aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVicent Marti2008-06-14 14:44:29 +0000
committerVicent Marti2008-06-14 14:44:29 +0000
commitd0b27cf9c66b9281899acf826cb205e19dcb7260 (patch)
tree74e813b1d1f081f35f41ca7a95da5d048951b9e7
parentd51a0cab3fe494698f001d81d5d86cea7cd0395b (diff)
parent91d3ea31359950b59ee46af8355cc0f5790257e5 (diff)
downloadscummvm-rg350-d0b27cf9c66b9281899acf826cb205e19dcb7260.tar.gz
scummvm-rg350-d0b27cf9c66b9281899acf826cb205e19dcb7260.tar.bz2
scummvm-rg350-d0b27cf9c66b9281899acf826cb205e19dcb7260.zip
Merged trunk into the GUI branch.
Fixed MSVS9 project files. svn-id: r32702
-rw-r--r--AUTHORS13
-rw-r--r--COPYING.LGPL504
-rw-r--r--Makefile2
-rw-r--r--Makefile.common3
-rw-r--r--NEWS2
-rw-r--r--README5
-rw-r--r--backends/fs/amigaos4/amigaos4-fs.cpp10
-rw-r--r--backends/fs/ds/ds-fs.cpp2
-rw-r--r--backends/fs/ds/ds-fs.h2
-rw-r--r--backends/fs/gp32/gp32-fs.cpp256
-rw-r--r--backends/fs/wii/wii-fs-factory.cpp (renamed from backends/platform/gp32/gp32_launcher.h)34
-rw-r--r--backends/fs/wii/wii-fs-factory.h (renamed from backends/fs/gp32/gp32-fs-factory.h)15
-rw-r--r--backends/fs/wii/wii-fs.cpp196
-rw-r--r--backends/midi/alsa.cpp92
-rw-r--r--backends/midi/camd.cpp51
-rw-r--r--backends/midi/coreaudio.cpp58
-rw-r--r--backends/midi/coremidi.cpp47
-rw-r--r--backends/midi/dmedia.cpp51
-rw-r--r--backends/midi/quicktime.cpp60
-rw-r--r--backends/midi/seq.cpp49
-rw-r--r--backends/midi/timidity.cpp47
-rw-r--r--backends/midi/windows.cpp55
-rw-r--r--backends/midi/ypa1.cpp49
-rw-r--r--backends/midi/zodiac.cpp49
-rw-r--r--backends/module.mk2
-rw-r--r--backends/platform/PalmOS/Src/be_base.cpp9
-rw-r--r--backends/platform/PalmOS/Src/be_base.h3
-rw-r--r--backends/platform/PalmOS/Src/be_save.cpp76
-rw-r--r--backends/platform/PalmOS/Src/extend.cpp2
-rw-r--r--backends/platform/PalmOS/Src/prefixes/native_kyra.h2
-rwxr-xr-xbackends/platform/PalmOS/Src/prefixes/native_m4.h7
-rwxr-xr-xbackends/platform/PalmOS/Src/prefixes/native_made.h7
-rw-r--r--backends/platform/PalmOS/Src/prefixes/native_sword1.h2
-rw-r--r--backends/platform/dc/selector.cpp4
-rw-r--r--backends/platform/ds/arm7/Makefile7
-rw-r--r--backends/platform/ds/arm7/source/main.cpp5
-rw-r--r--backends/platform/ds/arm9/buildkeyboard.bat4
-rw-r--r--backends/platform/ds/arm9/lib/readme.txt1
-rw-r--r--backends/platform/ds/arm9/makefile108
-rw-r--r--backends/platform/ds/arm9/source/adpcm_arm.s6
-rw-r--r--backends/platform/ds/arm9/source/blitters.cpp108
-rw-r--r--backends/platform/ds/arm9/source/blitters.h10
-rw-r--r--backends/platform/ds/arm9/source/blitters.s28
-rw-r--r--backends/platform/ds/arm9/source/blitters_arm.s15
-rw-r--r--backends/platform/ds/arm9/source/cdaudio.cpp172
-rw-r--r--backends/platform/ds/arm9/source/cdaudio.h2
-rw-r--r--backends/platform/ds/arm9/source/compressor/lz.h50
-rw-r--r--backends/platform/ds/arm9/source/console2.h4
-rw-r--r--backends/platform/ds/arm9/source/dsmain.cpp871
-rw-r--r--backends/platform/ds/arm9/source/dsmain.h104
-rw-r--r--backends/platform/ds/arm9/source/dsoptions.cpp103
-rw-r--r--backends/platform/ds/arm9/source/dsoptions.h10
-rw-r--r--backends/platform/ds/arm9/source/fat/disc_io.c68
-rw-r--r--backends/platform/ds/arm9/source/fat/disc_io.h8
-rw-r--r--backends/platform/ds/arm9/source/fat/gba_nds_fat.c526
-rw-r--r--backends/platform/ds/arm9/source/fat/gba_nds_fat.h30
-rw-r--r--backends/platform/ds/arm9/source/fat/io_dldi.h4
-rw-r--r--backends/platform/ds/arm9/source/fat/io_dldi.s16
-rw-r--r--backends/platform/ds/arm9/source/fat/io_efa2.c28
-rw-r--r--backends/platform/ds/arm9/source/fat/io_efa2.h28
-rw-r--r--backends/platform/ds/arm9/source/fat/io_fcsr.c16
-rw-r--r--backends/platform/ds/arm9/source/fat/io_fcsr.h4
-rw-r--r--backends/platform/ds/arm9/source/fat/io_m3_common.c10
-rw-r--r--backends/platform/ds/arm9/source/fat/io_m3_common.h6
-rw-r--r--backends/platform/ds/arm9/source/fat/io_m3cf.c54
-rw-r--r--backends/platform/ds/arm9/source/fat/io_m3cf.h4
-rw-r--r--backends/platform/ds/arm9/source/fat/io_m3sd.c4
-rw-r--r--backends/platform/ds/arm9/source/fat/io_m3sd_asm.s26
-rw-r--r--backends/platform/ds/arm9/source/fat/io_mmcf.c26
-rw-r--r--backends/platform/ds/arm9/source/fat/io_mmcf.h2
-rw-r--r--backends/platform/ds/arm9/source/fat/io_mpcf.c52
-rw-r--r--backends/platform/ds/arm9/source/fat/io_mpcf.h4
-rw-r--r--backends/platform/ds/arm9/source/fat/io_njsd.c84
-rw-r--r--backends/platform/ds/arm9/source/fat/io_njsd.h4
-rw-r--r--backends/platform/ds/arm9/source/fat/io_nmmc.c62
-rw-r--r--backends/platform/ds/arm9/source/fat/io_nmmc.h4
-rw-r--r--backends/platform/ds/arm9/source/fat/io_sccf.c2
-rw-r--r--backends/platform/ds/arm9/source/fat/io_sccf.h4
-rw-r--r--backends/platform/ds/arm9/source/fat/io_scsd.c10
-rw-r--r--backends/platform/ds/arm9/source/fat/io_scsd.h8
-rw-r--r--backends/platform/ds/arm9/source/fat/io_scsd_asm.s112
-rw-r--r--backends/platform/ds/arm9/source/fat/io_sd_common.c60
-rw-r--r--backends/platform/ds/arm9/source/fat/io_sd_common.h10
-rw-r--r--backends/platform/ds/arm9/source/gbampsave.cpp76
-rw-r--r--backends/platform/ds/arm9/source/gbampsave.h27
-rw-r--r--backends/platform/ds/arm9/source/keys.cpp16
-rw-r--r--backends/platform/ds/arm9/source/mad/readme.txt1
-rw-r--r--backends/platform/ds/arm9/source/osystem_ds.cpp270
-rw-r--r--backends/platform/ds/arm9/source/osystem_ds.h34
-rw-r--r--backends/platform/ds/arm9/source/portdefs.cpp2
-rw-r--r--backends/platform/ds/arm9/source/portdefs.h4
-rw-r--r--backends/platform/ds/arm9/source/ramsave.cpp98
-rw-r--r--backends/platform/ds/arm9/source/ramsave.h48
-rw-r--r--backends/platform/ds/arm9/source/scummconsole.c76
-rw-r--r--backends/platform/ds/arm9/source/scummconsole.h2
-rw-r--r--backends/platform/ds/arm9/source/scummhelp.cpp2
-rw-r--r--backends/platform/ds/arm9/source/scummhelp.h4
-rw-r--r--backends/platform/ds/arm9/source/touchkeyboard.cpp145
-rw-r--r--backends/platform/ds/arm9/source/touchkeyboard.h2
-rw-r--r--backends/platform/ds/arm9/source/wordcompletion.cpp16
-rw-r--r--backends/platform/ds/arm9/source/wordcompletion.h5
-rw-r--r--backends/platform/ds/arm9/source/zipreader.cpp66
-rw-r--r--backends/platform/ds/arm9/source/zipreader.h16
-rw-r--r--backends/platform/ds/makefile18
-rw-r--r--backends/platform/gp32/Makefile187
-rw-r--r--backends/platform/gp32/README.GP321
-rw-r--r--backends/platform/gp32/debug-gdbstub-usb.cpp1927
-rw-r--r--backends/platform/gp32/fontdata.c284
-rw-r--r--backends/platform/gp32/gfx_splash.h4870
-rw-r--r--backends/platform/gp32/gp32_launcher.cpp190
-rw-r--r--backends/platform/gp32/gp32_main.cpp93
-rw-r--r--backends/platform/gp32/gp32_osys.cpp792
-rw-r--r--backends/platform/gp32/gp32_osys.h155
-rw-r--r--backends/platform/gp32/gp32std.cpp336
-rw-r--r--backends/platform/gp32/gp32std.h61
-rw-r--r--backends/platform/gp32/gp32std_file.cpp320
-rw-r--r--backends/platform/gp32/gp32std_file.h61
-rw-r--r--backends/platform/gp32/gp32std_grap.cpp148
-rw-r--r--backends/platform/gp32/gp32std_grap.h47
-rw-r--r--backends/platform/gp32/gp32std_input.cpp210
-rw-r--r--backends/platform/gp32/gp32std_memory.cpp318
-rw-r--r--backends/platform/gp32/gp32std_memory.h35
-rw-r--r--backends/platform/gp32/gp32std_sound.cpp187
-rw-r--r--backends/platform/gp32/gp32std_sound.h48
-rw-r--r--backends/platform/gp32/gp_asmlib.s426
-rw-r--r--backends/platform/gp32/gp_clipped.c101
-rw-r--r--backends/platform/gp32/gpmad/readme.txt1
-rw-r--r--backends/platform/gp32/gptremor/readme.txt1
-rw-r--r--backends/platform/gp32/memcpy.S498
-rw-r--r--backends/platform/gp32/minilzo/readme.txt1
-rw-r--r--backends/platform/gp32/portdefs.h117
-rw-r--r--backends/platform/gp32/scummvm.bmpbin2104 -> 0 bytes
-rw-r--r--backends/platform/gp32/startup.c122
-rw-r--r--backends/platform/sdl/events.cpp2
-rw-r--r--backends/platform/sdl/sdl.cpp6
-rw-r--r--backends/platform/symbian/src/SymbianOS.cpp2
-rw-r--r--backends/platform/wii/Makefile156
-rw-r--r--backends/platform/wii/gecko_console.cpp91
-rw-r--r--backends/platform/wii/gecko_console.h14
-rw-r--r--backends/platform/wii/gx_supp.cpp264
-rw-r--r--backends/platform/wii/gx_supp.h39
-rw-r--r--backends/platform/wii/main.cpp107
-rw-r--r--backends/platform/wii/osystem.cpp190
-rw-r--r--backends/platform/wii/osystem.h176
-rw-r--r--backends/platform/wii/osystem_events.cpp271
-rw-r--r--backends/platform/wii/osystem_gfx.cpp453
-rw-r--r--backends/platform/wii/osystem_sfx.cpp133
-rw-r--r--backends/platform/wince/CELauncherDialog.cpp4
-rw-r--r--backends/plugins/dc/dc-provider.cpp10
-rw-r--r--backends/plugins/dc/dc-provider.h3
-rw-r--r--backends/plugins/dynamic-plugin.h4
-rw-r--r--backends/plugins/win32/win32-provider.cpp8
-rw-r--r--backends/plugins/win32/win32-provider.h3
-rw-r--r--base/commandLine.cpp27
-rw-r--r--base/game.cpp26
-rw-r--r--base/game.h11
-rw-r--r--base/main.cpp28
-rw-r--r--base/plugins.cpp231
-rw-r--r--base/plugins.h240
-rw-r--r--common/advancedDetector.cpp16
-rw-r--r--common/advancedDetector.h4
-rw-r--r--common/array.h8
-rw-r--r--common/file.cpp2
-rw-r--r--common/file.h6
-rw-r--r--common/hash-str.h14
-rw-r--r--common/hashmap.h1
-rw-r--r--common/module.mk1
-rw-r--r--common/rect.h2
-rw-r--r--common/scummsys.h8
-rw-r--r--common/system.cpp22
-rw-r--r--common/system.h10
-rw-r--r--common/unarj.cpp701
-rw-r--r--common/unarj.h185
-rw-r--r--common/util.cpp104
-rw-r--r--common/util.h6
-rwxr-xr-xconfigure109
-rw-r--r--dists/engine-data/drascula.datbin0 -> 213737 bytes
-rw-r--r--dists/engine-data/kyra.datbin230864 -> 236767 bytes
-rw-r--r--dists/msvc7/cruise.vcproj6
-rw-r--r--dists/msvc7/drascula.vcproj25
-rw-r--r--dists/msvc7/gob.vcproj80
-rw-r--r--dists/msvc7/kyra.vcproj63
-rw-r--r--dists/msvc7/made.vcproj14
-rw-r--r--dists/msvc7/parallaction.vcproj6
-rw-r--r--dists/msvc7/saga.vcproj17
-rw-r--r--dists/msvc7/scumm.vcproj4
-rw-r--r--dists/msvc7/scummvm.vcproj17
-rw-r--r--dists/msvc71/cruise.vcproj6
-rw-r--r--dists/msvc71/drascula.vcproj25
-rw-r--r--dists/msvc71/gob.vcproj80
-rw-r--r--dists/msvc71/kyra.vcproj63
-rw-r--r--dists/msvc71/made.vcproj14
-rw-r--r--dists/msvc71/parallaction.vcproj6
-rw-r--r--dists/msvc71/saga.vcproj17
-rw-r--r--dists/msvc71/scumm.vcproj4
-rw-r--r--dists/msvc71/scummvm.vcproj17
-rw-r--r--dists/msvc8/cruise.vcproj8
-rw-r--r--dists/msvc8/drascula.vcproj32
-rw-r--r--dists/msvc8/gob.vcproj104
-rw-r--r--dists/msvc8/kyra.vcproj64
-rw-r--r--dists/msvc8/made.vcproj14
-rw-r--r--dists/msvc8/parallaction.vcproj8
-rw-r--r--dists/msvc8/saga.vcproj20
-rw-r--r--dists/msvc8/scumm.vcproj4
-rw-r--r--dists/msvc8/scummvm.vcproj22
-rw-r--r--dists/msvc8_to_msvc7_71.bat1
-rw-r--r--dists/msvc9/cruise.vcproj8
-rw-r--r--dists/msvc9/drascula.vcproj32
-rw-r--r--dists/msvc9/gob.vcproj104
-rw-r--r--dists/msvc9/kyra.vcproj64
-rw-r--r--dists/msvc9/made.vcproj14
-rw-r--r--dists/msvc9/parallaction.vcproj8
-rw-r--r--dists/msvc9/saga.vcproj20
-rw-r--r--dists/msvc9/scummvm.vcproj20
-rw-r--r--dists/wii/READMII64
-rw-r--r--dists/wii/icon.pngbin0 -> 8505 bytes
-rw-r--r--dists/wii/meta.xml12
-rw-r--r--engines/agi/detection.cpp2
-rw-r--r--engines/agi/preagi_mickey.cpp8
-rw-r--r--engines/agos/agos.cpp44
-rw-r--r--engines/agos/agos.h1
-rw-r--r--engines/cine/anim.cpp7
-rw-r--r--engines/cine/bg.cpp96
-rw-r--r--engines/cine/bg.h15
-rw-r--r--engines/cine/bg_list.cpp60
-rw-r--r--engines/cine/bg_list.h4
-rw-r--r--engines/cine/cine.cpp12
-rw-r--r--engines/cine/cine.h2
-rw-r--r--engines/cine/gfx.cpp1404
-rw-r--r--engines/cine/gfx.h158
-rw-r--r--engines/cine/main_loop.cpp16
-rw-r--r--engines/cine/object.cpp28
-rw-r--r--engines/cine/pal.cpp62
-rw-r--r--engines/cine/pal.h8
-rw-r--r--engines/cine/part.cpp111
-rw-r--r--engines/cine/prc.cpp4
-rw-r--r--engines/cine/rel.cpp4
-rw-r--r--engines/cine/script.h7
-rw-r--r--engines/cine/script_fw.cpp119
-rw-r--r--engines/cine/script_os.cpp106
-rw-r--r--engines/cine/texte.cpp92
-rw-r--r--engines/cine/texte.h2
-rw-r--r--engines/cine/unpack.cpp162
-rw-r--r--engines/cine/unpack.h81
-rw-r--r--engines/cine/various.cpp833
-rw-r--r--engines/cine/various.h16
-rw-r--r--engines/cine/xref.txt37
-rw-r--r--engines/cruise/cruise_main.h1
-rw-r--r--engines/cruise/module.mk1
-rw-r--r--engines/cruise/stringSupport.cpp30
-rw-r--r--engines/cruise/stringSupport.h33
-rw-r--r--engines/drascula/actors.cpp462
-rw-r--r--engines/drascula/animation.cpp3764
-rw-r--r--engines/drascula/converse.cpp297
-rw-r--r--engines/drascula/detection.cpp177
-rw-r--r--engines/drascula/drascula.cpp4930
-rw-r--r--engines/drascula/drascula.h1197
-rw-r--r--engines/drascula/graphics.cpp687
-rw-r--r--engines/drascula/interface.cpp209
-rw-r--r--engines/drascula/module.mk11
-rw-r--r--engines/drascula/objects.cpp300
-rw-r--r--engines/drascula/palette.cpp202
-rw-r--r--engines/drascula/rooms.cpp3180
-rw-r--r--engines/drascula/saveload.cpp255
-rw-r--r--engines/drascula/sound.cpp159
-rw-r--r--engines/drascula/talk.cpp2435
-rw-r--r--engines/gob/coktelvideo.cpp39
-rw-r--r--engines/gob/coktelvideo.h20
-rw-r--r--engines/gob/dataio.cpp5
-rw-r--r--engines/gob/detection.cpp66
-rw-r--r--engines/gob/draw.cpp1
-rw-r--r--engines/gob/draw_v1.cpp6
-rw-r--r--engines/gob/draw_v2.cpp56
-rw-r--r--engines/gob/driver_vga.cpp20
-rw-r--r--engines/gob/game.cpp51
-rw-r--r--engines/gob/game.h13
-rw-r--r--engines/gob/game_v1.cpp25
-rw-r--r--engines/gob/game_v2.cpp39
-rw-r--r--engines/gob/global.cpp2
-rw-r--r--engines/gob/global.h64
-rw-r--r--engines/gob/gob.cpp96
-rw-r--r--engines/gob/gob.h97
-rw-r--r--engines/gob/goblin.cpp19
-rw-r--r--engines/gob/goblin.h2
-rw-r--r--engines/gob/goblin_v1.cpp13
-rw-r--r--engines/gob/goblin_v2.cpp2
-rw-r--r--engines/gob/goblin_v4.cpp1
-rw-r--r--engines/gob/init.cpp28
-rw-r--r--engines/gob/init_v1.cpp1
-rw-r--r--engines/gob/init_v2.cpp5
-rw-r--r--engines/gob/inter.cpp27
-rw-r--r--engines/gob/inter.h11
-rw-r--r--engines/gob/inter_bargon.cpp17
-rw-r--r--engines/gob/inter_v1.cpp104
-rw-r--r--engines/gob/inter_v2.cpp254
-rw-r--r--engines/gob/inter_v4.cpp120
-rw-r--r--engines/gob/map.cpp2
-rw-r--r--engines/gob/map_v1.cpp7
-rw-r--r--engines/gob/map_v2.cpp14
-rw-r--r--engines/gob/map_v4.cpp15
-rw-r--r--engines/gob/module.mk16
-rw-r--r--engines/gob/mult.cpp25
-rw-r--r--engines/gob/mult.h4
-rw-r--r--engines/gob/mult_v1.cpp1
-rw-r--r--engines/gob/mult_v2.cpp125
-rw-r--r--engines/gob/parse.cpp5
-rw-r--r--engines/gob/parse_v1.cpp7
-rw-r--r--engines/gob/parse_v2.cpp7
-rw-r--r--engines/gob/saveload.cpp917
-rw-r--r--engines/gob/saveload.h427
-rw-r--r--engines/gob/saveload_v2.cpp403
-rw-r--r--engines/gob/saveload_v3.cpp682
-rw-r--r--engines/gob/saveload_v4.cpp439
-rw-r--r--engines/gob/scenery.cpp185
-rw-r--r--engines/gob/scenery.h27
-rw-r--r--engines/gob/scenery_v1.cpp9
-rw-r--r--engines/gob/scenery_v2.cpp1
-rw-r--r--engines/gob/sound.cpp374
-rw-r--r--engines/gob/sound.h172
-rw-r--r--engines/gob/sound/adlib.cpp (renamed from engines/gob/music.cpp)130
-rw-r--r--engines/gob/sound/adlib.h (renamed from engines/gob/music.h)66
-rw-r--r--engines/gob/sound/bgatmosphere.cpp128
-rw-r--r--engines/gob/sound/bgatmosphere.h (renamed from backends/platform/gp32/gp32std_input.h)62
-rw-r--r--engines/gob/sound/cdrom.cpp (renamed from engines/gob/cdrom.cpp)128
-rw-r--r--engines/gob/sound/cdrom.h (renamed from engines/gob/cdrom.h)36
-rw-r--r--engines/gob/sound/infogrames.cpp103
-rw-r--r--engines/gob/sound/infogrames.h (renamed from backends/platform/gp32/globals.h)44
-rw-r--r--engines/gob/sound/pcspeaker.cpp55
-rw-r--r--engines/gob/sound/pcspeaker.h (renamed from backends/platform/PalmOS/Src/be_save.h)28
-rw-r--r--engines/gob/sound/sound.cpp582
-rw-r--r--engines/gob/sound/sound.h147
-rw-r--r--engines/gob/sound/soundblaster.cpp126
-rw-r--r--engines/gob/sound/soundblaster.h71
-rw-r--r--engines/gob/sound/sounddesc.cpp116
-rw-r--r--engines/gob/sound/sounddesc.h85
-rw-r--r--engines/gob/sound/soundmixer.cpp204
-rw-r--r--engines/gob/sound/soundmixer.h95
-rw-r--r--engines/gob/util.cpp5
-rw-r--r--engines/gob/variables.cpp311
-rw-r--r--engines/gob/variables.h147
-rw-r--r--engines/gob/video.cpp26
-rw-r--r--engines/gob/video.h12
-rw-r--r--engines/gob/video_v1.cpp1
-rw-r--r--engines/gob/video_v2.cpp1
-rw-r--r--engines/gob/videoplayer.cpp102
-rw-r--r--engines/gob/videoplayer.h6
-rw-r--r--engines/kyra/animator_hof.cpp10
-rw-r--r--engines/kyra/animator_lok.cpp (renamed from engines/kyra/animator_v1.cpp)124
-rw-r--r--engines/kyra/animator_lok.h (renamed from engines/kyra/animator_v1.h)14
-rw-r--r--engines/kyra/animator_mr.cpp52
-rw-r--r--engines/kyra/debugger.cpp30
-rw-r--r--engines/kyra/debugger.h14
-rw-r--r--engines/kyra/detection.cpp169
-rw-r--r--engines/kyra/gui.cpp18
-rw-r--r--engines/kyra/gui.h17
-rw-r--r--engines/kyra/gui_hof.cpp41
-rw-r--r--engines/kyra/gui_lok.cpp (renamed from engines/kyra/gui_v1.cpp)171
-rw-r--r--engines/kyra/gui_lok.h (renamed from engines/kyra/gui_v1.h)127
-rw-r--r--engines/kyra/gui_mr.cpp497
-rw-r--r--engines/kyra/gui_mr.h3
-rw-r--r--engines/kyra/gui_v2.cpp16
-rw-r--r--engines/kyra/gui_v2.h121
-rw-r--r--engines/kyra/items_hof.cpp2
-rw-r--r--engines/kyra/items_lok.cpp (renamed from engines/kyra/items_v1.cpp)134
-rw-r--r--engines/kyra/items_mr.cpp4
-rw-r--r--engines/kyra/items_v2.cpp4
-rw-r--r--engines/kyra/kyra.cpp393
-rw-r--r--engines/kyra/kyra.h268
-rw-r--r--engines/kyra/kyra_hof.cpp161
-rw-r--r--engines/kyra/kyra_hof.h144
-rw-r--r--engines/kyra/kyra_lok.cpp1044
-rw-r--r--engines/kyra/kyra_lok.h806
-rw-r--r--engines/kyra/kyra_mr.cpp126
-rw-r--r--engines/kyra/kyra_mr.h110
-rw-r--r--engines/kyra/kyra_v1.cpp1208
-rw-r--r--engines/kyra/kyra_v1.h973
-rw-r--r--engines/kyra/kyra_v2.cpp76
-rw-r--r--engines/kyra/kyra_v2.h48
-rw-r--r--engines/kyra/module.mk23
-rw-r--r--engines/kyra/resource.cpp808
-rw-r--r--engines/kyra/resource.h178
-rw-r--r--engines/kyra/saveload.cpp25
-rw-r--r--engines/kyra/saveload_lok.cpp (renamed from engines/kyra/saveload_v1.cpp)14
-rw-r--r--engines/kyra/saveload_mr.cpp99
-rw-r--r--engines/kyra/scene.cpp383
-rw-r--r--engines/kyra/scene_hof.cpp6
-rw-r--r--engines/kyra/scene_lok.cpp1284
-rw-r--r--engines/kyra/scene_mr.cpp10
-rw-r--r--engines/kyra/scene_v1.cpp1449
-rw-r--r--engines/kyra/scene_v2.cpp7
-rw-r--r--engines/kyra/screen.cpp73
-rw-r--r--engines/kyra/screen.h6
-rw-r--r--engines/kyra/screen_hof.cpp129
-rw-r--r--engines/kyra/screen_hof.h5
-rw-r--r--engines/kyra/screen_lok.cpp (renamed from engines/kyra/screen_v1.cpp)74
-rw-r--r--engines/kyra/screen_lok.h (renamed from engines/kyra/screen_v1.h)14
-rw-r--r--engines/kyra/screen_v2.cpp128
-rw-r--r--engines/kyra/screen_v2.h8
-rw-r--r--engines/kyra/script.cpp10
-rw-r--r--engines/kyra/script.h7
-rw-r--r--engines/kyra/script_hof.cpp115
-rw-r--r--engines/kyra/script_lok.cpp1987
-rw-r--r--engines/kyra/script_mr.cpp55
-rw-r--r--engines/kyra/script_tim.cpp35
-rw-r--r--engines/kyra/script_tim.h13
-rw-r--r--engines/kyra/script_v1.cpp1971
-rw-r--r--engines/kyra/script_v2.cpp68
-rw-r--r--engines/kyra/seqplayer.cpp10
-rw-r--r--engines/kyra/seqplayer.h6
-rw-r--r--engines/kyra/sequences_hof.cpp323
-rw-r--r--engines/kyra/sequences_lok.cpp (renamed from engines/kyra/sequences_v1.cpp)162
-rw-r--r--engines/kyra/sequences_mr.cpp2
-rw-r--r--engines/kyra/sequences_v2.cpp15
-rw-r--r--engines/kyra/sound.cpp80
-rw-r--r--engines/kyra/sound.h69
-rw-r--r--engines/kyra/sound_adlib.cpp10
-rw-r--r--engines/kyra/sound_digital.cpp179
-rw-r--r--engines/kyra/sound_lok.cpp (renamed from engines/kyra/sound_v1.cpp)31
-rw-r--r--engines/kyra/sound_towns.cpp52
-rw-r--r--engines/kyra/sprites.cpp18
-rw-r--r--engines/kyra/sprites.h8
-rw-r--r--engines/kyra/staticres.cpp992
-rw-r--r--engines/kyra/text.cpp6
-rw-r--r--engines/kyra/text.h6
-rw-r--r--engines/kyra/text_hof.cpp7
-rw-r--r--engines/kyra/text_hof.h4
-rw-r--r--engines/kyra/text_lok.cpp (renamed from engines/kyra/text_v1.cpp)42
-rw-r--r--engines/kyra/text_mr.cpp149
-rw-r--r--engines/kyra/timer.cpp53
-rw-r--r--engines/kyra/timer.h19
-rw-r--r--engines/kyra/timer_lok.cpp (renamed from engines/kyra/timer_v1.cpp)54
-rw-r--r--engines/kyra/timer_mr.cpp20
-rw-r--r--engines/kyra/vqa.cpp24
-rw-r--r--engines/kyra/vqa.h6
-rw-r--r--engines/kyra/wsamovie.cpp52
-rw-r--r--engines/kyra/wsamovie.h20
-rw-r--r--engines/lure/game.cpp3
-rw-r--r--engines/lure/lure.cpp10
-rw-r--r--engines/lure/lure.h1
-rw-r--r--engines/lure/res.cpp2
-rw-r--r--engines/lure/res_struct.cpp25
-rw-r--r--engines/m4/converse.cpp2
-rw-r--r--engines/m4/converse.h2
-rw-r--r--engines/m4/font.cpp2
-rw-r--r--engines/m4/m4.cpp6
-rw-r--r--engines/m4/script.h3
-rw-r--r--engines/made/database.cpp608
-rw-r--r--engines/made/database.h122
-rw-r--r--engines/made/detection.cpp116
-rw-r--r--engines/made/graphics.cpp144
-rw-r--r--engines/made/graphics.h13
-rw-r--r--engines/made/made.cpp121
-rw-r--r--engines/made/made.h29
-rw-r--r--engines/made/module.mk5
-rw-r--r--engines/made/pmvplayer.cpp72
-rw-r--r--engines/made/resource.cpp34
-rw-r--r--engines/made/resource.h11
-rw-r--r--engines/made/screen.cpp315
-rw-r--r--engines/made/screen.h94
-rw-r--r--engines/made/screenfx.cpp356
-rw-r--r--engines/made/screenfx.h70
-rw-r--r--engines/made/script.cpp366
-rw-r--r--engines/made/script.h10
-rw-r--r--engines/made/scriptfuncs.cpp770
-rw-r--r--engines/made/scriptfuncs.h359
-rw-r--r--engines/made/scriptfuncs_lgop2.cpp467
-rw-r--r--engines/made/scriptfuncs_mhne.cpp494
-rw-r--r--engines/made/scriptfuncs_rtz.cpp864
-rw-r--r--engines/metaengine.h21
-rw-r--r--engines/parallaction/callables_ns.cpp26
-rw-r--r--engines/parallaction/debug.cpp10
-rw-r--r--engines/parallaction/dialogue.cpp16
-rw-r--r--engines/parallaction/disk.h2
-rw-r--r--engines/parallaction/disk_br.cpp27
-rw-r--r--engines/parallaction/exec_br.cpp187
-rw-r--r--engines/parallaction/exec_ns.cpp119
-rw-r--r--engines/parallaction/font.cpp2
-rw-r--r--engines/parallaction/graphics.cpp9
-rw-r--r--engines/parallaction/graphics.h3
-rw-r--r--engines/parallaction/gui_br.cpp15
-rw-r--r--engines/parallaction/gui_ns.cpp42
-rw-r--r--engines/parallaction/input.cpp332
-rw-r--r--engines/parallaction/input.h114
-rw-r--r--engines/parallaction/inventory.cpp23
-rw-r--r--engines/parallaction/module.mk1
-rw-r--r--engines/parallaction/objects.cpp10
-rw-r--r--engines/parallaction/objects.h5
-rw-r--r--engines/parallaction/parallaction.cpp517
-rw-r--r--engines/parallaction/parallaction.h300
-rw-r--r--engines/parallaction/parallaction_br.cpp59
-rw-r--r--engines/parallaction/parallaction_ns.cpp62
-rw-r--r--engines/parallaction/parser.cpp14
-rw-r--r--engines/parallaction/parser.h336
-rw-r--r--engines/parallaction/parser_br.cpp888
-rw-r--r--engines/parallaction/parser_ns.cpp967
-rw-r--r--engines/parallaction/staticres.cpp361
-rw-r--r--engines/saga/actor.cpp3
-rw-r--r--engines/saga/actor_walk.cpp5
-rw-r--r--engines/saga/detection.cpp8
-rw-r--r--engines/saga/detection_tables.h138
-rw-r--r--engines/saga/gfx.cpp4
-rw-r--r--engines/saga/interface.cpp28
-rw-r--r--engines/saga/interface.h9
-rw-r--r--engines/saga/introproc_ihnm.cpp (renamed from engines/saga/ihnm_introproc.cpp)0
-rw-r--r--engines/saga/introproc_ite.cpp (renamed from engines/saga/ite_introproc.cpp)108
-rw-r--r--engines/saga/isomap.cpp9
-rw-r--r--engines/saga/isomap.h2
-rw-r--r--engines/saga/itedata.cpp149
-rw-r--r--engines/saga/module.mk4
-rw-r--r--engines/saga/music.cpp20
-rw-r--r--engines/saga/palanim.cpp21
-rw-r--r--engines/saga/puzzle.cpp25
-rw-r--r--engines/saga/rscfile.cpp8
-rw-r--r--engines/saga/saga.cpp35
-rw-r--r--engines/saga/saga.h26
-rw-r--r--engines/saga/sagaresnames.h274
-rw-r--r--engines/saga/saveload.cpp1
-rw-r--r--engines/saga/scene.cpp1
-rw-r--r--engines/saga/scene.h14
-rw-r--r--engines/saga/sfuncs.cpp1
-rw-r--r--engines/saga/sndres.cpp16
-rw-r--r--engines/saga/sprite.cpp6
-rw-r--r--engines/saga/sthread.cpp8
-rw-r--r--engines/scumm/charset.cpp5
-rw-r--r--engines/scumm/debugger.cpp28
-rw-r--r--engines/scumm/detection_tables.h21
-rw-r--r--engines/scumm/dialogs.cpp4
-rw-r--r--engines/scumm/nut_renderer.cpp10
-rw-r--r--engines/scumm/saveload.cpp4
-rw-r--r--engines/scumm/script_v6.cpp4
-rw-r--r--engines/scumm/scumm-md5.h10
-rw-r--r--engines/scumm/scumm.cpp6
-rw-r--r--engines/scumm/scumm.h1
-rw-r--r--engines/scumm/smush/channel.cpp6
-rw-r--r--engines/scumm/smush/codec37.cpp2
-rw-r--r--engines/scumm/smush/imuse_channel.cpp6
-rw-r--r--engines/scumm/smush/saud_channel.cpp2
-rw-r--r--engines/scumm/smush/smush_player.cpp4
-rw-r--r--engines/scumm/string.cpp31
-rw-r--r--engines/scumm/verbs.cpp4
-rw-r--r--engines/sky/sky.cpp1
-rw-r--r--engines/sword1/control.cpp2
-rw-r--r--engines/sword2/header.h18
-rw-r--r--engines/sword2/mouse.cpp24
-rw-r--r--engines/sword2/mouse.h3
-rw-r--r--engines/sword2/object.h12
-rw-r--r--engines/sword2/palette.cpp35
-rw-r--r--engines/sword2/resman.cpp6
-rw-r--r--engines/sword2/screen.cpp2
-rw-r--r--engines/sword2/screen.h7
-rw-r--r--engines/sword2/sword2.cpp67
-rw-r--r--engines/sword2/sword2.h4
-rw-r--r--graphics/cursorman.h4
-rw-r--r--graphics/fontman.h2
-rw-r--r--graphics/imageman.cpp2
-rw-r--r--gui/ListWidget.cpp2
-rw-r--r--gui/ThemeModern.cpp8
-rw-r--r--gui/about.cpp8
-rw-r--r--gui/console.cpp2
-rw-r--r--gui/credits.h3
-rw-r--r--gui/debugger.cpp6
-rw-r--r--gui/eval.cpp2
-rw-r--r--gui/eval.h6
-rw-r--r--gui/launcher.cpp28
-rw-r--r--gui/launcher.h1
-rw-r--r--gui/massadd.cpp63
-rw-r--r--gui/massadd.h10
-rw-r--r--gui/newgui.cpp3
-rw-r--r--gui/options.cpp35
-rw-r--r--gui/options.h3
-rw-r--r--gui/theme-config.cpp3
-rw-r--r--gui/theme.cpp8
-rw-r--r--gui/themes/classic080.ini3
-rw-r--r--gui/themes/modern.ini3
-rw-r--r--sound/audiostream.cpp30
-rw-r--r--sound/audiostream.h14
-rw-r--r--sound/flac.cpp26
-rw-r--r--sound/fmopl.h4
-rw-r--r--sound/mididrv.cpp24
-rw-r--r--sound/mididrv.h28
-rw-r--r--sound/mixer.h10
-rw-r--r--sound/module.mk1
-rw-r--r--sound/mp3.cpp70
-rw-r--r--sound/musicplugin.cpp (renamed from backends/fs/gp32/gp32-fs-factory.cpp)36
-rw-r--r--sound/musicplugin.h127
-rw-r--r--sound/null.cpp48
-rw-r--r--sound/softsynth/adlib.cpp49
-rw-r--r--sound/softsynth/fluidsynth.cpp49
-rw-r--r--sound/softsynth/mt32.cpp48
-rw-r--r--sound/softsynth/mt32/mt32emu.h2
-rw-r--r--sound/softsynth/ym2612.cpp58
-rw-r--r--sound/vorbis.cpp13
-rw-r--r--test/common/hashmap.h3
-rw-r--r--test/cxxtest/sample/CreatedTest.h2
-rw-r--r--test/cxxtest/sample/FixtureTest.h2
-rw-r--r--tools/create_drascula/Makefile4
-rw-r--r--tools/create_drascula/create_drascula.cpp527
-rw-r--r--tools/create_drascula/create_drascula.h97
-rw-r--r--tools/create_drascula/dists/msvc8/create_drascula.sln20
-rw-r--r--tools/create_drascula/dists/msvc8/create_drascula.vcproj191
-rw-r--r--tools/create_drascula/dists/msvc8_to_msvc9.bat32
-rw-r--r--tools/create_drascula/dists/msvc9/create_drascula.sln20
-rw-r--r--tools/create_drascula/dists/msvc9/create_drascula.vcproj192
-rw-r--r--tools/create_drascula/dists/msvc9_to_msvc8.bat33
-rw-r--r--tools/create_drascula/module.mk13
-rw-r--r--tools/create_drascula/staticdata.h (renamed from engines/drascula/texts.cpp)2165
-rw-r--r--tools/create_kyradat/create_kyradat.cpp214
-rw-r--r--tools/create_kyradat/create_kyradat.h18
-rw-r--r--tools/create_kyradat/hof_towns.h2
-rw-r--r--tools/create_kyradat/ita.h39
-rw-r--r--tools/create_kyradat/malcolm.h17
-rw-r--r--tools/create_kyradat/misc.h16
-rw-r--r--tools/create_kyradat/pak.cpp2
-rw-r--r--tools/create_kyradat/pak.h4
-rwxr-xr-xtools/credits.pl4
-rw-r--r--tools/scumm-md5.txt14
616 files changed, 42137 insertions, 43496 deletions
diff --git a/AUTHORS b/AUTHORS
index 7ebe8f1af7..2491f481a2 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -81,14 +81,14 @@ ScummVM Team
Paul Gilbert
M4:
- Torbjorn Andersson
+ Torbjorn Andersson
Paul Gilbert
- Benjamin Haisch
- Filippos Karapetis
+ Benjamin Haisch
+ Filippos Karapetis
MADE:
- Benjamin Haisch
-
+ Benjamin Haisch
+
Parallaction:
peres
@@ -139,6 +139,9 @@ ScummVM Team
Jurgen Braam
Lars Persson
+ Wii:
+ Andre Heider
+
Other subsystems
----------------
Infrastructure:
diff --git a/COPYING.LGPL b/COPYING.LGPL
new file mode 100644
index 0000000000..00b4fedfe7
--- /dev/null
+++ b/COPYING.LGPL
@@ -0,0 +1,504 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL. It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it. You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+ When we speak of free software, we are referring to freedom of use,
+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 and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+ To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights. These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ To protect each distributor, we want to make it very clear that
+there is no warranty for the free library. Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+ Finally, software patents pose a constant threat to the existence of
+any free program. We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder. Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+ Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License. This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License. We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+ When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library. The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom. The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+ We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License. It also provides other free software developers Less
+of an advantage over competing non-free programs. These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries. However, the Lesser license provides advantages in certain
+special circumstances.
+
+ For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard. To achieve this, non-free programs must be
+allowed to use the library. A more frequent case is that a free
+library does the same job as widely used non-free libraries. In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+ In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software. For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+ Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+ GNU LESSER GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, 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 library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete 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 distribute a copy of this License along with the
+Library.
+
+ 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 Library or any portion
+of it, thus forming a work based on the Library, 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) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+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 Library, 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 Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you 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.
+
+ If distribution of 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 satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+ 6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (1) uses at run time a
+ copy of the library already present on the user's computer system,
+ rather than copying library functions into the executable, and (2)
+ will operate properly with a modified version of the library, if
+ the user installs one, as long as the modified version is
+ interface-compatible with the version that the work was made with.
+
+ c) Accompany the work with a written offer, valid for at
+ least three years, to give the same user the materials
+ specified in Subsection 6a, above, for a charge no more
+ than the cost of performing this distribution.
+
+ d) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ e) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the materials to be 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.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+ 7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library 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.
+
+ 9. 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 Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+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 with
+this License.
+
+ 11. 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 Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library 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 Library.
+
+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.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library 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.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser 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 Library
+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 Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+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
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "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
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. 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 LIBRARY 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
+LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), 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 Libraries
+
+ If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change. You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+ To apply these terms, attach the following notices to the library. 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.
+
+ <one line to give the library's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+ <signature of Ty Coon>, 1 April 1990
+ Ty Coon, President of Vice
+
+That's all there is to it!
+
+
diff --git a/Makefile b/Makefile
index d230120bb0..506265032a 100644
--- a/Makefile
+++ b/Makefile
@@ -24,7 +24,7 @@ CXXFLAGS:= -Wall $(CXXFLAGS)
# Turn off some annoying and not-so-useful warnings
CXXFLAGS+= -Wno-long-long -Wno-multichar -Wno-unknown-pragmas -Wno-reorder
# Enable even more warnings...
-CXXFLAGS+= -pedantic -Wpointer-arith -Wcast-qual -Wcast-align -Wconversion
+CXXFLAGS+= -pedantic -Wpointer-arith -Wcast-qual -Wcast-align
CXXFLAGS+= -Wshadow -Wimplicit -Wundef -Wnon-virtual-dtor -Wwrite-strings
# Disable RTTI and exceptions, and enabled checking of pointers returned by "new"
diff --git a/Makefile.common b/Makefile.common
index 5a443644f2..c2704f2219 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -182,6 +182,9 @@ DIST_FILES_THEMES:=$(addprefix $(srcdir)/gui/themes/,modern.ini modern.zip class
# Engine data files
DIST_FILES_ENGINEDATA=
+ifdef ENABLE_DRASCULA
+DIST_FILES_ENGINEDATA+=drascula.dat
+endif
ifdef ENABLE_IGOR
DIST_FILES_ENGINEDATA+=igor.tbl
endif
diff --git a/NEWS b/NEWS
index ab83f09c3b..6a3a59a49b 100644
--- a/NEWS
+++ b/NEWS
@@ -4,7 +4,9 @@ For a more comprehensive changelog for the latest experimental SVN code, see:
0.12.0 (????-??-??)
New Games:
- Added support for The Legend of Kyrandia: Book Two: Hand of Fate
+ - Added support for The Legend of Kyrandia: Book Three: Malcolm's Revenge
- Added support for Lost in Time
+ - Added support for The Bizarre Adventures of Woodruff and the Schnibble
- Added support for the PC version of Waxworks
- Added support for the Macintosh version of I Have no Mouth, and I
must Scream
diff --git a/README b/README
index b12ac83ce4..ac44f53cab 100644
--- a/README
+++ b/README
@@ -245,7 +245,8 @@ site and view the compatibility chart.
Backyard Baseball [baseball]
Backyard Soccer [soccer]
- Blue's ABC Time [BluesABCTime]
+ Blue's 123 Time Activities [Blues123Time]
+ Blue's ABC Time Activities [BluesABCTime]
Blue's Birthday Adventure [BluesBirthday]
SPY Fox 3: Operation Ozone [spyozon]
@@ -1793,7 +1794,7 @@ messages (see http://www.sysinternals.com/ntw2k/freeware/debugview.shtml).
* To get a version you can run from Finder, type 'make bundle' which
will create ScummVM.app (this only works out of the box if you
installed SDL into /sw (as happens if you are using Fink). If you
- have installed SDL in another way, you will have to edit the Makefile).
+ have installed SDL in another way, you will have to edit ports.mk).
* For more information refer to:
http://wiki.scummvm.org/index.php/Compiling_ScummVM/MacOS_X_Crosscompiling
diff --git a/backends/fs/amigaos4/amigaos4-fs.cpp b/backends/fs/amigaos4/amigaos4-fs.cpp
index 3f4ba18a30..5bf57ddf34 100644
--- a/backends/fs/amigaos4/amigaos4-fs.cpp
+++ b/backends/fs/amigaos4/amigaos4-fs.cpp
@@ -209,7 +209,7 @@ AmigaOSFilesystemNode::AmigaOSFilesystemNode(BPTR pLock, const char *pDisplayNam
if (IDOS->NameFromLock(pLock, (STRPTR)n, bufSize) != DOSFALSE) {
_sPath = n;
_sDisplayName = pDisplayName ? pDisplayName : IDOS->FilePart((STRPTR)n);
- delete [] n;
+ delete[] n;
break;
}
@@ -217,12 +217,12 @@ AmigaOSFilesystemNode::AmigaOSFilesystemNode(BPTR pLock, const char *pDisplayNam
_bIsValid = false;
debug(6, "IoErr() != ERROR_LINE_TOO_LONG");
LEAVE();
- delete [] n;
+ delete[] n;
return;
}
bufSize *= 2;
- delete [] n;
+ delete[] n;
}
_bIsValid = false;
@@ -536,7 +536,7 @@ AbstractFSList AmigaOSFilesystemNode::listVolumes() const {
sprintf(buffer, "%s (%s)", volName, devName);
- delete [] devName;
+ delete[] devName;
AmigaOSFilesystemNode *entry = new AmigaOSFilesystemNode(volumeLock, buffer);
if (entry) {
@@ -554,7 +554,7 @@ AbstractFSList AmigaOSFilesystemNode::listVolumes() const {
IDOS->UnLock(volumeLock);
}
- delete [] volName;
+ delete[] volName;
}
dosList = IDOS->NextDosEntry(dosList, LDF_VOLUMES);
}
diff --git a/backends/fs/ds/ds-fs.cpp b/backends/fs/ds/ds-fs.cpp
index 79b957f2e2..cffe4c118d 100644
--- a/backends/fs/ds/ds-fs.cpp
+++ b/backends/fs/ds/ds-fs.cpp
@@ -25,7 +25,7 @@
//#include <NDS/ARM9/console.h> //basic print funcionality
#include "backends/fs/ds/ds-fs.h"
#include "dsmain.h"
-#include "gba_nds_fat.h"
+#include "fat/gba_nds_fat.h"
diff --git a/backends/fs/ds/ds-fs.h b/backends/fs/ds/ds-fs.h
index 21dfa00667..9ac453aca9 100644
--- a/backends/fs/ds/ds-fs.h
+++ b/backends/fs/ds/ds-fs.h
@@ -28,7 +28,7 @@
#include "zipreader.h"
#include "ramsave.h"
#include "scummconsole.h"
-#include "gba_nds_fat.h"
+#include "fat/gba_nds_fat.h"
#include "backends/fs/abstract-fs.h"
namespace DS {
diff --git a/backends/fs/gp32/gp32-fs.cpp b/backends/fs/gp32/gp32-fs.cpp
deleted file mode 100644
index 06830c13f5..0000000000
--- a/backends/fs/gp32/gp32-fs.cpp
+++ /dev/null
@@ -1,256 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- *
- */
-
-#include "backends/fs/abstract-fs.h"
-
-#define MAX_PATH_SIZE 256
-
-/**
- * Implementation of the ScummVM file system API.
- *
- * Parts of this class are documented in the base interface class, AbstractFilesystemNode.
- */
-class GP32FilesystemNode : public AbstractFilesystemNode {
-protected:
- String _displayName;
- String _path;
- bool _isDirectory;
- bool _isRoot;
-
-public:
- /**
- * Creates a GP32FilesystemNode with the root node as path.
- */
- GP32FilesystemNode();
-
- /**
- * Creates a GP32FilesystemNode for a given path.
- *
- * @param path String with the path the new node should point to.
- */
- GP32FilesystemNode(const String &path);
-
- virtual bool exists() const { return true; } //FIXME: this is just a stub
- virtual String getDisplayName() const { return _displayName; }
- virtual String getName() const { return _displayName; }
- virtual String getPath() const { return _path; }
- virtual bool isDirectory() const { return _isDirectory; }
- // FIXME: isValid should return false if this Node can't be used!
- // so client code can rely on the return value.
- virtual bool isReadable() const { return true; } //FIXME: this is just a stub
- virtual bool isWritable() const { return true; } //FIXME: this is just a stub
-
- virtual AbstractFilesystemNode *getChild(const String &n) const;
- virtual bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const;
- virtual AbstractFilesystemNode *getParent() const;
-};
-
-const char gpRootPath[] = "gp:\\";
-//char gpCurrentPath[MAX_PATH_SIZE] = "gp:\\"; // must end with '\'
-
-/**
- * Returns the last component of a given path.
- *
- * Examples:
- * gp:\foo\bar.txt would return "\bar.txt"
- * gp:\foo\bar\ would return "\bar\"
- *
- * @param str Path to obtain the last component from.
- * @return Pointer to the first char of the last component inside str.
- */
-const char *lastPathComponent(const Common::String &str) {
- if(str.empty())
- return "";
-
- const char *start = str.c_str();
- const char *cur = start + str.size() - 2;
-
- while (cur >= start && *cur != '\\') {
- --cur;
- }
-
- return cur + 1;
-}
-
-/**
- * FIXME: document this function.
- *
- * @param path
- * @param convPath
- */
-int gpMakePath(const char *path, char *convPath) {
- // copy root or current directory
- const char *p;
- if ((*path == '/') || (*path == '\\')) {
- path++;
- p = gpRootPath;
- while (*p)
- *convPath++ = *p++;
- }// else
- // p = gpCurrentPath;
-
- //while (*p)
- // *convPath++ = *p++;
-
- // add filenames/directories. remove "." & "..", replace "/" with "\"
- do {
- switch (*path) {
- case 0:
- case '/':
- case '\\':
- if (*(convPath - 1) == '\\') {
- // already ends with '\'
- } else if ((*(convPath - 2) == '\\') && (*(convPath - 1) == '.')) {
- convPath--; // remove '.' and end with '\'
- } else if ((*(convPath - 3) == '\\') && (*(convPath - 2) == '.') && (*(convPath - 1) == '.')) {
- convPath -= 3; // remove "\.."
- if (*(convPath - 1) == ':')
- *convPath++ = '\\'; // "gp:" -> "gp:\"
- else
- while (*(convPath - 1) != '\\')
- convPath--; // remove one directory and end with '\'
- } else {
- *convPath++ = '\\'; // just add '\'
- }
- break;
-
- default:
- *convPath++ = *path;
- break;
- }
- } while (*path++);
-
- *convPath = '\\';
-
- // *--convPath = 0; // remove last '\' and null-terminate
- *convPath = 0; // remove last '\' and null-terminate
-
- return 0;
-}
-
-GP32FilesystemNode::GP32FilesystemNode() {
- _isDirectory = true;
- _isRoot = true;
- _displayName = "GP32 Root";
- _path = "gp:\\";
-}
-
-GP32FilesystemNode::GP32FilesystemNode(const String &path) {
- const char *dsplName = NULL, *pos = NULL;
- char convPath[256];
-
- gpMakePath(path.c_str(), convPath);
-
- _path = convPath;
- pos = convPath;
-
- while (*pos)
- if (*pos++ == '\\')
- dsplName = pos;
-
- BP("FS: path name: %s", path.c_str());
-
- if (strcmp(path.c_str(), "gp:\\") == 0) {
- _isRoot = true;
- _displayName = "GP32 Root";
- } else {
- _isRoot = false;
- _displayName = String(dsplName);
- }
- _isDirectory = true;
-}
-
-AbstractFilesystemNode *GP32FilesystemNode::getChild(const String &n) const {
- // FIXME: Pretty lame implementation! We do no error checking to speak
- // of, do not check if this is a special node, etc.
- assert(_isDirectory);
-
- String newPath(_path);
- if (_path.lastChar() != '\\')
- newPath += '\\';
- newPath += n;
-
- return new GP32FilesystemNode(newPath);
-}
-
-bool GP32FilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, bool hidden) const {
- assert(_isDirectory);
-
- //TODO: honor the hidden flag
-
- GPDIRENTRY dirEntry;
- GPFILEATTR attr;
- GP32FilesystemNode entry;
- uint32 read;
-
- if (mode == FilesystemNode::kListAll)
- LP("listDir(kListAll)");
- else
- LP("listDir(kListDirectoriesOnly)");
-
- int startIdx = 0; // current file
- String listDir(_path);
- //listDir += "/";
-
- while (GpDirEnumList(listDir.c_str(), startIdx++, 1, &dirEntry, &read) == SM_OK) {
-da if (dirEntry.name[0] == '.')
- continue;
-
- entry._displayName = dirEntry.name;
- entry._path = _path;
- entry._path += dirEntry.name;
- entry._isRoot = false;
-
- GpFileAttr(entry._path.c_str(), &attr);
- entry._isDirectory = attr.attr & (1 << 4);
-
- // Honor the chosen mode
- if ((mode == FilesystemNode::kListFilesOnly && entry._isDirectory) ||
- (mode == FilesystemNode::kListDirectoriesOnly && !entry._isDirectory))
- continue;
-
- if (entry._isDirectory)
- entry._path += "\\";
- myList.push_back(new GP32FilesystemNode(entry));
- }
-
- BP("Dir... %s", listDir.c_str());
-
- return true;
-}
-
-AbstractFilesystemNode *GP32FilesystemNode::getParent() const {
- if (_isRoot)
- return 0;
-
- const char *start = _path.c_str();
- const char *end = lastPathComponent(_path);
-
- GP32FilesystemNode *p = new GP32FilesystemNode(String(start, end - start));
-
- NP("%s", p->_path.c_str());
-
- return p;
-}
diff --git a/backends/platform/gp32/gp32_launcher.h b/backends/fs/wii/wii-fs-factory.cpp
index fee9e9b60e..9839858dd5 100644
--- a/backends/platform/gp32/gp32_launcher.h
+++ b/backends/fs/wii/wii-fs-factory.cpp
@@ -8,28 +8,42 @@
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * $URL$
- * $Id$
- *
*/
-#ifndef __GP32_LAUNCHER_H
-#define __GP32_LAUNCHER_H
+#if defined(__WII__)
-#include "common/scummsys.h"
+#include <unistd.h>
-extern void readConfigVars();
+#include "backends/fs/wii/wii-fs-factory.h"
+#include "backends/fs/wii/wii-fs.cpp"
-extern void splashScreen();
+DECLARE_SINGLETON(WiiFilesystemFactory);
+AbstractFilesystemNode *WiiFilesystemFactory::makeRootFileNode() const {
+ return new WiiFilesystemNode();
+}
+
+AbstractFilesystemNode *WiiFilesystemFactory::makeCurrentDirectoryFileNode() const {
+ char buf[MAXPATHLEN];
+
+ if (getcwd(buf, MAXPATHLEN))
+ return new WiiFilesystemNode(buf, true);
+ else
+ return new WiiFilesystemNode();
+}
+
+AbstractFilesystemNode *WiiFilesystemFactory::makeFileNodePath(const String &path) const {
+ return new WiiFilesystemNode(path, true);
+}
#endif
+
diff --git a/backends/fs/gp32/gp32-fs-factory.h b/backends/fs/wii/wii-fs-factory.h
index 7e6cb595ca..24badee330 100644
--- a/backends/fs/gp32/gp32-fs-factory.h
+++ b/backends/fs/wii/wii-fs-factory.h
@@ -18,22 +18,20 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * $URL$
- * $Id$
*/
-#ifndef GP32_FILESYSTEM_FACTORY_H
-#define GP32_FILESYSTEM_FACTORY_H
+#ifndef _WII_FILESYSTEM_FACTORY_H_
+#define _WII_FILESYSTEM_FACTORY_H_
#include "common/singleton.h"
#include "backends/fs/fs-factory.h"
/**
- * Creates GP32FilesystemNode objects.
+ * Creates WiiFilesystemNode objects.
*
* Parts of this class are documented in the base interface class, FilesystemFactory.
*/
-class GP32FilesystemFactory : public FilesystemFactory, public Common::Singleton<GP32FilesystemFactory> {
+class WiiFilesystemFactory : public FilesystemFactory, public Common::Singleton<WiiFilesystemFactory> {
public:
typedef Common::String String;
@@ -42,10 +40,11 @@ public:
virtual AbstractFilesystemNode *makeFileNodePath(const String &path) const;
protected:
- GP32FilesystemFactory() {};
+ WiiFilesystemFactory() {};
private:
friend class Common::Singleton<SingletonBaseType>;
};
-#endif /*GP32_FILESYSTEM_FACTORY_H*/
+#endif /*Wii_FILESYSTEM_FACTORY_H*/
+
diff --git a/backends/fs/wii/wii-fs.cpp b/backends/fs/wii/wii-fs.cpp
new file mode 100644
index 0000000000..e6d0cf4c7e
--- /dev/null
+++ b/backends/fs/wii/wii-fs.cpp
@@ -0,0 +1,196 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#if defined(__WII__)
+
+#include "backends/fs/abstract-fs.h"
+
+#include <sys/dir.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+/**
+ * Implementation of the ScummVM file system API based on Wii.
+ *
+ * Parts of this class are documented in the base interface class, AbstractFilesystemNode.
+ */
+class WiiFilesystemNode : public AbstractFilesystemNode {
+protected:
+ String _displayName;
+ String _path;
+ bool _isDirectory, _isReadable, _isWritable;
+
+public:
+ /**
+ * Creates a WiiFilesystemNode with the root node as path.
+ */
+ WiiFilesystemNode();
+
+ /**
+ * Creates a WiiFilesystemNode for a given path.
+ *
+ * @param path String with the path the new node should point to.
+ * @param verify true if the isValid and isDirectory flags should be verified during the construction.
+ */
+ WiiFilesystemNode(const String &path, bool verify);
+
+ virtual bool exists() const;
+ virtual String getDisplayName() const { return _displayName; }
+ virtual String getName() const { return _displayName; }
+ virtual String getPath() const { return _path; }
+ virtual bool isDirectory() const { return _isDirectory; }
+ virtual bool isReadable() const { return _isReadable; }
+ virtual bool isWritable() const { return _isWritable; }
+
+ virtual AbstractFilesystemNode *getChild(const String &n) const;
+ virtual bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const;
+ virtual AbstractFilesystemNode *getParent() const;
+
+private:
+ virtual void setFlags();
+};
+
+/**
+ * Returns the last component of a given path.
+ *
+ * Examples:
+ * /foo/bar.txt would return /bar.txt
+ * /foo/bar/ would return /bar/
+ *
+ * @param str String containing the path.
+ * @return Pointer to the first char of the last component inside str.
+ */
+const char *lastPathComponent(const Common::String &str) {
+ if(str.empty())
+ return "";
+
+ const char *start = str.c_str();
+ const char *cur = start + str.size() - 2;
+
+ while (cur >= start && *cur != '/') {
+ --cur;
+ }
+
+ return cur + 1;
+}
+
+void WiiFilesystemNode::setFlags() {
+ struct stat st;
+
+ _isDirectory = false;
+ _isReadable = false;
+ _isWritable = false;
+
+ if (!stat(_path.c_str(), &st)) {
+ _isDirectory = S_ISDIR(st.st_mode);
+ _isReadable = (st.st_mode & S_IRUSR) > 0;
+ _isWritable = (st.st_mode & S_IWUSR) > 0;
+ }
+}
+
+
+WiiFilesystemNode::WiiFilesystemNode() {
+ // The root dir.
+ _path = "fat:/";
+ _displayName = _path;
+
+ setFlags();
+}
+
+WiiFilesystemNode::WiiFilesystemNode(const String &p, bool verify) {
+ assert(p.size() > 0);
+
+ _path = p;
+
+ _displayName = lastPathComponent(_path);
+
+ if (verify)
+ setFlags();
+}
+
+bool WiiFilesystemNode::exists() const {
+ struct stat st;
+ return stat(_path.c_str (), &st) == 0;
+}
+
+AbstractFilesystemNode *WiiFilesystemNode::getChild(const String &n) const {
+ assert(_isDirectory);
+
+ String newPath(_path);
+ if (newPath.lastChar() != '/')
+ newPath += '/';
+ newPath += n;
+
+ return new WiiFilesystemNode(newPath, true);
+}
+
+bool WiiFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, bool hidden) const {
+ assert(_isDirectory);
+
+ DIR_ITER* dp = diropen (_path.c_str());
+
+ if (dp == NULL)
+ return false;
+
+ char filename[MAXPATHLEN];
+ struct stat st;
+
+ while (dirnext(dp, filename, &st) == 0) {
+ if (strcmp(filename, ".") == 0 || strcmp(filename, "..") == 0)
+ continue;
+
+ String newPath(_path);
+ if (newPath.lastChar() != '/')
+ newPath += '/';
+ newPath += filename;
+
+ bool isDir = S_ISDIR(st.st_mode);
+
+ if ((mode == FilesystemNode::kListFilesOnly && isDir) ||
+ (mode == FilesystemNode::kListDirectoriesOnly && !isDir))
+ continue;
+
+ if (isDir)
+ newPath += '/';
+
+ myList.push_back(new WiiFilesystemNode(newPath, true));
+ }
+
+ dirclose(dp);
+
+ return true;
+}
+
+AbstractFilesystemNode *WiiFilesystemNode::getParent() const {
+ if (_path == "/")
+ return 0;
+
+ const char *start = _path.c_str();
+ const char *end = lastPathComponent(_path);
+
+ return new WiiFilesystemNode(String(start, end - start), true);
+}
+
+#endif //#if defined(__WII__)
+
diff --git a/backends/midi/alsa.cpp b/backends/midi/alsa.cpp
index 174bb73f65..2a252b9323 100644
--- a/backends/midi/alsa.cpp
+++ b/backends/midi/alsa.cpp
@@ -26,10 +26,10 @@
#if defined(UNIX) && defined(USE_ALSA)
-#include "sound/mpu401.h"
-
-#include "common/util.h"
#include "common/config-manager.h"
+#include "common/util.h"
+#include "sound/musicplugin.h"
+#include "sound/mpu401.h"
#include <alsa/asoundlib.h>
@@ -79,7 +79,7 @@ MidiDriver_ALSA::MidiDriver_ALSA()
}
int MidiDriver_ALSA::open() {
- char *var;
+ const char *var;
if (_isOpen)
return MERR_ALREADY_OPEN;
@@ -87,7 +87,8 @@ int MidiDriver_ALSA::open() {
if (!(var = getenv("SCUMMVM_PORT"))) {
// use config option if no var specified
- if (parse_addr(ConfMan.get("alsa_port").c_str(), &seq_client, &seq_port) < 0) {
+ var = ConfMan.get("alsa_port").c_str();
+ if (parse_addr(var, &seq_client, &seq_port) < 0) {
error("Invalid port %s", var);
return -1;
}
@@ -238,8 +239,85 @@ void MidiDriver_ALSA::send_event(int do_flush) {
snd_seq_flush_output(seq_handle);
}
-MidiDriver *MidiDriver_ALSA_create() {
- return new MidiDriver_ALSA();
+
+// Plugin interface
+
+class AlsaMusicPlugin : public MusicPluginObject {
+public:
+ const char *getName() const {
+ return "ALSA";
+ }
+
+ const char *getId() const {
+ return "alsa";
+ }
+
+ MusicDevices getDevices() const;
+ PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const;
+};
+
+#define perm_ok(pinfo,bits) ((snd_seq_port_info_get_capability(pinfo) & (bits)) == (bits))
+
+static int check_permission(snd_seq_port_info_t *pinfo)
+{
+ if (perm_ok(pinfo, SND_SEQ_PORT_CAP_WRITE|SND_SEQ_PORT_CAP_SUBS_WRITE)) {
+ if (!(snd_seq_port_info_get_capability(pinfo) & SND_SEQ_PORT_CAP_NO_EXPORT))
+ return 1;
+ }
+ return 0;
+}
+
+MusicDevices AlsaMusicPlugin::getDevices() const {
+ MusicDevices devices;
+
+ snd_seq_t *seq;
+ if (snd_seq_open(&seq, "default", SND_SEQ_OPEN_DUPLEX, 0) < 0)
+ return devices; // can't open sequencer
+
+ snd_seq_client_info_t *cinfo;
+ snd_seq_client_info_alloca(&cinfo);
+ snd_seq_port_info_t *pinfo;
+ snd_seq_port_info_alloca(&pinfo);
+ snd_seq_client_info_set_client(cinfo, -1);
+ while (snd_seq_query_next_client(seq, cinfo) >= 0) {
+ bool found_valid_port = false;
+
+ /* reset query info */
+ snd_seq_port_info_set_client(pinfo, snd_seq_client_info_get_client(cinfo));
+ snd_seq_port_info_set_port(pinfo, -1);
+ while (!found_valid_port && snd_seq_query_next_port(seq, pinfo) >= 0) {
+ if (check_permission(pinfo)) {
+ found_valid_port = true;
+ // TODO: Return a different music type depending on the configuration
+ devices.push_back(MusicDevice(this, snd_seq_client_info_get_name(cinfo), MT_GM));
+ //snd_seq_client_info_get_client(cinfo) : snd_seq_port_info_get_port(pinfo)
+ }
+ }
+ }
+ snd_seq_close(seq);
+
+ return devices;
+}
+
+PluginError AlsaMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const {
+ *mididriver = new MidiDriver_ALSA();
+
+ return kNoError;
+}
+
+MidiDriver *MidiDriver_ALSA_create(Audio::Mixer *mixer) {
+ MidiDriver *mididriver;
+
+ AlsaMusicPlugin p;
+ p.createInstance(mixer, &mididriver);
+
+ return mididriver;
}
+//#if PLUGIN_ENABLED_DYNAMIC(ALSA)
+ //REGISTER_PLUGIN_DYNAMIC(ALSA, PLUGIN_TYPE_MUSIC, AlsaMusicPlugin);
+//#else
+ REGISTER_PLUGIN_STATIC(ALSA, PLUGIN_TYPE_MUSIC, AlsaMusicPlugin);
+//#endif
+
#endif
diff --git a/backends/midi/camd.cpp b/backends/midi/camd.cpp
index 25dc00bf63..d6d5819a6e 100644
--- a/backends/midi/camd.cpp
+++ b/backends/midi/camd.cpp
@@ -26,9 +26,10 @@
#if defined(__amigaos4__)
-#include "sound/mpu401.h"
-#include "common/util.h"
#include "common/endian.h"
+#include "common/util.h"
+#include "sound/musicplugin.h"
+#include "sound/mpu401.h"
#include <proto/camd.h>
#include <proto/exec.h>
@@ -162,8 +163,50 @@ void MidiDriver_CAMD::closeAll() {
_isOpen = false;
}
-MidiDriver *MidiDriver_CAMD_create() {
- return new MidiDriver_CAMD();
+
+// Plugin interface
+
+class CamdMusicPlugin : public MusicPluginObject {
+public:
+ const char *getName() const {
+ return "CAMD";
+ }
+
+ const char *getId() const {
+ return "camd";
+ }
+
+ MusicDevices getDevices() const;
+ PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const;
+};
+
+MusicDevices CamdMusicPlugin::getDevices() const {
+ MusicDevices devices;
+ // TODO: Return a different music type depending on the configuration
+ // TODO: List the available devices
+ devices.push_back(MusicDevice(this, "", MT_GM));
+ return devices;
+}
+
+PluginError CamdMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const {
+ *mididriver = new MidiDriver_CAMD();
+
+ return kNoError;
}
+MidiDriver *MidiDriver_CAMD_create(Audio::Mixer *mixer) {
+ MidiDriver *mididriver;
+
+ CamdMusicPlugin p;
+ p.createInstance(mixer, &mididriver);
+
+ return mididriver;
+}
+
+//#if PLUGIN_ENABLED_DYNAMIC(CAMD)
+ //REGISTER_PLUGIN_DYNAMIC(CAMD, PLUGIN_TYPE_MUSIC, CamdMusicPlugin);
+//#else
+ REGISTER_PLUGIN_STATIC(CAMD, PLUGIN_TYPE_MUSIC, CamdMusicPlugin);
+//#endif
+
#endif
diff --git a/backends/midi/coreaudio.cpp b/backends/midi/coreaudio.cpp
index c338678036..bf35fb90ba 100644
--- a/backends/midi/coreaudio.cpp
+++ b/backends/midi/coreaudio.cpp
@@ -24,8 +24,20 @@
#ifdef MACOSX
+// HACK to disable deprecated warnings under Mac OS X 10.5.
+// Apple depracted the AUGraphNewNode & AUGraphGetNodeInfo APIs
+// in favor of the new AUGraphAddNode & AUGraphNodeInfo APIs.
+// While it would be trivial to switch to those, this would break
+// binary compatibility with all pre-10.5 systems, so we don't want
+// to do that just now. Maybe when 10.6 comes... :)
+#include <AvailabilityMacros.h>
+#undef DEPRECATED_ATTRIBUTE
+#define DEPRECATED_ATTRIBUTE
+
+
#include "common/config-manager.h"
#include "common/util.h"
+#include "sound/musicplugin.h"
#include "sound/mpu401.h"
#include <AudioToolbox/AUGraph.h>
@@ -192,8 +204,50 @@ void MidiDriver_CORE::sysEx(const byte *msg, uint16 length) {
MusicDeviceSysEx(_synth, buf, length+2);
}
-MidiDriver *MidiDriver_CORE_create() {
- return new MidiDriver_CORE();
+
+// Plugin interface
+
+class CoreAudioMusicPlugin : public MusicPluginObject {
+public:
+ const char *getName() const {
+ return "CoreAudio";
+ }
+
+ const char *getId() const {
+ return "core";
+ }
+
+ MusicDevices getDevices() const;
+ PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const;
+};
+
+MusicDevices CoreAudioMusicPlugin::getDevices() const {
+ MusicDevices devices;
+ // TODO: Return a different music type depending on the configuration
+ // TODO: List the available devices
+ devices.push_back(MusicDevice(this, "", MT_GM));
+ return devices;
}
+PluginError CoreAudioMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const {
+ *mididriver = new MidiDriver_CORE();
+
+ return kNoError;
+}
+
+MidiDriver *MidiDriver_CORE_create(Audio::Mixer *mixer) {
+ MidiDriver *mididriver;
+
+ CoreAudioMusicPlugin p;
+ p.createInstance(mixer, &mididriver);
+
+ return mididriver;
+}
+
+//#if PLUGIN_ENABLED_DYNAMIC(COREAUDIO)
+ //REGISTER_PLUGIN_DYNAMIC(COREAUDIO, PLUGIN_TYPE_MUSIC, CoreAudioMusicPlugin);
+//#else
+ REGISTER_PLUGIN_STATIC(COREAUDIO, PLUGIN_TYPE_MUSIC, CoreAudioMusicPlugin);
+//#endif
+
#endif // MACOSX
diff --git a/backends/midi/coremidi.cpp b/backends/midi/coremidi.cpp
index 251b41a986..da82249792 100644
--- a/backends/midi/coremidi.cpp
+++ b/backends/midi/coremidi.cpp
@@ -26,6 +26,7 @@
#include "common/config-manager.h"
#include "common/util.h"
+#include "sound/musicplugin.h"
#include "sound/mpu401.h"
#include <CoreMIDI/CoreMIDI.h>
@@ -175,8 +176,50 @@ void MidiDriver_CoreMIDI::sysEx(const byte *msg, uint16 length) {
MIDISend(mOutPort, mDest, packetList);
}
-MidiDriver *MidiDriver_CoreMIDI_create() {
- return new MidiDriver_CoreMIDI();
+
+// Plugin interface
+
+class CoreMIDIMusicPlugin : public MusicPluginObject {
+public:
+ const char *getName() const {
+ return "CoreMIDI";
+ }
+
+ const char *getId() const {
+ return "coremidi";
+ }
+
+ MusicDevices getDevices() const;
+ PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const;
+};
+
+MusicDevices CoreMIDIMusicPlugin::getDevices() const {
+ MusicDevices devices;
+ // TODO: Return a different music type depending on the configuration
+ // TODO: List the available devices
+ devices.push_back(MusicDevice(this, "", MT_GM));
+ return devices;
}
+PluginError CoreMIDIMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const {
+ *mididriver = new MidiDriver_CoreMIDI();
+
+ return kNoError;
+}
+
+MidiDriver *MidiDriver_CoreMIDI_create(Audio::Mixer *mixer) {
+ MidiDriver *mididriver;
+
+ CoreMIDIMusicPlugin p;
+ p.createInstance(mixer, &mididriver);
+
+ return mididriver;
+}
+
+//#if PLUGIN_ENABLED_DYNAMIC(COREMIDI)
+ //REGISTER_PLUGIN_DYNAMIC(COREMIDI, PLUGIN_TYPE_MUSIC, CoreMIDIMusicPlugin);
+//#else
+ REGISTER_PLUGIN_STATIC(COREMIDI, PLUGIN_TYPE_MUSIC, CoreMIDIMusicPlugin);
+//#endif
+
#endif // MACOSX
diff --git a/backends/midi/dmedia.cpp b/backends/midi/dmedia.cpp
index 6865f3e537..b4bd426ca4 100644
--- a/backends/midi/dmedia.cpp
+++ b/backends/midi/dmedia.cpp
@@ -18,7 +18,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * $URL:$
+ * $URL$
* $Id: dmedia.cpp$
*/
@@ -30,8 +30,9 @@
#if defined(IRIX)
#include "common/scummsys.h"
-#include "sound/mpu401.h"
#include "common/util.h"
+#include "sound/musicplugin.h"
+#include "sound/mpu401.h"
#include <dmedia/midi.h>
#include <sys/types.h>
@@ -174,8 +175,50 @@ void MidiDriver_DMEDIA::sysEx (const byte *msg, uint16 length) {
}
}
-MidiDriver *MidiDriver_DMEDIA_create() {
- return new MidiDriver_DMEDIA();
+
+// Plugin interface
+
+class DMediaMusicPlugin : public MusicPluginObject {
+public:
+ const char *getName() const {
+ return "DMedia";
+ }
+
+ const char *getId() const {
+ return "dmedia";
+ }
+
+ MusicDevices getDevices() const;
+ PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const;
+};
+
+MusicDevices DMediaMusicPlugin::getDevices() const {
+ MusicDevices devices;
+ // TODO: Return a different music type depending on the configuration
+ // TODO: List the available devices
+ devices.push_back(MusicDevice(this, "", MT_GM));
+ return devices;
}
+PluginError DMediaMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const {
+ *mididriver = new MidiDriver_DMEDIA();
+
+ return kNoError;
+}
+
+MidiDriver *MidiDriver_DMEDIA_create(Audio::Mixer *mixer) {
+ MidiDriver *mididriver;
+
+ DMediaMusicPlugin p;
+ p.createInstance(mixer, &mididriver);
+
+ return mididriver;
+}
+
+//#if PLUGIN_ENABLED_DYNAMIC(DMEDIA)
+ //REGISTER_PLUGIN_DYNAMIC(DMEDIA, PLUGIN_TYPE_MUSIC, DMediaMusicPlugin);
+//#else
+ REGISTER_PLUGIN_STATIC(DMEDIA, PLUGIN_TYPE_MUSIC, DMediaMusicPlugin);
+//#endif
+
#endif
diff --git a/backends/midi/quicktime.cpp b/backends/midi/quicktime.cpp
index 3267bb3415..568adf022b 100644
--- a/backends/midi/quicktime.cpp
+++ b/backends/midi/quicktime.cpp
@@ -24,10 +24,22 @@
#if defined(MACOSX) || defined(macintosh)
+// HACK to disable deprecated warnings under Mac OS X 10.5.
+// Apple depracted the complete QuickTime Music/MIDI API.
+// Apps are supposed to use CoreAudio & CoreMIDI. We do support
+// those, but while QT Midi support is still around, there is no
+// reason to disable this driver. If they really ditch the API in 10.6,
+// we can still release binaries with this driver disabled/removed.
+#include <AvailabilityMacros.h>
+#undef DEPRECATED_ATTRIBUTE
+#define DEPRECATED_ATTRIBUTE
+
+
-#include "sound/mpu401.h"
#include "common/endian.h"
#include "common/util.h"
+#include "sound/musicplugin.h"
+#include "sound/mpu401.h"
#if defined(MACOSX)
#include <QuickTime/QuickTimeComponents.h>
@@ -250,8 +262,50 @@ void MidiDriver_QT::dispose()
}
}
-MidiDriver *MidiDriver_QT_create() {
- return new MidiDriver_QT();
+
+// Plugin interface
+
+class QuickTimeMusicPlugin : public MusicPluginObject {
+public:
+ const char *getName() const {
+ return "QuickTime";
+ }
+
+ const char *getId() const {
+ return "qt";
+ }
+
+ MusicDevices getDevices() const;
+ PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const;
+};
+
+MusicDevices QuickTimeMusicPlugin::getDevices() const {
+ MusicDevices devices;
+ // TODO: Return a different music type depending on the configuration
+ // TODO: List the available devices
+ devices.push_back(MusicDevice(this, "", MT_GM));
+ return devices;
+}
+
+PluginError QuickTimeMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const {
+ *mididriver = new MidiDriver_QT();
+
+ return kNoError;
}
+MidiDriver *MidiDriver_QT_create(Audio::Mixer *mixer) {
+ MidiDriver *mididriver;
+
+ QuickTimeMusicPlugin p;
+ p.createInstance(mixer, &mididriver);
+
+ return mididriver;
+}
+
+//#if PLUGIN_ENABLED_DYNAMIC(QUICKTIME)
+ //REGISTER_PLUGIN_DYNAMIC(QUICKTIME, PLUGIN_TYPE_MUSIC, QuickTimeMusicPlugin);
+//#else
+ REGISTER_PLUGIN_STATIC(QUICKTIME, PLUGIN_TYPE_MUSIC, QuickTimeMusicPlugin);
+//#endif
+
#endif // MACOSX || macintosh
diff --git a/backends/midi/seq.cpp b/backends/midi/seq.cpp
index 39c61dd85b..57a5a1ea32 100644
--- a/backends/midi/seq.cpp
+++ b/backends/midi/seq.cpp
@@ -30,8 +30,9 @@
#if defined(UNIX) && !defined(__BEOS__) && !defined(__MAEMO__)
-#include "sound/mpu401.h"
#include "common/util.h"
+#include "sound/musicplugin.h"
+#include "sound/mpu401.h"
#include <fcntl.h>
#include <unistd.h>
@@ -169,8 +170,50 @@ void MidiDriver_SEQ::sysEx (const byte *msg, uint16 length) {
write (device, buf, position);
}
-MidiDriver *MidiDriver_SEQ_create() {
- return new MidiDriver_SEQ();
+
+// Plugin interface
+
+class SeqMusicPlugin : public MusicPluginObject {
+public:
+ const char *getName() const {
+ return "SEQ";
+ }
+
+ const char *getId() const {
+ return "seq";
+ }
+
+ MusicDevices getDevices() const;
+ PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const;
+};
+
+MusicDevices SeqMusicPlugin::getDevices() const {
+ MusicDevices devices;
+ // TODO: Return a different music type depending on the configuration
+ // TODO: List the available devices
+ devices.push_back(MusicDevice(this, "", MT_GM));
+ return devices;
}
+PluginError SeqMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const {
+ *mididriver = new MidiDriver_SEQ();
+
+ return kNoError;
+}
+
+MidiDriver *MidiDriver_SEQ_create(Audio::Mixer *mixer) {
+ MidiDriver *mididriver;
+
+ SeqMusicPlugin p;
+ p.createInstance(mixer, &mididriver);
+
+ return mididriver;
+}
+
+//#if PLUGIN_ENABLED_DYNAMIC(SEQ)
+ //REGISTER_PLUGIN_DYNAMIC(SEQ, PLUGIN_TYPE_MUSIC, SeqMusicPlugin);
+//#else
+ REGISTER_PLUGIN_STATIC(SEQ, PLUGIN_TYPE_MUSIC, SeqMusicPlugin);
+//#endif
+
#endif
diff --git a/backends/midi/timidity.cpp b/backends/midi/timidity.cpp
index 8b10cf07a4..b262fed88c 100644
--- a/backends/midi/timidity.cpp
+++ b/backends/midi/timidity.cpp
@@ -36,8 +36,9 @@
#if defined (UNIX)
-#include "sound/mpu401.h"
#include "common/util.h"
+#include "sound/musicplugin.h"
+#include "sound/mpu401.h"
#include <fcntl.h>
#include <unistd.h>
@@ -510,8 +511,48 @@ void MidiDriver_TIMIDITY::sysEx(const byte *msg, uint16 length) {
timidity_write_data(buf, position);
}
-MidiDriver *MidiDriver_TIMIDITY_create() {
- return new MidiDriver_TIMIDITY();
+
+// Plugin interface
+
+class TimidityMusicPlugin : public MusicPluginObject {
+public:
+ const char *getName() const {
+ return "TiMidity";
+ }
+
+ const char *getId() const {
+ return "timidity";
+ }
+
+ MusicDevices getDevices() const;
+ PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const;
+};
+
+MusicDevices TimidityMusicPlugin::getDevices() const {
+ MusicDevices devices;
+ devices.push_back(MusicDevice(this, "", MT_GM));
+ return devices;
}
+PluginError TimidityMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const {
+ *mididriver = new MidiDriver_TIMIDITY();
+
+ return kNoError;
+}
+
+MidiDriver *MidiDriver_TIMIDITY_create(Audio::Mixer *mixer) {
+ MidiDriver *mididriver;
+
+ TimidityMusicPlugin p;
+ p.createInstance(mixer, &mididriver);
+
+ return mididriver;
+}
+
+//#if PLUGIN_ENABLED_DYNAMIC(TIMIDITY)
+ //REGISTER_PLUGIN_DYNAMIC(TIMIDITY, PLUGIN_TYPE_MUSIC, TimidityMusicPlugin);
+//#else
+ REGISTER_PLUGIN_STATIC(TIMIDITY, PLUGIN_TYPE_MUSIC, TimidityMusicPlugin);
+//#endif
+
#endif // defined (UNIX)
diff --git a/backends/midi/windows.cpp b/backends/midi/windows.cpp
index db3ed50165..c564c124fe 100644
--- a/backends/midi/windows.cpp
+++ b/backends/midi/windows.cpp
@@ -24,11 +24,14 @@
#if defined(WIN32) && !defined(_WIN32_WCE)
-
#include <windows.h>
-#include <mmsystem.h>
+// winnt.h defines ARRAYSIZE, but we want our own one...
+#undef ARRAYSIZE
+
+#include "sound/musicplugin.h"
#include "sound/mpu401.h"
-#include "common/util.h"
+
+#include <mmsystem.h>
////////////////////////////////////////
//
@@ -141,8 +144,50 @@ void MidiDriver_WIN::check_error(MMRESULT result) {
}
}
-MidiDriver *MidiDriver_WIN_create() {
- return new MidiDriver_WIN();
+
+// Plugin interface
+
+class WindowsMusicPlugin : public MusicPluginObject {
+public:
+ const char *getName() const {
+ return "Windows MIDI";
+ }
+
+ const char *getId() const {
+ return "windows";
+ }
+
+ MusicDevices getDevices() const;
+ PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const;
+};
+
+MusicDevices WindowsMusicPlugin::getDevices() const {
+ MusicDevices devices;
+ // TODO: Return a different music type depending on the configuration
+ // TODO: List the available devices
+ devices.push_back(MusicDevice(this, "", MT_GM));
+ return devices;
+}
+
+PluginError WindowsMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const {
+ *mididriver = new MidiDriver_WIN();
+
+ return kNoError;
}
+MidiDriver *MidiDriver_WIN_create(Audio::Mixer *mixer) {
+ MidiDriver *mididriver;
+
+ WindowsMusicPlugin p;
+ p.createInstance(mixer, &mididriver);
+
+ return mididriver;
+}
+
+//#if PLUGIN_ENABLED_DYNAMIC(WINDOWS)
+ //REGISTER_PLUGIN_DYNAMIC(WINDOWS, PLUGIN_TYPE_MUSIC, WindowsMusicPlugin);
+//#else
+ REGISTER_PLUGIN_STATIC(WINDOWS, PLUGIN_TYPE_MUSIC, WindowsMusicPlugin);
+//#endif
+
#endif
diff --git a/backends/midi/ypa1.cpp b/backends/midi/ypa1.cpp
index ca77de7300..88f9c3de8f 100644
--- a/backends/midi/ypa1.cpp
+++ b/backends/midi/ypa1.cpp
@@ -22,8 +22,9 @@
* $Id$
*/
-#include "sound/mpu401.h"
#include "common/util.h"
+#include "sound/musicplugin.h"
+#include "sound/mpu401.h"
#include "Pa1Lib.h"
@@ -102,6 +103,48 @@ void MidiDriver_YamahaPa1::send(uint32 b) {
}
}
-MidiDriver *MidiDriver_YamahaPa1_create() {
- return new MidiDriver_YamahaPa1();
+
+// Plugin interface
+
+class YamahaPa1MusicPlugin : public MusicPluginObject {
+public:
+ const char *getName() const {
+ return "Yamaha Pa1";
+ }
+
+ const char *getId() const {
+ return "ypa1";
+ }
+
+ MusicDevices getDevices() const;
+ PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const;
+};
+
+MusicDevices YamahaPa1MusicPlugin::getDevices() const {
+ MusicDevices devices;
+ // TODO: Return a different music type depending on the configuration
+ // TODO: List the available devices
+ devices.push_back(MusicDevice(this, "", MT_GM));
+ return devices;
+}
+
+PluginError YamahaPa1MusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const {
+ *mididriver = new MidiDriver_YamahaPa1();
+
+ return kNoError;
}
+
+MidiDriver *MidiDriver_YamahaPa1_create(Audio::Mixer *mixer) {
+ MidiDriver *mididriver;
+
+ YamahaPa1MusicPlugin p;
+ p.createInstance(mixer, &mididriver);
+
+ return mididriver;
+}
+
+//#if PLUGIN_ENABLED_DYNAMIC(YPA1)
+ //REGISTER_PLUGIN_DYNAMIC(YPA1, PLUGIN_TYPE_MUSIC, YamahaPa1MusicPlugin);
+//#else
+ REGISTER_PLUGIN_STATIC(YPA1, PLUGIN_TYPE_MUSIC, YamahaPa1MusicPlugin);
+//#endif
diff --git a/backends/midi/zodiac.cpp b/backends/midi/zodiac.cpp
index b1c2aa61c7..456e4df43a 100644
--- a/backends/midi/zodiac.cpp
+++ b/backends/midi/zodiac.cpp
@@ -22,8 +22,9 @@
* $Id$
*/
-#include "sound/mpu401.h"
#include "common/util.h"
+#include "sound/musicplugin.h"
+#include "sound/mpu401.h"
#ifndef DISABLE_TAPWAVE
@@ -120,8 +121,50 @@ void MidiDriver_Zodiac::sysEx(const byte *msg, uint16 length) {
TwMidiSysEx(_midiHandle, 0, (byte *)buf, length + 2);
}
-MidiDriver *MidiDriver_Zodiac_create() {
- return new MidiDriver_Zodiac();
+
+// Plugin interface
+
+class ZodiacMusicPlugin : public MusicPluginObject {
+public:
+ const char *getName() const {
+ return "Tapwave Zodiac";
+ }
+
+ const char *getId() const {
+ return "zodiac";
+ }
+
+ MusicDevices getDevices() const;
+ PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const;
+};
+
+MusicDevices ZodiacMusicPlugin::getDevices() const {
+ MusicDevices devices;
+ // TODO: Return a different music type depending on the configuration
+ // TODO: List the available devices
+ devices.push_back(MusicDevice(this, "", MT_GM));
+ return devices;
+}
+
+PluginError ZodiacMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const {
+ *mididriver = new MidiDriver_Zodiac();
+
+ return kNoError;
}
+MidiDriver *MidiDriver_Zodiac_create(Audio::Mixer *mixer) {
+ MidiDriver *mididriver;
+
+ ZodiacMusicPlugin p;
+ p.createInstance(mixer, &mididriver);
+
+ return mididriver;
+}
+
+//#if PLUGIN_ENABLED_DYNAMIC(ZODIAC)
+ //REGISTER_PLUGIN_DYNAMIC(ZODIAC, PLUGIN_TYPE_MUSIC, ZodiacMusicPlugin);
+//#else
+ REGISTER_PLUGIN_STATIC(ZODIAC, PLUGIN_TYPE_MUSIC, ZodiacMusicPlugin);
+//#endif
+
#endif
diff --git a/backends/module.mk b/backends/module.mk
index e8ba303dea..6642a3a281 100644
--- a/backends/module.mk
+++ b/backends/module.mk
@@ -3,13 +3,13 @@ MODULE := backends
MODULE_OBJS := \
fs/amigaos4/amigaos4-fs-factory.o \
fs/ds/ds-fs-factory.o \
- fs/gp32/gp32-fs-factory.o \
fs/palmos/palmos-fs-factory.o \
fs/posix/posix-fs-factory.o \
fs/ps2/ps2-fs-factory.o \
fs/psp/psp-fs-factory.o \
fs/symbian/symbian-fs-factory.o \
fs/windows/windows-fs-factory.o \
+ fs/wii/wii-fs-factory.o \
events/default/default-events.o \
midi/alsa.o \
midi/camd.o \
diff --git a/backends/platform/PalmOS/Src/be_base.cpp b/backends/platform/PalmOS/Src/be_base.cpp
index 3dadbe5286..afb3f15bae 100644
--- a/backends/platform/PalmOS/Src/be_base.cpp
+++ b/backends/platform/PalmOS/Src/be_base.cpp
@@ -24,9 +24,9 @@
*/
#include "be_base.h"
-#include "be_save.h"
#include "common/config-file.h"
#include "common/config-manager.h"
+#include "backends/saves/default/default-saves.h"
#include "backends/timer/default/default-timer.h"
#include "sound/mixer.h"
@@ -100,7 +100,7 @@ void OSystem_PalmBase::initBackend() {
// Create the savefile manager, if none exists yet (we check for this to
// allow subclasses to provide their own).
if (_saveMgr == 0) {
- _saveMgr = new PalmSaveFileManager();
+ _saveMgr = new DefaultSaveFileManager();
}
// Create and hook up the mixer, if none exists yet (we check for this to
@@ -120,6 +120,11 @@ void OSystem_PalmBase::initBackend() {
OSystem::initBackend();
}
+void OSystem_PalmBase::getTimeAndDate(struct tm &t) const {
+ time_t curTime = time(0);
+ t = *localtime(&curTime);
+}
+
uint32 OSystem_PalmBase::getMillis() {
return TimGetTicks() * 1000 / SysTicksPerSecond();
}
diff --git a/backends/platform/PalmOS/Src/be_base.h b/backends/platform/PalmOS/Src/be_base.h
index 38b76fcb05..582aae5d7a 100644
--- a/backends/platform/PalmOS/Src/be_base.h
+++ b/backends/platform/PalmOS/Src/be_base.h
@@ -26,6 +26,8 @@
#ifndef BE_BASE_H
#define BE_BASE_H
+#include <time.h>
+
#include "PalmVersion.h"
#include "globals.h"
@@ -236,6 +238,7 @@ public:
bool pollEvent(Common::Event &event);
+ void getTimeAndDate(struct tm &t) const;
virtual uint32 getMillis();
virtual void delayMillis(uint msecs);
diff --git a/backends/platform/PalmOS/Src/be_save.cpp b/backends/platform/PalmOS/Src/be_save.cpp
deleted file mode 100644
index 1c3da1ba23..0000000000
--- a/backends/platform/PalmOS/Src/be_save.cpp
+++ /dev/null
@@ -1,76 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- *
- */
-
-#include "be_base.h"
-#include "common/savefile.h"
-#include "be_save.h"
-
-Common::StringList PalmSaveFileManager::listSavefiles(const char *pattern) {
- TODO: Implement this. If you don't understand what it should do, just ask
- (e.g. on scummvm-devel or Fingolfin). It should be pretty simple if you
- use Common::matchString from common/util.h and read the Doxygen docs,
- then combine this with the old code below...
-
-/*
-void PalmSaveFileManager::listSavefiles(const char *prefix, bool *marks, int num) {
- FileRef fileRef;
- // try to open the dir
- Err e = VFSFileOpen(gVars->VFS.volRefNum, SCUMMVM_SAVEPATH, vfsModeRead, &fileRef);
- memset(marks, false, num*sizeof(bool));
-
- if (e != errNone)
- return;
-
- // enumerate all files
- UInt32 dirEntryIterator = vfsIteratorStart;
- Char filename[32];
- FileInfoType info = {0, filename, 32};
- UInt16 length = StrLen(prefix);
- int slot = 0;
-
- while (dirEntryIterator != vfsIteratorStop) {
- e = VFSDirEntryEnumerate (fileRef, &dirEntryIterator, &info);
-
- if (e != expErrEnumerationEmpty) { // there is something
-
- if (StrLen(info.nameP) == (length + 2)) { // consider max 99, filename length is ok
- if (StrNCaselessCompare(prefix, info.nameP, length) == 0) { // this seems to be a save file
- if (isdigit(info.nameP[length]) && isdigit(info.nameP[length+1])) {
-
- slot = StrAToI(filename + length);
- if (slot >= 0 && slot < num)
- *(marks+slot) = true;
-
- }
- }
- }
-
- }
- }
-
- VFSFileClose(fileRef);
-}
-
-}
diff --git a/backends/platform/PalmOS/Src/extend.cpp b/backends/platform/PalmOS/Src/extend.cpp
index e2dbd8f093..430563a302 100644
--- a/backends/platform/PalmOS/Src/extend.cpp
+++ b/backends/platform/PalmOS/Src/extend.cpp
@@ -29,8 +29,6 @@
#include "modulesrsc.h"
-const char *SCUMMVM_SAVEPATH = "/PALM/Programs/ScummVM/Saved";
-
void PalmFatalError(const char *err) {
WinSetDrawWindow(WinGetDisplayWindow());
WinPalette(winPaletteSetToDefault,0,0,0);
diff --git a/backends/platform/PalmOS/Src/prefixes/native_kyra.h b/backends/platform/PalmOS/Src/prefixes/native_kyra.h
index c89b0a5b93..3b09c63a6f 100644
--- a/backends/platform/PalmOS/Src/prefixes/native_kyra.h
+++ b/backends/platform/PalmOS/Src/prefixes/native_kyra.h
@@ -2,6 +2,6 @@
#define PREFIX_H
#include "native_common.h"
-#define ENABLE_KYRA
+#define ENABLE_KYRA STATIC_PLUGIN
#endif
diff --git a/backends/platform/PalmOS/Src/prefixes/native_m4.h b/backends/platform/PalmOS/Src/prefixes/native_m4.h
new file mode 100755
index 0000000000..3bf85460a6
--- /dev/null
+++ b/backends/platform/PalmOS/Src/prefixes/native_m4.h
@@ -0,0 +1,7 @@
+#ifndef PREFIX_H
+#define PREFIX_H
+
+#include "native_common.h"
+#define ENABLE_M4 STATIC_PLUGIN
+
+#endif
diff --git a/backends/platform/PalmOS/Src/prefixes/native_made.h b/backends/platform/PalmOS/Src/prefixes/native_made.h
new file mode 100755
index 0000000000..fd439ed181
--- /dev/null
+++ b/backends/platform/PalmOS/Src/prefixes/native_made.h
@@ -0,0 +1,7 @@
+#ifndef PREFIX_H
+#define PREFIX_H
+
+#include "native_common.h"
+#define ENABLE_MADE STATIC_PLUGIN
+
+#endif
diff --git a/backends/platform/PalmOS/Src/prefixes/native_sword1.h b/backends/platform/PalmOS/Src/prefixes/native_sword1.h
index aaae4c9b86..6ae7bb9050 100644
--- a/backends/platform/PalmOS/Src/prefixes/native_sword1.h
+++ b/backends/platform/PalmOS/Src/prefixes/native_sword1.h
@@ -2,7 +2,7 @@
#define PREFIX_H
#include "native_common.h"
-#define ENABLE_SWORD1
+#define ENABLE_SWORD1 STATIC_PLUGIN
#define USE_MPEG2
#define USE_VORBIS
diff --git a/backends/platform/dc/selector.cpp b/backends/platform/dc/selector.cpp
index 4bca47afb2..880fbc400f 100644
--- a/backends/platform/dc/selector.cpp
+++ b/backends/platform/dc/selector.cpp
@@ -151,8 +151,8 @@ static Game the_game;
static void detectGames(FSList &files, GameList &candidates)
{
- const PluginList &plugins = PluginManager::instance().getPlugins();
- PluginList::const_iterator iter = plugins.begin();
+ const EnginePluginList &plugins = EngineMan.getPlugins();
+ EnginePluginList::const_iterator iter = plugins.begin();
for (iter = plugins.begin(); iter != plugins.end(); ++iter) {
candidates.push_back((*iter)->detectGames(files));
}
diff --git a/backends/platform/ds/arm7/Makefile b/backends/platform/ds/arm7/Makefile
index e6a190b1ce..55db7f8cad 100644
--- a/backends/platform/ds/arm7/Makefile
+++ b/backends/platform/ds/arm7/Makefile
@@ -68,7 +68,8 @@ endif
# list of directories containing libraries, this must be the top level containing
# include and lib
#---------------------------------------------------------------------------------
-LIBDIRS := /home/neil/devkitpror21/libnds home/neil/devkitpror21/libnds/nds
+#LIBDIRS := /home/neil/devkitpror21/libnds home/neil/devkitpror21/libnds/nds
+LIBDIRS := $(DEVKITPRO)/libnds
#---------------------------------------------------------------------------------
@@ -127,6 +128,10 @@ clean:
@echo clean ...$(TARGET)
@rm -fr $(BUILD) *.bin
+#---------------------------------------------------------------------------------
+semiclean:
+ @echo semiclean ...$(TARGET)
+
#---------------------------------------------------------------------------------
else
diff --git a/backends/platform/ds/arm7/source/main.cpp b/backends/platform/ds/arm7/source/main.cpp
index 0e31204ef7..bee39f1efe 100644
--- a/backends/platform/ds/arm7/source/main.cpp
+++ b/backends/platform/ds/arm7/source/main.cpp
@@ -36,7 +36,7 @@
#include <arm7/clock.h>
#include <stdlib.h>
#include <string.h>
-#include <registers_alt.h>
+//#include <registers_alt.h> // not needed in current libnds
#include <NDS/scummvm_ipc.h>
//////////////////////////////////////////////////////////////////////
#ifdef USE_DEBUGGER
@@ -261,6 +261,9 @@ uint16 powerManagerWrite(uint32 command, u32 data, bool enable) {
REG_SPICNT = SPI_ENABLE | SPI_BAUD_1MHz;
REG_SPIDATA = enable? (result | data): (result & ~data);
SerialWaitBusy();
+
+ // FIXME: This function should either return something, or have a comment
+ // explaining why it is valid for it to not return something. :-)
}
/*
diff --git a/backends/platform/ds/arm9/buildkeyboard.bat b/backends/platform/ds/arm9/buildkeyboard.bat
index 2078381ccb..ae3398d24d 100644
--- a/backends/platform/ds/arm9/buildkeyboard.bat
+++ b/backends/platform/ds/arm9/buildkeyboard.bat
@@ -2,7 +2,3 @@ cd data
..\tools\gfx2gba -c16 -t8 -M -pkeyboard_pal.raw ..\keyboard.bmp
del keyboard.map
pause
-cd data
-..\tools\gfx2gba -c16 -t8 -M -pkeyboard_pal.raw ..\keyboard.bmp
-del keyboard.map
-pause \ No newline at end of file
diff --git a/backends/platform/ds/arm9/lib/readme.txt b/backends/platform/ds/arm9/lib/readme.txt
index f6e7f4c511..2469e38cd0 100644
--- a/backends/platform/ds/arm9/lib/readme.txt
+++ b/backends/platform/ds/arm9/lib/readme.txt
@@ -1,2 +1 @@
If building with MAD enabled, put libmad.a in here.
-If building with MAD enabled, put libmad.a in here. \ No newline at end of file
diff --git a/backends/platform/ds/arm9/makefile b/backends/platform/ds/arm9/makefile
index ea98402d4e..7472a32218 100644
--- a/backends/platform/ds/arm9/makefile
+++ b/backends/platform/ds/arm9/makefile
@@ -1,47 +1,39 @@
-#DYNAMIC_MODULES = 1
-#libndsdir = $(DEVKITPRO)/libnds
-libndsdir = /home/neil/devkitpror21/libnds
-
-# Select the build you want by uncommenting one of the following lines:
-
-
-
-ifeq ($(SCUMM_BUILD),a)
- DS_BUILD_A = 1
-endif
-
-ifeq ($(SCUMM_BUILD),b)
- DS_BUILD_B = 1
-endif
+srcdir ?= .
+DEPDIR := .deps
-ifeq ($(SCUMM_BUILD),c)
- DS_BUILD_C = 1
-endif
-
-ifeq ($(SCUMM_BUILD),d)
- DS_BUILD_D = 1
-endif
-
-ifeq ($(SCUMM_BUILD),e)
- DS_BUILD_E = 1
-endif
+#DYNAMIC_MODULES = 1
+libndsdir = $(DEVKITPRO)/libnds
+#libndsdir = /home/neil/devkitpror21/libnds
-ifeq ($(SCUMM_BUILD),f)
- DS_BUILD_F = 1
-endif
+# Select the build by setting SCUMM_BUILD to a,b,c,d,e,f or g.
+# Anything else gets build a.
ifeq ($(SCUMM_BUILD),g)
DS_BUILD_G = 1
+else
+ ifeq ($(SCUMM_BUILD),f)
+ DS_BUILD_F = 1
+ else
+ ifeq ($(SCUMM_BUILD),e)
+ DS_BUILD_E = 1
+ else
+ ifeq ($(SCUMM_BUILD),d)
+ DS_BUILD_D = 1
+ else
+ ifeq ($(SCUMM_BUILD),c)
+ DS_BUILD_C = 1
+ else
+ ifeq ($(SCUMM_BUILD),b)
+ DS_BUILD_B = 1
+ else
+ DS_BUILD_A = 1
+ endif
+ endif
+ endif
+ endif
+ endif
endif
-#DS_BUILD_A = 1
-#DS_BUILD_B = 1
-#DS_BUILD_C = 1
-#DS_BUILD_D = 1 # started!
-#DS_BUILD_E = 1
-#DS_BUILD_F = 1
-#DS_BUILD_G = 1
-
# To do:
# - FAT cache?
@@ -79,14 +71,21 @@ VPATH = $(srcdir)
# Command to build libmad is:
# ./configure --host=arm-elf --enable-speed --enable-sso -enable-fpm=arm CFLAGS='-specs=ds_arm9.specs -mthumb-interwork'
+#
+# I actually had to use
+# ./configure --host=arm-elf --enable-speed --enable-sso -enable-fpm=arm CFLAGS='-specs=ds_arm9.specs -mthumb-interwork' LDFLAGS='C:/Progra~1/devkitpro/libnds/lib/libnds9.a' --disable-shared --disable-debugging
USE_ARM_SOUND_ASM = 1
ARM = 1
+USE_ARM_COSTUME_ASM = 1
ifdef DS_BUILD_A
- DEFINES = -DDS_SCUMM_BUILD -DDS_BUILD_A -DUSE_ARM_GFX_ASM
+ DEFINES = -DDS_SCUMM_BUILD -DDS_BUILD_A -DUSE_ARM_GFX_ASM -DUSE_ARM_COSTUME_ASM
LOGO = logoa.bmp
ENABLE_SCUMM = STATIC_PLUGIN
+ DEFINES += -DENABLE_SCUMM=STATIC_PLUGIN
+ MODULES += engines/scumm
+
USE_ARM_GFX_ASM = 1
BUILD=scummvm-A
endif
@@ -146,10 +145,12 @@ CXX = arm-eabi-g++
CFLAGS = -Wno-multichar -Wall\
-Wno-multichar -mcpu=arm9tdmi -mtune=arm9tdmi \
-mcpu=arm9tdmi -mtune=arm9tdmi -fomit-frame-pointer\
- -ffast-math -mthumb-interwork
+ -mthumb-interwork -DUSE_ARM_COSTUME_ASM=1
+
+# -ffast-math
ifdef USE_DEBUGGER
- DEFINES += -DUSE_DEBUGGER
+ DEFINES += -DUSE_DEBUGGER
CFLAGS += -g
endif
@@ -158,7 +159,7 @@ ifdef USE_PROFILER
DEFINES += -DUSE_PROFILER
endif
-CXXFLAGS= $(CFLAGS) -Wno-non-virtual-dtor -Wno-non-virtual-dtor \
+CXXFLAGS= $(CFLAGS) -Wno-non-virtual-dtor -Wno-unknown-pragmas -Wno-reorder \
-fno-exceptions -fno-rtti -mthumb-interwork
# -mthumb
@@ -181,9 +182,9 @@ endif
LDFLAGS = -specs=ds_arm9.specs -mthumb-interwork -Wl,--wrap,time -mno-fpu -Wl,-Map,map.txt
-INCLUDES= -I./ -I$(portdir)/$(BUILD) -I$(srcdir) -I$(srcdir)/common -I$(portdir)/source -I$(portdir)/source/compressor -I$(portdir)/source/fat \
- -I$(srcdir)/backends/fs -I$(srcdir)/backends/fs/ds -I$(portdir)/data -I$(libndsdir)/include -I$(portdir)/../commoninclude\
- -I$(srcdir)/scumm -I$(libndsdir)/include -I$(libndsdir)/include/nds -I$(srcdir)/engines -I$(portdir)/source/mad\
+INCLUDES= -I./ -I$(portdir)/$(BUILD) -I$(srcdir) -I$(srcdir)/common -I$(portdir)/source \
+ -I$(portdir)/data -I$(libndsdir)/include -I$(portdir)/../commoninclude\
+ -I$(libndsdir)/include -I$(libndsdir)/include/nds -I$(srcdir)/engines -I$(portdir)/source/mad\
-I$(portdir)/source/libcartreset -include $(srcdir)/common/scummsys.h
@@ -258,11 +259,13 @@ OPTLIST := actor.cpp ds_main.cpp osystem_ds.cpp blitters.cpp fmopl.cpp rate.cpp
#OPTLIST :=
# Compiler options for files which should be optimised for speed
-OPT_SPEED := -O3
+OPT_SPEED := -O2
# Compiler options for files which should be optimised for space
-OPT_SIZE := -Os -mthumb -fno-gcse -fno-schedule-insns2
+OPT_SIZE := -Os
+
+#-mthumb -fno-gcse -fno-schedule-insns2
OBJS := $(DATA_OBJS) $(LIBCARTRESET_OBJS) $(PORT_OBJS) $(COMPRESSOR_OBJS) $(FAT_OBJS)
@@ -277,6 +280,9 @@ ndsall:
include $(srcdir)/Makefile.common
+semiclean:
+ $(RM) $(portdir)/source/dsoptions.o $(portdir)/source/dsmain.o $(FAT_OBJS) $(DATA_OBJS) $(portdir)/source/wordcompletion.o
+
clean:
$(RM) $(OBJS) $(EXECUTABLE)
rm -fr $(BUILD)
@@ -330,8 +336,8 @@ endef
ifndef HAVE_GCC3
# If you use GCC, disable the above and enable this for intelligent
# dependency tracking.
-.cpp.o:
-
+#.cpp.o:
+%.o:%.cpp
$(MKDIR) $(*D)/$(DEPDIR)
$(CXX) -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d2" $(CXXFLAGS) $(CPPFLAGS) -c $(<) -o $*.o
# $(ECHO) "$(*D)/" > $(*D)/$(DEPDIR)/$(*F).d
@@ -342,7 +348,8 @@ else
# rule can get you into a bad state if you Ctrl-C at the wrong moment.
# Also, with this GCC inserts additional dummy rules for the involved headers,
# which ensures a smooth compilation even if said headers become obsolete.
-.cpp.o:
+#.cpp.o:
+%.o:%.cpp
# echo !!!!!!!!!!!! $(notdir $<)
# ifeq ( $(notdir $<), $(findstring $(notdir $<), $(OPTLIST)) )
# OPTFLAG=-O3
@@ -354,8 +361,7 @@ else
# echo !!!!!!!! $(OPTFLAG)
$(MKDIR) $(*D)/$(DEPDIR)
- $(CXX) -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d",-MQ,"$@",-MP $(CXXFLAGS) $(CPPFLAGS) -c $(<) -o $*.o
- $(CXX) -MMD -MF "$(*D)/$(DEPDIR)/$(*F).d" $(if $(findstring $(notdir $<), $(OPTLIST)), $(OPT_SPEED), $(OPT_SIZE)) $(CXXFLAGS) $(CPPFLAGS) -c $(<) -o $*.o
+ $(CXX) -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d",-MQ,"$@",-MP $(if $(findstring $(notdir $<), $(OPTLIST)), $(OPT_SPEED), $(OPT_SIZE)) $(CXXFLAGS) $(CPPFLAGS) -c $(<) -o $*.o
endif
diff --git a/backends/platform/ds/arm9/source/adpcm_arm.s b/backends/platform/ds/arm9/source/adpcm_arm.s
index 178a63bb8c..38e8e60c6d 100644
--- a/backends/platform/ds/arm9/source/adpcm_arm.s
+++ b/backends/platform/ds/arm9/source/adpcm_arm.s
@@ -55,14 +55,14 @@ ARM_adpcm
loop:
LDRH r10,[r11,r2] @ r10 = stepTab[stepTableIndex]
TST r12,#4 @ if ((offset & 4) == 0)
- MOVEQ r9, #0 @ r9 = diff = 0
+ MOVEQ r9, #0 @ r9 = diff = 0
MOVNE r9, r10 @ else r9 = diff = stepTab[stepTableIndex]
TST r12,#2 @ if (offset & 2)
- ADDNE r9, r9, r10,ASR #1 @ diff += r10>>1
+ ADDNE r9, r9, r10,ASR #1 @ diff += r10>>1
TST r12,#1 @ if (offset & 1)
- ADDNE r9, r9, r10,ASR #2 @ diff += r10>>2
+ ADDNE r9, r9, r10,ASR #2 @ diff += r10>>2
ADD r9, r9, r10,ASR #3 @ diff += r10>>3
diff --git a/backends/platform/ds/arm9/source/blitters.cpp b/backends/platform/ds/arm9/source/blitters.cpp
index 07c6b3fee1..582e15eb13 100644
--- a/backends/platform/ds/arm9/source/blitters.cpp
+++ b/backends/platform/ds/arm9/source/blitters.cpp
@@ -27,25 +27,25 @@
namespace DS {
-void asmDrawStripToScreen(int height, int width, byte const* text, byte const* src, byte* dst,
+void asmDrawStripToScreen(int height, int width, byte const* text, byte const* src, byte* dst,
int vsPitch, int vmScreenWidth, int textSurfacePitch) {
if (height <= 0) height = 1;
if (width < 4) return;
-
-
+
+
width &= ~4;
// src = (const byte *) (((int) (src)) & (~4));
// dst = (byte *) (((int) (dst)) & (~4));
// text = (const byte *) (((int) (text)) & (~4));
-
+
asm ( "mov r5, %0\n" // Height
- "yLoop:\n"
+ "yLoop:\n"
"mov r3, #0\n" // X pos
-
+
"xLoop:\n"
-
+
"ldr r4, [%2, r3]\n" // Load text layer word
"cmp r4, %5\n"
"bne singleByteCompare\n"
@@ -54,7 +54,7 @@ void asmDrawStripToScreen(int height, int width, byte const* text, byte const* s
"add r3, r3, #4\n"
"cmp r3, %1\n" // x == width?
"blt xLoop\n"
-
+
"add %2, %2, %8\n" // src += vs->pitch
"add %3, %3, %6\n" // dst += _vm->_screenWidth
"add %4, %4, %7\n" // text += _textSurface.pitch
@@ -62,8 +62,8 @@ void asmDrawStripToScreen(int height, int width, byte const* text, byte const* s
"cmp r5, #0\n" // y == 0?
"bne yLoop\n"
"b end\n"
-
-
+
+
"singleByteCompare:\n"
"ldrb r4, [%2, r3]\n" // Load text byte
"cmps r4, %5, lsr #24\n" // Compare with mask
@@ -78,7 +78,7 @@ void asmDrawStripToScreen(int height, int width, byte const* text, byte const* s
"ldreqb r4, [%3, r3]\n" // Otherwise Load src byte
"streqb r4, [%4, r3]\n" // Store it
"add r3, r3, #1\n"
-
+
"ldrb r4, [%2, r3]\n" // Load text byte
"cmps r4, %5, lsr #24\n" // Compare with mask
"strneb r4, [%4, r3]\n" // Store if not equal
@@ -91,7 +91,7 @@ void asmDrawStripToScreen(int height, int width, byte const* text, byte const* s
"strneb r4, [%4, r3]\n" // Store if not equal
"ldreqb r4, [%3, r3]\n" // Otherwise Load src byte
"streqb r4, [%4, r3]\n" // Store it
- "add r3, r3, #1\n"
+ "add r3, r3, #1\n"
"cmps r3, %1\n" // x == width?
"blt xLoop\n" // Repeat
@@ -101,10 +101,10 @@ void asmDrawStripToScreen(int height, int width, byte const* text, byte const* s
"sub r5, r5, #1\n" // y -= 1
"cmp r5, #0\n" // y == 0?
"bne yLoop\n"
-
+
"end:\n"
: /* no output registers */
- : "r" (height), "r" (width), "r" (text), "r" (src), "r" (dst), "r" (CHARSET_MASK_TRANSPARENCY | (CHARSET_MASK_TRANSPARENCY << 8) | (CHARSET_MASK_TRANSPARENCY << 16) | (CHARSET_MASK_TRANSPARENCY << 24)),
+ : "r" (height), "r" (width), "r" (text), "r" (src), "r" (dst), "r" (CHARSET_MASK_TRANSPARENCY | (CHARSET_MASK_TRANSPARENCY << 8) | (CHARSET_MASK_TRANSPARENCY << 16) | (CHARSET_MASK_TRANSPARENCY << 24)),
"r" (vsPitch), "r" (vmScreenWidth), "r" (textSurfacePitch)
: "r5", "r3", "r4", "%2", "%3", "%4", "memory");
}
@@ -115,7 +115,7 @@ void asmCopy8Col(byte* dst, int dstPitch, const byte* src, int height) {
asm("ands r0, %3, #1\n"
"addne %3, %3, #1\n"
"bne roll2\n"
-
+
"yLoop2:\n"
"ldr r0, [%2, #0]\n"
"str r0, [%0, #0]\n"
@@ -131,7 +131,7 @@ void asmCopy8Col(byte* dst, int dstPitch, const byte* src, int height) {
"add %0, %0, %1\n"
"add %2, %2, %1\n"
"subs %3, %3, #2\n"
- "bne yLoop2\n"
+ "bne yLoop2\n"
: /* no output registers */
: "r" (dst), "r" (dstPitch), "r" (src), "r" (height)
@@ -150,7 +150,7 @@ void ComputeDivBy5TableIFN()
for (int i=0; i<160; ++i)
{
DIV_BY_5[i] = (2*i+5)/10;
- }
+ }
}
#ifdef PERFECT_5_TO_4_RESCALING
@@ -163,13 +163,13 @@ static inline void RescaleBlock_5x1555_To_4x1555( u16 s0, u16 s1, u16 s2, u16 s3
u32 bs3 = s3 & 0x1F;
u32 bs4 = s4 & 0x1F;
-#if 0
+#if 0
u32 gs0 = (s0 >> 5) & 0x1F;
u32 gs1 = (s1 >> 5) & 0x1F;
u32 gs2 = (s2 >> 5) & 0x1F;
u32 gs3 = (s3 >> 5) & 0x1F;
u32 gs4 = (s4 >> 5) & 0x1F;
-
+
u32 rs0 = (s0 >> 10) & 0x1F;
u32 rs1 = (s1 >> 10) & 0x1F;
u32 rs2 = (s2 >> 10) & 0x1F;
@@ -191,22 +191,22 @@ static inline void RescaleBlock_5x1555_To_4x1555( u16 s0, u16 s1, u16 s2, u16 s3
asm("and %0, %2, %1, lsr #10" : "=r"(rs3) : "r"(s3), "r"(mask) : );
asm("and %0, %2, %1, lsr #10" : "=r"(rs4) : "r"(s4), "r"(mask) : );
#endif
-
+
u32 rd0 = 4*rs0 + rs1;
u32 rd1 = 2*rs1 + rs1 + 2*rs2;
u32 rd2 = 2*rs2 + 2*rs3 + rs3;
u32 rd3 = rs3 + 4*rs4;
-
+
u32 gd0 = 4*gs0 + gs1;
u32 gd1 = 2*gs1 + gs1 + 2*gs2;
u32 gd2 = 2*gs2 + 2*gs3 + gs3;
u32 gd3 = gs3 + 4*gs4;
-
+
u32 bd0 = 4*bs0 + bs1;
u32 bd1 = 2*bs1 + bs1 + 2*bs2;
u32 bd2 = 2*bs2 + 2*bs3 + bs3;
u32 bd3 = bs3 + 4*bs4;
-
+
#if 0
// Offsetting for correct rounding
rd0 = rd0*2+5; rd1 = rd1*2+5; rd2 = rd2*2+5; rd3 = rd3*2+5;
@@ -217,14 +217,14 @@ static inline void RescaleBlock_5x1555_To_4x1555( u16 s0, u16 s1, u16 s2, u16 s3
gd0 = (gd0 * 51) >> 9; gd1 = (gd1 * 51) >> 9; gd2 = (gd2 * 51) >> 9; gd3 = (gd3 * 51) >> 9;
bd0 = (bd0 * 51) >> 9; bd1 = (bd1 * 51) >> 9; bd2 = (bd2 * 51) >> 9; bd3 = (bd3 * 51) >> 9;
#else
- rd0 = DIV_BY_5[rd0]; rd1 = DIV_BY_5[rd1]; rd2 = DIV_BY_5[rd2]; rd3 = DIV_BY_5[rd3];
- gd0 = DIV_BY_5[gd0]; gd1 = DIV_BY_5[gd1]; gd2 = DIV_BY_5[gd2]; gd3 = DIV_BY_5[gd3];
- bd0 = DIV_BY_5[bd0]; bd1 = DIV_BY_5[bd1]; bd2 = DIV_BY_5[bd2]; bd3 = DIV_BY_5[bd3];
+ rd0 = DIV_BY_5[rd0]; rd1 = DIV_BY_5[rd1]; rd2 = DIV_BY_5[rd2]; rd3 = DIV_BY_5[rd3];
+ gd0 = DIV_BY_5[gd0]; gd1 = DIV_BY_5[gd1]; gd2 = DIV_BY_5[gd2]; gd3 = DIV_BY_5[gd3];
+ bd0 = DIV_BY_5[bd0]; bd1 = DIV_BY_5[bd1]; bd2 = DIV_BY_5[bd2]; bd3 = DIV_BY_5[bd3];
#endif
-
+
u32 d10 = 0x80008000 | (rd1 << 26) | (gd1 << 21) | (bd1 << 16) | (rd0 << 10) | (gd0 << 5) | bd0;
u32 d32 = 0x80008000 | (rd3 << 26) | (gd3 << 21) | (bd3 << 16) | (rd2 << 10) | (gd2 << 5) | bd2;
-
+
((u32*)dest)[0] = d10;
((u32*)dest)[1] = d32;
}
@@ -233,7 +233,7 @@ static inline void RescaleBlock_5x1555_To_4x1555( u16 s0, u16 s1, u16 s2, u16 s3
u16* dest)
{
static const u32 MASK = 0x03E07C1F;
-
+
u32 argbargbs0 = u32(s0) | (u32(s0) << 16);
u32 argbargbs1 = u32(s1) | (u32(s1) << 16);
u32 argbargbs2 = u32(s2) | (u32(s2) << 16);
@@ -245,32 +245,32 @@ static inline void RescaleBlock_5x1555_To_4x1555( u16 s0, u16 s1, u16 s2, u16 s3
u32 grbs2 = argbargbs2 & MASK;
u32 grbs3 = argbargbs3 & MASK;
u32 grbs4 = argbargbs4 & MASK;
-
+
u32 grbd0 = (3*grbs0 + grbs1) >> 2;
u32 grbd1 = ( grbs1 + grbs2) >> 1;
u32 grbd2 = ( grbs2 + grbs3) >> 1;
u32 grbd3 = ( grbs3 + 3*grbs4) >> 2;
-
+
grbd0 &= MASK;
grbd1 &= MASK;
grbd2 &= MASK;
grbd3 &= MASK;
-
+
u32 d0 = grbd0 | (grbd0 >> 16);
u32 d1 = grbd1 | (grbd1 >> 16);
u32 d2 = grbd2 | (grbd2 >> 16);
u32 d3 = grbd3 | (grbd3 >> 16);
-
- d0 &= 0xFFFF;
- d1 &= 0xFFFF;
- d2 &= 0xFFFF;
- d3 &= 0xFFFF;
-
- d0 |= 0x8000;
- d1 |= 0x8000;
- d2 |= 0x8000;
- d3 |= 0x8000;
-
+
+ d0 &= 0xFFFF;
+ d1 &= 0xFFFF;
+ d2 &= 0xFFFF;
+ d3 &= 0xFFFF;
+
+ d0 |= 0x8000;
+ d1 |= 0x8000;
+ d2 |= 0x8000;
+ d3 |= 0x8000;
+
dest[0] = d0;
dest[1] = d1;
dest[2] = d2;
@@ -287,13 +287,13 @@ static inline void RescaleBlock_5x8888_To_4x1555( u32 s0, u32 s1, u32 s2, u32 s3
u32 bd0 = (d0 << 24) >> 24;
u32 bd1 = (d1 << 24) >> 24;
u32 gd0 = (d0 << 16) >> 24;
- u32 gd1 = (d1 << 16) >> 24;
+ u32 gd1 = (d1 << 16) >> 24;
u32 rd0 = (d0 >> 16);
u32 rd1 = (d1 >> 16);
-
+
rd0 = DIV_BY_5[rd0]; rd1 = DIV_BY_5[rd1];
gd0 = DIV_BY_5[gd0]; gd1 = DIV_BY_5[gd1];
- bd0 = DIV_BY_5[bd0]; bd1 = DIV_BY_5[bd1];
+ bd0 = DIV_BY_5[bd0]; bd1 = DIV_BY_5[bd1];
u32 d10 = 0x80008000 | (rd1 << 26) | (gd1 << 21) | (bd1 << 16) | (rd0 << 10) | (gd0 << 5) | bd0;
((u32*)dest)[0] = d10;
@@ -307,11 +307,11 @@ static inline void RescaleBlock_5x8888_To_4x1555( u32 s0, u32 s1, u32 s2, u32 s3
u32 rd2 = (d2 >> 16);
u32 rd3 = (d3 >> 16);
- rd2 = DIV_BY_5[rd2]; rd3 = DIV_BY_5[rd3];
- gd2 = DIV_BY_5[gd2]; gd3 = DIV_BY_5[gd3];
- bd2 = DIV_BY_5[bd2]; bd3 = DIV_BY_5[bd3];
+ rd2 = DIV_BY_5[rd2]; rd3 = DIV_BY_5[rd3];
+ gd2 = DIV_BY_5[gd2]; gd3 = DIV_BY_5[gd3];
+ bd2 = DIV_BY_5[bd2]; bd3 = DIV_BY_5[bd3];
u32 d32 = 0x80008000 | (rd3 << 26) | (gd3 << 21) | (bd3 << 16) | (rd2 << 10) | (gd2 << 5) | bd2;
-
+
((u32*)dest)[1] = d32;
}
@@ -320,7 +320,7 @@ static inline void RescaleBlock_5x8888_To_4x1555( u32 s0, u32 s1, u32 s2, u32 s3
static inline void Rescale_320xPAL8Scanline_To_256x1555Scanline(u16* dest, const u8* src, const u32* palette)
{
ComputeDivBy5TableIFN();
-
+
for (size_t i=0; i<64; ++i)
{
u32 s0 = palette[src[5*i+0]];
@@ -353,7 +353,7 @@ static inline void Rescale_320xPAL8Scanline_To_256x1555Scanline(u16* dest, const
static inline void Rescale_320x1555Scanline_To_256x1555Scanline(u16* dest, const u16* src)
{
ComputeDivBy5TableIFN();
-
+
for (size_t i=0; i<64; ++i)
{
u16 s0 = src[5*i+0];
@@ -384,7 +384,7 @@ void Rescale_320x256xPAL8_To_256x256x1555(u16* dest, const u8* src, int destStri
for (size_t i=0; i<200; ++i)
{
- Rescale_320xPAL8Scanline_To_256x1555Scanline(dest + i*destStride, src + i *srcStride, fastRam);
+ Rescale_320xPAL8Scanline_To_256x1555Scanline(dest + i*destStride, src + i *srcStride, fastRam);
}
}
#else
@@ -396,7 +396,7 @@ void Rescale_320x256xPAL8_To_256x256x1555(u16* dest, const u8* src, int destStri
for (size_t i=0; i<200; ++i)
{
- Rescale_320xPAL8Scanline_To_256x1555Scanline(dest + i*destStride, src + i *srcStride, fastRam);
+ Rescale_320xPAL8Scanline_To_256x1555Scanline(dest + i*destStride, src + i *srcStride, fastRam);
}
}
#endif
diff --git a/backends/platform/ds/arm9/source/blitters.h b/backends/platform/ds/arm9/source/blitters.h
index 7434a58efd..463aa2ac02 100644
--- a/backends/platform/ds/arm9/source/blitters.h
+++ b/backends/platform/ds/arm9/source/blitters.h
@@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
-
+
#ifndef _BLITTERS_H_
#define _BLITTERS_H_
@@ -29,22 +29,22 @@
namespace DS {
-void asmDrawStripToScreen(int height, int width, byte const* text, byte const* src, byte* dst,
+void asmDrawStripToScreen(int height, int width, byte const* text, byte const* src, byte* dst,
int vsPitch, int vmScreenWidth, int textSurfacePitch);
void asmCopy8Col(byte* dst, int dstPitch, const byte* src, int height);
void Rescale_320x256xPAL8_To_256x256x1555(u16* dest, const u8* src, int destStride, int srcStride, const u16* palette);
void Rescale_320x256x1555_To_256x256x1555(u16* dest, const u16* src, int destStride, int srcStride);
}
-
+
#else
extern "C" {
-void asmDrawStripToScreen(int height, int width, byte const* text, byte const* src, byte* dst,
+void asmDrawStripToScreen(int height, int width, byte const* text, byte const* src, byte* dst,
int vsPitch, int vmScreenWidth, int textSurfacePitch);
void asmCopy8Col(byte* dst, int dstPitch, const byte* src, int height);
-void Rescale_320x256xPAL8_To_256x256x1555(u16* dest, const u8* src, int destStride, int srcStride, const u16* palette);
+void Rescale_320x256xPAL8_To_256x256x1555(u16* dest, const u8* src, int destStride, int srcStride, const u16* palette, u32 numLines);
void Rescale_320x256x1555_To_256x256x1555(u16* dest, const u16* src, int destStride, int srcStride);
}
diff --git a/backends/platform/ds/arm9/source/blitters.s b/backends/platform/ds/arm9/source/blitters.s
index 40b8782eec..2f14c5a140 100644
--- a/backends/platform/ds/arm9/source/blitters.s
+++ b/backends/platform/ds/arm9/source/blitters.s
@@ -21,7 +21,7 @@
@ @author Robin Watts (robin@wss.co.uk)
.text
-
+
.global asmDrawStripToScreen
.global asmCopy8Col
.global Rescale_320x256xPAL8_To_256x256x1555
@@ -142,7 +142,7 @@ asmCopy8Col:
@ r3 = height
STMFD r13!,{r14}
SUB r1,r1,#4
-
+
TST r3,#1
ADDNE r3,r3,#1
BNE roll2
@@ -177,7 +177,7 @@ Rescale_320x256x1555_To_256x256x1555:
@ r2 = dstStride
@ r3 = srcStride
STMFD r13!,{r4-r5,r8-r11,r14}
-
+
SUB r2,r2,#64*5 @ srcStride -= line length
SUB r3,r3,#64*4 @ dstStride -= line length
@@ -187,7 +187,7 @@ Rescale_320x256x1555_To_256x256x1555:
MOV r5, #200 @ r5 = y
yLoop3:
MOV r4, #64 @ r4 = x
-xLoop3:
+xLoop3:
LDRH r9, [r0],#2 @ r9 = src0
LDRH r10,[r0],#2 @ r10= src1
LDRH r11,[r0],#2 @ r11= src2
@@ -212,7 +212,7 @@ xLoop3:
ADD r11,r11,r12 @ r11= dst2
ADD r12,r12,r14 @ r12= src3 + src4
ADD r12,r12,r14,LSL #1 @ r12= src3 + src4*3 = dst3<<2
-
+
AND r9, r8, r9, LSR #2 @ r9 = dst0 (split)
AND r10,r8, r10,LSR #1 @ r10= dst1 (split)
AND r11,r8, r11,LSR #1 @ r11= dst2 (split)
@@ -227,7 +227,7 @@ xLoop3:
ORR r10,r10,#0x8000
ORR r11,r11,#0x8000
ORR r12,r12,#0x8000
-
+
STRH r9, [r1],#2
STRH r10,[r1],#2
STRH r11,[r1],#2
@@ -235,7 +235,7 @@ xLoop3:
SUBS r4,r4,#1
BGT xLoop3
-
+
ADD r0,r0,r2,LSL #1
ADD r1,r2,r3,LSL #1
SUBS r5,r5,#1
@@ -266,7 +266,7 @@ Rescale_320x256xPAL8_To_256x256x1555:
ORR r8, r8,#0x00007C00
ORR r8, r8,#0x03E00000 @ r8 = mask
LDR r9, [r13,#7*4] @ r9 = palette
-
+
SUB r13,r13,#256*4 @ r13 = 1K of space on the stack.
MOV r5, r13 @ r5 points to this space
MOV r14,#256
@@ -277,14 +277,14 @@ palLoop:
AND r10,r10,r8 @ r10 = separated palette entry
STR r10,[r5], #4
BGT palLoop
-
+
SUB r2,r2,#64*5 @ srcStride -= line length
SUB r3,r3,#64*4 @ dstStride -= line length
MOV r5,#200 @ r5 = y
yLoop4:
MOV r4,#64 @ r4 = x
-xLoop4:
+xLoop4:
LDRB r9, [r0],#1 @ r9 = src0
LDRB r10,[r0],#1 @ r10= src1
LDRB r11,[r0],#1 @ r11= src2
@@ -303,7 +303,7 @@ xLoop4:
ADD r11,r11,r12 @ r11= dst2
ADD r12,r12,r14 @ r12= src3 + src4
ADD r12,r12,r14,LSL #1 @ r12= src3 + src4*3 = dst3<<2
-
+
AND r9, r8, r9, LSR #2 @ r9 = dst0 (split)
AND r10,r8, r10,LSR #1 @ r10= dst1 (split)
AND r11,r8, r11,LSR #1 @ r11= dst2 (split)
@@ -318,7 +318,7 @@ xLoop4:
ORR r10,r10,#0x8000
ORR r11,r11,#0x8000
ORR r12,r12,#0x8000
-
+
STRH r9, [r1],#2
STRH r10,[r1],#2
STRH r11,[r1],#2
@@ -326,7 +326,7 @@ xLoop4:
SUBS r4,r4,#1
BGT xLoop4
-
+
ADD r0,r0,r2
ADD r1,r2,r3,LSL #1
SUBS r5,r5,#1
@@ -336,4 +336,4 @@ xLoop4:
LDMFD r13!,{r4-r5,r8-r11,PC}
-
+
diff --git a/backends/platform/ds/arm9/source/blitters_arm.s b/backends/platform/ds/arm9/source/blitters_arm.s
index fa7613929b..5f7df298b4 100644
--- a/backends/platform/ds/arm9/source/blitters_arm.s
+++ b/backends/platform/ds/arm9/source/blitters_arm.s
@@ -251,8 +251,8 @@ xLoop3:
@ const u8 *src,
@ int dstStride,
@ int srcStride,
- @ const u16 *pal);
- @
+ @ const u16 *pal,
+ @ u32 numLines);
Rescale_320x256xPAL8_To_256x256x1555:
@ r0 = dst
@ r1 = src
@@ -263,6 +263,7 @@ Rescale_320x256xPAL8_To_256x256x1555:
ORR r8, r8,#0x0000FC00
ORR r8, r8,#0x03E00000 @ r8 = mask
LDR r9, [r13,#9*4] @ r9 = palette
+ LDR r7, [r13,#10*4] @ r7 = numLines
SUB r13,r13,#256*4 @ r13 = 1K of space on the stack.
MOV r5, r13 @ r5 points to this space
@@ -280,7 +281,7 @@ palLoop:
SUB r3,r3,#64*5 @ dstStride -= line length
MOV r14,#0xFF @ r14= 255
- MOV r5,#200 @ r5 = y
+ MOV r5,r7 @ r5 = numLines
yLoop4:
MOV r4,#16 @ r4 = x
xLoop4:
@@ -292,7 +293,7 @@ xLoop4:
ADD r6, r6, r6, LSL #1 @ r6 = 3*pal[src0]
AND r9, r14,r10,LSR #16 @ r9 = src2
LDR r9, [r13,r9, LSL #2] @ r9 = pal[src2]
- MOV r10,r10,LSR #24 @ r10= src3
+ MOV r10,r10,LSR #24 @ r10= src3
LDR r10,[r13,r10,LSL #2] @ r10= pal[src3]
ADD r6, r6, r7 @ r6 = dst0<<2
AND r6, r8, r6, LSR #2 @ r6 = dst0 (split)
@@ -322,7 +323,7 @@ xLoop4:
ADD r6, r6, r6, LSL #1 @ r6 = 3*pal[src5]
MOV r9, r11,LSR #24 @ r9 = src7
LDR r9, [r13,r9, LSL #2] @ r9 = pal[src7]
- AND r10,r14,r12 @ r10= src8
+ AND r10,r14,r12 @ r10= src8
LDR r10,[r13,r10,LSL #2] @ r10= pal[src8]
ADD r6, r6, r7 @ r6 = dst4<<2
AND r6, r8, r6, LSR #2 @ r6 = dst4 (split)
@@ -354,7 +355,7 @@ xLoop4:
ADD r6, r6, r6, LSL #1 @ r6 = 3*pal[src10]
AND r9, r14,r10 @ r9 = src12
LDR r9, [r13,r9, LSL #2] @ r9 = pal[src12]
- AND r12,r14,r10,LSR #8 @ r11= src13
+ AND r12,r14,r10,LSR #8 @ r11= src13
LDR r12,[r13,r12,LSL #2] @ r11= pal[src13]
ADD r6, r6, r7 @ r6 = dst8<<2
AND r6, r8, r6, LSR #2 @ r6 = dst8 (split)
@@ -384,7 +385,7 @@ xLoop4:
ADD r6, r6, r6, LSL #1 @ r6 = 3*pal[src15]
AND r9, r14,r11,LSR #8 @ r9 = src17
LDR r9, [r13,r9, LSL #2] @ r9 = pal[src17]
- AND r12,r14,r11,LSR #16 @ r11= src18
+ AND r12,r14,r11,LSR #16 @ r11= src18
LDR r12,[r13,r12,LSL #2] @ r11= pal[src18]
ADD r6, r6, r7 @ r6 = dst12<<2
AND r6, r8, r6, LSR #2 @ r6 = dst12 (split)
diff --git a/backends/platform/ds/arm9/source/cdaudio.cpp b/backends/platform/ds/arm9/source/cdaudio.cpp
index e8c9f55ef1..56ac4e8c09 100644
--- a/backends/platform/ds/arm9/source/cdaudio.cpp
+++ b/backends/platform/ds/arm9/source/cdaudio.cpp
@@ -19,10 +19,10 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
-
+
#include "cdaudio.h"
-#include "ds-fs.h"
-#include "config-manager.h"
+#include "backends/fs/ds/ds-fs.h"
+#include "common/config-manager.h"
#include "dsmain.h"
#include "NDS/scummvm_ipc.h"
#include "console2.h"
@@ -53,14 +53,14 @@ struct WaveHeader {
u16 fmtExtraData; // Number of extra fmt bytes
u16 fmtExtra; // Samples per block (only for IMA-ADPCM files)
} __attribute__ ((packed));
-
+
struct chunkHeader {
- char name[4];
+ char name[4];
u32 size;
} __attribute__ ((packed));
struct Header {
- s16 firstSample;
+ s16 firstSample;
char stepTableIndex;
char reserved;
} __attribute__ ((packed));
@@ -112,7 +112,7 @@ void decompressBlock();
void allocBuffers() {
-
+
}
void setActive(bool active) {
@@ -125,17 +125,17 @@ bool getActive() {
void playTrack(int track, int numLoops, int startFrame, int duration) {
Common::String path = ConfMan.get("path");
-
+
if (isPlayingFlag) {
stopTrack();
}
-
+
if (trackStartsAt2) {
track++;
}
-
-
-
+
+
+
char str[100];
if (path[strlen(path.c_str()) - 1] == '/') {
@@ -145,50 +145,50 @@ void playTrack(int track, int numLoops, int startFrame, int duration) {
sprintf(str, "/track%d.wav", track);
path = path + str;
}
-
-
+
+
//1820160
-
+
file = DS::std_fopen(path.c_str(), "rb");
-
+
if (!file) {
consolePrintf("Failed to open %s!\n", path.c_str());
return;
}
-
-
+
+
DS::std_fread((const void *) &waveHeader, sizeof(waveHeader), 1, file);
-
+
consolePrintf("Playing track %d\n", track);
consolePrintf("Format: %d\n", waveHeader.fmtFormatTag);
consolePrintf("Rate : %d\n", waveHeader.fmtSamPerSec);
consolePrintf("Bits : %d\n", waveHeader.fmtBitsPerSam);
consolePrintf("BlkSz : %d\n", waveHeader.fmtExtra);
-
+
if ((waveHeader.fmtFormatTag != 17) && (waveHeader.fmtFormatTag != 20)) {
consolePrintf("Wave file is in the wrong format! You must use IMA-ADPCM 4-bit mono.\n");
DS::std_fclose(file);
return;
}
-
+
for (int r = 0; r < 8; r++) {
IPC->adpcm.buffer[r] = (u8 * volatile) (decoderFormat *) malloc(waveHeader.fmtBlockAlign);
IPC->adpcm.filled[r] = false;
IPC->adpcm.arm7Dirty[r] = false;
}
-
+
// Skip chunks until we reach the data chunk
chunkHeader chunk;
DS::std_fread((const void *) &chunk, sizeof(chunkHeader), 1, file);
-
+
while (!((chunk.name[0] == 'd') && (chunk.name[1] == 'a') && (chunk.name[2] == 't') && (chunk.name[3] == 'a'))) {
DS::std_fseek(file, chunk.size, SEEK_CUR);
DS::std_fread((const void *) &chunk, sizeof(chunkHeader), 1, file);
}
-
+
dataChunkStart = DS::std_ftell(file);
-
-
+
+
static bool started = false;
sampleNum = 0;
blockCount = 0;
@@ -206,35 +206,35 @@ void playTrack(int track, int numLoops, int startFrame, int duration) {
memset(audioBuffer, 0, BUFFER_SIZE * 2);
memset(decompressionBuffer, 0, waveHeader.fmtExtra * 2);
DS::playSound(audioBuffer, BUFFER_SIZE * 2, false, false, waveHeader.fmtSamPerSec);
-
- }
+
+ }
fillPos = (IPC->streamPlayingSection + 1) & 3;
isPlayingFlag = true;
-
-
+
+
// Startframe is a 75Hz timer. Dunno why, since nothing else
// seems to run at that rate.
int tenths = (startFrame * 10) / 75;
-
+
// Seek to the nearest block start to the start time
int samples = (tenths * waveHeader.fmtSamPerSec) / 10;
int block = samples / waveHeader.fmtExtra;
-
-
+
+
if (duration == 0) {
blocksLeft = 0;
} else {
blocksLeft = ((((duration * 100) / 75) * (waveHeader.fmtSamPerSec)) / (waveHeader.fmtExtra) / 100) + 10;
}
// consolePrintf("Playing %d blocks (%d)\n\n", blocksLeft, duration);
-
+
// No need to seek if we're starting from the beginning
if (block != 0) {
DS::std_fseek(file, dataChunkStart + block * waveHeader.fmtBlockAlign, SEEK_SET);
// consolePrintf("Startframe: %d msec: %d (%d,%d)\n", startFrame, tenthssec, samples, block);
}
-
-
+
+
//decompressBlock();
playNextBlock();
DS::CD::numLoops = numLoops;
@@ -252,21 +252,21 @@ extern "C" void ARM_adcpm(int *block, int len, int stepTableIndex,
void decompressBlock() {
int block[2048];
bool loop = false;
-
+
blockCount++;
-
+
if (blockCount < 10) return;
-
-
+
+
do {
DS::std_fread((const void *) &blockHeader, sizeof(blockHeader), 1, file);
-
+
DS::std_fread(&block[0], waveHeader.fmtBlockAlign - sizeof(blockHeader), 1, file);
if (DS::std_feof(file) ) {
// Reached end of file, so loop
-
-
+
+
if ((numLoops == -1) || (numLoops > 1)) {
// Seek file to first packet
if (numLoops != -1) {
@@ -283,14 +283,14 @@ void decompressBlock() {
stopTrack();
return;
}
-
+
} else {
loop = false;
}
-
+
} while (loop);
-
-
+
+
if (blocksLeft > 0) {
blocksLeft--;
// consolePrintf("%d ", blocksLeft);
@@ -305,37 +305,37 @@ void decompressBlock() {
blockHeader.stepTableIndex,
blockHeader.firstSample,
decompressionBuffer);
-#else
+#else
// First sample is in header
decompressionBuffer[0] = blockHeader.firstSample;
-
+
// Set up initial table indeces
int stepTableIndex = blockHeader.stepTableIndex;
int prevSample = blockHeader.firstSample;
-
+
// consolePrintf("Decompressing block step=%d fs=%d\n", stepTableIndex, prevSample);
for (int r = 0; r < waveHeader.fmtExtra - 1; r++) {
-
+
int word = block[r >> 3];
int offset = 0;
-
+
switch (7 - (r & 0x0007)) {
case 0: {
offset = (word & 0xF0000000) >> 28;
break;
}
-
+
case 1: {
offset = (word & 0x0F000000) >> 24;
break;
}
-
+
case 2: {
offset = (word & 0x00F00000) >> 20;
break;
}
-
+
case 3: {
offset = (word & 0x000F0000) >> 16;
break;
@@ -361,41 +361,41 @@ void decompressBlock() {
break;
}
}
-
+
int diff = 0;
-
+
if (offset & 4) {
diff = diff + stepTab[stepTableIndex];
}
-
+
if (offset & 2) {
diff = diff + (stepTab[stepTableIndex] >> 1);
}
-
+
if (offset & 1) {
diff = diff + (stepTab[stepTableIndex] >> 2);
}
-
+
diff = diff + (stepTab[stepTableIndex] >> 3);
-
+
if (offset & 8) {
- diff = -diff;
+ diff = -diff;
}
-
+
int newSample = prevSample + diff;
-
+
if (newSample > 32767) newSample = 32767;
if (newSample < -32768) newSample = -32768;
-
+
decompressionBuffer[r + 1] = newSample;
-
+
prevSample = newSample;
-
+
stepTableIndex += indexTab[offset];
-
+
if (stepTableIndex > 88) stepTableIndex = 88;
if (stepTableIndex < 0) stepTableIndex = 0;
-
+
}
#endif
@@ -404,21 +404,21 @@ void decompressBlock() {
void playNextBlock() {
if (!isPlayingFlag) return;
int lastBlockId = -1;
-
+
while (IPC->adpcm.semaphore); // Wait for buffer to become free if needed
IPC->adpcm.semaphore = true; // Lock the buffer structure to prevent clashing with the ARM7
// DC_FlushAll();
-
+
//-8644, 25088
for (int block = fillPos + 1; block < fillPos + 4; block++) {
int blockId = block & 3;
-
+
if (IPC->streamFillNeeded[blockId]) {
-
+
IPC->streamFillNeeded[blockId] = false;
// DC_FlushAll();
-
+
/* if (!(REG_KEYINPUT & KEY_R)) {
//consolePrintf("Align: %d First: %d Step:%d Res:%d\n", waveHeader.fmtBlockAlign, blockHeader.firstSample, blockHeader.stepTableIndex, blockHeader.reserved);
consolePrintf("Filling buffer %d\n", blockId);
@@ -432,19 +432,19 @@ void playNextBlock() {
}
}
}
-
+
lastBlockId = blockId;
IPC->streamFillNeeded[blockId] = false;
// DC_FlushAll();
}
-
-
-
+
+
+
}
-
-
-
+
+
+
if (lastBlockId != -1) {
fillPos = lastBlockId;
/* if (!(REG_KEYINPUT & KEY_R)) {
@@ -459,18 +459,18 @@ void stopTrack() {
if (!isPlayingFlag) return;
DS::std_fclose(file);
-
+
isPlayingFlag = false;
-
+
for (int r = 0; r < BUFFER_SIZE; r++) {
audioBuffer[r] = 0;
}
-
+
for (int r= 0; r < waveHeader.fmtExtra; r++) {
decompressionBuffer[r] = 0;
}
// DS::stopSound(1);
-
+
// free(audioBuffer);
// free(decompressionBuffer);
@@ -507,7 +507,7 @@ bool trackExists(int num) {
bool checkCD() {
// Need to check whethe CD audio files are present - do this by trying to open Track1.wav.
consolePrintf("Attempted to open cd drive\n");
-
+
if (trackExists(1)) {
trackStartsAt2 = false;
return true;
diff --git a/backends/platform/ds/arm9/source/cdaudio.h b/backends/platform/ds/arm9/source/cdaudio.h
index a4a1a0bce9..d237569bb7 100644
--- a/backends/platform/ds/arm9/source/cdaudio.h
+++ b/backends/platform/ds/arm9/source/cdaudio.h
@@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
-
+
#ifndef _CDAUDIO_H_
#define _CDAUDIO_H_
diff --git a/backends/platform/ds/arm9/source/compressor/lz.h b/backends/platform/ds/arm9/source/compressor/lz.h
index dc10210742..e7ea1567ca 100644
--- a/backends/platform/ds/arm9/source/compressor/lz.h
+++ b/backends/platform/ds/arm9/source/compressor/lz.h
@@ -48,53 +48,3 @@ void LZ_Uncompress( unsigned char *in, unsigned char *out,
#endif /* _lz_h_ */
-/*************************************************************************
-* Name: lz.h
-* Author: Marcus Geelnard
-* Description: LZ77 coder/decoder interface.
-* Reentrant: Yes
-* $Id$
-*-------------------------------------------------------------------------
-* Copyright (c) 2003-2004 Marcus Geelnard
-*
-* This software is provided 'as-is', without any express or implied
-* warranty. In no event will the authors be held liable for any damages
-* arising from the use of this software.
-*
-* Permission is granted to anyone to use this software for any purpose,
-* including commercial applications, and to alter it and redistribute it
-* freely, subject to the following restrictions:
-*
-* 1. The origin of this software must not be misrepresented; you must not
-* claim that you wrote the original software. If you use this software
-* in a product, an acknowledgment in the product documentation would
-* be appreciated but is not required.
-*
-* 2. Altered source versions must be plainly marked as such, and must not
-* be misrepresented as being the original software.
-*
-* 3. This notice may not be removed or altered from any source
-* distribution.
-*
-* Marcus Geelnard
-* marcus.geelnard at home.se
-*************************************************************************/
-
-#ifndef _lz_h_
-#define _lz_h_
-
-
-
-/*************************************************************************
-* Function prototypes
-*************************************************************************/
-
-int LZ_Compress( unsigned char *in, unsigned char *out,
- unsigned int insize );
-int LZ_CompressFast( unsigned char *in, unsigned char *out,
- unsigned int insize, unsigned int *work );
-void LZ_Uncompress( unsigned char *in, unsigned char *out,
- unsigned int insize );
-
-
-#endif /* _lz_h_ */
diff --git a/backends/platform/ds/arm9/source/console2.h b/backends/platform/ds/arm9/source/console2.h
index 86434dcb93..6b9a677cc7 100644
--- a/backends/platform/ds/arm9/source/console2.h
+++ b/backends/platform/ds/arm9/source/console2.h
@@ -25,7 +25,7 @@
//
// Changelog:
// 0.1: First version
-// 0.2: Fixed sprite mapping bug. 1D mapping should work now.
+// 0.2: Fixed sprite mapping bug. 1D mapping should work now.
// Changed some register defines for consistency.
//
//////////////////////////////////////////////////////////////////////
@@ -87,7 +87,7 @@ void consoleClear(void);
//
// Changelog:
// 0.1: First version
-// 0.2: Fixed sprite mapping bug. 1D mapping should work now.
+// 0.2: Fixed sprite mapping bug. 1D mapping should work now.
// Changed some register defines for consistency.
//
//////////////////////////////////////////////////////////////////////
diff --git a/backends/platform/ds/arm9/source/dsmain.cpp b/backends/platform/ds/arm9/source/dsmain.cpp
index d11e4e6f75..a130509e36 100644
--- a/backends/platform/ds/arm9/source/dsmain.cpp
+++ b/backends/platform/ds/arm9/source/dsmain.cpp
@@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
-
+
// - Remove scummconsole.c
// - Delete files
@@ -55,6 +55,11 @@
// - Alternative controls?
+// - Fix 512x256 backbuffer to 320x240 - Done
+// - Fix keyboard appearing on wrong screen - Done
+// - Volume amplify option
+// - Make save/restore game screen use scaler buffer
+
//#define USE_LIBCARTRESET
@@ -66,12 +71,11 @@
#include <stdlib.h>
#include "dsmain.h"
#include "string.h"
-#include "system.h"
#include "osystem_ds.h"
#include "icons_raw.h"
-#include "gba_nds_fat.h"
-#include "disc_io.h"
-#include "config-manager.h"
+#include "fat/gba_nds_fat.h"
+#include "fat/disc_io.h"
+#include "common/config-manager.h"
#include "engines/scumm/scumm.h"
#include "keyboard_raw.h"
#include "keyboard_pal_raw.h"
@@ -84,14 +88,13 @@
#include "user_debugger.h"
#endif
#include "ramsave.h"
-#include "disc_io.h"
#include "blitters.h"
#include "cartreset_nolibfat.h"
#include "keys.h"
#ifdef USE_PROFILER
#include "profiler/cyg-profile.h"
#endif
-#include "ds-fs.h"
+#include "backends/fs/ds/ds-fs.h"
namespace DS {
@@ -158,7 +161,6 @@ bool bufferFirstHalf;
bool bufferSecondHalf;
// Saved buffers
-u8* savedBuffer = NULL;
bool highBuffer;
bool displayModeIs8Bit = false;
@@ -211,36 +213,41 @@ int gameHeight = 200;
// Scale
bool twoHundredPercentFixedScale = false;
bool cpuScalerEnable = false;
-#define NUM_SUPPORTED_GAMES 17
+#define NUM_SUPPORTED_GAMES 20
#ifdef USE_PROFILER
int hBlankCount = 0;
#endif
+u8* scalerBackBuffer = NULL;
+
gameListType gameList[NUM_SUPPORTED_GAMES] = {
// Unknown game - use normal SCUMM controls
- {"unknown", CONT_SCUMM_ORIGINAL},
-
+ {"unknown", CONT_SCUMM_ORIGINAL},
+
// SCUMM games
{"maniac", CONT_SCUMM_ORIGINAL},
{"zak", CONT_SCUMM_ORIGINAL},
{"loom", CONT_SCUMM_ORIGINAL},
{"indy3", CONT_SCUMM_ORIGINAL},
- {"atlantis", CONT_SCUMM_ORIGINAL},
+ {"atlantis", CONT_SCUMM_ORIGINAL},
{"monkey", CONT_SCUMM_ORIGINAL},
{"monkey2", CONT_SCUMM_ORIGINAL},
- {"tentacle", CONT_SCUMM_ORIGINAL},
+ {"tentacle", CONT_SCUMM_ORIGINAL},
{"samnmax", CONT_SCUMM_SAMNMAX},
-
+
// Non-SCUMM games
{"sky", CONT_SKY},
{"simon1", CONT_SIMON},
{"simon2", CONT_SIMON},
- {"gob", CONT_GOBLINS},
+ {"gob", CONT_GOBLINS},
{"queen", CONT_SCUMM_ORIGINAL},
{"cine", CONT_FUTURE_WARS},
- {"agi", CONT_AGI}
+ {"agi", CONT_AGI},
+ {"elvira2", CONT_SIMON},
+ {"elvira1", CONT_SIMON},
+ {"waxworks", CONT_SIMON},
};
gameListType* currentGame = NULL;
@@ -277,13 +284,14 @@ void updateStatus();
void triggerIcon(int imageNum);
void setIcon(int num, int x, int y, int imageNum, int flags, bool enable);
void setIconMain(int num, int x, int y, int imageNum, int flags, bool enable);
+void uploadSpriteGfx();
TransferSound soundControl;
bool isCpuScalerEnabled()
{
- return cpuScalerEnable;
+ return cpuScalerEnable || !displayModeIs8Bit;
}
@@ -298,11 +306,11 @@ void setCpuScalerEnable(bool enable) {
//plays an 8 bit mono sample at 11025Hz
void playSound(const void* data, u32 length, bool loop, bool adpcm, int rate)
{
-
+
if (!IPC->soundData) {
soundControl.count = 0;
}
-
+
soundControl.data[soundControl.count].data = data;
soundControl.data[soundControl.count].len = length | (loop? 0x80000000: 0x00000000);
soundControl.data[soundControl.count].rate = rate; // 367 samples per frame
@@ -322,8 +330,14 @@ void stopSound(int channel) {
void updateOAM() {
DC_FlushAll();
- dmaCopy(sprites, OAM_SUB, 128 * sizeof(SpriteEntry));
- dmaCopy(spritesMain, OAM, 128 * sizeof(SpriteEntry));
+
+ if (gameScreenSwap) {
+ dmaCopy(sprites, OAM, 128 * sizeof(SpriteEntry));
+ dmaCopy(spritesMain, OAM_SUB, 128 * sizeof(SpriteEntry));
+ } else {
+ dmaCopy(sprites, OAM_SUB, 128 * sizeof(SpriteEntry));
+ dmaCopy(spritesMain, OAM, 128 * sizeof(SpriteEntry));
+ }
}
void setGameSize(int width, int height) {
@@ -344,67 +358,31 @@ void initSprites() {
sprites[i].attribute[0] = ATTR0_DISABLED;
sprites[i].attribute[1] = 0;
sprites[i].attribute[2] = 0;
- sprites[i].attribute[3] = 0;
+ sprites[i].filler = 0;
}
-
+
for (int i = 0; i < 128; i++) {
spritesMain[i].attribute[0] = ATTR0_DISABLED;
spritesMain[i].attribute[1] = 0;
spritesMain[i].attribute[2] = 0;
- spritesMain[i].attribute[3] = 0;
+ spritesMain[i].filler = 0;
}
-
+
updateOAM();
}
void saveGameBackBuffer() {
-#ifndef ENABLE_SCUMM
- if (savedBuffer == NULL) savedBuffer = new u8[gameWidth * gameHeight];
- for (int r = 0; r < gameHeight; r++) {
-
- u16* dst = (u16 *) (savedBuffer + (r * gameWidth));
- u16* src = BG_GFX_SUB + (r * 256);
- for (int x = 0; x < gameWidth >> 1; x++)
- {
- *dst++ = *src++;
- }
- }
-#endif
+ // Sometimes the only copy of the game screen is in video memory.
+ // So, I lock the video memory here, as if I'm going to modify it. This
+ // forces OSystem_DS to create a system memory copy if one doesn't exist.
+ // This will be automatially resotred by OSystem_DS::updateScreen().
+
+ OSystem_DS::instance()->lockScreen();
+ OSystem_DS::instance()->unlockScreen();
}
-void restoreGameBackBuffer() {
-#ifndef ENABLE_SCUMM
- if (savedBuffer) {
- for (int r = 0; r < gameHeight; r++) {
-
- u16* dst = get8BitBackBuffer() + (r * 256);
- u16* dst2 = BG_GFX_SUB + (r * 256);
- u16* src = ((u16 *) (savedBuffer)) + (r * (gameWidth >> 1));
-
- for (int x = 0; x < gameWidth >> 1; x++)
- {
- *dst++ = *src;
- *dst2++ = *src++;
- }
-
- }
-
- delete savedBuffer;
- savedBuffer = NULL;
- }
-#else
- memset(get8BitBackBuffer(), 0, 512 * 256);
- memset(BG_GFX_SUB, 0, 512 * 256);
- if (Scumm::g_scumm) {
- Scumm::g_scumm->markRectAsDirty(Scumm::kMainVirtScreen, 0, gameWidth - 1, 0, gameHeight - 1, 1);
- Scumm::g_scumm->markRectAsDirty(Scumm::kTextVirtScreen, 0, gameWidth - 1, 0, gameHeight - 1, 1);
- Scumm::g_scumm->markRectAsDirty(Scumm::kVerbVirtScreen, 0, gameWidth - 1, 0, gameHeight - 1, 1);
- }
-#endif
-
-}
void startSound(int freq, int buffer) {
@@ -414,22 +392,22 @@ void startSound(int freq, int buffer) {
bufferFirstHalf = false;
bufferSecondHalf = true;
-
+
int bytes = (2 * (bufferSamples)) + 100;
-
+
soundBuffer = (s16 *) malloc(bytes * 2);
if (!soundBuffer)
consolePrintf("Sound buffer alloc failed\n");
soundHiPart = true;
-
+
for (int r = 0; r < bytes; r++) {
soundBuffer[r] = 0;
}
soundFrequency = freq;
-
+
swiWaitForVBlank();
swiWaitForVBlank();
@@ -461,14 +439,14 @@ void initGame() {
consolePrintf("\n\n\n\nCurrent game: '%s' %d\n", gameName, gameName[0]);
currentGame = &gameList[0]; // Default game
-
+
for (int r = 0; r < NUM_SUPPORTED_GAMES; r++) {
if (!stricmp(gameName, gameList[r].gameId)) {
currentGame = &gameList[r];
// consolePrintf("Game list num: %d\n", currentGame);
}
}
-
+
if (firstTime) {
firstTime = false;
@@ -515,7 +493,7 @@ void displayMode8Bit() {
consolePrintf("displayMode8Bit...");
#endif
u16 buffer[32 * 32];
-
+
setKeyboardEnable(false);
if (!displayModeIs8Bit) {
@@ -524,49 +502,62 @@ void displayMode8Bit() {
}
}
+ consoleInitDefault((u16*)SCREEN_BASE_BLOCK(2), (u16*)CHAR_BASE_BLOCK(0), 16);
+ consolePrintSet(0, 23);
+
+ if (!displayModeIs8Bit) {
+ for (int r = 0; r < 32 * 32; r++) {
+ ((u16 *) SCREEN_BASE_BLOCK(2))[r] = buffer[r];
+ }
+// dmaCopyHalfWords(3, (u16 *) SCREEN_BASE_BLOCK(0), buffer, 32 * 32 * 2);
+ }
+
+ displayModeIs8Bit = true;
+
if (isCpuScalerEnabled())
{
- videoSetMode(MODE_5_2D | (consoleEnable? DISPLAY_BG0_ACTIVE: 0) | DISPLAY_BG3_ACTIVE | DISPLAY_SPR_ACTIVE | DISPLAY_SPR_1D | DISPLAY_SPR_1D_BMP);
+ videoSetMode(MODE_5_2D | (consoleEnable? DISPLAY_BG0_ACTIVE: 0) | DISPLAY_BG3_ACTIVE | DISPLAY_SPR_ACTIVE | DISPLAY_SPR_1D | DISPLAY_SPR_1D_BMP);
videoSetModeSub(MODE_3_2D /*| DISPLAY_BG0_ACTIVE*/ | DISPLAY_BG3_ACTIVE | DISPLAY_SPR_ACTIVE | DISPLAY_SPR_1D | DISPLAY_SPR_1D_BMP); //sub bg 0 will be used to print text
-
+
vramSetBankA(VRAM_A_MAIN_BG_0x06000000);
vramSetBankB(VRAM_B_MAIN_BG_0x06020000);
-
+
vramSetBankC(VRAM_C_SUB_BG_0x06200000);
- vramSetBankD(VRAM_D_MAIN_BG_0x06040000);
-
+ vramSetBankD(VRAM_D_SUB_SPRITE);
+
vramSetBankH(VRAM_H_LCD);
-
+
BG3_CR = BG_BMP16_256x256 | BG_BMP_BASE(8);
BG3_XDX = 256;
BG3_XDY = 0;
BG3_YDX = 0;
BG3_YDY = (int) ((200.0f / 192.0f) * 256);
+
}
else
{
- videoSetMode(MODE_5_2D | (consoleEnable? DISPLAY_BG0_ACTIVE: 0) | DISPLAY_BG3_ACTIVE | DISPLAY_SPR_ACTIVE | DISPLAY_SPR_1D | DISPLAY_SPR_1D_BMP);
+ videoSetMode(MODE_5_2D | (consoleEnable? DISPLAY_BG0_ACTIVE: 0) | DISPLAY_BG3_ACTIVE | DISPLAY_SPR_ACTIVE | DISPLAY_SPR_1D | DISPLAY_SPR_1D_BMP);
videoSetModeSub(MODE_3_2D /*| DISPLAY_BG0_ACTIVE*/ | DISPLAY_BG3_ACTIVE | DISPLAY_SPR_ACTIVE | DISPLAY_SPR_1D | DISPLAY_SPR_1D_BMP); //sub bg 0 will be used to print text
-
+
vramSetBankA(VRAM_A_MAIN_BG_0x06000000);
vramSetBankB(VRAM_B_MAIN_BG_0x06020000);
-
+
vramSetBankC(VRAM_C_SUB_BG_0x06200000);
- vramSetBankD(VRAM_D_MAIN_BG_0x06040000);
-
+ vramSetBankD(VRAM_D_SUB_SPRITE);
+
vramSetBankH(VRAM_H_LCD);
-
+
BG3_CR = BG_BMP8_512x256 | BG_BMP_BASE(8);
-
+
BG3_XDX = (int) (((float) (gameWidth) / 256.0f) * 256);
BG3_XDY = 0;
BG3_YDX = 0;
BG3_YDY = (int) ((200.0f / 192.0f) * 256);
- }
-
+ }
+
SUB_BG3_CR = BG_BMP8_512x256;
-
+
SUB_BG3_XDX = (int) (subScreenWidth / 256.0f * 256);
SUB_BG3_XDY = 0;
SUB_BG3_YDX = 0;
@@ -578,35 +569,29 @@ void displayMode8Bit() {
BG0_CR = BG_MAP_BASE(2) | BG_TILE_BASE(0);
BG0_Y0 = 0;
-
- // Restore palette entry used by text in the front-end
+
+ // Restore palette entry used by text in the front-end
// PALETTE_SUB[255] = savedPalEntry255;
-
- consoleInitDefault((u16*)SCREEN_BASE_BLOCK(2), (u16*)CHAR_BASE_BLOCK(0), 16);
- consolePrintSet(0, 23);
-
- if (!displayModeIs8Bit) {
- for (int r = 0; r < 32 * 32; r++) {
- ((u16 *) SCREEN_BASE_BLOCK(2))[r] = buffer[r];
- }
-// dmaCopyHalfWords(3, (u16 *) SCREEN_BASE_BLOCK(0), buffer, 32 * 32 * 2);
- }
-
+
+
initGame();
-
- if (!displayModeIs8Bit) restoreGameBackBuffer();
- displayModeIs8Bit = true;
+
#ifdef HEAVY_LOGGING
consolePrintf("done\n");
#endif
+ if (gameScreenSwap) {
+ POWER_CR |= POWER_SWAP_LCDS;
+ } else {
+ POWER_CR &= ~POWER_SWAP_LCDS;
+ }
- POWER_CR &= ~POWER_SWAP_LCDS;
-
+ uploadSpriteGfx();
+
keyboardEnable = false;
-
+
}
void setGameID(int id) {
@@ -619,22 +604,22 @@ void dummyHandler() {
void checkSleepMode() {
if (IPC->performArm9SleepMode) {
-
+
consolePrintf("ARM9 Entering sleep mode\n");
-
+
int intSave = REG_IE;
irqSet(IRQ_VBLANK, dummyHandler);
// int irqHandlerSave = (int) IRQ_HANDLER;
REG_IE = IRQ_VBLANK;
//IRQ_HANDLER = dummyHandler;
-
+
int powerSave = POWER_CR;
POWER_CR &= ~POWER_ALL;
-
+
while (IPC->performArm9SleepMode) {
swiWaitForVBlank();
}
-
+
POWER_CR = powerSave;
// IRQ_HANDLER = (void (*)()) irqHandlerSave;
irqSet(IRQ_VBLANK, VBlankHandler);
@@ -671,47 +656,57 @@ void setCursorIcon(const u8* icon, uint w, uint h, byte keycolor, int hotspotX,
{
int off = 128*64;
-
-
+
+
memset(SPRITE_GFX + off, 0, 32 * 32 * 2);
-
+ memset(SPRITE_GFX_SUB + off, 0, 32 * 32 * 2);
+
for (uint y=0; y<h; y++) {
for (uint x=0; x<w; x++) {
int color = icon[y*w+x];
-
+
if (color == keycolor) {
SPRITE_GFX[off+(y)*32+x] = 0x0000; // black background
+ SPRITE_GFX_SUB[off+(y)*32+x] = 0x0000; // black background
} else {
SPRITE_GFX[off+(y)*32+x] = BG_PALETTE[color] | 0x8000;
+ SPRITE_GFX_SUB[off+(y)*32+x] = BG_PALETTE[color] | 0x8000;
}
}
}
-
+
}
if (currentGame->control != CONT_SCUMM_SAMNMAX)
return;
uint16 border = RGB15(24,24,24) | 0x8000;
-
-
- int off = 48*64;
+
+
+ int off = 176*64;
memset(SPRITE_GFX_SUB+off, 0, 64*64*2);
-
+ memset(SPRITE_GFX+off, 0, 64*64*2);
+
int pos = 190 - (w+2);
+
-
-
+
// make border
for (uint i=0; i<w+2; i++) {
+ SPRITE_GFX[off+i] = border;
+ SPRITE_GFX[off+(31)*64+i] = border;
+
SPRITE_GFX_SUB[off+i] = border;
SPRITE_GFX_SUB[off+(31)*64+i] = border;
}
for (uint i=1; i<31; i++) {
+ SPRITE_GFX[off+(i*64)] = border;
+ SPRITE_GFX[off+(i*64)+(w+1)] = border;
+
SPRITE_GFX_SUB[off+(i*64)] = border;
SPRITE_GFX_SUB[off+(i*64)+(w+1)] = border;
}
-
+
int offset = (32 - h) >> 1;
for (uint y=0; y<h; y++) {
@@ -719,23 +714,24 @@ void setCursorIcon(const u8* icon, uint w, uint h, byte keycolor, int hotspotX,
int color = icon[y*w+x];
if (color == keycolor) {
+ SPRITE_GFX[off+(y+1+offset)*64+(x+1)] = 0x8000; // black background
SPRITE_GFX_SUB[off+(y+1+offset)*64+(x+1)] = 0x8000; // black background
} else {
+ SPRITE_GFX[off+(y+1+offset)*64+(x+1)] = BG_PALETTE[color] | 0x8000;
SPRITE_GFX_SUB[off+(y+1+offset)*64+(x+1)] = BG_PALETTE[color] | 0x8000;
}
}
}
-
-
- if ((cursorEnable))
- {
+
+
+ if ((cursorEnable)) {
sprites[1].attribute[0] = ATTR0_BMP | 150;
sprites[1].attribute[1] = ATTR1_SIZE_64 | pos;
- sprites[1].attribute[2] = ATTR2_ALPHA(1) | 48;
+ sprites[1].attribute[2] = ATTR2_ALPHA(1) | 176;
} else {
sprites[1].attribute[0] = ATTR0_DISABLED | 150;
sprites[1].attribute[1] = ATTR1_SIZE_64 | pos;
- sprites[1].attribute[2] = ATTR2_ALPHA(1) | 48;
+ sprites[1].attribute[2] = ATTR2_ALPHA(1) | 176;
}
}
@@ -751,6 +747,8 @@ void displayMode16Bit() {
if (displayModeIs8Bit) {
+// static int test = 0;
+// consolePrintf("saving buffer... %d\n", test++);
saveGameBackBuffer();
for (int r = 0; r < 32 * 32; r++) {
buffer[r] = ((u16 *) SCREEN_BASE_BLOCK(2))[r];
@@ -758,7 +756,7 @@ void displayMode16Bit() {
}
- videoSetMode(MODE_5_2D | /*DISPLAY_BG0_ACTIVE |*/ DISPLAY_BG3_ACTIVE | DISPLAY_SPR_ACTIVE | DISPLAY_SPR_1D | DISPLAY_SPR_1D_BMP);
+ videoSetMode(MODE_5_2D | /*DISPLAY_BG0_ACTIVE |*/ DISPLAY_BG3_ACTIVE | DISPLAY_SPR_ACTIVE | DISPLAY_SPR_1D | DISPLAY_SPR_1D_BMP);
videoSetModeSub(MODE_0_2D | DISPLAY_BG0_ACTIVE |/* DISPLAY_BG1_ACTIVE |*/ DISPLAY_SPR_ACTIVE | DISPLAY_SPR_1D | DISPLAY_SPR_1D_BMP); //sub bg 0 will be used to print text
vramSetBankA(VRAM_A_MAIN_BG);
@@ -769,14 +767,10 @@ void displayMode16Bit() {
BG3_CR = BG_BMP16_512x256;
highBuffer = false;
-
- BG3_XDX = isCpuScalerEnabled() ? 256 : (int) (1.25f * 256);
- BG3_XDY = 0;
- BG3_YDX = 0;
- BG3_YDY = (int) ((200.0f / 192.0f) * 256);
+
memset(BG_GFX, 0, 512 * 256 * 2);
-
+
savedPalEntry255 = PALETTE_SUB[255];
PALETTE_SUB[255] = RGB15(31,31,31);//by default font will be rendered with color 255
@@ -795,14 +789,20 @@ void displayMode16Bit() {
consolePrintSet(0, 23);
consolePrintf("\n");
-
+
// Show keyboard
SUB_BG1_CR = BG_TILE_BASE(1) | BG_MAP_BASE(12);
//drawKeyboard(1, 12);
-
+
POWER_CR &= ~POWER_SWAP_LCDS;
displayModeIs8Bit = false;
+
+ BG3_XDX = isCpuScalerEnabled() ? 256 : (int) (1.25f * 256);
+ BG3_XDY = 0;
+ BG3_YDX = 0;
+ BG3_YDY = (int) ((200.0f / 192.0f) * 256);
+
#ifdef HEAVY_LOGGING
consolePrintf("done\n");
#endif
@@ -816,13 +816,13 @@ void displayMode16BitFlipBuffer() {
#endif
if (!displayModeIs8Bit) {
u16* back = get16BitBackBuffer();
-
+
// highBuffer = !highBuffer;
// BG3_CR = BG_BMP16_512x256 | BG_BMP_RAM(highBuffer? 1: 0);
-
+
if (isCpuScalerEnabled())
{
- Rescale_320x256x1555_To_256x256x1555(BG_GFX, back, 512, 512);
+ Rescale_320x256x1555_To_256x256x1555(BG_GFX, back, 512, 512);
}
else
{
@@ -841,12 +841,14 @@ void displayMode16BitFlipBuffer() {
#endif
const u8* back = (const u8*)get8BitBackBuffer();
u16* base = BG_GFX + 0x10000;
- Rescale_320x256xPAL8_To_256x256x1555( base,
- back,
- 256,
- 512,
- BG_PALETTE );
-
+ Rescale_320x256xPAL8_To_256x256x1555(
+ base,
+ back,
+ 256,
+ get8BitBackBufferStride(),
+ BG_PALETTE,
+ getGameHeight() );
+
#ifdef SCALER_PROFILE
// 10 pixels : 1ms
u16 t1 = TIMER1_DATA;
@@ -875,9 +877,24 @@ u16* get16BitBackBuffer() {
return BG_GFX + 0x20000;
}
+s32 get8BitBackBufferStride() {
+ // When the CPU scaler is enabled, the back buffer is in system RAM and is 320 pixels wide
+ // When the CPU scaler is disabled, the back buffer is in video memory and therefore must have a 512 pixel stride
+
+ if (isCpuScalerEnabled()){
+ return 320;
+ } else {
+ return 512;
+ }
+}
+
+u16* getScalerBuffer() {
+ return (u16 *) scalerBackBuffer;
+}
+
u16* get8BitBackBuffer() {
if (isCpuScalerEnabled())
- return BG_GFX + 0x60000;
+ return (u16 *) scalerBackBuffer;
else
return BG_GFX + 0x10000; // 16bit qty!
}
@@ -899,10 +916,10 @@ void doSoundCallback() {
if (soundCallback) {
lastCallbackFrame = frameCount;
-
+
for (int r = IPC->playingSection; r < IPC->playingSection + 4; r++) {
int chunk = r & 3;
-
+
if (IPC->fillNeeded[chunk]) {
IPC->fillNeeded[chunk] = false;
DC_FlushAll();
@@ -910,9 +927,9 @@ void doSoundCallback() {
IPC->fillNeeded[chunk] = false;
DC_FlushAll();
}
-
+
}
-
+
}
#ifdef HEAVY_LOGGING
consolePrintf("done\n");
@@ -924,7 +941,7 @@ void doTimerCallback() {
if (callbackTimer <= 0) {
callbackTimer += callbackInterval;
callback(callbackInterval);
- }
+ }
}
}
@@ -933,15 +950,15 @@ void soundUpdate() {
// playSound(soundBuffer, (bufferSamples * 2), true);
}
// consolePrintf("%x\n", IPC->test);
-
-
+
+
if (bufferFrame == 0) {
// bufferFirstHalf = true;
- }
+ }
if (bufferFrame == bufferSize >> 1) {
//bufferSecondHalf = true;
- }
-
+ }
+
bufferFrame++;
if (bufferFrame == bufferSize) {
bufferFrame = 0;
@@ -954,20 +971,20 @@ void memoryReport() {
do {
p = (int *) malloc(r * 8192);
free(p);
- r++;
+ r++;
} while ((p) && (r < 512));
-
+
int t = -1;
void* block[1024];
do {
t++;
block[t] = (int *) malloc(4096);
- } while ((t < 1024) && (block[t]));
-
+ } while ((t < 1024) && (block[t]));
+
for (int q = 0; q < t; q++) {
free(block[q]);
}
-
+
consolePrintf("Free: %dK, Largest: %dK\n", t * 4, r * 8);
}
@@ -978,7 +995,7 @@ void addIndyFightingKeys() {
event.type = Common::EVENT_KEYDOWN;
event.kbd.flags = 0;
-
+
// consolePrintf("Fight keys\n");
if ((getKeysDown() & KEY_L)) {
@@ -1008,16 +1025,16 @@ void addIndyFightingKeys() {
event.kbd.keycode = Common::KEYCODE_6;
event.kbd.ascii = '6';
system->addEvent(event);
- }
+ }
if ((getKeysChanged() & KEY_DOWN)) {
event.type = getKeyEvent(KEY_DOWN);
event.kbd.keycode = Common::KEYCODE_2;
event.kbd.ascii = '2';
system->addEvent(event);
}
-
+
if (indyFightRight) {
-
+
if ((getKeysChanged() & KEY_X)) {
event.type = getKeyEvent(KEY_X);
event.kbd.keycode = Common::KEYCODE_9;
@@ -1035,7 +1052,7 @@ void addIndyFightingKeys() {
event.kbd.keycode = Common::KEYCODE_3;
event.kbd.ascii = '3';
system->addEvent(event);
- }
+ }
} else {
@@ -1056,18 +1073,18 @@ void addIndyFightingKeys() {
event.kbd.keycode = Common::KEYCODE_1;
event.kbd.ascii = '1';
system->addEvent(event);
- }
-
+ }
+
}
-
-
+
+
if ((getKeysChanged() & KEY_Y)) {
event.type = getKeyEvent(KEY_Y);
event.kbd.keycode = Common::KEYCODE_5;
event.kbd.ascii = '5';
system->addEvent(event);
}
-}
+}
void setKeyboardEnable(bool en) {
@@ -1079,8 +1096,8 @@ void setKeyboardEnable(bool en) {
DS::drawKeyboard(1, 15, backupBank);
-
-
+
+
SUB_BG1_CR = BG_TILE_BASE(1) | BG_MAP_BASE(15);
if (displayModeIs8Bit) {
@@ -1090,7 +1107,11 @@ void setKeyboardEnable(bool en) {
SUB_DISPLAY_CR |= DISPLAY_BG1_ACTIVE; // Turn on keyboard layer
SUB_DISPLAY_CR &= ~DISPLAY_BG0_ACTIVE; // Turn off console layer
}
- lcdSwap();
+
+ // Ensure the keyboard is on the lower screen
+ POWER_CR |= POWER_SWAP_LCDS;
+
+
} else {
@@ -1098,26 +1119,38 @@ void setKeyboardEnable(bool en) {
for (int r = 0; r < 256; r++) {
BG_PALETTE_SUB[r] = BG_PALETTE[r];
}
-
-
+
+
//restoreVRAM(1, 12, backupBank);
-
+
if (displayModeIs8Bit) {
// Copy the sub screen VRAM from the top screen - they should always be
// the same.
u16* buffer = get8BitBackBuffer();
+ s32 stride = get8BitBackBufferStride();
+ for (int y = 0; y < gameHeight; y++) {
+ for (int x = 0; x < gameWidth; x++) {
+ BG_GFX_SUB[y * 256 + x] = buffer[(y * (stride / 2)) + x];
+ }
+ }
+/*
for (int r = 0; r < (512 * 256) >> 1; r++)
BG_GFX_SUB[r] = buffer[r];
-
+ */
SUB_DISPLAY_CR &= ~DISPLAY_BG1_ACTIVE; // Turn off keyboard layer
SUB_DISPLAY_CR |= DISPLAY_BG3_ACTIVE; // Turn on game layer
} else {
SUB_DISPLAY_CR &= ~DISPLAY_BG1_ACTIVE; // Turn off keyboard layer
SUB_DISPLAY_CR |= DISPLAY_BG0_ACTIVE; // Turn on console layer
}
-
- lcdSwap();
+
+ // Restore the screens so they're the right way round
+ if (gameScreenSwap) {
+ POWER_CR |= POWER_SWAP_LCDS;
+ } else {
+ POWER_CR &= ~POWER_SWAP_LCDS;
+ }
}
}
@@ -1136,7 +1169,7 @@ void addEventsToQueue() {
OSystem_DS* system = OSystem_DS::instance();
Common::Event event;
-
+
#ifdef USE_PROFILER
if (keysDown() & KEY_R) {
cygprofile_begin();
@@ -1148,7 +1181,7 @@ void addEventsToQueue() {
}
#endif
-
+
if (system->isEventQueueEmpty()) {
/*
@@ -1157,7 +1190,7 @@ void addEventsToQueue() {
consolePrintf("Tweak: %d\n", tweak);
IPC->tweakChanged = true;
}
-
+
if (getKeysDown() & KEY_R) {
tweak++;
@@ -1173,14 +1206,14 @@ void addEventsToQueue() {
if (!indyFightState) {
- if ((!(getKeysHeld() & KEY_L)) && (!(getKeysHeld() & KEY_R)) && (getKeysDown() & KEY_B)) {
+ if ((!(getKeysHeld() & KEY_L)) && (!(getKeysHeld() & KEY_R)) && (getKeysDown() & KEY_B)) {
if (currentGame->control == CONT_AGI) {
event.kbd.keycode = Common::KEYCODE_RETURN;
event.kbd.ascii = 13;
event.kbd.flags = 0;
} else {
- event.kbd.keycode = Common::KEYCODE_ESCAPE;
- event.kbd.ascii = 27;
+ event.kbd.keycode = Common::KEYCODE_ESCAPE;
+ event.kbd.ascii = 27;
event.kbd.flags = 0;
}
@@ -1190,11 +1223,11 @@ void addEventsToQueue() {
event.type = Common::EVENT_KEYUP;
system->addEvent(event);
}
-
+
}
-
-
-
+
+
+
if ((!getIndyFightState()) && (getKeysDown() & KEY_Y)) {
consoleEnable = !consoleEnable;
if (displayModeIs8Bit) {
@@ -1203,7 +1236,7 @@ void addEventsToQueue() {
displayMode16Bit();
}
}
-
+
if ((getKeyboardEnable())) {
event.kbd.flags = 0;
@@ -1211,30 +1244,30 @@ void addEventsToQueue() {
bool release = getKeysReleased() & (KEY_LEFT | KEY_RIGHT | KEY_UP | KEY_DOWN);
bool shoulders = getKeysHeld() & (KEY_L | KEY_R);
- if ( (down && (!shoulders)) || release)
+ if ( (down && (!shoulders)) || release)
{
-
+
if (getKeysChanged() & KEY_LEFT) {
event.kbd.keycode = Common::KEYCODE_LEFT;
event.kbd.ascii = 0;
event.type = getKeyEvent(KEY_LEFT);
system->addEvent(event);
}
-
+
if (getKeysChanged() & KEY_RIGHT) {
event.kbd.keycode = Common::KEYCODE_RIGHT;
event.kbd.ascii = 0;
event.type = getKeyEvent(KEY_RIGHT);
system->addEvent(event);
}
-
+
if (getKeysChanged() & KEY_UP) {
event.kbd.keycode = Common::KEYCODE_UP;
event.kbd.ascii = 0;
event.type = getKeyEvent(KEY_UP);
system->addEvent(event);
}
-
+
if (getKeysChanged() & KEY_DOWN) {
event.kbd.keycode = Common::KEYCODE_DOWN;
event.kbd.ascii = 0;
@@ -1242,15 +1275,22 @@ void addEventsToQueue() {
system->addEvent(event);
}
}
-
+
}
-
+
if (!((getKeysHeld() & KEY_L) || (getKeysHeld() & KEY_R)) && (!getIndyFightState()) && (!getKeyboardEnable())) {
if ((getKeysDown() & KEY_A) && (!indyFightState)) {
gameScreenSwap = !gameScreenSwap;
- }
+ if (gameScreenSwap) {
+ POWER_CR |= POWER_SWAP_LCDS;
+ } else {
+ POWER_CR &= ~POWER_SWAP_LCDS;
+ }
+
+ }
+
if (!getPenHeld() || (mouseMode != MOUSE_HOVER)) {
if (getKeysDown() & KEY_LEFT) {
mouseMode = MOUSE_LEFT;
@@ -1264,7 +1304,7 @@ void addEventsToQueue() {
system->addEvent(event);
rightButtonDown = false;
}
-
+
if (getKeysDown() & KEY_RIGHT) {
if ((currentGame->control != CONT_SCUMM_SAMNMAX) && (currentGame->control != CONT_FUTURE_WARS) && (currentGame->control != CONT_GOBLINS)) {
@@ -1281,13 +1321,13 @@ void addEventsToQueue() {
} else {
event.mouse = Common::Point(getPenX(), getPenY());
}
-
+
rightButtonDown = true;
-
+
event.type = Common::EVENT_RBUTTONDOWN;
system->addEvent(event);
-
+
//event.type = Common::EVENT_RBUTTONUP;
//system->addEvent(event);
}
@@ -1299,9 +1339,9 @@ void addEventsToQueue() {
mouseMode = MOUSE_HOVER;
}
}
-
-
-
+
+
+
}
if ((getKeysDown() & KEY_SELECT)) {
@@ -1310,18 +1350,18 @@ void addEventsToQueue() {
showOptionsDialog();
}
-
+
}
-
+
if (!getIndyFightState() && !((getKeysHeld() & KEY_L) || (getKeysHeld() & KEY_R)) && (getKeysDown() & KEY_X)) {
setKeyboardEnable(!keyboardEnable);
}
-
- updateStatus();
-
+
+ updateStatus();
+
Common::Event event;
-
+
if (!keyboardEnable) {
if ((!(getKeysHeld() & KEY_L)) && (!(getKeysHeld() & KEY_R))) {
@@ -1332,12 +1372,12 @@ void addEventsToQueue() {
}
if ((mouseMode != MOUSE_HOVER) || (!displayModeIs8Bit)) {
- if (getPenDown() && (!(getKeysHeld() & KEY_L)) && (!(getKeysHeld() & KEY_R))) {
+ if (getPenDown() && (!(getKeysHeld() & KEY_L)) && (!(getKeysHeld() & KEY_R))) {
event.type = ((mouseMode == MOUSE_LEFT) || (!displayModeIs8Bit))? Common::EVENT_LBUTTONDOWN: Common::EVENT_RBUTTONDOWN;
event.mouse = Common::Point(getPenX(), getPenY());
system->addEvent(event);
}
-
+
if (getPenReleased()) {
event.type = mouseMode == MOUSE_LEFT? Common::EVENT_LBUTTONUP: Common::EVENT_RBUTTONUP;
event.mouse = Common::Point(getPenX(), getPenY());
@@ -1345,36 +1385,37 @@ void addEventsToQueue() {
}
} else {
// In hover mode, D-pad left and right click the mouse when the pen is on the screen
-
+
if (getPenHeld()) {
if (getKeysDown() & KEY_LEFT) {
event.type = Common::EVENT_LBUTTONDOWN;
event.mouse = Common::Point(getPenX(), getPenY());
system->addEvent(event);
}
- /* if (getKeysReleased() & KEY_LEFT) {
+ if (getKeysReleased() & KEY_LEFT) {
event.type = Common::EVENT_LBUTTONUP;
event.mouse = Common::Point(getPenX(), getPenY());
system->addEvent(event);
- }*/
+ }
+
if (getKeysDown() & KEY_RIGHT) {
event.type = Common::EVENT_RBUTTONDOWN;
event.mouse = Common::Point(getPenX(), getPenY());
system->addEvent(event);
}
- /*if (getKeysReleased() & KEY_RIGHT) {
+ if (getKeysReleased() & KEY_RIGHT) {
event.type = Common::EVENT_RBUTTONUP;
event.mouse = Common::Point(getPenX(), getPenY());
system->addEvent(event);
- }*/
+ }
}
}
-
+
if (((!(getKeysHeld() & KEY_L)) && (!(getKeysHeld() & KEY_R)) || (indyFightState)) && (displayModeIs8Bit)) {
// Controls specific to the control method
-
-
+
+
if (currentGame->control == CONT_SKY) {
// Extra controls for Beneath a Steel Sky
if ((getKeysDown() & KEY_DOWN)) {
@@ -1387,7 +1428,7 @@ void addEventsToQueue() {
// Extra controls for Simon the Sorcerer
if ((getKeysDown() & KEY_DOWN)) {
Common::Event event;
-
+
event.type = Common::EVENT_KEYDOWN;
event.kbd.keycode = Common::KEYCODE_F10; // F10 or # - show hotspots
event.kbd.ascii = Common::ASCII_F10;
@@ -1400,13 +1441,13 @@ void addEventsToQueue() {
}
}
-
-
+
+
if (currentGame->control == CONT_SCUMM_ORIGINAL) {
// Extra controls for Scumm v1-5 games
if ((getKeysDown() & KEY_DOWN)) {
Common::Event event;
-
+
event.type = Common::EVENT_KEYDOWN;
event.kbd.keycode = Common::KEYCODE_PERIOD; // Full stop - skips current dialogue line
event.kbd.ascii = '.';
@@ -1416,19 +1457,19 @@ void addEventsToQueue() {
event.type = Common::EVENT_KEYUP;
system->addEvent(event);
}
-
+
if (indyFightState) {
addIndyFightingKeys();
}
-
+
}
-
+
}
}
-
+
if (!displayModeIs8Bit) {
// Front end controls
-
+
if (leftHandedSwap(getKeysChanged()) & KEY_UP) {
event.type = getKeyEvent(leftHandedSwap(KEY_UP));
event.kbd.keycode = Common::KEYCODE_UP;
@@ -1455,10 +1496,10 @@ void addEventsToQueue() {
event.type = Common::EVENT_KEYUP;
system->addEvent(event);
}
-
+
}
-
+
if ((getKeysChanged() & KEY_START)) {
event.type = getKeyEvent(KEY_START);
if (currentGame->control == CONT_FUTURE_WARS) {
@@ -1477,38 +1518,37 @@ void addEventsToQueue() {
// consolePrintf("!!!!!F5!!!!!");
}
event.kbd.flags = 0;
- consolePrintf("!!!!!F5!!!!!");
system->addEvent(event);
}
-
+
if (keyboardEnable) {
DS::addKeyboardEvents();
}
-
+
consumeKeys();
-
+
consumePenEvents();
}
}
-
+
void triggerIcon(int imageNum) {
triggeredIcon = imageNum;
- triggeredIconTimeout = 120;
+ triggeredIconTimeout = 120;
}
-
+
void setIcon(int num, int x, int y, int imageNum, int flags, bool enable) {
- sprites[num].attribute[0] = ATTR0_BMP | (enable? y: 192) | (!enable? ATTR0_DISABLED: 0);
+ sprites[num].attribute[0] = ATTR0_BMP | (enable? y: 192) | (!enable? ATTR0_DISABLED: 0);
sprites[num].attribute[1] = ATTR1_SIZE_32 | x | flags;
sprites[num].attribute[2] = ATTR2_ALPHA(1)| (imageNum * 16);
}
void setIconMain(int num, int x, int y, int imageNum, int flags, bool enable) {
- spritesMain[num].attribute[0] = ATTR0_BMP | (y & 0xFF) | (!enable? ATTR0_DISABLED: 0);
+ spritesMain[num].attribute[0] = ATTR0_BMP | (y & 0xFF) | (!enable? ATTR0_DISABLED: 0);
spritesMain[num].attribute[1] = ATTR1_SIZE_32 | (x & 0x1FF) | flags;
spritesMain[num].attribute[2] = ATTR2_ALPHA(1)| (imageNum * 16);
}
@@ -1536,16 +1576,16 @@ void updateStatus() {
break;
}
}
-
+
setIcon(0, 208, 150, offs, 0, true);
-
+
if (indyFightState) {
setIcon(1, (190 - 32), 150, 3, (indyFightRight? 0: ATTR1_FLIP_X), true);
// consolePrintf("%d\n", indyFightRight);
} else {
// setIcon(1, 0, 0, 0, 0, false);
}
-
+
if (triggeredIconTimeout > 0) {
triggeredIconTimeout--;
setIcon(4, 16, 150, triggeredIcon, 0, true);
@@ -1570,7 +1610,7 @@ void updateStatus() {
// spritesMain[0].attribute[0] = ATTR0_DISABLED;
// spritesMain[0].attribute[1] = 0;
// spritesMain[0].attribute[2] = 0;
-// spritesMain[0].attribute[3] = 0;
+// spritesMain[0].filler = 0;
setIconMain(0, 0, 0, 0, 0, false);
}
@@ -1584,30 +1624,32 @@ void soundBufferEmptyHandler() {
} else {
// bufferFirstHalf = true;
}
-
+
soundHiPart = !soundHiPart;
}
void setMainScreenScroll(int x, int y) {
- if (gameScreenSwap) {
+/* if (gameScreenSwap) {
SUB_BG3_CX = x + (((frameCount & 1) == 0)? 64: 0);
SUB_BG3_CY = y;
- } else {
+ } else */{
BG3_CX = x + (((frameCount & 1) == 0)? 64: 0);
BG3_CY = y;
-
- touchX = x >> 8;
- touchY = y >> 8;
+
+ if (!gameScreenSwap) {
+ touchX = x >> 8;
+ touchY = y >> 8;
+ }
}
}
void setMainScreenScale(int x, int y) {
- if (gameScreenSwap) {
+/* if (gameScreenSwap) {
SUB_BG3_XDX = x;
SUB_BG3_XDY = 0;
SUB_BG3_YDX = 0;
SUB_BG3_YDY = y;
- } else {
+ } else*/ {
if (isCpuScalerEnabled() && (x==320))
{
BG3_XDX = 256;
@@ -1616,41 +1658,54 @@ void setMainScreenScale(int x, int y) {
BG3_YDY = y;
}
else
- {
+ {
BG3_XDX = x;
BG3_XDY = 0;
BG3_YDX = 0;
BG3_YDY = y;
}
-
- touchScX = x;
- touchScY = y;
+
+ if (!gameScreenSwap) {
+ touchScX = x;
+ touchScY = y;
+ }
}
}
void setZoomedScreenScroll(int x, int y, bool shake) {
- if (gameScreenSwap) {
+/* if (gameScreenSwap) {
BG3_CX = x + ((shake && ((frameCount & 1) == 0))? 64: 0);
BG3_CY = y;
-
+
touchX = x >> 8;
touchY = y >> 8;
- } else {
+ } else */{
+
+ if (gameScreenSwap) {
+ touchX = x >> 8;
+ touchY = y >> 8;
+ }
+
+
SUB_BG3_CX = x + ((shake && (frameCount & 1) == 0)? 64: 0);
SUB_BG3_CY = y;
}
}
void setZoomedScreenScale(int x, int y) {
- if (gameScreenSwap) {
+/* if (gameScreenSwap) {
BG3_XDX = x;
BG3_XDY = 0;
BG3_YDX = 0;
BG3_YDY = y;
- touchScX = x;
- touchScY = y;
- } else {
+ } else */{
+
+ if (gameScreenSwap) {
+ touchScX = x;
+ touchScY = y;
+ }
+
SUB_BG3_XDX = x;
SUB_BG3_XDY = 0;
SUB_BG3_YDX = 0;
@@ -1684,7 +1739,7 @@ void VBlankHandler(void) {
soundUpdate();
-
+
if ((!gameScreenSwap) && (!(getKeysHeld() & KEY_L) && !(getKeysHeld() & KEY_R))) {
if (currentGame) {
@@ -1699,14 +1754,14 @@ void VBlankHandler(void) {
}
}
}
-
+
penUpdate();
keysUpdate();
frameCount++;
-
+
if ((cursorEnable) && (mouseCursorVisible))
{
if (!keyboardEnable) {
@@ -1725,31 +1780,31 @@ void VBlankHandler(void) {
if (callback) {
callbackTimer -= FRAME_TIME;
}
-
+
if ((getKeysHeld() & KEY_L) || (getKeysHeld() & KEY_R)) {
-
+
if ((!dragging) && (getPenHeld()) && (penDownFrames > 5)) {
dragging = true;
dragStartX = penX;
dragStartY = penY;
-
+
if (gameScreenSwap) {
dragScX = subScTargetX;
dragScY = subScTargetY;
} else {
dragScX = scX;
- dragScY = scY;
- }
-
-
+ dragScY = scY;
+ }
+
+
}
-
+
if ((dragging) && (!getPenHeld())) {
dragging = false;
}
-
+
if (dragging) {
-
+
if (gameScreenSwap) {
subScTargetX = dragScX + ((dragStartX - penX) << 8);
subScTargetY = dragScY + ((dragStartY - penY) << 8);
@@ -1757,18 +1812,18 @@ void VBlankHandler(void) {
scX = dragScX + ((dragStartX - penX));
scY = dragScY + ((dragStartY - penY));
}
-
+
// consolePrintf("X:%d Y:%d\n", dragStartX - penX, dragStartY - penY);
}
- }
-
-
+ }
+
+
/* if ((frameCount & 1) == 0) {
SUB_BG3_CX = subScX;
} else {
SUB_BG3_CX = subScX + 64;
}
-
+
SUB_BG3_CY = subScY + (shakePos << 8);*/
/*SUB_BG3_XDX = (int) (subScreenWidth / 256.0f * 256);
@@ -1777,40 +1832,40 @@ void VBlankHandler(void) {
SUB_BG3_YDY = (int) (subScreenHeight / 192.0f * 256);*/
static int ratio = ( 320 << 8) / SCUMM_GAME_WIDTH;
-
+
bool zooming = false;
-
+
if ((getKeysHeld() & KEY_L) || (getKeysHeld() & KEY_R)) {
if ((getKeysHeld() & KEY_A) && (subScreenScale < ratio)) {
subScreenScale += 1;
zooming = true;
}
-
+
if ((getKeysHeld() & KEY_B) && (subScreenScale > 128)) {
subScreenScale -=1;
zooming = true;
}
}
-
+
int xCenter = subScTargetX + ((subScreenWidth >> 1) << 8);
int yCenter = subScTargetY + ((subScreenHeight >> 1) << 8);
-
+
if (twoHundredPercentFixedScale) {
subScreenWidth = 256 >> 1;
subScreenHeight = 192 >> 1;
} else {
subScreenWidth = (((SCUMM_GAME_HEIGHT * 256) / 192) * subScreenScale) >> 8;
subScreenHeight = SCUMM_GAME_HEIGHT * subScreenScale >> 8;
-
+
if ( ((subScreenWidth) > 256 - 8) && ((subScreenWidth) < 256 + 8) ) {
subScreenWidth = 256;
subScreenHeight = 192;
if (zooming) {
subScX = subScTargetX;
subScY = subScTargetY;
- triggerIcon(5);
+ triggerIcon(5);
}
} else if ( ((subScreenWidth) > 128 - 8) && ((subScreenWidth) < 128 + 8) ) {
subScreenWidth = 128;
@@ -1832,13 +1887,13 @@ void VBlankHandler(void) {
//triggerIcon(-1);
}
}
-
+
subScTargetX = xCenter - ((subScreenWidth >> 1) << 8);
subScTargetY = yCenter - ((subScreenHeight >> 1) << 8);
+
-
-
+
if (subScTargetX < 0) subScTargetX = 0;
if (subScTargetX > (gameWidth - subScreenWidth) << 8) subScTargetX = (gameWidth - subScreenWidth) << 8;
@@ -1850,30 +1905,30 @@ void VBlankHandler(void) {
subScX += (subScTargetX - subScX) >> 2;
subScY += (subScTargetY - subScY) >> 2;
-
+
if (displayModeIs8Bit) {
-
+
if ((getKeysHeld() & KEY_L) || (getKeysHeld() & KEY_R)) {
-
+
int offsX = 0, offsY = 0;
if (getKeysHeld() & KEY_LEFT) {
offsX -= 1;
}
-
+
if (getKeysHeld() & KEY_RIGHT) {
offsX += 1;
}
-
+
if (getKeysHeld() & KEY_UP) {
offsY -= 1;
}
-
+
if (getKeysHeld() & KEY_DOWN) {
offsY += 1;
}
-
+
if (((gameScreenSwap) && (getKeysHeld() & KEY_L)) || ((!gameScreenSwap) && (getKeysHeld() & KEY_R))) {
subScTargetX += offsX << 8;
subScTargetY += offsY << 8;
@@ -1884,32 +1939,32 @@ void VBlankHandler(void) {
}
if (!scaledMode) {
-
+
if (scX + 256 > gameWidth - 1) {
scX = gameWidth - 1 - 256;
}
-
+
if (scX < 0) {
scX = 0;
}
-
+
if (scY + 192 > gameHeight - 1) {
scY = gameHeight - 1 - 192;
}
-
+
if (scY < 0) {
scY = 0;
}
-
+
setZoomedScreenScroll(subScX, subScY, (subScreenWidth != 256) && (subScreenWidth != 128));
setZoomedScreenScale(subScreenWidth, ((subScreenHeight * (256 << 8)) / 192) >> 8);
-
-
+
+
setMainScreenScroll(scX << 8, (scY << 8) + (shakePos << 8));
setMainScreenScale(256, 256); // 1:1 scale
-
+
} else {
-
+
if (scY > gameHeight - 192 - 1) {
scY = gameHeight - 192 - 1;
}
@@ -1917,13 +1972,13 @@ void VBlankHandler(void) {
if (scY < 0) {
scY = 0;
}
-
+
setZoomedScreenScroll(subScX, subScY, (subScreenWidth != 256) && (subScreenWidth != 128));
setZoomedScreenScale(subScreenWidth, ((subScreenHeight * (256 << 8)) / 192) >> 8);
-
+
setMainScreenScroll(64, (scY << 8) + (shakePos << 8));
setMainScreenScale(320, 256); // 1:1 scale
-
+
}
} else {
setZoomedScreenScroll(0, 0, true);
@@ -1932,12 +1987,12 @@ void VBlankHandler(void) {
setMainScreenScroll(0, 0);
setMainScreenScale(320, 256); // 1:1 scale
}
-
+
// Enable on screen keyboard when pen taps icon
if ((keyboardIcon) && (penX < 32) && (penY > 160) && (penHeld)) {
setKeyboardEnable(true);
}
-
+
if (keyboardEnable) {
if (DS::getKeyboardClosed()) {
setKeyboardEnable(false);
@@ -1987,7 +2042,7 @@ void setTopScreenTarget(int x, int y) {
if (subScTargetY < 0) subScTargetY = 0;
if (subScTargetY > gameHeight - subScreenHeight) subScTargetY = gameHeight - subScreenHeight;
-
+
subScTargetX <<=8;
subScTargetY <<=8;
}
@@ -2000,6 +2055,19 @@ void hBlankHandler() {
}
#endif
+void uploadSpriteGfx() {
+ vramSetBankD(VRAM_D_SUB_SPRITE);
+ vramSetBankE(VRAM_E_MAIN_SPRITE);
+
+ // Convert texture from 24bit 888 to 16bit 1555, remembering to set top bit!
+ u8* srcTex = (u8 *) icons_raw;
+ for (int r = 32 * 256 ; r >= 0; r--) {
+ SPRITE_GFX_SUB[r] = 0x8000 | (srcTex[r * 3] >> 3) | ((srcTex[r * 3 + 1] >> 3) << 5) | ((srcTex[r * 3 + 2] >> 3) << 10);
+ SPRITE_GFX[r] = 0x8000 | (srcTex[r * 3] >> 3) | ((srcTex[r * 3 + 1] >> 3) << 5) | ((srcTex[r * 3 + 2] >> 3) << 10);
+ }
+
+}
+
void initHardware() {
// Guard band
//((int *) (0x023FFF00)) = 0xBEEFCAFE;
@@ -2008,12 +2076,12 @@ void initHardware() {
penInit();
powerON(POWER_ALL);
-/* vramSetBankA(VRAM_A_MAIN_BG);
- vramSetBankB(VRAM_B_MAIN_BG);
+/* vramSetBankA(VRAM_A_MAIN_BG);
+ vramSetBankB(VRAM_B_MAIN_BG);
vramSetBankC(VRAM_C_SUB_BG); */
- vramSetBankI(VRAM_I_SUB_SPRITE);
- vramSetBankE(VRAM_E_MAIN_SPRITE);
-
+ vramSetBankD(VRAM_D_SUB_SPRITE);
+ vramSetBankE(VRAM_E_MAIN_SPRITE);
+
currentTimeMillis = 0;
@@ -2041,8 +2109,8 @@ void initHardware() {
// Allocate save buffer for game screen
// savedBuffer = new u8[320 * 200];
displayMode16Bit();
-
- memset(BG_GFX, 0, 512 * 256 * 2);
+
+ memset(BG_GFX, 0, 512 * 256 * 2);
scaledMode = true;
scX = 0;
scY = 0;
@@ -2050,33 +2118,33 @@ void initHardware() {
subScY = 0;
subScTargetX = 0;
subScTargetY = 0;
-
+
//lcdSwap();
POWER_CR &= ~POWER_SWAP_LCDS;
-
+
frameCount = 0;
callback = NULL;
-
-// vramSetBankH(VRAM_H_SUB_BG);
-
+
+// vramSetBankH(VRAM_H_SUB_BG);
+
// // Do text stuff
//BG0_CR = BG_MAP_BASE(0) | BG_TILE_BASE(1);
// BG0_Y0 = 48;
-
+
PALETTE[255] = RGB15(31,31,31);//by default font will be rendered with color 255
-
+
//consoleInit() is a lot more flexible but this gets you up and running quick
// consoleInitDefault((u16*)SCREEN_BASE_BLOCK(0), (u16*)CHAR_BASE_BLOCK(1), 16);
//consolePrintSet(0, 6);
-
+
//irqs are nice
irqInit();
// irqInitHandler();
irqSet(IRQ_VBLANK, VBlankHandler);
irqSet(IRQ_TIMER0, timerTickHandler);
irqSet(IRQ_TIMER2, soundBufferEmptyHandler);
-
+
irqEnable(IRQ_VBLANK);
irqEnable(IRQ_TIMER0);
irqEnable(IRQ_TIMER2);
@@ -2085,15 +2153,15 @@ void initHardware() {
irqSet(IRQ_HBLANK, hBlankHandler);
irqEnable(IRQ_HBLANK);
#endif
-
-
+
+
// Set up a millisecond timer
#ifdef HEAVY_LOGGING
consolePrintf("Setting up timer...");
#endif
TIMER0_CR = 0;
TIMER0_DATA = (u32) TIMER_FREQ(1000);
- TIMER0_CR = TIMER_ENABLE | TIMER_DIV_1 | TIMER_IRQ_REQ;
+ TIMER0_CR = TIMER_ENABLE | TIMER_DIV_1 | TIMER_IRQ_REQ;
REG_IME = 1;
#ifdef HEAVY_LOGGING
consolePrintf("done\n");
@@ -2102,23 +2170,18 @@ void initHardware() {
PALETTE[255] = RGB15(0,0,31);
initSprites();
-
+
// videoSetModeSub(MODE_3_2D | DISPLAY_BG0_ACTIVE | DISPLAY_BG3_ACTIVE | DISPLAY_SPR_ACTIVE | DISPLAY_SPR_1D | DISPLAY_SPR_1D_BMP); //sub bg 0 will be used to print text
- // Convert texture from 24bit 888 to 16bit 1555, remembering to set top bit!
- u8* srcTex = (u8 *) icons_raw;
- for (int r = 32 * 256 ; r >= 0; r--) {
- SPRITE_GFX_SUB[r] = 0x8000 | (srcTex[r * 3] >> 3) | ((srcTex[r * 3 + 1] >> 3) << 5) | ((srcTex[r * 3 + 2] >> 3) << 10);
- SPRITE_GFX[r] = 0x8000 | (srcTex[r * 3] >> 3) | ((srcTex[r * 3 + 1] >> 3) << 5) | ((srcTex[r * 3 + 2] >> 3) << 10);
- }
-
-
-
+ // If the software scaler's back buffer has not been allocated, do it now
+ scalerBackBuffer = (u8 *) malloc(320 * 256);
WAIT_CR &= ~(0x0080);
// REG_WRAM_CNT = 0;
+ uploadSpriteGfx();
+
// This is a bodge to get around the fact that the cursor is turned on before it's image is set
// during startup in Sam & Max. This bodge moves the cursor offscreen so it is not seen.
sprites[1].attribute[1] = ATTR1_SIZE_64 | 192;
@@ -2126,6 +2189,8 @@ void initHardware() {
}
+
+
void setKeyboardIcon(bool enable) {
keyboardIcon = enable;
}
@@ -2199,27 +2264,27 @@ void penUpdate() {
penDownLastFrame = false;
penDownFrames = 0;
}
-
+
}
int leftHandedSwap(int keys) {
// Start and select are unchanged
if (leftHandedMode) {
int result = keys & (~(KEY_R | KEY_L | KEY_Y | KEY_A | KEY_B | KEY_X | KEY_LEFT | KEY_RIGHT | KEY_UP | KEY_DOWN));
-
+
if (keys & KEY_L) result |= KEY_R;
if (keys & KEY_R) result |= KEY_L;
-
+
if (keys & KEY_LEFT) result |= KEY_Y;
if (keys & KEY_RIGHT) result |= KEY_A;
if (keys & KEY_DOWN) result |= KEY_B;
if (keys & KEY_UP) result |= KEY_X;
-
+
if (keys & KEY_Y) result |= KEY_LEFT;
if (keys & KEY_A) result |= KEY_RIGHT;
if (keys & KEY_B) result |= KEY_DOWN;
if (keys & KEY_X) result |= KEY_UP;
-
+
return result;
} else {
return keys;
@@ -2310,28 +2375,28 @@ int getPenY() {
GLvector getPenPos() {
GLvector v;
-
+
v.x = (penX * inttof32(1)) / SCREEN_WIDTH;
v.y = (penY * inttof32(1)) / SCREEN_HEIGHT;
-
+
return v;
}
void formatSramOption() {
consolePrintf("The following files are present in save RAM:\n");
DSSaveFileManager::instance()->listFiles();
-
+
consolePrintf("\nAre you sure you want to\n");
consolePrintf("DELETE all files?\n");
consolePrintf("A = Yes, X = No\n");
-
+
while (true) {
if (keysHeld() & KEY_A) {
DSSaveFileManager::instance()->formatSram();
consolePrintf("SRAM cleared!\n");
return;
}
-
+
if (keysHeld() & KEY_X) {
consolePrintf("Whew, that was close!\n");
return;
@@ -2366,7 +2431,11 @@ void* fastRamAlloc(int size) {
// return malloc(size);
void* result = (void *) fastRamPointer;
fastRamPointer += size;
- return (void *) (result);
+ if(fastRamPointer > fastRamData + FAST_RAM_SIZE) {
+ consolePrintf("FastRam (ITCM) allocation failed!\n");
+ return NULL;
+ }
+ return result;
}
void fastRamReset() {
@@ -2380,7 +2449,7 @@ void fastRamReset() {
bool GBAMPAvail = false;
-bool initGBAMP(int mode) {
+bool initGBAMP(int mode) {
if (FAT_InitFiles()) {
if (mode == 2) {
disc_IsInserted();
@@ -2405,14 +2474,14 @@ void initDebugger() {
set_verbosity(VERBOSE_INFO | VERBOSE_ERROR);
wireless_init(0);
wireless_connect();
-
+
// This is where the address of the computer running the Java
// stub goes.
debugger_connect_tcp(192, 168, 0, 1);
- debugger_init();
-
+ debugger_init();
+
// Update function - should really call every frame
- user_debugger_update();
+ user_debugger_update();
}
@@ -2447,7 +2516,7 @@ cardTranslate cardReaderTable[] = {
void reboot() {
int deviceType = -1;
-
+
if (disc_getDeviceId() == DEVICE_DLDI) {
char id[6];
@@ -2525,13 +2594,13 @@ int main(void)
initDebugger();
}
#endif
-
+
// Let arm9 read cartridge
*((u16 *) (0x04000204)) &= ~0x0080;
-
+
lastCallbackFrame = 0;
tweak = 0;
-
+
indyFightState = false;
indyFightRight = true;
@@ -2544,25 +2613,25 @@ int main(void)
// bufferSize = 10;
-
+
/*bufferRate = 44100;
bufferFrame = 0;
bufferSamples = 8192;
bufferFirstHalf = false;
bufferSecondHalf = true;
-
+
int bytes = (2 * (bufferSamples)) + 100;
-
+
soundBuffer = (s16 *) malloc(bytes * 2);
soundHiPart = true;
-
+
for (int r = 0; r < bytes; r++) {
soundBuffer[r] = 0;
}
-
+
swiWaitForVBlank();
swiWaitForVBlank();
@@ -2571,35 +2640,35 @@ int main(void)
swiWaitForVBlank();
swiWaitForVBlank();
*/
-
+
lastEventFrame = 0;
mouseMode = MOUSE_LEFT;
-
+
/*
TIMER1_CR = 0;
TIMER1_DATA = TIMER_FREQ(bufferRate);
TIMER1_CR = TIMER_ENABLE | TIMER_DIV_1;
-
+
TIMER2_CR = 0;
TIMER2_DATA = 0xFFFF - (bufferSamples / 2);
TIMER2_CR = TIMER_ENABLE | TIMER_IRQ_REQ | TIMER_CASCADE;
*/
// 2945 - 2947
+
-
-
+
// for (int r = 2946; r < 3000; r++) {
// soundBuffer[r] = 30000;
// }
-
+
//2372
consolePrintf("-------------------------------\n");
consolePrintf("ScummVM DS\n");
consolePrintf("Ported by Neil Millstone\n");
- consolePrintf("Version 0.11.0 beta1 ");
+ consolePrintf("Version 0.11.1 beta2");
#if defined(DS_BUILD_A)
consolePrintf("build A\n");
consolePrintf("Lucasarts SCUMM games (SCUMM)\n");
@@ -2610,7 +2679,7 @@ int main(void)
consolePrintf("-------------------------------\n");
#elif defined(DS_BUILD_C)
consolePrintf("build C\n");
- consolePrintf("Simon/Elvira (AGOS)\n");
+ consolePrintf("Simon/Elvira/Waxworks (AGOS)\n");
consolePrintf("-------------------------------\n");
#elif defined(DS_BUILD_D)
consolePrintf("build D\n");
@@ -2618,7 +2687,7 @@ int main(void)
consolePrintf("-------------------------------\n");
#elif defined(DS_BUILD_E)
consolePrintf("build E\n");
- consolePrintf("ITE/IHNM (SAGA)\n");
+ consolePrintf("Inherit the Earth (SAGA)\n");
consolePrintf("-------------------------------\n");
#elif defined(DS_BUILD_F)
consolePrintf("build F\n");
@@ -2649,7 +2718,7 @@ int main(void)
consolePrintf("\n");
#endif
-
+
#ifdef USE_BUILT_IN_DRIVER_SELECTION
// Do M3 detection selectioon
int extraData = DSSaveFileManager::getExtraData();
@@ -2688,7 +2757,7 @@ int main(void)
disc_setEnable(mode);
DSSaveFileManager::setExtraData(mode);
#else
-
+
int mode = 0;
#endif
@@ -2734,11 +2803,11 @@ int main(void)
}
delete node;
-
+
updateStatus();
-
-
+
+
// OSystem_DS::instance();
g_system = new OSystem_DS();
@@ -2754,33 +2823,25 @@ int main(void)
//printf("'%s'", Common::ConfigManager::kApplicationDomain.c_str());
#if defined(DS_BUILD_A)
- char* argv[2] = {"/scummvmds", "--config=scummvm.ini"};
+ const char *argv[] = {"/scummvmds"};
#elif defined(DS_BUILD_B)
- char* argv[2] = {"/scummvmds", "--config=scummvmb.ini"};
+ const char *argv[] = {"/scummvmds", "--config=scummvmb.ini"};
#elif defined(DS_BUILD_C)
- char* argv[2] = {"/scummvmds", "--config=scummvmc.ini"};
+ const char *argv[] = {"/scummvmds", "--config=scummvmc.ini"};
#elif defined(DS_BUILD_D)
- char* argv[3] = {"/scummvmds", "--config=scummvmd.ini"};
+ const char *argv[] = {"/scummvmds", "--config=scummvmd.ini"};
#elif defined(DS_BUILD_E)
- char* argv[3] = {"/scummvmds", "--config=scummvme.ini"};
+ const char *argv[] = {"/scummvmds", "--config=scummvme.ini"};
#elif defined(DS_BUILD_F)
- char* argv[3] = {"/scummvmds", "--config=scummvmf.ini"};
+ const char *argv[] = {"/scummvmds", "--config=scummvmf.ini"};
#elif defined(DS_BUILD_G)
- char* argv[3] = {"/scummvmds", "--config=scummvmg.ini"};
+ const char *argv[] = {"/scummvmds", "--config=scummvmg.ini"};
#endif
-#ifdef DS_NON_SCUMM_BUILD
-
while (1) {
- scummvm_main(2, (char **) &argv);
+ scummvm_main(ARRAYSIZE(argv), (char **) &argv);
powerOff();
}
-#else
- while (1) {
- scummvm_main(1, (char **) &argv);
- powerOff();
- }
-#endif
return 0;
}
diff --git a/backends/platform/ds/arm9/source/dsmain.h b/backends/platform/ds/arm9/source/dsmain.h
index 85212a2d01..f20442b11e 100644
--- a/backends/platform/ds/arm9/source/dsmain.h
+++ b/backends/platform/ds/arm9/source/dsmain.h
@@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
-
+
#ifndef _DSMAIN_H
#define _DSMAIN_H
@@ -42,98 +42,100 @@ enum controlType {
};
struct gameListType {
- char gameId[16];
- controlType control;
+ char gameId[16];
+ controlType control;
};
// Pen reading functions
-void penInit();
-void penUpdate();
-bool getPenDown();
-bool getPenHeld();
-bool getPenReleased();
-int getPenX();
-int getPenY();
+void penInit();
+void penUpdate();
+bool getPenDown();
+bool getPenHeld();
+bool getPenReleased();
+int getPenX();
+int getPenY();
GLvector getPenPos();
-void consumePenEvents();
+void consumePenEvents();
// Pad reading
-int getKeysHeld();
-void keysUpdate();
-int getKeysDown();
-int getKeysReleased();
-void consumeKeys();
-int leftHandedSwap(int keys);
+int getKeysHeld();
+void keysUpdate();
+int getKeysDown();
+int getKeysReleased();
+void consumeKeys();
+int leftHandedSwap(int keys);
// Video
-void displayMode8Bit(); // Switch to 8-bit mode5
-void displayMode16Bit(); // Switch to 16-bit mode5
+void displayMode8Bit(); // Switch to 8-bit mode5
+void displayMode16Bit(); // Switch to 16-bit mode5
// Flip double buffer
-void displayMode16BitFlipBuffer();
+void displayMode16BitFlipBuffer();
// Get address of current back buffer
-u16* get16BitBackBuffer();
-u16* get8BitBackBuffer();
+u16* get16BitBackBuffer();
+u16* get8BitBackBuffer();
+s32 get8BitBackBufferStride();
+u16* getScalerBuffer();
-void setTalkPos(int x, int y);
-void setTopScreenTarget(int x, int y);
+void setTalkPos(int x, int y);
+void setTopScreenTarget(int x, int y);
void set200PercentFixedScale(bool on);
// Timers
-void setTimerCallback(OSystem_DS::TimerProc proc, int interval); // Setup a callback function at a regular interval
-int getMillis(); // Return the current runtime in milliseconds
-void doTimerCallback(); // Call callback function if required
+void setTimerCallback(OSystem_DS::TimerProc proc, int interval); // Setup a callback function at a regular interval
+int getMillis(); // Return the current runtime in milliseconds
+void doTimerCallback(); // Call callback function if required
// Sound
-void setSoundProc(OSystem_DS::SoundProc proc, void* param); // Setup a callback function for sound
-void doSoundCallback(); // Call function if sound buffers need more data
-void playSound(const void* data, u32 length, bool loop, bool adpcm = false, int rate = 22050); // Start a sound
-void stopSound(int channel);
+void setSoundProc(OSystem_DS::SoundProc proc, void* param); // Setup a callback function for sound
+void doSoundCallback(); // Call function if sound buffers need more data
+void playSound(const void* data, u32 length, bool loop, bool adpcm = false, int rate = 22050); // Start a sound
+void stopSound(int channel);
int getSoundFrequency();
// Event queue
-void addEventsToQueue();
-void VBlankHandler();
+void addEventsToQueue();
+void VBlankHandler();
// Sam and Max Stuff
-void setGameID(int id);
-void setCursorIcon(const u8* icon, uint w, uint h, byte keycolor, int hotspotX, int hotspotY);
+void setGameID(int id);
+void setCursorIcon(const u8* icon, uint w, uint h, byte keycolor, int hotspotX, int hotspotY);
void setShowCursor(bool enable);
void setMouseCursorVisible(bool visible);
// Shake
-void setShakePos(int shakePos);
+void setShakePos(int shakePos);
// Reports
-void memoryReport();
+void memoryReport();
// GBAMP
-bool isGBAMPAvailable();
+bool isGBAMPAvailable();
// Sleep (I'd like some of that right now)
-void checkSleepMode();
+void checkSleepMode();
// Virtual keyboard
-void setKeyboardIcon(bool enable);
-bool getKeyboardIcon();
-void setKeyboardEnable(bool en);
-bool getKeyboardEnable();
+void setKeyboardIcon(bool enable);
+bool getKeyboardIcon();
+void setKeyboardEnable(bool en);
+bool getKeyboardEnable();
// Options
-void setLeftHanded(bool enable);
-void setTouchXOffset(int x);
-void setTouchYOffset(int y);
-void setUnscaledMode(bool enable);
+void setLeftHanded(bool enable);
+void setTouchXOffset(int x);
+void setTouchYOffset(int y);
+void setUnscaledMode(bool enable);
void setSnapToBorder(bool enable);
-void setIndyFightState(bool st);
-bool getIndyFightState();
+void setIndyFightState(bool st);
+bool getIndyFightState();
bool isCpuScalerEnabled();
void setCpuScalerEnable(bool enable);
// Display
-bool getIsDisplayMode8Bit();
-void setGameSize(int width, int height);
+bool getIsDisplayMode8Bit();
+void setGameSize(int width, int height);
int getGameWidth();
int getGameHeight();
diff --git a/backends/platform/ds/arm9/source/dsoptions.cpp b/backends/platform/ds/arm9/source/dsoptions.cpp
index d23201f745..edb9c70580 100644
--- a/backends/platform/ds/arm9/source/dsoptions.cpp
+++ b/backends/platform/ds/arm9/source/dsoptions.cpp
@@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
-
+
#include "dsoptions.h"
#include "dsmain.h"
#include "gui/dialog.h"
@@ -28,6 +28,7 @@
#include "osystem_ds.h"
#include "engines/scumm/scumm.h"
#include "touchkeyboard.h"
+#include "gui/PopUpWidget.h"
#define ALLOW_CPU_SCALER
@@ -40,28 +41,39 @@ namespace Scumm {
namespace DS {
-DSOptionsDialog::DSOptionsDialog() : GUI::Dialog(20, 0, 320 - 40, 230 - 20) {
+DSOptionsDialog::DSOptionsDialog() : GUI::Dialog(5, 0, 320 - 5, 230 - 20) {
addButton(this, 10, 175, "Close", GUI::kCloseCmd, 'C');
+ _radioButtonMode = false;
+
#ifdef DS_SCUMM_BUILD
if (!DS::isGBAMPAvailable()) {
// addButton(this, 100, 140, "Delete Save", 'dels', 'D');
}
#endif
- new GUI::StaticTextWidget(this, 80, 10, 130, 15, "ScummVM DS Options", GUI::kTextAlignCenter);
+ new GUI::StaticTextWidget(this, 90, 10, 130, 15, "ScummVM DS Options", GUI::kTextAlignCenter);
- _leftHandedCheckbox = new GUI::CheckboxWidget(this, 20, 25, 200, 20, "Left handed mode", 0, 'L');
- _indyFightCheckbox = new GUI::CheckboxWidget(this, 20, 40, 200, 20, "Indy fighting controls", 0, 'I');
- _unscaledCheckbox = new GUI::CheckboxWidget(this, 20, 55, 200, 20, "Unscaled main screen", 0, 'S');
- _twoHundredPercentCheckbox = new GUI::CheckboxWidget(this, 20, 70, 230, 20, "Zoomed screen at fixed 200% zoom", 0, 'T');
- _highQualityAudioCheckbox = new GUI::CheckboxWidget(this, 20, 85, 250, 20, "High quality audio (slower) (reboot)", 0, 'T');
- _disablePowerOff = new GUI::CheckboxWidget(this, 20, 100, 250, 20, "Disable power off on quit", 0, 'T');
- _showCursorCheckbox = new GUI::CheckboxWidget(this, 20, 115, 130, 20, "Show mouse cursor", 0, 'T');
-#ifdef ALLOW_CPU_SCALER
- _cpuScaler = new GUI::CheckboxWidget(this, 160, 115, 90, 20, "CPU scaler", 0, 'T');
-#endif
- _snapToBorderCheckbox = new GUI::CheckboxWidget(this, 20, 130, 250, 20, "Snap to border", 0, 'T');
+ _leftHandedCheckbox = new GUI::CheckboxWidget(this, 5, 70, 130, 20, "Left handed mode", 0, 'L');
+ _indyFightCheckbox = new GUI::CheckboxWidget(this, 5, 40, 200, 20, "Indy fighting controls", 0, 'I');
+ _twoHundredPercentCheckbox = new GUI::CheckboxWidget(this, 5, 55, 230, 20, "Zoomed screen at fixed 200% zoom", 0, 'T');
+ _highQualityAudioCheckbox = new GUI::CheckboxWidget(this, 5, 25, 250, 20, "High quality audio (slower) (reboot)", 0, 'T');
+ _disablePowerOff = new GUI::CheckboxWidget(this, 5, 85, 130, 20, "Disable power off", 0, 'T');
+ _showCursorCheckbox = new GUI::CheckboxWidget(this, 5, 100, 130, 20, "Show mouse cursor", 0, 'T');
+
+//#ifdef ALLOW_CPU_SCALER
+// _cpuScaler = new GUI::CheckboxWidget(this, 160, 115, 90, 20, "CPU scaler", 0, 'T');
+//#endif
+
+ new GUI::StaticTextWidget(this, 180, 70, 130, 15, "Main screen:", GUI::kTextAlignLeft);
+
+ _hardScaler = new GUI::CheckboxWidget(this, 140, 85, 170, 20, "Hardware scale (fast)", 0x10000001, 'T');
+ _cpuScaler = new GUI::CheckboxWidget(this, 140, 100, 170, 20, "Software scale (quality)", 0x10000002, 'S');
+ _unscaledCheckbox = new GUI::CheckboxWidget(this, 140, 115, 170, 20, "Unscaled", 0x10000003, 'S');
+
+
+
+ _snapToBorderCheckbox = new GUI::CheckboxWidget(this, 5, 115, 120, 20, "Snap to border", 0, 'T');
new GUI::StaticTextWidget(this, 20, 145, 110, 15, "Touch X Offset", GUI::kTextAlignLeft);
_touchX = new GUI::SliderWidget(this, 130, 145, 130, 12, 1);
@@ -153,6 +165,11 @@ DSOptionsDialog::DSOptionsDialog() : GUI::Dialog(20, 0, 320 - 40, 230 - 20) {
_touchY->setValue(0);
}
+ if (!_cpuScaler->getState() && !_unscaledCheckbox->getState()) {
+ _hardScaler->setState(true);
+ }
+
+ _radioButtonMode = true;
}
DSOptionsDialog::~DSOptionsDialog() {
@@ -177,16 +194,49 @@ void DSOptionsDialog::updateConfigManager() {
}
void DSOptionsDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data) {
+
+ static bool guard = false;
+
+ if ((!guard) && (_radioButtonMode))
+ {
+ guard = true;
+
+ if ((cmd & 0xFF000000) == 0x10000000)
+ {
+ _cpuScaler->setState(false);
+ _hardScaler->setState(false);
+ _unscaledCheckbox->setState(false);
+
+ if ((sender == _cpuScaler) && (cmd == 0x10000002))
+ {
+ _cpuScaler->setState(true);
+ }
+
+ if ((sender == _hardScaler) && (cmd == 0x10000001))
+ {
+ _hardScaler->setState(true);
+ }
+
+ if ((sender == _unscaledCheckbox) && (cmd == 0x10000003))
+ {
+ _unscaledCheckbox->setState(true);
+ }
+ }
+
+ guard = false;
+
+ }
+
if (cmd == GUI::kCloseCmd) {
updateConfigManager();
close();
}
-
+
#ifdef DS_SCUMM_BUILD
/* if (cmd == 'dels') {
_delDialog->setList(Scumm::generateSavegameList(Scumm::g_scumm, false));
_delDialog->handleCommand(NULL, GUI::kListSelectionChangedCmd, 0);
-
+
Common::Event event;
event.type = Common::EVENT_KEYDOWN;
event.kbd.ascii = 0;
@@ -195,9 +245,9 @@ void DSOptionsDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, uint
event.type = Common::EVENT_KEYUP;
OSystem_DS::instance()->addEvent(event);
-
+
int idx = _delDialog->runModal();
-
+
if (idx >= 0) {
char name[256];
Scumm::g_scumm->makeSavegameName(name, idx, false);
@@ -205,10 +255,10 @@ void DSOptionsDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, uint
((DSSaveFileManager *) (OSystem_DS::instance()->getSavefileManager()))->deleteFile(name);
}
}
-
+
}*/
#endif
-
+
}
@@ -220,11 +270,11 @@ void togglePause() {
OSystem_DS* system = OSystem_DS::instance();
event.type = Common::EVENT_KEYDOWN;
- event.kbd.keycode = Common::KEYCODE_p;
+ event.kbd.keycode = Common::KEYCODE_p;
event.kbd.ascii = 'p';
event.kbd.flags = 0;
system->addEvent(event);
-
+
event.type = Common::EVENT_KEYUP;
system->addEvent(event);
}
@@ -235,14 +285,12 @@ void showOptionsDialog() {
togglePause();
DS::displayMode16Bit();
-
+
DSOptionsDialog* d = new DSOptionsDialog();
d->runModal();
- consolePrintf("deleting dialog\n");
delete d;
-
- consolePrintf("going to 8 bit\n");
+
DS::displayMode8Bit();
togglePause();
@@ -303,7 +351,8 @@ void setOptions() {
} else {
DS::setCpuScalerEnable(false);
}
-#endif
+#endif
+
}
}
diff --git a/backends/platform/ds/arm9/source/dsoptions.h b/backends/platform/ds/arm9/source/dsoptions.h
index 3c9da82a83..9cfa785ca8 100644
--- a/backends/platform/ds/arm9/source/dsoptions.h
+++ b/backends/platform/ds/arm9/source/dsoptions.h
@@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
-
+
#ifndef _DSOPTIONS_H_
#define _DSOPTIONS_H_
@@ -39,7 +39,7 @@ class DSOptionsDialog : public GUI::Dialog {
public:
DSOptionsDialog();
~DSOptionsDialog();
-
+
protected:
virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data);
void togglePause();
@@ -53,14 +53,18 @@ protected:
GUI::CheckboxWidget* _indyFightCheckbox;
GUI::CheckboxWidget* _highQualityAudioCheckbox;
GUI::CheckboxWidget* _disablePowerOff;
- GUI::CheckboxWidget* _cpuScaler;
GUI::CheckboxWidget* _showCursorCheckbox;
GUI::CheckboxWidget* _snapToBorderCheckbox;
+ GUI::CheckboxWidget* _hardScaler;
+ GUI::CheckboxWidget* _cpuScaler;
+
#ifdef DS_SCUMM_BUILD
Scumm::SaveLoadChooser* _delDialog;
#endif
+ bool _radioButtonMode;
+
};
extern void showOptionsDialog();
diff --git a/backends/platform/ds/arm9/source/fat/disc_io.c b/backends/platform/ds/arm9/source/fat/disc_io.c
index f456343a2c..6d48674d62 100644
--- a/backends/platform/ds/arm9/source/fat/disc_io.c
+++ b/backends/platform/ds/arm9/source/fat/disc_io.c
@@ -5,7 +5,7 @@
uniformed io-interface to work with Chishm's FAT library
Written by MightyMax
-
+
Modified by Chishm:
2005-11-06
* Added WAIT_CR modifications for NDS
@@ -87,7 +87,7 @@ LPIO_INTERFACE active_interface = 0;
Disc Cache functions
2006-02-03:
- Added by www.neoflash.com
+ Added by www.neoflash.com
*/
int discDetect = 0;
@@ -99,7 +99,7 @@ int dldiFound = FALSE;
#include <string.h>
#define CACHE_FREE 0xFFFFFFFF
-
+
static u8 cacheBuffer[ DISC_CACHE_COUNT * 512 ];
static struct {
@@ -112,20 +112,20 @@ FATDevice currentDevice;
static u32 disc_CacheFind(u32 sector) {
u32 i;
-
+
for( i = 0; i < DISC_CACHE_COUNT; i++ ) {
if( cache[ i ].sector == sector )
return i;
}
-
+
return CACHE_FREE;
}
static u32 disc_CacheFindFree(void) {
-
+
u32 i = 0, j;
u32 count = -1;
-
+
for( j = 0; j < DISC_CACHE_COUNT; j++ ) {
if( cache[ j ].sector == CACHE_FREE ) {
@@ -142,7 +142,7 @@ static u32 disc_CacheFindFree(void) {
if( cache[ i ].sector != CACHE_FREE && cache[i].dirty != 0 ) {
active_interface->fn_WriteSectors( cache[ i ].sector, 1, &cacheBuffer[ i * 512 ] );
- /* todo: handle write error here
+ /* todo: handle write error here
cache[ i ].sector = CACHE_FREE;
cache[ i ].dirty = 0;
@@ -431,7 +431,7 @@ bool disc_setDsSlotInterface (void)
#endif
-bool disc_Init(void)
+bool disc_Init(void)
{
#ifdef DISC_CACHE
disc_CacheInit();
@@ -455,15 +455,15 @@ bool disc_Init(void)
// could not find a working IO Interface
active_interface = 0 ;
return false ;
-}
+}
-bool disc_IsInserted(void)
+bool disc_IsInserted(void)
{
if (active_interface) return active_interface->fn_IsInserted() ;
return false ;
-}
+}
-bool disc_ReadSectors(u32 sector, u8 numSecs, void* buffer)
+bool disc_ReadSectors(u32 sector, u8 numSecs, void* buffer)
{
#ifdef DISC_CACHE
u8 *p=(u8*)buffer;
@@ -480,9 +480,9 @@ bool disc_ReadSectors(u32 sector, u8 numSecs, void* buffer)
if (active_interface) return active_interface->fn_ReadSectors(sector,numSecs,buffer) ;
return false ;
#endif
-}
+}
-bool disc_WriteSectors(u32 sector, u8 numSecs, void* buffer)
+bool disc_WriteSectors(u32 sector, u8 numSecs, void* buffer)
{
/*#ifdef DISC_CACHE
u8 *p=(u8*)buffer;
@@ -499,18 +499,46 @@ bool disc_WriteSectors(u32 sector, u8 numSecs, void* buffer)
#ifdef DISC_CACHE
disc_CacheInit();
#endif
+
+#define MISALIGNMENT_BODGE
+
+#ifdef MISALIGNMENT_BODGE
+ // This bodge works around problems with some card reader drivers which require data to be
+ // aligned to 2- or 4-byte boundaries it varies which one they require. This bodge sorts
+ // it but also reduces write speed as it doesn't use the multi-sector write capability any
+ // more. A better fix will be written for a future version.
+
+ if (active_interface) {
+ u8 sectorBuffer[512];
+ int r;
+
+ for (r = 0; r < numSecs; r++) {
+ memcpy(sectorBuffer, &buffer[r * 512], 512);
+
+ if (!active_interface->fn_WriteSectors(sector + r, 1, sectorBuffer))
+ {
+ return false;
+ }
+ }
+
+
+ return true;
+ }
+
+#else
if (active_interface) return active_interface->fn_WriteSectors(sector,numSecs,buffer) ;
return false ;
+#endif
//#endif
-}
+}
-bool disc_ClearStatus(void)
+bool disc_ClearStatus(void)
{
if (active_interface) return active_interface->fn_ClearStatus() ;
return false ;
-}
+}
-bool disc_Shutdown(void)
+bool disc_Shutdown(void)
{
#ifdef DISC_CACHE
disc_CacheFlush();
@@ -518,7 +546,7 @@ bool disc_Shutdown(void)
if (active_interface) active_interface->fn_Shutdown() ;
active_interface = 0 ;
return true ;
-}
+}
u32 disc_HostType (void)
{
diff --git a/backends/platform/ds/arm9/source/fat/disc_io.h b/backends/platform/ds/arm9/source/fat/disc_io.h
index b2317ca110..2d3da1fc6f 100644
--- a/backends/platform/ds/arm9/source/fat/disc_io.h
+++ b/backends/platform/ds/arm9/source/fat/disc_io.h
@@ -7,7 +7,7 @@
// Use DMA to read the card, remove this line to use normal reads/writes
// #define _CF_USE_DMA
-// Allow buffers not aligned to 16 bits when reading files.
+// Allow buffers not aligned to 16 bits when reading files.
// Note that this will slow down access speed, so only use if you have to.
// It is also incompatible with DMA
#define _CF_ALLOW_UNALIGNED
@@ -43,7 +43,7 @@
// This allows the code to build on an earlier version of libnds, before the register was renamed
#ifndef REG_EXMEMCNT
-#define REG_EXMEMCNT REG_EXEMEMCNT
+#define REG_EXMEMCNT REG_EXEMEMCNT
#endif
#ifndef REG_EXEMEMCNT
@@ -53,7 +53,7 @@
//----------------------------------------------------------------------
#if defined _CF_USE_DMA && defined _CF_ALLOW_UNALIGNED
- #error You can't use both DMA and unaligned memory
+ #error You can not use both DMA and unaligned memory
#endif
// When compiling for NDS, make sure NDS is defined
@@ -70,7 +70,7 @@
#endif
// Disable NDS specific hardware and features if running on a GBA
-#ifndef NDS
+#ifndef NDS
#undef SUPPORT_NMMC
#undef DISC_CACHE
#endif
diff --git a/backends/platform/ds/arm9/source/fat/gba_nds_fat.c b/backends/platform/ds/arm9/source/fat/gba_nds_fat.c
index fffd8ab88b..b5fdd665df 100644
--- a/backends/platform/ds/arm9/source/fat/gba_nds_fat.c
+++ b/backends/platform/ds/arm9/source/fat/gba_nds_fat.c
@@ -42,7 +42,7 @@
//---------------------------------------------------------------
// Appropriate placement of CF functions and data
#ifdef NDS
- #define _VARS_IN_RAM
+ #define _VARS_IN_RAM
#else
#define _VARS_IN_RAM __attribute__ ((section (".sbss")))
#endif
@@ -74,7 +74,7 @@
#ifdef __GNUC__
#define __PACKED __attribute__ ((__packed__))
#else
- #define __PACKED
+ #define __PACKED
#pragma pack(1)
#endif
@@ -98,7 +98,7 @@ typedef struct
u32 numSectors;
union // Different types of extended BIOS Parameter Block for FAT16 and FAT32
{
- struct
+ struct
{
// Ext BIOS Parameter Block for FAT16
u8 driveNumber;
@@ -110,7 +110,7 @@ typedef struct
// Bootcode
u8 bootCode[448];
} __PACKED fat16;
- struct
+ struct
{
// FAT32 extended block
u32 sectorsPerFAT32;
@@ -158,7 +158,7 @@ typedef struct
typedef struct
{
u8 ordinal; // Position within LFN
- u16 char0;
+ u16 char0;
u16 char1;
u16 char2;
u16 char3;
@@ -177,7 +177,7 @@ typedef struct
u16 char12;
} __PACKED DIR_ENT_LFN;
-const char lfn_offset_table[13]={0x01,0x03,0x05,0x07,0x09,0x0E,0x10,0x12,0x14,0x16,0x18,0x1C,0x1E};
+const char lfn_offset_table[13]={0x01,0x03,0x05,0x07,0x09,0x0E,0x10,0x12,0x14,0x16,0x18,0x1C,0x1E};
// End of packed structs
#ifdef __PACKED
@@ -190,7 +190,7 @@ const char lfn_offset_table[13]={0x01,0x03,0x05,0x07,0x09,0x0E,0x10,0x12,0x14,0x
//-----------------------------------------------------------------
// Global Variables
-// _VARS_IN_RAM variables are stored in the largest section of WRAM
+// _VARS_IN_RAM variables are stored in the largest section of WRAM
// available: IWRAM on NDS ARM7, EWRAM on NDS ARM9 and GBA
// Files
@@ -305,7 +305,7 @@ u16 getRTCtoFileTime (void)
u16 getRTCtoFileDate (void)
{
#ifdef NDS
- return (
+ return (
( ((IPC->rtc_year + 20) & 0x7F) <<9) |
( (IPC->rtc_month & 0xF) << 5) |
(IPC->rtc_day & 0x1F) );
@@ -330,13 +330,13 @@ u32 FAT_NextCluster(u32 cluster)
u32 nextCluster = CLUSTER_FREE;
u32 sector;
int offset;
-
- switch (filesysType)
+
+ switch (filesysType)
{
case FS_UNKNOWN:
nextCluster = CLUSTER_FREE;
break;
-
+
case FS_FAT12:
sector = filesysFAT + (((cluster * 3) / 2) / BYTE_PER_READ);
offset = ((cluster * 3) / 2) % BYTE_PER_READ;
@@ -351,32 +351,32 @@ u32 FAT_NextCluster(u32 cluster)
nextCluster = ((u8*)fatBuffer)[offset];
offset++;
-
+
if (offset >= BYTE_PER_READ) {
offset = 0;
fatBufferCurSector++;
disc_ReadSector(fatBufferCurSector, fatBuffer);
}
-
+
nextCluster |= (((u8*)fatBuffer)[offset]) << 8;
-
+
if (cluster & 0x01) {
nextCluster = nextCluster >> 4;
- } else {
+ } else {
nextCluster &= 0x0FFF;
}
-
+
if (nextCluster >= 0x0FF7)
{
nextCluster = CLUSTER_EOF;
}
break;
-
+
case FS_FAT16:
sector = filesysFAT + ((cluster << 1) / BYTE_PER_READ);
offset = cluster % (BYTE_PER_READ >> 1);
-
+
// If FAT buffer contains wrong sector
if (sector != fatBufferCurSector)
{
@@ -387,17 +387,17 @@ u32 FAT_NextCluster(u32 cluster)
// read the nextCluster value
nextCluster = ((u16*)fatBuffer)[offset];
-
+
if (nextCluster >= 0xFFF7)
{
nextCluster = CLUSTER_EOF;
}
break;
-
+
case FS_FAT32:
sector = filesysFAT + ((cluster << 2) / BYTE_PER_READ);
offset = cluster % (BYTE_PER_READ >> 2);
-
+
// If FAT buffer contains wrong sector
if (sector != fatBufferCurSector)
{
@@ -408,18 +408,18 @@ u32 FAT_NextCluster(u32 cluster)
// read the nextCluster value
nextCluster = (((u32*)fatBuffer)[offset]) & 0x0FFFFFFF;
-
+
if (nextCluster >= 0x0FFFFFF7)
{
nextCluster = CLUSTER_EOF;
}
break;
-
+
default:
nextCluster = CLUSTER_FREE;
break;
}
-
+
return nextCluster;
}
@@ -437,13 +437,13 @@ bool FAT_WriteFatEntry (u32 cluster, u32 value)
{
return false;
}
-
- switch (filesysType)
+
+ switch (filesysType)
{
case FS_UNKNOWN:
return false;
break;
-
+
case FS_FAT12:
sector = filesysFAT + (((cluster * 3) / 2) / BYTE_PER_READ);
offset = ((cluster * 3) / 2) % BYTE_PER_READ;
@@ -465,32 +465,32 @@ bool FAT_WriteFatEntry (u32 cluster, u32 value)
offset = 0;
// write the buffer back to disc
disc_WriteSector(fatBufferCurSector, fatBuffer);
- // read the next sector
+ // read the next sector
fatBufferCurSector++;
disc_ReadSector(fatBufferCurSector, fatBuffer);
}
-
+
((u8*)fatBuffer)[offset] = (value & 0x0FF0) >> 4;
} else {
-
+
((u8*)fatBuffer)[offset] = value & 0xFF;
-
+
offset++;
if (offset >= BYTE_PER_READ) {
offset = 0;
// write the buffer back to disc
disc_WriteSector(fatBufferCurSector, fatBuffer);
- // read the next sector
+ // read the next sector
fatBufferCurSector++;
disc_ReadSector(fatBufferCurSector, fatBuffer);
}
-
+
((u8*)fatBuffer)[offset] = (((u8*)fatBuffer)[offset] & 0xF0) | ((value >> 8) & 0x0F);
}
break;
-
+
case FS_FAT16:
sector = filesysFAT + ((cluster << 1) / BYTE_PER_READ);
offset = cluster % (BYTE_PER_READ >> 1);
@@ -507,11 +507,11 @@ bool FAT_WriteFatEntry (u32 cluster, u32 value)
((u16*)fatBuffer)[offset] = (value & 0xFFFF);
break;
-
+
case FS_FAT32:
sector = filesysFAT + ((cluster << 2) / BYTE_PER_READ);
offset = cluster % (BYTE_PER_READ >> 2);
-
+
// If FAT buffer contains wrong sector
if (sector != fatBufferCurSector)
{
@@ -524,15 +524,15 @@ bool FAT_WriteFatEntry (u32 cluster, u32 value)
(((u32*)fatBuffer)[offset]) = value;
break;
-
+
default:
return false;
break;
}
-
+
// write the buffer back to disc
disc_WriteSector(fatBufferCurSector, fatBuffer);
-
+
return true;
}
#endif
@@ -540,8 +540,8 @@ bool FAT_WriteFatEntry (u32 cluster, u32 value)
#ifdef CAN_WRITE_TO_DISC
/*-----------------------------------------------------------------
FAT_ReadWriteFatEntryBuffered
-Internal function - writes FAT information about a cluster to a
- buffer that should then be flushed to disc using
+Internal function - writes FAT information about a cluster to a
+ buffer that should then be flushed to disc using
FAT_WriteFatEntryFlushBuffer()
Call FAT_WriteFatEntry first so as not to ruin the disc.
Also returns the entry being replaced
@@ -555,13 +555,13 @@ u32 FAT_ReadWriteFatEntryBuffered (u32 cluster, u32 value)
if ((cluster < 0x0002) || (cluster > fatLastCluster))
return CLUSTER_FREE;
-
- switch (filesysType)
+
+ switch (filesysType)
{
case FS_UNKNOWN:
oldValue = CLUSTER_FREE;
break;
-
+
case FS_FAT12:
sector = filesysFAT + (((cluster * 3) / 2) / BYTE_PER_READ);
offset = ((cluster * 3) / 2) % BYTE_PER_READ;
@@ -587,40 +587,40 @@ u32 FAT_ReadWriteFatEntryBuffered (u32 cluster, u32 value)
offset = 0;
// write the buffer back to disc
disc_WriteSector(fatBufferCurSector, fatBuffer);
- // read the next sector
+ // read the next sector
fatBufferCurSector++;
disc_ReadSector(fatBufferCurSector, fatBuffer);
}
-
+
oldValue |= ((((u8*)fatBuffer)[offset]) << 4) & 0x0FF0;
((u8*)fatBuffer)[offset] = (value & 0x0FF0) >> 4;
} else {
-
+
oldValue = ((u8*)fatBuffer)[offset] & 0xFF;
((u8*)fatBuffer)[offset] = value & 0xFF;
-
+
offset++;
if (offset >= BYTE_PER_READ) {
offset = 0;
// write the buffer back to disc
disc_WriteSector(fatBufferCurSector, fatBuffer);
- // read the next sector
+ // read the next sector
fatBufferCurSector++;
disc_ReadSector(fatBufferCurSector, fatBuffer);
}
-
+
oldValue |= (((u8*)fatBuffer)[offset] & 0x0F) << 8;
((u8*)fatBuffer)[offset] = (((u8*)fatBuffer)[offset] & 0xF0) | ((value >> 8) & 0x0F);
}
- if (oldValue >= 0x0FF7)
+ if (oldValue >= 0x0FF7)
{
oldValue = CLUSTER_EOF;
}
break;
-
+
case FS_FAT16:
sector = filesysFAT + ((cluster << 1) / BYTE_PER_READ);
offset = cluster % (BYTE_PER_READ >> 1);
@@ -634,23 +634,23 @@ u32 FAT_ReadWriteFatEntryBuffered (u32 cluster, u32 value)
// Load correct sector to buffer
fatBufferCurSector = sector;
disc_ReadSector(fatBufferCurSector, fatBuffer);
- }
+ }
// write the value to the FAT buffer
oldValue = ((u16*)fatBuffer)[offset];
((u16*)fatBuffer)[offset] = value;
- if (oldValue >= 0xFFF7)
+ if (oldValue >= 0xFFF7)
{
oldValue = CLUSTER_EOF;
}
break;
-
+
case FS_FAT32:
sector = filesysFAT + ((cluster << 2) / BYTE_PER_READ);
offset = cluster % (BYTE_PER_READ >> 2);
-
+
// If FAT buffer contains wrong sector
if (sector != fatBufferCurSector)
{
@@ -666,18 +666,18 @@ u32 FAT_ReadWriteFatEntryBuffered (u32 cluster, u32 value)
oldValue = ((u32*)fatBuffer)[offset];
((u32*)fatBuffer)[offset] = value;
- if (oldValue >= 0x0FFFFFF7)
+ if (oldValue >= 0x0FFFFFF7)
{
oldValue = CLUSTER_EOF;
}
break;
-
+
default:
oldValue = CLUSTER_FREE;
break;
}
-
+
return oldValue;
}
#endif
@@ -727,7 +727,7 @@ u32 FAT_FirstFreeCluster(void)
/*-----------------------------------------------------------------
FAT_LinkFreeCluster
Internal function - gets the first available free cluster, sets it
-to end of file, links the input cluster to it then returns the
+to end of file, links the input cluster to it then returns the
cluster number
-----------------------------------------------------------------*/
u32 FAT_LinkFreeCluster(u32 cluster)
@@ -746,7 +746,7 @@ u32 FAT_LinkFreeCluster(u32 cluster)
{
return curLink; // Return the current link - don't allocate a new one
}
-
+
// Get a free cluster
firstFree = FAT_FirstFreeCluster();
@@ -777,7 +777,7 @@ Internal function - frees any cluster used by a file
bool FAT_ClearLinks (u32 cluster)
{
u32 nextCluster;
-
+
if ((cluster < 0x0002) || (cluster > fatLastCluster))
return false;
@@ -793,7 +793,7 @@ bool FAT_ClearLinks (u32 cluster)
while ((cluster != CLUSTER_EOF) && (cluster != CLUSTER_FREE))
{
cluster = FAT_ReadWriteFatEntryBuffered (cluster, CLUSTER_FREE);
- }
+ }
// Flush fat write buffer
FAT_WriteFatEntryFlushBuffer ();
@@ -814,7 +814,7 @@ bool FAT_InitFiles (void)
int i;
int bootSector;
BOOT_SEC* bootSec;
-
+
if (!disc_Init())
{
return (false);
@@ -830,7 +830,7 @@ bool FAT_InitFiles (void)
return false;
}*/
-
+
// Check if there is a FAT string, which indicates this is a boot sector
if ((globalBuffer[0x36] == 'F') && (globalBuffer[0x37] == 'A') && (globalBuffer[0x38] == 'T'))
@@ -848,9 +848,9 @@ bool FAT_InitFiles (void)
// First check for an active partition
for (i=0x1BE; (i < 0x1FE) && (globalBuffer[i] != 0x80); i+= 0x10);
// If it didn't find an active partition, search for any valid partition
- if (i == 0x1FE)
+ if (i == 0x1FE)
for (i=0x1BE; (i < 0x1FE) && (globalBuffer[i+0x04] == 0x00); i+= 0x10);
-
+
// Go to first valid partition
if ( i != 0x1FE) // Make sure it found a partition
{
@@ -865,7 +865,7 @@ bool FAT_InitFiles (void)
if (!disc_ReadSector (bootSector, bootSec)) {
return false;
}
-
+
// Store required information about the file system
if (bootSec->sectorsPerFAT != 0)
{
@@ -875,7 +875,7 @@ bool FAT_InitFiles (void)
{
filesysSecPerFAT = bootSec->extBlock.fat32.sectorsPerFAT32;
}
-
+
if (bootSec->numSectorsSmall != 0)
{
filesysNumSec = bootSec->numSectorsSmall;
@@ -987,7 +987,7 @@ Return the file info structure of the next valid file entry
u32 dirCluster: IN cluster of subdirectory table
int entry: IN the desired file entry
int origin IN: relative position of the entry
-DIR_ENT return OUT: desired dirEntry. First char will be FILE_FREE if
+DIR_ENT return OUT: desired dirEntry. First char will be FILE_FREE if
the entry does not exist.
-----------------------------------------------------------------*/
DIR_ENT FAT_GetDirEntry ( u32 dirCluster, int entry, int origin)
@@ -1011,8 +1011,8 @@ DIR_ENT FAT_GetDirEntry ( u32 dirCluster, int entry, int origin)
{
return (dir);
}
-
- switch (origin)
+
+ switch (origin)
{
case SEEK_SET:
wrkDirCluster = dirCluster;
@@ -1022,7 +1022,7 @@ DIR_ENT FAT_GetDirEntry ( u32 dirCluster, int entry, int origin)
case SEEK_CUR: // Don't change anything
break;
case SEEK_END: // Find entry signifying end of directory
- // Subtraction will never reach 0, so it keeps going
+ // Subtraction will never reach 0, so it keeps going
// until reaches end of directory
wrkDirCluster = dirCluster;
wrkDirSector = 0;
@@ -1055,7 +1055,7 @@ DIR_ENT FAT_GetDirEntry ( u32 dirCluster, int entry, int origin)
{
notFound = true;
}
- firstSector = FAT_ClustToSect(wrkDirCluster);
+ firstSector = FAT_ClustToSect(wrkDirCluster);
}
else if ((wrkDirCluster == FAT16_ROOT_DIR_CLUSTER) && (wrkDirSector == (filesysData - filesysRootDir)))
{
@@ -1082,7 +1082,7 @@ DIR_ENT FAT_GetDirEntry ( u32 dirCluster, int entry, int origin)
lfnName[0] = '\0';
}
}
- if (entry == 0)
+ if (entry == 0)
{
if (!lfnExists)
{
@@ -1128,7 +1128,7 @@ DIR_ENT FAT_GetDirEntry ( u32 dirCluster, int entry, int origin)
}
}
} while (!found && !notFound);
-
+
// If no file is found, return FILE_FREE
if (notFound)
{
@@ -1141,7 +1141,7 @@ DIR_ENT FAT_GetDirEntry ( u32 dirCluster, int entry, int origin)
/*-----------------------------------------------------------------
FAT_GetLongFilename
-Get the long name of the last file or directory retrived with
+Get the long name of the last file or directory retrived with
GetDirEntry. Also works for FindFirstFile and FindNextFile.
If a long name doesn't exist, it returns the short name
instead.
@@ -1156,14 +1156,14 @@ bool FAT_GetLongFilename (char* filename)
strncpy (filename, lfnName, MAX_FILENAME_LENGTH - 1);
filename[MAX_FILENAME_LENGTH - 1] = '\0';
-
+
return true;
}
/*-----------------------------------------------------------------
FAT_GetFilename
-Get the alias (short name) of the file or directory stored in
+Get the alias (short name) of the file or directory stored in
dirEntry
DIR_ENT dirEntry: IN a valid directory table entry
char* alias OUT: will be filled with the alias (short filename),
@@ -1192,7 +1192,7 @@ bool FAT_GetFilename (DIR_ENT dirEntry, char* alias)
}
}
else
- {
+ {
// Copy the filename from the dirEntry to the string
for (i = 0; (i < 8) && (dirEntry.name[i] != ' '); i++)
{
@@ -1230,8 +1230,8 @@ bool FAT_GetAlias (char* alias)
}
// Read in the last accessed directory entry
disc_ReadSector ((wrkDirCluster == FAT16_ROOT_DIR_CLUSTER ? filesysRootDir : FAT_ClustToSect(wrkDirCluster)) + wrkDirSector, globalBuffer);
-
- return FAT_GetFilename (((DIR_ENT*)globalBuffer)[wrkDirOffset], alias);
+
+ return FAT_GetFilename (((DIR_ENT*)globalBuffer)[wrkDirOffset], alias);
}
/*-----------------------------------------------------------------
@@ -1244,8 +1244,8 @@ u32 FAT_GetFileSize (void)
{
// Read in the last accessed directory entry
disc_ReadSector ((wrkDirCluster == FAT16_ROOT_DIR_CLUSTER ? filesysRootDir : FAT_ClustToSect(wrkDirCluster)) + wrkDirSector, globalBuffer);
-
- return ((DIR_ENT*)globalBuffer)[wrkDirOffset].fileSize;
+
+ return ((DIR_ENT*)globalBuffer)[wrkDirOffset].fileSize;
}
/*-----------------------------------------------------------------
@@ -1257,8 +1257,8 @@ u32 FAT_GetFileCluster (void)
{
// Read in the last accessed directory entry
disc_ReadSector ((wrkDirCluster == FAT16_ROOT_DIR_CLUSTER ? filesysRootDir : FAT_ClustToSect(wrkDirCluster)) + wrkDirSector, globalBuffer);
-
- return (((DIR_ENT*)globalBuffer)[wrkDirOffset].startCluster) | (((DIR_ENT*)globalBuffer)[wrkDirOffset].startClusterHigh << 16);
+
+ return (((DIR_ENT*)globalBuffer)[wrkDirOffset].startCluster) | (((DIR_ENT*)globalBuffer)[wrkDirOffset].startClusterHigh << 16);
}
/*-----------------------------------------------------------------
@@ -1270,8 +1270,8 @@ u8 FAT_GetFileAttributes (void)
{
// Read in the last accessed directory entry
disc_ReadSector ((wrkDirCluster == FAT16_ROOT_DIR_CLUSTER ? filesysRootDir : FAT_ClustToSect(wrkDirCluster)) + wrkDirSector, globalBuffer);
-
- return ((DIR_ENT*)globalBuffer)[wrkDirOffset].attrib;
+
+ return ((DIR_ENT*)globalBuffer)[wrkDirOffset].attrib;
}
#ifdef CAN_WRITE_TO_DISC
@@ -1294,10 +1294,10 @@ u8 FAT_SetFileAttributes (const char* filename, u8 attributes, u8 mask)
disc_ReadSector ((wrkDirCluster == FAT16_ROOT_DIR_CLUSTER ? filesysRootDir : FAT_ClustToSect(wrkDirCluster)) + wrkDirSector, globalBuffer);
((DIR_ENT*)globalBuffer)[wrkDirOffset].attrib = (((DIR_ENT*)globalBuffer)[wrkDirOffset].attrib & ~(mask & 0x27)) | (attributes & 0x27); // 0x27 is he settable attributes
-
+
disc_WriteSector ((wrkDirCluster == FAT16_ROOT_DIR_CLUSTER ? filesysRootDir : FAT_ClustToSect(wrkDirCluster)) + wrkDirSector, globalBuffer);
- return ((DIR_ENT*)globalBuffer)[wrkDirOffset].attrib;
+ return ((DIR_ENT*)globalBuffer)[wrkDirOffset].attrib;
}
#endif
@@ -1305,7 +1305,7 @@ u8 FAT_SetFileAttributes (const char* filename, u8 attributes, u8 mask)
time_t FAT_FileTimeToCTime (u16 fileTime, u16 fileDate)
{
struct tm timeInfo;
-
+
timeInfo.tm_year = (fileDate >> 9) + 80; // years since midnight January 1970
timeInfo.tm_mon = ((fileDate >> 5) & 0xf) - 1; // Months since january
timeInfo.tm_mday = fileDate & 0x1f; // Day of the month
@@ -1326,8 +1326,8 @@ time_t FAT_GetFileCreationTime (void)
{
// Read in the last accessed directory entry
disc_ReadSector ((wrkDirCluster == FAT16_ROOT_DIR_CLUSTER ? filesysRootDir : FAT_ClustToSect(wrkDirCluster)) + wrkDirSector, globalBuffer);
-
- return FAT_FileTimeToCTime(((DIR_ENT*)globalBuffer)[wrkDirOffset].cTime, ((DIR_ENT*)globalBuffer)[wrkDirOffset].cDate);
+
+ return FAT_FileTimeToCTime(((DIR_ENT*)globalBuffer)[wrkDirOffset].cTime, ((DIR_ENT*)globalBuffer)[wrkDirOffset].cDate);
}
/*-----------------------------------------------------------------
@@ -1339,8 +1339,8 @@ time_t FAT_GetFileLastWriteTime (void)
{
// Read in the last accessed directory entry
disc_ReadSector ((wrkDirCluster == FAT16_ROOT_DIR_CLUSTER ? filesysRootDir : FAT_ClustToSect(wrkDirCluster)) + wrkDirSector, globalBuffer);
-
- return FAT_FileTimeToCTime(((DIR_ENT*)globalBuffer)[wrkDirOffset].mTime, ((DIR_ENT*)globalBuffer)[wrkDirOffset].mDate);
+
+ return FAT_FileTimeToCTime(((DIR_ENT*)globalBuffer)[wrkDirOffset].mTime, ((DIR_ENT*)globalBuffer)[wrkDirOffset].mDate);
}
#endif
@@ -1374,8 +1374,8 @@ DIR_ENT FAT_DirEntFromPath (const char* path)
return;
}
#endif
-
- if (path[pathPos] == '/')
+
+ if (path[pathPos] == '/')
{
dirCluster = filesysRootDirClus; // Start at root directory
}
@@ -1383,13 +1383,13 @@ DIR_ENT FAT_DirEntFromPath (const char* path)
{
dirCluster = curWorkDirCluster; // Start at current working dir
}
-
+
// Eat any slash /
while ((path[pathPos] == '/') && (path[pathPos] != '\0'))
{
pathPos++;
}
-
+
// Search until can't continue
found = false;
notFound = false;
@@ -1437,7 +1437,7 @@ DIR_ENT FAT_DirEntFromPath (const char* path)
flagLFN = true;
}
}
-
+
// Add end of string char
name[namePos] = '\0';
@@ -1497,7 +1497,7 @@ DIR_ENT FAT_DirEntFromPath (const char* path)
dirEntry = FAT_GetDirEntry (dirCluster, 1, SEEK_CUR);
}
}
-
+
if (found && ((dirEntry.attrib & ATTRIB_DIR) == ATTRIB_DIR) && (path[pathPos] != '\0'))
// It has found a directory from within the path that needs to be followed
{
@@ -1505,7 +1505,7 @@ DIR_ENT FAT_DirEntFromPath (const char* path)
dirCluster = dirEntry.startCluster | (dirEntry.startClusterHigh << 16);
}
}
-
+
if (notFound)
{
dirEntry.name[0] = FILE_FREE;
@@ -1534,11 +1534,11 @@ bool FAT_AddDirEntry (const char* path, DIR_ENT newDirEntry)
bool flagLFN, dotSeen;
char fileAlias[13] = {0};
int tailNum;
-
+
unsigned char chkSum = 0;
-
+
u32 oldWorkDirCluster;
-
+
DIR_ENT* dirEntries = (DIR_ENT*)globalBuffer;
u32 dirCluster;
int secOffset;
@@ -1566,7 +1566,7 @@ bool FAT_AddDirEntry (const char* path, DIR_ENT newDirEntry)
{
curWorkDirCluster = filesysRootDirClus;
}
-
+
pathPos = 0;
filePos = 0;
flagLFN = false;
@@ -1576,7 +1576,7 @@ bool FAT_AddDirEntry (const char* path, DIR_ENT newDirEntry)
if (path[pathPos + filePos] == '/')
{
filename[filePos] = '\0';
- if (FAT_chdir(filename) == false)
+ if (FAT_chdir(filename) == false)
{
curWorkDirCluster = oldWorkDirCluster;
return false; // Couldn't change directory
@@ -1587,17 +1587,17 @@ bool FAT_AddDirEntry (const char* path, DIR_ENT newDirEntry)
filename[filePos] = path[pathPos + filePos];
filePos++;
}
-
+
// Skip over last slashes
while (path[pathPos] == '/')
pathPos++;
-
+
// Check if the filename has a leading "."
// If so, it is an LFN
if (path[pathPos] == '.') {
flagLFN = true;
}
-
+
// Copy name from path
filePos = 0;
dotSeen = false;
@@ -1622,12 +1622,12 @@ bool FAT_AddDirEntry (const char* path, DIR_ENT newDirEntry)
flagLFN = true;
}
}
-
+
if (filePos == 0) // No filename
{
return false;
}
-
+
// Check if a long filename was specified
if (filePos > 12)
{
@@ -1638,7 +1638,7 @@ bool FAT_AddDirEntry (const char* path, DIR_ENT newDirEntry)
if (!flagLFN && (strrchr (filename, '.') != NULL) && (strlen(strrchr(filename, '.')) > 4)) {
flagLFN = true;
}
-
+
lfnPos = (filePos - 1) / 13;
// Add end of string char
@@ -1646,8 +1646,8 @@ bool FAT_AddDirEntry (const char* path, DIR_ENT newDirEntry)
// Clear remaining chars
while (filePos < MAX_FILENAME_LENGTH)
filename[filePos++] = 0x01; // Set for LFN compatibility
-
-
+
+
if (flagLFN)
{
// Generate short filename - always a 2 digit number for tail
@@ -1666,7 +1666,7 @@ bool FAT_AddDirEntry (const char* path, DIR_ENT newDirEntry)
// Pad Alias with underscores
while (aliasPos < 5)
fileAlias[aliasPos++] = '_';
-
+
fileAlias[5] = '~';
fileAlias[8] = '.';
fileAlias[9] = ' ';
@@ -1692,14 +1692,14 @@ bool FAT_AddDirEntry (const char* path, DIR_ENT newDirEntry)
} else {
aliasPos = 9;
}
-
+
// Pad Alias extension with spaces
while (aliasPos < 12)
fileAlias[aliasPos++] = ' ';
-
+
fileAlias[12] = '\0';
-
-
+
+
// Get a valid tail number
tailNum = 0;
do {
@@ -1707,7 +1707,7 @@ bool FAT_AddDirEntry (const char* path, DIR_ENT newDirEntry)
fileAlias[6] = 0x30 + ((tailNum / 10) % 10); // 10's digit
fileAlias[7] = 0x30 + (tailNum % 10); // 1's digit
} while ((FAT_DirEntFromPath(fileAlias).name[0] != FILE_FREE) && (tailNum < 100));
-
+
if (tailNum < 100) // Found an alias not being used
{
// Calculate file checksum
@@ -1725,7 +1725,7 @@ bool FAT_AddDirEntry (const char* path, DIR_ENT newDirEntry)
{
return false;
}
-
+
dirEntryLength = lfnPos + 2;
}
else // Its not a long file name
@@ -1743,7 +1743,7 @@ bool FAT_AddDirEntry (const char* path, DIR_ENT newDirEntry)
dirEntryLength = 1;
}
-
+
// Change dirEntry name to match alias
for (aliasPos = 0; ((fileAlias[aliasPos] != '.') && (fileAlias[aliasPos] != '\0') && (aliasPos < 8)); aliasPos++)
{
@@ -1775,12 +1775,12 @@ bool FAT_AddDirEntry (const char* path, DIR_ENT newDirEntry)
maxSectors = (dirCluster == FAT16_ROOT_DIR_CLUSTER ? (filesysData - filesysRootDir) : filesysSecPerClus);
firstSector = (dirCluster == FAT16_ROOT_DIR_CLUSTER ? filesysRootDir : FAT_ClustToSect(dirCluster));
disc_ReadSector (firstSector + secOffset, dirEntries);
-
+
dirEntryRemain = dirEntryLength;
tempDirCluster = dirCluster;
tempSecOffset = secOffset;
tempEntryOffset = entryOffset;
-
+
// Search for a large enough space to fit in new directory entry
while ((dirEntries[entryOffset].name[0] != FILE_LAST) && (dirEntryRemain > 0))
{
@@ -1803,7 +1803,7 @@ bool FAT_AddDirEntry (const char* path, DIR_ENT newDirEntry)
{
dirCluster = FAT_NextCluster(dirCluster);
}
- firstSector = FAT_ClustToSect(dirCluster);
+ firstSector = FAT_ClustToSect(dirCluster);
}
else if ((dirCluster == FAT16_ROOT_DIR_CLUSTER) && (secOffset == (filesysData - filesysRootDir)))
{
@@ -1824,7 +1824,7 @@ bool FAT_AddDirEntry (const char* path, DIR_ENT newDirEntry)
}
// Modifying the last directory is a special case - have to erase following entries
- if (dirEntries[entryOffset].name[0] == FILE_LAST)
+ if (dirEntries[entryOffset].name[0] == FILE_LAST)
{
dirEndFlag = true;
}
@@ -1843,7 +1843,7 @@ bool FAT_AddDirEntry (const char* path, DIR_ENT newDirEntry)
}
// Add new directory entry
- while (dirEntryRemain > 0)
+ while (dirEntryRemain > 0)
{
// Move to next entry, first pass advances from last used entry
entryOffset++;
@@ -1868,7 +1868,7 @@ bool FAT_AddDirEntry (const char* path, DIR_ENT newDirEntry)
{
dirCluster = FAT_NextCluster(dirCluster);
}
- firstSector = FAT_ClustToSect(dirCluster);
+ firstSector = FAT_ClustToSect(dirCluster);
}
else if ((dirCluster == FAT16_ROOT_DIR_CLUSTER) && (secOffset == (filesysData - filesysRootDir)))
{
@@ -1900,7 +1900,7 @@ bool FAT_AddDirEntry (const char* path, DIR_ENT newDirEntry)
lfnEntry.flag = ATTRIB_LFN;
lfnEntry.reserved1 = 0;
lfnEntry.reserved2 = 0;
-
+
*((DIR_ENT_LFN*)&dirEntries[entryOffset]) = lfnEntry;
lfnPos --;
lfnEntry.ordinal = 0;
@@ -1914,7 +1914,7 @@ bool FAT_AddDirEntry (const char* path, DIR_ENT newDirEntry)
dirEntryRemain--;
}
-
+
// Write directory back to disk
disc_WriteSector (firstSector + secOffset, dirEntries);
@@ -1930,7 +1930,7 @@ FAT_FindNextFile
Gets the name of the next directory entry
(can be a file or subdirectory)
char* filename: OUT filename, must be at least 13 chars long
-FILE_TYPE return: OUT returns FT_NONE if failed,
+FILE_TYPE return: OUT returns FT_NONE if failed,
FT_FILE if it found a file and FT_DIR if it found a directory
-----------------------------------------------------------------*/
FILE_TYPE FAT_FindNextFile(char* filename)
@@ -1963,7 +1963,7 @@ FAT_FindFirstFile
Gets the name of the first directory entry and resets the count
(can be a file or subdirectory)
char* filename: OUT filename, must be at least 13 chars long
-FILE_TYPE return: OUT returns FT_NONE if failed,
+FILE_TYPE return: OUT returns FT_NONE if failed,
FT_FILE if it found a file and FT_DIR if it found a directory
-----------------------------------------------------------------*/
FILE_TYPE FAT_FindFirstFile(char* filename)
@@ -1971,7 +1971,7 @@ FILE_TYPE FAT_FindFirstFile(char* filename)
// Get the first directory entry
DIR_ENT file;
file = FAT_GetDirEntry (curWorkDirCluster, 1, SEEK_SET);
-
+
if (file.name[0] == FILE_FREE)
{
return FT_NONE; // Did not find a file
@@ -1996,7 +1996,7 @@ FAT_FindFirstFileLFN
Gets the long file name of the first directory entry and resets
the count (can be a file or subdirectory)
char* lfn: OUT long file name, must be at least 256 chars long
-FILE_TYPE return: OUT returns FT_NONE if failed,
+FILE_TYPE return: OUT returns FT_NONE if failed,
FT_FILE if it found a file and FT_DIR if it found a directory
-----------------------------------------------------------------*/
FILE_TYPE FAT_FindFirstFileLFN(char* lfn)
@@ -2012,7 +2012,7 @@ FAT_FindNextFileLFN
Gets the long file name of the next directory entry
(can be a file or subdirectory)
char* lfn: OUT long file name, must be at least 256 chars long
-FILE_TYPE return: OUT returns FT_NONE if failed,
+FILE_TYPE return: OUT returns FT_NONE if failed,
FT_FILE if it found a file and FT_DIR if it found a directory
-----------------------------------------------------------------*/
FILE_TYPE FAT_FindNextFileLFN(char* lfn)
@@ -2026,29 +2026,29 @@ FILE_TYPE FAT_FindNextFileLFN(char* lfn)
/*-----------------------------------------------------------------
FAT_FileExists
-Returns the type of file
+Returns the type of file
char* filename: IN filename of the file to look for
-FILE_TYPE return: OUT returns FT_NONE if there is now file with
+FILE_TYPE return: OUT returns FT_NONE if there is now file with
that name, FT_FILE if it is a file and FT_DIR if it is a directory
-----------------------------------------------------------------*/
FILE_TYPE FAT_FileExists(const char* filename)
{
- DIR_ENT dirEntry;
- // Get the dirEntry for the path specified
- dirEntry = FAT_DirEntFromPath (filename);
-
- if (dirEntry.name[0] == FILE_FREE)
- {
- return FT_NONE;
- }
- else if (dirEntry.attrib & ATTRIB_DIR)
- {
- return FT_DIR;
- }
- else
- {
- return FT_FILE;
- }
+ DIR_ENT dirEntry;
+ // Get the dirEntry for the path specified
+ dirEntry = FAT_DirEntFromPath (filename);
+
+ if (dirEntry.name[0] == FILE_FREE)
+ {
+ return FT_NONE;
+ }
+ else if (dirEntry.attrib & ATTRIB_DIR)
+ {
+ return FT_DIR;
+ }
+ else
+ {
+ return FT_FILE;
+ }
}
/*-----------------------------------------------------------------
@@ -2074,7 +2074,7 @@ u32 FAT_GetFileSystemTotalSize (void)
/*-----------------------------------------------------------------
FAT_chdir
Changes the current working directory
-const char* path: IN null terminated string of directory separated by
+const char* path: IN null terminated string of directory separated by
forward slashes, / is root
bool return: OUT returns true if successful
-----------------------------------------------------------------*/
@@ -2090,7 +2090,7 @@ bool FAT_chdir (const char* path)
{
return true;
}
-
+
dir = FAT_DirEntFromPath (path);
if (((dir.attrib & ATTRIB_DIR) == ATTRIB_DIR) && (dir.name[0] != FILE_FREE))
@@ -2111,7 +2111,7 @@ bool FAT_chdir (const char* path)
return true;
}
else
- {
+ {
// Couldn't change directory - wrong path specified
return false;
}
@@ -2120,12 +2120,12 @@ bool FAT_chdir (const char* path)
/*-----------------------------------------------------------------
FAT_fopen(filename, mode)
Opens a file
-const char* path: IN null terminated string of filename and path
+const char* path: IN null terminated string of filename and path
separated by forward slashes, / is root
const char* mode: IN mode to open file in
Supported modes: "r", "r+", "w", "w+", "a", "a+", don't use
"b" or "t" in any mode, as all files are openned in binary mode
-FAT_FILE* return: OUT handle to open file, returns NULL if the file
+FAT_FILE* return: OUT handle to open file, returns NULL if the file
couldn't be openned
-----------------------------------------------------------------*/
FAT_FILE* FAT_fopen(const char* path, const char* mode)
@@ -2149,10 +2149,10 @@ FAT_FILE* FAT_fopen(const char* path, const char* mode)
{
return NULL;
}
-
+
// Get the dirEntry for the path specified
dirEntry = FAT_DirEntFromPath (path);
-
+
// Check that it is not a directory
if (dirEntry.attrib & ATTRIB_DIR)
{
@@ -2174,7 +2174,7 @@ FAT_FILE* FAT_fopen(const char* path, const char* mode)
// Find a free file buffer
for (fileNum = 0; (fileNum < MAX_FILES_OPEN) && (openFiles[fileNum].inUse == true); fileNum++);
-
+
if (fileNum == MAX_FILES_OPEN) // No free files
{
return NULL;
@@ -2191,7 +2191,7 @@ FAT_FILE* FAT_fopen(const char* path, const char* mode)
{
return NULL;
}
-
+
file->read = true;
#ifdef CAN_WRITE_TO_DISC
file->write = ( strchr(mode, '+') != NULL ); //(mode[1] == '+');
@@ -2199,13 +2199,13 @@ FAT_FILE* FAT_fopen(const char* path, const char* mode)
file->write = false;
#endif
file->append = false;
-
+
// Store information about position within the file, for use
// by FAT_fread, FAT_fseek, etc.
file->firstCluster = dirEntry.startCluster | (dirEntry.startClusterHigh << 16);
-
+
#ifdef CAN_WRITE_TO_DISC
- // Check if file is openned for random. If it is, and currently has no cluster, one must be
+ // Check if file is openned for random. If it is, and currently has no cluster, one must be
// assigned to it.
if (file->write && file->firstCluster == CLUSTER_FREE)
{
@@ -2223,7 +2223,7 @@ FAT_FILE* FAT_fopen(const char* path, const char* mode)
disc_WriteSector (file->dirEntSector, globalBuffer);
}
#endif
-
+
file->length = dirEntry.fileSize;
file->curPos = 0;
file->curClus = dirEntry.startCluster | (dirEntry.startClusterHigh << 16);
@@ -2234,7 +2234,7 @@ FAT_FILE* FAT_fopen(const char* path, const char* mode)
file->appByte = 0;
file->appClus = 0;
file->appSect = 0;
-
+
disc_ReadSector( FAT_ClustToSect( file->curClus), file->readBuffer);
file->inUse = true; // We're using this file now
@@ -2248,7 +2248,7 @@ FAT_FILE* FAT_fopen(const char* path, const char* mode)
{
dirEntry.attrib = ATTRIB_ARCH;
dirEntry.reserved = 0;
-
+
// Time and date set to system time and date
dirEntry.cTime_ms = 0;
dirEntry.cTime = getRTCtoFileTime();
@@ -2257,12 +2257,12 @@ FAT_FILE* FAT_fopen(const char* path, const char* mode)
dirEntry.mTime = getRTCtoFileTime();
dirEntry.mDate = getRTCtoFileDate();
}
- else // Already a file entry
+ else // Already a file entry
{
// Free any clusters used
FAT_ClearLinks (dirEntry.startCluster | (dirEntry.startClusterHigh << 16));
}
-
+
// Get a cluster to use
startCluster = FAT_LinkFreeCluster (CLUSTER_FREE);
if (startCluster == CLUSTER_FREE) // Couldn't get a free cluster
@@ -2298,13 +2298,13 @@ FAT_FILE* FAT_fopen(const char* path, const char* mode)
((DIR_ENT*) globalBuffer)[file->dirEntOffset] = dirEntry;
disc_WriteSector (file->dirEntSector, globalBuffer);
}
-
+
// Now that file is created, open it
file->read = ( strchr(mode, '+') != NULL ); //(mode[1] == '+');
file->write = true;
file->append = false;
-
+
// Store information about position within the file, for use
// by FAT_fread, FAT_fseek, etc.
file->firstCluster = startCluster;
@@ -2318,7 +2318,7 @@ FAT_FILE* FAT_fopen(const char* path, const char* mode)
file->appByte = 0;
file->appClus = 0;
file->appSect = 0;
-
+
// Empty file, so empty read buffer
memset (file->readBuffer, 0, BYTE_PER_READ);
file->inUse = true; // We're using this file now
@@ -2332,7 +2332,7 @@ FAT_FILE* FAT_fopen(const char* path, const char* mode)
{
dirEntry.attrib = ATTRIB_ARCH;
dirEntry.reserved = 0;
-
+
// Time and date set to system time and date
dirEntry.cTime_ms = 0;
dirEntry.cTime = getRTCtoFileTime();
@@ -2352,13 +2352,13 @@ FAT_FILE* FAT_fopen(const char* path, const char* mode)
}
dirEntry.startCluster = (startCluster & 0xFFFF);
dirEntry.startClusterHigh = ((startCluster >> 16) & 0xFFFF);
-
+
if(!FAT_AddDirEntry (path, dirEntry))
return NULL;
-
+
// Get the newly created dirEntry
dirEntry = FAT_DirEntFromPath (path);
-
+
// Store append cluster
file->appClus = startCluster;
@@ -2377,7 +2377,7 @@ FAT_FILE* FAT_fopen(const char* path, const char* mode)
{
return NULL;
}
-
+
// Store cluster position into the directory entry
dirEntry.startCluster = (file->firstCluster & 0xFFFF);
dirEntry.startClusterHigh = ((file->firstCluster >> 16) & 0xFFFF);
@@ -2387,7 +2387,7 @@ FAT_FILE* FAT_fopen(const char* path, const char* mode)
// Store append cluster
file->appClus = startCluster;
-
+
} else {
// Follow cluster list until last one is found
@@ -2410,7 +2410,7 @@ FAT_FILE* FAT_fopen(const char* path, const char* mode)
file->read = ( strchr(mode, '+') != NULL );
file->write = false;
file->append = true;
-
+
// Calculate the sector and byte of the current position,
// and store them
file->appSect = (dirEntry.fileSize % filesysBytePerClus) / BYTE_PER_READ;
@@ -2424,7 +2424,7 @@ FAT_FILE* FAT_fopen(const char* path, const char* mode)
file->curClus = file->appClus;
file->curSect = file->appSect;
file->curByte = file->appByte;
-
+
// Read into buffer
disc_ReadSector( FAT_ClustToSect(file->curClus) + file->curSect, file->readBuffer);
file->inUse = true; // We're using this file now
@@ -2464,7 +2464,7 @@ bool FAT_fclose (FAT_FILE* file)
disc_CacheFlush();
}
#endif
- file->inUse = false;
+ file->inUse = false;
return true;
}
else
@@ -2515,14 +2515,14 @@ int FAT_fseek(FAT_FILE* file, s32 offset, int origin)
}
// Can't seek in append only mode
- if (!file->read && !file->write)
+ if (!file->read && !file->write)
{
return -1;
}
curPos = file->curPos;
- switch (origin)
+ switch (origin)
{
case SEEK_SET:
if (offset >= 0)
@@ -2537,13 +2537,13 @@ int FAT_fseek(FAT_FILE* file, s32 offset, int origin)
if (offset >= 0)
{
position = curPos + offset;
- }
+ }
else if ( (u32)(offset * -1) >= curPos )
{
// Tried to seek before start of file
position = 0;
}
- else
+ else
{
// Using u32 to maintain 32 bits of accuracy
position = curPos - (u32)(offset * -1);
@@ -2560,7 +2560,7 @@ int FAT_fseek(FAT_FILE* file, s32 offset, int origin)
// Tried to seek before start of file
position = 0;
}
- else
+ else
{
// Using u32 to maintain 32 bits of accuracy
position = file->length - (u32)(offset * -1);
@@ -2575,7 +2575,7 @@ int FAT_fseek(FAT_FILE* file, s32 offset, int origin)
// Tried to go past end of file
position = file->length;
}
-
+
// Save position
file->curPos = position;
@@ -2608,14 +2608,14 @@ int FAT_fseek(FAT_FILE* file, s32 offset, int origin)
nextCluster = FAT_NextCluster (cluster);
}
// Check if ran out of clusters, and the file is being written to
- if ((clusCount >= 0) && (file->write || file->append))
+ if ((clusCount >= 0) && (file->write || file->append))
{
// Set flag to allocate a new cluster
file->curSect = filesysSecPerClus;
file->curByte = 0;
}
file->curClus = cluster;
-
+
// Reload sector buffer for new position in file, if it is a different sector
if ((curPos ^ position) >= BYTE_PER_READ)
{
@@ -2645,7 +2645,7 @@ u32 FAT_fread (void* buffer, u32 size, u32 count, FAT_FILE* file)
int curSect;
u32 curClus;
u32 tempNextCluster;
-
+
int tempVar;
char* data = (char*)buffer;
@@ -2678,14 +2678,14 @@ u32 FAT_fread (void* buffer, u32 size, u32 count, FAT_FILE* file)
if (tempVar > remain)
tempVar = remain;
- if ((tempVar < BYTE_PER_READ) && flagNoError)
+ if ((tempVar < BYTE_PER_READ) && flagNoError)
{
memcpy(data, &(file->readBuffer[curByte]), tempVar);
remain -= tempVar;
data += tempVar;
curByte += tempVar;
- if (curByte >= BYTE_PER_READ)
+ if (curByte >= BYTE_PER_READ)
{
curByte = 0;
curSect++;
@@ -2694,7 +2694,7 @@ u32 FAT_fread (void* buffer, u32 size, u32 count, FAT_FILE* file)
// align to cluster
// tempVar is number of sectors to read
- if (remain > (filesysSecPerClus - curSect) * BYTE_PER_READ)
+ if (remain > (filesysSecPerClus - curSect) * BYTE_PER_READ)
{
tempVar = filesysSecPerClus - curSect;
} else {
@@ -2789,7 +2789,7 @@ u32 FAT_fread (void* buffer, u32 size, u32 count, FAT_FILE* file)
FAT_fwrite(buffer, size, count, file)
Writes size * count bytes into file from buffer, starting
from current position. It then sets the current position to the
- byte after the last byte written. If the file was openned in
+ byte after the last byte written. If the file was openned in
append mode it always writes to the end of the file.
const void* buffer IN: Pointer to buffer containing data. Should be
at least as big as the number of bytes to be written.
@@ -2870,7 +2870,7 @@ u32 FAT_fwrite (const void* buffer, u32 size, u32 count, FAT_FILE* file)
disc_ReadSector( FAT_ClustToSect( curClus), writeBuffer);
}
}
-
+
// Align to sector
tempVar = BYTE_PER_READ - curByte;
if (tempVar > remain)
@@ -2885,9 +2885,9 @@ u32 FAT_fwrite (const void* buffer, u32 size, u32 count, FAT_FILE* file)
// Write buffer back to disk
disc_WriteSector (curSect + FAT_ClustToSect(curClus), writeBuffer);
-
+
// Move onto next sector
- if (curByte >= BYTE_PER_READ)
+ if (curByte >= BYTE_PER_READ)
{
curByte = 0;
curSect++;
@@ -2896,7 +2896,7 @@ u32 FAT_fwrite (const void* buffer, u32 size, u32 count, FAT_FILE* file)
// Align to cluster
// tempVar is number of sectors to write
- if (remain > (filesysSecPerClus - curSect) * BYTE_PER_READ)
+ if (remain > (filesysSecPerClus - curSect) * BYTE_PER_READ)
{
tempVar = filesysSecPerClus - curSect;
} else {
@@ -2964,7 +2964,7 @@ u32 FAT_fwrite (const void* buffer, u32 size, u32 count, FAT_FILE* file)
remain -= tempVar * BYTE_PER_READ;
curSect += tempVar;
}
-
+
// Last remaining sector
// Check if sector wanted is different to the one started with
if ( (( (file->append ? file->appByte : file->curByte) + length) >= BYTE_PER_READ) && flagNoError)
@@ -2984,7 +2984,7 @@ u32 FAT_fwrite (const void* buffer, u32 size, u32 count, FAT_FILE* file)
disc_WriteSector( curSect + FAT_ClustToSect( curClus), writeBuffer);
}
}
-
+
// Amount read is the originally requested amount minus stuff remaining
length = length - remain;
@@ -3041,14 +3041,14 @@ int FAT_remove (const char* path)
u32 oldWorkDirCluster;
char checkFilename[13];
FILE_TYPE checkFiletype;
-
+
dirEntry = FAT_DirEntFromPath (path);
if (dirEntry.name[0] == FILE_FREE)
{
return -1;
}
-
+
// Only delete directories if the directory is entry
if (dirEntry.attrib & ATTRIB_DIR)
{
@@ -3062,10 +3062,10 @@ int FAT_remove (const char* path)
{
checkFiletype = FAT_FindNextFile (checkFilename);
}
-
+
// Change back to working directory
curWorkDirCluster = oldWorkDirCluster;
-
+
// Check that the directory is empty
if (checkFiletype != FT_NONE)
{
@@ -3084,7 +3084,7 @@ int FAT_remove (const char* path)
disc_ReadSector ( (wrkDirCluster == FAT16_ROOT_DIR_CLUSTER ? filesysRootDir : FAT_ClustToSect(wrkDirCluster)) + wrkDirSector , globalBuffer);
((DIR_ENT*)globalBuffer)[wrkDirOffset].name[0] = FILE_FREE;
disc_WriteSector ( (wrkDirCluster == FAT16_ROOT_DIR_CLUSTER ? filesysRootDir : FAT_ClustToSect(wrkDirCluster)) + wrkDirSector , globalBuffer);
-
+
// Flush any sectors in disc cache
disc_CacheFlush();
@@ -3095,7 +3095,7 @@ int FAT_remove (const char* path)
#ifdef CAN_WRITE_TO_DISC
/*-----------------------------------------------------------------
FAT_mkdir (path)
-Makes a new directory, so long as no other directory or file has
+Makes a new directory, so long as no other directory or file has
the same name.
const char* path IN: Path and filename of directory to make
int return OUT: zero if successful, non-zero if not
@@ -3123,7 +3123,7 @@ int FAT_mkdir (const char* path)
{
curWorkDirCluster = filesysRootDirClus;
}
-
+
pathPos = 0;
filePos = 0;
@@ -3132,7 +3132,7 @@ int FAT_mkdir (const char* path)
if (path[pathPos + filePos] == '/')
{
pathname[filePos] = '\0';
- if (FAT_chdir(pathname) == false)
+ if (FAT_chdir(pathname) == false)
{
curWorkDirCluster = oldDirCluster;
return -1; // Couldn't change directory
@@ -3236,9 +3236,9 @@ FAT_fgets (char *tgtBuffer, int num, FAT_FILE* file)
Gets a up to num bytes from file, stopping at the first
newline.
-CAUTION: does not do strictly streaming. I.e. it's
+CAUTION: does not do strictly streaming. I.e. it's
reading more then needed bytes and seeking back.
- shouldn't matter for random access
+ shouldn't matter for random access
char *tgtBuffer OUT: buffer to write to
int num IN: size of target buffer
@@ -3250,62 +3250,62 @@ bool return OUT: character if successful, EOF if not
* Added check for unix style text files
* Removed seek when no newline is found, since it isn't necessary
-------------------------------------------------------------------*/
-char *FAT_fgets(char *tgtBuffer, int num, FAT_FILE* file)
-{
+char *FAT_fgets(char *tgtBuffer, int num, FAT_FILE* file)
+{
u32 curPos;
u32 readLength;
char *returnChar;
-
- // invalid filehandle
+
+ // invalid filehandle
if (file == NULL)
{
- return NULL ;
+ return NULL ;
}
-
- // end of file
+
+ // end of file
if (FAT_feof(file)==true)
{
- return NULL ;
- }
-
- // save current position
- curPos = FAT_ftell(file);
-
- // read the full buffer (max string chars is num-1 and one end of string \0
- readLength = FAT_fread(tgtBuffer,1,num-1,file) ;
-
- // mark least possible end of string
- tgtBuffer[readLength] = '\0' ;
-
- if (readLength==0) {
- // return error
- return NULL ;
- }
-
- // get position of first return '\r'
- returnChar = strchr(tgtBuffer,'\r');
-
+ return NULL ;
+ }
+
+ // save current position
+ curPos = FAT_ftell(file);
+
+ // read the full buffer (max string chars is num-1 and one end of string \0
+ readLength = FAT_fread(tgtBuffer,1,num-1,file) ;
+
+ // mark least possible end of string
+ tgtBuffer[readLength] = '\0' ;
+
+ if (readLength==0) {
+ // return error
+ return NULL ;
+ }
+
+ // get position of first return '\r'
+ returnChar = strchr(tgtBuffer,'\r');
+
// if no return is found, search for a newline
if (returnChar == NULL)
{
returnChar = strchr(tgtBuffer,'\n');
}
-
- // Mark the return, if existant, as end of line/string
- if (returnChar!=NULL) {
- *returnChar++ = 0 ;
- if (*returnChar=='\n') { // catch newline too when jumping over the end
- // return to location after \r\n (strlen+2)
- FAT_fseek(file,curPos+strlen(tgtBuffer)+2,SEEK_SET) ;
- return tgtBuffer ;
- } else {
- // return to location after \r (strlen+1)
- FAT_fseek(file,curPos+strlen(tgtBuffer)+1,SEEK_SET) ;
- return tgtBuffer ;
+
+ // Mark the return, if existant, as end of line/string
+ if (returnChar!=NULL) {
+ *returnChar++ = 0 ;
+ if (*returnChar=='\n') { // catch newline too when jumping over the end
+ // return to location after \r\n (strlen+2)
+ FAT_fseek(file,curPos+strlen(tgtBuffer)+2,SEEK_SET) ;
+ return tgtBuffer ;
+ } else {
+ // return to location after \r (strlen+1)
+ FAT_fseek(file,curPos+strlen(tgtBuffer)+1,SEEK_SET) ;
+ return tgtBuffer ;
}
}
-
- return tgtBuffer ;
+
+ return tgtBuffer ;
}
#ifdef CAN_WRITE_TO_DISC
@@ -3322,20 +3322,20 @@ bool return OUT: number of characters written if successful,
* Uses FAT_FILE instead of int
* writtenBytes is now u32 instead of int
-------------------------------------------------------------------*/
-int FAT_fputs (const char *string, FAT_FILE* file)
-{
+int FAT_fputs (const char *string, FAT_FILE* file)
+{
u32 writtenBytes;
- // save string except end of string '\0'
- writtenBytes = FAT_fwrite((void *)string, 1, strlen(string), file);
+ // save string except end of string '\0'
+ writtenBytes = FAT_fwrite((void *)string, 1, strlen(string), file);
- // check if we had an error
- if (writtenBytes != strlen(string))
- {
- // return EOF error
+ // check if we had an error
+ if (writtenBytes != strlen(string))
+ {
+ // return EOF error
return EOF;
}
- // return the charcount written
- return writtenBytes ;
+ // return the charcount written
+ return writtenBytes ;
}
#endif
diff --git a/backends/platform/ds/arm9/source/fat/gba_nds_fat.h b/backends/platform/ds/arm9/source/fat/gba_nds_fat.h
index c554cc80f6..539f94fef7 100644
--- a/backends/platform/ds/arm9/source/fat/gba_nds_fat.h
+++ b/backends/platform/ds/arm9/source/fat/gba_nds_fat.h
@@ -25,7 +25,7 @@
// Maximum number of files open at once
// Increase this to open more files, decrease to save memory
-#define MAX_FILES_OPEN 4
+#define MAX_FILES_OPEN 16
// Allow file writing
// Disable this to remove file writing support
@@ -147,7 +147,7 @@ bool FAT_GetAlias (char* alias);
/*-----------------------------------------------------------------
FAT_GetLongFilename
-Get the long name of the last file or directory retrived with
+Get the long name of the last file or directory retrived with
GetDirEntry. Also works for FindFirstFile and FindNextFile
char* filename: OUT will be filled with the filename, should be at
least 256 bytes long
@@ -210,7 +210,7 @@ FAT_FindNextFile
Gets the name of the next directory entry
(can be a file or subdirectory)
char* filename: OUT filename, must be at least 13 chars long
-FILE_TYPE return: OUT returns FT_NONE if failed,
+FILE_TYPE return: OUT returns FT_NONE if failed,
FT_FILE if it found a file and FT_DIR if it found a directory
-----------------------------------------------------------------*/
FILE_TYPE FAT_FindNextFile (char* filename);
@@ -220,7 +220,7 @@ FAT_FindFirstFile
Gets the name of the first directory entry and resets the count
(can be a file or subdirectory)
char* filename: OUT filename, must be at least 13 chars long
-FILE_TYPE return: OUT returns FT_NONE if failed,
+FILE_TYPE return: OUT returns FT_NONE if failed,
FT_FILE if it found a file and FT_DIR if it found a directory
-----------------------------------------------------------------*/
FILE_TYPE FAT_FindFirstFile (char* filename);
@@ -230,7 +230,7 @@ FAT_FindFirstFileLFN
Gets the long file name of the first directory entry and resets
the count (can be a file or subdirectory)
char* lfn: OUT long file name, must be at least 256 chars long
-FILE_TYPE return: OUT returns FT_NONE if failed,
+FILE_TYPE return: OUT returns FT_NONE if failed,
FT_FILE if it found a file and FT_DIR if it found a directory
-----------------------------------------------------------------*/
FILE_TYPE FAT_FindFirstFileLFN(char* lfn);
@@ -240,16 +240,16 @@ FAT_FindNextFileLFN
Gets the long file name of the next directory entry
(can be a file or subdirectory)
char* lfn: OUT long file name, must be at least 256 chars long
-FILE_TYPE return: OUT returns FT_NONE if failed,
+FILE_TYPE return: OUT returns FT_NONE if failed,
FT_FILE if it found a file and FT_DIR if it found a directory
-----------------------------------------------------------------*/
FILE_TYPE FAT_FindNextFileLFN(char* lfn);
/*-----------------------------------------------------------------
FAT_FileExists
-Returns the type of file
+Returns the type of file
char* filename: IN filename of the file to look for
-FILE_TYPE return: OUT returns FT_NONE if there is now file with
+FILE_TYPE return: OUT returns FT_NONE if there is now file with
that name, FT_FILE if it is a file and FT_DIR if it is a directory
-----------------------------------------------------------------*/
FILE_TYPE FAT_FileExists (const char* filename);
@@ -269,7 +269,7 @@ u32 FAT_GetFileSystemTotalSize (void);
/*-----------------------------------------------------------------
FAT_chdir
Changes the current working directory
-const char* path: IN null terminated string of directory separated by
+const char* path: IN null terminated string of directory separated by
forward slashes, / is root
bool return: OUT returns true if successful
-----------------------------------------------------------------*/
@@ -282,12 +282,12 @@ bool FAT_chdir (const char* path);
/*-----------------------------------------------------------------
FAT_fopen(filename, mode)
Opens a file
-const char* path: IN null terminated string of filename and path
+const char* path: IN null terminated string of filename and path
separated by forward slashes, / is root
const char* mode: IN mode to open file in
Supported modes: "r", "r+", "w", "w+", "a", "a+", don't use
"b" or "t" in any mode, as all files are openned in binary mode
-FAT_FILE* return: OUT handle to open file, returns -1 if the file
+FAT_FILE* return: OUT handle to open file, returns -1 if the file
couldn't be openned
-----------------------------------------------------------------*/
FAT_FILE* FAT_fopen(const char* path, const char* mode);
@@ -338,7 +338,7 @@ u32 FAT_fread (void* buffer, u32 size, u32 count, FAT_FILE* file);
FAT_fwrite(buffer, size, count, file)
Writes size * count bytes into file from buffer, starting
from current position. It then sets the current position to the
- byte after the last byte written. If the file was openned in
+ byte after the last byte written. If the file was openned in
append mode it always writes to the end of the file.
const void* buffer IN: Pointer to buffer containing data. Should be
at least as big as the number of bytes to be written.
@@ -371,7 +371,7 @@ int FAT_remove (const char* path);
#ifdef CAN_WRITE_TO_DISC
/*-----------------------------------------------------------------
FAT_mkdir (path)
-Makes a new directory, so long as no other directory or file has
+Makes a new directory, so long as no other directory or file has
the same name.
const char* path IN: Path and filename of directory to make
int return OUT: zero if successful, non-zero if not
@@ -403,9 +403,9 @@ FAT_fgets (char *tgtBuffer, int num, FAT_FILE* file)
Gets a up to num bytes from file, stopping at the first
newline.
-CAUTION: does not do strictly streaming. I.e. it's
+CAUTION: does not do strictly streaming. I.e. it's
reading more then needed bytes and seeking back.
- shouldn't matter for random access
+ shouldn't matter for random access
char *tgtBuffer OUT: buffer to write to
int num IN: size of target buffer
diff --git a/backends/platform/ds/arm9/source/fat/io_dldi.h b/backends/platform/ds/arm9/source/fat/io_dldi.h
index 034c6aace3..053de3a94c 100644
--- a/backends/platform/ds/arm9/source/fat/io_dldi.h
+++ b/backends/platform/ds/arm9/source/fat/io_dldi.h
@@ -1,8 +1,8 @@
/*
- io_dldi.h
+ io_dldi.h
Reserved space for new drivers
-
+
This software is completely free. No warranty is provided.
If you use it, please give me credit and email me about your
project at chishm@hotmail.com
diff --git a/backends/platform/ds/arm9/source/fat/io_dldi.s b/backends/platform/ds/arm9/source/fat/io_dldi.s
index 657e475086..c2314e772d 100644
--- a/backends/platform/ds/arm9/source/fat/io_dldi.s
+++ b/backends/platform/ds/arm9/source/fat/io_dldi.s
@@ -17,8 +17,8 @@
.byte 0x01 @ Version number
.byte 0x0F @32KiB @ Log [base-2] of the size of this driver in bytes.
.byte 0x00 @ Sections to fix
- .byte 0x0F @32KiB @ Log [base-2] of the allocated space in bytes.
-
+ .byte 0x0F @32KiB @ Log [base-2] of the allocated space in bytes.
+
@---------------------------------------------------------------------------------
@ Text identifier - can be anything up to 47 chars + terminating null -- 16 bytes
.align 4
@@ -42,13 +42,13 @@ _dldi_driver_name:
_io_dldi:
.ascii "DLDI" @ ioType
.word 0x00000000 @ Features
- .word _DLDI_startup @
- .word _DLDI_isInserted @
+ .word _DLDI_startup @
+ .word _DLDI_isInserted @
.word _DLDI_readSectors @ Function pointers to standard device driver functions
- .word _DLDI_writeSectors @
- .word _DLDI_clearStatus @
- .word _DLDI_shutdown @
-
+ .word _DLDI_writeSectors @
+ .word _DLDI_clearStatus @
+ .word _DLDI_shutdown @
+
@---------------------------------------------------------------------------------
_DLDI_startup:
diff --git a/backends/platform/ds/arm9/source/fat/io_efa2.c b/backends/platform/ds/arm9/source/fat/io_efa2.c
index 468361969e..f3aa65cfcb 100644
--- a/backends/platform/ds/arm9/source/fat/io_efa2.c
+++ b/backends/platform/ds/arm9/source/fat/io_efa2.c
@@ -47,7 +47,7 @@ See gba_nds_fat.txt for help and license details.
// ID of Samsung K9K1G NAND flash chip
#define EFA2_NAND_ID 0xEC79A5C0
-// first sector of udisk
+// first sector of udisk
#define EFA2_UDSK_START 0x40
//
@@ -101,7 +101,7 @@ void efa2_nand_lock(void) {
//
// Set NAND Flash chip enable and write protection bits ?
-//
+//
// val | ~CE | ~WP |
// -----+-----+-----+
// 0 | 0 | 0 |
@@ -125,7 +125,7 @@ inline void efa2_nand_reset(void) {
//
// Read out NAND ID information, could be used for card detection
-//
+//
// | EFA2 1GBit |
// ------------------+------------+
// maker code | 0xEC |
@@ -166,7 +166,7 @@ EFA2_ClearStatus
Reads and checks NAND status information
bool return OUT: true if NAND is idle
-----------------------------------------------------------------*/
-bool EFA2_ClearStatus (void)
+bool EFA2_ClearStatus (void)
{
// tbd: currently there is no write support, so always return
// true, there is no possibility for pending operations
@@ -178,7 +178,7 @@ EFA2_IsInserted
Checks to see if the NAND chip used by the EFA2 is present
bool return OUT: true if the correct NAND chip is found
-----------------------------------------------------------------*/
-bool EFA2_IsInserted (void)
+bool EFA2_IsInserted (void)
{
EFA2_ClearStatus();
return (efa2_nand_id() == EFA2_NAND_ID);
@@ -223,7 +223,7 @@ bool EFA2_ReadSectors (u32 sector, u8 numSecs, void* buffer)
efa2_nand_reset();
// set NAND to READ1 operation mode and transfer page address
- REG_EFA2_NAND_CMD = 0x00; // write READ1 command
+ REG_EFA2_NAND_CMD = 0x00; // write READ1 command
REG_EFA2_NAND_WR = 0x00; // write address [7:0]
REG_EFA2_NAND_WR = (page ) & 0xff; // write address [15:8]
REG_EFA2_NAND_WR = (page >> 8 ) & 0xff; // write address[23:16]
@@ -280,7 +280,7 @@ bool EFA2_WriteSectors (u32 sector, u8 numSecs, void* buffer)
EFA2_Shutdown
unload the EFA2 interface
-----------------------------------------------------------------*/
-bool EFA2_Shutdown(void)
+bool EFA2_Shutdown(void)
{
return EFA2_ClearStatus();
}
@@ -368,7 +368,7 @@ See gba_nds_fat.txt for help and license details.
// ID of Samsung K9K1G NAND flash chip
#define EFA2_NAND_ID 0xEC79A5C0
-// first sector of udisk
+// first sector of udisk
#define EFA2_UDSK_START 0x40
//
@@ -422,7 +422,7 @@ void efa2_nand_lock(void) {
//
// Set NAND Flash chip enable and write protection bits ?
-//
+//
// val | ~CE | ~WP |
// -----+-----+-----+
// 0 | 0 | 0 |
@@ -446,7 +446,7 @@ inline void efa2_nand_reset(void) {
//
// Read out NAND ID information, could be used for card detection
-//
+//
// | EFA2 1GBit |
// ------------------+------------+
// maker code | 0xEC |
@@ -487,7 +487,7 @@ EFA2_ClearStatus
Reads and checks NAND status information
bool return OUT: true if NAND is idle
-----------------------------------------------------------------*/
-bool EFA2_ClearStatus (void)
+bool EFA2_ClearStatus (void)
{
// tbd: currently there is no write support, so always return
// true, there is no possibility for pending operations
@@ -499,7 +499,7 @@ EFA2_IsInserted
Checks to see if the NAND chip used by the EFA2 is present
bool return OUT: true if the correct NAND chip is found
-----------------------------------------------------------------*/
-bool EFA2_IsInserted (void)
+bool EFA2_IsInserted (void)
{
EFA2_ClearStatus();
return (efa2_nand_id() == EFA2_NAND_ID);
@@ -544,7 +544,7 @@ bool EFA2_ReadSectors (u32 sector, u8 numSecs, void* buffer)
efa2_nand_reset();
// set NAND to READ1 operation mode and transfer page address
- REG_EFA2_NAND_CMD = 0x00; // write READ1 command
+ REG_EFA2_NAND_CMD = 0x00; // write READ1 command
REG_EFA2_NAND_WR = 0x00; // write address [7:0]
REG_EFA2_NAND_WR = (page ) & 0xff; // write address [15:8]
REG_EFA2_NAND_WR = (page >> 8 ) & 0xff; // write address[23:16]
@@ -601,7 +601,7 @@ bool EFA2_WriteSectors (u32 sector, u8 numSecs, void* buffer)
EFA2_Shutdown
unload the EFA2 interface
-----------------------------------------------------------------*/
-bool EFA2_Shutdown(void)
+bool EFA2_Shutdown(void)
{
return EFA2_ClearStatus();
}
diff --git a/backends/platform/ds/arm9/source/fat/io_efa2.h b/backends/platform/ds/arm9/source/fat/io_efa2.h
index 27c4e9beb8..840c6b83ac 100644
--- a/backends/platform/ds/arm9/source/fat/io_efa2.h
+++ b/backends/platform/ds/arm9/source/fat/io_efa2.h
@@ -26,31 +26,3 @@
extern LPIO_INTERFACE EFA2_GetInterface(void);
#endif // define IO_EFA2_H
-/*
- io_efa2.h by CyteX
-
- Based on io_mpfc.h by chishm (Michael Chisholm)
-
- Hardware Routines for reading the NAND flash located on
- EFA2 flash carts
-
- This software is completely free. No warranty is provided.
- If you use it, please give me credit and email me about your
- project at cytex <at> gmx <dot> de and do not forget to also
- drop chishm <at> hotmail <dot> com a line
-
- See gba_nds_fat.txt for help and license details.
-*/
-
-#ifndef IO_EFA2_H
-#define IO_EFA2_H
-
-// 'EFA2'
-#define DEVICE_TYPE_EFA2 0x32414645
-
-#include "disc_io.h"
-
-// export interface
-extern LPIO_INTERFACE EFA2_GetInterface(void);
-
-#endif // define IO_EFA2_H
diff --git a/backends/platform/ds/arm9/source/fat/io_fcsr.c b/backends/platform/ds/arm9/source/fat/io_fcsr.c
index 7a67a6b1b0..d576dfbb0f 100644
--- a/backends/platform/ds/arm9/source/fat/io_fcsr.c
+++ b/backends/platform/ds/arm9/source/fat/io_fcsr.c
@@ -4,7 +4,7 @@
compact_flash.c
By chishm (Michael Chisholm)
- Hardware Routines for using a GBA Flash Cart and SRAM as a
+ Hardware Routines for using a GBA Flash Cart and SRAM as a
block device.
This software is completely free. No warranty is provided.
@@ -57,7 +57,7 @@ FCSR_IsInserted
Is a GBA Flash Cart with a valid file system inserted?
bool return OUT: true if a GBA FC card is inserted
-----------------------------------------------------------------*/
-bool FCSR_IsInserted (void)
+bool FCSR_IsInserted (void)
{
bool flagFoundFileSys = false;
@@ -85,7 +85,7 @@ FCSR_ClearStatus
Finish any pending operations
bool return OUT: always true for GBA FC
-----------------------------------------------------------------*/
-bool FCSR_ClearStatus (void)
+bool FCSR_ClearStatus (void)
{
return true;
}
@@ -101,7 +101,7 @@ void* buffer OUT: pointer to 512 byte buffer to store data in
bool return OUT: true if successful
-----------------------------------------------------------------*/
bool FCSR_ReadSectors (u32 sector, u8 numSecs, void* buffer)
-{
+{
int i;
bool flagSramSector = false;
int numSectors = (numSecs > 0 ? numSecs : 256);
@@ -208,14 +208,14 @@ bool FCSR_WriteSectors (u32 sector, u8 numSecs, void* buffer)
FCSR_Shutdown
unload the Flash Cart interface
-----------------------------------------------------------------*/
-bool FCSR_Shutdown(void)
+bool FCSR_Shutdown(void)
{
int i;
if (FCSR_ClearStatus() == false)
return false;
FCSR_FileSysPointer = 0;
-
+
for (i=0; i < 4; i++)
{
FCSR_SramSectorPointer[i] = 0;
@@ -262,11 +262,11 @@ bool FCSR_StartUp(void)
// Get SRAM sector regions from header block
for (i = 0; i < 4; i++)
{
- FCSR_SramSectorStart[i] = fileSysPointer[i+4];
+ FCSR_SramSectorStart[i] = fileSysPointer[i+4];
SramRegionSize[i] = fileSysPointer[i+8];
FCSR_SramSectorEnd[i] = FCSR_SramSectorStart[i] + SramRegionSize[i];
}
-
+
// Calculate SRAM region pointers
FCSR_SramSectorPointer[0] = (u8*)(SRAM_START + 4);
for (i = 1; i < 4; i++)
diff --git a/backends/platform/ds/arm9/source/fat/io_fcsr.h b/backends/platform/ds/arm9/source/fat/io_fcsr.h
index ef390a8ad6..2f87c1c8aa 100644
--- a/backends/platform/ds/arm9/source/fat/io_fcsr.h
+++ b/backends/platform/ds/arm9/source/fat/io_fcsr.h
@@ -1,5 +1,5 @@
/*
- io_fcsr.h
+ io_fcsr.h
Hardware Routines for using a GBA Flash Cart with SRAM
@@ -23,7 +23,7 @@ extern LPIO_INTERFACE FCSR_GetInterface(void) ;
#endif // define IO_FCSR_H
/*
- io_fcsr.h
+ io_fcsr.h
Hardware Routines for using a GBA Flash Cart with SRAM
diff --git a/backends/platform/ds/arm9/source/fat/io_m3_common.c b/backends/platform/ds/arm9/source/fat/io_m3_common.c
index 9c8280c808..ab2c143327 100644
--- a/backends/platform/ds/arm9/source/fat/io_m3_common.c
+++ b/backends/platform/ds/arm9/source/fat/io_m3_common.c
@@ -1,13 +1,13 @@
/*
- io_m3_common.c
+ io_m3_common.c
Routines common to all version of the M3
-
+
Some code based on M3 SD drivers supplied by M3Adapter.
Some code written by SaTa may have been unknowingly used.
Copyright (c) 2006 Michael "Chishm" Chisholm
-
+
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
@@ -47,7 +47,7 @@ void _M3_changeMode (u32 mode) {
_M3_readHalfword (0x08000000 + (mode << 1));
_M3_readHalfword (0x0800080e);
_M3_readHalfword (0x08000000);
-
+
if ((mode & 0x0f) != 4) {
_M3_readHalfword (0x09000000);
} else {
@@ -56,5 +56,5 @@ void _M3_changeMode (u32 mode) {
_M3_readHalfword (0x08000188);
_M3_readHalfword (0x08000188);
}
-}
+}
diff --git a/backends/platform/ds/arm9/source/fat/io_m3_common.h b/backends/platform/ds/arm9/source/fat/io_m3_common.h
index 6d0c669783..92e6bed980 100644
--- a/backends/platform/ds/arm9/source/fat/io_m3_common.h
+++ b/backends/platform/ds/arm9/source/fat/io_m3_common.h
@@ -1,5 +1,5 @@
/*
- io_m3_common.h
+ io_m3_common.h
Routines common to all version of the M3
@@ -7,7 +7,7 @@
Some code written by SaTa may have been unknowingly used.
Copyright (c) 2006 Michael "Chishm" Chisholm
-
+
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
@@ -40,7 +40,7 @@
// Values for changing mode
#define M3_MODE_ROM 0x00400004
-#define M3_MODE_MEDIA 0x00400003
+#define M3_MODE_MEDIA 0x00400003
extern void _M3_changeMode (u32 mode);
diff --git a/backends/platform/ds/arm9/source/fat/io_m3cf.c b/backends/platform/ds/arm9/source/fat/io_m3cf.c
index 968d83ae33..910f01097e 100644
--- a/backends/platform/ds/arm9/source/fat/io_m3cf.c
+++ b/backends/platform/ds/arm9/source/fat/io_m3cf.c
@@ -73,7 +73,7 @@ M3CF_IsInserted
Is a compact flash card inserted?
bool return OUT: true if a CF card is inserted
-----------------------------------------------------------------*/
-bool M3CF_IsInserted (void)
+bool M3CF_IsInserted (void)
{
// Change register, then check if value did change
M3_REG_STS = CF_STS_INSERTED;
@@ -86,17 +86,17 @@ M3CF_ClearStatus
Tries to make the CF card go back to idle mode
bool return OUT: true if a CF card is idle
-----------------------------------------------------------------*/
-bool M3CF_ClearStatus (void)
+bool M3CF_ClearStatus (void)
{
int i;
-
+
// Wait until CF card is finished previous commands
i=0;
while ((M3_REG_CMD & CF_STS_BUSY) && (i < CARD_TIMEOUT))
{
i++;
}
-
+
// Wait until card is ready for commands
i = 0;
while ((!(M3_REG_STS & CF_STS_INSERTED)) && (i < CARD_TIMEOUT))
@@ -128,7 +128,7 @@ bool M3CF_ReadSectors (u32 sector, u8 numSecs, void* buffer)
u8 *buff_u8 = (u8*)buffer;
int temp;
#endif
-
+
#if defined _CF_USE_DMA && defined NDS && defined ARM9
DC_FlushRange( buffer, j * BYTE_PER_READ);
#endif
@@ -139,7 +139,7 @@ bool M3CF_ReadSectors (u32 sector, u8 numSecs, void* buffer)
{
i++;
}
-
+
// Wait until card is ready for commands
i = 0;
while ((!(M3_REG_STS & CF_STS_INSERTED)) && (i < CARD_TIMEOUT))
@@ -148,20 +148,20 @@ bool M3CF_ReadSectors (u32 sector, u8 numSecs, void* buffer)
}
if (i >= CARD_TIMEOUT)
return false;
-
+
// Set number of sectors to read
- M3_REG_SEC = numSecs;
-
+ M3_REG_SEC = numSecs;
+
// Set read sector
M3_REG_LBA1 = sector & 0xFF; // 1st byte of sector number
M3_REG_LBA2 = (sector >> 8) & 0xFF; // 2nd byte of sector number
M3_REG_LBA3 = (sector >> 16) & 0xFF; // 3rd byte of sector number
M3_REG_LBA4 = ((sector >> 24) & 0x0F )| CF_CMD_LBA; // last nibble of sector number
-
+
// Set command to read
M3_REG_CMD = CF_CMD_READ;
-
-
+
+
while (j--)
{
// Wait until card is ready for reading
@@ -172,7 +172,7 @@ bool M3CF_ReadSectors (u32 sector, u8 numSecs, void* buffer)
}
if (i >= CARD_TIMEOUT)
return false;
-
+
// Read data
#ifdef _CF_USE_DMA
#ifdef NDS
@@ -194,12 +194,12 @@ bool M3CF_ReadSectors (u32 sector, u8 numSecs, void* buffer)
}
} else {
while(i--)
- *buff++ = *M3_DATA;
+ *buff++ = *M3_DATA;
}
#else
i=256;
while(i--)
- *buff++ = *M3_DATA;
+ *buff++ = *M3_DATA;
#endif
}
#if defined _CF_USE_DMA && defined NDS
@@ -230,7 +230,7 @@ bool M3CF_WriteSectors (u32 sector, u8 numSecs, void* buffer)
u8 *buff_u8 = (u8*)buffer;
int temp;
#endif
-
+
#if defined _CF_USE_DMA && defined NDS && defined ARM9
DC_FlushRange( buffer, j * BYTE_PER_READ);
#endif
@@ -241,7 +241,7 @@ bool M3CF_WriteSectors (u32 sector, u8 numSecs, void* buffer)
{
i++;
}
-
+
// Wait until card is ready for commands
i = 0;
while ((!(M3_REG_STS & CF_STS_INSERTED)) && (i < CARD_TIMEOUT))
@@ -250,19 +250,19 @@ bool M3CF_WriteSectors (u32 sector, u8 numSecs, void* buffer)
}
if (i >= CARD_TIMEOUT)
return false;
-
+
// Set number of sectors to write
- M3_REG_SEC = numSecs;
-
+ M3_REG_SEC = numSecs;
+
// Set write sector
M3_REG_LBA1 = sector & 0xFF; // 1st byte of sector number
M3_REG_LBA2 = (sector >> 8) & 0xFF; // 2nd byte of sector number
M3_REG_LBA3 = (sector >> 16) & 0xFF; // 3rd byte of sector number
M3_REG_LBA4 = ((sector >> 24) & 0x0F )| CF_CMD_LBA; // last nibble of sector number
-
+
// Set command to write
M3_REG_CMD = CF_CMD_WRITE;
-
+
while (j--)
{
// Wait until card is ready for writing
@@ -273,7 +273,7 @@ bool M3CF_WriteSectors (u32 sector, u8 numSecs, void* buffer)
}
if (i >= CARD_TIMEOUT)
return false;
-
+
// Write data
#ifdef _CF_USE_DMA
#ifdef NDS
@@ -295,19 +295,19 @@ bool M3CF_WriteSectors (u32 sector, u8 numSecs, void* buffer)
}
} else {
while(i--)
- *M3_DATA = *buff++;
+ *M3_DATA = *buff++;
}
#else
i=256;
while(i--)
- *M3_DATA = *buff++;
+ *M3_DATA = *buff++;
#endif
}
#if defined _CF_USE_DMA && defined NDS
// Wait for end of transfer before returning
while(DMA3_CR & DMA_BUSY);
#endif
-
+
return true;
}
@@ -317,7 +317,7 @@ M3_Unlock
Returns true if M3 was unlocked, false if failed
Added by MightyMax
-----------------------------------------------------------------*/
-bool M3_Unlock(void)
+bool M3_Unlock(void)
{
// run unlock sequence
volatile unsigned short tmp ;
diff --git a/backends/platform/ds/arm9/source/fat/io_m3cf.h b/backends/platform/ds/arm9/source/fat/io_m3cf.h
index 006c283adc..bade53f511 100644
--- a/backends/platform/ds/arm9/source/fat/io_m3cf.h
+++ b/backends/platform/ds/arm9/source/fat/io_m3cf.h
@@ -1,5 +1,5 @@
/*
- io_m3cf.h
+ io_m3cf.h
Hardware Routines for reading a compact flash card
using the M3 CF
@@ -24,7 +24,7 @@ extern LPIO_INTERFACE M3CF_GetInterface(void) ;
#endif // define IO_M3CF_H
/*
- io_m3cf.h
+ io_m3cf.h
Hardware Routines for reading a compact flash card
using the M3 CF
diff --git a/backends/platform/ds/arm9/source/fat/io_m3sd.c b/backends/platform/ds/arm9/source/fat/io_m3sd.c
index 2bbda37a5a..914b83e06e 100644
--- a/backends/platform/ds/arm9/source/fat/io_m3sd.c
+++ b/backends/platform/ds/arm9/source/fat/io_m3sd.c
@@ -218,7 +218,7 @@ void M3SD_writesector(u16 * p,u32 sectorn)
}
} while ((verify > 0) && (tries < 16));
-
+
free(data);
free(check);
} // */
@@ -356,7 +356,7 @@ bool M3SD_Shutdown(void)
bool M3SD_StartUp(void)
{
vu16* waitCr = (vu16*)0x4000204;
-
+
*waitCr |= 0x6000;
// *(vu16*)0x4000204=0x6000;
// Try unlocking 3 times, because occationally it fails to detect the reader.
diff --git a/backends/platform/ds/arm9/source/fat/io_m3sd_asm.s b/backends/platform/ds/arm9/source/fat/io_m3sd_asm.s
index a6bb8dc187..ffaa971aca 100644
--- a/backends/platform/ds/arm9/source/fat/io_m3sd_asm.s
+++ b/backends/platform/ds/arm9/source/fat/io_m3sd_asm.s
@@ -54,7 +54,7 @@ sd_write_loop2:
sd_write_busy:
bl clkin
- ldrh r0,[r1]
+ ldrh r0,[r1]
tst r0,#0x100
beq sd_write_busy
ldmfd r13!,{r0-r1}
@@ -68,10 +68,10 @@ SD_crc16:
stmfd r13!,{r4-r9}
mov r9,r2
- mov r3,#0
- mov r4,#0
- mov r5,#0
- mov r6,#0
+ mov r3,#0
+ mov r4,#0
+ mov r5,#0
+ mov r6,#0
ldr r7,=0x80808080
ldr r8,=0x1021
@@ -86,19 +86,19 @@ sd_crc16_loop:
eorne r3,r3,r8
tst r2,r7,lsr #24
eorne r3,r3,r8
-
+
mov r4,r4,lsl #1
tst r4,#0x10000
eorne r4,r4,r8
tst r2,r7,lsr #25
eorne r4,r4,r8
-
+
mov r5,r5,lsl #1
tst r5,#0x10000
eorne r5,r5,r8
tst r2,r7,lsr #26
eorne r5,r5,r8
-
+
mov r6,r6,lsl #1
tst r6,#0x10000
eorne r6,r6,r8
@@ -107,7 +107,7 @@ sd_crc16_loop:
mov r7,r7,ror #4
subs r1,r1,#4
- bne sd_crc16_loop
+ bne sd_crc16_loop
mov r2,r9
mov r8,#16
@@ -145,7 +145,7 @@ SD_data_write:
mov r2,#SDODA
sd_data_write_busy:
bl clkin
- ldrh r3,[r2]
+ ldrh r3,[r2]
tst r3,#0x100
beq sd_data_write_busy
@@ -169,7 +169,7 @@ sd_data_write_loop:
bl clkout
subs r5, r5, #2
- bne sd_data_write_loop
+ bne sd_data_write_loop
cmp r1,#0
movne r0,r1
@@ -184,10 +184,10 @@ sd_data_write_loop2:
bl clkout
subs r5, r5, #1
bne sd_data_write_loop2
-
+
sd_data_write_busy2:
bl clkin
- ldrh r3,[r2]
+ ldrh r3,[r2]
tst r3,#0x100
beq sd_data_write_busy2
diff --git a/backends/platform/ds/arm9/source/fat/io_mmcf.c b/backends/platform/ds/arm9/source/fat/io_mmcf.c
index 5ccb3122e4..3034afe311 100644
--- a/backends/platform/ds/arm9/source/fat/io_mmcf.c
+++ b/backends/platform/ds/arm9/source/fat/io_mmcf.c
@@ -74,14 +74,14 @@ static bool cf_block_ready(void)
do
{
while (!(CF_RD_STATUS & 0x40));
- } while (CF_RD_STATUS & 0x80);
+ } while (CF_RD_STATUS & 0x80);
*/
do
{
i++;
- while ( (!(CF_RD_STATUS & 0x40)) && (i < CARD_TIMEOUT) ) i++;
- } while ( (CF_RD_STATUS & 0x80) && (i < CARD_TIMEOUT) );
+ while ( (!(CF_RD_STATUS & 0x40)) && (i < CARD_TIMEOUT) ) i++;
+ } while ( (CF_RD_STATUS & 0x80) && (i < CARD_TIMEOUT) );
if (i >= CARD_TIMEOUT) {
return false;
@@ -110,7 +110,7 @@ MMCF_IsInserted
Is a compact flash card inserted?
bool return OUT: true if a CF card is inserted
-----------------------------------------------------------------*/
-bool MMCF_IsInserted (void)
+bool MMCF_IsInserted (void)
{
if ( !cf_set_features(0xAA) ) return false;
@@ -123,7 +123,7 @@ MMCF_ClearStatus
Tries to make the CF card go back to idle mode
bool return OUT: true if a CF card is idle
-----------------------------------------------------------------*/
-bool MMCF_ClearStatus (void)
+bool MMCF_ClearStatus (void)
{
return true;
}
@@ -185,7 +185,7 @@ bool MMCF_ReadSectors (u32 sector, u8 numSecs, void* buffer)
}
} else {
while(i--)
- *buff++ = *MP_DATA;
+ *buff++ = *MP_DATA;
}
#else
i=256;
@@ -222,15 +222,15 @@ bool MMCF_WriteSectors (u32 sector, u8 numSecs, void* buffer)
u8 *buff_u8 = (u8*)buffer;
int temp;
#endif
-
+
#if defined _CF_USE_DMA && defined NDS && defined ARM9
DC_FlushRange( buffer, j * BYTE_PER_READ);
#endif
- if (numSecs > 1)
+ if (numSecs > 1)
{
int r = 0;
-
+
for (r = 0; r < numSecs; r++)
{
MMCF_WriteSectors(sector + r, 1, ((unsigned char *) (buffer)) + 512);
@@ -270,12 +270,12 @@ bool MMCF_WriteSectors (u32 sector, u8 numSecs, void* buffer)
}
} else {
while(i--)
- *MP_DATA = *buff++;
+ *MP_DATA = *buff++;
}
#else
i=256;
while(i--)
- *MP_DATA = *buff++;
+ *MP_DATA = *buff++;
#endif
}
@@ -283,7 +283,7 @@ bool MMCF_WriteSectors (u32 sector, u8 numSecs, void* buffer)
#if defined _CF_USE_DMA && defined NDS
// Wait for end of transfer before returning
while(DMA3_CR & DMA_BUSY);
-#endif
+#endif
//#define _CF_VERIFY
@@ -312,7 +312,7 @@ bool MMCF_WriteSectors (u32 sector, u8 numSecs, void* buffer)
MMCF_Shutdown
unload the GBAMP CF interface
-----------------------------------------------------------------*/
-bool MMCF_Shutdown(void)
+bool MMCF_Shutdown(void)
{
return MMCF_ClearStatus() ;
}
diff --git a/backends/platform/ds/arm9/source/fat/io_mmcf.h b/backends/platform/ds/arm9/source/fat/io_mmcf.h
index fa9e6536ee..baa43ac59f 100644
--- a/backends/platform/ds/arm9/source/fat/io_mmcf.h
+++ b/backends/platform/ds/arm9/source/fat/io_mmcf.h
@@ -1,5 +1,5 @@
/*
- io_mmcf.h
+ io_mmcf.h
Hardware Routines for reading a compact flash card
using the GBA Movie Player
diff --git a/backends/platform/ds/arm9/source/fat/io_mpcf.c b/backends/platform/ds/arm9/source/fat/io_mpcf.c
index 6b56e29291..a12b6e8e1e 100644
--- a/backends/platform/ds/arm9/source/fat/io_mpcf.c
+++ b/backends/platform/ds/arm9/source/fat/io_mpcf.c
@@ -73,7 +73,7 @@ MPCF_IsInserted
Is a compact flash card inserted?
bool return OUT: true if a CF card is inserted
-----------------------------------------------------------------*/
-bool MPCF_IsInserted (void)
+bool MPCF_IsInserted (void)
{
// Change register, then check if value did change
MP_REG_STS = CF_STS_INSERTED;
@@ -86,17 +86,17 @@ MPCF_ClearStatus
Tries to make the CF card go back to idle mode
bool return OUT: true if a CF card is idle
-----------------------------------------------------------------*/
-bool MPCF_ClearStatus (void)
+bool MPCF_ClearStatus (void)
{
int i;
-
+
// Wait until CF card is finished previous commands
i=0;
while ((MP_REG_CMD & CF_STS_BUSY) && (i < CARD_TIMEOUT))
{
i++;
}
-
+
// Wait until card is ready for commands
i = 0;
while ((!(MP_REG_STS & CF_STS_INSERTED)) && (i < CARD_TIMEOUT))
@@ -139,7 +139,7 @@ bool MPCF_ReadSectors (u32 sector, u8 numSecs, void* buffer)
{
i++;
}
-
+
// Wait until card is ready for commands
i = 0;
while ((!(MP_REG_STS & CF_STS_INSERTED)) && (i < CARD_TIMEOUT))
@@ -148,20 +148,20 @@ bool MPCF_ReadSectors (u32 sector, u8 numSecs, void* buffer)
}
if (i >= CARD_TIMEOUT)
return false;
-
+
// Set number of sectors to read
- MP_REG_SEC = numSecs;
-
+ MP_REG_SEC = numSecs;
+
// Set read sector
MP_REG_LBA1 = sector & 0xFF; // 1st byte of sector number
MP_REG_LBA2 = (sector >> 8) & 0xFF; // 2nd byte of sector number
MP_REG_LBA3 = (sector >> 16) & 0xFF; // 3rd byte of sector number
MP_REG_LBA4 = ((sector >> 24) & 0x0F )| CF_CMD_LBA; // last nibble of sector number
-
+
// Set command to read
MP_REG_CMD = CF_CMD_READ;
-
-
+
+
while (j--)
{
// Wait until card is ready for reading
@@ -172,7 +172,7 @@ bool MPCF_ReadSectors (u32 sector, u8 numSecs, void* buffer)
}
if (i >= CARD_TIMEOUT)
return false;
-
+
// Read data
#ifdef _CF_USE_DMA
#ifdef NDS
@@ -194,12 +194,12 @@ bool MPCF_ReadSectors (u32 sector, u8 numSecs, void* buffer)
}
} else {
while(i--)
- *buff++ = *MP_DATA;
+ *buff++ = *MP_DATA;
}
#else
i=256;
while(i--)
- *buff++ = *MP_DATA;
+ *buff++ = *MP_DATA;
#endif
}
#if (defined _CF_USE_DMA) && (defined NDS)
@@ -229,7 +229,7 @@ bool MPCF_WriteSectors (u32 sector, u8 numSecs, void* buffer)
u8 *buff_u8 = (u8*)buffer;
int temp;
#endif
-
+
#if defined _CF_USE_DMA && defined NDS && defined ARM9
DC_FlushRange( buffer, j * BYTE_PER_READ);
#endif
@@ -240,7 +240,7 @@ bool MPCF_WriteSectors (u32 sector, u8 numSecs, void* buffer)
{
i++;
}
-
+
// Wait until card is ready for commands
i = 0;
while ((!(MP_REG_STS & CF_STS_INSERTED)) && (i < CARD_TIMEOUT))
@@ -249,19 +249,19 @@ bool MPCF_WriteSectors (u32 sector, u8 numSecs, void* buffer)
}
if (i >= CARD_TIMEOUT)
return false;
-
+
// Set number of sectors to write
- MP_REG_SEC = numSecs;
-
+ MP_REG_SEC = numSecs;
+
// Set write sector
MP_REG_LBA1 = sector & 0xFF; // 1st byte of sector number
MP_REG_LBA2 = (sector >> 8) & 0xFF; // 2nd byte of sector number
MP_REG_LBA3 = (sector >> 16) & 0xFF; // 3rd byte of sector number
MP_REG_LBA4 = ((sector >> 24) & 0x0F )| CF_CMD_LBA; // last nibble of sector number
-
+
// Set command to write
MP_REG_CMD = CF_CMD_WRITE;
-
+
while (j--)
{
// Wait until card is ready for writing
@@ -272,7 +272,7 @@ bool MPCF_WriteSectors (u32 sector, u8 numSecs, void* buffer)
}
if (i >= CARD_TIMEOUT)
return false;
-
+
// Write data
#ifdef _CF_USE_DMA
#ifdef NDS
@@ -294,19 +294,19 @@ bool MPCF_WriteSectors (u32 sector, u8 numSecs, void* buffer)
}
} else {
while(i--)
- *MP_DATA = *buff++;
+ *MP_DATA = *buff++;
}
#else
i=256;
while(i--)
- *MP_DATA = *buff++;
+ *MP_DATA = *buff++;
#endif
}
#if defined _CF_USE_DMA && defined NDS
// Wait for end of transfer before returning
while(DMA3_CR & DMA_BUSY);
#endif
-
+
return true;
}
@@ -314,7 +314,7 @@ bool MPCF_WriteSectors (u32 sector, u8 numSecs, void* buffer)
MPCF_Shutdown
unload the GBAMP CF interface
-----------------------------------------------------------------*/
-bool MPCF_Shutdown(void)
+bool MPCF_Shutdown(void)
{
return MPCF_ClearStatus() ;
}
diff --git a/backends/platform/ds/arm9/source/fat/io_mpcf.h b/backends/platform/ds/arm9/source/fat/io_mpcf.h
index 8ec8859097..58cab41b4c 100644
--- a/backends/platform/ds/arm9/source/fat/io_mpcf.h
+++ b/backends/platform/ds/arm9/source/fat/io_mpcf.h
@@ -1,5 +1,5 @@
/*
- io_mpcf.h
+ io_mpcf.h
Hardware Routines for reading a compact flash card
using the GBA Movie Player
@@ -24,7 +24,7 @@ extern LPIO_INTERFACE MPCF_GetInterface(void) ;
#endif // define IO_MPCF_H
/*
- io_mpcf.h
+ io_mpcf.h
Hardware Routines for reading a compact flash card
using the GBA Movie Player
diff --git a/backends/platform/ds/arm9/source/fat/io_njsd.c b/backends/platform/ds/arm9/source/fat/io_njsd.c
index d8a0ff69ac..fbb223d560 100644
--- a/backends/platform/ds/arm9/source/fat/io_njsd.c
+++ b/backends/platform/ds/arm9/source/fat/io_njsd.c
@@ -3,11 +3,11 @@
Hardware Routines for reading an SD card using
a NinjaDS SD adapter.
-
+
Original code supplied by NinjaMod
-
+
Copyright (c) 2006 Michael "Chishm" Chisholm
-
+
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
@@ -28,7 +28,7 @@
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
+
2006-08-05 - Chishm
* First release
*/
@@ -84,7 +84,7 @@ static u32 _NJSD_relativeCardAddress = 0;
static inline bool _NJSD_waitIRQ(void) {
/*#ifdef _NJSD_SYNC
int i = IRQ_TIMEOUT;
- while (!(REG_IF & 0x100000) && --i);
+ while (!(REG_IF & 0x100000) && --i);
REG_IF = 0x100000;
if (i <= 0) {
return false;
@@ -96,7 +96,7 @@ static inline bool _NJSD_waitIRQ(void) {
//if (!(REG_IME & 1))
//{
// irq's disabled...
- while (!(REG_IF & 0x100000) && (!(_NJSD_irqFlag)) && --i);
+ while (!(REG_IF & 0x100000) && (!(_NJSD_irqFlag)) && --i);
_NJSD_irqFlag = 0;
REG_IF = 0x100000;
if (i <= 0) {
@@ -106,7 +106,7 @@ static inline bool _NJSD_waitIRQ(void) {
}
//} else {
// irq's enabled
- // while (!(_NJSD_irqFlag) && --i);
+ // while (!(_NJSD_irqFlag) && --i);
// _NJSD_irqFlag = 0;
// REG_IF = 0x100000;
// if (i <= 0) {
@@ -118,8 +118,8 @@ static inline bool _NJSD_waitIRQ(void) {
//#endif
}
-static inline void _NJSD_writeCardCommand
- (u8 cmd0, u8 cmd1, u8 cmd2, u8 cmd3, u8 cmd4, u8 cmd5, u8 cmd6, u8 cmd7)
+static inline void _NJSD_writeCardCommand
+ (u8 cmd0, u8 cmd1, u8 cmd2, u8 cmd3, u8 cmd4, u8 cmd5, u8 cmd6, u8 cmd7)
{
CARD_COMMAND[0] = cmd0;
CARD_COMMAND[1] = cmd1;
@@ -142,7 +142,7 @@ static bool _NJSD_reset (void) {
if (i <= 0) {
return false;
}
-
+
return true;
}
@@ -179,7 +179,7 @@ static bool _NJSD_sendCMDR (int speed, u8 *rsp_buf, int type, u8 cmd, u32 param)
REG_IME = 0;
#endif
- REG_IE &= ~0x100000;
+ REG_IE &= ~0x100000;
REG_IF = 0x100000;
CARD_CR1H = CARD_CR1_ENABLE;
@@ -191,7 +191,7 @@ static bool _NJSD_sendCMDR (int speed, u8 *rsp_buf, int type, u8 cmd, u32 param)
} else {
CARD_COMMAND[0] = 0xF0 | (speed << 2) | 0 | (1 << 1);
}
-
+
CARD_COMMAND[1] = (type & 0x40) | ((( type >> 2) & 7) << 3);
CARD_COMMAND[2] = 0x40 | cmd;
CARD_COMMAND[3] = (param>>24) & 0xFF;
@@ -301,7 +301,7 @@ static bool _NJSD_writeSector (u8 *buffer, u8 *crc_buf, u32 offset) {
}
- REG_IE &= ~0x100000;
+ REG_IE &= ~0x100000;
REG_IF = 0x100000;
CARD_CR1H = CARD_CR1_ENABLE;
@@ -334,7 +334,7 @@ static bool _NJSD_writeSector (u8 *buffer, u8 *crc_buf, u32 offset) {
i++;
}
} while (CARD_CR2 & CARD_BUSY);
-
+
i = WRITE_TIMEOUT;
responseBuffer[3] = 0;
do {
@@ -352,7 +352,7 @@ static bool _NJSD_writeSector (u8 *buffer, u8 *crc_buf, u32 offset) {
#ifdef _NJSD_SYNC
REG_IME = old_REG_IME;
#endif
-
+
return true;
}
@@ -365,12 +365,12 @@ static bool _NJSD_sendCLK (int speed, int count) {
REG_IME = 0;
#endif
- REG_IE &= ~0x100000;
+ REG_IE &= ~0x100000;
REG_IF = 0x100000;
//CARD_CR1H = CARD_CR1_ENABLE; // | CARD_CR1_IRQ;
_NJSD_writeCardCommand (0xE0 | ((speed & 3) << 2), 0, (count - 1), 0, 0, 0, 0, 0);
-
+
CARD_CR2 = _NJSD_cardFlags;
i = COMMAND_TIMEOUT;
while ((CARD_CR2 & CARD_BUSY) && --i);
@@ -404,7 +404,7 @@ static bool _NJSD_sendCMDN (int speed, u8 cmd, u32 param) {
REG_IME = 0;
#endif
- REG_IE &= ~0x100000;
+ REG_IE &= ~0x100000;
REG_IF = 0x100000;
CARD_CR1H = CARD_CR1_ENABLE; // | CARD_CR1_IRQ;
@@ -438,22 +438,22 @@ static bool _NJSD_sendCMDN (int speed, u8 cmd, u32 param) {
static bool _NJSD_cardInit (void) {
u8 responseBuffer[17];
int i;
-
+
// If the commands succeed the first time, assume they'll always succeed
if (! _NJSD_sendCLK (SD_CLK_200KHz, 256) ) return false;
if (! _NJSD_sendCMDN (SD_CLK_200KHz, GO_IDLE_STATE, 0) ) return false;
_NJSD_sendCLK (SD_CLK_200KHz, 8);
-
+
_NJSD_sendCLK (SD_CLK_200KHz, 256);
- _NJSD_sendCMDN (SD_CLK_200KHz, GO_IDLE_STATE, 0);
+ _NJSD_sendCMDN (SD_CLK_200KHz, GO_IDLE_STATE, 0);
_NJSD_sendCLK (SD_CLK_200KHz, 8);
-
+
for (i = 0; i < MAX_STARTUP_TRIES ; i++) {
_NJSD_sendCMDR (SD_CLK_200KHz, responseBuffer, SD_RSP_48, APP_CMD, 0);
- if (
+ if (
_NJSD_sendCMDR (SD_CLK_200KHz, responseBuffer, SD_RSP_48, SD_APP_OP_COND, SD_OCR_VALUE) &&
((responseBuffer[1] & 0x80) != 0))
- {
+ {
// Card is ready to receive commands now
break;
}
@@ -461,10 +461,10 @@ static bool _NJSD_cardInit (void) {
if (i >= MAX_STARTUP_TRIES) {
return false;
}
-
+
// The card's name, as assigned by the manufacturer
_NJSD_sendCMDR (SD_CLK_200KHz, responseBuffer, SD_RSP_136, ALL_SEND_CID, 0);
-
+
// Get a new address
for (i = 0; i < MAX_STARTUP_TRIES ; i++) {
_NJSD_sendCMDR (SD_CLK_200KHz, responseBuffer, SD_RSP_48, SEND_RELATIVE_ADDR, 0);
@@ -473,23 +473,23 @@ static bool _NJSD_cardInit (void) {
break;
}
}
- if (i >= MAX_STARTUP_TRIES) {
+ if (i >= MAX_STARTUP_TRIES) {
return false;
}
// Some cards won't go to higher speeds unless they think you checked their capabilities
_NJSD_sendCMDR (SD_CLK_200KHz, responseBuffer, SD_RSP_136, SEND_CSD, _NJSD_relativeCardAddress);
-
+
// Only this card should respond to all future commands
_NJSD_sendCMDR (SD_CLK_200KHz, responseBuffer, SD_RSP_48, SELECT_CARD, _NJSD_relativeCardAddress);
-
+
// Set a 4 bit data bus
_NJSD_sendCMDR (SD_CLK_200KHz, responseBuffer, SD_RSP_48, APP_CMD, _NJSD_relativeCardAddress);
_NJSD_sendCMDR (SD_CLK_200KHz, responseBuffer, SD_RSP_48, SET_BUS_WIDTH, 2); // 4-bit mode.
// Use 512 byte blocks
_NJSD_sendCMDR (SD_CLK_200KHz, responseBuffer, SD_RSP_48, SET_BLOCKLEN, 512); // 512 byte blocks
-
+
return true;
}
@@ -521,17 +521,17 @@ bool _NJSD_startup(void) {
return false;
}
return true;
-}
+}
bool _NJSD_writeSectors (u32 sector, u32 numSectors, const void* buffer) {
- u8 crc[8];
+ u8 crc[8];
u32 offset = sector * BYTES_PER_READ;
u8* data = (u8*) buffer;
while (numSectors--) {
_SD_CRC16 ( data, BYTES_PER_READ, crc);
-
+
if (! _NJSD_writeSector (data, crc, offset)) {
return false;
}
@@ -549,7 +549,7 @@ bool _NJSD_readSectors (u32 sector, u32 numSectors, void* buffer) {
#ifdef _NJSD_SYNC
u32 old_REG_IME;
#endif
-
+
u8* tbuf = (u8*)buffer;
if (numSectors == 0) {
@@ -573,7 +573,7 @@ bool _NJSD_readSectors (u32 sector, u32 numSectors, void* buffer) {
if (!_NJSD_waitIRQ ()) {
#ifdef _NJSD_SYNC
REG_IME = old_REG_IME;
-#endif
+#endif
return false;
}
}
@@ -586,10 +586,10 @@ bool _NJSD_readSectors (u32 sector, u32 numSectors, void* buffer) {
if (!_NJSD_waitIRQ ()) {
#ifdef _NJSD_SYNC
REG_IME = old_REG_IME;
-#endif
+#endif
return false;
}
-
+
if (((int)buffer & 0x03) != 0){
cardPolledTransfer (0xA1406000, tmp, BYTES_PER_READ, (u8*)_NJSD_read_cmd);
memcpy (tbuf + (numSectors - 1) * BYTES_PER_READ, tmp, BYTES_PER_READ);
@@ -618,7 +618,7 @@ bool _NJSD_readSectors (u32 sector, u32 numSectors, void* buffer) {
#ifdef _NJSD_SYNC
u32 old_REG_IME;
#endif
-
+
u8* tbuf = (u8*)buffer;
if (numSectors == 0) {
@@ -637,7 +637,7 @@ bool _NJSD_readSectors (u32 sector, u32 numSectors, void* buffer) {
if (!_NJSD_waitIRQ ()) {
#ifdef _NJSD_SYNC
REG_IME = old_REG_IME;
-#endif
+#endif
return false;
}
}
@@ -645,10 +645,10 @@ bool _NJSD_readSectors (u32 sector, u32 numSectors, void* buffer) {
if (!_NJSD_waitIRQ ()) {
#ifdef _NJSD_SYNC
REG_IME = old_REG_IME;
-#endif
+#endif
return false;
}
-
+
cardPolledTransfer (0xA1406000, (u32*)(tbuf + (numSectors - 1) * BYTES_PER_READ), BYTES_PER_READ, (u8*)_NJSD_read_cmd);
} else {
_NJSD_sendCMDR (_NJSD_speed, NULL, SD_RSP_STREAM, READ_SINGLE_BLOCK, sector * BYTES_PER_READ);
@@ -678,4 +678,4 @@ LPIO_INTERFACE NJSD_GetInterface(void) {
} ;
#endif // defined NDS
-#endif
+#endif \ No newline at end of file
diff --git a/backends/platform/ds/arm9/source/fat/io_njsd.h b/backends/platform/ds/arm9/source/fat/io_njsd.h
index dce469cad6..a297cda112 100644
--- a/backends/platform/ds/arm9/source/fat/io_njsd.h
+++ b/backends/platform/ds/arm9/source/fat/io_njsd.h
@@ -1,11 +1,11 @@
/*
- io_njsd.h
+ io_njsd.h
Hardware Routines for reading an SD card using
a NinjaDS SD adapter.
Copyright (c) 2006 Michael "Chishm" Chisholm
-
+
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
diff --git a/backends/platform/ds/arm9/source/fat/io_nmmc.c b/backends/platform/ds/arm9/source/fat/io_nmmc.c
index e9331ae58e..a29c26e43a 100644
--- a/backends/platform/ds/arm9/source/fat/io_nmmc.c
+++ b/backends/platform/ds/arm9/source/fat/io_nmmc.c
@@ -13,10 +13,10 @@
project at chishm@hotmail.com
See gba_nds_fat.txt for help and license details.
-
+
2006-02-09 - www.neoflash.com:
* First stable release
-
+
2006-02-13 - Chishm
* Added ReadMK2Config function
* Added read config test to init function so no unnecessary card commands are sent
@@ -73,7 +73,7 @@ static inline void Neo_MK2GameMode() {
static inline void Neo_EnableEEPROM( bool enable ) {
Neo_OpenSPI(spi_freq);
if(enable) Neo_SPI(0x06);
- else Neo_SPI(0x0E);
+ else Neo_SPI(0x0E);
Neo_CloseSPI();
}
@@ -87,7 +87,7 @@ void Neo_WriteMK2Config(u8 config) {
Neo_EnableEEPROM(false);
}
-u8 Neo_ReadMK2Config(void)
+u8 Neo_ReadMK2Config(void)
{
u8 config;
Neo_EnableEEPROM(true);
@@ -104,7 +104,7 @@ u8 Neo_ReadMK2Config(void)
u8 selectMMC_command [8] = {0xFF, 0x00, 0x6A, 0xDF, 0x37, 0x59, 0x33, 0xA3};
-void Neo_SelectMMC (u8 dataByte)
+void Neo_SelectMMC (u8 dataByte)
{
selectMMC_command[1] = dataByte; // Set enable / disable byte
cardWriteCommand (selectMMC_command); // Send "5. Use the EEPROM CS to access the MK2 MMC/SD card"
@@ -154,12 +154,12 @@ bool Neo_CheckMMCResponse( u8 response, u8 mask ) {
bool Neo_InitMMC() {
Neo_MK2GameMode();
Neo_WriteMK2Config( MK2_CONFIG_ZIP_RAM_CLOSE | MK2_CONFIG_GAME_FLASH_CLOSE);
-
+
// Make sure the configuration was accepted
if (Neo_ReadMK2Config() != (MK2_CONFIG_ZIP_RAM_CLOSE | MK2_CONFIG_GAME_FLASH_CLOSE)) {
return false; // If not, then it wasn't initialised properly
}
-
+
return true;
}
@@ -167,7 +167,7 @@ bool Neo_InitMMC() {
bool NMMC_IsInserted(void) {
int i;
-
+
Neo_EnableMMC( true ); // Open SPI port to MMC card
Neo_SendMMCCommand(MMC_SEND_CSD, 0);
if( Neo_CheckMMCResponse( 0x00, 0xFF ) == false ) { // Make sure no errors occured
@@ -183,13 +183,13 @@ bool NMMC_IsInserted(void) {
for (i = 0; i < 28; i++) {
Neo_SPI(0xff);
}
-
+
return true;
}
bool NMMC_ClearStatus (void) {
u32 i;
-
+
Neo_EnableMMC( true ); // Open SPI port to MMC card
for (i = 0; i < 10; i++) {
Neo_SPI(0xFF); // Send 10 0xFF bytes to MMC card
@@ -224,14 +224,14 @@ bool NMMC_StartUp(void) {
return false;
}
Neo_EnableMMC( true ); // Open SPI port to MMC card
-
+
// Set block length
Neo_SendMMCCommand(MMC_SET_BLOCKLEN, BYTE_PER_READ );
if( Neo_CheckMMCResponse( 0x00, 0xFF ) == false ) { // Make sure no errors occured
Neo_EnableMMC( false );
return false;
}
-
+
// Check if we can use a higher SPI frequency
Neo_SendMMCCommand(MMC_SEND_CSD, 0);
if( Neo_CheckMMCResponse( 0x00, 0xFF ) == false ) { // Make sure no errors occured
@@ -252,77 +252,77 @@ bool NMMC_StartUp(void) {
if ((transSpeed & 0xf0) >= 0x30) {
spi_freq = 0;
}
-
+
Neo_EnableMMC( false );
return true;
-}
+}
-bool NMMC_WriteSectors (u32 sector, u8 numSecs, void* buffer)
+bool NMMC_WriteSectors (u32 sector, u8 numSecs, void* buffer)
{
u32 i;
u8 *p=buffer;
-
+
int totalSecs = (numSecs == 0) ? 256 : numSecs;
sector *= BYTE_PER_READ;
-
+
Neo_EnableMMC( true ); // Open SPI port to MMC card
Neo_SendMMCCommand( 25, sector );
if( Neo_CheckMMCResponse( 0x00, 0xFF ) == false ) { // Make sure no errors occured
Neo_EnableMMC( false );
return false;
}
-
+
while (totalSecs--) {
Neo_SPI( 0xFC ); // Send Start Block token
for( i = 0; i < BYTE_PER_READ; i++ ) // Send a block of data
Neo_SPI( *p++ );
Neo_SPI( 0xFF ); // Send fake CRC16
Neo_SPI( 0xFF ); // Send fake CRC16
-
+
if( ( Neo_SPI( 0xFF ) & 0x0F ) != 0x05 ) { // Make sure the block was accepted
Neo_EnableMMC( false );
return false;
}
while( Neo_SPI( 0xFF ) == 0x00 ); // Wait for the block to be written
}
-
+
// Stop transmission block
Neo_SPI( 0xFD ); // Send Stop Transmission Block token
for( i = 0; i < BYTE_PER_READ; i++ ) // Send a block of fake data
Neo_SPI( 0xFF );
Neo_SPI( 0xFF ); // Send fake CRC16
Neo_SPI( 0xFF ); // Send fake CRC16
-
- Neo_SPI (0xFF); // Send 8 clocks
+
+ Neo_SPI (0xFF); // Send 8 clocks
while( Neo_SPI( 0xFF ) == 0x00 ); // Wait for the busy signal to clear
-
- for ( i = 0; i < 0x10; i++) {
+
+ for ( i = 0; i < 0x10; i++) {
Neo_SPI (0xFF); // Send clocks for the MMC card to finish what it's doing
}
-
+
Neo_EnableMMC( false ); // Close SPI port to MMC card
return true;
}
-bool NMMC_ReadSectors (u32 sector, u8 numSecs, void* buffer)
+bool NMMC_ReadSectors (u32 sector, u8 numSecs, void* buffer)
{
u32 i;
u8 *p=buffer;
-
+
int totalSecs = (numSecs == 0) ? 256 : numSecs;
sector *= BYTE_PER_READ;
-
+
Neo_EnableMMC( true ); // Open SPI port to MMC card
-
+
while (totalSecs--) {
Neo_SendMMCCommand(MMC_READ_BLOCK, sector );
if( Neo_CheckMMCResponse( 0x00, 0xFF ) == false ) { // Make sure no errors occured
Neo_EnableMMC( false );
return false;
}
-
+
if( Neo_CheckMMCResponse( 0xFE, 0xFF ) == false ) { // Check for Start Block token
Neo_EnableMMC( false );
return false;
@@ -333,7 +333,7 @@ bool NMMC_ReadSectors (u32 sector, u8 numSecs, void* buffer)
Neo_SPI( 0xFF ); // Ignore CRC16
sector += BYTE_PER_READ;
}
-
+
Neo_EnableMMC( false ); // Close SPI port to MMC card
return true;
}
diff --git a/backends/platform/ds/arm9/source/fat/io_nmmc.h b/backends/platform/ds/arm9/source/fat/io_nmmc.h
index 0249e3a864..5244d21868 100644
--- a/backends/platform/ds/arm9/source/fat/io_nmmc.h
+++ b/backends/platform/ds/arm9/source/fat/io_nmmc.h
@@ -1,5 +1,5 @@
/*
- io_NMMC.h
+ io_NMMC.h
Hardware Routines for reading an SD or MMC card using
a Neoflash MK2 or MK3.
@@ -26,7 +26,7 @@ extern LPIO_INTERFACE NMMC_GetInterface(void) ;
#endif // define IO_NMMC_H
/*
- io_NMMC.h
+ io_NMMC.h
Hardware Routines for reading an SD or MMC card using
a Neoflash MK2 or MK3.
diff --git a/backends/platform/ds/arm9/source/fat/io_sccf.c b/backends/platform/ds/arm9/source/fat/io_sccf.c
index bda628fdaa..0c77f4673c 100644
--- a/backends/platform/ds/arm9/source/fat/io_sccf.c
+++ b/backends/platform/ds/arm9/source/fat/io_sccf.c
@@ -57,7 +57,7 @@ bool SCCF_Unlock(void)
temp = (~temp & 0xFF);
return (CF_REG_LBA1 == temp);
#undef CF_REG_LBA1
-}
+}
bool SCCF_Shutdown(void) {
return MPCF_ClearStatus() ;
diff --git a/backends/platform/ds/arm9/source/fat/io_sccf.h b/backends/platform/ds/arm9/source/fat/io_sccf.h
index 2270c4eab1..961909fbce 100644
--- a/backends/platform/ds/arm9/source/fat/io_sccf.h
+++ b/backends/platform/ds/arm9/source/fat/io_sccf.h
@@ -1,5 +1,5 @@
/*
- io_sccf.h
+ io_sccf.h
Hardware Routines for reading a compact flash card
using the Supercard CF
@@ -24,7 +24,7 @@ extern LPIO_INTERFACE SCCF_GetInterface(void) ;
#endif // define IO_SCCF_H
/*
- io_sccf.h
+ io_sccf.h
Hardware Routines for reading a compact flash card
using the Supercard CF
diff --git a/backends/platform/ds/arm9/source/fat/io_scsd.c b/backends/platform/ds/arm9/source/fat/io_scsd.c
index 270691436d..9359fefb6d 100644
--- a/backends/platform/ds/arm9/source/fat/io_scsd.c
+++ b/backends/platform/ds/arm9/source/fat/io_scsd.c
@@ -1,8 +1,8 @@
/*
io_scsd.c by SaTa.
based on io_sccf.c
-
-
+
+
*/
/*
@@ -43,7 +43,7 @@ extern void InitSCMode(void); // CF‚Æ“¯‚¶
extern void ReadSector(u16 *buff,u32 sector,u8 ReadNumber);
extern void WriteSector(u16 *buff,u32 sector,u8 writeNumber);
extern bool MemoryCard_IsInserted(void); // CF‚ƈႤ
-//
+//
/*-----------------------------------------------------------------
SCSD_Unlock
@@ -55,7 +55,7 @@ bool SCSD_Unlock(void)
{
InitSCMode();
return MemoryCard_IsInserted();
-}
+}
bool SCSD_Shutdown(void) {
return MPCF_ClearStatus() ;
@@ -103,4 +103,4 @@ LPIO_INTERFACE SCSD_GetInterface(void) {
return &io_scsd ;
} ;
-#endif
+#endif \ No newline at end of file
diff --git a/backends/platform/ds/arm9/source/fat/io_scsd.h b/backends/platform/ds/arm9/source/fat/io_scsd.h
index 492492f619..75115b8d62 100644
--- a/backends/platform/ds/arm9/source/fat/io_scsd.h
+++ b/backends/platform/ds/arm9/source/fat/io_scsd.h
@@ -1,12 +1,12 @@
/*
io_scsd.h by SaTa.
based on io_sccf.h
-
-
+
+
*/
/*
- io_sccf.h
+ io_sccf.h
Hardware Routines for reading a compact flash card
using the GBA Movie Player
@@ -26,4 +26,4 @@
// export interface
extern LPIO_INTERFACE SCSD_GetInterface(void) ;
-#endif // define IO_SCSD_H
+#endif // define IO_SCSD_H \ No newline at end of file
diff --git a/backends/platform/ds/arm9/source/fat/io_scsd_asm.s b/backends/platform/ds/arm9/source/fat/io_scsd_asm.s
index 390d36afeb..498cbb96c2 100644
--- a/backends/platform/ds/arm9/source/fat/io_scsd_asm.s
+++ b/backends/platform/ds/arm9/source/fat/io_scsd_asm.s
@@ -1,22 +1,22 @@
.TEXT
@--------------------------------sd data--------------------------------
.equ sd_comadd,0x9800000
-.equ sd_dataadd,0x9000000
+.equ sd_dataadd,0x9000000
.equ sd_dataradd,0x9100000
@-----------------viod sd_data_write_s(u16 *buff,u16* crc16buff)-------------------
.ALIGN
- .GLOBAL sd_data_write_s
+ .GLOBAL sd_data_write_s
.CODE 32
sd_data_write_s:
stmfd r13!,{r4-r5}
mov r5,#512
mov r2,#sd_dataadd
sd_data_write_busy:
- ldrh r3,[r2]
+ ldrh r3,[r2]
tst r3,#0x100
beq sd_data_write_busy
- ldrh r3,[r2]
+ ldrh r3,[r2]
mov r3,#0 @star bit
strh r3,[r2]
@@ -24,10 +24,10 @@ sd_data_write_loop:
ldrh r3,[r0],#2
add r3,r3,r3,lsl #20
mov r4,r3,lsl #8
- stmia r2,{r3-r4}
-
- subs r5, r5, #2
- bne sd_data_write_loop
+ stmia r2,{r3-r4}
+
+ subs r5, r5, #2
+ bne sd_data_write_loop
cmp r1,#0
movne r0,r1
@@ -38,11 +38,11 @@ sd_data_write_loop:
mov r3,#0xff @end bit
strh r3,[r2]
sd_data_write_loop2:
- ldrh r3,[r2]
+ ldrh r3,[r2]
tst r3,#0x100
bne sd_data_write_loop2
- ldmia r2,{r3-r4}
+ ldmia r2,{r3-r4}
ldmfd r13!,{r4-r5}
bx r14
@@ -50,7 +50,7 @@ sd_data_write_loop2:
@----------void sd_data_read_s(u16 *buff)-------------
.ALIGN
- .GLOBAL sd_data_read_s
+ .GLOBAL sd_data_read_s
.CODE 32
sd_data_read_s:
stmfd r13!,{r4}
@@ -61,62 +61,62 @@ sd_data_read_loop1:
bne sd_data_read_loop1
mov r2,#512
sd_data_read_loop:
- ldmia r1,{r3-r4}
+ ldmia r1,{r3-r4}
mov r3,r4,lsr #16
strh r3 ,[r0],#2
- ldmia r1,{r3-r4}
+ ldmia r1,{r3-r4}
mov r3,r4,lsr #16
strh r3 ,[r0],#2
- ldmia r1,{r3-r4}
+ ldmia r1,{r3-r4}
mov r3,r4,lsr #16
strh r3 ,[r0],#2
- ldmia r1,{r3-r4}
+ ldmia r1,{r3-r4}
mov r3,r4,lsr #16
strh r3 ,[r0],#2
- ldmia r1,{r3-r4}
+ ldmia r1,{r3-r4}
mov r3,r4,lsr #16
strh r3 ,[r0],#2
- ldmia r1,{r3-r4}
+ ldmia r1,{r3-r4}
mov r3,r4,lsr #16
strh r3 ,[r0],#2
- ldmia r1,{r3-r4}
+ ldmia r1,{r3-r4}
mov r3,r4,lsr #16
strh r3 ,[r0],#2
- ldmia r1,{r3-r4}
+ ldmia r1,{r3-r4}
mov r3,r4,lsr #16
strh r3 ,[r0],#2
- subs r2, r2, #16
- bne sd_data_read_loop
+ subs r2, r2, #16
+ bne sd_data_read_loop
ldmia r1,{r3-r4} @crc 16
- ldmia r1,{r3-r4}
- ldmia r1,{r3-r4}
- ldmia r1,{r3-r4}
+ ldmia r1,{r3-r4}
+ ldmia r1,{r3-r4}
+ ldmia r1,{r3-r4}
ldrh r3,[r1] @end bit
- ldmfd r13!,{r4}
+ ldmfd r13!,{r4}
bx r14
@----------end sd_data_read_s-------------
@------void sd_com_crc16_s(u16* buff,u16 num,u16* crc16buff)
.ALIGN
- .GLOBAL sd_crc16_s
+ .GLOBAL sd_crc16_s
.CODE 32
sd_crc16_s:
stmfd r13!,{r4-r9}
mov r9,r2
- mov r3,#0
- mov r4,#0
- mov r5,#0
- mov r6,#0
+ mov r3,#0
+ mov r4,#0
+ mov r5,#0
+ mov r6,#0
ldr r7,=0x80808080
ldr r8,=0x1021
@@ -131,19 +131,19 @@ sd_crc16_loop:
eorne r3,r3,r8
tst r2,r7,lsr #24
eorne r3,r3,r8
-
+
mov r4,r4,lsl #1
tst r4,#0x10000
eorne r4,r4,r8
tst r2,r7,lsr #25
eorne r4,r4,r8
-
+
mov r5,r5,lsl #1
tst r5,#0x10000
eorne r5,r5,r8
tst r2,r7,lsr #26
eorne r5,r5,r8
-
+
mov r6,r6,lsl #1
tst r6,#0x10000
eorne r6,r6,r8
@@ -152,7 +152,7 @@ sd_crc16_loop:
mov r7,r7,ror #4
subs r1,r1,#4
- bne sd_crc16_loop
+ bne sd_crc16_loop
mov r2,r9
mov r8,#16
@@ -184,7 +184,7 @@ sd_crc16_write_data:
@--------------u8 sd_crc7_s(u16* buff,u16 num)----------------------------
.ALIGN
- .GLOBAL sd_crc7_s
+ .GLOBAL sd_crc7_s
.CODE 32
sd_crc7_s:
stmfd r13!,{r4}
@@ -206,7 +206,7 @@ sd_crc7_loop:
mov r4,r4,ror #1
subs r1,r1,#1
- bne sd_crc7_loop
+ bne sd_crc7_loop
mov r3,r3,lsl #1
add r0,r3,#1
@@ -216,7 +216,7 @@ sd_crc7_loop:
@--------------sd_com_read_s(u16* buff,u32 num)------------------
.ALIGN
- .GLOBAL sd_com_read_s
+ .GLOBAL sd_com_read_s
.CODE 32
sd_com_read_s:
@@ -229,8 +229,8 @@ sd_com_read_loop1:
sd_com_read_loop:
ldmia r2,{r3-r6}
- subs r1, r1, #1
- bne sd_com_read_loop
+ subs r1, r1, #1
+ bne sd_com_read_loop
ldmfd r13!,{r4-r6}
bx r14
@--------------end sd_com_read_s------------------
@@ -242,14 +242,14 @@ sd_com_read_loop:
.CODE 32
sd_com_write_s:
stmfd r13!,{r4-r6}
-
+
mov r2,#sd_comadd
sd_com_write_busy:
- ldrh r3,[r2]
+ ldrh r3,[r2]
tst r3,#0x1
beq sd_com_write_busy
- ldrh r3,[r2]
+ ldrh r3,[r2]
sd_com_write_loop:
ldrb r3,[r0],#1
@@ -257,9 +257,9 @@ sd_com_write_loop:
mov r4,r3,lsl #2
mov r5,r4,lsl #2
mov r6,r5,lsl #2
- stmia r2,{r3-r6}
- subs r1, r1, #1
- bne sd_com_write_loop
+ stmia r2,{r3-r6}
+ subs r1, r1, #1
+ bne sd_com_write_loop
ldmfd r13!,{r4-r6}
bx r14
@@ -267,7 +267,7 @@ sd_com_write_loop:
@-----------------void send_clk(u32 num)---------
.ALIGN
- .GLOBAL send_clk
+ .GLOBAL send_clk
.CODE 32
send_clk:
@@ -281,7 +281,7 @@ send_clk_loop1:
@---------------------------void SDCommand(u8 command,u8 num,u32 sector)--------------------
.ALIGN
- .GLOBAL SDCommand
+ .GLOBAL SDCommand
.CODE 32
@void SDCommand(u8 command,u8 num,u32 sector )
@{
@@ -338,12 +338,12 @@ SDCommand:
@ register u16 i,j;
@ i=readnum;
@ sectno<<=9;
-@ SDCommand(18,0,sector);
+@ SDCommand(18,0,sector);
@ for (j=0;j<i ; j++)
@ {
@ sd_data_read_s((u32)buff+j*512);
@ }
-@ SDCommand(12,0,0);
+@ SDCommand(12,0,0);
@ get_resp();
@ send_clk(0x10);
@
@@ -363,7 +363,7 @@ beginforj_ReadSector:
cmp r6,r5
bge endforj_ReadSector
mov r0,r4
- add r0,r0,r6,lsl #9
+ add r0,r0,r6,lsl #9
bl sd_data_read_s
add r6,r6,#1
b beginforj_ReadSector
@@ -408,17 +408,17 @@ get_resp:
@
@ sectno<<=9;
@
-@ SDCommand(25,0,sector);
+@ SDCommand(25,0,sector);
@ get_resp();
-@ send_clk(0x10);
+@ send_clk(0x10);
@
@ for (j=0;j<i ; j++)
@ {
@ sd_crc16_s((u32)(u32)buff+j*512,512,(u32)crc16);
@ sd_data_write_s((u32)buff+j*512,(u32)crc16);
-@ send_clk(0x10);
+@ send_clk(0x10);
@ }
-@ SDCommand(12,0,0);
+@ SDCommand(12,0,0);
@ get_resp();
@ send_clk(0x10);
@ while((*(u16*)sd_dataadd &0x0100)==0);
@@ -451,7 +451,7 @@ beginforj_WriteSector:
add r2,r13,#4
bl sd_crc16_s
mov r0,r4
- add r0,r0,r6,lsl #9
+ add r0,r0,r6,lsl #9
add r1,r13,#4
bl sd_data_write_s
mov r0,#0x10
@@ -481,7 +481,7 @@ beginwhile_WriteSector:
.GLOBAL InitSCMode
.CODE 32
InitSCMode:
- mvn r0,#0x0F6000000
+ mvn r0,#0x0F6000000
sub r0,r0,#0x01
mov r1,#0x0A500
add r1,r1,#0x5A
diff --git a/backends/platform/ds/arm9/source/fat/io_sd_common.c b/backends/platform/ds/arm9/source/fat/io_sd_common.c
index 36d4a3bfc8..0a38e6277c 100644
--- a/backends/platform/ds/arm9/source/fat/io_sd_common.c
+++ b/backends/platform/ds/arm9/source/fat/io_sd_common.c
@@ -5,10 +5,10 @@
Common SD card routines
- SD routines partially based on sd.s by Romman
+ SD routines partially based on sd.s by Romman
Copyright (c) 2006 Michael "Chishm" Chisholm
-
+
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
@@ -29,7 +29,7 @@
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
+
2006-08-07 - Chishm
* Moved the SD initialization to a common function
* Increased timeouts for slower cards
@@ -61,10 +61,10 @@ u8 _SD_CRC7(u8* data, int cnt) {
}
crc = (crc << 1) | 1;
return(crc);
-}
+}
/*
-Calculates the CRC16 for a sector of data. Calculates it
+Calculates the CRC16 for a sector of data. Calculates it
as 4 separate lots, merged into one buffer. This is used
for 4 SD data lines, not for 1 data line alone.
*/
@@ -79,53 +79,53 @@ void _SD_CRC16 (u8* buff, int buffLength, u8* crc16buff) {
b = 0; // r4
c = 0; // r5
d = 0; // r6
-
+
buffLength = buffLength * 8;
-
-
+
+
do {
if (bitPattern & 0x80) dataByte = *buff++;
-
+
a = a << 1;
if ( a & 0x10000) a ^= crcConst;
if (dataByte & (bitPattern >> 24)) a ^= crcConst;
-
+
b = b << 1;
if (b & 0x10000) b ^= crcConst;
if (dataByte & (bitPattern >> 25)) b ^= crcConst;
-
+
c = c << 1;
if (c & 0x10000) c ^= crcConst;
if (dataByte & (bitPattern >> 26)) c ^= crcConst;
-
+
d = d << 1;
if (d & 0x10000) d ^= crcConst;
if (dataByte & (bitPattern >> 27)) d ^= crcConst;
-
+
bitPattern = (bitPattern >> 4) | (bitPattern << 28);
} while (buffLength-=4);
-
+
count = 16; // r8
-
+
do {
bitPattern = bitPattern << 4;
if (a & 0x8000) bitPattern |= 8;
if (b & 0x8000) bitPattern |= 4;
if (c & 0x8000) bitPattern |= 2;
if (d & 0x8000) bitPattern |= 1;
-
+
a = a << 1;
b = b << 1;
c = c << 1;
d = d << 1;
-
+
count--;
-
+
if (!(count & 0x01)) {
*crc16buff++ = (u8)(bitPattern & 0xff);
}
} while (count != 0);
-
+
return;
}
@@ -136,20 +136,20 @@ cmd_17byte_response: a pointer to a function that sends the SD card a command an
use4bitBus: initialise card to use a 4 bit data bus when communicating with the card
RCA: a pointer to the location to store the card's Relative Card Address, preshifted up by 16 bits.
*/
-bool _SD_InitCard (_SD_FN_CMD_6BYTE_RESPONSE cmd_6byte_response,
+bool _SD_InitCard (_SD_FN_CMD_6BYTE_RESPONSE cmd_6byte_response,
_SD_FN_CMD_17BYTE_RESPONSE cmd_17byte_response,
bool use4bitBus,
u32 *RCA)
{
u8 responseBuffer[17] = {0};
int i;
-
+
for (i = 0; i < MAX_STARTUP_TRIES ; i++) {
cmd_6byte_response (responseBuffer, APP_CMD, 0);
- if (
+ if (
cmd_6byte_response (responseBuffer, SD_APP_OP_COND, SD_OCR_VALUE) &&
((responseBuffer[1] & 0x80) != 0))
- {
+ {
// Card is ready to receive commands now
break;
}
@@ -157,10 +157,10 @@ bool _SD_InitCard (_SD_FN_CMD_6BYTE_RESPONSE cmd_6byte_response,
if (i >= MAX_STARTUP_TRIES) {
return false;
}
-
+
// The card's name, as assigned by the manufacturer
cmd_17byte_response (responseBuffer, ALL_SEND_CID, 0);
-
+
// Get a new address
for (i = 0; i < MAX_STARTUP_TRIES ; i++) {
cmd_6byte_response (responseBuffer, SEND_RELATIVE_ADDR, 0);
@@ -169,16 +169,16 @@ bool _SD_InitCard (_SD_FN_CMD_6BYTE_RESPONSE cmd_6byte_response,
break;
}
}
- if (i >= MAX_STARTUP_TRIES) {
+ if (i >= MAX_STARTUP_TRIES) {
return false;
}
// Some cards won't go to higher speeds unless they think you checked their capabilities
cmd_17byte_response (responseBuffer, SEND_CSD, *RCA);
-
+
// Only this card should respond to all future commands
cmd_6byte_response (responseBuffer, SELECT_CARD, *RCA);
-
+
if (use4bitBus) {
// Set a 4 bit data bus
cmd_6byte_response (responseBuffer, APP_CMD, *RCA);
@@ -187,7 +187,7 @@ bool _SD_InitCard (_SD_FN_CMD_6BYTE_RESPONSE cmd_6byte_response,
// Use 512 byte blocks
cmd_6byte_response (responseBuffer, SET_BLOCKLEN, 512); // 512 byte blocks
-
+
// Wait until card is ready for data
i = 0;
do {
@@ -196,7 +196,7 @@ bool _SD_InitCard (_SD_FN_CMD_6BYTE_RESPONSE cmd_6byte_response,
}
i++;
} while (!cmd_6byte_response (responseBuffer, SEND_STATUS, *RCA) && ((responseBuffer[3] & 0x1f) != ((SD_STATE_TRAN << 1) | READY_FOR_DATA)));
-
+
return true;
}
diff --git a/backends/platform/ds/arm9/source/fat/io_sd_common.h b/backends/platform/ds/arm9/source/fat/io_sd_common.h
index 8962d88890..09abffab39 100644
--- a/backends/platform/ds/arm9/source/fat/io_sd_common.h
+++ b/backends/platform/ds/arm9/source/fat/io_sd_common.h
@@ -8,7 +8,7 @@
SD routines partially based on sd.s by Romman
Copyright (c) 2006 Michael "Chishm" Chisholm
-
+
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
@@ -32,7 +32,7 @@
2006-07-11 - Chishm
* Original release
-
+
2006-07-28 - Chishm
* Changed voltage range that the SD card can use
*/
@@ -76,7 +76,7 @@
#define SD_STATE_IDENT 2 // Identification state, after ALL_SEND_CID
#define SD_STATE_STBY 3 // Standby state, when card is deselected
#define SD_STATE_TRAN 4 // Transfer state, after card is selected and ready for data transfer
-#define SD_STATE_DATA 5 //
+#define SD_STATE_DATA 5 //
#define SD_STATE_RCV 6 // Receive data state
#define SD_STATE_PRG 7 // Programming state
#define SD_STATE_DIS 8 // Disconnect state
@@ -85,7 +85,7 @@
#define READY_FOR_DATA 1 // bit 8 in card status
/*
-Calculate the CRC7 of a command and return it preshifted with
+Calculate the CRC7 of a command and return it preshifted with
an end bit added
*/
extern u8 _SD_CRC7(u8* data, int size);
@@ -106,7 +106,7 @@ cmd_17byte_response: a pointer to a function that sends the SD card a command an
use4bitBus: initialise card to use a 4 bit data bus when communicating with the card
RCA: a pointer to the location to store the card's Relative Card Address, preshifted up by 16 bits.
*/
-extern bool _SD_InitCard (_SD_FN_CMD_6BYTE_RESPONSE cmd_6byte_response,
+extern bool _SD_InitCard (_SD_FN_CMD_6BYTE_RESPONSE cmd_6byte_response,
_SD_FN_CMD_17BYTE_RESPONSE cmd_17byte_response,
bool use4bitBus,
u32 *RCA);
diff --git a/backends/platform/ds/arm9/source/gbampsave.cpp b/backends/platform/ds/arm9/source/gbampsave.cpp
index fbe0c69944..9c8af81a6e 100644
--- a/backends/platform/ds/arm9/source/gbampsave.cpp
+++ b/backends/platform/ds/arm9/source/gbampsave.cpp
@@ -21,8 +21,9 @@
*/
#include "gbampsave.h"
-#include "gba_nds_fat.h"
-#include "ds-fs.h"
+#include "fat/gba_nds_fat.h"
+#include "backends/fs/ds/ds-fs.h"
+#include "common/config-manager.h"
/////////////////////////
// GBAMP Save File
@@ -30,7 +31,7 @@
GBAMPSaveFile::GBAMPSaveFile(char* name, bool saveOrLoad) {
handle = DS::std_fopen(name, saveOrLoad? "w": "r");
- consolePrintf("%s handle is %d\n", name, handle);
+// consolePrintf("%s handle is %d\n", name, handle);
// consolePrintf("Created %s\n", name);
bufferPos = 0;
saveSize = 0;
@@ -92,40 +93,40 @@ uint32 GBAMPSaveFile::write(const void *buf, uint32 size) {
memcpy(buffer + bufferPos, buf, size);
bufferPos += size;
-
+
saveSize += size;
/* int pos = 0;
-
+
int rest = SAVE_BUFFER_SIZE - bufferPos;
memcpy(buffer + bufferPos, buf, rest);
bufferPos = 512;
pos += rest;
- flushSaveBuffer();
+ flushSaveBuffer();
size -= rest;
// consolePrintf("First section: %d\n", rest);
-
+
while (size >= 512) {
DS::std_fwrite(((char *) (buf)) + pos, 1, 512, handle);
size -= 512;
pos += 512;
// consolePrintf("Full chunk, %d left ", size);
}
-
+
bufferPos = 0;
memcpy(buffer + bufferPos, ((char *) (buf)) + pos, size);
bufferPos += size;
// consolePrintf("%d left in buffer ", bufferPos);*/
-
+
} else {
-
+
memcpy(buffer + bufferPos, buf, size);
bufferPos += size;
-
+
saveSize += size;
}
-
+
// if ((size > 100) || (size <= 0)) consolePrintf("Write %d bytes\n", size);
return size;
}
@@ -145,41 +146,62 @@ GBAMPSaveFileManager::~GBAMPSaveFileManager() {
GBAMPSaveFile* GBAMPSaveFileManager::openSavefile(char const* name, bool saveOrLoad) {
char fileSpec[128];
-
+
strcpy(fileSpec, getSavePath());
-
+
if (fileSpec[strlen(fileSpec) - 1] == '/') {
sprintf(fileSpec, "%s%s", getSavePath(), name);
} else {
sprintf(fileSpec, "%s/%s", getSavePath(), name);
}
-
+
// consolePrintf(fileSpec);
GBAMPSaveFile* sf = new GBAMPSaveFile(fileSpec, saveOrLoad);
if (sf->isOpen()) {
- return sf;
+ return sf;
} else {
delete sf;
- return NULL;
+ return NULL;
+ }
+}
+
+// This method copied from an old version of the savefile.cpp, since it's been removed from there and
+// placed in default-saves.cpp, where I cannot call it.
+const char *GBAMPSaveFileManager::getSavePath() const {
+ const char *dir = NULL;
+
+ // Try to use game specific savepath from config
+ dir = ConfMan.get("savepath").c_str();
+
+ // Work around a bug (#999122) in the original 0.6.1 release of
+ // ScummVM, which would insert a bad savepath value into config files.
+ if (0 == strcmp(dir, "None")) {
+ ConfMan.removeKey("savepath", ConfMan.getActiveDomainName());
+ ConfMan.flushToDisk();
+ dir = ConfMan.get("savepath").c_str();
}
+
+
+ assert(dir);
+
+ return dir;
}
-Common::StringList GBAMPSaveFileManager::listSavefiles(const char *pattern) {
+Common::StringList GBAMPSaveFileManager::listSavefiles(const char *pattern) {
enum { TYPE_NO_MORE = 0, TYPE_FILE = 1, TYPE_DIR = 2 };
char name[256];
-
- DS::std_cwd((char *) getSavePath());
+
+ DS::std_cwd((char*)getSavePath()); //TODO : Check this suspicious const-cast
// consolePrintf("Save path: '%s', pattern: '%s'\n", getSavePath(),pattern);
-
+
int fileType = FAT_FindFirstFileLFN(name);
Common::StringList list;
-
do {
-
+
if (fileType == TYPE_FILE) {
FAT_GetLongFilename(name);
@@ -187,18 +209,18 @@ Common::StringList GBAMPSaveFileManager::listSavefiles(const char *pattern) {
for (int r = 0; r < strlen(name); r++) {
name[r] = tolower(name[r]);
}
-
-
+
+
if (Common::matchString(name, pattern)) {
list.push_back(name);
}
}
} while ((fileType = FAT_FindNextFileLFN(name)));
-
+
FAT_chdir("/");
return list;
-}
+}
diff --git a/backends/platform/ds/arm9/source/gbampsave.h b/backends/platform/ds/arm9/source/gbampsave.h
index 40dcde0b26..d0cbc68bfd 100644
--- a/backends/platform/ds/arm9/source/gbampsave.h
+++ b/backends/platform/ds/arm9/source/gbampsave.h
@@ -19,13 +19,12 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
-
+
#ifndef _GBAMPSAVE_H_
#define _GBAMPSAVE_H_
-#include "system.h"
-#include "saves/default/default-saves.h"
-#include "ds-fs.h"
+#include "common/system.h"
+#include "backends/fs/ds/ds-fs.h"
#define SAVE_BUFFER_SIZE 100000
@@ -39,42 +38,44 @@ class GBAMPSaveFile : public Common::InSaveFile, public Common::OutSaveFile {
public:
GBAMPSaveFile(char* name, bool saveOrLoad);
virtual ~GBAMPSaveFile();
-
+
virtual uint32 read(void *buf, uint32 size);
virtual uint32 write(const void *buf, uint32 size);
-
+
virtual bool eos() const;
virtual void skip(uint32 bytes);
virtual uint32 pos() const;
virtual uint32 size() const;
virtual void seek(int32 pos, int whence);
-
+
void flushSaveBuffer();
-
+
virtual bool isOpen() const {
return handle != 0;
}
};
-class GBAMPSaveFileManager : public DefaultSaveFileManager {
+class GBAMPSaveFileManager : public Common::SaveFileManager {
public:
GBAMPSaveFileManager();
~GBAMPSaveFileManager();
-
+
// static GBAMPSaveFileManager* instance() { return instancePtr; }
GBAMPSaveFile *openSavefile(const char *filename, bool saveOrLoad);
-
+
virtual Common::OutSaveFile* openForSaving(const char* filename) { return openSavefile(filename, true); }
virtual Common::InSaveFile* openForLoading(const char* filename) { return openSavefile(filename, false); }
-
+
virtual bool removeSavefile(const char *filename) { return false; } // TODO: Implement this
virtual Common::StringList listSavefiles(const char *pattern);
-
+
void deleteFile(char* name);
void listFiles();
+
+ const char *getSavePath() const;
};
#endif
diff --git a/backends/platform/ds/arm9/source/keys.cpp b/backends/platform/ds/arm9/source/keys.cpp
index 8bfc983565..dcec2287b9 100644
--- a/backends/platform/ds/arm9/source/keys.cpp
+++ b/backends/platform/ds/arm9/source/keys.cpp
@@ -27,26 +27,26 @@
$Log: keys.c,v $
Revision 1.13 2006/01/12 09:10:47 wntrmute
Added key repeat as suggested by pepsiman
-
+
Revision 1.12 2005/11/27 12:30:25 wntrmute
reverted to correct hardware REGisters
-
+
Revision 1.11 2005/11/27 07:48:45 joatski
Renamed REG_KEYINPUT and REG_KEYCNT back to KEYS and KEYS_CR, as the alternatives are defined in registers_alt.h.
Changed function returns to uint32
-
+
Revision 1.10 2005/11/03 23:38:49 wntrmute
don't use enum for key function returns
-
+
Revision 1.9 2005/10/13 16:30:11 dovoto
Changed KEYPAD_BITS to a typedef enum, this resolved some issues with multiple redefinition of KEYPAD_BITS (although this error did not allways occur).
-
+
Revision 1.8 2005/10/03 21:21:59 wntrmute
use enum types
-
+
Revision 1.7 2005/09/07 18:06:27 wntrmute
use new register names
-
+
Revision 1.6 2005/08/23 17:06:10 wntrmute
converted all endings to unix
@@ -148,4 +148,4 @@ uint32 keysUp(void) {
}
-} // namespace ds
+} // namespace ds \ No newline at end of file
diff --git a/backends/platform/ds/arm9/source/mad/readme.txt b/backends/platform/ds/arm9/source/mad/readme.txt
index 09a2ec07df..c911ab9271 100644
--- a/backends/platform/ds/arm9/source/mad/readme.txt
+++ b/backends/platform/ds/arm9/source/mad/readme.txt
@@ -1,2 +1 @@
Put mad.h here if you are compiling with Madlib support enabled.
-Put mad.h here if you are compiling with Madlib support enabled. \ No newline at end of file
diff --git a/backends/platform/ds/arm9/source/osystem_ds.cpp b/backends/platform/ds/arm9/source/osystem_ds.cpp
index 2044448923..6e6b457115 100644
--- a/backends/platform/ds/arm9/source/osystem_ds.cpp
+++ b/backends/platform/ds/arm9/source/osystem_ds.cpp
@@ -22,7 +22,6 @@
#include "common/scummsys.h"
#include "common/system.h"
-#include "system.h"
#include "common/util.h"
#include "common/rect.h"
@@ -32,11 +31,12 @@
#include "nds.h"
#include "dsmain.h"
#include "nds/registers_alt.h"
-#include "config-manager.h"
+#include "common/config-manager.h"
#include "common/str.h"
#include "cdaudio.h"
#include "graphics/surface.h"
#include "touchkeyboard.h"
+#include "backends/fs/ds/ds-fs-factory.h"
OSystem_DS* OSystem_DS::_instance = NULL;
@@ -57,13 +57,12 @@ OSystem_DS::~OSystem_DS() {
delete _timer;
}
-int OSystem_DS::timerHandler(int t)
-{
+int OSystem_DS::timerHandler(int t) {
DSTimerManager *tm = (DSTimerManager *)g_system->getTimerManager();
tm->handler();
return t;
}
-
+
void OSystem_DS::initBackend() {
ConfMan.setInt("autosave_period", 0);
ConfMan.setBool("FM_medium_quality", true);
@@ -72,7 +71,7 @@ void OSystem_DS::initBackend() {
_timer = new DSTimerManager;
DS::setSoundProc(Audio::Mixer::mixCallback, _mixer);
DS::setTimerCallback(&OSystem_DS::timerHandler, 10);
-
+
OSystem::initBackend();
}
@@ -135,20 +134,20 @@ void OSystem_DS::setPalette(const byte *colors, uint start, uint num) {
int red = *colors;
int green = *(colors + 1);
int blue = *(colors + 2);
-
+
red >>= 3;
green >>= 3;
blue >>= 3;
-
+
// if (r != 255)
- {
+ {
BG_PALETTE[r] = red | (green << 5) | (blue << 10);
if (!DS::getKeyboardEnable()) {
BG_PALETTE_SUB[r] = red | (green << 5) | (blue << 10);
}
}
// if (num == 16) consolePrintf("pal:%d r:%d g:%d b:%d\n", r, red, green, blue);
-
+
colors += 4;
}
}
@@ -157,7 +156,7 @@ bool OSystem_DS::grabRawScreen(Graphics::Surface* surf) {
surf->create(DS::getGameWidth(), DS::getGameHeight(), 1);
// Ensure we copy using 16 bit quantities due to limitation of VRAM addressing
-
+
u16* image = (u16 *) DS::get8BitBackBuffer();
for (int y = 0; y < DS::getGameHeight(); y++)
@@ -174,7 +173,7 @@ bool OSystem_DS::grabRawScreen(Graphics::Surface* surf) {
void OSystem_DS::grabPalette(unsigned char *colors, uint start, uint num) {
// consolePrintf("Grabpalette");
-
+
for (unsigned int r = start; r < start + num; r++) {
*colors++ = (BG_PALETTE[r] & 0x001F) << 3;
*colors++ = (BG_PALETTE[r] & 0x03E0) >> 5 << 3;
@@ -183,64 +182,69 @@ void OSystem_DS::grabPalette(unsigned char *colors, uint start, uint num) {
}
-void OSystem_DS::copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h)
-{
+void OSystem_DS::copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h) {
// consolePrintf("Copy rect %d, %d %d, %d ", x, y, w, h);
-
+
if (w <= 1) return;
if (h < 0) return;
if (!DS::getIsDisplayMode8Bit()) return;
-
+
+ u16* bg;
+ s32 stride;
u16* bgSub = (u16 *) BG_GFX_SUB;
- u16* bg = (u16 *) DS::get8BitBackBuffer();
- u16* src = (u16 *) buf;
- if (DS::getKeyboardEnable()) {
+ if (_frameBufferExists) {
+ bg = (u16 *) _framebuffer.pixels;
+ stride = _framebuffer.pitch;
+ } else {
+ bg = (u16 *) DS::get8BitBackBuffer();
+ stride = DS::get8BitBackBufferStride();
+ }
+ u16* src = (u16 *) buf;
+
+ if (DS::getKeyboardEnable()) {
+
for (int dy = y; dy < y + h; dy++) {
- u16* dest = bg + (dy << 8) + (x >> 1);
-
+ u16* dest = bg + (dy * (stride >> 1)) + (x >> 1);
+
DC_FlushRange(src, w << 1);
DC_FlushRange(dest, w << 1);
dmaCopyHalfWords(3, src, dest, w);
-
+
src += pitch >> 1;
}
-
+
} else {
for (int dy = y; dy < y + h; dy++) {
- u16* dest1 = bg + (dy << 8) + (x >> 1);
+ u16* dest1 = bg + (dy * (stride >> 1)) + (x >> 1);
u16* dest2 = bgSub + (dy << 8) + (x >> 1);
-
+
DC_FlushRange(src, w << 1);
DC_FlushRange(dest1, w << 1);
DC_FlushRange(dest2, w << 1);
-
+
dmaCopyHalfWords(3, src, dest1, w);
dmaCopyHalfWords(3, src, dest2, w);
-
+
src += pitch >> 1;
}
}
-
+
// consolePrintf("Done\n");
-
-
-
+
+
+
}
-void OSystem_DS::updateScreen()
-{
+void OSystem_DS::updateScreen() {
- if (_frameBufferExists)
+ if ((_frameBufferExists) && (DS::getIsDisplayMode8Bit()))
{
+ _frameBufferExists = false;
+
// Copy temp framebuffer back to screen
copyRectToScreen((byte *)_framebuffer.pixels, _framebuffer.pitch, 0, 0, _framebuffer.w, _framebuffer.h);
-
- // Free memory
- _framebuffer.free();
-
- _frameBufferExists = false;
}
DS::displayMode16BitFlipBuffer();
@@ -253,87 +257,78 @@ void OSystem_DS::setShakePos(int shakeOffset) {
DS::setShakePos(shakeOffset);
}
-void OSystem_DS::showOverlay ()
-{
+void OSystem_DS::showOverlay () {
// consolePrintf("showovl\n");
DS::displayMode16Bit();
}
-void OSystem_DS::hideOverlay ()
-{
+void OSystem_DS::hideOverlay () {
DS::displayMode8Bit();
}
-void OSystem_DS::clearOverlay ()
-{
+void OSystem_DS::clearOverlay () {
memset((u16 *) DS::get16BitBackBuffer(), 0, 512 * 256 * 2);
// consolePrintf("clearovl\n");
}
-void OSystem_DS::grabOverlay (OverlayColor *buf, int pitch)
-{
+void OSystem_DS::grabOverlay (OverlayColor *buf, int pitch) {
// consolePrintf("grabovl\n");
}
-void OSystem_DS::copyRectToOverlay (const OverlayColor *buf, int pitch, int x, int y, int w, int h)
-{
+void OSystem_DS::copyRectToOverlay (const OverlayColor *buf, int pitch, int x, int y, int w, int h) {
u16* bg = (u16 *) DS::get16BitBackBuffer();
u16* src = (u16 *) buf;
-
+
// if (x + w > 256) w = 256 - x;
//if (x + h > 256) h = 256 - y;
// consolePrintf("Copy rect ovl %d, %d %d, %d %d\n", x, y, w, h, pitch);
-
-
+
+
for (int dy = y; dy < y + h; dy++) {
-
-
+
+
// Slow but save copy:
for (int dx = x; dx < x + w; dx++) {
-
+
*(bg + (dy * 512) + dx) = *src;
//if ((*src) != 0) consolePrintf("%d,%d: %d ", dx, dy, *src);
//consolePrintf("%d,", *src);
src++;
}
src += (pitch - w);
-
+
// Fast but broken copy: (why?)
/*
REG_IME = 0;
dmaCopy(src, bg + (dy << 9) + x, w * 2);
REG_IME = 1;
-
+
src += pitch;*/
}
-
+
// consolePrintf("Copy rect ovl done");
}
-int16 OSystem_DS::getOverlayHeight()
-{
+int16 OSystem_DS::getOverlayHeight() {
// consolePrintf("getovlheight\n");
return getHeight();
}
-int16 OSystem_DS::getOverlayWidth()
-{
+int16 OSystem_DS::getOverlayWidth() {
// consolePrintf("getovlwid\n");
return getWidth();
}
-
-bool OSystem_DS::showMouse(bool visible)
-{
+
+bool OSystem_DS::showMouse(bool visible) {
DS::setShowCursor(visible);
return true;
}
-void OSystem_DS::warpMouse(int x, int y)
-{
+void OSystem_DS::warpMouse(int x, int y) {
}
void OSystem_DS::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor, int targetCursorScale) {
@@ -344,8 +339,7 @@ void OSystem_DS::addEvent(Common::Event& e) {
eventQueue[queuePos++] = e;
}
-bool OSystem_DS::pollEvent(Common::Event &event)
-{
+bool OSystem_DS::pollEvent(Common::Event &event) {
if (lastPenFrame != DS::getMillis()) {
@@ -366,7 +360,7 @@ bool OSystem_DS::pollEvent(Common::Event &event)
return true;
}
}
-
+
return false;
/* if (lastPenFrame != DS::getMillis()) {
@@ -379,7 +373,7 @@ bool OSystem_DS::pollEvent(Common::Event &event)
if (eventNum == 1) {
eventNum = 0;
lastPenFrame = DS::getMillis();
- if (DS::getPenDown()) {
+ if (DS::getPenDown()) {
event.type = Common::EVENT_LBUTTONDOWN;
event.mouse = Common::Point(DS::getPenX(), DS::getPenY());
consolePrintf("Down %d, %d ", event.mouse.x, event.mouse.y);
@@ -398,47 +392,49 @@ bool OSystem_DS::pollEvent(Common::Event &event)
return false;
}
-uint32 OSystem_DS::getMillis()
-{
+uint32 OSystem_DS::getMillis() {
return DS::getMillis();
}
-void OSystem_DS::delayMillis(uint msecs)
-{
+void OSystem_DS::delayMillis(uint msecs) {
int st = getMillis();
DS::addEventsToQueue();
DS::CD::update();
-
+
DS::doSoundCallback();
while (st + msecs >= getMillis()) {
DS::doSoundCallback();
}
-
+
DS::doTimerCallback();
DS::checkSleepMode();
DS::addEventsToQueue();
}
-OSystem::MutexRef OSystem_DS::createMutex(void)
-{
+void OSystem_DS::getTimeAndDate(struct tm &t) const {
+ time_t curTime = time(0);
+ t = *localtime(&curTime);
+}
+
+FilesystemFactory *OSystem_DS::getFilesystemFactory() {
+ return &DSFilesystemFactory::instance();
+}
+
+OSystem::MutexRef OSystem_DS::createMutex(void) {
return NULL;
}
-void OSystem_DS::lockMutex(MutexRef mutex)
-{
+void OSystem_DS::lockMutex(MutexRef mutex) {
}
-void OSystem_DS::unlockMutex(MutexRef mutex)
-{
+void OSystem_DS::unlockMutex(MutexRef mutex) {
}
-void OSystem_DS::deleteMutex(MutexRef mutex)
-{
+void OSystem_DS::deleteMutex(MutexRef mutex) {
}
-void OSystem_DS::clearSoundCallback()
-{
- consolePrintf("Clearing sound callback");
+void OSystem_DS::clearSoundCallback() {
+// consolePrintf("Clearing sound callback");
// DS::setSoundProc(NULL, NULL);
}
@@ -447,23 +443,19 @@ int OSystem_DS::getOutputSampleRate() const
return DS::getSoundFrequency();
}
-bool OSystem_DS::openCD(int drive)
-{
+bool OSystem_DS::openCD(int drive) {
return DS::CD::checkCD();
}
-bool OSystem_DS::pollCD()
-{
+bool OSystem_DS::pollCD() {
return DS::CD::isPlaying();
}
-void OSystem_DS::playCD(int track, int num_loops, int start_frame, int duration)
-{
+void OSystem_DS::playCD(int track, int num_loops, int start_frame, int duration) {
DS::CD::playTrack(track, num_loops, start_frame, duration);
}
-void OSystem_DS::stopCD()
-{
+void OSystem_DS::stopCD() {
DS::CD::stopTrack();
}
@@ -471,26 +463,22 @@ void OSystem_DS::updateCD()
{
}
-void OSystem_DS::quit()
-{
+void OSystem_DS::quit() {
/* consolePrintf("Soft resetting...");
IPC->reset = 1;
REG_IE = 0;
-
+
asm("swi 0x26\n");
swiSoftReset();*/
}
-void OSystem_DS::setWindowCaption(const char *caption)
-{
+void OSystem_DS::setWindowCaption(const char *caption) {
}
-void OSystem_DS::displayMessageOnOSD(const char *msg)
-{
+void OSystem_DS::displayMessageOnOSD(const char *msg) {
}
-Common::SaveFileManager* OSystem_DS::getSavefileManager()
-{
+Common::SaveFileManager* OSystem_DS::getSavefileManager() {
bool forceSram;
if (ConfMan.hasKey("forcesramsave", "ds")) {
@@ -498,10 +486,10 @@ Common::SaveFileManager* OSystem_DS::getSavefileManager()
} else {
forceSram = false;
}
- if (forceSram) {
+ if (forceSram) {
consolePrintf("Using SRAM save method!\n");
}
-
+
if (DS::isGBAMPAvailable() && (!forceSram)) {
return &mpSaveManager;
} else {
@@ -511,28 +499,64 @@ Common::SaveFileManager* OSystem_DS::getSavefileManager()
Graphics::Surface* OSystem_DS::createTempFrameBuffer() {
- // For now, we create a full temporary screen surface, to which we copy the
- // the screen content. Later unlockScreen will copy everything back.
- // Not very nice nor efficient, but at least works, and is not worse
- // than in the bad old times where we used grabRawScreen + copyRectToScreen.
-// consolePrintf("lockScreen()\n");
- _framebuffer.create(DS::getGameWidth(), DS::getGameHeight(), 1);
// Ensure we copy using 16 bit quantities due to limitation of VRAM addressing
- size_t imageStrideInBytes = DS::isCpuScalerEnabled()? DS::getGameWidth() : 512;
+ // If the scaler is enabled, we can just return the 8 bit back buffer, since it's in system memory
+ // memory anyway. Otherwise, we need to copy the back buffer into the memory normally used by the scaler buffer and
+ // then return it.
+ // We must make sure that once the frame buffer is created, future calls to copyRectToScreen() copy to this buffer
+
+ if (DS::isCpuScalerEnabled()) {
+
+ _framebuffer.pixels = DS::getScalerBuffer();
+ _framebuffer.w = DS::getGameWidth();
+ _framebuffer.h = DS::getGameHeight();
+ _framebuffer.pitch = DS::getGameWidth();
+ _framebuffer.bytesPerPixel = 1;
+
+
+ } else {
+
+ s32 height = DS::getGameHeight();
+ s32 width = DS::getGameWidth();
+ s32 stride = DS::get8BitBackBufferStride();
+
+ u16* src = DS::get8BitBackBuffer();
+ u16* dest = DS::getScalerBuffer();
+
+ for (int y = 0; y < height; y++) {
+
+ u16* destLine = dest + (y * (width / 2));
+ u16* srcLine = src + (y * (stride / 2));
+
+ DC_FlushRange(srcLine, width);
+
+ dmaCopyHalfWords(3, srcLine, destLine, width);
+ }
+
+ _framebuffer.pixels = dest;
+ _framebuffer.w = width;
+ _framebuffer.h = height;
+ _framebuffer.pitch = width;
+ _framebuffer.bytesPerPixel = 1;
+
+ }
+
+ _frameBufferExists = true;
+
+/*
+ size_t imageStrideInBytes = DS::get8BitBackBufferStride();
size_t imageStrideInWords = imageStrideInBytes / 2;
u16* image = (u16 *) DS::get8BitBackBuffer();
for (int y = 0; y < DS::getGameHeight(); y++) {
DC_FlushRange(image + (y * imageStrideInWords), DS::getGameWidth());
for (int x = 0; x < DS::getGameWidth() >> 1; x++) {
- *(((u16 *) (_framebuffer.pixels)) + y * (DS::getGameWidth() >> 1) + x) = image[(y << 8) + x];
+ *(((u16 *) (_framebuffer.pixels)) + y * (DS::getGameWidth() >> 1) + x) = image[(y * imageStrideInWords) + x];
// *(((u16 *) (surf->pixels)) + y * (DS::getGameWidth() >> 1) + x) = image[y * imageStrideInWords + x];
}
- }
-// consolePrintf("lockScreen() done\n");
- _frameBufferExists = true;
+ }*/
return &_framebuffer;
}
@@ -547,15 +571,7 @@ Graphics::Surface *OSystem_DS::lockScreen() {
}
void OSystem_DS::unlockScreen() {
-
-// consolePrintf("unlockScreen()\n");
-
- // Copy temp framebuffer back to screen
-// copyRectToScreen((byte *)_framebuffer.pixels, _framebuffer.pitch, 0, 0, _framebuffer.w, _framebuffer.h);
-
- // Free memory
-// _framebuffer.free();
-// consolePrintf("unlockScreen() done\n");
+ // No need to do anything here. The screen will be updated in updateScreen().
}
void OSystem_DS::setFocusRectangle(const Common::Rect& rect) {
diff --git a/backends/platform/ds/arm9/source/osystem_ds.h b/backends/platform/ds/arm9/source/osystem_ds.h
index 9d6454d02d..246797188f 100644
--- a/backends/platform/ds/arm9/source/osystem_ds.h
+++ b/backends/platform/ds/arm9/source/osystem_ds.h
@@ -19,8 +19,8 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
-
-
+
+
#ifndef _OSYSTEM_DS_H_
#define _OSYSTEM_DS_H_
#include "common/system.h"
@@ -33,10 +33,10 @@
#include "sound/mixer.h"
#include "graphics/surface.h"
-class DSAudioMixer : public Audio::Mixer {
+class DSAudioMixer : public Audio::Mixer {
};
-class DSTimerManager : public DefaultTimerManager {
+class DSTimerManager : public DefaultTimerManager {
};
@@ -45,10 +45,10 @@ protected:
int eventNum;
int lastPenFrame;
-
+
Common::Event eventQueue[96];
int queuePos;
-
+
DSSaveFileManager saveManager;
GBAMPSaveFileManager mpSaveManager;
DSAudioMixer* _mixer;
@@ -58,7 +58,7 @@ protected:
static OSystem_DS* _instance;
-
+
Graphics::Surface* createTempFrameBuffer();
public:
@@ -98,7 +98,7 @@ public:
inline virtual OverlayColor RGBToColor(uint8 r, uint8 g, uint8 b);
inline virtual void colorToRGB(OverlayColor color, uint8 &r, uint8 &g, uint8 &b);
-
+
virtual bool showMouse(bool visible);
virtual void warpMouse(int x, int y);
@@ -107,6 +107,7 @@ public:
virtual bool pollEvent(Common::Event &event);
virtual uint32 getMillis();
virtual void delayMillis(uint msecs);
+ virtual void getTimeAndDate(struct tm &t) const;
virtual MutexRef createMutex(void);
virtual void lockMutex(MutexRef mutex);
@@ -130,21 +131,21 @@ public:
virtual void displayMessageOnOSD(const char *msg);
virtual Common::SaveFileManager *getSavefileManager();
-
+
void addEvent(Common::Event& e);
bool isEventQueueEmpty() { return queuePos == 0; }
-
+
virtual bool grabRawScreen(Graphics::Surface* surf);
-
+
virtual void setFocusRectangle(const Common::Rect& rect);
-
+
virtual void clearFocusRectangle();
-
+
virtual void initBackend();
-
+
virtual Graphics::Surface *lockScreen();
virtual void unlockScreen();
-
+
virtual Audio::Mixer* getMixer() { return _mixer; }
virtual Common::TimerManager* getTimerManager() { return _timer; }
static int timerHandler(int t);
@@ -154,8 +155,7 @@ public:
virtual void clearAutoComplete();
virtual void setCharactersEntered(int count);
-
-
+ FilesystemFactory *getFilesystemFactory();
};
static const OSystem::GraphicsMode s_supportedGraphicsModes[] = {
diff --git a/backends/platform/ds/arm9/source/portdefs.cpp b/backends/platform/ds/arm9/source/portdefs.cpp
index 075d24d909..74a41faca0 100644
--- a/backends/platform/ds/arm9/source/portdefs.cpp
+++ b/backends/platform/ds/arm9/source/portdefs.cpp
@@ -37,7 +37,6 @@ extern "C" time_t __wrap_time(time_t* t) {
time_t DS_time(time_t) {
- consolePrintf("Time!");
if (OSystem_DS::instance()) {
return 0xABCD1234 + (OSystem_DS::instance()->getMillis() / 1000);
} else {
@@ -46,7 +45,6 @@ time_t DS_time(time_t) {
}
time_t DS_time(long* t) {
- consolePrintf("Time!");
if (OSystem_DS::instance()) {
if (t) *t = 0xABCD1234 + (OSystem_DS::instance()->getMillis() / 1000);
return 0xABCD1234 + (OSystem_DS::instance()->getMillis() / 1000);
diff --git a/backends/platform/ds/arm9/source/portdefs.h b/backends/platform/ds/arm9/source/portdefs.h
index 12d53a332f..de7a5795f5 100644
--- a/backends/platform/ds/arm9/source/portdefs.h
+++ b/backends/platform/ds/arm9/source/portdefs.h
@@ -19,10 +19,12 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
-
+
#ifndef _PORTDEFS_H_
#define _PORTDEFS_H_
+
+
/*
typedef unsigned char u8;
typedef signed char s8;
diff --git a/backends/platform/ds/arm9/source/ramsave.cpp b/backends/platform/ds/arm9/source/ramsave.cpp
index 8bcc34f9af..be355ce76f 100644
--- a/backends/platform/ds/arm9/source/ramsave.cpp
+++ b/backends/platform/ds/arm9/source/ramsave.cpp
@@ -17,10 +17,9 @@
* 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.
- *
+ *
*/
// Save in order 1,2,3,4,larger 2,5
-#include "system.h"
#include "ramsave.h"
#include "nds.h"
#include "compressor/lz.h"
@@ -52,18 +51,18 @@ DSSaveFile::DSSaveFile(SCUMMSave* s, bool compressed, u8* data) {
ownsData = true;
saveCompressed = false;
// consolePrintf("Decompressed. name=%s size=%d (%d)", save.name, save.size, save.compressedSize);
-
+
} else {
ownsData = false;
origHeader = s;
}
-
+
if (save.magic == (int) 0xBEEFCAFE) {
save.isValid = true;
} else {
save.isValid = false;
}
-
+
isTempFile = false;
}
@@ -78,7 +77,7 @@ DSSaveFile::~DSSaveFile() {
}
bool DSSaveFile::loadFromSaveRAM(vu8* address) {
-
+
SCUMMSave newSave;
for (int t = 0; t < (int) sizeof(newSave); t++) {
@@ -89,13 +88,13 @@ bool DSSaveFile::loadFromSaveRAM(vu8* address) {
newSave.isValid = true;
*((u16 *) (0x4000204)) |= 0x3;
-
+
saveData = new unsigned char[newSave.compressedSize];
-
+
for (int t = 0; t < (int) newSave.compressedSize; t++) {
((char *) (saveData))[t] = *(address + t + sizeof(newSave));
}
-
+
if (ownsData) delete this->saveData;
save = newSave;
saveCompressed = true;
@@ -105,7 +104,7 @@ bool DSSaveFile::loadFromSaveRAM(vu8* address) {
return true;
}
-
+
return false;
}
@@ -114,11 +113,11 @@ void DSSaveFile::compress() {
unsigned char* compBuffer = new unsigned char[(save.size * 110) / 100];
int compSize = LZ_Compress((u8 *) saveData, compBuffer, save.size);
save.compressedSize = compSize;
-
-
-
+
+
+
delete saveData;
-
+
// Make the save smaller
saveData = (u8 *) realloc(compBuffer, save.compressedSize);
saveCompressed = true;
@@ -129,39 +128,39 @@ int DSSaveFile::saveToSaveRAM(vu8* address) {
unsigned char* compBuffer;
bool failed;
-
+
int compSize;
-
+
compress();
-
+
compSize = save.compressedSize;
compBuffer = saveData;
-
+
if (DSSaveFileManager::instance()->getBytesFree() >= getRamUsage()) {
DSSaveFileManager::instance()->addBytesFree(-getRamUsage());
-
+
// Write header
for (int t = 0; t < sizeof(save); t++) {
while (*(address + t) != ((char *) (&save))[t]) {
*(address + t) = ((char *) (&save))[t];
}
}
-
+
// Write compressed buffer
for (int t = sizeof(save); t < (int) sizeof(save) + compSize; t++) {
while (*(address + t) != compBuffer[t - sizeof(save)]) {
*(address + t) = compBuffer[t - sizeof(save)];
}
}
-
+
failed = false;
} else {
failed = true;
}
-
+
return failed? 0: compSize + sizeof(save);
}
@@ -177,7 +176,7 @@ uint32 DSSaveFile::read(void *buf, uint32 size) {
}
memcpy(buf, saveData + ptr, size);
// consolePrintf("byte: %d ", ((u8 *) (buf))[0]);
-
+
ptr += size;
return size;
}
@@ -249,7 +248,7 @@ bool DSSaveFile::matches(char* filename) {
return false;
}
}
-
+
void DSSaveFile::setName(char *name) {
save.isValid = true;
save.magic = 0xBEEFCAFE;
@@ -258,7 +257,7 @@ void DSSaveFile::setName(char *name) {
save.compressedSize = 0;
saveData = new unsigned char[DS_MAX_SAVE_SIZE];
strcpy(save.name, name);
-
+
if ((strstr(name, ".s99")) || (strstr(name, ".c"))) {
isTempFile = true;
} else {
@@ -298,10 +297,10 @@ void DSSaveFile::deleteFile() {
DSSaveFileManager::DSSaveFileManager() {
instancePtr = this;
-
+
*((u16 *) (0x4000204)) |= 0x3;
swiWaitForVBlank();
-
+
loadAllFromSRAM();
}
@@ -311,7 +310,7 @@ DSSaveFileManager::~DSSaveFileManager() {
void DSSaveFileManager::loadAllFromSRAM() {
int addr = 1;
-
+
for (int r = 0; r < 8; r++) {
gbaSave[r].deleteFile();
}
@@ -332,7 +331,7 @@ void DSSaveFileManager::formatSram() {
for (int r = 0; r < SRAM_SAVE_MAX; r++) {
*(CART_RAM + r) = 0;
}
-
+
loadAllFromSRAM();
}
@@ -358,7 +357,7 @@ DSSaveFile *DSSaveFileManager::openSavefile(const char* filename, bool saveOrLoa
return gbaSave[r].clone();
}
}
-
+
if (saveOrLoad) {
return makeSaveFile(filename, saveOrLoad);
} else {
@@ -383,16 +382,26 @@ void DSSaveFileManager::deleteFile(char* name) {
flushToSaveRAM();
}
-void DSSaveFileManager::removeSavefile(const char *filename) {
- TODO: Implement this. Most likely, you just have to use the code of deleteFile?
+bool DSSaveFileManager::removeSavefile(const char *filename) {
+ consolePrintf("DSSaveFileManager::removeSavefile : Not implemented yet.\n");
+ assert(false);
+ //TODO: Implement this. Most likely, you just have to use the code of deleteFile?
+ return false;
}
Common::StringList DSSaveFileManager::listSavefiles(const char *pattern) {
+ consolePrintf("DSSaveFileManager::listSavefiles : Not implemented yet.\n");
+ assert(false);
+ return Common::StringList();
+ /*
TODO: Implement this. If you don't understand what it should do, just ask
(e.g. on scummvm-devel or Fingolfin). It should be pretty simple if you
use Common::matchString from common/util.h and read the Doxygen docs,
then combine this with the old code below...
+ */
+}
+
/*
void DSSaveFileManager::listSavefiles(const char *prefix, bool *marks, int num) {
@@ -408,21 +417,20 @@ void DSSaveFileManager::listSavefiles(const char *prefix, bool *marks, int num)
}
}
}
-
+
}
*/
-}
DSSaveFile *DSSaveFileManager::makeSaveFile(const char *filename, bool saveOrLoad) {
-
+
// Find a free save slot
int r = 0;
-
+
while ((r < 8) && (gbaSave[r].isValid())) {
r++;
}
-
+
if ((r == 8) && (gbaSave[r].isValid())) {
// No more saves
return NULL;
@@ -439,9 +447,9 @@ void DSSaveFileManager::flushToSaveRAM() {
int cartAddr = 1;
int s;
int extraData = DSSaveFileManager::getExtraData();
-
+
*((u16 *) (0x4000204)) |= 0x3;
-
+
swiWaitForVBlank();
int size = 0;
@@ -451,20 +459,20 @@ void DSSaveFileManager::flushToSaveRAM() {
if (!gbaSave[r].isTemp()) size += gbaSave[r].getRamUsage();
}
}
-
+
if (size <= SRAM_SAVE_MAX) {
for (int r = 0; r < SRAM_SAVE_MAX; r++) {
*(CART_RAM + r) = 0;
}
-
+
sramBytesFree = SRAM_SAVE_MAX;
-
+
for (int r = 0; (r < 8); r++) {
if (gbaSave[r].isValid() && (!gbaSave[r].isTemp())) {
-
+
cartAddr += s = gbaSave[r].saveToSaveRAM(CART_RAM + cartAddr);
-
+
/* if (s == 0) {
consolePrintf("WARNING: Save didn't fit in cart RAM and has been lost!! Delete files and save again.", gbaSave[r].getName());
failed = true;
@@ -475,7 +483,7 @@ void DSSaveFileManager::flushToSaveRAM() {
consolePrintf("WARNING: Save didn't fit in cart RAM and has been lost!! Delete files and save again.");
loadAllFromSRAM();
-
+
}
DSSaveFileManager::setExtraData(extraData);
diff --git a/backends/platform/ds/arm9/source/ramsave.h b/backends/platform/ds/arm9/source/ramsave.h
index abf225e598..f919da18db 100644
--- a/backends/platform/ds/arm9/source/ramsave.h
+++ b/backends/platform/ds/arm9/source/ramsave.h
@@ -19,12 +19,12 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
-
+
#ifndef _RAMSAVE_H_
#define _RAMSAVE_H_
-#include "system.h"
-#include "savefile.h"
+#include "common/system.h"
+#include "common/savefile.h"
// SaveFileManager class
@@ -46,56 +46,56 @@ class DSSaveFile : public Common::InSaveFile, public Common::OutSaveFile {
u16 extraMagic; // 32
u32 reserved; // 36
} __attribute__ ((packed));
-
+
SCUMMSave save;
u8* saveData;
SCUMMSave* origHeader;
bool isOpenFlag;
bool isTempFile;
-
+
public:
DSSaveFile();
DSSaveFile(SCUMMSave* s, bool saveCompressed, u8* data);
~DSSaveFile();
-
+
void reset();
-
+
bool isOpen() const { return isOpenFlag; }
virtual bool eos() const;
virtual void skip(uint32 size);
-
+
virtual uint32 pos() const;
virtual uint32 size() const;
virtual void seek(int32 pos, int whence);
uint32 read(void *buf, uint32 size);
uint32 write(const void *buf, uint32 size);
-
+
void setName(char *name);
char* getName() { return save.name; }
-
+
bool isValid() { return save.isValid; }
bool isTemp() { return isTempFile; }
bool matches(char* prefix, int num);
bool matches(char* filename);
-
+
void clearData();
void compress();
-
+
int getRamUsage() { return sizeof(save) + save.compressedSize; }
char* getRamImage() { return (char *) &save; }
-
+
int getSize() { return save.size; }
-
+
DSSaveFile* clone();
-
+
bool loadFromSaveRAM(vu8* address);
int saveToSaveRAM(vu8* address);
-
-
+
+
void deleteFile();
-
+
void operator delete(void *p) {
// consolePrintf("Finished! size=%d\n", ((DSSaveFile *) (p))->save->size);
}
@@ -107,25 +107,25 @@ public:
class DSSaveFileManager : public Common::SaveFileManager {
-
+
DSSaveFile gbaSave[8];
static DSSaveFileManager* instancePtr;
int sramBytesFree;
-
+
public:
DSSaveFileManager();
~DSSaveFileManager();
-
+
static DSSaveFileManager* instance() { return instancePtr; }
DSSaveFile *openSavefile(const char *filename, bool saveOrLoad);
-
+
virtual Common::OutSaveFile* openForSaving(const char* filename) { return openSavefile(filename, true); }
virtual Common::InSaveFile* openForLoading(const char* filename) { return openSavefile(filename, false); }
virtual bool removeSavefile(const char *filename);
virtual Common::StringList listSavefiles(const char *pattern);
-
+
void flushToSaveRAM();
void addBytesFree(int size) { sramBytesFree += size; }
@@ -134,7 +134,7 @@ public:
void deleteFile(char* name);
void listFiles();
void formatSram();
-
+
void loadAllFromSRAM();
static bool isExtraDataPresent();
diff --git a/backends/platform/ds/arm9/source/scummconsole.c b/backends/platform/ds/arm9/source/scummconsole.c
index 980dea7bc4..2145b47353 100644
--- a/backends/platform/ds/arm9/source/scummconsole.c
+++ b/backends/platform/ds/arm9/source/scummconsole.c
@@ -25,7 +25,7 @@
//
// Changelog:
// 0.1: First version
-// 0.2: Fixed sprite mapping bug. 1D mapping should work now.
+// 0.2: Fixed sprite mapping bug. 1D mapping should work now.
// Changed some register defines for consistency.
//
//////////////////////////////////////////////////////////////////////
@@ -52,7 +52,7 @@ u16* fontMap;
u8 row, col;
//font may not start on a character base boundry
-u16 fontOffset;
+u16 fontOffset;
//the first character in the set (0 if you have a full set)
u16 fontStart;
@@ -65,7 +65,7 @@ u16 fontPal;
///////////////////////////////////////////////////////////
//consoleInit
-// param:
+// param:
// font: 16 color font
// charBase: the location the font data will be loaded to
// numCharacters: count of characters in the font
@@ -79,7 +79,7 @@ void consoleInit(u16* font, u16* charBase, u16 numCharacters, u8 charStart, u16*
int i;
row = col = 0;
-
+
fontStart = charStart;
fontOffset = 0;
@@ -111,9 +111,9 @@ void consoleInit(u16* font, u16* charBase, u16 numCharacters, u8 charStart, u16*
temp |= 0xF00;
if(font[i] & 0xF000)
temp |= 0xF000;
-
+
charBase[i] = temp;
- }
+ }
}
}//end if bitdepth
else
@@ -140,7 +140,7 @@ void consoleInit(u16* font, u16* charBase, u16 numCharacters, u8 charStart, u16*
void consoleInitDefault(u16* map, u16* charBase, u8 bitDepth)
{
- consoleInit((u16 *) default_font_bin, charBase, 128, 0, map, CONSOLE_USE_COLOR255, bitDepth);
+ consoleInit((u16 *) default_font_bin, charBase, 128, 0, map, CONSOLE_USE_COLOR255, bitDepth);
}
void consolePrintSet(int x, int y)
@@ -164,9 +164,9 @@ void consolePrintChar(char c)
{
col = 0;
- row++;
+ row++;
}
-
+
if(row >= CONSOLE_HEIGHT)
{
row--;
@@ -178,7 +178,7 @@ void consolePrintChar(char c)
}
-
+
switch(c)
{
@@ -199,7 +199,7 @@ void consolePrintChar(char c)
}
-
+
}
@@ -207,16 +207,16 @@ void printX(int w, unsigned d)
{
int loop = 0;
int i = 0;
-
+
char buf[20] = {0};
while(d > 0)
{
buf[loop++] = d & 0xF;
- d = d>>4;
+ d = d>>4;
}
-
+
for (i = 7; i >= 0; i--)
{
if(buf[i] || i < loop)
@@ -235,15 +235,15 @@ void printx(int w, unsigned int d)
{
int loop = 0;
int i = 0;
-
+
char buf[20] = {0};
while(d > 0)
{
buf[loop++] = d & 0xF;
- d = d>>4;
+ d = d>>4;
}
-
+
for (i = 7; i >= 0; i--)
{
if(buf[i] || i < loop)
@@ -262,8 +262,8 @@ void printInt(int w, int d)
{
int loop = 0;
int i = 0;
-
- char buf[20] = {0};
+
+ char buf[20] = {0};
if(d < 0)
{
@@ -276,9 +276,9 @@ void printInt(int w, int d)
else while (d > 0)
{
buf[loop++] = d % 10;
- d /= 10;
+ d /= 10;
}
-
+
for (i = 7; i >= 0; i--)
{
if(buf[i] || i < loop)
@@ -310,16 +310,16 @@ void print0X(int w, unsigned d)
{
int loop = 0;
int i = 0;
-
+
char buf[] = {0,0,0,0,0,0,0,0}; //set to zero cause I may add formatted output someday
-
+
while(d > 0)
{
buf[loop++] = d & 0xF;
- d = d>>4;
+ d = d>>4;
}
-
+
for (i = 7; i >= 0; i--)
{
if(buf[i] || i < w || i < loop)
@@ -336,16 +336,16 @@ void print0x(int w, unsigned int d)
{
int loop = 0;
int i = 0;
-
+
char buf[] = {0,0,0,0,0,0,0,0}; //set to zero cause I may add formatted output someday
-
+
while(d > 0)
{
buf[loop++] = d & 0xF;
- d = d>>4;
+ d = d>>4;
}
-
+
for (i = 7; i >= 0; i--)
{
if(buf[i] || i < w || i < loop)
@@ -362,9 +362,9 @@ void print0Int(int w, int d)
{
int loop = 0;
int i = 0;
-
+
char buf[] = {0,0,0,0,0,0,0,0,0,0,0,0,0}; //set to zero cause I may add formatted output someday
-
+
if(d < 0)
{
consolePrintChar('-');
@@ -374,9 +374,9 @@ void print0Int(int w, int d)
while(d > 0)
{
buf[loop++] = d % 10;
- d /= 10;
+ d /= 10;
}
-
+
for (i = 15; i >= 0; i--)
if(buf[i] || i < w || i < loop)
consolePrintChar(buf[i] + '0');
@@ -414,14 +414,14 @@ void printF(int w, float f)
if(*t & BIT(31))
consolePrintChar('-');
-
+
print0Bin(32, fraction);
-
+
printInt(1, fraction);
consolePrintChar('e');
printInt(1, exp - 127);
-
+
/*
if(exp == 0 && fraction == 0)
{
@@ -447,7 +447,7 @@ void consolePrintf(const char* s, ...)
va_list argp;
va_start(argp, s);
-
+
while(*s)
{
@@ -474,7 +474,7 @@ void consolePrintf(const char* s, ...)
case 'I':
case 'd':
case 'D':
- if(z)print0Int(w, va_arg(argp, int));
+ if(z)print0Int(w, va_arg(argp, int));
else printInt(w, va_arg(argp, int));
s++;
break;
diff --git a/backends/platform/ds/arm9/source/scummconsole.h b/backends/platform/ds/arm9/source/scummconsole.h
index d8ccf34c62..01fdfc2f04 100644
--- a/backends/platform/ds/arm9/source/scummconsole.h
+++ b/backends/platform/ds/arm9/source/scummconsole.h
@@ -25,7 +25,7 @@
//
// Changelog:
// 0.1: First version
-// 0.2: Fixed sprite mapping bug. 1D mapping should work now.
+// 0.2: Fixed sprite mapping bug. 1D mapping should work now.
// Changed some register defines for consistency.
//
//////////////////////////////////////////////////////////////////////
diff --git a/backends/platform/ds/arm9/source/scummhelp.cpp b/backends/platform/ds/arm9/source/scummhelp.cpp
index f9efd58276..452f782dc5 100644
--- a/backends/platform/ds/arm9/source/scummhelp.cpp
+++ b/backends/platform/ds/arm9/source/scummhelp.cpp
@@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
-
+
#include "scummhelp.h"
#define ADD_BIND(k,d) do { key[i] = k; dsc[i] = d; i++; } while (0)
diff --git a/backends/platform/ds/arm9/source/scummhelp.h b/backends/platform/ds/arm9/source/scummhelp.h
index 602cb5f788..e79c863cbd 100644
--- a/backends/platform/ds/arm9/source/scummhelp.h
+++ b/backends/platform/ds/arm9/source/scummhelp.h
@@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
-
+
#ifndef _SCUMMHELP_H_
#define _SCUMMHELP_H_
@@ -30,7 +30,7 @@ namespace DS {
void updateStrings(byte gameId, byte version, Common::Platform platform,
int page, Common::String &title, Common::String *&key, Common::String *&dsc);
-
+
}
#endif
diff --git a/backends/platform/ds/arm9/source/touchkeyboard.cpp b/backends/platform/ds/arm9/source/touchkeyboard.cpp
index 5ff162cc4f..11832f4e3a 100644
--- a/backends/platform/ds/arm9/source/touchkeyboard.cpp
+++ b/backends/platform/ds/arm9/source/touchkeyboard.cpp
@@ -45,7 +45,7 @@ struct key_data {
key_data keys[DS_NUM_KEYS] = {
// Key number x y character
-
+
// Numbers
{28, 3, 0, '1'},
{29, 5, 0, '2'},
@@ -116,7 +116,7 @@ key_data keys[DS_NUM_KEYS] = {
{54, 29, 8, Common::KEYCODE_DOWN},
{53, 31, 8, Common::KEYCODE_RIGHT},
{51, 29, 6, Common::KEYCODE_UP},
-
+
// Close button
{56, 30, 0, Common::KEYCODE_INVALID},
@@ -133,7 +133,7 @@ key_data keys[DS_NUM_KEYS] = {
{66, 26, -2, Common::KEYCODE_F10},
{67, 28, -2, Common::KEYCODE_F11},
{68, 30, -2, Common::KEYCODE_F12},
-
+
};
int keyboardX;
@@ -162,7 +162,7 @@ void restoreVRAM(int tileBase, int mapBase, u16* saveSpace) {
/* for (int r = 0; r < 32 * 32; r++) {
((u16 *) SCREEN_BASE_BLOCK_SUB(mapBase))[r] = *saveSpace++;
}
-
+
for (int r = 0; r < 4096; r++) {
((u16 *) CHAR_BASE_BLOCK_SUB(tileBase))[r] = *saveSpace++;
}*/
@@ -175,77 +175,77 @@ void drawKeyboard(int tileBase, int mapBase, u16* saveSpace) {
// *saveSpace++ = ((u16 *) SCREEN_BASE_BLOCK_SUB(mapBase))[r];
((u16 *) SCREEN_BASE_BLOCK_SUB(mapBase))[r] = 0;
}
-
+
for (int r = 0; r < KEYBOARD_DATA_SIZE / 2; r++) {
// *saveSpace++ = ((u16 *) CHAR_BASE_BLOCK_SUB(tileBase))[r];
((u16 *) CHAR_BASE_BLOCK_SUB(tileBase))[r] = ((u16 *) (keyboard_raw))[r];
}
-
+
for (int r = 0; r < 16; r++) {
BG_PALETTE_SUB[r] = ((u16 *) (keyboard_pal_raw))[r];
}
// this is the font
for (int tile = 0; tile < 94; tile++) {
-
+
u16* tileAddr = (u16 *) (CHAR_BASE_BLOCK_SUB(tileBase) + ((KEYBOARD_DATA_SIZE) + (tile * 32)));
u8* src = ((u8 *) (_8x8font_tga_raw)) + 18 + tile * 8;
for (int y = 0 ; y < 8; y++) {
for (int x = 0; x < 2; x++) {
*(tileAddr + (y * 2) + x) =(*(src + (y * 752) + (x * 4) + 0) & 0x0F)
- | ((*(src + (y * 752) + (x * 4) + 1) & 0x0F) << 4)
+ | ((*(src + (y * 752) + (x * 4) + 1) & 0x0F) << 4)
| ((*(src + (y * 752) + (x * 4) + 2) & 0x0F) << 8)
| ((*(src + (y * 752) + (x * 4) + 3) & 0x0F) << 12);
-
+
}
}
}
-
+
for (int r = 0; r < 16; r++) {
int col = ((u16 *) (keyboard_pal_raw))[r];
-
+
int red = col & 0x001F;
int green = (col & 0x03E0) >> 5;
int blue = (col & 0x7C00) >> 10;
-
+
red = (red * 8) / 16;
green = (green * 24) / 16;
blue = (blue * 8) / 16;
if (green > 31) green = 31;
-
+
BG_PALETTE_SUB[16 + r] = red | (green << 5) | (blue << 10);
}
-
+
keyboardX = -2;
keyboardY = 2;
-
+
DS::mapBase = mapBase;
DS::tileBase = tileBase;
-
+
shiftState = false;
capsLockState = false;
-
+
int x = keyboardX;
int y = keyboardY;
-
+
u16* base = ((u16 *) SCREEN_BASE_BLOCK_SUB(mapBase));
baseAddress = base;
-
+
for (int r = 0; r < DS_NUM_KEYS; r++) {
base[(y + keys[r].y) * 32 + x + keys[r].x] = 10 + keys[r].keyNum * 2;
base[(y + keys[r].y) * 32 + x + keys[r].x + 1] = 10 + keys[r].keyNum * 2 + 1;
-
+
base[(y + keys[r].y + 1) * 32 + x + keys[r].x] = 10 + 148 + keys[r].keyNum * 2;
base[(y + keys[r].y + 1) * 32 + x + keys[r].x + 1] = 10 + 148 + keys[r].keyNum * 2 + 1;
-
+
keys[r].pressed = false;
}
-
+
closed = false;
clearAutoComplete();
}
@@ -257,7 +257,7 @@ void drawAutoComplete() {
baseAddress[y * 32 + x] = 0;
}
}
-
+
for (int r = 0; r < autoCompleteCount; r++) {
int y = 12 + (r % 6) * 2;
@@ -265,15 +265,15 @@ void drawAutoComplete() {
for (int p = 0; p < strlen(autoCompleteWord[r]); p++) {
char c = autoCompleteWord[r][p];
-
+
int tile = c - 33 + (KEYBOARD_DATA_SIZE / 32);
if (selectedCompletion == r) {
tile |= 0x1000;
}
- baseAddress[y * 32 + x + p] = tile;
-
+ baseAddress[y * 32 + x + p] = tile;
+
}
}
@@ -317,7 +317,7 @@ void clearAutoComplete() {
void typeCompletion(int current) {
Common::Event event;
- OSystem_DS* system = OSystem_DS::instance();
+ OSystem_DS* system = OSystem_DS::instance();
strcat(autoCompleteBuffer, &autoCompleteWord[current][charactersEntered]);
strcat(autoCompleteBuffer, " ");
@@ -330,7 +330,7 @@ void typeCompletion(int current) {
event.type = Common::EVENT_KEYDOWN;
event.kbd.flags = 0;
system->addEvent(event);
-
+
event.type = Common::EVENT_KEYUP;
system->addEvent(event);
}
@@ -350,14 +350,14 @@ void updateTypeEvents()
if (autoCompleteBuffer[0] != '\0')
{
Common::Event event;
- OSystem_DS* system = OSystem_DS::instance();
-
+ OSystem_DS* system = OSystem_DS::instance();
+
event.kbd.keycode = (Common::KeyCode) autoCompleteBuffer[0];
event.kbd.ascii = autoCompleteBuffer[0];
event.type = Common::EVENT_KEYDOWN;
event.kbd.flags = 0;
system->addEvent(event);
-
+
event.type = Common::EVENT_KEYUP;
system->addEvent(event);
@@ -380,30 +380,37 @@ void createKeyEvent(int keyNum, Common::Event& event)
} else {
event.kbd.keycode = (Common::KeyCode) (Common::KEYCODE_F1 - (keys[keyNum].character - '1'));
event.kbd.ascii = 0;
- }
-
+ }
+
} else if ((keys[keyNum].character >= 'A') && (keys[keyNum].character <= 'Z')) {
-
+
if ((!DS::shiftState) && (!DS::capsLockState)) {
event.kbd.ascii = keys[keyNum].character + 32; // Make key lowercase.
} else {
event.kbd.ascii = keys[keyNum].character;
}
-
+
event.kbd.keycode = (Common::KeyCode) event.kbd.ascii;
} else {
- event.kbd.ascii = keys[keyNum].character;
- event.kbd.keycode = (Common::KeyCode) keys[keyNum].character;
- }
+ if ((keys[keyNum].character >= Common::KEYCODE_F1) && (keys[keyNum].character >= Common::KEYCODE_F12)) {
+ event.kbd.keycode = (Common::KeyCode) keys[keyNum].character;
+ event.kbd.ascii = keys[keyNum].character - Common::KEYCODE_F1 + Common::ASCII_F1;
+ } else {
+ event.kbd.ascii = keys[keyNum].character;
+ event.kbd.keycode = (Common::KeyCode) keys[keyNum].character;
+ }
+ }
}
void addKeyboardEvents() {
+ bool resetShift = false;
+
updateTypeEvents();
if (DS::getPenDown()) {
int x = IPC->touchXpx;
int y = IPC->touchYpx;
-
+
int tx = (x >> 3);
int ty = (y >> 3);
@@ -427,81 +434,89 @@ void addKeyboardEvents() {
tx -= keyboardX;
ty -= keyboardY;
-
+
// consolePrintf("x=%d y=%d\n", tx, ty);
-
+
for (int r = 0; r < DS_NUM_KEYS; r++) {
- if (( (tx >= keys[r].x) && (tx <= keys[r].x + 1)) &&
+ if (( (tx >= keys[r].x) && (tx <= keys[r].x + 1)) &&
(ty >= keys[r].y) && (ty <= keys[r].y + 1)) {
- OSystem_DS* system = OSystem_DS::instance();
+ OSystem_DS* system = OSystem_DS::instance();
Common::Event event;
-
+
// consolePrintf("Key: %d\n", r);
if ((keys[r].character == Common::KEYCODE_INVALID)) {
// Close button
DS::closed = true;
} else {
createKeyEvent(r, event);
- }
-
- //event.kbd.keycode = keys[r].character;
- //event.kbd.ascii = keys[r].character;
+ }
+
+ //event.kbd.keycode = keys[r].character;
+ //event.kbd.ascii = keys[r].character;
event.type = Common::EVENT_KEYDOWN;
system->addEvent(event);
// event.type = Common::EVENT_KEYUP;
// system->addEvent(event);
-
+
switch (keys[r].character) {
case DS_SHIFT: {
DS::shiftState = !DS::shiftState;
DS::setKeyHighlight(r, DS::shiftState);
break;
}
-
+
case DS_CAPSLOCK: {
DS::capsLockState = !DS::capsLockState;
DS::setKeyHighlight(r, DS::capsLockState);
break;
}
-
+
default: {
DS::setKeyHighlight(r, true);
keys[r].pressed = true;
-
- if (DS::shiftState) {
- DS::shiftState = false;
- for (int t = 0; t < DS_NUM_KEYS; t++) {
- if (keys[t].character == DS_SHIFT) {
- DS::setKeyHighlight(t, false);
- }
- }
- }
break;
}
}
-
+
}
}
}
-
+
if (DS::getPenReleased()) {
-
+
for (int r = 0; r < DS_NUM_KEYS; r++) {
if (keys[r].pressed) {
DS::setKeyHighlight(r, false);
- OSystem_DS* system = OSystem_DS::instance();
-
+ OSystem_DS* system = OSystem_DS::instance();
+
Common::Event event;
createKeyEvent(r, event);
event.type = Common::EVENT_KEYUP;
system->addEvent(event);
keys[r].pressed = false;
+
+ if (keys[r].character != DS_SHIFT) {
+ resetShift = true;
+ }
+ }
+ }
+
+ }
+
+
+ if ((resetShift) && (DS::shiftState)) {
+ DS::shiftState = false;
+ resetShift = false;
+ for (int t = 0; t < DS_NUM_KEYS; t++) {
+ if (keys[t].character == DS_SHIFT) {
+ DS::setKeyHighlight(t, false);
}
}
}
+
}
}
diff --git a/backends/platform/ds/arm9/source/touchkeyboard.h b/backends/platform/ds/arm9/source/touchkeyboard.h
index e4aa102ab4..8a5fc728ce 100644
--- a/backends/platform/ds/arm9/source/touchkeyboard.h
+++ b/backends/platform/ds/arm9/source/touchkeyboard.h
@@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
-
+
#ifndef _TOUCHKEYBOARD_H_
#define _TOUCHKEYBOARD_H_
diff --git a/backends/platform/ds/arm9/source/wordcompletion.cpp b/backends/platform/ds/arm9/source/wordcompletion.cpp
index bf4ce7c909..9eeeb62410 100644
--- a/backends/platform/ds/arm9/source/wordcompletion.cpp
+++ b/backends/platform/ds/arm9/source/wordcompletion.cpp
@@ -23,7 +23,7 @@ void addAutoCompleteLine(char* line) {
{
char word[32];
int length;
-
+
// Skip the T9-style numbers
while (*line != ' ')
{
@@ -37,7 +37,7 @@ void addAutoCompleteLine(char* line) {
if (*line == ' ') line++;
- // Copy the new word
+ // Copy the new word
do {
word[length++] = *line++;
} while ((*line != '\0') && (*line != ' ') && (*line != '\n'));
@@ -47,7 +47,7 @@ void addAutoCompleteLine(char* line) {
// Store a pointer to the start of the word
wordBufferPtr[wordBufferPtrPos++] = &wordBuffer[wordBufferPos];
-
+
// copy the new word into the buffer
strcpy(&wordBuffer[wordBufferPos], word);
wordBufferPos += strlen(word) + 1;
@@ -104,11 +104,11 @@ bool findWordCompletions(char* input)
// Get the word from the dictonary line
word = wordBufferPtr[position];
-
+
// Now check to see if the word is before or after the stub we're after
int result = scumm_stricmp((const char *) partialWord, (const char *) word);
-
+
if (result == 0) {
// We've found the whole word. Aren't we good.
break;
@@ -128,10 +128,10 @@ bool findWordCompletions(char* input)
word = wordBufferPtr[position];
//consolePrintf("Final word: %s\n", word);
-
+
system->setCharactersEntered(strlen(partialWord));
-
+
bool match = true;
@@ -161,7 +161,7 @@ bool findWordCompletions(char* input)
break;
}
}
-
+
if (match) {
system->addAutoComplete(word);
}
diff --git a/backends/platform/ds/arm9/source/wordcompletion.h b/backends/platform/ds/arm9/source/wordcompletion.h
index 39be8511bf..980277d6bb 100644
--- a/backends/platform/ds/arm9/source/wordcompletion.h
+++ b/backends/platform/ds/arm9/source/wordcompletion.h
@@ -1,10 +1,7 @@
-
-
-
namespace DS {
extern bool findWordCompletions(char* input);
extern void addAutoCompleteLine(char* line);
extern void sortAutoCompleteWordList();
-} \ No newline at end of file
+}
diff --git a/backends/platform/ds/arm9/source/zipreader.cpp b/backends/platform/ds/arm9/source/zipreader.cpp
index 8ba56c2b7c..01321f44f5 100644
--- a/backends/platform/ds/arm9/source/zipreader.cpp
+++ b/backends/platform/ds/arm9/source/zipreader.cpp
@@ -17,7 +17,7 @@
* 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.
- *
+ *
*/
@@ -29,25 +29,25 @@
ZipFile::ZipFile() {
// Locate a zip file in cartridge memory space
-
+
// consolePrintf("ZIP file check...");
-
+
char* p = (char *) ZF_SEARCH_START;
bool found = false;
-
+
_zipFile = NULL;
-
+
while ((p != (char *) ZF_SEARCH_END) && (!found)) {
// Zip file header is: 0x504B0304
-
+
if ( (*p == 0x50) && (*(p + 1) == 0x4B) && (*(p + 2) == 0x03) && (*(p + 3) == 0x04) ) {
// Found header!
found = true;
_zipFile = p;
}
-
+
if (!found) p += ZF_SEARCH_STRIDE;
-
+
}
if (_zipFile) {
@@ -56,14 +56,14 @@ ZipFile::ZipFile() {
// consolePrintf("Not in use!\n");
return;
}
-
+
changeToRoot();
restartFile();
-
+
if (_currentFile->compSize != (u32) getFileSize()) {
consolePrintf("Error: ZIP file contains compression!\n");
}
-
+
_allFilesVisible = false;
}
@@ -83,73 +83,73 @@ bool ZipFile::restartFile() {
getFileName(name);
more = skipFile();
}
-
+
return more;
}
bool ZipFile::currentFileInFolder() {
char name[128];
-
+
if (_allFilesVisible) return true;
-
+
getFileName(name);
// consolePrintf("N:'%s'D:'%s'\n", name, _directory);
-
+
if (_directory[0] == 0) { // Root directory
name[strlen(name) - 1] = 0;
- return !strchr(name, '\\'); // Not in root if contains a / character before the last character
+ return !strchr(name, '\\'); // Not in root if contains a / character before the last character
} else {
/* if (name starts with directory && it's not the directory
&& (no slashes after the directory || it's the last character)
&& (slash follows directory)
*/
- if ((strstr(name, _directory) == name) && (strlen(name) != strlen(_directory))
+ if ((strstr(name, _directory) == name) && (strlen(name) != strlen(_directory))
&& ((strchr(name + strlen(_directory) + 1, '\\') == NULL)
|| (strchr(name + strlen(_directory) + 1, '\\') == name + strlen(name) - 1))
&& (*(name + strlen(_directory)) == '\\')) {
return true;
}
}
-
+
return false;
}
void ZipFile::getFileName(char* name) {
strncpy(name, (char *) (_currentFile + 1), _currentFile->nameLength);
-
+
for (int r = 0; r < (int) strlen(name); r++) {
if (name[r] == '/') name[r] = '\\';
}
name[_currentFile->nameLength] = 0;
-
+
if (name[strlen(name) - 1] == '\\') {
name[strlen(name) - 1] = 0;
- }
+ }
}
bool ZipFile::skipFile() {
bool valid;
do {
-
+
// Move on to the next file
_currentFile = (FileHeader *) (
((char *) (_currentFile)) + sizeof(*_currentFile) + _currentFile->nameLength + _currentFile->fileSize + _currentFile->extraLength
);
-
+
// Return true if there are more files. Check this by looking for the magic number
valid = (_currentFile->magic[0] == 0x50) &&
(_currentFile->magic[1] == 0x4B) &&
(_currentFile->magic[2] == 0x03) &&
(_currentFile->magic[3] == 0x04);
-
-
+
+
} while (valid && !currentFileInFolder());
-
+
return valid;
-
+
// Currently doesn't handle data descriptors!
}
@@ -170,7 +170,7 @@ int ZipFile::getFileSize() {
}
bool ZipFile::isDirectory() {
- return _currentFile->fileSize == 0; // This is a bit wrong, but seems to work.
+ return _currentFile->fileSize == 0; // This is a bit wrong, but seems to work.
}
char* ZipFile::getFile() {
@@ -180,7 +180,7 @@ char* ZipFile::getFile() {
bool ZipFile::findFile(char* search) {
changeToRoot();
restartFile();
-
+
char searchName[128];
strcpy(searchName, search);
for (int r = 0; r < (int) strlen(searchName); r++) {
@@ -191,15 +191,15 @@ bool ZipFile::findFile(char* search) {
*(searchName + strlen(searchName) - 1) = '\0'; // which we need to dispose of.
}
-
+
do {
char name[128];
getFileName(name);
if (*(name + strlen(name) - 1) == '\\') { // Directories have a terminating slash
*(name + strlen(name) - 1) = '\0'; // which we need to dispose of.
}
-
-
+
+
if (!stricmp(name, searchName)) {
// consolePrintf("'%s'=='%s'\n", name, searchName);
return true; // Got it!
@@ -222,7 +222,7 @@ void ZipFile::changeDirectory(char* dir) {
for (int r = 0; r < (int) strlen(_directory); r++) {
if (_directory[r] == '/') _directory[r] = '\\';
}
-
+
if (_directory[strlen(_directory) - 1] == '\\') {
_directory[strlen(_directory) - 1] = '\0';
}
diff --git a/backends/platform/ds/arm9/source/zipreader.h b/backends/platform/ds/arm9/source/zipreader.h
index cd7244dba5..19aa3d9f31 100644
--- a/backends/platform/ds/arm9/source/zipreader.h
+++ b/backends/platform/ds/arm9/source/zipreader.h
@@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
-
+
#ifndef _ZIPREADER_H_
#define _ZIPREADER_H_
#include "portdefs.h"
@@ -45,9 +45,9 @@ class ZipFile {
char* _zipFile;
char _directory[128];
-
+
bool _allFilesVisible;
-
+
FileHeader* _currentFile;
public:
@@ -55,25 +55,25 @@ public:
~ZipFile();
bool isReady();
-
+
// These operations set the current file
bool restartFile();
bool skipFile();
- bool findFile(char* search);
+ bool findFile(char* search);
// These return the file's data and information
char* getFile();
int getFileSize();
void getFileName(char* name);
bool isDirectory();
-
+
// These set the current directory
void changeDirectory(char* name);
void changeToRoot();
void setAllFilesVisible(bool state) { _allFilesVisible = state; }
-
+
bool currentFileInFolder();
-
+
u16 misaligned16(u16* v);
u32 misaligned32(u32* v);
diff --git a/backends/platform/ds/makefile b/backends/platform/ds/makefile
index 9c88932a7f..3fb19e939c 100644
--- a/backends/platform/ds/makefile
+++ b/backends/platform/ds/makefile
@@ -15,6 +15,24 @@ all:
@for i in $(SUBDIRS); do if test -d $$i; then make -C $$i; fi; done;
clean:
@for i in $(SUBDIRS); do if test -d $$i; then make -C $$i clean; fi; done;
+semiclean:
+ @for i in $(SUBDIRS); do if test -d $$i; then make -C $$i semiclean; fi; done;
export:
@for i in $(SUBDIRS); do if test -d $$i; then make -C $$i export; fi; done;
+
+allbuilds:
+ make semiclean
+ make all SCUMM_BUILD=a
+ make semiclean
+ make all SCUMM_BUILD=b
+ make semiclean
+ make all SCUMM_BUILD=c
+ make semiclean
+ make all SCUMM_BUILD=d
+ make semiclean
+ make all SCUMM_BUILD=e
+ make semiclean
+ make all SCUMM_BUILD=f
+ make semiclean
+ make all SCUMM_BUILD=g
diff --git a/backends/platform/gp32/Makefile b/backends/platform/gp32/Makefile
deleted file mode 100644
index f7145bf860..0000000000
--- a/backends/platform/gp32/Makefile
+++ /dev/null
@@ -1,187 +0,0 @@
-CC := arm-elf-gcc
-CXX := arm-elf-g++
-LD := arm-elf-g++
-AS := arm-elf-as
-AR := arm-elf-ar cru
-RANLIB := arm-elf-ranlib
-RM := rm -f
-MKDIR := mkdir -p
-ECHO := echo -n
-CAT := cat
-RM := rm -f
-# recursive version of RM
-RM_REC := $(RM) -r
-ZIP := zip -q
-CP := cp
-OBJCOPY := arm-elf-objcopy
-FXETOOL := b2fxec
-
-
-#######################################################################
-# Default compilation parameters. Normally don't edit these #
-#######################################################################
-
-CFLAGS = -marm -march=armv4t -mtune=arm920 -mapcs \
- -finline-functions \
- -fshort-enums \
- -mstructure-size-boundary=32 \
- -mno-thumb-interwork \
- -I$(GPSDK)/include \
- -g \
- -O2 \
- -fomit-frame-pointer
-# -ffast-math \
-# -fshort-double
-
-CPPFLAGS:= $(CFLAGS)
-CXXFLAGS:= $(CFLAGS)
-DEFINES :=
-LDFLAGS :=
-INCLUDES:= -I. -Icommon
-LIBS :=
-OBJS :=
-
-# Turn on useful warnings
-CXXFLAGS+= -Wall -pedantic -Wpointer-arith -Wcast-qual -Wcast-align -Wconversion
-CXXFLAGS+= -Wshadow -Wuninitialized -Wimplicit -Wundef
-CXXFLAGS+= -Wno-long-long -Wno-multichar -Wno-unknown-pragmas -Wno-reorder
-CXXFLAGS+= -Wwrite-strings -fcheck-new -Wctor-dtor-privacy -Wnon-virtual-dtor
-
-# Stripped Build? (Smaller ELF, Minimal debug symbol information).
-# You MUST comment this out with a # if you wish to debug your code.
-STRIP_DEBUG = -Wl,--strip-debug
-
-# GPSDK (SDK, Includes and Startup Files) base dir
-GPSDK = /usr/compat/gp32/share/sdk
-
-LDSPECS = -specs=gp32_gpsdk.specs
-
-LDFLAGS = $(STRIP_DEBUG) -Wl,-Map,$(MAPFILE) $(LDSPECS) -Wl,--no-warn-mismatch
-
-LIBS += -L$(GPSDK)/lib \
- -lgpmem -lgpos -lgpstdio -lgpstdlib -lgpsound -lgpgraphic -lgpfont \
- -lm -lc -lgcc
-
-INCLUDES += -Ibackends/platform/gp32 -Iengines -I$(GPSDK)/include
-
-MODULES += backends/platform/gp32
-
-# Outputs
-EXEEXT = .elf
-MAPFILE = scummvm.map
-BIN = scummvm.gxb
-FXE = scummvm.fxe
-
-# Plugins hack
-srcdir = ./
-
-DEFINES = -D__GP32__
-DEFINES += -DNONSTANDARD_PORT
-
-# Disable new themes. GP32 has LOW memory!
-DEFINES += -DDISABLE_FANCY_THEMES
-
-# Support libtremor.
-#DEFINES += -DUSE_VORBIS -DUSE_TREMOR -DGP32_SDK
-#INCLUDES += -Ibackends/platform/gp32/gptremor
-#LIBS += -Lbackends/platform/gp32/gptremor -lgptremor
-
-# Support libmad.
-#DEFINES += -DUSE_MAD
-#INCLUDES += -Ibackends/platform/gp32/gpmad
-#LIBS += -Lbackends/platform/gp32/gpmad -lgpmad
-
-# Support libminilzo.
-DEFINES += -DUSE_MINILZO
-INCLUDES += -Ibackends/platform/gp32/minilzo
-LIBS += -Lbackends/platform/gp32/minilzo -lminilzo
-
-# Support for 8:3 save files names (The GP32 uses FAT12/16 (no vFAT) for the file system).
-DEFINES += -DSHORT_SAVENAMES
-
-# Support for the unsigned sound mixer.
-DEFINES += -DOUTPUT_UNSIGNED_AUDIO
-
-# Support for the GP32 (fmOPL derived) MIDI engine.
-# - NOT fully implemented yet.
-#DEFINES += -DUSE_GP32_FMOPL
-
-
-
-#GP32 Debug - Remove from Release builds
-# This builds in the GP32 GDB USB Stub. Don't use it unless you know what your doing.
-# You also need to remove ANY optemisation from the compiler flags.
-#DEFINES += -DGP32_GDB
-#OBJS += backends/platform/gp32/debug-gdbstub-usb.o
-
-# Standard librarys and optimization modules
-OBJS += backends/platform/gp32/startup.o \
- backends/platform/gp32/memcpy.o \
- backends/platform/gp32/gp_asmlib.o \
- backends/platform/gp32/gp_clipped.o \
- backends/platform/gp32/fontdata.o
-
-# Custom GP32 std library
-OBJS += backends/platform/gp32/gp32std.o \
- backends/platform/gp32/gp32std_file.o \
- backends/platform/gp32/gp32std_grap.o \
- backends/platform/gp32/gp32std_input.o \
- backends/platform/gp32/gp32std_memory.o \
- backends/platform/gp32/gp32std_sound.o \
- #backends/platform/gp32/dmaaudio_asm.o \
- #backends/platform/gp32/dmaaudio.o \
-
-#Main ScummVM for the GP32 Backend
-OBJS += backends/platform/gp32/gp32_main.o \
- backends/platform/gp32/gp32_launcher.o \
- backends/platform/gp32/gp32_osys.o \
- backends/fs/gp32/gp32-fs.o
-
-$(FXE): $(BIN)
- $(FXETOOL) -f -a "The ScummVM Team" -t "ScummVM for the GP32" -b backends/platform/gp32/scummvm.bmp $< $@
-
-$(BIN): scummvm$(EXEEXT)
- $(OBJCOPY) -O binary $< $@
-
-# Uncomment this to use GCC 3.x specific dependency tracking (recommended)
-HAVE_GCC3 = 1
-
-#######################################################################
-# Control which modules are built - uncomment any to disable module #
-#######################################################################
-
-DISABLE_SCALERS = 1
-DISABLE_HQ_SCALERS = 1
-
-ENABLE_SCUMM = STATIC_PLUGIN
-
-# We can play The Dig with GP32 -- without any movies/musics/voices. But who would do that?
-#ENABLE_SCUMM_7_8 = 1
-#ENABLE_HE = 1
-
-ENABLE_AGOS = STATIC_PLUGIN
-ENABLE_SKY = STATIC_PLUGIN
-ENABLE_QUEEN = STATIC_PLUGIN
-ENABLE_GOB = STATIC_PLUGIN
-ENABLE_LURE = STATIC_PLUGIN
-ENABLE_CINE = STATIC_PLUGIN
-ENABLE_SAGA = STATIC_PLUGIN
-ENABLE_KYRA = STATIC_PLUGIN
-ENABLE_AGI = STATIC_PLUGIN
-
-# The engines below are not supported on the GP32 port so there is
-# no point compiling support into the binary.
-#ENABLE_SWORD1 = STATIC_PLUGIN
-#ENABLE_SWORD2 = STATIC_PLUGIN
-
-#######################################################################
-# Misc stuff - you should normally never have to edit this #
-#######################################################################
-
-EXECUTABLE := scummvm$(EXEEXT)
-
-include Makefile.common
-
-dist:
- $(RM) $(ZIPFILE)
- $(ZIP) $(ZIPFILE) $(DISTFILES)
diff --git a/backends/platform/gp32/README.GP32 b/backends/platform/gp32/README.GP32
deleted file mode 100644
index 15120c7303..0000000000
--- a/backends/platform/gp32/README.GP32
+++ /dev/null
@@ -1 +0,0 @@
-TODO. :)
diff --git a/backends/platform/gp32/debug-gdbstub-usb.cpp b/backends/platform/gp32/debug-gdbstub-usb.cpp
deleted file mode 100644
index 76b7fad13b..0000000000
--- a/backends/platform/gp32/debug-gdbstub-usb.cpp
+++ /dev/null
@@ -1,1927 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- *
- */
-
-/*
- *
- * Basic GP32 USB GDB Debug Stub - Use with Multi-firmware that supports GDB
- * Mithris kindly gave me the basic stub code.
- *
- */
-#include <sys/types.h>
-#include <gpcomm.h>
-#include <gpos_def.h>
-#include <gpdef.h>
-#include <gpmain.h>
-#include <gpos_def.h>
-#include <gpstdio.h>
-#include <gpgraphic.h>
-#include <gpfont.h>
-#include <gpstdlib.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdarg.h>
-
-//#define USE_PRINTF // If there is a Printf(const char *pFormat,...) implemented
-
-///////////////////////////////////////////////////////////////
-// Externs
-extern int __text_start;
-extern int __data_start;
-extern int __bss_start;
-#ifdef USE_PRINTF
-extern void Printf(char *pFormat, ...);
-#endif
-///////////////////////////////////////////////////////////////
-
-extern "C" {
- int OpenUSB();
- void InstallISR();
-}
-
-struct g_Namedregisters {
- unsigned int r0;
- unsigned int r1;
- unsigned int r2;
- unsigned int r3;
- unsigned int r4;
- unsigned int r5;
- unsigned int r6;
- unsigned int r7;
- unsigned int r8;
- unsigned int r9;
- unsigned int r10;
- unsigned int r11;
- unsigned int r12;
- unsigned int sp;
- unsigned int lr;
- unsigned int pc;
- unsigned int fps;
- unsigned int fcpsr;
-};
-
-///////////////////////////////////////////////////////////////
-// Defines
-
-
-#define _REG_R1 0
-#define _REG_R2 2
-#define _REG_R3 3
-#define _REG_R4 4
-#define _REG_R5 5
-#define _REG_R6 6
-#define _REG_R7 7
-#define _REG_R8 8
-#define _REG_R9 9
-#define _REG_R10 10
-#define _REG_R11 11
-#define _REG_R12 12
-#define _REG_FP 11
-#define _REG_IP 12
-#define _REG_SL 10
-#define _REG_SP 13
-#define _REG_LR 14
-#define _REG_PC 15
-
-#define PACKET_SIZE 0x100
-
-#define MODE_USER 0
-#define MODE_FIQ 1
-#define MODE_IRQ 2
-#define MODE_SUPERVISOR 3
-#define MODE_ABORT 4
-#define MODE_UNDEF 5
-#define MODE_SYSTEM 6
-#define MODE_DUNNO -1
-
-///////////////////////////////////////////////////////////////
-// Global stuff
-
-// Register array.
-int g_Registers[50] = {1, 2, 3, 4 ,5, 6, 7, 8, 9, 10,
- 11, 12, 13, 14, 15, 16, 17, 18, 19,
- 21, 22, 23, 24, 25, 26, 27, 28, 29,
- 31, 32, 33, 34, 35, 36, 37, 38, 39,
- 41, 42, 43, 44, 45, 46, 47, 48, 49};
-
-// Register name strings, not used right now.
-static char * arm_register_name_strings[] =
-{"r0", "r1", "r2", "r3", /* 0 1 2 3 */
- "r4", "r5", "r6", "r7", /* 4 5 6 7 */
- "r8", "r9", "r10", "r11", /* 8 9 10 11 */
- "r12", "sp", "lr", "pc", /* 12 13 14 15 */
- "f0", "f1", "f2", "f3", /* 16 17 18 19 */
- "f4", "f5", "f6", "f7", /* 20 21 22 23 */
- "fps", "cpsr" }; /* 24 25 */
-
-
-// Some USB stuff
-GPN_DESC g_CommDesc;
-GPN_COMM g_Comm;
-const char HexDigits[17] = "0123456789abcdef";
-char g_SendBuffer[256];
-char g_TempBuffer[256];
-char g_ReadBuffer[0x100];
-unsigned int g_CurrentCSPR = 0;
-unsigned int g_SavedStepInstruction = 0;
-unsigned int g_StepAddress = 0;
-bool g_LastWasStep = false;
-int g_iTrap = 0;
-bool g_GDBConnected = false;
-///////////////////////////////////////////////////////////////
-
-
-///////////////////////////////////////////////////////////////
-// Prototypes
-void BreakPoint();
-int GetException(unsigned int CSPR);
-unsigned int *GetNextInstruction(unsigned int *pAddr);
-bool CondWillExecute(unsigned int uiCond, unsigned int CSPR);
-unsigned int DecodeInstruction(unsigned int uiInstruction, unsigned int PC);
-
-///////////////////////////////////////////////////////////////
-
-
-///////////////////////////////////////////////////////////////
-// Code Begins here
-///////////////////////////////////////////////////////////////
-
-///////////////////////////////////////////////////////////////
-// Open usb comms stuff
-int OpenUSB()
-{
- int iResult;
-
- g_CommDesc.port_kind = COMM_USB_D;
- g_CommDesc.tr_mode = 1;
- g_CommDesc.tr_buf_size = PACKET_SIZE;
- g_CommDesc.sz_pkt = PACKET_SIZE;
- g_CommDesc.isr_comm_ram = 0;
-
-
- iResult = GpCommCreate(&g_CommDesc, &g_Comm);
- return iResult;
-}
-
-///////////////////////////////////////////////////////////////
-// No need for explanation
-void CloseUSB()
-{
- GpCommDelete(&g_CommDesc);
-}
-
-///////////////////////////////////////////////////////////////
-// No need for explanation
-int SendUSB(const void *pData, unsigned int uiSize)
-{
- return g_Comm.comm_send((unsigned char *)pData, uiSize);
-}
-
-
-///////////////////////////////////////////////////////////////
-// No need for explanation
-int RecvUSB(char *pBuffer, unsigned int uiSize)
-{
- return g_Comm.comm_recv((unsigned char *)pBuffer, uiSize);
-}
-
-///////////////////////////////////////////////////////////////
-// Waits for an acknowledge from the server
-void WaitACK()
-{
- bool bBreak = false;
- int iResult;
-
- while (!bBreak) {
- iResult = g_Comm.comm_recv((unsigned char *)g_SendBuffer, 0x100);
- if (iResult > 0) {
- bBreak = true;
- }
- }
-}
-///////////////////////////////////////////////////////////////
-// Formats and sends a command to the server,
-// it also calculates checksum
-void SendCommand(unsigned char *pCommand)
-{
- int iOffset;
- unsigned int iCheckSum;
-
- iOffset = 4;
- g_SendBuffer[iOffset++] = '$';
-
- iCheckSum = 0;
- while (*pCommand != 0) {
- g_SendBuffer[iOffset++] = *pCommand;
- iCheckSum += *pCommand++;
- }
-
- g_SendBuffer[iOffset++] = '#';
- iCheckSum = iCheckSum & 0xff;
- g_SendBuffer[iOffset++] = HexDigits[(iCheckSum & 0xf0) >> 4];
- g_SendBuffer[iOffset++] = HexDigits[(iCheckSum & 0x0f)];
- g_SendBuffer[iOffset] = 0;
-
- (*(int *)&g_SendBuffer[0]) = (iOffset - 4);
- SendUSB(g_SendBuffer, 0x100);
- WaitACK();
-}
-
-///////////////////////////////////////////////////////////////
-// This function creates and sends a package which tells gdb that
-// the last command was unsupported
-void UnSupportedCommand()
-{
- (*(int *)&g_SendBuffer[0]) = 4;
- g_SendBuffer[4] = '$';
- g_SendBuffer[5] = '#';
- g_SendBuffer[6] = '0';
- g_SendBuffer[7] = '0';
- g_SendBuffer[8] = '0';
- SendUSB(g_SendBuffer, 0x100);
-
- WaitACK();
-
-}
-
-
-///////////////////////////////////////////////////////////////
-// This function is quite similar to the SendCommand above
-// But it allows the user to set the package length.
-// If the length of a package exceeds 256bytes including
-// the protocol stuff and the package length you can split
-// the packages by sending the package size * -1.
-// The server will then merge all packages until a package
-// with a length >0 is recieved.
-void SendCommandSize(unsigned char *pCommand, int iSize)
-{
- int iOffset;
- unsigned int iCheckSum;
-
- iOffset = 4;
- g_SendBuffer[iOffset++] = '$';
-
- iCheckSum = 0;
- while (*pCommand != 0) {
- g_SendBuffer[iOffset++] = *pCommand;
- iCheckSum += *pCommand++;
- }
-
- g_SendBuffer[iOffset++] = '#';
- iCheckSum = iCheckSum & 0xff;
- g_SendBuffer[iOffset++] = HexDigits[(iCheckSum & 0xf0) >> 4];
- g_SendBuffer[iOffset++] = HexDigits[(iCheckSum & 0x0f)];
- g_SendBuffer[iOffset] = 0;
-
- (*(int *)&g_SendBuffer[0]) = iSize;
- SendUSB(g_SendBuffer, 0x100);
-
- WaitACK();
-}
-
-
-///////////////////////////////////////////////////////////////
-// Writes a 32bit hexadeciman number in ascii to the string.
-void HexToString(char *pString, int iNumber)
-{
- pString[0] = HexDigits[(iNumber >> 28) & 0x0f];
- pString[1] = HexDigits[(iNumber >> 24) & 0x0f];
- pString[2] = HexDigits[(iNumber >> 20) & 0x0f];
- pString[3] = HexDigits[(iNumber >> 16) & 0x0f];
- pString[4] = HexDigits[(iNumber >> 12) & 0x0f];
- pString[5] = HexDigits[(iNumber >> 8) & 0x0f];
- pString[6] = HexDigits[(iNumber >> 4) & 0x0f];
- pString[7] = HexDigits[(iNumber) & 0x0f];
-
-}
-
-///////////////////////////////////////////////////////////////
-// This does the same, but in a differend endian.
-void HexToStringBW(char *pString, int iNumber)
-{
- pString[6] = HexDigits[(iNumber >> 28) & 0x0f];
- pString[7] = HexDigits[(iNumber >> 24) & 0x0f];
- pString[4] = HexDigits[(iNumber >> 20) & 0x0f];
- pString[5] = HexDigits[(iNumber >> 16) & 0x0f];
- pString[2] = HexDigits[(iNumber >> 12) & 0x0f];
- pString[3] = HexDigits[(iNumber >> 8) & 0x0f];
- pString[0] = HexDigits[(iNumber >> 4) & 0x0f];
- pString[1] = HexDigits[(iNumber) & 0x0f];
-
- pString[8] = 0;
-
-}
-
-
-///////////////////////////////////////////////////////////////
-// equiv to strcat i imagine
-void PrintToString(char *pString, char *pOtherString)
-{
- while (*pOtherString != 0) {
- *pString = *pOtherString;
- *pString++;
- *pOtherString++;
- }
-}
-
-///////////////////////////////////////////////////////////////
-// converts "ff" -> 0xff
-unsigned char StringToByte(char *pString)
-{
- unsigned char ucValue = 0;
-
- for (int i = 0; i < 2; i++) {
- ucValue = ucValue << 4;
- switch(pString[i]) {
- case '0':
- break;
- case '1':
- ucValue |= (0x01);
- break;
- case '2':
- ucValue |= (0x02);
- break;
- case '3':
- ucValue |= (0x03);
- break;
- case '4':
- ucValue |= (0x04);
- break;
- case '5':
- ucValue |= (0x05);
- break;
- case '6':
- ucValue |= (0x06);
- break;
- case '7':
- ucValue |= (0x07);
- break;
- case '8':
- ucValue |= (0x08);
- break;
- case '9':
- ucValue |= (0x09);
- break;
- case 'a':
- ucValue |= (0x0a);
- break;
- case 'b':
- ucValue |= (0x0b);
- break;
- case 'c':
- ucValue |= (0x0c);
- break;
- case 'd':
- ucValue |= (0x0d);
- break;
- case 'e':
- ucValue |= (0x0e);
- break;
- case 'f':
- ucValue |= (0x0f);
- break;
-
- }
- }
-
- return ucValue;
-}
-
-///////////////////////////////////////////////////////////////
-// Sends a package with the program offsets to GDB
-// Of some reason all offsets should be NULL.
-void SendOffsets()
-{
- char String[255];
- int a = 0;//(int)&__text_start;
- int b = 0;//(int)&__data_start;
- int c = 0;//(int)&__bss_start;
-
- PrintToString(String, "Text=");
- HexToString(&String[5], a);
- PrintToString(&String[5+8], ";Data=");
- HexToString(&String[5+8+6], b);
- PrintToString(&String[5+8+6+8], ";Bss=");
- HexToString(&String[5+8+6+8+5], c);
- String[5+8+6+8+5+8] = 0;
-
- SendCommand((unsigned char *)String);
-}
-
-///////////////////////////////////////////////////////////////
-// This function dumps all registers to GDB
-// It utilizes the SendCommandSize function to split the package.
-void DumpRegisters()
-{
- char Buffer[0x100];
- // Ugly hack so far.
-
- for (int i = 0; i < 21; i++) {
- //g_Registers[i] = i;
- HexToStringBW(&Buffer[i * 8], g_Registers[i]);
- }
- Buffer[21*8] = 0;
- SendCommandSize((unsigned char *)Buffer, -1 * (21 * 8 + 4));
- for (int i = 0; i < 21; i++) {
- //g_Registers[20 + i] = i;
- HexToStringBW(&Buffer[i * 8], g_Registers[21 + i]);
- }
- Buffer[21*8] = 0;
-
- SendCommandSize((unsigned char *)Buffer, (21 * 8) + 4);
-}
-
-///////////////////////////////////////////////////////////////
-// This function extracts an address from a string.
-void *GetAddr(char *pBuffer)
-{
- int iAddr;
- int i = 0;
- iAddr = 0;
-
- while (pBuffer[i] != ',') {
- iAddr = iAddr << 4;
- switch(pBuffer[i]) {
- case '0':
- //iAddr |=
- break;
- case '1':
- iAddr |= (0x01);
- break;
- case '2':
- iAddr |= (0x02);
- break;
- case '3':
- iAddr |= (0x03);
- break;
- case '4':
- iAddr |= (0x04);
- break;
- case '5':
- iAddr |= (0x05);
- break;
- case '6':
- iAddr |= (0x06);
- break;
- case '7':
- iAddr |= (0x07);
- break;
- case '8':
- iAddr |= (0x08);
- break;
- case '9':
- iAddr |= (0x09);
- break;
- case 'a':
- iAddr |= (0x0a);
- break;
- case 'b':
- iAddr |= (0x0b);
- break;
- case 'c':
- iAddr |= (0x0c);
- break;
- case 'd':
- iAddr |= (0x0d);
- break;
- case 'e':
- iAddr |= (0x0e);
- break;
- case 'f':
- iAddr |= (0x0f);
- break;
-
- }
- i++;
- }
- return (void *)iAddr;
-}
-///////////////////////////////////////////////////////////////
-// This function does pretty much the same, but returns an int
-// I know, some redundant code.
-int GetBytes(char *pBuffer)
-{
- int iBytes = 0;
- int i = 0;
-
-
- while ((pBuffer[i] != '#') && (pBuffer[i] != ':')) {
- iBytes = iBytes << 4;
- switch(pBuffer[i]) {
- case '0':
- //iAddr |=
- break;
- case '1':
- iBytes |= 0x01;
- break;
- case '2':
- iBytes |= 0x02;
- break;
- case '3':
- iBytes |= 0x03;
- break;
- case '4':
- iBytes |= 0x04;
- break;
- case '5':
- iBytes |= 0x05;
- break;
- case '6':
- iBytes |= 0x06;
- break;
- case '7':
- iBytes |= 0x07;
- break;
- case '8':
- iBytes |= 0x08;
- break;
- case '9':
- iBytes |= 0x09;
- break;
- case 'a':
- iBytes |= 0x0a;
- break;
- case 'b':
- iBytes |= 0x0b;
- break;
- case 'c':
- iBytes |= 0x0c;
- break;
- case 'd':
- iBytes |= 0x0d;
- break;
- case 'e':
- iBytes |= 0x0e;
- break;
- case 'f':
- iBytes |= 0x0f;
- break;
-
- }
-
- i++;
- }
- return iBytes;
-}
-
-///////////////////////////////////////////////////////////////
-// This function reads memory and sends it back to GDB.
-void SendMemory(void *pAddr, int iBytes)
-{
- unsigned char *pData;
- unsigned char iData;
- int iBufferPos = 0;
- int iBytesToSend;
- char Byte;
- int i;
-
- pData = (unsigned char *)pAddr;
-
-
- do {
- if (iBytes > 100) {
- iBytesToSend = 100;
- iBytes -= 100;
- } else {
- iBytesToSend = iBytes;
- iBytes = 0;
- }
- iBufferPos = 0;
- for (i = 0; i < iBytesToSend; i+=1) {
- iData = *pData++;
- g_TempBuffer[iBufferPos++] = HexDigits[(iData & 0xf0) >> 4];
- g_TempBuffer[iBufferPos++] = HexDigits[(iData & 0x0f)];
-
- }
- if (iBytes > 0) {
- // This mean that we have not yet sent our last command.
- g_TempBuffer[iBufferPos] = 0;
- SendCommandSize((unsigned char *)g_TempBuffer, -1 * (i + 1 + 4));
- }
- } while (iBytes > 0 );
- g_TempBuffer[iBufferPos] = 0;
- SendCommand((unsigned char *)g_TempBuffer);
-}
-
-
-
-///////////////////////////////////////////////////////////////
-// Does pretty much what it says.
-void WriteMemory(void *pAddr, unsigned int uiBytes, char *pHexString)
-{
- unsigned char *pData = ((unsigned char *)pAddr);
- unsigned int uiOffset = 0;
- unsigned char ucByte;
-
- //Printf("0x%x 0x%x", pAddr, uiBytes);
- for (unsigned int i = 0; i < uiBytes ; i++) {
- ucByte = StringToByte(&pHexString[uiOffset]);
- //Printf("0x%x", ucByte);
- *pData++ = ucByte;
- uiOffset += 2;
- }
- /*
- while (1);
- unsigned int *piData = (unsigned int *)pAddr;
- *piData = 0xe7ffdefe;//0xfedeffe7;
- */
-
-}
-
-
-///////////////////////////////////////////////////////////////
-// Sends the required information about a trap
-// TODO: correct numbers need to be placed there.
-void SendBreakPoint()
-{
- int iOffset = 0;
-
- g_TempBuffer[iOffset++] = 'T';
- g_TempBuffer[iOffset++] = '0';
- g_TempBuffer[iOffset++] = '5';
- g_TempBuffer[iOffset++] = '0';
- g_TempBuffer[iOffset++] = 'd';
- g_TempBuffer[iOffset++] = ':';
- HexToStringBW(&g_TempBuffer[iOffset], g_Registers[_REG_SP]);
- iOffset += 8;
- g_TempBuffer[iOffset++] = ';';
- g_TempBuffer[iOffset++] = '0';
- g_TempBuffer[iOffset++] = 'b';
- g_TempBuffer[iOffset++] = ':';
- HexToStringBW(&g_TempBuffer[iOffset], g_Registers[_REG_FP]);
- iOffset += 8;
- g_TempBuffer[iOffset++] = ';';
- g_TempBuffer[iOffset++] = '0';
- g_TempBuffer[iOffset++] = 'f';
- g_TempBuffer[iOffset++] = ':';
- HexToStringBW(&g_TempBuffer[iOffset], g_Registers[_REG_PC]);
- iOffset += 8;
- g_TempBuffer[iOffset++] = ';';
- g_TempBuffer[iOffset] = 0;
-
- SendCommand((unsigned char *)g_TempBuffer);
-
-
-
-
-}
-
-
-///////////////////////////////////////////////////////////////
-// Finds a character in a string and returns the offset.
-int FindChar(char *pBuffer, char sign)
-{
- int iRetVal = 0;
-
- while (*pBuffer != sign) {
- iRetVal++;
- *pBuffer++;
- }
- return iRetVal;
-}
-
-
-// Attibute naked.
-///////////////////////////////////////////////////////////////
-// This is the ISR(Interrupt Service Routine) which handles
-// All traps, it's basically a context switcher.
-void ISR() __attribute__ ((naked));
-void ISR()
-{
- // Lets snatch the registers!
-
- asm volatile(" \n"
- " str r4, [%0, #0x10] \n"
- " str r5, [%0, #0x14] \n"
- " str r6, [%0, #0x18] \n"
- " str r7, [%0, #0x1C] \n"
- " str r8, [%0, #0x20] \n"
- " str r9, [%0, #0x24] \n"
- " str r10, [%0, #0x28] \n"
- " str r11, [%0, #0x2C] \n"
- " str r12, [%0, #0x30] \n"
-
- " str r14, [%0, #0x3C] \n"
-
- " @// skip 8 * 12byte(96bit) = 0x60 \n"
-
- " mov r4, %0 \n"
- " ldmia sp!, {r0, r1, r2, r3} \n"
- " str r0, [r4, #0x00] \n"
- " str r1, [r4, #0x04] \n"
- " str r2, [r4, #0x08] \n"
- " str r3, [r4,#0x0C] \n"
-
- " mrs r1, SPSR \n"
- " str r1, [r4, #0x48] \n"
- " str r1, [r4,#0xA0] \n"
- " str r1, [r4,#0xA4] \n"
-
- " mrs r1, CPSR \n"
- " mov r2, r1 \n"
-
-
- " @// Let us set the mode to supervisor so we can get r13 and r14 \n"
- " bic r1, r1, #0x1f \n"
- " orr r1, r1, #0x13 \n"
- " msr CPSR_c, r1 \n"
- " @// Just remember that we're in the supervisor stack aswell now \n"
- " str r13, [r4,#0x34] \n"
- " str r14, [r4,#0x38] \n"
- " @// Lets move back to whatever mode we was in. \n"
- " @// Make sure that IRQ's are turned on \n"
- " bic r2, r2, #0x80 \n"
- " msr CPSR_fsxc, r2 \n"
-
-
-
-
- " \n"
- :
- : "r" (g_Registers)
- : "%0", "r1", "r2", "r4");
-
-
- // Get Current CSPR and save LR
- asm volatile(" \n"
- " mrs r0, CPSR \n"
- " str r0, [%0] \n"
-
- " str r14, [%1, #0x40] \n"
- " str r0, [%1, #0x44] \n"
- " str r13, [%1, #0x4C] \n"
- " \n"
- :
- : "r" (&g_CurrentCSPR), "r" (g_Registers)
- : "r0");
-
-
- switch(g_CurrentCSPR & 0x1f) {
- case 0x10: // USER
- g_iTrap = 0;
- break;
- case 0x11: // FIQ
- g_iTrap = 1;
- break;
- case 0x12: // IRQ
- g_iTrap = 2;
- break;
- case 0x13: // Supervisor
- g_iTrap = 3;
- break;
- case 0x17: // Abort
- g_iTrap = 4;
- break;
- case 0x1B: // Undefined/Breakpoint
- // We cannot continue like this!
- g_Registers[15] -= 4;
- g_Registers[16] -= 4;
- g_iTrap = 5;
- break;
- case 0x1F: // System
- g_iTrap = 6;
- break;
- default:
- g_iTrap = -1;
- }
-
-
- #ifdef USE_PRINTF
- Printf("Trap@0x%x:%d", g_Registers[15], g_iTrap);
- #endif
- /*
- switch (g_iTrap) {
- case MODE_USER:
- break;
- case MODE_FIQ:
- break;
- case MODE_IRQ:
- break;
- case MODE_SUPERVISOR:
- break;
- case MODE_ABORT:
- break;
- case MODE_UNDEF:
- break;
- case MODE_SYSTEM:
- break;
- case MODE_DUNNO:
- default:
- while (1);
- }
- */
- SendBreakPoint();
- BreakPoint();
-
- //Printf("0x%x 0x%x", g_Registers[15], g_Registers[16]);
- // Okay, it's time to continue.
-
-
- switch (g_iTrap) {
- case MODE_USER:
- //Printf("Dunno!!\n");
- break;
- case MODE_FIQ:
- //Printf("Dunno!!\n");
- break;
- case MODE_IRQ:
- //Printf("Dunno!!\n");
- break;
- case MODE_SUPERVISOR:
- //Printf("Dunno!!\n");
- break;
- case MODE_ABORT:
- asm volatile(" \n"
- " mov r10, #0 \n"
- " @Invalidate I&D cache \n"
- " mcr p15, 0, r10, c7, c7 \n"
- " @ restore the registers \n"
- " ldr r1,[%0, #0x04] \n"
- " ldr r2,[%0, #0x08] \n"
- " ldr r4,[%0, #0x10] \n"
- " ldr r5,[%0, #0x14] \n"
- " ldr r6,[%0, #0x18] \n"
- " ldr r7,[%0, #0x1C] \n"
- " ldr r8,[%0, #0x20] \n"
- " ldr r9,[%0, #0x24] \n"
- " ldr r10,[%0, #0x28] \n"
- " ldr r11,[%0, #0x2C] \n"
- " ldr r12,[%0, #0x30] \n"
- " ldr r14,[%0, #0x40] \n"
- " ldr r0, [%0, #0x44] \n"
- " msr CPSR_fsxc, r0 \n"
- " ldr r0, [%0, #0x48] \n"
- " msr SPSR_fsxc, r0 \n"
-
- " ldr r0,[%0, #0x00] \n"
- " ldr r3,[%0, #0x0C] \n"
-
- " subs pc, lr, #0x04 \n"
-
- " \n"
- :
- :"r" (g_Registers)
- :"r0");
- break;
- case MODE_UNDEF:
- // This will be the breakpoint i'm gonna test with.
- asm volatile(" \n"
- " mov r10, #0 \n"
- " @Invalidate I&D cache \n"
- " mcr p15, 0, r10, c7, c7 \n"
- " @ restore the registers \n"
- " ldr r1,[%0, #0x04] \n"
- " ldr r2,[%0, #0x08] \n"
- " ldr r4,[%0, #0x10] \n"
- " ldr r5,[%0, #0x14] \n"
- " ldr r6,[%0, #0x18] \n"
- " ldr r7,[%0, #0x1C] \n"
- " ldr r8,[%0, #0x20] \n"
- " ldr r9,[%0, #0x24] \n"
- " ldr r10,[%0, #0x28] \n"
- " ldr r11,[%0, #0x2C] \n"
- " ldr r12,[%0, #0x30] \n"
- " ldr r14,[%0, #0x40] \n"
- " ldr r0, [%0, #0x44] \n"
- " msr CPSR_fsxc, r0 \n"
- " ldr r0, [%0, #0x48] \n"
- " msr SPSR_fsxc, r0 \n"
-
- " ldr r0,[%0, #0x00] \n"
- " ldr r3,[%0, #0x0C] \n"
- " @ The subbing has already been done! \n"
- " @subs pc, lr, #0x04 \n"
- " movs pc, lr \n"
- " \n"
- :
- :"r" (g_Registers)
- :"r0");
-
-
- break;
- case MODE_SYSTEM:
- //Printf("Dunno!!\n");
- break;
- case MODE_DUNNO:
- default:
- //Printf("Dunno!!\n");
- while (1);
- }
-
-
-
-
-}
-
-///////////////////////////////////////////////////////////////
-// Returns which exception occured based on CSPR
-int GetException(unsigned int CSPR)
-{
- switch(CSPR & 0x1f) {
- case 0x10: // USER
- return 0;
- case 0x11: // FIQ
- return 1;
- case 0x12: // IRQ
- return 2;
- case 0x13: // Supervisor
- return 3;
- case 0x17: // Abort
- return 4;
- case 0x1B: // Undefined/Breakpoint
- return 5;
- case 0x1F: // System
- return 6;
- default:
- return -1;
- }
-}
-
-
-///////////////////////////////////////////////////////////////
-// Installs the ISR address into the system RAM
-void InstallISR()
-{
- int *pPointer = (int *)(0x0c7ac040);
- int *pPointer2 = (int *)(0x0c7ac018);
-
- void (*pISR)();
-
- pISR = ISR;
-
- *pPointer = (int)pISR;
- *pPointer2 = (int)pISR;
-
-}
-
-void DEBUG_Print(char *pFormat, ...)
-{
- char Temp[0x100];
- va_list VaList;
- int iLength;
- int iOffset;
- unsigned char MyChar;
-
- if (!g_GDBConnected) return;
-
- va_start(VaList , pFormat);
- vsnprintf(Temp, 0x100, pFormat , VaList);
- va_end(VaList);
-
- iLength = strlen(Temp);
- if (iLength > 100) iLength = 100;
-
- g_TempBuffer[0] = 'O';
- iOffset = 1;
- for (int i = 0; i < iLength; i++) {
- MyChar = (unsigned char)Temp[i];
- g_TempBuffer[iOffset++] = HexDigits[(MyChar & 0xf0) >> 4];
- g_TempBuffer[iOffset++] = HexDigits[(MyChar & 0x0f)];
- }
- g_TempBuffer[iOffset] = 0;
- SendCommand((unsigned char *)g_TempBuffer);
-
-}
-
-
-///////////////////////////////////////////////////////////////
-// The main thread when the GDB thread has control
-void BreakPoint()
-{
- unsigned int *pNextInstruction;
- bool bBreakLoop = false;
- int iResult;
- int iMessageLength;
- int iOffsetAdd;
- int iNullVal = 0;
- void *pAddr;
- int iOffset;
- int iBytes;
-
-
- // Find out if we got here through a STEP command
- if (g_LastWasStep) {
- #ifdef USE_PRINTF
- Printf("I:0x%x 0x%x", *((unsigned int *)(g_Registers[15] + 4)), *((unsigned int *)(g_Registers[15])));
- Printf("S: 0x%x", g_StepAddress);
- #endif
- if ((unsigned int)g_Registers[15] == g_StepAddress) {
- // Yes it was, Lets restore the instruction.
- *((unsigned int *)g_StepAddress) = g_SavedStepInstruction;
- #ifdef USE_PRINTF
- Printf("Restore: 0x%x", g_SavedStepInstruction);
- #endif
- } else {
- while (1);
- }
- g_LastWasStep = false;
- }
-
-
- while (!bBreakLoop) {
- iResult = RecvUSB(g_ReadBuffer, 0x100);
- //Printf("%d\n", iResult);
-
- if (iResult > 0) {
- // If we recieve a package we can assume that GDB is connected.. or smth..:D
- g_GDBConnected = true;
- // Well, we have recieved a package, lets print the contents.
- iMessageLength = *(int *)&g_ReadBuffer[0];
- g_ReadBuffer[4 + iMessageLength] = 0;
- //Printf("%s\n %d", &g_ReadBuffer[4], iMessageLength);
-
- // Let us also send an ACK '+'
- (*(int *)&g_SendBuffer[0]) = 1;
- g_SendBuffer[4] = '+';
- SendUSB((const void *)g_SendBuffer, 0x100);
- WaitACK();
-
- // I can see that i get a bunch of '+' and '-' in the messages.. lets remove them.
- iOffsetAdd = 4;
- while ((g_ReadBuffer[iOffsetAdd] == '+') || (g_ReadBuffer[iOffsetAdd] == '-')) iOffsetAdd++;
-
- // Check whether it's legimit command
- if (g_ReadBuffer[iOffsetAdd] == '$') {
- // Well it is!
- switch(g_ReadBuffer[iOffsetAdd + 1]) {
- case 'H': // Set thread, we're not having any threads.. so.. just return OK
- SendCommand((unsigned char *)"OK");
- break;
- case 'q': // Query, there are some queries, but GDB first asks for Offsets
- switch(g_ReadBuffer[iOffsetAdd + 2]) {
- case 'O': // Offsets
- SendOffsets();
- break;
- case 'C':
- SendCommand((unsigned char *)"QC0000");
- //SendBreakPoint();
- break;
-
- }
- break;
- case '?':
- // This will have to be modified later to send the correct signal.
- SendBreakPoint();
- break;
- case 'g':
- DumpRegisters();
- break;
- case 'm':
- pAddr = GetAddr(&g_ReadBuffer[iOffsetAdd + 2]);
- iOffset = FindChar(&g_ReadBuffer[iOffsetAdd + 2], ',');
- iBytes = GetBytes(&g_ReadBuffer[iOffsetAdd + 2 + iOffset]);
- SendMemory(pAddr, iBytes);
- break;
- case 'X': //Write memory binary, which we DON't support.. ofcourse.
- UnSupportedCommand();
- break;
- case 'P': // Write register
- {
- SendCommand((unsigned char *)"OK");
-
- }
- break;
- case 'M': // Write memory not binary
- {
- pAddr = GetAddr(&g_ReadBuffer[iOffsetAdd + 2]);
- iOffset = FindChar(&g_ReadBuffer[iOffsetAdd + 2], ',');
- iBytes = GetBytes(&g_ReadBuffer[iOffsetAdd + 2 + iOffset]);
- iOffset = FindChar(&g_ReadBuffer[iOffsetAdd + 2], ':');
- WriteMemory(pAddr, iBytes, &g_ReadBuffer[iOffsetAdd + 2 + iOffset + 1]);
- SendCommand((unsigned char *)"OK");
-
- }
- break;
- case 'c': // continue
- {
- return;
-
- }
- break;
-
- case 's': // Stepping.
- {
- // Get the address of the next instruction.
- pNextInstruction = GetNextInstruction((unsigned int *)g_Registers[15]);
-
- // Read whatsever there.
- g_SavedStepInstruction = *pNextInstruction;
- g_StepAddress = (unsigned int)pNextInstruction;
- g_LastWasStep = true;
-
- //Printf("Curr: 0x%x", g_Registers[15]);
- #ifdef USE_PRINTF
- Printf("Next: 0x%x->0x%x", g_Registers[15], pNextInstruction);
- #endif
- //Printf("Trap: 0x%x", GetException((unsigned int)g_Registers[40]));
- // Write a breakpoint instruction to the address.
- *pNextInstruction = 0xe7ffdefe;
- return;
-
- }
- break;
- case 'Z': // BreakPoint.
- {
- switch(g_ReadBuffer[iOffsetAdd + 2]) {
- case '0':
- // Software breakpoint, i think it's up to me to add, it, lets send OK for now.
- UnSupportedCommand();
- break;
- default:
- // We only support software breakpoints for now, lets return unsupported.
- // Actually we don't even support SW breakpoints now
- UnSupportedCommand();
- break;
- }
- }
- break;
-
- default:
- UnSupportedCommand();
- break;
-
- }
- }
-
- }
-
- }
-
-}
-
-///////////////////////////////////////////////////////////////
-// Tries to find the next instruction to be executed after a break
-unsigned int *GetNextInstruction(unsigned int *pAddr)
-{
- unsigned int uiInstruction = *pAddr;
- unsigned int uiAndVal = 0;
- unsigned int iNewPC = 0;
- int iNewAddr = 0;
- int iRegsbeforePC = 0;
- unsigned int uiBaseRegister = 0;
- unsigned int uiRegVal = 0;
- unsigned int uiData = 0;
- unsigned int uiCondMask = 0;
- int iPCOffset = 0;
-
- unsigned int uiNewPC = DecodeInstruction(uiInstruction, (unsigned int)pAddr);
- return (unsigned int *)uiNewPC;
-
-
- // Set new PC to pAddr + 4, because we really hope that is the case...:D
- iNewPC = (unsigned int)pAddr;
- iNewPC += 4; // Next instruction (atleast in ARM mode, we don't support thumb yet)
-
- // Now it's a good point to find out if the instruction would be executed anyway.
- uiCondMask = (uiInstruction & 0xf0000000) >> 28;
-
- if (CondWillExecute(uiCondMask, (unsigned int)g_Registers[18])) {
- //Printf("Condition will execute");
- // Find out if it's a B or BL instruction. (This is the easy one)
- if ((uiInstruction & 0xE000000 ) == 0xA000000) {
- #ifdef USE_PRINTF
- Printf("0x%x", uiInstruction);
- #endif
- // Okay, it's a branch instruction, lets get the address it's for
- iNewAddr = uiInstruction & 0xffffff;
- // We might need to sign extend this instruction.
- if ((iNewAddr & 0x00800000) != 0) {
- #ifdef USE_PRINTF
- printf("Sign extending");
- #endif
- //iNewAddr *= -1;
- iNewAddr |= 0xff000000;
- }
- #ifdef USE_PRINTF
- Printf("0x%x", iNewAddr);
- #endif
- iNewAddr *= 4; // Instruction size.
- iNewPC = ((int)pAddr + iNewAddr + 8);
- }
-
- // Well, it might be a ldm(ea)?
-
- if ((uiInstruction & 0xE000000) == 0x8000000) {
- #ifdef USE_PRINTF
- Printf("LDM");
- #endif
- // this is a LDM/STM alright.
- if ((uiInstruction & 0x100000) != 0) {
- // This is a LDM instruction
- // Lets see if the PC is ever loaded.
- #ifdef USE_PRINTF
- Printf("includes PC");
- #endif
- if ((uiInstruction & 0x8000) != 0) {
- // Well (damn the PC is loaded)
- for (int i = 0; i < 15; i++) {
- uiAndVal = 1 << i;
- if ((uiInstruction & uiAndVal) != 0) iRegsbeforePC++;
- }
- #ifdef USE_PRINTF
- Printf("%d regs", iRegsbeforePC);
- #endif
- /*
- <mr_spiv> da = fa
- <mr_spiv> ia = fd
- <mr_spiv> db = ea
- <mr_spiv> ib = ed
- */
- // Lets find out which register is used as base for this operation.
- uiBaseRegister = (uiInstruction & 0xF0000) >> 16;
- uiRegVal = ((unsigned int *)g_Registers)[uiBaseRegister];
- // First, have a look at the U bit.
- if ((uiInstruction & (1 << 23)) != 0) {
-
- // Transfer is made descending
- // Which also means that the PC is closest to the base register i just found out.
- // Lets check the P bit (If i'm supposed to increment before or after.
-
- iPCOffset = iRegsbeforePC * 4;
- if (((uiInstruction) & (1 << 24)) != 0) iPCOffset += 4;
-
- } else {
- // Transfer is done ascending
- // Lets check the P bit (If i'm supposed to decrement before or after.
- if (((uiInstruction) & (1 << 24)) != 0) iPCOffset = -4;
- }
-
-
- iNewPC = *(unsigned int *)((((int)uiRegVal) + iPCOffset) & ~0x03);
- }
- }
- }
-
- // Check if it's a mov pc, Rn
-
- }
-
- return (unsigned int *)iNewPC;
-}
-
-///////////////////////////////////////////////////////////////
-// Determines if uiCond will be true with this CSPR
-bool CondWillExecute(unsigned int uiCond, unsigned int CSPR)
-{
-
- switch(uiCond) {
- case 0: // EQ
- // This is true if Z is set in CSPR
- if ((CSPR & (1 << 30)) != 0) return true;
- else return false;
- case 1: // NE
- // This should be true if Z is not set.
- if ((CSPR & (1 << 30)) == 0) return true;
- else return false;
- case 2: // CS/HS
- // this one should be true if C is set.
- if ((CSPR & (1 << 29)) != 0) return true;
- else return false;
- case 3: // CC/LO
- // this one should be true if C is clear.
- if ((CSPR & (1 << 29)) == 0) return true;
- else return false;
- case 4: // MI
- // this one should be true if N is set
- if ((CSPR & (1 << 31)) != 0) return true;
- else return false;
- case 5: // PL
- // this one should be true if N is clear.
- if ((CSPR & (1 << 31)) == 0) return true;
- else return false;
- case 6: // VS
- // this one should be true if V is set
- if ((CSPR & (1 << 28)) != 0) return true;
- else return false;
- case 7: // VC
- // this one should be true if V is clear.
- if ((CSPR & (1 << 28)) == 0) return true;
- else return false;
- case 8: // HI
- // This is true if C and Z is clear
- if (((CSPR & (1 << 30)) == 0) && ((CSPR & (1 << 29)) == 0)) return true;
- else return false;
- case 9: // LS
- // C clear OR Z set
- if (((CSPR & (1 << 29)) == 0) || ((CSPR & (1 << 30)) != 0)) return true;
- else return false;
- case 10: // GE
- // N set AND V set || N clear and V clear
- if ((CSPR & (1 << 31)) == (CSPR & (1 << 28))) return true;
- else return false;
- case 11: // LT
- // N != V
- if ((CSPR & (1 << 31)) != (CSPR & (1 << 28))) return true;
- else return false;
- case 12: // GT
- // Z == 0, N == V
- if (((CSPR & (1 << 30)) == 0) && ((CSPR & (1 << 31)) == (CSPR & (1 << 28)))) return true;
- else return false;
- case 13: // LE
- if (((CSPR & (1 << 30)) == 1) && ((CSPR & (1 << 31)) != (CSPR & (1 << 28)))) return true;
- else return false;
- case 14: // AL
- return true;
- default:
- break;
- }
-
-
-}
-// I got the idea for this layout from the singlestep.c (found in eCos)
-// But i thought the code was a bit tricky to port, and i wanna learn more about this anyway so, i'll just do smth similar to that
-
-
-
-typedef struct
-{
- unsigned Rm : 4; // Rm
- unsigned resv2 : 1; // Reserved 2 (0)
- unsigned shift : 2; // hmm.. dunno actually but probably (LSL, LSR, ASR, ROR )
- unsigned amount : 5; // Shift amount 0-31
- unsigned Rd : 4; // Rd
- unsigned Rn : 4; // Rn
- unsigned s : 1; // S-flag
- unsigned opcode : 4; // Opcode (Mov etc)
- unsigned resv1 : 3; // Reserved 1 (000)
- unsigned cond : 4; // Condition
-
-} dpisr; // Data Processing Immediate Register Shift
-#define DPISR_R1 0
-#define DPISR_R2 0
-// Example <opcode> Rd, Rm, <shift> amount
-typedef struct
-{
- unsigned Rm : 4; // Rm
- unsigned resv3 : 1; // Reserved 3 (1)
- unsigned shift : 2; // (LSL, LSR, ASR, ROR )
- unsigned resv2 : 1; // Reserved 2 (0)
- unsigned Rs : 4; // Rs
- unsigned Rd : 4; // Rd
- unsigned Rn : 4; // Rn
- unsigned s : 1; // S-flag
- unsigned opcode : 4; // Opcode
- unsigned resv1 : 3; // Reserved 1 (000)
- unsigned cond : 4; // Condition
-} dprrs; // Data Processing Register Register Shift
-#define DPRRS_R1 0
-#define DPRRS_R2 0
-#define DPRRS_R3 1
-// Example <opcode> Rd, Rn, Rm <shift> Rs
-// This intruction is unpredictable if R15 is one of the used registers anyway.
-typedef struct
-{
- unsigned immed : 8; // Immediate value
- unsigned rotate : 4; // rotate
- unsigned Rd : 4; // Rd
- unsigned Rn : 4; // Rn
- unsigned s : 1; // S-flag
- unsigned opcode : 4; // Opcode
- unsigned resv1 : 3; // Reserved 1 (001)
- unsigned cond : 4; // Condition
-} dpi; // Data processing immediate
-// example add r0, r1, (ror <immed>, <rotate * 2>)
-#define DPI_R1 1
-
-typedef struct
-{
- unsigned immed : 12; // Immediate
- unsigned Rd : 4; // Rd
- unsigned Rn : 4; // Rn
- unsigned L : 1; // L-bit (Load/Store)?
- unsigned W : 1; // W-bit
- unsigned B : 1; // B-bit
- unsigned U : 1; // U-bit
- unsigned p : 1; // P-bit
- unsigned resv1 : 3; // Reserved 1 (010)
- unsigned cond : 4; // Condition
-} lsio; // Load/store immediate offset
-// Example ldr Rd, [Rn, #<immed>]
-#define LSIO_R1 2
-
-
-typedef struct
-{
- unsigned Rm : 4; // Rm
- unsigned resv2 : 1; // Reserved 2 (0)
- unsigned shift : 2; // Shit type (LSL, LSR, ASR, ROR )
- unsigned amount : 5; // Shift amount (0-31)
- unsigned Rd : 4; // Rd
- unsigned Rn : 4; // Rn
- unsigned L : 1; // L-bit (Load/Store)?
- unsigned W : 1; // W-bit
- unsigned B : 1; // B-bit
- unsigned U : 1; // U-bit
- unsigned p : 1; // P-bit
- unsigned resv1 : 3; // Reserved 1 (011)
- unsigned cond : 4; // Condition
-} lsro; // Load/Store register offset
-// Example ldr Rd, [Rn + Rm lsl 5]
-#define LSRO_R1 3
-#define LSRO_R2 0
-
-
-typedef struct
-{
- unsigned regs : 16; // Register mask
- unsigned Rn : 4; // Rn
- unsigned L : 1; // L-bit (Load/Store)?
- unsigned W : 1; // W-bit
- unsigned S : 1; // B-bit
- unsigned U : 1; // U-bit
- unsigned p : 1; // P-bit
-
- unsigned resv1 : 3; // Reserved 1 (100)
- unsigned cond : 4; // Condition
-} lsm; // Load store multiple
-// Example: ldm r0, {r1, r2, r3}
-#define LSM_R1 4
-
-typedef struct
-{
- unsigned offset : 24; // Branch offset
- unsigned link : 1; // Link flag
- unsigned resv1 : 3; // Reserved 1 (101)
- unsigned cond : 4; // Condition
-} bl; // Branch with link(optional)
-#define BL_R1 5
-
-typedef union {
- dpisr DPISR;
- dprrs DPRRS;
- dpi DPI;
- lsio LSIO;
- lsro LSRO;
- lsm LSM;
- bl BL;
- unsigned int uiInstruction;
-} Instruction;
-
-/*
-#define DPISR_R1 0
-#define DPISR_R2 0
-
-
-#define DPRRS_R1 0
-#define DPRRS_R2 0
-#define DPRRS_R3 1
-
-#define DPI_R1 1
-
-#define LSIO_R1 2
-
-#define LSRO_R1 3
-#define LSRO_R2 0
-
-#define LSM_R1 4
-
-#define BL_R1 5
-*/
-
-/*
- * Data Processiong Opcode field values
- */
-#define OPCODE_MOV 0xD
-#define OPCODE_MVN 0xF
-#define OPCODE_ADD 0x4
-#define OPCODE_ADC 0x5
-#define OPCODE_SUB 0x2
-#define OPCODE_SBC 0x6
-#define OPCODE_RSB 0x3
-#define OPCODE_RSC 0x7
-#define OPCODE_AND 0x0
-#define OPCODE_EOR 0x1
-#define OPCODE_ORR 0xC
-#define OPCODE_BIC 0xE
-#define OPCODE_CMP 0xA
-#define OPCODE_CMN 0xB
-#define OPCODE_TST 0x8
-#define OPCODE_TEQ 0x9
-
-/*
- * Shift field values
- */
-#define SHIFT_LSL 0x0
-#define SHIFT_LSR 0x1
-#define SHIFT_ASR 0x2
-#define SHIFT_ROR 0x3
-#define SHIFT_RRX 0x3 /* Special case: ROR(0) implies RRX */
-
-
-unsigned int DecodeDPISR(dpisr Instr, unsigned int PC);
-unsigned int DecodeDPRRS(dprrs Instr, unsigned int PC);
-unsigned int DecodeDPI(dpi Instr, unsigned int PC);
-unsigned int DecodeLSIO(lsio Instr, unsigned int PC);
-unsigned int DecodeLSRO(lsro Instr, unsigned int PC);
-unsigned int DecodeLSM(lsm Instr, unsigned int PC);
-unsigned int DecodeBL(bl Instr, unsigned int PC);
-
-
-///////////////////////////////////////////////////////////////
-//
-unsigned int DecodeInstruction(unsigned int uiInstruction, unsigned int PC)
-{
- Instruction myInstruction;
- unsigned int uiCondMask;
-
- uiCondMask = (uiInstruction & 0xf0000000) >> 28;
-
- // This instruction can do whatever it wants, but if it doesn't execute we don't give a shit.
- if (!CondWillExecute(uiCondMask, (unsigned int)g_Registers[18])) return PC + 4;
- //Printf("CondWillExec");
-
- myInstruction.uiInstruction = uiInstruction;
-
- // Start decoding.. phuu
-
- if ((myInstruction.DPISR.resv1 == DPISR_R1) && (myInstruction.DPISR.resv2 == DPISR_R2)) return DecodeDPISR(myInstruction.DPISR, PC);
- else if ((myInstruction.DPRRS.resv1 == DPRRS_R1) &&
- (myInstruction.DPRRS.resv2 == DPRRS_R2) &&
- (myInstruction.DPRRS.resv3 == DPRRS_R3)) return DecodeDPRRS(myInstruction.DPRRS, PC);
- else if ((myInstruction.DPI.resv1 == DPI_R1)) return DecodeDPI(myInstruction.DPI, PC);
- else if ((myInstruction.LSIO.resv1 == LSIO_R1)) return DecodeLSIO(myInstruction.LSIO, PC);
-
- else if ((myInstruction.LSRO.resv1 == LSRO_R1) &&
- (myInstruction.LSRO.resv2 == LSRO_R2)) return DecodeLSRO(myInstruction.LSRO, PC);
- else if (myInstruction.LSM.resv1 == LSM_R1) return DecodeLSM(myInstruction.LSM, PC);
- else if (myInstruction.BL.resv1 == BL_R1) return DecodeBL(myInstruction.BL, PC);
-
- return 0;
-}
-
-///////////////////////////////////////////////////////////////
-//
-unsigned int LSL(unsigned int uiValue, unsigned int uiSteps)
-{
- return uiValue << uiSteps;
-}
-
-///////////////////////////////////////////////////////////////
-//
-unsigned int LSR(unsigned int uiValue, unsigned int uiSteps)
-{
- return uiValue >> uiSteps;
-}
-
-///////////////////////////////////////////////////////////////
-//
-// This one could be trickier since, i'm nor sure if a signed shift really is a signed shift.
-unsigned int ASR(unsigned int uiValue, unsigned int uiSteps)
-{
- unsigned int uiSignMask = 0;
-
- // Check if it's a negative number
- if (uiValue & 0x80000000) {
- // Yes, damn
- uiSignMask = ((~0) << (32 - uiSteps));
- }
-
- return ((uiValue >> uiSteps) | uiSignMask);
-}
-
-///////////////////////////////////////////////////////////////
-//
-unsigned int ROR(unsigned int uiValue, unsigned int uiSteps)
-{
- unsigned int uiRetval;
-
- while (uiSteps-- > 0) {
- if (uiValue & 0x01) {
- uiValue = (uiValue >> 1) | 0x80000000;
- } else {
- uiValue = uiValue >> 1;
- }
- }
- return uiValue;
-}
-
-
-///////////////////////////////////////////////////////////////
-//
-unsigned int Shift_Operand(unsigned int Rm, unsigned int amount, unsigned int shift)
-{
- unsigned int uiRegisterValue;
-
-
-
-
- uiRegisterValue = g_Registers[Rm];
- if (Rm == 0x0f) {
- // Rm is PC, and PC is offseted by 8.
- uiRegisterValue += 8;
- }
-
- // Determine the shift mode.
- //(LSL, LSR, ASR, ROR )
- switch (shift) {
- case 0: // LSL
- return LSL(uiRegisterValue, amount);
- case 1: // LSR
- return LSR(uiRegisterValue, amount);
- case 2: // ASR
- return ASR(uiRegisterValue, amount);
- case 3: // ROR
- return ROR(uiRegisterValue, amount);
- default:
- break;
- }
- return 0;
-}
-
-///////////////////////////////////////////////////////////////
-//
-// Example <opcode> Rd, Rm, <shift> amount
-unsigned int DecodeDPISR(dpisr Instr, unsigned int uiPC)
-{
- unsigned int uiOperand = Shift_Operand(Instr.Rm, Instr.amount, Instr.shift);
- unsigned int uiRnVal = g_Registers[Instr.Rn];
-
-
-
- // Only do this i Pc is Rd
- if (Instr.Rd != 0x0f) return uiPC + 4;
-
- // The actual value that PC contains when executing this instruction is the instruction address+8
- if (Instr.Rn == 0x0f) uiRnVal += 8;
-
- // Check what opcode it is!
- switch (Instr.opcode) {
- case OPCODE_MOV:
- return uiOperand;
- case OPCODE_MVN:
- return ~uiOperand;
- case OPCODE_ADD:
- return uiRnVal + uiOperand;
- case OPCODE_ADC:
- return uiRnVal + uiOperand + (((g_Registers[18] & (1 << 29))) == 0?0:1);
- case OPCODE_SUB:
- return uiRnVal - uiOperand;
- case OPCODE_SBC:
- return uiRnVal - uiOperand - (((g_Registers[18] & (1 << 29))) == 0?1:0);
- case OPCODE_RSB:
- return uiOperand - uiRnVal;
- case OPCODE_RSC:
- return uiOperand - uiRnVal - (((g_Registers[18] & (1 << 29))) == 0?1:0);
- case OPCODE_AND:
- return (uiRnVal & uiOperand);
- case OPCODE_EOR:
- return (uiRnVal^uiOperand);
- case OPCODE_ORR:
- return (uiRnVal | uiOperand);
- case OPCODE_BIC:
- return (uiRnVal & ~uiOperand);
- default:
- return 0;
- }
-}
-
-
-///////////////////////////////////////////////////////////////
-//
-//dprrs; // Data Processing Register Register Shift
-// Example <opcode> Rd, Rn, Rm <shift> Rs
-unsigned int DecodeDPRRS(dprrs Instr, unsigned int uiPC)
-{
- unsigned int uiRmValue = g_Registers[Instr.Rm];
- unsigned int uiRsValue = g_Registers[Instr.Rs];
- unsigned int uiRnVal = g_Registers[Instr.Rn];
- if ((Instr.Rm = 0x0f)) uiRmValue += 8;
-
-
- unsigned int uiOperand = Shift_Operand(uiRmValue, uiRsValue, Instr.shift);
-
- // Check if destination is PC
- if (Instr.Rd != 0x0f) return uiPC + 4;
- if ((Instr.Rn = 0x0f)) uiRnVal += 8;
-
- // Check what opcode it is!
- switch (Instr.opcode) {
- case OPCODE_MOV:
- return uiOperand;
- case OPCODE_MVN:
- return ~uiOperand;
- case OPCODE_ADD:
- return uiRnVal + uiOperand;
- case OPCODE_ADC:
- return uiRnVal + uiOperand + (((g_Registers[18] & (1 << 29))) == 0?0:1);
- case OPCODE_SUB:
- return uiRnVal - uiOperand;
- case OPCODE_SBC:
- return uiRnVal - uiOperand - (((g_Registers[18] & (1 << 29))) == 0?1:0);
- case OPCODE_RSB:
- return uiOperand - uiRnVal;
- case OPCODE_RSC:
- return uiOperand - uiRnVal - (((g_Registers[18] & (1 << 29))) == 0?1:0);
- case OPCODE_AND:
- return (uiRnVal & uiOperand);
- case OPCODE_EOR:
- return (uiRnVal^uiOperand);
- case OPCODE_ORR:
- return (uiRnVal | uiOperand);
- case OPCODE_BIC:
- return (uiRnVal & ~uiOperand);
- default:
- return 0;
- }
-
-}
-
-///////////////////////////////////////////////////////////////
-//
-// dpi; // Data processing immediate
-// example add r0, r1, (ror <immed>, <rotate * 2>)
-unsigned int DecodeDPI(dpi Instr, unsigned int uiPC)
-{
- unsigned int uiOperand = (ROR(Instr.immed, Instr.rotate << 1));
- unsigned int uiRnVal = g_Registers[Instr.Rn];
-
- // Check if PC is destination
- if (Instr.Rd != 0x0f) return uiPC + 4; // Next instruction
- if ((Instr.Rn = 0x0f)) uiRnVal += 8;
-
- // Check what opcode it is!
- switch ((Instr.opcode)) {
- case OPCODE_MOV:
- return uiOperand;
- case OPCODE_MVN:
- return ~uiOperand;
- case OPCODE_ADD:
- return uiRnVal + uiOperand;
- case OPCODE_ADC:
- return uiRnVal + uiOperand + (((g_Registers[18] & (1 << 29))) == 0?0:1);
- case OPCODE_SUB:
- return uiRnVal - uiOperand;
- case OPCODE_SBC:
- return uiRnVal - uiOperand - (((g_Registers[18] & (1 << 29))) == 0?1:0);
- case OPCODE_RSB:
- return uiOperand - uiRnVal;
- case OPCODE_RSC:
- return uiOperand - uiRnVal - (((g_Registers[18] & (1 << 29))) == 0?1:0);
- case OPCODE_AND:
- return (uiRnVal & uiOperand);
- case OPCODE_EOR:
- return (uiRnVal^uiOperand);
- case OPCODE_ORR:
- return (uiRnVal | uiOperand);
- case OPCODE_BIC:
- return (uiRnVal & ~uiOperand);
- default:
- return 0;
- }
-
-}
-
-///////////////////////////////////////////////////////////////
-//
-// lsio; // Load/store immediate offset
-// Example ldr Rd, [Rn, #<immed>]
-unsigned int DecodeLSIO(lsio Instr, unsigned int uiPC)
-{
- unsigned int uiRnValue = g_Registers[Instr.Rn];
- unsigned int uiMemValue;
-
- // Check if destination is PC
- if (Instr.Rd != 0x0f) return uiPC + 4;
- // Check if it's a LDR instruction
- if (Instr.L != 1) return uiPC + 4;
-
- if (Instr.Rn == 0x0f) uiRnValue += 8;
-
- // Check if it's pre-indexed
- if (Instr.p == 1){
-
- if (Instr.U == 1) {
- // Add offset
- uiRnValue += Instr.immed;
- } else {
- // Sub offset
- uiRnValue -= Instr.immed;
- }
- }
-
- uiMemValue = *(unsigned int *)(uiRnValue);
-
- return uiMemValue;
-
-}
-
-///////////////////////////////////////////////////////////////
-//
-// lsro; // Load/Store register offset
-// Example ldr Rd, [Rn + Rm lsl 5]
-unsigned int DecodeLSRO(lsro Instr, unsigned int uiPC)
-{
- unsigned int uiRnValue = g_Registers[Instr.Rn];
- unsigned int uiRmValue = g_Registers[Instr.Rm];
- unsigned int uiIndex;
- unsigned int uiMemValue;
-
- if (Instr.Rm == 0x0f) uiRmValue += 8;
- if (Instr.Rn == 0x0f) uiRnValue += 8;
-
- // Check if destination is PC and that it's LDR instruction
- if ((Instr.Rd != 0x0f) || (Instr.L != 1)) return uiPC + 4;
-
- uiIndex = Shift_Operand(Instr.Rm, Instr.amount, Instr.shift);
-
- if (Instr.p == 1){
-
- if (Instr.U == 1) {
- // Add offset
- uiRnValue += uiIndex;
- } else {
- // Sub offset
- uiRnValue -= uiIndex;
- }
- }
-
- uiMemValue = *(unsigned int *)(uiRnValue);
-
- return uiMemValue;
-
-
-}
-///////////////////////////////////////////////////////////////
-//
-// lsm; // Load store multiple
-// Example: ldm r0, {r1, r2, r3}
-unsigned int DecodeLSM(lsm Instr, unsigned int uiPC)
-{
- unsigned int uiRnValue = g_Registers[Instr.Rn];
- unsigned int uiOffsetToPC = 0;
- unsigned int uiMemValue;
-
- // Make sure PC is destination and it's Load instruction
- if (((Instr.regs & (1 << 15)) == 0) || (Instr.L != 1)) return uiPC + 4;
-
-
- // Check if U bit it set
- if (Instr.U == 0) {
- // This means that it's ascending
- // Also means that the PC is closest to Rn
- if (Instr.p == 1) {
- // Pre decrement.
- uiOffsetToPC -= 4;
- } else {
- uiOffsetToPC = 0;
- }
- } else {
- // The stack is descending, that means that the PC is as far away as possible.
- // Lets find out how many registers before it.
- for (int i = 0; i < 15; i++) {
- if ((Instr.regs & (1 << i)) != 0) uiOffsetToPC += 4;
- }
-
- // If the P bit is set, it uses pre increment
- if (Instr.p == 1) uiOffsetToPC += 4;
- }
-
- // read from out calculated address.
- uiMemValue = *(unsigned int *)((uiRnValue + uiOffsetToPC) & ~0x03);
-
- return uiMemValue;
-
-}
-
-///////////////////////////////////////////////////////////////
-//
-// bl; // Branch with link(optional)
-unsigned int DecodeBL(bl Instr, unsigned int uiPC)
-{
- //Printf("Decode BL");
- unsigned int uiAddress;
-
- uiAddress = Instr.offset;
- if (uiAddress & 0x00800000) {
- uiAddress |= 0xff000000;
- }
-
- uiAddress <<= 2;
- uiAddress += 8;
-
- return uiPC + uiAddress;
-
-}
diff --git a/backends/platform/gp32/fontdata.c b/backends/platform/gp32/fontdata.c
deleted file mode 100644
index 56f778ce2c..0000000000
--- a/backends/platform/gp32/fontdata.c
+++ /dev/null
@@ -1,284 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- *
- */
-
-const unsigned char fontresEng1[] =
-{
- 0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x7E,0x81,0xA5,0x81,0x81,0xBD,0x81,0x7E,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x7E,0xFF,0xDB,0xFF,0xFF,0xC3,0xFF,0x7E,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x36,0x7F,0x7F,0x7F,0x7F,0x3E,0x1C,0x08,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x08,0x1C,0x3E,0x7F,0x3E,0x1C,0x08,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x18,0x3C,0x3C,0x7E,0x66,0x7E,0x18,0x3C,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x18,0x3C,0x3C,0x7E,0x7E,0x3C,0x18,0x3C,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x18,0x3C,0x3C,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0xFF,0xFF,0xFF,0xFF,0xE7,0xC3,0xC3,0xE7,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x3C,0x66,0x42,0x42,0x66,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0xFF,0xFF,0xFF,0xC3,0x99,0xBD,0xBD,0x99,0xC3,0xFF,0xFF,0xFF,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x0F,0x07,0x0D,0x19,0x3C,0x66,0x66,0x3C,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x3C,0x66,0x66,0x3C,0x18,0x7E,0x18,0x18,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x3C,0x33,0x3C,0x33,0x30,0x70,0xF0,0x70,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x7F,0x63,0x7F,0x63,0x63,0x67,0xE7,0xE6,0xC0,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x18,0x18,0xDB,0x3C,0xE7,0x3C,0xDB,0x18,0x18,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x40,0x60,0x70,0x7C,0x7F,0x7C,0x70,0x60,0x40,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x01,0x03,0x07,0x1F,0x7F,0x1F,0x07,0x03,0x01,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x18,0x3C,0x7E,0x18,0x18,0x7E,0x3C,0x18,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x33,0x33,0x33,0x33,0x33,0x00,0x33,0x33,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x7F,0xDB,0xDB,0xDB,0x7B,0x1B,0x1B,0x1B,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x3E,0x63,0x30,0x1C,0x36,0x63,0x63,0x36,0x1C,0x06,0x63,0x3E,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x7F,0x7F,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x18,0x3C,0x7E,0x18,0x18,0x7E,0x3C,0x18,0x7E,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x18,0x3C,0x7E,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x7E,0x3C,0x18,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x0C,0x06,0x7F,0x06,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x18,0x30,0x7F,0x30,0x18,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x60,0x60,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x24,0x66,0xFF,0x66,0x24,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x08,0x1C,0x1C,0x3E,0x3E,0x7F,0x7F,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x7F,0x7F,0x3E,0x3E,0x1C,0x1C,0x08,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x18,0x3C,0x3C,0x3C,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x66,0x66,0x66,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x36,0x36,0x7F,0x36,0x36,0x7F,0x36,0x36,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x18,0x18,0x3C,0x66,0x60,0x3C,0x06,0x06,0x66,0x3C,0x18,0x18,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x61,0x63,0x06,0x0C,0x18,0x30,0x63,0x43,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x1C,0x36,0x36,0x1C,0x3B,0x6E,0x66,0x3B,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x30,0x30,0x30,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x0C,0x18,0x30,0x30,0x30,0x30,0x18,0x0C,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x18,0x0C,0x06,0x06,0x06,0x06,0x0C,0x18,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x66,0x3C,0xFF,0x3C,0x66,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x18,0x18,0x18,0xFF,0x18,0x18,0x18,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x30,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x01,0x03,0x06,0x0C,0x18,0x30,0x60,0x40,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x3C,0x66,0x66,0x6E,0x76,0x66,0x66,0x3C,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x18,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x3C,0x66,0x66,0x06,0x0C,0x18,0x30,0x7E,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x3C,0x66,0x06,0x1C,0x06,0x06,0x66,0x3C,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x0C,0x1C,0x3C,0x6C,0x6C,0x7E,0x0C,0x0C,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x7E,0x60,0x60,0x7C,0x06,0x06,0x66,0x3C,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x3C,0x60,0x60,0x7C,0x66,0x66,0x66,0x3C,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x7E,0x06,0x06,0x0C,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x3C,0x66,0x66,0x3C,0x66,0x66,0x66,0x3C,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x3C,0x66,0x66,0x66,0x3E,0x06,0x06,0x3C,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x18,0x18,0x30,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x06,0x0C,0x18,0x30,0x30,0x18,0x0C,0x06,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x60,0x30,0x18,0x0C,0x0C,0x18,0x30,0x60,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x3C,0x66,0x06,0x0C,0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x3C,0x66,0x66,0x6E,0x6E,0x6E,0x60,0x3C,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x18,0x3C,0x66,0x66,0x7E,0x66,0x66,0x66,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x7C,0x66,0x66,0x7C,0x66,0x66,0x66,0x7C,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x3C,0x66,0x60,0x60,0x60,0x60,0x66,0x3C,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x7C,0x66,0x66,0x66,0x66,0x66,0x66,0x7C,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x7E,0x60,0x60,0x7C,0x60,0x60,0x60,0x7E,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x7E,0x60,0x60,0x7C,0x60,0x60,0x60,0x60,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x3C,0x66,0x60,0x60,0x6E,0x66,0x66,0x3E,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x66,0x66,0x66,0x7E,0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x06,0x06,0x06,0x06,0x06,0x66,0x66,0x3C,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x66,0x6C,0x78,0x70,0x78,0x6C,0x66,0x66,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x7E,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x63,0x77,0x7F,0x6B,0x6B,0x63,0x63,0x63,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x66,0x66,0x76,0x7E,0x6E,0x66,0x66,0x66,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x3C,0x66,0x66,0x66,0x66,0x66,0x66,0x3C,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x7C,0x66,0x66,0x66,0x7C,0x60,0x60,0x60,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x3C,0x66,0x66,0x66,0x66,0x66,0x66,0x3C,0x04,0x06,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x7C,0x66,0x66,0x7C,0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x3C,0x66,0x60,0x3C,0x06,0x66,0x66,0x3C,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x7E,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x3C,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x66,0x3C,0x18,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x63,0x63,0x63,0x63,0x6B,0x7F,0x77,0x63,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x66,0x66,0x3C,0x18,0x3C,0x66,0x66,0x66,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x66,0x66,0x66,0x3C,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x7E,0x06,0x0C,0x18,0x30,0x60,0x60,0x7E,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x3C,0x30,0x30,0x30,0x30,0x30,0x30,0x3C,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x40,0x60,0x30,0x18,0x0C,0x06,0x03,0x01,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x3C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x3C,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x18,0x3C,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,0xFF,0x00,0x00,
- 0x00,0x00,0x18,0x18,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x3C,0x06,0x3E,0x66,0x66,0x3E,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x60,0x60,0x7C,0x66,0x66,0x66,0x66,0x7C,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x3C,0x66,0x60,0x60,0x66,0x3C,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x06,0x06,0x3E,0x66,0x66,0x66,0x66,0x3E,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x3C,0x66,0x7E,0x60,0x66,0x3C,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x3C,0x66,0x60,0x78,0x60,0x60,0x60,0x60,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x3C,0x66,0x66,0x66,0x3E,0x06,0x66,0x3C,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x60,0x60,0x7C,0x66,0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x18,0x18,0x00,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x06,0x00,0x06,0x06,0x06,0x06,0x06,0x66,0x66,0x3C,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x60,0x60,0x66,0x6C,0x78,0x6C,0x66,0x66,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x77,0x7F,0x6B,0x6B,0x6B,0x6B,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x6C,0x7E,0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x3C,0x66,0x66,0x66,0x66,0x3C,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x7C,0x66,0x66,0x66,0x7C,0x60,0x60,0x60,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x3E,0x66,0x66,0x66,0x3E,0x06,0x06,0x06,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x6E,0x78,0x60,0x60,0x60,0x60,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x3C,0x66,0x38,0x0C,0x66,0x3C,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x30,0x30,0x7C,0x30,0x30,0x30,0x36,0x1C,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x3C,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x3C,0x18,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x63,0x63,0x63,0x6B,0x7F,0x36,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x66,0x3C,0x18,0x18,0x3C,0x66,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x3E,0x06,0x66,0x3C,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x7E,0x0C,0x18,0x30,0x60,0x7E,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x0E,0x18,0x18,0x18,0x70,0x18,0x18,0x18,0x0E,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x18,0x18,0x18,0x18,0x00,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x70,0x18,0x18,0x18,0x0E,0x18,0x18,0x18,0x70,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x3B,0x6E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x08,0x1C,0x36,0x63,0x63,0x7F,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x3C,0x66,0xC2,0xC0,0xC2,0x66,0x3C,0x18,0x0E,0x0C,0x78,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x66,0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x66,0x3E,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x06,0x0C,0x18,0x00,0x3E,0x63,0x7F,0x60,0x63,0x3E,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x08,0x1C,0x36,0x00,0x3C,0x06,0x3E,0x66,0x66,0x3B,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x66,0x66,0x00,0x3C,0x06,0x3E,0x66,0x66,0x3B,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x30,0x18,0x0C,0x00,0x3C,0x06,0x3E,0x66,0x66,0x3B,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x1C,0x36,0x1C,0x00,0x3C,0x06,0x3E,0x66,0x66,0x3B,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x3C,0x66,0x60,0x66,0x3C,0x0C,0x06,0x3C,0x00,0x00,0x00,
- 0x00,0x00,0x08,0x1C,0x36,0x00,0x3E,0x63,0x7F,0x60,0x63,0x3E,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x66,0x66,0x00,0x3E,0x63,0x7F,0x60,0x63,0x3E,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x30,0x18,0x0C,0x00,0x3E,0x63,0x7F,0x60,0x63,0x3E,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x66,0x66,0x00,0x38,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x18,0x3C,0x66,0x00,0x38,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x60,0x30,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x63,0x63,0x08,0x1C,0x36,0x63,0x63,0x7F,0x63,0x63,0x00,0x00,0x00,0x00,
- 0x00,0x1C,0x36,0x1C,0x00,0x1C,0x36,0x63,0x63,0x7F,0x63,0x63,0x00,0x00,0x00,0x00,
- 0x00,0x0C,0x18,0x30,0x00,0x7F,0x33,0x30,0x3E,0x30,0x33,0x7F,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x6E,0x3B,0x1B,0x7E,0xD8,0xDC,0x77,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x1F,0x36,0x66,0x66,0x7F,0x66,0x66,0x66,0x67,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x08,0x1C,0x36,0x00,0x3E,0x63,0x63,0x63,0x63,0x3E,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x63,0x63,0x00,0x3E,0x63,0x63,0x63,0x63,0x3E,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x30,0x18,0x0C,0x00,0x3E,0x63,0x63,0x63,0x63,0x3E,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x18,0x3C,0x66,0x00,0x66,0x66,0x66,0x66,0x66,0x3B,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x30,0x18,0x0C,0x00,0x66,0x66,0x66,0x66,0x66,0x3B,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x63,0x63,0x00,0x63,0x63,0x63,0x63,0x3F,0x03,0x06,0x3C,0x00,0x00,
- 0x00,0x00,0x63,0x63,0x1C,0x36,0x63,0x63,0x63,0x63,0x36,0x1C,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x63,0x63,0x00,0x63,0x63,0x63,0x63,0x63,0x63,0x3E,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x18,0x18,0x7E,0xC3,0xC0,0xC0,0xC3,0x7E,0x18,0x18,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x1C,0x36,0x32,0x30,0x78,0x30,0x30,0x30,0x73,0x7E,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0xC3,0x66,0x3C,0x18,0xFF,0x18,0xFF,0x18,0x18,0x00,0x00,0x00,0x00,
- 0x00,0x00,0xFC,0x66,0x66,0x7C,0x62,0x66,0x6F,0x66,0x66,0xF3,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x0E,0x1B,0x18,0x18,0x18,0x7E,0x18,0x18,0x18,0x18,0xD8,0x70,0x00,0x00,
- 0x00,0x00,0x0C,0x18,0x30,0x00,0x3C,0x06,0x3E,0x66,0x66,0x3B,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x0C,0x18,0x30,0x00,0x38,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x0C,0x18,0x30,0x00,0x3E,0x63,0x63,0x63,0x63,0x3E,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x0C,0x18,0x30,0x00,0x66,0x66,0x66,0x66,0x66,0x3B,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x3B,0x6E,0x00,0x6E,0x33,0x33,0x33,0x33,0x33,0x00,0x00,0x00,0x00,
- 0x00,0x3B,0x6E,0x00,0x63,0x73,0x7B,0x7F,0x6F,0x67,0x63,0x63,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x3C,0x6C,0x6C,0x3E,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x38,0x6C,0x6C,0x38,0x00,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x18,0x18,0x00,0x18,0x18,0x30,0x63,0x63,0x3E,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x60,0x60,0x60,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0x03,0x03,0x03,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x60,0xE0,0x63,0x66,0x6C,0x18,0x30,0x6E,0xC3,0x06,0x0C,0x1F,0x00,0x00,
- 0x00,0x00,0x60,0xE0,0x63,0x66,0x6C,0x18,0x33,0x67,0xCF,0x1F,0x03,0x03,0x00,0x00,
- 0x00,0x00,0x00,0x18,0x18,0x00,0x18,0x18,0x3C,0x3C,0x3C,0x18,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x1B,0x36,0x6C,0x36,0x1B,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x6C,0x36,0x1B,0x36,0x6C,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,
- 0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55,
- 0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,0x77,0xDD,
- 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
- 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
- 0x18,0x18,0x18,0x18,0x18,0x18,0xF8,0x18,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
- 0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xF6,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
- 0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x18,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
- 0x36,0x36,0x36,0x36,0x36,0x36,0xF6,0x06,0xF6,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
- 0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
- 0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x06,0xF6,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
- 0x36,0x36,0x36,0x36,0x36,0x36,0xF6,0x06,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x18,0x18,0x18,0x18,0x18,0x18,0xF8,0x18,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
- 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
- 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
- 0x18,0x18,0x18,0x18,0x18,0x18,0x1F,0x18,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
- 0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
- 0x36,0x36,0x36,0x36,0x36,0x36,0x37,0x30,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x30,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
- 0x36,0x36,0x36,0x36,0x36,0x36,0xF7,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xF7,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
- 0x36,0x36,0x36,0x36,0x36,0x36,0x37,0x30,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
- 0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x36,0x36,0x36,0x36,0x36,0x36,0xF7,0x00,0xF7,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
- 0x18,0x18,0x18,0x18,0x18,0x18,0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
- 0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x18,0x18,0x18,0x18,0x18,0x18,0x1F,0x18,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x18,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
- 0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xFF,0x36,0x36,0x36,0x36,0x36,0x36,0x36,
- 0x18,0x18,0x18,0x18,0x18,0x18,0xFF,0x18,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
- 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
- 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
- 0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,
- 0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,
- 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x3B,0x6E,0x6C,0x6C,0x6E,0x3B,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x3E,0x63,0x7E,0x63,0x63,0x7E,0x60,0x60,0x20,0x00,0x00,
- 0x00,0x00,0x00,0x7F,0x63,0x63,0x60,0x60,0x60,0x60,0x60,0x60,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x7F,0x36,0x36,0x36,0x36,0x36,0x36,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x7F,0x63,0x30,0x18,0x0C,0x18,0x30,0x63,0x7F,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x6C,0x6C,0x6C,0x6C,0x38,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x33,0x33,0x33,0x33,0x3E,0x30,0x30,0x60,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x3F,0x6C,0x0C,0x0C,0x0C,0x0C,0x0C,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x7E,0x18,0x3C,0x66,0x66,0x66,0x3C,0x18,0x7E,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x1C,0x36,0x63,0x63,0x7F,0x63,0x63,0x36,0x1C,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x1C,0x36,0x63,0x63,0x63,0x36,0x36,0x36,0x77,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x1E,0x30,0x18,0x0C,0x3E,0x66,0x66,0x66,0x3C,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0xDB,0xDB,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x03,0x06,0x7E,0xDB,0xDB,0xF3,0x7E,0x60,0xC0,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x1C,0x30,0x60,0x60,0x7C,0x60,0x60,0x30,0x1C,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x3E,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x7F,0x00,0x00,0x7F,0x00,0x00,0x7F,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x18,0x18,0x18,0xFF,0x18,0x18,0x18,0x00,0xFF,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x30,0x18,0x0C,0x06,0x0C,0x18,0x30,0x00,0x7E,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x0C,0x18,0x30,0x60,0x30,0x18,0x0C,0x00,0x7E,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x0E,0x1B,0x1B,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,
- 0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xD8,0xD8,0x70,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x18,0x18,0x00,0x00,0xFF,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x3B,0x6E,0x00,0x3B,0x6E,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x38,0x6C,0x6C,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x0F,0x0C,0x0C,0x0C,0x0C,0x0C,0xEC,0x6C,0x3C,0x1C,0x00,0x00,0x00,0x00,
- 0x00,0x00,0xD8,0x6C,0x6C,0x6C,0x6C,0x6C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x70,0xD8,0x30,0x60,0xC8,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x3E,0x3E,0x3E,0x3E,0x3E,0x3E,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
-};
diff --git a/backends/platform/gp32/gfx_splash.h b/backends/platform/gp32/gfx_splash.h
deleted file mode 100644
index 6e1081ca6e..0000000000
--- a/backends/platform/gp32/gfx_splash.h
+++ /dev/null
@@ -1,4870 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- *
- */
-
-/////////////////////////////////////////
-//
-// Header file for GP32
-//
-// convertion of gfx_splash.bmp file :
-// Width = 320
-// Heigth = 240
-// GP32 Mode = 8 Bits per Pixel
-//
-// with GP32Converter coded by Edorul :
-// http://www.ifrance.com/edorul/
-// edorul@free.fr
-//
-/////////////////////////////////////////
-
-#define gfx_splash_width 320
-#define gfx_splash_height 240
-
-#define gfx_splash_palnb 256
-
-#include <gpgraphic.h>
-
-GP_PALETTEENTRY gfx_splash_Pal[256] = {
- 0x843, 0x88B, 0x1941, 0x110D, 0x2883, 0x30C9, 0x2945, 0x2109, 0x214D, 0x2989, 0x218F, 0x3149, 0x394D, 0x3989, 0x318D, 0x8D1,
- 0x1153, 0x9D9, 0x2993, 0x29DB, 0x1A01, 0x3243, 0x3A4B, 0x3B01, 0x1A15, 0x125B, 0x3255, 0x329B, 0x3B17, 0x331D, 0x40C3, 0x4145,
- 0x498B, 0x6987, 0x61C9, 0x49D1, 0x4285, 0x524D, 0x4B43, 0x530D, 0x6207, 0x624D, 0x6307, 0x6B4B, 0x4211, 0x4A55, 0x4A93, 0x4297,
- 0x5251, 0x5255, 0x5293, 0x5295, 0x4ADB, 0x5313, 0x535D, 0x6AD3, 0x62D9, 0x7355, 0x6319, 0x6B5D, 0x6B9B, 0x639F, 0x7359, 0x735D,
- 0x739B, 0x7B9F, 0x32E1, 0x3B63, 0x4AA3, 0x52E9, 0x4BA3, 0x53A9, 0x6BE3, 0x6BA9, 0x7BF1, 0x7C4D, 0x5C1F, 0x7417, 0x741B, 0x5C25,
- 0x54AB, 0x552F, 0x6C65, 0x6CAB, 0x7D27, 0x752D, 0x54F1, 0x5D35, 0x5D79, 0x6CF1, 0x6D75, 0x6DB9, 0x7E35, 0x763B, 0x89CF, 0xB085,
- 0xA909, 0xA98D, 0xB14B, 0xB1CF, 0x8207, 0x834F, 0x8A53, 0x8AD3, 0x8A95, 0x9253, 0x9295, 0x8395, 0x8359, 0x835D, 0x83D9, 0x83DD,
- 0x9359, 0x93D9, 0x93DD, 0xAA11, 0xA2D7, 0xB253, 0xBA95, 0xA393, 0xAB19, 0xABDB, 0xA3DF, 0xB319, 0xB3DF, 0xC001, 0xC8C7, 0xD843,
- 0xD885, 0xC909, 0xC18D, 0xD14B, 0xD9CF, 0xE001, 0xE8C7, 0xF801, 0xF885, 0xF14B, 0xD295, 0xCB19, 0xC39D, 0xDB19, 0xD3DF, 0xF295,
- 0xE319, 0xEB9D, 0xF35B, 0xFBDF, 0x83E1, 0x8C4D, 0x8C15, 0x945D, 0x9D53, 0x951F, 0xAC57, 0xAC9D, 0xA595, 0xB55D, 0xD517, 0xCD5B,
- 0xE59B, 0xD65B, 0xE69B, 0x8421, 0x8C65, 0x8CA3, 0x84E7, 0x9461, 0x9465, 0x9CA1, 0x94A5, 0x8CAB, 0x9D25, 0x8D6D, 0xA463, 0xA4E1,
- 0xA4E5, 0xB421, 0xB4E1, 0xB4A5, 0xA4E9, 0xAD65, 0xA529, 0xAD6D, 0xADAB, 0xADAD, 0xB56B, 0xB56D, 0xB5AB, 0xB5AD, 0x94F3, 0x8DB3,
- 0x8DF9, 0xADB5, 0xA5F9, 0x9E27, 0x962D, 0xB665, 0xB62D, 0xBF25, 0xB729, 0x9675, 0x8EBD, 0x9F37, 0x9F3D, 0xA675, 0xAEB9, 0xAF37,
- 0xAF7D, 0xCC63, 0xC4E7, 0xD463, 0xD4E7, 0xC5A5, 0xC569, 0xC5E9, 0xC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0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD,
- 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD,
- 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD, 0xFD
-
-};
diff --git a/backends/platform/gp32/gp32_launcher.cpp b/backends/platform/gp32/gp32_launcher.cpp
deleted file mode 100644
index 9931118f08..0000000000
--- a/backends/platform/gp32/gp32_launcher.cpp
+++ /dev/null
@@ -1,190 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- *
- */
-
-#include "common/scummsys.h"
-#include "common/file.h"
-
-#include "engines/engine.h"
-
-#include "gp32std.h"
-#include "gp32std_grap.h"
-#include "gp32std_input.h"
-#include "gp32_launcher.h"
-
-#include "gfx_splash.h"
-#include "globals.h"
-
-uint16 cpuSpeedTable[15] = {40, 66, 100, 120, 133, 144, 156, 160, 166, 172, 176, 180, 188, 192, 200};
-uint16 gammaTable[16] = {5000, 6000, 7000, 8000, 9000, 10000, 11000, 12000, 13000, 14000, 15000, 16000, 17000, 18000, 19000, 20000};
-char *oplTable[3] = {"LOW", "MEDIUM", "HIGH"};
-uint16 sampleTable[4] = {0, 11025, 22050, 44100};
-
-uint8 maxTable[5] = {15, 16, 3, 3, 2};
-uint8 currentSetting[5] = {2, 5, 1, 1, 0};
-
-void writeConfigVars() {
- Common::File file;
-
- g_vars.cpuSpeed = cpuSpeedTable[currentSetting[0]];
- g_vars.gammaRamp = gammaTable[currentSetting[1]];
- g_vars.fmQuality = currentSetting[2];
- g_vars.sampleRate = sampleTable[currentSetting[3]];
-
- if (!file.open("gp:\\gpetc\\scummvm.cfg", Common::File::kFileWriteMode)) {
- return;
- }
- file.writeByte(currentSetting[0]);
- file.writeByte(currentSetting[1]);
- file.writeByte(currentSetting[2]);
- file.writeByte(currentSetting[3]);
- file.close();
-}
-
-void readConfigVars() {
- Common::File file;
- if (!file.open("gp:\\gpetc\\scummvm.cfg", Common::File::kFileReadMode)) {
- currentSetting[0] = 2;
- currentSetting[1] = 5;
- currentSetting[2] = 1;
- currentSetting[3] = 1;
- writeConfigVars();
- return;
- }
- currentSetting[0] = file.readByte();
- currentSetting[1] = file.readByte();
- currentSetting[2] = file.readByte();
- currentSetting[3] = file.readByte();
- g_vars.cpuSpeed = cpuSpeedTable[currentSetting[0]];
- g_vars.gammaRamp = gammaTable[currentSetting[1]];
- g_vars.fmQuality = currentSetting[2];
- g_vars.sampleRate = sampleTable[currentSetting[3]];
- file.close();
-}
-
-void configMenu() {
- uint32 nKeyUD;
- uint16 nKeyP;
-
- int currentSelect = 0;
- char text[32];
-
- // OK / CANCEL
- currentSetting[4] = 0;
-
- while (1) {
- gp_fillRect(frameBuffer2, 0, 0, 320, 240, 0xffff);
- gp_textOut(frameBuffer2, 90, 10, "Configuration Menu", 0);
-
- gp_textOut(frameBuffer2, 30, 40, "CPU clock speed", 0);
- gp_textOut(frameBuffer2, 30, 80, "Gamma ramp", 0);
- gp_textOut(frameBuffer2, 30, 120, "FMOPL (AdLib) quality", 0);
- gp_textOut(frameBuffer2, 30, 160, "Sampling rate", 0);
-
- gp_textOut(frameBuffer2, 100, 210, "OK CANCEL", 0);
-
- if (currentSelect == 4) {
- gp_textOut(frameBuffer2, 80 + currentSetting[4] * 100, 210, "@", 0);
- } else
- gp_textOut(frameBuffer2, 20, (currentSelect + 1) * 40, "@", 0);
-
- sprintf(text, "%d MHz", cpuSpeedTable[currentSetting[0]]);
- gp_textOut(frameBuffer2, 220, 40, text, 0);
- sprintf(text, "%.2f", (float)gammaTable[currentSetting[1]] / 10000);
- gp_textOut(frameBuffer2, 220, 80, text, 0);
- gp_textOut(frameBuffer2, 220, 120, oplTable[currentSetting[2]], 0);
- if (sampleTable[currentSetting[3]] == 0) {
- strcpy(text, "NO SOUND");
- } else {
- sprintf(text, "%d Hz", sampleTable[currentSetting[3]]);
- }
- gp_textOut(frameBuffer2, 220, 160, text, 0);
-
- gp_flipScreen();
-
- gp_getButtonEvent(&nKeyUD, &nKeyP);
-
- if (gpd_getButtonDown(nKeyUD, GPC_VK_UP)) {
- if (currentSelect > 0)
- currentSelect--;
- }
- if (gpd_getButtonDown(nKeyUD, GPC_VK_DOWN)) {
- if (currentSelect < 4)
- currentSelect++;
- }
- if (gpd_getButtonDown(nKeyUD, GPC_VK_LEFT)) {
- if (currentSelect <= 4)
- if (currentSetting[currentSelect] > 0)
- currentSetting[currentSelect]--;
- }
- if (gpd_getButtonDown(nKeyUD, GPC_VK_RIGHT)) {
- if (currentSelect <= 4)
- if (currentSetting[currentSelect] < maxTable[currentSelect] - 1)
- currentSetting[currentSelect]++;
- }
-
- if (gpd_getButtonUp(nKeyUD, GPC_VK_START) ||
- gpd_getButtonUp(nKeyUD, GPC_VK_FA)) {
- if (currentSelect == 4) {
- if (currentSetting[currentSelect] == 0) { // OK
- writeConfigVars();
- return;
- } else { // CANCEL
- return;
- }
- }
- }
- }
-}
-
-void splashScreen() {
- uint32 nKeyUD;
- uint16 nKeyP;
-
- while (1) {
- uint16 *buffer = frameBuffer2;//&frameBuffer1[240 - _screenHeight];
- uint8 *picBuffer = gfx_splash;
-
- for (int c = 0; c < LCD_WIDTH * LCD_HEIGHT; c++) {
- *buffer++ = gfx_splash_Pal[*picBuffer++];
- }
-
- gp_flipScreen();
-
- while (1) {
- gp_getButtonEvent(&nKeyUD, &nKeyP);
-
- if (gpd_getButtonUp(nKeyUD, GPC_VK_START) ||
- gpd_getButtonUp(nKeyUD, GPC_VK_FA)) {
- gp_fillRect(frameBuffer1, 0, 0, 320, 240, 0xffff);
- gp_fillRect(frameBuffer2, 0, 0, 320, 240, 0xffff);
- return;
- }
- if (gpd_getButtonUp(nKeyUD, GPC_VK_SELECT)) {
- configMenu();
- break;
- }
- }
- }
-}
diff --git a/backends/platform/gp32/gp32_main.cpp b/backends/platform/gp32/gp32_main.cpp
deleted file mode 100644
index 3db3dfe553..0000000000
--- a/backends/platform/gp32/gp32_main.cpp
+++ /dev/null
@@ -1,93 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- *
- */
-
-#include "common/scummsys.h"
-
-#include "common/config-manager.h"
-
-#include "base/main.h"
-
-#include "gp32std.h"
-#include "gp32std_grap.h"
-
-#include "gp32_launcher.h"
-#include "gp32_osys.h"
-#include "globals.h"
-
-GlobalVars g_vars;
-
-void init() {
- gp_setCpuSpeed(40); // Default CPU Speed
-
- GpGraphicModeSet(16, NULL);
-
- //if (type == NLU || type == FLU || type == BLU)
- // gp_initFramebuffer(frameBuffer, 16, 85);
- //else if (type == BLUPLUS)
- // gp_initFramebufferBP(frameBuffer, 16, 85);
- // else
- // error("Invalid Console");
- gp_initFrameBuffer();
-
- GpFatInit();
- GpRelativePathSet("gp:\\gpmm");
-}
-
-void GpMain(void *arg) {
- extern void memBlockInit();
- memBlockInit();
-
- init();
-
- readConfigVars();
-
- splashScreen();
-
- //doConfig
- gp_initGammaTable((float)g_vars.gammaRamp / 10000);
- gp_setCpuSpeed(g_vars.cpuSpeed);
- GPDEBUG("Set CPU Speed: %d", g_vars.cpuSpeed);
-
- // FOR DEBUG PURPOSE!
- //int argc = 4;
- //char *argv[] = { "scummvm", "-enull", "-pgp:\\game\\dott\\", "tentacle" };
- //int argc = 2;
- //char *argv[] = { "scummvm", "-d5" };
-
- extern OSystem *OSystem_GP32_create();
- g_system = OSystem_GP32_create();
- assert(g_system);
-
- // Invoke the actual ScummVM main entry point:
- //int res = scummvm_main(argc, argv);
- int res = scummvm_main(1, NULL);
-
- extern void memBlockDeinit();
- memBlockDeinit();
-
- g_system->quit(); // TODO: Consider removing / replacing this!
-
- //return res;
-}
diff --git a/backends/platform/gp32/gp32_osys.cpp b/backends/platform/gp32/gp32_osys.cpp
deleted file mode 100644
index 866d97e966..0000000000
--- a/backends/platform/gp32/gp32_osys.cpp
+++ /dev/null
@@ -1,792 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- *
- */
-
-#include "common/scummsys.h"
-#include "common/system.h"
-
-#include "common/rect.h"
-#include "common/savefile.h"
-#include "common/config-manager.h"
-#include "graphics/surface.h"
-
-#include "gp32_osys.h"
-#include "globals.h"
-
-static const OSystem::GraphicsMode s_supportedGraphicsModes[] = {
- {0, 0, 0}
-};
-
-OSystem_GP32::OSystem_GP32() :
- _screenWidth(0), _screenHeight(0), _gameScreen(NULL), _hwScreen(NULL),
- _overlayVisible(false), _forceFull(false), _adjustAspectRatio(false),
- /*_paletteDirtyStart(0), _paletteDirtyEnd(0),*/
- _mouseBuf(NULL), _mouseHeight(0), _mouseWidth(0), _mouseKeyColor(0),
- _mouseHotspotX(0), _mouseHotspotY(0) {
- NP("OSys::OSystem_GP32()");
- // allocate palette storage
- memset(_currentPalette, 0, 256 * sizeof(uint16));
-
- memset(&_km, 0, sizeof(_km));
-
- // HACK: bring mouse cursor to center
- _mouseX = 160;
- _mouseY = 120;
-}
-
-OSystem_GP32::~OSystem_GP32() {
- NP("OSys::~OSystem_GP32()");
-}
-
-bool OSystem_GP32::hasFeature(Feature f) {
- NP("OSys::hasFeature()");
- return false;
-}
-
-void OSystem_GP32::setFeatureState(Feature f, bool enable) {
- NP("OSys::setFeatureState()");
-}
-
-bool OSystem_GP32::getFeatureState(Feature f) {
- NP("OSys::getFeatureState()");
- return false;
-}
-
-const OSystem::GraphicsMode* OSystem_GP32::getSupportedGraphicsModes() const {
- NP("OSys::getSupportedGraphicsModes()");
- return s_supportedGraphicsModes;
-}
-
-
-int OSystem_GP32::getDefaultGraphicsMode() const {
- NP("OSys::getSupportedGraphicsModes()");
- return -1;
-}
-
-bool OSystem_GP32::setGraphicsMode(int mode) {
- NP("OSys::setGraphicsMode()");
- return true;
-}
-
-bool OSystem_GP32::setGraphicsMode(const char *name) {
- NP("OSys::setGraphicsMode()");
- return true;
-}
-
-int OSystem_GP32::getGraphicsMode() const {
- NP("OSys::getGraphicsMode()");
- return -1;
-}
-
-void OSystem_GP32::initSize(uint width, uint height) {
- NP("OSys::initSize()");
-
- if (width == _screenWidth && height == _screenHeight)
- return;
-
- _screenWidth = width;
- _screenHeight = height;
-
- if (height != 200)
- _adjustAspectRatio = false;
-
- _overlayWidth = width;
- _overlayHeight = height;
-// _overlayWidth = 320;
-// _overlayHeight = 240;
-
- // Create the surface that contains the 8 bit game data
- _gameScreen = new uint8[_screenWidth * _screenHeight];
-
- // Create the surface that contains the scaled graphics in 16 bit mode
- _tmpScreen = frameBuffer2;
-
- // Create the surface that is connected with hardware screen
- _hwScreen = frameBuffer1;
-
- _overlayBuffer = new OverlayColor[_overlayWidth * _overlayHeight];
-
- _km.x_max = _screenWidth - 1;
- _km.y_max = _screenHeight - 1;
- _km.x = _mouseX;
- _km.y = _mouseY;
- _km.delay_time = 25;
- _km.last_time = 0;
-
- // Clear Screen
- gp_fillRect(_hwScreen, 0, 0, 320, 240, 0xFFFF);
-}
-
-int16 OSystem_GP32::getHeight() {
- //NP("OSys::getHeight()");
- return _screenHeight;
-}
-
-int16 OSystem_GP32::getWidth() {
- //NP("OSys::getWidth()");
- return _screenWidth;
-}
-
-void OSystem_GP32::setPalette(const byte *colors, uint start, uint num) {
- //NP("OSys::setPalette()");
- const byte *b = colors;
- uint i;
- uint16 *base = _currentPalette + start;
- for (i = 0; i < num; i++) {
- base[i] = gp_RGBTo16(b[0], b[1], b[2]);
- b += 4;
- }
-
-// if (start < _paletteDirtyStart)
-// _paletteDirtyStart = start;
-
-// if (start + num > _paletteDirtyEnd)
-// _paletteDirtyEnd = start + num;
-}
-
-void OSystem_GP32::grabPalette(byte *colors, uint start, uint num) {
- NP("OSys::grabPalette()");
-}
-
-void OSystem_GP32::copyRectToScreen(const byte *src, int pitch, int x, int y, int w, int h) {
- //NP("OSys::copyRectToScreen()");
- //Clip the coordinates
- if (x < 0) {
- w += x;
- src -= x;
- x = 0;
- }
-
- if (y < 0) {
- h += y;
- src -= y * pitch;
- y = 0;
- }
-
- if (w > _screenWidth - x) {
- w = _screenWidth - x;
- }
-
- if (h > _screenHeight - y) {
- h = _screenHeight - y;
- }
-
- if (w <= 0 || h <= 0)
- return;
-
- byte *dst = _gameScreen + y * _screenWidth + x;
-
- if (_screenWidth == pitch && pitch == w) {
- memcpy(dst, src, h * w);
- } else {
- do {
- memcpy(dst, src, w);
- src += pitch;
- dst += _screenWidth;
- } while (--h);
- }
-}
-
-Graphics::Surface *OSystem_GP32::lockScreen() {
- _framebuffer.pixels = _gameScreen;
- _framebuffer.w = _screenWidth;
- _framebuffer.h = _screenHeight;
- _framebuffer.pitch = _screenWidth;
- _framebuffer.bytesPerPixel = 1;
-
- return &_framebuffer;
-}
-
-void OSystem_GP32::unlockScreen() {
- // The screen is always completely update anyway, so we don't have to force a full update here.
-}
-
-//TODO: Implement Dirty rect?
-void OSystem_GP32::updateScreen() {
- uint16 *buffer;
- //TODO: adjust shakePos
-
- // draw gamescreen
- buffer = &_tmpScreen[240 - _screenHeight];
- for (int x = 0; x < _screenWidth; x++) {
- for (int y = 0; y < _screenHeight; y++) {
- *buffer++ = _currentPalette[_gameScreen[((_screenHeight - 1) - y) * _screenWidth + x]];
- }
- buffer += 240 - _screenHeight;
- }
-
- // draw overlay
- if (_overlayVisible) {
- buffer = &_tmpScreen[240 - _overlayHeight];
- for (int x = 0; x < _overlayWidth; x++) {
- for (int y = 0; y < _overlayHeight; y++) {
- *buffer++ = _overlayBuffer[((_overlayHeight - 1) - y) * _overlayWidth + x];
- }
- buffer += 240 - _overlayHeight;
- }
- }
-
- // draw mouse
- //adjust cursor position
- int mX = _mouseX - _mouseHotspotX;
- int mY = _mouseY - _mouseHotspotY;
- //if (_overlayVisible)
- //else
- if (_mouseVisible)
- for (int y = 0; y < _mouseHeight; y++) {
- for (int x = 0; x < _mouseWidth; x++) {
- if (mX + x < _screenWidth && mY + y < _screenHeight && mX + x >= 0 && mY + y >= 0)
- if (_mouseBuf[y * _mouseWidth + x] != _mouseKeyColor)
- gpd_drawPixel16(_tmpScreen, mX + x, mY + y, _currentPalette[_mouseBuf[y * _mouseWidth + x]]);
- }
- }
-
- //TODO: draw softkeyboard
- //gp_flipScreen();
- //_hwScreen = frameBuffer1;
- //_tmpScreen = frameBuffer2;
- memcpy(_hwScreen, _tmpScreen, LCD_WIDTH * LCD_HEIGHT * sizeof(uint16));
-}
-
-void OSystem_GP32::setShakePos(int shakeOffset) {
- //NP("OSys::setShakePos()");
-}
-
-void OSystem_GP32::showOverlay() {
- //NP("OSys::showOverlay()");
- _overlayVisible = true;
- clearOverlay();
-}
-
-void OSystem_GP32::hideOverlay() {
- //NP("OSys::hideOverlay()");
- _overlayVisible = false;
- clearOverlay();
- _forceFull = true;
-}
-
-// Clear overlay with game screen
-//TODO: Optimize?
-void OSystem_GP32::clearOverlay() {
- //NP("OSys::clearOverlay()");
- if (!_overlayVisible)
- return;
-
- uint8 *s = _gameScreen;
- OverlayColor *d = _overlayBuffer;
- uint8 c;
- for (int y = 0; y < _overlayHeight; y++) {
- for (int x = 0; x < _overlayWidth; x++) {
- c = *s;
- *d++ = _currentPalette[c];
- s++;
- }
- }
-
- _forceFull = true;
-}
-
-void OSystem_GP32::grabOverlay(OverlayColor *buf, int pitch) {
- //NP("OSys::grabOverlay()");
- int h = _overlayHeight;
- OverlayColor *src = _overlayBuffer;
-
- do {
- memcpy(buf, src, _overlayWidth * sizeof(OverlayColor));
- src += _overlayWidth;
- buf += pitch;
- } while (--h);
-}
-
-void OSystem_GP32::copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h) {
- //NP("OSys::copyRectToOverlay()");
-
- //Clip the coordinates
- if (x < 0) {
- w += x;
- buf -= x;
- x = 0;
- }
-
- if (y < 0) {
- h += y;
- buf -= y * pitch;
- y = 0;
- }
-
- if (w > _overlayWidth - x) {
- w = _overlayWidth - x;
- }
-
- if (h > _overlayHeight - y) {
- h = _overlayHeight - y;
- }
-
- if (w <= 0 || h <= 0)
- return;
-
-
- OverlayColor *dst = _overlayBuffer + y * _overlayWidth + x;
- if (_overlayWidth == pitch && pitch == w) {
- memcpy(dst, buf, h * w * sizeof(OverlayColor));
- } else {
- do {
- memcpy(dst, buf, w * sizeof(OverlayColor));
- buf += pitch;
- dst += _overlayWidth;
- } while (--h);
- }
-}
-
-int16 OSystem_GP32::getOverlayHeight() {
- return getHeight();
-}
-
-int16 OSystem_GP32::getOverlayWidth() {
- return getWidth();
-}
-
-OverlayColor OSystem_GP32::RGBToColor(uint8 r, uint8 g, uint8 b) {
- return gp_RGBTo16(r, g, b);
-}
-
-void OSystem_GP32::colorToRGB(OverlayColor color, uint8 &r, uint8 &g, uint8 &b) {
- gp_16ToRGB(color, &r, &g, &b);
-}
-
-bool OSystem_GP32::showMouse(bool visible) {
- NP("OSys::showMouse()");
- if (_mouseVisible == visible)
- return visible;
-
- bool last = _mouseVisible;
- _mouseVisible = visible;
-
- updateScreen();
-
- return last;
-}
-
-void OSystem_GP32::warpMouse(int x, int y) {
- //NP("OSys::warpMouse()");
- //assert(x > 0 && x < _screenWidth);
- //assert(y > 0 && y < _screenHeight);
- _mouseX = x;
- _mouseY = y;
-}
-
-void OSystem_GP32::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor, int cursorTargetScale) {
- //NP("OSys::setMouseCursor()");
- _mouseWidth = w;
- _mouseHeight = h;
-
- _mouseHotspotX = hotspotX;
- _mouseHotspotY = hotspotY;
-
- _mouseKeyColor = keycolor;
-
- if (_mouseBuf)
- free(_mouseBuf);
-
- _mouseBuf = (byte *)malloc(w * h);
- memcpy(_mouseBuf, buf, w * h);
-}
-
-void OSystem_GP32::handleKbdMouse() {
- uint32 curTime = getMillis();
- if (curTime >= _km.last_time + _km.delay_time) {
- _km.last_time = curTime;
- if (_km.x_down_count == 1) {
- _km.x_down_time = curTime;
- _km.x_down_count = 2;
- }
- if (_km.y_down_count == 1) {
- _km.y_down_time = curTime;
- _km.y_down_count = 2;
- }
-
- if (_km.x_vel || _km.y_vel) {
- if (_km.x_down_count) {
- if (curTime > _km.x_down_time + _km.delay_time * 12) {
- if (_km.x_vel > 0)
- _km.x_vel++;
- else
- _km.x_vel--;
- } else if (curTime > _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 (curTime > _km.y_down_time + _km.delay_time * 12) {
- if (_km.y_vel > 0)
- _km.y_vel++;
- else
- _km.y_vel--;
- } else if (curTime > _km.y_down_time + _km.delay_time * 8) {
- if (_km.y_vel > 0)
- _km.y_vel = 5;
- else
- _km.y_vel = -5;
- }
- }
-
- //GPDEBUG("%d %d - %d %d", _km.x, _km.y, _km.x_vel, _km.y_vel);
- _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;
- }
-
- warpMouse(_km.x, _km.y);
- }
- }
-}
-
-void OSystem_GP32::fillMouseEvent(Common::Event &event, int x, int y) {
- event.mouse.x = x;
- event.mouse.y = y;
-
- // Update the "keyboard mouse" coords
- _km.x = x;
- _km.y = y;
-
- // Optionally perform aspect ratio adjusting
- //if (_adjustAspectRatio)
- // event.mouse.y = aspect2Real(event.mouse.y);
-}
-
-bool OSystem_GP32::pollEvent(Common::Event &event) {
- //NP("OSys::pollEvent()");
- GP32BtnEvent ev;
-
- handleKbdMouse();
-
- if (!gp_pollButtonEvent(&ev))
- return false;
-
- switch(ev.type) {
- case BUTTON_DOWN:
- if (ev.button == GPC_VK_LEFT) {
- _km.x_vel = -1;
- _km.x_down_count = 1;
- }
- if (ev.button == GPC_VK_RIGHT) {
- _km.x_vel = 1;
- _km.x_down_count = 1;
- }
- if (ev.button == GPC_VK_UP) {
- _km.y_vel = -1;
- _km.y_down_count = 1;
- }
- if (ev.button == GPC_VK_DOWN) {
- _km.y_vel = 1;
- _km.y_down_count = 1;
- }
- if (ev.button == GPC_VK_START) { // START = menu/enter
- event.type = Common::EVENT_KEYDOWN;
- if (_overlayVisible)
- event.kbd.keycode = event.kbd.ascii = 13;
- else {
- event.kbd.keycode = Common::KEYCODE_F5;
- event.kbd.ascii = Common::ASCII_F5;
- }
- return true;
- }
- if (ev.button == GPC_VK_SELECT) { // SELECT = pause
- event.type = Common::EVENT_KEYDOWN;
- event.kbd.keycode = event.kbd.ascii = 32;
- return true;
- }
- if (ev.button == GPC_VK_FL) {
- event.type = Common::EVENT_KEYDOWN;
- event.kbd.keycode = event.kbd.ascii = '0';
- return true;
- }
- if (ev.button == GPC_VK_FR) { // R = ESC
- event.type = Common::EVENT_KEYDOWN;
- event.kbd.keycode = event.kbd.ascii = 27;
- return true;
- }
- if (ev.button == GPC_VK_FA) {
- event.type = Common::EVENT_LBUTTONDOWN;
- fillMouseEvent(event, _km.x, _km.y);
- return true;
- }
- if (ev.button == GPC_VK_FB) {
- event.type = Common::EVENT_RBUTTONDOWN;
- fillMouseEvent(event, _km.x, _km.y);
- return true;
- }
- break;
- case BUTTON_UP:
- if (ev.button == GPC_VK_LEFT) {
- if (_km.x_vel < 0) {
- _km.x_vel = 0;
- _km.x_down_count = 0;
- }
- event.type = Common::EVENT_MOUSEMOVE;
- fillMouseEvent(event, _km.x, _km.y);
- return true;
- }
- if (ev.button == GPC_VK_RIGHT) {
- if (_km.x_vel > 0) {
- _km.x_vel = 0;
- _km.x_down_count = 0;
- }
- event.type = Common::EVENT_MOUSEMOVE;
- fillMouseEvent(event, _km.x, _km.y);
- return true;
- }
- if (ev.button == GPC_VK_UP) {
- if (_km.y_vel < 0) {
- _km.y_vel = 0;
- _km.y_down_count = 0;
- }
- event.type = Common::EVENT_MOUSEMOVE;
- fillMouseEvent(event, _km.x, _km.y);
- return true;
- }
- if (ev.button == GPC_VK_DOWN) {
- if (_km.y_vel > 0) {
- _km.y_vel = 0;
- _km.y_down_count = 0;
- }
- event.type = Common::EVENT_MOUSEMOVE;
- fillMouseEvent(event, _km.x, _km.y);
- return true;
- }
-
- if (ev.button == GPC_VK_START) {
- event.type = Common::EVENT_KEYUP;
- if (_overlayVisible)
- event.kbd.keycode = event.kbd.ascii = 13;
- else {
- event.kbd.keycode = Common::KEYCODE_F5;
- event.kbd.ascii = Common::ASCII_F5;
- }
- return true;
- }
- if (ev.button == GPC_VK_SELECT) {
- event.type = Common::EVENT_KEYUP;
- event.kbd.keycode = event.kbd.ascii = 32;
- return true;
- }
- if (ev.button == GPC_VK_FL) {
- event.type = Common::EVENT_KEYUP;
- event.kbd.keycode = event.kbd.ascii = '0';
- return true;
- }
- if (ev.button == GPC_VK_FR) {
- event.type = Common::EVENT_KEYUP;
- event.kbd.keycode = event.kbd.ascii = 27;
- return true;
- }
- if (ev.button == GPC_VK_FA) {
- event.type = Common::EVENT_LBUTTONUP;
- fillMouseEvent(event, _km.x, _km.y);
- return true;
- }
- if (ev.button == GPC_VK_FB) {
- event.type = Common::EVENT_RBUTTONUP;
- fillMouseEvent(event, _km.x, _km.y);
- return true;
- }
- break;
- default:
- error("Unknown Common::Event!");
- }
-
- if (gp_getButtonPressed(GPC_VK_LEFT) ||
- gp_getButtonPressed(GPC_VK_RIGHT) ||
- gp_getButtonPressed(GPC_VK_UP) ||
- gp_getButtonPressed(GPC_VK_DOWN)) {
- event.type = Common::EVENT_MOUSEMOVE;
- fillMouseEvent(event, _km.x, _km.y);
- return true;
- }
- return false;
-}
-
-uint32 OSystem_GP32::getMillis() {
- return GpTickCountGet();
-}
-
-void OSystem_GP32::delayMillis(uint msecs) {
- int startTime = GpTickCountGet();
- while (GpTickCountGet() < startTime + msecs);
-}
-
-// Add a new callback timer
-//FIXME: Add to member
-int _timerInterval;
-int (*_timerCallback)(int);
-
-static void _timerCallbackVoid() {
- //NP("timer running");
- _timerCallback(_timerInterval); //FIXME ?? (*_timercallback)(_timerinterval);
-}
-
-void OSystem_GP32::setTimerCallback(TimerProc callback, int interval) {
- //NP("OSys::setTimerCallback()");
-
- int timerNo = 1;
-
- if (callback == NULL) {
- GpTimerKill(timerNo);
- return;
- }
-
- if (GpTimerOptSet(timerNo, interval, 0, _timerCallbackVoid) == GPOS_ERR_ALREADY_USED) {
- error("Timer slot is already used");
- }
-
- _timerInterval = interval;
- _timerCallback = callback;
-
- GpTimerSet(timerNo);
-}
-
-OSystem::MutexRef OSystem_GP32::createMutex() {
-// NP("OSys::createMutex()");
- return NULL;
-}
-
-void OSystem_GP32::lockMutex(MutexRef mutex) {
-// NP("OSys::lockMutex()");
-}
-
-void OSystem_GP32::unlockMutex(MutexRef mutex) {
-// NP("OSys::unlockMutex()");
-}
-
-void OSystem_GP32::deleteMutex(MutexRef mutex) {
-// NP("OSys::deleteMutex()");
-}
-
-bool OSystem_GP32::setSoundCallback(SoundProc proc, void *param) {
- //NP("OSys::setSoundCallback()");
-
- GPSOUNDBUF gpSoundBuf;
-
- ConfMan.setBool("FM_medium_quality", (g_vars.fmQuality == FM_QUALITY_MED));
- ConfMan.setBool("FM_high_quality", (g_vars.fmQuality == FM_QUALITY_HI));
- //ConfMan.set("output_rate", (int)g_vars.sampleRate);
-
- if (ConfMan.hasKey("output_rate"))
- _samplesPerSec = ConfMan.getInt("output_rate");
-
- _samplesPerSec = (int)g_vars.sampleRate; //hack
-
- if (_samplesPerSec == 0) {
- return false;
- }
-
- if (_samplesPerSec < 0)
- _samplesPerSec = SAMPLES_PER_SEC;
-
- // Originally, we always used 2048 samples. This loop will produce the
- // same result at 22050 Hz, and should hopefully produce something
- // sensible for other frequencies. Note that it must be a power of two.
-
- uint32 samples = 0x8000;
-
- for (;;) {
- if ((1000 * samples) / _samplesPerSec < 100)
- break;
- samples >>= 1;
- }
-
- switch(_samplesPerSec) {
- case 44100:
- case 22050:
- case 11025:
- break;
- default:
- _samplesPerSec = 11025;
- }
-
- gpSoundBuf.freq = _samplesPerSec;
- gpSoundBuf.format = 16;
- gpSoundBuf.channels = 2;
- gpSoundBuf.samples = samples;
- gpSoundBuf.userdata = param;
- gpSoundBuf.callback = proc;
- gp_soundBufStart(&gpSoundBuf);
-
- // For Safety...
- GPDEBUG("_samplesPerSec = %d, samples = %d", _samplesPerSec, samples);
- gp_delay(1000);
- return true;
-}
-
-void OSystem_GP32::clearSoundCallback() {
- //NP("OSys::clearSoundCallback()");
- if (_samplesPerSec != 0)
- gp_soundBufStop();
-}
-
-int OSystem_GP32::getOutputSampleRate() const {
- //NP("OSys::getOutputSampleRate()");
- return _samplesPerSec;
-}
-
-void OSystem_GP32::quit() {
- //NP("OSys::quit()");
- clearSoundCallback();
- setTimerCallback(0, 0);
- exit(0);
-}
-
-void OSystem_GP32::setWindowCaption(const char *caption) {
- NP("OSys::setWindowCaption(%s)", caption);
-}
-
-void OSystem_GP32::displayMessageOnOSD(const char *msg) {
- NP("OSys::displayMessageOnOSD(%s)", msg);
-}
-
-OSystem *OSystem_GP32_create() {
- NP("OSys::OSystem_GP32_create()");
- return new OSystem_GP32();
-}
diff --git a/backends/platform/gp32/gp32_osys.h b/backends/platform/gp32/gp32_osys.h
deleted file mode 100644
index 9938671962..0000000000
--- a/backends/platform/gp32/gp32_osys.h
+++ /dev/null
@@ -1,155 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- *
- */
-
-#ifndef GP32_OSYS_H
-#define GP32_OSYS_H
-
-//Standard ScummVM includes.
-#include "common/scummsys.h"
-#include "common/system.h"
-
-#include "engines/engine.h"
-
-#include "gp32std.h"
-#include "gp32std_grap.h"
-#include "gp32std_input.h"
-#include "gp32std_sound.h"
-
-class OSystem_GP32 : public OSystem {
-public:
- static OSystem *instance();
-
-protected:
- uint16 _screenWidth, _screenHeight;
- uint8 *_gameScreen;
- uint16 *_tmpScreen, *_hwScreen;
- OverlayColor *_overlayBuffer;
-
- Graphics::Surface _framebuffer;
-
- int _overlayWidth, _overlayHeight;
- bool _overlayVisible;
- uint32 _shakePos;
-
- // 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;
- };
-
- struct MousePos {
- int16 x, y, w, h;
- };
-
- // mouse
- KbdMouse _km;
- bool _mouseVisible;
- int _mouseX, _mouseY;
- int _mouseWidth, _mouseHeight;
- int _mouseHotspotX, _mouseHotspotY;
- byte _mouseKeyColor;
- byte *_mouseBuf;
-
- bool _adjustAspectRatio;
-
- /** Force full redraw on next updateScreen */
- bool _forceFull;
-
- uint16 _currentPalette[256];
-// uint _paletteDirtyStart, _paletteDirtyEnd;
-
- int32 _samplesPerSec;
-
-public:
-
- OSystem_GP32();
- ~OSystem_GP32();
-
- bool hasFeature(Feature f);
- void setFeatureState(Feature f, bool enable);
- bool getFeatureState(Feature f);
- const GraphicsMode *getSupportedGraphicsModes() const;
- int getDefaultGraphicsMode() const;
- bool setGraphicsMode(int mode);
- bool setGraphicsMode(const char *name);
- int getGraphicsMode() const;
- void initSize(uint width, uint height);
- int16 getHeight();
- int16 getWidth();
- void setPalette(const byte *colors, uint start, uint num);
- void grabPalette(byte *colors, uint start, uint num);
-
- void copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h);
- void updateScreen();
- void setShakePos(int shakeOffset);
-
- void showOverlay();
- void hideOverlay();
- void clearOverlay();
- void grabOverlay(OverlayColor *buf, int pitch);
- void copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h);
-
- virtual Graphics::Surface *lockScreen();
- virtual void unlockScreen();
-
- int16 getOverlayHeight();
- int16 getOverlayWidth();
-
- OverlayColor RGBToColor(uint8 r, uint8 g, uint8 b);
- void colorToRGB(OverlayColor color, uint8 &r, uint8 &g, uint8 &b);
-
- bool showMouse(bool visible);
-
- void warpMouse(int x, int y);
- void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor = 255, int cursorTargetScale = 1);
-
- bool pollEvent(Common::Event &event);
- uint32 getMillis();
- void delayMillis(uint msecs);
-
- void setTimerCallback(TimerProc callback, int interval);
-
- MutexRef createMutex(void);
- void lockMutex(MutexRef mutex);
- void unlockMutex(MutexRef mutex);
- void deleteMutex(MutexRef mutex);
-
- bool setSoundCallback(SoundProc proc, void *param);
- void clearSoundCallback();
- int getOutputSampleRate() const;
-
- void quit();
-
- void setWindowCaption(const char *caption);
-
- void displayMessageOnOSD(const char *msg);
-
- void fillMouseEvent(Common::Event &event, int x, int y);
- void handleKbdMouse();
-};
-
-#else
- #warning GP32_OSYS.H Called more then once.
-#endif /* GP32_H */
diff --git a/backends/platform/gp32/gp32std.cpp b/backends/platform/gp32/gp32std.cpp
deleted file mode 100644
index 13c055ebfa..0000000000
--- a/backends/platform/gp32/gp32std.cpp
+++ /dev/null
@@ -1,336 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- *
- */
-
-#include "common/scummsys.h"
-//#include "graphics/scaler.h"
-#include "common/system.h"
-
-#include "engines/engine.h"
-
-#include "gp32std.h"
-#include "gp32std_grap.h"
-#include "gp32std_memory.h"
-
-#define DEBUG_MAX 5
-char debline[DEBUG_MAX][256];
-static int debnext = 0;
-
-void _dprintf(const char *s, ...) {
- int deba, deb;
- char buf[1024];
- va_list va;
-
- va_start(va, s);
- vsprintf(buf, s, va);
- va_end(va);
-
- strcpy(debline[debnext++], buf);
-
- if (debnext == DEBUG_MAX)
- debnext = 0;
- gp_fillRect(frameBuffer1, 0, 243 - (DEBUG_MAX * 8) - 4, 320, (DEBUG_MAX * 8), 0);
-
- for (deb = debnext, deba = 0; deb < DEBUG_MAX; deb++, deba++) {
- //gp_fillRect(frameBuffer1, 0, (243 - (DEBUG_MAX * 8) - 4) + 8 * deba, 320, 8, 0);
- gp_textOut(frameBuffer1, 0, (240 - (DEBUG_MAX * 8) - 4) + 8 * deba, debline[deb], 0xFFFF);
- }
- for (deb = 0; deb < debnext; deb++, deba++) {
- //gp_fillRect(frameBuffer1, 0, (243 - (DEBUG_MAX * 8) - 4) + 8 * deba, 320, 8, 0);
- gp_textOut(frameBuffer1, 0, (240 - (DEBUG_MAX * 8) - 4) + 8 * deba, debline[deb], 0xFFFF);
- }
-
-// gp_delay(100);
-}
-
-////////////////////
-//String functions
-char *gp_strcpy(char *dst, const char *src) {
- char *pDst = dst;
-
- while (*pDst++ = *src++)
- ;
-
- return dst;
-}
-
-char *gp_strncpy(char *dst, const char *src, size_t count) {
- char *start = dst;
-
- while (count && (*dst++ = *src++))
- count--;
-
- if (count)
- while (--count)
- *dst++ = '\0';
-
- return start;
-}
-
-char *gp_strcat(char *dst, const char *src) {
- char *pDst = dst;
-
- while (*pDst)
- pDst++;
-
- while (*pDst++ = *src++)
- ;
-
- return dst;
-
-}
-
-char *gp_strdup(const char *str) {
- char *memory;
-
- if (!str)
- return NULL;
-
- if (memory = (char *)gp_malloc(strlen(str) + 1))
- return gp_strcpy(memory, str);
-
- return NULL;
-}
-
-int gp_strcasecmp(const char *dst, const char *src) {
- int f, l;
- do {
- f = tolower((unsigned char)(*(dst++)));
- l = tolower((unsigned char)(*(src++)));
- } while (f && (f == l));
-
- return f - l;
-}
-
-int gp_strncasecmp(const char *dst, const char *src, size_t count) {
- int f,l;
-
- if (count) {
- do {
- f = tolower((unsigned char)(*(dst++)));
- l = tolower((unsigned char)(*(src++)));
- } while (--count && f && (f == l));
- return f - l;
- }
-
- return 0;
-}
-
-//FIXME: Handle LONG string
-void gp_sprintf(char *str, const char *fmt, ...) {
- char s[512];
- va_list marker;
-
- va_start(marker, fmt);
- vsnprintf(s, 512, fmt, marker);
- va_end(marker);
-
- gp_strcpy(str, s);
-}
-
-int gp_printf(const char *fmt, ...) {
- char s[256];
- va_list marker;
-
- va_start(marker, fmt);
- vsnprintf(s, 256, fmt, marker);
- va_end(marker);
-
- _dprintf("%s", s);
- //gp_delay(100);
- return 0;
-}
-
-void gp_delay(uint32 msecs) {
- int startTime = GpTickCountGet();
- while (GpTickCountGet() < startTime + msecs);
-}
-
-void gp_clockSpeedChange(int freq, int magic, int div) {
- #define rTCFG0 (*(volatile unsigned *)0x15100000)
- #define rTCFG1 (*(volatile unsigned *)0x15100004)
- #define rTCNTB4 (*(volatile unsigned *)0x1510003c)
- unsigned int pclk;
- unsigned int prescaler0;
-
- // Change CPU Speed
- GpClockSpeedChange(freq, magic, div);
- pclk = GpPClkGet();
-
- // Repair SDK timer - it forgets to set prescaler
- prescaler0 = (pclk / (8000 * 40)) - 1;
- rTCFG0 = (rTCFG0 & 0xFFFFFF00) | prescaler0;
- rTCFG1 = 0x30033;
-
- // Repair GpTickCountGet
- rTCNTB4 = pclk / 1600;
-}
-
-void gp_setCpuSpeed(int freq) {
- // Default value for 40 mhz
- static int CLKDIV = 0x48013;
- static int MCLK = 40000000;
- static int CLKMODE = 0;
- static int HCLK = 40000000;
- static int PCLK = 40000000;
-
- switch (freq) {
- // overclocked
- case 168: { CLKDIV = 0x14000; MCLK = 168000000; CLKMODE = 3; break; }
- case 172: { CLKDIV = 0x23010; MCLK = 172000000; CLKMODE = 3; break; }
- case 176: { CLKDIV = 0x24010; MCLK = 176000000; CLKMODE = 3; break; }
- case 180: { CLKDIV = 0x16000; MCLK = 180000000; CLKMODE = 3; break; }
- case 184: { CLKDIV = 0x26010; MCLK = 184000000; CLKMODE = 3; break; }
- case 188: { CLKDIV = 0x27010; MCLK = 188000000; CLKMODE = 3; break; }
- case 192: { CLKDIV = 0x18000; MCLK = 192000000; CLKMODE = 3; break; }
- case 196: { CLKDIV = 0x29010; MCLK = 196000000; CLKMODE = 3; break; }
- case 200: { CLKDIV = 0x2A010; MCLK = 200000000; CLKMODE = 3; break; }
- case 204: { CLKDIV = 0x2b010; MCLK = 204000000; CLKMODE = 3; break; }
- case 208: { CLKDIV = 0x2c010; MCLK = 208000000; CLKMODE = 3; break; }
- case 212: { CLKDIV = 0x2d010; MCLK = 212000000; CLKMODE = 3; break; }
- case 216: { CLKDIV = 0x2e010; MCLK = 216000000; CLKMODE = 3; break; }
- case 220: { CLKDIV = 0x2f010; MCLK = 220000000; CLKMODE = 3; break; }
- case 224: { CLKDIV = 0x30010; MCLK = 224000000; CLKMODE = 3; break; }
- case 228: { CLKDIV = 0x1e000; MCLK = 228000000; CLKMODE = 3; break; }
- case 232: { CLKDIV = 0x32010; MCLK = 232000000; CLKMODE = 3; break; }
- case 236: { CLKDIV = 0x33010; MCLK = 236000000; CLKMODE = 3; break; }
- case 240: { CLKDIV = 0x20000; MCLK = 240000000; CLKMODE = 3; break; }
- case 244: { CLKDIV = 0x35010; MCLK = 244000000; CLKMODE = 3; break; }
- case 248: { CLKDIV = 0x36010; MCLK = 248000000; CLKMODE = 3; break; }
- case 252: { CLKDIV = 0x22000; MCLK = 252000000; CLKMODE = 3; break; }
- case 256: { CLKDIV = 0x38010; MCLK = 256000000; CLKMODE = 3; break; }
-
- // normal
-// case 166: { CLKDIV = 0x4B011; MCLK = 166000000; CLKMODE = 3; break; }
- case 166: { CLKDIV = 0x2f001; MCLK = 165000000; CLKMODE = 3; break; }
- case 164: { CLKDIV = 0x4a011; MCLK = 164000000; CLKMODE = 3; break; }
- case 160: { CLKDIV = 0x48011; MCLK = 160000000; CLKMODE = 3; break; }
- case 156: { CLKDIV = 0x2c001; MCLK = 156000000; CLKMODE = 3; break; }
- case 144: { CLKDIV = 0x28001; MCLK = 144000000; CLKMODE = 3; break; }
- case 133: { CLKDIV = 0x51021; MCLK = 133500000; CLKMODE = 2; break; }
- case 132: { CLKDIV = 0x3a011; MCLK = 132000000; CLKMODE = 3; break; }
- case 120: { CLKDIV = 0x24001; MCLK = 120000000; CLKMODE = 2; break; }
- case 100: { CLKDIV = 0x2b011; MCLK = 102000000; CLKMODE = 2; break; }
- case 66: { CLKDIV = 0x25002; MCLK = 67500000; CLKMODE = 2; break; }
- case 50: { CLKDIV = 0x2a012; MCLK = 50000000; CLKMODE = 0; break; }
-// case 40: { CLKDIV = 0x48013; MCLK = 40000000; CLKMODE = 0; break; }
- case 40: { CLKDIV = 0x48013; MCLK = 40000000; CLKMODE = 1; break; }
-// case 33: { CLKDIV = 0x25003; MCLK = 33750000; CLKMODE = 0; break; }
- case 33: { CLKDIV = 0x25003; MCLK = 33750000; CLKMODE = 2; break; }
- case 22: { CLKDIV = 0x33023; MCLK = 22125000; CLKMODE = 0; break; }
- default:
- error("Invalid CPU frequency!");
- }
- if (CLKMODE == 0) { HCLK = MCLK; PCLK = MCLK; }
- if (CLKMODE == 1) { HCLK = MCLK; PCLK = MCLK / 2; }
- if (CLKMODE == 2) { HCLK = MCLK / 2; PCLK = MCLK / 2; }
- if (CLKMODE == 3) { HCLK = MCLK / 2; PCLK = MCLK / 4; }
-
- gp_clockSpeedChange(MCLK, CLKDIV, CLKMODE);
-}
-
-void gp_Reset() {
- gp_setCpuSpeed(66);
- asm volatile("swi #4\n");
-}
-
-void gp_exit(int code) {
- if (!code) {
- printf(" ----------------------------------------");
- printf(" Your GP32 is now restarting... ");
- printf(" ----------------------------------------");
- printf("");
-
- gp_delay(3000);
-
- GpAppExit();
- } else {
- printf("Exit Code %d", code);
- while (1);
- }
-}
-
-// Debug functions
-void GPDEBUG(const char *fmt, ...) {
- char s[256];
- va_list marker;
-
- va_start(marker, fmt);
- vsnprintf(s, 256, fmt, marker);
- va_end(marker);
-
- _dprintf("%s", s);
-}
-
-void NP(const char *fmt, ...) {
-// return;
- char s[256];
- va_list marker;
-
- va_start(marker, fmt);
- vsnprintf(s, 256, fmt, marker);
- va_end(marker);
-
- _dprintf("NP:%s", s);
- gp_delay(50);
-}
-
-void LP(const char *fmt, ...) {
-// return;
- char s[256];
- va_list marker;
-
- va_start(marker, fmt);
- vsnprintf(s, 256, fmt, marker);
- va_end(marker);
-
- _dprintf("LP:%s", s);
- gp_delay(300);
-}
-
-void SP(const char *fmt, ...) {
-// return;
- char s[256];
- va_list marker;
-
- va_start(marker, fmt);
- vsnprintf(s, 256, fmt, marker);
- va_end(marker);
-
- _dprintf("SP:%s", s);
- gp_delay(50);
-}
-
-void BP(const char *fmt, ...) {
-// return;
- char s[256];
- va_list marker;
-
- va_start(marker, fmt);
- vsnprintf(s, 256, fmt, marker);
- va_end(marker);
-
- _dprintf("BP:%s", s);
- gp_delay(2000);
-}
diff --git a/backends/platform/gp32/gp32std.h b/backends/platform/gp32/gp32std.h
deleted file mode 100644
index 746b096d29..0000000000
--- a/backends/platform/gp32/gp32std.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- *
- */
-
-#ifndef __GP32STD_H
-#define __GP32STD_H
-
-#include <gpfont.h>
-#include <gpfont_port.h>
-#include <gpgraphic.h>
-#include <gpmm.h>
-#include <gpmem.h>
-#include <gpos_def.h>
-#include <gpstdio.h>
-#include <gpstdlib.h>
-#include <gpdef.h>
-
-#define LCD_WIDTH 320
-#define LCD_HEIGHT 240
-
-extern char * gp_strcpy(char *dst, const char *src);
-extern char * gp_strncpy(char *dst, const char *src, size_t count);
-extern char * gp_strcat(char *dst, const char *src);
-extern char * gp_strdup(const char *str);
-extern int gp_strcasecmp(const char *dst, const char *src);
-extern int gp_strncasecmp(const char *dst, const char *src, size_t count);
-extern void gp_sprintf(char *str, const char *fmt, ...);
-
-extern void gp_setCpuSpeed(int freq);
-extern int gp_printf(const char *fmt, ...);
-extern void gp_delay(unsigned long msecs);
-extern void gp_exit(int code);
-
-extern void GPDEBUG(const char *fmt, ...);
-extern void LP(const char *fmt, ...);
-extern void NP(const char *fmt, ...);
-extern void SP(const char *fmt, ...);
-extern void BP(const char *fmt, ...);
-
-#endif
diff --git a/backends/platform/gp32/gp32std_file.cpp b/backends/platform/gp32/gp32std_file.cpp
deleted file mode 100644
index 6c7076c4d4..0000000000
--- a/backends/platform/gp32/gp32std_file.cpp
+++ /dev/null
@@ -1,320 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- *
- */
-
-
-#include "common/scummsys.h"
-//#include "graphics/scaler.h"
-#include "common/system.h"
-
-#include "gp32std.h"
-#include "gp32std_file.h"
-
-FILE *gp_stderr = NULL;
-FILE *gp_stdout = NULL;
-FILE *gp_stdin = NULL;
-
-// Cache Idea / Code borrowed from the ps2 port
-#define USE_CACHE
-
-//////////////////
-//File functions
-
-
-// CACHE
-inline bool gp_cacheInPos(GPFILE *stream) {
- return (stream->cachePos <= stream->filePos && stream->filePos < stream->cachePos + stream->bytesInCache);
-}
-
-int gp_cacheMiss(GPFILE *stream) {
- unsigned long readcount = 0;
-
- int copyLen = stream->fileSize - stream->filePos;
- if (copyLen > FCACHE_SIZE)
- copyLen = FCACHE_SIZE;
-
- stream->cachePos = stream->filePos;
- stream->cacheBufOffs = 0;
- stream->bytesInCache = copyLen;
-
- ERR_CODE err = GpFileRead(stream->handle, stream->cacheData, copyLen, &readcount);
-
- stream->physFilePos += copyLen;
-
- return err;
-}
-
-int gp_flushWriteCache(GPFILE *stream) {
- if (stream->bytesInCache == 0)
- return 0;
-
- ERR_CODE err = GpFileWrite(stream->handle, stream->cacheData, stream->bytesInCache); // flush cache
-
- stream->filePos += stream->bytesInCache;
- stream->physFilePos += stream->bytesInCache;
- stream->bytesInCache = 0;
-
- return err;
-}
-
-///////////////////////////////////////////////////////////////
-
-GPFILE *gp_fopen(const char *fileName, const char *openMode) {
- uint32 mode;
- GPFILE *file;
- ERR_CODE err;
- char tempPath[256];
-
- if (!strchr(fileName, '.')) {
- sprintf(tempPath, "%s.", fileName);
- fileName = tempPath;
- }
-
- file = new GPFILE;
-
-// NP("%s(\"%s\", \"%s\")", __FUNCTION__, fileName, openMode);
-
- // FIXME add binary/text support
- if (tolower(openMode[0]) == 'r') {
- mode = OPEN_R;
- GpFileGetSize(fileName, &file->fileSize);
- err = GpFileOpen(fileName, mode, &file->handle);
- } else if (tolower(openMode[0]) == 'w') {
- file->fileSize = 0;
- mode = OPEN_W;
- err = GpFileCreate(fileName, ALWAYS_CREATE, &file->handle);
- } else if (tolower(openMode[0]) == 'a') {
- warning("We do not support 'a' file open mode.");
- delete file;
- return NULL;
- } else {
- error("wrong file mode");
- }
-
- if (!file) {
- error("%s: cannot create FILE structure", __FUNCTION__);
- }
-
- if (err) {
- printf("gp_fopen(): IO error %d", err);
- delete file;
- return NULL;
- }
-
- file->mode = mode;
- file->cachePos = 0;
- file->filePos = 0;
- file->cacheBufOffs = 0;
- file->physFilePos = 0;
- file->bytesInCache = 0;
-
- return file;
-}
-
-int gp_fclose(GPFILE *stream) {
- if (!stream) {
- //warning("closing null file");
- return 1;
- }
-
-/* if (*(uint32 *)((char *)stream - sizeof(uint32)) == 0x4321) {
- debug(0, "Double closing", __FUNCTION__);
- return 1;
- }
-*/
-
-#ifdef USE_CACHE
- if (stream->bytesInCache && stream->mode == OPEN_W) {
- gp_flushWriteCache(stream);
- }
-#endif
-
- ERR_CODE err = GpFileClose(stream->handle);
- delete stream;
-
- return err;
-}
-
-int gp_fseek(GPFILE *stream, long offset, int whence) {
- switch (whence) {
- case SEEK_SET:
- whence = FROM_BEGIN;
- break;
- case SEEK_CUR:
- whence = FROM_CURRENT;
- break;
- case SEEK_END:
- whence = FROM_END;
- break;
- }
-
- ERR_CODE err;
-#ifdef USE_CACHE
- // need to flush cache
- if (stream->mode == OPEN_W) { // write
- gp_flushWriteCache(stream);
- err = GpFileSeek(stream->handle, whence, offset, (long *)&stream->filePos);
- } else { // read
- if (whence == SEEK_CUR)
- offset += stream->physFilePos - stream->filePos;
-
- err = GpFileSeek(stream->handle, whence, offset, (long *)&stream->physFilePos);
- stream->filePos = stream->physFilePos;
-
- if (!gp_cacheInPos(stream)) { // cache miss
- gp_cacheMiss(stream);
- }
- }
-#endif
-
- return 1;
- //return 0; //FIXME?
-}
-
-size_t gp_fread(void *ptr, size_t size, size_t n, GPFILE *stream) {
- unsigned int len = size * n;
- uint8 *dest = (uint8 *)ptr;
-
-#ifdef USE_CACHE
- while (len && !gp_feof(stream)) {
- if (gp_cacheInPos(stream)) {
- uint32 startPos = (stream->cacheBufOffs + (stream->filePos - stream->cachePos)) % FCACHE_SIZE;
- uint32 copyLen = stream->bytesInCache - (stream->filePos - stream->cachePos);
- if (copyLen > len)
- copyLen = len;
- if (startPos + copyLen > FCACHE_SIZE)
- copyLen = FCACHE_SIZE - startPos;
-
- memcpy(dest, stream->cacheData + startPos, copyLen);
-
- stream->filePos += copyLen;
- dest += copyLen;
- len -= copyLen;
- } else { // cache miss or cache empty
- gp_cacheMiss(stream);
- }
- }
-#else
- ulong readcount = 0;
- ERR_CODE err = GpFileRead(stream->handle, ptr, len, &readcount);
- stream->physFilePos += len;
- stream->filePos += len;
-#endif
-
- // FIXME: Fingolfin asks: why is there a FIXME here? Please either clarify what
- // needs fixing, or remove it!
- return 1; //readcount / size; //FIXME
-}
-
-size_t gp_fwrite(const void *ptr, size_t size, size_t n, GPFILE *stream) {
- int len = size * n;
- uint8 *srcBuf = (uint8 *)ptr;
-
- if (!stream) {
- //warning("writing to null file");
- return 0;
- }
-
-#ifdef USE_CACHE
- while (len) {
- uint32 copyLen;
- if (stream->bytesInCache + len > FCACHE_SIZE)
- copyLen = FCACHE_SIZE - stream->bytesInCache;
- else
- copyLen = len;
-
- srcBuf += copyLen;
- len -= copyLen;
-
- if (stream->bytesInCache == FCACHE_SIZE) {
- gp_flushWriteCache(stream);
- }
- }
-#else
- ERR_CODE err = GpFileWrite(stream->handle, ptr, len);
- if (!err)
- return n;
- else
- return -err;
-#endif
- return 1;
-}
-
-long gp_ftell(GPFILE *stream) {
- ulong pos = 0;
- pos = stream->filePos;
- //ERR_CODE err = GpFileSeek(stream->handle, FROM_CURRENT, 0, (long*)&pos);
- return pos;
-}
-
-void gp_clearerr(GPFILE *stream)
-{
-}
-
-int gp_feof(GPFILE *stream) {
- return (unsigned long)gp_ftell(stream) >= stream->fileSize;
-}
-
-char gp_fgetc(GPFILE *stream) {
- char c[1];
-
- gp_fread(&c[0], 1, 1, stream);
- return c[0];
-}
-
-char *gp_fgets(char *s, int n, GPFILE *stream) {
- int i = 0;
-
- while (!gp_feof(stream) && i < n) {
- gp_fread(&s[i], 1, 1, stream);
- if (s[i] == '\n') {
- s[i + 1] = 0;
- return s;
- }
- i++;
- }
- if (gp_feof(stream))
- return NULL;
- else
- return s;
-}
-
-int gp_fprintf(GPFILE *stream, const char *fmt, ...) {
- char s[256];
- va_list marker;
-
- va_start(marker, fmt);
- vsnprintf(s, 256, fmt, marker);
- va_end(marker);
-
- return gp_fwrite(s, 1, strlen(s), stream);
-}
-
-int gp_fflush(GPFILE *stream) {
- return 0;
-}
-
-int gp_ferror(GPFILE *stream) {
- return 0;
-}
diff --git a/backends/platform/gp32/gp32std_file.h b/backends/platform/gp32/gp32std_file.h
deleted file mode 100644
index a515a63590..0000000000
--- a/backends/platform/gp32/gp32std_file.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- *
- */
-
-#ifndef __GP32STD_FILE_H
-#define __GP32STD_FILE_H
-
-#define FCACHE_SIZE 8 * 1024
-
-typedef struct {
- F_HANDLE handle;
- unsigned long mode;
- unsigned long fileSize;
- unsigned long filePos;
- unsigned long physFilePos;
- unsigned long cachePos;
- unsigned long cacheBufOffs;
- unsigned long bytesInCache;
- unsigned char cacheData[FCACHE_SIZE];
-} GPFILE;
-
-extern GPFILE *gp_stderr;
-extern GPFILE *gp_stdout;
-extern GPFILE *gp_stdin;
-
-extern GPFILE * gp_fopen(const char *filename, const char *mode);
-extern int gp_fclose(GPFILE *stream);
-extern int gp_fseek(GPFILE *stream, long offset, int whence);
-extern size_t gp_fread(void *ptr, size_t size, size_t n, GPFILE *stream);
-extern size_t gp_fwrite(const void *ptr, size_t size, size_t n, GPFILE *stream);
-extern long gp_ftell(GPFILE *stream);
-extern void gp_clearerr(GPFILE *stream);
-extern int gp_feof(GPFILE *stream);
-extern char gp_fgetc(GPFILE *stream);
-extern char * gp_fgets(char *s, int n, GPFILE *stream);
-extern int gp_fflush(GPFILE *stream);
-extern int gp_ferror(GPFILE *stream);
-extern int gp_fprintf(GPFILE *stream, const char *fmt, ...);
-
-#endif
diff --git a/backends/platform/gp32/gp32std_grap.cpp b/backends/platform/gp32/gp32std_grap.cpp
deleted file mode 100644
index a60f61c66b..0000000000
--- a/backends/platform/gp32/gp32std_grap.cpp
+++ /dev/null
@@ -1,148 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- *
- */
-
-#include "common/scummsys.h"
-#include "common/system.h"
-
-#include "gp32std.h"
-#include "gp32std_grap.h"
-
-#include "globals.h"
-
-GPDRAWSURFACE lcdSurface[2];
-
-uint8 flipIndex = 1;
-
-uint16 *frameBuffer1;
-uint16 *frameBuffer2;
-
-uint8 gammaLUT[256];
-uint8 gammaLUTInv[256];
-
-extern const unsigned char fontresEng1[];
-extern const unsigned char fontresKor1[];
-
-void gp_putBitmap8x16(uint16 *frameBuffer, int x, int y, byte *lpBitmap, uint16 wColor) {
- byte *pBitmap = lpBitmap;
- for (int nRow = 0; nRow < 12; nRow ++) {
- byte data = *pBitmap++;
- for (int nCol = 0; nCol < 7; nCol ++) {
- if (data & 0x80)
- if (x + nCol >= 0 && y + nRow >= 0 && x + nCol < 320 && y + nRow < 240)
- gpd_drawPixel16(frameBuffer, x + nCol, y + nRow, wColor);
-
- data <<= 1;
- }
- }
-}
-
-void gp_putEngFont(uint16 *frameBuffer, int x, int y, char c, uint16 wColor) {
- byte *pBitmap = (byte *) &fontresEng1[c * 16];
- gp_putBitmap8x16(frameBuffer, x, y, pBitmap, wColor);
-}
-
-void gp_textOut(uint16 *frameBuffer, int x, int y, char* lpszText, uint16 wColor) {
- // TODO: Handle korean font
- int nPos = x;
- char* pszText = lpszText;
-
- while (*pszText != '\0') {
- if (*pszText == '\n') {
- nPos = x;
- y += 8;
- } else {
- gp_putEngFont(frameBuffer, nPos, y, *pszText, wColor);
- nPos += 7;
- }
-
- pszText++;
- }
-}
-
-void gp_fillRect(uint16 *frameBuffer, int16 x, int16 y, int16 w, int16 h, uint16 color) {
- uint16 *buffer = &frameBuffer[(240 - (y + h)) + (240 * x)];
- for (int i = 0; i < w; i++) {
- for (int j = 0; j < h; j++) {
- *buffer++ = color;
- }
- buffer += 240 - h;
- }
-}
-
-void gp_initGammaTable(float value)
-{
- for (int i = 0; i < 256; i++) {
- if (value == 1.0f) {
- gammaLUT[i] = i;
- gammaLUTInv[i] = i;
- } else {
- gammaLUT[i] = (uint8)(pow((double)i / 256, 1 / (double)value) * 256);
- gammaLUTInv[i] = (uint8)(pow((double)i / 256, (double)value) * 256);
- }
- }
-}
-
-uint16 gp_RGBTo16(uint16 r, uint16 g, uint16 b) {
- // GP32 16bit color 5551
- if (g_vars.gammaRamp != 10000) {
- r = gammaLUT[r];
- g = gammaLUT[g];
- b = gammaLUT[b];
- }
- return (((r >> 3) & 0x1F) << 11) | (((g >> 3) & 0x1F) << 6) | ((b >> 3) & 0x1F) << 1;
-}
-
-void gp_16ToRGB(uint16 color, uint8 *r, uint8 *g, uint8 *b) {
- *r = ((((color) >> 11) & 0x1F) << 3);
- *g = ((((color) >> 6) & 0x1F) << 3); //(((color>>5)&0x3F) << 2);
- *b = ((((color) >> 1) & 0x1F) << 3); //((color&0x1F) << 3);
-
- if (g_vars.gammaRamp != 10000) {
- *r = gammaLUTInv[*r];
- *g = gammaLUTInv[*g];
- *b = gammaLUTInv[*b];
- }
-}
-
-void gp_flipScreen() {
- uint16 *frameBuffer1_old = frameBuffer1;
- uint16 *frameBuffer2_old = frameBuffer2;
-
- GpSurfaceFlip(&lcdSurface[flipIndex]);
- flipIndex = 1 - flipIndex;
- frameBuffer1 = frameBuffer2_old;
- frameBuffer2 = frameBuffer1_old;
-}
-
-void gp_initFrameBuffer() {
- GpLcdSurfaceGet(&lcdSurface[0], 0);
- GpLcdSurfaceGet(&lcdSurface[1], 1);
- GpSurfaceSet(&lcdSurface[0]);
- frameBuffer1 = (uint16 *)lcdSurface[0].ptbuffer;
- frameBuffer2 = (uint16 *)lcdSurface[1].ptbuffer;
-
- memset(frameBuffer1, 0xFF, LCD_WIDTH * LCD_HEIGHT * sizeof(uint16));
- memset(frameBuffer2, 0xFF, LCD_WIDTH * LCD_HEIGHT * sizeof(uint16));
-}
diff --git a/backends/platform/gp32/gp32std_grap.h b/backends/platform/gp32/gp32std_grap.h
deleted file mode 100644
index 79bc312779..0000000000
--- a/backends/platform/gp32/gp32std_grap.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- *
- */
-
-#ifndef __GP32STD_GRAP_H
-#define __GP32STD_GRAP_H
-
-extern GPDRAWSURFACE lcdSurface[2];
-extern uint8 flipIndex;
-
-extern uint16 *frameBuffer1;
-extern uint16 *frameBuffer2;
-
-extern void gp_fillRect(uint16 *frameBuffer, int16 x, int16 y, int16 w, int16 h, uint16 color);
-extern uint16 gp_RGBTo16(uint16 r, uint16 g, uint16 b);
-extern void gp_16ToRGB(uint16 color, uint8 *r, uint8 *g, uint8 *b);
-
-extern void gp_textOut(uint16 *frameBuffer, int x, int y, char* lpszText, uint16 wColor);
-
-extern void gp_initGammaTable(float value);
-extern void gp_initFrameBuffer();
-extern void gp_flipScreen();
-
-#define gpd_drawPixel16(dst,x,y,color) (dst)[(239 - (y)) + (240 * (x))] = (color)
-
-#endif
diff --git a/backends/platform/gp32/gp32std_input.cpp b/backends/platform/gp32/gp32std_input.cpp
deleted file mode 100644
index 41689d9472..0000000000
--- a/backends/platform/gp32/gp32std_input.cpp
+++ /dev/null
@@ -1,210 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- *
- */
-
-#include "common/scummsys.h"
-
-#include "gp32std.h"
-#include "gp32std_input.h"
-
-static uint32 buttonState = 0;
-static uint16 buttonPressState = 0;
-
-#define GET_BUTTON_PRESSED(a) (buttonPressState & (a))
-#define ON_BUTTON_PRESSED(a) (buttonPressState |= (a))
-#define OFF_BUTTON_PRESSED(a) (buttonPressState &= ~(a))
-
-#define GET_BUTTON_DOWN(a) (buttonState & (a) << 12)
-#define ON_BUTTON_DOWN(a) buttonState |= ((a) << 12)
-#define OFF_BUTTON_DOWN(a) buttonState &= ~((a) << 12)
-
-#define GET_BUTTON_UP(a) (buttonState & (a))
-#define ON_BUTTON_UP(a) buttonState |= (a)
-#define OFF_BUTTON_UP(a) buttonState &= ~(a)
-
-#define rKEY_A 0x4000
-#define rKEY_B 0x2000
-#define rKEY_L 0x1000
-#define rKEY_R 0x8000
-#define rKEY_UP 0x0800
-#define rKEY_DOWN 0x0200
-#define rKEY_LEFT 0x0100
-#define rKEY_RIGHT 0x0400
-#define rKEY_START 0x0040
-#define rKEY_SELECT 0x0080
-#define rPBDAT (*(volatile unsigned *)0x1560000c)
-#define rPEDAT (*(volatile unsigned *)0x15600030)
-
-/****************************************************************
- GP32 Input mappings - Returns Button Pressed.
-****************************************************************/
-int gp_trapKey() {
- int value = 0;
-
- unsigned long gpb = rPBDAT; // 0x156
- unsigned long gpe = rPEDAT;
-
- if ((gpb & rKEY_LEFT) == 0)
- value |= GPC_VK_LEFT;
- if ((gpb & rKEY_RIGHT) == 0)
- value |= GPC_VK_RIGHT;
- if ((gpb & rKEY_UP) == 0)
- value |= GPC_VK_UP;
- if ((gpb & rKEY_DOWN) == 0)
- value |= GPC_VK_DOWN;
- if ((gpb & rKEY_A) == 0)
- value |= GPC_VK_FA;
- if ((gpb & rKEY_B) == 0)
- value |= GPC_VK_FB;
- if ((gpb & rKEY_L) == 0)
- value |= GPC_VK_FL;
- if ((gpb & rKEY_R) == 0)
- value |= GPC_VK_FR;
- if ((gpe & rKEY_SELECT) == 0)
- value |= GPC_VK_SELECT;
- if ((gpe & rKEY_START) == 0)
- value |= GPC_VK_START;
-
- return value;
-}
-
-bool gp_getButtonEvent(uint32 *nKeyUD, uint16 *nKeyP) {
-// int nKey = GpKeyGet();
- int nKey = gp_trapKey();
-
- const int keyBitMask[10] = {0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x100, 0x200};
-
- for (int i = 0; i < 10; i++) {
- OFF_BUTTON_DOWN(keyBitMask[i]);
- OFF_BUTTON_UP(keyBitMask[i]);
- if (nKey & keyBitMask[i]) {
- if (!GET_BUTTON_PRESSED(keyBitMask[i])) {
-// GPDEBUG("DOWN %d", i);
- ON_BUTTON_PRESSED(keyBitMask[i]);
- ON_BUTTON_DOWN(keyBitMask[i]);
- }
- } else {
- if (GET_BUTTON_PRESSED(keyBitMask[i])) {
-// GPDEBUG("UP %d", i);
- OFF_BUTTON_PRESSED(keyBitMask[i]);
- ON_BUTTON_UP(keyBitMask[i]);
- }
- }
- }
-
-// GPDEBUG("%08x %04x", buttonState, buttonPressState);
- *nKeyUD = buttonState;
- *nKeyP = buttonPressState;
- return true;
-}
-
-#define MAX_EVENTS 32
-
-struct EventQueue {
-protected:
- int front, rear;
- int numElement;
- GP32BtnEvent event[MAX_EVENTS];
-
-public:
- void push(GP32BtnEvent *ev) {
- if ((rear + 1) % MAX_EVENTS == front) {
- GPDEBUG("Queue Overflow!");
- return;
- }
- numElement++;
-
- event[rear].type = ev->type;
- event[rear].button = ev->button;
- rear = (rear + 1) % MAX_EVENTS;
- }
-
- bool isEmpty() {
- return (numElement == 0);
- }
-
- bool isFull() {
- return (numElement == MAX_EVENTS);
- }
-
- bool get(GP32BtnEvent *ev) {
- if (front == rear) {
- return false;
- }
- numElement--;
- ev->type = event[front].type;
- ev->button = event[front].button;
- front = (front + 1) % MAX_EVENTS;
- return true;
- }
-};
-
-EventQueue eventQueue;
-
-bool gp_pumpButtonEvent() {
- int nKey = gp_trapKey();
- GP32BtnEvent ev;
-
- const int keyBitMask[10] = {0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x100, 0x200};
-
- for (int i = 0; i < 10; i++) {
- if (nKey & keyBitMask[i]) {
- if (!GET_BUTTON_PRESSED(keyBitMask[i])) {
- ON_BUTTON_PRESSED(keyBitMask[i]);
- ev.type = BUTTON_DOWN;
- ev.button = keyBitMask[i];
- eventQueue.push(&ev);
- //ON_BUTTON_DOWN(keyBitMask[i]);
- }
- } else {
- if (GET_BUTTON_PRESSED(keyBitMask[i])) {
- OFF_BUTTON_PRESSED(keyBitMask[i]);
- ev.type = BUTTON_UP;
- ev.button = keyBitMask[i];
- eventQueue.push(&ev);
- //ON_BUTTON_UP(keyBitMask[i]);
- }
- }
- }
-
- return true;
-}
-
-bool gp_pollButtonEvent(GP32BtnEvent *ev) {
- gp_pumpButtonEvent();
-
- if (eventQueue.isEmpty()) {
- return false;
- }
-
- eventQueue.get(ev);
-// GPDEBUG("Event poll %d %d", ev->type, ev->button);
-
- return true;
-}
-
-bool gp_getButtonPressed(uint16 button)
-{
- return buttonPressState & button;
-}
diff --git a/backends/platform/gp32/gp32std_memory.cpp b/backends/platform/gp32/gp32std_memory.cpp
deleted file mode 100644
index 9d7ef9a124..0000000000
--- a/backends/platform/gp32/gp32std_memory.cpp
+++ /dev/null
@@ -1,318 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- *
- */
-
-#include "common/scummsys.h"
-//#include "graphics/scaler.h"
-#include "common/system.h"
-
-#include "engines/engine.h"
-
-#include "gp32std.h"
-#include "gp32std_grap.h"
-#include "gp32std_memory.h"
-
-/////////////////////
-//Memory management
-
-#define USER_MEMORY_SIZE (256 * 1024)
-#define USER_BLOCK_SIZE 24
-#define NUM_BLOCK (USER_MEMORY_SIZE / USER_BLOCK_SIZE)
-// use fixed block size for small allocations
-// consumes about 128k for block array
-// consumes 256k for user memory
-
-class MemBlock {
-protected:
- static byte *userMem;
-// static size_t allocSize;
-// static MemBlock *head;
- static int numBlock;
- static int prevBlock;
-
- // Linked list is slow for this task. :)
- static MemBlock *block;
-
- byte *blockData;
- size_t size;
-
-// MemBlock *next;
-
- int used;
-
-public:
- static void init();
- static void deinit();
-
- static void *addBlock(size_t size);
- static void deleteBlock(void *dstBlock);
-};
-
-byte *MemBlock::userMem = NULL;
-//MemBlock *MemBlock::head = NULL;
-//size_t MemBlock::allocSize = 0;
-int MemBlock::numBlock = 0;
-int MemBlock::prevBlock = 0;
-MemBlock *MemBlock::block = NULL;
-
-void MemBlock::init()
-{
- userMem = (byte *)gm_malloc(USER_MEMORY_SIZE + USER_BLOCK_SIZE);
- block = (MemBlock *)gm_malloc(NUM_BLOCK * sizeof(MemBlock));
-
- if (!(userMem && block)) {
- //error
- }
-
- memset(userMem, 0, USER_MEMORY_SIZE + USER_BLOCK_SIZE);
- memset(block, 0, NUM_BLOCK * sizeof(MemBlock));
-}
-
-void MemBlock::deinit()
-{
- if (!(userMem && block)) {
- //error
- }
- gm_free(userMem);
- gm_free(block);
- userMem = NULL;
- block = NULL;
-}
-
-void *MemBlock::addBlock(size_t size)
-{
- int i;
- MemBlock *blk = &block[prevBlock];
-
- // some optimizaion with loop
- for (i = prevBlock; i < NUM_BLOCK; i++) {
- if (!blk->used) {
- break;
- }
- blk++;
- }
- if (i == NUM_BLOCK) {
- blk = &block[0];
- for (i = 0; i < prevBlock; i++) {
- if (!blk->used) {
- break;
- }
- blk++;
- }
- if (i == prevBlock) {
- prevBlock = 0;
- return gm_malloc(size);
- }
- }
-
- byte *ptr = userMem + (i * USER_BLOCK_SIZE);
-
- blk->size = size;
- blk->blockData = ptr;
- blk->used = 1;
-
- prevBlock = i;
-
- return (void *) ptr;
-}
-
-void MemBlock::deleteBlock(void *dstBlock)
-{
- // Faster method
- uint32 np = (uint32) dstBlock - (uint32) userMem;
-
- if ((np / USER_BLOCK_SIZE) * USER_BLOCK_SIZE != np) {
- gm_free(dstBlock);
-// warning("wrong block! (%d / %d)", (np / USER_BLOCK_SIZE) * USER_BLOCK_SIZE, np);
- return;
- }
- int i = np / USER_BLOCK_SIZE;
- if (i > NUM_BLOCK) {
- gm_free(dstBlock);
- return;
- }
- block[i].used = 0;
-
-/*
- int i = 0;
- for (i = 0; i < NUM_BLOCK; i++) {
- if (block[i].blockData == dstBlock)
- break;
- }
- if (i == NUM_BLOCK) {
- gm_free(dstBlock); //fixme?
- //warning("wrong block! %x", (uint32)block - (uint32)userMem);
- } else {
- GPDEBUG("deleteing block %d", i);
- block[i].used = 0;
- }*/
-}
-
-// HACK not to include struct MemBlock
-void memBlockInit()
-{
- MemBlock::init();
-}
-
-void memBlockDeinit()
-{
- MemBlock::deinit();
-}
-
-#undef memcpy
-#undef memset
-void *gp_memcpy(void *dst, const void *src, size_t count) {
- return memcpy(dst, src, count);
-}
-
-void *gp_memset(void *dst, int val, size_t count) {
- return memset(dst, val, count);
-}
-
-#define MALLOC_MASK 0xAB800000
-
-// WE HAVE TO ALIGN MEMORY ADDRESS ON THE ARM PROCESSOR!
-#define ALIGNED_SIZE(size) ((size) + (4 - ((size) & 3)))
-
-void *gp_malloc(size_t size) {
- uint32 np;
- uint32 *up;
-
- // size + 8 bytes : stores block size
- int allocSize = ALIGNED_SIZE(size) + sizeof(uint32) + sizeof(uint32);
- if (allocSize <= USER_BLOCK_SIZE) {
- np = (uint32) MemBlock::addBlock(allocSize);
- } else {
- np = (uint32) gm_malloc(allocSize);
- }
-
- if (np) {
- up = (uint32 *)np;
- *up = ALIGNED_SIZE(size) | MALLOC_MASK; // mem size: up to 8mb
- up = (uint32 *)(np + ALIGNED_SIZE(size) + sizeof(uint32));
- *up = 0x1234; // catches oob acess
- return (void *)(np + sizeof(uint32));
- }
-
- return NULL;
-}
-
-void gp_free(void *block) {
- uint32 np;
- uint32 *up;
-
- if (!block) {
- return;
- }
-
- np = ((uint32) block) - sizeof(uint32);
- up = (uint32 *) np;
- if (*up == 0x4321) {
- warning("%s: double deallocation", __FUNCTION__);
- return;
- }
-
- if (*up & MALLOC_MASK != MALLOC_MASK) {
- warning("%s: corrupt block", __FUNCTION__);
- return;
- }
-
- int blockSize = (*up & 0x7fffff);
- up = (uint32 *)(np + blockSize + sizeof(uint32));
- if (*up != 0x1234) {
- warning("gp_free: corrupt block - OOB access", __FUNCTION__);
- return;
- }
-
- np = ((uint32) block) - sizeof(uint32);
- up = (uint32 *) np;
- *up = 0x4321;
-
- if (blockSize + 8 <= USER_BLOCK_SIZE) {
- MemBlock::deleteBlock(up);
- } else {
- gm_free(up);
- }
-}
-
-void *gp_calloc(size_t nitems, size_t size) {
- void *p = gp_malloc(nitems * size); //gpcalloc doesnt clear?
-
- gp_memset(p, 0, nitems * size);
-
-// if (*(uint8 *)p != 0)
-// warning("%s: calloc doesn't clear", __FUNCTION__); //fixme: was error
-
- return p;
-}
-
-//////////////////////////////////////////////////
-// GP32 stuff
-//////////////////////////////////////////////////
-static char usedMemStr[16];
-int gUsedMem = 1024 * 1024;
-
-//#define CLEAN_MEMORY_WITH_0xE7
-//#define CHECK_USED_MEMORY
-//#define CHECK_NEW_TIME
-//#define CHECK_NEW_SIZE
-
-void *operator new(size_t size) {
-#if defined(CHECK_NEW_TIME)
- static int ftick;
- ftick = GpTickCountGet();
-#endif
-// printf("BP:operator new(%d)", size);
- void *ptr = gp_malloc(size);
-
-#if defined(CLEAN_MEMORY_WITH_0xE7)
- if (ptr != NULL) {
- gp_memset(ptr, 0xE7, size);
- }
-#endif
-#if defined(CHECK_USED_MEMORY)
- // Check free memory.
- gUsedMem = ((int)(ptr) + size) - 0xc000000;
-
- sprintf(usedMemStr, "%8d", gUsedMem);
- gp_fillRect(frameBuffer1, 0, 0, 64, 12, 0);
- gp_textOut(frameBuffer1, 0, 0, usedMemStr, 0xfffff);
-#endif
-#if defined(CHECK_NEW_TIME)
- sprintf(usedMemStr, "%2d", GpTickCountGet() - ftick);
- gp_fillRect(frameBuffer1, 72, 0, 24, 12, 0);
- gp_textOut(frameBuffer1, 72, 0, usedMemStr, 0xfffff);
-#endif
-#if defined(CHECK_NEW_SIZE)
- sprintf(usedMemStr, "%8d", size);
- gp_fillRect(frameBuffer1, 108, 0, 64, 12, 0);
- gp_textOut(frameBuffer1, 108, 0, usedMemStr, 0xfffff);
-#endif
- return ptr;
-}
-
-void operator delete(void *ptr) {
-// printf("operator delete(%x)", ptr);
- gp_free(ptr);
-}
diff --git a/backends/platform/gp32/gp32std_memory.h b/backends/platform/gp32/gp32std_memory.h
deleted file mode 100644
index b824e33838..0000000000
--- a/backends/platform/gp32/gp32std_memory.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- *
- */
-
-#ifndef __GP32STD_MEMORY_H
-#define __GP32STD_MEMORY_H
-
-extern void * gp_memcpy(void *dst, const void *src, size_t count);
-extern void * gp_memset(void *dst, int val, size_t count);
-extern void * gp_malloc(size_t size);
-extern void * gp_calloc(size_t nitems, size_t size);
-extern void gp_free(void *block);
-
-#endif
diff --git a/backends/platform/gp32/gp32std_sound.cpp b/backends/platform/gp32/gp32std_sound.cpp
deleted file mode 100644
index 68b33b95f2..0000000000
--- a/backends/platform/gp32/gp32std_sound.cpp
+++ /dev/null
@@ -1,187 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- *
- */
-
-#include "common/scummsys.h"
-
-#include "gp32std.h"
-#include "gp32std_sound.h"
-
-#define GP32_TIMER_AUDIO_IDX 0
-
-// Global variables
-static volatile unsigned int frame = 0;
-static volatile unsigned int *soundPos = 0;
-static volatile int idx_buf;
-static volatile unsigned int shiftVal = 0;
-static void *buffer;
-static GPSOUNDBUF soundBuf;
-
-// This routine gets called by the timer interrupt and
-// polls the current playing position within the buffer.
-
-static void soundTimer() {
- static int locked = false;
-
- if (locked) {
- return;
- }
-
- locked = true;
-
- unsigned int sampleshiftVal = soundBuf.samples << shiftVal;
- unsigned int t = (((unsigned int)(*soundPos) - (unsigned int)buffer) >> shiftVal) >= soundBuf.samples ? 1 : 0;
- if (t != frame) {
- unsigned int offs = ((frame == 1) ? (sampleshiftVal) : 0);
- //memset((uint8 *)buffer + offs, 0, sampleshiftVal);
- soundBuf.callback(soundBuf.userdata, (uint8 *)((unsigned int)buffer + offs), sampleshiftVal);
- frame = t;
- {
- // Play silence
- register uint16 *d = (uint16 *)((uint8 *)buffer + offs); // alignment-safe
- register uint32 max = (uint32)((uint8 *)buffer + offs + sampleshiftVal);
- do {
- *d++ ^= 0x8000; // 1
- *d++ ^= 0x8000; // 2
- *d++ ^= 0x8000; // 3
- *d++ ^= 0x8000; // 4
- *d++ ^= 0x8000; // 5
- *d++ ^= 0x8000; // 6
- *d++ ^= 0x8000; // 7
- *d++ ^= 0x8000; // 8
- *d++ ^= 0x8000; // 9
- *d++ ^= 0x8000; // 10
- *d++ ^= 0x8000; // 11
- *d++ ^= 0x8000; // 12
- *d++ ^= 0x8000; // 13
- *d++ ^= 0x8000; // 14
- *d++ ^= 0x8000; // 15
- *d++ ^= 0x8000; // 16
- *d++ ^= 0x8000; // 17
- *d++ ^= 0x8000; // 18
- *d++ ^= 0x8000; // 19
- *d++ ^= 0x8000; // 20
- *d++ ^= 0x8000; // 21
- *d++ ^= 0x8000; // 22
- *d++ ^= 0x8000; // 23
- *d++ ^= 0x8000; // 24
- *d++ ^= 0x8000; // 25
- *d++ ^= 0x8000; // 26
- *d++ ^= 0x8000; // 27
- *d++ ^= 0x8000; // 28
- *d++ ^= 0x8000; // 29
- *d++ ^= 0x8000; // 30
- *d++ ^= 0x8000; // 31
- *d++ ^= 0x8000; // 32
- } while ((uint32)d < max);
- }
- }
-
- locked = false;
-}
-
-int gp_soundBufStart(GPSOUNDBUF *sb) {
- int bufferSize = 0;
-
- PCM_SR gpFreq = PCM_S11;
- PCM_BIT gpFormat = PCM_16BIT;
-
- frame = 0;
-
- // Copy the structure
- memcpy(&soundBuf, sb, sizeof(GPSOUNDBUF));
-
- // Calculate size of a single sample in bytes
- // and a corresponding shift value
- shiftVal = 0;
-
- switch (soundBuf.format) {
- case 8:
- gpFormat = PCM_8BIT;
- break;
- case 16:
- gpFormat = PCM_16BIT;
- shiftVal++;
- break;
- }
-
- switch (soundBuf.freq) {
- case 11025:
- if (soundBuf.channels == 2) {
- gpFreq = PCM_S11;
- shiftVal++;
- } else
- gpFreq = PCM_M11;
- break;
- case 22050:
- if (soundBuf.channels == 2) {
- gpFreq = PCM_S22;
- shiftVal++;
- } else
- gpFreq = PCM_M22;
- break;
- case 44100:
- if (soundBuf.channels == 2) {
- gpFreq = PCM_S44;
- shiftVal++;
- } else
- gpFreq = PCM_M44;
- break;
- }
-
- soundBuf.samplesize = 1 << shiftVal;
-
- // Allocate memory for the playing buffer
- bufferSize = soundBuf.samplesize * soundBuf.samples * 2;
- buffer = malloc(bufferSize);
-
- // Clear the buffer
- uint16 *tmpBuf = (uint16 *)buffer;
- for (int i = 0; i < bufferSize / 2; i++)
- tmpBuf[i] = 0x8000;
-
- // Frequency of the timer interrupt which polls the playing position
- // FIXME: This frequency should not be multiplied by 4.
- soundBuf.pollfreq = 4 * (2 * soundBuf.freq) / soundBuf.samples;
-
- // Set timer interrupt
- if (GpTimerOptSet(GP32_TIMER_AUDIO_IDX, soundBuf.pollfreq, 0, soundTimer) == GPOS_ERR_ALREADY_USED) {
- GPDEBUG(" Timer is already used... kill timer");
- GpTimerKill(GP32_TIMER_AUDIO_IDX);
- }
- GpTimerSet(GP32_TIMER_AUDIO_IDX);
-
- GpPcmInit(gpFreq, gpFormat);
- GpPcmPlay((unsigned short *)buffer, bufferSize, 1);
- GpPcmLock((unsigned short *)buffer, (int *)&idx_buf, (unsigned int *)&soundPos);
-
- return 0;
-}
-
-void gp_soundBufStop() {
- GpTimerKill(GP32_TIMER_AUDIO_IDX);
- GpPcmStop();
- GpPcmRemove((unsigned short *)buffer);
- free(buffer);
-}
diff --git a/backends/platform/gp32/gp32std_sound.h b/backends/platform/gp32/gp32std_sound.h
deleted file mode 100644
index ad3f18a17f..0000000000
--- a/backends/platform/gp32/gp32std_sound.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- *
- */
-
-#ifndef __GP32STD_SOUND_H
-#define __GP32STD_SOUND_H
-
-// GPSOUNDBUF.userdata / Pointer to the buffer which needs to be refilled / Length of the buffer in bytes
-typedef void SoundProc(void *param, byte *buf, int len);
-
-typedef struct TGPSOUNDBUF {
- int32 freq;
- uint16 format;
- uint16 samples; // Buffer length (in samples)
- uint16 channels;
- uint16 padding; // Fix alignment problem
- void *userdata; // Userdata which gets passed to the callback function
- SoundProc *callback; // Callback function (just like in SDL)
- unsigned int pollfreq; // Frequency of the timer interrupt which polls the playing position
- // recommended value: 2*(playingfreq in Hz/GPSOUNDBUF.samples)
- unsigned int samplesize; // Size of one sample (8bit mono->1, 16bit stereo->4) - don't touch this
-} GPSOUNDBUF;
-
-int gp_soundBufStart(GPSOUNDBUF *sb);
-void gp_soundBufStop();
-
-#endif
diff --git a/backends/platform/gp32/gp_asmlib.s b/backends/platform/gp32/gp_asmlib.s
deleted file mode 100644
index e1f1d8cb39..0000000000
--- a/backends/platform/gp32/gp_asmlib.s
+++ /dev/null
@@ -1,426 +0,0 @@
- .ALIGN
-@ .ARM
-
- .GLOBAL cpu_speed
- .GLOBAL mmu_change
- .GLOBAL gp_enableIRQ
- .GLOBAL gp_disableIRQ
- .GLOBAL gp_installSWIIRQ
- .GLOBAL gp_removeSWIIRQ
-
-cpu_speed:
- stmdb r13!, {r0-r12,lr}
- stmdb sp!, {r0, r1, r2}
- mov r0, sp
- swi #0x0d
- add sp, sp, #12
- ldmia r13!, {r0-r12,lr}
- bx lr
- nop
-
-mmu_change:
- stmdb r13!, {r0-r12,lr}
- swi #0x02
- ldmia r13!, {r0-r12,lr}
- bx lr
- nop
-
-gp_enableIRQ:
- stmdb r13!, {r0,lr}
- mrs r0, CPSR
- bic r0, r0, #0x80
- msr CPSR, r0
- ldmia r13!, {r0,pc}
- bx lr
-
-gp_disableIRQ:
- stmdb r13!, {r0,lr}
- MRS r0, CPSR
- ORR r0, r0, #0xc0
- MSR CPSR, r0
- ldmia r13!, {r0,pc}
- bx lr
-
-gp_installSWIIRQ:
- stmdb r13!, {r14}
- swi 0x9
- ldmia r13!, {pc}
- bx lr
-
-gp_removeSWIIRQ:
- stmdb r13!, {r14}
- swi 0xa
- ldmia r13!, {pc}
- bx lr
-
-
-@ ******** ASMFastSolidBlit(unsigned char *src4, unsigned char *dst4, int nbx, int nby, int height2, int trans, int coul) ********
-
- .ALIGN
- .GLOBAL ASMFastSolidBlit
- .TYPE ASMFastSolidBlit, function
- .CODE 32
-
-@r0 = src4
-@r1 = dst4
-@r2 = nbx
-@r3 = nby
-
-@r4 = height2
-@r5 = trans
-@r6 = coul
-@r7 = tmp
-@r8 = tmpnby
-@r9 = tmp2
-
-_bx7:
- ldrb r8,[r0,+r3] @lecture 1er pixel
- subs r7,r3,#1
- bmi _sauty2
-
-_sauty2: @ecriture r8
- TEQ r8,r5
- STRNEB r8,[r1,+r7]
- SUB r0,r0,r4
- SUB r1,r1,#240
- SUBS r2,r2,#1
- BPL _bx7
-
- ldmfd r13!,{r4-r8}
- add sp,sp,#8
- bx lr
-
-ASMFastSolidBlit:
-
- sub sp,sp,#12
- stmfd r13!,{r4-r9}
- ldr r4,[r13,#36]
- ldr r5,[r13,#40]
- ldr r6,[r13,#44]
-
-_bx8:
- ldrb r9,[r0,+r3] @lecture 1er pixel
- subs r8,r3,#1
- bmi _sauty2
-
-_by8:
- LDRB r7,[r0,+r8]
- TEQ r9,r5
- STRNEB r6,[r1,+r8]
- SUBS r8,r8,#1
- BMI _sauty3b
- LDRB r9,[r0,+r8]
- TEQ r7,r5
- STRNEB r6,[r1,+r8]
- SUBS r8,r8,#1
- BMI _sauty3
- LDRB r7,[r0,+r8]
- TEQ r9,r5
- STRNEB r6,[r1,+r8]
- SUBS r8,r8,#1
- BMI _sauty3b
- LDRB r9,[r0,+r8]
- TEQ r7,r5
- STRNEB r6,[r1,+r8]
- SUBS r8,r8,#1
- BMI _sauty3
- LDRB r7,[r0,+r8]
- TEQ r9,r5
- STRNEB r6,[r1,+r8]
- SUBS r8,r8,#1
- BMI _sauty3b
- LDRB r9,[r0,+r8]
- TEQ r7,r5
- STRNEB r6,[r1,+r8]
- SUBS r8,r8,#1
- BMI _sauty3
- LDRB r7,[r0,+r8]
- TEQ r9,r5
- STRNEB r6,[r1,+r8]
- SUBS r8,r8,#1
- BMI _sauty3b
- LDRB r9,[r0,+r8]
- TEQ r7,r5
- STRNEB r6,[r1,+r8]
- SUBS r8,r8,#1
- BMI _sauty3
- LDRB r7,[r0,+r8]
- TEQ r9,r5
- STRNEB r6,[r1,+r8]
- SUBS r8,r8,#1
- BMI _sauty3b
- LDRB r9,[r0,+r8]
- TEQ r7,r5
- STRNEB r6,[r1,+r8]
- SUBS r8,r8,#1
- BMI _sauty3
- LDRB r7,[r0,+r8]
- TEQ r9,r5
- STRNEB r6,[r1,+r8]
- SUBS r8,r8,#1
- BMI _sauty3b
- LDRB r9,[r0,+r8]
- TEQ r7,r5
- STRNEB r6,[r1,+r8]
- SUBS r8,r8,#1
- BMI _sauty3
- LDRB r7,[r0,+r8]
- TEQ r9,r5
- STRNEB r6,[r1,+r8]
- SUBS r8,r8,#1
- BMI _sauty3b
- LDRB r9,[r0,+r8]
- TEQ r7,r5
- STRNEB r6,[r1,+r8]
- SUBS r8,r8,#1
- BMI _sauty3
- LDRB r7,[r0,+r8]
- TEQ r9,r5
- STRNEB r6,[r1,+r8]
- SUBS r8,r8,#1
- BMI _sauty3b
- LDRB r9,[r0,+r8]
- TEQ r7,r5
- STRNEB r6,[r1,+r8]
- SUBS r8,r8,#1
-
- BPL _by8
-
-_sauty3: @ecriture pour r9
- TEQ r9,r5
- STRNEB r6,[r1,+r8]
- SUB r0,r0,r4
- SUB r1,r1,#240
- SUBS r2,r2,#1
- BPL _bx8
-
- ldmfd r13!,{r4-r9}
- add sp,sp,#12
- bx lr
-
-_sauty3b: @ecriture pour r7
- TEQ r7,r5
- STRNEB r6,[r1,+r8]
- SUB r0,r0,r4
- SUB r1,r1,#240
- SUBS r2,r2,#1
- BPL _bx8
-
- ldmfd r13!,{r4-r9}
- add sp,sp,#12
- bx lr
-
-
-@ ******** ASMSaveBitmap(unsigned char *src4, unsigned char *dst, int nbx, int nby, int height2) ********
-
- .ALIGN
- .GLOBAL ASMSaveBitmap
- .TYPE ASMSaveBitmap, function
- .CODE 32
-
-@r0 = src4
-@r1 = dst + 1
-@r2 = nbx
-@r3 = nby
-
-@r7 = height2
-@r8 = tmp
-@r9 = tmpnby
-@r10 = dst4
-
-ASMSaveBitmap:
-
- sub sp,sp,#4
- stmfd r13!,{r7-r10}
- LDR r7,[r13,#20]
-
-_bx6:
- MLA r10,r2,r7,r1
- MOV r9,r3
-
-_by6:
- LDRB r8,[r0,+r9]
- SUBS r9,r9,#1
- STRB r8,[r10,+r9]
- BMI _fincol6
- LDRB r8,[r0,+r9]
- SUBS r9,r9,#1
- STRB r8,[r10,+r9]
- BMI _fincol6
- LDRB r8,[r0,+r9]
- SUBS r9,r9,#1
- STRB r8,[r10,+r9]
- BMI _fincol6
- LDRB r8,[r0,+r9]
- SUBS r9,r9,#1
- STRB r8,[r10,+r9]
- BMI _fincol6
- LDRB r8,[r0,+r9]
- SUBS r9,r9,#1
- STRB r8,[r10,+r9]
- BMI _fincol6
- LDRB r8,[r0,+r9]
- SUBS r9,r9,#1
- STRB r8,[r10,+r9]
- BMI _fincol6
- LDRB r8,[r0,+r9]
- SUBS r9,r9,#1
- STRB r8,[r10,+r9]
- BMI _fincol6
- LDRB r8,[r0,+r9]
- SUBS r9,r9,#1
- STRB r8,[r10,+r9]
- BMI _fincol6
- LDRB r8,[r0,+r9]
- SUBS r9,r9,#1
- STRB r8,[r10,+r9]
- BMI _fincol6
- LDRB r8,[r0,+r9]
- SUBS r9,r9,#1
- STRB r8,[r10,+r9]
- BMI _fincol6
- LDRB r8,[r0,+r9]
- SUBS r9,r9,#1
- STRB r8,[r10,+r9]
- BMI _fincol6
- LDRB r8,[r0,+r9]
- SUBS r9,r9,#1
- STRB r8,[r10,+r9]
- BMI _fincol6
- LDRB r8,[r0,+r9]
- SUBS r9,r9,#1
- STRB r8,[r10,+r9]
- BMI _fincol6
- LDRB r8,[r0,+r9]
- SUBS r9,r9,#1
- STRB r8,[r10,+r9]
- BMI _fincol6
- LDRB r8,[r0,+r9]
- SUBS r9,r9,#1
- STRB r8,[r10,+r9]
- BMI _fincol6
- LDRB r8,[r0,+r9]
- SUBS r9,r9,#1
- STRB r8,[r10,+r9]
-
- BPL _by6
-
-_fincol6:
- SUB r0,r0,#240
- SUBS r2,r2,#1
- BPL _bx6
-
- ldmfd r13!,{r7-r10}
- add sp,sp,#4
- bx lr
-
-
- .ALIGN
- .GLOBAL gp_clearFramebuffer
- .TYPE gp_clearFramebuffer, function
- .CODE 32
-gp_clearFramebuffer:
- @ r0 = framebuffer
- @ r1 = color
- orr r1,r1,r1,lsl #16 @hi halfword = lo halfword
- mov r2,#38400
-clear: str r1,[r0],#4
- subs r2,r2,#1
- bne clear
- bx lr
-
-
-@ ******** ASMFastClear(unsigned char *dst4, int nbx, int nby) ********
-
- .ALIGN
- .GLOBAL ASMFastClear
- .TYPE ASMFastClear, function
- .CODE 32
-
-@r0 = dst4
-@r1 = nbx
-@r2 = nby
-
-@r3 = #0
-@r4 = tmpnby
-
-@optimis?pour h=20
-
-ASMFastClear:
-
- str r4,[sp,#-4]!
- MOV r3,#0
-
-_bx9:
- MOV r4,r2
-
-_by9:
- STRB r3,[r0,+r4]
- SUBS r4,r4,#1
- BMI _sauty4
- STRB r3,[r0,+r4]
- SUBS r4,r4,#1
- BMI _sauty4
- STRB r3,[r0,+r4]
- SUBS r4,r4,#1
- BMI _sauty4
- STRB r3,[r0,+r4]
- SUBS r4,r4,#1
- BMI _sauty4
- STRB r3,[r0,+r4]
- SUBS r4,r4,#1
- BMI _sauty4
- STRB r3,[r0,+r4]
- SUBS r4,r4,#1
- BMI _sauty4
- STRB r3,[r0,+r4]
- SUBS r4,r4,#1
- BMI _sauty4
- STRB r3,[r0,+r4]
- SUBS r4,r4,#1
- BMI _sauty4
- STRB r3,[r0,+r4]
- SUBS r4,r4,#1
- BMI _sauty4
- STRB r3,[r0,+r4]
- SUBS r4,r4,#1
- BMI _sauty4
- STRB r3,[r0,+r4]
- SUBS r4,r4,#1
- BMI _sauty4
- STRB r3,[r0,+r4]
- SUBS r4,r4,#1
- BMI _sauty4
- STRB r3,[r0,+r4]
- SUBS r4,r4,#1
- BMI _sauty4
- STRB r3,[r0,+r4]
- SUBS r4,r4,#1
- BMI _sauty4
- STRB r3,[r0,+r4]
- SUBS r4,r4,#1
- BMI _sauty4
- STRB r3,[r0,+r4]
- SUBS r4,r4,#1
- BMI _sauty4
- STRB r3,[r0,+r4]
- SUBS r4,r4,#1
- BMI _sauty4
- STRB r3,[r0,+r4]
- SUBS r4,r4,#1
- BMI _sauty4
- STRB r3,[r0,+r4]
- SUBS r4,r4,#1
- BMI _sauty4
- STRB r3,[r0,+r4]
- SUBS r4,r4,#1
-
- BPL _by9
-
-_sauty4:
- SUB r0,r0,#240
- SUBS r1,r1,#1
- BPL _bx9
-
- ldr r4,[sp],#4
- bx lr
diff --git a/backends/platform/gp32/gp_clipped.c b/backends/platform/gp32/gp_clipped.c
deleted file mode 100644
index 5bcb9358d3..0000000000
--- a/backends/platform/gp32/gp_clipped.c
+++ /dev/null
@@ -1,101 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- *
- */
-
-//Some global variables and macros
-
-#define screen_width 320
-#define screen_height 240
-
-void gp_FastSolidBlit(void *framebuffer, int dx, const int dy, const int width, const int height, const unsigned char *src, const int trans, const int coul) {
- int xmin, ymin, xmax, ymax;
- int height2 = ( (height + 3) >> 2) << 2;
-
- if(dx < 0) {
- xmin = -dx;
- } else xmin = 0;
- if( (dx++ + width) > screen_width) {
- xmax = screen_width - dx;
- } else xmax = width - 1;
- if(dy < 0) {
- ymax = height + dy - 1;
- } else ymax = height - 1;
- if( (dy + height) > screen_height) {
- ymin = dy + height - screen_height;
- } else ymin = 0;
- if( (xmin > xmax) || (ymin > ymax) ) return;
-
- unsigned char *dst4 = framebuffer + (dx + xmax) * screen_height - height - dy + 1 + ymin;
- src += (xmax * height2 + ymin);
- ASMFastSolidBlit(src, dst4, xmax - xmin, ymax - ymin, height2, trans, coul);
-}
-
-//Copy from framebuffer to dest
-void gp_SaveBitmap(void *framebuffer, int dx, const int dy, const int width, const int height, const unsigned char *dest) { //Sur l'icran
- int xmin, ymin, xmax, ymax;
- int height2 = ( (height + 3) >> 2) << 2;
-
- if(dx < 0) {
- xmin = -dx;
- } else xmin = 0;
- if( (dx++ + width) > screen_width) {
- xmax = screen_width - dx;
- } else xmax = width - 1;
- if(dy < 0) {
- ymax = height + dy - 1;
- } else ymax = height - 1;
- if( (dy + height) > screen_height) {
- ymin = dy + height - screen_height;
- } else ymin = 0;
- if( (xmin > xmax) || (ymin > ymax) ) return;
-
- unsigned char *src4 = framebuffer + (dx + xmax) * screen_height - height - dy + ymin;
- dest += (xmin * height2 + ymin + 1);
- ASMSaveBitmap(src4, dest, xmax - xmin, ymax - ymin, height2);
-}
-
-//Clears area with color #0, should not trigger clicky noise
-
-void gp_FastClear(void *framebuffer, int dx, int dy, int width, int height) {
- int xmin, ymin, xmax, ymax;
-
- if(dx < 0) {
- xmin = -dx;
- } else xmin = 0;
- if( (dx++ + width) > screen_width) {
- xmax = screen_width - dx;
- } else xmax = width - 1;
- if(dy < 0) {
- ymax = height + dy - 1;
- } else ymax = height - 1;
- if( (dy + height) > screen_height) {
- ymin = dy + height - screen_height;
- } else ymin = 0;
- if( (xmin > xmax) || (ymin > ymax) ) return;
-
- int decaly = screen_height - height - dy;
-
- unsigned char *dst4 = framebuffer + (dx + xmax) * screen_height - height - dy + ymin;
- ASMFastClear(dst4, xmax - xmin, ymax - ymin);
-}
diff --git a/backends/platform/gp32/gpmad/readme.txt b/backends/platform/gp32/gpmad/readme.txt
deleted file mode 100644
index edceb8494d..0000000000
--- a/backends/platform/gp32/gpmad/readme.txt
+++ /dev/null
@@ -1 +0,0 @@
-You may put libgpmad.a and the header files in this directory when you build with MAD library. \ No newline at end of file
diff --git a/backends/platform/gp32/gptremor/readme.txt b/backends/platform/gp32/gptremor/readme.txt
deleted file mode 100644
index fa1b02b198..0000000000
--- a/backends/platform/gp32/gptremor/readme.txt
+++ /dev/null
@@ -1 +0,0 @@
-You may put libgptremor.a and the header files in this directory when you build with Tremor library. \ No newline at end of file
diff --git a/backends/platform/gp32/memcpy.S b/backends/platform/gp32/memcpy.S
deleted file mode 100644
index 12853dbfc4..0000000000
--- a/backends/platform/gp32/memcpy.S
+++ /dev/null
@@ -1,498 +0,0 @@
-/* $NetBSD: memcpy.S,v 1.3 1997/11/22 03:27:12 mark Exp $ */
-
-/*-
-* Copyright (c) 1997 The NetBSD Foundation, Inc.
-* All rights reserved.
-*
-* This code is derived from software contributed to The NetBSD Foundation
-* by Neil A. Carson and Mark Brinicombe
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions
-* are met:
-* 1. Redistributions of source code must retain the above copyright
-* notice, this list of conditions and the following disclaimer.
-* 2. Redistributions in binary form must reproduce the above copyright
-* notice, this list of conditions and the following disclaimer in the
-* documentation and/or other materials provided with the distribution.
-* 3. All advertising materials mentioning features or use of this software
-* must display the following acknowledgement:
-* This product includes software developed by the NetBSD
-* Foundation, Inc. and its contributors.
-* 4. Neither the name of The NetBSD Foundation nor the names of its
-* contributors may be used to endorse or promote products derived
-* from this software without specific prior written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
-* ``AS IS\'\' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
-* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
-* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-* POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/* This was modified by Jay Monkman <jmonkman@smoothsmoothie.com> to
-* save and restore r12. This is necessary for RTEMS.
-*/
-/* #include <machine/asm.h>*/
-
-#define ENTRY(_LABEL) \
- .global _LABEL; _LABEL:
-/*
-.globl memcpy
-memcpy:
-*/
-ENTRY(memcpy)
-stmfd sp!, {r0, r12, lr}
-bl _memcpy
-ldmfd sp!, {r0, r12, pc}
-
-
-/*
-.globl memove
-memmove:
-*/
-ENTRY(memmove)
-stmfd sp!, {r0, r12, lr}
-bl _memcpy
-ldmfd sp!, {r0, r12, pc}
-
-
-
-/*
-* This is one fun bit of code ...
-* Some easy listening music is suggested while trying to understand this
-* code e.g. Iron Maiden
-*
-* For anyone attempting to understand it :
-*
-* The core code is implemented here with simple stubs for memcpy()
-* memmove() and bcopy().
-*
-* All local labels are prefixed with Lmemcpy_
-* Following the prefix a label starting f is used in the forward copy code
-* while a label using b is used in the backwards copy code
-* The source and destination addresses determine whether a forward or
-* backward copy is performed.
-* Separate bits of code are used to deal with the following situations
-* for both the forward and backwards copy.
-* unaligned source address
-* unaligned destination address
-* Separate copy routines are used to produce an optimised result for each
-* of these cases.
-* The copy code will use LDM/STM instructions to copy up to 32 bytes at
-* a time where possible.
-*
-* Note: r12 (aka ip) can be trashed during the function along with
-* r0-r3 although r0-r2 have defined uses i.e. src, dest, len through out.
-* Additional registers are preserved prior to use i.e. r4, r5 & lr
-*
-* Apologies for the state of the comments;-)
-*/
-
-
-/*
-_memcpy:
-*/
-ENTRY(_memcpy)
-/* Determine copy direction */
-cmp r1, r0
-bcc Lmemcpy_backwards
-
-moveq r0, #0 /* Quick abort for len=0 */
-moveq pc, lr
-
-stmdb sp!, {r0, lr} /* memcpy() returns dest addr */
-subs r2, r2, #4
-blt Lmemcpy_fl4 /* less than 4 bytes */
-ands r12, r0, #3
-bne Lmemcpy_fdestul /* oh unaligned destination addr */
-ands r12, r1, #3
-bne Lmemcpy_fsrcul /* oh unaligned source addr */
-
-Lmemcpy_ft8:
-/* We have aligned source and destination */
-subs r2, r2, #8
-blt Lmemcpy_fl12 /* less than 12 bytes (4 from above) */
-subs r2, r2, #0x14
-blt Lmemcpy_fl32 /* less than 32 bytes (12 from above) */
-stmdb sp!, {r4} /* borrow r4 */
-
-/* blat 32 bytes at a time */
-/* XXX for really big copies perhaps we should use more registers */
-Lmemcpy_floop32:
-ldmia r1!, {r3, r4, r12, lr}
-stmia r0!, {r3, r4, r12, lr}
-ldmia r1!, {r3, r4, r12, lr}
-stmia r0!, {r3, r4, r12, lr}
-subs r2, r2, #0x20
-bge Lmemcpy_floop32
-
-cmn r2, #0x10
-ldmgeia r1!, {r3, r4, r12, lr} /* blat a remaining 16 bytes */
-stmgeia r0!, {r3, r4, r12, lr}
-subge r2, r2, #0x10
-ldmia sp!, {r4} /* return r4 */
-
-Lmemcpy_fl32:
-adds r2, r2, #0x14
-
-/* blat 12 bytes at a time */
-Lmemcpy_floop12:
-ldmgeia r1!, {r3, r12, lr}
-stmgeia r0!, {r3, r12, lr}
-subges r2, r2, #0x0c
-bge Lmemcpy_floop12
-
-Lmemcpy_fl12:
-adds r2, r2, #8
-blt Lmemcpy_fl4
-
-subs r2, r2, #4
-ldrlt r3, [r1], #4
-strlt r3, [r0], #4
-ldmgeia r1!, {r3, r12}
-stmgeia r0!, {r3, r12}
-subge r2, r2, #4
-
-Lmemcpy_fl4:
-/* less than 4 bytes to go */
-adds r2, r2, #4
-ldmeqia sp!, {r0, pc} /* done */
-
-/* copy the crud byte at a time */
-cmp r2, #2
-ldrb r3, [r1], #1
-strb r3, [r0], #1
-ldrgeb r3, [r1], #1
-strgeb r3, [r0], #1
-ldrgtb r3, [r1], #1
-strgtb r3, [r0], #1
-ldmia sp!, {r0, pc}
-
-/* erg - unaligned destination */
-Lmemcpy_fdestul:
-rsb r12, r12, #4
-cmp r12, #2
-
-/* align destination with byte copies */
-ldrb r3, [r1], #1
-strb r3, [r0], #1
-ldrgeb r3, [r1], #1
-strgeb r3, [r0], #1
-ldrgtb r3, [r1], #1
-strgtb r3, [r0], #1
-subs r2, r2, r12
-blt Lmemcpy_fl4 /* less the 4 bytes */
-
-ands r12, r1, #3
-beq Lmemcpy_ft8 /* we have an aligned source */
-
-/* erg - unaligned source */
-/* This is where it gets nasty ... */
-Lmemcpy_fsrcul:
-bic r1, r1, #3
-ldr lr, [r1], #4
-cmp r12, #2
-bgt Lmemcpy_fsrcul3
-beq Lmemcpy_fsrcul2
-cmp r2, #0x0c
-blt Lmemcpy_fsrcul1loop4
-sub r2, r2, #0x0c
-stmdb sp!, {r4, r5}
-
-Lmemcpy_fsrcul1loop16:
-mov r3, lr, lsr #8
-ldmia r1!, {r4, r5, r12, lr}
-orr r3, r3, r4, lsl #24
-mov r4, r4, lsr #8
-orr r4, r4, r5, lsl #24
-mov r5, r5, lsr #8
-orr r5, r5, r12, lsl #24
-mov r12, r12, lsr #8
-orr r12, r12, lr, lsl #24
-stmia r0!, {r3-r5, r12}
-subs r2, r2, #0x10
-bge Lmemcpy_fsrcul1loop16
-ldmia sp!, {r4, r5}
-adds r2, r2, #0x0c
-blt Lmemcpy_fsrcul1l4
-
-Lmemcpy_fsrcul1loop4:
-mov r12, lr, lsr #8
-ldr lr, [r1], #4
-orr r12, r12, lr, lsl #24
-str r12, [r0], #4
-subs r2, r2, #4
-bge Lmemcpy_fsrcul1loop4
-
-Lmemcpy_fsrcul1l4:
-sub r1, r1, #3
-b Lmemcpy_fl4
-
-Lmemcpy_fsrcul2:
-cmp r2, #0x0c
-blt Lmemcpy_fsrcul2loop4
-sub r2, r2, #0x0c
-stmdb sp!, {r4, r5}
-
-Lmemcpy_fsrcul2loop16:
-mov r3, lr, lsr #16
-ldmia r1!, {r4, r5, r12, lr}
-orr r3, r3, r4, lsl #16
-mov r4, r4, lsr #16
-orr r4, r4, r5, lsl #16
-mov r5, r5, lsr #16
-orr r5, r5, r12, lsl #16
-mov r12, r12, lsr #16
-orr r12, r12, lr, lsl #16
-stmia r0!, {r3-r5, r12}
-subs r2, r2, #0x10
-bge Lmemcpy_fsrcul2loop16
-ldmia sp!, {r4, r5}
-adds r2, r2, #0x0c
-blt Lmemcpy_fsrcul2l4
-
-Lmemcpy_fsrcul2loop4:
-mov r12, lr, lsr #16
-ldr lr, [r1], #4
-orr r12, r12, lr, lsl #16
-str r12, [r0], #4
-subs r2, r2, #4
-bge Lmemcpy_fsrcul2loop4
-
-Lmemcpy_fsrcul2l4:
-sub r1, r1, #2
-b Lmemcpy_fl4
-
-Lmemcpy_fsrcul3:
-cmp r2, #0x0c
-blt Lmemcpy_fsrcul3loop4
-sub r2, r2, #0x0c
-stmdb sp!, {r4, r5}
-
-Lmemcpy_fsrcul3loop16:
-mov r3, lr, lsr #24
-ldmia r1!, {r4, r5, r12, lr}
-orr r3, r3, r4, lsl #8
-mov r4, r4, lsr #24
-orr r4, r4, r5, lsl #8
-mov r5, r5, lsr #24
-orr r5, r5, r12, lsl #8
-mov r12, r12, lsr #24
-orr r12, r12, lr, lsl #8
-stmia r0!, {r3-r5, r12}
-subs r2, r2, #0x10
-bge Lmemcpy_fsrcul3loop16
-ldmia sp!, {r4, r5}
-adds r2, r2, #0x0c
-blt Lmemcpy_fsrcul3l4
-
-Lmemcpy_fsrcul3loop4:
-mov r12, lr, lsr #24
-ldr lr, [r1], #4
-orr r12, r12, lr, lsl #8
-str r12, [r0], #4
-subs r2, r2, #4
-bge Lmemcpy_fsrcul3loop4
-
-Lmemcpy_fsrcul3l4:
-sub r1, r1, #1
-b Lmemcpy_fl4
-
-Lmemcpy_backwards:
-add r1, r1, r2
-add r0, r0, r2
-subs r2, r2, #4
-blt Lmemcpy_bl4 /* less than 4 bytes */
-ands r12, r0, #3
-bne Lmemcpy_bdestul /* oh unaligned destination addr */
-ands r12, r1, #3
-bne Lmemcpy_bsrcul /* oh unaligned source addr */
-
-Lmemcpy_bt8:
-/* We have aligned source and destination */
-subs r2, r2, #8
-blt Lmemcpy_bl12 /* less than 12 bytes (4 from above) */
-stmdb sp!, {r4, lr}
-subs r2, r2, #0x14 /* less than 32 bytes (12 from above) */
-blt Lmemcpy_bl32
-
-/* blat 32 bytes at a time */
-/* XXX for really big copies perhaps we should use more registers */
-Lmemcpy_bloop32:
-ldmdb r1!, {r3, r4, r12, lr}
-stmdb r0!, {r3, r4, r12, lr}
-ldmdb r1!, {r3, r4, r12, lr}
-stmdb r0!, {r3, r4, r12, lr}
-subs r2, r2, #0x20
-bge Lmemcpy_bloop32
-
-Lmemcpy_bl32:
-cmn r2, #0x10
-ldmgedb r1!, {r3, r4, r12, lr} /* blat a remaining 16 bytes */
-stmgedb r0!, {r3, r4, r12, lr}
-subge r2, r2, #0x10
-adds r2, r2, #0x14
-ldmgedb r1!, {r3, r12, lr} /* blat a remaining 12 bytes */
-stmgedb r0!, {r3, r12, lr}
-subge r2, r2, #0x0c
-ldmia sp!, {r4, lr}
-
-Lmemcpy_bl12:
-adds r2, r2, #8
-blt Lmemcpy_bl4
-subs r2, r2, #4
-ldrlt r3, [r1, #-4]!
-strlt r3, [r0, #-4]!
-ldmgedb r1!, {r3, r12}
-stmgedb r0!, {r3, r12}
-subge r2, r2, #4
-
-Lmemcpy_bl4:
-/* less than 4 bytes to go */
-adds r2, r2, #4
-moveq pc, lr /* done */
-
-/* copy the crud byte at a time */
-cmp r2, #2
-ldrb r3, [r1, #-1]!
-strb r3, [r0, #-1]!
-ldrgeb r3, [r1, #-1]!
-strgeb r3, [r0, #-1]!
-ldrgtb r3, [r1, #-1]!
-strgtb r3, [r0, #-1]!
-mov pc, lr
-
-/* erg - unaligned destination */
-Lmemcpy_bdestul:
-cmp r12, #2
-
-/* align destination with byte copies */
-ldrb r3, [r1, #-1]!
-strb r3, [r0, #-1]!
-ldrgeb r3, [r1, #-1]!
-strgeb r3, [r0, #-1]!
-ldrgtb r3, [r1, #-1]!
-strgtb r3, [r0, #-1]!
-subs r2, r2, r12
-blt Lmemcpy_bl4 /* less than 4 bytes to go */
-ands r12, r1, #3
-beq Lmemcpy_bt8 /* we have an aligned source */
-
-/* erg - unaligned source */
-/* This is where it gets nasty ... */
-Lmemcpy_bsrcul:
-bic r1, r1, #3
-ldr r3, [r1, #0]
-cmp r12, #2
-blt Lmemcpy_bsrcul1
-beq Lmemcpy_bsrcul2
-cmp r2, #0x0c
-blt Lmemcpy_bsrcul3loop4
-sub r2, r2, #0x0c
-stmdb sp!, {r4, r5, lr}
-
-Lmemcpy_bsrcul3loop16:
-mov lr, r3, lsl #8
-ldmdb r1!, {r3-r5, r12}
-orr lr, lr, r12, lsr #24
-mov r12, r12, lsl #8
-orr r12, r12, r5, lsr #24
-mov r5, r5, lsl #8
-orr r5, r5, r4, lsr #24
-mov r4, r4, lsl #8
-orr r4, r4, r3, lsr #24
-stmdb r0!, {r4, r5, r12, lr}
-subs r2, r2, #0x10
-bge Lmemcpy_bsrcul3loop16
-ldmia sp!, {r4, r5, lr}
-adds r2, r2, #0x0c
-blt Lmemcpy_bsrcul3l4
-
-Lmemcpy_bsrcul3loop4:
-mov r12, r3, lsl #8
-ldr r3, [r1, #-4]!
-orr r12, r12, r3, lsr #24
-str r12, [r0, #-4]!
-subs r2, r2, #4
-bge Lmemcpy_bsrcul3loop4
-
-Lmemcpy_bsrcul3l4:
-add r1, r1, #3
-b Lmemcpy_bl4
-
-Lmemcpy_bsrcul2:
-cmp r2, #0x0c
-blt Lmemcpy_bsrcul2loop4
-sub r2, r2, #0x0c
-stmdb sp!, {r4, r5, lr}
-
-Lmemcpy_bsrcul2loop16:
-mov lr, r3, lsl #16
-ldmdb r1!, {r3-r5, r12}
-orr lr, lr, r12, lsr #16
-mov r12, r12, lsl #16
-orr r12, r12, r5, lsr #16
-mov r5, r5, lsl #16
-orr r5, r5, r4, lsr #16
-mov r4, r4, lsl #16
-orr r4, r4, r3, lsr #16
-stmdb r0!, {r4, r5, r12, lr}
-subs r2, r2, #0x10
-bge Lmemcpy_bsrcul2loop16
-ldmia sp!, {r4, r5, lr}
-adds r2, r2, #0x0c
-blt Lmemcpy_bsrcul2l4
-
-Lmemcpy_bsrcul2loop4:
-mov r12, r3, lsl #16
-ldr r3, [r1, #-4]!
-orr r12, r12, r3, lsr #16
-str r12, [r0, #-4]!
-subs r2, r2, #4
-bge Lmemcpy_bsrcul2loop4
-
-Lmemcpy_bsrcul2l4:
-add r1, r1, #2
-b Lmemcpy_bl4
-
-Lmemcpy_bsrcul1:
-cmp r2, #0x0c
-blt Lmemcpy_bsrcul1loop4
-sub r2, r2, #0x0c
-stmdb sp!, {r4, r5, lr}
-
-Lmemcpy_bsrcul1loop32:
-mov lr, r3, lsl #24
-ldmdb r1!, {r3-r5, r12}
-orr lr, lr, r12, lsr #8
-mov r12, r12, lsl #24
-orr r12, r12, r5, lsr #8
-mov r5, r5, lsl #24
-orr r5, r5, r4, lsr #8
-mov r4, r4, lsl #24
-orr r4, r4, r3, lsr #8
-stmdb r0!, {r4, r5, r12, lr}
-subs r2, r2, #0x10
-bge Lmemcpy_bsrcul1loop32
-ldmia sp!, {r4, r5, lr}
-adds r2, r2, #0x0c
-blt Lmemcpy_bsrcul1l4
-
-Lmemcpy_bsrcul1loop4:
-mov r12, r3, lsl #24
-ldr r3, [r1, #-4]!
-orr r12, r12, r3, lsr #8
-str r12, [r0, #-4]!
-subs r2, r2, #4
-bge Lmemcpy_bsrcul1loop4
-
-Lmemcpy_bsrcul1l4:
-add r1, r1, #1
-b Lmemcpy_bl4
diff --git a/backends/platform/gp32/minilzo/readme.txt b/backends/platform/gp32/minilzo/readme.txt
deleted file mode 100644
index 5cf1a9b360..0000000000
--- a/backends/platform/gp32/minilzo/readme.txt
+++ /dev/null
@@ -1 +0,0 @@
-You may put libminlzo.a and the header files in this directory when you build with MINILZO library. \ No newline at end of file
diff --git a/backends/platform/gp32/portdefs.h b/backends/platform/gp32/portdefs.h
deleted file mode 100644
index dd0d70a25a..0000000000
--- a/backends/platform/gp32/portdefs.h
+++ /dev/null
@@ -1,117 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- *
- */
-
-#ifndef PORTDEFS_H
-#define PORTDEFS_H
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdarg.h>
-#include <math.h>
-#include <time.h>
-#include <cctype>
-
-#include "gp32std.h"
-#include "gp32std_file.h"
-#include "gp32std_memory.h"
-
-#undef byte
-
-#undef malloc
-#undef calloc
-#undef free
-
-#undef stderr
-#undef stdout
-#undef stdin
-
-#undef fopen
-#undef fread
-#undef fwrite
-#undef fclose
-#undef ftell
-#undef rewind
-#undef fseek
-
-#undef ferror
-#undef clearerr
-
-#undef feof
-#undef getc
-
-#define FILE GPFILE
-
-#define stderr gp_stderr
-#define stdout gp_stdout
-#define stdin gp_stdin
-
-#define fopen gp_fopen
-#define fread gp_fread
-#define fwrite gp_fwrite
-#define fclose gp_fclose
-#define fseek gp_fseek
-#define ftell gp_ftell
-#define ferror gp_ferror
-#define clearerr gp_clearerr
-
-#define feof gp_feof
-#define fgets gp_fgets
-#define fgetc gp_fgetc
-#define getc gp_fgetc
-
-#define fprintf gp_fprintf
-#define fflush gp_fflush
-
-#define printf gp_printf
-
-#define exit gp_exit
-
-#define strcpy gp_strcpy
-#define strncpy gp_strncpy
-#define strcat gp_strcat
-#define strdup gp_strdup
-#define sprintf gp_sprintf
-#define strcasecmp gp_strcasecmp
-#define strncasecmp gp_strncasecmp
-
-#define memcpy gp_memcpy
-#define memset gp_memset
-#define malloc gp_malloc
-#define calloc gp_calloc //gm_calloc
-#define free gp_free
-
-#define FUNCTION GPDEBUG("FUNC: %s", __FUNCTION__);
-
-#define DELAY gp_delay(500);
-
-#define MARK printf("MARK: %s, %s, %d", __FILE__, __FUNCTION__, __LINE__);
-
-#define assert(e) ((e) ? 0 : (printf("!AS: " #e " (%s, %d)\n", __FILE__, __LINE__)))
-#define ASSERT assert
-
-#define ENDLESSLOOP while (1)
-
-#endif /* PORTDEFS_H */
diff --git a/backends/platform/gp32/scummvm.bmp b/backends/platform/gp32/scummvm.bmp
deleted file mode 100644
index 4f9dce2eb7..0000000000
--- a/backends/platform/gp32/scummvm.bmp
+++ /dev/null
Binary files differ
diff --git a/backends/platform/gp32/startup.c b/backends/platform/gp32/startup.c
deleted file mode 100644
index ad1022ca3c..0000000000
--- a/backends/platform/gp32/startup.c
+++ /dev/null
@@ -1,122 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- *
- */
-
-#include <gpdef.h>
-#include <gpstdlib.h>
-#include <gpfont.h>
-#include <gpfont_port.h>
-#include <gpfontres.dat>
-
-#include <initval_port.h>
-
-#ifdef USE_GP_MEM
- #include <gpmem.h>
-#endif
-
-unsigned int HEAPSTART;
-unsigned int HEAPEND;
-
-void InitializeFont (void);
-extern void GpKeyPollingTimeSet (int loop_cnt);
-extern void GpMain(void *arg);
-
-int main (int arg_len, char * arg_v)
- {
- GM_HEAP_DEF gm_heap_def;
-
- _gp_sdk_init();
-
- // keyboard polling count setting
- GpKeyPollingTimeSet (KEYPOLLING_NUM);
-
- #ifdef USE_GP_MEM
- gm_heap_def.heapstart = (void*)(HEAPSTART);
- gm_heap_def.heapend = (void *)(HEAPEND & ~3);
- gm_heap_init (&gm_heap_def);
-
- gp_mem_func.malloc = gm_malloc;
- gp_mem_func.zimalloc = gm_zi_malloc;
- gp_mem_func.calloc = gm_calloc;
- gp_mem_func.free = gm_free;
- gp_mem_func.availablemem = gm_availablesize;
- gp_mem_func.malloc_ex = gm_malloc_ex;
- gp_mem_func.free_ex = gm_free_ex;
- gp_mem_func.make_mem_partition = gm_make_mem_part;
-
- gp_str_func.memset = gm_memset;
- gp_str_func.memcpy = gm_memcpy;
- gp_str_func.strcpy = gm_strcpy;
- gp_str_func.strncpy = gm_strncpy;
- gp_str_func.strcat = gm_strcat;
- gp_str_func.strncat = gm_strncat;
- gp_str_func.gpstrlen = gm_lstrlen;
- gp_str_func.sprintf = gm_sprintf;
- gp_str_func.uppercase = gm_uppercase;
- gp_str_func.lowercase = gm_lowercase;
- gp_str_func.compare = gm_compare;
- gp_str_func.trim_right = gm_trim_right;
- #endif /*USE_GP_MEM*/
-
- //Font initialize
- InitializeFont ();
-
- GpKernelInitialize ();
-
- GpKernelStart ();
-
- GpAppExit ();
- while (1) {}
- }
-
-void InitializeFont (void)
- {
- BGFONTINFO mInfo;
- mInfo.kor_w = KORFONT_W;
- mInfo.kor_h = KORFONT_H;
- mInfo.eng_w = ENGFONT_W;
- mInfo.eng_h = ENGFONT_H;
- mInfo.chargap = FONT_CHARGAP;
- mInfo.linegap = FONT_LINEGAP;
- GpFontInit (&mInfo);
- GpFontResSet ((unsigned char*)fontresKor, (unsigned char*)fontresEng);
- }
-
-int GpPredefinedStackGet (H_THREAD th)
- {
- switch (th)
- {
- case H_THREAD_GPMAIN:
- return GPMAIN_STACK_SIZE;
- case H_THREAD_NET:
- return NET_STACK_SIZE;
- case H_THREAD_TMR0:
- case H_THREAD_TMR1:
- case H_THREAD_TMR2:
- case H_THREAD_TMR3:
- return USER_STACK_SIZE;
- default:
- return 0;
- }
- }
diff --git a/backends/platform/sdl/events.cpp b/backends/platform/sdl/events.cpp
index 9a0a33f45c..a4a72ca380 100644
--- a/backends/platform/sdl/events.cpp
+++ b/backends/platform/sdl/events.cpp
@@ -148,7 +148,7 @@ void OSystem_SDL::handleKbdMouse() {
_km.y_down_count = 1;
}
- SDL_WarpMouse(_km.x, _km.y);
+ SDL_WarpMouse((Uint16)_km.x, (Uint16)_km.y);
}
}
}
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index 866f5299a0..be3aaad926 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -403,10 +403,10 @@ bool OSystem_SDL::setSoundCallback(SoundProc proc, void *param) {
_samplesPerSec = SAMPLES_PER_SEC;
// Determine the sample buffer size. We want it to store enough data for
- // about 1/10th of a second. Note that it must be a power of two.
+ // about 1/32th of a second. Note that it must be a power of two.
// So e.g. at 22050 Hz, we request a sample buffer size of 2048.
- int samples = 0x8000;
- while (10 * samples >= _samplesPerSec) {
+ int samples = 8192;
+ while (16 * samples >= _samplesPerSec) {
samples >>= 1;
}
diff --git a/backends/platform/symbian/src/SymbianOS.cpp b/backends/platform/symbian/src/SymbianOS.cpp
index 3e34025eab..d3e92731db 100644
--- a/backends/platform/symbian/src/SymbianOS.cpp
+++ b/backends/platform/symbian/src/SymbianOS.cpp
@@ -142,7 +142,7 @@ void OSystem_SDL_Symbian::initBackend() {
}
OSystem_SDL_Symbian::~OSystem_SDL_Symbian() {
- delete []_stereo_mix_buffer;
+ delete[] _stereo_mix_buffer;
}
int OSystem_SDL_Symbian::getDefaultGraphicsMode() const {
diff --git a/backends/platform/wii/Makefile b/backends/platform/wii/Makefile
new file mode 100644
index 0000000000..a52ceb1774
--- /dev/null
+++ b/backends/platform/wii/Makefile
@@ -0,0 +1,156 @@
+DEBUG_WII = 1
+
+ENABLE_SCUMM = 1
+ENABLE_SCUMM_7_8 = 1
+ENABLE_HE = 1
+# ENABLE_AGI = 1
+ENABLE_AGOS = 1
+ENABLE_CINE = 1
+ENABLE_CRUISE = 1
+ENABLE_DRASCULA = 1
+ENABLE_GOB = 1
+ENABLE_IGOR = 1
+ENABLE_KYRA = 1
+ENABLE_LURE = 1
+ENABLE_M4 = 1
+ENABLE_MADE = 1
+ENABLE_PARALLACTION = 1
+ENABLE_QUEEN = 1
+ENABLE_SAGA = 1
+ENABLE_SKY = 1
+ENABLE_SWORD1 = 1
+ENABLE_SWORD2 = 1
+ENABLE_TOUCHE = 1
+
+DISABLE_HQ_SCALERS = 1
+DISABLE_SCALERS = 1
+
+USE_ZLIB = 1
+USE_MAD = 1
+USE_TREMOR = 1
+USE_FLAC = 1
+USE_MPEG2 = 1
+USE_MT32EMU = 1
+
+srcdir = ../../..
+VPATH = $(srcdir)
+HAVE_GCC3 = 1
+
+DISTPATH = $(srcdir)/dists/wii
+
+ifeq ($(strip $(DEVKITPPC)),)
+$(error "Please set DEVKITPPC in your environment. export DEVKITPPC=<path to>devkitPPC")
+endif
+
+PREFIX = $(DEVKITPPC)/bin/powerpc-gekko-
+CXX = $(PREFIX)g++
+AS = $(PREFIX)gcc
+LD = $(PREFIX)gcc
+AR = $(PREFIX)ar cru
+RANLIB = $(PREFIX)ranlib
+STRIP = $(PREFIX)strip -g
+OBJCOPY = $(PREFIX)objcopy
+MKDIR = mkdir -p
+RM = rm -f
+CP = cp -f
+
+TARGET = scummvm-wii
+
+MACHDEP = -DGEKKO -mrvl -mcpu=750 -meabi -mhard-float \
+ -ffunction-sections -fdata-sections -fmodulo-sched
+
+INCDIR = $(srcdir) . $(srcdir)/engines/ $(DEVKITPRO)/libogc/include
+LIBDIR = $(DEVKITPRO)/libogc/lib/wii
+
+CXXFLAGS = -g -Os -Wall $(MACHDEP) -D__WII__ -Wno-multichar -Wno-long-long \
+ -Wno-unknown-pragmas -Wno-reorder -fno-exceptions -fno-rtti
+
+CXXFLAGS += $(addprefix -I,$(INCDIR))
+LDFLAGS = -g $(MACHDEP) -Wl,-Map,$(TARGET).elf.map
+LDFLAGS += $(addprefix -L,$(LIBDIR))
+LIBS = -lstdc++ -lfat -lwiiuse -lbte -logc -lm
+
+CXXFLAGS += -I$(DEVKITPRO)/3rd/wii/include
+LDFLAGS += -L$(DEVKITPRO)/3rd/wii/lib
+
+ifdef DEBUG_WII
+CXXFLAGS += -DDEBUG_WII
+LIBS += -ldb
+endif
+
+ifdef USE_ZLIB
+CXXFLAGS += -DUSE_ZLIB
+LIBS += -lz
+endif
+
+ifdef USE_MAD
+CXXFLAGS += -DUSE_MAD -I$(DEVKITPRO)/libogc/include/mad
+LIBS += -lmad
+endif
+
+ifdef USE_TREMOR
+CXXFLAGS += -DUSE_VORBIS -DUSE_TREMOR
+LIBS += -lvorbisidec
+endif
+
+ifdef USE_FLAC
+CXXFLAGS += -DUSE_FLAC
+LIBS += -lFLAC
+endif
+
+ifdef USE_MPEG2
+CXXFLAGS += -DUSE_MPEG2
+LIBS += -lmpeg2
+endif
+
+ifdef USE_MT32EMU
+CXXFLAGS += -DUSE_MT32EMU
+endif
+
+OBJS := backends/platform/wii/main.o \
+ backends/platform/wii/gecko_console.o \
+ backends/platform/wii/gx_supp.o \
+ backends/platform/wii/osystem.o \
+ backends/platform/wii/osystem_gfx.o \
+ backends/platform/wii/osystem_sfx.o \
+ backends/platform/wii/osystem_events.o
+
+include $(srcdir)/Makefile.common
+
+.PHONY: clean-wii distclean-wii upload dist
+
+all: $(TARGET).dol
+
+$(TARGET).dol: $(TARGET).elf
+ $(OBJCOPY) -O binary $< $@
+
+$(TARGET).elf: $(OBJS)
+ $(LD) $^ $(LDFLAGS) $(LIBS) -o $@
+
+clean: clean-wii
+
+clean-wii:
+ @-$(RM) $(TARGET).elf $(TARGET).elf.map $(TARGET).dol
+
+distclean: distclean-wii
+
+distclean-wii:
+ @-$(RM) dist
+
+upload:
+ $(DEVKITPPC)/bin/wiiload $(TARGET).dol
+
+dist:
+ $(MKDIR) dist/apps/scummvm
+ $(CP) $(TARGET).dol dist/apps/scummvm/boot.dol
+ $(CP) $(DISTPATH)/meta.xml dist/apps/scummvm/
+ $(CP) $(DISTPATH)/icon.png dist/apps/scummvm/
+ $(CP) $(DISTPATH)/READMII dist/apps/scummvm/
+ $(CP) $(srcdir)/AUTHORS dist/apps/scummvm/
+ $(CP) $(srcdir)/COPYING dist/apps/scummvm/
+ $(CP) $(srcdir)/COPYRIGHT dist/apps/scummvm/
+ $(CP) $(srcdir)/NEWS dist/apps/scummvm/
+ $(CP) $(srcdir)/README dist/apps/scummvm/
+ $(CP) $(DIST_FILES_THEMES) dist/apps/scummvm/
+ $(CP) $(DIST_FILES_ENGINEDATA) dist/apps/scummvm/
+
diff --git a/backends/platform/wii/gecko_console.cpp b/backends/platform/wii/gecko_console.cpp
new file mode 100644
index 0000000000..c419f6e7e5
--- /dev/null
+++ b/backends/platform/wii/gecko_console.cpp
@@ -0,0 +1,91 @@
+/*-------------------------------------------------------------
+
+Copyright (C) 2008
+Hector Martin (marcan)
+
+This software is provided 'as-is', without any express or implied
+warranty. In no event will the authors be held liable for any
+damages arising from the use of this software.
+
+Permission is granted to anyone to use this software for any
+purpose, including commercial applications, and to alter it and
+redistribute it freely, subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you
+must not claim that you wrote the original software. If you use
+this software in a product, an acknowledgment in the product
+documentation would be appreciated but is not required.
+
+2. Altered source versions must be plainly marked as such, and
+must not be misrepresented as being the original software.
+
+3. This notice may not be removed or altered from any source
+distribution.
+
+-------------------------------------------------------------*/
+
+#include <stdio.h>
+#include <sys/iosupport.h>
+#include <ogcsys.h>
+#include <gccore.h>
+#include <reent.h>
+
+#include "gecko_console.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+static const devoptab_t *dotab_console;
+int usb_sendbuffer_safe(s32 chn,const void *buffer,int size);
+int usb_sendbuffer(s32 chn,const void *buffer,int size);
+
+int __gecko_write(struct _reent *r,int fd,const char *ptr,int len) {
+ char *tmp = (char*)ptr;
+ u32 level;
+ if(dotab_console)
+ dotab_console->write_r(r,fd,ptr,len);
+
+ if(!tmp || len<=0)
+ return -1;
+ level = IRQ_Disable();
+ usb_sendbuffer(1, ptr, len);
+ IRQ_Restore(level);
+ return len;
+}
+
+const devoptab_t dotab_gecko = {
+ "stdout", // device name
+ 0, // size of file structure
+ NULL, // device open
+ NULL, // device close
+ __gecko_write, // device write
+ NULL, // device read
+ NULL, // device seek
+ NULL, // device fstat
+ NULL, // device stat
+ NULL, // device link
+ NULL, // device unlink
+ NULL, // device chdir
+ NULL, // device rename
+ NULL, // device mkdir
+ 0, // dirStateSize
+ NULL, // device diropen_r
+ NULL, // device dirreset_r
+ NULL, // device dirnext_r
+ NULL, // device dirclose_r
+ NULL // device statvfs_r
+};
+
+void gecko_console_init(int chain) {
+ dotab_console = NULL;
+ if(chain)
+ dotab_console = devoptab_list[STD_OUT];
+ devoptab_list[STD_OUT] = &dotab_gecko;
+ devoptab_list[STD_ERR] = &dotab_gecko;
+}
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/backends/platform/wii/gecko_console.h b/backends/platform/wii/gecko_console.h
new file mode 100644
index 0000000000..ba7c393add
--- /dev/null
+++ b/backends/platform/wii/gecko_console.h
@@ -0,0 +1,14 @@
+#ifndef _WII_GECKO_CONSOLE_H_
+#define _WII_GECKO_CONSOLE_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void gecko_console_init(int chain);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/backends/platform/wii/gx_supp.cpp b/backends/platform/wii/gx_supp.cpp
new file mode 100644
index 0000000000..4c7b8ed58a
--- /dev/null
+++ b/backends/platform/wii/gx_supp.cpp
@@ -0,0 +1,264 @@
+/****************************************************************************
+* Generic GX Support for Emulators
+* softdev 2007
+*
+* 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.,
+* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*
+* NGC GX Video Functions
+*
+* These are pretty standard functions to setup and use GX scaling.
+****************************************************************************/
+
+#include <gccore.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <malloc.h>
+
+#define DEFAULT_FIFO_SIZE (256 * 1024)
+
+#define HASPECT 320
+#define VASPECT 240
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*** 2D ***/
+static u32 whichfb;
+static u32 *xfb[2];
+static GXRModeObj *vmode;
+
+/*** 3D GX ***/
+static u8 *gp_fifo;
+
+/*** Texture memory ***/
+static u8 *texturemem;
+static u32 texturesize;
+
+GXTexObj texobj;
+static Mtx view;
+static u16 vwidth, vheight, oldvwidth, oldvheight;
+
+/* New texture based scaler */
+typedef struct tagcamera {
+ Vector pos;
+ Vector up;
+ Vector view;
+} camera;
+
+static s16 square[] ATTRIBUTE_ALIGN(32) = {
+ -HASPECT, VASPECT, 0,
+ HASPECT, VASPECT, 0,
+ HASPECT, -VASPECT, 0,
+ -HASPECT, -VASPECT, 0,
+};
+
+static camera cam = {
+ { 0.0f, 0.0f, 370.0f },
+ { 0.0f, 0.5f, 0.0f },
+ { 0.0f, 0.0f, -0.5f }
+};
+
+void GX_InitVideo() {
+ vmode = VIDEO_GetPreferredMode(NULL);
+ VIDEO_Configure(vmode);
+
+ xfb[0] = (u32 *) MEM_K0_TO_K1 (SYS_AllocateFramebuffer(vmode));
+ xfb[1] = (u32 *) MEM_K0_TO_K1 (SYS_AllocateFramebuffer(vmode));
+ gp_fifo = (u8 *) memalign(32, DEFAULT_FIFO_SIZE);
+
+ VIDEO_ClearFrameBuffer(vmode, xfb[0], COLOR_BLACK);
+ VIDEO_ClearFrameBuffer(vmode, xfb[1], COLOR_BLACK);
+
+ whichfb = 0;
+ VIDEO_SetNextFramebuffer(xfb[whichfb]);
+ VIDEO_SetBlack(FALSE);
+ VIDEO_Flush();
+ VIDEO_WaitVSync();
+
+ if (vmode->viTVMode & VI_NON_INTERLACE)
+ VIDEO_WaitVSync();
+}
+
+/****************************************************************************
+ * Scaler Support Functions
+ ****************************************************************************/
+static void draw_init(void) {
+ GX_ClearVtxDesc();
+ GX_SetVtxDesc(GX_VA_POS, GX_INDEX8);
+ GX_SetVtxDesc(GX_VA_CLR0, GX_INDEX8);
+ GX_SetVtxDesc(GX_VA_TEX0, GX_DIRECT);
+
+ GX_SetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XYZ, GX_S16, 0);
+ GX_SetVtxAttrFmt(GX_VTXFMT0, GX_VA_CLR0, GX_CLR_RGBA, GX_RGBA8, 0);
+ GX_SetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_TEX_ST, GX_F32, 0);
+
+ GX_SetArray(GX_VA_POS, square, 3 * sizeof(s16));
+
+ GX_SetNumTexGens(1);
+ GX_SetTexCoordGen(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, GX_IDENTITY);
+
+ GX_InvalidateTexAll();
+
+ GX_InitTexObj(&texobj, texturemem, vwidth, vheight, GX_TF_RGB565,
+ GX_CLAMP, GX_CLAMP, GX_FALSE);
+}
+
+static void draw_vert(u8 pos, u8 c, f32 s, f32 t) {
+ GX_Position1x8(pos);
+ GX_Color1x8(c);
+ GX_TexCoord2f32(s, t);
+}
+
+static void draw_square(Mtx v) {
+ Mtx m;
+ Mtx mv;
+
+ guMtxIdentity(m);
+ guMtxTransApply(m, m, 0, 0, -100);
+ guMtxConcat(v, m, mv);
+
+ GX_LoadPosMtxImm(mv, GX_PNMTX0);
+ GX_Begin(GX_QUADS, GX_VTXFMT0, 4);
+ draw_vert(0, 0, 0.0, 0.0);
+ draw_vert(1, 0, 1.0, 0.0);
+ draw_vert(2, 0, 1.0, 1.0);
+ draw_vert(3, 0, 0.0, 1.0);
+ GX_End();
+}
+
+/****************************************************************************
+ * StartGX
+ ****************************************************************************/
+void GX_Start(u16 width, u16 height, s16 haspect, s16 vaspect) {
+ Mtx p;
+
+ GX_AbortFrame();
+
+ /*** Set new aspect ***/
+ square[0] = square[9] = -haspect;
+ square[3] = square[6] = haspect;
+ square[1] = square[4] = vaspect;
+ square[7] = square[10] = -vaspect;
+
+ /*** Allocate 32byte aligned texture memory ***/
+ texturesize = (width * height) * 2;
+ texturemem = (u8 *) memalign(32, texturesize);
+
+ GXColor gxbackground = { 0, 0, 0, 0xff };
+
+ /*** Clear out FIFO area ***/
+ memset(gp_fifo, 0, DEFAULT_FIFO_SIZE);
+
+ /*** Initialise GX ***/
+ GX_Init(gp_fifo, DEFAULT_FIFO_SIZE);
+ GX_SetCopyClear(gxbackground, 0x00ffffff);
+
+ GX_SetViewport(0, 0, vmode->fbWidth, vmode->efbHeight, 0, 1);
+ GX_SetDispCopyYScale((f32) vmode->xfbHeight / (f32) vmode->efbHeight);
+ GX_SetScissor(0, 0, vmode->fbWidth, vmode->efbHeight);
+ GX_SetDispCopySrc(0, 0, vmode->fbWidth, vmode->efbHeight);
+ GX_SetDispCopyDst(vmode->fbWidth, vmode->xfbHeight);
+ GX_SetCopyFilter(vmode->aa, vmode->sample_pattern, GX_TRUE,
+ vmode->vfilter);
+ GX_SetFieldMode(vmode->field_rendering,
+ ((vmode->viHeight == 2 * vmode->xfbHeight) ?
+ GX_ENABLE : GX_DISABLE));
+ GX_SetPixelFmt(GX_PF_RGB8_Z24, GX_ZC_LINEAR);
+ GX_SetCullMode(GX_CULL_NONE);
+ GX_CopyDisp(xfb[whichfb ^ 1], GX_TRUE);
+ GX_SetDispCopyGamma(GX_GM_1_0);
+
+ guPerspective(p, 60, 1.33f, 10.0f, 1000.0f);
+ GX_LoadProjectionMtx(p, GX_PERSPECTIVE);
+ memset(texturemem, 0, texturesize);
+
+ GX_Flush();
+
+ /*** Setup for first call to scaler ***/
+ vwidth = vheight = -1;
+}
+
+/****************************************************************************
+* GX_Render
+*
+* Pass in a buffer, width and height to update as a tiled RGB565 texture
+****************************************************************************/
+void GX_Render(u16 width, u16 height, u8 *buffer, u16 pitch) {
+ u16 h, w;
+ u64 *dst = (u64 *) texturemem;
+ u64 *src1 = (u64 *) buffer;
+ u64 *src2 = (u64 *) (buffer + pitch);
+ u64 *src3 = (u64 *) (buffer + (pitch * 2));
+ u64 *src4 = (u64 *) (buffer + (pitch * 3));
+ u16 rowpitch = (pitch >> 3) * 3 + pitch % 8;
+
+ vwidth = width;
+ vheight = height;
+
+ whichfb ^= 1;
+
+ if ((oldvheight != vheight) || (oldvwidth != vwidth)) {
+ /** Update scaling **/
+ oldvwidth = vwidth;
+ oldvheight = vheight;
+ draw_init();
+ memset(&view, 0, sizeof(Mtx));
+ guLookAt(view, &cam.pos, &cam.up, &cam.view);
+ GX_SetViewport(0, 0, vmode->fbWidth, vmode->efbHeight, 0, 1);
+ }
+
+ GX_InvVtxCache();
+ GX_InvalidateTexAll();
+ GX_SetTevOp(GX_TEVSTAGE0, GX_DECAL);
+ GX_SetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR0A0);
+
+ for (h = 0; h < vheight; h += 4) {
+ for (w = 0; w < (vwidth >> 2); w++) {
+ *dst++ = *src1++;
+ *dst++ = *src2++;
+ *dst++ = *src3++;
+ *dst++ = *src4++;
+ }
+
+ src1 += rowpitch;
+ src2 += rowpitch;
+ src3 += rowpitch;
+ src4 += rowpitch;
+ }
+
+ DCFlushRange(texturemem, texturesize);
+
+ GX_SetNumChans(1);
+ GX_LoadTexObj(&texobj, GX_TEXMAP0);
+
+ draw_square(view);
+
+ GX_DrawDone();
+
+ GX_SetZMode(GX_TRUE, GX_LEQUAL, GX_TRUE);
+ GX_SetColorUpdate(GX_TRUE);
+ GX_CopyDisp(xfb[whichfb], GX_TRUE);
+ GX_Flush();
+
+ VIDEO_SetNextFramebuffer(xfb[whichfb]);
+ VIDEO_Flush();
+}
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/backends/platform/wii/gx_supp.h b/backends/platform/wii/gx_supp.h
new file mode 100644
index 0000000000..9393e93a26
--- /dev/null
+++ b/backends/platform/wii/gx_supp.h
@@ -0,0 +1,39 @@
+/****************************************************************************
+* Generic GX Scaler
+* softdev 2007
+*
+* 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.,
+* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*
+* NGC GX Video Functions
+*
+* These are pretty standard functions to setup and use GX scaling.
+****************************************************************************/
+#ifndef _WII_GX_SUPP_H_
+#define _WII_GX_SUPP_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void GX_InitVideo();
+
+void GX_Start(u16 width, u16 height, s16 haspect, s16 vaspect);
+void GX_Render(u16 width, u16 height, u8 *buffer, u16 pitch);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/backends/platform/wii/main.cpp b/backends/platform/wii/main.cpp
new file mode 100644
index 0000000000..5753ecefe4
--- /dev/null
+++ b/backends/platform/wii/main.cpp
@@ -0,0 +1,107 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include <fat.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <errno.h>
+#include <unistd.h>
+
+#include "osystem.h"
+
+#ifdef DEBUG_WII
+#include <debug.h>
+#include <gecko_console.h>
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+bool reset_btn_pressed = false;
+bool power_btn_pressed = false;
+
+void reset_cb(void) {
+ reset_btn_pressed = true;
+}
+
+void power_cb(void) {
+ power_btn_pressed = true;
+}
+
+int main(int argc, char *argv[]) {
+ s32 res;
+
+ VIDEO_Init();
+ PAD_Init();
+ AUDIO_Init(NULL);
+
+#ifdef DEBUG_WII
+ gecko_console_init(0);
+ //DEBUG_Init(GDBSTUB_DEVICE_USB, 1);
+#endif
+
+ printf("startup\n");
+
+ SYS_SetResetCallback(reset_cb);
+ SYS_SetPowerCallback(power_cb);
+
+ if (!fatInitDefault()) {
+ printf("fatInitDefault failed\n");
+ } else {
+ // set the default path if libfat couldnt set it
+ // this allows loading over tcp/usbgecko
+ char buf[MAXPATHLEN];
+
+ getcwd(buf, MAXPATHLEN);
+ if (!strcmp(buf, "fat:/"))
+ chdir("/apps/scummvm");
+
+ //fatEnableReadAhead(PI_DEFAULT, 32, 128);
+ }
+
+ g_system = new OSystem_Wii();
+ assert(g_system);
+
+ res = scummvm_main(argc, argv);
+ g_system->quit();
+
+ printf("shutdown\n");
+
+ if (!fatUnmount(PI_DEFAULT)) {
+ printf("fatUnmount failed\n");
+ fatUnsafeUnmount(PI_DEFAULT);
+ }
+
+ if (power_btn_pressed) {
+ printf("shutting down\n");
+ SYS_ResetSystem(SYS_POWEROFF, 0, 0);
+ }
+
+ printf("reloading\n");
+
+ return res;
+}
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/backends/platform/wii/osystem.cpp b/backends/platform/wii/osystem.cpp
new file mode 100644
index 0000000000..2667ecb69d
--- /dev/null
+++ b/backends/platform/wii/osystem.cpp
@@ -0,0 +1,190 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include "osystem.h"
+#include "backends/fs/wii/wii-fs-factory.h"
+
+#include <unistd.h>
+
+#include <ogc/mutex.h>
+#include <ogc/lwp_watchdog.h>
+
+OSystem_Wii::OSystem_Wii() :
+ _startup_time(0),
+ _alarm(-1),
+
+ _palette(NULL),
+ _cursorPalette(NULL),
+ _cursorPaletteDisabled(true),
+
+ _gameWidth(0),
+ _gameHeight(0),
+ _gamePixels(NULL),
+
+ _overlayVisible(false),
+ _overlayWidth(0),
+ _overlayHeight(0),
+ _overlaySize(0),
+ _overlayPixels(NULL),
+
+ _lastScreenUpdate(0),
+ _texture(NULL),
+ _currentWidth(0),
+ _currentHeight(0),
+
+ _supportedGraphicsModes(NULL),
+ _activeGraphicsMode(-1),
+
+ _mouseVisible(false),
+ _mouseX(0),
+ _mouseY(0),
+ _mouseWidth(0),
+ _mouseHeight(0),
+ _mouseHotspotX(0),
+ _mouseHotspotY(0),
+ _mouseKeyColor(0),
+ _mouseCursor(NULL),
+
+ _event_quit(false),
+
+ _savefile(NULL),
+ _mixer(NULL),
+ _timer(NULL) {
+}
+
+OSystem_Wii::~OSystem_Wii() {
+ if (_savefile) {
+ delete _savefile;
+ _savefile = NULL;
+ }
+
+ if (_mixer) {
+ delete _mixer;
+ _mixer = NULL;
+ }
+
+ if (_timer) {
+ delete _timer;
+ _timer = NULL;
+ }
+}
+
+void OSystem_Wii::initBackend() {
+ _startup_time = gettime();
+
+ _savefile = new DefaultSaveFileManager();
+ _mixer = new Audio::Mixer();
+ _timer = new DefaultTimerManager();
+
+ initGfx();
+ initSfx();
+ initEvents();
+
+ OSystem::initBackend();
+}
+
+void OSystem_Wii::quit() {
+ deinitEvents();
+ deinitSfx();
+ deinitGfx();
+}
+
+bool OSystem_Wii::hasFeature(Feature f) {
+ return f == kFeatureCursorHasPalette;
+}
+
+void OSystem_Wii::setFeatureState(Feature f, bool enable) {
+}
+
+bool OSystem_Wii::getFeatureState(Feature f) {
+ return false;
+}
+
+uint32 OSystem_Wii::getMillis() {
+ return ticks_to_millisecs(diff_ticks(_startup_time, gettime()));
+}
+
+void OSystem_Wii::delayMillis(uint msecs) {
+ usleep(msecs * 1000);
+}
+
+OSystem::MutexRef OSystem_Wii::createMutex() {
+ mutex_t *mutex = (mutex_t *) malloc(sizeof(mutex_t));
+ s32 res = LWP_MutexInit(mutex, false);
+
+ if (res) {
+ printf("ERROR creating mutex\n");
+ delete mutex;
+ return NULL;
+ }
+
+ return (MutexRef) mutex;
+}
+
+void OSystem_Wii::lockMutex(MutexRef mutex) {
+ s32 res = LWP_MutexLock(*(mutex_t *) mutex);
+
+ if (res)
+ printf("ERROR locking mutex %p (%d)\n", mutex, res);
+}
+
+void OSystem_Wii::unlockMutex(MutexRef mutex) {
+ s32 res = LWP_MutexUnlock(*(mutex_t *) mutex);
+
+ if (res)
+ printf("ERROR unlocking mutex %p (%d)\n", mutex, res);
+}
+
+void OSystem_Wii::deleteMutex(MutexRef mutex) {
+ s32 res = LWP_MutexDestroy(*(mutex_t *) mutex);
+
+ if (res)
+ printf("ERROR destroying mutex %p (%d)\n", mutex, res);
+}
+
+void OSystem_Wii::setWindowCaption(const char *caption) {
+ printf("window caption: %s\n", caption);
+}
+
+Common::SaveFileManager *OSystem_Wii::getSavefileManager() {
+ assert(_savefile);
+ return _savefile;
+}
+
+Audio::Mixer *OSystem_Wii::getMixer() {
+ assert(_mixer);
+ return _mixer;
+}
+
+Common::TimerManager *OSystem_Wii::getTimerManager() {
+ assert(_timer);
+ return _timer;
+}
+
+FilesystemFactory *OSystem_Wii::getFilesystemFactory() {
+ return &WiiFilesystemFactory::instance();
+}
+
+void OSystem_Wii::getTimeAndDate(struct tm &t) const {
+ time_t curTime = time(0);
+ t = *localtime(&curTime);
+}
+
diff --git a/backends/platform/wii/osystem.h b/backends/platform/wii/osystem.h
new file mode 100644
index 0000000000..2a168fd0b7
--- /dev/null
+++ b/backends/platform/wii/osystem.h
@@ -0,0 +1,176 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef _WII_OSYSTEM_H_
+#define _WII_OSYSTEM_H_
+
+#include "common/system.h"
+#include "base/main.h"
+
+#include "common/rect.h"
+#include "common/events.h"
+
+#include "backends/saves/default/default-saves.h"
+#include "backends/timer/default/default-timer.h"
+#include "graphics/surface.h"
+#include "sound/mixer.h"
+
+#include <gctypes.h>
+#include <gccore.h>
+#include <ogcsys.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern bool reset_btn_pressed;
+extern bool power_btn_pressed;
+
+#ifdef __cplusplus
+}
+#endif
+
+class OSystem_Wii : public OSystem {
+private:
+ s64 _startup_time;
+ syswd_t _alarm;
+
+ u16 *_palette;
+ u16 *_cursorPalette;
+ bool _cursorPaletteDisabled;
+
+ u16 _gameWidth, _gameHeight;
+ u8 *_gamePixels;
+ Graphics::Surface _surface;
+
+ bool _overlayVisible;
+ u16 _overlayWidth, _overlayHeight;
+ u32 _overlaySize;
+ OverlayColor *_overlayPixels;
+
+ u32 _lastScreenUpdate;
+ u16 *_texture;
+ u16 _currentWidth, _currentHeight;
+
+ OSystem::GraphicsMode *_supportedGraphicsModes;
+ s32 _activeGraphicsMode;
+
+ bool _mouseVisible;
+ s32 _mouseX, _mouseY;
+ u32 _mouseWidth, _mouseHeight;
+ s32 _mouseHotspotX, _mouseHotspotY;
+ u8 _mouseKeyColor;
+ u8 *_mouseCursor;
+
+ bool _event_quit;
+
+ u32 _lastPadCheck;
+
+ void initGfx();
+ void deinitGfx();
+
+ void initSfx();
+ void deinitSfx();
+
+ void initEvents();
+ void deinitEvents();
+ void updateEventScreenResolution();
+
+protected:
+ Common::SaveFileManager *_savefile;
+ Audio::Mixer *_mixer;
+ DefaultTimerManager *_timer;
+
+public:
+ OSystem_Wii();
+ virtual ~OSystem_Wii();
+
+ virtual void initBackend();
+
+ virtual bool hasFeature(Feature f);
+ virtual void setFeatureState(Feature f, bool enable);
+ virtual bool getFeatureState(Feature f);
+ virtual const GraphicsMode *getSupportedGraphicsModes() const;
+ virtual int getDefaultGraphicsMode() const;
+ bool setGraphicsMode(const char *name);
+ virtual bool setGraphicsMode(int mode);
+ virtual int getGraphicsMode() const;
+ virtual void initSize(uint width, uint height);
+ virtual int16 getWidth();
+ virtual int16 getHeight();
+ virtual void setPalette(const byte *colors, uint start, uint num);
+ virtual void grabPalette(byte *colors, uint start, uint num);
+ virtual void setCursorPalette(const byte *colors, uint start, uint num);
+ virtual void disableCursorPalette(bool disable);
+ virtual void copyRectToScreen(const byte *buf, int pitch, int x, int y,
+ int w, int h);
+ virtual void updateScreen();
+ virtual Graphics::Surface *lockScreen();
+ virtual void unlockScreen();
+ virtual void setShakePos(int shakeOffset);
+
+ virtual void showOverlay();
+ virtual void hideOverlay();
+ virtual void clearOverlay();
+ virtual void grabOverlay(OverlayColor *buf, int pitch);
+ virtual void copyRectToOverlay(const OverlayColor *buf, int pitch,
+ int x, int y, int w, int h);
+ virtual int16 getOverlayWidth();
+ virtual int16 getOverlayHeight();
+
+ virtual OverlayColor RGBToColor(uint8 r, uint8 g, uint8 b);
+ virtual void colorToRGB(OverlayColor color, uint8 &r, uint8 &g, uint8 &b);
+ virtual OverlayColor ARGBToColor(uint8 a, uint8 r, uint8 g, uint8 b);
+ virtual void colorToARGB(OverlayColor color, uint8 &a, uint8 &r,
+ uint8 &g, uint8 &b);
+
+ virtual bool showMouse(bool visible);
+
+ virtual void warpMouse(int x, int y);
+ virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX,
+ int hotspotY, byte keycolor = 255,
+ int cursorTargetScale = 1);
+
+ virtual bool pollEvent(Common::Event &event);
+ virtual uint32 getMillis();
+ virtual void delayMillis(uint msecs);
+
+ virtual MutexRef createMutex();
+ virtual void lockMutex(MutexRef mutex);
+ virtual void unlockMutex(MutexRef mutex);
+ virtual void deleteMutex(MutexRef mutex);
+
+ typedef void (*SoundProc)(void *param, byte *buf, int len);
+ virtual int getOutputSampleRate() const;
+
+ virtual void quit();
+
+ virtual void setWindowCaption(const char *caption);
+
+ virtual Common::SaveFileManager *getSavefileManager();
+ virtual Audio::Mixer *getMixer();
+ virtual Common::TimerManager *getTimerManager();
+ FilesystemFactory *getFilesystemFactory();
+ void getTimeAndDate(struct tm &t) const;
+};
+
+#endif
+
diff --git a/backends/platform/wii/osystem_events.cpp b/backends/platform/wii/osystem_events.cpp
new file mode 100644
index 0000000000..2d7c2d9c18
--- /dev/null
+++ b/backends/platform/wii/osystem_events.cpp
@@ -0,0 +1,271 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include <unistd.h>
+#include <malloc.h>
+
+#ifndef GAMECUBE
+#include <wiiuse/wpad.h>
+#endif
+
+#include <ogc/lwp_watchdog.h>
+
+#include "osystem.h"
+
+#define TIMER_THREAD_STACKSIZE (1024 * 32)
+#define TIMER_THREAD_PRIO 64
+
+#define PAD_CHECK_TIME 40
+
+#ifndef GAMECUBE
+#define PADS_A (PAD_BUTTON_A | (WPAD_BUTTON_A << 16))
+#define PADS_B (PAD_BUTTON_B | (WPAD_BUTTON_B << 16))
+#define PADS_X (PAD_BUTTON_X | (WPAD_BUTTON_MINUS << 16))
+#define PADS_Y (PAD_BUTTON_Y | (WPAD_BUTTON_PLUS << 16))
+#define PADS_Z (PAD_TRIGGER_Z | (WPAD_BUTTON_2 << 16))
+#define PADS_START (PAD_BUTTON_START | (WPAD_BUTTON_HOME << 16))
+#define PADS_UP (PAD_BUTTON_UP | (WPAD_BUTTON_UP << 16))
+#define PADS_DOWN (PAD_BUTTON_DOWN | (WPAD_BUTTON_DOWN << 16))
+#define PADS_LEFT (PAD_BUTTON_LEFT | (WPAD_BUTTON_LEFT << 16))
+#define PADS_RIGHT (PAD_BUTTON_RIGHT | (WPAD_BUTTON_RIGHT << 16))
+#else
+#define PADS_A PAD_BUTTON_A
+#define PADS_B PAD_BUTTON_B
+#define PADS_X PAD_BUTTON_X
+#define PADS_Y PAD_BUTTON_Y
+#define PADS_Z PAD_TRIGGER_Z
+#define PADS_START PAD_BUTTON_START
+#define PADS_UP PAD_BUTTON_UP
+#define PADS_DOWN PAD_BUTTON_DOWN
+#define PADS_LEFT PAD_BUTTON_LEFT
+#define PADS_RIGHT PAD_BUTTON_RIGHT
+#endif
+
+static lwpq_t timer_queue;
+static lwp_t timer_thread;
+static u8 *timer_stack;
+static bool timer_thread_running = false;
+static bool timer_thread_quit = false;
+
+static void * timer_thread_func(void *arg) {
+ while (!timer_thread_quit) {
+ DefaultTimerManager *tm =
+ (DefaultTimerManager *) g_system->getTimerManager();
+ tm->handler();
+
+ usleep(1000 * 10);
+ }
+
+ return NULL;
+}
+
+void OSystem_Wii::initEvents() {
+ timer_thread_quit = false;
+
+ timer_stack = (u8 *) memalign(32, TIMER_THREAD_STACKSIZE);
+ memset(timer_stack, 0, TIMER_THREAD_STACKSIZE);
+
+ LWP_InitQueue(&timer_queue);
+
+ s32 res = LWP_CreateThread(&timer_thread, timer_thread_func, NULL,
+ timer_stack, TIMER_THREAD_STACKSIZE,
+ TIMER_THREAD_PRIO);
+
+ if (res) {
+ printf("ERROR creating timer thread: %d\n", res);
+ LWP_CloseQueue(timer_queue);
+ }
+
+ timer_thread_running = res == 0;
+
+#ifndef GAMECUBE
+ WPAD_Init();
+ WPAD_SetDataFormat(WPAD_CHAN_0, WPAD_FMT_BTNS_ACC_IR);
+ WPAD_SetIdleTimeout(120);
+#endif
+}
+
+void OSystem_Wii::deinitEvents() {
+ if (timer_thread_running) {
+ timer_thread_quit = true;
+ LWP_ThreadBroadcast(timer_queue);
+
+ LWP_JoinThread(timer_thread, NULL);
+ LWP_CloseQueue(timer_queue);
+
+ timer_thread_running = false;
+ }
+
+#ifndef GAMECUBE
+ WPAD_Shutdown();
+#endif
+}
+
+void OSystem_Wii::updateEventScreenResolution() {
+#ifndef GAMECUBE
+ WPAD_SetVRes(WPAD_CHAN_0, _currentWidth + _currentWidth / 5,
+ _currentHeight + _currentHeight / 5);
+#endif
+}
+
+#define KBD_EVENT(pad_button, kbd_keycode, kbd_ascii) \
+ do { \
+ if ((bd | bu) & pad_button) { \
+ if (bd & pad_button) \
+ event.type = Common::EVENT_KEYDOWN; \
+ else \
+ event.type = Common::EVENT_KEYUP; \
+ event.kbd.keycode = kbd_keycode; \
+ event.kbd.ascii = kbd_ascii; \
+ return true; \
+ } \
+ } while (0)
+
+bool OSystem_Wii::pollEvent(Common::Event &event) {
+ if ((reset_btn_pressed || power_btn_pressed) && !_event_quit) {
+ _event_quit = true;
+ event.type = Common::EVENT_QUIT;
+
+ printf("quit event\n");
+
+ return true;
+ }
+
+ u32 bd, bh, bu;
+
+ PAD_ScanPads();
+
+ bd = PAD_ButtonsDown(0);
+ bh = PAD_ButtonsHeld(0);
+ bu = PAD_ButtonsUp(0);
+
+#ifndef GAMECUBE
+ WPAD_ScanPads();
+
+ s32 res = WPAD_Probe(0, NULL);
+
+ if (res == WPAD_ERR_NONE) {
+
+ bd |= WPAD_ButtonsDown(0) << 16;
+ bh |= WPAD_ButtonsHeld(0) << 16;
+ bu |= WPAD_ButtonsUp(0) << 16;
+ }
+#endif
+
+ if (bd || bu) {
+ if (bh & PADS_UP)
+ event.kbd.flags = Common::KBD_SHIFT;
+
+ KBD_EVENT(PADS_Z, Common::KEYCODE_RETURN, Common::ASCII_RETURN);
+ KBD_EVENT(PADS_X, Common::KEYCODE_ESCAPE, Common::ASCII_ESCAPE);
+ KBD_EVENT(PADS_Y, Common::KEYCODE_PERIOD, '.');
+ KBD_EVENT(PADS_START, Common::KEYCODE_F5, Common::ASCII_F5);
+ KBD_EVENT(PADS_UP, Common::KEYCODE_LSHIFT, 0);
+ KBD_EVENT(PADS_DOWN, Common::KEYCODE_0, '0');
+ KBD_EVENT(PADS_LEFT, Common::KEYCODE_y, 'y');
+ KBD_EVENT(PADS_RIGHT, Common::KEYCODE_n, 'n');
+
+ if ((bd | bu) & (PADS_A | PADS_B)) {
+ if (bd & PADS_A)
+ event.type = Common::EVENT_LBUTTONDOWN;
+ else if (bu & PADS_A)
+ event.type = Common::EVENT_LBUTTONUP;
+ else if (bd & PADS_B)
+ event.type = Common::EVENT_RBUTTONDOWN;
+ else if (bu & PADS_B)
+ event.type = Common::EVENT_RBUTTONUP;
+
+ event.mouse.x = _mouseX;
+ event.mouse.y = _mouseY;
+
+ return true;
+ }
+ }
+
+ s32 mx = _mouseX;
+ s32 my = _mouseY;
+
+#ifndef GAMECUBE
+ if (res == WPAD_ERR_NONE) {
+ struct ir_t ir;
+
+ WPAD_IR(0, &ir);
+
+ if (ir.valid) {
+ mx = ir.x - _currentWidth / 10;
+ my = ir.y - _currentHeight / 10;
+
+ if (mx < 0)
+ mx = 0;
+
+ if (mx >= _currentWidth)
+ mx = _currentWidth - 1;
+
+ if (my < 0)
+ my = 0;
+
+ if (my >= _currentHeight)
+ my = _currentHeight - 1;
+
+ if ((mx != _mouseX) || (my != _mouseY)) {
+ event.type = Common::EVENT_MOUSEMOVE;
+ event.mouse.x = _mouseX = mx;
+ event.mouse.y = _mouseY = my;
+
+ return true;
+ }
+ }
+ }
+#endif
+
+ uint32 time = getMillis();
+ if (time - _lastPadCheck > PAD_CHECK_TIME) {
+ _lastPadCheck = time;
+
+ if (abs (PAD_StickX(0)) > 16)
+ mx += PAD_StickX(0) / (4 * _overlayWidth / _currentWidth);
+ if (abs (PAD_StickY(0)) > 16)
+ my -= PAD_StickY(0) / (4 * _overlayHeight / _currentHeight);
+
+ if (mx < 0)
+ mx = 0;
+
+ if (mx >= _currentWidth)
+ mx = _currentWidth - 1;
+
+ if (my < 0)
+ my = 0;
+
+ if (my >= _currentHeight)
+ my = _currentHeight - 1;
+
+ if ((mx != _mouseX) || (my != _mouseY)) {
+ event.type = Common::EVENT_MOUSEMOVE;
+ event.mouse.x = _mouseX = mx;
+ event.mouse.y = _mouseY = my;
+
+ return true;
+ }
+ }
+
+ return false;
+}
+
diff --git a/backends/platform/wii/osystem_gfx.cpp b/backends/platform/wii/osystem_gfx.cpp
new file mode 100644
index 0000000000..1e54233c93
--- /dev/null
+++ b/backends/platform/wii/osystem_gfx.cpp
@@ -0,0 +1,453 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include <malloc.h>
+
+#include "osystem.h"
+#include "gx_supp.h"
+
+#define MAX_FPS 30
+
+enum GraphicModeID {
+ GM_DEFAULT
+};
+
+void OSystem_Wii::initGfx() {
+ _surface.w = 0;
+ _surface.h = 0;
+ _surface.pitch = 0;
+ _surface.pixels = NULL;
+ _surface.bytesPerPixel = 0;
+
+ GX_InitVideo();
+
+ _overlayWidth = 640;
+ _overlayHeight = 480;
+
+ _overlaySize = _overlayWidth * _overlayHeight * 2;
+ _overlayPixels = (OverlayColor *) memalign(32, _overlaySize);
+
+ _palette = (u16 *) memalign(32, 256 * 2);
+ memset(_palette, 0, 256 * 2);
+
+ _cursorPalette = (u16 *) memalign(32, 256 * 2);
+ memset(_cursorPalette, 0, 256 * 2);
+
+ _supportedGraphicsModes = new OSystem::GraphicsMode[2];
+ _supportedGraphicsModes[0].name = strdup("gx");
+ _supportedGraphicsModes[0].description = strdup("wii hardware scaler");
+ _supportedGraphicsModes[0].id = GM_DEFAULT;
+ _supportedGraphicsModes[1].name = 0;
+ _supportedGraphicsModes[1].description = 0;
+ _supportedGraphicsModes[1].id = 0;
+
+ _texture = (u16 *) memalign(32, _overlaySize);
+
+ GX_Start(_overlayWidth, _overlayHeight, 320, 240);
+}
+
+void OSystem_Wii::deinitGfx() {
+ GX_AbortFrame();
+
+ if (_supportedGraphicsModes) {
+ delete[] _supportedGraphicsModes;
+ _supportedGraphicsModes = NULL;
+ }
+
+ if (_gamePixels) {
+ free(_gamePixels);
+ _gamePixels = NULL;
+ }
+
+ if (_palette) {
+ free(_palette);
+ _palette = NULL;
+ }
+
+ if (_overlayPixels) {
+ free(_overlayPixels);
+ _overlayPixels = NULL;
+ }
+
+ if (_mouseCursor) {
+ free(_mouseCursor);
+ _mouseCursor = NULL;
+ }
+
+ if (_cursorPalette) {
+ free(_cursorPalette);
+ _cursorPalette = NULL;
+ }
+
+ if (_texture) {
+ free(_texture);
+ _texture = NULL;
+ }
+}
+
+const OSystem::GraphicsMode* OSystem_Wii::getSupportedGraphicsModes() const {
+ return _supportedGraphicsModes;
+}
+
+int OSystem_Wii::getDefaultGraphicsMode() const {
+ return GM_DEFAULT;
+}
+
+bool OSystem_Wii::setGraphicsMode(const char *mode) {
+ setGraphicsMode(GM_DEFAULT);
+
+ return true;
+}
+
+bool OSystem_Wii::setGraphicsMode(int mode) {
+ return true;
+}
+
+int OSystem_Wii::getGraphicsMode() const {
+ return _activeGraphicsMode;
+}
+
+void OSystem_Wii::initSize(uint width, uint height) {
+ if (_gameWidth != width || _gameHeight != height) {
+ printf("initSize %u %u\n", width, height);
+
+ _gameWidth = width;
+ _gameHeight = height;
+
+ if(_gamePixels)
+ free(_gamePixels);
+
+ _gamePixels = (u8 *) memalign(32, _gameWidth * _gameHeight);
+
+ if (!_overlayVisible) {
+ _currentWidth = _gameWidth;
+ _currentHeight = _gameHeight;
+ updateEventScreenResolution();
+ }
+ }
+}
+
+int16 OSystem_Wii::getWidth() {
+ return _gameWidth;
+}
+
+int16 OSystem_Wii::getHeight() {
+ return _gameHeight;
+}
+
+void OSystem_Wii::setPalette(const byte *colors, uint start, uint num) {
+ const byte *p = colors;
+ for (uint i = 0; i < num; ++i) {
+ _palette[start + i] = RGBToColor(p[0], p[1], p[2]);
+ p += 4;
+ }
+}
+
+void OSystem_Wii::grabPalette(byte *colors, uint start, uint num) {
+ byte *p = colors;
+ u8 r, g, b;
+ for (uint i = 0; i < num; ++i) {
+ colorToRGB(_palette[start + i], r, g, b);
+ p[0] = r;
+ p[1] = g;
+ p[2] = b;
+ p[3] = 0xff;
+ p += 4;
+ }
+}
+
+void OSystem_Wii::setCursorPalette(const byte *colors, uint start, uint num) {
+ const byte *p = colors;
+ for (uint i = 0; i < num; ++i) {
+ _cursorPalette[start + i] = RGBToColor(p[0], p[1], p[2]);
+ p += 4;
+ }
+
+ _cursorPaletteDisabled = false;
+}
+
+void OSystem_Wii::disableCursorPalette(bool disable) {
+ _cursorPaletteDisabled = disable;
+}
+
+void OSystem_Wii::copyRectToScreen(const byte *buf, int pitch, int x, int y,
+ int w, int h) {
+ if (x < 0) {
+ w += x;
+ buf -= x;
+ x = 0;
+ }
+
+ if (y < 0) {
+ h += y;
+ buf -= y * pitch;
+ y = 0;
+ }
+
+ if (w > _gameWidth - x)
+ w = _gameWidth - x;
+
+ if (h > _gameHeight - y)
+ h = _gameHeight - y;
+
+ if (w <= 0 || h <= 0)
+ return;
+
+ byte *dst = _gamePixels + y * _gameWidth + x;
+ if (_gameWidth == pitch && pitch == w) {
+ memcpy(dst, buf, h * w);
+ } else {
+ do {
+ memcpy(dst, buf, w);
+ buf += pitch;
+ dst += _gameWidth;
+ } while (--h);
+ }
+}
+
+void OSystem_Wii::updateScreen() {
+ static u32 x, y, h, skip;
+ static s16 msx, msy, mox, moy, mskip;
+ static u16 mpx, mpy;
+ static u8 *s;
+ static u16 *d, *p;
+
+ u32 now = getMillis();
+ if (now - _lastScreenUpdate < 1000 / MAX_FPS)
+ return;
+
+ _lastScreenUpdate = now;
+
+ h = 0;
+ if (_overlayVisible) {
+ memcpy(_texture, _overlayPixels, _overlaySize);
+ } else {
+ for (y = 0; y < _gameHeight; ++y) {
+ for (x = 0; x < _gameWidth; ++x)
+ _texture[h + x] = _palette[_gamePixels[h + x]];
+
+ h += _gameWidth;
+ }
+ }
+
+ if (_mouseVisible) {
+ msx = _mouseX - _mouseHotspotX;
+ msy = _mouseY - _mouseHotspotY;
+ mox = 0;
+ moy = 0;
+ mpx = _mouseWidth;
+ mpy = _mouseHeight;
+
+ if (msx < 0) {
+ mox = -msx;
+ mpx -= mox;
+ msx = 0;
+ } else
+ if (msx + mpx > _currentWidth - 1)
+ mpx = _currentWidth - msx - 1;
+
+ if (msy < 0) {
+ moy = -msy;
+ mpy -= moy;
+ msy = 0;
+ } else
+ if (msy + mpy + 1 > _currentHeight - 1)
+ mpy = _currentHeight - msy - 1;
+
+
+ if (_cursorPaletteDisabled)
+ p = _palette;
+ else
+ p = _cursorPalette;
+
+ skip = _currentWidth - mpx;
+ mskip = _mouseWidth - mpx;
+
+ s = _mouseCursor + moy * _mouseWidth + mox;
+ d = _texture + (msy * _currentWidth + msx);
+
+ for (y = 0; y < mpy; ++y) {
+ for (x = 0; x < mpx; ++x) {
+ if (*s == _mouseKeyColor) {
+ s++;
+ d++;
+
+ continue;
+ }
+
+ *d++ = p[*s];
+ s++;
+ }
+
+ d += skip;
+ s += mskip;
+ }
+ }
+
+ GX_Render(_currentWidth, _currentHeight, (u8 *) _texture,
+ _currentWidth * 2);
+}
+
+Graphics::Surface *OSystem_Wii::lockScreen() {
+ _surface.pixels = _gamePixels;
+ _surface.w = _gameWidth;
+ _surface.h = _gameHeight;
+ _surface.pitch = _gameWidth;
+ _surface.bytesPerPixel = 1;
+
+ return &_surface;
+}
+
+void OSystem_Wii::unlockScreen() {
+}
+
+void OSystem_Wii::setShakePos(int shakeOffset) {
+}
+
+void OSystem_Wii::showOverlay() {
+ _mouseX = _overlayWidth / 2;
+ _mouseY = _overlayHeight / 2;
+ _overlayVisible = true;
+ _currentWidth = _overlayWidth;
+ _currentHeight = _overlayHeight;
+
+ updateEventScreenResolution();
+}
+
+void OSystem_Wii::hideOverlay() {
+ _mouseX = _gameWidth / 2;
+ _mouseY = _gameHeight / 2;
+ _overlayVisible = false;
+ _currentWidth = _gameWidth;
+ _currentHeight = _gameHeight;
+
+ updateEventScreenResolution();
+}
+
+void OSystem_Wii::clearOverlay() {
+ memset(_overlayPixels, 0, _overlaySize);
+}
+
+void OSystem_Wii::grabOverlay(OverlayColor *buf, int pitch) {
+ int h = _overlayHeight;
+ OverlayColor *src = _overlayPixels;
+
+ do {
+ memcpy(buf, src, _overlayWidth * sizeof(OverlayColor));
+ src += _overlayWidth;
+ buf += pitch;
+ } while (--h);
+}
+
+void OSystem_Wii::copyRectToOverlay(const OverlayColor *buf, int pitch, int x,
+ int y, int w, int h) {
+ if (x < 0) {
+ w += x;
+ buf -= x;
+ x = 0;
+ }
+
+ if (y < 0) {
+ h += y;
+ buf -= y * pitch;
+ y = 0;
+ }
+
+ if (w > _overlayWidth - x)
+ w = _overlayWidth - x;
+
+ if (h > _overlayHeight - y)
+ h = _overlayHeight - y;
+
+ if (w <= 0 || h <= 0)
+ return;
+
+ OverlayColor *dst = _overlayPixels + (y * _overlayWidth + x);
+ if (_overlayWidth == pitch && pitch == w) {
+ memcpy(dst, buf, h * w * sizeof(OverlayColor));
+ } else {
+ do {
+ memcpy(dst, buf, w * sizeof(OverlayColor));
+ buf += pitch;
+ dst += _overlayWidth;
+ } while (--h);
+ }
+}
+
+int16 OSystem_Wii::getOverlayWidth() {
+ return _overlayWidth;
+}
+
+int16 OSystem_Wii::getOverlayHeight() {
+ return _overlayHeight;
+}
+
+OverlayColor OSystem_Wii::RGBToColor(uint8 r, uint8 g, uint8 b) {
+ return (((r >> 3) & 0x1f) << 11) | (((g >> 2) & 0x3f) << 5 ) |
+ ((b >> 3) & 0x1f);
+}
+
+void OSystem_Wii::colorToRGB(OverlayColor color, uint8 &r, uint8 &g, uint8 &b) {
+ r = ((color >> 11) & 0x1f) << 3;
+ g = ((color >> 5) & 0x3f) << 2;
+ b = (color & 0x1f) << 3;
+}
+
+OverlayColor OSystem_Wii::ARGBToColor(uint8 a, uint8 r, uint8 g, uint8 b) {
+ return RGBToColor(r, g, b);
+}
+
+void OSystem_Wii::colorToARGB(OverlayColor color, uint8 &a, uint8 &r, uint8 &g,
+ uint8 &b) {
+ a = 0xff;
+ colorToRGB(color, r, g, b);
+}
+
+bool OSystem_Wii::showMouse(bool visible) {
+ bool last = _mouseVisible;
+ _mouseVisible = visible;
+
+ return last;
+}
+
+void OSystem_Wii::warpMouse(int x, int y) {
+ _mouseX = x;
+ _mouseY = y;
+}
+
+void OSystem_Wii::setMouseCursor(const byte *buf, uint w, uint h, int hotspotX,
+ int hotspotY, byte keycolor,
+ int cursorTargetScale) {
+ (void) cursorTargetScale; // TODO
+
+ _mouseWidth = w;
+ _mouseHeight = h;
+ _mouseHotspotX = hotspotX;
+ _mouseHotspotY = hotspotY;
+ _mouseKeyColor = keycolor;
+
+ if (_mouseCursor)
+ free(_mouseCursor);
+
+ _mouseCursor = (u8 *) memalign(32, w * h);
+ memcpy(_mouseCursor, buf, w * h);
+}
+
diff --git a/backends/platform/wii/osystem_sfx.cpp b/backends/platform/wii/osystem_sfx.cpp
new file mode 100644
index 0000000000..16b2f3b055
--- /dev/null
+++ b/backends/platform/wii/osystem_sfx.cpp
@@ -0,0 +1,133 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include <malloc.h>
+
+#include "osystem.h"
+
+#define SFX_THREAD_STACKSIZE (1024 * 128)
+#define SFX_THREAD_PRIO 80
+#define SFX_THREAD_FRAG_SIZE 4096
+
+static lwpq_t sfx_queue;
+static lwp_t sfx_thread;
+static u8 *sfx_stack;
+static bool sfx_thread_running = false;
+static bool sfx_thread_quit = false;
+
+static u8 sb = 0;
+static u8 *sound_buffer[2];
+
+static OSystem_Wii::SoundProc sound_proc = NULL;
+static void *proc_param = NULL;
+
+static void audio_switch_buffers() {
+ AUDIO_StopDMA();
+ AUDIO_InitDMA((u32) sound_buffer[sb], SFX_THREAD_FRAG_SIZE);
+ AUDIO_StartDMA();
+
+ LWP_ThreadSignal(sfx_queue);
+}
+
+static void * sfx_thread_func(void *arg) {
+ u8 next_sb;
+
+ while (true) {
+ LWP_ThreadSleep(sfx_queue);
+
+ if (sfx_thread_quit)
+ break;
+
+ next_sb = sb ^ 1;
+ sound_proc(proc_param, sound_buffer[next_sb], SFX_THREAD_FRAG_SIZE);
+ DCFlushRange(sound_buffer[next_sb], SFX_THREAD_FRAG_SIZE);
+
+ sb = next_sb;
+ }
+
+ return NULL;
+}
+
+void OSystem_Wii::initSfx() {
+ sfx_thread_running = false;
+ sfx_thread_quit = false;
+
+ sfx_stack = (u8 *) memalign(32, SFX_THREAD_STACKSIZE);
+ memset(sfx_stack, 0, SFX_THREAD_STACKSIZE);
+
+ LWP_InitQueue(&sfx_queue);
+
+ s32 res = LWP_CreateThread(&sfx_thread, sfx_thread_func, NULL, sfx_stack,
+ SFX_THREAD_STACKSIZE, SFX_THREAD_PRIO);
+
+ if (res) {
+ printf("ERROR creating sfx thread: %d\n", res);
+ LWP_CloseQueue(sfx_queue);
+ return;
+ }
+
+ sfx_thread_running = true;
+
+ sound_buffer[0] = (u8 *) memalign(32, SFX_THREAD_FRAG_SIZE);
+ sound_buffer[1] = (u8 *) memalign(32, SFX_THREAD_FRAG_SIZE);
+
+ memset(sound_buffer[0], 0, SFX_THREAD_FRAG_SIZE);
+ memset(sound_buffer[1], 0, SFX_THREAD_FRAG_SIZE);
+
+ DCFlushRange(sound_buffer[0], SFX_THREAD_FRAG_SIZE);
+ DCFlushRange(sound_buffer[1], SFX_THREAD_FRAG_SIZE);
+
+ sound_proc = Audio::Mixer::mixCallback;
+ proc_param = _mixer;
+
+ _mixer->setReady(true);
+
+ AUDIO_SetDSPSampleRate(AI_SAMPLERATE_48KHZ);
+ AUDIO_RegisterDMACallback(audio_switch_buffers);
+
+ audio_switch_buffers();
+}
+
+void OSystem_Wii::deinitSfx() {
+ if (_mixer)
+ _mixer->setReady(false);
+
+ AUDIO_StopDMA();
+ AUDIO_RegisterDMACallback(NULL);
+
+ if (sfx_thread_running) {
+ sfx_thread_quit = true;
+ LWP_ThreadBroadcast(sfx_queue);
+
+ LWP_JoinThread(sfx_thread, NULL);
+ LWP_CloseQueue(sfx_queue);
+
+ sfx_thread_running = false;
+
+ free(sound_buffer[0]);
+ free(sound_buffer[1]);
+ }
+}
+
+int OSystem_Wii::getOutputSampleRate() const {
+ return 48000;
+}
+
diff --git a/backends/platform/wince/CELauncherDialog.cpp b/backends/platform/wince/CELauncherDialog.cpp
index 45e41e5e93..edfdad84b3 100644
--- a/backends/platform/wince/CELauncherDialog.cpp
+++ b/backends/platform/wince/CELauncherDialog.cpp
@@ -28,7 +28,7 @@
#include "CELauncherDialog.h"
-#include "engines/engine.h"
+#include "engines/metaengine.h"
#include "gui/newgui.h"
#include "gui/widget.h"
@@ -77,7 +77,7 @@ void CELauncherDialog::automaticScanDirectory(const FilesystemNode &node) {
FSList files;
node.getChildren(files, FilesystemNode::kListFilesOnly);
// detect
- GameList candidates(PluginManager::instance().detectGames(files));
+ GameList candidates(EngineMan.detectGames(files));
// insert
if (candidates.size() >= 1) {
GameDescriptor result = candidates[0];
diff --git a/backends/plugins/dc/dc-provider.cpp b/backends/plugins/dc/dc-provider.cpp
index 1cae4bbd32..9b150c8db4 100644
--- a/backends/plugins/dc/dc-provider.cpp
+++ b/backends/plugins/dc/dc-provider.cpp
@@ -83,9 +83,17 @@ public:
};
-Plugin* SDLPluginProvider::createPlugin(const Common::String &filename) const {
+Plugin* DCPluginProvider::createPlugin(const Common::String &filename) const {
return new DCPlugin(filename);
}
+bool DCPluginProvider::isPluginFilename(const Common::String &filename) const {
+ // Check the plugin suffix
+ if (!filename.hasSuffix(".PLG"))
+ return false;
+
+ return true;
+}
+
#endif // defined(DYNAMIC_MODULES) && defined(__DC__)
diff --git a/backends/plugins/dc/dc-provider.h b/backends/plugins/dc/dc-provider.h
index 1b96f55d4d..f413061828 100644
--- a/backends/plugins/dc/dc-provider.h
+++ b/backends/plugins/dc/dc-provider.h
@@ -34,8 +34,7 @@ class DCPluginProvider : public FilePluginProvider {
protected:
Plugin* createPlugin(const Common::String &filename) const;
- virtual const char* getPrefix() const { return ""; }
- virtual const char* getSuffix() const { return ".PLG"; }
+ bool isPluginFilename(const Common::String &filename) const;
virtual void addCustomDirectories(Common::StringList &dirs) const {
dirs.push_back("/");
diff --git a/backends/plugins/dynamic-plugin.h b/backends/plugins/dynamic-plugin.h
index 4771f1c086..ec051c4ed7 100644
--- a/backends/plugins/dynamic-plugin.h
+++ b/backends/plugins/dynamic-plugin.h
@@ -46,6 +46,7 @@ public:
return false;
}
if (verFunc() != PLUGIN_VERSION) {
+ warning("Plugin uses a different API version (you have: '%d', needed is: '%d')", verFunc(), PLUGIN_VERSION);
unloadPlugin();
return false;
}
@@ -58,6 +59,7 @@ public:
}
_type = (PluginType)typeFunc();
if (_type >= PLUGIN_TYPE_MAX) {
+ warning("Plugin type unknown: %d", _type);
unloadPlugin();
return false;
}
@@ -69,6 +71,7 @@ public:
return false;
}
if (typeVerFunc() != pluginTypeVersions[_type]) {
+ warning("Plugin uses a different type API version (you have: '%d', needed is: '%d')", typeVerFunc(), pluginTypeVersions[_type]);
unloadPlugin();
return false;
}
@@ -83,6 +86,7 @@ public:
// Get the plugin object
_pluginObject = getObject();
if (!_pluginObject) {
+ warning("Couldn't get the plugin object");
unloadPlugin();
return false;
}
diff --git a/backends/plugins/win32/win32-provider.cpp b/backends/plugins/win32/win32-provider.cpp
index 0592638140..64636d8096 100644
--- a/backends/plugins/win32/win32-provider.cpp
+++ b/backends/plugins/win32/win32-provider.cpp
@@ -107,5 +107,13 @@ Plugin* Win32PluginProvider::createPlugin(const Common::String &filename) const
return new Win32Plugin(filename);
}
+bool Win32PluginProvider::isPluginFilename(const Common::String &filename) const {
+ // Check the plugin suffix
+ if (!filename.hasSuffix(".dll"))
+ return false;
+
+ return true;
+}
+
#endif // defined(DYNAMIC_MODULES) && defined(_WIN32)
diff --git a/backends/plugins/win32/win32-provider.h b/backends/plugins/win32/win32-provider.h
index e4b0be7395..4ddc8b7500 100644
--- a/backends/plugins/win32/win32-provider.h
+++ b/backends/plugins/win32/win32-provider.h
@@ -34,8 +34,7 @@ class Win32PluginProvider : public FilePluginProvider {
protected:
Plugin* createPlugin(const Common::String &filename) const;
- virtual const char* getPrefix() const { return ""; }
- virtual const char* getSuffix() const { return ".dll"; }
+ bool isPluginFilename(const Common::String &filename) const;
virtual void addCustomDirectories(Common::StringList &dirs) const {}
};
diff --git a/base/commandLine.cpp b/base/commandLine.cpp
index a4c867edee..b9fd4ecfb7 100644
--- a/base/commandLine.cpp
+++ b/base/commandLine.cpp
@@ -23,7 +23,7 @@
*
*/
-#include "engines/engine.h"
+#include "engines/metaengine.h"
#include "base/commandLine.h"
#include "base/plugins.h"
#include "base/version.h"
@@ -46,6 +46,8 @@
#endif
#elif defined(__SYMBIAN32__)
#define DEFAULT_SAVE_PATH "Savegames"
+#elif defined(PALMOS_MODE)
+#define DEFAULT_SAVE_PATH "/PALM/Programs/ScummVM/Saved"
#endif
#define DETECTOR_TESTING_HACK
@@ -146,7 +148,7 @@ static void usage(const char *s, ...) {
vsnprintf(buf, STRINGBUFLEN, s, va);
va_end(va);
-#if !(defined(PALMOS_ARM) || defined(PALMOS_DEBUG) || defined(__GP32__) || defined (__SYMBIAN32__))
+#if !(defined(__GP32__) || defined (__SYMBIAN32__))
printf(USAGE_STRING, s_appName, buf, s_appName, s_appName);
#endif
exit(1);
@@ -229,6 +231,9 @@ void registerDefaults() {
ConfMan.registerDefault("savepath", savePath);
#elif defined (IPHONE)
ConfMan.registerDefault("savepath", OSystem_IPHONE::getSavePath());
+
+#elif defined(PALMOS_MODE)
+ ConfMan.registerDefault("savepath", DEFAULT_SAVE_PATH);
#endif
#endif // #ifdef DEFAULT_SAVE_PATH
@@ -559,10 +564,10 @@ static void listGames() {
printf("Game ID Full Title \n"
"-------------------- ------------------------------------------------------\n");
- const PluginList &plugins = PluginManager::instance().getPlugins();
- PluginList::const_iterator iter = plugins.begin();
+ const EnginePlugin::List &plugins = EngineMan.getPlugins();
+ EnginePlugin::List::const_iterator iter = plugins.begin();
for (iter = plugins.begin(); iter != plugins.end(); ++iter) {
- GameList list = (*iter)->getSupportedGames();
+ GameList list = (**iter)->getSupportedGames();
for (GameList::iterator v = list.begin(); v != list.end(); ++v) {
printf("%-20s %s\n", v->gameid().c_str(), v->description().c_str());
}
@@ -586,7 +591,7 @@ static void listTargets() {
// to find the proper desc. In fact, the platform probably should
// be taken into account, too.
Common::String gameid(name);
- GameDescriptor g = Base::findGame(gameid);
+ GameDescriptor g = EngineMan.findGame(gameid);
if (g.description().size() > 0)
description = g.description();
}
@@ -613,8 +618,8 @@ static void listSaves(const char *target) {
gameid.toLowercase(); // Normalize it to lower case
// Find the plugin that will handle the specified gameid
- const Plugin *plugin = 0;
- GameDescriptor game = Base::findGame(gameid, &plugin);
+ const EnginePlugin *plugin = 0;
+ GameDescriptor game = EngineMan.findGame(gameid, &plugin);
if (!plugin) {
error("Could not find any plugin to handle gameid '%s' (target '%s')", gameid.c_str(), target);
@@ -622,7 +627,7 @@ static void listSaves(const char *target) {
}
// Query the plugin for a list of savegames
- SaveStateList saveList = plugin->listSaves(target);
+ SaveStateList saveList = (*plugin)->listSaves(target);
// TODO: Include more info about the target (desc, engine name, ...) ???
printf("Saves for target '%s':\n", target);
@@ -667,7 +672,7 @@ static void runDetectorTest() {
continue;
}
- GameList candidates(PluginManager::instance().detectGames(files));
+ GameList candidates(EngineMan.detectGames(files));
bool gameidDiffers = false;
GameList::iterator x;
for (x = candidates.begin(); x != candidates.end(); ++x) {
@@ -740,7 +745,7 @@ bool processSettings(Common::String &command, Common::StringMap &settings) {
// domain (i.e. a target) matching this argument, or alternatively
// whether there is a gameid matching that name.
if (!command.empty()) {
- GameDescriptor gd = Base::findGame(command);
+ GameDescriptor gd = EngineMan.findGame(command);
if (ConfMan.hasGameDomain(command) || !gd.gameid().empty()) {
bool idCameFromCommandLine = false;
diff --git a/base/game.cpp b/base/game.cpp
index a79cfddec9..9628543672 100644
--- a/base/game.cpp
+++ b/base/game.cpp
@@ -75,29 +75,3 @@ void SaveStateDescriptor::setThumbnail(Graphics::Surface *t) {
}
_thumbnail = t;
}
-
-
-namespace Base {
-
-// TODO: Find a better name & place for this function.
-GameDescriptor findGame(const Common::String &gameName, const Plugin **plugin) {
- // Find the GameDescriptor for this target
- const PluginList &plugins = PluginManager::instance().getPlugins();
- GameDescriptor result;
-
- if (plugin)
- *plugin = 0;
-
- PluginList::const_iterator iter = plugins.begin();
- for (iter = plugins.begin(); iter != plugins.end(); ++iter) {
- result = (*iter)->findGame(gameName.c_str());
- if (!result.gameid().empty()) {
- if (plugin)
- *plugin = *iter;
- break;
- }
- }
- return result;
-}
-
-} // End of namespace Base
diff --git a/base/game.h b/base/game.h
index 08d18247ef..18d7967388 100644
--- a/base/game.h
+++ b/base/game.h
@@ -179,15 +179,4 @@ public:
/** List of savestates. */
typedef Common::Array<SaveStateDescriptor> SaveStateList;
-
-class Plugin;
-
-namespace Base {
-
-// TODO: Find a better name & place for this function.
-GameDescriptor findGame(const Common::String &gameName, const Plugin **plugin = NULL);
-
-} // End of namespace Base
-
-
#endif
diff --git a/base/main.cpp b/base/main.cpp
index d0da338e2a..20775f24db 100644
--- a/base/main.cpp
+++ b/base/main.cpp
@@ -32,6 +32,7 @@
*/
#include "engines/engine.h"
+#include "engines/metaengine.h"
#include "base/commandLine.h"
#include "base/plugins.h"
#include "base/version.h"
@@ -90,8 +91,8 @@ static bool launcherDialog(OSystem &system) {
#endif // vector renderer debug
}
-static const Plugin *detectPlugin() {
- const Plugin *plugin = 0;
+static const EnginePlugin *detectPlugin() {
+ const EnginePlugin *plugin = 0;
// Make sure the gameid is set in the config manager, and that it is lowercase.
Common::String gameid(ConfMan.getActiveDomainName());
@@ -102,23 +103,26 @@ static const Plugin *detectPlugin() {
ConfMan.set("gameid", gameid);
// Query the plugins and find one that will handle the specified gameid
- printf("Looking for %s\n", gameid.c_str());
- GameDescriptor game = Base::findGame(gameid, &plugin);
+ printf("User picked target '%s' (gameid '%s')...\n", ConfMan.getActiveDomainName().c_str(), gameid.c_str());
+ printf(" Looking for a plugin supporting this gameid... ");
+ GameDescriptor game = EngineMan.findGame(gameid, &plugin);
if (plugin == 0) {
- printf("Failed game detection\n");
+ printf("failed\n");
warning("%s is an invalid gameid. Use the --list-games option to list supported gameid", gameid.c_str());
return 0;
+ } else {
+ printf("%s\n", plugin->getName());
}
// FIXME: Do we really need this one?
- printf("Trying to start game '%s'\n", game.description().c_str());
+ printf(" Starting '%s'\n", game.description().c_str());
return plugin;
}
// TODO: specify the possible return values here
-static int runGame(const Plugin *plugin, OSystem &system, const Common::String &edebuglevels) {
+static int runGame(const EnginePlugin *plugin, OSystem &system, const Common::String &edebuglevels) {
Common::String gameDataPath(ConfMan.get("path"));
if (gameDataPath.empty()) {
} else if (gameDataPath.lastChar() != '/'
@@ -151,7 +155,7 @@ static int runGame(const Plugin *plugin, OSystem &system, const Common::String &
// Create the game engine
Engine *engine = 0;
- PluginError err = plugin->createInstance(&system, &engine);
+ PluginError err = (*plugin)->createInstance(&system, &engine);
if (!engine || err != kNoError) {
// TODO: Show an error dialog or so?
// TODO: Also take 'err' into consideration...
@@ -181,7 +185,7 @@ static int runGame(const Plugin *plugin, OSystem &system, const Common::String &
// Set the window caption to the game name
Common::String caption(ConfMan.get("description"));
- Common::String desc = Base::findGame(ConfMan.get("gameid")).description();
+ Common::String desc = EngineMan.findGame(ConfMan.get("gameid")).description();
if (caption.empty() && !desc.empty())
caption = desc;
if (caption.empty())
@@ -311,11 +315,11 @@ extern "C" int scummvm_main(int argc, char *argv[]) {
// cleanly, so this is now enabled to encourage people to fix bits :)
while (0 != ConfMan.getActiveDomain()) {
// Try to find a plugin which feels responsible for the specified game.
- const Plugin *plugin = detectPlugin();
+ const EnginePlugin *plugin = detectPlugin();
if (plugin) {
// Unload all plugins not needed for this game,
// to save memory
- PluginManager::instance().unloadPluginsExcept(plugin);
+ PluginManager::instance().unloadPluginsExcept(PLUGIN_TYPE_ENGINE, plugin);
// Try to run the game
int result = runGame(plugin, system, specialDebug);
@@ -342,7 +346,7 @@ extern "C" int scummvm_main(int argc, char *argv[]) {
launcherDialog(system);
}
- PluginManager::instance().unloadPluginsExcept(NULL);
+ PluginManager::instance().unloadPlugins();
PluginManager::destroy();
Common::ConfigManager::destroy();
GUI::NewGui::destroy();
diff --git a/base/plugins.cpp b/base/plugins.cpp
index 9e2c2599ce..dcd394495f 100644
--- a/base/plugins.cpp
+++ b/base/plugins.cpp
@@ -24,12 +24,23 @@
*/
#include "base/plugins.h"
-#include "common/util.h"
+
+#include "common/func.h"
+
+#ifdef DYNAMIC_MODULES
+#include "common/config-manager.h"
+#endif
+
+// Plugin versioning
int pluginTypeVersions[PLUGIN_TYPE_MAX] = {
PLUGIN_TYPE_ENGINE_VERSION,
+ PLUGIN_TYPE_MUSIC_VERSION,
};
+
+// Abstract plugins
+
PluginType Plugin::getType() const {
return _type;
}
@@ -38,31 +49,6 @@ const char *Plugin::getName() const {
return _pluginObject->getName();
}
-const char *Plugin::getCopyright() const {
- return ((MetaEngine*)_pluginObject)->getCopyright();
-}
-
-PluginError Plugin::createInstance(OSystem *syst, Engine **engine) const {
- return ((MetaEngine*)_pluginObject)->createInstance(syst, engine);
-}
-
-GameList Plugin::getSupportedGames() const {
- return ((MetaEngine*)_pluginObject)->getSupportedGames();
-}
-
-GameDescriptor Plugin::findGame(const char *gameid) const {
- return ((MetaEngine*)_pluginObject)->findGame(gameid);
-}
-
-GameList Plugin::detectGames(const FSList &fslist) const {
- return ((MetaEngine*)_pluginObject)->detectGames(fslist);
-}
-
-SaveStateList Plugin::listSaves(const char *target) const {
- return ((MetaEngine*)_pluginObject)->listSaves(target);
-}
-
-
class StaticPlugin : public Plugin {
public:
StaticPlugin(PluginObject *pluginobject, PluginType type) {
@@ -99,6 +85,7 @@ public:
// "Loader" for the static plugins.
// Iterate over all registered (static) plugins and load them.
+ // Engine plugins
#if PLUGIN_ENABLED_STATIC(SCUMM)
LINK_PLUGIN(SCUMM)
#endif
@@ -157,6 +144,49 @@ public:
LINK_PLUGIN(TOUCHE)
#endif
+ // Music plugins
+ // TODO: Use defines to disable or enable each MIDI driver as a
+ // static/dynamic plugin, like it's done for the engines
+ LINK_PLUGIN(NULL)
+ #if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__SYMBIAN32__)
+ LINK_PLUGIN(WINDOWS)
+ #endif
+ #if defined(UNIX) && defined(USE_ALSA)
+ LINK_PLUGIN(ALSA)
+ #endif
+ #if defined(UNIX) && !defined(__BEOS__) && !defined(__MAEMO__)
+ LINK_PLUGIN(SEQ)
+ #endif
+ #if defined(IRIX)
+ LINK_PLUGIN(DMEDIA)
+ #endif
+ #if defined(__amigaos4__)
+ LINK_PLUGIN(CAMD)
+ #endif
+ #if defined(MACOSX)
+ LINK_PLUGIN(COREAUDIO)
+ LINK_PLUGIN(COREMIDI)
+ LINK_PLUGIN(QUICKTIME)
+ #endif
+ #if defined(PALMOS_MODE)
+ # if defined(COMPILE_CLIE)
+ LINK_PLUGIN(YPA1)
+ # elif defined(COMPILE_ZODIAC) && (!defined(ENABLE_SCUMM) || !defined(PALMOS_ARM))
+ LINK_PLUGIN(ZODIAC)
+ # endif
+ #endif
+ #ifdef USE_FLUIDSYNTH
+ LINK_PLUGIN(FLUIDSYNTH)
+ #endif
+ #ifdef USE_MT32EMU
+ LINK_PLUGIN(MT32)
+ #endif
+ LINK_PLUGIN(ADLIB)
+ LINK_PLUGIN(TOWNS)
+ #if defined (UNIX)
+ LINK_PLUGIN(TIMIDITY)
+ #endif
+
return pl;
}
};
@@ -167,30 +197,34 @@ PluginList FilePluginProvider::getPlugins() {
PluginList pl;
// Prepare the list of directories to search
- Common::StringList pluginDirs;
- // TODO: Add the user specified directory (via config file)
- pluginDirs.push_back(".");
- pluginDirs.push_back("plugins");
+ FSList pluginDirs;
+
+ // Add the default directories
+ pluginDirs.push_back(FilesystemNode("."));
+ pluginDirs.push_back(FilesystemNode("plugins"));
// Add the provider's custom directories
addCustomDirectories(pluginDirs);
- Common::StringList::const_iterator d;
- for (d = pluginDirs.begin(); d != pluginDirs.end(); d++) {
+ // Add the user specified directory
+ Common::String pluginsPath(ConfMan.get("pluginspath"));
+ if (!pluginsPath.empty())
+ pluginDirs.push_back(FilesystemNode(pluginsPath));
+
+ FSList::const_iterator dir;
+ for (dir = pluginDirs.begin(); dir != pluginDirs.end(); dir++) {
// Load all plugins.
// Scan for all plugins in this directory
- FilesystemNode dir(*d);
FSList files;
- if (!dir.getChildren(files, FilesystemNode::kListFilesOnly)) {
- debug(1, "Couldn't open plugin directory '%s'", d->c_str());
+ if (!dir->getChildren(files, FilesystemNode::kListFilesOnly)) {
+ debug(1, "Couldn't open plugin directory '%s'", dir->getPath().c_str());
continue;
} else {
- debug(1, "Reading plugins from plugin directory '%s'", d->c_str());
+ debug(1, "Reading plugins from plugin directory '%s'", dir->getPath().c_str());
}
for (FSList::const_iterator i = files.begin(); i != files.end(); ++i) {
- Common::String name(i->getName());
- if (name.hasPrefix(getPrefix()) && name.hasSuffix(getSuffix())) {
+ if (isPluginFilename(i->getName())) {
pl.push_back(createPlugin(i->getPath()));
}
}
@@ -199,25 +233,25 @@ PluginList FilePluginProvider::getPlugins() {
return pl;
}
-const char* FilePluginProvider::getPrefix() const {
+bool FilePluginProvider::isPluginFilename(const Common::String &filename) const {
#ifdef PLUGIN_PREFIX
- return PLUGIN_PREFIX;
-#else
- return "";
+ // Check the plugin prefix
+ if (!filename.hasPrefix(PLUGIN_PREFIX))
+ return false;
#endif
-}
-const char* FilePluginProvider::getSuffix() const {
#ifdef PLUGIN_SUFFIX
- return PLUGIN_SUFFIX;
-#else
- return "";
+ // Check the plugin suffix
+ if (!filename.hasSuffix(PLUGIN_SUFFIX))
+ return false;
#endif
+
+ return true;
}
-void FilePluginProvider::addCustomDirectories(Common::StringList &dirs) const {
+void FilePluginProvider::addCustomDirectories(FSList &dirs) const {
#ifdef PLUGIN_DIRECTORY
- dirs.push_back(PLUGIN_DIRECTORY);
+ dirs.push_back(FilesystemNode(PLUGIN_DIRECTORY));
#endif
}
@@ -252,31 +286,30 @@ void PluginManager::loadPlugins() {
for (ProviderList::iterator pp = _providers.begin();
pp != _providers.end();
++pp) {
- PluginList pl((**pp).getPlugins());
- for (PluginList::iterator plugin = pl.begin(); plugin != pl.end(); ++plugin) {
- tryLoadPlugin(*plugin);
- }
+ PluginList pl((*pp)->getPlugins());
+ Common::for_each(pl.begin(), pl.end(), Common::bind1st(Common::mem_fun(&PluginManager::tryLoadPlugin), this));
}
}
void PluginManager::unloadPlugins() {
- unloadPluginsExcept(NULL);
+ for (int i = 0; i < PLUGIN_TYPE_MAX; i++)
+ unloadPluginsExcept((PluginType)i, NULL);
}
-void PluginManager::unloadPluginsExcept(const Plugin *plugin) {
+void PluginManager::unloadPluginsExcept(PluginType type, const Plugin *plugin) {
Plugin *found = NULL;
- for (PluginList::iterator p = _plugins.begin(); p != _plugins.end(); ++p) {
+ for (PluginList::iterator p = _plugins[type].begin(); p != _plugins[type].end(); ++p) {
if (*p == plugin) {
found = *p;
} else {
- (**p).unloadPlugin();
+ (*p)->unloadPlugin();
delete *p;
}
}
- _plugins.clear();
+ _plugins[type].clear();
if (found != NULL) {
- _plugins.push_back(found);
+ _plugins[type].push_back(found);
}
}
@@ -284,16 +317,26 @@ bool PluginManager::tryLoadPlugin(Plugin *plugin) {
assert(plugin);
// Try to load the plugin
if (plugin->loadPlugin()) {
- // If successful, add it to the list of known plugins and return.
- _plugins.push_back(plugin);
+ // The plugin is valid, see if it provides the same module as an
+ // already loaded one and should replace it.
+ bool found = false;
+
+ PluginList::iterator pl = _plugins[plugin->getType()].begin();
+ while (!found && pl != _plugins[plugin->getType()].end()) {
+ if (!strcmp(plugin->getName(), (*pl)->getName())) {
+ // Found a duplicated module. Replace the old one.
+ found = true;
+ delete *pl;
+ *pl = plugin;
+ debug(1, "Replaced the duplicated plugin: '%s'", plugin->getName());
+ }
+ pl++;
+ }
- // TODO/FIXME: We should perform some additional checks here:
- // * Check for some kind of "API version" (possibly derived from the
- // SVN tree revision?)
- // * If two plugins provide the same engine, we should only load one.
- // To detect this situation, we could just compare the plugin name.
- // To handle it, simply prefer modules loaded earlier to those coming.
- // Or vice versa... to be determined... :-)
+ if (!found) {
+ // If it provides a new module, just add it to the list of known plugins.
+ _plugins[plugin->getType()].push_back(plugin);
+ }
return true;
} else {
@@ -303,15 +346,59 @@ bool PluginManager::tryLoadPlugin(Plugin *plugin) {
}
}
-GameList PluginManager::detectGames(const FSList &fslist) const {
+
+// Engine plugins
+
+#include "engines/metaengine.h"
+
+DECLARE_SINGLETON(EngineManager);
+
+GameDescriptor EngineManager::findGame(const Common::String &gameName, const EnginePlugin **plugin) const {
+ // Find the GameDescriptor for this target
+ const EnginePlugin::List &plugins = getPlugins();
+ GameDescriptor result;
+
+ if (plugin)
+ *plugin = 0;
+
+ EnginePlugin::List::const_iterator iter = plugins.begin();
+ for (iter = plugins.begin(); iter != plugins.end(); ++iter) {
+ result = (**iter)->findGame(gameName.c_str());
+ if (!result.gameid().empty()) {
+ if (plugin)
+ *plugin = *iter;
+ break;
+ }
+ }
+ return result;
+}
+
+GameList EngineManager::detectGames(const FSList &fslist) const {
GameList candidates;
+ const EnginePlugin::List &plugins = getPlugins();
+
// Iterate over all known games and for each check if it might be
// the game in the presented directory.
- PluginList::const_iterator iter;
- for (iter = _plugins.begin(); iter != _plugins.end(); ++iter) {
- candidates.push_back((*iter)->detectGames(fslist));
+ EnginePlugin::List::const_iterator iter;
+ for (iter = plugins.begin(); iter != plugins.end(); ++iter) {
+ candidates.push_back((**iter)->detectGames(fslist));
}
return candidates;
}
+
+const EnginePlugin::List &EngineManager::getPlugins() const {
+ return (const EnginePlugin::List &)PluginManager::instance().getPlugins(PLUGIN_TYPE_ENGINE);
+}
+
+
+// Music plugins
+
+#include "sound/musicplugin.h"
+
+DECLARE_SINGLETON(MusicManager);
+
+const MusicPlugin::List &MusicManager::getPlugins() const {
+ return (const MusicPlugin::List &)PluginManager::instance().getPlugins(PLUGIN_TYPE_MUSIC);
+}
diff --git a/base/plugins.h b/base/plugins.h
index ca08a0c628..9d3ce97c3b 100644
--- a/base/plugins.h
+++ b/base/plugins.h
@@ -26,98 +26,82 @@
#ifndef BASE_PLUGINS_H
#define BASE_PLUGINS_H
-#include "common/array.h"
#include "common/error.h"
-#include "common/list.h"
#include "common/singleton.h"
#include "common/util.h"
-#include "base/game.h"
+
+#ifdef DYNAMIC_MODULES
+#include "common/fs.h"
+#endif
/**
- * Abstract base class for the plugin objects which handle plugins
- * instantiation. Subclasses for this may be used for engine plugins
- * and other types of plugins.
+ * @page pagePlugins An overview of the ScummVM plugin system
+ * This is a brief overview of how plugins (dynamically loadable code modules)
+ * work in ScummVM. We will explain how to write plugins, how they work internally,
+ * and sketch how porters can add support for them in their ports.
+ *
+ * \section secPluginImpl Implementing a plugin
+ * TODO
+ *
+ * \section secPluginUse Using plugins
+ * TODO
+ *
+ * \section secPluginInternals How plugins work internally
+ * TODO
+ *
+ * \section secPluginBackend How to add support for dynamic plugins to a port
+ * TODO
*/
-class PluginObject {
-public:
- virtual ~PluginObject() {}
- /** Returns the name of the plugin. */
- virtual const char *getName() const = 0;
-};
-#include "engines/metaengine.h"
-// Global Plugin API version
+// Plugin versioning
+
+/** Global Plugin API version */
#define PLUGIN_VERSION 1
enum PluginType {
PLUGIN_TYPE_ENGINE = 0,
+ PLUGIN_TYPE_MUSIC,
+ /* PLUGIN_TYPE_SCALER, */ // TODO: Add graphics scaler plugins
PLUGIN_TYPE_MAX
};
// TODO: Make the engine API version depend on ScummVM's version
-// because of the backlinking
+// because of the backlinking (posibly from the SVN revision)
#define PLUGIN_TYPE_ENGINE_VERSION 1
+#define PLUGIN_TYPE_MUSIC_VERSION 1
extern int pluginTypeVersions[PLUGIN_TYPE_MAX];
-class Engine;
-class FSList;
-class OSystem;
-
-/**
- * Abstract base class for the plugin system.
- * Subclasses for this can be used to wrap both static and dynamic
- * plugins.
- */
-class Plugin {
-protected:
- PluginObject *_pluginObject;
- PluginType _type;
-
-public:
- Plugin() : _pluginObject(0) {}
- virtual ~Plugin() {
- //if (isLoaded())
- //unloadPlugin();
- }
-
-// virtual bool isLoaded() const = 0; // TODO
- virtual bool loadPlugin() = 0; // TODO: Rename to load() ?
- virtual void unloadPlugin() = 0; // TODO: Rename to unload() ?
-
- PluginType getType() const;
- const char *getName() const;
- const char *getCopyright() const;
-
- PluginError createInstance(OSystem *syst, Engine **engine) const;
- GameList getSupportedGames() const;
- GameDescriptor findGame(const char *gameid) const;
- GameList detectGames(const FSList &fslist) const;
- SaveStateList listSaves(const char *target) const;
-};
+// Plugin linking
#define STATIC_PLUGIN 1
#define DYNAMIC_PLUGIN 2
+// Note: The spaces around ENABLE_##ID have been added on purpose for
+// MSVC. For some reason, MSVC tries to add the parenthesis after
+// ENABLE_##ID to the check, thus making it false all the time.
+// Please do NOT remove them, otherwise no engine plugins will be
+// registered under MSVC
+
#define PLUGIN_ENABLED_STATIC(ID) \
- (defined(ENABLE_##ID) && !PLUGIN_ENABLED_DYNAMIC(ID))
+ (defined( ENABLE_##ID ) && !PLUGIN_ENABLED_DYNAMIC(ID))
#define PLUGIN_ENABLED_DYNAMIC(ID) \
- (defined(ENABLE_##ID) && (ENABLE_##ID == DYNAMIC_PLUGIN) && defined(DYNAMIC_MODULES))
+ (defined( ENABLE_##ID ) && (ENABLE_##ID == DYNAMIC_PLUGIN) && defined(DYNAMIC_MODULES))
/**
- * REGISTER_PLUGIN is a convenience macro meant to ease writing
- * the plugin interface for our modules. In particular, using it
- * makes it possible to compile the very same code in a module
- * both as a static and a dynamic plugin.
+ * REGISTER_PLUGIN_STATIC is a convenience macro which is used to declare
+ * the plugin interface for static plugins. Code (such as game engines)
+ * which needs to implement a static plugin can simply invoke this macro
+ * with a plugin ID, plugin type and PluginObject subclass, and the correct
+ * wrapper code will be inserted.
*
- * @todo add some means to query the plugin API version etc.
+ * @see REGISTER_PLUGIN_DYNAMIC
*/
-
#define REGISTER_PLUGIN_STATIC(ID,TYPE,PLUGINCLASS) \
PluginType g_##ID##_type = TYPE; \
PluginObject *g_##ID##_getObject() { \
@@ -127,6 +111,15 @@ public:
#ifdef DYNAMIC_MODULES
+/**
+ * REGISTER_PLUGIN_DYNAMIC is a convenience macro which is used to declare
+ * the plugin interface for dynamically loadable plugins. Code (such as game engines)
+ * which needs to implement a dynamic plugin can simply invoke this macro
+ * with a plugin ID, plugin type and PluginObject subclass, and the correct
+ * wrapper code will be inserted.
+ *
+ * @see REGISTER_PLUGIN_STATIC
+ */
#define REGISTER_PLUGIN_DYNAMIC(ID,TYPE,PLUGINCLASS) \
extern "C" { \
PLUGIN_EXPORT int32 PLUGIN_getVersion() { return PLUGIN_VERSION; } \
@@ -141,44 +134,149 @@ public:
#endif // DYNAMIC_MODULES
-/** List of plugins. */
+// Abstract plugins
+
+/**
+ * Abstract base class for the plugin objects which handle plugins
+ * instantiation. Subclasses for this may be used for engine plugins
+ * and other types of plugins.
+ *
+ * FIXME: This class needs better documentation, esp. how it differs from class Plugin
+ */
+class PluginObject {
+public:
+ virtual ~PluginObject() {}
+
+ /** Returns the name of the plugin. */
+ virtual const char *getName() const = 0;
+};
+
+/**
+ * Abstract base class for the plugin system.
+ * Subclasses for this can be used to wrap both static and dynamic
+ * plugins.
+ *
+ * FIXME: This class needs better documentation, esp. how it differs from class PluginObject
+ */
+class Plugin {
+protected:
+ PluginObject *_pluginObject;
+ PluginType _type;
+
+public:
+ Plugin() : _pluginObject(0) {}
+ virtual ~Plugin() {
+ //if (isLoaded())
+ //unloadPlugin();
+ }
+
+// virtual bool isLoaded() const = 0; // TODO
+ virtual bool loadPlugin() = 0; // TODO: Rename to load() ?
+ virtual void unloadPlugin() = 0; // TODO: Rename to unload() ?
+
+ PluginType getType() const;
+ const char *getName() const;
+};
+
+/** List of Plugin instances. */
typedef Common::Array<Plugin *> PluginList;
+/**
+ * Convenience template to make it easier defining normal Plugin
+ * subclasses. Namely, the PluginSubclass will manage PluginObjects
+ * of a type specified via the PO_t template parameter.
+ */
+template<class PO_t>
+class PluginSubclass : public Plugin {
+public:
+ PO_t *operator->() const {
+ return (PO_t *)_pluginObject;
+ }
+
+ typedef Common::Array<PluginSubclass *> List;
+};
+/**
+ * Abstract base class for Plugin factories. Subclasses of this
+ * are responsible for creating plugin objects, e.g. by loading
+ * loadable modules from storage media; by creating "fake" plugins
+ * from static code; or whatever other means.
+ */
class PluginProvider {
public:
virtual ~PluginProvider() {}
/**
* Return a list of Plugin objects. The caller is responsible for actually
- * loading/unloading them (by invoking the appropriate methods).
+ * loading/unloading them (by invoking the appropriate Plugin methods).
* Furthermore, the caller is responsible for deleting these objects
* eventually.
+ *
+ * @return a list of Plugin instances
*/
virtual PluginList getPlugins() = 0;
};
+#ifdef DYNAMIC_MODULES
+
+/**
+ * Abstract base class for Plugin factories which load binary code from files.
+ * Subclasses only have to implement the createPlugin() method, and optionally
+ * can overload the other protected methods to achieve custom behavior.
+ */
class FilePluginProvider : public PluginProvider {
public:
+ /**
+ * Return a list of Plugin objects loaded via createPlugin from disk.
+ * For this, a list of directories is searched for plugin objects:
+ * The current dir and its "plugins" subdirectory (if present), a list
+ * of custom search dirs (see addCustomDirectories) and finally the
+ * directory specified via the "pluginspath" config variable (if any).
+ *
+ * @return a list of Plugin instances
+ */
virtual PluginList getPlugins();
protected:
- virtual Plugin* createPlugin(const Common::String &filename) const = 0;
+ /**
+ * Create a Plugin instance from a loadable code module with the specified name.
+ * Subclasses of FilePluginProvider have to at least overload this method.
+ * If the file is not found, or does not contain loadable code, 0 is returned instead.
+ *
+ * @param filename the name of the loadable code module
+ * @return a pointer to a Plugin instance, or 0 if an error occurred.
+ */
+ virtual Plugin *createPlugin(const Common::String &filename) const = 0;
- virtual const char* getPrefix() const;
- virtual const char* getSuffix() const;
+ /**
+ * Check if the supplied filename corresponds to a loadable plugin file in
+ * the current platform.
+ *
+ * @param filename the name of the file to check
+ * @return true if the filename corresponds to a plugin, false otherwise
+ */
+ virtual bool isPluginFilename(const Common::String &filename) const;
- virtual void addCustomDirectories(Common::StringList &dirs) const;
+ /**
+ * Optionally add to the list of directories to be searched for
+ * plugins by getPlugins().
+ *
+ * @param dirs the reference to the list of directories to be used when
+ * searching for plugins.
+ */
+ virtual void addCustomDirectories(FSList &dirs) const;
};
+#endif // DYNAMIC_MODULES
+
/**
- * Instances of this class manage all plugins, including loading them,
- * making wrapper objects of class Plugin available, and unloading them.
+ * Singleton class which manages all plugins, including loading them,
+ * managing all Plugin class instances, and unloading them.
*/
class PluginManager : public Common::Singleton<PluginManager> {
- typedef Common::List<PluginProvider *> ProviderList;
+ typedef Common::Array<PluginProvider *> ProviderList;
private:
- PluginList _plugins;
+ PluginList _plugins[PLUGIN_TYPE_MAX];
ProviderList _providers;
bool tryLoadPlugin(Plugin *plugin);
@@ -193,11 +291,9 @@ public:
void loadPlugins();
void unloadPlugins();
- void unloadPluginsExcept(const Plugin *plugin);
-
- const PluginList &getPlugins() { return _plugins; }
+ void unloadPluginsExcept(PluginType type, const Plugin *plugin);
- GameList detectGames(const FSList &fslist) const;
+ const PluginList &getPlugins(PluginType t) { return _plugins[t]; }
};
#endif
diff --git a/common/advancedDetector.cpp b/common/advancedDetector.cpp
index 79289072df..4387bd199e 100644
--- a/common/advancedDetector.cpp
+++ b/common/advancedDetector.cpp
@@ -268,7 +268,10 @@ PluginError AdvancedMetaEngine::createInstance(OSystem *syst, Engine **engine) c
return kNoError;
}
-static void reportUnknown(StringMap &filesMD5, HashMap<String, int32, Common::CaseSensitiveString_Hash, Common::CaseSensitiveString_EqualTo> &filesSize) {
+typedef HashMap<String, bool> StringSet;
+typedef HashMap<String, int32> IntMap;
+
+static void reportUnknown(StringMap &filesMD5, IntMap &filesSize) {
// TODO: This message should be cleaned up / made more specific.
// For example, we should specify at least which engine triggered this.
//
@@ -285,11 +288,8 @@ static void reportUnknown(StringMap &filesMD5, HashMap<String, int32, Common::Ca
}
static ADGameDescList detectGame(const FSList *fslist, const Common::ADParams &params, Language language, Platform platform, const Common::String extra) {
- typedef HashMap<String, bool, CaseSensitiveString_Hash, CaseSensitiveString_EqualTo> StringSet;
StringSet filesList;
- typedef StringMap StringMap;
- typedef HashMap<String, int32, Common::CaseSensitiveString_Hash, Common::CaseSensitiveString_EqualTo> IntMap;
StringMap filesMD5;
IntMap filesSize;
IntMap allFiles;
@@ -428,7 +428,13 @@ static ADGameDescList detectGame(const FSList *fslist, const Common::ADParams &p
if (curFilesMatched > maxFilesMatched) {
debug(2, " ... new best match, removing all previous candidates");
maxFilesMatched = curFilesMatched;
- matched.clear();
+
+ for (uint j = 0; j < matched.size();) {
+ if (matched[j]->flags & ADGF_KEEPMATCH)
+ ++j;
+ else
+ matched.remove_at(j);
+ }
matched.push_back(g);
} else if (curFilesMatched == maxFilesMatched) {
matched.push_back(g);
diff --git a/common/advancedDetector.h b/common/advancedDetector.h
index 2dc4b44b5f..48b9e213d7 100644
--- a/common/advancedDetector.h
+++ b/common/advancedDetector.h
@@ -46,6 +46,8 @@ struct ADGameFileDescription {
enum ADGameFlags {
ADGF_NO_FLAGS = 0,
+ ADGF_KEEPMATCH = (1 << 27), // this entry is kept even when there are matched
+ // entries with more files
ADGF_DROPLANGUAGE = (1 << 28), // don't add language to gameid
ADGF_CD = (1 << 29), // add "-cd" to gameid
ADGF_DEMO = (1 << 30) // add "-demo" to gameid
@@ -219,7 +221,7 @@ public:
* @note The fslist parameter may be 0 -- in that case, it is assumed
* that the callback searchs the current directory.
*/
- const Common::ADGameDescription *fallbackDetect(const FSList *fslist) const {
+ virtual const Common::ADGameDescription *fallbackDetect(const FSList *fslist) const {
return 0;
}
};
diff --git a/common/array.h b/common/array.h
index 24a07b49bf..854ce5b91d 100644
--- a/common/array.h
+++ b/common/array.h
@@ -99,7 +99,7 @@ public:
if (this == &array)
return *this;
- delete [] _data;
+ delete[] _data;
_size = array._size;
_capacity = _size + 32;
_data = new T[_capacity];
@@ -113,7 +113,7 @@ public:
}
void clear() {
- delete [] _data;
+ delete[] _data;
_data = 0;
_size = 0;
_capacity = 0;
@@ -151,7 +151,7 @@ public:
if (old_data) {
// Copy old data
copy(old_data, old_data + _size, _data);
- delete [] old_data;
+ delete[] old_data;
}
}
@@ -166,7 +166,7 @@ public:
// Copy old data
int cnt = (_size < newSize ? _size : newSize);
copy(old_data, old_data + cnt, _data);
- delete [] old_data;
+ delete[] old_data;
}
_size = newSize;
}
diff --git a/common/file.cpp b/common/file.cpp
index 4a7aed0e3d..386777e2c5 100644
--- a/common/file.cpp
+++ b/common/file.cpp
@@ -136,7 +136,7 @@
namespace Common {
-typedef HashMap<String, int, CaseSensitiveString_Hash, CaseSensitiveString_EqualTo> StringIntMap;
+typedef HashMap<String, int> StringIntMap;
// The following two objects could be turned into static members of class
// File. However, then we would be forced to #include hashmap in file.h
diff --git a/common/file.h b/common/file.h
index 25c51a0afe..8a69318128 100644
--- a/common/file.h
+++ b/common/file.h
@@ -108,10 +108,10 @@ public:
*
* @return: true if the end of file is reached, false otherwise.
*/
- bool eof() const;
+ virtual bool eof() const;
- uint32 pos() const;
- uint32 size() const;
+ virtual uint32 pos() const;
+ virtual uint32 size() const;
void seek(int32 offs, int whence = SEEK_SET);
uint32 read(void *dataPtr, uint32 dataSize);
uint32 write(const void *dataPtr, uint32 dataSize);
diff --git a/common/hash-str.h b/common/hash-str.h
index 5575735f1d..f64b62daed 100644
--- a/common/hash-str.h
+++ b/common/hash-str.h
@@ -57,11 +57,12 @@ struct IgnoreCase_Hash {
-typedef HashMap<String, String, IgnoreCase_Hash, IgnoreCase_EqualTo> StringMap;
-
-
-#if 0
// Specalization of the Hash functor for String objects.
+// We do case sensitve hashing here, because that is what
+// the default EqualTo is compatible with. If one wants to use
+// case insensitve hashing, then only because one wants to use
+// IgnoreCase_EqualTo, and then one has to specify a custom
+// hash anyway.
template <>
struct Hash<String> {
uint operator()(const String& s) const {
@@ -75,7 +76,10 @@ struct Hash<const char *> {
return hashit(s);
}
};
-#endif
+
+// String map -- by default case insensitive
+typedef HashMap<String, String, IgnoreCase_Hash, IgnoreCase_EqualTo> StringMap;
+
} // End of namespace Common
diff --git a/common/hashmap.h b/common/hashmap.h
index 81a4b0d17e..1bae44e98e 100644
--- a/common/hashmap.h
+++ b/common/hashmap.h
@@ -535,6 +535,7 @@ void HashMap<Key, Val, HashFunc, EqualFunc>::erase(const Key &key) {
}
}
_arr[i] = NULL;
+ _nele--;
return;
}
diff --git a/common/module.mk b/common/module.mk
index a7c0f4eb90..c3f2a38c3f 100644
--- a/common/module.mk
+++ b/common/module.mk
@@ -14,6 +14,7 @@ MODULE_OBJS := \
stream.o \
util.o \
system.o \
+ unarj.o \
unzip.o \
zlib.o
diff --git a/common/rect.h b/common/rect.h
index d88f400039..f71124434a 100644
--- a/common/rect.h
+++ b/common/rect.h
@@ -61,7 +61,7 @@ struct Point {
if (diffy >= 0x1000)
return 0xFFFFFF;
- return diffx*diffx + diffy*diffy;
+ return uint(diffx*diffx + diffy*diffy);
}
};
diff --git a/common/scummsys.h b/common/scummsys.h
index 4299de7243..939f34a5c3 100644
--- a/common/scummsys.h
+++ b/common/scummsys.h
@@ -369,6 +369,14 @@
#define STRINGBUFLEN 256
#define printf(fmt, ...) consolePrintf(fmt, ##__VA_ARGS__)
+#elif defined(__WII__)
+
+ #define scumm_stricmp strcasecmp
+ #define scumm_strnicmp strncasecmp
+
+ #define SCUMM_BIG_ENDIAN
+ #define SCUMM_NEED_ALIGNMENT
+
#else
#error No system type defined
diff --git a/common/system.cpp b/common/system.cpp
index 8c9ca46da6..327b7246e2 100644
--- a/common/system.cpp
+++ b/common/system.cpp
@@ -35,8 +35,6 @@
#include "gui/message.h"
#include "sound/mixer.h"
-#include <time.h>
-
OSystem *g_system = 0;
OSystem::OSystem() {
@@ -124,38 +122,22 @@ void OSystem::clearScreen() {
unlockScreen();
}
-void OSystem::getTimeAndDate(struct tm &t) const {
-#ifndef __PLAYSTATION2__
- // PS2SDK doesn't provide localtime, so this code doesn't compile
- time_t curTime = time(0);
- t = *localtime(&curTime);
-#endif
-}
-
/*
* Include header files needed for the getFilesystemFactory() method.
*
* TODO: Remove these gradually and move the getFilesystemFactory() implementations
* to the respective backends. Then turn it into a pure virtual method of OSystem.
*/
-#if defined(__DS__)
- #include "backends/fs/ds/ds-fs-factory.h"
-#elif defined(__GP32__)
- #include "backends/fs/gp32/gp32-fs-factory.h"
-#elif defined(PALMOS_MODE)
+#if defined(PALMOS_MODE)
#include "backends/fs/palmos/palmos-fs-factory.h"
#elif defined(__PLAYSTATION2__)
#include "backends/fs/ps2/ps2-fs-factory.h"
#endif
FilesystemFactory *OSystem::getFilesystemFactory() {
- #if defined(__amigaos4__) || defined(__DC__) || defined(__SYMBIAN32__) || defined(UNIX) || defined(WIN32) || defined(__PSP__)
+ #if defined(__amigaos4__) || defined(__DC__) || defined(__SYMBIAN32__) || defined(UNIX) || defined(WIN32) || defined(__WII__) || defined(__PSP__) || defined(__DS__)
// These ports already implement this function, so it should never be called.
return 0;
- #elif defined(__DS__)
- return &DSFilesystemFactory::instance();
- #elif defined(__GP32__)
- return &GP32FilesystemFactory::instance();
#elif defined(PALMOS_MODE)
return &PalmOSFilesystemFactory::instance();
#elif defined(__PLAYSTATION2__)
diff --git a/common/system.h b/common/system.h
index 7989cabfbd..204ea9383a 100644
--- a/common/system.h
+++ b/common/system.h
@@ -662,7 +662,7 @@ public:
* Move ("warp") the mouse cursor to the specified position in virtual
* screen coordinates.
* @param x the new x position of the mouse
- * @param y the new x position of the mouse
+ * @param y the new y position of the mouse
*/
virtual void warpMouse(int x, int y) = 0;
@@ -727,8 +727,12 @@ public:
/** Delay/sleep for the specified amount of milliseconds. */
virtual void delayMillis(uint msecs) = 0;
- /** Get the current time and date. Correspond to time()+localtime(). */
- virtual void getTimeAndDate(struct tm &t) const;
+ /**
+ * Get the current time and date, in the local timezone.
+ * Corresponds on many systems to the combination of time()
+ * and localtime().
+ */
+ virtual void getTimeAndDate(struct tm &t) const = 0;
/**
* Return the timer manager singleton. For more information, refer
diff --git a/common/unarj.cpp b/common/unarj.cpp
new file mode 100644
index 0000000000..f3ac20c285
--- /dev/null
+++ b/common/unarj.cpp
@@ -0,0 +1,701 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+// Heavily based on Unarj 2.65
+
+/* UNARJ.C, UNARJ, R JUNG, 06/05/02
+ * Main Extractor routine
+ * Copyright (c) 1991-2002 by ARJ Software, Inc. All rights reserved.
+ *
+ * This code may be freely used in programs that are NOT ARJ archivers
+ * (both compress and extract ARJ archives).
+ *
+ * If you wish to distribute a modified version of this program, you
+ * MUST indicate that it is a modified version both in the program and
+ * source code.
+ *
+ * We are holding the copyright on the source code, so please do not
+ * delete our name from the program files or from the documentation.
+ *
+ * We wish to give credit to Haruhiko Okumura for providing the
+ * basic ideas for ARJ and UNARJ in his program AR. Please note
+ * that UNARJ is significantly different from AR from an archive
+ * structural point of view.
+ *
+ */
+
+#include "common/scummsys.h"
+#include "common/util.h"
+#include "common/unarj.h"
+
+namespace Common {
+
+static uint32 CRCtable[256];
+
+static void InitCRC(void) {
+ const uint32 poly = 0xEDB88320;
+ int i, j;
+ uint32 n;
+
+ for (i = 0; i < 256; i++) {
+ n = i;
+ for (j = 0; j < 8; j++)
+ n = (n & 1) ? ((n >> 1) ^ poly) : (n >> 1);
+ CRCtable[i] = n;
+ }
+}
+
+static uint32 GetCRC(byte *data, int len) {
+ uint32 CRC = 0xFFFFFFFF;
+ int i;
+ for (i = 0; i < len; i++)
+ CRC = (CRC >> 8) ^ CRCtable[(CRC ^ data[i]) & 0xFF];
+ return CRC ^ 0xFFFFFFFF;
+}
+
+ArjFile::ArjFile() {
+ InitCRC();
+ _isOpen = false;
+ _fallBack = false;
+}
+
+ArjFile::~ArjFile() {
+ close();
+
+ for (uint i = 0; i < _headers.size(); i++)
+ delete _headers[i];
+
+ _headers.clear();
+ _fileMap.clear();
+ _archMap.clear();
+}
+
+void ArjFile::registerArchive(const String &filename) {
+ int32 first_hdr_pos;
+ ArjHeader *header;
+
+ if (!_currArchive.open(filename))
+ return;
+
+ first_hdr_pos = findHeader();
+
+ if (first_hdr_pos < 0) {
+ warning("ArjFile::registerArchive(): Could not find a valid header");
+ return;
+ }
+
+ _currArchive.seek(first_hdr_pos, SEEK_SET);
+ if (readHeader() == NULL)
+ return;
+
+ while ((header = readHeader()) != NULL) {
+ _headers.push_back(header);
+
+ _currArchive.seek(header->compSize, SEEK_CUR);
+
+ _fileMap[header->filename] = _headers.size() - 1;
+ _archMap[header->filename] = filename;
+ }
+
+ _currArchive.close();
+
+ debug(0, "ArjFile::registerArchive(%s): Located %d files", filename.c_str(), _headers.size());
+}
+
+int32 ArjFile::findHeader(void) {
+ long arcpos, lastpos;
+ int c;
+ byte header[HEADERSIZE_MAX];
+ uint32 crc;
+ uint16 headersize;
+
+ arcpos = _currArchive.pos();
+ _currArchive.seek(0L, SEEK_END);
+ lastpos = _currArchive.pos() - 2;
+ if (lastpos > MAXSFX)
+ lastpos = MAXSFX;
+
+ for ( ; arcpos < lastpos; arcpos++) {
+ _currArchive.seek(arcpos, SEEK_SET);
+ c = _currArchive.readByte();
+ while (arcpos < lastpos) {
+ if (c != HEADER_ID_LO) // low order first
+ c = _currArchive.readByte();
+ else if ((c = _currArchive.readByte()) == HEADER_ID_HI)
+ break;
+ arcpos++;
+ }
+ if (arcpos >= lastpos)
+ break;
+ if ((headersize = _currArchive.readUint16LE()) <= HEADERSIZE_MAX) {
+ _currArchive.read(header, headersize);
+ crc = GetCRC(header, headersize);
+ if (crc == _currArchive.readUint32LE()) {
+ _currArchive.seek(arcpos, SEEK_SET);
+ return arcpos;
+ }
+ }
+ }
+ return -1; // could not find a valid header
+}
+
+ArjHeader *ArjFile::readHeader() {
+ ArjHeader header;
+ ArjHeader *head;
+ byte headData[HEADERSIZE_MAX];
+
+ header.id = _currArchive.readUint16LE();
+ if (header.id != HEADER_ID) {
+ warning("ArjFile::readHeader(): Bad header ID (%x)", header.id);
+
+ return NULL;
+ }
+
+ header.headerSize = _currArchive.readUint16LE();
+ if (header.headerSize == 0)
+ return NULL; // end of archive
+ if (header.headerSize > HEADERSIZE_MAX) {
+ warning("ArjFile::readHeader(): Bad header");
+
+ return NULL;
+ }
+
+ int rSize = _currArchive.read(headData, header.headerSize);
+
+ MemoryReadStream readS(headData, rSize);
+
+ header.headerCrc = _currArchive.readUint32LE();
+ if (GetCRC(headData, header.headerSize) != header.headerCrc) {
+ warning("ArjFile::readHeader(): Bad header CRC");
+ return NULL;
+ }
+
+ header.firstHdrSize = readS.readByte();
+ header.nbr = readS.readByte();
+ header.xNbr = readS.readByte();
+ header.hostOs = readS.readByte();
+ header.flags = readS.readByte();
+ header.method = readS.readByte();
+ header.fileType = readS.readByte();
+ (void)readS.readByte();
+ header.timeStamp = readS.readUint32LE();
+ header.compSize = readS.readSint32LE();
+ header.origSize = readS.readSint32LE();
+ header.fileCRC = readS.readUint32LE();
+ header.entryPos = readS.readUint16LE();
+ header.fileMode = readS.readUint16LE();
+ header.hostData = readS.readUint16LE();
+
+ if (header.origSize < 0 || header.compSize < 0) {
+ warning("ArjFile::readHeader(): Wrong file size");
+ return NULL;
+ }
+
+ strncpy(header.filename, (const char *)&headData[header.firstHdrSize], FNAME_MAX);
+
+ strncpy(header.comment, (const char *)&headData[header.firstHdrSize + strlen(header.filename) + 1], COMMENT_MAX);
+
+ /* if extheadersize == 0 then no CRC */
+ /* otherwise read extheader data and read 4 bytes for CRC */
+
+ while ((header.extHeaderSize = _currArchive.readUint16LE()) != 0)
+ _currArchive.seek((long)(header.extHeaderSize + 4), SEEK_CUR);
+
+ header.pos = _currArchive.pos();
+
+ head = new ArjHeader(header);
+
+ return head;
+}
+
+
+bool ArjFile::open(const Common::String &filename, AccessMode mode) {
+ if (_isOpen)
+ error("Attempt to open another instance of archive");
+
+ _isOpen = false;
+
+ if (_fallBack) {
+ _currArchive.open(filename);
+ if (_currArchive.isOpen()) {
+ _isOpen = true;
+ _uncompressed = &_currArchive;
+ return true;
+ }
+ }
+
+ if (!_fileMap.contains(filename))
+ return false;
+
+ _isOpen = true;
+
+ ArjHeader *hdr = _headers[_fileMap[filename]];
+
+ _compsize = hdr->compSize;
+ _origsize = hdr->origSize;
+
+ _uncompressedData = (byte *)malloc(_origsize);
+ _outstream = new MemoryWriteStream(_uncompressedData, _origsize);
+
+ _currArchive.open(_archMap[filename]);
+ _currArchive.seek(hdr->pos, SEEK_SET);
+
+ if (hdr->method == 0) { // store
+ _currArchive.read(_uncompressedData, _origsize);
+ } else {
+ _compressedData = (byte *)malloc(_compsize);
+ _currArchive.read(_compressedData, _compsize);
+
+ _compressed = new MemoryReadStream(_compressedData, _compsize);
+
+ if (hdr->method == 1 || hdr->method == 2 || hdr->method == 3)
+ decode();
+ else if (hdr->method == 4)
+ decode_f();
+
+ delete _compressed;
+ free(_compressedData);
+ }
+
+ _currArchive.close();
+ delete _outstream;
+ _outstream = NULL;
+
+ _uncompressed = new MemoryReadStream(_uncompressedData, _origsize);
+
+ return true;
+}
+
+void ArjFile::close() {
+ if (!_isOpen)
+ return;
+
+ _isOpen = false;
+
+ if (_fallBack) {
+ _currArchive.close();
+ return;
+ } else {
+ delete _uncompressed;
+ }
+
+ _uncompressed = NULL;
+
+ free(_uncompressedData);
+ _uncompressedData = NULL;
+}
+
+uint32 ArjFile::read(void *dataPtr, uint32 dataSize) {
+ return _uncompressed->read(dataPtr, dataSize);
+}
+
+bool ArjFile::eos() {
+ return _uncompressed->eos();
+}
+
+uint32 ArjFile::pos() {
+ return _uncompressed->pos();
+}
+
+uint32 ArjFile::size() {
+ return _uncompressed->size();
+}
+
+void ArjFile::seek(int32 offset, int whence) {
+ _uncompressed->seek(offset, whence);
+}
+
+void ArjFile::init_getbits() {
+ _bitbuf = 0;
+ _subbitbuf = 0;
+ _bitcount = 0;
+ fillbuf(2 * CHAR_BIT);
+}
+
+void ArjFile::fillbuf(int n) { // Shift bitbuf n bits left, read n bits
+ _bitbuf = (_bitbuf << n) & 0xFFFF; /* lose the first n bits */
+ while (n > _bitcount) {
+ _bitbuf |= _subbitbuf << (n -= _bitcount);
+ if (_compsize != 0) {
+ _compsize--;
+ _subbitbuf = _compressed->readByte();
+ } else
+ _subbitbuf = 0;
+ _bitcount = CHAR_BIT;
+ }
+ _bitbuf |= _subbitbuf >> (_bitcount -= n);
+}
+
+uint16 ArjFile::getbits(int n) {
+ uint16 x;
+
+ x = _bitbuf >> (2 * CHAR_BIT - n);
+ fillbuf(n);
+ return x;
+}
+
+
+
+/* Huffman decode routines */
+
+void ArjFile::make_table(int nchar, byte *bitlen, int tablebits, uint16 *table, int tablesize) {
+ uint16 count[17], weight[17], start[18], *p;
+ uint i, k, len, ch, jutbits, avail, nextcode, mask;
+
+ for (i = 1; i <= 16; i++)
+ count[i] = 0;
+ for (i = 0; (int)i < nchar; i++)
+ count[bitlen[i]]++;
+
+ start[1] = 0;
+ for (i = 1; i <= 16; i++)
+ start[i + 1] = start[i] + (count[i] << (16 - i));
+ if (start[17] != (uint16) (1 << 16))
+ error("ArjFile::make_table(): bad file data");
+
+ jutbits = 16 - tablebits;
+ for (i = 1; (int)i <= tablebits; i++) {
+ start[i] >>= jutbits;
+ weight[i] = 1 << (tablebits - i);
+ }
+ while (i <= 16) {
+ weight[i] = 1 << (16 - i);
+ i++;
+ }
+
+ i = start[tablebits + 1] >> jutbits;
+ if (i != (uint16) (1 << 16)) {
+ k = 1 << tablebits;
+ while (i != k)
+ table[i++] = 0;
+ }
+
+ avail = nchar;
+ mask = 1 << (15 - tablebits);
+ for (ch = 0; (int)ch < nchar; ch++) {
+ if ((len = bitlen[ch]) == 0)
+ continue;
+ k = start[len];
+ nextcode = k + weight[len];
+ if ((int)len <= tablebits) {
+ if (nextcode > (uint)tablesize)
+ error("ArjFile::make_table(): bad file data");
+ for (i = start[len]; i < nextcode; i++)
+ table[i] = ch;
+ } else {
+ p = &table[k >> jutbits];
+ i = len - tablebits;
+ while (i != 0) {
+ if (*p == 0) {
+ _right[avail] = _left[avail] = 0;
+ *p = avail++;
+ }
+ if (k & mask)
+ p = &_right[*p];
+ else
+ p = &_left[*p];
+ k <<= 1;
+ i--;
+ }
+ *p = ch;
+ }
+ start[len] = nextcode;
+ }
+}
+
+void ArjFile::read_pt_len(int nn, int nbit, int i_special) {
+ int i, n;
+ int16 c;
+ uint16 mask;
+
+ n = getbits(nbit);
+ if (n == 0) {
+ c = getbits(nbit);
+ for (i = 0; i < nn; i++)
+ _pt_len[i] = 0;
+ for (i = 0; i < 256; i++)
+ _pt_table[i] = c;
+ } else {
+ i = 0;
+ while (i < n) {
+ c = _bitbuf >> (13);
+ if (c == 7) {
+ mask = 1 << (12);
+ while (mask & _bitbuf) {
+ mask >>= 1;
+ c++;
+ }
+ }
+ fillbuf((c < 7) ? 3 : (int)(c - 3));
+ _pt_len[i++] = (byte)c;
+ if (i == i_special) {
+ c = getbits(2);
+ while (--c >= 0)
+ _pt_len[i++] = 0;
+ }
+ }
+ while (i < nn)
+ _pt_len[i++] = 0;
+ make_table(nn, _pt_len, 8, _pt_table, PTABLESIZE); // replaced sizeof
+ }
+}
+
+void ArjFile::read_c_len() {
+ int16 i, c, n;
+ uint16 mask;
+
+ n = getbits(CBIT);
+ if (n == 0) {
+ c = getbits(CBIT);
+ for (i = 0; i < NC; i++)
+ _c_len[i] = 0;
+ for (i = 0; i < CTABLESIZE; i++)
+ _c_table[i] = c;
+ } else {
+ i = 0;
+ while (i < n) {
+ c = _pt_table[_bitbuf >> (8)];
+ if (c >= NT) {
+ mask = 1 << (7);
+ do {
+ if (_bitbuf & mask)
+ c = _right[c];
+ else
+ c = _left[c];
+ mask >>= 1;
+ } while (c >= NT);
+ }
+ fillbuf((int)(_pt_len[c]));
+ if (c <= 2) {
+ if (c == 0)
+ c = 1;
+ else if (c == 1)
+ c = getbits(4) + 3;
+ else
+ c = getbits(CBIT) + 20;
+ while (--c >= 0)
+ _c_len[i++] = 0;
+ }
+ else
+ _c_len[i++] = (byte)(c - 2);
+ }
+ while (i < NC)
+ _c_len[i++] = 0;
+ make_table(NC, _c_len, 12, _c_table, CTABLESIZE); // replaced sizeof
+ }
+}
+
+uint16 ArjFile::decode_c() {
+ uint16 j, mask;
+
+ if (_blocksize == 0) {
+ _blocksize = getbits(16);
+ read_pt_len(NT, TBIT, 3);
+ read_c_len();
+ read_pt_len(NP, PBIT, -1);
+ }
+ _blocksize--;
+ j = _c_table[_bitbuf >> 4];
+ if (j >= NC) {
+ mask = 1 << (3);
+ do {
+ if (_bitbuf & mask)
+ j = _right[j];
+ else
+ j = _left[j];
+ mask >>= 1;
+ } while (j >= NC);
+ }
+ fillbuf((int)(_c_len[j]));
+ return j;
+}
+
+uint16 ArjFile::decode_p() {
+ uint16 j, mask;
+
+ j = _pt_table[_bitbuf >> (8)];
+ if (j >= NP) {
+ mask = 1 << (7);
+ do {
+ if (_bitbuf & mask)
+ j = _right[j];
+ else
+ j = _left[j];
+ mask >>= 1;
+ } while (j >= NP);
+ }
+ fillbuf((int)(_pt_len[j]));
+ if (j != 0) {
+ j--;
+ j = (1 << j) + getbits((int)j);
+ }
+ return j;
+}
+
+void ArjFile::decode_start() {
+ _blocksize = 0;
+ init_getbits();
+}
+
+void ArjFile::decode() {
+ int16 i;
+ int16 j;
+ int16 c;
+ int16 r;
+ int32 count;
+
+ decode_start();
+ count = 0;
+ r = 0;
+
+ while (count < _origsize) {
+ if ((c = decode_c()) <= ARJ_UCHAR_MAX) {
+ _text[r] = (byte) c;
+ count++;
+ if (++r >= DDICSIZ) {
+ r = 0;
+ _outstream->write(_text, DDICSIZ);
+ }
+ } else {
+ j = c - (ARJ_UCHAR_MAX + 1 - THRESHOLD);
+ count += j;
+ i = decode_p();
+ if ((i = r - i - 1) < 0)
+ i += DDICSIZ;
+ if (r > i && r < DDICSIZ - MAXMATCH - 1) {
+ while (--j >= 0)
+ _text[r++] = _text[i++];
+ } else {
+ while (--j >= 0) {
+ _text[r] = _text[i];
+ if (++r >= DDICSIZ) {
+ r = 0;
+ _outstream->write(_text, DDICSIZ);
+ }
+ if (++i >= DDICSIZ)
+ i = 0;
+ }
+ }
+ }
+ }
+ if (r != 0)
+ _outstream->write(_text, r);
+}
+
+/* Macros */
+
+#define BFIL {_getbuf|=_bitbuf>>_getlen;fillbuf(CODE_BIT-_getlen);_getlen=CODE_BIT;}
+#define GETBIT(c) {if(_getlen<=0)BFIL c=(_getbuf&0x8000)!=0;_getbuf<<=1;_getlen--;}
+#define BPUL(l) {_getbuf<<=l;_getlen-=l;}
+#define GETBITS(c,l) {if(_getlen<l)BFIL c=(uint16)_getbuf>>(CODE_BIT-l);BPUL(l)}
+
+int16 ArjFile::decode_ptr() {
+ int16 c = 0;
+ int16 width;
+ int16 plus;
+ int16 pwr;
+
+ plus = 0;
+ pwr = 1 << (STRTP);
+ for (width = (STRTP); width < (STOPP); width++) {
+ GETBIT(c);
+ if (c == 0)
+ break;
+ plus += pwr;
+ pwr <<= 1;
+ }
+ if (width != 0)
+ GETBITS(c, width);
+ c += plus;
+ return c;
+}
+
+int16 ArjFile::decode_len() {
+ int16 c = 0;
+ int16 width;
+ int16 plus;
+ int16 pwr;
+
+ plus = 0;
+ pwr = 1 << (STRTL);
+ for (width = (STRTL); width < (STOPL); width++) {
+ GETBIT(c);
+ if (c == 0)
+ break;
+ plus += pwr;
+ pwr <<= 1;
+ }
+ if (width != 0)
+ GETBITS(c, width);
+ c += plus;
+ return c;
+}
+
+void ArjFile::decode_f() {
+ int16 i;
+ int16 j;
+ int16 c;
+ int16 r;
+ int16 pos1;
+ int32 count;
+
+ init_getbits();
+ _getlen = _getbuf = 0;
+ count = 0;
+ r = 0;
+
+ while (count < _origsize) {
+ c = decode_len();
+ if (c == 0) {
+ GETBITS(c, CHAR_BIT);
+ _text[r] = (byte)c;
+ count++;
+ if (++r >= DDICSIZ) {
+ r = 0;
+ _outstream->write(_text, DDICSIZ);
+ }
+ } else {
+ j = c - 1 + THRESHOLD;
+ count += j;
+ pos1 = decode_ptr();
+ if ((i = r - pos1 - 1) < 0)
+ i += DDICSIZ;
+ while (j-- > 0) {
+ _text[r] = _text[i];
+ if (++r >= DDICSIZ) {
+ r = 0;
+ _outstream->write(_text, DDICSIZ);
+ }
+ if (++i >= DDICSIZ)
+ i = 0;
+ }
+ }
+ }
+ if (r != 0)
+ _outstream->write(_text, r);
+}
+
+
+} // End of namespace Common
diff --git a/common/unarj.h b/common/unarj.h
new file mode 100644
index 0000000000..b015999671
--- /dev/null
+++ b/common/unarj.h
@@ -0,0 +1,185 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#ifndef COMMON_UNARJ_H
+#define COMMON_UNARJ_H
+
+#include "common/file.h"
+#include "common/hash-str.h"
+
+namespace Common {
+
+#define HEADER_ID 0xEA60
+#define HEADER_ID_HI 0xEA
+#define HEADER_ID_LO 0x60
+#define FIRST_HDR_SIZE 30
+#define FIRST_HDR_SIZE_V 34
+#define COMMENT_MAX 2048
+#define FNAME_MAX 512
+#define HEADERSIZE_MAX (FIRST_HDR_SIZE + 10 + FNAME_MAX + COMMENT_MAX)
+#define CRC_MASK 0xFFFFFFFFL
+#define MAXSFX 25000L
+
+#define CODE_BIT 16
+#define CHAR_BIT 8
+#define ARJ_UCHAR_MAX 255 // UCHAR_MAX is defined in limits.h in MSVC
+#define THRESHOLD 3
+#define DDICSIZ 26624
+#define MAXDICBIT 16
+#define MATCHBIT 8
+#define MAXMATCH 256
+#define NC (ARJ_UCHAR_MAX + MAXMATCH + 2 - THRESHOLD)
+#define NP (MAXDICBIT + 1)
+#define CBIT 9
+#define NT (CODE_BIT + 3)
+#define PBIT 5
+#define TBIT 5
+
+#if NT > NP
+#define NPT NT
+#else
+#define NPT NP
+#endif
+
+#define CTABLESIZE 4096
+#define PTABLESIZE 256
+
+#define STRTP 9
+#define STOPP 13
+
+#define STRTL 0
+#define STOPL 7
+
+struct ArjHeader {
+ int32 pos;
+ uint16 id;
+ uint16 headerSize;
+ //
+ byte firstHdrSize;
+ byte nbr;
+ byte xNbr;
+ byte hostOs;
+ byte flags;
+ byte method;
+ byte fileType;
+ byte pad;
+ uint32 timeStamp;
+ int32 compSize;
+ int32 origSize;
+ uint32 fileCRC;
+ uint16 entryPos;
+ uint16 fileMode;
+ uint16 hostData;
+ char filename[FNAME_MAX];
+ char comment[COMMENT_MAX];
+ uint16 extHeaderSize;
+
+ uint32 headerCrc;
+};
+
+typedef HashMap<String, int, IgnoreCase_Hash, IgnoreCase_EqualTo> ArjFilesMap;
+
+class ArjFile : public File {
+public:
+ ArjFile();
+ ~ArjFile();
+
+ void enableFallback(bool val) { _fallBack = val; }
+
+ void registerArchive(const String &filename);
+
+ bool open(const Common::String &filename, AccessMode mode = kFileReadMode);
+ void close();
+
+ uint32 read(void *dataPtr, uint32 dataSize);
+ bool eos();
+ uint32 pos();
+ uint32 size();
+ void seek(int32 offset, int whence = SEEK_SET);
+ bool isOpen() { return _isOpen; }
+
+private:
+ bool _fallBack;
+
+ File _currArchive;
+ Array<ArjHeader *> _headers;
+ ArjFilesMap _fileMap;
+ StringMap _archMap;
+ ReadStream *_stream;
+ byte *_uncompressedData;
+ byte *_compressedData;
+ MemoryWriteStream *_outstream;
+ MemoryReadStream *_compressed;
+ SeekableReadStream *_uncompressed;
+
+ bool _isOpen;
+
+ int32 findHeader(void);
+ ArjHeader *readHeader();
+
+ void decode();
+ void decode_f();
+
+ uint16 _bitbuf;
+ int32 _compsize;
+ int32 _origsize;
+ byte _subbitbuf;
+ int _bitcount;
+
+ void init_getbits();
+ void fillbuf(int n);
+ uint16 getbits(int n);
+
+
+ void make_table(int nchar, byte *bitlen, int tablebits, uint16 *table, int tablesize);
+ void read_pt_len(int nn, int nbit, int i_special);
+ void read_c_len(void);
+ uint16 decode_c(void);
+ uint16 decode_p(void);
+ void decode_start(void);
+ int16 decode_ptr(void);
+ int16 decode_len(void);
+
+private:
+ byte _text[DDICSIZ];
+
+ int16 _getlen;
+ int16 _getbuf;
+
+ uint16 _left[2 * NC - 1];
+ uint16 _right[2 * NC - 1];
+ byte _c_len[NC];
+ byte _pt_len[NPT];
+
+ uint16 _c_table[CTABLESIZE];
+ uint16 _pt_table[PTABLESIZE];
+ uint16 _blocksize;
+
+
+};
+
+} // End of namespace Common
+
+#endif
diff --git a/common/util.cpp b/common/util.cpp
index 1f48a6ddd9..6f0fdcb233 100644
--- a/common/util.cpp
+++ b/common/util.cpp
@@ -394,18 +394,40 @@ const char *getRenderModeDescription(RenderMode id) {
#pragma mark -
-static Array<EngineDebugLevel> gDebugLevels;
-static uint32 gDebugLevelsEnabled = 0;
+namespace {
+
+DebugLevelContainer gDebugLevels;
+uint32 gDebugLevelsEnabled = 0;
+
+struct DebugLevelSort {
+ bool operator()(const EngineDebugLevel &l, const EngineDebugLevel &r) {
+ return (l.option.compareToIgnoreCase(r.option) < 0);
+ }
+};
+
+struct DebugLevelSearch {
+ const String &_option;
+
+ DebugLevelSearch(const String &option) : _option(option) {}
+
+ bool operator()(const EngineDebugLevel &l) {
+ return _option.equalsIgnoreCase(l.option);
+ }
+};
+
+}
bool addSpecialDebugLevel(uint32 level, const String &option, const String &description) {
- for (uint i = 0; i < gDebugLevels.size(); ++i) {
- if (!scumm_stricmp(option.c_str(), gDebugLevels[i].option.c_str())) {
- warning("Declared engine debug level '%s' again", option.c_str());
- gDebugLevels[i] = EngineDebugLevel(level, option, description);
- return true;
- }
+ DebugLevelContainer::iterator i = find_if(gDebugLevels.begin(), gDebugLevels.end(), DebugLevelSearch(option));
+
+ if (i != gDebugLevels.end()) {
+ warning("Declared engine debug level '%s' again", option.c_str());
+ *i = EngineDebugLevel(level, option, description);
+ } else {
+ gDebugLevels.push_back(EngineDebugLevel(level, option, description));
+ sort(gDebugLevels.begin(), gDebugLevels.end(), DebugLevelSort());
}
- gDebugLevels.push_back(EngineDebugLevel(level, option, description));
+
return true;
}
@@ -415,43 +437,43 @@ void clearAllSpecialDebugLevels() {
}
bool enableSpecialDebugLevel(const String &option) {
- for (uint i = 0; i < gDebugLevels.size(); ++i) {
- if (!scumm_stricmp(option.c_str(), gDebugLevels[i].option.c_str())) {
- gDebugLevelsEnabled |= gDebugLevels[i].level;
- gDebugLevels[i].enabled = true;
- return true;
- }
+ DebugLevelContainer::iterator i = find_if(gDebugLevels.begin(), gDebugLevels.end(), DebugLevelSearch(option));
+
+ if (i != gDebugLevels.end()) {
+ gDebugLevelsEnabled |= i->level;
+ i->enabled = true;
+
+ return true;
+ } else {
+ return false;
}
- return false;
}
void enableSpecialDebugLevelList(const String &option) {
- uint start = 0;
- uint end = 0;
-
- const char *str = option.c_str();
- for (end = start + 1; end <= option.size(); ++end) {
- if (str[end] == ',' || end == option.size()) {
- if (!enableSpecialDebugLevel(Common::String(&str[start], end-start))) {
- warning("Engine does not support debug level '%s'", Common::String(&str[start], end-start).c_str());
- }
- start = end + 1;
- }
+ StringTokenizer tokenizer(option, " ,");
+ String token;
+
+ while (!tokenizer.empty()) {
+ token = tokenizer.nextToken();
+ if (!enableSpecialDebugLevel(token))
+ warning("Engine does not support debug level '%s'", token.c_str());
}
}
bool disableSpecialDebugLevel(const String &option) {
- for (uint i = 0; i < gDebugLevels.size(); ++i) {
- if (!scumm_stricmp(option.c_str(), gDebugLevels[i].option.c_str())) {
- gDebugLevelsEnabled &= ~gDebugLevels[i].level;
- gDebugLevels[i].enabled = false;
- return true;
- }
+ DebugLevelContainer::iterator i = find_if(gDebugLevels.begin(), gDebugLevels.end(), DebugLevelSearch(option));
+
+ if (i != gDebugLevels.end()) {
+ gDebugLevelsEnabled &= ~i->level;
+ i->enabled = false;
+
+ return true;
+ } else {
+ return false;
}
- return false;
}
-const Array<EngineDebugLevel> &listSpecialDebugLevels() {
+const DebugLevelContainer &listSpecialDebugLevels() {
return gDebugLevels;
}
@@ -578,14 +600,8 @@ void NORETURN CDECL error(const char *s, ...) {
// Print the error message to stderr
-#ifdef __GP32__
- printf("ERROR: %s\n", buf_output);
-#else
fprintf(stderr, "%s!\n", buf_output);
-#endif
-
-#ifndef __GP32__
// Unless this error -originated- within the debugger itself, we
// now invoke the debugger, if available / supported.
if (g_engine) {
@@ -599,7 +615,6 @@ void NORETURN CDECL error(const char *s, ...) {
debugger->onFrame();
}
}
-#endif
#if defined( USE_WINDBG )
@@ -641,13 +656,10 @@ void CDECL warning(const char *s, ...) {
vsnprintf(buf, STRINGBUFLEN, s, va);
va_end(va);
-#ifdef __GP32__ //ph0x FIXME: implement fprint?
- printf("WARNING: %s\n", buf);
-#else
#if !defined (__SYMBIAN32__)
fprintf(stderr, "WARNING: %s!\n", buf);
#endif
-#endif
+
#if defined( USE_WINDBG )
strcat(buf, "\n");
#if defined( _WIN32_WCE )
diff --git a/common/util.h b/common/util.h
index 1f680d28c1..c23513596c 100644
--- a/common/util.h
+++ b/common/util.h
@@ -27,7 +27,7 @@
#include "common/scummsys.h"
#include "common/str.h"
-#include "common/array.h"
+#include "common/list.h"
#ifdef MIN
#undef MIN
@@ -308,11 +308,13 @@ void enableSpecialDebugLevelList(const String &option);
*/
bool disableSpecialDebugLevel(const String &option);
+typedef List<EngineDebugLevel> DebugLevelContainer;
+
/**
* Lists all debug levels
* @return returns a arry with all debug levels
*/
-const Array<EngineDebugLevel> &listSpecialDebugLevels();
+const DebugLevelContainer &listSpecialDebugLevels();
/**
* Return the active debug flag mask (i.e. all active debug flags ORed
diff --git a/configure b/configure
index d71501098a..99da4e0478 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# configue -- custom configure script for ScummVM.
+# configure -- custom configure script for ScummVM.
#
# ScummVM is the legal property of its developers, whose names
# are too numerous to list here. Please refer to the COPYRIGHT
@@ -125,9 +125,12 @@ _prefix=/usr/local
_srcdir=`dirname $0`
-# TODO: We should really use mktemp(1) to determine a random tmp file name.
-# However, that tool might not be available everywhere.
-TMPO=${_srcdir}/scummvm-conf
+# Determine a tmp file name, using mktemp(1) when available.
+if type mktemp > /dev/null 2>&1 ; then
+ TMPO=`mktemp`
+else
+ TMPO=${_srcdir}/scummvm-conf
+fi
TMPC=${TMPO}.cpp
TMPLOG=${_srcdir}/config.log
@@ -159,7 +162,7 @@ add_line_to_config_mk() {
'"$1"
}
-# Add a line of data to h.mk.
+# Add a line of data to config.h.
add_line_to_config_h() {
_config_h_data="$_config_h_data"'
'"$1"
@@ -218,7 +221,7 @@ if test -n "$_host"; then
# In cross-compiling mode, we cannot run the result
eval "$1 $CXXFLAGS $LDFLAGS -o tmp_cxx_compiler$EXEEXT tmp_cxx_compiler.cpp" 2> /dev/null && rm -f tmp_cxx_compiler$EXEEXT tmp_cxx_compiler.cpp
else
- eval "$1 $CXXFLAGS $LDFLAGS -o tmp_cxx_compiler$EXEEXT tmp_cxx_compiler.cpp" 2> /dev/null && eval "./tmp_cxx_compiler 2> /dev/null" && rm -f tmp_cxx_compiler$EXEEXT tmp_cxx_compiler.cpp
+ eval "$1 $CXXFLAGS $LDFLAGS -o tmp_cxx_compiler$EXEEXT tmp_cxx_compiler.cpp" 2> /dev/null && eval "./tmp_cxx_compiler$EXEEXT 2> /dev/null" && rm -f tmp_cxx_compiler$EXEEXT tmp_cxx_compiler.cpp
fi
}
@@ -373,8 +376,15 @@ engine_enable() {
opt=yes
fi
engine=`echo $eng | sed 's/-/_/g'`
+
+ # Filter the parameter for the subengines
+ if test "`get_engine_sub ${engine}`" != "no" -a "$opt" != "yes" ; then
+ option_error
+ return
+ fi
+
if test "$opt" = "static" -o "$opt" = "dynamic" -o "$opt" = "yes" ; then
- if test "`get_engine_build ${engine}`" != "$opt" ; then
+ if test "`get_engine_name ${engine}`" != "" ; then
eval _engine_${engine}_build=$opt
else
option_error
@@ -386,8 +396,14 @@ engine_enable() {
# Disable the given engine
engine_disable() {
+ # Filter malformed options
+ if ( echo $1 | grep '=' ) 2> /dev/null > /dev/null ; then
+ option_error
+ return
+ fi
+
engine=`echo $1 | sed 's/-/_/g'`
- if test "`get_engine_build $engine`" != "no" ; then
+ if test "`get_engine_name ${engine}`" != "" ; then
eval _engine_${engine}_build=no
else
option_error
@@ -453,33 +469,38 @@ prepare_engine_build_strings() {
get_engine_build_string() {
engine_string=""
engine_build=`get_engine_build $1`
- if test $engine_build = no ; then
- # The engine is disabled
+ show=no
+
+ # Check if the current engine should be shown for the current status
+ if test $engine_build = $2 ; then
+ show=yes
+ else
+ # Test for disabled sub-engines
if test $2 = no ; then
- engine_string=`get_engine_name $1`
- else
- engine_string=""
+ for subeng in `get_engine_subengines $1` ; do
+ if test `get_engine_build $subeng` = no ; then
+ engine_build=no
+ show=yes
+ fi
+ done
fi
- else
- # The engine is enabled, get the custom string
+ fi
+
+ # Convert static/dynamic to yes to ease the check of subengines
+ if test $engine_build != no ; then
+ engine_build=yes
+ fi
+
+ # The engine should be shown, build the string
+ if test $show = yes ; then
build_string_func=get_${1}_build_string
if ( type $build_string_func | grep function ) 2> /dev/null > /dev/null ; then
- engine_string=`$build_string_func $1 $2`
+ engine_string=`$build_string_func $1 $engine_build`
else
- engine_string=`get_subengines_build_string $1 $2`
+ engine_string=`get_subengines_build_string $1 $engine_build`
fi
- if test $2 = no ; then
- if test -n "$engine_string" ; then
- engine_string="`get_engine_name $1` $engine_string"
- fi
- else
- if test $2 = $engine_build ; then
- engine_string="`get_engine_name $1` $engine_string"
- else
- engine_string=""
- fi
- fi
+ engine_string="`get_engine_name $1` $engine_string"
fi
echo $engine_string
@@ -523,10 +544,12 @@ get_sword2_build_string() {
}
get_scumm_build_string() {
- if test $2 != no ; then
- base="[v0-v6 games]"
+ if test `get_engine_build $1` != no ; then
+ if test $2 != no ; then
+ base="[v0-v6 games]"
+ fi
+ get_subengines_build_string $1 $2 "$base"
fi
- get_subengines_build_string $1 $2 "$base"
}
#
@@ -559,7 +582,7 @@ Usage: $0 [OPTIONS]...
Configuration:
-h, --help display this help and exit
- --backend=BACKEND backend to build (sdl, x11, morphos, dc, gp32, gp2x, iphone, null) [sdl]
+ --backend=BACKEND backend to build (sdl, x11, morphos, dc, gp2x, iphone, null) [sdl]
Installation directories:
--prefix=DIR use this prefix for installing ScummVM [/usr/local]
@@ -923,6 +946,12 @@ if test "$_cxx_major" -ge "3" ; then
add_line_to_config_mk 'HAVE_GCC3 = 1'
fi;
+if test "$_cxx_major" -ge "4" && test "$_cxx_minor" -ge "3" ; then
+ CXXFLAGS="$CXXFLAGS -Wno-parentheses -Wno-empty-body"
+else
+ CXXFLAGS="$CXXFLAGS -Wconversion"
+fi;
+
add_to_config_mk_if_no $_build_hq_scalers 'DISABLE_HQ_SCALERS = 1'
add_to_config_mk_if_no $_build_scalers 'DISABLE_SCALERS = 1'
@@ -1061,9 +1090,9 @@ if test -n "$_host"; then
type_2_byte='short'
type_4_byte='int'
;;
- arm-linux|arm-linux-gnueabi|arm-*-linux-gnueabi)
+ arm-linux|arm*-linux-gnueabi|arm-*-linux|*-angstrom-linux)
echo "Cross-compiling to $_host, forcing endianness, alignment and type sizes"
- DEFINES="$DEFINES -DUNIX -DUSE_ARM_SOUND_ASM -DUSE_ARM_SMUSH_ASM"
+ DEFINES="$DEFINES -DUNIX -DUSE_ARM_SMUSH_ASM"
#not true for all ARM systems, but the interesting ones are all LE. Most (if not all) BE arm devices don't have a screen
_endian=little
_need_memalign=yes
@@ -1078,7 +1107,7 @@ if test -n "$_host"; then
;;
gp2x)
echo "Cross-compiling to $_host, forcing endianness, alignment and type sizes"
- DEFINES="$DEFINES -DUNIX -DGP2X -DUSE_ARM_SOUND_ASM -DUSE_ARM_SMUSH_ASM"
+ DEFINES="$DEFINES -DUNIX -DGP2X -DUSE_ARM_SMUSH_ASM"
_endian=little
_need_memalign=yes
type_1_byte='char'
@@ -1087,7 +1116,6 @@ if test -n "$_host"; then
add_line_to_config_mk 'USE_ARM_SOUND_ASM = 1'
add_line_to_config_mk 'USE_ARM_SMUSH_ASM = 1'
_backend="gp2x"
- _mak_hq_scalers='DISABLE_HQ_SCALERS = 1'
_build_hq_scalers="no"
;;
ppc-amigaos)
@@ -1125,7 +1153,7 @@ if test -n "$_host"; then
;;
iphone)
echo "Cross-compiling to $_host, forcing endianness, alignment and type sizes"
- DEFINES="$DEFINES -DIPHONE -DUNIX -DUSE_ARM_SOUND_ASM -DUSE_ARM_SMUSH_ASM"
+ DEFINES="$DEFINES -DIPHONE -DUNIX -DUSE_ARM_SMUSH_ASM"
_endian=little
_need_memalign=yes
type_1_byte='char'
@@ -1134,7 +1162,6 @@ if test -n "$_host"; then
add_line_to_config_mk 'USE_ARM_SOUND_ASM = 1'
add_line_to_config_mk 'USE_ARM_SMUSH_ASM = 1'
_backend="iphone"
- _mak_hq_scalers='DISABLE_HQ_SCALERS = 1'
_build_hq_scalers="no"
;;
*)
@@ -1185,7 +1212,7 @@ int main(int argc, char **argv)
}
EOF
_need_memalign=yes
- cc_check && $TMPO && _need_memalign=no
+ cc_check && $TMPO$EXEEXT && _need_memalign=no
;;
esac
echo "$_need_memalign"
@@ -1287,7 +1314,7 @@ PLUGIN_PREFIX :=
PLUGIN_SUFFIX := .dll
PLUGIN_EXTRA_DEPS = $(EXECUTABLE)
CXXFLAGS += -DDYNAMIC_MODULES
-PLUGIN_LDFLAGS := -shared ./libscummvm.a
+PLUGIN_LDFLAGS := -Wl,--enable-auto-import -shared ./libscummvm.a
PRE_OBJS_FLAGS := -Wl,--whole-archive
POST_OBJS_FLAGS := -Wl,--export-all-symbols -Wl,--no-whole-archive -Wl,--out-implib,./libscummvm.a
'
@@ -1494,7 +1521,7 @@ EOF
# don't execute while cross compiling
cc_check $LDFLAGS $CXXFLAGS $MPEG2_CFLAGS $MPEG2_LIBS -lmpeg2 && _mpeg2=yes
else
- cc_check $LDFLAGS $CXXFLAGS $MPEG2_CFLAGS $MPEG2_LIBS -lmpeg2 && $TMPO && _mpeg2=yes
+ cc_check $LDFLAGS $CXXFLAGS $MPEG2_CFLAGS $MPEG2_LIBS -lmpeg2 && $TMPO$EXEEXT && _mpeg2=yes
fi
fi
if test "$_mpeg2" = yes ; then
diff --git a/dists/engine-data/drascula.dat b/dists/engine-data/drascula.dat
new file mode 100644
index 0000000000..321e63c277
--- /dev/null
+++ b/dists/engine-data/drascula.dat
Binary files differ
diff --git a/dists/engine-data/kyra.dat b/dists/engine-data/kyra.dat
index ddf13e1e5c..7171707e8b 100644
--- a/dists/engine-data/kyra.dat
+++ b/dists/engine-data/kyra.dat
Binary files differ
diff --git a/dists/msvc7/cruise.vcproj b/dists/msvc7/cruise.vcproj
index d34f910c0d..bac134e02c 100644
--- a/dists/msvc7/cruise.vcproj
+++ b/dists/msvc7/cruise.vcproj
@@ -244,12 +244,6 @@
RelativePath="..\..\engines\cruise\stack.h">
</File>
<File
- RelativePath="..\..\engines\cruise\stringSupport.cpp">
- </File>
- <File
- RelativePath="..\..\engines\cruise\stringSupport.h">
- </File>
- <File
RelativePath="..\..\engines\cruise\various.cpp">
</File>
<File
diff --git a/dists/msvc7/drascula.vcproj b/dists/msvc7/drascula.vcproj
index 8a55a1856b..2d23296dbc 100644
--- a/dists/msvc7/drascula.vcproj
+++ b/dists/msvc7/drascula.vcproj
@@ -97,9 +97,15 @@
</Configurations>
<Files>
<File
+ RelativePath="..\..\engines\drascula\actors.cpp">
+ </File>
+ <File
RelativePath="..\..\engines\drascula\animation.cpp">
</File>
<File
+ RelativePath="..\..\engines\drascula\converse.cpp">
+ </File>
+ <File
RelativePath="..\..\engines\drascula\detection.cpp">
</File>
<File
@@ -109,13 +115,28 @@
RelativePath="..\..\engines\drascula\drascula.h">
</File>
<File
+ RelativePath="..\..\engines\drascula\graphics.cpp">
+ </File>
+ <File
+ RelativePath="..\..\engines\drascula\interface.cpp">
+ </File>
+ <File
+ RelativePath="..\..\engines\drascula\objects.cpp">
+ </File>
+ <File
+ RelativePath="..\..\engines\drascula\palette.cpp">
+ </File>
+ <File
RelativePath="..\..\engines\drascula\rooms.cpp">
</File>
<File
- RelativePath="..\..\engines\drascula\talk.cpp">
+ RelativePath="..\..\engines\drascula\saveload.cpp">
+ </File>
+ <File
+ RelativePath="..\..\engines\drascula\sound.cpp">
</File>
<File
- RelativePath="..\..\engines\drascula\texts.cpp">
+ RelativePath="..\..\engines\drascula\talk.cpp">
</File>
</Files>
<Globals>
diff --git a/dists/msvc7/gob.vcproj b/dists/msvc7/gob.vcproj
index a8c856ce17..bb7eac35e0 100644
--- a/dists/msvc7/gob.vcproj
+++ b/dists/msvc7/gob.vcproj
@@ -96,12 +96,63 @@
</Configuration>
</Configurations>
<Files>
- <File
- RelativePath="..\..\engines\gob\cdrom.cpp">
- </File>
- <File
- RelativePath="..\..\engines\gob\cdrom.h">
- </File>
+ <Filter
+ Name="sound">
+ <File
+ RelativePath="..\..\engines\gob\sound\adlib.cpp">
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\adlib.h">
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\bgatmosphere.cpp">
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\bgatmosphere.h">
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\cdrom.cpp">
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\cdrom.h">
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\infogrames.cpp">
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\infogrames.h">
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\pcspeaker.cpp">
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\pcspeaker.h">
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\sound.cpp">
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\sound.h">
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\soundblaster.cpp">
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\soundblaster.h">
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\sounddesc.cpp">
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\sounddesc.h">
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\soundmixer.cpp">
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\soundmixer.h">
+ </File>
+ </Filter>
<File
RelativePath="..\..\engines\gob\coktelvideo.cpp">
</File>
@@ -244,12 +295,6 @@
RelativePath="..\..\engines\gob\mult_v2.cpp">
</File>
<File
- RelativePath="..\..\engines\gob\music.cpp">
- </File>
- <File
- RelativePath="..\..\engines\gob\music.h">
- </File>
- <File
RelativePath="..\..\engines\gob\palanim.cpp">
</File>
<File
@@ -280,6 +325,9 @@
RelativePath="..\..\engines\gob\saveload_v3.cpp">
</File>
<File
+ RelativePath="..\..\engines\gob\saveload_v4.cpp">
+ </File>
+ <File
RelativePath="..\..\engines\gob\scenery.cpp">
</File>
<File
@@ -292,16 +340,16 @@
RelativePath="..\..\engines\gob\scenery_v2.cpp">
</File>
<File
- RelativePath="..\..\engines\gob\sound.cpp">
+ RelativePath="..\..\engines\gob\util.cpp">
</File>
<File
- RelativePath="..\..\engines\gob\sound.h">
+ RelativePath="..\..\engines\gob\util.h">
</File>
<File
- RelativePath="..\..\engines\gob\util.cpp">
+ RelativePath="..\..\engines\gob\variables.cpp">
</File>
<File
- RelativePath="..\..\engines\gob\util.h">
+ RelativePath="..\..\engines\gob\variables.h">
</File>
<File
RelativePath="..\..\engines\gob\video.cpp">
diff --git a/dists/msvc7/kyra.vcproj b/dists/msvc7/kyra.vcproj
index decc992b81..d547288d21 100644
--- a/dists/msvc7/kyra.vcproj
+++ b/dists/msvc7/kyra.vcproj
@@ -100,13 +100,13 @@
RelativePath="..\..\engines\kyra\animator_hof.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\animator_mr.cpp">
+ RelativePath="..\..\engines\kyra\animator_lok.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\animator_v1.cpp">
+ RelativePath="..\..\engines\kyra\animator_lok.h">
</File>
<File
- RelativePath="..\..\engines\kyra\animator_v1.h">
+ RelativePath="..\..\engines\kyra\animator_mr.cpp">
</File>
<File
RelativePath="..\..\engines\kyra\animator_v2.cpp">
@@ -133,16 +133,16 @@
RelativePath="..\..\engines\kyra\gui_hof.h">
</File>
<File
- RelativePath="..\..\engines\kyra\gui_mr.cpp">
+ RelativePath="..\..\engines\kyra\gui_lok.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\gui_mr.h">
+ RelativePath="..\..\engines\kyra\gui_lok.h">
</File>
<File
- RelativePath="..\..\engines\kyra\gui_v1.cpp">
+ RelativePath="..\..\engines\kyra\gui_mr.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\gui_v1.h">
+ RelativePath="..\..\engines\kyra\gui_mr.h">
</File>
<File
RelativePath="..\..\engines\kyra\gui_v2.cpp">
@@ -154,25 +154,25 @@
RelativePath="..\..\engines\kyra\items_hof.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\items_mr.cpp">
+ RelativePath="..\..\engines\kyra\items_lok.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\items_v1.cpp">
+ RelativePath="..\..\engines\kyra\items_mr.cpp">
</File>
<File
RelativePath="..\..\engines\kyra\items_v2.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\kyra.cpp">
+ RelativePath="..\..\engines\kyra\kyra_hof.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\kyra.h">
+ RelativePath="..\..\engines\kyra\kyra_hof.h">
</File>
<File
- RelativePath="..\..\engines\kyra\kyra_hof.cpp">
+ RelativePath="..\..\engines\kyra\kyra_lok.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\kyra_hof.h">
+ RelativePath="..\..\engines\kyra\kyra_lok.h">
</File>
<File
RelativePath="..\..\engines\kyra\kyra_mr.cpp">
@@ -205,16 +205,16 @@
RelativePath="..\..\engines\kyra\saveload_hof.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\saveload_mr.cpp">
+ RelativePath="..\..\engines\kyra\saveload_lok.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\saveload_v1.cpp">
+ RelativePath="..\..\engines\kyra\saveload_mr.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\scene.cpp">
+ RelativePath="..\..\engines\kyra\scene_hof.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\scene_hof.cpp">
+ RelativePath="..\..\engines\kyra\scene_lok.cpp">
</File>
<File
RelativePath="..\..\engines\kyra\scene_mr.cpp">
@@ -238,16 +238,16 @@
RelativePath="..\..\engines\kyra\screen_hof.h">
</File>
<File
- RelativePath="..\..\engines\kyra\screen_mr.cpp">
+ RelativePath="..\..\engines\kyra\screen_lok.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\screen_mr.h">
+ RelativePath="..\..\engines\kyra\screen_lok.h">
</File>
<File
- RelativePath="..\..\engines\kyra\screen_v1.cpp">
+ RelativePath="..\..\engines\kyra\screen_mr.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\screen_v1.h">
+ RelativePath="..\..\engines\kyra\screen_mr.h">
</File>
<File
RelativePath="..\..\engines\kyra\screen_v2.cpp">
@@ -265,6 +265,9 @@
RelativePath="..\..\engines\kyra\script_hof.cpp">
</File>
<File
+ RelativePath="..\..\engines\kyra\script_lok.cpp">
+ </File>
+ <File
RelativePath="..\..\engines\kyra\script_mr.cpp">
</File>
<File
@@ -289,10 +292,10 @@
RelativePath="..\..\engines\kyra\sequences_hof.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\sequences_mr.cpp">
+ RelativePath="..\..\engines\kyra\sequences_lok.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\sequences_v1.cpp">
+ RelativePath="..\..\engines\kyra\sequences_mr.cpp">
</File>
<File
RelativePath="..\..\engines\kyra\sequences_v2.cpp">
@@ -310,10 +313,10 @@
RelativePath="..\..\engines\kyra\sound_digital.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\sound_towns.cpp">
+ RelativePath="..\..\engines\kyra\sound_lok.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\sound_v1.cpp">
+ RelativePath="..\..\engines\kyra\sound_towns.cpp">
</File>
<File
RelativePath="..\..\engines\kyra\sprites.cpp">
@@ -337,13 +340,13 @@
RelativePath="..\..\engines\kyra\text_hof.h">
</File>
<File
- RelativePath="..\..\engines\kyra\text_mr.cpp">
+ RelativePath="..\..\engines\kyra\text_lok.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\text_mr.h">
+ RelativePath="..\..\engines\kyra\text_mr.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\text_v1.cpp">
+ RelativePath="..\..\engines\kyra\text_mr.h">
</File>
<File
RelativePath="..\..\engines\kyra\timer.cpp">
@@ -355,10 +358,10 @@
RelativePath="..\..\engines\kyra\timer_hof.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\timer_mr.cpp">
+ RelativePath="..\..\engines\kyra\timer_lok.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\timer_v1.cpp">
+ RelativePath="..\..\engines\kyra\timer_mr.cpp">
</File>
<File
RelativePath="..\..\engines\kyra\vqa.cpp">
diff --git a/dists/msvc7/made.vcproj b/dists/msvc7/made.vcproj
index 6f4caa8154..757d46aa23 100644
--- a/dists/msvc7/made.vcproj
+++ b/dists/msvc7/made.vcproj
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="Windows-1252"?>
+<?xml version="1.0" encoding="windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.00"
@@ -148,22 +148,22 @@
RelativePath="..\..\engines\made\screen.h">
</File>
<File
- RelativePath="..\..\engines\made\script.cpp">
+ RelativePath="..\..\engines\made\screenfx.cpp">
</File>
<File
- RelativePath="..\..\engines\made\script.h">
+ RelativePath="..\..\engines\made\screenfx.h">
</File>
<File
- RelativePath="..\..\engines\made\scriptfuncs.h">
+ RelativePath="..\..\engines\made\script.cpp">
</File>
<File
- RelativePath="..\..\engines\made\scriptfuncs_lgop2.cpp">
+ RelativePath="..\..\engines\made\script.h">
</File>
<File
- RelativePath="..\..\engines\made\scriptfuncs_mhne.cpp">
+ RelativePath="..\..\engines\made\scriptfuncs.cpp">
</File>
<File
- RelativePath="..\..\engines\made\scriptfuncs_rtz.cpp">
+ RelativePath="..\..\engines\made\scriptfuncs.h">
</File>
<File
RelativePath="..\..\engines\made\sound.cpp">
diff --git a/dists/msvc7/parallaction.vcproj b/dists/msvc7/parallaction.vcproj
index 0d802e5667..79ac169995 100644
--- a/dists/msvc7/parallaction.vcproj
+++ b/dists/msvc7/parallaction.vcproj
@@ -148,6 +148,12 @@
RelativePath="..\..\engines\parallaction\gui_ns.cpp">
</File>
<File
+ RelativePath="..\..\engines\parallaction\input.cpp">
+ </File>
+ <File
+ RelativePath="..\..\engines\parallaction\input.h">
+ </File>
+ <File
RelativePath="..\..\engines\parallaction\inventory.cpp">
</File>
<File
diff --git a/dists/msvc7/saga.vcproj b/dists/msvc7/saga.vcproj
index ecbdec967b..1a1cb29555 100644
--- a/dists/msvc7/saga.vcproj
+++ b/dists/msvc7/saga.vcproj
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="windows-1252"?>
+<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.00"
@@ -151,9 +151,6 @@
RelativePath="..\..\engines\saga\gfx.h">
</File>
<File
- RelativePath="..\..\engines\saga\ihnm_introproc.cpp">
- </File>
- <File
RelativePath="..\..\engines\saga\image.cpp">
</File>
<File
@@ -166,13 +163,16 @@
RelativePath="..\..\engines\saga\interface.h">
</File>
<File
- RelativePath="..\..\engines\saga\isomap.cpp">
+ RelativePath="..\..\engines\saga\introproc_ihnm.cpp">
</File>
<File
- RelativePath="..\..\engines\saga\isomap.h">
+ RelativePath="..\..\engines\saga\introproc_ite.cpp">
+ </File>
+ <File
+ RelativePath="..\..\engines\saga\isomap.cpp">
</File>
<File
- RelativePath="..\..\engines\saga\ite_introproc.cpp">
+ RelativePath="..\..\engines\saga\isomap.h">
</File>
<File
RelativePath="..\..\engines\saga\itedata.cpp">
@@ -226,9 +226,6 @@
RelativePath="..\..\engines\saga\saga.h">
</File>
<File
- RelativePath="..\..\engines\saga\sagaresnames.h">
- </File>
- <File
RelativePath="..\..\engines\saga\saveload.cpp">
</File>
<File
diff --git a/dists/msvc7/scumm.vcproj b/dists/msvc7/scumm.vcproj
index 8264952066..56f78692cc 100644
--- a/dists/msvc7/scumm.vcproj
+++ b/dists/msvc7/scumm.vcproj
@@ -21,7 +21,7 @@
AdditionalOptions="/wd4201 /wd4512 /wd4511 /wd4100 /wd4121 /wd4310 /wd4706 /wd4127 /wd4189 /wd4702"
Optimization="0"
AdditionalIncludeDirectories="../..;../../engines"
- PreprocessorDefinitions="WIN32;_DEBUG;USE_ZLIB;USE_MAD;USE_VORBIS"
+ PreprocessorDefinitions="WIN32;_DEBUG;ENABLE_SCUMM_7_8;ENABLE_HE;USE_ZLIB;USE_MAD;USE_VORBIS"
MinimalRebuild="TRUE"
ExceptionHandling="TRUE"
BasicRuntimeChecks="3"
@@ -65,7 +65,7 @@
InlineFunctionExpansion="1"
OmitFramePointers="TRUE"
AdditionalIncludeDirectories="../..;../../engines"
- PreprocessorDefinitions="WIN32;NDEBUG;USE_ZLIB;USE_MAD;USE_VORBIS"
+ PreprocessorDefinitions="WIN32;NDEBUG;ENABLE_SCUMM_7_8;ENABLE_HE;USE_ZLIB;USE_MAD;USE_VORBIS"
StringPooling="TRUE"
ExceptionHandling="TRUE"
RuntimeLibrary="0"
diff --git a/dists/msvc7/scummvm.vcproj b/dists/msvc7/scummvm.vcproj
index f39a682cd9..5efde22725 100644
--- a/dists/msvc7/scummvm.vcproj
+++ b/dists/msvc7/scummvm.vcproj
@@ -21,7 +21,7 @@
AdditionalOptions="/wd4201 /wd4512 /wd4511 /wd4100 /wd4121 /wd4310 /wd4706 /wd4127 /wd4189 /wd4702"
Optimization="0"
AdditionalIncludeDirectories="../..;../../engines"
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;USE_ZLIB;USE_MAD;USE_VORBIS;USE_MPEG2;USE_NASM;USE_MT32EMU"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;USE_ZLIB;USE_MAD;USE_VORBIS;USE_MPEG2;USE_NASM;USE_MT32EMU;ENABLE_AGI;ENABLE_AGOS;ENABLE_CINE;ENABLE_CRUISE;ENABLE_DRASCULA;ENABLE_GOB;ENABLE_IGOR;ENABLE_KYRA;ENABLE_LURE;ENABLE_M4;ENABLE_MADE;ENABLE_PARALLACTION;ENABLE_QUEEN;ENABLE_SAGA;ENABLE_SCUMM;ENABLE_SKY;ENABLE_SWORD1;ENABLE_SWORD2;ENABLE_TOUCHE;ENABLE_SCUMM_7_8;ENABLE_HE"
MinimalRebuild="TRUE"
ExceptionHandling="TRUE"
BasicRuntimeChecks="3"
@@ -50,6 +50,8 @@
<Tool
Name="VCMIDLTool"/>
<Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
@@ -74,7 +76,7 @@
InlineFunctionExpansion="1"
OmitFramePointers="TRUE"
AdditionalIncludeDirectories="../..;../../engines"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;USE_ZLIB;USE_MAD;USE_VORBIS;USE_MPEG2;USE_MT32EMU"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;USE_ZLIB;USE_MAD;USE_VORBIS;USE_MPEG2;USE_MT32EMU;ENABLE_AGI;ENABLE_AGOS;ENABLE_CINE;ENABLE_CRUISE;ENABLE_DRASCULA;ENABLE_GOB;ENABLE_IGOR;ENABLE_KYRA;ENABLE_LURE;ENABLE_M4;ENABLE_MADE;ENABLE_PARALLACTION;ENABLE_QUEEN;ENABLE_SAGA;ENABLE_SCUMM;ENABLE_SKY;ENABLE_SWORD1;ENABLE_SWORD2;ENABLE_TOUCHE;ENABLE_SCUMM_7_8;ENABLE_HE"
StringPooling="TRUE"
MinimalRebuild="FALSE"
ExceptionHandling="TRUE"
@@ -105,6 +107,8 @@
<Tool
Name="VCMIDLTool"/>
<Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
@@ -291,6 +295,12 @@
RelativePath="..\..\common\timer.h">
</File>
<File
+ RelativePath="..\..\common\unarj.cpp">
+ </File>
+ <File
+ RelativePath="..\..\common\unarj.h">
+ </File>
+ <File
RelativePath="..\..\common\unzip.cpp">
</File>
<File
@@ -386,6 +396,9 @@
RelativePath="..\..\sound\midiparser_xmidi.cpp">
</File>
<File
+ RelativePath="..\..\sound\musicplugin.h">
+ </File>
+ <File
RelativePath="..\..\sound\mixer.cpp">
</File>
<File
diff --git a/dists/msvc71/cruise.vcproj b/dists/msvc71/cruise.vcproj
index 1915be0c5d..53ed72f60e 100644
--- a/dists/msvc71/cruise.vcproj
+++ b/dists/msvc71/cruise.vcproj
@@ -258,12 +258,6 @@
RelativePath="..\..\engines\cruise\stack.h">
</File>
<File
- RelativePath="..\..\engines\cruise\stringSupport.cpp">
- </File>
- <File
- RelativePath="..\..\engines\cruise\stringSupport.h">
- </File>
- <File
RelativePath="..\..\engines\cruise\various.cpp">
</File>
<File
diff --git a/dists/msvc71/drascula.vcproj b/dists/msvc71/drascula.vcproj
index 0d27422515..9160a02bbf 100644
--- a/dists/msvc71/drascula.vcproj
+++ b/dists/msvc71/drascula.vcproj
@@ -111,9 +111,15 @@
</References>
<Files>
<File
+ RelativePath="..\..\engines\drascula\actors.cpp">
+ </File>
+ <File
RelativePath="..\..\engines\drascula\animation.cpp">
</File>
<File
+ RelativePath="..\..\engines\drascula\converse.cpp">
+ </File>
+ <File
RelativePath="..\..\engines\drascula\detection.cpp">
</File>
<File
@@ -123,13 +129,28 @@
RelativePath="..\..\engines\drascula\drascula.h">
</File>
<File
+ RelativePath="..\..\engines\drascula\graphics.cpp">
+ </File>
+ <File
+ RelativePath="..\..\engines\drascula\interface.cpp">
+ </File>
+ <File
+ RelativePath="..\..\engines\drascula\objects.cpp">
+ </File>
+ <File
+ RelativePath="..\..\engines\drascula\palette.cpp">
+ </File>
+ <File
RelativePath="..\..\engines\drascula\rooms.cpp">
</File>
<File
- RelativePath="..\..\engines\drascula\talk.cpp">
+ RelativePath="..\..\engines\drascula\saveload.cpp">
+ </File>
+ <File
+ RelativePath="..\..\engines\drascula\sound.cpp">
</File>
<File
- RelativePath="..\..\engines\drascula\texts.cpp">
+ RelativePath="..\..\engines\drascula\talk.cpp">
</File>
</Files>
<Globals>
diff --git a/dists/msvc71/gob.vcproj b/dists/msvc71/gob.vcproj
index ac8960b28c..3d6408cdf5 100644
--- a/dists/msvc71/gob.vcproj
+++ b/dists/msvc71/gob.vcproj
@@ -110,12 +110,63 @@
<References>
</References>
<Files>
- <File
- RelativePath="..\..\engines\gob\cdrom.cpp">
- </File>
- <File
- RelativePath="..\..\engines\gob\cdrom.h">
- </File>
+ <Filter
+ Name="sound">
+ <File
+ RelativePath="..\..\engines\gob\sound\adlib.cpp">
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\adlib.h">
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\bgatmosphere.cpp">
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\bgatmosphere.h">
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\cdrom.cpp">
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\cdrom.h">
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\infogrames.cpp">
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\infogrames.h">
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\pcspeaker.cpp">
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\pcspeaker.h">
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\sound.cpp">
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\sound.h">
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\soundblaster.cpp">
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\soundblaster.h">
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\sounddesc.cpp">
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\sounddesc.h">
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\soundmixer.cpp">
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\soundmixer.h">
+ </File>
+ </Filter>
<File
RelativePath="..\..\engines\gob\coktelvideo.cpp">
</File>
@@ -258,12 +309,6 @@
RelativePath="..\..\engines\gob\mult_v2.cpp">
</File>
<File
- RelativePath="..\..\engines\gob\music.cpp">
- </File>
- <File
- RelativePath="..\..\engines\gob\music.h">
- </File>
- <File
RelativePath="..\..\engines\gob\palanim.cpp">
</File>
<File
@@ -294,6 +339,9 @@
RelativePath="..\..\engines\gob\saveload_v3.cpp">
</File>
<File
+ RelativePath="..\..\engines\gob\saveload_v4.cpp">
+ </File>
+ <File
RelativePath="..\..\engines\gob\scenery.cpp">
</File>
<File
@@ -306,16 +354,16 @@
RelativePath="..\..\engines\gob\scenery_v2.cpp">
</File>
<File
- RelativePath="..\..\engines\gob\sound.cpp">
+ RelativePath="..\..\engines\gob\util.cpp">
</File>
<File
- RelativePath="..\..\engines\gob\sound.h">
+ RelativePath="..\..\engines\gob\util.h">
</File>
<File
- RelativePath="..\..\engines\gob\util.cpp">
+ RelativePath="..\..\engines\gob\variables.cpp">
</File>
<File
- RelativePath="..\..\engines\gob\util.h">
+ RelativePath="..\..\engines\gob\variables.h">
</File>
<File
RelativePath="..\..\engines\gob\video.cpp">
diff --git a/dists/msvc71/kyra.vcproj b/dists/msvc71/kyra.vcproj
index 3992223f50..f37b1d85fc 100644
--- a/dists/msvc71/kyra.vcproj
+++ b/dists/msvc71/kyra.vcproj
@@ -114,13 +114,13 @@
RelativePath="..\..\engines\kyra\animator_hof.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\animator_mr.cpp">
+ RelativePath="..\..\engines\kyra\animator_lok.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\animator_v1.cpp">
+ RelativePath="..\..\engines\kyra\animator_lok.h">
</File>
<File
- RelativePath="..\..\engines\kyra\animator_v1.h">
+ RelativePath="..\..\engines\kyra\animator_mr.cpp">
</File>
<File
RelativePath="..\..\engines\kyra\animator_v2.cpp">
@@ -147,16 +147,16 @@
RelativePath="..\..\engines\kyra\gui_hof.h">
</File>
<File
- RelativePath="..\..\engines\kyra\gui_mr.cpp">
+ RelativePath="..\..\engines\kyra\gui_lok.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\gui_mr.h">
+ RelativePath="..\..\engines\kyra\gui_lok.h">
</File>
<File
- RelativePath="..\..\engines\kyra\gui_v1.cpp">
+ RelativePath="..\..\engines\kyra\gui_mr.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\gui_v1.h">
+ RelativePath="..\..\engines\kyra\gui_mr.h">
</File>
<File
RelativePath="..\..\engines\kyra\gui_v2.cpp">
@@ -168,25 +168,25 @@
RelativePath="..\..\engines\kyra\items_hof.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\items_mr.cpp">
+ RelativePath="..\..\engines\kyra\items_lok.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\items_v1.cpp">
+ RelativePath="..\..\engines\kyra\items_mr.cpp">
</File>
<File
RelativePath="..\..\engines\kyra\items_v2.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\kyra.cpp">
+ RelativePath="..\..\engines\kyra\kyra_hof.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\kyra.h">
+ RelativePath="..\..\engines\kyra\kyra_hof.h">
</File>
<File
- RelativePath="..\..\engines\kyra\kyra_hof.cpp">
+ RelativePath="..\..\engines\kyra\kyra_lok.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\kyra_hof.h">
+ RelativePath="..\..\engines\kyra\kyra_lok.h">
</File>
<File
RelativePath="..\..\engines\kyra\kyra_mr.cpp">
@@ -219,16 +219,16 @@
RelativePath="..\..\engines\kyra\saveload_hof.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\saveload_mr.cpp">
+ RelativePath="..\..\engines\kyra\saveload_lok.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\saveload_v1.cpp">
+ RelativePath="..\..\engines\kyra\saveload_mr.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\scene.cpp">
+ RelativePath="..\..\engines\kyra\scene_hof.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\scene_hof.cpp">
+ RelativePath="..\..\engines\kyra\scene_lok.cpp">
</File>
<File
RelativePath="..\..\engines\kyra\scene_mr.cpp">
@@ -252,16 +252,16 @@
RelativePath="..\..\engines\kyra\screen_hof.h">
</File>
<File
- RelativePath="..\..\engines\kyra\screen_mr.cpp">
+ RelativePath="..\..\engines\kyra\screen_lok.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\screen_mr.h">
+ RelativePath="..\..\engines\kyra\screen_lok.h">
</File>
<File
- RelativePath="..\..\engines\kyra\screen_v1.cpp">
+ RelativePath="..\..\engines\kyra\screen_mr.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\screen_v1.h">
+ RelativePath="..\..\engines\kyra\screen_mr.h">
</File>
<File
RelativePath="..\..\engines\kyra\screen_v2.cpp">
@@ -279,6 +279,9 @@
RelativePath="..\..\engines\kyra\script_hof.cpp">
</File>
<File
+ RelativePath="..\..\engines\kyra\script_lok.cpp">
+ </File>
+ <File
RelativePath="..\..\engines\kyra\script_mr.cpp">
</File>
<File
@@ -303,10 +306,10 @@
RelativePath="..\..\engines\kyra\sequences_hof.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\sequences_mr.cpp">
+ RelativePath="..\..\engines\kyra\sequences_lok.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\sequences_v1.cpp">
+ RelativePath="..\..\engines\kyra\sequences_mr.cpp">
</File>
<File
RelativePath="..\..\engines\kyra\sequences_v2.cpp">
@@ -324,10 +327,10 @@
RelativePath="..\..\engines\kyra\sound_digital.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\sound_towns.cpp">
+ RelativePath="..\..\engines\kyra\sound_lok.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\sound_v1.cpp">
+ RelativePath="..\..\engines\kyra\sound_towns.cpp">
</File>
<File
RelativePath="..\..\engines\kyra\sprites.cpp">
@@ -351,13 +354,13 @@
RelativePath="..\..\engines\kyra\text_hof.h">
</File>
<File
- RelativePath="..\..\engines\kyra\text_mr.cpp">
+ RelativePath="..\..\engines\kyra\text_lok.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\text_mr.h">
+ RelativePath="..\..\engines\kyra\text_mr.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\text_v1.cpp">
+ RelativePath="..\..\engines\kyra\text_mr.h">
</File>
<File
RelativePath="..\..\engines\kyra\timer.cpp">
@@ -369,10 +372,10 @@
RelativePath="..\..\engines\kyra\timer_hof.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\timer_mr.cpp">
+ RelativePath="..\..\engines\kyra\timer_lok.cpp">
</File>
<File
- RelativePath="..\..\engines\kyra\timer_v1.cpp">
+ RelativePath="..\..\engines\kyra\timer_mr.cpp">
</File>
<File
RelativePath="..\..\engines\kyra\vqa.cpp">
diff --git a/dists/msvc71/made.vcproj b/dists/msvc71/made.vcproj
index 1ddc1ce245..5d0dd621e8 100644
--- a/dists/msvc71/made.vcproj
+++ b/dists/msvc71/made.vcproj
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="Windows-1252"?>
+<?xml version="1.0" encoding="windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
@@ -162,22 +162,22 @@
RelativePath="..\..\engines\made\screen.h">
</File>
<File
- RelativePath="..\..\engines\made\script.cpp">
+ RelativePath="..\..\engines\made\screenfx.cpp">
</File>
<File
- RelativePath="..\..\engines\made\script.h">
+ RelativePath="..\..\engines\made\screenfx.h">
</File>
<File
- RelativePath="..\..\engines\made\scriptfuncs.h">
+ RelativePath="..\..\engines\made\script.cpp">
</File>
<File
- RelativePath="..\..\engines\made\scriptfuncs_lgop2.cpp">
+ RelativePath="..\..\engines\made\script.h">
</File>
<File
- RelativePath="..\..\engines\made\scriptfuncs_mhne.cpp">
+ RelativePath="..\..\engines\made\scriptfuncs.cpp">
</File>
<File
- RelativePath="..\..\engines\made\scriptfuncs_rtz.cpp">
+ RelativePath="..\..\engines\made\scriptfuncs.h">
</File>
<File
RelativePath="..\..\engines\made\sound.cpp">
diff --git a/dists/msvc71/parallaction.vcproj b/dists/msvc71/parallaction.vcproj
index 0d5369d54e..440e7123e8 100644
--- a/dists/msvc71/parallaction.vcproj
+++ b/dists/msvc71/parallaction.vcproj
@@ -162,6 +162,12 @@
RelativePath="..\..\engines\parallaction\gui_ns.cpp">
</File>
<File
+ RelativePath="..\..\engines\parallaction\input.cpp">
+ </File>
+ <File
+ RelativePath="..\..\engines\parallaction\input.h">
+ </File>
+ <File
RelativePath="..\..\engines\parallaction\inventory.cpp">
</File>
<File
diff --git a/dists/msvc71/saga.vcproj b/dists/msvc71/saga.vcproj
index 1e1333a9c7..388dd64ff2 100644
--- a/dists/msvc71/saga.vcproj
+++ b/dists/msvc71/saga.vcproj
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="windows-1252"?>
+<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
@@ -165,9 +165,6 @@
RelativePath="..\..\engines\saga\gfx.h">
</File>
<File
- RelativePath="..\..\engines\saga\ihnm_introproc.cpp">
- </File>
- <File
RelativePath="..\..\engines\saga\image.cpp">
</File>
<File
@@ -180,13 +177,16 @@
RelativePath="..\..\engines\saga\interface.h">
</File>
<File
- RelativePath="..\..\engines\saga\isomap.cpp">
+ RelativePath="..\..\engines\saga\introproc_ihnm.cpp">
</File>
<File
- RelativePath="..\..\engines\saga\isomap.h">
+ RelativePath="..\..\engines\saga\introproc_ite.cpp">
+ </File>
+ <File
+ RelativePath="..\..\engines\saga\isomap.cpp">
</File>
<File
- RelativePath="..\..\engines\saga\ite_introproc.cpp">
+ RelativePath="..\..\engines\saga\isomap.h">
</File>
<File
RelativePath="..\..\engines\saga\itedata.cpp">
@@ -240,9 +240,6 @@
RelativePath="..\..\engines\saga\saga.h">
</File>
<File
- RelativePath="..\..\engines\saga\sagaresnames.h">
- </File>
- <File
RelativePath="..\..\engines\saga\saveload.cpp">
</File>
<File
diff --git a/dists/msvc71/scumm.vcproj b/dists/msvc71/scumm.vcproj
index 26f8e7de58..661cc1fa19 100644
--- a/dists/msvc71/scumm.vcproj
+++ b/dists/msvc71/scumm.vcproj
@@ -21,7 +21,7 @@
AdditionalOptions="/wd4201 /wd4512 /wd4511 /wd4100 /wd4121 /wd4310 /wd4706 /wd4127 /wd4189 /wd4702"
Optimization="0"
AdditionalIncludeDirectories="../..;../../engines"
- PreprocessorDefinitions="WIN32;_DEBUG;USE_ZLIB;USE_MAD;USE_VORBIS"
+ PreprocessorDefinitions="WIN32;_DEBUG;ENABLE_SCUMM_7_8;ENABLE_HE;USE_ZLIB;USE_MAD;USE_VORBIS"
MinimalRebuild="TRUE"
ExceptionHandling="TRUE"
BasicRuntimeChecks="3"
@@ -71,7 +71,7 @@
InlineFunctionExpansion="1"
OmitFramePointers="TRUE"
AdditionalIncludeDirectories="../..;../../engines"
- PreprocessorDefinitions="WIN32;NDEBUG;USE_ZLIB;USE_MAD;USE_VORBIS"
+ PreprocessorDefinitions="WIN32;NDEBUG;ENABLE_SCUMM_7_8;ENABLE_HE;USE_ZLIB;USE_MAD;USE_VORBIS"
StringPooling="TRUE"
ExceptionHandling="TRUE"
RuntimeLibrary="0"
diff --git a/dists/msvc71/scummvm.vcproj b/dists/msvc71/scummvm.vcproj
index 5cab91dd7f..16f56e3004 100644
--- a/dists/msvc71/scummvm.vcproj
+++ b/dists/msvc71/scummvm.vcproj
@@ -21,7 +21,7 @@
AdditionalOptions="/wd4201 /wd4512 /wd4511 /wd4100 /wd4121 /wd4310 /wd4706 /wd4127 /wd4189 /wd4702"
Optimization="0"
AdditionalIncludeDirectories="../..;../../engines"
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;USE_ZLIB;USE_MAD;USE_VORBIS;USE_MPEG2;USE_NASM;USE_MT32EMU"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;USE_ZLIB;USE_MAD;USE_VORBIS;USE_MPEG2;USE_NASM;USE_MT32EMU;ENABLE_AGI;ENABLE_AGOS;ENABLE_CINE;ENABLE_CRUISE;ENABLE_DRASCULA;ENABLE_GOB;ENABLE_IGOR;ENABLE_KYRA;ENABLE_LURE;ENABLE_M4;ENABLE_MADE;ENABLE_PARALLACTION;ENABLE_QUEEN;ENABLE_SAGA;ENABLE_SCUMM;ENABLE_SKY;ENABLE_SWORD1;ENABLE_SWORD2;ENABLE_TOUCHE;ENABLE_SCUMM_7_8;ENABLE_HE"
MinimalRebuild="TRUE"
ExceptionHandling="TRUE"
BasicRuntimeChecks="3"
@@ -50,6 +50,8 @@
<Tool
Name="VCMIDLTool"/>
<Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
@@ -80,7 +82,7 @@
InlineFunctionExpansion="1"
OmitFramePointers="TRUE"
AdditionalIncludeDirectories="../..;../../engines"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;USE_ZLIB;USE_MAD;USE_VORBIS;USE_MPEG2;USE_MT32EMU"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;USE_ZLIB;USE_MAD;USE_VORBIS;USE_MPEG2;USE_MT32EMU;ENABLE_AGI;ENABLE_AGOS;ENABLE_CINE;ENABLE_CRUISE;ENABLE_DRASCULA;ENABLE_GOB;ENABLE_IGOR;ENABLE_KYRA;ENABLE_LURE;ENABLE_M4;ENABLE_MADE;ENABLE_PARALLACTION;ENABLE_QUEEN;ENABLE_SAGA;ENABLE_SCUMM;ENABLE_SKY;ENABLE_SWORD1;ENABLE_SWORD2;ENABLE_TOUCHE;ENABLE_SCUMM_7_8;ENABLE_HE"
StringPooling="TRUE"
MinimalRebuild="FALSE"
ExceptionHandling="TRUE"
@@ -111,6 +113,8 @@
<Tool
Name="VCMIDLTool"/>
<Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
@@ -305,6 +309,12 @@
RelativePath="..\..\common\timer.h">
</File>
<File
+ RelativePath="..\..\common\unarj.cpp">
+ </File>
+ <File
+ RelativePath="..\..\common\unarj.h">
+ </File>
+ <File
RelativePath="..\..\common\unzip.cpp">
</File>
<File
@@ -400,6 +410,9 @@
RelativePath="..\..\sound\midiparser_xmidi.cpp">
</File>
<File
+ RelativePath="..\..\sound\musicplugin.h">
+ </File>
+ <File
RelativePath="..\..\sound\mixer.cpp">
</File>
<File
diff --git a/dists/msvc8/cruise.vcproj b/dists/msvc8/cruise.vcproj
index 45479ef22f..f183d07ee3 100644
--- a/dists/msvc8/cruise.vcproj
+++ b/dists/msvc8/cruise.vcproj
@@ -357,14 +357,6 @@
>
</File>
<File
- RelativePath="..\..\engines\cruise\stringSupport.cpp"
- >
- </File>
- <File
- RelativePath="..\..\engines\cruise\stringSupport.h"
- >
- </File>
- <File
RelativePath="..\..\engines\cruise\various.cpp"
>
</File>
diff --git a/dists/msvc8/drascula.vcproj b/dists/msvc8/drascula.vcproj
index 7cf6065a4f..0867377f31 100644
--- a/dists/msvc8/drascula.vcproj
+++ b/dists/msvc8/drascula.vcproj
@@ -161,10 +161,18 @@
</References>
<Files>
<File
+ RelativePath="..\..\engines\drascula\actors.cpp"
+ >
+ </File>
+ <File
RelativePath="..\..\engines\drascula\animation.cpp"
>
</File>
<File
+ RelativePath="..\..\engines\drascula\converse.cpp"
+ >
+ </File>
+ <File
RelativePath="..\..\engines\drascula\detection.cpp"
>
</File>
@@ -177,15 +185,35 @@
>
</File>
<File
+ RelativePath="..\..\engines\drascula\graphics.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\drascula\interface.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\drascula\objects.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\drascula\palette.cpp"
+ >
+ </File>
+ <File
RelativePath="..\..\engines\drascula\rooms.cpp"
>
</File>
<File
- RelativePath="..\..\engines\drascula\talk.cpp"
+ RelativePath="..\..\engines\drascula\saveload.cpp"
>
</File>
<File
- RelativePath="..\..\engines\drascula\texts.cpp"
+ RelativePath="..\..\engines\drascula\sound.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\drascula\talk.cpp"
>
</File>
</Files>
diff --git a/dists/msvc8/gob.vcproj b/dists/msvc8/gob.vcproj
index 04858f540e..c178caf8be 100644
--- a/dists/msvc8/gob.vcproj
+++ b/dists/msvc8/gob.vcproj
@@ -160,14 +160,82 @@
<References>
</References>
<Files>
- <File
- RelativePath="..\..\engines\gob\cdrom.cpp"
- >
- </File>
- <File
- RelativePath="..\..\engines\gob\cdrom.h"
- >
- </File>
+ <Filter
+ Name="sound"
+ >
+ <File
+ RelativePath="..\..\engines\gob\sound\adlib.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\adlib.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\bgatmosphere.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\bgatmosphere.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\cdrom.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\cdrom.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\infogrames.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\infogrames.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\pcspeaker.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\pcspeaker.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\sound.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\sound.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\soundblaster.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\soundblaster.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\sounddesc.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\sounddesc.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\soundmixer.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\soundmixer.h"
+ >
+ </File>
+ </Filter>
<File
RelativePath="..\..\engines\gob\coktelvideo.cpp"
>
@@ -357,14 +425,6 @@
>
</File>
<File
- RelativePath="..\..\engines\gob\music.cpp"
- >
- </File>
- <File
- RelativePath="..\..\engines\gob\music.h"
- >
- </File>
- <File
RelativePath="..\..\engines\gob\palanim.cpp"
>
</File>
@@ -405,6 +465,10 @@
>
</File>
<File
+ RelativePath="..\..\engines\gob\saveload_v4.cpp"
+ >
+ </File>
+ <File
RelativePath="..\..\engines\gob\scenery.cpp"
>
</File>
@@ -421,19 +485,19 @@
>
</File>
<File
- RelativePath="..\..\engines\gob\sound.cpp"
+ RelativePath="..\..\engines\gob\util.cpp"
>
</File>
<File
- RelativePath="..\..\engines\gob\sound.h"
+ RelativePath="..\..\engines\gob\util.h"
>
</File>
<File
- RelativePath="..\..\engines\gob\util.cpp"
+ RelativePath="..\..\engines\gob\variables.cpp"
>
</File>
<File
- RelativePath="..\..\engines\gob\util.h"
+ RelativePath="..\..\engines\gob\variables.h"
>
</File>
<File
diff --git a/dists/msvc8/kyra.vcproj b/dists/msvc8/kyra.vcproj
index d173914b59..c99abdc5bc 100644
--- a/dists/msvc8/kyra.vcproj
+++ b/dists/msvc8/kyra.vcproj
@@ -165,15 +165,15 @@
>
</File>
<File
- RelativePath="..\..\engines\kyra\animator_mr.cpp"
+ RelativePath="..\..\engines\kyra\animator_lok.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\animator_v1.cpp"
+ RelativePath="..\..\engines\kyra\animator_lok.h"
>
</File>
<File
- RelativePath="..\..\engines\kyra\animator_v1.h"
+ RelativePath="..\..\engines\kyra\animator_mr.cpp"
>
</File>
<File
@@ -209,19 +209,19 @@
>
</File>
<File
- RelativePath="..\..\engines\kyra\gui_mr.cpp"
+ RelativePath="..\..\engines\kyra\gui_lok.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\gui_mr.h"
+ RelativePath="..\..\engines\kyra\gui_lok.h"
>
</File>
<File
- RelativePath="..\..\engines\kyra\gui_v1.cpp"
+ RelativePath="..\..\engines\kyra\gui_mr.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\gui_v1.h"
+ RelativePath="..\..\engines\kyra\gui_mr.h"
>
</File>
<File
@@ -237,11 +237,11 @@
>
</File>
<File
- RelativePath="..\..\engines\kyra\items_mr.cpp"
+ RelativePath="..\..\engines\kyra\items_lok.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\items_v1.cpp"
+ RelativePath="..\..\engines\kyra\items_mr.cpp"
>
</File>
<File
@@ -249,19 +249,19 @@
>
</File>
<File
- RelativePath="..\..\engines\kyra\kyra.cpp"
+ RelativePath="..\..\engines\kyra\kyra_hof.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\kyra.h"
+ RelativePath="..\..\engines\kyra\kyra_hof.h"
>
</File>
<File
- RelativePath="..\..\engines\kyra\kyra_hof.cpp"
+ RelativePath="..\..\engines\kyra\kyra_lok.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\kyra_hof.h"
+ RelativePath="..\..\engines\kyra\kyra_lok.h"
>
</File>
<File
@@ -305,19 +305,19 @@
>
</File>
<File
- RelativePath="..\..\engines\kyra\saveload_mr.cpp"
+ RelativePath="..\..\engines\kyra\saveload_lok.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\saveload_v1.cpp"
+ RelativePath="..\..\engines\kyra\saveload_mr.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\scene.cpp"
+ RelativePath="..\..\engines\kyra\scene_hof.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\scene_hof.cpp"
+ RelativePath="..\..\engines\kyra\scene_lok.cpp"
>
</File>
<File
@@ -349,19 +349,19 @@
>
</File>
<File
- RelativePath="..\..\engines\kyra\screen_mr.cpp"
+ RelativePath="..\..\engines\kyra\screen_lok.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\screen_mr.h"
+ RelativePath="..\..\engines\kyra\screen_lok.h"
>
</File>
<File
- RelativePath="..\..\engines\kyra\screen_v1.cpp"
+ RelativePath="..\..\engines\kyra\screen_mr.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\screen_v1.h"
+ RelativePath="..\..\engines\kyra\screen_mr.h"
>
</File>
<File
@@ -385,6 +385,10 @@
>
</File>
<File
+ RelativePath="..\..\engines\kyra\script_lok.cpp"
+ >
+ </File>
+ <File
RelativePath="..\..\engines\kyra\script_mr.cpp"
>
</File>
@@ -417,11 +421,11 @@
>
</File>
<File
- RelativePath="..\..\engines\kyra\sequences_mr.cpp"
+ RelativePath="..\..\engines\kyra\sequences_lok.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\sequences_v1.cpp"
+ RelativePath="..\..\engines\kyra\sequences_mr.cpp"
>
</File>
<File
@@ -445,11 +449,11 @@
>
</File>
<File
- RelativePath="..\..\engines\kyra\sound_towns.cpp"
+ RelativePath="..\..\engines\kyra\sound_lok.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\sound_v1.cpp"
+ RelativePath="..\..\engines\kyra\sound_towns.cpp"
>
</File>
<File
@@ -481,15 +485,15 @@
>
</File>
<File
- RelativePath="..\..\engines\kyra\text_mr.cpp"
+ RelativePath="..\..\engines\kyra\text_lok.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\text_mr.h"
+ RelativePath="..\..\engines\kyra\text_mr.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\text_v1.cpp"
+ RelativePath="..\..\engines\kyra\text_mr.h"
>
</File>
<File
@@ -505,11 +509,11 @@
>
</File>
<File
- RelativePath="..\..\engines\kyra\timer_mr.cpp"
+ RelativePath="..\..\engines\kyra\timer_lok.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\timer_v1.cpp"
+ RelativePath="..\..\engines\kyra\timer_mr.cpp"
>
</File>
<File
diff --git a/dists/msvc8/made.vcproj b/dists/msvc8/made.vcproj
index 7f7ec6e454..b3c309b334 100644
--- a/dists/msvc8/made.vcproj
+++ b/dists/msvc8/made.vcproj
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="Windows-1252"?>
+<?xml version="1.0" encoding="windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8,00"
@@ -229,27 +229,27 @@
>
</File>
<File
- RelativePath="..\..\engines\made\script.cpp"
+ RelativePath="..\..\engines\made\screenfx.cpp"
>
</File>
<File
- RelativePath="..\..\engines\made\script.h"
+ RelativePath="..\..\engines\made\screenfx.h"
>
</File>
<File
- RelativePath="..\..\engines\made\scriptfuncs.h"
+ RelativePath="..\..\engines\made\script.cpp"
>
</File>
<File
- RelativePath="..\..\engines\made\scriptfuncs_lgop2.cpp"
+ RelativePath="..\..\engines\made\script.h"
>
</File>
<File
- RelativePath="..\..\engines\made\scriptfuncs_mhne.cpp"
+ RelativePath="..\..\engines\made\scriptfuncs.cpp"
>
</File>
<File
- RelativePath="..\..\engines\made\scriptfuncs_rtz.cpp"
+ RelativePath="..\..\engines\made\scriptfuncs.h"
>
</File>
<File
diff --git a/dists/msvc8/parallaction.vcproj b/dists/msvc8/parallaction.vcproj
index 0e2b0a761a..21a6d3bab3 100644
--- a/dists/msvc8/parallaction.vcproj
+++ b/dists/msvc8/parallaction.vcproj
@@ -229,6 +229,14 @@
>
</File>
<File
+ RelativePath="..\..\engines\parallaction\input.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\parallaction\input.h"
+ >
+ </File>
+ <File
RelativePath="..\..\engines\parallaction\inventory.cpp"
>
</File>
diff --git a/dists/msvc8/saga.vcproj b/dists/msvc8/saga.vcproj
index d40332b470..79f7d35fb5 100644
--- a/dists/msvc8/saga.vcproj
+++ b/dists/msvc8/saga.vcproj
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="windows-1252"?>
+<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8,00"
@@ -233,10 +233,6 @@
>
</File>
<File
- RelativePath="..\..\engines\saga\ihnm_introproc.cpp"
- >
- </File>
- <File
RelativePath="..\..\engines\saga\image.cpp"
>
</File>
@@ -253,15 +249,19 @@
>
</File>
<File
- RelativePath="..\..\engines\saga\isomap.cpp"
+ RelativePath="..\..\engines\saga\introproc_ihnm.cpp"
>
</File>
<File
- RelativePath="..\..\engines\saga\isomap.h"
+ RelativePath="..\..\engines\saga\introproc_ite.cpp"
>
</File>
<File
- RelativePath="..\..\engines\saga\ite_introproc.cpp"
+ RelativePath="..\..\engines\saga\isomap.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\saga\isomap.h"
>
</File>
<File
@@ -333,10 +333,6 @@
>
</File>
<File
- RelativePath="..\..\engines\saga\sagaresnames.h"
- >
- </File>
- <File
RelativePath="..\..\engines\saga\saveload.cpp"
>
</File>
diff --git a/dists/msvc8/scumm.vcproj b/dists/msvc8/scumm.vcproj
index e10f664c28..42a4ff6993 100644
--- a/dists/msvc8/scumm.vcproj
+++ b/dists/msvc8/scumm.vcproj
@@ -42,7 +42,7 @@
AdditionalOptions="/wd4201 /wd4512 /wd4511 /wd4100 /wd4121 /wd4310 /wd4706 /wd4127 /wd4189 /wd4702 /wd4996"
Optimization="0"
AdditionalIncludeDirectories="../..;../../engines"
- PreprocessorDefinitions="WIN32;_DEBUG;USE_ZLIB;USE_MAD;USE_VORBIS"
+ PreprocessorDefinitions="WIN32;_DEBUG;ENABLE_SCUMM_7_8;ENABLE_HE;USE_ZLIB;USE_MAD;USE_VORBIS"
MinimalRebuild="true"
ExceptionHandling="1"
BasicRuntimeChecks="3"
@@ -115,7 +115,7 @@
InlineFunctionExpansion="1"
OmitFramePointers="true"
AdditionalIncludeDirectories="../..;../../engines"
- PreprocessorDefinitions="WIN32;NDEBUG;USE_ZLIB;USE_MAD;USE_VORBIS"
+ PreprocessorDefinitions="WIN32;NDEBUG;ENABLE_SCUMM_7_8;ENABLE_HE;USE_ZLIB;USE_MAD;USE_VORBIS"
StringPooling="true"
ExceptionHandling="1"
RuntimeLibrary="0"
diff --git a/dists/msvc8/scummvm.vcproj b/dists/msvc8/scummvm.vcproj
index 40c455eb8a..bee416b549 100644
--- a/dists/msvc8/scummvm.vcproj
+++ b/dists/msvc8/scummvm.vcproj
@@ -42,7 +42,7 @@
AdditionalOptions="/wd4201 /wd4512 /wd4511 /wd4100 /wd4121 /wd4310 /wd4706 /wd4127 /wd4189 /wd4702 /wd4996"
Optimization="0"
AdditionalIncludeDirectories="../..;../../engines"
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;USE_ZLIB;USE_MAD;USE_VORBIS;USE_MPEG2;USE_NASM;USE_MT32EMU"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;USE_ZLIB;USE_MAD;USE_VORBIS;USE_MPEG2;USE_NASM;USE_MT32EMU;ENABLE_AGI;ENABLE_AGOS;ENABLE_CINE;ENABLE_CRUISE;ENABLE_DRASCULA;ENABLE_GOB;ENABLE_IGOR;ENABLE_KYRA;ENABLE_LURE;ENABLE_M4;ENABLE_MADE;ENABLE_PARALLACTION;ENABLE_QUEEN;ENABLE_SAGA;ENABLE_SCUMM;ENABLE_SKY;ENABLE_SWORD1;ENABLE_SWORD2;ENABLE_TOUCHE;ENABLE_SCUMM_7_8;ENABLE_HE"
MinimalRebuild="true"
ExceptionHandling="1"
BasicRuntimeChecks="3"
@@ -97,6 +97,9 @@
Name="VCAppVerifierTool"
/>
<Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
@@ -130,7 +133,7 @@
InlineFunctionExpansion="1"
OmitFramePointers="true"
AdditionalIncludeDirectories="../..;../../engines"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;USE_ZLIB;USE_MAD;USE_VORBIS;USE_MPEG2;USE_MT32EMU"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;USE_ZLIB;USE_MAD;USE_VORBIS;USE_MPEG2;USE_MT32EMU;ENABLE_AGI;ENABLE_AGOS;ENABLE_CINE;ENABLE_CRUISE;ENABLE_DRASCULA;ENABLE_GOB;ENABLE_IGOR;ENABLE_KYRA;ENABLE_LURE;ENABLE_M4;ENABLE_MADE;ENABLE_PARALLACTION;ENABLE_QUEEN;ENABLE_SAGA;ENABLE_SCUMM;ENABLE_SKY;ENABLE_SWORD1;ENABLE_SWORD2;ENABLE_TOUCHE;ENABLE_SCUMM_7_8;ENABLE_HE"
StringPooling="true"
MinimalRebuild="false"
ExceptionHandling="1"
@@ -186,6 +189,9 @@
Name="VCAppVerifierTool"
/>
<Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
@@ -425,6 +431,14 @@
>
</File>
<File
+ RelativePath="..\..\common\unarj.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\common\unarj.h"
+ >
+ </File>
+ <File
RelativePath="..\..\common\unzip.cpp"
>
</File>
@@ -551,6 +565,10 @@
>
</File>
<File
+ RelativePath="..\..\sound\musicplugin.h"
+ >
+ </File>
+ <File
RelativePath="..\..\sound\mixer.cpp"
>
</File>
diff --git a/dists/msvc8_to_msvc7_71.bat b/dists/msvc8_to_msvc7_71.bat
index 11be21e1dd..71d04f68a3 100644
--- a/dists/msvc8_to_msvc7_71.bat
+++ b/dists/msvc8_to_msvc7_71.bat
@@ -101,3 +101,4 @@ echo Place rpl.exe from the bin folder inside the archive in the folder where
echo this batch file resides
:the_end
+pause
diff --git a/dists/msvc9/cruise.vcproj b/dists/msvc9/cruise.vcproj
index 2d47ab4d2c..19a96eb7be 100644
--- a/dists/msvc9/cruise.vcproj
+++ b/dists/msvc9/cruise.vcproj
@@ -358,14 +358,6 @@
>
</File>
<File
- RelativePath="..\..\engines\cruise\stringSupport.cpp"
- >
- </File>
- <File
- RelativePath="..\..\engines\cruise\stringSupport.h"
- >
- </File>
- <File
RelativePath="..\..\engines\cruise\various.cpp"
>
</File>
diff --git a/dists/msvc9/drascula.vcproj b/dists/msvc9/drascula.vcproj
index 9eb8d5af9a..45a75cb7a2 100644
--- a/dists/msvc9/drascula.vcproj
+++ b/dists/msvc9/drascula.vcproj
@@ -162,10 +162,18 @@
</References>
<Files>
<File
+ RelativePath="..\..\engines\drascula\actors.cpp"
+ >
+ </File>
+ <File
RelativePath="..\..\engines\drascula\animation.cpp"
>
</File>
<File
+ RelativePath="..\..\engines\drascula\converse.cpp"
+ >
+ </File>
+ <File
RelativePath="..\..\engines\drascula\detection.cpp"
>
</File>
@@ -178,15 +186,35 @@
>
</File>
<File
+ RelativePath="..\..\engines\drascula\graphics.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\drascula\interface.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\drascula\objects.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\drascula\palette.cpp"
+ >
+ </File>
+ <File
RelativePath="..\..\engines\drascula\rooms.cpp"
>
</File>
<File
- RelativePath="..\..\engines\drascula\talk.cpp"
+ RelativePath="..\..\engines\drascula\saveload.cpp"
>
</File>
<File
- RelativePath="..\..\engines\drascula\texts.cpp"
+ RelativePath="..\..\engines\drascula\sound.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\drascula\talk.cpp"
>
</File>
</Files>
diff --git a/dists/msvc9/gob.vcproj b/dists/msvc9/gob.vcproj
index a409f5dd82..e6c55519b0 100644
--- a/dists/msvc9/gob.vcproj
+++ b/dists/msvc9/gob.vcproj
@@ -161,14 +161,82 @@
<References>
</References>
<Files>
- <File
- RelativePath="..\..\engines\gob\cdrom.cpp"
- >
- </File>
- <File
- RelativePath="..\..\engines\gob\cdrom.h"
- >
- </File>
+ <Filter
+ Name="sound"
+ >
+ <File
+ RelativePath="..\..\engines\gob\sound\adlib.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\adlib.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\bgatmosphere.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\bgatmosphere.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\cdrom.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\cdrom.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\infogrames.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\infogrames.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\pcspeaker.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\pcspeaker.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\sound.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\sound.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\soundblaster.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\soundblaster.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\sounddesc.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\sounddesc.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\soundmixer.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\gob\sound\soundmixer.h"
+ >
+ </File>
+ </Filter>
<File
RelativePath="..\..\engines\gob\coktelvideo.cpp"
>
@@ -358,14 +426,6 @@
>
</File>
<File
- RelativePath="..\..\engines\gob\music.cpp"
- >
- </File>
- <File
- RelativePath="..\..\engines\gob\music.h"
- >
- </File>
- <File
RelativePath="..\..\engines\gob\palanim.cpp"
>
</File>
@@ -406,6 +466,10 @@
>
</File>
<File
+ RelativePath="..\..\engines\gob\saveload_v4.cpp"
+ >
+ </File>
+ <File
RelativePath="..\..\engines\gob\scenery.cpp"
>
</File>
@@ -422,19 +486,19 @@
>
</File>
<File
- RelativePath="..\..\engines\gob\sound.cpp"
+ RelativePath="..\..\engines\gob\util.cpp"
>
</File>
<File
- RelativePath="..\..\engines\gob\sound.h"
+ RelativePath="..\..\engines\gob\util.h"
>
</File>
<File
- RelativePath="..\..\engines\gob\util.cpp"
+ RelativePath="..\..\engines\gob\variables.cpp"
>
</File>
<File
- RelativePath="..\..\engines\gob\util.h"
+ RelativePath="..\..\engines\gob\variables.h"
>
</File>
<File
diff --git a/dists/msvc9/kyra.vcproj b/dists/msvc9/kyra.vcproj
index b004e9463e..f56a2733b5 100644
--- a/dists/msvc9/kyra.vcproj
+++ b/dists/msvc9/kyra.vcproj
@@ -166,15 +166,15 @@
>
</File>
<File
- RelativePath="..\..\engines\kyra\animator_mr.cpp"
+ RelativePath="..\..\engines\kyra\animator_lok.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\animator_v1.cpp"
+ RelativePath="..\..\engines\kyra\animator_lok.h"
>
</File>
<File
- RelativePath="..\..\engines\kyra\animator_v1.h"
+ RelativePath="..\..\engines\kyra\animator_mr.cpp"
>
</File>
<File
@@ -210,19 +210,19 @@
>
</File>
<File
- RelativePath="..\..\engines\kyra\gui_mr.cpp"
+ RelativePath="..\..\engines\kyra\gui_lok.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\gui_mr.h"
+ RelativePath="..\..\engines\kyra\gui_lok.h"
>
</File>
<File
- RelativePath="..\..\engines\kyra\gui_v1.cpp"
+ RelativePath="..\..\engines\kyra\gui_mr.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\gui_v1.h"
+ RelativePath="..\..\engines\kyra\gui_mr.h"
>
</File>
<File
@@ -238,11 +238,11 @@
>
</File>
<File
- RelativePath="..\..\engines\kyra\items_mr.cpp"
+ RelativePath="..\..\engines\kyra\items_lok.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\items_v1.cpp"
+ RelativePath="..\..\engines\kyra\items_mr.cpp"
>
</File>
<File
@@ -250,19 +250,19 @@
>
</File>
<File
- RelativePath="..\..\engines\kyra\kyra.cpp"
+ RelativePath="..\..\engines\kyra\kyra_hof.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\kyra.h"
+ RelativePath="..\..\engines\kyra\kyra_hof.h"
>
</File>
<File
- RelativePath="..\..\engines\kyra\kyra_hof.cpp"
+ RelativePath="..\..\engines\kyra\kyra_lok.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\kyra_hof.h"
+ RelativePath="..\..\engines\kyra\kyra_lok.h"
>
</File>
<File
@@ -306,19 +306,19 @@
>
</File>
<File
- RelativePath="..\..\engines\kyra\saveload_mr.cpp"
+ RelativePath="..\..\engines\kyra\saveload_lok.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\saveload_v1.cpp"
+ RelativePath="..\..\engines\kyra\saveload_mr.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\scene.cpp"
+ RelativePath="..\..\engines\kyra\scene_hof.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\scene_hof.cpp"
+ RelativePath="..\..\engines\kyra\scene_lok.cpp"
>
</File>
<File
@@ -350,19 +350,19 @@
>
</File>
<File
- RelativePath="..\..\engines\kyra\screen_mr.cpp"
+ RelativePath="..\..\engines\kyra\screen_lok.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\screen_mr.h"
+ RelativePath="..\..\engines\kyra\screen_lok.h"
>
</File>
<File
- RelativePath="..\..\engines\kyra\screen_v1.cpp"
+ RelativePath="..\..\engines\kyra\screen_mr.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\screen_v1.h"
+ RelativePath="..\..\engines\kyra\screen_mr.h"
>
</File>
<File
@@ -386,6 +386,10 @@
>
</File>
<File
+ RelativePath="..\..\engines\kyra\script_lok.cpp"
+ >
+ </File>
+ <File
RelativePath="..\..\engines\kyra\script_mr.cpp"
>
</File>
@@ -418,11 +422,11 @@
>
</File>
<File
- RelativePath="..\..\engines\kyra\sequences_mr.cpp"
+ RelativePath="..\..\engines\kyra\sequences_lok.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\sequences_v1.cpp"
+ RelativePath="..\..\engines\kyra\sequences_mr.cpp"
>
</File>
<File
@@ -446,11 +450,11 @@
>
</File>
<File
- RelativePath="..\..\engines\kyra\sound_towns.cpp"
+ RelativePath="..\..\engines\kyra\sound_lok.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\sound_v1.cpp"
+ RelativePath="..\..\engines\kyra\sound_towns.cpp"
>
</File>
<File
@@ -482,15 +486,15 @@
>
</File>
<File
- RelativePath="..\..\engines\kyra\text_mr.cpp"
+ RelativePath="..\..\engines\kyra\text_lok.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\text_mr.h"
+ RelativePath="..\..\engines\kyra\text_mr.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\text_v1.cpp"
+ RelativePath="..\..\engines\kyra\text_mr.h"
>
</File>
<File
@@ -506,11 +510,11 @@
>
</File>
<File
- RelativePath="..\..\engines\kyra\timer_mr.cpp"
+ RelativePath="..\..\engines\kyra\timer_lok.cpp"
>
</File>
<File
- RelativePath="..\..\engines\kyra\timer_v1.cpp"
+ RelativePath="..\..\engines\kyra\timer_mr.cpp"
>
</File>
<File
diff --git a/dists/msvc9/made.vcproj b/dists/msvc9/made.vcproj
index 17b619911f..a96ae262cb 100644
--- a/dists/msvc9/made.vcproj
+++ b/dists/msvc9/made.vcproj
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="Windows-1252"?>
+<?xml version="1.0" encoding="windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9,00"
@@ -230,27 +230,27 @@
>
</File>
<File
- RelativePath="..\..\engines\made\script.cpp"
+ RelativePath="..\..\engines\made\screenfx.cpp"
>
</File>
<File
- RelativePath="..\..\engines\made\script.h"
+ RelativePath="..\..\engines\made\screenfx.h"
>
</File>
<File
- RelativePath="..\..\engines\made\scriptfuncs.h"
+ RelativePath="..\..\engines\made\script.cpp"
>
</File>
<File
- RelativePath="..\..\engines\made\scriptfuncs_lgop2.cpp"
+ RelativePath="..\..\engines\made\script.h"
>
</File>
<File
- RelativePath="..\..\engines\made\scriptfuncs_mhne.cpp"
+ RelativePath="..\..\engines\made\scriptfuncs.cpp"
>
</File>
<File
- RelativePath="..\..\engines\made\scriptfuncs_rtz.cpp"
+ RelativePath="..\..\engines\made\scriptfuncs.h"
>
</File>
<File
diff --git a/dists/msvc9/parallaction.vcproj b/dists/msvc9/parallaction.vcproj
index 5eebf23e7e..bdc93860f9 100644
--- a/dists/msvc9/parallaction.vcproj
+++ b/dists/msvc9/parallaction.vcproj
@@ -230,6 +230,14 @@
>
</File>
<File
+ RelativePath="..\..\engines\parallaction\input.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\parallaction\input.h"
+ >
+ </File>
+ <File
RelativePath="..\..\engines\parallaction\inventory.cpp"
>
</File>
diff --git a/dists/msvc9/saga.vcproj b/dists/msvc9/saga.vcproj
index 8d70a3d411..9675dda2e9 100644
--- a/dists/msvc9/saga.vcproj
+++ b/dists/msvc9/saga.vcproj
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="windows-1252"?>
+<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9,00"
@@ -234,10 +234,6 @@
>
</File>
<File
- RelativePath="..\..\engines\saga\ihnm_introproc.cpp"
- >
- </File>
- <File
RelativePath="..\..\engines\saga\image.cpp"
>
</File>
@@ -254,15 +250,19 @@
>
</File>
<File
- RelativePath="..\..\engines\saga\isomap.cpp"
+ RelativePath="..\..\engines\saga\introproc_ihnm.cpp"
>
</File>
<File
- RelativePath="..\..\engines\saga\isomap.h"
+ RelativePath="..\..\engines\saga\introproc_ite.cpp"
>
</File>
<File
- RelativePath="..\..\engines\saga\ite_introproc.cpp"
+ RelativePath="..\..\engines\saga\isomap.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\engines\saga\isomap.h"
>
</File>
<File
@@ -334,10 +334,6 @@
>
</File>
<File
- RelativePath="..\..\engines\saga\sagaresnames.h"
- >
- </File>
- <File
RelativePath="..\..\engines\saga\saveload.cpp"
>
</File>
diff --git a/dists/msvc9/scummvm.vcproj b/dists/msvc9/scummvm.vcproj
index a0cc2c6e91..bc88e6fc66 100644
--- a/dists/msvc9/scummvm.vcproj
+++ b/dists/msvc9/scummvm.vcproj
@@ -43,7 +43,7 @@
AdditionalOptions="/wd4201 /wd4512 /wd4511 /wd4100 /wd4121 /wd4310 /wd4706 /wd4127 /wd4189 /wd4702 /wd4996"
Optimization="0"
AdditionalIncludeDirectories="../..;../../engines"
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;USE_ZLIB;USE_MAD;USE_VORBIS;USE_MPEG2;USE_NASM;USE_MT32EMU"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;USE_ZLIB;USE_MAD;USE_VORBIS;USE_MPEG2;USE_NASM;USE_MT32EMU;ENABLE_AGI;ENABLE_AGOS;ENABLE_CINE;ENABLE_CRUISE;ENABLE_DRASCULA;ENABLE_GOB;ENABLE_IGOR;ENABLE_KYRA;ENABLE_LURE;ENABLE_M4;ENABLE_MADE;ENABLE_PARALLACTION;ENABLE_QUEEN;ENABLE_SAGA;ENABLE_SCUMM;ENABLE_SKY;ENABLE_SWORD1;ENABLE_SWORD2;ENABLE_TOUCHE;ENABLE_SCUMM_7_8;ENABLE_HE"
MinimalRebuild="true"
ExceptionHandling="1"
BasicRuntimeChecks="3"
@@ -133,7 +133,7 @@
InlineFunctionExpansion="1"
OmitFramePointers="true"
AdditionalIncludeDirectories="../..;../../engines"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;USE_ZLIB;USE_MAD;USE_VORBIS;USE_MPEG2;USE_MT32EMU"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;USE_ZLIB;USE_MAD;USE_VORBIS;USE_MPEG2;USE_MT32EMU;ENABLE_AGI;ENABLE_AGOS;ENABLE_CINE;ENABLE_CRUISE;ENABLE_DRASCULA;ENABLE_GOB;ENABLE_IGOR;ENABLE_KYRA;ENABLE_LURE;ENABLE_M4;ENABLE_MADE;ENABLE_PARALLACTION;ENABLE_QUEEN;ENABLE_SAGA;ENABLE_SCUMM;ENABLE_SKY;ENABLE_SWORD1;ENABLE_SWORD2;ENABLE_TOUCHE;ENABLE_SCUMM_7_8;ENABLE_HE"
StringPooling="true"
MinimalRebuild="false"
ExceptionHandling="1"
@@ -430,6 +430,14 @@
>
</File>
<File
+ RelativePath="..\..\common\unarj.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\common\unarj.h"
+ >
+ </File>
+ <File
RelativePath="..\..\common\unzip.cpp"
>
</File>
@@ -580,6 +588,14 @@
>
</File>
<File
+ RelativePath="..\..\sound\musicplugin.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\sound\musicplugin.h"
+ >
+ </File>
+ <File
RelativePath="..\..\sound\null.cpp"
>
</File>
diff --git a/dists/wii/READMII b/dists/wii/READMII
new file mode 100644
index 0000000000..4f157dffe7
--- /dev/null
+++ b/dists/wii/READMII
@@ -0,0 +1,64 @@
+Wii port of ScummVM README
+--------------------------
+
+features not compiled in:
+- the AGI game engine
+
+REQUIREMENTS
+
+ - sd card
+ - wiimote or gamecube controller in port 1
+
+INSTALL
+
+ - copy the "apps" folder to the root of your sd card
+ - copy your demos and/or games onto the same sd card
+ each game goes into its own subdirectory, do not place those under
+ "/apps/scummvm", and do not set the "theme" or "extra" path to that folder
+ freeware versions: http://scummvm.org/downloads.php#extras
+ demos: http://scummvm.org/demos.php
+
+RUN
+
+ either use the homebrew channel, available at
+
+ http://hbc.hackmii.com/
+
+ or load "boot.dol" with your favorite loader
+
+CONTROLS
+
+ wiimote
+
+ analog stick: mouse movement
+ a: left mouse button
+ b: right mouse button
+ minus: escape
+ plus: "." (skip current line of text)
+ 2: enter
+ home: f5 (scummvm menu)
+ dpad up: shift (mass add for the gui)
+ dpad down: "0"
+ dpad left: "y"
+ dpad right: "n"
+
+ gamecube pad
+
+ analog stick: mouse movement
+ a: left mouse button
+ b: right mouse button
+ x: escape
+ y: "." (skip current line of text)
+ z: enter
+ start: f5 (scummvm menu)
+ dpad up: shift (mass add for the gui)
+ dpad down: "0"
+ dpad left: "y"
+ dpad right: "n"
+
+THANKS
+
+ shagkur and WinterMute, for devkitppc/libogc and the coorperation
+ svpe, for fixing the libfat feof/thread bugs on the last minute
+ para, for making wiiuse available in libogc
+
diff --git a/dists/wii/icon.png b/dists/wii/icon.png
new file mode 100644
index 0000000000..0a3264377f
--- /dev/null
+++ b/dists/wii/icon.png
Binary files differ
diff --git a/dists/wii/meta.xml b/dists/wii/meta.xml
new file mode 100644
index 0000000000..fb53474052
--- /dev/null
+++ b/dists/wii/meta.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<app version="1">
+ <name>ScummVM</name>
+ <coder>The ScummVM Team</coder>
+ <version>rev FIXME</version>
+ <release_date>FIXME</release_date>
+ <short_description>Point &amp; Click Adventures</short_description>
+ <long_description>ScummVM is a program which allows you to run certain classic graphical point-and-click adventure games, provided you already have their data files. The clever part about this: ScummVM just replaces the executables shipped with the games, allowing you to play them on systems for which they were never designed!
+
+Some of the adventures ScummVM supports include Adventure Soft's Simon the Sorcerer 1 and 2; Revolution's Beneath A Steel Sky, Broken Sword 1 and Broken Sword 2; Flight of the Amazon Queen; Wyrmkeep's Inherit the Earth; Coktel Vision's Gobliiins; Westwood Studios' The Legend of Kyrandia and games based on LucasArts' SCUMM (Script Creation Utility for Maniac Mansion) system such as Monkey Island, Day of the Tentacle, Sam and Max and more.</long_description>
+</app>
+
diff --git a/engines/agi/detection.cpp b/engines/agi/detection.cpp
index f526c51a27..cd6942f9c0 100644
--- a/engines/agi/detection.cpp
+++ b/engines/agi/detection.cpp
@@ -2148,7 +2148,7 @@ bool AgiMetaEngine::createInstance(OSystem *syst, Engine **engine, const Common:
}
const Common::ADGameDescription *AgiMetaEngine::fallbackDetect(const FSList *fslist) const {
- typedef Common::HashMap<Common::String, int32, Common::CaseSensitiveString_Hash, Common::CaseSensitiveString_EqualTo> IntMap;
+ typedef Common::HashMap<Common::String, int32> IntMap;
IntMap allFiles;
bool matchedUsingFilenames = false;
bool matchedUsingWag = false;
diff --git a/engines/agi/preagi_mickey.cpp b/engines/agi/preagi_mickey.cpp
index 6944eee9f2..08f8969ca3 100644
--- a/engines/agi/preagi_mickey.cpp
+++ b/engines/agi/preagi_mickey.cpp
@@ -238,7 +238,7 @@ bool Mickey::checkMenu() {
memcpy(buffer, &menu, sizeof(MSA_MENU));
getMenuSel(buffer, &iSel0, &iSel1);
- delete [] buffer;
+ delete[] buffer;
return parse(menu.cmd[iSel0].data[iSel1], menu.arg[iSel0].data[iSel1]);
}
@@ -645,7 +645,7 @@ void Mickey::playSound(ENUM_MSA_SOUND iSound) {
case Common::EVENT_LBUTTONUP:
case Common::EVENT_RBUTTONUP:
case Common::EVENT_KEYDOWN:
- delete [] buffer;
+ delete[] buffer;
return;
default:
break;
@@ -657,7 +657,7 @@ void Mickey::playSound(ENUM_MSA_SOUND iSound) {
break;
}
- delete [] buffer;
+ delete[] buffer;
}
// Graphics
@@ -893,7 +893,7 @@ void Mickey::drawLogo() {
_vm->_picture->showPic(10, 10, w, h);
- delete [] buffer;
+ delete[] buffer;
}
void Mickey::animate() {
diff --git a/engines/agos/agos.cpp b/engines/agos/agos.cpp
index 015aff3458..9b22240f83 100644
--- a/engines/agos/agos.cpp
+++ b/engines/agos/agos.cpp
@@ -23,7 +23,7 @@
*
*/
-
+#include <time.h> // for AGOSEngine::getTime()
#include "common/config-manager.h"
#include "common/file.h"
@@ -38,8 +38,6 @@
#include "sound/mididrv.h"
#include "sound/mods/protracker.h"
-#include <time.h> // for AGOSEngine::getTime()
-
using Common::File;
namespace AGOS {
@@ -879,7 +877,7 @@ AGOSEngine::~AGOSEngine() {
_midi.close();
for (uint i = 0; i < _itemHeap.size(); i++) {
- delete [] _itemHeap[i];
+ delete[] _itemHeap[i];
}
_itemHeap.clear();
@@ -908,7 +906,7 @@ AGOSEngine::~AGOSEngine() {
delete _dummyItem3;
delete _dummyWindow;
- delete [] _windowList;
+ delete[] _windowList;
delete _debugger;
delete _moviePlay;
@@ -919,25 +917,31 @@ GUI::Debugger *AGOSEngine::getDebugger() {
return _debugger;
}
-void AGOSEngine::pause() {
- _keyPressed.reset();
- _pause = true;
- bool ambient_status = _ambientPaused;
- bool music_status = _musicPaused;
+void AGOSEngine::pauseEngineIntern(bool pauseIt) {
+ if (pauseIt) {
+ _keyPressed.reset();
+ _pause = true;
+
+ _midi.pause(true);
+ _mixer->pauseAll(true);
+ _sound->ambientPause(true);
+ } else {
+ _pause = false;
+
+ _midi.pause(_musicPaused);
+ _mixer->pauseAll(false);
+ _sound->ambientPause(_ambientPaused);
+ }
+}
- _midi.pause(true);
- _mixer->pauseAll(true);
- _sound->ambientPause(true);
+void AGOSEngine::pause() {
+ pauseEngine(true);
while (_pause) {
delay(1);
if (_keyPressed.keycode == Common::KEYCODE_p)
- _pause = false;
+ pauseEngine(false);
}
-
- _midi.pause(music_status);
- _mixer->pauseAll(false);
- _sound->ambientPause(ambient_status);
}
int AGOSEngine::go() {
@@ -1017,7 +1021,7 @@ void AGOSEngine::shutdown() {
_midi.close();
for (uint i = 0; i < _itemHeap.size(); i++) {
- delete [] _itemHeap[i];
+ delete[] _itemHeap[i];
}
_itemHeap.clear();
@@ -1046,7 +1050,7 @@ void AGOSEngine::shutdown() {
delete _dummyItem3;
delete _dummyWindow;
- delete [] _windowList;
+ delete[] _windowList;
delete _debugger;
delete _moviePlay;
diff --git a/engines/agos/agos.h b/engines/agos/agos.h
index 1d5eda8392..448d26a9d0 100644
--- a/engines/agos/agos.h
+++ b/engines/agos/agos.h
@@ -1205,6 +1205,7 @@ protected:
void checkTimerCallback();
void delay(uint delay);
void pause();
+ virtual void pauseEngineIntern(bool pause);
void waitForMark(uint i);
void scrollScreen();
diff --git a/engines/cine/anim.cpp b/engines/cine/anim.cpp
index 8a14f677c3..055eb733c3 100644
--- a/engines/cine/anim.cpp
+++ b/engines/cine/anim.cpp
@@ -53,6 +53,7 @@ AnimData animDataTable[NUM_MAX_ANIMDATA];
static const AnimDataEntry transparencyData[] = {
{"ALPHA", 0xF},
+ {"TITRE", 0xF},
{"TITRE2", 0xF},
{"ET", 0xC},
{"L311", 0x3},
@@ -380,8 +381,8 @@ void AnimData::save(Common::OutSaveFile &fHandle) const {
fHandle.writeUint16BE(_var1);
fHandle.writeUint16BE(_bpp);
fHandle.writeUint16BE(_height);
- fHandle.writeUint32BE(0); // _data
- fHandle.writeUint32BE(0); // _mask
+ fHandle.writeUint32BE(_data != NULL); // _data
+ fHandle.writeUint32BE(_mask != NULL); // _mask
fHandle.writeUint16BE(_fileIdx);
fHandle.writeUint16BE(_frameIdx);
fHandle.write(_name, sizeof(_name));
@@ -729,7 +730,7 @@ void loadResource(const char *resourceName) {
} else if (strstr(resourceName, ".SEQ")) {
loadSeq(resourceName, -1);
return;
- } else if (strstr(resourceName, "ECHEC")) {
+ } else if (strstr(resourceName, "ECHEC")) { // Echec (French) means failure
exitEngine = 1;
return;
}
diff --git a/engines/cine/bg.cpp b/engines/cine/bg.cpp
index b6c07a05cb..c5b7fb4e3d 100644
--- a/engines/cine/bg.cpp
+++ b/engines/cine/bg.cpp
@@ -37,7 +37,7 @@ uint16 bgVar0;
byte *additionalBgTable[9];
byte currentAdditionalBgIdx = 0, currentAdditionalBgIdx2 = 0;
-byte loadCt(const char *ctName) {
+byte loadCtFW(const char *ctName) {
uint16 header[32];
byte *ptr, *dataPtr;
@@ -46,79 +46,62 @@ byte loadCt(const char *ctName) {
ptr = dataPtr = readBundleFile(findFileInBundle(ctName));
- if (g_cine->getGameType() == Cine::GType_OS) {
- uint16 bpp = READ_BE_UINT16(ptr); ptr += 2;
- if (bpp == 8) {
- ctColorMode = 1;
- memcpy(newPalette, ptr, 256 * 3);
- ptr += 3 * 256;
- memcpy(page3Raw, ptr, 320 * 200);
- } else {
- ctColorMode = 0;
- for (int i = 0; i < 16; i++) {
- tempPalette[i] = READ_BE_UINT16(ptr);
- ptr += 2;
- }
-
- gfxResetRawPage(page3Raw);
- gfxConvertSpriteToRaw(page3Raw, ptr, 160, 200);
- }
- } else {
- loadRelatedPalette(ctName);
+ loadRelatedPalette(ctName);
- assert(strstr(ctName, ".NEO"));
+ assert(strstr(ctName, ".NEO"));
- Common::MemoryReadStream readS(ptr, 32);
-
- for (int i = 0; i < 16; i++) {
- header[i] = readS.readUint16BE();
- }
+ Common::MemoryReadStream readS(ptr, 32);
- gfxConvertSpriteToRaw(page3Raw, ptr + 0x80, 160, 200);
+ for (int i = 0; i < 16; i++) {
+ header[i] = readS.readUint16BE();
}
+ gfxConvertSpriteToRaw(page3Raw, ptr + 0x80, 160, 200);
+
free(dataPtr);
return 0;
}
-void loadBgHigh(const char *currentPtr) {
- memcpy(newPalette, currentPtr, 256 * 3);
- currentPtr += 256 * 3;
+byte loadCtOS(const char *ctName) {
+ byte *ptr, *dataPtr;
- memcpy(page2Raw, currentPtr, 320 * 200);
+ if (currentCtName != ctName)
+ strcpy(currentCtName, ctName);
+
+ ptr = dataPtr = readBundleFile(findFileInBundle(ctName));
- newColorMode = 2;
- bgColorMode = 1;
+ uint16 bpp = READ_BE_UINT16(ptr);
+ ptr += 2;
+
+ if (bpp == 8) {
+ memcpy(page3Raw, ptr + 256 * 3, 320 * 200);
+ renderer->loadCt256(ptr, ctName);
+ } else {
+ gfxConvertSpriteToRaw(page3Raw, ptr + 32, 160, 200);
+ renderer->loadCt16(ptr, ctName);
+ }
+ free(dataPtr);
+ return 0;
}
byte loadBg(const char *bgName) {
byte *ptr, *dataPtr;
- if (currentBgName[0] != bgName)
- strcpy(currentBgName[0], bgName);
-
byte fileIdx = findFileInBundle(bgName);
ptr = dataPtr = readBundleFile(fileIdx);
- uint16 bpp = READ_BE_UINT16(ptr); ptr += 2;
+ uint16 bpp = READ_BE_UINT16(ptr);
+ ptr += 2;
+
if (bpp == 8) {
- loadBgHigh((const char *)ptr);
+ renderer->loadBg256(ptr, bgName);
} else {
- newColorMode = 1;
- bgColorMode = 0;
-
- for (int i = 0; i < 16; i++) {
- tempPalette[i] = READ_BE_UINT16(ptr);
- ptr += 2;
- }
-
if (g_cine->getGameType() == Cine::GType_FW) {
loadRelatedPalette(bgName);
}
- gfxResetRawPage(page2Raw);
- gfxConvertSpriteToRaw(page2Raw, ptr, 160, 200);
+ renderer->loadBg16(ptr, bgName);
}
free(dataPtr);
return 0;
@@ -127,28 +110,15 @@ byte loadBg(const char *bgName) {
void addBackground(const char *bgName, uint16 bgIdx) {
byte *ptr, *dataPtr;
- strcpy(currentBgName[bgIdx], bgName);
-
byte fileIdx = findFileInBundle(bgName);
ptr = dataPtr = readBundleFile(fileIdx);
- additionalBgTable[bgIdx] = (byte *) malloc(320 * 200);
-
uint16 bpp = READ_BE_UINT16(ptr); ptr += 2;
if (bpp == 8) {
- bgColorMode = 1;
- memcpy(newPalette, ptr, 256 * 3);
- ptr += 3 * 256;
- memcpy(additionalBgTable[bgIdx], ptr, 320 * 200);
+ renderer->loadBg256(ptr, bgName, bgIdx);
} else {
- bgColorMode = 0;
- for (int i = 0; i < 16; i++) {
- tempPalette[i] = READ_BE_UINT16(ptr);
- ptr += 2;
- }
-
- gfxConvertSpriteToRaw(additionalBgTable[bgIdx], ptr, 160, 200);
+ renderer->loadBg16(ptr, bgName, bgIdx);
}
free(dataPtr);
}
diff --git a/engines/cine/bg.h b/engines/cine/bg.h
index ca5c222131..5fa8209131 100644
--- a/engines/cine/bg.h
+++ b/engines/cine/bg.h
@@ -27,20 +27,9 @@
#define CINE_BG_H
namespace Cine {
-struct bgData {
- byte *data;
- byte colorMode;
- byte *highPalette;
- uint16 *lowPalette;
-};
-
byte loadBg(const char *bgName);
-byte loadCt(const char *bgName);
-
-//extern bgData additionalBgTable[9];
-extern byte *additionalBgTable[9];
-extern byte currentAdditionalBgIdx;
-extern byte currentAdditionalBgIdx2;
+byte loadCtFW(const char *bgName);
+byte loadCtOS(const char *bgName);
void addBackground(const char *bgName, uint16 bgIdx);
diff --git a/engines/cine/bg_list.cpp b/engines/cine/bg_list.cpp
index a70733dc68..cf25f1d355 100644
--- a/engines/cine/bg_list.cpp
+++ b/engines/cine/bg_list.cpp
@@ -40,62 +40,20 @@ Common::List<BGIncrust> bgIncrustList;
/*! \brief Add masked sprite to the background
* \param objIdx Sprite description
- * \param addList Add sprite to incrust list if true
- * \todo Fix incrust objects on CT background. Always drawing incrust elements
- * on CT background breaks game zones
*/
-void addToBGList(int16 objIdx, bool addList) {
- int16 x = objectTable[objIdx].x;
- int16 y = objectTable[objIdx].y;
- int16 width = animDataTable[objectTable[objIdx].frame]._var1;
- int16 height = animDataTable[objectTable[objIdx].frame]._height;
- const byte *data = animDataTable[objectTable[objIdx].frame].data();
- const byte *mask = animDataTable[objectTable[objIdx].frame].mask();
-// int16 part = objectTable[objIdx].part;
-
- // Operation Stealth may switch among multiple backgrounds
- if (g_cine->getGameType() == GType_OS) {
- for (int i = 0; i < 8; i++) {
- if (additionalBgTable[i]) {
- drawSpriteRaw2(data, objectTable[objIdx].part, width, height, additionalBgTable[i], x, y);
- }
- }
- } else {
- drawSpriteRaw(data, mask, width, height, page2Raw, x, y);
- }
+void addToBGList(int16 objIdx) {
+ renderer->incrustSprite(objectTable[objIdx]);
- if (addList)
- createBgIncrustListElement(objIdx, 0);
+ createBgIncrustListElement(objIdx, 0);
}
/*! \brief Add filled sprite to the background
* \param objIdx Sprite description
- * \param addList Add sprite to incrust list if true
- * \todo Fix incrust objects on CT background. Always drawing incrust elements
- * on CT background breaks game zones
*/
-void addSpriteFilledToBGList(int16 objIdx, bool addList) {
- int16 x = objectTable[objIdx].x;
- int16 y = objectTable[objIdx].y;
- int16 width = animDataTable[objectTable[objIdx].frame]._realWidth;
- int16 height = animDataTable[objectTable[objIdx].frame]._height;
- const byte *data = animDataTable[objectTable[objIdx].frame].data();
-
- if (data) {
- // Operation Stealth may switch among multiple backgrounds
- if (g_cine->getGameType() == GType_OS) {
- for (int i = 0; i < 8; i++) {
- if (additionalBgTable[i]) {
- gfxFillSprite(data, width, height, additionalBgTable[i], x, y);
- }
- }
- } else {
- gfxFillSprite(data, width, height, page2Raw, x, y);
- }
- }
+void addSpriteFilledToBGList(int16 objIdx) {
+ renderer->incrustMask(objectTable[objIdx]);
- if (addList)
- createBgIncrustListElement(objIdx, 1);
+ createBgIncrustListElement(objIdx, 1);
}
/*! \brief Add new element to incrust list
@@ -115,7 +73,7 @@ void createBgIncrustListElement(int16 objIdx, int16 param) {
bgIncrustList.push_back(tmp);
}
-/*! \brief Reset var8 (probably something related to bgIncrustList
+/*! \brief Reset var8 (probably something related to bgIncrustList)
*/
void resetBgIncrustList(void) {
var8 = 0;
@@ -142,9 +100,9 @@ void loadBgIncrustFromSave(Common::InSaveFile &fHandle) {
bgIncrustList.push_back(tmp);
if (tmp.param == 0) {
- addToBGList(tmp.objIdx, false);
+ renderer->incrustSprite(objectTable[tmp.objIdx]);
} else {
- addSpriteFilledToBGList(tmp.objIdx, false);
+ renderer->incrustMask(objectTable[tmp.objIdx]);
}
}
}
diff --git a/engines/cine/bg_list.h b/engines/cine/bg_list.h
index 9ceae0acf5..1849d6ec3d 100644
--- a/engines/cine/bg_list.h
+++ b/engines/cine/bg_list.h
@@ -46,8 +46,8 @@ struct BGIncrust {
extern Common::List<BGIncrust> bgIncrustList;
extern uint32 var8;
-void addToBGList(int16 objIdx, bool addList = true);
-void addSpriteFilledToBGList(int16 idx, bool addList = true);
+void addToBGList(int16 objIdx);
+void addSpriteFilledToBGList(int16 idx);
void createBgIncrustListElement(int16 objIdx, int16 param);
void resetBgIncrustList(void);
diff --git a/engines/cine/cine.cpp b/engines/cine/cine.cpp
index 41dd9be16f..efc33fadaf 100644
--- a/engines/cine/cine.cpp
+++ b/engines/cine/cine.cpp
@@ -95,7 +95,9 @@ int CineEngine::init() {
int CineEngine::go() {
CursorMan.showMouse(true);
mainLoop(1);
- gfxDestroy();
+
+ delete renderer;
+ delete[] page3Raw;
delete g_sound;
return 0;
}
@@ -105,8 +107,14 @@ void CineEngine::initialize() {
setupOpcodes();
initLanguage(g_cine->getLanguage());
- gfxInit();
+ if (g_cine->getGameType() == Cine::GType_OS) {
+ renderer = new OSRenderer;
+ } else {
+ renderer = new FWRenderer;
+ }
+
+ page3Raw = new byte[320 * 200];
textDataPtr = (byte *)malloc(8000);
partBuffer = (PartBuffer *)malloc(NUM_MAX_PARTDATA * sizeof(PartBuffer));
diff --git a/engines/cine/cine.h b/engines/cine/cine.h
index 7ce5231446..710840c17e 100644
--- a/engines/cine/cine.h
+++ b/engines/cine/cine.h
@@ -64,7 +64,7 @@ enum CineGameFeatures {
struct CINEGameDescription;
-typedef Common::HashMap<Common::String, const char *, Common::CaseSensitiveString_Hash, Common::CaseSensitiveString_EqualTo> StringPtrHashMap;
+typedef Common::HashMap<Common::String, const char *> StringPtrHashMap;
class CineEngine : public Engine {
diff --git a/engines/cine/gfx.cpp b/engines/cine/gfx.cpp
index 2730a92e62..47446f2410 100644
--- a/engines/cine/gfx.cpp
+++ b/engines/cine/gfx.cpp
@@ -27,6 +27,7 @@
#include "cine/bg.h"
#include "cine/bg_list.h"
#include "cine/various.h"
+#include "cine/pal.h"
#include "common/endian.h"
#include "common/system.h"
@@ -35,18 +36,8 @@
namespace Cine {
-uint16 c_palette[256];
-byte colorMode256 = 0;
-byte palette256[256 * 3];
-byte newPalette[256 * 3];
-byte newColorMode = 0;
-byte ctColorMode = 0;
-byte bgColorMode = 0;
-
-byte *screenBuffer;
-byte *page1Raw;
-byte *page2Raw;
byte *page3Raw;
+FWRenderer *renderer = NULL;
static const byte mouseCursorNormal[] = {
0x00, 0x00, 0x40, 0x00, 0x60, 0x00, 0x70, 0x00,
@@ -96,28 +87,1197 @@ static const byte cursorPalette[] = {
0xff, 0xff, 0xff, 0xff
};
-void gfxInit() {
- screenBuffer = (byte *)malloc(320 * 200);
- page1Raw = (byte *)malloc(320 * 200);
- page2Raw = (byte *)malloc(320 * 200);
- page3Raw = (byte *)malloc(320 * 200);
- if (!screenBuffer || !page1Raw || !page2Raw || !page3Raw) {
- error("Unable to allocate offscreen buffers");
+/*! \brief Initialize renderer
+ */
+FWRenderer::FWRenderer() : _background(NULL), _palette(NULL), _cmd(""),
+ _cmdY(0), _messageBg(0), _backBuffer(new byte[_screenSize]),
+ _activeLowPal(NULL), _changePal(0) {
+
+ assert(_backBuffer);
+
+ memset(_backBuffer, 0, _screenSize);
+ memset(_bgName, 0, sizeof (_bgName));
+}
+
+/* \brief Destroy renderer
+ */
+FWRenderer::~FWRenderer() {
+ delete[] _background;
+ delete[] _palette;
+ delete[] _backBuffer;
+ delete[] _activeLowPal;
+}
+
+/* \brief Reset renderer state
+ */
+void FWRenderer::clear() {
+ delete[] _background;
+ delete[] _palette;
+ delete[] _activeLowPal;
+
+ _background = NULL;
+ _palette = NULL;
+ _activeLowPal = NULL;
+
+ memset(_backBuffer, 0, _screenSize);
+
+ _cmd = "";
+ _cmdY = 0;
+ _messageBg = 0;
+ _changePal = 0;
+}
+
+/*! \brief Draw 1bpp sprite using selected color
+ * \param obj Object info
+ * \param fillColor Sprite color
+ */
+void FWRenderer::fillSprite(const objectStruct &obj, uint8 color) {
+ const byte *data = animDataTable[obj.frame].data();
+ int x, y, width, height;
+
+ x = obj.x;
+ y = obj.y;
+ width = animDataTable[obj.frame]._realWidth;
+ height = animDataTable[obj.frame]._height;
+
+ gfxFillSprite(data, width, height, _backBuffer, x, y, color);
+}
+
+/*! \brief Draw 1bpp sprite using selected color on background
+ * \param obj Object info
+ * \param fillColor Sprite color
+ */
+void FWRenderer::incrustMask(const objectStruct &obj, uint8 color) {
+ const byte *data = animDataTable[obj.frame].data();
+ int x, y, width, height;
+
+ x = obj.x;
+ y = obj.y;
+ width = animDataTable[obj.frame]._realWidth;
+ height = animDataTable[obj.frame]._height;
+
+ gfxFillSprite(data, width, height, _background, x, y, color);
+}
+
+/*! \brief Draw color sprite using with external mask
+ * \param obj Object info
+ * \param mask External mask
+ */
+void FWRenderer::drawMaskedSprite(const objectStruct &obj, const byte *mask) {
+ const byte *data = animDataTable[obj.frame].data();
+ int x, y, width, height;
+
+ x = obj.x;
+ y = obj.y;
+ width = animDataTable[obj.frame]._realWidth;
+ height = animDataTable[obj.frame]._height;
+
+ assert(mask);
+
+ drawSpriteRaw(data, mask, width, height, _backBuffer, x, y);
+}
+
+/*! \brief Draw color sprite
+ * \param obj Object info
+ */
+void FWRenderer::drawSprite(const objectStruct &obj) {
+ const byte *mask = animDataTable[obj.frame].mask();
+ drawMaskedSprite(obj, mask);
+}
+
+/*! \brief Draw color sprite on background
+ * \param obj Object info
+ */
+void FWRenderer::incrustSprite(const objectStruct &obj) {
+ const byte *data = animDataTable[obj.frame].data();
+ const byte *mask = animDataTable[obj.frame].mask();
+ int x, y, width, height;
+
+ x = obj.x;
+ y = obj.y;
+ width = animDataTable[obj.frame]._realWidth;
+ height = animDataTable[obj.frame]._height;
+
+ assert(mask);
+
+ drawSpriteRaw(data, mask, width, height, _background, x, y);
+}
+
+/*! \brief Draw command box on screen
+ */
+void FWRenderer::drawCommand() {
+ unsigned int i;
+ int x = 10, y = _cmdY;
+
+ drawPlainBox(x, y, 301, 11, 0);
+ drawBorder(x - 1, y - 1, 302, 12, 2);
+
+ x += 2;
+ y += 2;
+
+ for (i = 0; i < _cmd.size(); i++) {
+ x = drawChar(_cmd[i], x, y);
+ }
+}
+
+/*! \brief Draw message in a box
+ * \param str Message to draw
+ * \param x Top left message box corner coordinate
+ * \param y Top left message box corner coordinate
+ * \param width Message box width
+ * \param color Message box background color
+ */
+void FWRenderer::drawMessage(const char *str, int x, int y, int width, byte color) {
+ int i, tx, ty, tw;
+ int line = 0, words = 0, cw = 0;
+ int space = 0, extraSpace = 0;
+
+ drawPlainBox(x, y, width, 4, color);
+ tx = x + 4;
+ ty = str[0] ? y - 5 : y + 4;
+ tw = width - 8;
+
+ for (i = 0; str[i]; i++, line--) {
+ // Fit line of text into textbox
+ if (!line) {
+ while (str[i] == ' ') i++;
+ line = fitLine(str + i, tw, words, cw);
+
+ if ( str[i + line] != '\0' && str[i + line] != 0x7C && words) {
+ space = (tw - cw) / words;
+ extraSpace = (tw - cw) % words;
+ } else {
+ space = 5;
+ extraSpace = 0;
+ }
+
+ ty += 9;
+ drawPlainBox(x, ty, width, 9, color);
+ tx = x + 4;
+ }
+
+ // draw characters
+ if (str[i] == ' ') {
+ tx += space + extraSpace;
+
+ if (extraSpace) {
+ extraSpace = 0;
+ }
+ } else {
+ tx = drawChar(str[i], tx, ty);
+ }
+ }
+
+ ty += 9;
+ drawPlainBox(x, ty, width, 4, color);
+ drawDoubleBorder(x, y, width, ty - y + 4, 2);
+}
+
+/*! \brief Draw rectangle on screen
+ * \param x Top left corner coordinate
+ * \param y Top left corner coordinate
+ * \param width Rectangle width
+ * \param height Rectangle height
+ * \param color Fill color
+ */
+void FWRenderer::drawPlainBox(int x, int y, int width, int height, byte color) {
+ int i;
+ byte *dest = _backBuffer + y * 320 + x;
+
+ if (width < 0) {
+ x += width;
+ width = -width;
}
- memset(page1Raw, 0, 320 * 200);
- memset(page2Raw, 0, 320 * 200);
- memset(page3Raw, 0, 320 * 200);
- memset(additionalBgTable, 0, sizeof(additionalBgTable));
- additionalBgTable[0] = page2Raw;
- additionalBgTable[8] = page3Raw;
+ if (height < 0) {
+ y += height;
+ height = -height;
+ }
+
+ for (i = 0; i < height; i++) {
+ memset(dest + i * 320, color, width);
+ }
+}
+
+/*! \brief Draw empty rectangle
+ * \param x Top left corner coordinate
+ * \param y Top left corner coordinate
+ * \param width Rectangle width
+ * \param height Rectangle height
+ * \param color Line color
+ */
+void FWRenderer::drawBorder(int x, int y, int width, int height, byte color) {
+ drawLine(x, y, width, 1, color);
+ drawLine(x, y + height, width, 1, color);
+ drawLine(x, y, 1, height, color);
+ drawLine(x + width, y, 1, height + 1, color);
+}
+
+/*! \brief Draw empty 2 color rectangle (inner line color is black)
+ * \param x Top left corner coordinate
+ * \param y Top left corner coordinate
+ * \param width Rectangle width
+ * \param height Rectangle height
+ * \param color Outter line color
+ */
+void FWRenderer::drawDoubleBorder(int x, int y, int width, int height, byte color) {
+ drawBorder(x + 1, y + 1, width - 2, height - 2, 0);
+ drawBorder(x, y, width, height, color);
+}
+
+/*! \brief Draw text character on screen
+ * \param character Character to draw
+ * \param x Character coordinate
+ * \param y Character coordinate
+ */
+int FWRenderer::drawChar(char character, int x, int y) {
+ int width, idx;
+
+ if (character == ' ') {
+ x += 5;
+ } else if ((width = fontParamTable[(unsigned char)character].characterWidth)) {
+ idx = fontParamTable[(unsigned char)character].characterIdx;
+ drawSpriteRaw(textTable[idx][0], textTable[idx][1], 16, 8, _backBuffer, x, y);
+ x += width + 1;
+ }
+
+ return x;
+}
+
+/*! \brief Draw Line
+ * \param x Line end coordinate
+ * \param y Line end coordinate
+ * \param width Horizontal line length
+ * \param height Vertical line length
+ * \param color Line color
+ * \note Either width or height must be equal to 1
+ */
+void FWRenderer::drawLine(int x, int y, int width, int height, byte color) {
+ // this line is a special case of rectangle ;-)
+ drawPlainBox(x, y, width, height, color);
+}
+
+/*! \brief Hide invisible parts of the sprite
+ * \param[in,out] mask Mask to be updated
+ * \param it Overlay info from overlayList
+ */
+void FWRenderer::remaskSprite(byte *mask, Common::List<overlay>::iterator it) {
+ AnimData &sprite = animDataTable[objectTable[it->objIdx].frame];
+ int x, y, width, height, idx;
+ int mx, my, mw, mh;
+
+ x = objectTable[it->objIdx].x;
+ y = objectTable[it->objIdx].y;
+ width = sprite._realWidth;
+ height = sprite._height;
+
+ for (++it; it != overlayList.end(); ++it) {
+ if (it->type != 5) {
+ continue;
+ }
+
+ idx = ABS(objectTable[it->objIdx].frame);
+ mx = objectTable[it->objIdx].x;
+ my = objectTable[it->objIdx].y;
+ mw = animDataTable[idx]._realWidth;
+ mh = animDataTable[idx]._height;
+
+ gfxUpdateSpriteMask(mask, x, y, width, height, animDataTable[idx].data(), mx, my, mw, mh);
+ }
+}
+
+/*! \brief Draw background to backbuffer
+ */
+void FWRenderer::drawBackground() {
+ assert(_background);
+ memcpy(_backBuffer, _background, _screenSize);
+}
+
+/*! \brief Draw one overlay
+ * \param it Overlay info
+ */
+void FWRenderer::renderOverlay(const Common::List<overlay>::iterator &it) {
+ int idx, len, width;
+ objectStruct *obj;
+ AnimData *sprite;
+ byte *mask;
+
+ switch (it->type) {
+ // color sprite
+ case 0:
+ sprite = animDataTable + objectTable[it->objIdx].frame;
+ len = sprite->_realWidth * sprite->_height;
+ mask = new byte[len];
+ memcpy(mask, sprite->mask(), len);
+ remaskSprite(mask, it);
+ drawMaskedSprite(objectTable[it->objIdx], mask);
+ delete[] mask;
+ break;
+
+ // game message
+ case 2:
+ if (it->objIdx >= messageTable.size()) {
+ return;
+ }
+
+ _messageLen += messageTable[it->objIdx].size();
+ drawMessage(messageTable[it->objIdx].c_str(), it->x, it->y, it->width, it->color);
+ break;
+
+ // action failure message
+ case 3:
+ idx = it->objIdx * 4 + g_cine->_rnd.getRandomNumber(3);
+ len = strlen(failureMessages[idx]);
+ _messageLen += len;
+ width = 6 * len + 20;
+ width = width > 300 ? 300 : width;
+
+ drawMessage(failureMessages[idx], (320 - width) / 2, 80, width, 4);
+ break;
+
+ // bitmap
+ case 4:
+ assert(it->objIdx < NUM_MAX_OBJECT);
+ obj = objectTable + it->objIdx;
+
+ if (obj->frame < 0) {
+ return;
+ }
+
+ if (!animDataTable[obj->frame].data()) {
+ return;
+ }
+
+ fillSprite(*obj);
+ break;
+ }
}
-void gfxDestroy() {
- free(screenBuffer);
- free(page1Raw);
- free(page2Raw);
- free(page3Raw);
+/*! \brief Draw overlays
+ */
+void FWRenderer::drawOverlays() {
+ Common::List<overlay>::iterator it;
+
+ for (it = overlayList.begin(); it != overlayList.end(); ++it) {
+ renderOverlay(it);
+ }
+}
+
+/*! \brief Draw another frame
+ */
+void FWRenderer::drawFrame() {
+ drawBackground();
+ drawOverlays();
+
+ if (!_cmd.empty()) {
+ drawCommand();
+ }
+
+ if (_changePal) {
+ refreshPalette();
+ }
+
+ blit();
+}
+
+/*! \brief Update screen
+ */
+void FWRenderer::blit() {
+ g_system->copyRectToScreen(_backBuffer, 320, 0, 0, 320, 200);
+}
+
+/*! \brief Set player command string
+ * \param cmd New command string
+ */
+void FWRenderer::setCommand(const char *cmd) {
+ _cmd = cmd;
+}
+
+/*! \brief Refresh current palette
+ */
+void FWRenderer::refreshPalette() {
+ int i;
+ byte pal[16*4];
+
+ assert(_activeLowPal);
+
+ for (i = 0; i < 16; i++) {
+ // This seems to match the output from DOSbox.
+ pal[i * 4 + 2] = ((_activeLowPal[i] & 0x00f) >> 0) * 32;
+ pal[i * 4 + 1] = ((_activeLowPal[i] & 0x0f0) >> 4) * 32;
+ pal[i * 4 + 0] = ((_activeLowPal[i] & 0xf00) >> 8) * 32;
+ pal[i * 4 + 3] = 0;
+ }
+
+ g_system->setPalette(pal, 0, 16);
+ _changePal = 0;
+}
+
+/*! \brief Load palette of current background
+ */
+void FWRenderer::reloadPalette() {
+ assert(_palette);
+
+ if (!_activeLowPal) {
+ _activeLowPal = new uint16[_lowPalSize];
+ }
+
+ assert(_activeLowPal);
+
+ memcpy(_activeLowPal, _palette, _lowPalSize * sizeof (uint16));
+ _changePal = 1;
+}
+
+/*! \brief Load background into renderer
+ * \param bg Raw background data
+ */
+void FWRenderer::loadBg16(const byte *bg, const char *name) {
+ int i;
+
+ if (!_background) {
+ _background = new byte[_screenSize];
+ }
+
+ if (!_palette) {
+ _palette = new uint16[_lowPalSize];
+ }
+
+ assert(_background && _palette);
+
+ strcpy(_bgName, name);
+
+ for (i = 0; i < _lowPalSize; i++, bg += 2) {
+ _palette[i] = READ_BE_UINT16(bg);
+ }
+
+ gfxConvertSpriteToRaw(_background, bg, 160, 200);
+}
+
+/*! \brief Placeholder for Operation Stealth implementation
+ */
+void FWRenderer::loadBg16(const byte *bg, const char *name, unsigned int idx) {
+ error("Future Wars renderer doesn't support multiple backgrounds");
+}
+
+/*! \brief Placeholder for Operation Stealth implementation
+ */
+void FWRenderer::loadCt16(const byte *ct, const char *name) {
+ error("Future Wars renderer doesn't support multiple backgrounds");
+}
+
+/*! \brief Placeholder for Operation Stealth implementation
+ */
+void FWRenderer::loadBg256(const byte *bg, const char *name) {
+ error("Future Wars renderer doesn't support 256 color mode");
+}
+
+/*! \brief Placeholder for Operation Stealth implementation
+ */
+void FWRenderer::loadBg256(const byte *bg, const char *name, unsigned int idx) {
+ error("Future Wars renderer doesn't support multiple backgrounds");
+}
+
+/*! \brief Placeholder for Operation Stealth implementation
+ */
+void FWRenderer::loadCt256(const byte *ct, const char *name) {
+ error("Future Wars renderer doesn't support multiple backgrounds");
+}
+
+/*! \brief Placeholder for Operation Stealth implementation
+ */
+void FWRenderer::selectBg(unsigned int idx) {
+ error("Future Wars renderer doesn't support multiple backgrounds");
+}
+
+/*! \brief Placeholder for Operation Stealth implementation
+ */
+void FWRenderer::selectScrollBg(unsigned int idx) {
+ error("Future Wars renderer doesn't support multiple backgrounds");
+}
+
+/*! \brief Placeholder for Operation Stealth implementation
+ */
+void FWRenderer::setScroll(unsigned int shift) {
+ error("Future Wars renderer doesn't support multiple backgrounds");
+}
+
+/*! \brief Placeholder for Operation Stealth implementation
+ */
+void FWRenderer::removeBg(unsigned int idx) {
+ error("Future Wars renderer doesn't support multiple backgrounds");
+}
+
+void FWRenderer::saveBg(Common::OutSaveFile &fHandle) {
+ fHandle.write(_bgName, 13);
+}
+
+/*! \brief Restore active and backup palette from save
+ * \param fHandle Savefile open for reading
+ */
+void FWRenderer::restorePalette(Common::InSaveFile &fHandle) {
+ int i;
+
+ if (!_palette) {
+ _palette = new uint16[_lowPalSize];
+ }
+
+ if (!_activeLowPal) {
+ _activeLowPal = new uint16[_lowPalSize];
+ }
+
+ assert(_palette && _activeLowPal);
+
+ for (i = 0; i < _lowPalSize; i++) {
+ _activeLowPal[i] = fHandle.readUint16BE();
+ }
+
+ for (i = 0; i < _lowPalSize; i++) {
+ _palette[i] = fHandle.readUint16BE();
+ }
+
+ _changePal = 1;
+}
+
+/*! \brief Write active and backup palette to save
+ * \param fHandle Savefile open for writing
+ */
+void FWRenderer::savePalette(Common::OutSaveFile &fHandle) {
+ int i;
+
+ assert(_palette && _activeLowPal);
+
+ for (i = 0; i < _lowPalSize; i++) {
+ fHandle.writeUint16BE(_activeLowPal[i]);
+ }
+
+ for (i = 0; i < _lowPalSize; i++) {
+ fHandle.writeUint16BE(_palette[i]);
+ }
+}
+
+/*! \brief Rotate active palette
+ * \param a First color to rotate
+ * \param b Last color to rotate
+ * \param c Possibly rotation step, must be equal to 1 at the moment
+ */
+void FWRenderer::rotatePalette(int a, int b, int c) {
+ palRotate(_activeLowPal, a, b, c);
+ refreshPalette();
+}
+
+/*! \brief Copy part of backup palette to active palette and transform
+ * \param first First color to transform
+ * \param last Last color to transform
+ * \param r Red channel transformation
+ * \param g Green channel transformation
+ * \param b Blue channel transformation
+ */
+void FWRenderer::transformPalette(int first, int last, int r, int g, int b) {
+ if (!_activeLowPal) {
+ _activeLowPal = new uint16[_lowPalSize];
+ memset(_activeLowPal, 0, _lowPalSize * sizeof (uint16));
+ }
+
+ transformPaletteRange(_activeLowPal, _palette, first, last, r, g, b);
+ refreshPalette();
+}
+
+/*! \brief Draw menu box, one item per line with possible highlight
+ * \param items Menu items
+ * \param height Item count
+ * \param x Top left menu corner coordinate
+ * \param y Top left menu corner coordinate
+ * \param width Menu box width
+ * \param selected Index of highlighted item (no highlight if less than 0)
+ */
+void FWRenderer::drawMenu(const CommandeType *items, unsigned int height, int x, int y, int width, int selected) {
+ int tx, ty, th = height * 9 + 10;
+ unsigned int i, j;
+
+ if (x + width > 319) {
+ x = 319 - width;
+ }
+
+ if (y + th > 199) {
+ y = 199 - th;
+ }
+
+ drawPlainBox(x, y, width, 4, _messageBg);
+
+ ty = y + 4;
+
+ for (i = 0; i < height; i++, ty += 9) {
+ drawPlainBox(x, ty, width, 9, (int)i == selected ? 0 : _messageBg);
+ tx = x + 4;
+
+ for (j = 0; items[i][j]; j++) {
+ tx = drawChar(items[i][j], tx, ty);
+ }
+ }
+
+ drawPlainBox(x, ty, width, 4, _messageBg);
+ drawDoubleBorder(x, y, width, ty - y + 4, 2);
+}
+
+/*! \brief Draw text input box
+ * \param info Input box message
+ * \param input Text entered in the input area
+ * \param cursor Cursor position in the input area
+ * \param x Top left input box corner coordinate
+ * \param y Top left input box corner coordinate
+ * \param width Input box width
+ */
+void FWRenderer::drawInputBox(const char *info, const char *input, int cursor, int x, int y, int width) {
+ int i, tx, ty, tw;
+ int line = 0, words = 0, cw = 0;
+ int space = 0, extraSpace = 0;
+
+ drawPlainBox(x, y, width, 4, _messageBg);
+ tx = x + 4;
+ ty = info[0] ? y - 5 : y + 4;
+ tw = width - 8;
+
+ // input box info message
+ for (i = 0; info[i]; i++, line--) {
+ // fit line of text
+ if (!line) {
+ line = fitLine(info + i, tw, words, cw);
+
+ if ( info[i + line] != '\0' && words) {
+ space = (tw - cw) / words;
+ extraSpace = (tw - cw) % words;
+ } else {
+ space = 5;
+ extraSpace = 0;
+ }
+
+ ty += 9;
+ drawPlainBox(x, ty, width, 9, _messageBg);
+ tx = x + 4;
+ }
+
+ // draw characters
+ if (info[i] == ' ') {
+ tx += space + extraSpace;
+
+ if (extraSpace) {
+ extraSpace = 0;
+ }
+ } else {
+ tx = drawChar(info[i], tx, ty);
+ }
+ }
+
+ // input area background
+ ty += 9;
+ drawPlainBox(x, ty, width, 9, _messageBg);
+ drawPlainBox(x + 16, ty - 1, width - 32, 9, 0);
+ tx = x + 20;
+
+ // text in input area
+ for (i = 0; input[i]; i++) {
+ tx = drawChar(input[i], tx, ty);
+
+ if (cursor == i + 2) {
+ drawLine(tx, ty - 1, 1, 9, 2);
+ }
+ }
+
+ if (!input[0] || cursor == 1) {
+ drawLine(x + 20, ty - 1, 1, 9, 2);
+ }
+
+ ty += 9;
+ drawPlainBox(x, ty, width, 4, _messageBg);
+ drawDoubleBorder(x, y, width, ty - y + 4, 2);
+}
+
+/*! \brief Fade to black
+ */
+void FWRenderer::fadeToBlack() {
+ // FIXME: _activeLowPal is invalid when starting Operation Stealth
+ // Adding this sanity check fixes a crash when the game
+ // starts, but I'm not sure if this is the best place to check it
+ if (!_activeLowPal) {
+ warning("_activeLowPal is invalid");
+ return;
+ }
+
+ assert(_activeLowPal);
+
+ for (int i = 0; i < 8; i++) {
+ for (int j = 0; j < 16; j++) {
+ _activeLowPal[j] = transformColor(_activeLowPal[j], -1, -1, -1);
+ }
+
+ refreshPalette();
+ g_system->updateScreen();
+ g_system->delayMillis(50);
+ }
+}
+
+/*! \brief Initialize Operation Stealth renderer
+ */
+OSRenderer::OSRenderer() : _activeHiPal(NULL), _currentBg(0), _scrollBg(0),
+ _bgShift(0) {
+
+ int i;
+ for (i = 0; i < 9; i++) {
+ _bgTable[i].bg = NULL;
+ _bgTable[i].lowPal = NULL;
+ _bgTable[i].hiPal = NULL;
+ memset(_bgTable[i].name, 0, sizeof (_bgTable[i].name));
+ }
+}
+
+/*! \brief Destroy Operation Stealth renderer
+ */
+OSRenderer::~OSRenderer() {
+ delete[] _activeHiPal;
+
+ for (int i = 0; i < 9; i++) {
+ delete[] _bgTable[i].bg;
+ delete[] _bgTable[i].lowPal;
+ delete[] _bgTable[i].hiPal;
+ }
+}
+
+/*! \brief Reset Operation Stealth renderer state
+ */
+void OSRenderer::clear() {
+ delete[] _activeHiPal;
+ _activeHiPal = NULL;
+
+ for (int i = 0; i < 9; i++) {
+ delete[] _bgTable[i].bg;
+ delete[] _bgTable[i].lowPal;
+ delete[] _bgTable[i].hiPal;
+
+ _bgTable[i].bg = NULL;
+ _bgTable[i].lowPal = NULL;
+ _bgTable[i].hiPal = NULL;
+ memset(_bgTable[i].name, 0, sizeof (_bgTable[i].name));
+ }
+
+ _currentBg = 0;
+ _scrollBg = 0;
+ _bgShift = 0;
+
+ FWRenderer::clear();
+}
+
+/*! \brief Draw 1bpp sprite using selected color on backgrounds
+ * \param obj Object info
+ * \param fillColor Sprite color
+ */
+void OSRenderer::incrustMask(const objectStruct &obj, uint8 color) {
+ const byte *data = animDataTable[obj.frame].data();
+ int x, y, width, height, i;
+
+ x = obj.x;
+ y = obj.y;
+ width = animDataTable[obj.frame]._realWidth;
+ height = animDataTable[obj.frame]._height;
+
+ for (i = 0; i < 8; i++) {
+ if (!_bgTable[i].bg) {
+ continue;
+ }
+
+ gfxFillSprite(data, width, height, _bgTable[i].bg, x, y, color);
+ }
+}
+
+/*! \brief Draw color sprite
+ * \param obj Object info
+ */
+void OSRenderer::drawSprite(const objectStruct &obj) {
+ const byte *data = animDataTable[obj.frame].data();
+ int x, y, width, height, transColor;
+
+ x = obj.x;
+ y = obj.y;
+ transColor = obj.part;
+ width = animDataTable[obj.frame]._realWidth;
+ height = animDataTable[obj.frame]._height;
+
+ drawSpriteRaw2(data, transColor, width, height, _backBuffer, x, y);
+}
+
+/*! \brief Draw color sprite
+ * \param obj Object info
+ */
+void OSRenderer::incrustSprite(const objectStruct &obj) {
+ const byte *data = animDataTable[obj.frame].data();
+ int x, y, width, height, transColor, i;
+
+ x = obj.x;
+ y = obj.y;
+ transColor = obj.part;
+ width = animDataTable[obj.frame]._realWidth;
+ height = animDataTable[obj.frame]._height;
+
+ for (i = 0; i < 8; i++) {
+ if (!_bgTable[i].bg) {
+ continue;
+ }
+
+ drawSpriteRaw2(data, transColor, width, height, _bgTable[i].bg, x, y);
+ }
+}
+
+/*! \brief Draw text character on screen
+ * \param character Character to draw
+ * \param x Character coordinate
+ * \param y Character coordinate
+ */
+int OSRenderer::drawChar(char character, int x, int y) {
+ int width, idx;
+
+ if (character == ' ') {
+ x += 5;
+ } else if ((width = fontParamTable[(unsigned char)character].characterWidth)) {
+ idx = fontParamTable[(unsigned char)character].characterIdx;
+ drawSpriteRaw2(textTable[idx][0], 0, 16, 8, _backBuffer, x, y);
+ x += width + 1;
+ }
+
+ return x;
+}
+
+/*! \brief Draw background to backbuffer
+ */
+void OSRenderer::drawBackground() {
+ byte *main;
+
+ main = _bgTable[_currentBg].bg;
+ assert(main);
+
+ if (!_bgShift) {
+ memcpy(_backBuffer, main, _screenSize);
+ } else {
+ byte *scroll = _bgTable[_scrollBg].bg;
+ int mainShift = _bgShift * _screenWidth;
+ int mainSize = _screenSize - mainShift;
+
+ assert(scroll);
+
+ memcpy(_backBuffer, main + mainShift, mainSize);
+ memcpy(_backBuffer + mainSize, scroll, mainShift);
+ }
+}
+
+/*! \brief Draw one overlay
+ * \param it Overlay info
+ */
+void OSRenderer::renderOverlay(const Common::List<overlay>::iterator &it) {
+ int len;
+ objectStruct *obj;
+ AnimData *sprite;
+ byte *mask;
+
+ switch (it->type) {
+ // color sprite
+ case 0:
+ sprite = animDataTable + objectTable[it->objIdx].frame;
+ len = sprite->_realWidth * sprite->_height;
+ mask = new byte[len];
+ generateMask(sprite->data(), mask, len, objectTable[it->objIdx].part);
+ remaskSprite(mask, it);
+ drawMaskedSprite(objectTable[it->objIdx], mask);
+ delete[] mask;
+ break;
+
+ // masked background
+ case 20:
+ assert(it->objIdx < NUM_MAX_OBJECT);
+ obj = objectTable + it->objIdx;
+ sprite = animDataTable + obj->frame;
+
+ if (obj->frame < 0 || it->x > 8 || !_bgTable[it->x].bg || sprite->_bpp != 1) {
+ break;
+ }
+
+ maskBgOverlay(_bgTable[it->x].bg, sprite->data(), sprite->_realWidth, sprite->_height, _backBuffer, obj->x, obj->y);
+ break;
+
+ // something else
+ default:
+ FWRenderer::renderOverlay(it);
+ break;
+ }
+}
+
+/*! \brief Refresh current palette
+ */
+void OSRenderer::refreshPalette() {
+ if (!_activeHiPal) {
+ FWRenderer::refreshPalette();
+ return;
+ }
+
+ int i;
+ byte pal[256*4];
+
+ for (i = 0; i < 256; i++) {
+ pal[i * 4 + 0] = _activeHiPal[i * 3 + 0];
+ pal[i * 4 + 1] = _activeHiPal[i * 3 + 1];
+ pal[i * 4 + 2] = _activeHiPal[i * 3 + 2];
+ pal[i * 4 + 3] = 0;
+ }
+
+ g_system->setPalette(pal, 0, 256);
+ _changePal = 0;
+}
+
+/*! \brief Load palette of current background
+ */
+void OSRenderer::reloadPalette() {
+ // selected background in plane takeoff scene has swapped colors 12
+ // and 14, shift background has it right
+ palBg *bg = _bgShift ? &_bgTable[_scrollBg] : &_bgTable[_currentBg];
+
+ assert(bg->lowPal || bg->hiPal);
+
+ if (bg->lowPal) {
+ if (!_activeLowPal) {
+ _activeLowPal = new uint16[_lowPalSize];
+ }
+
+ assert(_activeLowPal);
+
+ delete[] _activeHiPal;
+ _activeHiPal = NULL;
+
+ memcpy(_activeLowPal, bg->lowPal, _lowPalSize * sizeof (uint16));
+ } else {
+ if (!_activeHiPal) {
+ _activeHiPal = new byte[_hiPalSize];
+ }
+
+ assert(_activeHiPal);
+
+ delete[] _activeLowPal;
+ _activeLowPal = NULL;
+
+ memcpy(_activeHiPal, bg->hiPal, _hiPalSize);
+ }
+ _changePal = 1;
+}
+
+/*! \brief Rotate active palette
+ * \param a First color to rotate
+ * \param b Last color to rotate
+ * \param c Possibly rotation step, must be equal to 1 at the moment
+ */
+void OSRenderer::rotatePalette(int a, int b, int c) {
+ if (_activeLowPal) {
+ FWRenderer::rotatePalette(a, b, c);
+ return;
+ }
+
+ palRotate(_activeHiPal, a, b, c);
+ refreshPalette();
+}
+
+/*! \brief Copy part of backup palette to active palette and transform
+ * \param first First color to transform
+ * \param last Last color to transform
+ * \param r Red channel transformation
+ * \param g Green channel transformation
+ * \param b Blue channel transformation
+ */
+void OSRenderer::transformPalette(int first, int last, int r, int g, int b) {
+ palBg *bg = _bgShift ? &_bgTable[_scrollBg] : &_bgTable[_currentBg];
+
+ if (!bg->lowPal) {
+ if (!_activeHiPal) {
+ _activeHiPal = new byte[_hiPalSize];
+ memset(_activeHiPal, 0, _hiPalSize);
+ }
+
+ delete[] _activeLowPal;
+ _activeLowPal = NULL;
+
+ transformPaletteRange(_activeHiPal, bg->hiPal, first, last, r, g, b);
+ } else {
+ if (!_activeLowPal) {
+ _activeLowPal = new uint16[_lowPalSize];
+ memset(_activeLowPal, 0, _lowPalSize * sizeof (uint16));
+ }
+
+ delete[] _activeHiPal;
+ _activeHiPal = NULL;
+
+ transformPaletteRange(_activeLowPal, bg->lowPal, first, last, r, g, b);
+ }
+
+ refreshPalette();
+}
+
+/*! \brief Load 16 color background into renderer
+ * \param bg Raw background data
+ * \param name Background filename
+ */
+void OSRenderer::loadBg16(const byte *bg, const char *name) {
+ loadBg16(bg, name, 0);
+}
+
+/*! \brief Load 16 color background into renderer
+ * \param bg Raw background data
+ * \param name Background filename
+ * \param pos Background index
+ */
+void OSRenderer::loadBg16(const byte *bg, const char *name, unsigned int idx) {
+ int i;
+ assert(idx < 9);
+
+ if (!_bgTable[idx].bg) {
+ _bgTable[idx].bg = new byte[_screenSize];
+ }
+
+ if (!_bgTable[idx].lowPal) {
+ _bgTable[idx].lowPal = new uint16[_lowPalSize];
+ }
+
+ assert(_bgTable[idx].bg && _bgTable[idx].lowPal);
+
+ delete[] _bgTable[idx].hiPal;
+ _bgTable[idx].hiPal = NULL;
+
+ strcpy(_bgTable[idx].name, name);
+
+ for (i = 0; i < _lowPalSize; i++, bg += 2) {
+ _bgTable[idx].lowPal[i] = READ_BE_UINT16(bg);
+ }
+
+ gfxConvertSpriteToRaw(_bgTable[idx].bg, bg, 160, 200);
+}
+
+/*! \brief Load 16 color CT data as background into renderer
+ * \param ct Raw CT data
+ * \param name Background filename
+ */
+void OSRenderer::loadCt16(const byte *ct, const char *name) {
+ loadBg16(ct, name, 8);
+}
+
+/*! \brief Load 256 color background into renderer
+ * \param bg Raw background data
+ * \param name Background filename
+ */
+void OSRenderer::loadBg256(const byte *bg, const char *name) {
+ loadBg256(bg, name, 0);
+}
+
+/*! \brief Load 256 color background into renderer
+ * \param bg Raw background data
+ * \param name Background filename
+ * \param pos Background index
+ */
+void OSRenderer::loadBg256(const byte *bg, const char *name, unsigned int idx) {
+ assert(idx < 9);
+
+ if (!_bgTable[idx].bg) {
+ _bgTable[idx].bg = new byte[_screenSize];
+ }
+
+ if (!_bgTable[idx].hiPal) {
+ _bgTable[idx].hiPal = new byte[_hiPalSize];
+ }
+
+ assert(_bgTable[idx].bg && _bgTable[idx].hiPal);
+
+ delete[] _bgTable[idx].lowPal;
+ _bgTable[idx].lowPal = NULL;
+
+ strcpy(_bgTable[idx].name, name);
+ memcpy(_bgTable[idx].hiPal, bg, _hiPalSize);
+ memcpy(_bgTable[idx].bg, bg + _hiPalSize, _screenSize);
+}
+
+/*! \brief Load 256 color CT data as background into renderer
+ * \param ct Raw CT data
+ * \param name Background filename
+ */
+void OSRenderer::loadCt256(const byte *ct, const char *name) {
+ loadBg256(ct, name, 8);
+}
+
+/*! \brief Select active background and load its palette
+ * \param idx Background index
+ */
+void OSRenderer::selectBg(unsigned int idx) {
+ assert(idx < 9 && _bgTable[idx].bg);
+ assert(_bgTable[idx].lowPal || _bgTable[idx].hiPal);
+
+ _currentBg = idx;
+ reloadPalette();
+}
+
+/*! \brief Select scroll background
+ * \param idx Scroll background index
+ */
+void OSRenderer::selectScrollBg(unsigned int idx) {
+ assert(idx < 9);
+
+ if (_bgTable[idx].bg) {
+ _scrollBg = idx;
+ }
+ reloadPalette();
+}
+
+/*! \brief Set background scroll
+ * \param shift Background scroll in pixels
+ */
+void OSRenderer::setScroll(unsigned int shift) {
+ assert(shift <= 200);
+
+ _bgShift = shift;
+}
+
+/*! \brief Unload background from renderer
+ * \param idx Background to unload
+ */
+void OSRenderer::removeBg(unsigned int idx) {
+ assert(idx > 0 && idx < 9);
+
+ if (_currentBg == idx) {
+ _currentBg = 0;
+ }
+
+ if (_scrollBg == idx) {
+ _scrollBg = 0;
+ }
+
+ delete[] _bgTable[idx].bg;
+ delete[] _bgTable[idx].lowPal;
+ delete[] _bgTable[idx].hiPal;
+ _bgTable[idx].bg = NULL;
+ _bgTable[idx].lowPal = NULL;
+ _bgTable[idx].hiPal = NULL;
+ memset(_bgTable[idx].name, 0, sizeof (_bgTable[idx].name));
+}
+
+/*! \brief Fade to black
+ * \bug Operation Stealth sometimes seems to fade to black using
+ * transformPalette resulting in double fadeout
+ */
+void OSRenderer::fadeToBlack() {
+ if (!_activeHiPal) {
+ FWRenderer::fadeToBlack();
+ return;
+ }
+
+ for (int i = 0; i < 8; i++) {
+ for (int j = 0; j < _hiPalSize; j++) {
+ _activeHiPal[j] = CLIP(_activeHiPal[j] - 32, 0, 255);
+ }
+
+ refreshPalette();
+ g_system->updateScreen();
+ g_system->delayMillis(50);
+ }
}
void setMouseCursor(int cursor) {
@@ -147,21 +1307,6 @@ void setMouseCursor(int cursor) {
}
}
-static uint16 transformColor(uint16 baseColor, int8 r, int8 g, int8 b) {
- int8 oriR = CLIP( (baseColor & 0x007) + r, 0, 7);
- int8 oriG = CLIP(((baseColor & 0x070) >> 4) + g, 0, 7);
- int8 oriB = CLIP(((baseColor & 0x700) >> 8) + b, 0, 7);
-
- return oriR | (oriG << 4) | (oriB << 8);
-}
-
-void transformPaletteRange(byte startColor, byte stopColor, int8 r, int8 g, int8 b) {
- for (byte i = startColor; i <= stopColor; i++) {
- c_palette[i] = transformColor(tempPalette[i], b, g, r);
- }
- //gfxFlipPage(page2);
-}
-
void gfxFillSprite(const byte *spritePtr, uint16 width, uint16 height, byte *page, int16 x, int16 y, uint8 fillColor) {
int16 i, j;
@@ -170,17 +1315,12 @@ void gfxFillSprite(const byte *spritePtr, uint16 width, uint16 height, byte *pag
destPtr += i * 320;
for (j = 0; j < width; j++) {
- if (x + j >= 0 && x + j < 320 && i + y >= 0
- && i + y < 200) {
- if (!*(spritePtr++)) {
- *(destPtr++) = fillColor;
- } else {
- destPtr++;
- }
- } else {
- destPtr++;
- spritePtr++;
+ if (x + j >= 0 && x + j < 320 && i + y >= 0 && i + y < 200 && !*spritePtr) {
+ *destPtr = fillColor;
}
+
+ destPtr++;
+ spritePtr++;
}
}
}
@@ -360,53 +1500,7 @@ void gfxConvertSpriteToRaw(byte *dst, const byte *src, uint16 w, uint16 h) {
}
}
-void gfxCopyRawPage(byte *source, byte *dest) {
- memcpy(dest, source, 320 * 200);
-}
-
-void gfxFlipRawPage(byte *frontBuffer) {
- byte *page = frontBuffer;
- int x, y, i;
- byte *pixels = (byte *) screenBuffer;
- byte c;
- byte pal[256 * 4];
-
- for (y = 0; y < 200; y++) {
- for (x = 0; x < 320; x++) {
- c = *(page++);
-
- if (!colorMode256) {
- c = c & 15;
- }
-
- pixels[x + 0 + y * 320] = c;
- }
- }
-
- if (colorMode256) {
- for (i = 0; i < 256; i++) {
- pal[i * 4 + 0] = palette256[i * 3 + 0];
- pal[i * 4 + 1] = palette256[i * 3 + 1];
- pal[i * 4 + 2] = palette256[i * 3 + 2];
- pal[i * 4 + 3] = 0;
- }
- g_system->setPalette(pal, 0, 256);
- } else {
- for (i = 0; i < 16; i++) {
- // This seems to match the output from DOSbox.
- pal[i * 4 + 2] = ((c_palette[i] & 0x00f) >> 0) * 32;
- pal[i * 4 + 1] = ((c_palette[i] & 0x0f0) >> 4) * 32;
- pal[i * 4 + 0] = ((c_palette[i] & 0xf00) >> 8) * 32;
- pal[i * 4 + 3] = 0;
- }
- g_system->setPalette(pal, 0, 16);
- }
-
- g_system->copyRectToScreen(screenBuffer, 320, 0, 0, 320, 200);
-}
-
-void drawSpriteRaw(const byte *spritePtr, const byte *maskPtr, int16 width, int16 height,
- byte *page, int16 x, int16 y) {
+void drawSpriteRaw(const byte *spritePtr, const byte *maskPtr, int16 width, int16 height, byte *page, int16 x, int16 y) {
int16 i, j;
// FIXME: Is it a bug if maskPtr == NULL?
@@ -417,9 +1511,8 @@ void drawSpriteRaw(const byte *spritePtr, const byte *maskPtr, int16 width, int1
byte *destPtr = page + x + y * 320;
destPtr += i * 320;
- for (j = 0; j < width * 8; j++) {
- if (((g_cine->getGameType() == Cine::GType_FW && (!maskPtr || !(*maskPtr))) || (g_cine->getGameType() == Cine::GType_OS)) && (x + j >= 0
- && x + j < 320 && i + y >= 0 && i + y < 200)) {
+ for (j = 0; j < width; j++) {
+ if ((!maskPtr || !(*maskPtr)) && x + j >= 0 && x + j < 320 && i + y >= 0 && i + y < 200) {
*(destPtr++) = *(spritePtr++);
} else {
destPtr++;
@@ -432,21 +1525,19 @@ void drawSpriteRaw(const byte *spritePtr, const byte *maskPtr, int16 width, int1
}
}
-void drawSpriteRaw2(const byte *spritePtr, byte transColor, int16 width, int16 height,
- byte *page, int16 x, int16 y) {
+void drawSpriteRaw2(const byte *spritePtr, byte transColor, int16 width, int16 height, byte *page, int16 x, int16 y) {
int16 i, j;
for (i = 0; i < height; i++) {
byte *destPtr = page + x + y * 320;
destPtr += i * 320;
- for (j = 0; j < width * 8; j++) {
- if ((*(spritePtr) != transColor) && (x + j >= 0 && x + j < 320 && i + y >= 0 && i + y < 200)) {
- *(destPtr++) = *(spritePtr++);
- } else {
- destPtr++;
- spritePtr++;
+ for (j = 0; j < width; j++) {
+ if ((*spritePtr != transColor) && (x + j >= 0 && x + j < 320 && i + y >= 0 && i + y < 200)) {
+ *destPtr = *spritePtr;
}
+ destPtr++;
+ spritePtr++;
}
}
}
@@ -499,93 +1590,4 @@ void maskBgOverlay(const byte *bgPtr, const byte *maskPtr, int16 width, int16 he
}
}
-/*! \todo Fix rendering to prevent fadein artifacts
- */
-void fadeFromBlack() {
- int i, j;
- int r, g, b, tr, tg, tb;
- if (newColorMode == 2) {
- colorMode256 = 1;
- memset(palette256, 0, 256*3);
- } else if (newColorMode == 1) {
- colorMode256 = 0;
- memset(c_palette, 0, 16 * sizeof(uint16));
- }
-
- for (i = 0; i < 8; i++ ) {
- gfxFlipRawPage(page1Raw);
- g_system->updateScreen();
- g_system->delayMillis(50);
-
- if (colorMode256) {
- for (j = 0; j < 256*3; j++) {
- r = palette256[j] + (newPalette[j] + 7) / 8;
- palette256[j] = CLIP(r, 0, (int)newPalette[j]);
- }
- } else {
- for (j = 0; j < 16; j++) {
- r = c_palette[j] & 0xf;
- g = (c_palette[j] & 0xf0) >> 4;
- b = (c_palette[j] & 0xf00) >> 8;
-
- tr = tempPalette[j] & 0xf;
- tg = (tempPalette[j] & 0xf0) >> 4;
- tb = (tempPalette[j] & 0xf00) >> 8;
-
- r = CLIP(r + (tr + 7) / 8, 0, tr);
- g = CLIP(g + (tg + 7) / 8, 0, tg);
- b = CLIP(b + (tb + 7) / 8, 0, tb);
-
- c_palette[j] = r | (g << 4) | (b << 8);
- }
-
- }
- }
-
- if (colorMode256) {
- memcpy(palette256, newPalette, 256*3);
- } else {
- memcpy(c_palette, tempPalette, sizeof(uint16) * 16);
- }
-}
-
-void fadeToBlack() {
- for (int i = 0; i < 8; i++) {
- if (colorMode256) {
- for (int j = 0; j < 256*3; j++) {
- palette256[j] = CLIP(palette256[j] - 32, 0, 255);
- }
- } else {
- for (int j = 0; j < 16; j++) {
- c_palette[j] = transformColor(c_palette[j], -1, -1, -1);
- }
- }
- gfxFlipRawPage(page1Raw);
- g_system->updateScreen();
- g_system->delayMillis(50);
- }
-}
-
-void blitRawScreen(byte *frontBuffer) {
- gfxFlipRawPage(frontBuffer);
-}
-
-void flip(void) {
- blitRawScreen(page1Raw);
- if (fadeRequired) {
- if (newColorMode == 3) {
- newColorMode = ctColorMode + 1;
- }
-
- if (newColorMode == 2) {
- colorMode256 = 1;
- memcpy(palette256, newPalette, 256*3);
- } else {
- colorMode256 = 0;
- memcpy(c_palette, tempPalette, sizeof(uint16) * 16);
- }
- fadeRequired = false;
- }
-}
-
} // End of namespace Cine
diff --git a/engines/cine/gfx.h b/engines/cine/gfx.h
index 3812b52113..c63c79ac82 100644
--- a/engines/cine/gfx.h
+++ b/engines/cine/gfx.h
@@ -26,24 +26,158 @@
#ifndef CINE_GFX_H
#define CINE_GFX_H
+#include "common/noncopyable.h"
+#include "cine/object.h"
+
namespace Cine {
+/*! \brief Background with palette
+ */
+struct palBg {
+ byte *bg; ///< Background data
+ byte *hiPal; ///< 256 color palette
+ uint16 *lowPal; ///< 16 color palette
+ char name[15]; ///< Background filename
+};
+
+/*! \brief Future Wars renderer
+ *
+ * Screen backbuffer is not cleared between frames, you can draw menus etc.
+ * without calling drawFrame() all the time
+ */
+class FWRenderer : public Common::NonCopyable {
+private:
+ byte *_background; ///< Current background
+ char _bgName[13]; ///< Background filename
+ uint16 *_palette; ///< 16 color backup palette
+
+ Common::String _cmd; ///< Player command string
+
+protected:
+ static const int _screenSize = 320 * 200; ///< Screen size
+ static const int _screenWidth = 320; ///< Screen width
+ static const int _screenHeight = 200; ///< Screen height
+ static const int _lowPalSize = 16; ///< 16 color palette size
+
+ byte *_backBuffer; ///< Screen backbuffer
+ uint16 *_activeLowPal; ///< Active 16 color palette
+ int _changePal; ///< Load active palette to video backend on next frame
+
+ void fillSprite(const objectStruct &obj, uint8 color = 0);
+ void drawMaskedSprite(const objectStruct &obj, const byte *mask);
+ virtual void drawSprite(const objectStruct &obj);
+
+ void drawCommand();
+ void drawMessage(const char *str, int x, int y, int width, byte color);
+ void drawPlainBox(int x, int y, int width, int height, byte color);
+ void drawBorder(int x, int y, int width, int height, byte color);
+ void drawDoubleBorder(int x, int y, int width, int height, byte color);
+ virtual int drawChar(char character, int x, int y);
+ void drawLine(int x, int y, int width, int height, byte color);
+ void remaskSprite(byte *mask, Common::List<overlay>::iterator it);
+ virtual void drawBackground();
+
+ virtual void renderOverlay(const Common::List<overlay>::iterator &it);
+ void drawOverlays();
+
+public:
+ uint16 _messageBg; ///< Message box background color
+ uint16 _cmdY; ///< Player command string position on screen
+
+ FWRenderer();
+ virtual ~FWRenderer();
+
+ /*! \brief Test if renderer is ready to draw */
+ virtual bool ready() { return _background != NULL; }
+
+ virtual void clear();
+
+ void drawFrame();
+ void blit();
+ void setCommand(const char *cmd);
+
+ virtual void incrustMask(const objectStruct &obj, uint8 color = 0);
+ virtual void incrustSprite(const objectStruct &obj);
+
+ virtual void loadBg16(const byte *bg, const char *name);
+ virtual void loadBg16(const byte *bg, const char *name, unsigned int idx);
+ virtual void loadCt16(const byte *ct, const char *name);
+ virtual void loadBg256(const byte *bg, const char *name);
+ virtual void loadBg256(const byte *bg, const char *name, unsigned int idx);
+ virtual void loadCt256(const byte *ct, const char *name);
+ virtual void selectBg(unsigned int idx);
+ virtual void selectScrollBg(unsigned int idx);
+ virtual void setScroll(unsigned int shift);
+ virtual void removeBg(unsigned int idx);
+ void saveBg(Common::OutSaveFile &fHandle);
+
+ virtual void refreshPalette();
+ virtual void reloadPalette();
+ void restorePalette(Common::InSaveFile &fHandle);
+ void savePalette(Common::OutSaveFile &fHandle);
+ virtual void rotatePalette(int a, int b, int c);
+ virtual void transformPalette(int first, int last, int r, int g, int b);
+
+ void drawMenu(const CommandeType *items, unsigned int height, int x, int y, int width, int selected);
+ void drawInputBox(const char *info, const char *input, int cursor, int x, int y, int width);
+
+ virtual void fadeToBlack();
+};
+
+/*! \brief Operation Stealth renderer
+ */
+class OSRenderer : public FWRenderer {
+private:
+ palBg _bgTable[9]; ///< Table of backgrounds loaded into renderer
+ byte *_activeHiPal; ///< Active 256 color palette
+ unsigned int _currentBg; ///< Current background
+ unsigned int _scrollBg; ///< Current scroll background
+ unsigned int _bgShift; ///< Background shift
+
+protected:
+ static const int _hiPalSize = 256 * 3; ///< 256 color palette size
+
+ void drawSprite(const objectStruct &obj);
+ int drawChar(char character, int x, int y);
+ void drawBackground();
+ void renderOverlay(const Common::List<overlay>::iterator &it);
+
+public:
+ OSRenderer();
+ ~OSRenderer();
+
+ /*! \brief Test if renderer is ready to draw */
+ bool ready() { return _bgTable[_currentBg].bg != NULL; }
+
+ void clear();
+
+ void incrustMask(const objectStruct &obj, uint8 color = 0);
+ void incrustSprite(const objectStruct &obj);
+
+ void loadBg16(const byte *bg, const char *name);
+ void loadBg16(const byte *bg, const char *name, unsigned int idx);
+ void loadCt16(const byte *ct, const char *name);
+ void loadBg256(const byte *bg, const char *name);
+ void loadBg256(const byte *bg, const char *name, unsigned int idx);
+ void loadCt256(const byte *ct, const char *name);
+ void selectBg(unsigned int idx);
+ void selectScrollBg(unsigned int idx);
+ void setScroll(unsigned int shift);
+ void removeBg(unsigned int idx);
+
+ void refreshPalette();
+ void reloadPalette();
+ void rotatePalette(int a, int b, int c);
+ void transformPalette(int first, int last, int r, int g, int b);
+
+ void fadeToBlack();
+};
+
void gfxDrawSprite(byte *src4, uint16 sw, uint16 sh, byte *dst4, int16 sx, int16 sy);
-extern byte *page1Raw;
-extern byte *page2Raw;
extern byte *page3Raw;
+extern FWRenderer *renderer;
-extern uint16 c_palette[256];
-extern byte colorMode256;
-extern byte palette256[256 * 3];
-extern byte newPalette[256 * 3];
-extern byte newColorMode;
-extern byte ctColorMode;
-extern byte bgColorMode;
-
-void gfxInit();
-void gfxDestroy();
void setMouseCursor(int cursor);
void gfxCopyPage(byte *source, byte *dest);
diff --git a/engines/cine/main_loop.cpp b/engines/cine/main_loop.cpp
index 6042849f59..cfb828cf3c 100644
--- a/engines/cine/main_loop.cpp
+++ b/engines/cine/main_loop.cpp
@@ -182,14 +182,12 @@ int getKeyData() {
void CineEngine::mainLoop(int bootScriptIdx) {
bool playerAction;
uint16 quitFlag;
- uint16 i;
byte di;
uint16 mouseButton;
quitFlag = 0;
if (_preLoad == false) {
- resetSeqList();
resetBgIncrustList();
setTextWindow(0, 0, 20, 200);
@@ -223,17 +221,10 @@ void CineEngine::mainLoop(int bootScriptIdx) {
globalVars[VAR_LOW_MEMORY] = 0; // set to 1 to disable some animations, sounds etc.
}
- for (i = 0; i < 16; i++) {
- c_palette[i] = 0;
- }
-
- _paletteNeedUpdate = true;
-
strcpy(newPrcName, "");
strcpy(newRelName, "");
strcpy(newObjectName, "");
strcpy(newMsgName, "");
- strcpy(currentBgName[0], "");
strcpy(currentCtName, "");
strcpy(currentPartName, "");
@@ -257,8 +248,9 @@ void CineEngine::mainLoop(int bootScriptIdx) {
setMouseCursor(MOUSE_CURSOR_CROSS);
}
- drawOverlays();
- flip();
+ if (renderer->ready()) {
+ renderer->drawFrame();
+ }
if (waitForPlayerClick) {
playerAction = false;
@@ -289,6 +281,8 @@ void CineEngine::mainLoop(int bootScriptIdx) {
} while (mouseButton != 0);
waitForPlayerClick = 0;
+
+ removeMessages();
}
if (checkForPendingDataLoadSwitch) {
diff --git a/engines/cine/object.cpp b/engines/cine/object.cpp
index 36f7b17a69..7666f05352 100644
--- a/engines/cine/object.cpp
+++ b/engines/cine/object.cpp
@@ -185,37 +185,37 @@ void addObjectParam(byte objIdx, byte paramIdx, int16 newValue) {
}
void modifyObjectParam(byte objIdx, byte paramIdx, int16 newValue) {
- paramIdx--;
-
- assert(paramIdx <= 5);
+ // Operation Stealth checks object index range, Future Wars doesn't.
+ if (g_cine->getGameType() == Cine::GType_OS && objIdx >= NUM_MAX_OBJECT)
+ return;
switch (paramIdx) {
- case 0:
+ case 1:
objectTable[objIdx].x = newValue;
break;
- case 1:
+ case 2:
objectTable[objIdx].y = newValue;
break;
- case 2:
+ case 3:
objectTable[objIdx].mask = newValue;
+ // TODO: Check this part against disassembly
if (removeOverlay(objIdx, 0)) {
addOverlay(objIdx, 0);
}
break;
- case 3:
+ case 4:
objectTable[objIdx].frame = newValue;
break;
- case 4:
- // is it really in Future Wars? it breaks the newspaper machine
- // on the airport in Operation Stealth
- if (newValue == -1 && g_cine->getGameType() != Cine::GType_OS) {
+ case 5:
+ // TODO: Test if this really breaks the newspaper machine on the airport in Operation Stealth.
+ if (g_cine->getGameType() == Cine::GType_FW && newValue == -1) {
objectTable[objIdx].costume = globalVars[0];
} else {
objectTable[objIdx].costume = newValue;
}
break;
- case 5:
+ case 6:
objectTable[objIdx].part = newValue;
break;
}
@@ -236,6 +236,10 @@ uint16 compareObjectParam(byte objIdx, byte type, int16 value) {
return compareResult;
}
+/*! \bug In Operation Stealth, if you try to go downstairs to the sea in the
+ * location between bank and hotel, getObjectParam is called with paramIdx 16
+ * and crashes
+ */
int16 getObjectParam(uint16 objIdx, uint16 paramIdx) {
assert(objIdx <= NUM_MAX_OBJECT);
diff --git a/engines/cine/pal.cpp b/engines/cine/pal.cpp
index 9341563898..3e6f5adf40 100644
--- a/engines/cine/pal.cpp
+++ b/engines/cine/pal.cpp
@@ -28,8 +28,6 @@
namespace Cine {
-uint16 tempPalette[256];
-
uint16 palEntriesCount;
PalEntry *palPtr = NULL;
@@ -113,4 +111,64 @@ void loadRelatedPalette(const char *fileName) {
}
}
+void palRotate(uint16 *pal, byte a, byte b, byte c) {
+ assert(pal);
+
+ if (c == 1) {
+ uint16 currentColor = pal[b];
+
+ for (int i = b; i > a; i--) {
+ pal[i] = pal[i - 1];
+ }
+
+ pal[a] = currentColor;
+ }
+}
+
+void palRotate(byte *pal, byte a, byte b, byte c) {
+ assert(pal);
+
+ if (c == 1) {
+ byte currentR = pal[3 * b + 0];
+ byte currentG = pal[3 * b + 1];
+ byte currentB = pal[3 * b + 2];
+
+ for (int i = b; i > a; i--) {
+ pal[3 * i + 0] = pal[3 * (i - 1) + 0];
+ pal[3 * i + 1] = pal[3 * (i - 1) + 1];
+ pal[3 * i + 2] = pal[3 * (i - 1) + 2];
+ }
+
+ pal[3 * a + 0] = currentR;
+ pal[3 * a + 1] = currentG;
+ pal[3 * a + 2] = currentB;
+ }
+}
+
+uint16 transformColor(uint16 baseColor, int r, int g, int b) {
+ int8 oriR = CLIP( (baseColor & 0x007) + b, 0, 7);
+ int8 oriG = CLIP(((baseColor & 0x070) >> 4) + g, 0, 7);
+ int8 oriB = CLIP(((baseColor & 0x700) >> 8) + r, 0, 7);
+
+ return oriR | (oriG << 4) | (oriB << 8);
+}
+
+void transformPaletteRange(uint16 *dstPal, uint16 *srcPal, int startColor, int stopColor, int r, int g, int b) {
+ assert(srcPal && dstPal);
+
+ for (int i = startColor; i <= stopColor; i++) {
+ dstPal[i] = transformColor(srcPal[i], r, g, b);
+ }
+}
+
+void transformPaletteRange(byte *dstPal, byte *srcPal, int startColor, int stopColor, int r, int g, int b) {
+ assert(srcPal && dstPal);
+
+ for (int i = startColor; i <= stopColor; i++) {
+ dstPal[3 * i + 0] = CLIP(srcPal[3 * i + 0] + r * 32, 0, 255);
+ dstPal[3 * i + 1] = CLIP(srcPal[3 * i + 1] + g * 32, 0, 255);
+ dstPal[3 * i + 2] = CLIP(srcPal[3 * i + 2] + b * 32, 0, 255);
+ }
+}
+
} // End of namespace Cine
diff --git a/engines/cine/pal.h b/engines/cine/pal.h
index da822fa1a1..70fcc0d98a 100644
--- a/engines/cine/pal.h
+++ b/engines/cine/pal.h
@@ -36,10 +36,14 @@ struct PalEntry {
void loadPal(const char *fileName);
-extern uint16 tempPalette[256];
-
void loadRelatedPalette(const char *fileName);
+void palRotate(uint16 *pal, byte a, byte b, byte c);
+void palRotate(byte *pal, byte a, byte b, byte c);
+uint16 transformColor(uint16 baseColor, int r, int g, int b);
+void transformPaletteRange(uint16 *srcPal, uint16 *dstPal, int startColor, int stopColor, int r, int g, int b);
+void transformPaletteRange(byte *srcPal, byte *dstPal, int startColor, int stopColor, int r, int g, int b);
+
} // End of namespace Cine
#endif
diff --git a/engines/cine/part.cpp b/engines/cine/part.cpp
index 43656460c5..b39f1eff7d 100644
--- a/engines/cine/part.cpp
+++ b/engines/cine/part.cpp
@@ -70,25 +70,41 @@ void closePart(void) {
// TODO
}
-static void fixVolCnfFileName(char *dst, const uint8 *src) {
- memcpy(dst, src, 8);
- src += 8;
- dst[8] = 0;
-
- char *ext = strchr(dst, ' ');
- if (!ext) {
- ext = &dst[8];
- }
- if (*src == ' ') {
- *ext = 0;
- } else {
- *ext++ = '.';
- memcpy(ext, src, 3);
- char *end = strchr(ext, ' ');
- if (!end) {
- end = &ext[3];
+static Common::String fixVolCnfFileName(const uint8 *src, uint len) {
+ assert(len == 11 || len == 13);
+ // Copy source to a temporary buffer and force a trailing zero for string manipulation
+ char tmp[14];
+ memcpy(tmp, src, len);
+ tmp[len] = 0;
+
+ if (len == 11) {
+ // Filenames of length 11 have no separation of the extension and the basename
+ // so that's why we have to convert them first. There's no trailing zero in them
+ // either and they're always of the full length 11 with padding spaces. Extension
+ // can be always found at offset 8 onwards.
+ //
+ // Examples of filename mappings:
+ // "AEROPORTMSG" -> "AEROPORT.MSG"
+ // "MITRAILLHP " -> "MITRAILL.HP" (Notice the trailing space after the extension)
+ // "BOND10 " -> "BOND10"
+ // "GIRL SET" -> "GIRL.SET"
+
+ // Replace all space characters with zeroes
+ for (uint i = 0; i < len; i++)
+ if (tmp[i] == ' ')
+ tmp[i] = 0;
+ // Extract the filename's extension
+ Common::String extension(tmp + 8);
+ tmp[8] = 0; // Force separation of extension and basename
+ Common::String basename(tmp);
+ if (extension.empty()) {
+ return basename;
+ } else {
+ return basename + "." + extension;
}
- *end = 0;
+ } else {
+ // Filenames of length 13 are okay as they are, no need for conversion
+ return Common::String(tmp);
}
}
@@ -97,30 +113,25 @@ void CineEngine::readVolCnf() {
if (!f.open("vol.cnf")) {
error("Unable to open 'vol.cnf'");
}
- bool abaseHeader = false;
uint32 unpackedSize, packedSize;
char hdr[8];
f.read(hdr, 8);
- if (memcmp(hdr, "ABASECP", 7) == 0) {
- abaseHeader = true;
+ bool compressed = (memcmp(hdr, "ABASECP", 7) == 0);
+ if (compressed) {
unpackedSize = f.readUint32BE();
packedSize = f.readUint32BE();
} else {
f.seek(0);
unpackedSize = packedSize = f.size();
}
- uint8 *buf = (uint8 *)malloc(unpackedSize);
- if (!buf) {
- error("Unable to allocate %d bytes", unpackedSize);
- }
+ uint8 *buf = new uint8[unpackedSize];
f.read(buf, packedSize);
if (packedSize != unpackedSize) {
- bool b = delphineUnpack(buf, buf, packedSize);
- if (!b) {
+ CineUnpacker cineUnpacker;
+ if (!cineUnpacker.unpack(buf, packedSize, buf, unpackedSize)) {
error("Error while unpacking 'vol.cnf' data");
}
}
- const int fileNameLength = abaseHeader ? 11 : 13;
uint8 *p = buf;
int resourceFilesCount = READ_BE_UINT16(p); p += 2;
int entrySize = READ_BE_UINT16(p); p += 2;
@@ -132,31 +143,48 @@ void CineEngine::readVolCnf() {
p += entrySize;
}
- int volumeEntriesCount = 0;
+ // Check file name blocks' sizes
+ bool fileNameLenMod11, fileNameLenMod13;
+ fileNameLenMod11 = fileNameLenMod13 = true;
for (int i = 0; i < resourceFilesCount; ++i) {
int size = READ_BE_UINT32(p); p += 4;
- assert((size % fileNameLength) == 0);
- volumeEntriesCount += size / fileNameLength;
+ fileNameLenMod11 &= ((size % 11) == 0);
+ fileNameLenMod13 &= ((size % 13) == 0);
p += size;
}
+ // Make sure at least one of the candidates for file name length fits the data
+ assert(fileNameLenMod11 || fileNameLenMod13);
+
+ // File name length used to be deduced from the fact whether the file
+ // was compressed or not. Compressed files used file name length 11,
+ // uncompressed files used file name length 13. It worked almost always,
+ // but not with the game entry that's detected as the Operation Stealth's
+ // US Amiga release. It uses a compressed 'vol.cnf' file but still uses
+ // file names of length 13. So we try to deduce the file name length from
+ // the data in the 'vol.cnf' file.
+ int fileNameLength;
+ if (fileNameLenMod11 != fileNameLenMod13) {
+ // All file name blocks' sizes were divisible by either 11 or 13, but not with both.
+ fileNameLength = (fileNameLenMod11 ? 11 : 13);
+ } else {
+ warning("Couldn't deduce file name length from data in 'vol.cnf', using a backup deduction scheme.");
+ // Here we use the former file name length detection method
+ // if we couldn't deduce the file name length from the data.
+ fileNameLength = (compressed ? 11 : 13);
+ }
p = buf + 4 + resourceFilesCount * entrySize;
for (int i = 0; i < resourceFilesCount; ++i) {
int count = READ_BE_UINT32(p) / fileNameLength; p += 4;
while (count--) {
- char volumeEntryName[13];
- if (abaseHeader) {
- fixVolCnfFileName(volumeEntryName, p);
- } else {
- memcpy(volumeEntryName, p, fileNameLength);
- }
+ Common::String volumeEntryName = fixVolCnfFileName(p, fileNameLength);
_volumeEntriesMap.setVal(volumeEntryName, _volumeResourceFiles[i].c_str());
- debugC(5, kCineDebugPart, "Added volume entry name '%s' resource file '%s'", volumeEntryName, _volumeResourceFiles[i].c_str());
+ debugC(5, kCineDebugPart, "Added volume entry name '%s' resource file '%s'", volumeEntryName.c_str(), _volumeResourceFiles[i].c_str());
p += fileNameLength;
}
}
- free(buf);
+ delete[] buf;
}
int16 findFileInBundle(const char *fileName) {
@@ -197,7 +225,10 @@ byte *readBundleFile(int16 foundFileIdx) {
if (partBuffer[foundFileIdx].unpackedSize != partBuffer[foundFileIdx].packedSize) {
byte *unpackBuffer = (byte *)malloc(partBuffer[foundFileIdx].packedSize);
readFromPart(foundFileIdx, unpackBuffer);
- delphineUnpack(dataPtr, unpackBuffer, partBuffer[foundFileIdx].packedSize);
+ CineUnpacker cineUnpacker;
+ if (!cineUnpacker.unpack(unpackBuffer, partBuffer[foundFileIdx].packedSize, dataPtr, partBuffer[foundFileIdx].unpackedSize)) {
+ warning("Error unpacking '%s' from bundle file '%s'", partBuffer[foundFileIdx].partName, currentPartName);
+ }
free(unpackBuffer);
} else {
readFromPart(foundFileIdx, dataPtr);
diff --git a/engines/cine/prc.cpp b/engines/cine/prc.cpp
index 0f068a197e..402c97b1a6 100644
--- a/engines/cine/prc.cpp
+++ b/engines/cine/prc.cpp
@@ -98,10 +98,10 @@ void loadPrc(const char *pPrcName) {
char buffer[256];
for (s = 0; s < numScripts; s++) {
- if (scriptTable[s].size) {
+ if (scriptTable[s]->_size) {
sprintf(buffer, "%s_%03d.txt", pPrcName, s);
- decompileScript(scriptTable[s].ptr, scriptTable[s].stack, scriptTable[s].size, s);
+ decompileScript((const byte *)scriptTable[s]->getString(0), scriptTable[s]->_size, s);
dumpScript(buffer);
}
}
diff --git a/engines/cine/rel.cpp b/engines/cine/rel.cpp
index f550efed27..dd2d0f68b6 100644
--- a/engines/cine/rel.cpp
+++ b/engines/cine/rel.cpp
@@ -81,10 +81,10 @@ void loadRel(char *pRelName) {
char buffer[256];
for (s = 0; s < numEntry; s++) {
- if (relTable[s].size) {
+ if (relTable[s]->_size) {
sprintf(buffer, "%s_%03d.txt", pRelName, s);
- decompileScript(relTable[s].data, NULL, relTable[s].size, s);
+ decompileScript((const byte *)relTable[s]->getString(0), relTable[s]->_size, s);
dumpScript(buffer);
}
}
diff --git a/engines/cine/script.h b/engines/cine/script.h
index 4a2e7072ee..eeac0e8809 100644
--- a/engines/cine/script.h
+++ b/engines/cine/script.h
@@ -155,8 +155,8 @@ protected:
int o1_getObjectParam();
int o1_addObjectParam();
int o1_subObjectParam();
- int o1_add2ObjectParam();
- int o1_sub2ObjectParam();
+ int o1_mulObjectParam();
+ int o1_divObjectParam();
int o1_compareObjectParam();
int o1_setupObject();
int o1_checkCollision();
@@ -230,6 +230,7 @@ protected:
int o1_unloadMask5();
// pointers to member functions in C++ suck...
+ int o2_loadCt();
int o2_loadPart();
int o2_addSeqListElement();
int o2_removeSeq();
@@ -362,7 +363,7 @@ extern ScriptVars globalVars;
void setupOpcodes();
-void decompileScript(byte *scriptPtr, int16 *stackPtr, uint16 scriptSize, uint16 scriptIdx);
+void decompileScript(const byte *scriptPtr, uint16 scriptSize, uint16 scriptIdx);
void dumpScript(char *dumpName);
#define OP_loadPart 0x3F
diff --git a/engines/cine/script_fw.cpp b/engines/cine/script_fw.cpp
index f833d7c30b..845120c99e 100644
--- a/engines/cine/script_fw.cpp
+++ b/engines/cine/script_fw.cpp
@@ -41,11 +41,6 @@ namespace Cine {
ScriptVars globalVars(NUM_MAX_VAR);
uint16 compareVars(int16 a, int16 b);
-void palRotate(byte a, byte b, byte c);
-void removeSeq(uint16 param1, uint16 param2, uint16 param3);
-uint16 isSeqRunning(uint16 param1, uint16 param2, uint16 param3);
-void addGfxElementA0(int16 param1, int16 param2);
-void removeGfxElementA0(int16 idx, int16 param);
const Opcode FWScript::_opcodeTable[] = {
/* 00 */
@@ -54,8 +49,8 @@ const Opcode FWScript::_opcodeTable[] = {
{ &FWScript::o1_addObjectParam, "bbw" },
{ &FWScript::o1_subObjectParam, "bbw" },
/* 04 */
- { &FWScript::o1_add2ObjectParam, "bbw" },
- { &FWScript::o1_sub2ObjectParam, "bbw" },
+ { &FWScript::o1_mulObjectParam, "bbw" },
+ { &FWScript::o1_divObjectParam, "bbw" },
{ &FWScript::o1_compareObjectParam, "bbw" },
{ &FWScript::o1_setupObject, "bwwww" },
/* 08 */
@@ -808,23 +803,32 @@ int FWScript::o1_subObjectParam() {
return 0;
}
-/*! \todo Implement this instruction
- */
-int FWScript::o1_add2ObjectParam() {
- uint16 a = getNextByte();
- uint16 b = getNextByte();
- uint16 c = getNextWord();
- warning("STUB: o1_add2ObjectParam(%x, %x, %x)", a, b, c);
+int FWScript::o1_mulObjectParam() {
+ byte objIdx = getNextByte();
+ byte paramIdx = getNextByte();
+ int16 newValue = getNextWord();
+
+ debugC(5, kCineDebugScript, "Line: %d: mulObjectParam(objIdx:%d,paramIdx:%d,newValue:%d)", _line, objIdx, paramIdx, newValue);
+
+ // FIXME? In PC versions of Future Wars and Operation Stealth the multiplication is done unsigned.
+ // (16b x 16b -> 32b, taking only 16 LSBs). The question is, does it really matter?
+ int16 currentValue = getObjectParam(objIdx, paramIdx);
+ modifyObjectParam(objIdx, paramIdx, currentValue * newValue);
return 0;
}
-/*! \todo Implement this instruction
- */
-int FWScript::o1_sub2ObjectParam() {
- uint16 a = getNextByte();
- uint16 b = getNextByte();
- uint16 c = getNextWord();
- warning("STUB: o1_sub2ObjectParam(%x, %x, %x)", a, b, c);
+int FWScript::o1_divObjectParam() {
+ byte objIdx = getNextByte();
+ byte paramIdx = getNextByte();
+ int16 newValue = getNextWord();
+
+ debugC(5, kCineDebugScript, "Line: %d: divObjectParam(objIdx:%d,paramIdx:%d,newValue:%d)", _line, objIdx, paramIdx, newValue);
+
+ // In PC versions of Future Wars and Operation Stealth the division is done signed.
+ // Dividend is first sign extended from 16 bits to 32 bits and then divided by the
+ // 16 bit divider using signed division. Only 16 LSBs of the quotient are saved.
+ int16 currentValue = getObjectParam(objIdx, paramIdx);
+ modifyObjectParam(objIdx, paramIdx, currentValue / newValue);
return 0;
}
@@ -1299,7 +1303,7 @@ int FWScript::o1_loadCt() {
const char *param = getNextString();
debugC(5, kCineDebugScript, "Line: %d: loadCt(\"%s\")", _line, param);
- loadCt(param);
+ loadCtFW(param);
return 0;
}
@@ -1355,31 +1359,29 @@ int FWScript::o1_blitAndFade() {
debugC(5, kCineDebugScript, "Line: %d: request fadein", _line);
// TODO: use real code
- drawOverlays();
- fadeRequired = true;
- flip();
-
// fadeFromBlack();
+
+ renderer->reloadPalette();
return 0;
}
int FWScript::o1_fadeToBlack() {
debugC(5, kCineDebugScript, "Line: %d: request fadeout", _line);
- fadeToBlack();
+ renderer->fadeToBlack();
return 0;
}
int FWScript::o1_transformPaletteRange() {
byte startColor = getNextByte();
byte numColor = getNextByte();
- uint16 r = getNextWord();
- uint16 g = getNextWord();
- uint16 b = getNextWord();
+ int16 r = getNextWord();
+ int16 g = getNextWord();
+ int16 b = getNextWord();
debugC(5, kCineDebugScript, "Line: %d: transformPaletteRange(from:%d,numIdx:%d,r:%d,g:%d,b:%d)", _line, startColor, numColor, r, g, b);
- transformPaletteRange(startColor, numColor, r, g, b);
+ renderer->transformPalette(startColor, numColor, r, g, b);
return 0;
}
@@ -1387,7 +1389,8 @@ int FWScript::o1_setDefaultMenuColor2() {
byte param = getNextByte();
debugC(5, kCineDebugScript, "Line: %d: setDefaultMenuColor2(%d)", _line, param);
- defaultMenuBoxColor2 = param;
+
+ renderer->_messageBg = param;
return 0;
}
@@ -1397,7 +1400,8 @@ int FWScript::o1_palRotate() {
byte c = getNextByte();
debugC(5, kCineDebugScript, "Line: %d: palRotate(%d,%d,%d)", _line, a, b, c);
- palRotate(a, b, c);
+
+ renderer->rotatePalette(a, b, c);
return 0;
}
@@ -1475,11 +1479,7 @@ int FWScript::o1_compareGlobalVar() {
debugC(5, kCineDebugScript, "Line: %d: compare globalVars[%d] and %d", _line, varIdx, value);
- if (varIdx == 255 && (g_cine->getGameType() == Cine::GType_FW)) { // TODO: fix
- _compare = 1;
- } else {
- _compare = compareVars(_globalVars[varIdx], value);
- }
+ _compare = compareVars(_globalVars[varIdx], value);
}
return 0;
@@ -1558,7 +1558,8 @@ int FWScript::o1_setDefaultMenuColor() {
byte param = getNextByte();
debugC(5, kCineDebugScript, "Line: %d: setDefaultMenuColor(%d)", _line, param);
- defaultMenuBoxColor = param;
+
+ renderer->_cmdY = param;
return 0;
}
@@ -1608,7 +1609,8 @@ int FWScript::o1_stopSample() {
return 0;
}
-/*! \todo Implement this instruction
+/*! \todo Implement this instruction's Amiga part (PC part already done)
+ * In PC versions of Future Wars and Operation Stealth this instruction does nothing else but read the parameters.
*/
int FWScript::o1_op71() {
byte a = getNextByte();
@@ -1617,7 +1619,8 @@ int FWScript::o1_op71() {
return 0;
}
-/*! \todo Implement this instruction
+/*! \todo Implement this instruction's Amiga part (PC part already done)
+ * In PC versions of Future Wars and Operation Stealth this instruction does nothing else but read the parameters.
*/
int FWScript::o1_op72() {
uint16 a = getNextWord();
@@ -1627,7 +1630,8 @@ int FWScript::o1_op72() {
return 0;
}
-/*! \todo Implement this instruction
+/*! \todo Implement this instruction's Amiga part (PC part already done)
+ * In PC versions of Future Wars and Operation Stealth this instruction does nothing else but read the parameters.
*/
int FWScript::o1_op73() {
// I believe this opcode is identical to o1_op72(). In fact, Operation
@@ -1635,7 +1639,7 @@ int FWScript::o1_op73() {
uint16 a = getNextWord();
byte b = getNextByte();
uint16 c = getNextWord();
- warning("STUB: o1_op72(%x, %x, %x)", a, b, c);
+ warning("STUB: o1_op73(%x, %x, %x)", a, b, c);
return 0;
}
@@ -1728,18 +1732,6 @@ int FWScript::o1_unloadMask5() {
//-----------------------------------------------------------------------
-void palRotate(byte a, byte b, byte c) {
- if (c == 1) {
- uint16 currentColor = c_palette[b];
-
- for (int16 i = b; i > a; i--) {
- c_palette[i] = c_palette[i - 1];
- }
-
- c_palette[a] = currentColor;
- }
-}
-
void addScriptToList0(uint16 idx) {
ScriptPtr tmp(scriptInfo->create(*scriptTable[idx], idx));
assert(tmp);
@@ -1863,14 +1855,13 @@ const char *getObjPramName(byte paramIdx) {
}
}
-void decompileScript(byte *scriptPtr, int16 *stackPtr, uint16 scriptSize, uint16 scriptIdx) {
+void decompileScript(const byte *scriptPtr, uint16 scriptSize, uint16 scriptIdx) {
char lineBuffer[256];
- byte *localScriptPtr = scriptPtr;
+ const byte *localScriptPtr = scriptPtr;
uint16 exitScript;
uint32 position = 0;
assert(scriptPtr);
- // assert(stackPtr);
exitScript = 0;
@@ -2292,7 +2283,7 @@ void decompileScript(byte *scriptPtr, int16 *stackPtr, uint16 scriptSize, uint16
sprintf(lineBuffer, "loadPart(%s)\n", localScriptPtr + position);
}
- position += strlen((char *)localScriptPtr + position) + 1;
+ position += strlen((const char *)localScriptPtr + position) + 1;
break;
}
case 0x40:
@@ -2309,7 +2300,7 @@ void decompileScript(byte *scriptPtr, int16 *stackPtr, uint16 scriptSize, uint16
sprintf(lineBuffer, "loadPrc(%d,%s)\n", param, localScriptPtr + position);
- position += strlen((char *)localScriptPtr + position) + 1;
+ position += strlen((const char *)localScriptPtr + position) + 1;
break;
}
case OP_requestCheckPendingDataLoad: // nop
@@ -2461,7 +2452,7 @@ void decompileScript(byte *scriptPtr, int16 *stackPtr, uint16 scriptSize, uint16
{
sprintf(lineBuffer, "comment: %s\n", localScriptPtr + position);
- position += strlen((char *)localScriptPtr + position);
+ position += strlen((const char *)localScriptPtr + position);
break;
}
case 0x5A:
@@ -2540,7 +2531,7 @@ void decompileScript(byte *scriptPtr, int16 *stackPtr, uint16 scriptSize, uint16
{
sprintf(lineBuffer, "loadDat(%s)\n", localScriptPtr + position);
- position += strlen((char *)localScriptPtr + position) + 1;
+ position += strlen((const char *)localScriptPtr + position) + 1;
break;
}
case 0x6E: // nop
@@ -2801,7 +2792,7 @@ void decompileScript(byte *scriptPtr, int16 *stackPtr, uint16 scriptSize, uint16
sprintf(lineBuffer, "ADDBG(%d,%s)\n", param1, localScriptPtr + position);
- position += strlen((char *)localScriptPtr + position);
+ position += strlen((const char *)localScriptPtr + position);
break;
}
@@ -2825,7 +2816,7 @@ void decompileScript(byte *scriptPtr, int16 *stackPtr, uint16 scriptSize, uint16
sprintf(lineBuffer, "loadABS(%d,%s)\n", param1, localScriptPtr + position);
- position += strlen((char *)localScriptPtr + position);
+ position += strlen((const char *)localScriptPtr + position);
break;
}
diff --git a/engines/cine/script_os.cpp b/engines/cine/script_os.cpp
index 1f5ea2b838..319fca5d3c 100644
--- a/engines/cine/script_os.cpp
+++ b/engines/cine/script_os.cpp
@@ -45,8 +45,8 @@ const Opcode OSScript::_opcodeTable[] = {
{ &FWScript::o1_addObjectParam, "bbw" },
{ &FWScript::o1_subObjectParam, "bbw" },
/* 04 */
- { &FWScript::o1_add2ObjectParam, "bbw" },
- { &FWScript::o1_sub2ObjectParam, "bbw" },
+ { &FWScript::o1_mulObjectParam, "bbw" },
+ { &FWScript::o1_divObjectParam, "bbw" },
{ &FWScript::o1_compareObjectParam, "bbw" },
{ &FWScript::o1_setupObject, "bwwww" },
/* 08 */
@@ -73,7 +73,7 @@ const Opcode OSScript::_opcodeTable[] = {
{ &FWScript::o1_loadMask4, "b" },
{ &FWScript::o1_unloadMask4, "b" },
{ &FWScript::o1_addSpriteFilledToBgList, "b" },
- { &FWScript::o1_op1B, "" },
+ { &FWScript::o1_op1B, "" }, /* TODO: Name this opcode properly. */
/* 1C */
{ 0, 0 },
{ &FWScript::o1_label, "l" },
@@ -116,7 +116,7 @@ const Opcode OSScript::_opcodeTable[] = {
{ &FWScript::o1_loadAnim, "s" },
/* 3C */
{ &FWScript::o1_loadBg, "s" },
- { &FWScript::o1_loadCt, "s" },
+ { &FWScript::o2_loadCt, "s" },
{ 0, 0 },
{ &FWScript::o2_loadPart, "s" },
/* 40 */
@@ -173,7 +173,7 @@ const Opcode OSScript::_opcodeTable[] = {
{ &FWScript::o1_setDefaultMenuColor, "b" },
{ &FWScript::o1_allowPlayerInput, "" },
{ &FWScript::o1_disallowPlayerInput, "" },
- { &FWScript::o1_changeDataDisk, "b" },
+ { &FWScript::o1_changeDataDisk, "b" }, /* Same as opcodes 0x95 and 0xA9. */
/* 6C */
{ 0, 0 },
{ &FWScript::o1_loadMusic, "s" },
@@ -181,9 +181,9 @@ const Opcode OSScript::_opcodeTable[] = {
{ &FWScript::o1_fadeOutMusic, "" },
/* 70 */
{ &FWScript::o1_stopSample, "" },
- { &FWScript::o1_op71, "bw" },
- { &FWScript::o1_op72, "wbw" },
- { &FWScript::o1_op72, "wbw" },
+ { &FWScript::o1_op71, "bw" }, /* TODO: Name this opcode properly. */
+ { &FWScript::o1_op72, "wbw" }, /* Same as opcode 0x73. TODO: Name this opcode properly. */
+ { &FWScript::o1_op72, "wbw" }, /* Same as opcode 0x72. */
/* 74 */
{ 0, 0 },
{ 0, 0 },
@@ -193,7 +193,7 @@ const Opcode OSScript::_opcodeTable[] = {
{ &FWScript::o2_playSampleAlt, "bbwbww" },
{ &FWScript::o1_disableSystemMenu, "b" },
{ &FWScript::o1_loadMask5, "b" },
- { &FWScript::o1_unloadMask5, "b" },
+ { &FWScript::o1_unloadMask5, "b" }, /* Last opcode used by Future Wars. */
/* 7C */
{ 0, 0 },
{ 0, 0 },
@@ -201,8 +201,8 @@ const Opcode OSScript::_opcodeTable[] = {
{ &FWScript::o2_addSeqListElement, "bbbbwww" },
/* 80 */
{ &FWScript::o2_removeSeq, "bb" },
- { &FWScript::o2_op81, "" },
- { &FWScript::o2_op82, "bbw" },
+ { &FWScript::o2_op81, "" }, /* TODO: Name this opcode properly. */
+ { &FWScript::o2_op82, "bbwwb" }, /* TODO: Name this opcode properly. */
{ &FWScript::o2_isSeqRunning, "bb" },
/* 84 */
{ &FWScript::o2_gotoIfSupNearest, "b" },
@@ -216,7 +216,7 @@ const Opcode OSScript::_opcodeTable[] = {
{ &FWScript::o2_startObjectScript, "b" },
/* 8C */
{ &FWScript::o2_stopObjectScript, "b" },
- { &FWScript::o2_op8D, "wwwwwwww" },
+ { &FWScript::o2_op8D, "wwwwwwww" }, /* TODO: Name this opcode properly. */
{ &FWScript::o2_addBackground, "bs" },
{ &FWScript::o2_removeBackground, "b" },
/* 90 */
@@ -226,32 +226,32 @@ const Opcode OSScript::_opcodeTable[] = {
{ 0, 0 },
/* 94 */
{ 0, 0 },
- { &FWScript::o1_changeDataDisk, "b" },
+ { &FWScript::o1_changeDataDisk, "b" }, /* Same as opcodes 0x6B and 0xA9. */
{ 0, 0 },
{ 0, 0 },
/* 98 */
{ 0, 0 },
{ 0, 0 },
- { &FWScript::o2_wasZoneChecked, "" },
- { &FWScript::o2_op9B, "wwwwwwww" },
+ { &FWScript::o2_wasZoneChecked, "b" },
+ { &FWScript::o2_op9B, "wwwwwwww" }, /* TODO: Name this opcode properly. */
/* 9C */
- { &FWScript::o2_op9C, "wwww" },
+ { &FWScript::o2_op9C, "wwww" }, /* TODO: Name this opcode properly. */
{ &FWScript::o2_useBgScroll, "b" },
{ &FWScript::o2_setAdditionalBgVScroll, "c" },
- { &FWScript::o2_op9F, "ww" },
+ { &FWScript::o2_op9F, "ww" }, /* TODO: Name this opcode properly. */
/* A0 */
- { &FWScript::o2_addGfxElementA0, "ww" },
- { &FWScript::o2_removeGfxElementA0, "ww" },
- { &FWScript::o2_opA2, "ww" },
- { &FWScript::o2_opA3, "ww" },
+ { &FWScript::o2_addGfxElementA0, "ww" }, /* TODO: Name this opcode properly. */
+ { &FWScript::o2_removeGfxElementA0, "ww" }, /* TODO: Name this opcode properly. */
+ { &FWScript::o2_opA2, "ww" }, /* TODO: Name this opcode properly. */
+ { &FWScript::o2_opA3, "ww" }, /* TODO: Name this opcode properly. */
/* A4 */
- { &FWScript::o2_loadMask22, "b" },
- { &FWScript::o2_unloadMask22, "b" },
+ { &FWScript::o2_loadMask22, "b" }, /* TODO: Name this opcode properly. */
+ { &FWScript::o2_unloadMask22, "b" }, /* TODO: Name this opcode properly. */
{ 0, 0 },
{ 0, 0 },
/* A8 */
{ 0, 0 },
- { &FWScript::o1_changeDataDisk, "b" }
+ { &FWScript::o1_changeDataDisk, "b" } /* Same as opcodes 0x6B and 0x95. */
};
const unsigned int OSScript::_numOpcodes = ARRAYSIZE(OSScript::_opcodeTable);
@@ -365,6 +365,14 @@ FWScript *OSScriptInfo::create(const RawObjectScript &script, int16 index, const
// OPERATION STEALTH opcodes
// ------------------------------------------------------------------------
+int FWScript::o2_loadCt() {
+ const char *param = getNextString();
+
+ debugC(5, kCineDebugScript, "Line: %d: loadCt(\"%s\")", _line, param);
+ loadCtOS(param);
+ return 0;
+}
+
int FWScript::o2_loadPart() {
const char *param = getNextString();
@@ -447,7 +455,9 @@ int FWScript::o2_op82() {
byte a = getNextByte();
byte b = getNextByte();
uint16 c = getNextWord();
- warning("STUB: o2_op82(%x, %x, %x)", a, b, c);
+ uint16 d = getNextWord();
+ byte e = getNextByte();
+ warning("STUB: o2_op82(%x, %x, %x, %x, %x)", a, b, c, d, e);
return 0;
}
@@ -615,20 +625,7 @@ int FWScript::o2_removeBackground() {
debugC(5, kCineDebugScript, "Line: %d: removeBackground(%d)", _line, param);
- if (additionalBgTable[param]) {
- free(additionalBgTable[param]);
- additionalBgTable[param] = NULL;
- }
-
- if (currentAdditionalBgIdx == param) {
- currentAdditionalBgIdx = 0;
- }
-
- if (currentAdditionalBgIdx2 == param) {
- currentAdditionalBgIdx2 = 0;
- }
-
- strcpy(currentBgName[param], "");
+ renderer->removeBg(param);
return 0;
}
@@ -644,29 +641,20 @@ int FWScript::o2_loadAbs() {
int FWScript::o2_loadBg() {
byte param = getNextByte();
- assert(param <= 8);
+ assert(param < 9);
debugC(5, kCineDebugScript, "Line: %d: useBg(%d)", _line, param);
- if (additionalBgTable[param]) {
- currentAdditionalBgIdx = param;
- if (param == 8) {
- newColorMode = 3;
- } else {
- newColorMode = bgColorMode + 1;
- }
- //if (_screenNeedFadeOut == 0) {
- // adBgVar1 = 1;
- //}
- fadeRequired = true;
- }
+ renderer->selectBg(param);
return 0;
}
-/*! \todo Implement this instruction
+/*! \todo Check the current implementation for correctness
*/
int FWScript::o2_wasZoneChecked() {
- warning("STUB: o2_wasZoneChecked()");
+ byte param = getNextByte();
+ _compare = (param < 16 && zoneData[param]);
+ debugC(5, kCineDebugScript, "Line: %d: o2_wasZoneChecked(%d)", _line, param);
return 0;
}
@@ -699,13 +687,11 @@ int FWScript::o2_op9C() {
int FWScript::o2_useBgScroll() {
byte param = getNextByte();
- assert(param <= 8);
+ assert(param < 9);
debugC(5, kCineDebugScript, "Line: %d: useBgScroll(%d)", _line, param);
- if (additionalBgTable[param]) {
- currentAdditionalBgIdx2 = param;
- }
+ renderer->selectScrollBg(param);
return 0;
}
@@ -716,12 +702,12 @@ int FWScript::o2_setAdditionalBgVScroll() {
byte param2 = getNextByte();
debugC(5, kCineDebugScript, "Line: %d: additionalBgVScroll = var[%d]", _line, param2);
- additionalBgVScroll = _localVars[param2];
+ renderer->setScroll(_localVars[param2]);
} else {
uint16 param2 = getNextWord();
debugC(5, kCineDebugScript, "Line: %d: additionalBgVScroll = %d", _line, param2);
- additionalBgVScroll = param2;
+ renderer->setScroll(param2);
}
return 0;
}
diff --git a/engines/cine/texte.cpp b/engines/cine/texte.cpp
index e41626cad1..9b4b83f420 100644
--- a/engines/cine/texte.cpp
+++ b/engines/cine/texte.cpp
@@ -611,65 +611,49 @@ void freePoldatDat() {
fontParamTable = 0;
}
-uint16 computeMessageLength(const byte *ptr, uint16 width, uint16 *numWords, uint16 *messageWidth, uint16 *lineResult) {
- const byte *localPtr = ptr;
-
- uint16 var_2 = 0;
- uint16 localLineResult = 0;
- uint16 var_6 = 0;
- uint16 var_8 = 0;
- uint16 localMessageWidth = 0;
- uint16 var_16 = 0;
- uint16 finished = 0;
- uint16 si = 0;
- uint16 di = 0;
-
- while (!finished) {
- byte character = *(localPtr++);
-
- if (character == ' ') {
- var_8 = var_16;
- var_6 = localMessageWidth;
- localLineResult = si;
- var_2 = di;
-
- if (si + 5 < width) {
- var_16++;
- si += 5;
- } else {
- finished = 1;
- }
- } else if (character == 0x7C || character == 0) {
- finished = 1;
- si = 0;
+/*! \brief Fit a substring of text into one line of fixed width text box
+ * \param str Text to fit
+ * \param maxWidth Text box width
+ * \param[out] words Number of words that fit
+ * \param[out] width Total width of nonblank characters that fit
+ * \return Length of substring which fits
+ */
+int fitLine(const char *str, int maxWidth, int &words, int &width) {
+ int i, bkpWords = 0, bkpWidth = 0, bkpLen = 0;
+ int charWidth = 0, fullWidth = 0;
+
+ words = 0;
+ width = 0;
+
+ for (i = 0; str[i]; i++) {
+ if (str[i] == 0x7C) {
+ i++;
+ break;
+ } else if (str[i] == ' ') {
+ charWidth = 5;
+ bkpWords = words++;
+ bkpWidth = width;
+ bkpLen = i + 1;
} else {
- if (fontParamTable[character].characterWidth) {
- uint16 var_C = fontParamTable[character].characterWidth + 1;
-
- if (si + var_C < width) {
- si += var_C;
- localMessageWidth += var_C;
- } else {
- finished = 1;
-
- if (localLineResult) {
- var_16 = var_8;
- localMessageWidth = var_6;
- si = localLineResult;
- di = var_2;
- }
- }
- }
+ charWidth = fontParamTable[(unsigned char)str[i]].characterWidth + 1;
+ width += charWidth;
}
- di++;
- }
+ if (!charWidth) {
+ continue;
+ }
- *numWords = var_16;
- *messageWidth = localMessageWidth;
- *lineResult = si;
+ if (fullWidth + charWidth < maxWidth) {
+ fullWidth += charWidth;
+ } else if (fullWidth) {
+ words = bkpWords;
+ width = bkpWidth;
+ i = bkpLen;
+ break;
+ }
+ }
- return di;
+ return i;
}
} // End of namespace Cine
diff --git a/engines/cine/texte.h b/engines/cine/texte.h
index b5eaef9211..ae82832aea 100644
--- a/engines/cine/texte.h
+++ b/engines/cine/texte.h
@@ -56,7 +56,7 @@ void freeErrmessDat(void);
void loadPoldatDat(const char *fname);
void freePoldatDat(void);
-uint16 computeMessageLength(const byte *ptr, uint16 width, uint16 *numWords, uint16 *messageWidth, uint16 *lineResult);
+int fitLine(const char *ptr, int maxWidth, int &words, int &width);
} // End of namespace Cine
diff --git a/engines/cine/unpack.cpp b/engines/cine/unpack.cpp
index 4409af4b07..dcd3181242 100644
--- a/engines/cine/unpack.cpp
+++ b/engines/cine/unpack.cpp
@@ -30,94 +30,120 @@
namespace Cine {
-struct UnpackCtx {
- int size, datasize;
- uint32 crc;
- uint32 chk;
- byte *dst;
- const byte *src;
-};
-
-static int rcr(UnpackCtx *uc, int CF) {
- int rCF = (uc->chk & 1);
- uc->chk >>= 1;
- if (CF) {
- uc->chk |= 0x80000000;
+uint32 CineUnpacker::readSource() {
+ if (_src < _srcBegin || _src + 4 > _srcEnd) {
+ _error = true;
+ return 0; // The source pointer is out of bounds, returning a default value
}
- return rCF;
+ uint32 value = READ_BE_UINT32(_src);
+ _src -= 4;
+ return value;
}
-static int nextChunk(UnpackCtx *uc) {
- int CF = rcr(uc, 0);
- if (uc->chk == 0) {
- uc->chk = READ_BE_UINT32(uc->src); uc->src -= 4;
- uc->crc ^= uc->chk;
- CF = rcr(uc, 1);
+uint CineUnpacker::rcr(bool inputCarry) {
+ uint outputCarry = (_chunk32b & 1);
+ _chunk32b >>= 1;
+ if (inputCarry) {
+ _chunk32b |= 0x80000000;
}
- return CF;
+ return outputCarry;
}
-static uint16 getCode(UnpackCtx *uc, byte numChunks) {
- uint16 c = 0;
- while (numChunks--) {
+uint CineUnpacker::nextBit() {
+ uint carry = rcr(false);
+ // Normally if the chunk becomes zero then the carry is one as
+ // the end of chunk marker is always the last to be shifted out.
+ if (_chunk32b == 0) {
+ _chunk32b = readSource();
+ _crc ^= _chunk32b;
+ carry = rcr(true); // Put the end of chunk marker in the most significant bit
+ }
+ return carry;
+}
+
+uint CineUnpacker::getBits(uint numBits) {
+ uint c = 0;
+ while (numBits--) {
c <<= 1;
- if (nextChunk(uc)) {
- c |= 1;
- }
+ c |= nextBit();
}
return c;
}
-static void unpackHelper1(UnpackCtx *uc, byte numChunks, byte addCount) {
- uint16 count = getCode(uc, numChunks) + addCount + 1;
- uc->datasize -= count;
- while (count--) {
- *uc->dst = (byte)getCode(uc, 8);
- --uc->dst;
+void CineUnpacker::unpackRawBytes(uint numBytes) {
+ if (_dst >= _dstEnd || _dst - numBytes + 1 < _dstBegin) {
+ _error = true;
+ return; // Destination pointer is out of bounds for this operation
+ }
+ while (numBytes--) {
+ *_dst = (byte)getBits(8);
+ --_dst;
}
}
-static void unpackHelper2(UnpackCtx *uc, byte numChunks) {
- uint16 i = getCode(uc, numChunks);
- uint16 count = uc->size + 1;
- uc->datasize -= count;
- while (count--) {
- *uc->dst = *(uc->dst + i);
- --uc->dst;
+void CineUnpacker::copyRelocatedBytes(uint offset, uint numBytes) {
+ if (_dst + offset >= _dstEnd || _dst - numBytes + 1 < _dstBegin) {
+ _error = true;
+ return; // Destination pointer is out of bounds for this operation
+ }
+ while (numBytes--) {
+ *_dst = *(_dst + offset);
+ --_dst;
}
}
-bool delphineUnpack(byte *dst, const byte *src, int len) {
- UnpackCtx uc;
- uc.src = src + len - 4;
- uc.datasize = READ_BE_UINT32(uc.src); uc.src -= 4;
- uc.dst = dst + uc.datasize - 1;
- uc.size = 0;
- uc.crc = READ_BE_UINT32(uc.src); uc.src -= 4;
- uc.chk = READ_BE_UINT32(uc.src); uc.src -= 4;
- uc.crc ^= uc.chk;
- do {
- if (!nextChunk(&uc)) {
- uc.size = 1;
- if (!nextChunk(&uc)) {
- unpackHelper1(&uc, 3, 0);
- } else {
- unpackHelper2(&uc, 8);
+bool CineUnpacker::unpack(const byte *src, uint srcLen, byte *dst, uint dstLen) {
+ // Initialize variables used for detecting errors during unpacking
+ _error = false;
+ _srcBegin = src;
+ _srcEnd = src + srcLen;
+ _dstBegin = dst;
+ _dstEnd = dst + dstLen;
+
+ // Initialize other variables
+ _src = _srcBegin + srcLen - 4;
+ uint32 unpackedLength = readSource(); // Unpacked length in bytes
+ _dst = _dstBegin + unpackedLength - 1;
+ _crc = readSource();
+ _chunk32b = readSource();
+ _crc ^= _chunk32b;
+
+ while (_dst >= _dstBegin && !_error) {
+ /*
+ Bits => Action:
+ 0 0 => unpackRawBytes(3 bits + 1) i.e. unpackRawBytes(1..9)
+ 1 1 1 => unpackRawBytes(8 bits + 9) i.e. unpackRawBytes(9..264)
+ 0 1 => copyRelocatedBytes(8 bits, 2) i.e. copyRelocatedBytes(0..255, 2)
+ 1 0 0 => copyRelocatedBytes(9 bits, 3) i.e. copyRelocatedBytes(0..511, 3)
+ 1 0 1 => copyRelocatedBytes(10 bits, 4) i.e. copyRelocatedBytes(0..1023, 4)
+ 1 1 0 => copyRelocatedBytes(12 bits, 8 bits + 1) i.e. copyRelocatedBytes(0..4095, 1..256)
+ */
+ if (!nextBit()) { // 0...
+ if (!nextBit()) { // 0 0
+ uint numBytes = getBits(3) + 1;
+ unpackRawBytes(numBytes);
+ } else { // 0 1
+ uint numBytes = 2;
+ uint offset = getBits(8);
+ copyRelocatedBytes(offset, numBytes);
}
- } else {
- uint16 c = getCode(&uc, 2);
- if (c == 3) {
- unpackHelper1(&uc, 8, 8);
- } else if (c < 2) {
- uc.size = c + 2;
- unpackHelper2(&uc, c + 9);
- } else {
- uc.size = getCode(&uc, 8);
- unpackHelper2(&uc, 12);
+ } else { // 1...
+ uint c = getBits(2);
+ if (c == 3) { // 1 1 1
+ uint numBytes = getBits(8) + 9;
+ unpackRawBytes(numBytes);
+ } else if (c < 2) { // 1 0 x
+ uint numBytes = c + 3;
+ uint offset = getBits(c + 9);
+ copyRelocatedBytes(offset, numBytes);
+ } else { // 1 1 0
+ uint numBytes = getBits(8) + 1;
+ uint offset = getBits(12);
+ copyRelocatedBytes(offset, numBytes);
}
}
- } while (uc.datasize > 0 && uc.src >= src - 4);
- return uc.crc == 0;
+ }
+ return !_error && (_crc == 0);
}
} // End of namespace Cine
diff --git a/engines/cine/unpack.h b/engines/cine/unpack.h
index 5f57a3531b..e16cb594a9 100644
--- a/engines/cine/unpack.h
+++ b/engines/cine/unpack.h
@@ -31,7 +31,86 @@
namespace Cine {
-bool delphineUnpack(byte *dst, const byte *src, int len);
+/**
+ * A LZ77 style decompressor for Delphine's data files
+ * used in at least Future Wars and Operation Stealth.
+ * @note Works backwards in the source and destination buffers.
+ * @note Can work with source and destination in the same buffer if there's space.
+ */
+class CineUnpacker {
+public:
+ /**
+ * Unpacks packed data from the source buffer to the destination buffer.
+ * @warning Do NOT call this on data that is not packed.
+ * @note Source and destination buffer pointers can be the same as long as there's space for the unpacked data.
+ * @param src Pointer to the source buffer.
+ * @param srcLen Length of the source buffer.
+ * @param dst Pointer to the destination buffer.
+ * @param dstLen Length of the destination buffer.
+ * @return True if no errors were detected in the source data and unpacking was successful, otherwise false.
+ */
+ bool unpack(const byte *src, uint srcLen, byte *dst, uint dstLen);
+private:
+ /**
+ * Reads an unsigned big endian 32-bit integer from the source stream and goes backwards 4 bytes.
+ * @return If the operation is valid, an unsigned big endian 32-bit integer read from the source stream.
+ * @return If the operation is invalid, zero.
+ * @note Sets internal error state if the read operation would be out of source bounds.
+ */
+ uint32 readSource();
+
+ /**
+ * Shifts the current internal 32-bit chunk to the right by one.
+ * Puts input carry into internal chunk's topmost (i.e. leftmost) bit.
+ * @return The least significant bit that was shifted out from the chunk.
+ */
+ uint rcr(bool inputCarry);
+
+ /**
+ * Get the next bit from the source stream.
+ * @note Changes the bit position in the source stream.
+ * @return The next bit from the source stream.
+ */
+ uint nextBit();
+
+ /**
+ * Get bits from the source stream.
+ * @note Changes the bit position in the source stream.
+ * @param numBits Number of bits to read from the source stream.
+ * @return Integer value consisting of the bits read from the source stream (In range [0, (2 ** numBits) - 1]).
+ * @return Later the bit was read from the source, the less significant it is in the return value.
+ */
+ uint getBits(uint numBits);
+
+ /**
+ * Copy raw bytes from the input stream and write them to the destination stream.
+ * This is used when no adequately long match is found in the sliding window.
+ * @note Sets internal error state if the operation would be out of bounds.
+ * @param numBytes Amount of bytes to copy from the input stream
+ */
+ void unpackRawBytes(uint numBytes);
+
+ /**
+ * Copy bytes from the sliding window in the destination buffer.
+ * This is used when a match of two bytes or longer is found.
+ * @note Sets internal error state if the operation would be out of bounds.
+ * @param offset Offset in the sliding window
+ * @param numBytes Amount of bytes to copy
+ */
+ void copyRelocatedBytes(uint offset, uint numBytes);
+private:
+ uint32 _crc; //!< Error-detecting code (This should be zero after successful unpacking)
+ uint32 _chunk32b; //!< The current internal 32-bit chunk of source data
+ byte *_dst; //!< Pointer to the current position in the destination buffer
+ const byte *_src; //!< Pointer to the current position in the source buffer
+
+ // These are used for detecting errors (e.g. out of bounds issues) during unpacking
+ bool _error; //!< Did an error occur during unpacking?
+ const byte *_srcBegin; //!< Source buffer's beginning
+ const byte *_srcEnd; //!< Source buffer's end
+ byte *_dstBegin; //!< Destination buffer's beginning
+ byte *_dstEnd; //!< Destination buffer's end
+};
} // End of namespace Cine
diff --git a/engines/cine/various.cpp b/engines/cine/various.cpp
index a6bd9964c0..9b98ddb253 100644
--- a/engines/cine/various.cpp
+++ b/engines/cine/various.cpp
@@ -87,7 +87,6 @@ char newPrcName[20];
char newRelName[20];
char newObjectName[20];
char newMsgName[20];
-char currentBgName[8][15];
char currentCtName[15];
char currentPartName[15];
char currentDatName[30];
@@ -96,8 +95,6 @@ int16 saveVar2;
byte isInPause = 0;
-uint16 defaultMenuBoxColor;
-
byte inputVar1 = 0;
uint16 inputVar2 = 0, inputVar3 = 0;
@@ -114,7 +111,6 @@ CommandeType objectListCommand[20];
int16 objListTab[20];
uint16 exitEngine;
-uint16 defaultMenuBoxColor2;
uint16 zoneData[NUM_MAX_ZONE];
@@ -140,6 +136,7 @@ void addPlayerCommandMessage(int16 cmd) {
tmp.type = 3;
overlayList.push_back(tmp);
+ waitForPlayerClick = 1;
}
int16 getRelEntryForObject(uint16 param1, uint16 param2, SelectedObjStruct *pSelectedObject) {
@@ -393,11 +390,14 @@ bool brokenSave(Common::InSaveFile &fHandle) {
return broken;
}
+/*! \todo Implement Operation Stealth loading, this is obviously Future Wars only
+ */
bool CineEngine::makeLoad(char *saveName) {
int16 i;
int16 size;
bool broken;
Common::InSaveFile *fHandle;
+ char bgName[13];
fHandle = g_saveFileMan->openForLoading(saveName);
@@ -440,7 +440,6 @@ bool CineEngine::makeLoad(char *saveName) {
strcpy(newRelName, "");
strcpy(newObjectName, "");
strcpy(newMsgName, "");
- strcpy(currentBgName[0], "");
strcpy(currentCtName, "");
allowPlayerInput = 0;
@@ -455,9 +454,7 @@ bool CineEngine::makeLoad(char *saveName) {
fadeRequired = false;
- for (i = 0; i < 16; i++) {
- c_palette[i] = 0;
- }
+ renderer->clear();
checkForPendingDataLoadSwitch = 0;
@@ -473,7 +470,7 @@ bool CineEngine::makeLoad(char *saveName) {
fHandle->read(currentPrcName, 13);
fHandle->read(currentRelName, 13);
fHandle->read(currentMsgName, 13);
- fHandle->read(currentBgName[0], 13);
+ fHandle->read(bgName, 13);
fHandle->read(currentCtName, 13);
checkDataDisk(currentDisk);
@@ -490,12 +487,12 @@ bool CineEngine::makeLoad(char *saveName) {
loadRel(currentRelName);
}
- if (strlen(currentBgName[0])) {
- loadBg(currentBgName[0]);
+ if (strlen(bgName)) {
+ loadBg(bgName);
}
if (strlen(currentCtName)) {
- loadCt(currentCtName);
+ loadCtFW(currentCtName);
}
fHandle->readUint16BE();
@@ -511,13 +508,7 @@ bool CineEngine::makeLoad(char *saveName) {
objectTable[i].part = fHandle->readUint16BE();
}
- for (i = 0; i < 16; i++) {
- c_palette[i] = fHandle->readUint16BE();
- }
-
- for (i = 0; i < 16; i++) {
- tempPalette[i] = fHandle->readUint16BE();
- }
+ renderer->restorePalette(*fHandle);
globalVars.load(*fHandle, NUM_MAX_VAR - 1);
@@ -530,8 +521,10 @@ bool CineEngine::makeLoad(char *saveName) {
}
fHandle->read(commandBuffer, 0x50);
+ renderer->setCommand(commandBuffer);
+
+ renderer->_cmdY = fHandle->readUint16BE();
- defaultMenuBoxColor = fHandle->readUint16BE();
bgVar0 = fHandle->readUint16BE();
allowPlayerInput = fHandle->readUint16BE();
playerCommand = fHandle->readSint16BE();
@@ -542,7 +535,8 @@ bool CineEngine::makeLoad(char *saveName) {
var3 = fHandle->readUint16BE();
var2 = fHandle->readUint16BE();
commandVar2 = fHandle->readSint16BE();
- defaultMenuBoxColor2 = fHandle->readUint16BE();
+
+ renderer->_messageBg = fHandle->readUint16BE();
fHandle->readUint16BE();
fHandle->readUint16BE();
@@ -615,7 +609,7 @@ void makeSave(char *saveFileName) {
fHandle->write(currentPrcName, 13);
fHandle->write(currentRelName, 13);
fHandle->write(currentMsgName, 13);
- fHandle->write(currentBgName[0], 13);
+ renderer->saveBg(*fHandle);
fHandle->write(currentCtName, 13);
fHandle->writeUint16BE(0xFF);
@@ -631,13 +625,7 @@ void makeSave(char *saveFileName) {
fHandle->writeUint16BE(objectTable[i].part);
}
- for (i = 0; i < 16; i++) {
- fHandle->writeUint16BE(c_palette[i]);
- }
-
- for (i = 0; i < 16; i++) {
- fHandle->writeUint16BE(tempPalette[i]);
- }
+ renderer->savePalette(*fHandle);
globalVars.save(*fHandle, NUM_MAX_VAR - 1);
@@ -651,7 +639,8 @@ void makeSave(char *saveFileName) {
fHandle->write(commandBuffer, 0x50);
- fHandle->writeUint16BE(defaultMenuBoxColor);
+ fHandle->writeUint16BE(renderer->_cmdY);
+
fHandle->writeUint16BE(bgVar0);
fHandle->writeUint16BE(allowPlayerInput);
fHandle->writeUint16BE(playerCommand);
@@ -662,7 +651,8 @@ void makeSave(char *saveFileName) {
fHandle->writeUint16BE(var3);
fHandle->writeUint16BE(var2);
fHandle->writeUint16BE(commandVar2);
- fHandle->writeUint16BE(defaultMenuBoxColor2);
+
+ fHandle->writeUint16BE(renderer->_messageBg);
fHandle->writeUint16BE(0xFF);
fHandle->writeUint16BE(0x1E);
@@ -864,26 +854,6 @@ void CineEngine::makeSystemMenu(void) {
}
}
-int drawChar(byte character, int16 x, int16 y) {
- if (character == ' ') {
- x += 5;
- } else {
- byte characterWidth = fontParamTable[character].characterWidth;
-
- if (characterWidth) {
- byte characterIdx = fontParamTable[character].characterIdx;
- if (g_cine->getGameType() == Cine::GType_OS) {
- drawSpriteRaw2(textTable[characterIdx][0], 0, 2, 8, page1Raw, x, y);
- } else {
- drawSpriteRaw(textTable[characterIdx][0], textTable[characterIdx][1], 2, 8, page1Raw, x, y);
- }
- x += characterWidth + 1;
- }
- }
-
- return x;
-}
-
void drawMessageBox(int16 x, int16 y, int16 width, int16 currentY, int16 offset, int16 color, byte* page) {
gfxDrawLine(x + offset, y + offset, x + width - offset, y + offset, color, page); // top
gfxDrawLine(x + offset, currentY + 4 - offset, x + width - offset, currentY + 4 - offset, color, page); // bottom
@@ -896,49 +866,6 @@ void drawDoubleMessageBox(int16 x, int16 y, int16 width, int16 currentY, int16 c
drawMessageBox(x, y, width, currentY, 0, color, page);
}
-void makeTextEntry(const CommandeType commandList[], uint16 height, uint16 X, uint16 Y, uint16 width) {
- byte color = 2;
- byte color2 = defaultMenuBoxColor2;
- int16 paramY = (height * 9) + 10;
- int16 currentX, currentY;
- int16 i;
- uint16 j;
- byte currentChar;
-
- if (X + width > 319) {
- X = 319 - width;
- }
-
- if (Y + paramY > 199) {
- Y = 199 - paramY;
- }
-
- hideMouse();
- blitRawScreen(page1Raw);
-
- gfxDrawPlainBoxRaw(X, Y, X + width, Y + 4, color2, page1Raw);
-
- currentX = X + 4;
- currentY = Y + 4;
-
- for (i = 0; i < height; i++) {
- gfxDrawPlainBoxRaw(X, currentY, X + width, currentY + 9, color2, page1Raw);
- currentX = X + 4;
-
- for (j = 0; j < strlen(commandList[i]); j++) {
- currentChar = commandList[i][j];
- currentX = drawChar(currentChar, currentX, currentY);
- }
-
- currentY += 9;
- }
-
- gfxDrawPlainBoxRaw(X, currentY, X + width, currentY + 4, color2, page1Raw); // bottom part
- drawDoubleMessageBox(X, Y, width, currentY, color, page1Raw);
-
- blitRawScreen(page1Raw);
-}
-
void processInventory(int16 x, int16 y) {
int16 listSize = buildObjectListCommand(-2);
uint16 button;
@@ -946,7 +873,8 @@ void processInventory(int16 x, int16 y) {
if (!listSize)
return;
- makeTextEntry(objectListCommand, listSize, x, y, 140);
+ renderer->drawMenu(objectListCommand, listSize, x, y, 140, -1);
+ renderer->blit();
do {
manageEvents();
@@ -1085,7 +1013,7 @@ void makeCommandLine(void) {
}
if (!disableSystemMenu) {
- isDrawCommandEnabled = 1;
+ renderer->setCommand(commandBuffer);
}
}
@@ -1094,13 +1022,8 @@ uint16 needMouseSave = 0;
uint16 menuVar4 = 0;
uint16 menuVar5 = 0;
-int16 makeMenuChoice(const CommandeType commandList[], uint16 height, uint16 X, uint16 Y,
- uint16 width, bool recheckValue) {
- byte color = 2;
- byte color2 = defaultMenuBoxColor2;
+int16 makeMenuChoice(const CommandeType commandList[], uint16 height, uint16 X, uint16 Y, uint16 width, bool recheckValue) {
int16 paramY;
- int16 currentX, currentY;
- int16 i;
uint16 button;
int16 var_A;
int16 di;
@@ -1110,7 +1033,6 @@ int16 makeMenuChoice(const CommandeType commandList[], uint16 height, uint16 X,
int16 var_14;
int16 currentSelection, oldSelection;
int16 var_4;
- byte currentChar;
if (disableSystemMenu)
return -1;
@@ -1125,30 +1047,8 @@ int16 makeMenuChoice(const CommandeType commandList[], uint16 height, uint16 X,
Y = 199 - paramY;
}
- hideMouse();
- blitRawScreen(page1Raw);
-
- gfxDrawPlainBoxRaw(X, Y, X + width, Y + 4, color2, page1Raw);
-
- currentX = X + 4;
- currentY = Y + 4;
-
- for (i = 0; i < height; i++) {
- gfxDrawPlainBoxRaw(X, currentY, X + width, currentY + 9, color2, page1Raw);
- currentX = X + 4;
-
- for (j = 0; j < strlen(commandList[i]); j++) {
- currentChar = commandList[i][j];
- currentX = drawChar(currentChar, currentX, currentY);
- }
-
- currentY += 9;
- }
-
- gfxDrawPlainBoxRaw(X, currentY, X + width, currentY + 4, color2, page1Raw); // bottom part
- drawDoubleMessageBox(X, Y, width, currentY, color, page1Raw);
-
- blitRawScreen(page1Raw);
+ renderer->drawMenu(commandList, height, X, Y, width, -1);
+ renderer->blit();
do {
manageEvents();
@@ -1160,15 +1060,9 @@ int16 makeMenuChoice(const CommandeType commandList[], uint16 height, uint16 X,
currentSelection = 0;
di = currentSelection * 9 + Y + 4;
- gfxDrawPlainBoxRaw(X + 2, di - 1, X + width - 2, di + 7, 0, page1Raw); // draw black box behind selection
- currentX = X + 4;
-
- for (j = 0; j < strlen(commandList[currentSelection]); j++) {
- currentChar = commandList[currentSelection][j];
- currentX = drawChar(currentChar, currentX, di);
- }
- blitRawScreen(page1Raw);
+ renderer->drawMenu(commandList, height, X, Y, width, currentSelection);
+ renderer->blit();
manageEvents();
getMouseData(mouseUpdateStatus, &button, (uint16 *)&mouseX, (uint16 *)&mouseY);
@@ -1219,29 +1113,10 @@ int16 makeMenuChoice(const CommandeType commandList[], uint16 height, uint16 X,
hideMouse();
}
- di = oldSelection * 9 + Y + 4;
-
- gfxDrawPlainBoxRaw(X + 2, di - 1, X + width - 2, di + 7, color2, page1Raw); // restore color
-
- currentX = X + 4;
-
- for (j = 0; j < strlen(commandList[oldSelection]); j++) {
- currentChar = commandList[oldSelection][j];
- currentX = drawChar(currentChar, currentX, di);
- }
-
di = currentSelection * 9 + Y + 4;
- gfxDrawPlainBoxRaw(X + 2, di - 1, X + width - 2, di + 7, 0, page1Raw); // black new
-
- currentX = X + 4;
-
- for (j = 0; j < strlen(commandList[currentSelection]); j++) {
- currentChar = commandList[currentSelection][j];
- currentX = drawChar(currentChar, currentX, di);
- }
-
- blitRawScreen(page1Raw);
+ renderer->drawMenu(commandList, height, X, Y, width, currentSelection);
+ renderer->blit();
// if (needMouseSave) {
// gfxRedrawMouseCursor();
@@ -1271,38 +1146,6 @@ int16 makeMenuChoice(const CommandeType commandList[], uint16 height, uint16 X,
return currentSelection;
}
-void drawMenuBox(char *command, int16 x, int16 y) {
- byte j;
- byte lColor = 2;
-
- hideMouse();
-
- gfxDrawPlainBoxRaw(x, y, x + 300, y + 10, 0, page2Raw);
-
- drawMessageBox(x, y, 300, y + 6, -1, lColor, page2Raw);
-
- x += 2;
- y += 2;
-
- for (j = 0; j < strlen(command); j++) {
- byte currentChar = command[j];
-
- if (currentChar == ' ') {
- x += 5;
- } else {
- byte characterWidth = fontParamTable[currentChar].characterWidth;
-
- if (characterWidth) {
- byte characterIdx = fontParamTable[currentChar].characterIdx;
- drawSpriteRaw(textTable[characterIdx][0], textTable[characterIdx][1], 2, 8, page2Raw, x, y);
- x += characterWidth + 1;
- }
- }
- }
-
-// gfxRedrawMouseCursor();
-}
-
void makeActionMenu(void) {
uint16 mouseButton;
uint16 mouseX;
@@ -1342,11 +1185,6 @@ uint16 executePlayerInput(void) {
}
if (allowPlayerInput) {
- if (isDrawCommandEnabled) {
- drawMenuBox(commandBuffer, 10, defaultMenuBoxColor);
- isDrawCommandEnabled = 0;
- }
-
getMouseData(mouseUpdateStatus, &mouseButton, &mouseX, &mouseY);
while (mouseButton && currentEntry < 200) {
@@ -1393,7 +1231,6 @@ uint16 executePlayerInput(void) {
if (choiceResultTable[playerCommand] == commandVar1) {
int16 relEntry;
- drawMenuBox(commandBuffer, 10, defaultMenuBoxColor);
SelectedObjStruct obj;
obj.idx = commandVar3[0];
obj.param = commandVar3[1];
@@ -1410,41 +1247,40 @@ uint16 executePlayerInput(void) {
commandVar1 = 0;
strcpy(commandBuffer, "");
+ renderer->setCommand("");
}
} else {
globalVars[VAR_MOUSE_X_POS] = mouseX;
globalVars[VAR_MOUSE_Y_POS] = mouseY;
}
}
- } else {
- if (mouseButton & 2) {
- if (mouseButton & 1) {
- g_cine->makeSystemMenu();
- }
+ } else if (mouseButton & 2) {
+ if (mouseButton & 1) {
+ g_cine->makeSystemMenu();
+ }
- makeActionMenu();
- makeCommandLine();
- } else {
- int16 objIdx;
+ makeActionMenu();
+ makeCommandLine();
+ } else {
+ int16 objIdx;
- objIdx = getObjectUnderCursor(mouseX, mouseY);
+ objIdx = getObjectUnderCursor(mouseX, mouseY);
- if (commandVar2 != objIdx) {
- if (objIdx != -1) {
- char command[256];
+ if (commandVar2 != objIdx) {
+ if (objIdx != -1) {
+ char command[256];
- strcpy(command, commandBuffer);
- strcat(command, " ");
- strcat(command, objectTable[objIdx].name);
+ strcpy(command, commandBuffer);
+ strcat(command, " ");
+ strcat(command, objectTable[objIdx].name);
- drawMenuBox(command, 10, defaultMenuBoxColor);
- } else {
- isDrawCommandEnabled = 1;
- }
+ renderer->setCommand(command);
+ } else {
+ isDrawCommandEnabled = 1;
}
-
- commandVar2 = objIdx;
}
+
+ commandVar2 = objIdx;
}
} else {
if (mouseButton & 2) {
@@ -1653,257 +1489,9 @@ void drawSprite(Common::List<overlay>::iterator it, const byte *spritePtr, const
free(msk);
}
-int16 additionalBgVScroll = 0;
-
-void backupOverlayPage(void) {
- byte *scrollBg;
- byte *bgPage = additionalBgTable[currentAdditionalBgIdx];
-
- if (bgPage) {
- if (!additionalBgVScroll) {
- memcpy(page1Raw, bgPage, 320 * 200);
- } else {
- scrollBg = additionalBgTable[currentAdditionalBgIdx2];
-
- for (int16 i = additionalBgVScroll; i < 200 + additionalBgVScroll; i++) {
- if (i > 200) {
- memcpy(page1Raw + (i - additionalBgVScroll) * 320, scrollBg + (i - 200) * 320, 320);
- } else {
- memcpy(page1Raw + (i - additionalBgVScroll) * 320, bgPage + (i-1) * 320, 320);
- }
- }
- }
- }
-}
-
-void drawMessage(const char *messagePtr, int16 x, int16 y, int16 width, int16 color) {
- byte color2 = 2;
- byte endOfMessageReached = 0;
- int16 localX, localY, localWidth;
- uint16 messageLength = 0, numWords = 0, messageWidth = 0;
- uint16 lineResult, fullLineWidth;
- uint16 interWordSize, interWordSizeRemain;
- const char *endOfMessagePtr;
- byte currentChar; //, characterWidth;
-
- gfxDrawPlainBoxRaw(x, y, x + width, y + 4, color, page1Raw);
-
- localX = x + 4;
- localY = y + 4;
- localWidth = width - 8;
-
- do {
- messageLength = 0;
-
- while (messagePtr[messageLength] == ' ') {
- messageLength++;
- }
-
- messagePtr += messageLength;
-
- messageLength = computeMessageLength((const byte *)messagePtr, localWidth, &numWords, &messageWidth, &lineResult);
-
- endOfMessagePtr = messagePtr + messageLength;
-
- if (lineResult) {
- fullLineWidth = localWidth - messageWidth;
-
- if (numWords) {
- interWordSize = fullLineWidth / numWords;
- interWordSizeRemain = fullLineWidth % numWords;
- } else {
- interWordSize = 5;
- interWordSizeRemain = 0;
- }
- } else {
- interWordSize = 5;
- interWordSizeRemain = 0;
- }
-
- gfxDrawPlainBoxRaw(x, localY, x + width, localY + 9, color, page1Raw);
-
- do {
- currentChar = *(messagePtr++);
-
- if (currentChar == 0) {
- endOfMessageReached = 1;
- } else if (currentChar == ' ') {
- localX += interWordSizeRemain + interWordSize;
-
- if (interWordSizeRemain)
- interWordSizeRemain = 0;
- } else {
- localX = drawChar(currentChar, localX, localY);
- }
- } while ((messagePtr < endOfMessagePtr) && !endOfMessageReached);
-
- localX = x + 4;
- localY += 9;
- } while (!endOfMessageReached);
-
- gfxDrawPlainBoxRaw(x, localY, x + width, localY + 4, color, page1Raw);
-
- drawDoubleMessageBox(x, y, width, localY, color2, page1Raw);
-}
-
-void drawDialogueMessage(byte msgIdx, int16 x, int16 y, int16 width, int16 color) {
- if (msgIdx >= messageTable.size()) {
-// removeOverlay(msgIdx, 2);
- return;
- }
-
- _messageLen += messageTable[msgIdx].size();
- drawMessage(messageTable[msgIdx].c_str(), x, y, width, color);
-
- // this invalidates the iterator in drawOverlays()
-// removeOverlay(msgIdx, 2);
-}
-
-void drawFailureMessage(byte cmd) {
- byte msgIdx = cmd * 4 + g_cine->_rnd.getRandomNumber(3);
-
- const char *messagePtr = failureMessages[msgIdx];
- int len = strlen(messagePtr);
-
- _messageLen += len;
-
- int16 width = 6 * len + 20;
-
- if (width > 300)
- width = 300;
-
- int16 x = (320 - width) / 2;
- int16 y = 80;
- int16 color = 4;
-
- drawMessage(messagePtr, x, y, width, color);
-
- // this invalidates the iterator in drawOverlays()
-// removeOverlay(cmd, 3);
-}
-
-void drawOverlays(void) {
- uint16 width, height;
- AnimData *pPart;
- int16 x, y;
- objectStruct *objPtr;
- byte messageIdx;
+void removeMessages() {
Common::List<overlay>::iterator it;
- backupOverlayPage();
-
- _messageLen = 0;
-
- for (it = overlayList.begin(); it != overlayList.end(); ++it) {
- switch (it->type) {
- case 0: // sprite
- assert(it->objIdx < NUM_MAX_OBJECT);
-
- objPtr = &objectTable[it->objIdx];
- x = objPtr->x;
- y = objPtr->y;
-
- if (objPtr->frame < 0) {
- continue;
- }
-
- pPart = &animDataTable[objPtr->frame];
- width = pPart->_realWidth;
- height = pPart->_height;
-
- if (!pPart->data()) {
- continue;
- }
-
- // drawSprite ignores masks of Operation Stealth sprites
- drawSprite(it, pPart->data(), pPart->mask(), width, height, page1Raw, x, y);
- break;
-
- case 2: // text
- // gfxWaitVSync();
- // hideMouse();
-
- messageIdx = it->objIdx;
- x = it->x;
- y = it->y;
- width = it->width;
- height = it->color;
-
- blitRawScreen(page1Raw);
-
- drawDialogueMessage(messageIdx, x, y, width, height);
-
- // blitScreen(page0, NULL);
- // gfxRedrawMouseCursor();
-
- waitForPlayerClick = 1;
-
- break;
-
- case 3:
- // gfxWaitSync()
- // hideMouse();
-
- blitRawScreen(page1Raw);
-
- drawFailureMessage(it->objIdx);
-
- // blitScreen(page0, NULL);
- // gfxRedrawMouseCursor();
-
- waitForPlayerClick = 1;
-
- break;
-
- case 4:
- assert(it->objIdx < NUM_MAX_OBJECT);
-
- objPtr = &objectTable[it->objIdx];
- x = objPtr->x;
- y = objPtr->y;
-
- if (objPtr->frame < 0) {
- continue;
- }
-
- assert(objPtr->frame < NUM_MAX_ANIMDATA);
-
- pPart = &animDataTable[objPtr->frame];
-
- width = pPart->_realWidth;
- height = pPart->_height;
-
- if (!pPart->data()) {
- continue;
- }
-
- gfxFillSprite(pPart->data(), width, height, page1Raw, x, y);
- break;
-
- case 20:
- assert(it->objIdx < NUM_MAX_OBJECT);
-
- objPtr = &objectTable[it->objIdx];
- x = objPtr->x;
- y = objPtr->y;
- var5 = it->x;
-
- if (objPtr->frame < 0 || var5 > 8 || !additionalBgTable[var5] || animDataTable[objPtr->frame]._bpp != 1) {
- continue;
- }
-
- width = animDataTable[objPtr->frame]._realWidth;
- height = animDataTable[objPtr->frame]._height;
-
- if (!animDataTable[objPtr->frame].data()) {
- continue;
- }
-
- maskBgOverlay(additionalBgTable[var5], animDataTable[objPtr->frame].data(), width, height, page1Raw, x, y);
- break;
- }
- }
-
for (it = overlayList.begin(); it != overlayList.end(); ) {
if (it->type == 2 || it->type == 3) {
it = overlayList.erase(it);
@@ -1978,115 +1566,96 @@ void addMessage(byte param1, int16 param2, int16 param3, int16 param4, int16 par
tmp.color = param5;
overlayList.push_back(tmp);
+ waitForPlayerClick = 1;
}
-SeqListElement seqList;
+Common::List<SeqListElement> seqList;
void removeSeq(uint16 param1, uint16 param2, uint16 param3) {
- SeqListElement *currentHead = &seqList;
- SeqListElement *tempHead = currentHead;
+ Common::List<SeqListElement>::iterator it;
- while (currentHead && (currentHead->var6 != param1 || currentHead->var4 != param2 || currentHead->varE != param3)) {
- tempHead = currentHead;
- currentHead = tempHead->next;
- }
-
- if (currentHead && currentHead->var6 == param1 && currentHead->var4 == param2 && currentHead->varE == param3) {
- currentHead->var4 = -1;
+ for (it = seqList.begin(); it != seqList.end(); ++it) {
+ if (it->objIdx == param1 && it->var4 == param2 && it->varE == param3) {
+ it->var4 = -1;
+ break;
+ }
}
}
uint16 isSeqRunning(uint16 param1, uint16 param2, uint16 param3) {
- SeqListElement *currentHead = &seqList;
- SeqListElement *tempHead = currentHead;
-
- while (currentHead && (currentHead->var6 != param1 || currentHead->var4 != param2 || currentHead->varE != param3)) {
- tempHead = currentHead;
- currentHead = tempHead->next;
- }
+ Common::List<SeqListElement>::iterator it;
- if (currentHead && currentHead->var6 == param1 && currentHead->var4 == param2 && currentHead->varE == param3) {
- return 1;
+ for (it = seqList.begin(); it != seqList.end(); ++it) {
+ if (it->objIdx == param1 && it->var4 == param2 && it->varE == param3) {
+ return 1;
+ }
}
return 0;
}
-void addSeqListElement(int16 param0, int16 param1, int16 param2, int16 param3, int16 param4, int16 param5, int16 param6, int16 param7, int16 param8) {
- SeqListElement *currentHead = &seqList;
- SeqListElement *tempHead = currentHead;
- SeqListElement *newElement;
-
- currentHead = tempHead->next;
-
- while (currentHead && currentHead->varE < param7) {
- tempHead = currentHead;
- currentHead = tempHead->next;
- }
-
- newElement = new SeqListElement;
-
- newElement->next = tempHead->next;
- tempHead->next = newElement;
-
- newElement->var6 = param0;
- newElement->var4 = param1;
- newElement->var8 = param2;
- newElement->varA = param3;
- newElement->varC = param4;
- newElement->var14 = 0;
- newElement->var16 = 0;
- newElement->var18 = param5;
- newElement->var1A = param6;
- newElement->varE = param7;
- newElement->var10 = param8;
- newElement->var12 = param8;
- newElement->var1C = 0;
- newElement->var1E = 0;
-}
-
-void resetSeqList() {
- seqList.next = NULL;
+void addSeqListElement(uint16 objIdx, int16 param1, int16 param2, int16 frame, int16 param4, int16 param5, int16 param6, int16 param7, int16 param8) {
+ Common::List<SeqListElement>::iterator it;
+ SeqListElement tmp;
+
+ for (it = seqList.begin(); it != seqList.end() && it->varE < param7; ++it) ;
+
+ tmp.objIdx = objIdx;
+ tmp.var4 = param1;
+ tmp.var8 = param2;
+ tmp.frame = frame;
+ tmp.varC = param4;
+ tmp.var14 = 0;
+ tmp.var16 = 0;
+ tmp.var18 = param5;
+ tmp.var1A = param6;
+ tmp.varE = param7;
+ tmp.var10 = param8;
+ tmp.var12 = param8;
+ tmp.var1C = 0;
+ tmp.var1E = 0;
+
+ seqList.insert(it, tmp);
}
-void computeMove1(SeqListElement *element, int16 x, int16 y, int16 param1,
+void computeMove1(SeqListElement &element, int16 x, int16 y, int16 param1,
int16 param2, int16 x2, int16 y2) {
- element->var16 = 0;
- element->var14 = 0;
+ element.var16 = 0;
+ element.var14 = 0;
if (y2) {
if (y - param2 > y2) {
- element->var16 = 2;
+ element.var16 = 2;
}
if (y + param2 < y2) {
- element->var16 = 1;
+ element.var16 = 1;
}
}
if (x2) {
if (x - param1 > x2) {
- element->var14 = 2;
+ element.var14 = 2;
}
if (x + param1 < x2) {
- element->var14 = 1;
+ element.var14 = 1;
}
}
}
-uint16 computeMove2(SeqListElement *element) {
+uint16 computeMove2(SeqListElement &element) {
int16 returnVar = 0;
- if (element->var16 == 1) {
+ if (element.var16 == 1) {
returnVar = 4;
- } else if (element->var16 == 2) {
+ } else if (element.var16 == 2) {
returnVar = 3;
}
- if (element->var14 == 1) {
+ if (element.var14 == 1) {
returnVar = 1;
- } else if (element->var14 == 2) {
+ } else if (element.var14 == 2) {
returnVar = 2;
}
@@ -2165,14 +1734,13 @@ void resetGfxEntityEntry(uint16 objIdx) {
#endif
}
-uint16 addAni(uint16 param1, uint16 param2, const byte *ptr, SeqListElement *element, uint16 param3, int16 *param4) {
+uint16 addAni(uint16 param1, uint16 objIdx, const byte *ptr, SeqListElement &element, uint16 param3, int16 *param4) {
const byte *currentPtr = ptr;
const byte *ptrData;
const byte *ptr2;
int16 di;
assert(ptr);
- assert(element);
assert(param4);
dummyU16 = READ_BE_UINT16((currentPtr + param1 * 2) + 8);
@@ -2181,25 +1749,25 @@ uint16 addAni(uint16 param1, uint16 param2, const byte *ptr, SeqListElement *ele
assert(*ptrData);
- di = (objectTable[param2].costume + 1) % (*ptrData);
+ di = (objectTable[objIdx].costume + 1) % (*ptrData);
ptr2 = (ptrData + (di * 8)) + 1;
- if ((checkCollision(param2, ptr2[0], ptr2[1], ptr2[2], ptr[0]) & 1)) {
+ if ((checkCollision(objIdx, ptr2[0], ptr2[1], ptr2[2], ptr[0]) & 1)) {
return 0;
}
- objectTable[param2].x += (int8)ptr2[4];
- objectTable[param2].y += (int8)ptr2[5];
- objectTable[param2].mask += (int8)ptr2[6];
+ objectTable[objIdx].x += (int8)ptr2[4];
+ objectTable[objIdx].y += (int8)ptr2[5];
+ objectTable[objIdx].mask += (int8)ptr2[6];
- if (objectTable[param2].frame) {
- resetGfxEntityEntry(param2);
+ if (objectTable[objIdx].frame) {
+ resetGfxEntityEntry(objIdx);
}
- objectTable[param2].frame = ptr2[7] + element->var8;
+ objectTable[objIdx].frame = ptr2[7] + element.var8;
- if (param3 || !element->var14) {
- objectTable[param2].costume = di;
+ if (param3 || !element.var14) {
+ objectTable[objIdx].costume = di;
} else {
*param4 = di;
}
@@ -2207,86 +1775,86 @@ uint16 addAni(uint16 param1, uint16 param2, const byte *ptr, SeqListElement *ele
return 1;
}
-void processSeqListElement(SeqListElement *element) {
- int16 x = objectTable[element->var6].x;
- int16 y = objectTable[element->var6].y;
- const byte *ptr1 = animDataTable[element->varA].data();
+void processSeqListElement(SeqListElement &element) {
+ int16 x = objectTable[element.objIdx].x;
+ int16 y = objectTable[element.objIdx].y;
+ const byte *ptr1 = animDataTable[element.frame].data();
int16 var_10;
int16 var_4;
int16 var_2;
- if (element->var12 < element->var10) {
- element->var12++;
+ if (element.var12 < element.var10) {
+ element.var12++;
return;
}
- element->var12 = 0;
+ element.var12 = 0;
if (ptr1) {
uint16 param1 = ptr1[1];
uint16 param2 = ptr1[2];
- if (element->varC != 255) {
+ if (element.varC != 255) {
// FIXME: Why is this here? Fingolfin gets lots of these
// in his copy of Operation Stealth (value 0 or 236) under
// Mac OS X. Maybe it's a endian issue? At least the graphics
// in the copy protection screen are partially messed up.
- warning("processSeqListElement: varC = %d", element->varC);
+ warning("processSeqListElement: varC = %d", element.varC);
}
if (globalVars[VAR_MOUSE_X_POS] || globalVars[VAR_MOUSE_Y_POS]) {
computeMove1(element, ptr1[4] + x, ptr1[5] + y, param1, param2, globalVars[VAR_MOUSE_X_POS], globalVars[VAR_MOUSE_Y_POS]);
} else {
- element->var16 = 0;
- element->var14 = 0;
+ element.var16 = 0;
+ element.var14 = 0;
}
var_10 = computeMove2(element);
if (var_10) {
- element->var1C = var_10;
- element->var1E = var_10;
+ element.var1C = var_10;
+ element.var1E = var_10;
}
var_4 = -1;
- if ((element->var16 == 1
- && !addAni(3, element->var6, ptr1, element, 0, &var_4)) || (element->var16 == 2 && !addAni(2, element->var6, ptr1, element, 0,
+ if ((element.var16 == 1
+ && !addAni(3, element.objIdx, ptr1, element, 0, &var_4)) || (element.var16 == 2 && !addAni(2, element.objIdx, ptr1, element, 0,
&var_4))) {
- if (element->varC == 255) {
+ if (element.varC == 255) {
globalVars[VAR_MOUSE_Y_POS] = 0;
}
}
- if ((element->var14 == 1
- && !addAni(0, element->var6, ptr1, element, 1, &var_2))) {
- if (element->varC == 255) {
+ if ((element.var14 == 1
+ && !addAni(0, element.objIdx, ptr1, element, 1, &var_2))) {
+ if (element.varC == 255) {
globalVars[VAR_MOUSE_X_POS] = 0;
if (var_4 != -1) {
- objectTable[element->var6].costume = var_4;
+ objectTable[element.objIdx].costume = var_4;
}
}
}
- if ((element->var14 == 2 && !addAni(1, element->var6, ptr1, element, 1, &var_2))) {
- if (element->varC == 255) {
+ if ((element.var14 == 2 && !addAni(1, element.objIdx, ptr1, element, 1, &var_2))) {
+ if (element.varC == 255) {
globalVars[VAR_MOUSE_X_POS] = 0;
if (var_4 != -1) {
- objectTable[element->var6].costume = var_4;
+ objectTable[element.objIdx].costume = var_4;
}
}
}
- if (element->var16 + element->var14) {
- if (element->var1C) {
- if (element->var1E) {
- objectTable[element->var6].costume = 0;
- element->var1E = 0;
+ if (element.var16 + element.var14) {
+ if (element.var1C) {
+ if (element.var1E) {
+ objectTable[element.objIdx].costume = 0;
+ element.var1E = 0;
}
- addAni(element->var1C + 3, element->var6, ptr1, element, 1, (int16 *) & var2);
+ addAni(element.var1C + 3, element.objIdx, ptr1, element, 1, (int16 *) & var2);
}
}
@@ -2295,119 +1863,28 @@ void processSeqListElement(SeqListElement *element) {
}
void processSeqList(void) {
- SeqListElement *currentHead = &seqList;
- SeqListElement *tempHead = currentHead;
+ Common::List<SeqListElement>::iterator it;
- currentHead = tempHead->next;
-
- while (currentHead) {
- if (currentHead->var4 != -1) {
- processSeqListElement(currentHead);
+ for (it = seqList.begin(); it != seqList.end(); ++it) {
+ if (it->var4 == -1) {
+ continue;
}
- tempHead = currentHead;
- currentHead = tempHead->next;
+ processSeqListElement(*it);
}
}
bool makeTextEntryMenu(const char *messagePtr, char *inputString, int stringMaxLength, int y) {
- int16 color = 2;
- byte color2 = defaultMenuBoxColor2;
- byte endOfMessageReached = 0;
- int16 localX, localY, localWidth;
- int margins = 16;
int len = strlen(messagePtr);
int16 width = 6 * len + 20;
- uint16 messageLength = 0, numWords = 0, messageWidth = 0;
- uint16 lineResult, fullLineWidth;
- uint16 interWordSize, interWordSizeRemain;
- const char *endOfMessagePtr;
- byte currentChar, characterWidth;
width = CLIP((int)width, 180, 250);
int16 x = (320 - width) / 2;
- gfxDrawPlainBoxRaw(x - margins, y, x + width + margins, y + 4, color2, page1Raw);
-
- localX = x + 4;
- localY = y + 4;
- localWidth = width;
-
getKeyData(); // clear input key
- do {
- messageLength = 0;
-
- while (messagePtr[messageLength] == ' ') {
- messageLength++;
- }
-
- messagePtr += messageLength;
-
- messageLength = computeMessageLength((const byte *)messagePtr, localWidth, &numWords, &messageWidth, &lineResult);
-
- endOfMessagePtr = messagePtr + messageLength;
-
- if (lineResult) {
- fullLineWidth = localWidth - messageWidth;
-
- if (numWords) {
- interWordSize = fullLineWidth / numWords;
- interWordSizeRemain = fullLineWidth % numWords;
- } else {
- interWordSize = 5;
- interWordSizeRemain = 0;
- }
- } else {
- interWordSize = 5;
- interWordSizeRemain = 0;
- }
-
- gfxDrawPlainBoxRaw(x - margins, localY, x + width + margins, localY + 9, color2, page1Raw);
-
- do {
- currentChar = *(messagePtr++);
-
- if (currentChar == 0) {
- endOfMessageReached = 1;
- } else if (currentChar == ' ') {
- localX += interWordSizeRemain + interWordSize;
-
- if (interWordSizeRemain)
- interWordSizeRemain = 0;
- } else {
- characterWidth = fontParamTable[currentChar].characterWidth;
-
- if (characterWidth) {
- byte characterIdx = fontParamTable[currentChar].characterIdx;
- drawSpriteRaw(textTable[characterIdx][0], textTable[characterIdx][1], 2, 8, page1Raw, localX, localY);
- localX += characterWidth + 1;
- }
- }
- } while ((messagePtr < endOfMessagePtr) && !endOfMessageReached);
-
- localX = x + 4;
- localY += 9;
- } while (!endOfMessageReached);
-
- // Input string
- gfxDrawPlainBoxRaw(x - margins, localY, x + width + margins, localY + 9, color2, page1Raw);
- localY += 9;
-
- x -= margins;
- width += margins * 2;
-
- gfxDrawPlainBoxRaw(x, localY, x + width, localY + 4, color2, page1Raw);
-
- drawDoubleMessageBox(x, y, width, localY, color, page1Raw);
-
- x += margins;
- width -= margins * 2;
- localY -= 9;
-
-
int quit = 0;
bool redraw = true;
CommandeType tempString;
@@ -2416,24 +1893,8 @@ bool makeTextEntryMenu(const char *messagePtr, char *inputString, int stringMaxL
while (!quit) {
if (redraw) {
- gfxDrawPlainBoxRaw(x, localY - 1, x + width, localY + 8, 0, page1Raw);
-
- int currentX = x + 4;
-
- for (uint j = 0; j < strlen(inputString); j++) {
- currentChar = inputString[j];
- currentX = drawChar(currentChar, currentX, localY);
-
- // draw cursor here
- if (inputPos == (int)(j + 2))
- gfxDrawLine(currentX, localY - 1, currentX, localY + 8, color, page1Raw);
-
- }
-
- if (strlen(inputString) == 0 || inputPos == 1) // cursor wasn't yet drawn
- gfxDrawLine(x + 4, localY - 1, x + 4, localY + 8, color, page1Raw);
-
- blitRawScreen(page1Raw);
+ renderer->drawInputBox(messagePtr, inputString, inputPos, x - 16, y, width + 32);
+ renderer->blit();
redraw = false;
}
diff --git a/engines/cine/various.h b/engines/cine/various.h
index f906b2aa19..91662c16ff 100644
--- a/engines/cine/various.h
+++ b/engines/cine/various.h
@@ -43,11 +43,10 @@ extern bool disableSystemMenu;
extern bool inMenu;
struct SeqListElement {
- struct SeqListElement *next;
int16 var4;
- int16 var6;
+ uint16 objIdx;
int16 var8;
- int16 varA;
+ int16 frame;
int16 varC;
int16 varE;
int16 var10;
@@ -60,7 +59,7 @@ struct SeqListElement {
int16 var1E;
};
-extern SeqListElement seqList;
+extern Common::List<SeqListElement> seqList;
extern uint16 var2;
extern uint16 var3;
@@ -97,7 +96,6 @@ extern char newRelName[20];
extern char newObjectName[20];
extern char newMsgName[20];
-extern char currentBgName[8][15];
extern char currentCtName[15];
extern char currentPartName[15];
@@ -130,20 +128,16 @@ struct SelectedObjStruct {
int16 param;
};
-extern uint16 defaultMenuBoxColor;
-extern uint16 defaultMenuBoxColor2;
-
#define NUM_MAX_ZONE 16
extern uint16 zoneData[NUM_MAX_ZONE];
void addMessage(byte param1, int16 param2, int16 param3, int16 param4, int16 param5);
-extern int16 additionalBgVScroll;
+void removeMessages();
void removeSeq(uint16 param1, uint16 param2, uint16 param3);
uint16 isSeqRunning(uint16 param1, uint16 param2, uint16 param3);
-void addSeqListElement(int16 param0, int16 param1, int16 param2, int16 param3, int16 param4, int16 param5, int16 param6, int16 param7, int16 param8);
-void resetSeqList();
+void addSeqListElement(uint16 objIdx, int16 param1, int16 param2, int16 frame, int16 param4, int16 param5, int16 param6, int16 param7, int16 param8);
void processSeqList(void);
bool makeTextEntryMenu(const char *caption, char *string, int strLen, int y);
diff --git a/engines/cine/xref.txt b/engines/cine/xref.txt
index 3640ef83d6..5a8d2eef0f 100644
--- a/engines/cine/xref.txt
+++ b/engines/cine/xref.txt
@@ -1,4 +1,4 @@
-script.cpp:
+script_fw.cpp:
setupOpcodes() - replaced with FWScript/OSScript class members
getNextByte() - replaced with RawScript/FWScript class members
getNextWord() - replaced with RawScript/FWScript class members
@@ -89,6 +89,9 @@ o1_disableSystemMenu() - replaced with FWScript::o1_disableSystemMenu()
o1_loadMask5() - replaced with FWScript::o1_loadMask5()
o1_unloadMask5() - replaced with FWScript::o1_unloadMask5()
+palRotate() - modified and moved to pal.cpp
+
+script_os.cpp:
o2_loadPart() - replaced with FWScript::o2_loadPart()
o2_addSeqListElement() - replaced with FWScript::o2_addSeqListElement()
o2_removeSeq() - replaced with FWScript::o2_removeSeq()
@@ -134,20 +137,48 @@ releaseObjectScripts() - removed (obsoleted by Common::List::clear())
various.cpp:
setupScriptList() - removed (obsoleted by new makeLoad() and
loadScriptFromSave() implementation)
+drawChar() - removed (obsoleted by FWRenderer::drawChar())
+makeTextEntry() - removed (obsoleted by FWRenderer::drawMenu())
+drawMenuBox() - removed (obsoleted by FWRenderer::drawCommand())
+backupOverlayPage() - removed (obsoleted by FWRenderer::drawBackground())
+drawMessage() - removed (obsoleted by FWRenderer::drawMessage())
+drawDialogueMessage() - removed (obsoleted by FWRenderer::renderOverlay())
+drawFailureMessage() - removed (obsoleted by FWRenderer::renderOverlay())
+drawOverlays() - removed (obsoleted by FWRenderer::drawOverlays())
+resetSeqList() - removed (obsoleted by Common::List)
anim.cpp:
freeAnimData() - replaced with animData::clear()
allocFrame() - replaced with animData::load()
reserveFrame() - replaced with animData::load()
-bg_list.cpp
+bg_list.cpp:
reincrustAllBg() - removed (obsoleted by new loadResourcesFromSave() and
loadBgIncrustFromSave() implementation)
freeBgIncrustList() - removed (obsoleted by Common::List::clear())
-object.cpp
+object.cpp:
unloadAllMasks() - removed (obsoleted by Common::List::clear())
resetMessageHead() - removed (obsoleted by Common::List)
freeOverlay() - removed (duplicate of removeOverlay)
removeOverlayElement() - renamed to removeOverlay
loadOverlayElement() - renamed to addOverlay
+
+gfx.cpp:
+gfxInit() - removed (obsoleted by FWRenderer)
+gfxDestroy() - removed (obsoleted by FWRenderer)
+transformColor() - moved to pal.cpp
+transformPaletteRange() - modified and moved to pal.cpp
+gfxCopyRawPage() - removed (obsoleted by FWRenderer)
+gfxFlipRawPage() - removed (obsoleted by FWRenderer::blit() and
+ FWRenderer::refreshPalette())
+fadeToBlack() - removed (obsoleted by FWRenderer::fadeToBlack())
+blitRawScreen() - removed (obsoleted by FWRenderer)
+flip() - removed (obsoleted by FWRenderer::reloadPalette())
+
+bg.cpp:
+loadCt() - split into loadCtFW() and loadCtOS()
+loadBgHigh() - removed (obsoleted by OSRenderer::loadBg256())
+
+texte.cpp:
+computeMessageLength() - replaced with fitLine()
diff --git a/engines/cruise/cruise_main.h b/engines/cruise/cruise_main.h
index c7d597dbd6..60afe5fa4c 100644
--- a/engines/cruise/cruise_main.h
+++ b/engines/cruise/cruise_main.h
@@ -45,7 +45,6 @@
#include "cruise/stack.h"
#include "cruise/script.h"
#include "cruise/various.h"
-#include "cruise/stringSupport.h"
#include "cruise/function.h"
#include "cruise/saveload.h"
#include "cruise/linker.h"
diff --git a/engines/cruise/module.mk b/engines/cruise/module.mk
index 384d7a1ecb..8db5b1da44 100644
--- a/engines/cruise/module.mk
+++ b/engines/cruise/module.mk
@@ -27,7 +27,6 @@ MODULE_OBJS := \
saveload.o \
script.o \
stack.o \
- stringSupport.o \
various.o \
vars.o \
volume.o
diff --git a/engines/cruise/stringSupport.cpp b/engines/cruise/stringSupport.cpp
deleted file mode 100644
index 7712f1e172..0000000000
--- a/engines/cruise/stringSupport.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- *
- */
-
-#include "cruise/cruise_main.h"
-
-namespace Cruise {
-
-} // End of namespace Cruise
diff --git a/engines/cruise/stringSupport.h b/engines/cruise/stringSupport.h
deleted file mode 100644
index c7cdb8efd9..0000000000
--- a/engines/cruise/stringSupport.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- *
- */
-
-#ifndef CRUISE_STRING_SUPPORT_H
-#define CRSUIE_STRING_SUPPORT_H
-
-namespace Cruise {
-
-} // End of namespace Cruise
-
-#endif
diff --git a/engines/drascula/actors.cpp b/engines/drascula/actors.cpp
new file mode 100644
index 0000000000..10ce415c2c
--- /dev/null
+++ b/engines/drascula/actors.cpp
@@ -0,0 +1,462 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "drascula/drascula.h"
+
+namespace Drascula {
+
+void DrasculaEngine::placeIgor() {
+ int pos_igor[6] = { 1, 0, igorX, igorY, 54, 61 };
+
+ if (currentChapter == 4) {
+ pos_igor[1] = 138;
+ } else {
+ if (trackIgor == 3)
+ pos_igor[1] = 138;
+ else if (trackIgor == 1)
+ pos_igor[1] = 76;
+ }
+
+ copyRectClip(pos_igor, frontSurface, screenSurface);
+}
+
+void DrasculaEngine::placeDrascula() {
+ int pos_dr[6] = { 0, 122, drasculaX, drasculaY, 45, 77 };
+
+ if (trackDrascula == 1)
+ pos_dr[0] = 47;
+ else if (trackDrascula == 0)
+ pos_dr[0] = 1;
+ else if (trackDrascula == 3 && currentChapter == 1)
+ pos_dr[0] = 93;
+
+ if (currentChapter == 6)
+ copyRectClip(pos_dr, drawSurface2, screenSurface);
+ else
+ copyRectClip(pos_dr, backSurface, screenSurface);
+}
+
+void DrasculaEngine::placeBJ() {
+ int pos_bj[6] = { 0, 99, bjX, bjY, 26, 76 };
+
+ if (trackBJ == 3)
+ pos_bj[0] = 10;
+ else if (trackBJ == 0)
+ pos_bj[0] = 37;
+
+ copyRectClip(pos_bj, drawSurface3, screenSurface);
+}
+
+void DrasculaEngine::hiccup(int counter) {
+ int y = 0, trackCharacter = 0;
+ if (currentChapter == 3)
+ y = -1;
+
+ do {
+ counter--;
+
+ updateRoom();
+ if (currentChapter == 3)
+ updateScreen(0, 0, 0, y, 320, 200, screenSurface);
+ else
+ updateScreen(0, 1, 0, y, 320, 198, screenSurface);
+
+ if (trackCharacter == 0)
+ y++;
+ else
+ y--;
+
+ if (currentChapter == 3) {
+ if (y == 1)
+ trackCharacter = 1;
+ if (y == -1)
+ trackCharacter = 0;
+ } else {
+ if (y == 2)
+ trackCharacter = 1;
+ if (y == 0)
+ trackCharacter = 0;
+ }
+ } while (counter > 0);
+
+ updateRoom();
+ updateScreen();
+}
+
+void DrasculaEngine::startWalking() {
+ characterMoved = 1;
+
+ stepX = STEP_X;
+ stepY = STEP_Y;
+
+ if (currentChapter == 2) {
+ if ((roomX < curX) && (roomY <= (curY + curHeight)))
+ quadrant_1();
+ else if ((roomX < curX) && (roomY > (curY + curHeight)))
+ quadrant_3();
+ else if ((roomX > curX + curWidth) && (roomY <= (curY + curHeight)))
+ quadrant_2();
+ else if ((roomX > curX + curWidth) && (roomY > (curY + curHeight)))
+ quadrant_4();
+ else if (roomY < curY + curHeight)
+ walkUp();
+ else if (roomY > curY + curHeight)
+ walkDown();
+ } else {
+ if ((roomX < curX + curWidth / 2 ) && (roomY <= (curY + curHeight)))
+ quadrant_1();
+ else if ((roomX < curX + curWidth / 2) && (roomY > (curY + curHeight)))
+ quadrant_3();
+ else if ((roomX > curX + curWidth / 2) && (roomY <= (curY + curHeight)))
+ quadrant_2();
+ else if ((roomX > curX + curWidth / 2) && (roomY > (curY + curHeight)))
+ quadrant_4();
+ else
+ characterMoved = 0;
+ }
+ startTime = getTime();
+}
+
+void DrasculaEngine::moveCharacters() {
+ int curPos[6];
+ int r;
+
+ if (characterMoved == 1 && stepX == STEP_X) {
+ for (r = 0; r < stepX; r++) {
+ if (currentChapter != 2) {
+ if (trackProtagonist == 0 && roomX - r == curX + curWidth / 2) {
+ characterMoved = 0;
+ stepX = STEP_X;
+ stepY = STEP_Y;
+ }
+ if (trackProtagonist == 1 && roomX + r == curX + curWidth / 2) {
+ characterMoved = 0;
+ stepX = STEP_X;
+ stepY = STEP_Y;
+ curX = roomX - curWidth / 2;
+ curY = roomY - curHeight;
+ }
+ } else if (currentChapter == 2) {
+ if (trackProtagonist == 0 && roomX - r == curX) {
+ characterMoved = 0;
+ stepX = STEP_X;
+ stepY = STEP_Y;
+ }
+ if (trackProtagonist == 1 && roomX + r == curX + curWidth) {
+ characterMoved = 0;
+ stepX = STEP_X;
+ stepY = STEP_Y;
+ curX = roomX - curWidth + 4;
+ curY = roomY - curHeight;
+ }
+ }
+ }
+ }
+ if (characterMoved == 1 && stepY == STEP_Y) {
+ for (r = 0; r < stepY; r++) {
+ if (trackProtagonist == 2 && roomY - r == curY + curHeight) {
+ characterMoved = 0;
+ stepX = STEP_X;
+ stepY = STEP_Y;
+ }
+ if (trackProtagonist == 3 && roomY + r == curY + curHeight) {
+ characterMoved = 0;
+ stepX = STEP_X;
+ stepY = STEP_Y;
+ }
+ }
+ }
+
+ if (currentChapter == 1 || currentChapter == 4 || currentChapter == 5 || currentChapter == 6) {
+ if (hare_se_ve == 0) {
+ increaseFrameNum();
+ return;
+ }
+ }
+
+ if (characterMoved == 0) {
+ curPos[0] = 0;
+ curPos[1] = DIF_MASK_HARE;
+ curPos[2] = curX;
+ curPos[3] = curY;
+ if (currentChapter == 2) {
+ curPos[4] = curWidth;
+ curPos[5] = curHeight;
+ } else {
+ curPos[4] = CHARACTER_WIDTH;
+ curPos[5] = CHARACTER_HEIGHT;
+ }
+
+ if (trackProtagonist == 0) {
+ curPos[1] = 0;
+ if (currentChapter == 2)
+ copyRectClip(curPos, extraSurface, screenSurface);
+ else
+ reduce_hare_chico(curPos[0], curPos[1], curPos[2], curPos[3], curPos[4], curPos[5],
+ factor_red[curY + curHeight], extraSurface, screenSurface);
+ } else if (trackProtagonist == 1) {
+ if (currentChapter == 2)
+ copyRectClip(curPos, extraSurface, screenSurface);
+ else
+ reduce_hare_chico(curPos[0], curPos[1], curPos[2], curPos[3], curPos[4], curPos[5],
+ factor_red[curY + curHeight], extraSurface, screenSurface);
+ } else if (trackProtagonist == 2) {
+ if (currentChapter == 2)
+ copyRectClip(curPos, backSurface, screenSurface);
+ else
+ reduce_hare_chico(curPos[0], curPos[1], curPos[2], curPos[3], curPos[4], curPos[5],
+ factor_red[curY + curHeight], backSurface, screenSurface);
+ } else {
+ if (currentChapter == 2)
+ copyRectClip(curPos, frontSurface, screenSurface);
+ else
+ reduce_hare_chico(curPos[0], curPos[1], curPos[2], curPos[3], curPos[4], curPos[5],
+ factor_red[curY + curHeight], frontSurface, screenSurface);
+ }
+ } else if (characterMoved == 1) {
+ curPos[0] = _frameX[num_frame];
+ curPos[1] = frame_y + DIF_MASK_HARE;
+ curPos[2] = curX;
+ curPos[3] = curY;
+ if (currentChapter == 2) {
+ curPos[4] = curWidth;
+ curPos[5] = curHeight;
+ } else {
+ curPos[4] = CHARACTER_WIDTH;
+ curPos[5] = CHARACTER_HEIGHT;
+ }
+ if (trackProtagonist == 0) {
+ curPos[1] = 0;
+ if (currentChapter == 2)
+ copyRectClip(curPos, extraSurface, screenSurface);
+ else
+ reduce_hare_chico(curPos[0], curPos[1], curPos[2], curPos[3], curPos[4], curPos[5],
+ factor_red[curY + curHeight], extraSurface, screenSurface);
+ } else if (trackProtagonist == 1) {
+ if (currentChapter == 2)
+ copyRectClip(curPos, extraSurface, screenSurface);
+ else
+ reduce_hare_chico(curPos[0], curPos[1], curPos[2], curPos[3], curPos[4], curPos[5],
+ factor_red[curY + curHeight], extraSurface, screenSurface);
+ } else if (trackProtagonist == 2) {
+ if (currentChapter == 2)
+ copyRectClip(curPos, backSurface, screenSurface);
+ else
+ reduce_hare_chico(curPos[0], curPos[1], curPos[2], curPos[3], curPos[4], curPos[5],
+ factor_red[curY + curHeight], backSurface, screenSurface);
+ } else {
+ if (currentChapter == 2)
+ copyRectClip(curPos, frontSurface, screenSurface);
+ else
+ reduce_hare_chico(curPos[0], curPos[1], curPos[2], curPos[3], curPos[4], curPos[5],
+ factor_red[curY + curHeight], frontSurface, screenSurface);
+ }
+ increaseFrameNum();
+ }
+}
+
+void DrasculaEngine::quadrant_1() {
+ float distanceX, distanceY;
+
+ if (currentChapter == 2)
+ distanceX = curX - roomX;
+ else
+ distanceX = curX + curWidth / 2 - roomX;
+
+ distanceY = (curY + curHeight) - roomY;
+
+ if (distanceX < distanceY) {
+ curDirection = 0;
+ trackProtagonist = 2;
+ stepX = (int)(distanceX / (distanceY / STEP_Y));
+ } else {
+ curDirection = 7;
+ trackProtagonist = 0;
+ stepY = (int)(distanceY / (distanceX / STEP_X));
+ }
+}
+
+void DrasculaEngine::quadrant_2() {
+ float distanceX, distanceY;
+
+ if (currentChapter == 2)
+ distanceX = abs(curX + curWidth - roomX);
+ else
+ distanceX = abs(curX + curWidth / 2 - roomX);
+
+ distanceY = (curY + curHeight) - roomY;
+
+ if (distanceX < distanceY) {
+ curDirection = 1;
+ trackProtagonist = 2;
+ stepX = (int)(distanceX / (distanceY / STEP_Y));
+ } else {
+ curDirection = 2;
+ trackProtagonist = 1;
+ stepY = (int)(distanceY / (distanceX / STEP_X));
+ }
+}
+
+void DrasculaEngine::quadrant_3() {
+ float distanceX, distanceY;
+
+ if (currentChapter == 2)
+ distanceX = curX - roomX;
+ else
+ distanceX = curX + curWidth / 2 - roomX;
+
+ distanceY = roomY - (curY + curHeight);
+
+ if (distanceX < distanceY) {
+ curDirection = 5;
+ trackProtagonist = 3;
+ stepX = (int)(distanceX / (distanceY / STEP_Y));
+ } else {
+ curDirection = 6;
+ trackProtagonist = 0;
+ stepY = (int)(distanceY / (distanceX / STEP_X));
+ }
+}
+
+void DrasculaEngine::quadrant_4() {
+ float distanceX, distanceY;
+
+ if (currentChapter == 2)
+ distanceX = abs(curX + curWidth - roomX);
+ else
+ distanceX = abs(curX + curWidth / 2 - roomX);
+
+ distanceY = roomY - (curY + curHeight);
+
+ if (distanceX < distanceY) {
+ curDirection = 4;
+ trackProtagonist = 3;
+ stepX = (int)(distanceX / (distanceY / STEP_Y));
+ } else {
+ curDirection = 3;
+ trackProtagonist = 1;
+ stepY = (int)(distanceY / (distanceX / STEP_X));
+ }
+}
+
+void DrasculaEngine::increaseFrameNum() {
+ timeDiff = getTime() - startTime;
+
+ if (timeDiff >= 6) {
+ startTime = getTime();
+ num_frame++;
+ if (num_frame == 6)
+ num_frame = 0;
+
+ if (curDirection == 0 || curDirection == 7) {
+ curX -= stepX;
+ curY -= stepY;
+ } else if (curDirection == 1 || curDirection == 2) {
+ curX += stepX;
+ curY -= stepY;
+ } else if (curDirection == 3 || curDirection == 4) {
+ curX += stepX;
+ curY += stepY;
+ } else if (curDirection == 5 || curDirection == 6) {
+ curX -= stepX;
+ curY += stepY;
+ }
+ }
+
+ if (currentChapter != 2) {
+ curY += (int)(curHeight - newHeight);
+ curX += (int)(curWidth - newWidth);
+ curHeight = (int)newHeight;
+ curWidth = (int)newWidth;
+ }
+}
+
+void DrasculaEngine::walkDown() {
+ curDirection = 4;
+ trackProtagonist = 3;
+ stepX = 0;
+}
+
+void DrasculaEngine::walkUp() {
+ curDirection = 0;
+ trackProtagonist = 2;
+ stepX = 0;
+}
+
+void DrasculaEngine::moveVonBraun() {
+ int pos_vb[6];
+
+ if (vonBraunHasMoved == 0) {
+ pos_vb[0] = 256;
+ pos_vb[1] = 129;
+ pos_vb[2] = vonBraunX;
+ pos_vb[3] = 66;
+ pos_vb[4] = 33;
+ pos_vb[5] = 69;
+ if (trackVonBraun == 0)
+ pos_vb[0] = 222;
+ else if (trackVonBraun == 1)
+ pos_vb[0] = 188;
+ } else {
+ pos_vb[0] = actorFrames[kFrameVonBraun];
+ pos_vb[1] = (trackVonBraun == 0) ? 62 : 131;
+ pos_vb[2] = vonBraunX;
+ pos_vb[3] = 66;
+ pos_vb[4] = 28;
+ pos_vb[5] = 68;
+
+ actorFrames[kFrameVonBraun] += 29;
+ if (actorFrames[kFrameVonBraun] > 146)
+ actorFrames[kFrameVonBraun] = 1;
+ }
+
+ copyRectClip(pos_vb, frontSurface, screenSurface);
+}
+
+void DrasculaEngine::placeVonBraun(int pointX) {
+ trackVonBraun = (pointX < vonBraunX) ? 0 : 1;
+ vonBraunHasMoved = 1;
+
+ for (;;) {
+ updateRoom();
+ updateScreen();
+ if (trackVonBraun == 0) {
+ vonBraunX = vonBraunX - 5;
+ if (vonBraunX <= pointX)
+ break;
+ } else {
+ vonBraunX = vonBraunX + 5;
+ if (vonBraunX >= pointX)
+ break;
+ }
+ pause(5);
+ }
+
+ vonBraunHasMoved = 0;
+}
+
+
+
+} // End of namespace Drascula
diff --git a/engines/drascula/animation.cpp b/engines/drascula/animation.cpp
index 8ae6a18b3a..feb6cb93ca 100644
--- a/engines/drascula/animation.cpp
+++ b/engines/drascula/animation.cpp
@@ -27,125 +27,140 @@
namespace Drascula {
-static const int interf_x[] ={ 1, 65, 129, 193, 1, 65, 129 };
-static const int interf_y[] ={ 51, 51, 51, 51, 83, 83, 83 };
+void DrasculaEngine::updateAnim(int y, int destX, int destY, int width, int height, int count, byte* src, int delayVal) {
+ int x = 0;
+ for (int n = 0; n < count; n++){
+ x++;
+ copyBackground(x, y, destX, destY, width, height, src, screenSurface);
+ updateScreen(destX, destY, destX, destY, width, height, screenSurface);
+ x += width;
+ pause(delayVal);
+ }
+}
+
+void DrasculaEngine::updateAnim2(int y, int px, int py, int width, int height, int count, byte* src) {
+ int x = 0;
+
+ for (int n = 0; n < count; n++) {
+ x++;
+ copyBackground(px, py, px, py, width, height, bgSurface, screenSurface);
+ copyRect(x, y, px, py, width, height, src, screenSurface);
+ updateScreen(px, py, px, py, width, height, screenSurface);
+ x = x + width;
+ pause(3);
+ }
+}
+
+// This is the game's introduction sequence
void DrasculaEngine::animation_1_1() {
int l, l2, p;
- int pos_pixel[6];
+ int pixelPos[6];
while (term_int == 0) {
- playmusic(29);
- fliplay("logoddm.bin", 9);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ playMusic(29);
+ playFLI("logoddm.bin", 9);
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
delay(600);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
clearRoom();
delay(340);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
- playmusic(26);
+ playMusic(26);
delay(500);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
- fliplay("logoalc.bin", 8);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ playFLI("logoalc.bin", 8);
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
clearRoom();
- loadPic("cielo.alg");
- decompressPic(dir_zona_pantalla, 256);
- Negro();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- FundeDelNegro(2);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ loadPic("cielo.alg", screenSurface, COMPLETE_PAL);
+ black();
+ updateScreen();
+ fadeFromBlack(2);
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
delay(900);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
- color_abc(ROJO);
- centra_texto("Transilvanya, 1993 d.c.", 160, 100);
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ color_abc(kColorRed);
+ centerText(_textmisc[_lang][1], 160, 100);
+ updateScreen();
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
delay(1000);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
delay(1200);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
- fliplay("scrollb.bin", 9);
+ playFLI("scrollb.bin", 9);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
clearRoom();
- comienza_sound("s5.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ playSound(5);
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
- anima("scr2.bin", 17);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ if (animate("scr2.bin", 17))
break;
- fin_sound_corte();
- anima("scr3.bin", 17);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ stopSound();
+ if (animate("scr3.bin", 17))
break;
- loadPic("cielo2.alg");
- decompressPic(dir_zona_pantalla, 256);
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ loadPic("cielo2.alg", screenSurface, COMPLETE_PAL);
+ updateScreen();
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
- FundeAlNegro(1);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ fadeToBlack(1);
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
clearRoom();
- loadPic("96.alg");
- decompressPic(dir_hare_frente, COMPLETA);
- loadPic("103.alg");
- decompressPic(dir_dibujo1, MEDIA);
- loadPic("104.alg");
- decompressPic(dir_dibujo3, 1);
- loadPic("aux104.alg");
- decompressPic(dir_dibujo2, 1);
+ loadPic(96, frontSurface, COMPLETE_PAL);
+ loadPic(103, bgSurface, HALF_PAL);
+ loadPic(104, drawSurface3);
+ loadPic("aux104.alg", drawSurface2);
- playmusic(4);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ playMusic(4);
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
delay(400);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
for (l2 = 0; l2 < 3; l2++)
for (l = 0; l < 7; l++) {
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- copyBackground(interf_x[l], interf_y[l], 156, 45, 63, 31, dir_dibujo2, dir_zona_pantalla);
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- if (getscan() == Common::KEYCODE_ESCAPE) {
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
+ copyBackground(interf_x[l], interf_y[l], 156, 45, 63, 31, drawSurface2, screenSurface);
+ updateScreen();
+ if (getScan() == Common::KEYCODE_ESCAPE) {
term_int = 1;
break;
}
pause(3);
}
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
l2 = 0; p = 0;
- pos_pixel[3] = 45;
- pos_pixel[4] = 63;
- pos_pixel[5] = 31;
+ pixelPos[3] = 45;
+ pixelPos[4] = 63;
+ pixelPos[5] = 31;
for (l = 0; l < 180; l++) {
- copyBackground(0, 0, 320 - l, 0, l, 200, dir_dibujo3, dir_zona_pantalla);
- copyBackground(l, 0, 0, 0, 320 - l, 200, dir_dibujo1, dir_zona_pantalla);
+ copyBackground(0, 0, 320 - l, 0, l, 200, drawSurface3, screenSurface);
+ copyBackground(l, 0, 0, 0, 320 - l, 200, bgSurface, screenSurface);
- pos_pixel[0] = interf_x[l2];
- pos_pixel[1] = interf_y[l2];
- pos_pixel[2] = 156 - l;
+ pixelPos[0] = interf_x[l2];
+ pixelPos[1] = interf_y[l2];
+ pixelPos[2] = 156 - l;
- copyRectClip(pos_pixel, dir_dibujo2, dir_zona_pantalla);
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ copyRectClip(pixelPos, drawSurface2, screenSurface);
+ updateScreen();
p++;
if (p == 6) {
p = 0;
@@ -153,1559 +168,1212 @@ void DrasculaEngine::animation_1_1() {
}
if (l2 == 7)
l2 = 0;
- if (getscan() == Common::KEYCODE_ESCAPE) {
+ if (getScan() == Common::KEYCODE_ESCAPE) {
term_int = 1;
break;
}
}
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
- copyBackground(0, 0, 0, 0, 320, 200, dir_zona_pantalla, dir_dibujo1);
+ copyBackground(0, 0, 0, 0, 320, 200, screenSurface, bgSurface);
- talk_dr_grande(_textd[_lang][1], "D1.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ talk_dr_grande(1);
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
clearRoom();
- loadPic("100.alg");
- decompressPic(dir_dibujo1, MEDIA);
- loadPic("auxigor.alg");
- decompressPic(dir_hare_frente, 1);
- loadPic("auxdr.alg");
- decompressPic(dir_hare_fondo, 1);
- sentido_dr = 0;
- x_dr = 129;
- y_dr = 95;
- sentido_igor = 1;
- x_igor = 66;
- y_igor = 97;
-
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- pon_igor();
- pon_dr();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- talk_igor_dch(_texti[_lang][8], "I8.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- pon_igor();
- pon_dr();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- talk_dr_izq(_textd[_lang][2], "d2.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- talk_dr_izq(_textd[_lang][3], "d3.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- anima("lib.bin", 16);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- anima("lib2.bin", 16);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ loadPic(100, bgSurface, HALF_PAL);
+ loadPic("auxigor.alg", frontSurface);
+ loadPic("auxdr.alg", backSurface);
+ trackDrascula = 0;
+ drasculaX = 129;
+ drasculaY = 95;
+ trackIgor = 1;
+ igorX = 66;
+ igorY = 97;
+
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
+ placeIgor();
+ placeDrascula();
+ updateScreen();
+ talk_igor(8, kIgorDch);
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
+ break;
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
+ placeIgor();
+ placeDrascula();
+ updateScreen();
+ talk_drascula(2);
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
+ break;
+ talk_drascula(3);
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
+ break;
+ if (animate("lib.bin", 16))
+ break;
+ if (animate("lib2.bin", 16))
break;
clearRoom();
- color_solo = ROJO;
- loadPic("plan1.alg");
- decompressPic(dir_zona_pantalla, MEDIA);
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ color_solo = kColorRed;
+ loadPic("plan1.alg", screenSurface, HALF_PAL);
+ updateScreen();
pause(10);
talk_solo(_textd[_lang][4],"d4.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
- loadPic("plan1.alg");
- decompressPic(dir_zona_pantalla, MEDIA);
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ loadPic("plan1.alg", screenSurface, HALF_PAL);
+ updateScreen();
talk_solo(_textd[_lang][5], "d5.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
- anima("lib2.bin", 16);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ if (animate("lib2.bin", 16))
break;
clearRoom();
- loadPic("plan2.alg");
- decompressPic(dir_zona_pantalla, MEDIA);
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ loadPic("plan2.alg", screenSurface, HALF_PAL);
+ updateScreen();
pause(20);
talk_solo(_textd[_lang][6], "d6.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
- anima("lib2.bin", 16);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ if (animate("lib2.bin", 16))
break;
clearRoom();
- loadPic("plan3.alg");
- decompressPic(dir_zona_pantalla, MEDIA);
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ loadPic("plan3.alg", screenSurface, HALF_PAL);
+ updateScreen();
pause(20);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
talk_solo(_textd[_lang][7], "d7.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
- loadPic("plan3.alg");
- decompressPic(dir_zona_pantalla, MEDIA);
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ loadPic("plan3.alg", screenSurface, HALF_PAL);
+ updateScreen();
talk_solo(_textd[_lang][8], "d8.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
clearRoom();
- loadPic("100.alg");
- decompressPic(dir_dibujo1, MEDIA);
+ loadPic(100, bgSurface, HALF_PAL);
MusicFadeout();
- stopmusic();
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ stopMusic();
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
- talk_igor_dch(_texti[_lang][9], "I9.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ talk_igor(9, kIgorDch);
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
- talk_dr_izq(_textd[_lang][9], "d9.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ talk_drascula(9);
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
- talk_igor_dch(_texti[_lang][10], "I10.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ talk_igor(10, kIgorDch);
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
- playmusic(11);
- talk_dr_izq(_textd[_lang][10], "d10.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ playMusic(11);
+ talk_drascula(10);
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
- anima("rayo1.bin", 16);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ if (animate("rayo1.bin", 16))
break;
- comienza_sound("s5.als");
- anima("rayo2.bin", 15);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ playSound(5);
+ if (animate("rayo2.bin", 15))
break;
- anima("frel2.bin", 16);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ if (animate("frel2.bin", 16))
break;
- anima("frel.bin", 16);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ if (animate("frel.bin", 16))
break;
- anima("frel.bin", 16);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ if (animate("frel.bin", 16))
break;
- fin_sound_corte();
+ stopSound();
clearRoom();
- Negro();
- playmusic(23);
- FundeDelNegro(0);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- sentido_dr = 1;
- talk_igor_dch(_texti[_lang][1], "I1.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- talk_dr_dch(_textd[_lang][11], "d11.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- sentido_dr = 3;
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- pon_igor();
- pon_dr();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ black();
+ playMusic(23);
+ fadeFromBlack(0);
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
+ break;
+ trackDrascula = 1;
+ talk_igor(1, kIgorDch);
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
+ break;
+ talk_drascula(11, 1);
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
+ break;
+ trackDrascula = 3;
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
+ placeIgor();
+ placeDrascula();
+ updateScreen();
pause(1);
- sentido_dr = 0;
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- pon_igor();
- pon_dr();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- talk_dr_izq(_textd[_lang][12], "d12.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- sentido_dr = 3;
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- pon_igor();
- pon_dr();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ trackDrascula = 0;
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
+ placeIgor();
+ placeDrascula();
+ updateScreen();
+ talk_drascula(12);
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
+ break;
+ trackDrascula = 3;
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
+ placeIgor();
+ placeDrascula();
+ updateScreen();
pause(1);
- sentido_dr = 1;
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- pon_igor();
- pon_dr();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- talk_igor_dch(_texti[_lang][2], "I2.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ trackDrascula = 1;
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
+ placeIgor();
+ placeDrascula();
+ updateScreen();
+ talk_igor(2, kIgorDch);
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
pause(13);
- talk_dr_dch(_textd[_lang][13],"d13.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
- break;
- sentido_dr = 3;
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- pon_igor();
- pon_dr();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ talk_drascula(13, 1);
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
+ break;
+ trackDrascula = 3;
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
+ placeIgor();
+ placeDrascula();
+ updateScreen();
pause(1);
- sentido_dr = 0;
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- pon_igor();
- pon_dr();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- talk_dr_izq(_textd[_lang][14], "d14.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ trackDrascula = 0;
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
+ placeIgor();
+ placeDrascula();
+ updateScreen();
+ talk_drascula(14);
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
- talk_igor_dch(_texti[_lang][3], "I3.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ talk_igor(3, kIgorDch);
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
- talk_dr_izq(_textd[_lang][15], "d15.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ talk_drascula(15);
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
- talk_igor_dch(_texti[_lang][4], "I4.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ talk_igor(4, kIgorDch);
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
- talk_dr_izq(_textd[_lang][16], "d16.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ talk_drascula(16);
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
- talk_igor_dch(_texti[_lang][5], "I5.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ talk_igor(5, kIgorDch);
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
- sentido_igor = 3;
- talk_dr_izq(_textd[_lang][17], "d17.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ trackIgor = 3;
+ talk_drascula(17);
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
pause(18);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
- talk_igor_frente(_texti[_lang][6], "I6.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ talk_igor(6, kIgorFront);
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
- FundeAlNegro(0);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ fadeToBlack(0);
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
clearRoom();
- playmusic(2);
+ playMusic(2);
pause(5);
- fliplay("intro.bin", 12);
+ playFLI("intro.bin", 12);
term_int = 1;
}
clearRoom();
- loadPic("96.alg");
- decompressPic(dir_hare_frente, COMPLETA);
- loadPic("99.alg");
- decompressPic(dir_hare_fondo, 1);
-}
-
-void DrasculaEngine::talk_dr_grande(const char *dicho, const char *filename) {
- int tiempou;
- long tiempol;
- int x_talk[4] = {47, 93, 139, 185};
- int cara;
- int l = 0;
-
- int longitud;
- longitud = strlen(dicho);
-
- tiempol = _system->getMillis();
- tiempou = (unsigned int)tiempol / 2;
- _rnd->setSeed(tiempou);
-
- buffer_teclado();
-
- color_abc(ROJO);
-
- if (hay_sb == 1) {
- sku = new Common::File;
- sku->open(filename);
- if (!sku->isOpen()) {
- error("no puedo abrir archivo de voz");
- }
- ctvd_init(2);
- ctvd_speaker(1);
- ctvd_output(sku);
- }
-
-bucless:
-
- cara = _rnd->getRandomNumber(3);
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- copyBackground(interf_x[l] + 24, interf_y[l], 0, 45, 39, 31, dir_dibujo2, dir_zona_pantalla);
- copyBackground(x_talk[cara], 1, 171, 68, 45, 48, dir_dibujo2, dir_zona_pantalla);
- l++;
- if (l == 7)
- l = 0;
-
- if (con_voces == 0)
- centra_texto(dicho, 191, 69);
-
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- pause(3);
-
- byte key = getscan();
- if (key == Common::KEYCODE_ESCAPE)
- term_int = 1;
-
- if (key != 0)
- ctvd_stop();
- buffer_teclado();
- if (hay_sb == 1) {
- if (LookForFree() != 0)
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- longitud = longitud - 2;
- if (longitud > 0)
- goto bucless;
- }
+ loadPic(96, frontSurface, COMPLETE_PAL);
+ loadPic(99, backSurface);
}
+// John falls in love with BJ, who is then abducted by Drascula
void DrasculaEngine::animation_2_1() {
int l;
- lleva_al_hare(231, 91);
+ gotoObject(231, 91);
hare_se_ve = 0;
term_int = 0;
for (;;) {
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
- anima("ag.bin", 14);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ if (animate("ag.bin", 14))
break;
- loadPic("an11y13.alg");
- decompressPic(dir_hare_dch, 1);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ if (_lang == kSpanish)
+ textSurface = frontSurface;
+
+ loadPic("an11y13.alg", extraSurface);
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
- talk_tabernero(_textt[_lang][22], "T22.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ talk_bartender(22);
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
- loadPic("97.alg");
- decompressPic(dir_hare_dch, 1);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ if (_lang == kSpanish)
+ textSurface = extraSurface;
+
+ loadPic(97, extraSurface);
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
pause(4);
- comienza_sound("s1.als");
- hipo(18);
- fin_sound();
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ playSound(1);
+ hiccup(18);
+ finishSound();
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
clearRoom();
- stopmusic();
- corta_musica = 1;
- memset(dir_zona_pantalla, 0, 64000);
- color_solo = BLANCO;
+ stopMusic();
+ musicStopped = 1;
+ memset(screenSurface, 0, 64000);
+ color_solo = kColorWhite;
pause(80);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
talk_solo(_textbj[_lang][1], "BJ1.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
clearRoom();
- loadPic("bj.alg");
- decompressPic(dir_zona_pantalla, MEDIA);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ loadPic("bj.alg", screenSurface, HALF_PAL);
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
- Negro();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- FundeDelNegro(1);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ black();
+ updateScreen();
+ fadeFromBlack(1);
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
- color_solo = AMARILLO;
+ color_solo = kColorYellow;
talk_solo(_text[_lang][214], "214.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
clearRoom();
- loadPic("16.alg");
- decompressPic(dir_dibujo1, MEDIA);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ loadPic(16, bgSurface, HALF_PAL);
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
- loadPic("auxbj.alg");
- decompressPic(dir_dibujo3, 1);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ loadPic("auxbj.alg", drawSurface3);
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
- strcpy(num_room, "16.alg");
+ roomNumber = 16;
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
for (l = 0; l < 200; l++)
factor_red[l] = 99;
- x_bj = 170;
- y_bj = 90;
- sentido_bj = 0;
- hare_x = 91;
- hare_y = 95;
- sentido_hare = 1;
+ bjX = 170;
+ bjY = 90;
+ trackBJ = 0;
+ curX = 91;
+ curY = 95;
+ trackProtagonist = 1;
hare_se_ve = 1;
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
- loadPic("97g.alg");
- decompressPic(dir_hare_dch, 1);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ loadPic("97g.alg", extraSurface);
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
- anima("lev.bin", 15);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ if (animate("lev.bin", 15))
break;
- lleva_al_hare(100 + ancho_hare / 2, 99 + alto_hare);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ gotoObject(100 + curWidth / 2, 99 + curHeight);
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
- sentido_hare = 1;
- hare_x = 100;
- hare_y = 95;
+ trackProtagonist = 1;
+ curX = 100;
+ curY = 95;
- talk_bj(_textbj[_lang][2], "BJ2.als");
- talk(_text[_lang][215], "215.als");
- talk_bj(_textbj[_lang][3], "BJ3.als");
- talk(_text[_lang][216], "216.als");
- talk_bj(_textbj[_lang][4], "BJ4.als");
- talk_bj(_textbj[_lang][5], "BJ5.als");
- talk_bj(_textbj[_lang][6], "BJ6.als");
- talk(_text[_lang][217], "217.als");
- talk_bj(_textbj[_lang][7], "BJ7.als");
- talk(_text[_lang][218], "218.als");
- talk_bj(_textbj[_lang][8], "BJ8.als");
- talk(_text[_lang][219], "219.als");
- talk_bj(_textbj[_lang][9], "BJ9.als");
- talk(_text[_lang][220], "220.als");
- talk(_text[_lang][221], "221.als");
- talk_bj(_textbj[_lang][10], "BJ10.als");
- talk(_text[_lang][222], "222.als");
- anima("gaf.bin", 15);
- anima("bjb.bin", 14);
- playmusic(9);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ talk_bj(2);
+ talk(215);
+ talk_bj(3);
+ talk(216);
+ talk_bj(4);
+ talk_bj(5);
+ talk_bj(6);
+ talk(217);
+ talk_bj(7);
+ talk(218);
+ talk_bj(8);
+ talk(219);
+ talk_bj(9);
+ talk(220);
+ talk(221);
+ talk_bj(10);
+ talk(222);
+ if (animate("gaf.bin", 15))
break;
- loadPic("97.alg");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ if (animate("bjb.bin", 14))
break;
- decompressPic(dir_hare_dch, 1);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ playMusic(9);
+ loadPic(97, extraSurface);
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ updateScreen();
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
pause(120);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
talk_solo(_text[_lang][223], "223.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
- color_solo = BLANCO;
+ color_solo = kColorWhite;
updateRoom();
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateScreen();
pause(110);
talk_solo(_textbj[_lang][11], "BJ11.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
updateRoom();
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ updateScreen();
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
pause(118);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
- lleva_al_hare(132, 97 + alto_hare);
+ gotoObject(132, 97 + curHeight);
pause(60);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
- talk(_text[_lang][224], "224.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ talk(224);
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
- talk_bj(_textbj[_lang][12], "BJ12.als");
- lleva_al_hare(157, 98 + alto_hare);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ talk_bj(12);
+ gotoObject(157, 98 + curHeight);
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
- anima("bes.bin", 16);
- playmusic(11);
- anima("rap.bin", 16);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ if (animate("bes.bin", 16))
break;
- sentido_hare = 3;
- strcpy(num_room, "no_bj.alg");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ playMusic(11);
+ if (animate("rap.bin", 16))
+ break;
+ trackProtagonist = 3;
+ // The room number was originally changed here to "no_bj.alg",
+ // which doesn't exist. In reality, this was just a hack to
+ // set the room number to a non-existant one, so that BJ does
+ // not appear again when the room is refreshed after the
+ // animation where Count Drascula abducts her. We set the
+ // room number to -1 for the same purpose
+ // Also check animation_9_6(), where the same hack was used by
+ // the original
+ roomNumber = -1;
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
pause(8);
updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- talk(_text[_lang][225], "225.als");
+ updateScreen();
+ talk(225);
pause(76);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
- sentido_hare = 1;
+ trackProtagonist = 1;
updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- talk(_text[_lang][226], "226.als");
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ updateScreen();
+ talk(226);
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateScreen();
pause(30);
- if ((term_int == 1) || (getscan() == Common::KEYCODE_ESCAPE))
+ if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break;
- talk(_text[_lang][227],"227.als");
- FundeAlNegro(0);
+ talk(227);
+ fadeToBlack(0);
break;
}
}
void DrasculaEngine::animation_3_1() {
- loadPic("an11y13.alg");
- decompressPic(dir_hare_dch, 1);
-
- talk(_text[_lang][192], "192.als");
- talk_tabernero(_textt[_lang][1], "t1.als");
- talk(_text[_lang][193], "193.als");
- talk_tabernero(_textt[_lang][2], "t2.als");
- talk(_text[_lang][194], "194.als");
- talk_tabernero(_textt[_lang][3], "t3.als");
- talk(_text[_lang][195], "195.als");
- talk_tabernero(_textt[_lang][4], "t4.als");
- talk(_text[_lang][196], "196.als");
- talk_tabernero(_textt[_lang][5], "t5.als");
- talk_tabernero(_textt[_lang][6], "t6.als");
- talk(_text[_lang][197], "197.als");
- talk_tabernero(_textt[_lang][7], "t7.als");
- talk(_text[_lang][198], "198.als");
- talk_tabernero(_textt[_lang][8], "t8.als");
- talk(_text[_lang][199], "199.als");
- talk_tabernero(_textt[_lang][9], "t9.als");
- talk(_text[_lang][200], "200.als");
- talk(_text[_lang][201], "201.als");
- talk(_text[_lang][202], "202.als");
+ if (_lang == kSpanish)
+ textSurface = frontSurface;
+
+ loadPic("an11y13.alg", extraSurface);
+
+ talk(192);
+ talk_bartender(1);
+ talk(193);
+ talk_bartender(2);
+ talk(194);
+ talk_bartender(3);
+ talk(195);
+ talk_bartender(4);
+ talk(196);
+ talk_bartender(5);
+ talk_bartender(6);
+ talk(197);
+ talk_bartender(7);
+ talk(198);
+ talk_bartender(8);
+ talk(199);
+ talk_bartender(9);
+ talk(200);
+ talk(201);
+ talk(202);
flags[0] = 1;
- loadPic("97.alg");
- decompressPic(dir_hare_dch, 1);
+ if (_lang == kSpanish)
+ textSurface = extraSurface;
+
+ loadPic(97, extraSurface);
}
void DrasculaEngine::animation_4_1() {
- loadPic("an12.alg");
- decompressPic(dir_hare_dch, 1);
+ if (_lang == kSpanish)
+ textSurface = frontSurface;
+
+ loadPic("an12.alg", extraSurface);
- talk(_text[_lang][205],"205.als");
+ talk(205);
updateRefresh_pre();
- copyBackground(1, 139, 228, 112, 47, 60, dir_hare_dch, dir_zona_pantalla);
- updateScreen(228,112, 228,112, 47,60, dir_zona_pantalla);
+ copyBackground(1, 139, 228, 112, 47, 60, extraSurface, screenSurface);
+ updateScreen(228,112, 228,112, 47,60, screenSurface);
pause(3);
updateRefresh_pre();
- copyBackground(49, 139, 228, 112, 47, 60, dir_hare_dch, dir_zona_pantalla);
- pon_hare();
+ copyBackground(49, 139, 228, 112, 47, 60, extraSurface, screenSurface);
+ moveCharacters();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateScreen();
pause(3);
- stopmusic();
+ stopMusic();
flags[11] = 1;
- talk_pianista(_textp[_lang][1], "p1.als");
- talk(_text[_lang][206], "206.als");
- talk_pianista(_textp[_lang][2], "p2.als");
- talk(_text[_lang][207], "207.als");
- talk_pianista(_textp[_lang][3], "p3.als");
- talk(_text[_lang][208], "208.als");
- talk_pianista(_textp[_lang][4], "p4.als");
- talk(_text[_lang][209], "209.als");
+ talk_pianist(1);
+ talk(206);
+ talk_pianist(2);
+ talk(207);
+ talk_pianist(3);
+ talk(208);
+ talk_pianist(4);
+ talk(209);
+
+ if (_lang == kSpanish)
+ textSurface = extraSurface;
flags[11] = 0;
- loadPic("97.alg");
- decompressPic(dir_hare_dch, 1);
+ loadPic(97, extraSurface);
}
void DrasculaEngine::animation_1_2() {
- lleva_al_hare(178, 121);
- lleva_al_hare(169, 135);
+ gotoObject(178, 121);
+ gotoObject(169, 135);
}
void DrasculaEngine::animation_2_2() {
- int n, x=0;
-
- sentido_hare = 0;
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- pon_hare();
+ trackProtagonist = 0;
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
+ moveCharacters();
updateRefresh();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- loadPic("an2_1.alg");
- decompressPic(dir_hare_frente, 1);
- loadPic("an2_2.alg");
- decompressPic(dir_hare_dch, 1);
-
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- copyBackground(1, 1, 201, 87, 50, 52, dir_hare_frente, dir_zona_pantalla);
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- for (n = 0; n < 6; n++) {
- x++;
- copyBackground(x, 1, 201, 87, 50, 52, dir_hare_frente, dir_zona_pantalla);
- updateScreen(201,87, 201,87, 50,52, dir_zona_pantalla);
- x = x + 50;
- pause(3);
- }
+ updateScreen();
+ loadPic("an2_1.alg", frontSurface);
+ loadPic("an2_2.alg", extraSurface);
- x = 0;
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
+ copyBackground(1, 1, 201, 87, 50, 52, frontSurface, screenSurface);
+ updateScreen();
- for (n = 0; n < 6; n++) {
- x++;
- copyBackground(x, 55, 201, 87, 50, 52, dir_hare_frente, dir_zona_pantalla);
- updateScreen(201, 87, 201, 87, 50, 52, dir_zona_pantalla);
- x = x + 50;
- pause(3);
- }
+ updateAnim(1, 201, 87, 50, 52, 6, frontSurface);
+ updateAnim(55, 201, 87, 50, 52, 6, frontSurface);
+ updateAnim(109, 201, 87, 50, 52, 6, frontSurface);
- x = 0;
+ playSound(2);
- for (n = 0; n < 6; n++){
- x++;
- copyBackground(x, 109, 201, 87, 50, 52, dir_hare_frente, dir_zona_pantalla);
- updateScreen(201, 87, 201, 87, 50, 52, dir_zona_pantalla);
- x = x + 50;
- pause(3);
- }
-
- x = 0;
- comienza_sound("s2.als");
-
- for (n = 0; n < 6; n++) {
- x++;
- copyBackground(x, 1, 201, 87, 50, 52, dir_hare_dch, dir_zona_pantalla);
- updateScreen(201,87, 201,87, 50,52, dir_zona_pantalla);
- x = x + 50;
- pause(3);
- }
-
- x = 0;
-
- for (n = 0; n < 6; n++) {
- x++;
- copyBackground(x, 55, 201, 87, 50, 52, dir_hare_dch, dir_zona_pantalla);
- updateScreen(201, 87, 201, 87, 50, 52, dir_zona_pantalla);
- x = x + 50;
- pause(3);
- }
- x = 0;
-
- for (n = 0; n < 2; n++) {
- x++;
- copyBackground(x, 109, 201, 87, 50, 52, dir_hare_dch, dir_zona_pantalla);
- updateScreen(201, 87, 201, 87, 50, 52, dir_zona_pantalla);
- x = x + 50;
- pause(3);
- }
+ updateAnim(1, 201, 87, 50, 52, 6, extraSurface);
+ updateAnim(55, 201, 87, 50, 52, 6, extraSurface);
+ updateAnim(109, 201, 87, 50, 52, 2, extraSurface);
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
+ updateScreen();
- fin_sound();
+ finishSound();
pause (4);
- comienza_sound("s1.als");
+ playSound(1);
hipo_sin_nadie(12);
- fin_sound();
+ finishSound();
}
void DrasculaEngine::animation_3_2() {
- lleva_al_hare(163, 106);
- lleva_al_hare(287, 101);
- sentido_hare = 0;
+ gotoObject(163, 106);
+ gotoObject(287, 101);
+ trackProtagonist = 0;
}
void DrasculaEngine::animation_4_2() {
- stopmusic();
+ stopMusic();
flags[9] = 1;
pause(12);
- talk(_textd[_lang][56], "d56.als");
+ talk(56);
pause(8);
clearRoom();
- loadPic("ciego1.alg");
- decompressPic(dir_dibujo1, MEDIA);
- loadPic("ciego2.alg");
- decompressPic(dir_dibujo3, 1);
- loadPic("ciego3.alg");
- decompressPic(dir_hare_dch, 1);
- loadPic("ciego4.alg");
- decompressPic(dir_hare_fondo, 1);
- loadPic("ciego5.alg");
- decompressPic(dir_hare_frente, 1);
-
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ loadPic("ciego1.alg", bgSurface, HALF_PAL); // ciego = blind
+ loadPic("ciego2.alg", drawSurface3);
+ loadPic("ciego3.alg", extraSurface);
+ loadPic("ciego4.alg", backSurface);
+ loadPic("ciego5.alg", frontSurface);
+
+ if (_lang == kSpanish)
+ textSurface = frontSurface;
+
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
+ updateScreen();
pause(10);
- talk_ciego(_textd[_lang][68], "d68.als", "44472225500022227555544444664447222550002222755554444466");
+ talk_blind(1);
pause(5);
- talk_hacker(_textd[_lang][57], "d57.als");
+ talk_hacker(57);
pause(6);
- talk_ciego(_textd[_lang][69],"d69.als","444722255000222275555444446655033336666664464402256555005504450005446");
+ talk_blind(2);
pause(4);
- talk_hacker(_textd[_lang][58],"d58.als");
- talk_ciego(_textd[_lang][70],"d70.als", "4447222550002222755554444466550333226220044644550044755665500440006655556666655044744656550446470046");
+ talk_hacker(58);
+ talk_blind(3);
delay(14);
- talk_hacker(_textd[_lang][59],"d59.als");
- talk_ciego(_textd[_lang][71],"d71.als", "550330227556444744446660004446655544444722255000222275555444446644444");
- talk_hacker(_textd[_lang][60],"d60.als");
- talk_ciego(_textd[_lang][72],"d72.als", "55033022755644455550444744400044504447222550002222755554444466000");
- talk_hacker(_textd[_lang][61],"d61.als");
- talk_ciego(_textd[_lang][73],"d73.als", "55033022755644444447227444466644444722255000222275555444446664404446554440055655022227500544446044444446");
- talk_hacker(_textd[_lang][62],"d62.als");
- talk_ciego(_textd[_lang][74],"d74.als", "55033022755644444472244472225500022227555544444662550002222755444446666055522275550005550022200222000222666");
- talk_hacker(_textd[_lang][63],"d63.als");
- talk_ciego(_textd[_lang][75],"d75.als", "44447774444555500222205550444444466666225266444755444722255000222275555444446633223220044022203336227555770550444660557220553302224477777550550550222635533000662220002275572227025555");
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- _system->delayMillis(1);
- talk_hacker(_textd[_lang][64], "d64.als");
- talk_ciego(_textd[_lang][76], "d76.als", "5555500004445550330244472225500022227555544444662755644446666005204402266222003332222774440446665555005550335544444");
-
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ talk_hacker(59);
+ talk_blind(4);
+ talk_hacker(60);
+ talk_blind(5);
+ talk_hacker(61);
+ talk_blind(6);
+ talk_hacker(62);
+ talk_blind(7);
+ talk_hacker(63);
+ talk_blind(8);
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
+ updateScreen();
+ _system->delayMillis(1000);
+ talk_hacker(64);
+ talk_blind(9);
+
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
+ updateScreen();
pause(14);
clearRoom();
- playmusic(musica_room);
- loadPic("9.alg");
- decompressPic(dir_dibujo1, MEDIA);
- loadPic("aux9.alg");
- decompressPic(dir_dibujo3, 1);
- loadPic("96.alg");
- decompressPic(dir_hare_frente, 1);
- loadPic("97.alg");
- decompressPic(dir_hare_dch, 1);
- loadPic("99.alg");
- decompressPic(dir_hare_fondo, 1);
- sin_verbo();
+ playMusic(roomMusic);
+ loadPic(9, bgSurface, HALF_PAL);
+ loadPic("aux9.alg", drawSurface3);
+ loadPic(96, frontSurface);
+ loadPic(97, extraSurface);
+ loadPic(99, backSurface);
+ withoutVerb();
+
+ if (_lang == kSpanish)
+ textSurface = extraSurface;
flags[9] = 0;
flags[4] = 1;
}
void DrasculaEngine::animation_8_2() {
- talk_pianista(_textp[_lang][6], "P6.als");
- talk(_text[_lang][358], "358.als");
- talk_pianista(_textp[_lang][7], "P7.als");
- talk_pianista(_textp[_lang][8], "P8.als");
+ talk_pianist(6);
+ talk(358);
+ talk_pianist(7);
+ talk_pianist(8);
}
void DrasculaEngine::animation_9_2() {
- talk_pianista(_textp[_lang][9], "P9.als");
- talk_pianista(_textp[_lang][10], "P10.als");
- talk_pianista(_textp[_lang][11], "P11.als");
+ talk_pianist(9);
+ talk_pianist(10);
+ talk_pianist(11);
}
void DrasculaEngine::animation_10_2() {
- talk_pianista(_textp[_lang][12], "P12.als");
- talk(_text[_lang][361], "361.als");
+ talk_pianist(12);
+ talk(361);
pause(40);
- talk_pianista(_textp[_lang][13], "P13.als");
- talk(_text[_lang][362], "362.als");
- talk_pianista(_textp[_lang][14], "P14.als");
- talk(_text[_lang][363], "363.als");
- talk_pianista(_textp[_lang][15], "P15.als");
- talk(_text[_lang][364], "364.als");
- talk_pianista(_textp[_lang][16], "P16.als");
+ talk_pianist(13);
+ talk(362);
+ talk_pianist(14);
+ talk(363);
+ talk_pianist(15);
+ talk(364);
+ talk_pianist(16);
}
void DrasculaEngine::animation_14_2() {
- int n, pos_cabina[6];
+ int cabinPos[6] = { 150, 6, 69, -160, 158, 161 };
int l = 0;
- loadPic("an14_2.alg");
- decompressPic(dir_hare_fondo, 1);
- loadPic("an14_1.alg");
+ loadPic("an14_2.alg", backSurface);
- pos_cabina[0] = 150;
- pos_cabina[1] = 6;
- pos_cabina[2] = 69;
- pos_cabina[3] = -160;
- pos_cabina[4] = 158;
- pos_cabina[5] = 161;
-
- for (n = -160; n <= 0; n = n + 5 + l) {
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ for (int n = -160; n <= 0; n = n + 5 + l) {
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
updateRefresh_pre();
- pon_hare();
- pon_vb();
- pos_cabina[3] = n;
- copyRectClip(pos_cabina, dir_hare_fondo, dir_zona_pantalla);
+ moveCharacters();
+ moveVonBraun();
+ cabinPos[3] = n;
+ copyRectClip(cabinPos, backSurface, screenSurface);
updateRefresh();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- l = l + 1;
+ updateScreen();
+ l++;
}
flags[24] = 1;
- decompressPic(dir_dibujo1, 1);
+ memcpy(bgSurface, screenSurface, 64000);
- comienza_sound("s7.als");
- hipo(15);
+ playSound(7);
+ hiccup(15);
- fin_sound();
+ finishSound();
- loadPic("99.alg");
- decompressPic(dir_hare_fondo, 1);
+ loadPic(99, backSurface);
}
void DrasculaEngine::animation_15_2() {
- talk_borracho(_textb[_lang][8], "B8.als");
+ talk_drunk(8);
pause(7);
- talk_borracho(_textb[_lang][9], "B9.als");
- talk_borracho(_textb[_lang][10], "B10.als");
- talk_borracho(_textb[_lang][11], "B11.als");
+ talk_drunk(9);
+ talk_drunk(10);
+ talk_drunk(11);
}
void DrasculaEngine::animation_16_2() {
- int l;
-
- talk_borracho(_textb[_lang][12], "B12.als");
- talk(_text[_lang][371], "371.als");
+ talk_drunk(12);
+ talk(371);
clearRoom();
- playmusic(32);
- int key = getscan();
+ if (_lang == kSpanish)
+ playMusic(30);
+ else
+ playMusic(32);
+
+ int key = getScan();
if (key != 0)
goto asco;
- color_abc(VERDE_OSCURO);
+ if (_lang != kSpanish)
+ color_abc(kColorDarkGreen);
+
+ loadPic("his1.alg", bgSurface, HALF_PAL);
- loadPic("his1.alg");
- decompressPic(dir_dibujo1, MEDIA);
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- centra_texto(_texthis[_lang][1], 180, 180);
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- key = getscan();
+ if (_lang == kSpanish)
+ black();
+
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
+
+ if (_lang != kSpanish)
+ centerText(_texthis[_lang][1], 180, 180);
+
+ updateScreen();
+
+ if (_lang == kSpanish)
+ fadeFromBlack(1);
+
+ key = getScan();
if (key != 0)
goto asco;
- _system->delayMillis(4);
- key = getscan();
+ if (_lang == kSpanish)
+ _system->delayMillis(3000);
+ else
+ _system->delayMillis(4000);
+
+ key = getScan();
if (key != 0)
goto asco;
- FundeAlNegro(1);
- key = getscan();
+ fadeToBlack(1);
+ key = getScan();
if (key != 0)
goto asco;
clearRoom();
- loadPic("his2.alg");
- decompressPic(dir_dibujo1, MEDIA);
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- centra_texto(_texthis[_lang][2], 180, 180);
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- key = getscan();
+ loadPic("his2.alg", bgSurface, HALF_PAL);
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
+
+ if (_lang != kSpanish)
+ centerText(_texthis[_lang][2], 180, 180);
+
+ updateScreen();
+ key = getScan();
if (key != 0)
goto asco;
- _system->delayMillis(4);
- key = getscan();
+ if (_lang == kSpanish)
+ _system->delayMillis(3000);
+ else
+ _system->delayMillis(4000);
+
+ key = getScan();
if (key != 0)
goto asco;
- FundeAlNegro(1);
- key = getscan();
+ fadeToBlack(1);
+ key = getScan();
if (key != 0)
goto asco;
clearRoom();
- loadPic("his3.alg");
- decompressPic(dir_dibujo1, MEDIA);
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- centra_texto(_texthis[_lang][3], 180, 180);
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- key = getscan();
+ loadPic("his3.alg", bgSurface, HALF_PAL);
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
+
+ if (_lang != kSpanish)
+ centerText(_texthis[_lang][3], 180, 180);
+
+ updateScreen();
+ key = getScan();
if (key != 0)
goto asco;
- _system->delayMillis(4);
- key = getscan();
+ if (_lang == kSpanish)
+ _system->delayMillis(3000);
+ else
+ _system->delayMillis(4000);
+
+ key = getScan();
if (key != 0)
goto asco;
- FundeAlNegro(1);
+ fadeToBlack(1);
clearRoom();
- loadPic("his4_1.alg");
- decompressPic(dir_dibujo1, MEDIA);
- loadPic("his4_2.alg");
- decompressPic(dir_dibujo3, 1);
-
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo3, dir_zona_pantalla);
- centra_texto(_texthis[_lang][1], 180, 180);
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- key = getscan();
+ loadPic("his4_1.alg", bgSurface, HALF_PAL);
+ loadPic("his4_2.alg", drawSurface3);
+
+ copyBackground(0, 0, 0, 0, 320, 200, drawSurface3, screenSurface);
+
+ if (_lang != kSpanish)
+ centerText(_texthis[_lang][1], 180, 180);
+
+ updateScreen();
+ key = getScan();
if (key != 0)
goto asco;
- _system->delayMillis(4);
- key = getscan();
+ if (_lang == kSpanish)
+ _system->delayMillis(2000);
+ else
+ _system->delayMillis(4000);
+
+ key = getScan();
if (key != 0)
goto asco;
- for (l = 1; l < 200; l++) {
- copyBackground(0, 0, 0, l, 320, 200 - l, dir_dibujo3, dir_zona_pantalla);
- copyBackground(0, 200 - l, 0, 0, 320, l, dir_dibujo1, dir_zona_pantalla);
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- key = getscan();
+ for (int l = 1; l < 200; l++) {
+ copyBackground(0, 0, 0, l, 320, 200 - l, drawSurface3, screenSurface);
+ copyBackground(0, 200 - l, 0, 0, 320, l, bgSurface, screenSurface);
+ updateScreen();
+ key = getScan();
if (key != 0)
goto asco;
}
pause(5);
- FundeAlNegro(2);
+ fadeToBlack(2);
clearRoom();
asco:
- loadPic(roomDisk);
- decompressPic(dir_dibujo3, 1);
- loadPic(num_room);
- decompressPic(dir_dibujo1, MEDIA);
- Negro();
+ loadPic(roomDisk, drawSurface3);
+ loadPic(roomNumber, bgSurface, HALF_PAL);
+ black();
updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- FundeDelNegro(0);
- if (musica_room != 0)
- playmusic(musica_room);
+ updateScreen();
+ fadeFromBlack(0);
+ if (roomMusic != 0)
+ playMusic(roomMusic);
else
- stopmusic();
+ stopMusic();
}
void DrasculaEngine::animation_17_2() {
- talk_borracho(_textb[_lang][13], "B13.als");
- talk_borracho(_textb[_lang][14], "B14.als");
+ talk_drunk(13);
+ talk_drunk(14);
flags[40] = 1;
}
void DrasculaEngine::animation_19_2() {
- talk_vbpuerta(_textvb[_lang][5], "VB5.als");
+ talk_vonBraunpuerta(5);
}
void DrasculaEngine::animation_20_2() {
- talk_vbpuerta(_textvb[_lang][7], "VB7.als");
- talk_vbpuerta(_textvb[_lang][8], "VB8.als");
- talk(_text[_lang][383], "383.als");
- talk_vbpuerta(_textvb[_lang][9], "VB9.als");
- talk(_text[_lang][384], "384.als");
- talk_vbpuerta(_textvb[_lang][10], "VB10.als");
- talk(_text[_lang][385], "385.als");
- talk_vbpuerta(_textvb[_lang][11], "VB11.als");
+ talk_vonBraunpuerta(7);
+ talk_vonBraunpuerta(8);
+ talk(383);
+ talk_vonBraunpuerta(9);
+ talk(384);
+ talk_vonBraunpuerta(10);
+ talk(385);
+ talk_vonBraunpuerta(11);
if (flags[23] == 0) {
- talk(_text[_lang][350], "350.als");
- talk_vbpuerta(_textvb[_lang][57], "VB57.als");
+ talk(350);
+ talk_vonBraunpuerta(57);
} else {
- talk(_text[_lang][386], "386.als");
- talk_vbpuerta(_textvb[_lang][12], "VB12.als");
+ talk(386);
+ talk_vonBraunpuerta(12);
flags[18] = 0;
flags[14] = 1;
- abre_puerta(15, 1);
- sal_de_la_habitacion(1);
+ openDoor(15, 1);
+ exitRoom(1);
animation_23_2();
- sal_de_la_habitacion(0);
+ exitRoom(0);
flags[21] = 0;
flags[24] = 0;
- sentido_vb = 1;
- vb_x = 120;
+ trackVonBraun = 1;
+ vonBraunX = 120;
- rompo_y_salgo = 1;
+ breakOut = 1;
}
}
void DrasculaEngine::animation_21_2() {
- talk_vbpuerta(_textvb[_lang][6], "VB6.als");
+ talk_vonBraunpuerta(6);
}
void DrasculaEngine::animation_23_2() {
- loadPic("an24.alg");
- decompressPic(dir_hare_frente, 1);
+ loadPic("an24.alg", frontSurface);
flags[21] = 1;
if (flags[25] == 0) {
- talk_vb(_textvb[_lang][13], "VB13.als");
- talk_vb(_textvb[_lang][14], "VB14.als");
+ talk_vonBraun(13);
+ talk_vonBraun(14);
pause(10);
- talk(_text[_lang][387], "387.als");
+ talk(387);
}
- talk_vb(_textvb[_lang][15], "VB15.als");
- lleva_vb(42);
- sentido_vb = 1;
- talk_vb(_textvb[_lang][16], "VB16.als");
- sentido_vb = 2;
- lleva_al_hare(157, 147);
- lleva_al_hare(131, 149);
- sentido_hare = 0;
+ talk_vonBraun(15);
+ placeVonBraun(42);
+ trackVonBraun = 1;
+ talk_vonBraun(16);
+ trackVonBraun = 2;
+ gotoObject(157, 147);
+ gotoObject(131, 149);
+ trackProtagonist = 0;
animation_14_2();
if (flags[25] == 0)
- talk_vb(_textvb[_lang][17], "VB17.als");
+ talk_vonBraun(17);
pause(8);
- sentido_vb = 1;
- talk_vb(_textvb[_lang][18], "VB18.als");
+ trackVonBraun = 1;
+ talk_vonBraun(18);
if (flags[29] == 0)
- animation_23_anexo();
+ animation_23_joined();
else
- animation_23_anexo2();
+ animation_23_joined2();
- sentido_vb = 2;
+ trackVonBraun = 2;
animation_25_2();
- lleva_vb(99);
+ placeVonBraun(99);
if (flags[29] == 0) {
- talk_vb(_textvb[_lang][19], "VB19.als");
+ talk_vonBraun(19);
if (flags[25] == 0) {
- talk_vb(_textvb[_lang][20],"VB20.als");
- if (resta_objeto(7) == 0)
+ talk_vonBraun(20);
+ if (removeObject(kItemMoney) == 0)
flags[30] = 1;
- if (resta_objeto(18) == 0)
+ if (removeObject(kItemTwoCoins) == 0)
flags[31] = 1;
- if (resta_objeto(19) == 0)
+ if (removeObject(kItemOneCoin) == 0)
flags[32] = 1;
}
- talk_vb(_textvb[_lang][21], "VB21.als");
+ talk_vonBraun(21);
} else
animation_27_2();
flags[25] = 1;
- rompo_y_salgo = 1;
+ breakOut = 1;
}
-void DrasculaEngine::animation_23_anexo() {
- int n, p_x = hare_x + 2, p_y = hare_y - 3;
+void DrasculaEngine::animation_23_joined() {
+ int p_x = curX + 2, p_y = curY - 3;
int x[] = {1, 38, 75, 112, 75, 112, 75, 112, 149, 112, 149, 112, 149, 186, 223, 260,
1, 38, 75, 112, 149, 112, 149, 112, 149, 112, 149, 186, 223, 260, 260, 260, 260, 223};
int y[] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 76, 76, 76, 76, 76, 76, 76,
76, 76, 76, 76, 76, 76, 76, 1, 1, 1, 1};
- loadPic("an23.alg");
- decompressPic(dir_hare_fondo, 1);
+ loadPic("an23.alg", backSurface);
- for (n = 0; n < 34; n++) {
- copyRect(p_x, p_y, p_x, p_y, 36, 74, dir_dibujo1, dir_zona_pantalla);
- copyRect(x[n], y[n], p_x, p_y, 36, 74, dir_hare_fondo, dir_zona_pantalla);
+ for (int n = 0; n < 34; n++) {
+ copyRect(p_x, p_y, p_x, p_y, 36, 74, bgSurface, screenSurface);
+ copyRect(x[n], y[n], p_x, p_y, 36, 74, backSurface, screenSurface);
updateRefresh();
- updateScreen(p_x, p_y, p_x, p_y, 36, 74, dir_zona_pantalla);
+ updateScreen(p_x, p_y, p_x, p_y, 36, 74, screenSurface);
pause(5);
}
- loadPic("99.alg");
- decompressPic(dir_hare_fondo, 1);
+ loadPic(99, backSurface);
}
-void DrasculaEngine::animation_23_anexo2() {
- int n, p_x = hare_x + 4, p_y = hare_y;
+void DrasculaEngine::animation_23_joined2() {
+ int p_x = curX + 4, p_y = curY;
int x[] = {1, 35, 69, 103, 137, 171, 205, 239, 273, 1, 35, 69, 103, 137};
int y[] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 73, 73, 73, 73, 73};
pause(50);
- loadPic("an23_2.alg");
- decompressPic(dir_hare_fondo, 1);
+ loadPic("an23_2.alg", backSurface);
- for (n = 0; n < 14; n++) {
- copyRect(p_x, p_y, p_x, p_y, 33, 71, dir_dibujo1, dir_zona_pantalla);
- copyRect(x[n], y[n], p_x, p_y, 33, 71, dir_hare_fondo, dir_zona_pantalla);
+ for (int n = 0; n < 14; n++) {
+ copyRect(p_x, p_y, p_x, p_y, 33, 71, bgSurface, screenSurface);
+ copyRect(x[n], y[n], p_x, p_y, 33, 71, backSurface, screenSurface);
updateRefresh();
- updateScreen(p_x,p_y, p_x,p_y, 33,71, dir_zona_pantalla);
+ updateScreen(p_x,p_y, p_x,p_y, 33,71, screenSurface);
pause(5);
}
- loadPic("99.alg");
- decompressPic(dir_hare_fondo,1);
+ loadPic(99, backSurface);
}
void DrasculaEngine::animation_25_2() {
- int n, pos_cabina[6];
+ int cabinPos[6] = { 150, 6, 69, 0, 158, 161 };
- loadPic("an14_2.alg");
- decompressPic(dir_hare_fondo, 1);
- loadPic("18.alg");
- decompressPic(dir_dibujo1, 1);
-
- pos_cabina[0] = 150;
- pos_cabina[1] = 6;
- pos_cabina[2] = 69;
- pos_cabina[3] = 0;
- pos_cabina[4] = 158;
- pos_cabina[5] = 161;
+ loadPic("an14_2.alg", backSurface);
+ loadPic(18, bgSurface);
flags[24] = 0;
- comienza_sound("s6.als");
+ playSound(6);
- for (n = 0; n >= -160; n = n - 8) {
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ for (int n = 0; n >= -160; n = n - 8) {
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
updateRefresh_pre();
- pon_hare();
- pon_vb();
+ moveCharacters();
+ moveVonBraun();
- pos_cabina[3] = n;
+ cabinPos[3] = n;
- copyRectClip(pos_cabina, dir_hare_fondo, dir_zona_pantalla);
+ copyRectClip(cabinPos, backSurface, screenSurface);
updateRefresh();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateScreen();
}
- fin_sound();
+ finishSound();
- loadPic("99.alg");
- decompressPic(dir_hare_fondo, 1);
+ loadPic(99, backSurface);
}
void DrasculaEngine::animation_27_2() {
flags[22] = 1;
- sin_verbo();
- resta_objeto(23);
- suma_objeto(11);
+ withoutVerb();
+ removeObject(kItemEarWithEarPlug);
+ addObject(kItemEarplugs);
- talk_vb(_textvb[_lang][23], "VB23.als");
- talk_vb(_textvb[_lang][24], "VB24.als");
+ talk_vonBraun(23);
+ talk_vonBraun(24);
if (flags[30] == 1)
- suma_objeto(7);
+ addObject(kItemMoney);
if (flags[31] == 1)
- suma_objeto(18);
+ addObject(kItemTwoCoins);
if (flags[32] == 1)
- suma_objeto(19);
- talk_vb(_textvb[_lang][25],"VB25.als");
- talk_vb(_textvb[_lang][26],"VB26.als");
+ addObject(kItemOneCoin);
+ talk_vonBraun(25);
+ talk_vonBraun(26);
}
void DrasculaEngine::animation_28_2() {
- talk_vb(_textvb[_lang][27], "VB27.als");
- talk_vb(_textvb[_lang][28], "VB28.als");
- talk_vb(_textvb[_lang][29], "VB29.als");
- talk_vb(_textvb[_lang][30], "VB30.als");
+ for(int i = 27; i <= 30; i++)
+ talk_vonBraun(i);
}
void DrasculaEngine::animation_29_2() {
if (flags[33] == 0) {
- talk_vb(_textvb[_lang][32], "VB32.als");
- talk(_text[_lang][398], "398.als");
- talk_vb(_textvb[_lang][33], "VB33.als");
- talk(_text[_lang][399], "399.als");
- talk_vb(_textvb[_lang][34], "VB34.als");
- talk_vb(_textvb[_lang][35], "VB35.als");
- talk(_text[_lang][400], "400.als");
- talk_vb(_textvb[_lang][36], "VB36.als");
- talk_vb(_textvb[_lang][37], "VB37.als");
- talk(_text[_lang][386], "386.als");
- talk_vb(_textvb[_lang][38], "VB38.als");
- talk_vb(_textvb[_lang][39], "VB39.als");
- talk(_text[_lang][401], "401.als");
- talk_vb(_textvb[_lang][40], "VB40.als");
- talk_vb(_textvb[_lang][41], "VB41.als");
+ talk_vonBraun(32);
+ talk(398);
+ talk_vonBraun(33);
+ talk(399);
+ talk_vonBraun(34);
+ talk_vonBraun(35);
+ talk(400);
+ talk_vonBraun(36);
+ talk_vonBraun(37);
+ talk(386);
+ talk_vonBraun(38);
+ talk_vonBraun(39);
+ talk(401);
+ talk_vonBraun(40);
+ talk_vonBraun(41);
flags[33] = 1;
} else
- talk_vb(_textvb[_lang][43], "VB43.als");
+ talk_vonBraun(43);
- talk(_text[_lang][402], "402.als");
- talk_vb(_textvb[_lang][42], "VB42.als");
+ talk(402);
+ talk_vonBraun(42);
if (flags[38] == 0) {
- talk(_text[_lang][403], "403.als");
- rompo_y_salgo = 1;
+ talk(403);
+ breakOut = 1;
} else
- talk(_text[_lang][386], "386.als");
+ talk(386);
}
void DrasculaEngine::animation_30_2() {
- talk_vb(_textvb[_lang][31], "VB31.als");
- talk(_text[_lang][396], "396.als");
+ talk_vonBraun(31);
+ talk(396);
}
void DrasculaEngine::animation_31_2() {
- talk_vb(_textvb[_lang][44], "VB44.als");
- lleva_vb(-50);
+ talk_vonBraun(44);
+ placeVonBraun(-50);
pause(15);
- lleva_al_hare(159, 140);
- loadPic("99.alg");
- decompressPic(dir_hare_fondo, 1);
- sentido_hare = 2;
+ gotoObject(159, 140);
+ loadPic(99, backSurface);
+ trackProtagonist = 2;
updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateScreen();
pause(78);
- sentido_hare = 0;
+ trackProtagonist = 0;
updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateScreen();
pause(22);
- talk(_text[_lang][406], "406.als");
- lleva_vb(98);
- talk_vb(_textvb[_lang][45], "VB45.als");
- talk_vb(_textvb[_lang][46], "VB46.als");
- talk_vb(_textvb[_lang][47], "VB47.als");
- talk(_text[_lang][407], "407.als");
- talk_vb(_textvb[_lang][48], "VB48.als");
- talk_vb(_textvb[_lang][49], "VB49.als");
- talk(_text[_lang][408], "408.als");
- talk_vb(_textvb[_lang][50], "VB50.als");
- talk_vb(_textvb[_lang][51], "VB51.als");
- talk(_text[_lang][409], "409.als");
- talk_vb(_textvb[_lang][52], "VB52.als");
- talk_vb(_textvb[_lang][53], "VB53.als");
+ talk(406);
+ placeVonBraun(98);
+ talk_vonBraun(45);
+ talk_vonBraun(46);
+ talk_vonBraun(47);
+ talk(407);
+ talk_vonBraun(48);
+ talk_vonBraun(49);
+ talk(408);
+ talk_vonBraun(50);
+ talk_vonBraun(51);
+ talk(409);
+ talk_vonBraun(52);
+ talk_vonBraun(53);
pause(12);
- talk_vb(_textvb[_lang][54], "VB54.als");
- talk_vb(_textvb[_lang][55], "VB55.als");
- talk(_text[_lang][410], "410.als");
- talk_vb(_textvb[_lang][56], "VB56.als");
+ talk_vonBraun(54);
+ talk_vonBraun(55);
+ talk(410);
+ talk_vonBraun(56);
- rompo_y_salgo = 1;
+ breakOut = 1;
flags[38] = 0;
flags[36] = 1;
- sin_verbo();
- resta_objeto(8);
- resta_objeto(13);
- resta_objeto(15);
- resta_objeto(16);
- resta_objeto(17);
- suma_objeto(20);
+ withoutVerb();
+ removeObject(kItemLeaves);
+ removeObject(kItemBubbleGum);
+ removeObject(kItemTissues);
+ removeObject(kItemCigarettes);
+ removeObject(kItemCandle);
+ addObject(kItemReefer);
}
void DrasculaEngine::animation_35_2() {
- int n, x = 0;
-
- lleva_al_hare(96, 165);
- lleva_al_hare(79, 165);
+ gotoObject(96, 165);
+ gotoObject(79, 165);
updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateScreen();
- loadPic("an35_1.alg");
- decompressPic(dir_hare_fondo, 1);
- loadPic("an35_2.alg");
- decompressPic(dir_hare_frente, 1);
+ loadPic("an35_1.alg", backSurface);
+ loadPic("an35_2.alg", frontSurface);
- for (n = 0; n < 6; n++) {
- x++;
- copyBackground(x, 1, 70, 90, 46, 80, dir_hare_fondo, dir_zona_pantalla);
- updateScreen(70,90, 70,90, 46,80,dir_zona_pantalla);
- x = x + 46;
- pause(3);
- }
+ updateAnim(1, 70, 90, 46, 80, 6, backSurface);
+ updateAnim(82, 70, 90, 46, 80, 6, backSurface);
+ updateAnim(1, 70, 90, 46, 80, 6, frontSurface);
+ updateAnim(82, 70, 90, 46, 80, 2, frontSurface);
- x = 0;
- for (n = 0; n < 6; n++) {
- x++;
- copyBackground(x, 82, 70, 90, 46, 80, dir_hare_fondo, dir_zona_pantalla);
- updateScreen(70, 90, 70, 90, 46, 80, dir_zona_pantalla);
- x = x + 46;
- pause(3);
- }
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
- x = 0;
- for (n = 0; n < 6; n++) {
- x++;
- copyBackground(x, 1, 70, 90, 46, 80, dir_hare_frente, dir_zona_pantalla);
- updateScreen(70, 90, 70, 90, 46, 80, dir_zona_pantalla);
-
- x = x + 46;
-
- pause(3);
- }
-
- x = 0;
- for (n = 0; n < 2; n++) {
- x++;
- copyBackground(x, 82, 70, 90, 46, 80, dir_hare_frente, dir_zona_pantalla);
- updateScreen(70, 90, 70,90, 46, 80,dir_zona_pantalla);
- x = x + 46;
- pause(3);
- }
-
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
-
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateScreen();
pause(19);
- comienza_sound("s1.als");
+ playSound(1);
hipo_sin_nadie(18);
- fin_sound();
+ finishSound();
pause(10);
- FundeAlNegro(2);
+ fadeToBlack(2);
}
void DrasculaEngine::animation_1_3() {
- talk(_text[_lang][413], "413.als");
+ talk(413);
grr();
pause(50);
- talk(_text[_lang][414], "414.als");
+ talk(414);
}
void DrasculaEngine::animation_2_3() {
flags[0] = 1;
- playmusic(13);
+ playMusic(13);
animation_3_3();
- playmusic(13);
+ playMusic(13);
animation_4_3();
flags[1] = 1;
updateRoom();
- updateScreen(120, 0, 120, 0, 200, 200, dir_zona_pantalla);
+ updateScreen(120, 0, 120, 0, 200, 200, screenSurface);
animation_5_3();
flags[0] = 0;
flags[1] = 1;
- loadPic("96.alg");
- decompressPic(dir_hare_frente, 1);
- loadPic("97.alg");
- decompressPic(dir_hare_dch, 1);
- loadPic("99.alg");
- decompressPic(dir_hare_fondo, 1);
+ loadPic(96, frontSurface);
+ loadPic(97, extraSurface);
+ loadPic(99, backSurface);
- lleva_al_hare(332, 127);
+ gotoObject(332, 127);
}
void DrasculaEngine::animation_3_3() {
- int n, x = 0;
- int px = hare_x - 20, py = hare_y - 1;
-
- loadPic("an2y_1.alg");
- decompressPic(dir_hare_frente, 1);
- loadPic("an2y_2.alg");
- decompressPic(dir_hare_dch, 1);
- loadPic("an2y_3.alg");
- decompressPic(dir_hare_fondo, 1);
+ int px = curX - 20, py = curY - 1;
- for (n = 0; n < 4; n++) {
- x++;
- copyBackground(px, py, px, py, 71, 72, dir_dibujo1, dir_zona_pantalla);
- copyRect(x, 2, px, py, 71, 72, dir_hare_frente, dir_zona_pantalla);
- updateScreen(px, py, px, py, 71, 72, dir_zona_pantalla);
- x = x + 71;
- pause(3);
- }
+ loadPic("an2y_1.alg", frontSurface);
+ loadPic("an2y_2.alg", extraSurface);
+ loadPic("an2y_3.alg", backSurface);
- x = 0;
-
- for (n = 0; n < 4; n++) {
- x++;
- copyBackground(px, py, px, py, 71, 72, dir_dibujo1, dir_zona_pantalla);
- copyRect(x, 75, px, py, 71, 72, dir_hare_frente, dir_zona_pantalla);
- updateScreen(px, py, px, py, 71, 72, dir_zona_pantalla);
- x = x + 71;
- pause(3);
- }
-
- x = 0;
-
- for (n = 0; n < 4; n++) {
- x++;
- copyBackground(px, py, px, py, 71, 72, dir_dibujo1, dir_zona_pantalla);
- copyRect(x, 2, px, py, 71, 72, dir_hare_dch, dir_zona_pantalla);
- updateScreen(px, py, px, py, 71, 72, dir_zona_pantalla);
- x = x + 71;
- pause(3);
- }
-
- x = 0;
-
- for (n = 0; n < 4; n++) {
- x++;
- copyBackground(px, py, px, py, 71, 72, dir_dibujo1, dir_zona_pantalla);
- copyRect(x, 75, px, py, 71, 72, dir_hare_dch, dir_zona_pantalla);
- updateScreen(px, py, px, py, 71, 72, dir_zona_pantalla);
- x = x + 71;
- pause(3);
- }
-
- x = 0;
-
- for (n = 0; n < 4; n++) {
- x++;
- copyBackground(px, py, px, py, 71, 72, dir_dibujo1, dir_zona_pantalla);
- copyRect(x, 2, px, py, 71, 72, dir_hare_fondo, dir_zona_pantalla);
- updateScreen(px, py, px, py, 71, 72, dir_zona_pantalla);
- x = x + 71;
- pause(3);
- }
-
- x = 0;
-
- for (n = 0; n < 4; n++) {
- x++;
- copyBackground(px, py, px, py, 71, 72, dir_dibujo1, dir_zona_pantalla);
- copyRect(x, 75, px, py, 71, 72, dir_hare_fondo, dir_zona_pantalla);
- updateScreen(px, py, px, py, 71, 72, dir_zona_pantalla);
- x = x + 71;
- pause(3);
- }
+ updateAnim2(2, px, py, 71, 72, 4, frontSurface);
+ updateAnim2(75, px, py, 71, 72, 4, frontSurface);
+ updateAnim2(2, px, py, 71, 72, 4, extraSurface);
+ updateAnim2(75, px, py, 71, 72, 4, extraSurface);
+ updateAnim2(2, px, py, 71, 72, 4, backSurface);
+ updateAnim2(75, px, py, 71, 72, 4, backSurface);
}
void DrasculaEngine::animation_4_3() {
- int n, x = 0;
int px = 120, py = 63;
- loadPic("any_1.alg");
- decompressPic(dir_hare_frente, 1);
- loadPic("any_2.alg");
- decompressPic(dir_hare_dch, 1);
- loadPic("any_3.alg");
- decompressPic(dir_hare_fondo, 1);
+ loadPic("any_1.alg", frontSurface);
+ loadPic("any_2.alg", extraSurface);
+ loadPic("any_3.alg", backSurface);
- for (n = 0; n < 4; n++){
- x++;
- copyBackground(px, py, px, py, 77, 89, dir_dibujo1, dir_zona_pantalla);
- copyRect(x, 1, px, py, 77, 89, dir_hare_frente, dir_zona_pantalla);
- updateScreen(px, py, px, py, 77, 89, dir_zona_pantalla);
- x = x + 77;
- pause(3);
- }
-
- x = 0;
-
- for (n = 0; n < 4; n++) {
- x++;
- copyBackground(px, py, px, py, 77, 89, dir_dibujo1, dir_zona_pantalla);
- copyRect(x, 91, px, py, 77, 89, dir_hare_frente, dir_zona_pantalla);
- updateScreen(px, py, px, py, 77, 89, dir_zona_pantalla);
- x = x + 77;
- pause(3);
- }
-
- x = 0;
-
- for (n = 0; n < 4; n++) {
- x++;
- copyBackground(px, py, px, py, 77, 89, dir_dibujo1, dir_zona_pantalla);
- copyRect(x, 1, px, py, 77, 89, dir_hare_dch, dir_zona_pantalla);
- updateScreen(px, py, px, py, 77, 89, dir_zona_pantalla);
- x = x + 77;
- pause(3);
- }
-
- x = 0;
-
- for (n = 0; n < 4; n++) {
- x++;
- copyBackground(px, py, px, py, 77, 89, dir_dibujo1, dir_zona_pantalla);
- copyRect(x, 91, px, py, 77, 89, dir_hare_dch, dir_zona_pantalla);
- updateScreen(px, py, px, py, 77, 89, dir_zona_pantalla);
- x = x + 77;
- pause(3);
- }
-
- x = 0;
-
- for (n = 0; n < 4; n++) {
- x++;
- copyBackground(px, py, px, py, 77, 89, dir_dibujo1, dir_zona_pantalla);
- copyRect(x, 1, px, py, 77, 89, dir_hare_fondo, dir_zona_pantalla);
- updateScreen(px, py, px, py, 77, 89, dir_zona_pantalla);
- x = x + 77;
- pause(3);
- }
-
- x = 0;
-
- for (n = 0; n < 4; n++) {
- x++;
- copyBackground(px, py, px, py, 77, 89, dir_dibujo1, dir_zona_pantalla);
- copyRect(x, 91, px, py, 77, 89, dir_hare_fondo, dir_zona_pantalla);
- updateScreen(px, py, px, py, 77, 89, dir_zona_pantalla);
- x = x + 77;
- pause(3);
- }
+ updateAnim2(1, px, py, 77, 89, 4, frontSurface);
+ updateAnim2(91, px, py, 77, 89, 4, frontSurface);
+ updateAnim2(1, px, py, 77, 89, 4, extraSurface);
+ updateAnim2(91, px, py, 77, 89, 4, extraSurface);
+ updateAnim2(1, px, py, 77, 89, 4, backSurface);
+ updateAnim2(91, px, py, 77, 89, 4, backSurface);
}
void DrasculaEngine::animation_5_3() {
- int n, x = 0;
- int px = hare_x - 20, py = hare_y - 1;
-
- loadPic("an3y_1.alg");
- decompressPic(dir_hare_frente, 1);
- loadPic("an3y_2.alg");
- decompressPic(dir_hare_dch, 1);
- loadPic("an3y_3.alg");
- decompressPic(dir_hare_fondo, 1);
-
- for (n = 0; n < 4; n++) {
- x++;
- copyBackground(px, py, px, py, 71, 72, dir_dibujo1, dir_zona_pantalla);
- copyRect(x, 2, px, py, 71, 72, dir_hare_frente, dir_zona_pantalla);
- updateScreen(px, py, px, py, 71, 72, dir_zona_pantalla);
- x = x + 71;
- pause(3);
- }
-
- x = 0;
-
- for (n = 0; n < 4; n++) {
- x++;
- copyBackground(px, py, px, py, 71, 72, dir_dibujo1, dir_zona_pantalla);
- copyRect(x, 75, px, py, 71, 72, dir_hare_frente, dir_zona_pantalla);
- updateScreen(px, py, px, py, 71, 72, dir_zona_pantalla);
- x = x + 71;
- pause(3);
- }
-
- x = 0;
-
- for (n = 0; n < 4; n++) {
- x++;
- copyBackground(px, py, px, py, 71, 72, dir_dibujo1, dir_zona_pantalla);
- copyRect(x, 2, px, py, 71, 72, dir_hare_dch, dir_zona_pantalla);
- updateScreen(px, py, px, py, 71, 72, dir_zona_pantalla);
- x = x + 71;
- pause(3);
- }
-
- x = 0;
-
- for (n = 0; n < 4; n++) {
- x++;
- copyBackground(px, py, px, py, 71, 72, dir_dibujo1, dir_zona_pantalla);
- copyRect(x, 75, px, py, 71, 72, dir_hare_dch, dir_zona_pantalla);
- updateScreen(px,py, px,py, 71,72, dir_zona_pantalla);
- x = x + 71;
- pause(3);
- }
+ int px = curX - 20, py = curY - 1;
- x = 0;
+ loadPic("an3y_1.alg", frontSurface);
+ loadPic("an3y_2.alg", extraSurface);
+ loadPic("an3y_3.alg", backSurface);
- for (n = 0; n < 4; n++) {
- x++;
- copyBackground(px, py, px, py, 71, 72, dir_dibujo1, dir_zona_pantalla);
- copyRect(x, 2, px, py, 71, 72, dir_hare_fondo, dir_zona_pantalla);
- updateScreen(px, py, px, py, 71, 72, dir_zona_pantalla);
- x = x + 71;
- pause(3);
- }
-
- x = 0;
-
- for (n = 0; n < 4; n++) {
- x++;
- copyBackground(px, py, px, py, 71, 72, dir_dibujo1, dir_zona_pantalla);
- copyRect(x, 75, px, py, 71, 72, dir_hare_fondo, dir_zona_pantalla);
- updateScreen(px, py, px, py, 71, 72, dir_zona_pantalla);
- x = x + 71;
- pause(3);
- }
+ updateAnim2(2, px, py, 71, 72, 4, frontSurface);
+ updateAnim2(75, px, py, 71, 72, 4, frontSurface);
+ updateAnim2(2, px, py, 71, 72, 4, extraSurface);
+ updateAnim2(75, px, py, 71, 72, 4, extraSurface);
+ updateAnim2(2, px, py, 71, 72, 4, backSurface);
+ updateAnim2(75, px, py, 71, 72, 4, backSurface);
}
void DrasculaEngine::animation_6_3() {
@@ -1713,288 +1381,272 @@ void DrasculaEngine::animation_6_3() {
int yoda_x[] = { 3 ,82, 161, 240, 3, 82 };
int yoda_y[] = { 3, 3, 3, 3, 94, 94 };
- hare_se_mueve = 0;
+ characterMoved = 0;
flags[3] = 1;
updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateScreen();
flags[1] = 0;
- loadPic("an4y.alg");
- decompressPic(dir_hare_frente, 1);
+ loadPic("an4y.alg", frontSurface);
for (frame = 0; frame < 6; frame++) {
pause(3);
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- copyRect(yoda_x[frame], yoda_y[frame], px, py, 78, 90, dir_hare_frente, dir_zona_pantalla);
- updateScreen(px, py, px, py, 78, 90, dir_zona_pantalla);
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
+ copyRect(yoda_x[frame], yoda_y[frame], px, py, 78, 90, frontSurface, screenSurface);
+ updateScreen(px, py, px, py, 78, 90, screenSurface);
}
flags[2] = 1;
- loadPic("96.alg");
- decompressPic(dir_hare_frente, 1);
+ loadPic(96, frontSurface);
updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateScreen();
}
-void DrasculaEngine::animation_rayo() {
- loadPic("anr_1.alg");
- decompressPic(dir_hare_frente, MEDIA);
- loadPic("anr_2.alg");
- decompressPic(dir_hare_dch, 1);
- loadPic("anr_3.alg");
- decompressPic(dir_hare_fondo, 1);
- loadPic("anr_4.alg");
- decompressPic(dir_dibujo1, 1);
- loadPic("anr_5.alg");
- decompressPic(dir_dibujo3, 1);
+void DrasculaEngine::animation_ray() {
+ loadPic("anr_1.alg", frontSurface, HALF_PAL);
+ loadPic("anr_2.alg", extraSurface);
+ loadPic("anr_3.alg", backSurface);
+ loadPic("anr_4.alg", bgSurface);
+ loadPic("anr_5.alg", drawSurface3);
- updateScreen(0, 0, 0, 0, 320, 200, dir_hare_frente);
+ updateScreen(0, 0, 0, 0, 320, 200, frontSurface);
pause(50);
- comienza_sound("s5.als");
+ playSound(5);
- updateScreen(0, 0, 0, 0, 320, 200, dir_hare_dch);
+ updateScreen(0, 0, 0, 0, 320, 200, extraSurface);
pause(3);
- updateScreen(0, 0, 0, 0, 320, 200, dir_hare_fondo);
+ updateScreen(0, 0, 0, 0, 320, 200, backSurface);
pause(3);
- updateScreen(0, 0, 0, 0, 320, 200, dir_dibujo1);
+ updateScreen(0, 0, 0, 0, 320, 200, bgSurface);
pause(3);
- updateScreen(0, 0, 0, 0, 320, 200, dir_hare_fondo);
+ updateScreen(0, 0, 0, 0, 320, 200, backSurface);
pause(3);
- updateScreen(0, 0, 0, 0, 320, 200, dir_dibujo3);
+ updateScreen(0, 0, 0, 0, 320, 200, drawSurface3);
pause(3);
- updateScreen(0, 0, 0, 0, 320, 200, dir_hare_frente);
- fin_sound();
+ updateScreen(0, 0, 0, 0, 320, 200, frontSurface);
+ finishSound();
}
void DrasculaEngine::animation_2_4() {
- talk_igor_sentado(_texti[_lang][16], "I16.als");
- talk(_text[_lang][278], "278.als");
- talk_igor_sentado(_texti[_lang][17], "I17.als");
- talk(_text[_lang][279], "279.als");
- talk_igor_sentado(_texti[_lang][18], "I18.als");
+ talk_igor(16, kIgorSeated);
+ talk(278);
+ talk_igor(17, kIgorSeated);
+ talk(279);
+ talk_igor(18, kIgorSeated);
}
void DrasculaEngine::animation_3_4() {
- talk_igor_sentado(_texti[_lang][19], "I19.als");
- talk_igor_sentado(_texti[_lang][20], "I20.als");
- talk(_text[_lang][281], "281.als");
+ talk_igor(19, kIgorSeated);
+ talk_igor(20, kIgorSeated);
+ talk(281);
}
void DrasculaEngine::animation_4_4() {
- talk(_text[_lang][287], "287.als");
- talk_igor_sentado(_texti[_lang][21], "I21.als");
- talk(_text[_lang][284], "284.als");
- talk_igor_sentado(_texti[_lang][22], "I22.als");
- talk(_text[_lang][285], "285.als");
- talk_igor_sentado(_texti[_lang][23], "I23.als");
+ talk(287);
+ talk_igor(21, kIgorSeated);
+ talk(284);
+ talk_igor(22, kIgorSeated);
+ talk(285);
+ talk_igor(23, kIgorSeated);
}
void DrasculaEngine::animation_7_4() {
- Negro();
- talk(_text[_lang][427], "427.als");
- FundeDelNegro(1);
- resta_objeto(8);
- resta_objeto(10);
- resta_objeto(12);
- resta_objeto(16);
- suma_objeto(17);
+ black();
+ talk(427);
+ fadeFromBlack(1);
+ removeObject(8);
+ removeObject(10);
+ removeObject(12);
+ removeObject(16);
+ addObject(17);
flags[30] = 0;
flags[29] = 0;
}
void DrasculaEngine::animation_1_5() {
if (flags[0] == 0) {
- talk(_text[_lang][430], "430.als");
- talk_bj(_textbj[_lang][16], "BJ16.als");
- talk_bj(_textbj[_lang][17], "BJ17.als");
- talk_bj(_textbj[_lang][18], "BJ18.als");
- talk(_text[_lang][217], "217.als");
- talk_bj(_textbj[_lang][19], "BJ19.als");
- talk(_text[_lang][229], "229.als");
+ talk(430);
+ talk_bj(16);
+ talk_bj(17);
+ talk_bj(18);
+ talk(217);
+ talk_bj(19);
+ talk(229);
pause(5);
- lleva_al_hare(114, 170);
- sentido_hare = 3;
- talk(_text[_lang][431], "431.als");
- talk_bj(_textbj[_lang][20], "BJ20.als");
- sentido_hare = 2;
+ gotoObject(114, 170);
+ trackProtagonist = 3;
+ talk(431);
+ talk_bj(20);
+ trackProtagonist = 2;
pause(4);
- talk(_text[_lang][438], "438.als");
- sitio_x = 120;
- sitio_y = 157;
- anda_a_objeto = 1;
- sentido_final = 1;
- empieza_andar();
- talk_bj(_textbj[_lang][21], "BJ21.als");
+ talk(438);
+ roomX = 120;
+ roomY = 157;
+ walkToObject = 1;
+ trackFinal = 1;
+ startWalking();
+ talk_bj(21);
for (;;) {
- if (hare_se_mueve == 0)
+ if (characterMoved == 0)
break;
updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateScreen();
}
- sentido_hare = 1;
- talk(_text[_lang][229], "229.als");
+ trackProtagonist = 1;
+ talk(229);
flags[0] = 1;
}
- sentido_hare = 1;
- conversa("op_8.cal");
+ trackProtagonist = 1;
+ converse(8);
}
void DrasculaEngine::animation_2_5() {
- talk_bj(_textbj[_lang][22], "BJ22.als");
+ talk_bj(22);
}
void DrasculaEngine::animation_3_5() {
- talk_bj(_textbj[_lang][23], "BJ23.als");
- agarra_objeto(10);
- rompo_y_salgo = 1;
+ talk_bj(23);
+ pickObject(10);
+ breakOut = 1;
}
void DrasculaEngine::animation_4_5() {
flags[7] = 1;
updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- talk(_text[_lang][228], "228.als");
- talk_lobo(_textl[_lang][1], "L1.als");
- talk_lobo(_textl[_lang][2], "L2.als");
+ updateScreen();
+ talk(228);
+ talk_werewolf(1);
+ talk_werewolf(2);
pause(23);
- talk(_text[_lang][229], "229.als");
- talk_lobo(_textl[_lang][3], "L3.als");
- talk_lobo(_textl[_lang][4], "L4.als");
- talk(_text[_lang][230], "230.als");
- talk_lobo(_textl[_lang][5], "L5.als");
- talk(_text[_lang][231], "231.als");
- talk_lobo(_textl[_lang][6], "L6.als");
- talk_lobo(_textl[_lang][7], "L7.als");
+ talk(229);
+ talk_werewolf(3);
+ talk_werewolf(4);
+ talk(230);
+ talk_werewolf(5);
+ talk(231);
+ talk_werewolf(6);
+ talk_werewolf(7);
pause(33);
- talk(_text[_lang][232], "232.als");
- talk_lobo(_textl[_lang][8], "L8.als");
+ talk(232);
+ talk_werewolf(8);
}
void DrasculaEngine::animation_5_5(){
int h;
int frame = 0;
- int hueso_x[] = {1, 99, 197, 1, 99, 197, 1, 99, 197};
- int hueso_y[] = {1, 1, 1, 66, 66, 66, 131, 131, 131};
- int vuela_x[] = {1, 63, 125, 187, 249};
- int pixel_x = hare_x - 53, pixel_y = hare_y - 9;
+ int boneX[] = {1, 99, 197, 1, 99, 197, 1, 99, 197};
+ int boneY[] = {1, 1, 1, 66, 66, 66, 131, 131, 131};
+ int flyX[] = {1, 63, 125, 187, 249};
+ int pixelX = curX - 53, pixelY = curY - 9;
- sin_verbo();
- resta_objeto(8);
+ withoutVerb();
+ removeObject(8);
- lleva_al_hare(hare_x - 19, hare_y + alto_hare);
- sentido_hare = 1;
+ gotoObject(curX - 19, curY + curHeight);
+ trackProtagonist = 1;
updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateScreen();
- loadPic("3an5_1.alg");
- decompressPic(dir_hare_fondo, 1);
- loadPic("3an5_2.alg");
- decompressPic(dir_hare_frente, 1);
+ loadPic("3an5_1.alg", backSurface);
+ loadPic("3an5_2.alg", frontSurface);
for (frame = 0; frame < 9; frame++) {
pause(3);
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- copyRect(hueso_x[frame], hueso_y[frame], pixel_x, pixel_y, 97, 64, dir_hare_fondo, dir_zona_pantalla);
- updateScreen(pixel_x, pixel_y, pixel_x,pixel_y, 97,64, dir_zona_pantalla);
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
+ copyRect(boneX[frame], boneY[frame], pixelX, pixelY, 97, 64, backSurface, screenSurface);
+ updateScreen(pixelX, pixelY, pixelX,pixelY, 97,64, screenSurface);
}
- copyBackground(52, 161, 198, 81, 26, 24, dir_dibujo3, dir_zona_pantalla);
- updateScreen(198, 81, 198, 81, 26, 24, dir_zona_pantalla);
+ copyBackground(52, 161, 198, 81, 26, 24, drawSurface3, screenSurface);
+ updateScreen(198, 81, 198, 81, 26, 24, screenSurface);
for (frame = 0; frame < 9; frame++) {
pause(3);
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- copyRect(hueso_x[frame], hueso_y[frame], pixel_x, pixel_y, 97, 64, dir_hare_frente, dir_zona_pantalla);
- updateScreen(pixel_x, pixel_y, pixel_x,pixel_y, 97, 64, dir_zona_pantalla);
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
+ copyRect(boneX[frame], boneY[frame], pixelX, pixelY, 97, 64, frontSurface, screenSurface);
+ updateScreen(pixelX, pixelY, pixelX,pixelY, 97, 64, screenSurface);
}
flags[6] = 1;
- actualiza_datos();
+ updateVisible();
pause(12);
- loadPic("96.alg");
- decompressPic(dir_hare_frente, 1);
+ loadPic(96, frontSurface);
for (h = 0; h < (200 - 18); h++)
- copyBackground(0, 53, 0, h, 320, 19, dir_hare_frente, dir_zona_pantalla);
+ copyBackground(0, 53, 0, h, 320, 19, frontSurface, screenSurface);
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateScreen();
- loadPic("101.alg");
- decompressPic(dir_dibujo1, MEDIA);
- loadPic("3an5_3.alg");
- decompressPic(dir_hare_fondo, 1);
- loadPic("3an5_4.alg");
- decompressPic(dir_hare_dch, 1);
+ loadPic(101, bgSurface, HALF_PAL);
+ loadPic("3an5_3.alg", backSurface);
+ loadPic("3an5_4.alg", extraSurface);
- updateScreen(0, 0, 0, 0, 320, 200, dir_dibujo1);
+ updateScreen(0, 0, 0, 0, 320, 200, bgSurface);
pause(9);
for (frame = 0; frame < 5; frame++) {
pause(3);
- copyBackground(vuela_x[frame], 1, 174, 79, 61, 109, dir_hare_fondo, dir_zona_pantalla);
- updateScreen(174, 79, 174, 79, 61, 109, dir_zona_pantalla);
+ copyBackground(flyX[frame], 1, 174, 79, 61, 109, backSurface, screenSurface);
+ updateScreen(174, 79, 174, 79, 61, 109, screenSurface);
}
for (frame = 0; frame < 5; frame++) {
pause(3);
- copyBackground(vuela_x[frame], 1, 174, 79, 61, 109, dir_hare_dch, dir_zona_pantalla);
- updateScreen(174, 79, 174, 79, 61, 109, dir_zona_pantalla);
+ copyBackground(flyX[frame], 1, 174, 79, 61, 109, extraSurface, screenSurface);
+ updateScreen(174, 79, 174, 79, 61, 109, screenSurface);
}
- updateScreen(0, 0, 0, 0, 320, 200, dir_dibujo1);
+ updateScreen(0, 0, 0, 0, 320, 200, bgSurface);
- comienza_sound("s1.als");
- fin_sound();
+ playSound(1);
+ finishSound();
- loadPic("99.alg");
- decompressPic(dir_hare_fondo, 1);
- loadPic("97.alg");
- decompressPic(dir_hare_dch, 1);
+ loadPic(99, backSurface);
+ loadPic(97, extraSurface);
clearRoom();
- loadPic("49.alg");
- decompressPic(dir_dibujo1, MEDIA);
+ loadPic(49, bgSurface, HALF_PAL);
}
void DrasculaEngine::animation_6_5() {
- talk_lobo(_textl[_lang][9], "L9.als");
- talk(_text[_lang][234], "234.als");
+ talk_werewolf(9);
+ talk(234);
}
void DrasculaEngine::animation_7_5() {
- talk_lobo(_textl[_lang][10], "L10.als");
- talk(_text[_lang][236], "236.als");
- talk_lobo(_textl[_lang][11], "L11.als");
- talk_lobo(_textl[_lang][12], "L12.als");
- talk_lobo(_textl[_lang][13], "L13.als");
+ talk_werewolf(10);
+ talk(236);
+ talk_werewolf(11);
+ talk_werewolf(12);
+ talk_werewolf(13);
pause(34);
- talk_lobo(_textl[_lang][14], "L14.als");
+ talk_werewolf(14);
}
void DrasculaEngine::animation_8_5() {
- talk_lobo(_textl[_lang][15], "L15.als");
- talk(_text[_lang][238], "238.als");
- talk_lobo(_textl[_lang][16], "L16.als");
+ talk_werewolf(15);
+ talk(238);
+ talk_werewolf(16);
}
void DrasculaEngine::animation_9_5() {
flags[4] = 1;
- talk(_text[_lang][401], "401.als");
- sin_verbo();
- resta_objeto(15);
+ talk(401);
+ withoutVerb();
+ removeObject(15);
}
void DrasculaEngine::animation_10_5() {
flags[3] = 1;
- talk(_text[_lang][401], "401.als");
- sin_verbo();
- resta_objeto(12);
+ talk(401);
+ withoutVerb();
+ removeObject(12);
}
void DrasculaEngine::animation_11_5() {
@@ -2003,123 +1655,114 @@ void DrasculaEngine::animation_11_5() {
animation_12_5();
else {
flags[9] = 0;
- talk(_text[_lang][33], "33.als");
+ talk(33);
}
}
void DrasculaEngine::animation_12_5() {
- DacPalette256 palFondo1;
- DacPalette256 palFondo2;
- DacPalette256 palFondo3;
+ DacPalette256 bgPalette1;
+ DacPalette256 bgPalette2;
+ DacPalette256 bgPalette3;
int frame;
- const int rayo_x[] = {1, 46, 91, 136, 181, 226, 271, 181};
+ const int rayX[] = {1, 46, 91, 136, 181, 226, 271, 181};
const int frusky_x[] = {100, 139, 178, 217, 100, 178, 217, 139, 100, 139};
const int elfrusky_x[] = {1, 68, 135, 1, 68, 135, 1, 68, 135, 68, 1, 135, 68, 135, 68};
- //const int humo_x[] = {1, 29, 57, 85, 113, 141, 169, 197, 225};
- int color, componente;
- char fundido;
+ int color, component;
+ char fade;
- playmusic(26);
+ playMusic(26);
updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateScreen();
pause(27);
- anima("rayo1.bin", 23);
- comienza_sound("s5.als");
- anima("rayo2.bin", 17);
- sentido_hare = 1;
+ animate("rayo1.bin", 23);
+ playSound(5);
+ animate("rayo2.bin", 17);
+ trackProtagonist = 1;
updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateScreen();
- hare_oscuro();
+ setDarkPalette();
for (color = 0; color < 255; color++)
- for (componente = 0; componente < 3; componente++) {
- palFondo1[color][componente] = palJuego[color][componente];
- palFondo2[color][componente] = palJuego[color][componente];
- palFondo3[color][componente] = palJuego[color][componente];
+ for (component = 0; component < 3; component++) {
+ bgPalette1[color][component] = gamePalette[color][component];
+ bgPalette2[color][component] = gamePalette[color][component];
+ bgPalette3[color][component] = gamePalette[color][component];
}
- for (fundido = 1; fundido >= 0; fundido--) {
- for (color = 0; color < 128; color++)
- for (componente = 0; componente < 3; componente++)
- palFondo1[color][componente] = LimitaVGA(palFondo1[color][componente] - 8 + fundido);
- }
-
- for (fundido = 2; fundido >= 0; fundido--) {
- for (color = 0; color < 128; color++)
- for (componente = 0; componente < 3; componente++)
- palFondo2[color][componente] = LimitaVGA(palFondo2[color][componente] - 8 + fundido);
- }
-
- for (fundido = 3; fundido >= 0; fundido--) {
- for (color = 0; color < 128; color++)
- for (componente = 0; componente < 3; componente++)
- palFondo3[color][componente] = LimitaVGA(palFondo3[color][componente] - 8 + fundido);
+ for (fade = 3; fade >= 0; fade--) {
+ for (color = 0; color < 128; color++) {
+ for (component = 0; component < 3; component++) {
+ bgPalette3[color][component] = adjustToVGA(bgPalette3[color][component] - 8 + fade);
+ if (fade <= 2)
+ bgPalette2[color][component] = adjustToVGA(bgPalette2[color][component] - 8 + fade);
+ if (fade <= 1)
+ bgPalette1[color][component] = adjustToVGA(bgPalette1[color][component] - 8 + fade);
+ }
+ }
}
- loadPic("3an11_1.alg");
- decompressPic(dir_hare_fondo, 1);
+ loadPic("3an11_1.alg", backSurface);
for (frame = 0; frame < 8; frame++) {
if (frame == 2 || frame == 4 || frame == 8 || frame==10)
- setvgapalette256((byte *)&palFondo1);
+ setPalette((byte *)&bgPalette1);
else if (frame == 1 || frame == 5 || frame == 7 || frame == 9)
- setvgapalette256((byte *)&palFondo2);
+ setPalette((byte *)&bgPalette2);
else
- setvgapalette256((byte *)&palFondo3);
+ setPalette((byte *)&bgPalette3);
pause(4);
updateRoom();
- copyRect(rayo_x[frame], 1, 41, 0, 44, 44, dir_hare_fondo, dir_zona_pantalla);
- copyRect(frusky_x[frame], 113, 205, 50, 38, 86, dir_dibujo3, dir_zona_pantalla);
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ copyRect(rayX[frame], 1, 41, 0, 44, 44, backSurface, screenSurface);
+ copyRect(frusky_x[frame], 113, 205, 50, 38, 86, drawSurface3, screenSurface);
+ updateScreen();
}
- fin_sound_corte();
+ stopSound();
for (frame = 0; frame < 15; frame++) {
if (frame == 2 || frame == 4 || frame == 7 || frame == 9)
- setvgapalette256((byte *)&palFondo1);
+ setPalette((byte *)&bgPalette1);
else if (frame == 1 || frame == 5)
- setvgapalette256((byte *)&palJuego);
+ setPalette((byte *)&gamePalette);
else
- setvgapalette256((byte *)&palFondo2);
+ setPalette((byte *)&bgPalette2);
pause(4);
updateRoom();
- copyRect(elfrusky_x[frame], 47, 192, 39, 66, 106, dir_hare_fondo, dir_zona_pantalla);
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ copyRect(elfrusky_x[frame], 47, 192, 39, 66, 106, backSurface, screenSurface);
+ updateScreen();
}
- anima("frel.bin", 16);
+ animate("frel.bin", 16);
clearRoom();
- hare_claro();
- ActualizaPaleta();
+ setBrightPalette();
+ setPalette((byte *)&gamePalette);
flags[1] = 1;
animation_13_5();
- comienza_sound("s1.als");
- hipo(12);
- fin_sound();
+ playSound(1);
+ hiccup(12);
+ finishSound();
- loadPic("99.alg");
- decompressPic(dir_hare_fondo, 1);
+ loadPic(99, backSurface);
- lleva_al_hare(40, 169);
- lleva_al_hare(-14, 175);
+ gotoObject(40, 169);
+ gotoObject(-14, 175);
- rompo = 1;
- musica_antes = musica_room;
+ doBreak = 1;
+ previousMusic = roomMusic;
hare_se_ve = 1;
clearRoom();
- sentido_hare = 1;
- hare_se_mueve = 0;
- hare_x = -1;
- obj_saliendo = 104;
- sin_verbo();
- carga_escoba("57.ald");
+ trackProtagonist = 1;
+ characterMoved = 0;
+ curX = -1;
+ objExit = 104;
+ withoutVerb();
+ enterRoom(57);
}
void DrasculaEngine::animation_13_5() {
@@ -2127,38 +1770,31 @@ void DrasculaEngine::animation_13_5() {
int frame = 0;
int frus_x[] = {1, 46, 91, 136, 181, 226, 271};
int frus_y[] = {1, 1, 1, 1, 1, 1, 1, 89};
- int pos_frusky[6];
+ int pos_frusky[6] = { 1, 1, frank_x, 81, 44, 87 };
- loadPic("auxfr.alg");
- decompressPic(dir_hare_fondo, 1);
+ loadPic("auxfr.alg", backSurface);
- pos_frusky[3] = 81;
- pos_frusky[4] = 44;
- pos_frusky[5] = 87;
- pos_frusky[0] = 1;
- pos_frusky[1] = 1;
- pos_frusky[2] = frank_x;
updateRoom();
- copyRectClip(pos_frusky, dir_hare_fondo, dir_zona_pantalla);
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ copyRectClip(pos_frusky, backSurface, screenSurface);
+ updateScreen();
pause(15);
- playmusic(18);
+ playMusic(18);
for (;;) {
updateRoom();
pos_frusky[0] = frus_x[frame];
pos_frusky[1] = frus_y[frame];
pos_frusky[2] = frank_x;
- copyRectClip( pos_frusky, dir_hare_fondo, dir_zona_pantalla);
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- frank_x = frank_x - 5;
+ copyRectClip( pos_frusky, backSurface, screenSurface);
+ updateScreen();
+ frank_x -= 5;
frame++;
if (frank_x <= -45)
break;
if (frame == 7) {
frame = 0;
- sentido_hare = 3;
+ trackProtagonist = 3;
}
pause(6);
}
@@ -2166,153 +1802,143 @@ void DrasculaEngine::animation_13_5() {
void DrasculaEngine::animation_14_5() {
flags[11] = 1;
- comienza_sound("s3.als");
+ playSound(3);
updateRoom();
- updateScreen(0, 0, 0,0 , 320, 200, dir_zona_pantalla);
- fin_sound();
+ updateScreen(0, 0, 0,0 , 320, 200, screenSurface);
+ finishSound();
pause(17);
- sentido_hare = 3;
- talk(_text[_lang][246],"246.als");
- lleva_al_hare(89, 160);
+ trackProtagonist = 3;
+ talk(246);
+ gotoObject(89, 160);
flags[10] = 1;
- comienza_sound("s7.als");
+ playSound(7);
updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- fin_sound();
+ updateScreen();
+ finishSound();
pause(14);
- sentido_hare = 3;
+ trackProtagonist = 3;
updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateScreen();
talk_solo(_textd[_lang][18], "d18.als");
- FundeAlNegro(1);
+ fadeToBlack(1);
}
void DrasculaEngine::animation_15_5() {
- talk_mus(_texte[_lang][4], "E4.als");
- talk_mus(_texte[_lang][5], "E5.als");
- talk_mus(_texte[_lang][6], "E6.als");
- talk(_text[_lang][291], "291.als");
- talk_mus(_texte[_lang][7], "E7.als");
+ talk_mus(4);
+ talk_mus(5);
+ talk_mus(6);
+ talk(291);
+ talk_mus(7);
}
void DrasculaEngine::animation_16_5() {
- talk_mus(_texte[_lang][8], "E8.als");
+ talk_mus(8);
}
void DrasculaEngine::animation_17_5() {
- talk_mus(_texte[_lang][9], "E9.als");
+ talk_mus(9);
}
void DrasculaEngine::animation_1_6() {
- int l;
-
- sentido_hare = 0;
- hare_x = 103;
- hare_y = 108;
+ trackProtagonist = 0;
+ curX = 103;
+ curY = 108;
flags[0] = 1;
- for (l = 0; l < 200; l++)
+ for (int l = 0; l < 200; l++)
factor_red[l] = 98;
- loadPic("auxig2.alg");
- decompressPic(dir_hare_frente, 1);
- loadPic("auxdr.alg");
- decompressPic(dir_dibujo2, 1);
- loadPic("car.alg");
- decompressPic(dir_hare_fondo, 1);
- talk_dr_dch(_textd[_lang][19], "D19.als");
- talk(_text[_lang][247], "247.als");
- talk_dr_dch(_textd[_lang][20], "d20.als");
- talk_dr_dch(_textd[_lang][21], "d21.als");
- talk(_text[_lang][248], "248.als");
- talk_dr_dch(_textd[_lang][22], "d22.als");
- talk(_text[_lang][249], "249.als");
- talk_dr_dch(_textd[_lang][23], "d23.als");
- conversa("op_11.cal");
- talk_dr_dch(_textd[_lang][26], "d26.als");
-
- anima("fum.bin", 15);
-
- talk_dr_dch(_textd[_lang][27], "d27.als");
- talk(_text[_lang][254], "254.als");
- talk_dr_dch(_textd[_lang][28], "d28.als");
- talk(_text[_lang][255], "255.als");
- talk_dr_dch(_textd[_lang][29], "d29.als");
- FundeAlNegro(1);
+ loadPic("auxig2.alg", frontSurface);
+ loadPic("auxdr.alg", drawSurface2);
+ loadPic("car.alg", backSurface);
+ talk_drascula(19, 1);
+ talk(247);
+ talk_drascula(20, 1);
+ talk_drascula(21, 1);
+ talk(248);
+ talk_drascula(22, 1);
+ talk(249);
+ talk_drascula(23, 1);
+ converse(11);
+ talk_drascula(26, 1);
+
+ animate("fum.bin", 15);
+
+ talk_drascula(27, 1);
+ talk(254);
+ talk_drascula(28, 1);
+ talk(255);
+ talk_drascula(29, 1);
+ fadeToBlack(1);
clearRoom();
- loadPic("time1.alg");
- decompressPic(dir_zona_pantalla, 1);
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ loadPic("time1.alg", screenSurface);
+ updateScreen();
delay(930);
clearRoom();
- Negro();
+ black();
hare_se_ve = 0;
flags[0] = 0;
updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- FundeDelNegro(1);
- talk(_text[_lang][256], "256.als");
- talk_dr_dch(_textd[_lang][30], "d30.als");
- talk(_text[_lang][257], "257.als");
- FundeAlNegro(0);
+ updateScreen();
+ fadeFromBlack(1);
+ talk(256);
+ talk_drascula(30, 1);
+ talk(257);
+ fadeToBlack(0);
clearRoom();
- loadPic("time1.alg");
- decompressPic(dir_zona_pantalla,1);
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ loadPic("time1.alg", screenSurface);
+ updateScreen();
delay(900);
clearRoom();
- Negro();
+ black();
updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- FundeDelNegro(1);
- talk(_text[_lang][258], "258.als");
- talk_dr_dch(_textd[_lang][31], "d31.als");
+ updateScreen();
+ fadeFromBlack(1);
+ talk(258);
+ talk_drascula(31, 1);
animation_5_6();
- talk_dr_dch(_textd[_lang][32], "d32.als");
- talk_igor_dch(_texti[_lang][11], "I11.als");
- sentido_igor = 3;
- talk_dr_dch(_textd[_lang][33], "d33.als");
- talk_igor_frente(_texti[_lang][12], "I12.als");
- talk_dr_dch(_textd[_lang][34], "d34.als");
- sentido_dr = 0;
- talk_dr_izq(_textd[_lang][35], "d35.als");
+ talk_drascula(32, 1);
+ talk_igor(11, kIgorDch);
+ trackIgor = 3;
+ talk_drascula(33, 1);
+ talk_igor(12, kIgorFront);
+ talk_drascula(34, 1);
+ trackDrascula = 0;
+ talk_drascula(35);
+
+ if (_lang == kSpanish)
+ textSurface = extraSurface;
+
clearRoom();
- carga_escoba("102.ald");
- activa_pendulo();
+ enterRoom(102);
+ activatePendulum();
}
void DrasculaEngine::animation_2_6() {
- talk_dr_dch(_textd[_lang][24], "d24.als");
+ talk_drascula(24, 1);
}
void DrasculaEngine::animation_3_6() {
- talk_dr_dch(_textd[_lang][24], "d24.als");
+ talk_drascula(24, 1);
}
void DrasculaEngine::animation_4_6() {
- talk_dr_dch(_textd[_lang][25], "d25.als");
+ talk_drascula(25, 1);
}
void DrasculaEngine::animation_5_6() {
- int n, pos_pen[6];
-
- pos_pen[0] = 1;
- pos_pen[1] = 29;
- pos_pen[2] = 204;
- pos_pen[3] = -125;
- pos_pen[4] = 18;
- pos_pen[5] = 125;
+ int pos_pen[6] = { 1, 29, 204, -125, 18, 125 };
- anima("man.bin", 14);
+ animate("man.bin", 14);
- for (n = -125; n <= 0; n = n + 2) {
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ for (int n = -125; n <= 0; n = n + 2) {
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
updateRefresh_pre();
pos_pen[3] = n;
- copyRectClip(pos_pen, dir_dibujo3, dir_zona_pantalla);
+ copyRectClip(pos_pen, drawSurface3, screenSurface);
updateRefresh();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateScreen();
pause(2);
}
@@ -2320,28 +1946,24 @@ void DrasculaEngine::animation_5_6() {
}
void DrasculaEngine::animation_6_6() {
- anima("rct.bin", 11);
+ animate("rct.bin", 11);
clearRoom();
- sin_verbo();
- resta_objeto(20);
- loadPic("96.alg");
- decompressPic(dir_hare_frente, 1);
- loadPic("97.alg");
- decompressPic(dir_hare_frente, 1);
- loadPic("97.alg");
- decompressPic(dir_hare_dch, 1);
- loadPic("99.alg");
- decompressPic(dir_hare_fondo, 1);
- rompo = 1;
- obj_saliendo = 104;
- hare_x = -1;
- sin_verbo();
- carga_escoba("58.ald");
+ withoutVerb();
+ removeObject(20);
+ loadPic(96, frontSurface);
+ loadPic(97, frontSurface);
+ loadPic(97, extraSurface);
+ loadPic(99, backSurface);
+ doBreak = 1;
+ objExit = 104;
+ curX = -1;
+ withoutVerb();
+ enterRoom(58);
hare_se_ve = 1;
- sentido_hare = 1;
- anima("hbp.bin", 14);
+ trackProtagonist = 1;
+ animate("hbp.bin", 14);
- sentido_hare = 3;
+ trackProtagonist = 3;
flags[0] = 1;
flags[1] = 0;
flags[2] = 1;
@@ -2349,926 +1971,597 @@ void DrasculaEngine::animation_6_6() {
void DrasculaEngine::animation_7_6() {
flags[8] = 1;
- actualiza_datos();
+ updateVisible();
}
void DrasculaEngine::animation_9_6() {
int v_cd;
- anima("fin.bin", 14);
- playmusic(13);
+ animate("fin.bin", 14);
+ playMusic(13);
flags[5] = 1;
- anima("drf.bin", 16);
- FundeAlNegro(0);
+ animate("drf.bin", 16);
+ fadeToBlack(0);
clearRoom();
- hare_x = -1;
- obj_saliendo = 108;
- carga_escoba("59.ald");
- strcpy(num_room, "nada.alg");
- loadPic("nota2.alg");
- decompressPic(dir_dibujo1, MEDIA);
- Negro();
- sentido_hare = 1;
- hare_x -= 21;
+ curX = -1;
+ objExit = 108;
+ enterRoom(59);
+ // The room number was originally changed here to "nada.alg",
+ // which is a non-existant file. In reality, this was just a
+ // hack to set the room number to a non-existant one, so that
+ // room sprites do not appear again when the room is refreshed.
+ // We set the room number to -1 for the same purpose.
+ // Also check animation_2_1(), where the same hack was used
+ // by the original
+ roomNumber = -1;
+ loadPic("nota2.alg", bgSurface, HALF_PAL);
+ black();
+ trackProtagonist = 1;
+ curX -= 21;
updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- FundeDelNegro(0);
+ updateScreen();
+ fadeFromBlack(0);
pause(96);
- lleva_al_hare(116, 178);
- sentido_hare = 2;
+ gotoObject(116, 178);
+ trackProtagonist = 2;
updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- playmusic(9);
+ updateScreen();
+ playMusic(9);
clearRoom();
- loadPic("nota.alg");
- decompressPic(dir_dibujo1, COMPLETA);
- color_abc(BLANCO);
+ loadPic("nota.alg", bgSurface, COMPLETE_PAL);
+ color_abc(kColorWhite);
talk_solo(_textbj[_lang][24], "bj24.als");
talk_solo(_textbj[_lang][25], "bj25.als");
talk_solo(_textbj[_lang][26], "bj26.als");
talk_solo(_textbj[_lang][27], "bj27.als");
talk_solo(_textbj[_lang][28], "bj28.als");
- sentido_hare = 3;
+ trackProtagonist = 3;
clearRoom();
- loadPic("96.alg");
- decompressPic(dir_hare_frente, COMPLETA);
- loadPic("nota2.alg");
- decompressPic(dir_dibujo1, MEDIA);
- talk(_text[_lang][296], "296.als");
- talk(_text[_lang][297], "297.als");
- talk(_text[_lang][298], "298.als");
- sentido_hare = 1;
- talk(_text[_lang][299], "299.als");
- talk(_text[_lang][300], "300.als");
+ loadPic(96, frontSurface, COMPLETE_PAL);
+ loadPic("nota2.alg", bgSurface, HALF_PAL);
+ talk(296);
+ talk(297);
+ talk(298);
+ trackProtagonist = 1;
+ talk(299);
+ talk(300);
updateRoom();
- copyBackground(0, 0, 0, 0, 320, 200, dir_zona_pantalla, dir_dibujo1);
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- color_abc(VERDE_CLARO);
- talk_solo("GOOOOOOOOOOOOOOOL", "s15.als");
- loadPic("nota2.alg");
- decompressPic(dir_dibujo1, 1);
- sentido_hare = 0;
+ copyBackground(0, 0, 0, 0, 320, 200, screenSurface, bgSurface);
+ updateScreen();
+ color_abc(kColorLightGreen);
+ talk_solo(_textmisc[_lang][2], "s15.als");
+ loadPic("nota2.alg", bgSurface);
+ trackProtagonist = 0;
updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- talk(_text[_lang][301], "301.als");
+ updateScreen();
+ talk(301);
v_cd = _mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType) / 16;
- v_cd = v_cd + 4;
- playmusic(17);
- FundeAlNegro(1);
+ v_cd += 4;
+ playMusic(17);
+ fadeToBlack(1);
clearRoom();
- fliplay("qpc.bin", 1);
+ playFLI("qpc.bin", 1);
MusicFadeout();
- stopmusic();
+ stopMusic();
clearRoom();
_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, v_cd * 16);
- playmusic(3);
- fliplay("crd.bin", 1);
- stopmusic();
+ playMusic(3);
+ playFLI("crd.bin", 1);
+ stopMusic();
}
void DrasculaEngine::animation_10_6() {
- comienza_sound ("s14.als");
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ playSound(14);
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
updateRefresh_pre();
- copyBackground(164, 85, 155, 48, 113, 114, dir_dibujo3, dir_zona_pantalla);
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- fin_sound();
- talk_taber2(_textt[_lang][23], "t23.als");
+ copyBackground(164, 85, 155, 48, 113, 114, drawSurface3, screenSurface);
+ updateScreen();
+ finishSound();
+ talk_bartender(23, 1);
flags[7] = 1;
}
void DrasculaEngine::animation_11_6() {
- talk_taber2(_textt[_lang][10], "t10.als");
- talk(_text[_lang][268], "268.als");
- talk_taber2(_textt[_lang][11], "t11.als");
+ talk_bartender(10, 1);
+ talk(268);
+ talk_bartender(11, 1);
}
void DrasculaEngine::animation_12_6() {
- talk_taber2(_textt[_lang][12], "t12.als");
- talk(_text[_lang][270], "270.als");
- talk_taber2(_textt[_lang][13], "t13.als");
- talk_taber2(_textt[_lang][14], "t14.als");
+ talk_bartender(12, 1);
+ talk(270);
+ talk_bartender(13, 1);
+ talk_bartender(14, 1);
}
void DrasculaEngine::animation_13_6() {
- talk_taber2(_textt[_lang][15], "t15.als");
+ talk_bartender(15, 1);
}
void DrasculaEngine::animation_14_6() {
- talk_taber2(_textt[_lang][24], "t24.als");
- suma_objeto(21);
+ talk_bartender(24, 1);
+ addObject(21);
flags[10] = 1;
- rompo_y_salgo = 1;
+ breakOut = 1;
}
void DrasculaEngine::animation_15_6() {
- talk_taber2(_textt[_lang][16], "t16.als");
+ talk_bartender(16, 1);
}
void DrasculaEngine::animation_18_6() {
flags[6] = 1;
- sin_verbo();
- resta_objeto(21);
- anima("beb.bin", 10);
+ withoutVerb();
+ removeObject(21);
+ animate("beb.bin", 10);
}
void DrasculaEngine::animation_19_6() {
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- copyBackground(140, 23, 161, 69, 35, 80, dir_dibujo3, dir_zona_pantalla);
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
+ copyBackground(140, 23, 161, 69, 35, 80, drawSurface3, screenSurface);
updateRefresh_pre();
- pon_hare();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ moveCharacters();
+ updateScreen();
pause(6);
updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- comienza_sound("s4.als");
+ updateScreen();
+ playSound(4);
pause(6);
- fin_sound();
+ finishSound();
}
void DrasculaEngine::animation_12_2() {
- loadPic("an12.alg");
- decompressPic(dir_hare_dch, 1);
+ if (_lang == kSpanish)
+ textSurface = frontSurface;
+
+ loadPic("an12.alg", extraSurface);
- talk(_text[_lang][356], "356.als");
+ talk(356);
updateRefresh_pre();
- copyBackground(1, 139, 228, 112, 47, 60, dir_hare_dch, dir_zona_pantalla);
- updateScreen(228, 112, 228, 112, 47, 60, dir_zona_pantalla);
+ copyBackground(1, 139, 228, 112, 47, 60, extraSurface, screenSurface);
+ updateScreen(228, 112, 228, 112, 47, 60, screenSurface);
pause(3);
updateRefresh_pre();
- copyBackground(49, 139, 228, 112, 47, 60, dir_hare_dch, dir_zona_pantalla);
- pon_hare();
+ copyBackground(49, 139, 228, 112, 47, 60, extraSurface, screenSurface);
+ moveCharacters();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateScreen();
pause(3);
- stopmusic();
+ stopMusic();
flags[11] = 1;
- talk_pianista(_textp[_lang][5], "P5.als");
- conversa("op_1.cal");
+ talk_pianist(5);
+ converse(1);
+
+ if (_lang == kSpanish)
+ textSurface = extraSurface;
flags[11] = 0;
- loadPic("974.alg");
- decompressPic(dir_hare_dch, 1);
+ loadPic(974, extraSurface);
}
void DrasculaEngine::animation_26_2() {
- int n, x = 0;
+ if (_lang == kSpanish)
+ textSurface = frontSurface;
- loadPic("an12.alg");
- decompressPic(dir_hare_dch, 1);
+ loadPic("an12.alg", extraSurface);
- talk(_text[_lang][392], "392.als");
+ talk(392);
updateRefresh_pre();
- copyBackground(1, 139, 228, 112, 47, 60, dir_hare_dch, dir_zona_pantalla);
- updateScreen(228, 112, 228, 112, 47, 60, dir_zona_pantalla);
+ copyBackground(1, 139, 228, 112, 47, 60, extraSurface, screenSurface);
+ updateScreen(228, 112, 228, 112, 47, 60, screenSurface);
pause(3);
updateRefresh_pre();
- copyBackground(49, 139, 228, 112, 47, 60, dir_hare_dch, dir_zona_pantalla);
- pon_hare();
+ copyBackground(49, 139, 228, 112, 47, 60, extraSurface, screenSurface);
+ moveCharacters();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateScreen();
pause(3);
- stopmusic();
+ stopMusic();
flags[11] = 1;
- talk_pianista(_textp[_lang][5], "P5.als");
- talk(_text[_lang][393], "393.als");
- talk_pianista(_textp[_lang][17], "P17.als");
- talk_pianista(_textp[_lang][18], "P18.als");
- talk_pianista(_textp[_lang][19], "P19.als");
+ talk_pianist(5);
+ talk(393);
+ talk_pianist(17);
+ talk_pianist(18);
+ talk_pianist(19);
- loadPic("an26.alg");
- decompressPic(dir_hare_dch, 1);
- for (n = 0; n < 6; n++){
- x++;
- copyBackground(x, 1, 225, 113, 50, 59, dir_hare_dch, dir_zona_pantalla);
- updateScreen(225,113, 225,113, 50,59, dir_zona_pantalla);
- x = x + 50;
- pause(3);
- }
+ loadPic("an26.alg", extraSurface);
+
+ updateAnim(1, 225, 113, 50, 59, 6, extraSurface);
- x = 0;
- for (n = 0; n < 6; n++) {
+ int x = 0;
+ for (int n = 0; n < 6; n++) {
x++;
- copyBackground(x, 61, 225, 113, 50, 59, dir_hare_dch, dir_zona_pantalla);
- updateScreen(225, 113, 225, 113, 50, 59, dir_zona_pantalla);
+ copyBackground(x, 61, 225, 113, 50, 59, extraSurface, screenSurface);
+ updateScreen(225, 113, 225, 113, 50, 59, screenSurface);
x = x + 50;
if (n == 2)
- comienza_sound("s9.als");
+ playSound(9);
pause(3);
}
- fin_sound_corte();
- x = 0;
- for (n = 0; n < 6; n++) {
- x++;
- copyBackground(x, 121, 225, 113, 50, 59, dir_hare_dch, dir_zona_pantalla);
- updateScreen(225, 113, 225, 113, 50, 59, dir_zona_pantalla);
- x = x + 50;
- pause(3);
- }
+ stopSound();
+
+ updateAnim(121, 225, 113, 50, 59, 6, extraSurface);
+
+ pickObject(11);
+ removeObject(kItemBook);
- agarra_objeto(11);
- resta_objeto(12);
+ if (_lang == kSpanish)
+ textSurface = extraSurface;
flags[11] = 0;
flags[39] = 1;
- loadPic("974.alg");
- decompressPic(dir_hare_dch, 1);
- musica_room = 16;
+ loadPic(974, extraSurface);
+ roomMusic = 16;
}
void DrasculaEngine::animation_11_2() {
- loadPic("an11y13.alg");
- decompressPic(dir_hare_dch, 1);
-
- talk(_text[_lang][352], "352.als");
- talk_tabernero(_textt[_lang][1], "T1.als");
- talk(_text[_lang][353], "353.als");
- talk_tabernero(_textt[_lang][17], "T17.als");
- talk(_text[_lang][354], "354.als");
- talk_tabernero(_textt[_lang][18], "T18.als");
- talk(_text[_lang][355], "355.als");
+ if (_lang == kSpanish)
+ textSurface = frontSurface;
+
+ loadPic("an11y13.alg", extraSurface);
+
+ talk(352);
+ talk_bartender(1);
+ talk(353);
+ talk_bartender(17);
+ talk(354);
+ talk_bartender(18);
+ talk(355);
pause(40);
- talk_tabernero("No, nada", "d82.als");
+ talk_bartender(82);
- loadPic("974.alg");
- decompressPic(dir_hare_dch, 1);
+ if (_lang == kSpanish)
+ textSurface = extraSurface;
+
+ loadPic(974, extraSurface);
}
void DrasculaEngine::animation_13_2() {
- loadPic("an11y13.alg");
- decompressPic(dir_hare_frente, 1);
+ loadPic("an11y13.alg", frontSurface);
if (flags[41] == 0) {
- talk(_text[_lang][103], "103.als");
- talk_borracho(_textb[_lang][4], "B4.als");
+ talk(103);
+ talk_drunk(4);
flags[12] = 1;
- talk(_text[_lang][367], "367.als");
- talk_borracho(_textb[_lang][5], "B5.als");
+ talk(367);
+ talk_drunk(5);
flags[12] = 1;
- talk(_text[_lang][368], "368.als");
- talk_borracho(_textb[_lang][6], "B6.als");
- talk_borracho(_textb[_lang][7], "B7.als");
+ talk(368);
+ talk_drunk(6);
+ talk_drunk(7);
flags[41] = 1;
}
- conversa("op_2.cal");
+ converse(2);
- loadPic("964.alg");
- decompressPic(dir_hare_frente, 1);
+ loadPic(964, frontSurface);
}
void DrasculaEngine::animation_18_2() {
- talk(_text[_lang][378], "378.als");
- talk_vbpuerta(_textvb[_lang][4], "VB4.als");
- conversa("op_3.cal");
+ talk(378);
+ talk_vonBraunpuerta(4);
+ converse(3);
}
void DrasculaEngine::animation_22_2() {
- talk(_text[_lang][374],"374.als");
+ talk(374);
- sentido_hare=2;
+ trackProtagonist=2;
updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- comienza_sound("s13.als");
- fin_sound();
- sentido_hare = 1;
+ updateScreen();
+ playSound(13);
+ finishSound();
+ trackProtagonist = 1;
- talk_vbpuerta(_textvb[_lang][1], "VB1.als");
- talk(_text[_lang][375], "375.als");
- talk_vbpuerta(_textvb[_lang][2], "VB2.als");
- talk(_text[_lang][376], "376.als");
- talk_vbpuerta(_textvb[_lang][3], "VB3.als");
+ talk_vonBraunpuerta(1);
+ talk(375);
+ talk_vonBraunpuerta(2);
+ talk(376);
+ talk_vonBraunpuerta(3);
flags[18] = 1;
}
void DrasculaEngine::animation_24_2() {
- if (hare_x < 178)
- lleva_al_hare(208, 136);
- sentido_hare = 3;
+ if (curX < 178)
+ gotoObject(208, 136);
+ trackProtagonist = 3;
updateRoom();
pause(3);
- sentido_hare = 0;
+ trackProtagonist = 0;
- talk(_text[_lang][356], "356.als");
+ talk(356);
- loadPic("an24.alg");
- decompressPic(dir_hare_frente, 1);
+ loadPic("an24.alg", frontSurface);
animation_32_2();
flags[21] = 1;
- talk_vb(_textvb[_lang][22], "VB22.als");
+ talk_vonBraun(22);
if (flags[22] == 0)
- conversa("op_4.cal");
+ converse(4);
else
- conversa("op_5.cal");
+ converse(5);
- sal_de_la_habitacion(0);
+ exitRoom(0);
flags[21] = 0;
flags[24] = 0;
- sentido_vb = 1;
- vb_x = 120;
+ trackVonBraun = 1;
+ vonBraunX = 120;
}
void DrasculaEngine::animation_32_2() {
- int n, x = 0;
-
- loadPic("an32_1.alg");
- decompressPic(dir_dibujo3, 1);
- loadPic("an32_2.alg");
- decompressPic(dir_hare_fondo, 1);
-
- for (n = 0; n < 4; n++) {
- x++;
- copyBackground(x, 1, 113, 53, 65, 81, dir_dibujo3, dir_zona_pantalla);
- updateScreen(113, 53, 113, 53, 65, 81, dir_zona_pantalla);
- x = x + 65;
- pause(4);
- }
-
- x = 0;
- for (n = 0; n < 4; n++) {
- x++;
- copyBackground(x, 83, 113, 53, 65, 81, dir_dibujo3, dir_zona_pantalla);
- updateScreen(113, 53, 113, 53, 65, 81, dir_zona_pantalla);
- x = x + 65;
- pause(4);
- }
+ loadPic("an32_1.alg", drawSurface3);
+ loadPic("an32_2.alg", backSurface);
- x = 0;
- for (n = 0; n < 4; n++) {
- x++;
- copyBackground(x, 1, 113, 53, 65, 81, dir_hare_fondo, dir_zona_pantalla);
- updateScreen(113, 53, 113, 53, 65, 81, dir_zona_pantalla);
- x = x + 65;
- pause(4);
- }
+ updateAnim(1, 113, 53, 65, 81, 4, drawSurface3, 4);
+ updateAnim(83, 113, 53, 65, 81, 4, drawSurface3, 4);
+ updateAnim(1, 113, 53, 65, 81, 4, backSurface, 4);
- x = 0;
- for (n = 0; n < 3; n++) {
+ int x = 0;
+ for (int n = 0; n < 3; n++) {
x++;
- copyBackground(x, 83, 113, 53, 65, 81, dir_hare_fondo, dir_zona_pantalla);
- updateScreen(113, 53, 113, 53, 65, 81, dir_zona_pantalla);
+ copyBackground(x, 83, 113, 53, 65, 81, backSurface, screenSurface);
+ updateScreen(113, 53, 113, 53, 65, 81, screenSurface);
x = x + 65;
if (n < 2)
pause(4);
}
- loadPic("aux18.alg");
- decompressPic(dir_dibujo3, 1);
+ loadPic("aux18.alg", drawSurface3);
}
void DrasculaEngine::animation_34_2() {
- int n, x = 0;
-
- sentido_hare = 1;
+ trackProtagonist = 1;
updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateScreen();
- loadPic("an34_1.alg");
- decompressPic(dir_hare_fondo, 1);
- loadPic("an34_2.alg");
- decompressPic(dir_hare_dch, 1);
+ loadPic("an34_1.alg", backSurface);
+ loadPic("an34_2.alg", extraSurface);
- for (n = 0; n < 3; n++) {
- x++;
- copyBackground(x, 1, 218, 79, 83, 75, dir_hare_fondo, dir_zona_pantalla);
- updateScreen(218, 79, 218, 79, 83, 75, dir_zona_pantalla);
- x = x + 83;
- pause(3);
- }
-
- x = 0;
+ updateAnim(1, 218, 79, 83, 75, 3, backSurface);
+ updateAnim(77, 218, 79, 83, 75, 3, backSurface);
- for (n = 0; n < 3; n++) {
- x++;
- copyBackground(x, 77, 218, 79, 83, 75, dir_hare_fondo, dir_zona_pantalla);
- updateScreen(218, 79, 218, 79, 83, 75, dir_zona_pantalla);
- x = x + 83;
- pause(3);
- }
+ playSound(8);
- x = 0;
- comienza_sound("s8.als");
+ updateAnim(1, 218, 79, 83, 75, 3, extraSurface);
- for (n = 0; n < 3; n++) {
- x++;
- copyBackground(x, 1, 218, 79, 83, 75, dir_hare_dch, dir_zona_pantalla);
- updateScreen(218, 79, 218, 79, 83,75, dir_zona_pantalla);
- x = x + 83;
- pause(3);
- }
- fin_sound();
+ finishSound();
pause(30);
- copyBackground(1, 77, 218, 79, 83, 75, dir_hare_dch, dir_zona_pantalla);
- updateScreen(218, 79, 218, 79, 83, 75, dir_zona_pantalla);
+ copyBackground(1, 77, 218, 79, 83, 75, extraSurface, screenSurface);
+ updateScreen(218, 79, 218, 79, 83, 75, screenSurface);
pause(3);
- loadPic("994.alg");
- decompressPic(dir_hare_fondo, 1);
- loadPic("974.alg");
- decompressPic(dir_hare_dch, 1);
+ loadPic(994, backSurface);
+ loadPic(974, extraSurface);
}
void DrasculaEngine::animation_36_2() {
- loadPic("an11y13.alg");
- decompressPic(dir_hare_dch, 1);
-
- talk(_text[_lang][404], "404.als");
- talk_tabernero(_textt[_lang][19], "T19.als");
- talk_tabernero(_textt[_lang][20], "T20.als");
- talk_tabernero(_textt[_lang][21], "T21.als");
- talk(_text[_lang][355], "355.als");
+ if (_lang == kSpanish)
+ textSurface = frontSurface;
+
+ loadPic("an11y13.alg", extraSurface);
+
+ talk(404);
+ talk_bartender(19);
+ talk_bartender(20);
+ talk_bartender(21);
+ talk(355);
pause(40);
- talk_tabernero("No, nada", "d82.als");
+ talk_bartender(82);
+
+ if (_lang == kSpanish)
+ textSurface = extraSurface;
- loadPic("974.alg");
- decompressPic(dir_hare_dch, 1);
+ loadPic(974, extraSurface);
}
void DrasculaEngine::animation_7_2() {
- int n, x = 0;
-
- loadPic("an7_1.alg");
- decompressPic(dir_hare_fondo, 1);
- loadPic("an7_2.alg");
- decompressPic(dir_hare_dch, 1);
- loadPic("an7_3.alg");
- decompressPic(dir_hare_frente, 1);
+ loadPic("an7_1.alg", backSurface);
+ loadPic("an7_2.alg", extraSurface);
+ loadPic("an7_3.alg", frontSurface);
if (flags[3] == 1)
- copyBackground(258, 110, 85, 44, 23, 53, dir_dibujo3, dir_dibujo1);
-
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
-
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- for (n = 0; n < 6; n++) {
- x++;
- copyBackground(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
- copyRect(x, 1, 80, 64, 51, 73, dir_hare_fondo, dir_zona_pantalla);
- updateScreen(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
- x = x + 51;
- pause(3);
- }
-
- x = 0;
-
- for (n = 0; n < 6; n++) {
- x++;
- copyBackground(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
- copyRect(x, 75, 80, 64, 51, 73, dir_hare_fondo, dir_zona_pantalla);
- updateScreen(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
- x = x + 51;
- pause(3);
- }
-
- x = 0;
-
- for (n = 0; n < 6; n++) {
- x++;
- copyBackground(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
- copyRect(x, 1, 80, 64, 51, 73, dir_hare_dch, dir_zona_pantalla);
- updateScreen(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
- x = x + 51;
- pause(3);
- }
-
- x = 0;
-
- for (n = 0; n < 6; n++) {
- x++;
- copyBackground(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
- copyRect(x, 75, 80, 64, 51, 73, dir_hare_dch, dir_zona_pantalla);
- updateScreen(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
- x = x + 51;
- pause(3);
- }
-
- x = 0;
-
- for (n = 0; n < 6; n++) {
- x++;
- copyBackground(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
- copyRect(x, 1, 80, 64, 51, 73, dir_hare_frente, dir_zona_pantalla);
- updateScreen(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
- x = x + 51;
- pause(3);
- }
- loadPic("an7_4.alg");
- decompressPic(dir_hare_fondo, 1);
- loadPic("an7_5.alg");
- decompressPic(dir_hare_dch, 1);
- loadPic("an7_6.alg");
- decompressPic(dir_hare_frente, 1);
- loadPic("an7_7.alg");
- decompressPic(dir_dibujo3, 1);
-
- x = 0;
-
- for (n = 0; n < 6; n++) {
- x++;
- copyBackground(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
- copyRect(x, 1, 80, 64, 51, 73, dir_hare_fondo, dir_zona_pantalla);
- updateScreen(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
- x = x + 51;
- pause(3);
- }
-
- x = 0;
-
- for (n = 0; n < 6; n++) {
- x++;
- copyBackground(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
- copyRect(x, 75, 80, 64, 51, 73, dir_hare_fondo, dir_zona_pantalla);
- updateScreen(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
- x = x + 51;
- pause(3);
- }
-
- x = 0;
+ copyBackground(258, 110, 85, 44, 23, 53, drawSurface3, bgSurface);
- for (n = 0; n < 6; n++) {
- x++;
- copyBackground(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
- copyRect(x, 1, 80, 64, 51,73, dir_hare_dch, dir_zona_pantalla);
- updateScreen(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
- x = x + 51;
- pause(3);
- }
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
- x = 0;
+ updateScreen();
- for (n = 0; n < 6; n++) {
- x++;
- copyBackground(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
- copyRect(x, 75, 80, 64, 51, 73, dir_hare_dch, dir_zona_pantalla);
- updateScreen(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
- x = x + 51;
- pause(3);
- }
+ updateAnim2(1, 80, 64, 51, 73, 6, backSurface);
+ updateAnim2(75, 80, 64, 51, 73, 6, backSurface);
+ updateAnim2(1, 80, 64, 51, 73, 6, extraSurface);
+ updateAnim2(75, 80, 64, 51, 73, 6, extraSurface);
+ updateAnim2(1, 80, 64, 51, 73, 6, frontSurface);
- x = 0;
+ loadPic("an7_4.alg", backSurface);
+ loadPic("an7_5.alg", extraSurface);
+ loadPic("an7_6.alg", frontSurface);
+ loadPic("an7_7.alg", drawSurface3);
- for (n = 0; n < 6; n++) {
- x++;
- copyBackground(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
- copyRect(x, 1, 80, 64, 51, 73, dir_hare_frente, dir_zona_pantalla);
- updateScreen(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
- x = x + 51;
- pause(3);
- }
+ updateAnim2(1, 80, 64, 51, 73, 6, backSurface);
+ updateAnim2(75, 80, 64, 51, 73, 6, backSurface);
+ updateAnim2(1, 80, 64, 51, 73, 6, extraSurface);
+ updateAnim2(75, 80, 64, 51, 73, 6, extraSurface);
+ updateAnim2(1, 80, 64, 51, 73, 6, frontSurface);
+ updateAnim2(75, 80, 64, 51, 73, 6, extraSurface);
+ updateAnim2(1, 80, 64, 51, 73, 6, frontSurface);
+ updateAnim2(75, 80, 64, 51, 73, 6, frontSurface);
+ updateAnim2(1, 80, 64, 51, 73, 6, drawSurface3);
+ updateAnim2(75, 80, 64, 51, 73, 2, drawSurface3);
- x = 0;
+ loadPic("an7_8.alg", backSurface);
+ loadPic("an7_9.alg", extraSurface);
- for (n = 0; n < 6; n++) {
- x++;
- copyBackground(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
- copyRect(x, 75, 80, 64, 51, 73, dir_hare_dch, dir_zona_pantalla);
- updateScreen(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
- x = x + 51;
- pause(3);
- }
+ updateAnim2(1, 80, 64, 51, 73, 6, backSurface);
+ updateAnim2(75, 80, 64, 51, 73, 6, backSurface);
+ updateAnim2(1, 80, 64, 51, 73, 6, extraSurface);
- x = 0;
-
- for (n = 0; n < 6; n++) {
- x++;
- copyBackground(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
- copyRect(x, 1, 80, 64, 51, 73, dir_hare_frente, dir_zona_pantalla);
- updateScreen(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
- x = x + 51;
- pause(3);
- }
-
- x = 0;
-
- for (n = 0; n < 6; n++) {
- x++;
- copyBackground(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
- copyRect(x, 75, 80, 64, 51, 73, dir_hare_frente, dir_zona_pantalla);
- updateScreen(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
- x = x + 51;
- pause(3);
- }
-
- x = 0;
-
- for (n = 0; n < 6; n++) {
- x++;
- copyBackground(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
- copyRect(x, 1, 80, 64, 51, 73, dir_dibujo3, dir_zona_pantalla);
- updateScreen(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
- x = x + 51;
- pause(3);
- }
-
- x = 0;
-
- for (n = 0; n < 2; n++) {
- x++;
- copyBackground(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
- copyRect(x, 75, 80, 64, 51, 73, dir_dibujo3, dir_zona_pantalla);
- updateScreen(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
- x = x + 51;
- pause(3);
- }
- loadPic("an7_8.alg");
- decompressPic(dir_hare_fondo, 1);
- loadPic("an7_9.alg");
- decompressPic(dir_hare_dch, 1);
-
- x = 0;
-
- for (n = 0; n < 6; n++) {
- x++;
- copyBackground(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
- copyRect(x, 1, 80, 64, 51, 73, dir_hare_fondo, dir_zona_pantalla);
- updateScreen(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
- x = x + 51;
- pause(3);
- }
-
- x = 0;
-
- for (n = 0; n < 6; n++) {
- x++;
- copyBackground(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
- copyRect(x, 75, 80, 64, 51, 73, dir_hare_fondo, dir_zona_pantalla);
- updateScreen(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
- x = x + 51;
- pause(3);
- }
-
- x = 0;
-
- for (n = 0; n < 6; n++) {
- x++;
- copyBackground(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
- copyRect(x, 1, 80, 64, 51, 73, dir_hare_dch, dir_zona_pantalla);
- updateScreen(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
- x = x + 51;
- pause(3);
- }
-
-
- copyBackground(80, 64, 80, 64, 51, 73, dir_dibujo1, dir_zona_pantalla);
- copyRect(1, 75, 80, 64, 51, 73, dir_hare_dch, dir_zona_pantalla);
- updateScreen(80, 64, 80, 64, 51, 73, dir_zona_pantalla);
+ copyBackground(80, 64, 80, 64, 51, 73, bgSurface, screenSurface);
+ copyRect(1, 75, 80, 64, 51, 73, extraSurface, screenSurface);
+ updateScreen(80, 64, 80, 64, 51, 73, screenSurface);
flags[37] = 1;
if (flags[7] == 1 && flags[26] == 1 && flags[34] == 1 && flags[35] == 1 && flags[37] == 1)
flags[38] = 1;
- loadPic("99.alg");
- decompressPic(dir_hare_fondo, 1);
- loadPic("97.alg");
- decompressPic(dir_hare_dch, 1);
- loadPic("96.alg");
- decompressPic(dir_hare_frente, 1);
- loadPic("aux3.alg");
- decompressPic(dir_dibujo3, 1);
+ loadPic(99, backSurface);
+ loadPic(97, extraSurface);
+ loadPic(96, frontSurface);
+ loadPic("aux3.alg", drawSurface3);
}
void DrasculaEngine::animation_5_2() {
- int n, x = 0;
-
- sentido_hare = 0;
+ trackProtagonist = 0;
updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateScreen();
- loadPic("an5_1.alg");
- decompressPic(dir_hare_fondo, 1);
- loadPic("an5_2.alg");
- decompressPic(dir_hare_dch, 1);
- loadPic("an5_3.alg");
- decompressPic(dir_hare_frente, 1);
- loadPic("an5_4.alg");
- decompressPic(dir_dibujo3, 1);
+ loadPic("an5_1.alg", backSurface);
+ loadPic("an5_2.alg", extraSurface);
+ loadPic("an5_3.alg", frontSurface);
+ loadPic("an5_4.alg", drawSurface3);
- copyBackground(1, 1, 213, 66, 53,84, dir_hare_fondo, dir_zona_pantalla);
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ copyBackground(1, 1, 213, 66, 53,84, backSurface, screenSurface);
+ updateScreen();
- for (n = 0; n < 6; n++) {
- x++;
- copyBackground(x, 1, 213, 66, 53, 84, dir_hare_fondo, dir_zona_pantalla);
- updateScreen(213, 66, 213, 66, 53, 84,dir_zona_pantalla);
- x = x + 52;
- pause(3);
- }
-
- x = 0;
-
- for (n = 0; n < 6; n++) {
- x++;
- copyBackground(x, 86, 213, 66, 53, 84, dir_hare_fondo, dir_zona_pantalla);
- updateScreen(213, 66, 213, 66, 53, 84, dir_zona_pantalla);
- x = x + 52;
- pause(3);
- }
-
- x = 0;
-
- for (n = 0; n < 6; n++) {
- x++;
- copyBackground(x, 1, 213, 66, 53, 84, dir_hare_dch, dir_zona_pantalla);
- updateScreen(213, 66, 213, 66, 53, 84, dir_zona_pantalla);
- x = x + 52;
- pause(3);
- }
-
- x = 0;
-
- for (n = 0; n < 6; n++) {
- x++;
- copyBackground(x, 1, 213, 66, 53, 84, dir_hare_dch, dir_zona_pantalla);
- updateScreen(213, 66, 213, 66, 53, 84, dir_zona_pantalla);
- x = x + 52;
- pause(3);
- }
-
- x = 0;
-
- for (n = 0; n < 6; n++) {
- x++;
- copyBackground(x, 86, 213, 66, 53, 84, dir_hare_dch, dir_zona_pantalla);
- updateScreen(213, 66, 213, 66, 53, 84, dir_zona_pantalla);
- x = x + 52;
- pause(3);
- }
-
- x = 0;
+ updateAnim(1, 213, 66, 52, 84, 6, backSurface);
+ updateAnim(86, 213, 66, 52, 84, 6, backSurface);
+ updateAnim(1, 213, 66, 52, 84, 6, extraSurface);
+ updateAnim(1, 213, 66, 52, 84, 6, extraSurface);
+ updateAnim(86, 213, 66, 52, 84, 6, extraSurface);
+ updateAnim(1, 213, 66, 52, 84, 6, frontSurface);
- for (n = 0; n < 6; n++) {
- x++;
- copyBackground(x, 1, 213, 66, 53, 84, dir_hare_frente, dir_zona_pantalla);
- updateScreen(213, 66, 213, 66, 53, 84, dir_zona_pantalla);
- x = x + 52;
- pause(3);
- }
-
- comienza_sound("s1.als");
-
- x = 0;
-
- for (n = 0; n < 6; n++) {
- x++;
- copyBackground(x, 86, 213, 66, 53, 84, dir_hare_frente, dir_zona_pantalla);
- updateScreen(213, 66, 213, 66, 53, 84, dir_zona_pantalla);
- x = x + 52;
- pause(3);
- }
- fin_sound_corte();
+ playSound(1);
+ updateAnim(86, 213, 66, 52, 84, 6, frontSurface);
+ stopSound();
- x = 0;
-
- for (n = 0; n < 6; n++) {
- x++;
- copyBackground(x, 1, 213, 66, 53, 84, dir_dibujo3, dir_zona_pantalla);
- updateScreen(213, 66, 213, 66, 53, 84, dir_zona_pantalla);
- x = x + 52;
- pause(3);
- }
+ updateAnim(1, 213, 66, 52, 84, 6, drawSurface3);
- loadPic("994.alg");
- decompressPic(dir_hare_fondo, 1);
- loadPic("974.alg");
- decompressPic(dir_hare_dch, 1);
- loadPic("964.alg");
- decompressPic(dir_hare_frente, 1);
- loadPic("aux5.alg");
- decompressPic(dir_dibujo3, 1);
+ loadPic(994, backSurface);
+ loadPic(974, extraSurface);
+ loadPic(964, frontSurface);
+ loadPic("aux5.alg", drawSurface3);
flags[8] = 1;
- hare_x = hare_x - 4;
- talk_sinc(_text[_lang][46], "46.als", "4442444244244");
- sin_verbo();
+ curX = curX - 4;
+ talk_sync(_text[_lang][46], "46.als", "4442444244244");
+ withoutVerb();
}
void DrasculaEngine::animation_6_2() {
- stopmusic();
+ stopMusic();
flags[9] = 1;
+ if (_lang == kSpanish)
+ textSurface = frontSurface;
+
clearRoom();
- loadPic("ciego1.alg");
- decompressPic(dir_dibujo1, MEDIA);
- loadPic("ciego2.alg");
- decompressPic(dir_dibujo3, 1);
- loadPic("ciego3.alg");
- decompressPic(dir_hare_dch, 1);
- loadPic("ciego4.alg");
- decompressPic(dir_hare_fondo, 1);
- loadPic("ciego5.alg");
- decompressPic(dir_hare_frente, 1);
-
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ loadPic("ciego1.alg", bgSurface, HALF_PAL); // ciego = blind
+ loadPic("ciego2.alg", drawSurface3);
+ loadPic("ciego3.alg", extraSurface);
+ loadPic("ciego4.alg", backSurface);
+ loadPic("ciego5.alg", frontSurface);
+
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
+ updateScreen();
pause(1);
if (flags[4] == 1)
- talk_hacker(_textd[_lang][66], "d66.als");
+ talk_hacker(66);
pause(6);
- talk_ciego(_textd[_lang][78], "d78.als",
- "004447222550002222755554444466222000220555002220550444446666662220000557550033344477222522665444466663337446055504446550550550222633003330000666622044422755722270255566667555655007222777");
+ talk_blind(11);
pause(4);
- talk_hacker(_textd[_lang][67], "d67.als");
+ talk_hacker(67);
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
+ updateScreen();
pause(10);
clearRoom();
- playmusic(musica_room);
- loadPic("9.alg");
- decompressPic(dir_dibujo1, MEDIA);
- loadPic("aux9.alg");
- decompressPic(dir_dibujo3, 1);
- loadPic("96.alg");
- decompressPic(dir_hare_frente, 1);
- loadPic("97.alg");
- decompressPic(dir_hare_dch, 1);
- loadPic("99.alg");
- decompressPic(dir_hare_fondo, 1);
- sin_verbo();
+ playMusic(roomMusic);
+ loadPic(9, bgSurface, HALF_PAL);
+ loadPic("aux9.alg", drawSurface3);
+ loadPic(96, frontSurface);
+ loadPic(97, extraSurface);
+ loadPic(99, backSurface);
+ withoutVerb();
+
+ if (_lang == kSpanish)
+ textSurface = extraSurface;
flags[9] = 0;
}
void DrasculaEngine::animation_33_2() {
- stopmusic();
+ stopMusic();
flags[9] = 1;
pause(12);
- talk(_textd[_lang][56], "d56.als" );
+ talk(56);
pause(8);
clearRoom();
- loadPic("ciego1.alg");
- decompressPic(dir_dibujo1, MEDIA);
- loadPic("ciego2.alg");
- decompressPic(dir_dibujo3, 1);
- loadPic("ciego3.alg");
- decompressPic(dir_hare_dch, 1);
- loadPic("ciego4.alg");
- decompressPic(dir_hare_fondo, 1);
- loadPic("ciego5.alg");
- decompressPic(dir_hare_frente, 1);
-
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ loadPic("ciego1.alg", bgSurface, HALF_PAL); // ciego = blind
+ loadPic("ciego2.alg", drawSurface3);
+ loadPic("ciego3.alg", extraSurface);
+ loadPic("ciego4.alg", backSurface);
+ loadPic("ciego5.alg", frontSurface);
+
+ if (_lang == kSpanish)
+ textSurface = frontSurface;
+
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
+ updateScreen();
pause(10);
- talk_ciego(_textd[_lang][68], "d68.als", "44472225500022227555544444472225500022227555544444664466");
+ talk_blind(1);
pause(5);
- talk_hacker(_textd[_lang][57], "d57.als");
+ talk_hacker(57);
pause(6);
_system->delayMillis(1000);
- talk_ciego(_textd[_lang][77], "d77.als", "56665004444447222550002222755554444466555033022755555000444444444444444444444444444444");
- talk_hacker(_textd[_lang][65], "d65.als");
+ talk_blind(10);
+ talk_hacker(65);
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
+ updateScreen();
pause(14);
clearRoom();
- playmusic(musica_room);
- loadPic("9.alg");
- decompressPic(dir_dibujo1, MEDIA);
- loadPic("aux9.alg");
- decompressPic(dir_dibujo3, 1);
- loadPic("96.alg");
- decompressPic(dir_hare_frente, 1);
- loadPic("97.alg");
- decompressPic(dir_hare_dch, 1);
- loadPic("99.alg");
- decompressPic(dir_hare_fondo, 1);
- sin_verbo();
+ playMusic(roomMusic);
+ loadPic(9, bgSurface, HALF_PAL);
+ loadPic("aux9.alg", drawSurface3);
+ loadPic(96, frontSurface);
+ loadPic(97, extraSurface);
+ loadPic(99, backSurface);
+ withoutVerb();
+
+ if (_lang == kSpanish)
+ textSurface = extraSurface;
flags[33] = 1;
flags[9] = 0;
@@ -3276,147 +2569,146 @@ void DrasculaEngine::animation_33_2() {
void DrasculaEngine::animation_1_4() {
if (flags[21] == 0) {
- strcpy(nombre_obj[2], "igor");
- talk(_text[_lang][275], "275.als");
+ strcpy(objName[2], "igor");
+ talk(275);
updateRefresh_pre();
- copyBackground(131, 133, 199, 95, 50, 66, dir_dibujo3, dir_zona_pantalla);
- updateScreen(199, 95, 199, 95, 50, 66, dir_zona_pantalla);
+ copyBackground(131, 133, 199, 95, 50, 66, drawSurface3, screenSurface);
+ updateScreen(199, 95, 199, 95, 50, 66, screenSurface);
pause(3);
updateRefresh_pre();
- copyBackground(182, 133, 199, 95, 50, 66, dir_dibujo3, dir_zona_pantalla);
- pon_hare();
+ copyBackground(182, 133, 199, 95, 50, 66, drawSurface3, screenSurface);
+ moveCharacters();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateScreen();
pause(3);
flags[18] = 1;
flags[20] = 1;
- talk_igor_sentado(_texti[_lang][13], "I13.als");
- talk_igor_sentado(_texti[_lang][14], "I14.als");
- talk_igor_sentado(_texti[_lang][15], "I15.als");
+ talk_igor(13, kIgorSeated);
+ talk_igor(14, kIgorSeated);
+ talk_igor(15, kIgorSeated);
flags[21] = 1;
} else {
- talk(_text[_lang][356], "356.als");
+ talk(356);
updateRefresh_pre();
- copyBackground(131, 133, 199, 95, 50, 66, dir_dibujo3, dir_zona_pantalla);
- updateScreen(199, 95, 199, 95, 50, 66, dir_zona_pantalla);
+ copyBackground(131, 133, 199, 95, 50, 66, drawSurface3, screenSurface);
+ updateScreen(199, 95, 199, 95, 50, 66, screenSurface);
pause(2);
updateRefresh_pre();
- copyBackground(182, 133, 199, 95, 50, 66, dir_dibujo3, dir_zona_pantalla);
- pon_hare();
+ copyBackground(182, 133, 199, 95, 50, 66, drawSurface3, screenSurface);
+ moveCharacters();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateScreen();
flags[18] = 1;
flags[20] = 1;
- talk(_text[_lang][276], "276.als");
+ talk(276);
pause(14);
- talk_igor_sentado(_texti[_lang][6], "I6.als");
+ talk_igor(6, kIgorSeated);
}
- conversa("op_6.cal");
+ converse(6);
flags[20] = 0;
flags[18] = 0;
}
void DrasculaEngine::animation_5_4(){
- sentido_hare = 3;
- loadPic("anh_dr.alg");
- decompressPic(dir_hare_fondo, 1);
- lleva_al_hare(99, 160);
- lleva_al_hare(38, 177);
+ trackProtagonist = 3;
+ loadPic("anh_dr.alg", backSurface);
+ gotoObject(99, 160);
+ gotoObject(38, 177);
hare_se_ve = 0;
updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateScreen();
delay(800);
- anima("bio.bin", 14);
+ animate("bio.bin", 14);
flags[29] = 1;
- hare_x = 95;
- hare_y = 82;
+ curX = 95;
+ curY = 82;
updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- abre_puerta(2, 0);
- loadPic("auxigor.alg");
- decompressPic(dir_hare_frente, 1);
- x_igor = 100;
- y_igor = 65;
- talk_igor_frente(_texti[_lang][29], "I29.ALS");
- talk_igor_frente(_texti[_lang][30], "I30.als");
- loadPic("96.alg");
- decompressPic(dir_hare_frente, 1);
- loadPic("99.alg");
- decompressPic(dir_hare_fondo, 1);
+ updateScreen();
+ openDoor(2, 0);
+ loadPic("auxigor.alg", frontSurface);
+ igorX = 100;
+ igorY = 65;
+ talk_igor(29, kIgorFront);
+ talk_igor(30, kIgorFront);
+ loadPic(96, frontSurface);
+ loadPic(99, backSurface);
hare_se_ve = 1;
- FundeAlNegro(0);
- sal_de_la_habitacion(0);
+ fadeToBlack(0);
+ exitRoom(0);
}
void DrasculaEngine::animation_6_4() {
- char room[13];
+ int prevRoom = roomNumber;
- strcpy(room, num_room);
- strcpy(num_room, "26.alg");
+ roomNumber = 26;
clearRoom();
- loadPic("26.alg");
- decompressPic(dir_dibujo1, MEDIA);
- loadPic("aux26.alg");
- decompressPic(dir_dibujo3, 1);
- loadPic("auxigor.alg");
- decompressPic(dir_hare_frente, 1);
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ loadPic(26, bgSurface, HALF_PAL);
+ loadPic("aux26.alg", drawSurface3);
+ loadPic("auxigor.alg", frontSurface);
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
update_26_pre();
- x_igor = 104;
- y_igor = 71;
- pon_igor();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ igorX = 104;
+ igorY = 71;
+ placeIgor();
+ updateScreen();
pause(40);
- talk_igor_frente(_texti[_lang][26], "I26.als");
- strcpy(num_room, room);
+ talk_igor(26, kIgorFront);
+ roomNumber = prevRoom;
clearRoom();
- loadPic("96.alg");
- decompressPic(dir_hare_frente, 1);
- loadPic(roomDisk);
- decompressPic(dir_dibujo3, 1);
- loadPic(num_room);
- decompressPic(dir_dibujo1, MEDIA);
- sin_verbo();
+ loadPic(96, frontSurface);
+ loadPic(roomDisk, drawSurface3);
+ loadPic(roomNumber, bgSurface, HALF_PAL);
+ withoutVerb();
updateRoom();
}
void DrasculaEngine::animation_8_4() {
- int frame;
- int estanteria_x[] = {1, 75, 149, 223, 1, 75, 149, 223, 149, 223, 149, 223, 149, 223};
- int estanteria_y[] = {1, 1, 1, 1, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74};
+ int bookcaseX[] = {1, 75, 149, 223, 1, 75, 149, 223, 149, 223, 149, 223, 149, 223};
+ int bookcaseY[] = {1, 1, 1, 1, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74};
- loadPic("an_8.alg");
- decompressPic(dir_hare_frente, 1);
+ loadPic("an_8.alg", frontSurface);
- for (frame = 0; frame < 14; frame++) {
+ for (int frame = 0; frame < 14; frame++) {
pause(2);
- copyBackground(estanteria_x[frame], estanteria_y[frame], 77, 45, 73, 72, dir_hare_frente, dir_zona_pantalla);
- updateScreen(77, 45, 77, 45, 73, 72, dir_zona_pantalla);
+ copyBackground(bookcaseX[frame], bookcaseY[frame], 77, 45, 73, 72, frontSurface, screenSurface);
+ updateScreen(77, 45, 77, 45, 73, 72, screenSurface);
}
- loadPic("96.alg");
- decompressPic(dir_hare_frente, 1);
- abre_puerta(7, 2);
+ loadPic(96, frontSurface);
+ openDoor(7, 2);
}
void DrasculaEngine::animation_9_4() {
- anima("st.bin", 14);
- FundeAlNegro(1);
+ animate("st.bin", 14);
+ fadeToBlack(1);
}
+void DrasculaEngine::activatePendulum() {
+ flags[1] = 2;
+ hare_se_ve = 0;
+ roomNumber = 102;
+ loadPic(102, bgSurface, HALF_PAL);
+ loadPic("an_p1.alg", drawSurface3);
+ loadPic("an_p2.alg", extraSurface);
+ loadPic("an_p3.alg", frontSurface);
+
+ copyBackground(0, 171, 0, 0, OBJWIDTH, OBJHEIGHT, backSurface, drawSurface3);
+
+ savedTime = getTime();
+}
} // End of namespace Drascula
diff --git a/engines/drascula/converse.cpp b/engines/drascula/converse.cpp
new file mode 100644
index 0000000000..1c3831e4ca
--- /dev/null
+++ b/engines/drascula/converse.cpp
@@ -0,0 +1,297 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "drascula/drascula.h"
+
+namespace Drascula {
+
+void DrasculaEngine::converse(int index) {
+ char fileName[20];
+ sprintf(fileName, "op_%d.cal", index);
+ uint h;
+ int game1 = 1, game2 = 1, game3 = 1, game4 = 1;
+ char phrase1[78];
+ char phrase2[78];
+ char phrase3[87];
+ char phrase4[78];
+ char sound1[13];
+ char sound2[13];
+ char sound3[13];
+ char sound4[13];
+ int answer1;
+ int answer2;
+ int answer3;
+ int used1 = 0;
+ int used2 = 0;
+ int used3 = 0;
+ char buffer[256];
+ uint len;
+
+ breakOut = 0;
+
+ if (currentChapter == 5)
+ withoutVerb();
+
+ _arj.open(fileName);
+ if (!_arj.isOpen()) {
+ error("missing data file %s", fileName);
+ }
+ int size = _arj.size();
+
+ getStringFromLine(buffer, size, phrase1);
+ getStringFromLine(buffer, size, phrase2);
+ getStringFromLine(buffer, size, phrase3);
+ getStringFromLine(buffer, size, phrase4);
+ getStringFromLine(buffer, size, sound1);
+ getStringFromLine(buffer, size, sound2);
+ getStringFromLine(buffer, size, sound3);
+ getStringFromLine(buffer, size, sound4);
+ getIntFromLine(buffer, size, &answer1);
+ getIntFromLine(buffer, size, &answer2);
+ getIntFromLine(buffer, size, &answer3);
+
+ _arj.close();
+
+ if (currentChapter == 2 && !strcmp(fileName, "op_5.cal") && flags[38] == 1 && flags[33] == 1) {
+ strcpy(phrase3, _text[_lang][405]);
+ strcpy(sound3, "405.als");
+ answer3 = 31;
+ }
+
+ if (currentChapter == 6 && !strcmp(fileName, "op_12.cal") && flags[7] == 1) {
+ strcpy(phrase3, _text[_lang][273]);
+ strcpy(sound3, "273.als");
+ answer3 = 14;
+ }
+
+ if (currentChapter == 6 && !strcmp(fileName, "op_12.cal") && flags[10] == 1) {
+ strcpy(phrase3, _text[_lang][274]);
+ strcpy(sound3, "274.als");
+ answer3 = 15;
+ }
+
+ len = strlen(phrase1);
+ for (h = 0; h < len; h++)
+ if (phrase1[h] == (char)0xa7)
+ phrase1[h] = ' ';
+
+ len = strlen(phrase2);
+ for (h = 0; h < len; h++)
+ if (phrase2[h] == (char)0xa7)
+ phrase2[h] = ' ';
+
+ len = strlen(phrase3);
+ for (h = 0; h < len; h++)
+ if (phrase3[h] == (char)0xa7)
+ phrase3[h] = ' ';
+
+ len = strlen(phrase4);
+ for (h = 0; h < len; h++)
+ if (phrase4[h] == (char)0xa7)
+ phrase4[h] = ' ';
+
+ loadPic("car.alg", backSurface);
+ // TODO code here should limit y position for mouse in dialog menu,
+ // but we can't implement this due lack backend functionality
+ // from 1(top) to 31
+ color_abc(kColorLightGreen);
+
+ while (breakOut == 0) {
+ updateRoom();
+
+ if (currentChapter == 1 || currentChapter == 4 || currentChapter == 6) {
+ if (musicStatus() == 0 && flags[11] == 0)
+ playMusic(roomMusic);
+ } else if (currentChapter == 2) {
+ if (musicStatus() == 0 && flags[11] == 0 && roomMusic != 0)
+ playMusic(roomMusic);
+ } else if (currentChapter == 3 || currentChapter == 5) {
+ if (musicStatus() == 0)
+ playMusic(roomMusic);
+ }
+
+ updateEvents();
+
+ if (mouseY > 0 && mouseY < 9) {
+ if (used1 == 1 && _color != kColorWhite)
+ color_abc(kColorWhite);
+ else if (used1 == 0 && _color != kColorLightGreen)
+ color_abc(kColorLightGreen);
+ } else if (mouseY > 8 && mouseY < 17) {
+ if (used2 == 1 && _color != kColorWhite)
+ color_abc(kColorWhite);
+ else if (used2 == 0 && _color != kColorLightGreen)
+ color_abc(kColorLightGreen);
+ } else if (mouseY > 16 && mouseY < 25) {
+ if (used3 == 1 && _color != kColorWhite)
+ color_abc(kColorWhite);
+ else if (used3 == 0 && _color != kColorLightGreen)
+ color_abc(kColorLightGreen);
+ } else if (_color != kColorLightGreen)
+ color_abc(kColorLightGreen);
+
+ if (mouseY > 0 && mouseY < 9)
+ game1 = 2;
+ else if (mouseY > 8 && mouseY < 17)
+ game2 = 2;
+ else if (mouseY > 16 && mouseY < 25)
+ game3 = 2;
+ else if (mouseY > 24 && mouseY < 33)
+ game4 = 2;
+
+ print_abc_opc(phrase1, 1, 2, game1);
+ print_abc_opc(phrase2, 1, 10, game2);
+ print_abc_opc(phrase3, 1, 18, game3);
+ print_abc_opc(phrase4, 1, 26, game4);
+
+ updateScreen();
+
+ if ((leftMouseButton == 1) && (game1 == 2)) {
+ delay(100);
+ used1 = 1;
+ talk(phrase1, sound1);
+ if (currentChapter == 3)
+ grr();
+ else
+ response(answer1);
+ } else if ((leftMouseButton == 1) && (game2 == 2)) {
+ delay(100);
+ used2 = 1;
+ talk(phrase2, sound2);
+ if (currentChapter == 3)
+ grr();
+ else
+ response(answer2);
+ } else if ((leftMouseButton == 1) && (game3 == 2)) {
+ delay(100);
+ used3 = 1;
+ talk(phrase3, sound3);
+ if (currentChapter == 3)
+ grr();
+ else
+ response(answer3);
+ } else if ((leftMouseButton == 1) && (game4 == 2)) {
+ delay(100);
+ talk(phrase4, sound4);
+ breakOut = 1;
+ }
+
+ if (leftMouseButton == 1) {
+ delay(100);
+ color_abc(kColorLightGreen);
+ }
+
+ game1 = (used1 == 0) ? 1 : 3;
+ game2 = (used2 == 0) ? 1 : 3;
+ game3 = (used3 == 0) ? 1 : 3;
+ game4 = 1;
+ } // while (breakOut == 0)
+
+ if (currentChapter == 2)
+ loadPic(menuBackground, backSurface);
+ else
+ loadPic(99, backSurface);
+ if (currentChapter != 5)
+ withoutVerb();
+}
+
+void DrasculaEngine::response(int function) {
+ if (currentChapter == 1) {
+ if (function >= 10 && function <= 12)
+ talk_drunk(function - 9);
+ } else if (currentChapter == 2) {
+ if (function == 8)
+ animation_8_2();
+ else if (function == 9)
+ animation_9_2();
+ else if (function == 10)
+ animation_10_2();
+ else if (function == 15)
+ animation_15_2();
+ else if (function == 16)
+ animation_16_2();
+ else if (function == 17)
+ animation_17_2();
+ else if (function == 19)
+ animation_19_2();
+ else if (function == 20)
+ animation_20_2();
+ else if (function == 21)
+ animation_21_2();
+ else if (function == 23)
+ animation_23_2();
+ else if (function == 28)
+ animation_28_2();
+ else if (function == 29)
+ animation_29_2();
+ else if (function == 30)
+ animation_30_2();
+ else if (function == 31)
+ animation_31_2();
+ } else if (currentChapter == 4) {
+ if (function == 2)
+ animation_2_4();
+ else if (function == 3)
+ animation_3_4();
+ else if (function == 4)
+ animation_4_4();
+ } else if (currentChapter == 5) {
+ if (function == 2)
+ animation_2_5();
+ else if (function == 3)
+ animation_3_5();
+ else if (function == 6)
+ animation_6_5();
+ else if (function == 7)
+ animation_7_5();
+ else if (function == 8)
+ animation_8_5();
+ else if (function == 15)
+ animation_15_5();
+ else if (function == 16)
+ animation_16_5();
+ else if (function == 17)
+ animation_17_5();
+ } else if (currentChapter == 6) {
+ if (function == 2)
+ animation_2_6();
+ else if (function == 3)
+ animation_3_6();
+ else if (function == 4)
+ animation_4_6();
+ else if (function == 11)
+ animation_11_6();
+ else if (function == 12)
+ animation_12_6();
+ else if (function == 13)
+ animation_13_6();
+ else if (function == 14)
+ animation_14_6();
+ else if (function == 15)
+ animation_15_6();
+ }
+}
+
+} // End of namespace Drascula
diff --git a/engines/drascula/detection.cpp b/engines/drascula/detection.cpp
index 80ea4f0eab..a426857fbd 100644
--- a/engines/drascula/detection.cpp
+++ b/engines/drascula/detection.cpp
@@ -35,27 +35,25 @@ namespace Drascula {
struct DrasculaGameDescription {
Common::ADGameDescription desc;
-
- int gameID;
- int gameType;
- uint32 features;
- uint16 version;
};
-uint32 DrasculaEngine::getGameID() const {
- return _gameDescription->gameID;
-}
-
uint32 DrasculaEngine::getFeatures() const {
- return _gameDescription->features;
+ return _gameDescription->desc.flags;
}
-Common::Platform DrasculaEngine::getPlatform() const {
- return _gameDescription->desc.platform;
+Common::Language DrasculaEngine::getLanguage() const {
+ return _gameDescription->desc.language;
}
-uint16 DrasculaEngine::getVersion() const {
- return _gameDescription->version;
+void DrasculaEngine::loadArchives() {
+ const Common::ADGameFileDescription *ag;
+
+ if (getFeatures() & GF_PACKED) {
+ for (ag = _gameDescription->desc.filesDescriptions; ag->fileName; ag++)
+ _arj.registerArchive(ag->fileName);
+ }
+
+ _arj.enableFallback(true);
}
}
@@ -75,53 +73,129 @@ static const DrasculaGameDescription gameDescriptions[] = {
{
"drascula",
0,
- AD_ENTRY1("14.ald", "09b2735953edcd43af115c65ae00b10e"),
+ AD_ENTRY1s("14.ald", "09b2735953edcd43af115c65ae00b10e", 1595),
Common::EN_ANY,
Common::kPlatformPC,
Common::ADGF_NO_FLAGS
},
- 0,
- 0,
- 0,
- 0,
},
-/*
+
+ {
+ // Drascula English version (original packed files)
+ {
+ "drascula",
+ 0,
+ AD_ENTRY1s("packet.001", "c6a8697396e213a18472542d5f547cb4", 32847563),
+ Common::EN_ANY,
+ Common::kPlatformPC,
+ Common::ADGF_KEEPMATCH | GF_PACKED
+ },
+ },
+
+ {
+ // Drascula German version (original packed files)
+ {
+ "drascula",
+ 0,
+ {
+ {"packet.001", 0, "c6a8697396e213a18472542d5f547cb4", 32847563},
+ {"packet.003", 0, "e8f4dc6091037329bab4ddb1cba35807", 719728},
+ {NULL, 0, NULL, 0}
+ },
+ Common::DE_DEU,
+ Common::kPlatformPC,
+ GF_PACKED
+ },
+ },
+
+ {
+ // Drascula French version (original packed files)
+ {
+ "drascula",
+ 0,
+ {
+ {"packet.001", 0, "c6a8697396e213a18472542d5f547cb4", 32847563},
+ {"packet.002", 0, "4401123400f22f212b89f15fb4b43013", 721122},
+ {NULL, 0, NULL, 0}
+ },
+ Common::FR_FRA,
+ Common::kPlatformPC,
+ GF_PACKED
+ },
+ },
+
+ {
+ // Drascula Spanish version (original packed version)
+ {
+ "drascula",
+ 0,
+ AD_ENTRY1s("packet.001", "3c971aba65a037d29d0b479cad6f5943", 31702652),
+ Common::ES_ESP,
+ Common::kPlatformPC,
+ GF_PACKED
+ },
+ },
+
{
// Drascula Spanish version
{
"drascula",
0,
- AD_ENTRY1("14.ald", "0746ed1a5cc8d9728f790c29813f4b43"),
+ AD_ENTRY1s("14.ald", "0746ed1a5cc8d9728f790c29813f4b43", 23059),
Common::ES_ESP,
Common::kPlatformPC,
Common::ADGF_NO_FLAGS
},
- 0,
- 0,
- 0,
- 0,
- },*/
+ },
- { AD_TABLE_END_MARKER, 0, 0, 0, 0 }
-};
+ {
+ // Drascula German version
+ {
+ "drascula",
+ 0,
+ AD_ENTRY1s("14.ald", "72e46089033d56bad1c179ac36e2a9d2", 610),
+ Common::DE_DEU,
+ Common::kPlatformPC,
+ Common::ADGF_NO_FLAGS
+ },
+ },
-/**
- * The fallback game descriptor used by the Drascula engine's fallbackDetector.
- * Contents of this struct are to be overwritten by the fallbackDetector.
- */
-static DrasculaGameDescription g_fallbackDesc = {
{
- "",
- "",
- AD_ENTRY1(0, 0), // This should always be AD_ENTRY1(0, 0) in the fallback descriptor
- Common::UNK_LANG,
- Common::kPlatformPC,
- Common::ADGF_NO_FLAGS
+ // Drascula French version
+ {
+ "drascula",
+ 0,
+ AD_ENTRY1s("14.ald", "eeeee96b82169003630e08992248296c", 608),
+ Common::FR_FRA,
+ Common::kPlatformPC,
+ Common::ADGF_NO_FLAGS
+ },
},
- 0,
- 0,
- 0,
- 0,
+
+ {
+ // Drascula Italian version (original packed version)
+ {
+ "drascula",
+ 0,
+ AD_ENTRY1s("packet.001", "0253e924af223f5fe52537023385159b", 32564209),
+ Common::IT_ITA,
+ Common::kPlatformPC,
+ GF_PACKED
+ },
+ },
+ {
+ // Drascula Italian version
+ {
+ "drascula",
+ 0,
+ AD_ENTRY1s("14.ald", "02b49a18328d0bf2efe6ba658c9c7a1d", 2098),
+ Common::IT_ITA,
+ Common::kPlatformPC,
+ Common::ADGF_NO_FLAGS
+ },
+ },
+
+ { AD_TABLE_END_MARKER }
};
} // End of namespace Drascula
@@ -158,9 +232,6 @@ public:
}
virtual bool createInstance(OSystem *syst, Engine **engine, const Common::ADGameDescription *desc) const;
-
- const Common::ADGameDescription *fallbackDetect(const FSList *fslist) const;
-
};
bool DrasculaMetaEngine::createInstance(OSystem *syst, Engine **engine, const Common::ADGameDescription *desc) const {
@@ -171,20 +242,6 @@ bool DrasculaMetaEngine::createInstance(OSystem *syst, Engine **engine, const Co
return gd != 0;
}
-const Common::ADGameDescription *DrasculaMetaEngine::fallbackDetect(const FSList *fslist) const {
- // Set the default values for the fallback descriptor's ADGameDescription part.
- Drascula::g_fallbackDesc.desc.language = Common::UNK_LANG;
- Drascula::g_fallbackDesc.desc.platform = Common::kPlatformPC;
- Drascula::g_fallbackDesc.desc.flags = Common::ADGF_NO_FLAGS;
-
- // Set default values for the fallback descriptor's DrasculaGameDescription part.
- Drascula::g_fallbackDesc.gameID = 0;
- Drascula::g_fallbackDesc.features = 0;
- Drascula::g_fallbackDesc.version = 0;
-
- return (const Common::ADGameDescription *)&Drascula::g_fallbackDesc;
-}
-
#if PLUGIN_ENABLED_DYNAMIC(DRASCULA)
REGISTER_PLUGIN_DYNAMIC(DRASCULA, PLUGIN_TYPE_ENGINE, DrasculaMetaEngine);
#else
diff --git a/engines/drascula/drascula.cpp b/engines/drascula/drascula.cpp
index 89bb6e530d..1cbe2ae0e1 100644
--- a/engines/drascula/drascula.cpp
+++ b/engines/drascula/drascula.cpp
@@ -58,13 +58,6 @@ DrasculaEngine::DrasculaEngine(OSystem *syst, const DrasculaGameDescription *gam
_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume"));
_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume"));
- const GameSettings *g;
-
- const char *gameid = ConfMan.get("gameid").c_str();
- for (g = drasculaSettings; g->gameid; ++g)
- if (!scumm_stricmp(g->gameid, gameid))
- _gameId = g->id;
-
_rnd = new Common::RandomSource();
syst->getEventManager()->registerRandomSource(*_rnd, "drascula");
@@ -77,35 +70,38 @@ DrasculaEngine::DrasculaEngine(OSystem *syst, const DrasculaGameDescription *gam
DrasculaEngine::~DrasculaEngine() {
delete _rnd;
-}
-static const int x_obj[44] = {0, X_OBJ1, X_OBJ2, X_OBJ3, X_OBJ4, X_OBJ5, X_OBJ6, X_OBJ7, X_OBJ8, X_OBJ9, X_OBJ10,
- X_OBJ11, X_OBJ12, X_OBJ13, X_OBJ14, X_OBJ15, X_OBJ16, X_OBJ17, X_OBJ18, X_OBJ19, X_OBJ20,
- X_OBJ21, X_OBJ22, X_OBJ23, X_OBJ24, X_OBJ25, X_OBJ26, X_OBJ27, X_OBJ28, X_OBJ29, X_OBJ30,
- X_OBJ31, X_OBJ32, X_OBJ33, X_OBJ34, X_OBJ35, X_OBJ36, X_OBJ37, X_OBJ38, X_OBJ39, X_OBJ40,
- X_OBJ41, X_OBJ42, X_OBJ43};
-static const int y_obj[44] = {0, Y_OBJ1, Y_OBJ2, Y_OBJ3, Y_OBJ4, Y_OBJ5, Y_OBJ6, Y_OBJ7, Y_OBJ8, Y_OBJ9, Y_OBJ10,
- Y_OBJ11, Y_OBJ12, Y_OBJ13, Y_OBJ14, Y_OBJ15, Y_OBJ16, Y_OBJ17, Y_OBJ18, Y_OBJ19, Y_OBJ20,
- Y_OBJ21, Y_OBJ22, Y_OBJ23, Y_OBJ24, Y_OBJ25, Y_OBJ26, Y_OBJ27, Y_OBJ28, Y_OBJ29, Y_OBJ30,
- Y_OBJ31, Y_OBJ32, Y_OBJ33, Y_OBJ34, Y_OBJ35, Y_OBJ36, Y_OBJ37, Y_OBJ38, Y_OBJ39, Y_OBJ40,
- Y_OBJ41, Y_OBJ42, Y_OBJ43};
-static const int x_pol[44] = {0, 1, 42, 83, 124, 165, 206, 247, 83, 1, 206,
- 1, 42, 83, 124, 165, 206, 247, 83, 1, 206,
- 247, 83, 165, 1, 206, 42, 124, 83, 1, 247,
- 83, 165, 1, 206, 42, 124, 83, 1, 247, 42,
- 1, 165, 206};
-static const int y_pol[44] = {0, 1, 1, 1, 1, 1, 1, 1, 27, 27, 1,
- 27, 27, 27, 27, 27, 27, 27, 1, 1, 27,
- 1, 1, 1, 1, 1, 27, 27, 27, 27, 27,
- 1, 1, 1, 1, 1, 27, 27, 27, 27, 27,
- 27, 1, 1};
-static const int x_barra[] = {6, 51, 96, 141, 186, 232, 276, 321};
-static const int x1d_menu[] = {280, 40, 80, 120, 160, 200, 240, 0, 40, 80, 120,
- 160, 200, 240, 0, 40, 80, 120, 160, 200, 240, 0,
- 40, 80, 120, 160, 200, 240, 0};
-static const int y1d_menu[] = {0, 0, 0, 0, 0, 0, 0, 25, 25, 25, 25, 25, 25, 25,
- 50, 50, 50, 50, 50, 50, 50, 75, 75, 75, 75, 75, 75, 75, 100};
-static int frame_x[20] = {43, 87, 130, 173, 216, 259};
+ free(_charMap);
+ free(_itemLocations);
+ free(_polX);
+ free(_polY);
+ free(_verbBarX);
+ free(_x1d_menu);
+ free(_y1d_menu);
+ free(_frameX);
+ free(_candleX);
+ free(_candleY);
+ free(_pianistX);
+ free(_drunkX);
+ free(_roomPreUpdates);
+ free(_roomUpdates);
+ free(_roomActions);
+ freeTexts(_text);
+ freeTexts(_textd);
+ freeTexts(_textb);
+ freeTexts(_textbj);
+ freeTexts(_texte);
+ freeTexts(_texti);
+ freeTexts(_textl);
+ freeTexts(_textp);
+ freeTexts(_textt);
+ freeTexts(_textvb);
+ freeTexts(_textsys);
+ freeTexts(_texthis);
+ freeTexts(_textverbs);
+ freeTexts(_textmisc);
+ freeTexts(_textd1);
+}
int DrasculaEngine::init() {
// Initialize backend
@@ -114,764 +110,469 @@ int DrasculaEngine::init() {
_system->initSize(320, 200);
_system->endGFXTransaction();
+ switch (getLanguage()) {
+ case Common::EN_ANY:
+ _lang = 0;
+ break;
+ case Common::ES_ESP:
+ _lang = 1;
+ break;
+ case Common::DE_DEU:
+ _lang = 2;
+ break;
+ case Common::FR_FRA:
+ _lang = 3;
+ break;
+ case Common::IT_ITA:
+ _lang = 4;
+ break;
+ default:
+ warning("Unknown game language. Falling back to English");
+ _lang = 0;
+ }
+
+ _charMap = 0;
+ _itemLocations = 0;
+ _polX = 0;
+ _polY = 0;
+ _verbBarX = 0;
+ _x1d_menu = 0;
+ _y1d_menu = 0;
+ _frameX = 0;
+ _candleX = 0;
+ _candleY = 0;
+ _pianistX = 0;
+ _drunkX = 0;
+ _roomPreUpdates = 0;
+ _roomUpdates = 0;
+ _roomActions = 0;
+ _text = 0;
+ _textd = 0;
+ _textb = 0;
+ _textbj = 0;
+ _texte = 0;
+ _texti = 0;
+ _textl = 0;
+ _textp = 0;
+ _textt = 0;
+ _textvb = 0;
+ _textsys = 0;
+ _texthis = 0;
+ _textverbs = 0;
+ _textmisc = 0;
+ _textd1 = 0;
+
+ if (!loadDrasculaDat())
+ return 1;
+
+ setupRoomsTable();
+ loadArchives();
+
return 0;
}
int DrasculaEngine::go() {
- num_ejec = 1; // values from 1 to 6 will start each part of game
+ currentChapter = 1; // values from 1 to 6 will start each part of game
hay_que_load = 0;
for (;;) {
+ int i;
+
VGA = (byte *)malloc(320 * 200);
memset(VGA, 0, 64000);
- lleva_objeto = 0;
- menu_bar = 0; menu_scr = 0; hay_nombre = 0;
+ takeObject = 0;
+ menuBar = 0; menuScreen = 0; hasName = 0;
frame_y = 0;
- hare_x = -1; hare_se_mueve = 0; sentido_hare = 3; num_frame = 0; hare_se_ve = 1;
- comprueba_flags = 1;
- rompo = 0; rompo2 = 0;
- anda_a_objeto = 0;
- paso_x = PASO_HARE_X; paso_y = PASO_HARE_Y;
- alto_hare = ALTO_PERSONAJE; ancho_hare = ANCHO_PERSONAJE; alto_pies = PIES_HARE;
- alto_talk = ALTO_TALK_HARE; ancho_talk = ANCHO_TALK_HARE;
- hay_respuesta = 0;
- conta_ciego_vez = 0;
- cambio_de_color = 0;
- rompo_y_salgo = 0;
- vb_x = 120; sentido_vb = 1; vb_se_mueve = 0; frame_vb = 1;
- frame_piano = 0;
- frame_borracho = 0;
- frame_velas = 0;
- cont_sv = 0;
+ curX = -1; characterMoved = 0; trackProtagonist = 3; num_frame = 0; hare_se_ve = 1;
+ checkFlags = 1;
+ doBreak = 0;
+ walkToObject = 0;
+ stepX = STEP_X; stepY = STEP_Y;
+ curHeight = CHARACTER_HEIGHT; curWidth = CHARACTER_WIDTH; feetHeight = FEET_HEIGHT;
+ talkHeight = TALK_HEIGHT; talkWidth = TALK_WIDTH;
+ hasAnswer = 0;
+ savedTime = 0;
+ changeColor = 0;
+ breakOut = 0;
+ vonBraunX = 120; trackVonBraun = 1; vonBraunHasMoved = 0;
+ framesWithoutAction = 0;
term_int = 0;
- corta_musica = 0;
- hay_seleccion = 0;
- Leng = 0;
+ musicStopped = 0;
+ selectionMade = 0;
UsingMem = 0;
- GlobalSpeed = 0;
- frame_ciego = 0;
- frame_ronquido = 0;
- frame_murcielago = 0;
- c_mirar = 0;
- c_poder = 0;
- ald = NULL;
- sku = NULL;
-
- asigna_memoria();
-
- hay_sb = 1;
- con_voces = 0;
- hay_seleccion = 0;
-
- if (num_ejec != 6) {
- loadPic("95.alg");
- decompressPic(dir_mesa, 1);
- }
-
- if (num_ejec == 1) {
- loadPic("96.alg");
- decompressPic(dir_hare_frente, COMPLETA);
- loadPic("99.alg");
- decompressPic(dir_hare_fondo, 1);
- loadPic("97.alg");
- decompressPic(dir_hare_dch, 1);
- } else if (num_ejec == 2) {
- loadPic("96.alg");
- decompressPic(dir_hare_frente, COMPLETA);
- loadPic("pts.alg");
- decompressPic(dir_dibujo2, 1);
- } else if (num_ejec == 3) {
- loadPic("aux13.alg");
- decompressPic(dir_dibujo1, COMPLETA);
- loadPic("96.alg");
- decompressPic(dir_hare_frente, 1);
- loadPic("97.alg");
- decompressPic(dir_hare_dch, 1);
- loadPic("99.alg");
- decompressPic(dir_hare_fondo, 1);
- } else if (num_ejec == 4) {
- loadPic("96.alg");
- decompressPic(dir_hare_frente, COMPLETA);
+ globalSpeed = 0;
+ curExcuseLook = 0;
+ curExcuseAction = 0;
+ roomNumber = 0;
+
+ for (i = 0; i < 8; i++)
+ actorFrames[i] = 0;
+ actorFrames[kFrameVonBraun] = 1;
+
+ allocMemory();
+
+ withVoices = 0;
+ selectionMade = 0;
+
+ if (currentChapter != 6)
+ loadPic(95, tableSurface);
+
+ if (currentChapter == 1) {
+ loadPic(96, frontSurface, COMPLETE_PAL);
+ loadPic(99, backSurface);
+ loadPic(97, extraSurface);
+ } else if (currentChapter == 2) {
+ loadPic(96, frontSurface, COMPLETE_PAL);
+ loadPic("pts.alg", drawSurface2);
+ } else if (currentChapter == 3) {
+ loadPic("aux13.alg", bgSurface, COMPLETE_PAL);
+ loadPic(96, frontSurface);
+ loadPic(97, extraSurface);
+ loadPic(99, backSurface);
+ } else if (currentChapter == 4) {
+ loadPic(96, frontSurface, COMPLETE_PAL);
if (hay_que_load == 0)
- animation_rayo();
- loadPic("96.alg");
- decompressPic(dir_hare_frente, 1);
+ animation_ray();
+ loadPic(96, frontSurface);
clearRoom();
- loadPic("99.alg");
- decompressPic(dir_hare_fondo, 1);
- loadPic("97.alg");
- decompressPic(dir_hare_dch, 1);
- } else if (num_ejec == 5) {
- loadPic("96.alg");
- decompressPic(dir_hare_frente, COMPLETA);
- loadPic("97.alg");
- decompressPic(dir_hare_dch, 1);
- loadPic("99.alg");
- decompressPic(dir_hare_fondo, 1);
- } else if (num_ejec == 6) {
- x_igor = 105, y_igor = 85, sentido_igor = 1;
- x_dr = 62, y_dr = 99, sentido_dr = 1;
- frame_pen = 0;
+ loadPic(99, backSurface);
+ loadPic(97, extraSurface);
+ } else if (currentChapter == 5) {
+ loadPic(96, frontSurface, COMPLETE_PAL);
+ loadPic(97, extraSurface);
+ loadPic(99, backSurface);
+ } else if (currentChapter == 6) {
+ igorX = 105, igorY = 85, trackIgor = 1;
+ drasculaX = 62, drasculaY = 99, trackDrascula = 1;
+ actorFrames[kFramePendulum] = 0;
flag_tv = 0;
- dir_pendulo = dir_dibujo3;
+ loadPic(96, frontSurface, COMPLETE_PAL);
+ loadPic(99, backSurface);
+ loadPic(97, extraSurface);
+ loadPic(95, tableSurface);
+ }
+ memset(iconName, 0, sizeof(iconName));
- loadPic("96.alg");
- decompressPic(dir_hare_frente, COMPLETA);
- loadPic("99.alg");
- decompressPic(dir_hare_fondo, 1);
- loadPic("97.alg");
- decompressPic(dir_hare_dch, 1);
+ for (i = 0; i < 6; i++)
+ strcpy(iconName[i + 1], _textverbs[_lang][i]);
- loadPic("95.alg");
- decompressPic(dir_mesa, 1);
- }
- memset(nombre_icono, 0, sizeof(nombre_icono));
- strcpy(nombre_icono[1], "look");
- strcpy(nombre_icono[2], "take");
- strcpy(nombre_icono[3], "open");
- strcpy(nombre_icono[4], "close");
- strcpy(nombre_icono[5], "talk");
- strcpy(nombre_icono[6], "push");
-
- paleta_hare();
- if (!escoba()) {
- salir_al_dos(0);
+ assignDefaultPalette();
+ if (!runCurrentChapter()) {
+ endChapter();
break;
}
- salir_al_dos(0);
- if (num_ejec == 6)
+ endChapter();
+ if (currentChapter == 6)
break;
- num_ejec++;
+ currentChapter++;
}
return 0;
}
-void DrasculaEngine::salir_al_dos(int r) {
- if (hay_sb == 1)
- ctvd_end();
+void DrasculaEngine::endChapter() {
+ stopSound();
clearRoom();
- Negro();
+ black();
MusicFadeout();
- stopmusic();
- libera_memoria();
+ stopMusic();
+ freeMemory();
free(VGA);
}
-void DrasculaEngine::asigna_memoria() {
- dir_zona_pantalla = (byte *)malloc(64000);
- assert(dir_zona_pantalla);
- dir_dibujo1 = (byte *)malloc(64000);
- assert(dir_dibujo1);
- dir_hare_fondo = (byte *)malloc(64000);
- assert(dir_hare_fondo);
- dir_dibujo3 = (byte *)malloc(64000);
- assert(dir_dibujo3);
- dir_dibujo2 = (byte *)malloc(64000);
- assert(dir_dibujo2);
- dir_mesa = (byte *)malloc(64000);
- assert(dir_mesa);
- dir_hare_dch = (byte *)malloc(64000);
- assert(dir_hare_dch);
- dir_hare_frente = (byte *)malloc(64000);
- assert(dir_hare_frente);
-}
-
-void DrasculaEngine::libera_memoria() {
- free(dir_zona_pantalla);
- free(dir_dibujo1);
- free(dir_hare_fondo);
- free(dir_dibujo2);
- free(dir_mesa);
- free(dir_dibujo3);
- free(dir_hare_dch);
- free(dir_hare_frente);
-}
-
-void DrasculaEngine::loadPic(const char *NamePcc) {
- unsigned int con, x = 0;
- unsigned int fExit = 0;
- byte ch, rep;
- Common::File file;
- byte *auxPun;
-
- file.open(NamePcc);
- if (!file.isOpen())
- error("missing game data %s %c", NamePcc, 7);
-
- Buffer_pcx = (byte *)malloc(65000);
- auxPun = Buffer_pcx;
- file.seek(128);
- while (!fExit) {
- ch = file.readByte();
- rep = 1;
- if ((ch & 192) == 192) {
- rep = (ch & 63);
- ch = file.readByte();
- }
- for (con = 0; con < rep; con++) {
- *auxPun++ = ch;
- x++;
- if (x > 64000)
- fExit = 1;
- }
- }
-
- file.read(cPal, 768);
- file.close();
-}
-
-void DrasculaEngine::decompressPic(byte *dir_escritura, int plt) {
- memcpy(dir_escritura, Buffer_pcx, 64000);
- free(Buffer_pcx);
- asigna_rgb((byte *)cPal, plt);
- if (plt > 1)
- funde_rgb(plt);
-}
-
-void DrasculaEngine::paleta_hare() {
- int color, componente;
-
- for (color = 235; color < 253; color++)
- for (componente = 0; componente < 3; componente++)
- palHare[color][componente] = palJuego[color][componente];
-
-}
-
-void DrasculaEngine::hare_oscuro() {
- int color, componente;
-
- for (color = 235; color < 253; color++ )
- for (componente = 0; componente < 3; componente++)
- palJuego[color][componente] = palHareOscuro[color][componente];
-
- ActualizaPaleta();
-}
-
-void DrasculaEngine::asigna_rgb(byte *dir_lectura, int plt) {
- int x, cnt = 0;
-
- for (x = 0; x < plt; x++) {
- palJuego[x][0] = dir_lectura[cnt++] / 4;
- palJuego[x][1] = dir_lectura[cnt++] / 4;
- palJuego[x][2] = dir_lectura[cnt++] / 4;
- }
- ActualizaPaleta();
-}
-
-void DrasculaEngine::funde_rgb(int plt) {}
-
-void DrasculaEngine::Negro() {
- int color, componente;
- DacPalette256 palNegra;
-
- for (color = 0; color < 256; color++)
- for (componente = 0; componente < 3; componente++)
- palNegra[color][componente] = 0;
-
- palNegra[254][0] = 0x3F;
- palNegra[254][1] = 0x3F;
- palNegra[254][2] = 0x15;
-
- setvgapalette256((byte *)&palNegra);
-}
-
-void DrasculaEngine::ActualizaPaleta() {
- setvgapalette256((byte *)&palJuego);
-}
-
-void DrasculaEngine::setvgapalette256(byte *PalBuf) {
- byte pal[256 * 4];
- int i;
-
- for (i = 0; i < 256; i++) {
- pal[i * 4 + 0] = PalBuf[i * 3 + 0] * 4;
- pal[i * 4 + 1] = PalBuf[i * 3 + 1] * 4;
- pal[i * 4 + 2] = PalBuf[i * 3 + 2] * 4;
- pal[i * 4 + 3] = 0;
- }
- _system->setPalette(pal, 0, 256);
- _system->updateScreen();
-}
-
-void DrasculaEngine::copyBackground(int xorg, int yorg, int xdes, int ydes, int Ancho,
- int Alto, byte *Origen, byte *Destino) {
- int x;
- Destino += xdes + ydes * 320;
- Origen += xorg + yorg * 320;
- for (x = 0; x < Alto; x++) {
- memcpy(Destino, Origen, Ancho);
- Destino += 320;
- Origen += 320;
- }
-}
-
-void DrasculaEngine::copyRect(int xorg, int yorg, int xdes, int ydes, int Ancho,
- int Alto, byte *Origen, byte *Destino) {
- int y, x;
-
- Destino += xdes + ydes * 320;
- Origen += xorg + yorg * 320;
-
- for (y = 0; y < Alto; y++)
- for (x = 0; x < Ancho; x++)
- if (Origen[x + y * 320] != 255)
- Destino[x + y * 320] = Origen[x + y * 320];
-}
-
-void DrasculaEngine::copyRectClip(int *Array, byte *Origen, byte *Destino) {
- int y, x;
- int xorg = Array[0];
- int yorg = Array[1];
- int xdes = Array[2];
- int ydes = Array[3];
- int Ancho = Array[4];
- int Alto = Array[5];
-
- if (ydes < 0) {
- yorg += -ydes;
- Alto += ydes;
- ydes = 0;
- }
- if (xdes < 0) {
- xorg += -xdes;
- Ancho += xdes;
- xdes = 0;
- }
- if ((xdes + Ancho) > 319)
- Ancho -= (xdes + Ancho) - 320;
- if ((ydes + Alto) > 199)
- Alto -= (ydes + Alto) - 200;
-
- Destino += xdes + ydes * 320;
- Origen += xorg + yorg * 320;
-
- for (y = 0; y < Alto; y++)
- for (x = 0; x < Ancho; x++)
- if (Origen[x + y * 320] != 255)
- Destino[x + y * 320] = Origen[x + y * 320];
-}
-
-void DrasculaEngine::updateScreen(int xorg, int yorg, int xdes, int ydes, int Ancho, int Alto, byte *Buffer) {
- int x;
- byte *ptr = VGA;
-
- ptr += xdes + ydes * 320;
- Buffer += xorg + yorg * 320;
- for (x = 0; x < Alto; x++) {
- memcpy(ptr, Buffer, Ancho);
- ptr += 320;
- Buffer += 320;
- }
-
- _system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200);
- _system->updateScreen();
-}
-
-bool DrasculaEngine::escoba() {
+bool DrasculaEngine::runCurrentChapter() {
int n;
- dir_texto = dir_mesa;
+ if (_lang == kSpanish)
+ textSurface = extraSurface;
+ else
+ textSurface = tableSurface;
- musica_antes = -1;
+ previousMusic = -1;
- if (num_ejec != 2) {
+ if (currentChapter != 2) {
int soc = 0;
for (n = 0; n < 6; n++) {
- soc = soc + ANCHO_PERSONAJE;
- frame_x[n] = soc;
+ soc = soc + CHARACTER_WIDTH;
+ _frameX[n] = soc;
}
}
for (n = 1; n < 43; n++)
- objetos_que_tengo[n] = 0;
+ inventoryObjects[n] = 0;
- for (n = 0; n < NUM_BANDERAS; n++)
+ for (n = 0; n < NUM_FLAGS; n++)
flags[n] = 0;
- if (num_ejec == 2) {
+ if (currentChapter == 2) {
flags[16] = 1;
flags[17] = 1;
flags[27] = 1;
}
for (n = 1; n < 7; n++)
- objetos_que_tengo[n] = n;
+ inventoryObjects[n] = n;
- if (num_ejec == 1) {
- agarra_objeto(28);
- buffer_teclado();
+ if (currentChapter == 1) {
+ pickObject(28);
if (hay_que_load == 0)
animation_1_1();
- sin_verbo();
- loadPic("2aux62.alg");
- decompressPic(dir_dibujo2, 1);
- sentido_hare = 1;
- obj_saliendo = 104;
+ withoutVerb();
+ loadPic("2aux62.alg", drawSurface2);
+ trackProtagonist = 1;
+ objExit = 104;
if (hay_que_load != 0) {
- if (!para_cargar(nom_partida)) {
+ if (!loadGame(saveName)) {
return true;
}
} else {
- carga_escoba("62.ald");
- hare_x = -20;
- hare_y = 56;
- lleva_al_hare(65, 145);
- }
- } else if (num_ejec == 2) {
- suma_objeto(28);
- buffer_teclado();
- sentido_hare = 3;
- obj_saliendo = 162;
+ enterRoom(62);
+ curX = -20;
+ curY = 56;
+ gotoObject(65, 145);
+ }
+ } else if (currentChapter == 2) {
+ addObject(kItemPhone);
+ trackProtagonist = 3;
+ objExit = 162;
if (hay_que_load == 0)
- carga_escoba("14.ald");
+ enterRoom(14);
else {
- if (!para_cargar(nom_partida)) {
+ if (!loadGame(saveName)) {
return true;
}
}
- } else if (num_ejec == 3) {
- suma_objeto(28);
- suma_objeto(11);
- suma_objeto(14);
- suma_objeto(22);
- suma_objeto(9);
- suma_objeto(20);
- suma_objeto(19);
+ } else if (currentChapter == 3) {
+ addObject(kItemPhone);
+ addObject(kItemEarplugs);
+ addObject(kItemSickle);
+ addObject(kItemHandbag);
+ addObject(kItemCross);
+ addObject(kItemReefer);
+ addObject(kItemOneCoin);
flags[1] = 1;
- buffer_teclado();
- sentido_hare = 1;
- obj_saliendo = 99;
+ trackProtagonist = 1;
+ objExit = 99;
if (hay_que_load == 0)
- carga_escoba("20.ald");
+ enterRoom(20);
else {
- if (!para_cargar(nom_partida)) {
+ if (!loadGame(saveName)) {
return true;
}
}
- } else if (num_ejec == 4) {
- suma_objeto(28);
- suma_objeto(9);
- suma_objeto(20);
- suma_objeto(22);
- buffer_teclado();
- obj_saliendo = 100;
+ // From here onwards the items have different IDs
+ } else if (currentChapter == 4) {
+ addObject(kItemPhone2);
+ addObject(kItemCross2);
+ addObject(kItemReefer2);
+ addObject(kItemOneCoin2);
+ objExit = 100;
if (hay_que_load == 0) {
- carga_escoba("21.ald");
- sentido_hare = 0;
- hare_x = 235;
- hare_y = 164;
+ enterRoom(21);
+ trackProtagonist = 0;
+ curX = 235;
+ curY = 164;
} else {
- if (!para_cargar(nom_partida)) {
+ if (!loadGame(saveName)) {
return true;
}
}
- } else if (num_ejec == 5) {
- suma_objeto(28);
- suma_objeto(7);
- suma_objeto(9);
- suma_objeto(11);
- suma_objeto(13);
- suma_objeto(14);
- suma_objeto(15);
- suma_objeto(17);
- suma_objeto(20);
- buffer_teclado();
- sentido_hare = 1;
- obj_saliendo = 100;
+ } else if (currentChapter == 5) {
+ addObject(28);
+ addObject(7);
+ addObject(9);
+ addObject(11);
+ addObject(13);
+ addObject(14);
+ addObject(15);
+ addObject(17);
+ addObject(20);
+ trackProtagonist = 1;
+ objExit = 100;
if (hay_que_load == 0) {
- carga_escoba("45.ald");
+ enterRoom(45);
} else {
- if (!para_cargar(nom_partida)) {
+ if (!loadGame(saveName)) {
return true;
}
}
- } else if (num_ejec == 6) {
- suma_objeto(28);
- suma_objeto(9);
+ } else if (currentChapter == 6) {
+ addObject(28);
+ addObject(9);
- buffer_teclado();
- sentido_hare = 1;
- obj_saliendo = 104;
+ trackProtagonist = 1;
+ objExit = 104;
if (hay_que_load == 0) {
- carga_escoba("58.ald");
+ enterRoom(58);
animation_1_6();
} else {
- if (!para_cargar(nom_partida)) {
+ if (!loadGame(saveName)) {
return true;
}
- loadPic("auxdr.alg");
- decompressPic(dir_dibujo2, 1);
+ loadPic("auxdr.alg", drawSurface2);
+ }
+ }
+
+ while (1) {
+ if (characterMoved == 0) {
+ stepX = STEP_X;
+ stepY = STEP_Y;
+ }
+ if (characterMoved == 0 && walkToObject == 1) {
+ trackProtagonist = trackFinal;
+ walkToObject = 0;
+ }
+
+ if (currentChapter == 2) {
+ // NOTE: the checks for room number 14 below are a hack used in the original
+ // game, and move the character to a place where his feet are not drawn above
+ // the pianist's head. Originally, walkToObject was not updated properly, which
+ // lead to an incorrect setting of the protagonist's tracking flag (above). This
+ // made the character start walking off screen, as his actual position was
+ // different than the displayed one
+ if (roomNumber == 3 && (curX == 279) && (curY + curHeight == 101)) {
+ animation_1_2();
+ } else if (roomNumber == 14 && (curX == 214) && (curY + curHeight == 121)) {
+ walkToObject = 1;
+ gotoObject(190, 130);
+ } else if (roomNumber == 14 && (curX == 246) && (curY + curHeight == 112)) {
+ walkToObject = 1;
+ gotoObject(190, 130);
+ }
}
- }
-
-bucles:
- if (hare_se_mueve == 0) {
- paso_x = PASO_HARE_X;
- paso_y = PASO_HARE_Y;
- }
- if (hare_se_mueve == 0 && anda_a_objeto == 1) {
- sentido_hare = sentido_final;
- anda_a_objeto = 0;
- }
-
- if (num_ejec == 2) {
- if ((!strcmp(num_room, "3.alg")) && (hare_x == 279) && (hare_y + alto_hare == 101))
- animation_1_2();
- else if ((!strcmp(num_room, "14.alg")) && (hare_x == 214) && (hare_y + alto_hare == 121))
- lleva_al_hare(190, 130);
- else if ((!strcmp(num_room, "14.alg")) && (hare_x == 246) && (hare_y + alto_hare == 112))
- lleva_al_hare(190, 130);
- }
-
- mueve_cursor();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- if (num_ejec == 2) {
- if (music_status() == 0 && musica_room != 0)
- playmusic(musica_room);
- } else {
- if (music_status() == 0)
- playmusic(musica_room);
- }
-
- MirarRaton();
-
- if (menu_scr == 0 && lleva_objeto == 1)
- comprueba_objetos();
-
- if (boton_dch == 1 && menu_scr == 1) {
- delay(100);
- if (num_ejec == 2)
- loadPic(fondo_y_menu);
- else
- loadPic("99.alg");
- decompressPic(dir_hare_fondo, 1);
- setvgapalette256((byte *)&palJuego);
- menu_scr = 0;
- espera_soltar();
- if (num_ejec != 3)
- cont_sv = 0;
- }
- if (boton_dch == 1 && menu_scr == 0) {
- delay(100);
- hare_se_mueve = 0;
- if (sentido_hare == 2)
- sentido_hare = 1;
- if (num_ejec == 4)
- loadPic("icons2.alg");
- else if (num_ejec == 5)
- loadPic("icons3.alg");
- else if (num_ejec == 6)
- loadPic("iconsp.alg");
- else
- loadPic("icons.alg");
- decompressPic(dir_hare_fondo, 1);
- menu_scr = 1;
- espera_soltar();
- sin_verbo();
- if (num_ejec != 3)
- cont_sv = 0;
- }
-
- if (boton_izq == 1 && menu_bar == 1) {
- delay(100);
- elige_en_barra();
- if (num_ejec != 3)
- cont_sv = 0;
- } else if (boton_izq == 1 && lleva_objeto == 0) {
- delay(100);
- if (comprueba1())
- return true;
- if (num_ejec != 3)
- cont_sv = 0;
- } else if (boton_izq == 1 && lleva_objeto == 1) {
- if (comprueba2())
- return true;
- if (num_ejec != 3)
- cont_sv = 0;
- }
-
- if (y_raton < 24 && menu_scr == 0)
- menu_bar = 1;
- else
- menu_bar = 0;
-
- Common::KeyCode key = getscan();
- if (key == Common::KEYCODE_F1 && menu_scr == 0) {
- elige_verbo(1);
- if (num_ejec != 3)
- cont_sv = 0;
- } else if (key == Common::KEYCODE_F2 && menu_scr == 0) {
- elige_verbo(2);
- if (num_ejec != 3)
- cont_sv = 0;
- } else if (key == Common::KEYCODE_F3 && menu_scr == 0) {
- elige_verbo(3);
- if (num_ejec != 3)
- cont_sv = 0;
- } else if (key == Common::KEYCODE_F4 && menu_scr == 0) {
- elige_verbo(4);
- cont_sv = 0;
- } else if (key == Common::KEYCODE_F5 && menu_scr == 0) {
- elige_verbo(5);
- if (num_ejec != 3)
- cont_sv = 0;
- } else if (key == Common::KEYCODE_F6 && menu_scr == 0) {
- elige_verbo(6);
- if (num_ejec != 3)
- cont_sv = 0;
- } else if (key == Common::KEYCODE_F9) {
- mesa();
- if (num_ejec != 3)
- cont_sv = 0;
- } else if (key == Common::KEYCODE_F10) {
- if (!saves())
- return true;
- if (num_ejec != 3)
- cont_sv = 0;
- } else if (key == Common::KEYCODE_F8) {
- sin_verbo();
- if (num_ejec != 3)
- cont_sv = 0;
- } else if (key == Common::KEYCODE_v) {
- con_voces = 1;
- print_abc(_textsys[_lang][2], 96, 86);
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- delay(1410);
- if (num_ejec != 3)
- cont_sv = 0;
- } else if (key == Common::KEYCODE_t) {
- con_voces = 0;
- print_abc(_textsys[_lang][3], 94, 86);
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- delay(1460);
- if (num_ejec != 3)
- cont_sv = 0;
- } else if (key == Common::KEYCODE_ESCAPE) {
- if (!confirma_salir())
- return false;
- if (num_ejec != 3)
- cont_sv = 0;
- } else if (num_ejec == 6 && key == Common::KEYCODE_0 && !strcmp(num_room, "61.alg")) {
- loadPic("alcbar.alg");
- decompressPic(dir_dibujo1, 255);
- } else if (cont_sv == 1500) {
- salva_pantallas();
- if (num_ejec != 3)
- cont_sv = 0;
- } else {
- if (num_ejec != 3)
- cont_sv++;
- }
- goto bucles;
-}
-
-void DrasculaEngine::agarra_objeto(int objeto) {
- if (num_ejec == 6)
- loadPic("iconsp.alg");
- else if (num_ejec == 4)
- loadPic("icons2.alg");
- else if (num_ejec == 5)
- loadPic("icons3.alg");
- else
- loadPic("icons.alg");
- decompressPic(dir_hare_fondo, 1);
- elige_objeto(objeto);
- if (num_ejec == 2)
- loadPic(fondo_y_menu);
- else
- loadPic("99.alg");
- decompressPic(dir_hare_fondo, 1);
-}
-
-void DrasculaEngine::elige_objeto(int objeto) {
- if (num_ejec == 5) {
- if (lleva_objeto == 1 && menu_scr == 0 && objeto_que_lleva != 16)
- suma_objeto(objeto_que_lleva);
- } else {
- if (lleva_objeto == 1 && menu_scr == 0)
- suma_objeto(objeto_que_lleva);
- }
- copyBackground(x1d_menu[objeto], y1d_menu[objeto], 0, 0, ANCHOBJ,ALTOBJ, dir_hare_fondo, dir_dibujo3);
- lleva_objeto = 1;
- objeto_que_lleva = objeto;
-}
-int DrasculaEngine::resta_objeto(int osj) {
- int h, q = 0;
+ moveCursor();
+ updateScreen();
- for (h = 1; h < 43; h++) {
- if (objetos_que_tengo[h] == osj) {
- objetos_que_tengo[h] = 0;
- q = 1;
- break;
+ if (currentChapter == 2) {
+ if (musicStatus() == 0 && roomMusic != 0)
+ playMusic(roomMusic);
+ } else {
+ if (musicStatus() == 0)
+ playMusic(roomMusic);
}
- }
-
- if (q == 1)
- return 0;
- else
- return 1;
-}
-void DrasculaEngine::sin_verbo() {
- int c = 171;
- if (menu_scr == 1)
- c = 0;
- if (num_ejec == 5) {
- if (lleva_objeto == 1 && objeto_que_lleva != 16)
- suma_objeto(objeto_que_lleva);
- } else {
- if (lleva_objeto == 1)
- suma_objeto(objeto_que_lleva);
- }
- copyBackground(0, c, 0, 0, ANCHOBJ,ALTOBJ, dir_hare_fondo, dir_dibujo3);
+ updateEvents();
- lleva_objeto = 0;
- hay_nombre = 0;
-}
-
-bool DrasculaEngine::para_cargar(char nom_game[]) {
- musica_antes = musica_room;
- menu_scr = 0;
- if (num_ejec != 1)
- clearRoom();
- if (!carga_partida(nom_game))
- return false;
- if (num_ejec == 2 || num_ejec == 3 || num_ejec == 5) {
- delete ald;
- ald = NULL;
- }
- carga_escoba(datos_actuales);
- sin_verbo();
+ if (menuScreen == 0 && takeObject == 1)
+ checkObjects();
+
+ if (rightMouseButton == 1 && menuScreen == 1) {
+ delay(100);
+ if (currentChapter == 2)
+ loadPic(menuBackground, backSurface);
+ else
+ loadPic(99, backSurface);
+ setPalette((byte *)&gamePalette);
+ menuScreen = 0;
+ updateEvents();
+ }
+ if (rightMouseButton == 1 && menuScreen == 0) {
+ delay(100);
+ characterMoved = 0;
+ if (trackProtagonist == 2)
+ trackProtagonist = 1;
+ if (currentChapter == 4)
+ loadPic("icons2.alg", backSurface);
+ else if (currentChapter == 5)
+ loadPic("icons3.alg", backSurface);
+ else if (currentChapter == 6)
+ loadPic("iconsp.alg", backSurface);
+ else
+ loadPic("icons.alg", backSurface);
+ menuScreen = 1;
+ updateEvents();
+ withoutVerb();
+ }
- return true;
-}
+ if (leftMouseButton == 1 && menuBar == 1) {
+ delay(100);
+ selectVerbFromBar();
+ } else if (leftMouseButton == 1 && takeObject == 0) {
+ delay(100);
+ if (verify1())
+ return true;
+ } else if (leftMouseButton == 1 && takeObject == 1) {
+ if (verify2())
+ return true;
+ }
-static char *getLine(Common::File *fp, char *buf, int len) {
+ menuBar = (mouseY < 24 && menuScreen == 0) ? 1 : 0;
+
+ Common::KeyCode key = getScan();
+ if (key == Common::KEYCODE_F1 && menuScreen == 0) {
+ selectVerb(1);
+ } else if (key == Common::KEYCODE_F2 && menuScreen == 0) {
+ selectVerb(2);
+ } else if (key == Common::KEYCODE_F3 && menuScreen == 0) {
+ selectVerb(3);
+ } else if (key == Common::KEYCODE_F4 && menuScreen == 0) {
+ selectVerb(4);
+ } else if (key == Common::KEYCODE_F5 && menuScreen == 0) {
+ selectVerb(5);
+ } else if (key == Common::KEYCODE_F6 && menuScreen == 0) {
+ selectVerb(6);
+ } else if (key == Common::KEYCODE_F9) {
+ volumeControls();
+ } else if (key == Common::KEYCODE_F10) {
+ if (!saveLoadScreen())
+ return true;
+ } else if (key == Common::KEYCODE_F8) {
+ withoutVerb();
+ } else if (key == Common::KEYCODE_v) {
+ withVoices = 1;
+ print_abc(_textsys[_lang][2], 96, 86);
+ updateScreen();
+ delay(1410);
+ } else if (key == Common::KEYCODE_t) {
+ withVoices = 0;
+ print_abc(_textsys[_lang][3], 94, 86);
+ updateScreen();
+ delay(1460);
+ } else if (key == Common::KEYCODE_ESCAPE) {
+ if (!confirmExit())
+ return false;
+ } else if (currentChapter == 6 && key == Common::KEYCODE_0 && roomNumber == 61) {
+ loadPic("alcbar.alg", bgSurface, 255);
+ }
+
+ if (leftMouseButton != 0 || rightMouseButton != 0 || key != 0)
+ if (currentChapter != 3)
+ framesWithoutAction = 0;
+
+ if (framesWithoutAction == 15000) {
+ screenSaver();
+ if (currentChapter != 3)
+ framesWithoutAction = 0;
+ }
+
+ if (currentChapter != 3)
+ framesWithoutAction++;
+
+ }
+}
+
+char *DrasculaEngine::getLine(char *buf, int len) {
byte c;
char *b;
for (;;) {
b = buf;
- while (!fp->eos()) {
- c = ~fp->readByte();
+ while (!_arj.eos()) {
+ c = ~_arj.readByte();
if (c == '\r')
continue;
- if (c == '\n')
- break;
- if (b - buf >= (len - 1))
+ if (c == '\n' || b - buf >= (len - 1))
break;
*b++ = c;
}
*b = '\0';
- if (fp->eos() && b == buf)
+ if (_arj.eos() && b == buf)
return NULL;
if (b != buf)
break;
@@ -879,473 +580,79 @@ static char *getLine(Common::File *fp, char *buf, int len) {
return buf;
}
-void DrasculaEngine::carga_escoba(const char *nom_fich) {
- int soc, l, martin = 0, obj_salir = 0;
- float chiquez = 0, pequegnez = 0;
- char pant1[20], pant2[20], pant3[20], pant4[20];
- char para_codificar[20];
- char buffer[256];
-
- hay_nombre = 0;
-
- strcpy(para_codificar, nom_fich);
- strcpy(datos_actuales, nom_fich);
-
- buffer_teclado();
-
- ald = new Common::File;
- ald->open(nom_fich);
- if (!ald->isOpen()) {
- error("missing data file");
- }
- int size = ald->size();
- getLine(ald, buffer, size);
- sscanf(buffer, "%s", num_room);
- strcat(num_room, ".alg");
-
- getLine(ald, buffer, size);
- sscanf(buffer, "%d", &musica_room);
- getLine(ald, buffer, size);
- sscanf(buffer, "%s", roomDisk);
- getLine(ald, buffer, size);
- sscanf(buffer, "%d", &nivel_osc);
-
- if (num_ejec == 2) {
- getLine(ald, buffer, size);
- sscanf(buffer, "%d", &martin);
- if (martin == 0)
- goto martini;
- ancho_hare = martin;
- getLine(ald, buffer, size);
- sscanf(buffer, "%d",&alto_hare);
- getLine(ald, buffer, size);
- sscanf(buffer, "%d",&alto_pies);
- getLine(ald, buffer, size);
- sscanf(buffer, "%d",&paso_x);
- getLine(ald, buffer, size);
- sscanf(buffer, "%d",&paso_y);
-
- getLine(ald, buffer, size);
- sscanf(buffer, "%s",pant1);
- getLine(ald, buffer, size);
- sscanf(buffer, "%s",pant2);
- getLine(ald, buffer, size);
- sscanf(buffer, "%s",pant3);
- getLine(ald, buffer, size);
- sscanf(buffer, "%s",pant4);
-
- loadPic(pant2);
- decompressPic(dir_hare_dch, 1);
- loadPic(pant1);
- decompressPic(dir_hare_frente, 1);
- loadPic(pant4);
- decompressPic(dir_hare_fondo, 1);
-
- strcpy(fondo_y_menu, pant4);
- }
-
-martini:
-
- getLine(ald, buffer, size);
- sscanf(buffer, "%d", &objs_room);
-
- for (l = 0; l < objs_room; l++) {
- getLine(ald, buffer, size);
- sscanf(buffer, "%d", &num_obj[l]);
- getLine(ald, buffer, size);
- sscanf(buffer, "%s", nombre_obj[l]);
- getLine(ald, buffer, size);
- sscanf(buffer, "%d", &x1[l]);
- getLine(ald, buffer, size);
- sscanf(buffer, "%d", &y1[l]);
- getLine(ald, buffer, size);
- sscanf(buffer, "%d", &x2[l]);
- getLine(ald, buffer, size);
- sscanf(buffer, "%d", &y2[l]);
- getLine(ald, buffer, size);
- sscanf(buffer, "%d", &sitiobj_x[l]);
- getLine(ald, buffer, size);
- sscanf(buffer, "%d", &sitiobj_y[l]);
- getLine(ald, buffer, size);
- sscanf(buffer, "%d", &sentidobj[l]);
- getLine(ald, buffer, size);
- sscanf(buffer, "%d", &visible[l]);
- getLine(ald, buffer, size);
- sscanf(buffer, "%d", &espuerta[l]);
- if (espuerta[l] != 0) {
- getLine(ald, buffer, size);
- sscanf(buffer, "%s", alapantallakeva[l]);
- getLine(ald, buffer, size);
- sscanf(buffer, "%d", &x_alakeva[l]);
- getLine(ald, buffer, size);
- sscanf(buffer, "%d", &y_alakeva[l]);
- getLine(ald, buffer, size);
- sscanf(buffer, "%d", &sentido_alkeva[l]);
- getLine(ald, buffer, size);
- sscanf(buffer, "%d", &alapuertakeva[l]);
- puertas_cerradas(l);
- }
- }
-
- getLine(ald, buffer, size);
- sscanf(buffer, "%d", &suelo_x1);
- getLine(ald, buffer, size);
- sscanf(buffer, "%d", &suelo_y1);
- getLine(ald, buffer, size);
- sscanf(buffer, "%d", &suelo_x2);
- getLine(ald, buffer, size);
- sscanf(buffer, "%d", &suelo_y2);
-
- if (num_ejec != 2) {
- getLine(ald, buffer, size);
- sscanf(buffer, "%d", &lejos);
- getLine(ald, buffer, size);
- sscanf(buffer, "%d", &cerca);
- }
- delete ald;
- ald = NULL;
-
- if (num_ejec == 2) {
- if (martin == 0) {
- paso_x = PASO_HARE_X;
- paso_y = PASO_HARE_Y;
- alto_hare = ALTO_PERSONAJE;
- ancho_hare = ANCHO_PERSONAJE;
- alto_pies = PIES_HARE;
- loadPic("97.alg");
- decompressPic(dir_hare_dch, 1);
- loadPic("96.alg");
- decompressPic(dir_hare_frente, 1);
- loadPic("99.alg");
- decompressPic(dir_hare_fondo, 1);
-
- strcpy(fondo_y_menu, "99.alg");
- }
- }
-
- for (l = 0; l < objs_room; l++) {
- if (num_obj[l] == obj_saliendo)
- obj_salir = l;
- }
-
- if (num_ejec == 2) {
- if (hare_x == -1) {
- hare_x = x_alakeva[obj_salir];
- hare_y = y_alakeva[obj_salir] - alto_hare;
- }
- hare_se_mueve = 0;
- }
- loadPic(roomDisk);
- decompressPic(dir_dibujo3, 1);
-
- loadPic(num_room);
- decompressPic(dir_dibujo1, MEDIA);
-
- copyBackground(0, 171, 0, 0, ANCHOBJ, ALTOBJ, dir_hare_fondo, dir_dibujo3);
-
- color_hare();
- if (nivel_osc != 0)
- funde_hare(nivel_osc);
- paleta_hare_claro();
- color_hare();
- funde_hare(nivel_osc + 2);
- paleta_hare_oscuro();
-
- hare_claro();
- cambio_de_color = -1;
-
- if (num_ejec == 2)
- color_abc(VERDE_CLARO);
-
- if (num_ejec != 2) {
- for (l = 0; l <= suelo_y1; l++)
- factor_red[l] = lejos;
- for (l = suelo_y1; l <= 201; l++)
- factor_red[l] = cerca;
-
- chiquez = (float)(cerca - lejos) / (float)(suelo_y2 - suelo_y1);
- for (l = suelo_y1; l <= suelo_y2; l++) {
- factor_red[l] = (int)(lejos + pequegnez);
- pequegnez = pequegnez + chiquez;
- }
- }
-
- if (!strcmp(num_room, "24.alg")) {
- for (l = suelo_y1 - 1; l > 74; l--) {
- factor_red[l] = (int)(lejos - pequegnez);
- pequegnez = pequegnez + chiquez;
- }
- }
-
- if (num_ejec == 5 && !strcmp(num_room, "54.alg")) {
- for (l = suelo_y1 - 1; l > 84; l--) {
- factor_red[l] = (int)(lejos - pequegnez);
- pequegnez = pequegnez + chiquez;
- }
- }
-
- if (num_ejec != 2) {
- if (hare_x == -1) {
- hare_x = x_alakeva[obj_salir];
- hare_y = y_alakeva[obj_salir];
- alto_hare = (ALTO_PERSONAJE * factor_red[hare_y]) / 100;
- ancho_hare = (ANCHO_PERSONAJE * factor_red[hare_y]) / 100;
- hare_y = hare_y - alto_hare;
- } else {
- alto_hare = (ALTO_PERSONAJE * factor_red[hare_y]) / 100;
- ancho_hare = (ANCHO_PERSONAJE * factor_red[hare_y]) / 100;
- }
- hare_se_mueve = 0;
- }
-
- if (num_ejec == 2) {
- soc = 0;
- for (l = 0; l < 6; l++) {
- soc = soc + ancho_hare;
- frame_x[l] = soc;
- }
- }
-
- if (num_ejec == 5)
- hare_se_ve = 1;
-
- actualiza_datos();
-
- if (num_ejec == 1)
- espuerta[7] = 0;
-
- if (num_ejec == 2) {
- if (!strcmp(num_room, "14.alg") && flags[39] == 1)
- musica_room = 16;
- else if (!strcmp(num_room, "15.alg") && flags[39] == 1)
- musica_room = 16;
- if (!strcmp(num_room, "14.alg") && flags[5] == 1)
- musica_room = 0;
- else if (!strcmp(num_room, "15.alg") && flags[5] == 1)
- musica_room = 0;
-
- if (musica_antes != musica_room && musica_room != 0)
- playmusic(musica_room);
- if (musica_room == 0)
- stopmusic();
- } else {
- if (musica_antes != musica_room && musica_room != 0)
- playmusic(musica_room);
- }
-
- if (num_ejec == 2) {
- if ((!strcmp(num_room, "9.alg")) || (strcmp(num_room, "2.alg")) || (!strcmp(num_room, "14.alg")) || (!strcmp(num_room, "18.alg")))
- conta_ciego_vez = vez();
- }
- if (num_ejec == 4) {
- if (!strcmp(num_room, "26.alg"))
- conta_ciego_vez = vez();
- }
-
- if (num_ejec == 4 && !strcmp(num_room, "24.alg") && flags[29] == 1)
- animation_7_4();
-
- if (num_ejec == 5) {
- if (!strcmp(num_room, "45.alg"))
- hare_se_ve = 0;
- if (!strcmp(num_room, "49.alg") && flags[7] == 0)
- animation_4_5();
- }
-
- updateRoom();
-}
-
-void DrasculaEngine::clearRoom() {
- memset(VGA, 0, 64000);
- _system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200);
- _system->updateScreen();
+void DrasculaEngine::getIntFromLine(char *buf, int len, int* result) {
+ getLine(buf, len);
+ sscanf(buf, "%d", result);
}
-void DrasculaEngine::lleva_al_hare(int punto_x, int punto_y) {
- if (num_ejec == 5 || num_ejec == 6) {
- if (hare_se_ve == 0) {
- hare_x = sitio_x;
- hare_y = sitio_y;
- goto fin;
- }
- }
- sitio_x = punto_x;
- sitio_y = punto_y;
- empieza_andar();
-
- for (;;) {
- updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- if (hare_se_mueve == 0)
- break;
- }
-
- if (anda_a_objeto == 1) {
- anda_a_objeto = 0;
- sentido_hare = sentido_final;
- }
-fin:
- updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-}
-
-void DrasculaEngine::mueve_cursor() {
- int pos_cursor[8];
-
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
-
- updateRefresh_pre();
- pon_hare();
- updateRefresh();
-
- if (!strcmp(texto_nombre, "hacker") && hay_nombre == 1) {
- if (_color != ROJO && menu_scr == 0)
- color_abc(ROJO);
- } else if (menu_scr == 0 && _color != VERDE_CLARO)
- color_abc(VERDE_CLARO);
- if (hay_nombre == 1 && menu_scr == 0)
- centra_texto(texto_nombre, x_raton, y_raton);
- if (menu_scr == 1)
- menu_sin_volcar();
- else if (menu_bar == 1)
- barra_menu();
-
- pos_cursor[0] = 0;
- pos_cursor[1] = 0;
- pos_cursor[2] = x_raton - 20;
- pos_cursor[3] = y_raton - 17;
- pos_cursor[4] = ANCHOBJ;
- pos_cursor[5] = ALTOBJ;
- copyRectClip(pos_cursor, dir_dibujo3, dir_zona_pantalla);
+void DrasculaEngine::getStringFromLine(char *buf, int len, char* result) {
+ getLine(buf, len);
+ sscanf(buf, "%s", result);
}
-void DrasculaEngine::comprueba_objetos() {
- int l, veo = 0;
-
- for (l = 0; l < objs_room; l++) {
- if (x_raton > x1[l] && y_raton > y1[l]
- && x_raton < x2[l] && y_raton < y2[l]
- && visible[l] == 1 && espuerta[l] == 0) {
- strcpy(texto_nombre, nombre_obj[l]);
- hay_nombre = 1;
- veo = 1;
- }
- }
-
- if (num_ejec == 2) {
- if (x_raton > hare_x + 2 && y_raton > hare_y + 2
- && x_raton < hare_x + ancho_hare - 2 && y_raton < hare_y + alto_hare - 2) {
- strcpy(texto_nombre, "hacker");
- hay_nombre = 1;
- veo = 1;
- }
- } else {
- if (x_raton > hare_x + 2 && y_raton > hare_y + 2
- && x_raton < hare_x + ancho_hare - 2 && y_raton < hare_y + alto_hare - 2 && veo == 0) {
- strcpy(texto_nombre, "hacker");
- hay_nombre = 1;
- veo = 1;
- }
- }
-
- if (veo == 0)
- hay_nombre = 0;
-}
-
-void DrasculaEngine::espera_soltar() {
- update_events();
-}
-
-void DrasculaEngine::MirarRaton() {
- update_events();
-}
-
-void DrasculaEngine::elige_en_barra() {
- int n, num_verbo = -1;
-
- for (n = 0; n < 7; n++)
- if (x_raton > x_barra[n] && x_raton < x_barra[n + 1])
- num_verbo = n;
-
- if (num_verbo < 1)
- sin_verbo();
- else
- elige_verbo(num_verbo);
-}
-
-bool DrasculaEngine::comprueba1() {
+bool DrasculaEngine::verify1() {
int l;
- if (menu_scr == 1)
- saca_objeto();
+ if (menuScreen == 1)
+ removeObject();
else {
- for (l = 0; l < objs_room; l++) {
- if (x_raton >= x1[l] && y_raton >= y1[l]
- && x_raton <= x2[l] && y_raton <= y2[l] && rompo == 0) {
- if (sal_de_la_habitacion(l))
+ for (l = 0; l < numRoomObjs; l++) {
+ if (mouseX >= x1[l] && mouseY >= y1[l]
+ && mouseX <= x2[l] && mouseY <= y2[l] && doBreak == 0) {
+ if (exitRoom(l))
return true;
- if (rompo == 1)
+ if (doBreak == 1)
break;
}
}
- if (x_raton > hare_x && y_raton > hare_y
- && x_raton < hare_x + ancho_hare && y_raton < hare_y + alto_hare)
- rompo = 1;
-
- for (l = 0; l < objs_room; l++) {
- if (x_raton > x1[l] && y_raton > y1[l]
- && x_raton < x2[l] && y_raton < y2[l] && rompo == 0) {
- sitio_x = sitiobj_x[l];
- sitio_y = sitiobj_y[l];
- sentido_final = sentidobj[l];
- rompo = 1;
- anda_a_objeto = 1;
- empieza_andar();
+ if (mouseX > curX && mouseY > curY
+ && mouseX < curX + curWidth && mouseY < curY + curHeight)
+ doBreak = 1;
+
+ for (l = 0; l < numRoomObjs; l++) {
+ if (mouseX > x1[l] && mouseY > y1[l]
+ && mouseX < x2[l] && mouseY < y2[l] && doBreak == 0) {
+ roomX = roomObjX[l];
+ roomY = roomObjY[l];
+ trackFinal = trackObj[l];
+ doBreak = 1;
+ walkToObject = 1;
+ startWalking();
}
}
- if (rompo == 0) {
- sitio_x = x_raton;
- sitio_y = y_raton;
-
- if (sitio_x < suelo_x1)
- sitio_x = suelo_x1;
- if (sitio_x > suelo_x2)
- sitio_x = suelo_x2;
- if (sitio_y < suelo_y1 + alto_pies)
- sitio_y = suelo_y1 + alto_pies;
- if (sitio_y > suelo_y2)
- sitio_y = suelo_y2;
-
- empieza_andar();
+ if (doBreak == 0) {
+ roomX = CLIP(mouseX, floorX1, floorX2);
+ roomY = CLIP(mouseY, floorY1 + feetHeight, floorY2);
+ startWalking();
}
- rompo = 0;
+ doBreak = 0;
}
return false;
}
-bool DrasculaEngine::comprueba2() {
+bool DrasculaEngine::verify2() {
int l;
- if (menu_scr == 1) {
- if (coge_objeto())
+ if (menuScreen == 1) {
+ if (pickupObject())
return true;
} else {
- if (!strcmp(texto_nombre, "hacker") && hay_nombre == 1) {
- if (banderas(50))
+ if (!strcmp(textName, "hacker") && hasName == 1) {
+ if (checkAction(50))
return true;
} else {
- for (l = 0; l < objs_room; l++) {
- if (x_raton > x1[l] && y_raton > y1[l]
- && x_raton < x2[l] && y_raton < y2[l] && visible[l] == 1) {
- sentido_final = sentidobj[l];
- anda_a_objeto = 1;
- lleva_al_hare(sitiobj_x[l], sitiobj_y[l]);
- if (banderas(num_obj[l]))
+ for (l = 0; l < numRoomObjs; l++) {
+ if (mouseX > x1[l] && mouseY > y1[l]
+ && mouseX < x2[l] && mouseY < y2[l] && visible[l] == 1) {
+ trackFinal = trackObj[l];
+ walkToObject = 1;
+ gotoObject(roomObjX[l], roomObjY[l]);
+ if (checkAction(objectNum[l]))
return true;
- if (num_ejec == 4)
+ if (currentChapter == 4)
break;
}
}
@@ -1355,13 +662,13 @@ bool DrasculaEngine::comprueba2() {
return false;
}
-Common::KeyCode DrasculaEngine::getscan() {
- update_events();
+Common::KeyCode DrasculaEngine::getScan() {
+ updateEvents();
return _keyPressed.keycode;
}
-void DrasculaEngine::update_events() {
+void DrasculaEngine::updateEvents() {
Common::Event event;
Common::EventManager *eventMan = _system->getEventManager();
@@ -1376,25 +683,25 @@ void DrasculaEngine::update_events() {
_keyPressed.keycode = Common::KEYCODE_INVALID;
break;
case Common::EVENT_MOUSEMOVE:
- x_raton = event.mouse.x;
- y_raton = event.mouse.y;
+ mouseX = event.mouse.x;
+ mouseY = event.mouse.y;
break;
case Common::EVENT_LBUTTONDOWN:
- boton_izq = 1;
+ leftMouseButton = 1;
break;
case Common::EVENT_LBUTTONUP:
- boton_izq = 0;
+ leftMouseButton = 0;
break;
case Common::EVENT_RBUTTONDOWN:
- boton_dch = 1;
+ rightMouseButton = 1;
break;
case Common::EVENT_RBUTTONUP:
- boton_dch = 0;
+ rightMouseButton = 0;
break;
case Common::EVENT_QUIT:
// TODO
- salir_al_dos(0);
- exit(0);
+ endChapter();
+ _system->quit();
break;
default:
break;
@@ -1402,3200 +709,289 @@ void DrasculaEngine::update_events() {
}
}
-void DrasculaEngine::elige_verbo(int verbo) {
- int c = 171;
-
- if (menu_scr == 1)
- c = 0;
- if (num_ejec == 5) {
- if (lleva_objeto == 1 && objeto_que_lleva != 16)
- suma_objeto(objeto_que_lleva);
- } else {
- if (lleva_objeto == 1)
- suma_objeto(objeto_que_lleva);
- }
-
- copyBackground(ANCHOBJ * verbo, c, 0, 0, ANCHOBJ, ALTOBJ, dir_hare_fondo, dir_dibujo3);
-
- lleva_objeto = 1;
- objeto_que_lleva = verbo;
-}
-
-void DrasculaEngine::mesa() {
- int nivel_master, nivel_voc, nivel_cd;
-
- copyRect(1, 56, 73, 63, 177, 97, dir_mesa, dir_zona_pantalla);
- updateScreen(73, 63, 73, 63, 177, 97, dir_zona_pantalla);
-
- for (;;) {
- nivel_master = 72 + 61 - ((_mixer->getVolumeForSoundType(Audio::Mixer::kPlainSoundType) / 16) * 4);
- nivel_voc = 72 + 61 - ((_mixer->getVolumeForSoundType(Audio::Mixer::kSFXSoundType) / 16) * 4);
- nivel_cd = 72 + 61 - ((_mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType) / 16) * 4);
-
- updateRoom();
-
- copyRect(1, 56, 73, 63, 177, 97, dir_mesa, dir_zona_pantalla);
-
- copyBackground(183, 56, 82, nivel_master, 39, 2 + ((_mixer->getVolumeForSoundType(Audio::Mixer::kPlainSoundType) / 16) * 4), dir_mesa, dir_zona_pantalla);
- copyBackground(183, 56, 138, nivel_voc, 39, 2 + ((_mixer->getVolumeForSoundType(Audio::Mixer::kSFXSoundType) / 16) * 4), dir_mesa, dir_zona_pantalla);
- copyBackground(183, 56, 194, nivel_cd, 39, 2 + ((_mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType) / 16) * 4), dir_mesa, dir_zona_pantalla);
-
- cursor_mesa();
-
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- MirarRaton();
-
- if (boton_dch == 1) {
- delay(100);
- break;
- }
- if (boton_izq == 1) {
- delay(100);
- if (x_raton > 80 && x_raton < 121) {
- int vol = _mixer->getVolumeForSoundType(Audio::Mixer::kPlainSoundType) / 16;
- if (y_raton < nivel_master && vol < 15)
- vol++;
- if (y_raton > nivel_master && vol > 0)
- vol--;
- _mixer->setVolumeForSoundType(Audio::Mixer::kPlainSoundType, vol * 16);
- }
-
- if (x_raton > 136 && x_raton < 178) {
- int vol = _mixer->getVolumeForSoundType(Audio::Mixer::kSFXSoundType) / 16;
- if (y_raton < nivel_voc && vol < 15)
- vol++;
- if (y_raton > nivel_voc && vol > 0)
- vol--;
- _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, vol * 16);
- }
-
- if (x_raton > 192 && x_raton < 233) {
- int vol = _mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType) / 16;
- if (y_raton < nivel_cd && vol < 15)
- vol++;
- if (y_raton > nivel_cd && vol > 0)
- vol--;
- _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, vol * 16);
- }
- }
-
- }
-
- espera_soltar();
-}
-
-bool DrasculaEngine::saves() {
- char nombres[10][23];
- char fichero[13];
- int n, n2, num_sav = 0, y = 27;
- Common::InSaveFile *sav;
-
- clearRoom();
-
- if (!(sav = _saveFileMan->openForLoading("saves.epa"))) {
- Common::OutSaveFile *epa;
- if (!(epa = _saveFileMan->openForSaving("saves.epa")))
- error("Can't open saves.epa file.");
- for (n = 0; n < NUM_SAVES; n++)
- epa->writeString("*\n");
- epa->finalize();
- delete epa;
- if (!(sav = _saveFileMan->openForLoading("saves.epa"))) {
- error("Can't open saves.epa file.");
- }
- }
- for (n = 0; n < NUM_SAVES; n++)
- sav->readLine(nombres[n], 23);
- delete sav;
-
- loadPic("savescr.alg");
- decompressPic(dir_dibujo1, MEDIA);
-
- color_abc(VERDE_CLARO);
-
- for (;;) {
- y = 27;
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- for (n = 0; n < NUM_SAVES; n++) {
- print_abc(nombres[n], 116, y);
- y = y + 9;
- }
- print_abc(select, 117, 15);
- cursor_mesa();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- y = 27;
-
- MirarRaton();
-
- if (boton_izq == 1) {
- delay(100);
- for (n = 0; n < NUM_SAVES; n++) {
- if (x_raton > 115 && y_raton > y + (9 * n) && x_raton < 115 + 175 && y_raton < y + 10 + (9 * n)) {
- strcpy(select, nombres[n]);
-
- if (strcmp(select, "*"))
- hay_seleccion = 1;
- else {
- introduce_nombre();
- strcpy(nombres[n], select);
- if (hay_seleccion == 1) {
- sprintf(fichero, "gsave%02d", n + 1);
- para_grabar(fichero);
- Common::OutSaveFile *tsav;
- if (!(tsav = _saveFileMan->openForSaving("saves.epa"))) {
- error("Can't open saves.epa file.");
- }
- for (n = 0; n < NUM_SAVES; n++) {
- tsav->writeString(nombres[n]);
- tsav->writeString("\n");
- }
- tsav->finalize();
- delete tsav;
- }
- }
-
- print_abc(select, 117, 15);
- y = 27;
- for (n2 = 0; n2 < NUM_SAVES; n2++) {
- print_abc(nombres[n2], 116, y);
- y = y + 9;
- }
- if (hay_seleccion == 1) {
- sprintf(fichero, "gsave%02d", n + 1);
- }
- num_sav = n;
- }
- }
-
- if (x_raton > 117 && y_raton > 15 && x_raton < 295 && y_raton < 24 && hay_seleccion == 1) {
- introduce_nombre();
- strcpy(nombres[num_sav], select);
- print_abc(select, 117, 15);
- y = 27;
- for (n2 = 0; n2 < NUM_SAVES; n2++) {
- print_abc(nombres[n2], 116, y);
- y = y + 9;
- }
- }
-
- if (x_raton > 125 && y_raton > 123 && x_raton < 199 && y_raton < 149 && hay_seleccion == 1) {
- if (!para_cargar(fichero))
- return false;
- break;
- } else if (x_raton > 208 && y_raton > 123 && x_raton < 282 && y_raton < 149 && hay_seleccion == 1) {
- para_grabar(fichero);
- Common::OutSaveFile *tsav;
- if (!(tsav = _saveFileMan->openForSaving("saves.epa"))) {
- error("Can't open saves.epa file.");
- }
- for (n = 0; n < NUM_SAVES; n++) {
- tsav->writeString(nombres[n]);
- tsav->writeString("\n");
- }
- tsav->finalize();
- delete tsav;
- } else if (x_raton > 168 && y_raton > 154 && x_raton < 242 && y_raton < 180)
- break;
- else if (hay_seleccion == 0) {
- print_abc("elige una partida", 117, 15);
- }
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- delay(400);
- }
- y = 26;
- }
-
- clearRoom();
- loadPic(num_room);
- decompressPic(dir_dibujo1, MEDIA);
- buffer_teclado();
- hay_seleccion = 0;
-
- return true;
-}
-
-void DrasculaEngine::print_abc(const char *dicho, int x_pantalla, int y_pantalla) {
- int pos_texto[8];
- int y_de_letra = 0, x_de_letra = 0, h, longitud;
- longitud = strlen(dicho);
-
- for (h = 0; h < longitud; h++) {
- y_de_letra = Y_ABC;
- int c = toupper(dicho[h]);
- if (c == 'A')
- x_de_letra = X_A;
- else if (c == 'B')
- x_de_letra = X_B;
- else if (c == 'C')
- x_de_letra = X_C;
- else if (c == 'D')
- x_de_letra = X_D;
- else if (c == 'E')
- x_de_letra = X_E;
- else if (c == 'F')
- x_de_letra = X_F;
- else if (c == 'G')
- x_de_letra = X_G;
- else if (c == 'H')
- x_de_letra = X_H;
- else if (c == 'I')
- x_de_letra = X_I;
- else if (c == 'J')
- x_de_letra = X_J;
- else if (c == 'K')
- x_de_letra = X_K;
- else if (c == 'L')
- x_de_letra = X_L;
- else if (c == 'M')
- x_de_letra = X_M;
- else if (c == 'N')
- x_de_letra = X_N;
- else if (c == 'O')
- x_de_letra = X_O;
- else if (c == 'P')
- x_de_letra = X_P;
- else if (c == 'Q')
- x_de_letra = X_Q;
- else if (c == 'R')
- x_de_letra = X_R;
- else if (c == 'S')
- x_de_letra = X_S;
- else if (c == 'T')
- x_de_letra = X_T;
- else if (c == 'U')
- x_de_letra = X_U;
- else if (c == 'V')
- x_de_letra = X_V;
- else if (c == 'W')
- x_de_letra = X_W;
- else if (c == 'X')
- x_de_letra = X_X;
- else if (c == 'Y')
- x_de_letra = X_Y;
- else if (c == 'Z')
- x_de_letra = X_Z;
- else if (c == 0xa7 || c == ' ')
- x_de_letra = ESPACIO;
- else {
- y_de_letra = Y_SIGNOS;
- if (c == '.')
- x_de_letra = X_PUNTO;
- else if (c == ',')
- x_de_letra = X_COMA;
- else if (c == '-')
- x_de_letra = X_GUION;
- else if (c == '?')
- x_de_letra = X_CIERRA_INTERROGACION;
- else if (c == 0xa8)
- x_de_letra = X_ABRE_INTERROGACION;
-// else if (c == '\'') // FIXME
-// x_de_letra = ESPACIO; // space for now
- else if (c == '"')
- x_de_letra = X_COMILLAS;
- else if (c == '!')
- x_de_letra = X_CIERRA_EXCLAMACION;
- else if (c == 0xad)
- x_de_letra = X_ABRE_EXCLAMACION;
- else if (c == ';')
- x_de_letra = X_PUNTO_Y_COMA;
- else if (c == '>')
- x_de_letra = X_MAYOR_QUE;
- else if (c == '<')
- x_de_letra = X_MENOR_QUE;
- else if (c == '$')
- x_de_letra = X_DOLAR;
- else if (c == '%')
- x_de_letra = X_POR_CIENTO;
- else if (c == ':')
- x_de_letra = X_DOS_PUNTOS;
- else if (c == '&')
- x_de_letra = X_AND;
- else if (c == '/')
- x_de_letra = X_BARRA;
- else if (c == '(')
- x_de_letra = X_ABRE_PARENTESIS;
- else if (c == ')')
- x_de_letra = X_CIERRA_PARENTESIS;
- else if (c == '*')
- x_de_letra = X_ASTERISCO;
- else if (c == '+')
- x_de_letra = X_MAS;
- else if (c == '1')
- x_de_letra = X_N1;
- else if (c == '2')
- x_de_letra = X_N2;
- else if (c == '3')
- x_de_letra = X_N3;
- else if (c == '4')
- x_de_letra = X_N4;
- else if (c == '5')
- x_de_letra = X_N5;
- else if (c == '6')
- x_de_letra = X_N6;
- else if (c == '7')
- x_de_letra = X_N7;
- else if (c == '8')
- x_de_letra = X_N8;
- else if (c == '9')
- x_de_letra = X_N9;
- else if (c == '0')
- x_de_letra = X_N0;
- }
-
- pos_texto[0] = x_de_letra;
- pos_texto[1] = y_de_letra;
- pos_texto[2] = x_pantalla;
- pos_texto[3] = y_pantalla;
- pos_texto[4] = ANCHO_LETRAS;
- pos_texto[5] = ALTO_LETRAS;
-
- copyRectClip(pos_texto, dir_texto, dir_zona_pantalla);
-
- x_pantalla = x_pantalla + ANCHO_LETRAS;
- if (x_pantalla > 317) {
- x_pantalla = 0;
- y_pantalla = y_pantalla + ALTO_LETRAS + 2;
- }
- }
-}
-
void DrasculaEngine::delay(int ms) {
_system->delayMillis(ms * 2); // originaly was 1
}
-bool DrasculaEngine::confirma_salir() {
- byte key;
-
- color_abc(ROJO);
- updateRoom();
- centra_texto(_textsys[_lang][1], 160, 87);
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- delay(100);
- for (;;) {
- key = getscan();
- if (key != 0)
- break;
- }
-
- if (key == Common::KEYCODE_ESCAPE) {
- stopmusic();
- return false;
- }
-
- return true;
+void DrasculaEngine::pause(int duration) {
+ _system->delayMillis(duration * 30); // was originaly 2
}
-void DrasculaEngine::salva_pantallas() {
- int xr, yr;
-
- // FIXME: that part (*.ghost) need RE from efecto.lib file for some gfx special effect
- // for now ignore
- return;
-
- clearRoom();
-
- loadPic("sv.alg");
- decompressPic(dir_dibujo1, MEDIA);
- //TODO inicio_ghost();
- //TODO carga_ghost();
-
- MirarRaton();
- xr = x_raton;
- yr = y_raton;
-
- for (;;) {
- //TODO efecto(dir_dibujo1);
- MirarRaton();
- if (boton_dch == 1 || boton_izq == 1)
- break;
- if (x_raton != xr)
- break;
- if (y_raton != yr)
- break;
- }
- //TODO fin_ghost();
- loadPic(num_room);
- decompressPic(dir_dibujo1, MEDIA);
-}
-
-void DrasculaEngine::fliplay(const char *filefli, int vel) {
- OpenSSN(filefli, vel);
- while (PlayFrameSSN() && (!term_int)) {
- if (getscan() == Common::KEYCODE_ESCAPE)
- term_int = 1;
- }
- EndSSN();
-}
-
-void DrasculaEngine::FundeDelNegro(int VelocidadDeFundido) {
- char fundido;
- unsigned int color, componente;
-
- DacPalette256 palFundido;
-
- for (fundido = 0; fundido < 64; fundido++) {
- for (color = 0; color < 256; color++) {
- for (componente = 0; componente < 3; componente++) {
- palFundido[color][componente] = LimitaVGA(palJuego[color][componente] - 63 + fundido);
- }
- }
- pause(VelocidadDeFundido);
-
- setvgapalette256((byte *)&palFundido);
- }
-}
-
-void DrasculaEngine::color_abc(int cl) {
- _color = cl;
-
- if (cl == 0) {
- palJuego[254][0] = 0;
- palJuego[254][1] = 0;
- palJuego[254][2] = 0;
- } else if (cl == 1) {
- palJuego[254][0] = 0x10;
- palJuego[254][1] = 0x3E;
- palJuego[254][2] = 0x28;
- } else if (cl == 3) {
- palJuego[254][0] = 0x16;
- palJuego[254][1] = 0x3F;
- palJuego[254][2] = 0x16;
- } else if (cl == 4) {
- palJuego[254][0] = 0x9;
- palJuego[254][1] = 0x3F;
- palJuego[254][2] = 0x12;
- } else if (cl == 5) {
- palJuego[254][0] = 0x3F;
- palJuego[254][1] = 0x3F;
- palJuego[254][2] = 0x15;
- } else if (cl == 7) {
- palJuego[254][0] = 0x38;
- palJuego[254][1] = 0;
- palJuego[254][2] = 0;
- } else if (cl == 8) {
- palJuego[254][0] = 0x3F;
- palJuego[254][1] = 0x27;
- palJuego[254][2] = 0x0B;
- } else if (cl == 9) {
- palJuego[254][0] = 0x2A;
- palJuego[254][1] = 0;
- palJuego[254][2] = 0x2A;
- } else if (cl == 10) {
- palJuego[254][0] = 0x30;
- palJuego[254][1] = 0x30;
- palJuego[254][2] = 0x30;
- } else if (cl == 11) {
- palJuego[254][0] = 98;
- palJuego[254][1] = 91;
- palJuego[254][2] = 100;
- };
-
- setvgapalette256((byte *)&palJuego);
-}
-
-char DrasculaEngine::LimitaVGA(char valor) {
- return (valor & 0x3F) * (valor > 0);
+int DrasculaEngine::getTime() {
+ return _system->getMillis() / 20; // originaly was 1
}
-void DrasculaEngine::centra_texto(const char *mensaje, int x_texto, int y_texto) {
- char bb[200], m2[200], m1[200], mb[10][50];
- char m3[200];
- int h, fil, x_texto3, x_texto2, x_texto1, conta_f = 0, ya = 0;
-
- strcpy(m1, " ");
- strcpy(m2, " ");
- strcpy(m3, " ");
- strcpy(bb, " ");
-
- for (h = 0; h < 10; h++)
- strcpy(mb[h], " ");
-
- if (x_texto > 160)
- ya = 1;
-
- strcpy(m1, mensaje);
- if (x_texto < 60)
- x_texto = 60;
- if (x_texto > 255)
- x_texto = 255;
-
- x_texto1 = x_texto;
-
- if (ya == 1)
- x_texto1 = 315 - x_texto;
-
- x_texto2 = (strlen(m1) / 2) * ANCHO_LETRAS;
-
-tut:
- strcpy(bb, m1);
- scumm_strrev(bb);
-
- if (x_texto1 < x_texto2) {
- strcpy(m3, strrchr(m1, ' '));
- strcpy(m1, strstr(bb, " "));
- scumm_strrev(m1);
- m1[strlen(m1) - 1] = '\0';
- strcat(m3, m2);
- strcpy(m2, m3);
- };
-
- x_texto2 = (strlen(m1) / 2) * ANCHO_LETRAS;
- if (x_texto1 < x_texto2)
- goto tut;
- strcpy(mb[conta_f], m1);
-
- if (!strcmp(m2, ""))
- goto imprimir;
- scumm_strrev(m2);
- m2[strlen(m2) - 1] = '\0';
- scumm_strrev(m2);
- strcpy(m1, m2);
- strcpy(m2, "");
- conta_f++;
-
- goto tut;
-
-imprimir:
-
- fil = y_texto - (((conta_f + 3) * ALTO_LETRAS));
-
- for (h = 0; h < conta_f + 1; h++) {
- x_texto3 = strlen(mb[h]) / 2;
- print_abc(mb[h], ((x_texto) - x_texto3 * ANCHO_LETRAS) - 1, fil);
- fil = fil + ALTO_LETRAS + 2;
- }
-}
+void DrasculaEngine::reduce_hare_chico(int xx1, int yy1, int xx2, int yy2, int width, int height, int factor, byte *dir_inicio, byte *dir_fin) {
+ float totalX, totalY;
+ int n, m;
+ float pixelX, pixelY;
+ int pixelPos[6];
-void DrasculaEngine::comienza_sound(const char *fichero) {
- if (hay_sb == 1) {
- sku = new Common::File;
- sku->open(fichero);
- if (!sku->isOpen()) {
- error("no puedo abrir archivo de voz");
- }
- }
- ctvd_init(2);
- ctvd_speaker(1);
- ctvd_output(sku);
-}
+ newWidth = (width * factor) / 100;
+ newHeight = (height * factor) / 100;
-void DrasculaEngine::anima(const char *animation, int FPS) {
- Common::File FileIn;
- unsigned j;
- int NFrames = 1;
- int cnt = 2;
+ totalX = width / newWidth;
+ totalY = height / newHeight;
- AuxBuffLast = (byte *)malloc(65000);
- AuxBuffDes = (byte *)malloc(65000);
+ pixelX = xx1;
+ pixelY = yy1;
- FileIn.open(animation);
+ for (n = 0; n < newHeight; n++) {
+ for (m = 0; m < newWidth; m++) {
+ pixelPos[0] = (int)pixelX;
+ pixelPos[1] = (int)pixelY;
+ pixelPos[2] = xx2 + m;
+ pixelPos[3] = yy2 + n;
+ pixelPos[4] = 1;
+ pixelPos[5] = 1;
- if (!FileIn.isOpen()) {
- error("No encuentro un fichero de animation.");
- }
+ copyRectClip(pixelPos, dir_inicio, dir_fin);
- FileIn.read(&NFrames, sizeof(NFrames));
- FileIn.read(&Leng, sizeof(Leng));
- AuxBuffOrg = (byte *)malloc(Leng);
- FileIn.read(AuxBuffOrg, Leng);
- FileIn.read(cPal, 768);
- carga_pcx(AuxBuffOrg);
- free(AuxBuffOrg);
- memcpy(VGA, AuxBuffDes, 64000);
- _system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200);
- _system->updateScreen();
- set_dac(cPal);
- memcpy(AuxBuffLast, AuxBuffDes, 64000);
- WaitForNext(FPS);
- while (cnt < NFrames) {
- FileIn.read(&Leng, sizeof(Leng));
- AuxBuffOrg = (byte *)malloc(Leng);
- FileIn.read(AuxBuffOrg, Leng);
- FileIn.read(cPal, 768);
- carga_pcx(AuxBuffOrg);
- free(AuxBuffOrg);
- for (j = 0;j < 64000; j++) {
- VGA[j] = AuxBuffLast[j] = AuxBuffDes[j] ^ AuxBuffLast[j];
+ pixelX += totalX;
}
- _system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200);
- _system->updateScreen();
- WaitForNext(FPS);
- cnt++;
- byte key = getscan();
- if (key == Common::KEYCODE_ESCAPE)
- term_int = 1;
- if (key != 0)
- break;
- }
- free(AuxBuffLast);
- free(AuxBuffDes);
- FileIn.close();
-}
-
-void DrasculaEngine::animafin_sound_corte() {
- if (hay_sb == 1) {
- ctvd_stop();
- delete sku;
- sku = NULL;
- ctvd_terminate();
+ pixelX = xx1;
+ pixelY += totalY;
}
}
-void DrasculaEngine::FundeAlNegro(int VelocidadDeFundido) {
- char fundido;
- unsigned int color, componente;
-
- DacPalette256 palFundido;
-
- for (fundido = 63; fundido >= 0; fundido--) {
- for (color = 0; color < 256; color++) {
- for (componente = 0; componente < 3; componente++) {
- palFundido[color][componente] = LimitaVGA(palJuego[color][componente] - 63 + fundido);
- }
- }
- pause(VelocidadDeFundido);
-
- setvgapalette256((byte *)&palFundido);
- }
-}
-
-void DrasculaEngine::pause(int cuanto) {
- _system->delayMillis(cuanto * 30); // was originaly 2
-}
-
-void DrasculaEngine::pon_igor() {
- int pos_igor[6];
-
- pos_igor[0] = 1;
- if (num_ejec == 4) {
- pos_igor[1] = 138;
- } else {
- if (sentido_igor == 3)
- pos_igor[1] = 138;
- else if (sentido_igor == 1)
- pos_igor[1] = 76;
- }
- pos_igor[2] = x_igor;
- pos_igor[3] = y_igor;
- pos_igor[4] = 54;
- pos_igor[5] = 61;
-
- copyRectClip(pos_igor, dir_hare_frente, dir_zona_pantalla);
-}
-
-void DrasculaEngine::pon_dr() {
- int pos_dr[6];
-
- if (sentido_dr == 1)
- pos_dr[0] = 47;
- else if (sentido_dr == 0)
- pos_dr[0] = 1;
- else if (sentido_dr == 3 && num_ejec == 1)
- pos_dr[0] = 93;
- pos_dr[1] = 122;
- pos_dr[2] = x_dr;
- pos_dr[3] = y_dr;
- pos_dr[4] = 45;
- pos_dr[5] = 77;
-
- if (num_ejec == 6)
- copyRectClip(pos_dr, dir_dibujo2, dir_zona_pantalla);
- else
- copyRectClip(pos_dr, dir_hare_fondo, dir_zona_pantalla);
-}
-
-void DrasculaEngine::pon_bj() {
- int pos_bj[6];
-
- if (sentido_bj == 3)
- pos_bj[0] = 10;
- else if (sentido_bj == 0)
- pos_bj[0] = 37;
- pos_bj[1] = 99;
- pos_bj[2] = x_bj;
- pos_bj[3] = y_bj;
- pos_bj[4] = 26;
- pos_bj[5] = 76;
-
- copyRectClip(pos_bj, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::hipo(int contador) {
- int y = 0, sentido = 0;
- if (num_ejec == 3)
+void DrasculaEngine::hipo_sin_nadie(int counter){
+ int y = 0, trackCharacter = 0;
+ if (currentChapter == 3)
y = -1;
-comienza:
- contador--;
-
- updateRoom();
- if (num_ejec == 3)
- updateScreen(0, 0, 0, y, 320, 200, dir_zona_pantalla);
- else
- updateScreen(0, 1, 0, y, 320, 198, dir_zona_pantalla);
-
- if (sentido == 0)
- y++;
- else
- y--;
-
- if (num_ejec == 3) {
- if (y == 1)
- sentido = 1;
- if (y == -1)
- sentido = 0;
- } else {
- if (y == 2)
- sentido = 1;
- if (y == 0)
- sentido = 0;
- }
- if (contador > 0)
- goto comienza;
-
- updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-}
-
-void DrasculaEngine::fin_sound() {
- delay(1);
-
- if (hay_sb == 1) {
- while (LookForFree() != 0);
- delete sku;
- sku = NULL;
- }
-}
-
-void DrasculaEngine::playmusic(int p) {
- AudioCD.stop();
- AudioCD.play(p - 1, 1, 0, 0);
-}
-
-void DrasculaEngine::stopmusic() {
- AudioCD.stop();
-}
+ do {
+ counter--;
-int DrasculaEngine::music_status() {
- return AudioCD.isPlaying();
-}
-
-void DrasculaEngine::updateRoom() {
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- updateRefresh_pre();
- if (num_ejec == 3) {
- if (flags[0] == 0)
- pon_hare();
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
+ if (currentChapter == 3)
+ updateScreen(0, 0, 0, y, 320, 200, screenSurface);
else
- copyRect(113, 54, hare_x - 20, hare_y - 1, 77, 89, dir_dibujo3, dir_zona_pantalla);
- } else {
- pon_hare();
- }
- updateRefresh();
-}
-
-bool DrasculaEngine::carga_partida(const char *nom_game) {
- int l, n_ejec2;
- Common::InSaveFile *sav;
-
- if (!(sav = _saveFileMan->openForLoading(nom_game))) {
- error("missing savegame file");
- }
-
- n_ejec2 = sav->readSint32LE();
- if (n_ejec2 != num_ejec) {
- strcpy(nom_partida, nom_game);
- num_ejec = n_ejec2 - 1;
- hay_que_load = 1;
- return false;
- }
- sav->read(datos_actuales, 20);
- hare_x = sav->readSint32LE();
- hare_y = sav->readSint32LE();
- sentido_hare = sav->readSint32LE();
-
- for (l = 1; l < 43; l++) {
- objetos_que_tengo[l] = sav->readSint32LE();
- }
-
- for (l = 0; l < NUM_BANDERAS; l++) {
- flags[l] = sav->readSint32LE();
- }
-
- lleva_objeto = sav->readSint32LE();
- objeto_que_lleva = sav->readSint32LE();
- hay_que_load = 0;
-
- return true;
-}
-
-void DrasculaEngine::puertas_cerradas(int l) {
- if (num_ejec == 1 || num_ejec == 3 || num_ejec == 5 || num_ejec == 6)
- return;
- else if (num_ejec == 2) {
- if (num_obj[l] == 138 && flags[0] == 0)
- espuerta[l] = 0;
- else if (num_obj[l] == 138 && flags[0] == 1)
- espuerta[l] = 1;
- else if (num_obj[l] == 136 && flags[8] == 0)
- espuerta[l] = 0;
- else if (num_obj[l] == 136 && flags[8] == 1)
- espuerta[l] = 1;
- else if (num_obj[l] == 156 && flags[16] == 0)
- espuerta[l] = 0;
- else if (num_obj[l] == 156 && flags[16] == 1)
- espuerta[l] = 1;
- else if (num_obj[l] == 163 && flags[17] == 0)
- espuerta[l] = 0;
- else if (num_obj[l] == 163 && flags[17] == 1)
- espuerta[l] = 1;
- else if (num_obj[l] == 177 && flags[15] == 0)
- espuerta[l] = 0;
- else if (num_obj[l] == 177 && flags[15] == 1)
- espuerta[l] = 1;
- else if (num_obj[l] == 175 && flags[40] == 0)
- espuerta[l] = 0;
- else if (num_obj[l] == 175 && flags[40] == 1)
- espuerta[l] = 1;
- else if (num_obj[l] == 173 && flags[36] == 0)
- espuerta[l] = 0;
- else if (num_obj[l] == 173 && flags[36] == 1)
- espuerta[l] = 1;
- } else if (num_ejec == 4) {
- if (num_obj[l] == 101 && flags[0] == 0)
- espuerta[l] = 0;
- else if (num_obj[l] == 101 && flags[0] == 1 && flags[28] == 1)
- espuerta[l] = 1;
- else if (num_obj[l] == 103 && flags[0] == 0)
- espuerta[l] = 0;
- else if (num_obj[l] == 103 && flags[0] == 1)
- espuerta[l] = 1;
- else if (num_obj[l] == 104 && flags[1] == 0)
- espuerta[l] = 0;
- else if (num_obj[l] == 104 && flags[1] == 1)
- espuerta[l] = 1;
- else if (num_obj[l] == 105 && flags[1] == 0)
- espuerta[l] = 0;
- else if (num_obj[l] == 105 && flags[1] == 1)
- espuerta[l] = 1;
- else if (num_obj[l] == 106 && flags[2] == 0)
- espuerta[l] = 0;
- else if (num_obj[l] == 106 && flags[2] == 1)
- espuerta[l] = 1;
- else if (num_obj[l] == 107 && flags[2] == 0)
- espuerta[l] = 0;
- else if (num_obj[l] == 107 && flags[2] == 1)
- espuerta[l] = 1;
- else if (num_obj[l] == 110 && flags[6] == 0)
- espuerta[l] = 0;
- else if (num_obj[l] == 110 && flags[6] == 1)
- espuerta[l] = 1;
- else if (num_obj[l] == 114 && flags[4] == 0)
- espuerta[l] = 0;
- else if (num_obj[l] == 114 && flags[4] == 1)
- espuerta[l] = 1;
- else if (num_obj[l] == 115 && flags[4] == 0)
- espuerta[l] = 0;
- else if (num_obj[l] == 115 && flags[4] == 1)
- espuerta[l] = 1;
- else if (num_obj[l] == 116 && flags[5] == 0)
- espuerta[l] = 0;
- else if (num_obj[l] == 116 && flags[5] == 1 && flags[23] == 1)
- espuerta[l] = 1;
- else if (num_obj[l] == 117 && flags[5] == 0)
- espuerta[l] = 0;
- else if (num_obj[l] == 117 && flags[5] == 1)
- espuerta[l] = 1;
- else if (num_obj[l] == 120 && flags[8] == 0)
- espuerta[l] = 0;
- else if (num_obj[l] == 120 && flags[8] == 1)
- espuerta[l] = 1;
- else if (num_obj[l] == 122 && flags[7] == 0)
- espuerta[l] = 0;
- else if (num_obj[l] == 122 && flags[7] == 1)
- espuerta[l] = 1;
- }
-}
-
-void DrasculaEngine::color_hare() {
- int color, componente;
-
- for (color = 235; color < 253; color++) {
- for (componente = 0; componente < 3; componente++) {
- palJuego[color][componente] = palHare[color][componente];
- }
- }
- ActualizaPaleta();
-}
-
-void DrasculaEngine::funde_hare(int oscuridad) {
- char fundido;
- unsigned int color, componente;
-
- for (fundido = oscuridad; fundido >= 0; fundido--) {
- for (color = 235; color < 253; color++) {
- for (componente = 0; componente < 3; componente++)
- palJuego[color][componente] = LimitaVGA(palJuego[color][componente] - 8 + fundido);
- }
- }
-
- ActualizaPaleta();
-}
-
-void DrasculaEngine::paleta_hare_claro() {
- int color, componente;
-
- for (color = 235; color < 253; color++) {
- for (componente = 0; componente < 3; componente++)
- palHareClaro[color][componente] = palJuego[color][componente];
- }
-}
+ updateScreen(0, 1, 0, y, 320, 198, screenSurface);
-void DrasculaEngine::paleta_hare_oscuro() {
- int color, componente;
-
- for (color = 235; color < 253; color++) {
- for (componente = 0; componente < 3; componente++)
- palHareOscuro[color][componente] = palJuego[color][componente];
- }
-}
-
-void DrasculaEngine::hare_claro() {
- int color, componente;
-
- for (color = 235; color < 253; color++) {
- for (componente = 0; componente < 3; componente++)
- palJuego[color][componente] = palHareClaro[color][componente];
- }
-
- ActualizaPaleta();
-}
-
-void DrasculaEngine::empieza_andar() {
- hare_se_mueve = 1;
-
- paso_x = PASO_HARE_X;
- paso_y = PASO_HARE_Y;
-
- if (num_ejec == 2) {
- if ((sitio_x < hare_x) && (sitio_y <= (hare_y + alto_hare)))
- cuadrante_1();
- else if ((sitio_x < hare_x) && (sitio_y > (hare_y + alto_hare)))
- cuadrante_3();
- else if ((sitio_x > hare_x + ancho_hare) && (sitio_y <= (hare_y + alto_hare)))
- cuadrante_2();
- else if ((sitio_x > hare_x + ancho_hare) && (sitio_y > (hare_y + alto_hare)))
- cuadrante_4();
- else if (sitio_y < hare_y + alto_hare)
- anda_parriba();
- else if (sitio_y > hare_y + alto_hare)
- anda_pabajo();
- } else {
- if ((sitio_x < hare_x + ancho_hare / 2 ) && (sitio_y <= (hare_y + alto_hare)))
- cuadrante_1();
- else if ((sitio_x < hare_x + ancho_hare / 2) && (sitio_y > (hare_y + alto_hare)))
- cuadrante_3();
- else if ((sitio_x > hare_x + ancho_hare / 2) && (sitio_y <= (hare_y + alto_hare)))
- cuadrante_2();
- else if ((sitio_x > hare_x + ancho_hare / 2) && (sitio_y > (hare_y + alto_hare)))
- cuadrante_4();
+ if (trackCharacter == 0)
+ y++;
else
- hare_se_mueve = 0;
- }
- conta_vez = vez();
-}
-
-void DrasculaEngine::pon_hare() {
- int pos_hare[6];
- int r;
-
- if (hare_se_mueve == 1 && paso_x == PASO_HARE_X) {
- for (r = 0; r < paso_x; r++) {
- if (num_ejec != 2) {
- if (sentido_hare == 0 && sitio_x - r == hare_x + ancho_hare / 2) {
- hare_se_mueve = 0;
- paso_x = PASO_HARE_X;
- paso_y = PASO_HARE_Y;
- }
- if (sentido_hare == 1 && sitio_x + r == hare_x + ancho_hare / 2) {
- hare_se_mueve = 0;
- paso_x = PASO_HARE_X;
- paso_y = PASO_HARE_Y;
- hare_x = sitio_x - ancho_hare / 2;
- hare_y = sitio_y - alto_hare;
- }
- } else if (num_ejec == 2) {
- if (sentido_hare == 0 && sitio_x - r == hare_x) {
- hare_se_mueve = 0;
- paso_x = PASO_HARE_X;
- paso_y = PASO_HARE_Y;
- }
- if (sentido_hare == 1 && sitio_x + r == hare_x + ancho_hare) {
- hare_se_mueve = 0;
- paso_x = PASO_HARE_X;
- paso_y = PASO_HARE_Y;
- hare_x = sitio_x - ancho_hare + 4;
- hare_y = sitio_y - alto_hare;
- }
- }
- }
- }
- if (hare_se_mueve == 1 && paso_y == PASO_HARE_Y) {
- for (r = 0; r < paso_y; r++) {
- if (sentido_hare == 2 && sitio_y - r == hare_y + alto_hare) {
- hare_se_mueve = 0;
- paso_x = PASO_HARE_X;
- paso_y = PASO_HARE_Y;
- }
- if (sentido_hare == 3 && sitio_y + r == hare_y + alto_hare) {
- hare_se_mueve = 0;
- paso_x = PASO_HARE_X;
- paso_y = PASO_HARE_Y;
- }
- }
- }
-
- if (num_ejec == 1 || num_ejec == 4 || num_ejec == 5 || num_ejec == 6) {
- if (hare_se_ve == 0)
- goto no_vuelco;
- }
-
- if (hare_se_mueve == 0) {
- pos_hare[0] = 0;
- pos_hare[1] = DIF_MASK_HARE;
- pos_hare[2] = hare_x;
- pos_hare[3] = hare_y;
- if (num_ejec == 2) {
- pos_hare[4] = ancho_hare;
- pos_hare[5] = alto_hare;
- } else {
- pos_hare[4] = ANCHO_PERSONAJE;
- pos_hare[5] = ALTO_PERSONAJE;
- }
-
- if (sentido_hare == 0) {
- pos_hare[1] = 0;
- if (num_ejec == 2)
- copyRectClip(pos_hare, dir_hare_dch, dir_zona_pantalla);
- else
- reduce_hare_chico(pos_hare[0], pos_hare[1], pos_hare[2], pos_hare[3], pos_hare[4], pos_hare[5],
- factor_red[hare_y + alto_hare], dir_hare_dch, dir_zona_pantalla);
- } else if (sentido_hare == 1) {
- if (num_ejec == 2)
- copyRectClip(pos_hare, dir_hare_dch, dir_zona_pantalla);
- else
- reduce_hare_chico(pos_hare[0], pos_hare[1], pos_hare[2], pos_hare[3], pos_hare[4], pos_hare[5],
- factor_red[hare_y + alto_hare], dir_hare_dch, dir_zona_pantalla);
- } else if (sentido_hare == 2) {
- if (num_ejec == 2)
- copyRectClip(pos_hare, dir_hare_fondo, dir_zona_pantalla);
- else
- reduce_hare_chico(pos_hare[0], pos_hare[1], pos_hare[2], pos_hare[3], pos_hare[4], pos_hare[5],
- factor_red[hare_y + alto_hare], dir_hare_fondo, dir_zona_pantalla);
- } else {
- if (num_ejec == 2)
- copyRectClip(pos_hare, dir_hare_frente, dir_zona_pantalla);
- else
- reduce_hare_chico(pos_hare[0], pos_hare[1], pos_hare[2], pos_hare[3], pos_hare[4], pos_hare[5],
- factor_red[hare_y + alto_hare], dir_hare_frente, dir_zona_pantalla);
- }
- } else if (hare_se_mueve == 1) {
- pos_hare[0] = frame_x[num_frame];
- pos_hare[1] = frame_y + DIF_MASK_HARE;
- pos_hare[2] = hare_x;
- pos_hare[3] = hare_y;
- if (num_ejec == 2) {
- pos_hare[4] = ancho_hare;
- pos_hare[5] = alto_hare;
- } else {
- pos_hare[4] = ANCHO_PERSONAJE;
- pos_hare[5] = ALTO_PERSONAJE;
- }
- if (sentido_hare == 0) {
- pos_hare[1] = 0;
- if (num_ejec == 2)
- copyRectClip(pos_hare, dir_hare_dch, dir_zona_pantalla);
- else
- reduce_hare_chico(pos_hare[0], pos_hare[1], pos_hare[2], pos_hare[3], pos_hare[4], pos_hare[5],
- factor_red[hare_y + alto_hare], dir_hare_dch, dir_zona_pantalla);
- } else if (sentido_hare == 1) {
- if (num_ejec == 2)
- copyRectClip(pos_hare, dir_hare_dch, dir_zona_pantalla);
- else
- reduce_hare_chico(pos_hare[0], pos_hare[1], pos_hare[2], pos_hare[3], pos_hare[4], pos_hare[5],
- factor_red[hare_y + alto_hare], dir_hare_dch, dir_zona_pantalla);
- } else if (sentido_hare == 2) {
- if (num_ejec == 2)
- copyRectClip(pos_hare, dir_hare_fondo, dir_zona_pantalla);
- else
- reduce_hare_chico(pos_hare[0], pos_hare[1], pos_hare[2], pos_hare[3], pos_hare[4], pos_hare[5],
- factor_red[hare_y + alto_hare], dir_hare_fondo, dir_zona_pantalla);
- } else {
- if (num_ejec == 2)
- copyRectClip(pos_hare, dir_hare_frente, dir_zona_pantalla);
- else
- reduce_hare_chico(pos_hare[0], pos_hare[1], pos_hare[2], pos_hare[3], pos_hare[4], pos_hare[5],
- factor_red[hare_y + alto_hare], dir_hare_frente, dir_zona_pantalla);
- }
-
-no_vuelco:
- aumenta_num_frame();
- }
-}
-
-void DrasculaEngine::menu_sin_volcar() {
- int h, n, x;
- char texto_icono[13];
-
- x = sobre_que_objeto();
- strcpy(texto_icono, nombre_icono[x]);
-
- for (n = 1; n < 43; n++) {
- h = objetos_que_tengo[n];
-
- if (h != 0) {
- if (num_ejec == 6)
- copyBackground(x_pol[n], y_pol[n], x_obj[n], y_obj[n],
- ANCHOBJ, ALTOBJ, dir_mesa, dir_zona_pantalla);
- else
- copyBackground(x_pol[n], y_pol[n], x_obj[n], y_obj[n],
- ANCHOBJ, ALTOBJ, dir_hare_frente, dir_zona_pantalla);
- }
- copyRect(x1d_menu[h], y1d_menu[h], x_obj[n], y_obj[n],
- ANCHOBJ, ALTOBJ, dir_hare_fondo, dir_zona_pantalla);
- }
-
- if (x < 7)
- print_abc(texto_icono, x_obj[x] - 2, y_obj[x] - 7);
-}
-
-void DrasculaEngine::barra_menu() {
- int n, sobre_verbo = 1;
-
- for (n = 0; n < 7; n++) {
- if (x_raton > x_barra[n] && x_raton < x_barra[n + 1])
- sobre_verbo = 0;
- copyRect(ANCHOBJ * n, ALTOBJ * sobre_verbo, x_barra[n], 2,
- ANCHOBJ, ALTOBJ, dir_hare_fondo, dir_zona_pantalla);
- sobre_verbo = 1;
- }
-}
-
-void DrasculaEngine::saca_objeto() {
- int h = 0, n;
-
- updateRoom();
-
- for (n = 1; n < 43; n++){
- if (sobre_que_objeto() == n) {
- h = objetos_que_tengo[n];
- objetos_que_tengo[n] = 0;
- if (h != 0)
- lleva_objeto = 1;
- }
- }
-
- espera_soltar();
-
- if (lleva_objeto == 1)
- elige_objeto(h);
-}
-
-bool DrasculaEngine::sal_de_la_habitacion(int l) {
- char salgo[13];
-
- if (num_ejec == 1) {
- if (num_obj[l] == 105 && flags[0] == 0)
- talk(_text[_lang][442], "442.als");
- else {
- puertas_cerradas(l);
- if (espuerta[l] != 0) {
- lleva_al_hare(sitiobj_x[l], sitiobj_y[l]);
- sentido_hare = sentidobj[l];
- updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- hare_se_mueve = 0;
- sentido_hare = sentido_alkeva[l];
- obj_saliendo = alapuertakeva[l];
- rompo = 1;
- musica_antes = musica_room;
-
- if (num_obj[l] == 105) {
- animation_2_1();
- return true;
- }
- clearRoom();
- strcpy(salgo, alapantallakeva[l]);
- strcat(salgo, ".ald");
- hare_x = -1;
- carga_escoba(salgo);
- }
- }
- } else if (num_ejec == 2) {
- puertas_cerradas(l);
- if (espuerta[l] != 0) {
- lleva_al_hare(sitiobj_x[l], sitiobj_y[l]);
- hare_se_mueve = 0;
- sentido_hare = sentido_alkeva[l];
- obj_saliendo = alapuertakeva[l];
- rompo = 1;
- musica_antes = musica_room;
- if (num_obj[l] == 136)
- animation_2_2();
- if (num_obj[l] == 124)
- animation_3_2();
- if (num_obj[l] == 173) {
- animation_35_2();
- return true;
- } if (num_obj[l] == 146 && flags[39] == 1) {
- flags[5] = 1;
- flags[11] = 1;
- }
- if (num_obj[l] == 176 && flags[29] == 1) {
- flags[29] = 0;
- resta_objeto(23);
- suma_objeto(11);
- }
- clearRoom();
- delete ald;
- ald = NULL;
- strcpy(salgo, alapantallakeva[l]);
- strcat(salgo, ".ald");
- hare_x =- 1;
- carga_escoba(salgo);
- }
- } else if (num_ejec == 3) {
- puertas_cerradas(l);
- if (espuerta[l] != 0 && visible[l] == 1) {
- lleva_al_hare(sitiobj_x[l], sitiobj_y[l]);
- sentido_hare = sentidobj[l];
- updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- hare_se_mueve = 0;
- sentido_hare = sentido_alkeva[l];
- obj_saliendo = alapuertakeva[l];
- rompo = 1;
- musica_antes = musica_room;
- clearRoom();
- strcpy(salgo, alapantallakeva[l]);
- strcat(salgo, ".ald");
- hare_x =- 1;
- carga_escoba(salgo);
- }
- } else if (num_ejec == 4) {
- puertas_cerradas(l);
- if (espuerta[l] != 0) {
- lleva_al_hare(sitiobj_x[l], sitiobj_y[l]);
- sentido_hare = sentidobj[l];
- updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- hare_se_mueve = 0;
- sentido_hare = sentido_alkeva[l];
- obj_saliendo = alapuertakeva[l];
- rompo = 1;
- musica_antes = musica_room;
-
- if (num_obj[l] == 108)
- lleva_al_hare(171, 78);
- clearRoom();
- strcpy(salgo, alapantallakeva[l]);
- strcat(salgo, ".ald");
- hare_x = -1;
- carga_escoba(salgo);
- }
- } else if (num_ejec == 5) {
- puertas_cerradas(l);
- if (espuerta[l] != 0 && visible[l] == 1) {
- lleva_al_hare(sitiobj_x[l], sitiobj_y[l]);
- sentido_hare = sentidobj[l];
- updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- hare_se_mueve = 0;
- sentido_hare = sentido_alkeva[l];
- obj_saliendo = alapuertakeva[l];
- rompo = 1;
- musica_antes = musica_room;
- hare_se_ve = 1;
- clearRoom();
- strcpy(salgo, alapantallakeva[l]);
- strcat(salgo, ".ald");
- hare_x = -1;
- carga_escoba(salgo);
- }
- } else if (num_ejec == 6) {
- puertas_cerradas(l);
- if (espuerta[l] != 0) {
- lleva_al_hare(sitiobj_x[l], sitiobj_y[l]);
- sentido_hare = sentidobj[l];
- updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- hare_se_mueve = 0;
- sentido_hare = sentido_alkeva[l];
- obj_saliendo = alapuertakeva[l];
- rompo = 1;
- musica_antes = musica_room;
- clearRoom();
- strcpy(salgo, alapantallakeva[l]);
- strcat(salgo, ".ald");
- hare_x = -1;
- carga_escoba(salgo);
-
- if (obj_saliendo == 105)
- animation_19_6();
- }
- }
-
- return false;
-}
-
-bool DrasculaEngine::coge_objeto() {
- int h, n;
- h = objeto_que_lleva;
- comprueba_flags = 1;
-
- updateRoom();
- menu_sin_volcar();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- if (objeto_que_lleva < 7)
- goto usando_verbos;
-
- for (n = 1; n < 43; n++) {
- if (sobre_que_objeto() == n && objetos_que_tengo[n] == 0) {
- objetos_que_tengo[n] = h;
- lleva_objeto = 0;
- comprueba_flags = 0;
- }
- }
-
-usando_verbos:
-
- if (comprueba_flags == 1) {
- if (comprueba_banderas_menu())
- return true;
- }
- espera_soltar();
- if (lleva_objeto == 0)
- sin_verbo();
-
- return false;
-}
-
-bool DrasculaEngine::banderas(int fl) {
- hare_se_mueve = 0;
- updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- hay_respuesta = 1;
-
- if (menu_scr == 1) {
- if (num_ejec == 1) {
- if (objeto_que_lleva == LOOK && fl == 28)
- talk(_text[_lang][328], "328.als");
- } else if (num_ejec == 2) {
- if ((objeto_que_lleva == LOOK && fl == 22 && flags[23] == 0)
- || (objeto_que_lleva == OPEN && fl == 22 && flags[23] == 0)) {
- talk(_text[_lang][164], "164.als");
- flags[23] = 1;
- sin_verbo();
- suma_objeto(7);
- suma_objeto(18);
- } else if (objeto_que_lleva == LOOK && fl == 22 && flags[23] == 1)
- talk(_text[_lang][307], "307.als");
- else if (objeto_que_lleva == LOOK && fl == 28)
- talk(_text[_lang][328], "328.als");
- else if (objeto_que_lleva == LOOK && fl == 7)
- talk(_text[_lang][143], "143.als");
- else if (objeto_que_lleva == TALK && fl == 7)
- talk(_text[_lang][144], "144.als");
- else if (objeto_que_lleva == LOOK && fl == 8)
- talk(_text[_lang][145], "145.als");
- else if (objeto_que_lleva == TALK && fl == 8)
- talk(_text[_lang][146], "146.als");
- else if (objeto_que_lleva == LOOK && fl == 9)
- talk(_text[_lang][147], "147.als");
- else if (objeto_que_lleva == TALK && fl == 9)
- talk(_text[_lang][148], "148.als");
- else if (objeto_que_lleva == LOOK && fl == 10)
- talk(_text[_lang][151], "151.als");
- else if (objeto_que_lleva == LOOK && fl == 11)
- talk(_text[_lang][152], "152.als");
- else if (objeto_que_lleva == TALK && fl == 11)
- talk(_text[_lang][153], "153.als");
- else if (objeto_que_lleva == LOOK && fl == 12)
- talk(_text[_lang][154], "154.als");
- else if (objeto_que_lleva == LOOK && fl == 13)
- talk(_text[_lang][155], "155.als");
- else if (objeto_que_lleva == LOOK && fl == 14)
- talk(_text[_lang][157], "157.als");
- else if (objeto_que_lleva == LOOK && fl == 15)
- talk(_text[_lang][58], "58.als");
- else if (objeto_que_lleva == LOOK && fl == 16)
- talk(_text[_lang][158], "158.als");
- else if (objeto_que_lleva == LOOK && fl == 17)
- talk(_text[_lang][159], "159.als");
- else if (objeto_que_lleva == LOOK && fl == 18)
- talk(_text[_lang][160], "160.als");
- else if (objeto_que_lleva == LOOK && fl == 19)
- talk(_text[_lang][161], "161.als");
- else if (objeto_que_lleva == LOOK && fl == 20)
- talk(_text[_lang][162], "162.als");
- else if (objeto_que_lleva == LOOK && fl == 23)
- talk(_text[_lang][152], "152.als");
- else
- hay_respuesta = 0;
- } else if (num_ejec == 3) {
- if (objeto_que_lleva == LOOK && fl == 22)
- talk(_text[_lang][307], "307.als");
- else if (objeto_que_lleva == LOOK && fl == 28)
- talk(_text[_lang][328], "328.als");
- else if (objeto_que_lleva == LOOK && fl == 7)
- talk(_text[_lang][143], "143.als");
- else if (objeto_que_lleva == TALK && fl == 7)
- talk(_text[_lang][144], "144.als");
- else if (objeto_que_lleva == LOOK && fl == 8)
- talk(_text[_lang][145], "145.als");
- else if (objeto_que_lleva == TALK && fl == 8)
- talk(_text[_lang][146], "146.als");
- else if (objeto_que_lleva == LOOK && fl == 9)
- talk(_text[_lang][147], "147.als");
- else if (objeto_que_lleva == TALK && fl == 9)
- talk(_text[_lang][148], "148.als");
- else if (objeto_que_lleva == LOOK && fl == 10)
- talk(_text[_lang][151], "151.als");
- else if (objeto_que_lleva == LOOK && fl == 11)
- talk(_text[_lang][152], "152.als");
- else if (objeto_que_lleva == TALK && fl == 11)
- talk(_text[_lang][153], "153.als");
- else if (objeto_que_lleva == LOOK && fl == 12)
- talk(_text[_lang][154], "154.als");
- else if (objeto_que_lleva == LOOK && fl == 13)
- talk(_text[_lang][155], "155.als");
- else if (objeto_que_lleva == LOOK && fl == 14)
- talk(_text[_lang][157], "157.als");
- else if (objeto_que_lleva == LOOK && fl == 15)
- talk(_text[_lang][58], "58.als");
- else if (objeto_que_lleva == LOOK && fl == 16)
- talk(_text[_lang][158], "158.als");
- else if (objeto_que_lleva == LOOK && fl == 17)
- talk(_text[_lang][159], "159.als");
- else if (objeto_que_lleva == LOOK && fl == 18)
- talk(_text[_lang][160], "160.als");
- else if (objeto_que_lleva == LOOK && fl == 19)
- talk(_text[_lang][161], "161.als");
- else if (objeto_que_lleva == LOOK && fl == 20)
- talk(_text[_lang][162], "162.als");
- else if (objeto_que_lleva == LOOK && fl == 23)
- talk(_text[_lang][152], "152.als");
- else
- hay_respuesta = 0;
- } else if (num_ejec == 4) {
- if ((objeto_que_lleva == 18 && fl == 19) || (objeto_que_lleva == 19 && fl == 18)) {
- sin_verbo();
- elige_objeto(21);
- resta_objeto(18);
- resta_objeto(19);
- } else if ((objeto_que_lleva == 14 && fl == 19) || (objeto_que_lleva == 19 && fl == 14))
- talk(_text[_lang][484], "484.als");
- else if (objeto_que_lleva == LOOK && fl == 28)
- talk(_text[_lang][328], "328.als");
- else if (objeto_que_lleva == LOOK && fl == 7)
- talk(_text[_lang][478], "478.als");
- else if (objeto_que_lleva == LOOK && fl == 8)
- talk(_text[_lang][480], "480.als");
- else if (objeto_que_lleva == LOOK && fl == 9) {
- talk(_text[_lang][482], "482.als");
- talk(_text[_lang][483], "483.als");
- } else if (objeto_que_lleva == LOOK && fl == 10)
- talk(_text[_lang][485], "485.als");
- else if (objeto_que_lleva == LOOK && fl == 11)
- talk(_text[_lang][488], "488.als");
- else if (objeto_que_lleva == LOOK && fl == 12)
- talk(_text[_lang][486], "486.als");
- else if (objeto_que_lleva == LOOK && fl == 13)
- talk(_text[_lang][490], "490.als");
- else if (objeto_que_lleva == LOOK && fl == 14)
- talk(_text[_lang][122], "122.als");
- else if (objeto_que_lleva == LOOK && fl == 15)
- talk(_text[_lang][117], "117.als");
- else if (objeto_que_lleva == TALK && fl == 15)
- talk(_text[_lang][118], "118.als");
- else if (objeto_que_lleva == OPEN && fl == 15)
- talk(_text[_lang][119], "119.als");
- else if (objeto_que_lleva == LOOK && fl == 16)
- talk(_text[_lang][491], "491.als");
- else if (objeto_que_lleva == LOOK && fl == 17)
- talk(_text[_lang][478], "478.als");
- else if (objeto_que_lleva == LOOK && fl == 18)
- talk(_text[_lang][493], "493.als");
- else if (objeto_que_lleva == LOOK && fl == 19) {
- talk(_text[_lang][494], "494.als");
- talk(_text[_lang][495], "495.als");
- } else if (objeto_que_lleva == LOOK && fl == 20)
- talk(_text[_lang][162], "162.als");
- else if (objeto_que_lleva == LOOK && fl == 21)
- talk(_text[_lang][496], "496.als");
- else if (objeto_que_lleva == LOOK && fl == 22)
- talk(_text[_lang][161], "161.als");
- else
- hay_respuesta = 0;
- } else if (num_ejec == 5) {
- if (objeto_que_lleva == LOOK && fl == 28)
- talk(_text[_lang][328], "328.als");
- else if (objeto_que_lleva == LOOK && fl == 7)
- talk(_text[_lang][478],"478.als");
- else if (objeto_que_lleva == LOOK && fl == 8)
- talk(_text[_lang][120], "120.als");
- else if (objeto_que_lleva == LOOK && fl == 9) {
- talk(_text[_lang][482], "482.als");
- talk(_text[_lang][483], "483.als");
- } else if (objeto_que_lleva == LOOK && fl == 11)
- talk(_text[_lang][488], "488.als");
- else if (objeto_que_lleva == LOOK && fl == 13)
- talk(_text[_lang][490], "490.als");
- else if (objeto_que_lleva == LOOK && fl == 14)
- talk(_text[_lang][121], "121.als");
- else if (objeto_que_lleva == LOOK && fl == 15)
- talk(_text[_lang][117], "117.als");
- else if (objeto_que_lleva == TALK && fl == 15)
- talk(_text[_lang][118], "118.als");
- else if (objeto_que_lleva == OPEN && fl == 15)
- talk(_text[_lang][119], "119.als");
- else if (objeto_que_lleva == LOOK && fl == 17)
- talk(_text[_lang][478], "478.als");
- else if (objeto_que_lleva == LOOK && fl == 20)
- talk(_text[_lang][162], "162.als");
- else
- hay_respuesta = 0;
- } else if (num_ejec == 6) {
- if (objeto_que_lleva == LOOK && fl == 28)
- talk(_text[_lang][328], "328.als");
- else if (objeto_que_lleva == LOOK && fl == 9) {
- talk(_text[_lang][482], "482.als");
- talk(_text[_lang][483], "483.als");
- } else if (objeto_que_lleva == LOOK && fl == 20)
- talk(_text[_lang][123], "123.als");
- else if (objeto_que_lleva == LOOK && fl == 21)
- talk(_text[_lang][441], "441.als");
- else
- hay_respuesta = 0;
- }
- } else {
- if (num_ejec == 1) {
- if (objeto_que_lleva == LOOK && fl == 50)
- talk(_text[_lang][308], "308.als");
- else if (objeto_que_lleva == OPEN && fl == 50)
- talk(_text[_lang][310], "310.als");
- else if (objeto_que_lleva == CLOSE && fl == 50)
- talk(_text[_lang][311], "311.als");
- else if (objeto_que_lleva == MOVE && fl == 50)
- talk(_text[_lang][312], "312.als");
- else if (objeto_que_lleva == PICK && fl == 50)
- talk(_text[_lang][313], "313.als");
- else if (objeto_que_lleva == TALK && fl == 50)
- talk(_text[_lang][314], "314.als");
- else if (!strcmp(num_room, "62.alg"))
- room_62(fl);
- else if (!strcmp(num_room, "63.alg"))
- room_63(fl);
- else
- hay_respuesta = 0;
- } else if (num_ejec == 2) {
- if (objeto_que_lleva == LOOK && fl == 50)
- talk(_text[_lang][308], "308.als");
- else if (objeto_que_lleva == OPEN && fl == 50)
- talk(_text[_lang][310], "310.als");
- else if (objeto_que_lleva == CLOSE && fl == 50)
- talk(_text[_lang][311], "311.als");
- else if (objeto_que_lleva == MOVE && fl == 50)
- talk(_text[_lang][312], "312.als");
- else if (objeto_que_lleva == PICK && fl == 50)
- talk(_text[_lang][313], "313.als");
- else if (objeto_que_lleva == TALK && fl == 50)
- talk(_text[_lang][314], "314.als");
- else if (objeto_que_lleva == 11 && fl == 50 && flags[22] == 0 && strcmp(num_room, "18.alg"))
- talk(_text[_lang][315], "315.als");
- else if (objeto_que_lleva == 13 && fl == 50)
- talk(_text[_lang][156], "156.als");
- else if (objeto_que_lleva == 20 && fl == 50)
- talk(_text[_lang][163], "163.als");
- else if (!strcmp(num_room, "1.alg"))
- room_1(fl);
- else if (!strcmp(num_room, "3.alg"))
- room_3(fl);
- else if (!strcmp(num_room, "4.alg"))
- room_4(fl);
- else if (!strcmp(num_room, "5.alg"))
- room_5(fl);
- else if (!strcmp(num_room, "6.alg"))
- room_6(fl);
- else if (!strcmp(num_room, "7.alg"))
- room_7(fl);
- else if (!strcmp(num_room, "8.alg"))
- room_8(fl);
- else if (!strcmp(num_room, "9.alg"))
- room_9(fl);
- else if (!strcmp(num_room, "12.alg"))
- room_12(fl);
- else if (!strcmp(num_room, "14.alg"))
- room_14(fl);
- else if (!strcmp(num_room, "15.alg"))
- room_15(fl);
- else if (!strcmp(num_room, "16.alg"))
- room_16(fl);
- else if (!strcmp(num_room, "17.alg"))
- room_17(fl);
- else if (!strcmp(num_room, "18.alg"))
- room_18(fl);
- else if (!strcmp(num_room, "19.alg"))
- room_19(fl);
- else
- hay_respuesta = 0;
- } else if (num_ejec == 3) {
- if (objeto_que_lleva == LOOK && fl == 50)
- talk(_text[_lang][309], "309.als");
- else if (objeto_que_lleva == OPEN && fl == 50)
- talk(_text[_lang][310], "310.als");
- else if (objeto_que_lleva == CLOSE && fl == 50)
- talk(_text[_lang][311], "311.als");
- else if (objeto_que_lleva == MOVE && fl == 50)
- talk(_text[_lang][312], "312.als");
- else if (objeto_que_lleva == PICK && fl == 50)
- talk(_text[_lang][313], "313.als");
- else if (objeto_que_lleva == TALK && fl == 50)
- talk(_text[_lang][314], "314.als");
- else if (!strcmp(num_room, "13.alg")) {
- if (room_13(fl))
- return true;
- } else
- hay_respuesta = 0;
- } else if (num_ejec == 4) {
- if (!strcmp(num_room, "28.alg"))
- talk(_text[_lang][178], "178.als");
- else if (objeto_que_lleva == LOOK && fl == 50)
- talk(_text[_lang][309], "309.als");
- else if (objeto_que_lleva == OPEN && fl == 50)
- talk(_text[_lang][310], "310.als");
- else if (objeto_que_lleva == CLOSE && fl == 50)
- talk(_text[_lang][311], "311.als");
- else if (objeto_que_lleva == MOVE && fl == 50)
- talk(_text[_lang][312], "312.als");
- else if (objeto_que_lleva == PICK && fl == 50)
- talk(_text[_lang][313], "313.als");
- else if (objeto_que_lleva == TALK && fl == 50)
- talk(_text[_lang][314], "314.als");
- else if (objeto_que_lleva == 8 && fl == 50 && flags[18] == 0)
- talk(_text[_lang][481], "481.als");
- else if (objeto_que_lleva == 9 && fl == 50)
- talk(_text[_lang][484], "484.als");
- else if (objeto_que_lleva == 12 && fl == 50 && flags[18] == 0)
- talk(_text[_lang][487], "487.als");
- else if (objeto_que_lleva == 20 && fl == 50)
- talk(_text[_lang][487], "487.als");
- else if (!strcmp(num_room, "21.alg")) {
- if (room_21(fl))
- return true;
- } else if (!strcmp(num_room, "22.alg"))
- room_22(fl);
- else if (!strcmp(num_room, "23.alg"))
- room_23(fl);
- else if (!strcmp(num_room, "24.alg"))
- room_24(fl);
- else if (!strcmp(num_room, "26.alg"))
- room_26(fl);
- else if (!strcmp(num_room, "27.alg"))
- room_27(fl);
- else if (!strcmp(num_room, "29.alg"))
- room_29(fl);
- else if (!strcmp(num_room, "30.alg"))
- room_30(fl);
- else if (!strcmp(num_room, "31.alg"))
- room_31(fl);
- else if (!strcmp(num_room, "34.alg"))
- room_34(fl);
- else if (!strcmp(num_room, "35.alg"))
- room_35(fl);
- else if (!strcmp(num_room, "44.alg"))
- room_44(fl);
- else
- hay_respuesta = 0;
- } else if (num_ejec == 5) {
- if (objeto_que_lleva == LOOK && fl == 50)
- talk("Cuanto mas me miro, mas me gusto", "54.als");
- else if (objeto_que_lleva == OPEN && fl == 50)
- talk("y luego como me cierro", "19.als");
- else if (objeto_que_lleva == CLOSE && fl == 50)
- talk("Tendre que abrirme primero no", "19.als");
- else if (objeto_que_lleva == MOVE && fl == 50)
- talk("Estoy bien donde estoy", "19.als");
- else if (objeto_que_lleva == PICK && fl == 50)
- talk("Ya me tengo", "11.als");
- else if (objeto_que_lleva == TALK && fl == 50)
- talk("hola yo", "16.als");
- else if (objeto_que_lleva == 20 && fl == 50)
- talk(_text[_lang][487], "487.als");
- else if (!strcmp(num_room, "49.alg"))
- room_49(fl);
- else if (!strcmp(num_room, "53.alg"))
- room_53(fl);
- else if (!strcmp(num_room, "54.alg"))
- room_54(fl);
- else if (!strcmp(num_room, "55.alg"))
- room_55(fl);
- else if (!strcmp(num_room, "56.alg")) {
- if (room_56(fl))
- return true;
- } else
- hay_respuesta = 0;
- } else if (num_ejec == 6) {
- if (objeto_que_lleva == LOOK && fl == 50 && flags[0] == 1)
- talk(_text[_lang][308], "308.als");
- else if (objeto_que_lleva == LOOK && fl == 50 && flags[0] == 0)
- talk(_text[_lang][310], "250.als" );
- else if (objeto_que_lleva == OPEN && fl == 50)
- talk(_text[_lang][310], "310.als" );
- else if (objeto_que_lleva == CLOSE && fl == 50)
- talk(_text[_lang][311], "311.als" );
- else if (objeto_que_lleva == MOVE && fl == 50)
- talk(_text[_lang][312], "312.als" );
- else if (objeto_que_lleva == PICK && fl == 50)
- talk(_text[_lang][313], "313.als" );
- else if (objeto_que_lleva == TALK && fl == 50)
- talk(_text[_lang][314], "314.als" );
- else if (!strcmp(num_room, "102.alg"))
- room_pendulo(fl);
- else if (!strcmp(num_room, "58.alg"))
- room_58(fl);
- else if (!strcmp(num_room, "59.alg"))
- room_59(fl);
- else if (!strcmp(num_room, "60.alg")) {
- if (room_60(fl))
- return true;
- } else if (!strcmp(num_room, "61.alg"))
- room_61(fl);
- else
- hay_respuesta = 0;
- }
- }
- if (hay_respuesta == 0 && hay_nombre == 1)
- room_0();
- else if (hay_respuesta == 0 && menu_scr == 1)
- room_0();
-
- return false;
-}
+ y--;
-void DrasculaEngine::cursor_mesa() {
- int pos_cursor[8];
-
- pos_cursor[0] = 225;
- pos_cursor[1] = 56;
- pos_cursor[2] = x_raton - 20;
- pos_cursor[3] = y_raton - 12;
- pos_cursor[4] = 40;
- pos_cursor[5] = 25;
-
- copyRectClip(pos_cursor, dir_mesa, dir_zona_pantalla);
-}
-
-void DrasculaEngine::introduce_nombre() {
- Common::KeyCode key;
- int v = 0, h = 0;
- char select2[23];
- strcpy(select2, " ");
- for (;;) {
- buffer_teclado();
- select2[v] = '-';
- copyBackground(115, 14, 115, 14, 176, 9, dir_dibujo1, dir_zona_pantalla);
- print_abc(select2, 117, 15);
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- key = getscan();
- delay(70);
- if (key != 0) {
- if (key == Common::KEYCODE_q)
- select2[v] = 'q';
- else if (key == Common::KEYCODE_w)
- select2[v] = 'w';
- else if (key == Common::KEYCODE_e)
- select2[v] = 'e';
- else if (key == Common::KEYCODE_r)
- select2[v] = 'r';
- else if (key == Common::KEYCODE_t)
- select2[v] = 't';
- else if (key == Common::KEYCODE_y)
- select2[v] = 'y';
- else if (key == Common::KEYCODE_u)
- select2[v] = 'u';
- else if (key == Common::KEYCODE_i)
- select2[v] = 'i';
- else if (key == Common::KEYCODE_o)
- select2[v] = 'o';
- else if (key == Common::KEYCODE_p)
- select2[v] = 'p';
- else if (key == Common::KEYCODE_a)
- select2[v] = 'a';
- else if (key == Common::KEYCODE_s)
- select2[v] = 's';
- else if (key == Common::KEYCODE_d)
- select2[v] = 'd';
- else if (key == Common::KEYCODE_f)
- select2[v] = 'f';
- else if (key == Common::KEYCODE_g)
- select2[v] = 'g';
- else if (key == Common::KEYCODE_h)
- select2[v] = 'h';
- else if (key == Common::KEYCODE_j)
- select2[v] = 'j';
- else if (key == Common::KEYCODE_k)
- select2[v] = 'k';
- else if (key == Common::KEYCODE_l)
- select2[v] = 'l';
- else if ((key == Common::KEYCODE_LCTRL) || (key == Common::KEYCODE_RCTRL))
- select2[v] = '\164';
- else if (key == Common::KEYCODE_z)
- select2[v] = 'z';
- else if (key == Common::KEYCODE_x)
- select2[v] = 'x';
- else if (key == Common::KEYCODE_c)
- select2[v] = 'c';
- else if (key == Common::KEYCODE_v)
- select2[v] = 'v';
- else if (key == Common::KEYCODE_b)
- select2[v] = 'b';
- else if (key == Common::KEYCODE_n)
- select2[v] = 'n';
- else if (key == Common::KEYCODE_m)
- select2[v] = 'm';
- else if (key == Common::KEYCODE_1)
- select2[v] = '1';
- else if (key == Common::KEYCODE_2)
- select2[v] = '2';
- else if (key == Common::KEYCODE_3)
- select2[v] = '3';
- else if (key == Common::KEYCODE_4)
- select2[v] = '4';
- else if (key == Common::KEYCODE_5)
- select2[v] = '5';
- else if (key == Common::KEYCODE_6)
- select2[v] = '6';
- else if (key == Common::KEYCODE_7)
- select2[v] = '7';
- else if (key == Common::KEYCODE_8)
- select2[v] = '8';
- else if (key == Common::KEYCODE_9)
- select2[v] = '9';
- else if (key == Common::KEYCODE_0)
- select2[v] = '0';
- else if (key == Common::KEYCODE_SPACE)
- select2[v] = '\167';
- else if (key == ESC)
- break;
- else if (key == Common::KEYCODE_RETURN) {
- select2[v] = '\0';
- h = 1;
- break;
- } else if (key == Common::KEYCODE_BACKSPACE)
- select2[v] = '\0';
- else
- v--;
-
- if (key == Common::KEYCODE_BACKSPACE)
- v--;
- else
- v++;
- }
- if (v == 22)
- v = 21;
- else if (v == -1)
- v = 0;
- }
- if (h == 1) {
- strcpy(select, select2);
- hay_seleccion = 1;
- }
-}
-
-void DrasculaEngine::para_grabar(char nom_game[]) {
- graba_partida(nom_game);
- comienza_sound("99.als");
- fin_sound();
-}
-
-void DrasculaEngine::OpenSSN(const char *Name, int Pause) {
- MiVideoSSN = (byte *)malloc(64256);
- GlobalSpeed = 1000 / Pause;
- FrameSSN = 0;
- UsingMem = 0;
- if (MiVideoSSN == NULL)
- return;
- _Sesion = new Common::File;
- _Sesion->open(Name);
- mSesion = TryInMem(_Sesion);
- LastFrame = _system->getMillis();
-}
-
-int DrasculaEngine::PlayFrameSSN() {
- int Exit = 0;
- int Lengt;
- byte *BufferSSN;
-
- if (!UsingMem)
- _Sesion->read(&CHUNK, 1);
- else {
- memcpy(&CHUNK, mSesion, 1);
- mSesion += 1;
- }
- switch (CHUNK) {
- case SET_PALET:
- if (!UsingMem)
- _Sesion->read(dacSSN, 768);
- else {
- memcpy(dacSSN, mSesion, 768);
- mSesion += 768;
- }
- set_dacSSN(dacSSN);
- break;
- case EMPTY_FRAME:
- WaitFrameSSN();
- break;
- case INIT_FRAME:
- if (!UsingMem) {
- _Sesion->read(&CMP, 1);
- _Sesion->read(&Lengt, 4);
+ if (currentChapter == 3) {
+ if (y == 1)
+ trackCharacter = 1;
+ if (y == -1)
+ trackCharacter = 0;
} else {
- memcpy(&CMP, mSesion, 1);
- mSesion += 1;
- memcpy(&Lengt, mSesion, 4);
- mSesion += 4;
+ if (y == 2)
+ trackCharacter = 1;
+ if (y == 0)
+ trackCharacter = 0;
}
- if (CMP == CMP_RLE) {
- if (!UsingMem) {
- BufferSSN = (byte *)malloc(Lengt);
- _Sesion->read(BufferSSN, Lengt);
- } else {
- BufferSSN = (byte *)malloc(Lengt);
- memcpy(BufferSSN, mSesion, Lengt);
- mSesion += Lengt;
- }
- Des_RLE(BufferSSN, MiVideoSSN);
- free(BufferSSN);
- if (FrameSSN) {
- WaitFrameSSN();
- MixVideo(VGA, MiVideoSSN);
- _system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200);
- } else {
- WaitFrameSSN();
- memcpy(VGA, MiVideoSSN, 64000);
- _system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200);
- }
- _system->updateScreen();
- FrameSSN++;
- } else {
- if (CMP == CMP_OFF) {
- if (!UsingMem) {
- BufferSSN = (byte *)malloc(Lengt);
- _Sesion->read(BufferSSN, Lengt);
- } else {
- BufferSSN = (byte *)malloc(Lengt);
- memcpy(BufferSSN, mSesion, Lengt);
- mSesion += Lengt;
- }
- Des_OFF(BufferSSN, MiVideoSSN, Lengt);
- free(BufferSSN);
- if (FrameSSN) {
- WaitFrameSSN();
- MixVideo(VGA, MiVideoSSN);
- _system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200);
- } else {
- WaitFrameSSN();
- memcpy(VGA, MiVideoSSN, 64000);
- _system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200);
- }
- _system->updateScreen();
- FrameSSN++;
- }
- }
- break;
- case END_ANIM:
- Exit = 1;
- break;
- default:
- Exit = 1;
- break;
- }
+ } while (counter > 0);
- return (!Exit);
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
+ updateScreen();
}
-void DrasculaEngine::EndSSN() {
- free(MiVideoSSN);
- if (UsingMem)
- free(pointer);
- else {
- _Sesion->close();
- delete _Sesion;
- }
-}
-
-byte *DrasculaEngine::TryInMem(Common::File *Sesion) {
- int Lengt;
-
- Sesion->seek(0, SEEK_END);
- Lengt = Sesion->pos();
- Sesion->seek(0, SEEK_SET);
- pointer = (byte *)malloc(Lengt);
- if (pointer == NULL)
- return NULL;
- Sesion->read(pointer, Lengt);
- UsingMem = 1;
- Sesion->close();
- delete Sesion;
- return pointer;
-}
-
-void DrasculaEngine::set_dacSSN(byte *PalBuf) {
- setvgapalette256((byte *)PalBuf);
-}
-
-void DrasculaEngine::Des_OFF(byte *BufferOFF, byte *MiVideoOFF, int Lenght) {
- int x = 0;
- unsigned char Reps;
- int Offset;
-
- memset(MiVideoSSN, 0, 64000);
- while (x < Lenght) {
- Offset = BufferOFF[x] + BufferOFF[x + 1] * 256;
- Reps = BufferOFF[x + 2];
- memcpy(MiVideoOFF + Offset, &BufferOFF[x + 3], Reps);
- x += 3 + Reps;
- }
-}
-
-void DrasculaEngine::Des_RLE(byte *BufferRLE, byte *MiVideoRLE) {
- signed int con = 0;
- unsigned int X = 0;
- unsigned int fExit = 0;
- char ch, rep;
- while (!fExit) {
- ch = *BufferRLE++;
- rep = 1;
- if ((ch & 192) == 192) {
- rep = (ch & 63);
- ch =* BufferRLE++;
- }
- for (con = 0; con < rep; con++) {
- *MiVideoRLE++ = ch;
- X++;
- if (X > 64000)
- fExit = 1;
- }
- }
-}
-
-void DrasculaEngine::MixVideo(byte *OldScreen, byte *NewScreen) {
- int x;
- for (x = 0; x < 64000; x++)
- OldScreen[x] ^= NewScreen[x];
-}
-
-void DrasculaEngine::WaitFrameSSN() {
- uint32 now;
- while ((now = _system->getMillis()) - LastFrame < ((uint32) GlobalSpeed))
- _system->delayMillis(GlobalSpeed - (now - LastFrame));
- LastFrame = LastFrame + GlobalSpeed;
-}
-
-byte *DrasculaEngine::carga_pcx(byte *NamePcc) {
- signed int con = 0;
- unsigned int X = 0;
- unsigned int fExit = 0;
- char ch, rep;
- byte *AuxPun;
-
- AuxPun = AuxBuffDes;
-
- while (!fExit) {
- ch = *NamePcc++;
- rep = 1;
- if ((ch & 192) == 192) {
- rep = (ch & 63);
- ch = *NamePcc++;
- }
- for (con = 0; con< rep; con++) {
- *AuxPun++ = ch;
- X++;
- if (X > 64000)
- fExit = 1;
- }
- }
- return AuxBuffDes;
-}
-
-void DrasculaEngine::set_dac(byte *dac) {
- setvgapalette256((byte *)dac);
-}
-
-void DrasculaEngine::WaitForNext(int FPS) {
- _system->delayMillis(1000 / FPS);
-}
-
-int DrasculaEngine::vez() {
- return _system->getMillis() / 20; // originaly was 1
-}
-
-void DrasculaEngine::reduce_hare_chico(int xx1, int yy1, int xx2, int yy2, int ancho, int alto, int factor, byte *dir_inicio, byte *dir_fin) {
- float suma_x, suma_y;
- int n, m;
- float pixel_x, pixel_y;
- int pos_pixel[6];
-
- nuevo_ancho = (ancho * factor) / 100;
- nuevo_alto = (alto * factor) / 100;
-
- suma_x = ancho / nuevo_ancho;
- suma_y = alto / nuevo_alto;
-
- pixel_x = xx1;
- pixel_y = yy1;
-
- for (n = 0; n < nuevo_alto; n++) {
- for (m = 0; m < nuevo_ancho; m++) {
- pos_pixel[0] = (int)pixel_x;
- pos_pixel[1] = (int)pixel_y;
- pos_pixel[2] = xx2 + m;
- pos_pixel[3] = yy2 + n;
- pos_pixel[4] = 1;
- pos_pixel[5] = 1;
-
- copyRectClip(pos_pixel, dir_inicio, dir_fin);
-
- pixel_x = pixel_x + suma_x;
- }
- pixel_x = xx1;
- pixel_y = pixel_y + suma_y;
- }
-}
-
-char DrasculaEngine::codifica(char car) {
- return ~car;
-}
-
-void DrasculaEngine::cuadrante_1() {
- float distancia_x, distancia_y;
-
- if (num_ejec == 2)
- distancia_x = hare_x - sitio_x;
- else
- distancia_x = hare_x + ancho_hare / 2 - sitio_x;
-
- distancia_y = (hare_y + alto_hare) - sitio_y;
-
- if (distancia_x < distancia_y) {
- direccion_hare = 0;
- sentido_hare = 2;
- paso_x = (int)(distancia_x / (distancia_y / PASO_HARE_Y));
- } else {
- direccion_hare = 7;
- sentido_hare = 0;
- paso_y = (int)(distancia_y / (distancia_x / PASO_HARE_X));
- }
-}
-
-void DrasculaEngine::cuadrante_2() {
- float distancia_x, distancia_y;
-
- if (num_ejec == 2)
- distancia_x = abs(hare_x + ancho_hare - sitio_x);
- else
- distancia_x = abs(hare_x + ancho_hare / 2 - sitio_x);
-
- distancia_y = (hare_y + alto_hare) - sitio_y;
-
- if (distancia_x < distancia_y) {
- direccion_hare = 1;
- sentido_hare = 2;
- paso_x = (int)(distancia_x / (distancia_y / PASO_HARE_Y));
- } else {
- direccion_hare = 2;
- sentido_hare = 1;
- paso_y = (int)(distancia_y / (distancia_x / PASO_HARE_X));
- }
-}
-
-void DrasculaEngine::cuadrante_3() {
- float distancia_x, distancia_y;
-
- if (num_ejec == 2)
- distancia_x = hare_x - sitio_x;
- else
- distancia_x = hare_x + ancho_hare / 2 - sitio_x;
-
- distancia_y = sitio_y - (hare_y + alto_hare);
-
- if (distancia_x < distancia_y) {
- direccion_hare = 5;
- sentido_hare = 3;
- paso_x = (int)(distancia_x / (distancia_y / PASO_HARE_Y));
- } else {
- direccion_hare = 6;
- sentido_hare = 0;
- paso_y = (int)(distancia_y / (distancia_x / PASO_HARE_X));
- }
-}
-
-void DrasculaEngine::cuadrante_4() {
- float distancia_x, distancia_y;
-
- if (num_ejec == 2)
- distancia_x = abs(hare_x + ancho_hare - sitio_x);
- else
- distancia_x = abs(hare_x + ancho_hare / 2 - sitio_x);
-
- distancia_y = sitio_y - (hare_y + alto_hare);
-
- if (distancia_x < distancia_y) {
- direccion_hare = 4;
- sentido_hare = 3;
- paso_x = (int)(distancia_x / (distancia_y / PASO_HARE_Y));
- } else {
- direccion_hare = 3;
- sentido_hare = 1;
- paso_y = (int)(distancia_y / (distancia_x / PASO_HARE_X));
- }
-}
-
-void DrasculaEngine::graba_partida(char nom_game[]) {
- Common::OutSaveFile *out;
- int l;
-
- if (!(out = _saveFileMan->openForSaving(nom_game))) {
- error("no puedo abrir el archivo");
- }
- out->writeSint32LE(num_ejec);
- out->write(datos_actuales, 20);
- out->writeSint32LE(hare_x);
- out->writeSint32LE(hare_y);
- out->writeSint32LE(sentido_hare);
-
- for (l = 1; l < 43; l++) {
- out->writeSint32LE(objetos_que_tengo[l]);
- }
-
- for (l = 0; l < NUM_BANDERAS; l++) {
- out->writeSint32LE(flags[l]);
- }
-
- out->writeSint32LE(lleva_objeto);
- out->writeSint32LE(objeto_que_lleva);
-
- out->finalize();
- if (out->ioFailed())
- warning("Can't write file '%s'. (Disk full?)", nom_game);
-
- delete out;
-}
-
-void DrasculaEngine::aumenta_num_frame() {
- diff_vez = vez() - conta_vez;
-
- if (diff_vez >= 6) {
- conta_vez = vez();
- num_frame++;
- if (num_frame == 6)
- num_frame = 0;
-
- if (direccion_hare == 0) {
- hare_x = hare_x - paso_x;
- hare_y = hare_y - paso_y;
- } else if (direccion_hare == 7) {
- hare_x = hare_x - paso_x;
- hare_y = hare_y - paso_y;
- } else if (direccion_hare == 1) {
- hare_x = hare_x + paso_x;
- hare_y = hare_y - paso_y;
- } else if (direccion_hare == 2) {
- hare_x = hare_x + paso_x;
- hare_y = hare_y - paso_y;
- } else if (direccion_hare == 3) {
- hare_x = hare_x + paso_x;
- hare_y = hare_y + paso_y;
- } else if (direccion_hare == 4) {
- hare_x = hare_x + paso_x;
- hare_y = hare_y + paso_y;
- } else if (direccion_hare == 5) {
- hare_x = hare_x - paso_x;
- hare_y = hare_y + paso_y;
- } else if (direccion_hare == 6) {
- hare_x = hare_x - paso_x;
- hare_y = hare_y + paso_y;
- }
- }
-
- if (num_ejec != 2) {
- diferencia_y = (int)(alto_hare - nuevo_alto);
- diferencia_x = (int)(ancho_hare - nuevo_ancho);
- hare_y = hare_y + diferencia_y;
- hare_x = hare_x + diferencia_x;
- alto_hare = (int)nuevo_alto;
- ancho_hare = (int)nuevo_ancho;
- }
-}
-
-int DrasculaEngine::sobre_que_objeto() {
- int n = 0;
-
- for (n = 1; n < 43; n++) {
- if (x_raton > x_obj[n] && y_raton > y_obj[n]
- && x_raton < x_obj[n] + ANCHOBJ && y_raton < y_obj[n] + ALTOBJ)
- break;
- }
-
- return n;
-}
-
-bool DrasculaEngine::comprueba_banderas_menu() {
- int h, n;
-
- for (n = 0; n < 43; n++) {
- if (sobre_que_objeto() == n) {
- h = objetos_que_tengo[n];
- if (h != 0)
- if (banderas(h))
- return true;
- }
- }
-
- return false;
-}
-
-void DrasculaEngine::conversa(const char *nom_fich) {
- int h;
- int juego1 = 1, juego2 = 1, juego3 = 1, juego4 = 1;
- char frase1[78];
- char frase2[78];
- char frase3[87];
- char frase4[78];
- char para_codificar[13];
- char suena1[13];
- char suena2[13];
- char suena3[13];
- char suena4[13];
- int longitud;
- int respuesta1;
- int respuesta2;
- int respuesta3;
- int usado1 = 0;
- int usado2 = 0;
- int usado3 = 0;
- char buffer[256];
-
- rompo_y_salgo = 0;
-
- strcpy(para_codificar, nom_fich);
-
- if (num_ejec == 5)
- sin_verbo();
-
- ald = new Common::File;
- ald->open(nom_fich);
- if (!ald->isOpen()) {
- error("missing data file");
- }
- int size = ald->size();
-
- getLine(ald, buffer, size);
- sscanf(buffer, "%s", frase1);
- getLine(ald, buffer, size);
- sscanf(buffer, "%s", frase2);
- getLine(ald, buffer, size);
- sscanf(buffer, "%s", frase3);
- getLine(ald, buffer, size);
- sscanf(buffer, "%s", frase4);
- getLine(ald, buffer, size);
- sscanf(buffer, "%s", suena1);
- getLine(ald, buffer, size);
- sscanf(buffer, "%s", suena2);
- getLine(ald, buffer, size);
- sscanf(buffer, "%s", suena3);
- getLine(ald, buffer, size);
- sscanf(buffer, "%s", suena4);
- getLine(ald, buffer, size);
- sscanf(buffer, "%d", &respuesta1);
- getLine(ald, buffer, size);
- sscanf(buffer, "%d", &respuesta2);
- getLine(ald, buffer, size);
- sscanf(buffer, "%d", &respuesta3);
- delete ald;
- ald = NULL;
-
- if (num_ejec == 2 && !strcmp(nom_fich, "op_5.cal") && flags[38] == 1 && flags[33] == 1) {
- strcpy(frase3, _text[_lang][405]);
- strcpy(suena3, "405.als");
- respuesta3 = 31;
- }
-
- if (num_ejec == 6 && !strcmp(nom_fich, "op_12.cal") && flags[7] == 1) {
- strcpy(frase3, _text[_lang][273]);
- strcpy(suena3, "273.als");
- respuesta3 = 14;
- }
-
- if (num_ejec == 6 && !strcmp(nom_fich, "op_12.cal") && flags[10] == 1) {
- strcpy(frase3, " cuanto queda para que acabe el partido?");
- strcpy(suena3, "274.als");
- respuesta3 = 15;
- }
-
- longitud = strlen(frase1);
- for (h = 0; h < longitud; h++)
- if (frase1[h] == (char)0xa7)
- frase1[h] = ' ';
-
- longitud = strlen(frase2);
- for (h = 0; h < longitud; h++)
- if (frase2[h] == (char)0xa7)
- frase2[h] = ' ';
-
- longitud = strlen(frase3);
- for (h = 0; h < longitud; h++)
- if (frase3[h] == (char)0xa7)
- frase3[h] = ' ';
-
- longitud = strlen(frase4);
- for (h = 0; h < longitud; h++)
- if (frase4[h] == (char)0xa7)
- frase4[h] = ' ';
-
- loadPic("car.alg");
- decompressPic(dir_hare_fondo, 1);
- // TODO code here should limit y position for mouse in dialog menu,
- // but we can't implement this due lack backend functionality
- // from 1(top) to 31
- color_abc(VERDE_CLARO);
-
-bucle_opc:
-
- updateRoom();
-
- if (num_ejec == 1 || num_ejec == 4 || num_ejec == 6) {
- if (music_status() == 0 && flags[11] == 0)
- playmusic(musica_room);
- } else if (num_ejec == 2) {
- if (music_status() == 0 && flags[11] == 0 && musica_room != 0)
- playmusic(musica_room);
- } else if (num_ejec == 3 || num_ejec == 5) {
- if (music_status() == 0)
- playmusic(musica_room);
- }
-
- MirarRaton();
-
- if (y_raton > 0 && y_raton < 9) {
- if (usado1 == 1 && _color != BLANCO)
- color_abc(BLANCO);
- else if (usado1 == 0 && _color != VERDE_CLARO)
- color_abc(VERDE_CLARO);
- } else if (y_raton > 8 && y_raton < 17) {
- if (usado2 == 1 && _color != BLANCO)
- color_abc(BLANCO);
- else if (usado2 == 0 && _color != VERDE_CLARO)
- color_abc(VERDE_CLARO);
- } else if (y_raton > 16 && y_raton < 25) {
- if (usado3 == 1 && _color != BLANCO)
- color_abc(BLANCO);
- else if (usado3 == 0 && _color != VERDE_CLARO)
- color_abc(VERDE_CLARO);
- } else if (_color != VERDE_CLARO)
- color_abc(VERDE_CLARO);
-
- if (y_raton > 0 && y_raton < 9)
- juego1 = 2;
- else if (y_raton > 8 && y_raton < 17)
- juego2 = 2;
- else if (y_raton > 16 && y_raton < 25)
- juego3 = 2;
- else if (y_raton > 24 && y_raton < 33)
- juego4 = 2;
-
- print_abc_opc(frase1, 1, 2, juego1);
- print_abc_opc(frase2, 1, 10, juego2);
- print_abc_opc(frase3, 1, 18, juego3);
- print_abc_opc(frase4, 1, 26, juego4);
-
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- if ((boton_izq == 1) && (juego1 == 2)) {
- delay(100);
- usado1 = 1;
- talk(frase1, suena1);
- if (num_ejec == 3)
- grr();
- else
- responde(respuesta1);
- } else if ((boton_izq == 1) && (juego2 == 2)) {
- delay(100);
- usado2 = 1;
- talk(frase2, suena2);
- if (num_ejec == 3)
- grr();
- else
- responde(respuesta2);
- } else if ((boton_izq == 1) && (juego3 == 2)) {
- delay(100);
- usado3 = 1;
- talk(frase3, suena3);
- if (num_ejec == 3)
- grr();
- else
- responde(respuesta3);
- } else if ((boton_izq == 1) && (juego4 == 2)) {
- delay(100);
- talk(frase4, suena4);
- rompo_y_salgo = 1;
- }
-
- if (boton_izq == 1) {
- delay(100);
- color_abc(VERDE_CLARO);
- }
-
- if (usado1 == 0)
- juego1 = 1;
- else
- juego1 = 3;
- if (usado2 == 0)
- juego2 = 1;
- else
- juego2 = 3;
- if (usado3 == 0)
- juego3 = 1;
- else
- juego3 = 3;
-
- juego4 = 1;
-
- if (rompo_y_salgo == 0)
- goto bucle_opc;
-
- if (num_ejec == 2)
- loadPic(fondo_y_menu);
- else
- loadPic("99.alg");
- decompressPic(dir_hare_fondo, 1);
- if (num_ejec != 5)
- sin_verbo();
-}
-
-void DrasculaEngine::print_abc_opc(const char *dicho, int x_pantalla, int y_pantalla, int juego) {
- int pos_texto[6];
- int y_de_signos, y_de_letra, x_de_letra = 0, h, longitud;
- longitud = strlen(dicho);
-
- for (h = 0; h < longitud; h++) {
- if (juego == 1) {
- y_de_letra = Y_ABC_OPC_1;
- y_de_signos = Y_SIGNOS_OPC_1;
- } else if (juego == 3) {
- y_de_letra = Y_ABC_OPC_3;
- y_de_signos = Y_SIGNOS_OPC_3;
- } else {
- y_de_letra = Y_ABC_OPC_2;
- y_de_signos = Y_SIGNOS_OPC_2;
- }
-
- int c = toupper(dicho[h]);
- if (c == 'A')
- x_de_letra = X_A_OPC;
- else if (c == 'B')
- x_de_letra = X_B_OPC;
- else if (c == 'C')
- x_de_letra = X_C_OPC;
- else if (c == 'D')
- x_de_letra = X_D_OPC;
- else if (c == 'E')
- x_de_letra = X_E_OPC;
- else if (c == 'F')
- x_de_letra = X_F_OPC;
- else if (c == 'G')
- x_de_letra = X_G_OPC;
- else if (c == 'H')
- x_de_letra = X_H_OPC;
- else if (c == 'I')
- x_de_letra = X_I_OPC;
- else if (c == 'J')
- x_de_letra = X_J_OPC;
- else if (c == 'K')
- x_de_letra = X_K_OPC;
- else if (c == 'L')
- x_de_letra = X_L_OPC;
- else if (c == 'M')
- x_de_letra = X_M_OPC;
- else if (c == 'N')
- x_de_letra = X_N_OPC;
- else if (c == 'O')
- x_de_letra = X_O_OPC;
- else if (c == 'P')
- x_de_letra = X_P_OPC;
- else if (c == 'Q')
- x_de_letra = X_Q_OPC;
- else if (c == 'R')
- x_de_letra = X_R_OPC;
- else if (c == 'S')
- x_de_letra = X_S_OPC;
- else if (c == 'T')
- x_de_letra = X_T_OPC;
- else if (c == 'U')
- x_de_letra = X_U_OPC;
- else if (c == 'V')
- x_de_letra = X_V_OPC;
- else if (c == 'W')
- x_de_letra = X_W_OPC;
- else if (c == 'X')
- x_de_letra = X_X_OPC;
- else if (c == 'Y')
- x_de_letra = X_Y_OPC;
- else if (c == 'Z')
- x_de_letra = X_Z_OPC;
- else if (c == ' ')
- x_de_letra = ESPACIO_OPC;
- else {
- y_de_letra = y_de_signos;
- if (c == '.')
- x_de_letra = X_PUNTO_OPC;
- else if (c == ',')
- x_de_letra = X_COMA_OPC;
- else if (c == '-')
- x_de_letra = X_GUION_OPC;
- else if (c == '?')
- x_de_letra = X_CIERRA_INTERROGACION_OPC;
- else if (c == 0xa8)
- x_de_letra = X_ABRE_INTERROGACION_OPC;
-// else if (c == '\'') // FIXME
-// x_de_letra = ESPACIO; // space for now
- else if (c == '"')
- x_de_letra = X_COMILLAS_OPC;
- else if (c == '!')
- x_de_letra = X_CIERRA_INTERROGACION_OPC;
- else if (c == 0xad)
- x_de_letra = X_ABRE_EXCLAMACION_OPC;
- else if (c == ';')
- x_de_letra = X_PUNTO_Y_COMA_OPC;
- else if (c == '>')
- x_de_letra = X_MAYOR_QUE_OPC;
- else if (c == '<')
- x_de_letra = X_MENOR_QUE_OPC;
- else if (c == '$')
- x_de_letra = X_DOLAR_OPC;
- else if (c == '%')
- x_de_letra = X_POR_CIENTO_OPC;
- else if (c == ':')
- x_de_letra = X_DOS_PUNTOS_OPC;
- else if (c == '&')
- x_de_letra = X_AND_OPC;
- else if (c == '/')
- x_de_letra = X_BARRA_OPC;
- else if (c == '(')
- x_de_letra = X_ABRE_PARENTESIS_OPC;
- else if (c == ')')
- x_de_letra = X_CIERRA_PARENTESIS_OPC;
- else if (c == '*')
- x_de_letra = X_ASTERISCO_OPC;
- else if (c == '+')
- x_de_letra = X_MAS_OPC;
- else if (c == '1')
- x_de_letra = X_N1_OPC;
- else if (c == '2')
- x_de_letra = X_N2_OPC;
- else if (c == '3')
- x_de_letra = X_N3_OPC;
- else if (c == '4')
- x_de_letra = X_N4_OPC;
- else if (c == '5')
- x_de_letra = X_N5_OPC;
- else if (c == '6')
- x_de_letra = X_N6_OPC;
- else if (c == '7')
- x_de_letra = X_N7_OPC;
- else if (c == '8')
- x_de_letra = X_N8_OPC;
- else if (c == '9')
- x_de_letra = X_N9_OPC;
- else if (c == '0')
- x_de_letra = X_N0_OPC;
- }
+bool DrasculaEngine::loadDrasculaDat() {
+ Common::File in;
+ int i;
- pos_texto[0] = x_de_letra;
- pos_texto[1] = y_de_letra;
- pos_texto[2] = x_pantalla;
- pos_texto[3] = y_pantalla;
- pos_texto[4] = ANCHO_LETRAS_OPC;
- pos_texto[5] = ALTO_LETRAS_OPC;
+ in.open("drascula.dat");
- copyRectClip(pos_texto, dir_hare_fondo, dir_zona_pantalla);
+ if (!in.isOpen()) {
+ Common::String errorMessage = "You're missing the 'drascula.dat' file. Get it from the ScummVM website";
+ GUIErrorMessage(errorMessage);
+ warning(errorMessage.c_str());
- x_pantalla = x_pantalla + ANCHO_LETRAS_OPC;
- }
-}
-
-void DrasculaEngine::responde(int funcion) {
- if (num_ejec == 1) {
- if (funcion == 10)
- talk_borracho(_textb[_lang][1], "B1.als");
- else if (funcion == 11)
- talk_borracho(_textb[_lang][2], "B2.als");
- else if (funcion == 12)
- talk_borracho(_textb[_lang][3], "B3.als");
- } else if (num_ejec == 2) {
- if (funcion == 8)
- animation_8_2();
- else if (funcion == 9)
- animation_9_2();
- else if (funcion == 10)
- animation_10_2();
- else if (funcion == 15)
- animation_15_2();
- else if (funcion == 16)
- animation_16_2();
- else if (funcion == 17)
- animation_17_2();
- else if (funcion == 19)
- animation_19_2();
- else if (funcion == 20)
- animation_20_2();
- else if (funcion == 21)
- animation_21_2();
- else if (funcion == 23)
- animation_23_2();
- else if (funcion == 28)
- animation_28_2();
- else if (funcion == 29)
- animation_29_2();
- else if (funcion == 30)
- animation_30_2();
- else if (funcion == 31)
- animation_31_2();
- } else if (num_ejec == 4) {
- if (funcion == 2)
- animation_2_4();
- else if (funcion == 3)
- animation_3_4();
- else if (funcion == 4)
- animation_4_4();
- } else if (num_ejec == 5) {
- if (funcion == 2)
- animation_2_5();
- else if (funcion == 3)
- animation_3_5();
- else if (funcion == 6)
- animation_6_5();
- else if (funcion == 7)
- animation_7_5();
- else if (funcion == 8)
- animation_8_5();
- else if (funcion == 15)
- animation_15_5();
- else if (funcion == 16)
- animation_16_5();
- else if (funcion == 17)
- animation_17_5();
- } else if (num_ejec == 6) {
- if (funcion == 2)
- animation_2_6();
- else if (funcion == 3)
- animation_3_6();
- else if (funcion == 4)
- animation_4_6();
- else if (funcion == 11)
- animation_11_6();
- else if (funcion == 12)
- animation_12_6();
- else if (funcion == 13)
- animation_13_6();
- else if (funcion == 14)
- animation_14_6();
- else if (funcion == 15)
- animation_15_6();
+ return false;
}
-}
-void DrasculaEngine::suma_objeto(int osj) {
- int h, puesto = 0;
+ char buf[256];
+ int ver;
- for (h = 1; h < 43; h++) {
- if (objetos_que_tengo[h] == osj)
- puesto = 1;
- }
+ in.read(buf, 8);
+ buf[8] = '\0';
- if (puesto == 0) {
- for (h = 1; h < 43; h++) {
- if (objetos_que_tengo[h] == 0) {
- objetos_que_tengo[h] = osj;
- puesto = 1;
- break;
- }
- }
- }
-}
-
-void DrasculaEngine::fin_sound_corte() {
- if (hay_sb == 1) {
- ctvd_stop();
- delete sku;
- sku = NULL;
- ctvd_terminate();
- }
-}
+ if (strcmp(buf, "DRASCULA")) {
+ Common::String errorMessage = "File 'drascula.dat' is corrupt. Get it from the ScummVM website";
+ GUIErrorMessage(errorMessage);
+ warning(errorMessage.c_str());
-void DrasculaEngine::MusicFadeout() {
- int org_vol = _mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType);
- for (;;) {
- int vol = _mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType);
- vol -= 10;
- if (vol < 0)
- vol = 0;
- _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, vol);
- if (vol == 0)
- break;
- update_events();
- _system->updateScreen();
- _system->delayMillis(50);
+ return false;
}
- AudioCD.stop();
- _system->delayMillis(100);
- _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, org_vol);
-}
-
-void DrasculaEngine::ctvd_end() {
- _mixer->stopHandle(_soundHandle);
-}
-
-void DrasculaEngine::ctvd_stop() {
- _mixer->stopHandle(_soundHandle);
-}
-
-void DrasculaEngine::ctvd_terminate() {
-// _mixer->stopHandle(_soundHandle);
-}
-void DrasculaEngine::ctvd_speaker(int flag) {}
-
-void DrasculaEngine::ctvd_output(Common::File *file_handle) {}
-
-void DrasculaEngine::ctvd_init(int b) {
- int soundSize = sku->size();
- byte *soundData = (byte *)malloc(soundSize);
- sku->seek(32);
- sku->read(soundData, soundSize);
- _mixer->playRaw(Audio::Mixer::kSFXSoundType, &_soundHandle, soundData, soundSize - 64,
- 11025, Audio::Mixer::FLAG_AUTOFREE | Audio::Mixer::FLAG_UNSIGNED);
-}
+ ver = in.readByte();
+
+ if (ver != DRASCULA_DAT_VER) {
+ snprintf(buf, 256, "File 'drascula.dat' is wrong version. Expected %d but got %d. Get it from the ScummVM website", DRASCULA_DAT_VER, ver);
+ GUIErrorMessage(buf);
+ warning(buf);
-int DrasculaEngine::LookForFree() {
- return _mixer->isSoundHandleActive(_soundHandle);
-}
-
-void DrasculaEngine::actualiza_datos() {
- if (num_ejec == 1) {
- // nothing
- } else if (num_ejec == 2) {
- if (!strcmp(num_room,"2.alg") && flags[40] == 0)
- visible[3] = 0;
- else if (!strcmp(num_room, "3.alg") && flags[3] == 1)
- visible[8] = 0;
- else if (!strcmp(num_room, "6.alg") && flags[1] == 1 && flags[10] == 0) {
- visible[2] = 0;
- visible[4] = 1;
- } else if (!strcmp(num_room, "7.alg") && flags[35] == 1)
- visible[3] = 0;
- else if (!strcmp(num_room, "14.alg") && flags[5] == 1)
- visible[4] = 0;
- else if (!strcmp(num_room, "18.alg") && flags[28] == 1)
- visible[2] = 0;
- } else if (num_ejec == 3) {
- // nothing
- } else if (num_ejec == 4) {
- if (!strcmp(num_room, "23.alg") && flags[0] == 0 && flags[11] == 0)
- visible[2] = 1;
- if (!strcmp(num_room, "23.alg") && flags[0] == 1 && flags[11] == 0)
- visible[2] = 0;
- if (!strcmp(num_room, "21.alg") && flags[10] == 1)
- visible[2] = 0;
- if (!strcmp(num_room, "22.alg") && flags[26] == 1) {
- visible[2] = 0;
- visible[1] = 1;
- }
- if (!strcmp(num_room, "22.alg") && flags[27] == 1)
- visible[3] = 0;
- if (!strcmp(num_room, "26.alg") && flags[21] == 0)
- strcpy(nombre_obj[2], "HUNCHBACKED");
- if (!strcmp(num_room, "26.alg") && flags[18] == 1)
- visible[2] = 0;
- if (!strcmp(num_room, "26.alg") && flags[12] == 1)
- visible[1] = 0;
- if (!strcmp(num_room, "35.alg") && flags[14] == 1)
- visible[2] = 0;
- if (!strcmp(num_room, "35.alg") && flags[17] == 1)
- visible[3] = 1;
- if (!strcmp(num_room, "35.alg") && flags[15] == 1)
- visible[1] = 0;
- } else if (num_ejec == 5) {
- if (!strcmp(num_room,"49.alg") && flags[6] == 1)
- visible[2] = 0;
- if (!strcmp(num_room,"49.alg") && flags[6] == 0)
- visible[1] = 0;
- if (!strcmp(num_room,"49.alg") && flags[6] == 1)
- visible[1] = 1;
- if (!strcmp(num_room,"45.alg") && flags[6] == 1)
- visible[3] = 1;
- if (!strcmp(num_room,"53.alg") && flags[2] == 1)
- visible[3] = 0;
- if (!strcmp(num_room,"54.alg") && flags[13] == 1)
- visible[3] = 0;
- if (!strcmp(num_room,"55.alg") && flags[8] == 1)
- visible[1] = 0;
- } else if (num_ejec == 6) {
- if ((!strcmp(num_room, "58.alg")) && flags[8] == 0)
- espuerta[1] = 0;
- if ((!strcmp(num_room, "58.alg")) && flags[8] == 1)
- espuerta[1] = 1;
- if (!strcmp(num_room, "59.alg"))
- espuerta[1] = 0;
- if (!strcmp(num_room, "60.alg")) {
- sentido_dr = 0;
- x_dr = 155;
- y_dr = 69;
- }
+ return false;
}
-}
-void DrasculaEngine::anda_pabajo() {
- direccion_hare = 4;
- sentido_hare = 3;
- paso_x = 0;
-}
-
-void DrasculaEngine::anda_parriba() {
- direccion_hare = 0;
- sentido_hare = 2;
- paso_x = 0;
-}
-
-void DrasculaEngine::pon_vb() {
- int pos_vb[6];
-
- if (vb_se_mueve == 0) {
- pos_vb[0] = 256;
- pos_vb[1] = 129;
- pos_vb[2] = vb_x;
- pos_vb[3] = 66;
- pos_vb[4] = 33;
- pos_vb[5] = 69;
- if (sentido_vb == 0)
- pos_vb[0] = 222;
- else if (sentido_vb == 1)
- pos_vb[0] = 188;
- } else {
- pos_vb[2] = vb_x;
- pos_vb[3] = 66;
- pos_vb[4] = 28;
- pos_vb[5] = 68;
-
- if (sentido_vb == 0) {
- pos_vb[0] = frame_vb;
- pos_vb[1] = 62;
- } else {
- pos_vb[0] = frame_vb;
- pos_vb[1] = 131;
- }
-
- frame_vb = frame_vb + 29;
- if (frame_vb > 146)
- frame_vb = 1;
+ _charMapSize = in.readUint16BE();
+ _charMap = (CharInfo *)malloc(sizeof(CharInfo) * _charMapSize);
+ for (i = 0; i < _charMapSize; i++) {
+ _charMap[i].inChar = in.readByte();
+ _charMap[i].mappedChar = in.readSint16BE();
+ _charMap[i].charType = in.readByte();
}
- copyRectClip(pos_vb, dir_hare_frente, dir_zona_pantalla);
-}
-
-void DrasculaEngine::lleva_vb(int punto_x) {
- if (punto_x < vb_x)
- sentido_vb = 0;
- else
- sentido_vb = 1;
-
- vb_se_mueve = 1;
-
- for (;;) {
- updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- if (sentido_vb == 0) {
- vb_x = vb_x - 5;
- if (vb_x <= punto_x)
- break;
- } else {
- vb_x = vb_x + 5;
- if (vb_x >= punto_x)
- break;
- }
- pause(5);
- }
+ _itemLocationsSize = in.readUint16BE();
+ _itemLocations = (ItemLocation *)malloc(sizeof(ItemLocation) * _itemLocationsSize);
+ for (i = 0; i < _itemLocationsSize; i++) {
+ _itemLocations[i].x = in.readSint16BE();
+ _itemLocations[i].y = in.readSint16BE();
+ }
+
+ _polXSize = in.readUint16BE();
+ _polX = (int *)malloc(sizeof(int) * _polXSize);
+ _polY = (int *)malloc(sizeof(int) * _polXSize);
+ for (i = 0; i < _polXSize; i++) {
+ _polX[i] = in.readSint16BE();
+ _polY[i] = in.readSint16BE();
+ }
+
+ _verbBarXSize = in.readUint16BE();
+ _verbBarX = (int *)malloc(sizeof(int) * _verbBarXSize);
+ for (i = 0; i < _verbBarXSize; i++) {
+ _verbBarX[i] = in.readSint16BE();
+ }
+
+ _x1dMenuSize = in.readUint16BE();
+ _x1d_menu = (int *)malloc(sizeof(int) * _x1dMenuSize);
+ _y1d_menu = (int *)malloc(sizeof(int) * _x1dMenuSize);
+ for (i = 0; i < _x1dMenuSize; i++) {
+ _x1d_menu[i] = in.readSint16BE();
+ _y1d_menu[i] = in.readSint16BE();
+ }
+
+ _frameXSize = in.readUint16BE();
+ _frameX = (int *)malloc(sizeof(int) * _frameXSize);
+ for (i = 0; i < _frameXSize; i++) {
+ _frameX[i] = in.readSint16BE();
+ }
+
+ _candleXSize = in.readUint16BE();
+ _candleX = (int *)malloc(sizeof(int) * _candleXSize);
+ _candleY = (int *)malloc(sizeof(int) * _candleXSize);
+ for (i = 0; i < _candleXSize; i++) {
+ _candleX[i] = in.readSint16BE();
+ _candleY[i] = in.readSint16BE();
+ }
+
+ _pianistXSize = in.readUint16BE();
+ _pianistX = (int *)malloc(sizeof(int) * _pianistXSize);
+ for (i = 0; i < _pianistXSize; i++) {
+ _pianistX[i] = in.readSint16BE();
+ }
+
+ _drunkXSize = in.readUint16BE();
+ _drunkX = (int *)malloc(sizeof(int) * _drunkXSize);
+ for (i = 0; i < _drunkXSize; i++) {
+ _drunkX[i] = in.readSint16BE();
+ }
+
+ _roomPreUpdatesSize = in.readUint16BE();
+ _roomPreUpdates = (RoomUpdate *)malloc(sizeof(RoomUpdate) * _roomPreUpdatesSize);
+ for (i = 0; i < _roomPreUpdatesSize; i++) {
+ _roomPreUpdates[i].roomNum = in.readSint16BE();
+ _roomPreUpdates[i].flag = in.readSint16BE();
+ _roomPreUpdates[i].flagValue = in.readSint16BE();
+ _roomPreUpdates[i].sourceX = in.readSint16BE();
+ _roomPreUpdates[i].sourceY = in.readSint16BE();
+ _roomPreUpdates[i].destX = in.readSint16BE();
+ _roomPreUpdates[i].destY = in.readSint16BE();
+ _roomPreUpdates[i].width = in.readSint16BE();
+ _roomPreUpdates[i].height = in.readSint16BE();
+ _roomPreUpdates[i].type = in.readSint16BE();
+ }
+
+ _roomUpdatesSize = in.readUint16BE();
+ _roomUpdates = (RoomUpdate *)malloc(sizeof(RoomUpdate) * _roomUpdatesSize);
+ for (i = 0; i < _roomUpdatesSize; i++) {
+ _roomUpdates[i].roomNum = in.readSint16BE();
+ _roomUpdates[i].flag = in.readSint16BE();
+ _roomUpdates[i].flagValue = in.readSint16BE();
+ _roomUpdates[i].sourceX = in.readSint16BE();
+ _roomUpdates[i].sourceY = in.readSint16BE();
+ _roomUpdates[i].destX = in.readSint16BE();
+ _roomUpdates[i].destY = in.readSint16BE();
+ _roomUpdates[i].width = in.readSint16BE();
+ _roomUpdates[i].height = in.readSint16BE();
+ _roomUpdates[i].type = in.readSint16BE();
+ }
+
+ _roomActionsSize = in.readUint16BE();
+ _roomActions = (RoomTalkAction *)malloc(sizeof(RoomTalkAction) * _roomActionsSize);
+ for (i = 0; i < _roomActionsSize; i++) {
+ _roomActions[i].room = in.readSint16BE();
+ _roomActions[i].chapter = in.readSint16BE();
+ _roomActions[i].action = in.readSint16BE();
+ _roomActions[i].objectID = in.readSint16BE();
+ _roomActions[i].speechID = in.readSint16BE();
+ }
+
+ _numLangs = in.readUint16BE();
+
+ _text = loadTexts(in);
+ _textd = loadTexts(in);
+ _textb = loadTexts(in);
+ _textbj = loadTexts(in);
+ _texte = loadTexts(in);
+ _texti = loadTexts(in);
+ _textl = loadTexts(in);
+ _textp = loadTexts(in);
+ _textt = loadTexts(in);
+ _textvb = loadTexts(in);
+ _textsys = loadTexts(in);
+ _texthis = loadTexts(in);
+ _textverbs = loadTexts(in);
+ _textmisc = loadTexts(in);
+ _textd1 = loadTexts(in);
- vb_se_mueve = 0;
+ return true;
}
-void DrasculaEngine::hipo_sin_nadie(int contador){
- int y = 0, sentido = 0;
- if (num_ejec == 3)
- y = -1;
+char ***DrasculaEngine::loadTexts(Common::File &in) {
+ int numTexts = in.readUint16BE();
+ char ***res;
+ int entryLen;
+ char *pos;
+ int len;
-comienza:
- contador--;
+ res = (char ***)malloc(sizeof(char *) * _numLangs);
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- if (num_ejec == 3)
- updateScreen(0, 0, 0, y, 320, 200, dir_zona_pantalla);
- else
- updateScreen(0, 1, 0, y, 320, 198, dir_zona_pantalla);
+ for (int lang = 0; lang < _numLangs; lang++) {
+ entryLen = in.readUint16BE();
- if (sentido == 0)
- y++;
- else
- y--;
+ res[lang] = (char **)malloc(sizeof(char *) * numTexts);
- if (num_ejec == 3) {
- if (y == 1)
- sentido = 1;
- if (y == -1)
- sentido = 0;
- } else {
- if (y == 2)
- sentido = 1;
- if (y == 0)
- sentido = 0;
- }
- if (contador > 0)
- goto comienza;
+ pos = (char *)malloc(entryLen);
+ res[lang][0] = pos;
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-}
+ in.read(res[lang][0], entryLen);
-void DrasculaEngine::abre_puerta(int nflag, int n_puerta) {
- if (flags[nflag] == 0) {
- if (num_ejec == 1 /*|| num_ejec == 4*/) {
- if (nflag != 7) {
- comienza_sound("s3.als");
- flags[nflag] = 1;
- }
- } else {
- comienza_sound("s3.als");
- flags[nflag] = 1;
- }
+ pos += DATAALIGNMENT;
- if (n_puerta != NO_PUERTA)
- puertas_cerradas(n_puerta);
- updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- fin_sound();
- sin_verbo();
- }
-}
+ for (int i = 1; i < numTexts; i++) {
+ pos -= 2;
-void DrasculaEngine::mapa() {
- int l, veo = 0;
+ len = READ_BE_UINT16(pos);
+ pos += 2 + len;
- for (l = 0; l < objs_room; l++) {
- if (x_raton > x1[l] && y_raton > y1[l]
- && x_raton < x2[l] && y_raton < y2[l]
- && visible[l] == 1) {
- strcpy(texto_nombre, nombre_obj[l]);
- hay_nombre = 1;
- veo = 1;
+ res[lang][i] = pos;
}
}
- if (veo == 0)
- hay_nombre = 0;
-}
-
-void DrasculaEngine::grr() {
- int longitud;
- longitud = 30;
-
- buffer_teclado();
-
- color_abc(VERDE_OSCURO);
-
- if (hay_sb == 1) {
- sku = new Common::File;
- sku->open("s10.als");
- if (!sku->isOpen()) {
- error("no puedo abrir archivo de voz");
- }
- ctvd_init(4);
- ctvd_speaker(1);
- ctvd_output(sku);
- }
-
- updateRoom();
- copyBackground(253, 110, 150, 65, 20, 30, dir_dibujo3, dir_zona_pantalla);
-
- if (con_voces == 0)
- centra_texto(".groaaarrrrgghhh!", 153, 65);
-
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
-bucless:
- int key = getscan();
- if (key != 0)
- ctvd_stop();
- buffer_teclado();
- if (hay_sb == 1) {
- if (LookForFree() != 0)
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- longitud = longitud - 2;
- if (longitud > 0)
- goto bucless;
- }
-
- updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-}
-
-void DrasculaEngine::activa_pendulo() {
- flags[1] = 2;
- hare_se_ve = 0;
- strcpy(num_room, "102.alg");
- loadPic("102.alg");
- decompressPic(dir_dibujo1, MEDIA);
- loadPic("an_p1.alg");
- decompressPic(dir_dibujo3, 1);
- loadPic("an_p2.alg");
- decompressPic(dir_hare_dch, 1);
- loadPic("an_p3.alg");
- decompressPic(dir_hare_frente, 1);
-
- copyBackground(0, 171, 0, 0, ANCHOBJ, ALTOBJ, dir_hare_fondo, dir_dibujo3);
-
- conta_ciego_vez = vez();
+ return res;
}
-void DrasculaEngine::cierra_puerta(int nflag, int n_puerta) {
- if (flags[nflag] == 1) {
- comienza_sound("s4.als");
- flags[nflag] = 0;
- if (n_puerta != NO_PUERTA)
- puertas_cerradas(n_puerta);
- updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- fin_sound();
- sin_verbo();
+void DrasculaEngine::freeTexts(char ***ptr) {
+ for (int lang = 0; lang < _numLangs; lang++) {
+ free(ptr[lang][0] - DATAALIGNMENT);
+ free(ptr[lang]);
}
+ free(ptr);
}
} // End of namespace Drascula
diff --git a/engines/drascula/drascula.h b/engines/drascula/drascula.h
index e1043561d3..ce67cc2c0e 100644
--- a/engines/drascula/drascula.h
+++ b/engines/drascula/drascula.h
@@ -35,6 +35,7 @@
#include "common/hash-str.h"
#include "common/events.h"
#include "common/keyboard.h"
+#include "common/unarj.h"
#include "sound/audiostream.h"
#include "sound/mixer.h"
@@ -45,290 +46,172 @@
namespace Drascula {
+#define DRASCULA_DAT_VER 2
+#define DATAALIGNMENT 4
+
enum DrasculaGameFeatures {
+ GF_PACKED = (1 << 0)
+};
+
+enum Languages {
+ kEnglish = 0,
+ kSpanish = 1,
+ kGerman = 2,
+ kFrench = 3,
+ kItalian = 4
+};
+
+enum Verbs {
+ kVerbDefault = -1,
+ kVerbLook = 1,
+ kVerbPick = 2,
+ kVerbOpen = 3,
+ kVerbClose = 4,
+ kVerbTalk = 5,
+ kVerbMove = 6
+};
+
+// Items up to chapter 3
+enum InventoryItems {
+ kItemMoney = 7,
+ kItemLeaves = 8,
+ kItemCross = 9,
+ kItemSpike = 10,
+ kItemEarplugs = 11,
+ kItemBook = 12,
+ kItemBubbleGum = 13,
+ kItemSickle = 14,
+ kItemTissues = 15,
+ kItemCigarettes = 16,
+ kItemCandle = 17,
+ kItemTwoCoins = 18,
+ kItemOneCoin = 19,
+ kItemReefer = 20,
+ kItemKey = 21,
+ kItemHandbag = 22,
+ kItemEarWithEarPlug = 23,
+ kItemPhone = 28
+};
+
+// Items from chapter 4 onwards
+enum InventoryItems2 {
+ kItemKey2 = 7,
+ kItemCross2 = 9,
+ kItemRope2 = 19,
+ kItemReefer2 = 20,
+ kItemOneCoin2 = 22,
+ kItemPhone2 = 28
+};
+
+enum Colors {
+ kColorBrown = 1,
+ kColorDarkBlue = 2,
+ kColorLightGreen = 3,
+ kColorDarkGreen = 4,
+ kColorYellow = 5,
+ kColorOrange = 6,
+ kColorRed = 7,
+ kColorMaroon = 8,
+ kColorPurple = 9,
+ kColorWhite = 10,
+ kColorPink = 11
+};
+
+enum SSNFrames {
+ kFrameInit = 0,
+ kFrameCmpRle = 1,
+ kFrameCmpOff = 2,
+ kFrameEndAnim = 3,
+ kFrameSetPal = 4,
+ kFrameMouseKey = 5, // unused
+ kFrameEmptyFrame = 6
+};
+
+enum IgorTalkerTypes {
+ kIgorDch = 0,
+ kIgorFront = 1,
+ kIgorDoor = 2,
+ kIgorSeated = 3,
+ kIgorWig = 4
};
+enum AnimFrameTypes {
+ kFrameBlind = 0,
+ kFrameSnore = 1,
+ kFrameBat = 2,
+ kFrameVonBraun = 3,
+ kFramePianist = 4,
+ kFrameDrunk = 5,
+ kFrameCandles = 6,
+ kFramePendulum = 7
+};
+
+#define TEXTD_START 68
+
struct DrasculaGameDescription;
-#define NUM_SAVES 10
-#define NUM_BANDERAS 50
-#define ESC 0x01
-#define F1 0x3B
-#define F2 0x3C
-#define F3 0x3D
-#define F4 0x3E
-#define F5 0x3F
-#define F6 0x40
-#define F8 0x42
-#define F9 0x43
-#define F10 0x44
-#define LOOK 1
-#define PICK 2
-#define OPEN 3
-#define CLOSE 4
-#define TALK 5
-#define MOVE 6
-#define INICISOUND 6
-#define FINALSOUND 8
-#define FINDRV 9
-#define DIF_MASK 55
-#define ANCHOBJ 40
-#define ALTOBJ 25
-
-#define X_OBJ1 5
-#define Y_OBJ1 10
-#define X_OBJ2 50
-#define Y_OBJ2 10
-#define X_OBJ3 95
-#define Y_OBJ3 10
-#define X_OBJ4 140
-#define Y_OBJ4 10
-#define X_OBJ5 185
-#define Y_OBJ5 10
-#define X_OBJ6 230
-#define Y_OBJ6 10
-#define X_OBJ7 275
-#define Y_OBJ7 10
-#define X_OBJ8 5
-#define Y_OBJ8 40
-#define X_OBJ9 50
-#define Y_OBJ9 40
-#define X_OBJ10 95
-#define Y_OBJ10 40
-#define X_OBJ11 140
-#define Y_OBJ11 40
-#define X_OBJ12 185
-#define Y_OBJ12 40
-#define X_OBJ13 230
-#define Y_OBJ13 40
-#define X_OBJ14 275
-#define Y_OBJ14 40
-#define X_OBJ15 5
-#define Y_OBJ15 70
-#define X_OBJ16 50
-#define Y_OBJ16 70
-#define X_OBJ17 95
-#define Y_OBJ17 70
-#define X_OBJ18 140
-#define Y_OBJ18 70
-#define X_OBJ19 185
-#define Y_OBJ19 70
-#define X_OBJ20 230
-#define Y_OBJ20 70
-#define X_OBJ21 275
-#define Y_OBJ21 70
-#define X_OBJ22 5
-#define Y_OBJ22 100
-#define X_OBJ23 50
-#define Y_OBJ23 100
-#define X_OBJ24 95
-#define Y_OBJ24 100
-#define X_OBJ25 140
-#define Y_OBJ25 100
-#define X_OBJ26 185
-#define Y_OBJ26 100
-#define X_OBJ27 230
-#define Y_OBJ27 100
-#define X_OBJ28 275
-#define Y_OBJ28 100
-#define X_OBJ29 5
-#define Y_OBJ29 130
-#define X_OBJ30 50
-#define Y_OBJ30 130
-#define X_OBJ31 95
-#define Y_OBJ31 130
-#define X_OBJ32 140
-#define Y_OBJ32 130
-#define X_OBJ33 185
-#define Y_OBJ33 130
-#define X_OBJ34 230
-#define Y_OBJ34 130
-#define X_OBJ35 275
-#define Y_OBJ35 130
-#define X_OBJ36 5
-#define Y_OBJ36 160
-#define X_OBJ37 50
-#define Y_OBJ37 160
-#define X_OBJ38 95
-#define Y_OBJ38 160
-#define X_OBJ39 140
-#define Y_OBJ39 160
-#define X_OBJ40 185
-#define Y_OBJ40 160
-#define X_OBJ41 230
-#define Y_OBJ41 160
-#define X_OBJ42 275
-#define Y_OBJ42 160
-#define X_OBJ43 275
-#define Y_OBJ43 160
-
-#define DIF_MASK_HARE 72
-#define DIF_MASK_ABC 22
-#define ANCHO_LETRAS 8
-#define ALTO_LETRAS 6
-
-#define Y_ABC 158
-#define Y_SIGNOS 169
-#define Y_ACENTOS 180
-
-#define X_A 6
-#define X_B 15
-#define X_C 24
-#define X_D 33
-#define X_E 42
-#define X_F 51
-#define X_G 60
-#define X_H 69
-#define X_I 78
-#define X_J 87
-#define X_K 96
-#define X_L 105
-#define X_M 114
-#define X_N 123
-#define X_GN 132
-#define X_O 141
-#define X_P 150
-#define X_Q 159
-#define X_R 168
-#define X_S 177
-#define X_T 186
-#define X_U 195
-#define X_V 204
-#define X_W 213
-#define X_X 222
-#define X_Y 231
-#define X_Z 240
-#define X_PUNTO 6
-#define X_COMA 15
-#define X_GUION 24
-#define X_CIERRA_INTERROGACION 33
-#define X_ABRE_INTERROGACION 42
-#define X_COMILLAS 51
-#define X_CIERRA_EXCLAMACION 60
-#define X_ABRE_EXCLAMACION 69
-#define X_PUNTO_Y_COMA 78
-#define X_MAYOR_QUE 87
-#define X_MENOR_QUE 96
-#define X_DOLAR 105
-#define X_POR_CIENTO 114
-#define X_DOS_PUNTOS 123
-#define X_AND 132
-#define X_BARRA 141
-#define X_ABRE_PARENTESIS 150
-#define X_CIERRA_PARENTESIS 159
-#define X_ASTERISCO 168
-#define X_MAS 177
-#define X_N1 186
-#define X_N2 195
-#define X_N3 204
-#define X_N4 213
-#define X_N5 222
-#define X_N6 231
-#define X_N7 240
-#define X_N8 249
-#define X_N9 258
-#define X_N0 267
-#define ESPACIO 250
-#define ALTO_TALK_HARE 25
-#define ANCHO_TALK_HARE 23
-#define VON_BRAUN 1
-#define AZUL_OSCURO 2
-#define VERDE_CLARO 3
-#define VERDE_OSCURO 4
-#define AMARILLO 5
-#define NARANJA 6
-#define ROJO 7
-#define MARRON 8
-#define MORADO 9
-#define BLANCO 10
-#define ROSA 11
-#define PASO_HARE_X 8
-#define PASO_HARE_Y 3
-#define ALTO_PERSONAJE 70
-#define ANCHO_PERSONAJE 43
-#define PIES_HARE 12
-
-#define ANCHO_LETRAS_OPC 6
-#define ALTO_LETRAS_OPC 5
-#define Y_ABC_OPC_1 6
-#define Y_SIGNOS_OPC_1 15
-#define Y_ABC_OPC_2 31
-#define Y_SIGNOS_OPC_2 40
-#define Y_ABC_OPC_3 56
-#define Y_SIGNOS_OPC_3 65
-#define X_A_OPC 10
-#define X_B_OPC 17
-#define X_C_OPC 24
-#define X_D_OPC 31
-#define X_E_OPC 38
-#define X_F_OPC 45
-#define X_G_OPC 52
-#define X_H_OPC 59
-#define X_I_OPC 66
-#define X_J_OPC 73
-#define X_K_OPC 80
-#define X_L_OPC 87
-#define X_M_OPC 94
-#define X_N_OPC 101
-#define X_GN_OPC 108
-#define X_O_OPC 115
-#define X_P_OPC 122
-#define X_Q_OPC 129
-#define X_R_OPC 136
-#define X_S_OPC 143
-#define X_T_OPC 150
-#define X_U_OPC 157
-#define X_V_OPC 164
-#define X_W_OPC 171
-#define X_X_OPC 178
-#define X_Y_OPC 185
-#define X_Z_OPC 192
-#define ESPACIO_OPC 199
-#define X_PUNTO_OPC 10
-#define X_COMA_OPC 17
-#define X_GUION_OPC 24
-#define X_CIERRA_INTERROGACION_OPC 31
-#define X_ABRE_INTERROGACION_OPC 38
-#define X_COMILLAS_OPC 45
-#define X_CIERRA_EXCLAMACION_OPC 52
-#define X_ABRE_EXCLAMACION_OPC 59
-#define X_PUNTO_Y_COMA_OPC 66
-#define X_MAYOR_QUE_OPC 73
-#define X_MENOR_QUE_OPC 80
-#define X_DOLAR_OPC 87
-#define X_POR_CIENTO_OPC 94
-#define X_DOS_PUNTOS_OPC 101
-#define X_AND_OPC 108
-#define X_BARRA_OPC 115
-#define X_ABRE_PARENTESIS_OPC 122
-#define X_CIERRA_PARENTESIS_OPC 129
-#define X_ASTERISCO_OPC 136
-#define X_MAS_OPC 143
-#define X_N1_OPC 150
-#define X_N2_OPC 157
-#define X_N3_OPC 164
-#define X_N4_OPC 171
-#define X_N5_OPC 178
-#define X_N6_OPC 185
-#define X_N7_OPC 192
-#define X_N8_OPC 199
-#define X_N9_OPC 206
-#define X_N0_OPC 213
-#define NO_PUERTA 99
-
-#define INIT_FRAME 0
-#define CMP_RLE 1
-#define CMP_OFF 2
-#define END_ANIM 3
-#define SET_PALET 4
-#define MOUSE_KEY 5
-#define EMPTY_FRAME 6
-
-#define COMPLETA 256
-#define MEDIA 128
+struct RoomTalkAction {
+ int room;
+ int chapter;
+ int action;
+ int objectID;
+ int speechID;
+};
+
+struct RoomUpdate {
+ int roomNum;
+ int flag;
+ int flagValue;
+ int sourceX;
+ int sourceY;
+ int destX;
+ int destY;
+ int width;
+ int height;
+ int type; // 0 - background, 1 - rect
+};
+
+struct ItemLocation {
+ int x;
+ int y;
+};
+
+struct CharInfo {
+ byte inChar;
+ uint16 mappedChar;
+ byte charType; // 0 - letters, 1 - signs, 2 - accented
+};
+
+#define NUM_SAVES 10
+#define NUM_FLAGS 50
+#define DIF_MASK 55
+#define OBJWIDTH 40
+#define OBJHEIGHT 25
+
+#define DIF_MASK_HARE 72
+#define DIF_MASK_ABC 22
+#define CHAR_WIDTH 8
+#define CHAR_HEIGHT 6
+
+#define TALK_HEIGHT 25
+#define TALK_WIDTH 23
+#define STEP_X 8
+#define STEP_Y 3
+#define CHARACTER_HEIGHT 70
+#define CHARACTER_WIDTH 43
+#define FEET_HEIGHT 12
+
+#define CHAR_WIDTH_OPC 6
+#define CHAR_HEIGHT_OPC 5
+#define NO_DOOR 99
+
+#define COMPLETE_PAL 256
+#define HALF_PAL 128
+
+static const int interf_x[] ={ 1, 65, 129, 193, 1, 65, 129 };
+static const int interf_y[] ={ 51, 51, 51, 51, 83, 83, 83 };
class DrasculaEngine : public ::Engine {
- int _gameId;
Common::KeyState _keyPressed;
protected:
@@ -339,157 +222,337 @@ protected:
public:
DrasculaEngine(OSystem *syst, const DrasculaGameDescription *gameDesc);
virtual ~DrasculaEngine();
- int getGameId() {
- return _gameId;
- }
Common::RandomSource *_rnd;
const DrasculaGameDescription *_gameDescription;
- uint32 getGameID() const;
uint32 getFeatures() const;
- uint16 getVersion() const;
- Common::Platform getPlatform() const;
- void update_events();
+ Common::Language getLanguage() const;
+ void updateEvents();
+
+ void loadArchives();
Audio::SoundHandle _soundHandle;
- void asigna_memoria();
- void libera_memoria();
- void salir_al_dos(int r);
+ void allocMemory();
+ void freeMemory();
+ void endChapter();
+
+ void loadPic(int roomNum, byte *targetSurface, int colorCount = 1) {
+ char rm[20];
+ sprintf(rm, "%i.alg", roomNum);
+ loadPic(rm, targetSurface, colorCount);
+ }
- void loadPic(const char *);
- void decompressPic(byte *dir_escritura, int plt);
+ void loadPic(const char *NamePcc, byte *targetSurface, int colorCount = 1);
typedef char DacPalette256[256][3];
- void asigna_rgb(byte *dir_lectura, int plt);
- void funde_rgb(int plt);
- void paleta_hare();
- void ActualizaPaleta();
- void setvgapalette256(byte *PalBuf);
- void copyBackground(int xorg, int yorg, int xdes, int ydes, int Ancho,
- int Alto, byte *Origen, byte *Destino);
- void copyRect(int xorg, int yorg, int xdes, int ydes, int Ancho,
- int Alto, byte *Origen, byte *Destino);
- void copyRectClip(int *Array, byte *Origen, byte *Destino);
- void updateScreen(int xorg, int yorg, int xdes, int ydes, int Ancho, int Alto, byte *Buffer);
-
- DacPalette256 palJuego;
- DacPalette256 palHare;
- DacPalette256 palHareClaro;
- DacPalette256 palHareOscuro;
+ void setRGB(byte *pal, int plt);
+ void assignDefaultPalette();
+ void setPalette(byte *PalBuf);
+ void copyBackground(int xorg, int yorg, int xdes, int ydes, int width,
+ int height, byte *src, byte *dest);
+ void copyRect(int xorg, int yorg, int xdes, int ydes, int width,
+ int height, byte *src, byte *dest);
+ void copyRectClip(int *Array, byte *src, byte *dest);
+ void updateScreen() {
+ updateScreen(0, 0, 0, 0, 320, 200, screenSurface);
+ }
+ void updateScreen(int xorg, int yorg, int xdes, int ydes, int width, int height, byte *buffer);
+ int checkWrapX(int x) {
+ if (x < 0) x += 320;
+ if (x > 319) x -= 320;
+ return x;
+ }
+ int checkWrapY(int y) {
+ if (y < 0) y += 200;
+ if (y > 199) y -= 200;
+ return y;
+ }
- byte *VGA;
+ DacPalette256 gamePalette;
+ DacPalette256 defaultPalette;
+ DacPalette256 brightPalette;
+ DacPalette256 darkPalette;
- byte *dir_dibujo1;
- byte *dir_hare_fondo;
- byte *dir_dibujo3;
- byte *dir_dibujo2;
- byte *dir_mesa;
- byte *dir_hare_dch;
- byte *dir_zona_pantalla;
- byte *dir_hare_frente;
- byte *dir_texto;
- byte *dir_pendulo;
+ // Graphics buffers/pointers
+ byte *VGA;
+ byte *bgSurface;
+ byte *backSurface;
+ byte *drawSurface3;
+ byte *drawSurface2;
+ byte *tableSurface;
+ byte *extraSurface; // not sure about this one, was "dir_hare_dch"
+ byte *screenSurface;
+ byte *frontSurface;
+ byte *textSurface;
+ byte *memPtr;
+ byte *mSession;
byte cPal[768];
- byte *Buffer_pcx;
- long LenFile;
-
- Common::File *ald, *sku;
-
- int hay_sb;
- int nivel_osc, musica_antes, musica_room;
- char num_room[20], roomDisk[20];
- char datos_actuales[20];
- int objs_room;
- char fondo_y_menu[20];
-
- char nombre_obj[30][20];
- char nombre_icono[44][13];
-
- int num_obj[40], visible[40], espuerta[40];
- int sitiobj_x[40], sitiobj_y[40], sentidobj[40];
- int objetos_que_tengo[43];
- char alapantallakeva[40][20];
- int x_alakeva[40], y_alakeva[40], sentido_alkeva[40], alapuertakeva[40];
+
+ Common::ArjFile _arj;
+
+ int actorFrames[8];
+
+ int previousMusic, roomMusic;
+ int roomNumber;
+ char roomDisk[20];
+ char currentData[20];
+ int numRoomObjs;
+ char menuBackground[20];
+
+ char objName[30][20];
+ char iconName[44][13];
+
+ int objectNum[40], visible[40], isDoor[40];
+ int roomObjX[40], roomObjY[40], trackObj[40];
+ int inventoryObjects[43];
+ char _targetSurface[40][20];
+ int _destX[40], _destY[40], trackCharacter_alkeva[40], alapuertakeva[40];
int x1[40], y1[40], x2[40], y2[40];
- int lleva_objeto, objeto_que_lleva;
- int con_voces;
- int menu_bar, menu_scr, hay_nombre;
- char texto_nombre[20];
- int frame_ciego;
- int frame_ronquido;
- int frame_murcielago;
- int c_mirar;
- int c_poder;
-
- int flags[NUM_BANDERAS];
+ int takeObject, pickedObject;
+ int withVoices;
+ int menuBar, menuScreen, hasName;
+ char textName[20];
+ int curExcuseLook;
+ int curExcuseAction;
+
+ int flags[NUM_FLAGS];
int frame_y;
- int hare_x, hare_y, hare_se_mueve, direccion_hare, sentido_hare, num_frame, hare_se_ve;
- int sitio_x, sitio_y, comprueba_flags;
- int rompo, rompo2;
- int paso_x, paso_y;
- int alto_hare, ancho_hare, alto_pies;
- int alto_talk, ancho_talk;
- int suelo_x1, suelo_y1, suelo_x2, suelo_y2;
- int cerca, lejos;
- int sentido_final, anda_a_objeto;
- int obj_saliendo;
- int diff_vez, conta_vez;
- int hay_respuesta;
- int conta_ciego_vez;
- int cambio_de_color;
- int rompo_y_salgo;
- int vb_x, sentido_vb, vb_se_mueve, frame_vb;
- float nuevo_alto, nuevo_ancho;
- int diferencia_x, diferencia_y;
+ int curX, curY, characterMoved, curDirection, trackProtagonist, num_frame, hare_se_ve;
+ int roomX, roomY, checkFlags;
+ int doBreak;
+ int stepX, stepY;
+ int curHeight, curWidth, feetHeight;
+ int talkHeight, talkWidth;
+ int floorX1, floorY1, floorX2, floorY2;
+ int near, far;
+ int trackFinal, walkToObject;
+ int objExit;
+ int timeDiff, startTime;
+ int hasAnswer;
+ int savedTime;
+ int changeColor;
+ int breakOut;
+ int vonBraunX, trackVonBraun, vonBraunHasMoved;
+ float newHeight, newWidth;
int factor_red[202];
- int frame_piano;
- int frame_borracho;
- int frame_velas;
int color_solo;
- int parpadeo;
- int x_igor, y_igor, sentido_igor;
- int x_dr, y_dr, sentido_dr;
- int x_bj, y_bj, sentido_bj;
- int cont_sv;
+ int blinking;
+ int igorX, igorY, trackIgor;
+ int drasculaX, drasculaY, trackDrascula;
+ int bjX, bjY, trackBJ;
+ int framesWithoutAction;
int term_int;
- int num_ejec;
+ int currentChapter;
int hay_que_load;
- char nom_partida[13];
+ char saveName[13];
int _color;
- int corta_musica;
+ int musicStopped;
char select[23];
- int hay_seleccion;
- int x_raton;
- int y_raton;
- int y_raton_ant;
- int boton_izq;
- int boton_dch;
-
- bool escoba();
- void Negro();
- void talk_vb(const char *, const char *);
- void talk_vbpuerta(const char *dicho, const char *filename);
- void talk_ciego(const char *, const char *, const char *);
- void talk_hacker(const char *, const char *);
- void agarra_objeto(int);
- void anda_parriba();
- void anda_pabajo();
- void pon_vb();
- void lleva_vb(int punto_x);
- void hipo_sin_nadie(int contador);
- void abre_puerta(int nflag, int n_puerta);
- void mapa();
- void buffer_teclado() { }
+ int selectionMade;
+ int mouseX;
+ int mouseY;
+ int leftMouseButton;
+ int rightMouseButton;
+
+ bool loadDrasculaDat();
+
+ bool runCurrentChapter();
+ void black();
+ void pickObject(int);
+ void walkUp();
+ void walkDown();
+ void moveVonBraun();
+ void placeVonBraun(int pointX);
+ void hipo_sin_nadie(int counter);
+ void openDoor(int nflag, int doorNum);
+ void showMap();
+
+ void setDarkPalette();
+
+ void withoutVerb();
+ void enterRoom(int);
+ void clearRoom();
+ void gotoObject(int, int);
+ void moveCursor();
+ void checkObjects();
+ void selectVerbFromBar();
+ bool verify1();
+ bool verify2();
+ Common::KeyCode getScan();
+ void selectVerb(int);
+ void updateVolume(Audio::Mixer::SoundType soundType, int prevVolume);
+ void volumeControls();
+ bool saveLoadScreen();
+ void print_abc(const char *, int, int);
+ void delay(int ms);
+ bool confirmExit();
+ void screenSaver();
+ void chooseObject(int object);
+ void addObject(int);
+ int removeObject(int osj);
+ void playFLI(const char *filefli, int vel);
+ void fadeFromBlack(int fadeSpeed);
+ void fadeToBlack(int fadeSpeed);
+ char adjustToVGA(char value);
+ void color_abc(int cl);
+ void centerText(const char *,int,int);
+ void playSound(int soundNum);
+ bool animate(const char *animation, int FPS);
+ void pause(int);
+ void placeIgor();
+ void placeBJ();
+ void placeDrascula();
+
+ void talkInit(const char *filename);
+ bool isTalkFinished(int* length);
+ void talk_igor(int, int);
+ void talk_drascula(int index, int talkerType = 0);
+ void talk_solo(const char *, const char *);
+ void talk_bartender(int, int talkerType = 0);
+ void talk_pen(const char *, const char *, int);
+ void talk_bj_bed(int);
+ void talk_htel(int);
+ void talk_bj(int);
+ void talk_baul(int);
+ void talk(int);
+ void talk(const char *, const char *);
+ void talk_sync(const char *, const char *, const char *);
+ void talk_drunk(int);
+ void talk_pianist(int);
+ void talk_werewolf(int);
+ void talk_mus(int);
+ void talk_dr_grande(int);
+ void talk_vonBraun(int);
+ void talk_vonBraunpuerta(int);
+ void talk_blind(int);
+ void talk_hacker(int);
+ void talk_generic(const char* said, const char* filename, int* faces, int faceCount, int* coords, byte* surface);
+
+ void hiccup(int);
+ void finishSound();
+ void stopSound();
+ void closeDoor(int nflag, int doorNum);
+ void playMusic(int p);
+ void stopMusic();
+ int musicStatus();
+ void updateRoom();
+ bool loadGame(const char *);
+ void updateDoor(int);
+ void setDefaultPalette();
+ void setPaletteBase(int darkness);
+ void assignBrightPalette();
+ void assignDarkPalette();
+ void setBrightPalette();
+ void updateVisible();
+ void startWalking();
+ void updateRefresh();
+ void updateRefresh_pre();
+ void moveCharacters();
+ void showMenu();
+ void clearMenu();
+ void removeObject();
+ bool exitRoom(int);
+ bool pickupObject();
+ bool checkAction(int);
+ void setCursorTable();
+ void enterName();
+ bool soundIsActive();
+ void waitFrameSSN();
+ void mixVideo(byte *OldScreen, byte *NewScreen);
+ void decodeRLE(byte *BufferRLE, byte *MiVideoRLE);
+ void decodeOffset(byte *BufferOFF, byte *MiVideoOFF, int length);
+ byte *TryInMem();
+ int playFrameSSN();
+
+ int UsingMem;
+ byte CHUNK;
+ byte CMP, dacSSN[768];
+ int FrameSSN;
+ int globalSpeed;
+ uint32 LastFrame;
+
+ int flag_tv;
+
+ void showFrame(bool firstFrame = false);
+ int getTime();
+ void reduce_hare_chico(int, int, int, int, int, int, int, byte *, byte *);
+ void quadrant_1();
+ void quadrant_2();
+ void quadrant_3();
+ void quadrant_4();
+ void saveGame(char[]);
+ void increaseFrameNum();
+ int whichObject();
+ bool checkMenuFlags();
+ void setupRoomsTable();
+ bool roomParse(int, int);
+ void converse(int);
+ void print_abc_opc(const char *, int, int, int);
+ void response(int);
+ void activatePendulum();
+
+ void MusicFadeout();
+ void playFile(const char *fname);
+
+ char *getLine(char *buf, int len);
+ void getIntFromLine(char *buf, int len, int* result);
+ void getStringFromLine(char *buf, int len, char* result);
+
+ void grr();
+ void updateAnim(int y, int destX, int destY, int width, int height, int count, byte* src, int delayVal = 3);
+ void updateAnim2(int y, int px, int py, int width, int height, int count, byte* src);
+
+ bool room(int rN, int fl);
+ bool room_0(int);
+ bool room_1(int);
+ bool room_2(int);
+ bool room_3(int);
+ bool room_4(int);
+ bool room_5(int);
+ bool room_6(int);
+ bool room_7(int);
+ bool room_8(int);
+ bool room_9(int);
+ bool room_12(int);
+ bool room_13(int);
+ bool room_14(int);
+ bool room_15(int);
+ bool room_16(int);
+ bool room_17(int);
+ bool room_18(int);
+ bool room_21(int);
+ bool room_22(int);
+ bool room_23(int);
+ bool room_24(int);
+ bool room_26(int);
+ bool room_27(int);
+ bool room_29(int);
+ bool room_30(int);
+ bool room_31(int);
+ bool room_34(int);
+ bool room_35(int);
+ bool room_49(int);
+ bool room_53(int);
+ bool room_54(int);
+ bool room_55(int);
+ bool room_56(int);
+ bool room_58(int);
+ bool room_59(int);
+ bool room_60(int);
+ bool room_62(int);
+ bool room_102(int);
+
void animation_1_1();
void animation_2_1();
- void animation_1_2();
- void animation_2_2();
void animation_3_1();
void animation_4_1();
+ //
+ void animation_1_2();
+ void animation_2_2();
void animation_3_2();
void animation_4_2();
void animation_5_2();
@@ -511,8 +574,8 @@ public:
void animation_21_2();
void animation_22_2();
void animation_23_2();
- void animation_23_anexo();
- void animation_23_anexo2();
+ void animation_23_joined();
+ void animation_23_joined2();
void animation_24_2();
void animation_25_2();
void animation_26_2();
@@ -526,225 +589,15 @@ public:
void animation_34_2();
void animation_35_2();
void animation_36_2();
-
- void update_1_pre();
- void update_2();
- void update_3();
- void update_3_pre();
- void update_4();
- void update_5();
- void update_5_pre();
- void update_6_pre();
- void update_7_pre();
- void update_9_pre();
- void update_12_pre();
- void update_14_pre();
- void update_15();
- void update_16_pre();
- void update_17_pre();
- void update_17();
- void update_18_pre();
- void update_18();
- void update_21_pre();
- void update_22_pre();
- void update_23_pre();
- void update_24_pre();
- void update_26_pre();
- void update_26();
- void update_27();
- void update_27_pre();
- void update_29();
- void update_29_pre();
- void update_30_pre();
- void update_31_pre();
- void update_34_pre();
- void update_35_pre();
- void update_31();
- void update_34();
- void update_35();
- void hare_oscuro();
-
-
- void sin_verbo();
- bool para_cargar(char[]);
- void carga_escoba(const char *);
- void clearRoom();
- void lleva_al_hare(int, int);
- void mueve_cursor();
- void comprueba_objetos();
- void espera_soltar();
- void MirarRaton();
- void elige_en_barra();
- bool comprueba1();
- bool comprueba2();
- Common::KeyCode getscan();
- void elige_verbo(int);
- void mesa();
- bool saves();
- void print_abc(const char *, int, int);
- void delay(int ms);
- bool confirma_salir();
- void salva_pantallas();
- void elige_objeto(int objeto);
- void suma_objeto(int);
- int resta_objeto(int osj);
- void fliplay(const char *filefli, int vel);
- void FundeDelNegro(int VelocidadDeFundido);
- char LimitaVGA(char valor);
- void color_abc(int cl);
- void centra_texto(const char *,int,int);
- void comienza_sound(const char *);
- void anima(const char *animation, int FPS);
- void fin_sound_corte();
- void FundeAlNegro(int VelocidadDeFundido);
- void pause(int);
- void talk_dr_grande(const char *dicho, const char *filename);
- void pon_igor();
- void pon_bj();
- void pon_dr();
- void talk_igor_dch(const char *dicho, const char *filename);
- void talk_dr_dch(const char *dicho, const char *filename);
- void talk_dr_izq(const char *dicho, const char *filename);
- void talk_solo(const char *, const char *);
- void talk_igor_frente(const char *, const char *);
- void talk_tabernero(const char *dicho, const char *filename);
- void talk_igorpuerta(const char *dicho, const char *filename);
- void talk_igor_peluca(const char *dicho, const char *filename);
- void hipo(int);
- void fin_sound();
- void talk_bj(const char *, const char *);
- void talk_baul(const char *dicho, const char *filename);
- void talk(const char *, const char *);
- void talk_sinc(const char *, const char *, const char *);
- void cierra_puerta(int nflag, int n_puerta);
- void playmusic(int p);
- void stopmusic();
- int music_status();
- void updateRoom();
- bool carga_partida(const char *);
- void puertas_cerradas(int);
- void animafin_sound_corte();
- void color_hare();
- void funde_hare(int oscuridad);
- void paleta_hare_claro();
- void paleta_hare_oscuro();
- void hare_claro();
- void actualiza_datos();
- void empieza_andar();
- void updateRefresh();
- void updateRefresh_pre();
- void pon_hare();
- void menu_sin_volcar();
- void barra_menu();
- void saca_objeto();
- bool sal_de_la_habitacion(int);
- bool coge_objeto();
- bool banderas(int);
- void cursor_mesa();
- void introduce_nombre();
- void para_grabar(char[]);
- int LookForFree();
- void OpenSSN(const char *Name, int Pause);
- void WaitFrameSSN();
- void MixVideo(byte *OldScreen, byte *NewScreen);
- void Des_RLE(byte *BufferRLE, byte *MiVideoRLE);
- void Des_OFF(byte *BufferOFF, byte *MiVideoOFF, int Lenght);
- void set_dacSSN(byte *dacSSN);
- byte *TryInMem(Common::File *Sesion);
- void EndSSN();
- int PlayFrameSSN();
-
- byte *AuxBuffOrg;
- byte *AuxBuffLast;
- byte *AuxBuffDes;
- int Leng;
-
- byte *pointer;
- int UsingMem;
- Common::File *_Sesion;
- byte CHUNK;
- byte CMP, dacSSN[768];
- byte *MiVideoSSN;
- byte *mSesion;
- int FrameSSN;
- int GlobalSpeed;
- uint32 LastFrame;
-
- int frame_pen;
- int flag_tv;
-
- byte *carga_pcx(byte *NamePcc);
- void set_dac(byte *dac);
- void WaitForNext(int FPS);
- int vez();
- void reduce_hare_chico(int, int, int, int, int, int, int, byte *, byte *);
- char codifica(char);
- void cuadrante_1();
- void cuadrante_2();
- void cuadrante_3();
- void cuadrante_4();
- void update_62();
- void update_62_pre();
- void update_63();
- void graba_partida(char[]);
- void aumenta_num_frame();
- int sobre_que_objeto();
- bool comprueba_banderas_menu();
- void room_0();
- void room_1(int);
- void room_2(int);
- void room_3(int);
- void room_4(int);
- void room_5(int);
- void room_6(int);
- void room_7(int);
- void room_8(int);
- void room_9(int);
- void room_12(int);
- void room_14(int);
- void room_15(int);
- void room_16(int);
- void room_17(int);
- void room_18(int);
- void room_19(int);
- bool room_21(int);
- void room_22(int);
- void room_23(int);
- void room_24(int);
- void room_26(int);
- void room_27(int);
- void room_29(int);
- void room_30(int);
- void room_31(int);
- void room_34(int);
- void room_35(int);
- void room_44(int);
- void room_62(int);
- void room_63(int);
- void conversa(const char *);
- void print_abc_opc(const char *, int, int, int);
- void responde(int);
- void talk_borracho(const char *dicho, const char *filename);
- void talk_pianista(const char *dicho, const char *filename);
-
- void MusicFadeout();
- void ctvd_end();
- void ctvd_stop();
- void ctvd_terminate();
- void ctvd_speaker(int flag);
- void ctvd_output(Common::File *file_handle);
- void ctvd_init(int b);
- void grr();
- bool room_13(int fl);
- void update_13();
- void update_20();
+ //
void animation_1_3();
void animation_2_3();
void animation_3_3();
void animation_4_3();
void animation_5_3();
void animation_6_3();
- void animation_rayo();
+ void animation_ray();
+ //
void animation_1_4();
void animation_2_4();
void animation_3_4();
@@ -754,6 +607,7 @@ public:
void animation_7_4();
void animation_8_4();
void animation_9_4();
+ //
void animation_1_5();
void animation_2_5();
void animation_3_5();
@@ -771,32 +625,7 @@ public:
void animation_15_5();
void animation_16_5();
void animation_17_5();
- void room_49(int);
- void room_53(int);
- void room_54(int);
- void room_55(int);
- bool room_56(int);
- void update_53_pre();
- void update_54_pre();
- void update_49_pre();
- void update_56_pre();
- void update_50();
- void update_57();
- void talk_igor_sentado(const char *, const char *);
- void talk_lobo(const char *dicho, const char *filename);
- void talk_mus(const char *dicho, const char *filename);
- void room_58(int);
- void room_59(int);
- bool room_60(int);
- void room_61(int);
- void room_pendulo(int);
- void update_pendulo();
- void update_58();
- void update_58_pre();
- void update_59_pre();
- void update_60_pre();
- void update_60();
- void update_61();
+ //
void animation_1_6();
void animation_2_6();
void animation_3_6();
@@ -813,29 +642,77 @@ public:
void animation_15_6();
void animation_18_6();
void animation_19_6();
- void activa_pendulo();
- void talk_pen(const char *, const char *);
- void talk_pen2(const char *, const char *);
- void talk_taber2(const char *, const char *);
- void talk_bj_cama(const char *dicho, const char * filename);
- void talk_htel(const char *dicho, const char *filename);
+
+ void update_1_pre();
+ void update_2();
+ void update_3();
+ void update_4();
+ void update_6_pre();
+ void update_9_pre();
+ void update_14_pre();
+ void update_13();
+ void update_16_pre();
+ void update_18_pre();
+ void update_23_pre();
+ void update_26_pre();
+ void update_26();
+ void update_35_pre();
+ void update_58();
+ void update_58_pre();
+ void update_59_pre();
+ void update_60_pre();
+ void update_60();
+ void update_62();
+ void update_62_pre();
+ void update_102();
private:
int _lang;
-};
-extern const char *_text[][501];
-extern const char *_textd[][79];
-extern const char *_textb[][15];
-extern const char *_textbj[][29];
-extern const char *_texte[][24];
-extern const char *_texti[][33];
-extern const char *_textl[][32];
-extern const char *_textp[][20];
-extern const char *_textt[][25];
-extern const char *_textvb[][63];
-extern const char *_textsys[][4];
-extern const char *_texthis[][5];
+ CharInfo *_charMap;
+ int _charMapSize;
+
+ int _itemLocationsSize;
+ int _polXSize;
+ int _verbBarXSize;
+ int _x1dMenuSize;
+ int _frameXSize;
+ int _candleXSize;
+ int _pianistXSize;
+ int _drunkXSize;
+ int _roomPreUpdatesSize;
+ int _roomUpdatesSize;
+ int _roomActionsSize;
+ int _numLangs;
+
+ char ***_text;
+ char ***_textd;
+ char ***_textb;
+ char ***_textbj;
+ char ***_texte;
+ char ***_texti;
+ char ***_textl;
+ char ***_textp;
+ char ***_textt;
+ char ***_textvb;
+ char ***_textsys;
+ char ***_texthis;
+ char ***_textverbs;
+ char ***_textmisc;
+ char ***_textd1;
+ ItemLocation *_itemLocations;
+ int *_polX, *_polY;
+ int *_verbBarX;
+ int *_x1d_menu, *_y1d_menu;
+ int *_frameX;
+ int *_candleX, *_candleY;
+ int *_pianistX, *_drunkX;
+ RoomUpdate *_roomPreUpdates, *_roomUpdates;
+ RoomTalkAction *_roomActions;
+
+ char ***loadTexts(Common::File &in);
+ void freeTexts(char ***ptr);
+};
} // End of namespace Drascula
diff --git a/engines/drascula/graphics.cpp b/engines/drascula/graphics.cpp
new file mode 100644
index 0000000000..64591a856e
--- /dev/null
+++ b/engines/drascula/graphics.cpp
@@ -0,0 +1,687 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "drascula/drascula.h"
+
+namespace Drascula {
+
+void DrasculaEngine::allocMemory() {
+ // FIXME: decodeOffset writes beyond 64000, so this
+ // buffer has been initialized to 64256 bytes (like
+ // the original did with the MiVideoSSN buffer)
+ screenSurface = (byte *)malloc(64256);
+ assert(screenSurface);
+ frontSurface = (byte *)malloc(64000);
+ assert(frontSurface);
+ backSurface = (byte *)malloc(64000);
+ assert(backSurface);
+ bgSurface = (byte *)malloc(64000);
+ assert(bgSurface);
+ drawSurface2 = (byte *)malloc(64000);
+ assert(drawSurface2);
+ drawSurface3 = (byte *)malloc(64000);
+ assert(drawSurface3);
+ tableSurface = (byte *)malloc(64000);
+ assert(tableSurface);
+ extraSurface = (byte *)malloc(64000);
+ assert(extraSurface);
+}
+
+void DrasculaEngine::freeMemory() {
+ free(screenSurface);
+ free(bgSurface);
+ free(backSurface);
+ free(drawSurface2);
+ free(tableSurface);
+ free(drawSurface3);
+ free(extraSurface);
+ free(frontSurface);
+}
+
+void DrasculaEngine::moveCursor() {
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
+
+ updateRefresh_pre();
+ moveCharacters();
+ updateRefresh();
+
+ if (!strcmp(textName, "hacker") && hasName == 1) {
+ if (_color != kColorRed && menuScreen == 0)
+ color_abc(kColorRed);
+ } else if (menuScreen == 0 && _color != kColorLightGreen)
+ color_abc(kColorLightGreen);
+ if (hasName == 1 && menuScreen == 0)
+ centerText(textName, mouseX, mouseY);
+ if (menuScreen == 1)
+ showMenu();
+ else if (menuBar == 1)
+ clearMenu();
+
+ int cursorPos[6] = { 0, 0, mouseX - 20, mouseY - 17, OBJWIDTH, OBJHEIGHT };
+ copyRectClip(cursorPos, drawSurface3, screenSurface);
+}
+
+void DrasculaEngine::setCursorTable() {
+ int cursorPos[6] = { 225, 56, mouseX - 20, mouseY - 12, 40, 25 };
+ copyRectClip(cursorPos, tableSurface, screenSurface);
+}
+
+void DrasculaEngine::loadPic(const char *NamePcc, byte *targetSurface, int colorCount) {
+ unsigned int con, x = 0;
+ unsigned int fExit = 0;
+ byte ch, rep;
+
+ _arj.open(NamePcc);
+ if (!_arj.isOpen())
+ error("missing game data %s %c", NamePcc, 7);
+
+ _arj.seek(128);
+ while (!fExit) {
+ ch = _arj.readByte();
+ rep = 1;
+ if ((ch & 192) == 192) {
+ rep = (ch & 63);
+ ch = _arj.readByte();
+ }
+ for (con = 0; con < rep; con++) {
+ x++;
+ if (x > 64000) {
+ fExit = 1;
+ break;
+ }
+ *targetSurface++ = ch;
+ }
+ }
+
+ for (int i = 0; i < 256; i++) {
+ cPal[i * 3 + 0] = _arj.readByte();
+ cPal[i * 3 + 1] = _arj.readByte();
+ cPal[i * 3 + 2] = _arj.readByte();
+ }
+
+ _arj.close();
+
+ setRGB((byte *)cPal, colorCount);
+}
+
+void DrasculaEngine::showFrame(bool firstFrame) {
+ int dataSize = _arj.readSint32LE();
+ byte *pcxData = (byte *)malloc(dataSize);
+ _arj.read(pcxData, dataSize);
+
+ for (int i = 0; i < 256; i++) {
+ cPal[i * 3 + 0] = _arj.readByte();
+ cPal[i * 3 + 1] = _arj.readByte();
+ cPal[i * 3 + 2] = _arj.readByte();
+ }
+
+ byte *prevFrame = (byte *)malloc(64000);
+ memcpy(prevFrame, VGA, 64000);
+
+ decodeRLE(pcxData, VGA);
+
+ free(pcxData);
+
+ if (!firstFrame)
+ mixVideo(VGA, prevFrame);
+
+ _system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200);
+ _system->updateScreen();
+ if (firstFrame)
+ setPalette(cPal);
+
+ free(prevFrame);
+}
+
+void DrasculaEngine::copyBackground(int xorg, int yorg, int xdes, int ydes, int width,
+ int height, byte *src, byte *dest) {
+ dest += xdes + ydes * 320;
+ src += xorg + yorg * 320;
+ for (int x = 0; x < height; x++) {
+ memcpy(dest, src, width);
+ dest += 320;
+ src += 320;
+ }
+}
+
+void DrasculaEngine::copyRect(int xorg, int yorg, int xdes, int ydes, int width,
+ int height, byte *src, byte *dest) {
+ int y, x;
+
+ dest += xdes + ydes * 320;
+ src += xorg + yorg * 320;
+
+ for (y = 0; y < height; y++)
+ for (x = 0; x < width; x++)
+ if (src[x + y * 320] != 255)
+ dest[x + y * 320] = src[x + y * 320];
+}
+
+void DrasculaEngine::copyRectClip(int *Array, byte *src, byte *dest) {
+ int y, x;
+ int xorg = Array[0];
+ int yorg = Array[1];
+ int xdes = Array[2];
+ int ydes = Array[3];
+ int width = Array[4];
+ int height = Array[5];
+
+ if (ydes < 0) {
+ yorg += -ydes;
+ height += ydes;
+ ydes = 0;
+ }
+ if (xdes < 0) {
+ xorg += -xdes;
+ width += xdes;
+ xdes = 0;
+ }
+ if ((xdes + width) > 319)
+ width -= (xdes + width) - 320;
+ if ((ydes + height) > 199)
+ height -= (ydes + height) - 200;
+
+ dest += xdes + ydes * 320;
+ src += xorg + yorg * 320;
+
+ for (y = 0; y < height; y++)
+ for (x = 0; x < width; x++)
+ if (src[x + y * 320] != 255)
+ dest[x + y * 320] = src[x + y * 320];
+}
+
+void DrasculaEngine::updateScreen(int xorg, int yorg, int xdes, int ydes, int width, int height, byte *buffer) {
+ byte *ptr = VGA;
+
+ ptr += xdes + ydes * 320;
+ buffer += xorg + yorg * 320;
+ for (int x = 0; x < height; x++) {
+ memcpy(ptr, buffer, width);
+ ptr += 320;
+ buffer += 320;
+ }
+
+ _system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200);
+ _system->updateScreen();
+}
+
+void DrasculaEngine::print_abc(const char *said, int screenX, int screenY) {
+ int letterY = 0, letterX = 0, i;
+ uint len = strlen(said);
+ byte c;
+
+ for (uint h = 0; h < len; h++) {
+ c = toupper(said[h]);
+
+ for (i = 0; i < _charMapSize; i++) {
+ if (c == _charMap[i].inChar) {
+ letterX = _charMap[i].mappedChar;
+
+ switch (_charMap[i].charType) {
+ case 0: // letters
+ letterY = (_lang == kSpanish) ? 149 : 158;
+ break;
+ case 1: // signs
+ letterY = (_lang == kSpanish) ? 160 : 169;
+ break;
+ case 2: // accented
+ letterY = 180;
+ break;
+ } // switch
+ break;
+ } // if
+ } // for
+
+ int textPos[6] = { letterX, letterY, screenX, screenY, CHAR_WIDTH, CHAR_HEIGHT };
+ copyRectClip(textPos, textSurface, screenSurface);
+
+ screenX = screenX + CHAR_WIDTH;
+ if (screenX > 317) {
+ screenX = 0;
+ screenY = screenY + CHAR_HEIGHT + 2;
+ }
+ } // for
+}
+
+void DrasculaEngine::print_abc_opc(const char *said, int screenX, int screenY, int game) {
+ int signY, letterY, letterX = 0;
+ uint len = strlen(said);
+
+ for (uint h = 0; h < len; h++) {
+ if (game == 1) {
+ letterY = 6;
+ signY = 15;
+ } else if (game == 3) {
+ letterY = 56;
+ signY = 65;
+ } else {
+ letterY = 31;
+ signY = 40;
+ }
+
+ byte c = toupper(said[h]);
+
+ // WORKAROUND: Even original did not process it correctly
+ // Fixes apostrophe rendering
+ if (_lang != kSpanish)
+ if (c == '\'')
+ c = (byte)'\244';
+
+ for (int i = 0; i < _charMapSize; i++) {
+ if (c == _charMap[i].inChar) {
+ // Convert the mapped char of the normal font to the
+ // mapped char of the dialogue font
+
+ int multiplier = (_charMap[i].mappedChar - 6) / 9;
+
+ letterX = multiplier * 7 + 10;
+
+ if (_charMap[i].charType > 0)
+ letterY = signY;
+ break;
+ } // if
+ } // for
+
+ int textPos[6] = { letterX, letterY, screenX, screenY, CHAR_WIDTH_OPC, CHAR_HEIGHT_OPC };
+ copyRectClip(textPos, backSurface, screenSurface);
+
+ screenX = screenX + CHAR_WIDTH_OPC;
+ }
+}
+
+void DrasculaEngine::centerText(const char *message, int textX, int textY) {
+ char bb[200], m2[200], m1[200], mb[10][50];
+ char m3[200];
+ int h, fil, textX3, textX2, textX1, conta_f = 0, ya = 0;
+
+ strcpy(m1, " ");
+ strcpy(m2, " ");
+ strcpy(m3, " ");
+ strcpy(bb, " ");
+
+ for (h = 0; h < 10; h++)
+ strcpy(mb[h], " ");
+
+ if (textX > 160)
+ ya = 1;
+
+ strcpy(m1, message);
+ textX = CLIP<int>(textX, 60, 255);
+
+ textX1 = textX;
+
+ if (ya == 1)
+ textX1 = 315 - textX;
+
+ textX2 = (strlen(m1) / 2) * CHAR_WIDTH;
+
+ while (true) {
+ strcpy(bb, m1);
+ scumm_strrev(bb);
+
+ if (textX1 < textX2) {
+ strcpy(m3, strrchr(m1, ' '));
+ strcpy(m1, strstr(bb, " "));
+ scumm_strrev(m1);
+ m1[strlen(m1) - 1] = '\0';
+ strcat(m3, m2);
+ strcpy(m2, m3);
+ };
+
+ textX2 = (strlen(m1) / 2) * CHAR_WIDTH;
+
+ if (textX1 < textX2)
+ continue;
+
+ strcpy(mb[conta_f], m1);
+
+ if (!strcmp(m2, ""))
+ break;
+
+ scumm_strrev(m2);
+ m2[strlen(m2) - 1] = '\0';
+ scumm_strrev(m2);
+ strcpy(m1, m2);
+ strcpy(m2, "");
+ conta_f++;
+ }
+
+ fil = textY - (((conta_f + 3) * CHAR_HEIGHT));
+
+ for (h = 0; h < conta_f + 1; h++) {
+ textX3 = strlen(mb[h]) / 2;
+ print_abc(mb[h], ((textX) - textX3 * CHAR_WIDTH) - 1, fil);
+ fil = fil + CHAR_HEIGHT + 2;
+ }
+}
+
+void DrasculaEngine::screenSaver() {
+ int xr, yr;
+ byte *copia, *ghost;
+ float coeff = 0, coeff2 = 0;
+ int count = 0;
+ int count2 = 0;
+ int tempLine[320];
+ int tempRow[200];
+
+ clearRoom();
+
+ loadPic("sv.alg", bgSurface, HALF_PAL);
+
+ // inicio_ghost();
+ copia = (byte *)malloc(64000);
+ ghost = (byte *)malloc(65536);
+
+ // carga_ghost();
+ _arj.open("ghost.drv");
+ if (!_arj.isOpen())
+ error("Cannot open file ghost.drv");
+
+ _arj.read(ghost, 65536);
+ _arj.close();
+
+ updateEvents();
+ xr = mouseX;
+ yr = mouseY;
+
+ for (;;) {
+ // efecto(bgSurface);
+
+ memcpy(copia, bgSurface, 64000);
+ coeff += 0.1f;
+ coeff2 = coeff;
+
+ if (++count > 319)
+ count = 0;
+
+ for (int i = 0; i < 320; i++) {
+ tempLine[i] = (int)(sin(coeff2) * 16);
+ coeff2 += 0.02f;
+ tempLine[i] = checkWrapY(tempLine[i]);
+ }
+
+ coeff2 = coeff;
+ for (int i = 0; i < 200; i++) {
+ tempRow[i] = (int)(sin(coeff2) * 16);
+ coeff2 += 0.02f;
+ tempRow[i] = checkWrapX(tempRow[i]);
+ }
+
+ if (++count2 > 199)
+ count2 = 0;
+
+ int x1_, y1_, off1, off2;
+
+ for (int i = 0; i < 200; i++) {
+ for (int j = 0; j < 320; j++) {
+ x1_ = j + tempRow[i];
+ x1_ = checkWrapX(x1_);
+
+ y1_ = i + count2;
+ y1_ = checkWrapY(y1_);
+
+ off1 = 320 * y1_ + x1_;
+
+ x1_ = j + count;
+ x1_ = checkWrapX(x1_);
+
+ y1_ = i + tempLine[j];
+ y1_ = checkWrapY(y1_);
+ off2 = 320 * y1_ + x1_;
+
+ VGA[320 * i + j] = ghost[bgSurface[off2] + (copia[off1] << 8)];
+ }
+ }
+ _system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200);
+ _system->updateScreen();
+
+ _system->delayMillis(20);
+
+ // end of efecto()
+
+ updateEvents();
+ if (rightMouseButton == 1 || leftMouseButton == 1)
+ break;
+ if (mouseX != xr)
+ break;
+ if (mouseY != yr)
+ break;
+ }
+ // fin_ghost();
+ free(copia);
+ free(ghost);
+
+ loadPic(roomNumber, bgSurface, HALF_PAL);
+}
+
+void DrasculaEngine::playFLI(const char *filefli, int vel) {
+ // Open file
+ globalSpeed = 1000 / vel;
+ FrameSSN = 0;
+ UsingMem = 0;
+ _arj.open(filefli);
+ mSession = TryInMem();
+ LastFrame = _system->getMillis();
+
+ while (playFrameSSN() && (!term_int)) {
+ if (getScan() == Common::KEYCODE_ESCAPE)
+ term_int = 1;
+ }
+
+ if (UsingMem)
+ free(memPtr);
+ else
+ _arj.close();
+}
+
+int DrasculaEngine::playFrameSSN() {
+ int Exit = 0;
+ uint32 length;
+ byte *BufferSSN;
+
+ if (!UsingMem)
+ CHUNK = _arj.readByte();
+ else {
+ memcpy(&CHUNK, mSession, 1);
+ mSession += 1;
+ }
+
+ switch (CHUNK) {
+ case kFrameSetPal:
+ if (!UsingMem) {
+ for (int i = 0; i < 256; i++) {
+ dacSSN[i * 3 + 0] = _arj.readByte();
+ dacSSN[i * 3 + 1] = _arj.readByte();
+ dacSSN[i * 3 + 2] = _arj.readByte();
+ }
+ } else {
+ memcpy(dacSSN, mSession, 768);
+ mSession += 768;
+ }
+ setPalette(dacSSN);
+ break;
+ case kFrameEmptyFrame:
+ waitFrameSSN();
+ break;
+ case kFrameInit:
+ if (!UsingMem) {
+ CMP = _arj.readByte();
+ length = _arj.readUint32LE();
+ } else {
+ memcpy(&CMP, mSession, 1);
+ mSession += 1;
+ length = READ_LE_UINT32(mSession);
+ mSession += 4;
+ }
+ if (CMP == kFrameCmpRle) {
+ BufferSSN = (byte *)malloc(length);
+ if (!UsingMem) {
+ _arj.read(BufferSSN, length);
+ } else {
+ memcpy(BufferSSN, mSession, length);
+ mSession += length;
+ }
+ decodeRLE(BufferSSN, screenSurface);
+ free(BufferSSN);
+ waitFrameSSN();
+ if (FrameSSN)
+ mixVideo(VGA, screenSurface);
+ else
+ memcpy(VGA, screenSurface, 64000);
+ _system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200);
+ _system->updateScreen();
+ FrameSSN++;
+ } else {
+ if (CMP == kFrameCmpOff) {
+ BufferSSN = (byte *)malloc(length);
+ if (!UsingMem) {
+ _arj.read(BufferSSN, length);
+ } else {
+ memcpy(BufferSSN, mSession, length);
+ mSession += length;
+ }
+ decodeOffset(BufferSSN, screenSurface, length);
+ free(BufferSSN);
+ waitFrameSSN();
+ if (FrameSSN)
+ mixVideo(VGA, screenSurface);
+ else
+ memcpy(VGA, screenSurface, 64000);
+ _system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200);
+ _system->updateScreen();
+ FrameSSN++;
+ }
+ }
+ break;
+ case kFrameEndAnim:
+ Exit = 1;
+ break;
+ default:
+ Exit = 1;
+ break;
+ }
+
+ return (!Exit);
+}
+
+byte *DrasculaEngine::TryInMem() {
+ int length;
+
+ _arj.seek(0, SEEK_END);
+ length = _arj.pos();
+ _arj.seek(0, SEEK_SET);
+ memPtr = (byte *)malloc(length);
+ if (memPtr == NULL)
+ return NULL;
+ _arj.read(memPtr, length);
+ UsingMem = 1;
+ _arj.close();
+
+ return memPtr;
+}
+
+void DrasculaEngine::decodeOffset(byte *BufferOFF, byte *MiVideoOFF, int length) {
+ int x = 0;
+ int size;
+ int offset;
+
+ memset(screenSurface, 0, 64000);
+ while (x < length) {
+ offset = BufferOFF[x] + BufferOFF[x + 1] * 256;
+ // FIXME: this writes beyond 64000, so the buffer has been initialized
+ // to 64256 bytes (like the original did)
+ size = BufferOFF[x + 2];
+ memcpy(MiVideoOFF + offset, &BufferOFF[x + 3], size);
+ x += 3 + size;
+ }
+}
+
+void DrasculaEngine::decodeRLE(byte* srcPtr, byte* dstPtr) {
+ bool stopProcessing = false;
+ byte pixel;
+ uint repeat;
+ int curByte = 0;
+
+ while (!stopProcessing) {
+ pixel = *srcPtr++;
+ repeat = 1;
+ if ((pixel & 192) == 192) {
+ repeat = (pixel & 63);
+ pixel = *srcPtr++;
+ }
+ for (uint j = 0; j < repeat; j++) {
+ curByte++;
+ if (curByte > 64000) {
+ stopProcessing = true;
+ break;
+ }
+ *dstPtr++ = pixel;
+ }
+ }
+}
+
+void DrasculaEngine::mixVideo(byte *OldScreen, byte *NewScreen) {
+ for (int x = 0; x < 64000; x++)
+ OldScreen[x] ^= NewScreen[x];
+}
+
+void DrasculaEngine::waitFrameSSN() {
+ uint32 now;
+ while ((now = _system->getMillis()) - LastFrame < ((uint32) globalSpeed))
+ _system->delayMillis(globalSpeed - (now - LastFrame));
+ LastFrame = LastFrame + globalSpeed;
+}
+
+bool DrasculaEngine::animate(const char *animationFile, int FPS) {
+ int NFrames = 1;
+ int cnt = 2;
+
+ _arj.open(animationFile);
+
+ if (!_arj.isOpen()) {
+ error("Animation file %s not found", animationFile);
+ }
+
+ NFrames = _arj.readSint32LE();
+ showFrame(true);
+ _system->delayMillis(1000 / FPS);
+ while (cnt < NFrames) {
+ showFrame();
+ _system->delayMillis(1000 / FPS);
+ cnt++;
+ byte key = getScan();
+ if (key == Common::KEYCODE_ESCAPE)
+ term_int = 1;
+ if (key != 0)
+ break;
+ }
+ _arj.close();
+
+ return ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE));
+}
+
+
+
+} // End of namespace Drascula
diff --git a/engines/drascula/interface.cpp b/engines/drascula/interface.cpp
new file mode 100644
index 0000000000..6e86788007
--- /dev/null
+++ b/engines/drascula/interface.cpp
@@ -0,0 +1,209 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "drascula/drascula.h"
+
+namespace Drascula {
+
+void DrasculaEngine::selectVerbFromBar() {
+ for (int n = 0; n < 7; n++) {
+ if (mouseX > _verbBarX[n] && mouseX < _verbBarX[n + 1] && n > 0) {
+ selectVerb(n);
+ return;
+ }
+ }
+
+ // no verb selected
+ withoutVerb();
+}
+
+void DrasculaEngine::selectVerb(int verb) {
+ int c = (menuScreen == 1) ? 0 : 171;
+
+ if (currentChapter == 5) {
+ if (takeObject == 1 && pickedObject != 16)
+ addObject(pickedObject);
+ } else {
+ if (takeObject == 1)
+ addObject(pickedObject);
+ }
+
+ copyBackground(OBJWIDTH * verb, c, 0, 0, OBJWIDTH, OBJHEIGHT, backSurface, drawSurface3);
+
+ takeObject = 1;
+ pickedObject = verb;
+}
+
+bool DrasculaEngine::confirmExit() {
+ byte key;
+
+ color_abc(kColorRed);
+ updateRoom();
+ centerText(_textsys[_lang][1], 160, 87);
+ updateScreen();
+
+ delay(100);
+ for (;;) {
+ key = getScan();
+ if (key != 0)
+ break;
+ }
+
+ if (key == Common::KEYCODE_ESCAPE) {
+ stopMusic();
+ return false;
+ }
+
+ return true;
+}
+
+void DrasculaEngine::showMenu() {
+ int h, n, x;
+ char textIcon[13];
+ byte *srcSurface = (currentChapter == 6) ? tableSurface : frontSurface;
+ x = whichObject();
+ strcpy(textIcon, iconName[x]);
+
+ for (n = 1; n < 43; n++) {
+ h = inventoryObjects[n];
+
+ if (h != 0) {
+ copyBackground(_polX[n], _polY[n], _itemLocations[n].x, _itemLocations[n].y,
+ OBJWIDTH, OBJHEIGHT, srcSurface, screenSurface);
+ }
+ copyRect(_x1d_menu[h], _y1d_menu[h], _itemLocations[n].x, _itemLocations[n].y,
+ OBJWIDTH, OBJHEIGHT, backSurface, screenSurface);
+ }
+
+ if (x < 7)
+ print_abc(textIcon, _itemLocations[x].x - 2, _itemLocations[x].y - 7);
+}
+
+void DrasculaEngine::clearMenu() {
+ int n, verbActivated = 1;
+
+ for (n = 0; n < 7; n++) {
+ if (mouseX > _verbBarX[n] && mouseX < _verbBarX[n + 1])
+ verbActivated = 0;
+ copyRect(OBJWIDTH * n, OBJHEIGHT * verbActivated, _verbBarX[n], 2,
+ OBJWIDTH, OBJHEIGHT, backSurface, screenSurface);
+ verbActivated = 1;
+ }
+}
+
+void DrasculaEngine::enterName() {
+ Common::KeyCode key;
+ int v = 0, h = 0;
+ char select2[23];
+ strcpy(select2, " ");
+ for (;;) {
+ select2[v] = '-';
+ copyBackground(115, 14, 115, 14, 176, 9, bgSurface, screenSurface);
+ print_abc(select2, 117, 15);
+ updateScreen();
+ key = getScan();
+ delay(70);
+ if (key != 0) {
+ if (key >= 0 && key <= 0xFF && isalpha(key))
+ select2[v] = tolower(key);
+ else if ((key == Common::KEYCODE_LCTRL) || (key == Common::KEYCODE_RCTRL))
+ select2[v] = '\164';
+ else if (key >= Common::KEYCODE_0 && key <= Common::KEYCODE_9)
+ select2[v] = key;
+ else if (key == Common::KEYCODE_SPACE)
+ select2[v] = '\167';
+ else if (key == Common::KEYCODE_ESCAPE)
+ break;
+ else if (key == Common::KEYCODE_RETURN) {
+ select2[v] = '\0';
+ h = 1;
+ break;
+ } else if (key == Common::KEYCODE_BACKSPACE)
+ select2[v] = '\0';
+ else
+ v--;
+
+ if (key == Common::KEYCODE_BACKSPACE)
+ v--;
+ else
+ v++;
+ }
+ if (v == 22)
+ v = 21;
+ else if (v == -1)
+ v = 0;
+ }
+ if (h == 1) {
+ strcpy(select, select2);
+ selectionMade = 1;
+ }
+}
+
+bool DrasculaEngine::checkMenuFlags() {
+ for (int n = 0; n < 43; n++) {
+ if (whichObject() == n) {
+ if (inventoryObjects[n] != 0 && checkAction(inventoryObjects[n]))
+ return true;
+ }
+ }
+
+ return false;
+}
+
+void DrasculaEngine::showMap() {
+ hasName = 0;
+
+ for (int l = 0; l < numRoomObjs; l++) {
+ if (mouseX > x1[l] && mouseY > y1[l]
+ && mouseX < x2[l] && mouseY < y2[l]
+ && visible[l] == 1) {
+ strcpy(textName, objName[l]);
+ hasName = 1;
+ }
+ }
+}
+
+void DrasculaEngine::grr() {
+ int length = 30;
+
+ color_abc(kColorDarkGreen);
+
+ playFile("s10.als");
+
+ updateRoom();
+ copyBackground(253, 110, 150, 65, 20, 30, drawSurface3, screenSurface);
+
+ if (withVoices == 0)
+ centerText("groaaarrrrgghhhh!", 153, 65);
+
+ updateScreen();
+
+ while (!isTalkFinished(&length));
+
+ updateRoom();
+ updateScreen();
+}
+
+} // End of namespace Drascula
diff --git a/engines/drascula/module.mk b/engines/drascula/module.mk
index 042b227ca3..dfe53ca824 100644
--- a/engines/drascula/module.mk
+++ b/engines/drascula/module.mk
@@ -1,12 +1,19 @@
MODULE := engines/drascula
MODULE_OBJS = \
+ actors.o \
animation.o \
+ converse.o \
detection.o \
drascula.o \
+ graphics.o \
+ interface.o \
+ objects.o \
+ palette.o \
rooms.o \
- talk.o \
- texts.o
+ saveload.o \
+ sound.o \
+ talk.o
# This module can be built as a plugin
diff --git a/engines/drascula/objects.cpp b/engines/drascula/objects.cpp
new file mode 100644
index 0000000000..01967d975d
--- /dev/null
+++ b/engines/drascula/objects.cpp
@@ -0,0 +1,300 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "drascula/drascula.h"
+
+namespace Drascula {
+
+void DrasculaEngine::pickObject(int object) {
+ if (currentChapter == 6)
+ loadPic("iconsp.alg", backSurface);
+ else if (currentChapter == 4)
+ loadPic("icons2.alg", backSurface);
+ else if (currentChapter == 5)
+ loadPic("icons3.alg", backSurface);
+ else
+ loadPic("icons.alg", backSurface);
+ chooseObject(object);
+ if (currentChapter == 2)
+ loadPic(menuBackground, backSurface);
+ else
+ loadPic(99, backSurface);
+}
+
+void DrasculaEngine::chooseObject(int object) {
+ if (currentChapter == 5) {
+ if (takeObject == 1 && menuScreen == 0 && pickedObject != 16)
+ addObject(pickedObject);
+ } else {
+ if (takeObject == 1 && menuScreen == 0)
+ addObject(pickedObject);
+ }
+ copyBackground(_x1d_menu[object], _y1d_menu[object], 0, 0, OBJWIDTH,OBJHEIGHT, backSurface, drawSurface3);
+ takeObject = 1;
+ pickedObject = object;
+}
+
+int DrasculaEngine::removeObject(int obj) {
+ int result = 1;
+
+ for (int h = 1; h < 43; h++) {
+ if (inventoryObjects[h] == obj) {
+ inventoryObjects[h] = 0;
+ result = 0;
+ break;
+ }
+ }
+
+ return result;
+}
+
+void DrasculaEngine::withoutVerb() {
+ int c = (menuScreen == 1) ? 0 : 171;
+
+ if (currentChapter == 5) {
+ if (takeObject == 1 && pickedObject != 16)
+ addObject(pickedObject);
+ } else {
+ if (takeObject == 1)
+ addObject(pickedObject);
+ }
+ copyBackground(0, c, 0, 0, OBJWIDTH,OBJHEIGHT, backSurface, drawSurface3);
+
+ takeObject = 0;
+ hasName = 0;
+}
+
+void DrasculaEngine::gotoObject(int pointX, int pointY) {
+ if (currentChapter == 5 || currentChapter == 6) {
+ if (hare_se_ve == 0) {
+ curX = roomX;
+ curY = roomY;
+ updateRoom();
+ updateScreen();
+ return;
+ }
+ }
+ roomX = pointX;
+ roomY = pointY;
+ startWalking();
+
+ for (;;) {
+ updateRoom();
+ updateScreen();
+ if (characterMoved == 0)
+ break;
+ }
+
+ if (walkToObject == 1) {
+ walkToObject = 0;
+ trackProtagonist = trackFinal;
+ }
+ updateRoom();
+ updateScreen();
+}
+
+void DrasculaEngine::checkObjects() {
+ int l, veo = 0;
+
+ for (l = 0; l < numRoomObjs; l++) {
+ if (mouseX > x1[l] && mouseY > y1[l]
+ && mouseX < x2[l] && mouseY < y2[l]
+ && visible[l] == 1 && isDoor[l] == 0) {
+ strcpy(textName, objName[l]);
+ hasName = 1;
+ veo = 1;
+ }
+ }
+
+ if (mouseX > curX + 2 && mouseY > curY + 2
+ && mouseX < curX + curWidth - 2 && mouseY < curY + curHeight - 2) {
+ if (currentChapter == 2 || veo == 0) {
+ strcpy(textName, "hacker");
+ hasName = 1;
+ veo = 1;
+ }
+ }
+
+ if (veo == 0)
+ hasName = 0;
+}
+
+void DrasculaEngine::removeObject() {
+ int h = 0, n;
+
+ updateRoom();
+
+ for (n = 1; n < 43; n++){
+ if (whichObject() == n) {
+ h = inventoryObjects[n];
+ inventoryObjects[n] = 0;
+ if (h != 0)
+ takeObject = 1;
+ }
+ }
+
+ updateEvents();
+
+ if (takeObject == 1)
+ chooseObject(h);
+}
+
+bool DrasculaEngine::pickupObject() {
+ int h = pickedObject;
+ checkFlags = 1;
+
+ updateRoom();
+ showMenu();
+ updateScreen();
+
+ // Objects with an ID smaller than 7 are the inventory verbs
+ if (pickedObject >= 7) {
+ for (int n = 1; n < 43; n++) {
+ if (whichObject() == n && inventoryObjects[n] == 0) {
+ inventoryObjects[n] = h;
+ takeObject = 0;
+ checkFlags = 0;
+ }
+ }
+ }
+
+ if (checkFlags == 1) {
+ if (checkMenuFlags())
+ return true;
+ }
+ updateEvents();
+ if (takeObject == 0)
+ withoutVerb();
+
+ return false;
+}
+
+void DrasculaEngine::addObject(int obj) {
+ int h, position = 0;
+
+ for (h = 1; h < 43; h++) {
+ if (inventoryObjects[h] == obj)
+ position = 1;
+ }
+
+ if (position == 0) {
+ for (h = 1; h < 43; h++) {
+ if (inventoryObjects[h] == 0) {
+ inventoryObjects[h] = obj;
+ position = 1;
+ break;
+ }
+ }
+ }
+}
+
+int DrasculaEngine::whichObject() {
+ int n = 0;
+
+ for (n = 1; n < 43; n++) {
+ if (mouseX > _itemLocations[n].x && mouseY > _itemLocations[n].y &&
+ mouseX < _itemLocations[n].x + OBJWIDTH &&
+ mouseY < _itemLocations[n].y + OBJHEIGHT)
+ break;
+ }
+
+ return n;
+}
+
+void DrasculaEngine::updateVisible() {
+ if (currentChapter == 1) {
+ // nothing
+ } else if (currentChapter == 2) {
+ if (roomNumber == 2 && flags[40] == 0)
+ visible[3] = 0;
+ else if (roomNumber == 3 && flags[3] == 1)
+ visible[8] = 0;
+ else if (roomNumber == 6 && flags[1] == 1 && flags[10] == 0) {
+ visible[2] = 0;
+ visible[4] = 1;
+ } else if (roomNumber == 7 && flags[35] == 1)
+ visible[3] = 0;
+ else if (roomNumber == 14 && flags[5] == 1)
+ visible[4] = 0;
+ else if (roomNumber == 18 && flags[28] == 1)
+ visible[2] = 0;
+ } else if (currentChapter == 3) {
+ // nothing
+ } else if (currentChapter == 4) {
+ if (roomNumber == 23 && flags[0] == 0 && flags[11] == 0)
+ visible[2] = 1;
+ if (roomNumber == 23 && flags[0] == 1 && flags[11] == 0)
+ visible[2] = 0;
+ if (roomNumber == 21 && flags[10] == 1)
+ visible[2] = 0;
+ if (roomNumber == 22 && flags[26] == 1) {
+ visible[2] = 0;
+ visible[1] = 1;
+ }
+ if (roomNumber == 22 && flags[27] == 1)
+ visible[3] = 0;
+ if (roomNumber == 26 && flags[21] == 0)
+ strcpy(objName[2], _textmisc[_lang][0]);
+ if (roomNumber == 26 && flags[18] == 1)
+ visible[2] = 0;
+ if (roomNumber == 26 && flags[12] == 1)
+ visible[1] = 0;
+ if (roomNumber == 35 && flags[14] == 1)
+ visible[2] = 0;
+ if (roomNumber == 35 && flags[17] == 1)
+ visible[3] = 1;
+ if (roomNumber == 35 && flags[15] == 1)
+ visible[1] = 0;
+ } else if (currentChapter == 5) {
+ if (roomNumber == 49 && flags[6] == 1)
+ visible[2] = 0;
+ if (roomNumber == 49 && flags[6] == 0)
+ visible[1] = 0;
+ if (roomNumber == 49 && flags[6] == 1)
+ visible[1] = 1;
+ if (roomNumber == 45 && flags[6] == 1)
+ visible[3] = 1;
+ if (roomNumber == 53 && flags[2] == 1)
+ visible[3] = 0;
+ if (roomNumber == 54 && flags[13] == 1)
+ visible[3] = 0;
+ if (roomNumber == 55 && flags[8] == 1)
+ visible[1] = 0;
+ } else if (currentChapter == 6) {
+ if (roomNumber == 58 && flags[8] == 0)
+ isDoor[1] = 0;
+ if (roomNumber == 58 && flags[8] == 1)
+ isDoor[1] = 1;
+ if (roomNumber == 59)
+ isDoor[1] = 0;
+ if (roomNumber == 60) {
+ trackDrascula = 0;
+ drasculaX = 155;
+ drasculaY = 69;
+ }
+ }
+}
+
+} // End of namespace Drascula
diff --git a/engines/drascula/palette.cpp b/engines/drascula/palette.cpp
new file mode 100644
index 0000000000..ad57bce618
--- /dev/null
+++ b/engines/drascula/palette.cpp
@@ -0,0 +1,202 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "drascula/drascula.h"
+
+namespace Drascula {
+
+void DrasculaEngine::setRGB(byte *pal, int colorCount) {
+ int x, cnt = 0;
+
+ for (x = 0; x < colorCount; x++) {
+ gamePalette[x][0] = pal[cnt++] / 4;
+ gamePalette[x][1] = pal[cnt++] / 4;
+ gamePalette[x][2] = pal[cnt++] / 4;
+ }
+ setPalette((byte *)&gamePalette);
+}
+
+void DrasculaEngine::black() {
+ int color, component;
+ DacPalette256 blackPalette;
+
+ for (color = 0; color < 256; color++)
+ for (component = 0; component < 3; component++)
+ blackPalette[color][component] = 0;
+
+ blackPalette[254][0] = 0x3F;
+ blackPalette[254][1] = 0x3F;
+ blackPalette[254][2] = 0x15;
+
+ setPalette((byte *)&blackPalette);
+}
+
+void DrasculaEngine::setPalette(byte *PalBuf) {
+ byte pal[256 * 4];
+ int i;
+
+ for (i = 0; i < 256; i++) {
+ pal[i * 4 + 0] = PalBuf[i * 3 + 0] * 4;
+ pal[i * 4 + 1] = PalBuf[i * 3 + 1] * 4;
+ pal[i * 4 + 2] = PalBuf[i * 3 + 2] * 4;
+ pal[i * 4 + 3] = 0;
+ }
+ _system->setPalette(pal, 0, 256);
+ _system->updateScreen();
+}
+
+void DrasculaEngine::color_abc(int cl) {
+ _color = cl;
+
+ char colorTable[][3] = {
+ { 0, 0, 0 }, { 0x10, 0x3E, 0x28 },
+ { 0, 0, 0 }, // unused
+ { 0x16, 0x3F, 0x16 }, { 0x09, 0x3F, 0x12 },
+ { 0x3F, 0x3F, 0x15 },
+ { 0, 0, 0 }, // unused
+ { 0x38, 0, 0 }, { 0x3F, 0x27, 0x0B },
+ { 0x2A, 0, 0x2A }, { 0x30, 0x30, 0x30 },
+ { 98, 91, 100 }
+ };
+
+ for (int i = 0; i <= 2; i++)
+ gamePalette[254][i] = colorTable[cl][i];
+
+ setPalette((byte *)&gamePalette);
+}
+
+char DrasculaEngine::adjustToVGA(char value) {
+ return (value & 0x3F) * (value > 0);
+}
+
+void DrasculaEngine::fadeToBlack(int fadeSpeed) {
+ char fade;
+ unsigned int color, component;
+
+ DacPalette256 palFade;
+
+ for (fade = 63; fade >= 0; fade--) {
+ for (color = 0; color < 256; color++) {
+ for (component = 0; component < 3; component++) {
+ palFade[color][component] = adjustToVGA(gamePalette[color][component] - 63 + fade);
+ }
+ }
+ pause(fadeSpeed);
+
+ setPalette((byte *)&palFade);
+ }
+}
+
+void DrasculaEngine::fadeFromBlack(int fadeSpeed) {
+ char fade;
+ unsigned int color, component;
+
+ DacPalette256 palFade;
+
+ for (fade = 0; fade < 64; fade++) {
+ for (color = 0; color < 256; color++) {
+ for (component = 0; component < 3; component++) {
+ palFade[color][component] = adjustToVGA(gamePalette[color][component] - 63 + fade);
+ }
+ }
+ pause(fadeSpeed);
+
+ setPalette((byte *)&palFade);
+ }
+}
+
+void DrasculaEngine::assignDefaultPalette() {
+ int color, component;
+
+ for (color = 235; color < 253; color++)
+ for (component = 0; component < 3; component++)
+ defaultPalette[color][component] = gamePalette[color][component];
+}
+
+void DrasculaEngine::assignBrightPalette() {
+ int color, component;
+
+ for (color = 235; color < 253; color++) {
+ for (component = 0; component < 3; component++)
+ brightPalette[color][component] = gamePalette[color][component];
+ }
+}
+
+void DrasculaEngine::assignDarkPalette() {
+ int color, component;
+
+ for (color = 235; color < 253; color++) {
+ for (component = 0; component < 3; component++)
+ darkPalette[color][component] = gamePalette[color][component];
+ }
+}
+
+void DrasculaEngine::setDefaultPalette() {
+ int color, component;
+
+ for (color = 235; color < 253; color++) {
+ for (component = 0; component < 3; component++) {
+ gamePalette[color][component] = defaultPalette[color][component];
+ }
+ }
+ setPalette((byte *)&gamePalette);
+}
+
+void DrasculaEngine::setBrightPalette() {
+ int color, component;
+
+ for (color = 235; color < 253; color++) {
+ for (component = 0; component < 3; component++)
+ gamePalette[color][component] = brightPalette[color][component];
+ }
+
+ setPalette((byte *)&gamePalette);
+}
+
+void DrasculaEngine::setDarkPalette() {
+ int color, component;
+
+ for (color = 235; color < 253; color++ )
+ for (component = 0; component < 3; component++)
+ gamePalette[color][component] = darkPalette[color][component];
+
+ setPalette((byte *)&gamePalette);
+}
+
+void DrasculaEngine::setPaletteBase(int darkness) {
+ char fade;
+ unsigned int color, component;
+
+ for (fade = darkness; fade >= 0; fade--) {
+ for (color = 235; color < 253; color++) {
+ for (component = 0; component < 3; component++)
+ gamePalette[color][component] = adjustToVGA(gamePalette[color][component] - 8 + fade);
+ }
+ }
+
+ setPalette((byte *)&gamePalette);
+}
+
+} // End of namespace Drascula
diff --git a/engines/drascula/rooms.cpp b/engines/drascula/rooms.cpp
index ba2f0d56b8..6fe28bdbdc 100644
--- a/engines/drascula/rooms.cpp
+++ b/engines/drascula/rooms.cpp
@@ -23,761 +23,584 @@
*
*/
+#include "common/array.h"
+
#include "drascula/drascula.h"
namespace Drascula {
-static const int mirar_t[3] = {100, 101, 54};
-static const char mirar_v[3][14] = {"100.als", "101.als", "54.als"};
-static const int poder_t[6] = {11, 109, 111, 110, 115, 116};
-static const char poder_v[6][14] = {"11.als", "109.als", "111.als", "110.als", "115.als", "116.als"};
-
-void DrasculaEngine::room_0() {
- if (num_ejec == 1) {
- if (objeto_que_lleva == LOOK)
- talk(_text[_lang][54], "54.als");
- else if (objeto_que_lleva == MOVE)
- talk(_text[_lang][19], "19.als");
- else if (objeto_que_lleva == PICK)
- talk(_text[_lang][11], "11.als");
- else if (objeto_que_lleva == OPEN)
- talk(_text[_lang][9], "9.als");
- else if (objeto_que_lleva == CLOSE)
- talk(_text[_lang][9], "9.als");
- else if (objeto_que_lleva == TALK)
- talk(_text[_lang][16], "16.als");
- else
- talk(_text[_lang][11],"11.als");
- } else if (num_ejec == 2) {
- if (objeto_que_lleva == LOOK) {
- talk(_text[_lang][mirar_t[c_mirar]], mirar_v[c_mirar]);
- c_mirar++;
- if (c_mirar == 3)
- c_mirar = 0;
- } else if (objeto_que_lleva == MOVE) {
- talk(_text[_lang][19], "19.als");
- } else if (objeto_que_lleva == PICK) {
- talk(_text[_lang][poder_t[c_poder]], poder_v[c_poder]);
- c_poder++;
- if (c_poder == 6)
- c_poder = 0;
- } else if (objeto_que_lleva == OPEN)
- talk(_text[_lang][9], "9.als");
- else if (objeto_que_lleva == CLOSE)
- talk(_text[_lang][9], "9.als");
- else if (objeto_que_lleva == TALK)
- talk(_text[_lang][16], "16.als");
- else {
- talk(_text[_lang][poder_t[c_poder]], poder_v[c_poder]);
- c_poder++;
- if (c_poder == 6)
- c_poder = 0;
- }
- } else if (num_ejec == 3) {
- if (objeto_que_lleva == LOOK)
- talk(_text[_lang][316], "316.als");
- else if (objeto_que_lleva == MOVE)
- talk(_text[_lang][317], "317.als");
- else if (objeto_que_lleva == PICK)
- talk(_text[_lang][318], "318.als");
- else if (objeto_que_lleva == OPEN)
- talk(_text[_lang][319], "319.als");
- else if (objeto_que_lleva == CLOSE)
- talk(_text[_lang][319], "319.als");
- else if (objeto_que_lleva == TALK)
- talk(_text[_lang][320], "320.als");
- else
- talk(_text[_lang][318], "318.als");
- } else if (num_ejec == 4) {
- if (objeto_que_lleva == LOOK) {
- talk(_text[_lang][mirar_t[c_mirar]], mirar_v[c_mirar]);
- c_mirar++;
- if (c_mirar == 3)
- c_mirar = 0;
- } else if (objeto_que_lleva == MOVE)
- talk(_text[_lang][19], "19.als");
- else if (objeto_que_lleva == PICK) {
- talk(_text[_lang][poder_t[c_poder]], poder_v[c_poder]);
- c_poder++;
- if (c_poder == 6)
- c_poder = 0;
- } else if (objeto_que_lleva == OPEN)
- talk(_text[_lang][9], "9.als");
- else if (objeto_que_lleva == CLOSE)
- talk(_text[_lang][9], "9.als");
- else if (objeto_que_lleva == TALK)
- talk(_text[_lang][16], "16.als");
- else {
- talk(_text[_lang][poder_t[c_poder]], poder_v[c_poder]);
- c_poder++;
- if (c_poder == 6)
- c_poder = 0;
- }
- } else if (num_ejec == 5) {
- if (objeto_que_lleva == LOOK) {
- talk(_text[_lang][mirar_t[c_mirar]], mirar_v[c_mirar]);
- c_mirar++;
- if (c_mirar == 3)
- c_mirar = 0;
- } else if (objeto_que_lleva == MOVE)
- talk(_text[_lang][19], "19.als");
- else if (objeto_que_lleva == PICK) {
- talk(_text[_lang][poder_t[c_poder]], poder_v[c_poder]);
- c_poder++;
- if (c_poder == 6)
- c_poder = 0;
- } else if (objeto_que_lleva == OPEN)
- talk(_text[_lang][9], "9.als");
- else if (objeto_que_lleva == CLOSE)
- talk(_text[_lang][9], "9.als");
- else if (objeto_que_lleva == TALK)
- talk(_text[_lang][16], "16.als");
- else {
- talk(_text[_lang][poder_t[c_poder]], poder_v[c_poder]);
- c_poder++;
- if (c_poder == 6)
- c_poder = 0;
- }
- } else if (num_ejec == 6) {
- if (objeto_que_lleva == LOOK) {
- talk(_text[_lang][mirar_t[c_mirar]], mirar_v[c_mirar]);
- c_mirar++;
- if (c_mirar == 3)
- c_mirar = 0;
- } else if (objeto_que_lleva == MOVE)
- talk(_text[_lang][19], "19.als");
- else if (objeto_que_lleva == PICK) {
- talk(_text[_lang][poder_t[c_poder]], poder_v[c_poder]);
- c_poder++;
- if (c_poder == 6)
- c_poder = 0;
- } else if (objeto_que_lleva == OPEN)
- talk(_text[_lang][9], "9.als");
- else if (objeto_que_lleva == CLOSE)
- talk(_text[_lang][9], "9.als");
- else if (objeto_que_lleva == TALK)
- talk(_text[_lang][16], "16.als");
- else {
- talk(_text[_lang][poder_t[c_poder]], poder_v[c_poder]);
- c_poder++;
- if (c_poder == 6)
- c_poder = 0;
+typedef bool (DrasculaEngine::*RoomParser)(int args);
+
+struct DrasculaRoomParser {
+ DrasculaRoomParser(const char* d, RoomParser p) : desc(d), proc(p) {}
+ const char* desc;
+ RoomParser proc;
+};
+
+typedef void (DrasculaEngine::*Updater)();
+
+struct DrasculaUpdater {
+ DrasculaUpdater(const char* d, Updater p) : desc(d), proc(p) {}
+ const char* desc;
+ Updater proc;
+};
+
+Common::Array<DrasculaRoomParser*> _roomParsers;
+Common::Array<DrasculaUpdater*> _roomPreupdaters;
+Common::Array<DrasculaUpdater*> _roomUpdaters;
+
+#define ROOM(x) _roomParsers.push_back(new DrasculaRoomParser(#x, &DrasculaEngine::x))
+#define PREUPDATEROOM(x) _roomPreupdaters.push_back(new DrasculaUpdater(#x, &DrasculaEngine::x))
+#define UPDATEROOM(x) _roomUpdaters.push_back(new DrasculaUpdater(#x, &DrasculaEngine::x))
+
+void DrasculaEngine::setupRoomsTable() {
+ ROOM(room_0); // default
+ ROOM(room_1);
+ ROOM(room_3);
+ ROOM(room_4);
+ ROOM(room_5);
+ ROOM(room_6);
+ ROOM(room_7);
+ ROOM(room_8);
+ ROOM(room_9);
+ ROOM(room_12);
+ ROOM(room_13); // returns bool
+ ROOM(room_14);
+ ROOM(room_15);
+ ROOM(room_16);
+ ROOM(room_17);
+ ROOM(room_18);
+ ROOM(room_21); // returns bool
+ ROOM(room_22);
+ ROOM(room_23);
+ ROOM(room_24);
+ ROOM(room_26);
+ ROOM(room_27);
+ ROOM(room_29);
+ ROOM(room_30);
+ ROOM(room_31);
+ ROOM(room_34);
+ ROOM(room_35);
+ ROOM(room_49);
+ ROOM(room_53);
+ ROOM(room_54);
+ ROOM(room_55);
+ ROOM(room_56); // returns bool
+ ROOM(room_58);
+ ROOM(room_59);
+ ROOM(room_60); // returns bool
+ ROOM(room_62);
+ ROOM(room_102);
+
+ PREUPDATEROOM(update_1_pre);
+ PREUPDATEROOM(update_6_pre);
+ PREUPDATEROOM(update_9_pre);
+ PREUPDATEROOM(update_14_pre);
+ PREUPDATEROOM(update_16_pre);
+ PREUPDATEROOM(update_18_pre);
+ PREUPDATEROOM(update_23_pre);
+ PREUPDATEROOM(update_26_pre);
+ PREUPDATEROOM(update_35_pre);
+ PREUPDATEROOM(update_58_pre);
+ PREUPDATEROOM(update_59_pre);
+ PREUPDATEROOM(update_60_pre);
+ PREUPDATEROOM(update_62_pre);
+
+ UPDATEROOM(update_2);
+ UPDATEROOM(update_3);
+ UPDATEROOM(update_4);
+ UPDATEROOM(update_13);
+ UPDATEROOM(update_26);
+ UPDATEROOM(update_58);
+ UPDATEROOM(update_60);
+ UPDATEROOM(update_62);
+ UPDATEROOM(update_102);
+}
+
+bool DrasculaEngine::roomParse(int rN, int fl) {
+ bool seen = false;
+
+ for (int i = 0; i < _roomActionsSize; i++) {
+ if (_roomActions[i].room == rN) {
+ seen = true;
+ if (_roomActions[i].chapter == currentChapter ||
+ _roomActions[i].chapter == -1) {
+ if (_roomActions[i].action == pickedObject ||
+ _roomActions[i].action == kVerbDefault) {
+ if (_roomActions[i].objectID == fl ||
+ _roomActions[i].objectID == -1) {
+ talk(_roomActions[i].speechID);
+ hasAnswer = 1;
+ return true;
+ }
+ }
+ }
+ } else if (seen) // Stop searching down the list
+ break;
+ }
+
+ return false;
+}
+
+bool DrasculaEngine::room_0(int fl) {
+ static const int lookExcuses[3] = {100, 101, 54};
+ static const int actionExcuses[6] = {11, 109, 111, 110, 115, 116};
+
+ fl = -1; // avoid warning
+
+ // non-default actions
+ if (currentChapter == 2 || currentChapter == 4 ||
+ currentChapter == 5 || currentChapter == 6) {
+ if (pickedObject == kVerbLook) {
+ talk(lookExcuses[curExcuseLook]);
+ curExcuseLook++;
+ if (curExcuseLook == 3)
+ curExcuseLook = 0;
+ } else {
+ talk(actionExcuses[curExcuseAction]);
+ curExcuseAction++;
+ if (curExcuseAction == 6)
+ curExcuseAction = 0;
}
}
+
+ return true;
}
-void DrasculaEngine::room_1(int fl) {
- if (objeto_que_lleva == LOOK && fl == 118) {
- talk(_text[_lang][1], "1.als");
+bool DrasculaEngine::room_1(int fl) {
+ if (pickedObject == kVerbLook && fl == 118) {
+ talk(1);
pause(10);
- talk(_text[_lang][2], "2.als");
- } else if (objeto_que_lleva == PICK && fl == 118)
- talk(_text[_lang][5], "5.als");
- else if (objeto_que_lleva == OPEN && fl == 118)
- talk(_text[_lang][3], "3.als");
- else if (objeto_que_lleva == CLOSE && fl == 118)
- talk(_text[_lang][4], "4.als");
- else if (objeto_que_lleva == TALK && fl == 118)
- talk(_text[_lang][6], "6.als");
- else if (objeto_que_lleva == LOOK && fl == 119)
- talk(_text[_lang][8], "8.als");
- else if (objeto_que_lleva == MOVE && fl == 119)
- talk(_text[_lang][13], "13.als");
- else if (objeto_que_lleva == CLOSE && fl == 119)
- talk(_text[_lang][10], "10.als");
- else if (objeto_que_lleva == TALK && fl == 119)
- talk(_text[_lang][12], "12.als");
- else if (objeto_que_lleva == LOOK && fl == 120 && flags[8] == 0)
- talk(_text[_lang][14], "14.als");
- else if (objeto_que_lleva == MOVE && fl == 120)
- talk(_text[_lang][13], "13.als");
- else if (objeto_que_lleva == OPEN && fl == 120)
- talk(_text[_lang][18], "18.als");
- else if (objeto_que_lleva == TALK && fl == 120)
- talk(_text[_lang][15], "15.als");
+ talk(2);
+ } else if (pickedObject == kVerbLook && fl == 120 && flags[8] == 0)
+ talk(14);
else
- hay_respuesta = 0;
-}
-
-void DrasculaEngine::room_3(int fl) {
- if (objeto_que_lleva == LOOK && fl == 129)
- talk(_text[_lang][21], "21.als");
- else if (objeto_que_lleva == PICK && fl == 129)
- talk(_text[_lang][5], "5.als");
- else if (objeto_que_lleva == MOVE && fl == 129)
- talk(_text[_lang][24], "24.als");
- else if (objeto_que_lleva == OPEN && fl == 129)
- talk(_text[_lang][22], "22.als");
- else if (objeto_que_lleva == CLOSE && fl == 129)
- talk(_text[_lang][10], "10.als");
- else if (objeto_que_lleva == TALK && fl == 129) {
- talk(_text[_lang][23], "23.als");
+ hasAnswer = 0;
+
+ return true;
+}
+
+bool DrasculaEngine::room_3(int fl) {
+ if (pickedObject == kVerbTalk && fl == 129) {
+ talk(23);
pause(6);
- talk_sinc(_text[_lang][50], "50.als", "11111111111144432554433");
- } else if (objeto_que_lleva == LOOK && fl == 131)
- talk(_text[_lang][27], "27.als");
- else if (objeto_que_lleva == PICK && fl == 131)
- talk(_text[_lang][5], "5.als");
- else if (objeto_que_lleva == MOVE && fl == 131)
- talk(_text[_lang][24], "24.als");
- else if (objeto_que_lleva == OPEN && fl == 131)
- talk(_text[_lang][22], "22.als");
- else if (objeto_que_lleva == CLOSE && fl == 131)
- talk(_text[_lang][10], "10.als");
- else if (objeto_que_lleva == TALK && fl == 131)
- talk(_text[_lang][23], "23.als");
- else if (objeto_que_lleva == LOOK && fl == 132)
- talk(_text[_lang][28], "28.als");
- else if (objeto_que_lleva == PICK && fl == 132)
- talk(_text[_lang][5], "5.als");
- else if (objeto_que_lleva == MOVE && fl == 132)
- talk(_text[_lang][24], "24.als");
- else if (objeto_que_lleva == OPEN && fl == 132)
- talk(_text[_lang][22], "22.als");
- else if (objeto_que_lleva == CLOSE && fl == 132)
- talk(_text[_lang][10], "10.als");
- else if (objeto_que_lleva == TALK && fl == 132)
- talk(_text[_lang][23], "23.als");
- else if (objeto_que_lleva == LOOK && fl == 133)
- talk(_text[_lang][321], "321.als");
- else if (objeto_que_lleva == PICK && fl == 133)
- talk(_text[_lang][31], "31.als");
- else if (objeto_que_lleva == MOVE && fl == 133)
- talk(_text[_lang][34], "34.als");
- else if (objeto_que_lleva == OPEN && fl == 133)
- talk(_text[_lang][30], "30.als");
- else if (objeto_que_lleva == CLOSE && fl == 133)
- talk(_text[_lang][10], "10.als");
- else if (objeto_que_lleva == TALK && fl == 133) {
- talk_sinc(_text[_lang][322], "322.als", "13333334125433333333");
+ talk_sync(_text[_lang][50], "50.als", "11111111111144432554433");
+ } else if (pickedObject == kVerbTalk && fl == 133) {
+ talk_sync(_text[_lang][322], "322.als", "13333334125433333333");
updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateScreen();
pause(25);
- talk(_text[_lang][33], "33.als");
- } else if (objeto_que_lleva == LOOK && fl == 165) {
- talk(_text[_lang][149], "149.als");
- talk(_text[_lang][150], "150.als");
- } else if (objeto_que_lleva == PICK && fl == 165) {
- copyBackground(0, 0, 0,0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ talk(33);
+ } else if (pickedObject == kVerbLook && fl == 165) {
+ talk(149);
+ talk(150);
+ } else if (pickedObject == kVerbPick && fl == 165) {
+ copyBackground(0, 0, 0,0, 320, 200, bgSurface, screenSurface);
updateRefresh_pre();
- copyRect(44, 1, hare_x, hare_y, 41, 70, dir_dibujo2, dir_zona_pantalla);
+ copyRect(44, 1, curX, curY, 41, 70, drawSurface2, screenSurface);
updateRefresh();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateScreen();
pause(4);
- agarra_objeto(10);
+ pickObject(10);
flags[3] = 1;
visible[8] = 0;
- } else if (objeto_que_lleva == LOOK && fl == 166)
- talk(_text[_lang][55], "55.als");
- else if (objeto_que_lleva == PICK && fl == 166)
- talk(_text[_lang][7], "7.als");
- else if (objeto_que_lleva == 14 && fl == 166 && flags[37] == 0) {
+ } else if (pickedObject == 14 && fl == 166 && flags[37] == 0) {
animation_7_2();
- agarra_objeto(8);
- } else if (objeto_que_lleva == 14 && fl == 166 && flags[37] == 1)
- talk(_text[_lang][323], "323.als");
- else if (objeto_que_lleva == LOOK && fl == 211)
- talk(_text[_lang][184], "184.als");
- else if (objeto_que_lleva == TALK && fl == 211) {
- talk(_text[_lang][185], "185.als");
- talk(_text[_lang][186], "186.als");
+ pickObject(8);
+ } else if (pickedObject == 14 && fl == 166 && flags[37] == 1)
+ talk(323);
+ else if (pickedObject == kVerbTalk && fl == 211) {
+ talk(185);
+ talk(186);
} else
- hay_respuesta = 0;
+ hasAnswer = 0;
+
+ return true;
}
-void DrasculaEngine::room_4(int fl) {
- if (objeto_que_lleva == MOVE && fl == 189 && flags[34] == 0) {
- talk(_text[_lang][327], "327.als");
- agarra_objeto(13);
+bool DrasculaEngine::room_4(int fl) {
+ if (pickedObject == kVerbMove && fl == 189 && flags[34] == 0) {
+ talk(327);
+ pickObject(13);
flags[34] = 1;
if (flags[7] == 1 && flags[26] == 1 && flags[34] == 1 && flags[35] == 1 && flags[37] == 1)
flags[38] = 1;
- } else if (objeto_que_lleva == LOOK && fl == 189)
- talk(_text[_lang][182], "182.als");
- else if (objeto_que_lleva == LOOK && fl == 207)
- talk(_text[_lang][175], "175.als");
- else if (objeto_que_lleva == TALK && fl == 207)
- talk(_text[_lang][176], "176.als");
- else if (objeto_que_lleva == LOOK && fl == 208)
- talk(_text[_lang][177], "177.als");
- else if (objeto_que_lleva == LOOK && fl == 209)
- talk(_text[_lang][179], "179.als");
- else if (objeto_que_lleva == LOOK && fl == 210)
- talk(_text[_lang][180], "180.als");
- else if (objeto_que_lleva == OPEN && fl == 210)
- talk(_text[_lang][181], "181.als");
- else
- hay_respuesta = 0;
-}
-
-void DrasculaEngine::room_5(int fl) {
- if (objeto_que_lleva == LOOK && fl == 136 && flags[8]==0) talk(_text[_lang][14], "14.als");
- else if (objeto_que_lleva == MOVE && fl == 136)
- talk(_text[_lang][13], "13.als");
- else if (objeto_que_lleva == OPEN && fl == 136)
- talk(_text[_lang][18], "18.als");
- else if (objeto_que_lleva == TALK && fl == 136)
- talk(_text[_lang][15], "15.als");
- else if (objeto_que_lleva == 10 && fl == 136) {
+ } else
+ hasAnswer = 0;
+
+ return true;
+}
+
+bool DrasculaEngine::room_5(int fl) {
+ if (pickedObject == kVerbLook && fl == 136 && flags[8] == 0)
+ talk(14);
+ else if (pickedObject == 10 && fl == 136) {
animation_5_2();
- resta_objeto(10);
- } else if (objeto_que_lleva == LOOK && fl == 212)
- talk(_text[_lang][187], "187.als");
- else if (objeto_que_lleva == TALK && fl == 212)
- talk(_text[_lang][188], "188.als");
- else if (objeto_que_lleva == LOOK && fl == 213)
- talk(_text[_lang][189], "189.als");
- else if (objeto_que_lleva == OPEN && fl == 213)
- talk(_text[_lang][190], "190.als");
- else
- hay_respuesta = 0;
-}
-
-void DrasculaEngine::room_6(int fl){
- if (objeto_que_lleva == LOOK && fl==144) {
- talk(_text[_lang][41], "41.als");
- talk(_text[_lang][42], "42.als");
- } else if (objeto_que_lleva == PICK && fl == 144)
- talk(_text[_lang][43], "43.als");
- else if (objeto_que_lleva == LOOK && fl == 138)
- talk(_text[_lang][35], "35.als");
- else if (objeto_que_lleva == OPEN && fl == 138)
- abre_puerta(0, 1);
- else if (objeto_que_lleva == CLOSE && fl == 138)
- cierra_puerta(0, 1);
- else if (objeto_que_lleva == TALK && fl == 138)
- talk(_text[_lang][6], "6.als");
- else if (objeto_que_lleva == LOOK && fl == 143)
- talk(_text[_lang][37], "37.als");
- else if (objeto_que_lleva == PICK && fl == 143)
- talk(_text[_lang][7], "7.als");
- else if (objeto_que_lleva == MOVE && fl == 143)
- talk(_text[_lang][7], "7.als");
- else if (objeto_que_lleva == OPEN && fl == 143 && flags[2] == 0) {
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- updateRefresh_pre();
- copyRect(228, 102, hare_x + 5, hare_y - 1, 47, 73, dir_dibujo3, dir_zona_pantalla);
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- pause(10);
- comienza_sound("s3.als");
- flags[2] = 1;
- updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- fin_sound();
- } else if (objeto_que_lleva == CLOSE && fl == 143 && flags[2] == 1) {
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ removeObject(kItemSpike);
+ } else
+ hasAnswer = 0;
+
+ return true;
+}
+
+bool DrasculaEngine::room_6(int fl) {
+ if (pickedObject == kVerbLook && fl==144) {
+ talk(41);
+ talk(42);
+ } else if (pickedObject == kVerbOpen && fl == 138)
+ openDoor(0, 1);
+ else if (pickedObject == kVerbClose && fl == 138)
+ closeDoor(0, 1);
+ else if (pickedObject == kVerbOpen && fl == 143 && flags[2] == 0) {
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
+ updateRefresh_pre();
+ copyRect(228, 102, curX + 5, curY - 1, 47, 73, drawSurface3, screenSurface);
+ updateScreen();
+ pause(10);
+ playSound(3);
+ flags[2] = 1;
+ updateRoom();
+ updateScreen();
+ finishSound();
+ } else if (pickedObject == kVerbClose && fl == 143 && flags[2] == 1) {
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
flags[2] = 0;
updateRefresh_pre();
- copyRect(228, 102, hare_x + 5, hare_y - 1, 47, 73, dir_dibujo3, dir_zona_pantalla);
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ copyRect(228, 102, curX + 5, curY - 1, 47, 73, drawSurface3, screenSurface);
+ updateScreen();
pause(5);
- comienza_sound("s4.als");
+ playSound(4);
updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- fin_sound();
- } else if (objeto_que_lleva == TALK && fl == 143)
- talk(_text[_lang][38], "38.als");
- else if (objeto_que_lleva == LOOK && fl == 139)
- talk(_text[_lang][36], "36.als");
- else if (objeto_que_lleva == OPEN && fl == 139 && flags[1] == 0) {
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ updateScreen();
+ finishSound();
+ } else if (pickedObject == kVerbOpen && fl == 139 && flags[1] == 0) {
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
updateRefresh_pre();
- copyRect(267, 1, hare_x - 14, hare_y - 2, 52, 73, dir_dibujo3, dir_zona_pantalla);
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ copyRect(267, 1, curX - 14, curY - 2, 52, 73, drawSurface3, screenSurface);
+ updateScreen();
pause(19);
- comienza_sound("s3.als");
+ playSound(3);
flags[1] = 1;
visible[4] = 1;
visible[2] = 0;
updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- fin_sound();
- } else if (objeto_que_lleva == LOOK && fl == 140)
- talk(_text[_lang][147], "147.als");
- else if (objeto_que_lleva == PICK && fl == 140) {
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ updateScreen();
+ finishSound();
+ } else if (pickedObject == kVerbPick && fl == 140) {
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
updateRefresh_pre();
- copyRect(267, 1, hare_x - 14, hare_y - 2, 52, 73, dir_dibujo3, dir_zona_pantalla);
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ copyRect(267, 1, curX - 14, curY - 2, 52, 73, drawSurface3, screenSurface);
+ updateScreen();
pause(19);
- agarra_objeto(9);
+ pickObject(9);
visible[4] = 0;
flags[10] = 1;
- } else if (objeto_que_lleva == OPEN && fl == 140)
- hay_respuesta = 1;
+ } else if (pickedObject == kVerbOpen && fl == 140)
+ hasAnswer = 1;
else
- hay_respuesta = 0;
+ hasAnswer = 0;
+
+ return true;
}
-void DrasculaEngine::room_7(int fl){
- if (objeto_que_lleva == LOOK && fl == 169)
- talk(_text[_lang][44], "44.als");
- else if (objeto_que_lleva == LOOK && fl == 164)
- talk(_text[_lang][35], "35.als" );
- else if (objeto_que_lleva == PICK && fl == 190) {
- agarra_objeto(17);
+bool DrasculaEngine::room_7(int fl) {
+ if (pickedObject == kVerbPick && fl == 190) {
+ pickObject(17);
flags[35] = 1;
visible[3] = 0;
if (flags[7] == 1 && flags[26] == 1 && flags[34] == 1 && flags[35] == 1 && flags[37] == 1)
flags[38] = 1;
} else
- hay_respuesta = 0;
+ hasAnswer = 0;
+
+ return true;
}
-void DrasculaEngine::room_8(int fl) {
- if (objeto_que_lleva == LOOK && fl == 147 && flags[7] == 0) {
- talk(_text[_lang][58], "58.als");
- agarra_objeto(15);
- flags[7] = 1;
- if (flags[7] == 1 && flags[26] == 1 && flags[34] == 1 && flags[35] == 1 && flags[37] == 1)
- flags[38] = 1;
- } else if (objeto_que_lleva == LOOK && fl == 147)
- talk(_text[_lang][59], "59.als");
- else
- hay_respuesta = 0;
+bool DrasculaEngine::room_8(int fl) {
+ if (pickedObject == kVerbLook && fl == 147) {
+ if (flags[7] == 0) {
+ talk(58);
+ pickObject(15);
+ flags[7] = 1;
+ if (flags[7] == 1 && flags[26] == 1 && flags[34] == 1 && flags[35] == 1 && flags[37] == 1)
+ flags[38] = 1;
+ } else {
+ talk(59);
+ }
+ } else
+ hasAnswer = 0;
+
+ return true;
}
-void DrasculaEngine::room_9(int fl){
- if (objeto_que_lleva == LOOK && fl == 150)
- talk(_text[_lang][35], "35.als");
- else if (objeto_que_lleva == TALK && fl == 150)
- talk(_text[_lang][6], "6.als");
- else if (objeto_que_lleva == LOOK && fl == 51)
- talk(_text[_lang][60], "60.als");
- else if (objeto_que_lleva == TALK && fl == 51 && flags[4] == 0)
+bool DrasculaEngine::room_9(int fl) {
+ if (pickedObject == kVerbTalk && fl == 51 && flags[4] == 0)
animation_4_2();
- else if (objeto_que_lleva == TALK && fl == 51 && flags[4] == 1)
+ else if (pickedObject == kVerbTalk && fl == 51 && flags[4] == 1)
animation_33_2();
- else if (objeto_que_lleva == 7 && fl == 51) {
+ else if (pickedObject == 7 && fl == 51) {
animation_6_2();
- resta_objeto(7);
- agarra_objeto(14);}
+ removeObject(kItemMoney);
+ pickObject(14);}
else
- hay_respuesta = 0;
-}
-
-void DrasculaEngine::room_12(int fl){
- if (objeto_que_lleva == LOOK && fl == 154)
- talk(_text[_lang][329], "329.als");
- else if (objeto_que_lleva == TALK && fl == 154)
- talk(_text[_lang][330], "330.als");
- else if (objeto_que_lleva == MOVE && fl == 155)
- talk(_text[_lang][48], "48.als");
- else if (objeto_que_lleva == TALK && fl == 155)
- talk(_text[_lang][331], "331.als");
- else if (objeto_que_lleva == LOOK && fl == 156)
- talk(_text[_lang][35], "35.als");
- else if (objeto_que_lleva == MOVE && fl == 156)
- talk(_text[_lang][48], "48.als");
- else if (objeto_que_lleva == TALK && fl == 156)
- talk(_text[_lang][50], "50.als");
- else if (objeto_que_lleva == OPEN && fl == 156)
- abre_puerta(16, 4);
- else if (objeto_que_lleva == CLOSE && fl == 156)
- cierra_puerta(16, 4);
+ hasAnswer = 0;
+
+ return true;
+}
+
+bool DrasculaEngine::room_12(int fl) {
+ if (pickedObject == kVerbOpen && fl == 156)
+ openDoor(16, 4);
+ else if (pickedObject == kVerbClose && fl == 156)
+ closeDoor(16, 4);
else
- hay_respuesta = 0;
+ hasAnswer = 0;
+
+ return true;
}
bool DrasculaEngine::room_13(int fl) {
- if (objeto_que_lleva == LOOK && fl == 51) {
- talk(_text[_lang][411], "411.als");
- sentido_hare = 3;
- talk(_text[_lang][412], "412.als");
- strcpy(nombre_obj[1], "yoda");
- } else if (objeto_que_lleva == TALK && fl == 51)
- conversa("op_7.cal");
- else if (objeto_que_lleva == 19 && fl == 51)
+ if (pickedObject == kVerbLook && fl == 51) {
+ talk(411);
+ trackProtagonist = 3;
+ talk(412);
+ strcpy(objName[1], "yoda");
+ } else if (pickedObject == kVerbTalk && fl == 51)
+ converse(7);
+ else if (pickedObject == 19 && fl == 51)
animation_1_3();
- else if (objeto_que_lleva == 9 && fl == 51) {
+ else if (pickedObject == 9 && fl == 51) {
animation_2_3();
return true;
} else
- hay_respuesta = 0;
+ hasAnswer = 0;
+
return false;
}
-void DrasculaEngine::room_14(int fl) {
- if (objeto_que_lleva == TALK && fl == 54 && flags[39] == 0)
+bool DrasculaEngine::room_14(int fl) {
+ if (pickedObject == kVerbTalk && fl == 54 && flags[39] == 0)
animation_12_2();
- else if (objeto_que_lleva == TALK && fl == 54 && flags[39] == 1)
- talk(_text[_lang][109], "109.als");
- else if (objeto_que_lleva == 12 && fl == 54)
+ else if (pickedObject == kVerbTalk && fl == 54 && flags[39] == 1)
+ talk(109);
+ else if (pickedObject == 12 && fl == 54)
animation_26_2();
- else if (objeto_que_lleva == TALK && fl == 52 && flags[5] == 0)
+ else if (pickedObject == kVerbTalk && fl == 52 && flags[5] == 0)
animation_11_2();
- else if (objeto_que_lleva == TALK && fl == 52 && flags[5] == 1)
+ else if (pickedObject == kVerbTalk && fl == 52 && flags[5] == 1)
animation_36_2();
- else if (objeto_que_lleva == TALK && fl == 53)
+ else if (pickedObject == kVerbTalk && fl == 53)
animation_13_2();
- else if (objeto_que_lleva == LOOK && fl == 200)
- talk(_text[_lang][165], "165.als");
- else if (objeto_que_lleva == LOOK && fl == 201)
- talk(_text[_lang][166], "166.als");
- else if (objeto_que_lleva == LOOK && fl == 202)
- talk(_text[_lang][167], "167.als");
- else if (objeto_que_lleva == LOOK && fl == 203)
- talk(_text[_lang][168], "168.als");
- else if (objeto_que_lleva == PICK && fl == 203)
- talk(_text[_lang][170], "170.als");
- else if (objeto_que_lleva == MOVE && fl == 203)
- talk(_text[_lang][170], "170.als");
- else if (objeto_que_lleva == TALK && fl == 203)
- talk(_text[_lang][169], "169.als");
- else if (objeto_que_lleva == LOOK && fl == 204)
- talk(_text[_lang][171], "171.als");
else
- hay_respuesta = 0;
-}
-
-void DrasculaEngine::room_15(int fl) {
- if (objeto_que_lleva == TALK && fl == 188)
- talk(_text[_lang][333], "333.als");
- else if (objeto_que_lleva == LOOK && fl == 188)
- talk(_text[_lang][334], "334.als");
- else if (objeto_que_lleva == 19 && fl == 188 && flags[27] == 0)
- talk(_text[_lang][335], "335.als");
- else if (objeto_que_lleva == 19 && fl == 188 && flags[27] == 1) {
- talk(_text[_lang][336], "336.als");
- sentido_hare = 3;
- talk(_text[_lang][337], "337.als");
- talk_sinc(_text[_lang][46], "46.als", "4442444244244");
- sentido_hare = 1;
- } else if (objeto_que_lleva == 18 && fl == 188 && flags[26] == 0) {
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- copyRect(133, 135, hare_x + 6, hare_y, 39, 63, dir_dibujo3, dir_zona_pantalla);
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- comienza_sound("s8.als");
- fin_sound();
- talk(_text[_lang][338], "338.als");
+ hasAnswer = 0;
+
+ return true;
+}
+
+bool DrasculaEngine::room_15(int fl) {
+ if (pickedObject == 19 && fl == 188 && flags[27] == 0)
+ talk(335);
+ else if (pickedObject == 19 && fl == 188 && flags[27] == 1) {
+ talk(336);
+ trackProtagonist = 3;
+ talk(337);
+ talk_sync(_text[_lang][46], "46.als", "4442444244244");
+ trackProtagonist = 1;
+ } else if (pickedObject == 18 && fl == 188 && flags[26] == 0) {
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
+ copyRect(133, 135, curX + 6, curY, 39, 63, drawSurface3, screenSurface);
+ updateScreen();
+ playSound(8);
+ finishSound();
+ talk(338);
flags[27] = 0;
- agarra_objeto(19);
- resta_objeto(18);
- } else if (objeto_que_lleva == MOVE && fl == 188 && flags[27] == 0) {
+ pickObject(19);
+ removeObject(kItemTwoCoins);
+ } else if (pickedObject == kVerbMove && fl == 188 && flags[27] == 0) {
animation_34_2();
- talk(_text[_lang][339], "339.als");
- agarra_objeto(16);
+ talk(339);
+ pickObject(16);
flags[26] = 1;
flags[27] = 1;
if (flags[7] == 1 && flags[26] == 1 && flags[34] == 1 && flags[35] == 1 && flags[37] == 1)
flags[38] = 1;
- } else if (objeto_que_lleva == LOOK && fl == 205)
- talk(_text[_lang][172], "172.als");
- else if (objeto_que_lleva == LOOK && fl == 206)
- talk(_text[_lang][173], "173.als");
- else if (objeto_que_lleva == MOVE && fl == 206)
- talk(_text[_lang][174], "174.als");
- else if (objeto_que_lleva == OPEN && fl == 206)
- talk(_text[_lang][174], "174.als");
- else
- hay_respuesta = 0;
-}
-
-void DrasculaEngine::room_16(int fl) {
- if (objeto_que_lleva == TALK && fl == 163)
- talk(_text[_lang][6], "6.als");
- else if (objeto_que_lleva == OPEN && fl == 163)
- abre_puerta(17, 0);
- else if (objeto_que_lleva == CLOSE && fl == 163)
- cierra_puerta(17, 0);
- else if (objeto_que_lleva == LOOK && fl == 183)
- talk(_text[_lang][340], "340.als");
- else if (objeto_que_lleva == TALK && fl == 183) {
- talk(_text[_lang][341], "341.als");
+ } else
+ hasAnswer = 0;
+
+ return true;
+}
+
+bool DrasculaEngine::room_16(int fl) {
+ if (pickedObject == kVerbOpen && fl == 163)
+ openDoor(17, 0);
+ else if (pickedObject == kVerbClose && fl == 163)
+ closeDoor(17, 0);
+ else if (pickedObject == kVerbTalk && fl == 183) {
+ talk(341);
pause(10);
- talk_sinc(_text[_lang][50], "50.als", "11111111111144432554433");
+ talk_sync(_text[_lang][50], "50.als", "11111111111144432554433");
pause(3);
- talk_baul("bla, bla, bla.", "d83.als");
- } else if (objeto_que_lleva == OPEN && fl == 183) {
- abre_puerta(19, NO_PUERTA);
+ talk_baul(83);
+ } else if (pickedObject == kVerbOpen && fl == 183) {
+ openDoor(19, NO_DOOR);
if (flags[20] == 0) {
flags[20] = 1;
- sentido_hare = 3;
+ trackProtagonist = 3;
updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- talk(_text[_lang][342], "342.als");
- agarra_objeto(22);
+ updateScreen();
+ talk(342);
+ pickObject(22);
}
- } else if (objeto_que_lleva == CLOSE && fl == 183)
- cierra_puerta(19, NO_PUERTA);
- else if (objeto_que_lleva == LOOK && fl == 185)
- talk(_text[_lang][37], "37.als");
- else if (objeto_que_lleva == PICK && fl == 185)
- talk(_text[_lang][7], "7.als");
- else if (objeto_que_lleva == MOVE && fl == 185)
- talk(_text[_lang][7], "7.als");
- else if (objeto_que_lleva == TALK && fl == 185)
- talk(_text[_lang][38], "38.als");
- else if (objeto_que_lleva == LOOK && fl == 187) {
- talk(_text[_lang][343], "343.als");
- sentido_hare = 3;
+ } else if (pickedObject == kVerbClose && fl == 183)
+ closeDoor(19, NO_DOOR);
+ else if (pickedObject == kVerbLook && fl == 187) {
+ talk(343);
+ trackProtagonist = 3;
updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- talk(_text[_lang][344], "344.als");
- } else if (objeto_que_lleva == TALK && fl == 187)
- talk(_text[_lang][345], "345.als");
- else
- hay_respuesta = 0;
+ updateScreen();
+ talk(344);
+ } else
+ hasAnswer = 0;
+
+ return true;
}
-void DrasculaEngine::room_17(int fl) {
- if (objeto_que_lleva == LOOK && fl == 177)
- talk(_text[_lang][35], "35.als");
- else if (objeto_que_lleva == TALK && fl == 177 && flags[18] == 0)
- talk(_text[_lang][6], "6.als");
- else if (objeto_que_lleva == TALK && fl == 177 && flags[18] == 1)
+bool DrasculaEngine::room_17(int fl) {
+ if (pickedObject == kVerbLook && fl == 177)
+ talk(35);
+ else if (pickedObject == kVerbTalk && fl == 177 && flags[18] == 0)
+ talk(6);
+ else if (pickedObject == kVerbTalk && fl == 177 && flags[18] == 1)
animation_18_2();
- else if (objeto_que_lleva == OPEN && fl == 177 && flags[18] == 1)
- talk(_text[_lang][346], "346.als");
- else if (objeto_que_lleva == OPEN && fl == 177 && flags[14] == 0 && flags[18] == 0)
+ else if (pickedObject == kVerbOpen && fl == 177 && flags[18] == 1)
+ talk(346);
+ else if (pickedObject == kVerbOpen && fl == 177 && flags[14] == 0 && flags[18] == 0)
animation_22_2();
- else if (objeto_que_lleva == OPEN && fl == 177 && flags[14] == 1)
- abre_puerta(15, 1);
- else if (objeto_que_lleva == CLOSE && fl == 177 && flags[14] == 1)
- cierra_puerta(15, 1);
- else if (objeto_que_lleva == 11 && fl == 50 && flags[22] == 0) {
- talk(_text[_lang][347], "347.als");
+ else if (pickedObject == kVerbOpen && fl == 177 && flags[14] == 1)
+ openDoor(15, 1);
+ else if (pickedObject == kVerbClose && fl == 177 && flags[14] == 1)
+ closeDoor(15, 1);
+ else if (pickedObject == 11 && fl == 50 && flags[22] == 0) {
+ talk(347);
flags[29] = 1;
- agarra_objeto(23);
- resta_objeto(11);
+ pickObject(23);
+ removeObject(kItemEarplugs);
} else
- hay_respuesta = 0;
+ hasAnswer = 0;
+
+ return true;
}
-void DrasculaEngine::room_18(int fl) {
- if (objeto_que_lleva == TALK && fl == 55 && flags[36] == 0)
+bool DrasculaEngine::room_18(int fl) {
+ if (pickedObject == kVerbTalk && fl == 55 && flags[36] == 0)
animation_24_2();
- else if (objeto_que_lleva == TALK && fl == 55 && flags[36] == 1)
- talk(_text[_lang][109], "109.als");
- else if (objeto_que_lleva == LOOK && fl == 181)
- talk(_text[_lang][348], "348.als");
- else if (objeto_que_lleva == PICK && fl == 182) {
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ else if (pickedObject == kVerbTalk && fl == 55 && flags[36] == 1)
+ talk(109);
+ else if (pickedObject == kVerbPick && fl == 182) {
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
updateRefresh_pre();
- copyRect(44, 1, hare_x, hare_y, 41, 70, dir_dibujo2, dir_zona_pantalla);
+ copyRect(44, 1, curX, curY, 41, 70, drawSurface2, screenSurface);
updateRefresh();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateScreen();
pause(4);
- agarra_objeto(12);
+ pickObject(12);
visible[2] = 0;
flags[28] = 1;
- } else if (objeto_que_lleva == LOOK && fl == 182)
- talk(_text[_lang][154], "154.als");
- else if (objeto_que_lleva == 8 && fl == 55 && flags[38] == 0 && flags[33] == 1)
- talk(_text[_lang][349], "349.als");
- else if (objeto_que_lleva == 13 && fl == 55 && flags[38] == 0 && flags[33] == 1)
- talk(_text[_lang][349], "349.als");
- else if (objeto_que_lleva == 15 && fl == 55 && flags[38] == 0 && flags[33] == 1)
- talk(_text[_lang][349], "349.als");
- else if (objeto_que_lleva == 16 && fl == 55 && flags[38] == 0 && flags[33] == 1)
- talk(_text[_lang][349], "349.als");
- else if (objeto_que_lleva == 17 && fl == 55 && flags[38] == 0 && flags[33] == 1)
- talk(_text[_lang][349], "349.als");
- else if (objeto_que_lleva == 8 && fl == 55 && flags[38] == 1 && flags[33] == 1)
- animation_24_2();
- else if (objeto_que_lleva == 13 && fl == 55 && flags[38] == 1 && flags[33] == 1)
- animation_24_2();
- else if (objeto_que_lleva == 15 && fl == 55 && flags[38] == 1 && flags[33] == 1)
- animation_24_2();
- else if (objeto_que_lleva == 16 && fl == 55 && flags[38] == 1 && flags[33] == 1)
- animation_24_2();
- else if (objeto_que_lleva == 17 && fl == 55 && flags[38] == 1 && flags[33] == 1)
- animation_24_2();
- else if (objeto_que_lleva == 11 && fl == 50 && flags[22] == 0) {
- sentido_hare = 3;
+ } else if (fl == 55 && flags[38] == 0 && flags[33] == 0) {
+ if (pickedObject == 8 || pickedObject == 13 || pickedObject == 15 ||
+ pickedObject == 16 || pickedObject == 17)
+ talk(349);
+ } else if (fl == 55 && flags[38] == 1 && flags[33] == 1) {
+ if (pickedObject == 8 || pickedObject == 13 || pickedObject == 15 ||
+ pickedObject == 16 || pickedObject == 17)
+ animation_24_2();
+ }
+ else if (pickedObject == 11 && fl == 50 && flags[22] == 0) {
+ trackProtagonist = 3;
updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ updateScreen();
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
updateRefresh_pre();
- copyRect(1, 1, hare_x - 1, hare_y + 3, 42, 67, dir_dibujo2, dir_zona_pantalla);
+ copyRect(1, 1, curX - 1, curY + 3, 42, 67, drawSurface2, screenSurface);
updateRefresh();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateScreen();
pause(6);
- talk(_text[_lang][347], "347.als");
+ talk(347);
flags[29] = 1;
- agarra_objeto(23);
- resta_objeto(11);
+ pickObject(23);
+ removeObject(kItemEarplugs);
} else
- hay_respuesta = 0;
-}
+ hasAnswer = 0;
-void DrasculaEngine::room_19(int fl) {
- if (objeto_que_lleva == LOOK && fl == 214)
- talk(_text[_lang][191], "191.als");
- else
- hay_respuesta = 0;
+ return true;
}
bool DrasculaEngine::room_21(int fl) {
- if (objeto_que_lleva == OPEN && fl == 101 && flags[28] == 0)
- talk(_text[_lang][419], "419.als");
- else if (objeto_que_lleva == OPEN && fl == 101 && flags[28] == 1)
- abre_puerta(0, 1);
- else if (objeto_que_lleva == CLOSE && fl == 101)
- cierra_puerta(0, 1);
- else if(objeto_que_lleva == PICK && fl == 141) {
- agarra_objeto(19);
+ if (pickedObject == kVerbOpen && fl == 101 && flags[28] == 0)
+ talk(419);
+ else if (pickedObject == kVerbOpen && fl == 101 && flags[28] == 1)
+ openDoor(0, 1);
+ else if (pickedObject == kVerbClose && fl == 101)
+ closeDoor(0, 1);
+ else if(pickedObject == kVerbPick && fl == 141) {
+ pickObject(19);
visible[2] = 0;
flags[10] = 1;
- } else if(objeto_que_lleva == 7 && fl == 101) {
+ } else if(pickedObject == 7 && fl == 101) {
flags[28] = 1;
- abre_puerta(0, 1);
- sin_verbo();
- } else if (objeto_que_lleva == 21 && fl == 179) {
+ openDoor(0, 1);
+ withoutVerb();
+ } else if (pickedObject == 21 && fl == 179) {
animation_9_4();
return true;
} else
- hay_respuesta = 0;
+ hasAnswer = 0;
return false;
}
-void DrasculaEngine::room_22(int fl) {
- if (objeto_que_lleva == PICK && fl == 140)
- talk(_text[_lang][7], "7.als");
- else if (objeto_que_lleva == 11 && fl == 140) {
- agarra_objeto(18);
+bool DrasculaEngine::room_22(int fl) {
+ if (pickedObject == 11 && fl == 140) {
+ pickObject(18);
visible[1] = 0;
flags[24] = 1;
- } else if (objeto_que_lleva == 22 && fl == 52) {
- anima("up.bin",14);
+ } else if (pickedObject == 22 && fl == 52) {
+ animate("up.bin",14);
flags[26]=1;
- comienza_sound("s1.als");
- hipo(14);
- fin_sound();
- sin_verbo();
- resta_objeto(22);
- actualiza_datos();
- sentido_hare = 3;
- talk(_text[_lang][499], "499.als");
- talk(_text[_lang][500], "500.als");
- } else if (objeto_que_lleva == LOOK && fl == 52)
- talk(_text[_lang][497], "497.als");
- else if (objeto_que_lleva == TALK && fl == 52)
- talk(_text[_lang][498], "498.als");
- else if (objeto_que_lleva == PICK && fl == 180 && flags[26] == 0)
- talk(_text[_lang][420], "420.als");
- else if (objeto_que_lleva == PICK && fl == 180 && flags[26] == 1) {
- agarra_objeto(7);
+ playSound(1);
+ hiccup(14);
+ finishSound();
+ withoutVerb();
+ removeObject(22);
+ updateVisible();
+ trackProtagonist = 3;
+ talk(499);
+ talk(500);
+ } else if (pickedObject == kVerbPick && fl == 180 && flags[26] == 0)
+ talk(420);
+ else if (pickedObject == kVerbPick && fl == 180 && flags[26] == 1) {
+ pickObject(7);
visible[3] = 0;
flags[27] = 1;
} else
- hay_respuesta = 0;
-}
-
-void DrasculaEngine::room_23(int fl) {
- if (objeto_que_lleva == OPEN && fl == 103) {
- abre_puerta(0, 0);
- actualiza_datos();
- } else if(objeto_que_lleva == CLOSE && fl == 103) {
- cierra_puerta(0, 0);
- actualiza_datos();
- } else if(objeto_que_lleva == OPEN && fl == 104)
- abre_puerta(1, 1);
- else if(objeto_que_lleva == CLOSE && fl == 104)
- cierra_puerta(1, 1);
- else if(objeto_que_lleva == PICK && fl == 142) {
- agarra_objeto(8);
+ hasAnswer = 0;
+
+ return true;
+}
+
+bool DrasculaEngine::room_23(int fl) {
+ if (pickedObject == kVerbOpen && fl == 103) {
+ openDoor(0, 0);
+ updateVisible();
+ } else if(pickedObject == kVerbClose && fl == 103) {
+ closeDoor(0, 0);
+ updateVisible();
+ } else if(pickedObject == kVerbOpen && fl == 104)
+ openDoor(1, 1);
+ else if(pickedObject == kVerbClose && fl == 104)
+ closeDoor(1, 1);
+ else if(pickedObject == kVerbPick && fl == 142) {
+ pickObject(8);
visible[2] = 0;
flags[11] = 1;
if (flags[22] == 1 && flags[14] == 1)
@@ -785,685 +608,502 @@ void DrasculaEngine::room_23(int fl) {
if (flags[18] == 1)
animation_6_4();
} else
- hay_respuesta = 0;
-}
-
-void DrasculaEngine::room_24(int fl) {
- if (objeto_que_lleva == OPEN && fl == 105)
- abre_puerta(1, 0);
- else if (objeto_que_lleva == CLOSE && fl == 105)
- cierra_puerta(1, 0);
- else if (objeto_que_lleva == OPEN && fl == 106)
- abre_puerta(2, 1);
- else if (objeto_que_lleva == CLOSE && fl == 106)
- cierra_puerta(2, 1);
- else if (objeto_que_lleva == LOOK && fl == 151)
- talk(_text[_lang][461], "461.als");
+ hasAnswer = 0;
+
+ return true;
+}
+
+bool DrasculaEngine::room_24(int fl) {
+ if (pickedObject == kVerbOpen && fl == 105)
+ openDoor(1, 0);
+ else if (pickedObject == kVerbClose && fl == 105)
+ closeDoor(1, 0);
+ else if (pickedObject == kVerbOpen && fl == 106)
+ openDoor(2, 1);
+ else if (pickedObject == kVerbClose && fl == 106)
+ closeDoor(2, 1);
else
- hay_respuesta = 0;
+ hasAnswer = 0;
+
+ return true;
}
-void DrasculaEngine::room_26(int fl) {
- if (objeto_que_lleva == OPEN && fl == 107 && flags[30] == 0)
- abre_puerta(2, 0);
- else if (objeto_que_lleva == OPEN && fl == 107 && flags[30] == 1)
- talk(_text[_lang][421], "421.als");
- else if (objeto_que_lleva == CLOSE && fl == 107)
- cierra_puerta(2, 0);
- else if (objeto_que_lleva == 10 && fl == 50 && flags[18] == 1 && flags[12] == 1)
+bool DrasculaEngine::room_26(int fl) {
+ if (pickedObject == kVerbOpen && fl == 107 && flags[30] == 0)
+ openDoor(2, 0);
+ else if (pickedObject == kVerbOpen && fl == 107 && flags[30] == 1)
+ talk(421);
+ else if (pickedObject == kVerbClose && fl == 107)
+ closeDoor(2, 0);
+ else if (pickedObject == 10 && fl == 50 && flags[18] == 1 && flags[12] == 1)
animation_5_4();
- else if (objeto_que_lleva == 8 && fl == 50 && flags[18] == 1 && flags[12] == 1)
+ else if (pickedObject == 8 && fl == 50 && flags[18] == 1 && flags[12] == 1)
animation_5_4();
- else if (objeto_que_lleva == 12 && fl == 50 && flags[18] == 1 && flags[12] == 1)
+ else if (pickedObject == 12 && fl == 50 && flags[18] == 1 && flags[12] == 1)
animation_5_4();
- else if (objeto_que_lleva == 16 && fl == 50 && flags[18] == 1 && flags[12] == 1)
+ else if (pickedObject == 16 && fl == 50 && flags[18] == 1 && flags[12] == 1)
animation_5_4();
- else if (objeto_que_lleva == PICK && fl == 143 && flags[18] == 1) {
- lleva_al_hare(260, 180);
- agarra_objeto(10);
+ else if (pickedObject == kVerbPick && fl == 143 && flags[18] == 1) {
+ gotoObject(260, 180);
+ pickObject(10);
visible[1] = 0;
flags[12] = 1;
- cierra_puerta(2, 0);
- sentido_hare = 2;
- talk_igorpuerta(_texti[_lang][27], "I27.als");
+ closeDoor(2, 0);
+ trackProtagonist = 2;
+ talk_igor(27, kIgorDoor);
flags[30] = 1;
- talk_igorpuerta(_texti[_lang][28], "I28.als");
- lleva_al_hare(153, 180);
- } else if (objeto_que_lleva == PICK && fl == 143 && flags[18] == 0) {
- lleva_al_hare(260, 180);
- copyBackground(80, 78, 199, 94, 38, 27, dir_dibujo3, dir_zona_pantalla);
- updateScreen(199, 94, 199, 94, 38, 27, dir_zona_pantalla);
+ talk_igor(28, kIgorDoor);
+ gotoObject(153, 180);
+ } else if (pickedObject == kVerbPick && fl == 143 && flags[18] == 0) {
+ gotoObject(260, 180);
+ copyBackground(80, 78, 199, 94, 38, 27, drawSurface3, screenSurface);
+ updateScreen(199, 94, 199, 94, 38, 27, screenSurface);
pause(3);
- talk_igor_peluca(_texti[_lang][25], "I25.als");
- lleva_al_hare(153, 180);
- } else if (objeto_que_lleva == TALK && fl == 51)
+ talk_igor(25, kIgorWig);
+ gotoObject(153, 180);
+ } else if (pickedObject == kVerbTalk && fl == 51)
animation_1_4();
- else if (objeto_que_lleva == OPEN && fl == 167)
- talk(_text[_lang][467], "467.als");
- else if (objeto_que_lleva == LOOK && fl == 164)
- talk(_text[_lang][470], "470.als");
- else if (objeto_que_lleva == OPEN && fl == 164)
- talk(_text[_lang][471], "471.als");
- else if (objeto_que_lleva == LOOK && fl == 163)
- talk(_text[_lang][472], "472.als");
- else if (objeto_que_lleva == PICK && fl == 163)
- talk(_text[_lang][473], "473.als");
- else if (objeto_que_lleva == LOOK && fl == 165)
- talk(_text[_lang][474], "474.als");
- else if (objeto_que_lleva == LOOK && fl == 168)
- talk(_text[_lang][476], "476.als");
- else if (objeto_que_lleva == PICK && fl == 168)
- talk(_text[_lang][477], "477.als");
else
- hay_respuesta = 0;
-}
-
-void DrasculaEngine::room_27(int fl) {
- if (objeto_que_lleva == OPEN && fl == 110)
- abre_puerta(6, 1);
- else if (objeto_que_lleva == CLOSE && fl == 110)
- cierra_puerta(6, 1);
- else if (objeto_que_lleva == OPEN && fl == 116 && flags[23] == 0)
- talk(_text[_lang][419], "419.als");
- else if (objeto_que_lleva == OPEN && fl == 116 && flags[23] == 1)
- abre_puerta(5, 3);
- else if (objeto_que_lleva == 17 && fl == 116) {
+ hasAnswer = 0;
+
+ return true;
+}
+
+bool DrasculaEngine::room_27(int fl) {
+ if (pickedObject == kVerbOpen && fl == 110)
+ openDoor(6, 1);
+ else if (pickedObject == kVerbClose && fl == 110)
+ closeDoor(6, 1);
+ else if (pickedObject == kVerbOpen && fl == 116 && flags[23] == 0)
+ talk(419);
+ else if (pickedObject == kVerbOpen && fl == 116 && flags[23] == 1)
+ openDoor(5, 3);
+ else if (pickedObject == 17 && fl == 116) {
flags[23] = 1;
- abre_puerta(5,3);
- sin_verbo();
- } else if (objeto_que_lleva == LOOK && fl == 175)
- talk(_text[_lang][429], "429.als");
- else if (fl == 150)
- talk(_text[_lang][460], "460.als");
+ openDoor(5,3);
+ withoutVerb();
+ } else if (fl == 150)
+ talk(460);
else
- hay_respuesta = 0;
-}
-
-void DrasculaEngine::room_29(int fl) {
- if (objeto_que_lleva == OPEN && fl == 114)
- abre_puerta(4, 1);
- else if (objeto_que_lleva == CLOSE && fl == 114)
- cierra_puerta(4, 1);
- else if (objeto_que_lleva == LOOK && fl == 152)
- talk(_text[_lang][463], "463.als");
- else if (objeto_que_lleva == OPEN && fl == 152)
- talk(_text[_lang][464], "464.als");
- else if (objeto_que_lleva == LOOK && fl == 153)
- talk(_text[_lang][465], "465.als");
- else if (objeto_que_lleva == PICK && fl == 154)
- talk(_text[_lang][466], "466.als");
- else if (objeto_que_lleva == OPEN && fl == 156)
- talk(_text[_lang][467], "467.als");
+ hasAnswer = 0;
+
+ return true;
+}
+
+bool DrasculaEngine::room_29(int fl) {
+ if (pickedObject == kVerbOpen && fl == 114)
+ openDoor(4, 1);
+ else if (pickedObject == kVerbClose && fl == 114)
+ closeDoor(4, 1);
else
- hay_respuesta = 0;
-}
-
-void DrasculaEngine::room_30(int fl) {
- if (objeto_que_lleva == OPEN && fl == 115)
- abre_puerta(4, 0);
- else if (objeto_que_lleva == CLOSE && fl == 115)
- cierra_puerta(4, 0);
- else if (objeto_que_lleva == OPEN && fl == 144 && flags[19] == 0)
- talk(_text[_lang][422], "422.als");
- else if (objeto_que_lleva == OPEN && fl == 144 && flags[19] == 1 && flags[22] == 1)
- abre_puerta(16, 1);
- else if (objeto_que_lleva == OPEN && fl == 144 && flags[19] == 1 && flags[22] == 0) {
- abre_puerta(16, 1);
- talk(_text[_lang][423], "423.als");
+ hasAnswer = 0;
+
+ return true;
+}
+
+bool DrasculaEngine::room_30(int fl) {
+ if (pickedObject == kVerbOpen && fl == 115)
+ openDoor(4, 0);
+ else if (pickedObject == kVerbClose && fl == 115)
+ closeDoor(4, 0);
+ else if (pickedObject == kVerbOpen && fl == 144 && flags[19] == 0)
+ talk(422);
+ else if (pickedObject == kVerbOpen && fl == 144 && flags[19] == 1 && flags[22] == 1)
+ openDoor(16, 1);
+ else if (pickedObject == kVerbOpen && fl == 144 && flags[19] == 1 && flags[22] == 0) {
+ openDoor(16, 1);
+ talk(423);
flags[22] = 1;
- agarra_objeto(12);
+ pickObject(12);
if (flags[11] == 1 && flags[14] == 1)
flags[18] = 1;
if (flags[18] == 1)
animation_6_4();
- } else if (objeto_que_lleva == CLOSE && fl == 144)
- cierra_puerta(16, 1);
- else if (objeto_que_lleva == 13 && fl == 144) {
- talk(_text[_lang][424], "424.als");
+ } else if (pickedObject == kVerbClose && fl == 144)
+ closeDoor(16, 1);
+ else if (pickedObject == 13 && fl == 144) {
+ talk(424);
flags[19] = 1;
- } else if (objeto_que_lleva == OPEN && fl == 157)
- talk(_text[_lang][468], "468.als");
- else if (objeto_que_lleva == LOOK && fl == 158)
- talk(_text[_lang][469], "469.als");
- else
- hay_respuesta = 0;
+ } else
+ hasAnswer = 0;
+
+ return true;
}
-void DrasculaEngine::room_31(int fl) {
- if (objeto_que_lleva == PICK && fl == 145) {
- agarra_objeto(11);
+bool DrasculaEngine::room_31(int fl) {
+ if (pickedObject == kVerbPick && fl == 145) {
+ pickObject(11);
visible[1] = 0;
flags[13] = 1;
- } else if (objeto_que_lleva == OPEN && fl == 117)
- abre_puerta(5, 0);
- else if (objeto_que_lleva == CLOSE && fl == 117)
- cierra_puerta(5, 0);
- else if (objeto_que_lleva == LOOK && fl == 161)
- talk(_text[_lang][470], "470.als");
- else if (objeto_que_lleva == OPEN && fl == 161)
- talk(_text[_lang][471], "471.als");
+ } else if (pickedObject == kVerbOpen && fl == 117)
+ openDoor(5, 0);
+ else if (pickedObject == kVerbClose && fl == 117)
+ closeDoor(5, 0);
else
- hay_respuesta = 0;
+ hasAnswer = 0;
+
+ return true;
}
-void DrasculaEngine::room_34(int fl) {
- if (objeto_que_lleva == MOVE && fl == 146)
+bool DrasculaEngine::room_34(int fl) {
+ if (pickedObject == kVerbMove && fl == 146)
animation_8_4();
- else if (objeto_que_lleva == LOOK && fl == 146)
- talk(_text[_lang][458], "458.als");
- else if (objeto_que_lleva == PICK && fl == 146)
- talk(_text[_lang][459], "459.als");
- else if (objeto_que_lleva == OPEN && fl == 120 && flags[25] == 1)
- abre_puerta(8, 2);
- else if (objeto_que_lleva == OPEN && fl == 120 && flags[25] == 0) {
- abre_puerta(8, 2);
- sentido_hare = 3;
- talk(_text[_lang][425], "425.als");
- agarra_objeto(14);
+ else if (pickedObject == kVerbOpen && fl == 120 && flags[25] == 1)
+ openDoor(8, 2);
+ else if (pickedObject == kVerbOpen && fl == 120 && flags[25] == 0) {
+ openDoor(8, 2);
+ trackProtagonist = 3;
+ talk(425);
+ pickObject(14);
flags[25] = 1;
- } else if (objeto_que_lleva == CLOSE && fl == 120)
- cierra_puerta(8, 2);
+ } else if (pickedObject == kVerbClose && fl == 120)
+ closeDoor(8, 2);
else
- hay_respuesta=0;
+ hasAnswer=0;
+
+ return true;
}
-void DrasculaEngine::room_35(int fl) {
- if (objeto_que_lleva == PICK && fl == 148) {
- agarra_objeto(16);
+bool DrasculaEngine::room_35(int fl) {
+ if (pickedObject == kVerbPick && fl == 148) {
+ pickObject(16);
visible[2] = 0;
flags[14] = 1;
if (flags[11] == 1 && flags[22] == 1)
flags[18] = 1;
if (flags[18] == 1)
animation_6_4();
- } else if (objeto_que_lleva == PICK && fl == 147) {
- talk(_text[_lang][426], "426.als");
- agarra_objeto(15);
+ } else if (pickedObject == kVerbPick && fl == 147) {
+ talk(426);
+ pickObject(15);
visible[1] = 0;
flags[15] = 1;
flags[17] = 1;
- actualiza_datos();
- } else if (objeto_que_lleva == PICK && fl == 149) {
- agarra_objeto(13);
+ updateVisible();
+ } else if (pickedObject == kVerbPick && fl == 149) {
+ pickObject(13);
visible[3] = 0;
flags[17] = 0;
} else
- hay_respuesta = 0;
-}
+ hasAnswer = 0;
-void DrasculaEngine::room_44(int fl) {
- if (objeto_que_lleva == LOOK && fl == 172)
- talk(_text[_lang][428], "428.als");
- else
- hay_respuesta = 0;
+ return true;
}
-void DrasculaEngine::room_49(int fl){
- if (objeto_que_lleva == TALK && fl ==51)
- conversa("op_9.cal");
- else if (objeto_que_lleva == LOOK && fl == 51)
- talk(_text[_lang][132], "132.als");
- else if ((objeto_que_lleva == 8 && fl == 51) || (objeto_que_lleva == 8 && fl == 203))
+bool DrasculaEngine::room_49(int fl) {
+ if (pickedObject == kVerbTalk && fl ==51)
+ converse(9);
+ else if ((pickedObject == 8 && fl == 51) || (pickedObject == 8 && fl == 203))
animation_5_5();
- else if (objeto_que_lleva == LOOK && fl == 200)
- talk(_text[_lang][133], "133.als");
- else if (objeto_que_lleva == TALK && fl == 200)
- talk(_text[_lang][134], "134.als");
- else if (objeto_que_lleva == LOOK && fl == 201)
- talk(_text[_lang][135], "135.als");
- else if (objeto_que_lleva == LOOK && fl == 203)
- talk(_text[_lang][137], "137.als");
else
- hay_respuesta = 0;
+ hasAnswer = 0;
+
+ return true;
}
-void DrasculaEngine::room_53(int fl) {
- if (objeto_que_lleva == PICK && fl == 120) {
- agarra_objeto(16);
+bool DrasculaEngine::room_53(int fl) {
+ if (pickedObject == kVerbPick && fl == 120) {
+ pickObject(16);
visible[3] = 0;
- } else if (objeto_que_lleva == LOOK && fl == 121)
- talk(_text[_lang][128], "128.als");
- else if (objeto_que_lleva == LOOK && fl == 209)
- talk(_text[_lang][129], "129.als");
- else if (objeto_que_lleva == MOVE && fl == 123)
+ } else if (pickedObject == kVerbMove && fl == 123)
animation_11_5();
- else if (objeto_que_lleva == LOOK && fl == 52)
- talk(_text[_lang][447], "447.als");
- else if (objeto_que_lleva == TALK && fl == 52)
- talk(_text[_lang][131], "131.als");
- else if (objeto_que_lleva == 12 && fl == 52)
+ else if (pickedObject == 12 && fl == 52)
animation_10_5();
- else if (objeto_que_lleva == 15 && fl == 52)
+ else if (pickedObject == 15 && fl == 52)
animation_9_5();
- else if (objeto_que_lleva == 16 && fl == 121) {
+ else if (pickedObject == 16 && fl == 121) {
flags[2] = 1;
- sin_verbo();
- actualiza_datos();
- } else if (objeto_que_lleva == 16) {
- talk(_text[_lang][439], "439.als");
- sin_verbo();
+ withoutVerb();
+ updateVisible();
+ } else if (pickedObject == 16) {
+ talk(439);
+ withoutVerb();
visible[3] = 1;
} else
- hay_respuesta = 0;
+ hasAnswer = 0;
+
+ return true;
}
-void DrasculaEngine::room_54(int fl) {
- if ((objeto_que_lleva == TALK && fl == 118) || (objeto_que_lleva == LOOK && fl == 118 && flags[0] == 0))
+bool DrasculaEngine::room_54(int fl) {
+ if ((pickedObject == kVerbTalk && fl == 118) || (pickedObject == kVerbLook && fl == 118 && flags[0] == 0))
animation_1_5();
- else if (objeto_que_lleva == LOOK && fl == 118 && flags[0]==1)
- talk(_text[_lang][124], "124.als");
- else if (objeto_que_lleva == LOOK && fl == 53)
- talk(_text[_lang][127], "127.als");
- else if (objeto_que_lleva == TALK && fl == 53 && flags[14] == 0) {
- talk(_text[_lang][288], "288.als");
+ else if (pickedObject == kVerbLook && fl == 118 && flags[0] == 1)
+ talk(124);
+ else if (pickedObject == kVerbTalk && fl == 53 && flags[14] == 0) {
+ talk(288);
flags[12] = 1;
pause(10);
- talk_mus(_texte[_lang][1], "E1.als");
- talk(_text[_lang][289], "289.als");
- talk_mus(_texte[_lang][2], "E2.als");
- talk_mus(_texte[_lang][3], "E3.als");
- conversa("op_10.cal");
+ talk_mus(1);
+ talk(289);
+ talk_mus(2);
+ talk_mus(3);
+ converse(10);
flags[12] = 0;
flags[14] = 1;
- } else if (objeto_que_lleva == TALK && fl == 53 && flags[14] == 1)
- talk(_text[_lang][109], "109.als");
- else if (objeto_que_lleva == PICK && fl == 9999 && flags[13] == 0) {
- agarra_objeto(8);
+ } else if (pickedObject == kVerbTalk && fl == 53 && flags[14] == 1)
+ talk(109);
+ else if (pickedObject == kVerbPick && fl == 9999 && flags[13] == 0) {
+ pickObject(8);
flags[13] = 1;
- talk_mus(_texte[_lang][10], "e10.als");
- actualiza_datos();
- } else if (objeto_que_lleva == OPEN && fl == 119)
- talk(_text[_lang][125], "125.als");
- else if (objeto_que_lleva == LOOK && fl == 119)
- talk(_text[_lang][126], "126.als");
- else if (objeto_que_lleva == 10 && fl == 119) {
+ talk_mus(10);
+ updateVisible();
+ } else if (pickedObject == 10 && fl == 119) {
pause(4);
- talk(_text[_lang][436], "436.als");
- sin_verbo();
- resta_objeto(10);
+ talk(436);
+ withoutVerb();
+ removeObject(10);
} else
- hay_respuesta = 0;
+ hasAnswer = 0;
+
+ return true;
}
-void DrasculaEngine::room_55(int fl) {
- if (objeto_que_lleva == PICK && fl == 122) {
- agarra_objeto(12);
+bool DrasculaEngine::room_55(int fl) {
+ if (pickedObject == kVerbPick && fl == 122) {
+ pickObject(12);
flags[8] = 1;
- actualiza_datos();
- } else if (objeto_que_lleva == LOOK && fl == 122)
- talk(_text[_lang][138], "138.als");
- else if (objeto_que_lleva == LOOK && fl == 204)
- talk(_text[_lang][139], "139.als");
- else if (objeto_que_lleva == LOOK && fl == 205)
- talk(_text[_lang][140], "140.als");
- else if (fl == 206) {
- comienza_sound("s11.als");
- anima("det.bin", 17);
- fin_sound();
- lleva_al_hare(hare_x - 3, hare_y + alto_hare + 6);
+ updateVisible();
+ } else if (fl == 206) {
+ playSound(11);
+ animate("det.bin", 17);
+ finishSound();
+ gotoObject(curX - 3, curY + curHeight + 6);
} else
- hay_respuesta = 0;
+ hasAnswer = 0;
+
+ return true;
}
bool DrasculaEngine::room_56(int fl) {
- if (objeto_que_lleva == OPEN && fl == 124) {
+ if (pickedObject == kVerbOpen && fl == 124) {
animation_14_5();
return true;
- } else if (objeto_que_lleva == LOOK && fl == 124)
- talk(_text[_lang][450], "450.als");
- else if (objeto_que_lleva == OPEN && fl == 207)
- talk(_text[_lang][141], "141.als");
- else if (objeto_que_lleva == LOOK && fl == 208)
- talk(_text[_lang][142], "142.als");
- else
- hay_respuesta = 0;
+ } else
+ hasAnswer = 0;
return false;
}
-void DrasculaEngine::room_58(int fl) {
- if (objeto_que_lleva == MOVE && fl == 103)
+bool DrasculaEngine::room_58(int fl) {
+ if (pickedObject == kVerbMove && fl == 103)
animation_7_6();
- else if (objeto_que_lleva == LOOK && fl == 104)
- talk(_text[_lang][454], "454.als");
else
- hay_respuesta = 0;
+ hasAnswer = 0;
+
+ return true;
}
-void DrasculaEngine::room_59(int fl) {
- if ((objeto_que_lleva == TALK && fl == 51) || (objeto_que_lleva == LOOK && fl == 51)) {
+bool DrasculaEngine::room_59(int fl) {
+ if ((pickedObject == kVerbTalk && fl == 51) || (pickedObject == kVerbLook && fl == 51)) {
flags[9] = 1;
- talk(_text[_lang][259], "259.als");
- talk_bj_cama(_textbj[_lang][13], "bj13.als");
- talk(_text[_lang][263], "263.als");
- talk_bj_cama(_textbj[_lang][14], "bj14.als");
+ talk(259);
+ talk_bj_bed(13);
+ talk(263);
+ talk_bj_bed(14);
pause(40);
- talk(_text[_lang][264], "264.als");
- talk_bj_cama(_textbj[_lang][15], "BJ15.als");
- talk(_text[_lang][265], "265.als");
+ talk(264);
+ talk_bj_bed(15);
+ talk(265);
flags[9] = 0;
if (flags[11] == 0) {
- comienza_sound("s12.als");
+ playSound(12);
delay(40);
- fin_sound();
+ finishSound();
delay(10);
- lleva_al_hare(174, 168);
- sentido_hare = 2;
+ gotoObject(174, 168);
+ trackProtagonist = 2;
updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateScreen();
pause(40);
- comienza_sound("s12.als");
+ playSound(12);
pause(19);
- fin_sound_corte();
+ stopSound();
hare_se_ve = 0;
updateRoom();
- copyRect(101, 34, hare_x - 4, hare_y - 1, 37, 70, dir_dibujo3, dir_zona_pantalla);
- copyBackground(0, 0, 0, 0, 320, 200, dir_zona_pantalla, dir_dibujo1);
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ copyRect(101, 34, curX - 4, curY - 1, 37, 70, drawSurface3, screenSurface);
+ copyBackground(0, 0, 0, 0, 320, 200, screenSurface, bgSurface);
+ updateScreen();
hare_se_ve = 1;
clearRoom();
- loadPic("tlef0.alg");
- decompressPic(dir_dibujo1, COMPLETA);
- loadPic("tlef1.alg");
- decompressPic(dir_dibujo3, 1);
- loadPic("tlef2.alg");
- decompressPic(dir_hare_frente, 1);
- loadPic("tlef3.alg");
- decompressPic(dir_hare_fondo, 1);
- talk_htel(_text[_lang][240], "240.als");
-
- color_abc(VON_BRAUN);
+ loadPic("tlef0.alg", bgSurface, COMPLETE_PAL);
+ loadPic("tlef1.alg", drawSurface3);
+ loadPic("tlef2.alg", frontSurface);
+ loadPic("tlef3.alg", backSurface);
+ talk_htel(240);
+
+ color_abc(kColorBrown);
talk_solo(_textvb[_lang][58], "VB58.als");
- talk_htel(_text[_lang][241], "241.als");
- color_abc(VON_BRAUN);
+ talk_htel(241);
+ color_abc(kColorBrown);
talk_solo(_textvb[_lang][59], "VB59.als");
- talk_htel(_text[_lang][242], "242.als");
- color_abc(VON_BRAUN);
+ talk_htel(242);
+ color_abc(kColorBrown);
talk_solo(_textvb[_lang][60], "VB60.als");
- talk_htel(_text[_lang][196], "196.als");
- color_abc(VON_BRAUN);
+ talk_htel(196);
+ color_abc(kColorBrown);
talk_solo(_textvb[_lang][61],"VB61.als");
- talk_htel(_text[_lang][244], "244.als");
- color_abc(VON_BRAUN);
+ talk_htel(244);
+ color_abc(kColorBrown);
talk_solo(_textvb[_lang][62], "VB62.als");
clearRoom();
- loadPic("aux59.alg");
- decompressPic(dir_dibujo3, 1);
- loadPic("96.alg");
- decompressPic(dir_hare_frente, COMPLETA);
- loadPic("99.alg");
- decompressPic(dir_hare_fondo, 1);
- loadPic("59.alg");
- decompressPic(dir_dibujo1, MEDIA);
- sentido_hare = 3;
- talk(_text[_lang][245], "245.als");
- sin_verbo();
+ loadPic("aux59.alg", drawSurface3);
+ loadPic(96, frontSurface, COMPLETE_PAL);
+ loadPic(99, backSurface);
+ loadPic(59, bgSurface, HALF_PAL);
+ trackProtagonist = 3;
+ talk(245);
+ withoutVerb();
flags[11] = 1;
}
} else
- hay_respuesta = 0;
+ hasAnswer = 0;
+
+ return true;
}
bool DrasculaEngine::room_60(int fl) {
- if (objeto_que_lleva == MOVE && fl == 112)
+ if (pickedObject == kVerbMove && fl == 112)
animation_10_6();
- else if (objeto_que_lleva == LOOK && fl == 112)
- talk(_text[_lang][440], "440.als");
- else if (objeto_que_lleva == TALK && fl == 52) {
- talk(_text[_lang][266], "266.als");
- talk_taber2(_textt[_lang][1], "t1.als");
- conversa("op_12.cal");
- sin_verbo();
- objeto_que_lleva = 0;
- } else if (objeto_que_lleva == TALK && fl == 115)
- talk(_text[_lang][455], "455.als");
- else if (objeto_que_lleva == TALK && fl == 56)
- talk(_text[_lang][455], "455.als");
- else if (objeto_que_lleva == LOOK && fl == 114)
- talk(_text[_lang][167], "167.als");
- else if (objeto_que_lleva == LOOK && fl == 113)
- talk(_text[_lang][168], "168.als");
- else if (objeto_que_lleva == PICK && fl == 113)
- talk(_text[_lang][170], "170.als");
- else if (objeto_que_lleva == MOVE && fl == 113)
- talk(_text[_lang][170], "170.als");
- else if (objeto_que_lleva == TALK && fl == 113)
- talk(_text[_lang][169], "169.als");
- else if (objeto_que_lleva == 21 && fl == 56)
+ else if (pickedObject == kVerbTalk && fl == 52) {
+ talk(266);
+ talk_bartender(1, 1);
+ converse(12);
+ withoutVerb();
+ pickedObject = 0;
+ } else if (pickedObject == 21 && fl == 56)
animation_18_6();
- else if (objeto_que_lleva == 9 && fl == 56 && flags[6] == 1) {
+ else if (pickedObject == 9 && fl == 56 && flags[6] == 1) {
animation_9_6();
return true;
- } else if (objeto_que_lleva == 9 && fl == 56 && flags[6] == 0) {
- anima("cnf.bin", 14);
- talk(_text[_lang][455], "455.als");
+ } else if (pickedObject == 9 && fl == 56 && flags[6] == 0) {
+ animate("cnf.bin", 14);
+ talk(455);
} else
- hay_respuesta = 0;
+ hasAnswer = 0;
return false;
}
-void DrasculaEngine::room_61(int fl) {
- if (objeto_que_lleva == LOOK && fl == 116)
- talk(_text[_lang][172], "172.als");
- else if (objeto_que_lleva == LOOK && fl == 117)
- talk(_text[_lang][173], "173.als");
- else if (objeto_que_lleva == MOVE && fl == 117)
- talk(_text[_lang][174], "174.als");
- else if (objeto_que_lleva == OPEN && fl == 117)
- talk(_text[_lang][174], "174.als");
- else
- hay_respuesta = 0;
-}
-
-void DrasculaEngine::room_62(int fl) {
- if (objeto_que_lleva == TALK && fl == 53)
- conversa("op_13.cal");
- else if (objeto_que_lleva == TALK && fl == 52 && flags[0] == 0)
+bool DrasculaEngine::room_62(int fl) {
+ if (pickedObject == kVerbTalk && fl == 53)
+ converse(13);
+ else if (pickedObject == kVerbTalk && fl == 52 && flags[0] == 0)
animation_3_1();
- else if (objeto_que_lleva == TALK && fl == 52 && flags[0] == 1)
- talk(_text[_lang][109], "109.als");
- else if (objeto_que_lleva == TALK && fl == 54)
+ else if (pickedObject == kVerbTalk && fl == 52 && flags[0] == 1)
+ talk(109);
+ else if (pickedObject == kVerbTalk && fl == 54)
animation_4_1();
- else if (objeto_que_lleva == LOOK && fl == 100)
- talk(_text[_lang][168], "168.als");
- else if (objeto_que_lleva == TALK && fl == 100)
- talk(_text[_lang][169], "169.als");
- else if (objeto_que_lleva == PICK && fl == 100)
- talk(_text[_lang][170], "170.als");
- else if (objeto_que_lleva == LOOK && fl == 101)
- talk(_text[_lang][171], "171.als");
- else if (objeto_que_lleva == LOOK && fl == 102)
- talk(_text[_lang][167], "167.als");
- else if (objeto_que_lleva == LOOK && fl == 103)
- talk(_text[_lang][166], "166.als");
- else hay_respuesta = 0;
-}
-
-void DrasculaEngine::room_63(int fl) {
- if (objeto_que_lleva == LOOK && fl == 110)
- talk(_text[_lang][172], "172.als");
- else if (objeto_que_lleva == LOOK && fl == 109)
- talk(_text[_lang][173], "173.als");
- else if (objeto_que_lleva == MOVE && fl == 109)
- talk(_text[_lang][174], "174.als");
- else if (objeto_que_lleva == LOOK && fl == 108)
- talk(_text[_lang][334], "334.als");
- else if (objeto_que_lleva == TALK && fl == 108)
- talk(_text[_lang][333], "333.als");
else
- hay_respuesta = 0;
+ hasAnswer = 0;
+
+ return true;
}
-void DrasculaEngine::room_pendulo(int fl) {
- if (objeto_que_lleva == LOOK && fl == 100)
- talk(_text[_lang][452], "452.als");
- else if (objeto_que_lleva == LOOK && fl == 101)
- talk (_text[_lang][123], "123.als");
- else if (objeto_que_lleva == PICK && fl == 101)
- agarra_objeto(20);
- else if (objeto_que_lleva == 20 && fl == 100)
+bool DrasculaEngine::room_102(int fl) {
+ if (pickedObject == kVerbPick && fl == 101)
+ pickObject(20);
+ else if (pickedObject == 20 && fl == 100)
animation_6_6();
- else if (objeto_que_lleva == PICK || objeto_que_lleva == OPEN)
- talk(_text[_lang][453], "453.als");
+ else if (pickedObject == kVerbPick || pickedObject == kVerbOpen)
+ talk(453);
else
- hay_respuesta = 0;
+ hasAnswer = 0;
+
+ return true;
}
void DrasculaEngine::updateRefresh() {
- if (num_ejec == 1) {
- if (!strcmp(num_room, "63.alg"))
- update_63();
- else if (!strcmp(num_room, "62.alg"))
- update_62();
- } else if (num_ejec == 2) {
- if (!strcmp(num_room, "3.alg"))
- update_3();
- else if (!strcmp(num_room, "2.alg"))
- update_2();
- else if (!strcmp(num_room, "4.alg"))
- update_4();
- else if (!strcmp(num_room, "5.alg"))
- update_5();
- else if (!strcmp(num_room, "15.alg"))
- update_15();
- else if (!strcmp(num_room, "17.alg"))
- update_17();
- else if (!strcmp(num_room, "18.alg"))
- update_18();
- else if (!strcmp(num_room, "10.alg"))
- mapa();
- } else if (num_ejec == 3) {
- if (!strcmp(num_room, "20.alg"))
- update_20();
- else if (!strcmp(num_room, "13.alg"))
- update_13();
- } else if (num_ejec == 4) {
- if (!strcmp(num_room, "29.alg"))
- update_29();
- else if (!strcmp(num_room, "26.alg"))
- update_26();
- else if (!strcmp(num_room, "27.alg"))
- update_27();
- else if (!strcmp(num_room, "31.alg"))
- update_31();
- else if (!strcmp(num_room, "34.alg"))
- update_34();
- else if (!strcmp(num_room, "35.alg"))
- update_35();
- } else if (num_ejec == 5) {
- if (!strcmp(num_room, "45.alg"))
- mapa();
- else if (!strcmp(num_room, "50.alg"))
- update_50();
- else if (!strcmp(num_room, "57.alg"))
- update_57();
- } else if (num_ejec == 6) {
- if (!strcmp(num_room, "60.alg"))
- update_60();
- else if (!strcmp(num_room, "61.alg"))
- update_61();
- else if (!strcmp(num_room, "58.alg"))
- update_58();
+ // Check generic updaters
+ for (int i = 0; i < _roomUpdatesSize; i++) {
+ if (_roomUpdates[i].roomNum == roomNumber) {
+ if (_roomUpdates[i].flag < 0 ||
+ flags[_roomUpdates[i].flag] == _roomUpdates[i].flagValue) {
+ if (_roomUpdates[i].type == 0) {
+ copyBackground(_roomUpdates[i].sourceX, _roomUpdates[i].sourceY,
+ _roomUpdates[i].destX, _roomUpdates[i].destY,
+ _roomUpdates[i].width, _roomUpdates[i].height,
+ drawSurface3, screenSurface);
+ } else {
+ copyRect(_roomUpdates[i].sourceX, _roomUpdates[i].sourceY,
+ _roomUpdates[i].destX, _roomUpdates[i].destY,
+ _roomUpdates[i].width, _roomUpdates[i].height,
+ drawSurface3, screenSurface);
+ }
+ }
+ }
}
+
+ // Call room-specific updater
+ char rm[20];
+ sprintf(rm, "update_%d", roomNumber);
+ for (uint i = 0; i < _roomUpdaters.size(); i++) {
+ if (!strcmp(rm, _roomUpdaters[i]->desc)) {
+ debug(4, "Calling room updater %d", roomNumber);
+ (this->*(_roomUpdaters[i]->proc))();
+ break;
+ }
+ }
+
+ if (roomNumber == 10)
+ showMap();
+ else if (roomNumber == 45)
+ showMap();
}
void DrasculaEngine::updateRefresh_pre() {
- if (num_ejec == 1) {
- if (!strcmp(num_room, "62.alg"))
- update_62_pre();
- else if (!strcmp(num_room, "16.alg"))
- pon_bj();
- } else if (num_ejec == 2) {
- if (!strcmp(num_room, "1.alg"))
- update_1_pre();
- else if (!strcmp(num_room, "3.alg"))
- update_3_pre();
- else if (!strcmp(num_room, "5.alg"))
- update_5_pre();
- else if (!strcmp(num_room, "6.alg"))
- update_6_pre();
- else if (!strcmp(num_room, "7.alg"))
- update_7_pre();
- else if (!strcmp(num_room, "9.alg"))
- update_9_pre();
- else if (!strcmp(num_room, "12.alg"))
- update_12_pre();
- else if (!strcmp(num_room, "14.alg"))
- update_14_pre();
- else if (!strcmp(num_room, "16.alg"))
- update_16_pre();
- else if (!strcmp(num_room, "17.alg"))
- update_17_pre();
- else if (!strcmp(num_room, "18.alg"))
- update_18_pre();
- } else if (num_ejec == 3) {
- // nothing
- } else if (num_ejec == 4) {
- if (!strcmp(num_room, "21.alg"))
- update_21_pre();
- else if (!strcmp(num_room, "22.alg"))
- update_22_pre();
- else if (!strcmp(num_room, "23.alg"))
- update_23_pre();
- else if (!strcmp(num_room, "24.alg"))
- update_24_pre();
- else if (!strcmp(num_room, "26.alg"))
- update_26_pre();
- else if (!strcmp(num_room, "27.alg"))
- update_27_pre();
- else if (!strcmp(num_room, "29.alg"))
- update_29_pre();
- else if (!strcmp(num_room, "30.alg"))
- update_30_pre();
- else if (!strcmp(num_room, "31.alg"))
- update_31_pre();
- else if (!strcmp(num_room, "34.alg"))
- update_34_pre();
- else if (!strcmp(num_room, "35.alg"))
- update_35_pre();
- } else if (num_ejec == 5) {
- if (!strcmp(num_room,"49.alg"))
- update_49_pre();
- else if (!strcmp(num_room,"53.alg"))
- update_53_pre();
- else if (!strcmp(num_room,"54.alg"))
- update_54_pre();
- else if (!strcmp(num_room,"56.alg"))
- update_56_pre();
- } else if (num_ejec == 6) {
- if (!strcmp(num_room, "102.alg"))
- update_pendulo();
- else if (!strcmp(num_room, "58.alg"))
- update_58_pre();
- else if (!strcmp(num_room, "59.alg"))
- update_59_pre();
- else if (!strcmp(num_room, "60.alg"))
- update_60_pre();
+ // Check generic preupdaters
+ for (int i = 0; i < _roomPreUpdatesSize; i++) {
+ if (_roomPreUpdates[i].roomNum == roomNumber) {
+ if (_roomPreUpdates[i].flag < 0 ||
+ flags[_roomPreUpdates[i].flag] == _roomPreUpdates[i].flagValue) {
+ if (_roomPreUpdates[i].type == 0) {
+ copyBackground(_roomPreUpdates[i].sourceX, _roomPreUpdates[i].sourceY,
+ _roomPreUpdates[i].destX, _roomPreUpdates[i].destY,
+ _roomPreUpdates[i].width, _roomPreUpdates[i].height,
+ drawSurface3, screenSurface);
+ } else {
+ copyRect(_roomPreUpdates[i].sourceX, _roomPreUpdates[i].sourceY,
+ _roomPreUpdates[i].destX, _roomPreUpdates[i].destY,
+ _roomPreUpdates[i].width, _roomPreUpdates[i].height,
+ drawSurface3, screenSurface);
+ }
+ }
+ }
}
-}
-void DrasculaEngine::update_1_pre() {
- int cambio_col_antes = cambio_de_color;
+ // Call room-specific preupdater
+ char rm[20];
+ sprintf(rm, "update_%d_pre", roomNumber);
+ for (uint i = 0; i < _roomPreupdaters.size(); i++) {
+ if (!strcmp(rm, _roomPreupdaters[i]->desc)) {
+ debug(4, "Calling room preupdater %d", roomNumber);
+ (this->*(_roomPreupdaters[i]->proc))();
+ break;
+ }
+ }
- if (hare_x > 98 && hare_x < 153)
- cambio_de_color = 1;
- else
- cambio_de_color = 0;
+ if (currentChapter == 1 && roomNumber == 16)
+ placeBJ();
+}
- if (cambio_col_antes != cambio_de_color && cambio_de_color == 1)
- hare_oscuro();
- if (cambio_col_antes != cambio_de_color && cambio_de_color == 0)
- hare_claro();
+void DrasculaEngine::update_1_pre() {
+ if (curX > 98 && curX < 153) {
+ changeColor = 1;
+ setDarkPalette();
+ } else {
+ changeColor = 0;
+ setBrightPalette();
+ }
if (flags[8] == 0)
- copyBackground(2, 158, 208, 67, 27, 40, dir_dibujo3, dir_zona_pantalla);
+ copyBackground(2, 158, 208, 67, 27, 40, drawSurface3, screenSurface);
}
-void DrasculaEngine::update_2(){
- int pos_murci[6];
- int diferencia;
- int murci_x[] = {0, 38, 76, 114, 152, 190, 228, 266,
+void DrasculaEngine::update_2() {
+ int batPos[6];
+ int difference;
+ int batX[] = {0, 38, 76, 114, 152, 190, 228, 266,
0, 38, 76, 114, 152, 190, 228, 266,
0, 38, 76, 114, 152, 190,
0, 48, 96, 144, 192, 240,
@@ -1471,7 +1111,7 @@ void DrasculaEngine::update_2(){
88, 146, 204, 262,
88, 146, 204, 262};
- int murci_y[] = {179, 179, 179, 179, 179, 179, 179, 179,
+ int batY[] = {179, 179, 179, 179, 179, 179, 179, 179,
158, 158, 158, 158, 158, 158, 158, 158,
137, 137, 137, 137, 137, 137,
115, 115, 115, 115, 115, 115,
@@ -1479,557 +1119,959 @@ void DrasculaEngine::update_2(){
41, 41, 41, 41,
4, 4, 4, 4};
- if (frame_murcielago == 41)
- frame_murcielago = 0;
+ if (actorFrames[kFrameBat] == 41)
+ actorFrames[kFrameBat] = 0;
- pos_murci[0] = murci_x[frame_murcielago];
- pos_murci[1] = murci_y[frame_murcielago];
+ batPos[0] = batX[actorFrames[kFrameBat]];
+ batPos[1] = batY[actorFrames[kFrameBat]];
- if (frame_murcielago < 22) {
- pos_murci[4] = 37;
- pos_murci[5] = 21;
- } else if (frame_murcielago > 27) {
- pos_murci[4] = 57;
- pos_murci[5] = 36;
+ if (actorFrames[kFrameBat] < 22) {
+ batPos[4] = 37;
+ batPos[5] = 21;
+ } else if (actorFrames[kFrameBat] > 27) {
+ batPos[4] = 57;
+ batPos[5] = 36;
} else {
- pos_murci[4] = 47;
- pos_murci[5] = 22;
+ batPos[4] = 47;
+ batPos[5] = 22;
}
- pos_murci[2] = 239;
- pos_murci[3] = 19;
+ batPos[2] = 239;
+ batPos[3] = 19;
- copyRectClip(pos_murci, dir_dibujo3, dir_zona_pantalla);
- diferencia = vez() - conta_ciego_vez;
- if (diferencia >= 6) {
- frame_murcielago++;
- conta_ciego_vez = vez();
+ copyRectClip(batPos, drawSurface3, screenSurface);
+ difference = getTime() - savedTime;
+ if (difference >= 6) {
+ actorFrames[kFrameBat]++;
+ savedTime = getTime();
}
- copyRect(29, 37, 58, 114, 57, 39, dir_dibujo3, dir_zona_pantalla);
- mapa();
-}
-
-void DrasculaEngine::update_3_pre() {
- if (flags[3] == 1)
- copyBackground(258, 110, 85, 44, 23, 53, dir_dibujo3, dir_zona_pantalla);
+ copyRect(29, 37, 58, 114, 57, 39, drawSurface3, screenSurface);
+ showMap();
}
void DrasculaEngine::update_3() {
- if (hare_y + alto_hare < 118)
- copyRect(129, 110, 194, 36, 126, 88, dir_dibujo3, dir_zona_pantalla);
- copyRect(47, 57, 277, 143, 43, 50, dir_dibujo3, dir_zona_pantalla);
+ if (curY + curHeight < 118)
+ copyRect(129, 110, 194, 36, 126, 88, drawSurface3, screenSurface);
+ copyRect(47, 57, 277, 143, 43, 50, drawSurface3, screenSurface);
}
void DrasculaEngine::update_4() {
- int cambio_col_antes = cambio_de_color;
- if (hare_x > 190)
- cambio_de_color = 1;
- else
- cambio_de_color = 0;
-
- if (cambio_col_antes != cambio_de_color && cambio_de_color == 1)
- hare_oscuro();
- if (cambio_col_antes != cambio_de_color && cambio_de_color == 0)
- hare_claro();
-}
-
-void DrasculaEngine::update_5_pre(){
- if (flags[8] == 0)
- copyBackground(256, 152, 208, 67, 27, 40, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::update_5() {
- copyRect(114, 130, 211, 87, 109, 69, dir_dibujo3, dir_zona_pantalla);
+ if (curX > 190) {
+ changeColor = 1;
+ setDarkPalette();
+ } else {
+ changeColor = 0;
+ setBrightPalette();
+ }
}
void DrasculaEngine::update_6_pre() {
- int cambio_col_antes = cambio_de_color;
-
- if ((hare_x > 149 && hare_y + alto_hare > 160 && hare_x < 220 && hare_y + alto_hare < 188) ||
- (hare_x > 75 && hare_y + alto_hare > 183 && hare_x < 145))
- cambio_de_color = 0;
- else
- cambio_de_color = 1;
-
- if (cambio_col_antes != cambio_de_color && cambio_de_color == 1)
- hare_oscuro();
- if (cambio_col_antes != cambio_de_color && cambio_de_color == 0)
- hare_claro();
-
- if (flags[1] == 0)
- copyBackground(97, 117, 34, 148, 36, 31, dir_dibujo3, dir_zona_pantalla);
- if (flags[0] == 0)
- copyBackground(3, 103, 185, 69, 23, 76, dir_dibujo3, dir_zona_pantalla);
- if (flags[2] == 0)
- copyBackground(28, 100, 219, 72, 64, 97, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::update_7_pre() {
- if (flags[35] == 0)
- copyBackground(1, 72, 158, 162, 19, 12, dir_dibujo3, dir_zona_pantalla);
+ if ((curX > 149 && curY + curHeight > 160 && curX < 220 && curY + curHeight < 188) ||
+ (curX > 75 && curY + curHeight > 183 && curX < 145)) {
+ changeColor = 0;
+ setBrightPalette();
+ } else {
+ changeColor = 1;
+ setDarkPalette();
+ }
}
void DrasculaEngine::update_9_pre() {
- int ciego_x[] = {26, 68, 110, 152, 194, 236, 278, 26, 68};
- int ciego_y[] = {51, 51, 51, 51, 51, 51, 51, 127, 127};
- int diferencia;
+ int blindX[] = {26, 68, 110, 152, 194, 236, 278, 26, 68};
+ int blindY[] = {51, 51, 51, 51, 51, 51, 51, 127, 127};
+ int difference;
- copyRect(ciego_x[frame_ciego], ciego_y[frame_ciego], 122, 57, 41, 72, dir_dibujo3, dir_zona_pantalla);
+ copyRect(blindX[actorFrames[kFrameBlind]], blindY[actorFrames[kFrameBlind]],
+ 122, 57, 41, 72, drawSurface3, screenSurface);
if (flags[9] == 0) {
- diferencia = vez() - conta_ciego_vez;
- if (diferencia >= 11) {
- frame_ciego++;
- conta_ciego_vez = vez();
+ difference = getTime() - savedTime;
+ if (difference >= 11) {
+ actorFrames[kFrameBlind]++;
+ savedTime = getTime();
}
- if (frame_ciego == 9)
- frame_ciego = 0;
+ if (actorFrames[kFrameBlind] == 9)
+ actorFrames[kFrameBlind] = 0;
} else
- frame_ciego = 3;
-}
-
-void DrasculaEngine::update_12_pre() {
- if (flags[16] == 0)
- copyBackground(1, 131, 106, 117, 55, 68, dir_dibujo3, dir_zona_pantalla);
+ actorFrames[kFrameBlind] = 3;
}
void DrasculaEngine::update_13() {
- if (hare_x > 55 && flags[3] == 0)
+ if (curX > 55 && flags[3] == 0)
animation_6_3();
+ // These cannot be placed in an array, as they're between screen updates
if (flags[1] == 0)
- copyRect(185, 110, 121, 65, 67, 88, dir_dibujo3, dir_zona_pantalla);
+ copyRect(185, 110, 121, 65, 67, 88, drawSurface3, screenSurface);
if (flags[2] == 0)
- copyRect(185, 21, 121, 63, 67, 88, dir_dibujo3, dir_zona_pantalla);
- copyRect(3, 127, 99, 102, 181, 71, dir_dibujo3, dir_zona_pantalla);
+ copyRect(185, 21, 121, 63, 67, 88, drawSurface3, screenSurface);
+ copyRect(3, 127, 99, 102, 181, 71, drawSurface3, screenSurface);
}
void DrasculaEngine::update_14_pre() {
- int velas_y[] = {158, 172, 186};
- int cirio_x[] = {14, 19, 24};
- int pianista_x[] = {1, 91, 61, 31, 91, 31, 1, 61, 31};
- int borracho_x[] = {1, 42, 83, 124, 165, 206, 247, 1};
- int diferencia;
-
- copyBackground(123, velas_y[frame_velas], 142, 14, 39, 13, dir_dibujo3, dir_zona_pantalla);
- copyBackground(cirio_x[frame_velas], 146, 311, 80, 4, 8, dir_dibujo3, dir_zona_pantalla);
-
- if (parpadeo == 5)
- copyBackground(1, 149, 127, 52, 9, 5, dir_dibujo3, dir_zona_pantalla);
- if (hare_x > 101 && hare_x < 155)
- copyBackground(31, 138, 178, 51, 18, 16, dir_dibujo3, dir_zona_pantalla);
+ int difference;
+
+ copyBackground(123, _candleY[actorFrames[kFrameCandles]], 142, 14, 39, 13, drawSurface3, screenSurface);
+ copyBackground(_candleX[actorFrames[kFrameCandles]], 146, 311, 80, 4, 8, drawSurface3, screenSurface);
+
+ if (blinking == 5)
+ copyBackground(1, 149, 127, 52, 9, 5, drawSurface3, screenSurface);
+ if (curX > 101 && curX < 155)
+ copyBackground(31, 138, 178, 51, 18, 16, drawSurface3, screenSurface);
if (flags[11] == 0)
- copyBackground(pianista_x[frame_piano], 157, 245, 130, 29, 42, dir_dibujo3, dir_zona_pantalla);
+ copyBackground(_pianistX[actorFrames[kFramePianist]], 157, 245, 130, 29, 42, drawSurface3, screenSurface);
else if (flags[5] == 0)
- copyBackground(145, 139, 228, 112, 47, 60, dir_hare_dch, dir_zona_pantalla);
+ copyBackground(145, 139, 228, 112, 47, 60, extraSurface, screenSurface);
else
- copyBackground(165, 140, 229, 117, 43, 59, dir_dibujo3, dir_zona_pantalla);
+ copyBackground(165, 140, 229, 117, 43, 59, drawSurface3, screenSurface);
if (flags[12] == 1)
- copyBackground(borracho_x[frame_borracho], 82, 170, 50, 40, 53, dir_dibujo3, dir_zona_pantalla);
- diferencia = vez() - conta_ciego_vez;
- if (diferencia > 6) {
+ copyBackground(_drunkX[actorFrames[kFrameDrunk]], 82, 170, 50, 40, 53, drawSurface3, screenSurface);
+ difference = getTime() - savedTime;
+ if (difference > 6) {
if (flags[12] == 1) {
- frame_borracho++;
- if (frame_borracho == 8) {
- frame_borracho = 0;
+ actorFrames[kFrameDrunk]++;
+ if (actorFrames[kFrameDrunk] == 8) {
+ actorFrames[kFrameDrunk] = 0;
flags[12] = 0;
}
} else if ((_rnd->getRandomNumber(94) == 15) && (flags[13] == 0))
flags[12] = 1;
- frame_velas++;
- if (frame_velas == 3)
- frame_velas = 0;
- frame_piano++;
- if (frame_piano == 9)
- frame_piano = 0;
- parpadeo = _rnd->getRandomNumber(10);
- conta_ciego_vez = vez();
+ actorFrames[kFrameCandles]++;
+ if (actorFrames[kFrameCandles] == 3)
+ actorFrames[kFrameCandles] = 0;
+ actorFrames[kFramePianist]++;
+ if (actorFrames[kFramePianist] == 9)
+ actorFrames[kFramePianist] = 0;
+ blinking = _rnd->getRandomNumber(10);
+ savedTime = getTime();
}
}
-void DrasculaEngine::update_15() {
- copyRect(1, 154, 83, 122, 131, 44, dir_dibujo3, dir_zona_pantalla);
-}
-
void DrasculaEngine::update_16_pre() {
+ if (currentChapter != 2) {
+ debug(4, "update_16_pre: Special case, current chapter is not 2, not performing update");
+ return;
+ }
+
if (flags[17] == 0)
- copyBackground(1, 103, 24, 72, 33, 95, dir_dibujo3, dir_zona_pantalla);
+ copyBackground(1, 103, 24, 72, 33, 95, drawSurface3, screenSurface);
if (flags[19] == 1)
- copyBackground(37, 151, 224, 115, 56, 47, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::update_17_pre() {
- if (flags[15] == 1)
- copyBackground(1, 135, 108, 65, 44, 63, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::update_17() {
- copyRect(48, 135, 78, 139, 80, 30, dir_dibujo3, dir_zona_pantalla);
+ copyBackground(37, 151, 224, 115, 56, 47, drawSurface3, screenSurface);
}
void DrasculaEngine::update_18_pre() {
- int diferencia;
- int ronquido_x[] = {95, 136, 95, 136, 95, 95, 95, 95, 136, 95, 95, 95, 95, 95, 95, 95};
- int ronquido_y[] = {18, 18, 56, 56, 94, 94, 94, 94, 94, 18, 18, 18, 18, 18, 18, 18};
+ int difference;
+ int snore_x[] = {95, 136, 95, 136, 95, 95, 95, 95, 136, 95, 95, 95, 95, 95, 95, 95};
+ int snore_y[] = {18, 18, 56, 56, 94, 94, 94, 94, 94, 18, 18, 18, 18, 18, 18, 18};
if (flags[21] == 0) {
- copyBackground(1, 69, 120, 58, 56, 61, dir_dibujo3, dir_zona_pantalla);
- copyBackground(ronquido_x[frame_ronquido], ronquido_y[frame_ronquido], 124, 59, 40, 37, dir_dibujo3, dir_zona_pantalla);
+ copyBackground(1, 69, 120, 58, 56, 61, drawSurface3, screenSurface);
+ copyBackground(snore_x[actorFrames[kFrameSnore]],
+ snore_y[actorFrames[kFrameSnore]],
+ 124, 59, 40, 37, drawSurface3, screenSurface);
} else
- pon_vb();
-
- diferencia = vez() - conta_ciego_vez;
- if (diferencia > 9) {
- frame_ronquido++;
- if (frame_ronquido == 16)
- frame_ronquido = 0;
- conta_ciego_vez = vez();
+ moveVonBraun();
+
+ difference = getTime() - savedTime;
+ if (difference > 9) {
+ actorFrames[kFrameSnore]++;
+ if (actorFrames[kFrameSnore] == 16)
+ actorFrames[kFrameSnore] = 0;
+ savedTime = getTime();
}
}
-void DrasculaEngine::update_18() {
- if (flags[24] == 1)
- copyRect(177, 1, 69, 29, 142, 130, dir_dibujo3, dir_zona_pantalla);
- copyRect(105, 132, 109, 108, 196, 65, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::update_20() {
- copyRect(1, 137, 106, 121, 213, 61, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::update_21_pre() {
- if (flags[0] == 1)
- copyBackground(2, 171, 84, 126, 17, 26, dir_dibujo3, dir_zona_pantalla);
-
- if (flags[10] == 1)
- copyBackground(20, 163, 257, 149, 14, 34, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::update_22_pre() {
- if (flags[24] == 1)
- copyBackground(2, 187, 107, 106, 62, 12, dir_dibujo3, dir_zona_pantalla);
-
- if (flags[27] == 0)
- copyBackground(32, 181, 203, 88, 13, 5, dir_dibujo3, dir_zona_pantalla);
-
- if (flags[26] == 0)
- copyBackground(2, 133, 137, 83, 29, 53, dir_dibujo3, dir_zona_pantalla);
- else
- copyBackground(65, 174, 109, 145, 55, 25, dir_dibujo3, dir_zona_pantalla);
-}
-
void DrasculaEngine::update_23_pre() {
if (flags[11] == 1 && flags[0] == 0)
- copyBackground(87, 171, 237, 110, 20, 28, dir_dibujo3, dir_zona_pantalla);
+ copyBackground(87, 171, 237, 110, 20, 28, drawSurface3, screenSurface);
+ // It might be possible to put these in an array, though I'm a bit unsure
+ // of the draw order
if (flags[0] == 1)
- copyBackground(29, 126, 239, 94, 57, 73, dir_dibujo3, dir_zona_pantalla);
+ copyBackground(29, 126, 239, 94, 57, 73, drawSurface3, screenSurface);
if (flags[1] == 1)
- copyRect(1, 135, 7, 94, 27, 64, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::update_24_pre() {
- if (flags[1] == 1)
- copyBackground(1, 163, 225, 124, 12, 36, dir_dibujo3, dir_zona_pantalla);
-
- if (flags[2] == 1)
- copyBackground(14, 153, 30, 107, 23, 46, dir_dibujo3, dir_zona_pantalla);
+ copyRect(1, 135, 7, 94, 27, 64, drawSurface3, screenSurface);
}
void DrasculaEngine::update_26_pre() {
- int diferencia;
-
- if (flags[2] == 1)
- copyBackground(1, 130, 87, 44, 50, 69, dir_dibujo3, dir_zona_pantalla);
+ int difference;
- if (flags[12] == 1)
- copyBackground(52, 177, 272, 103, 27, 22, dir_dibujo3, dir_zona_pantalla);
-
- if (flags[18] == 0)
- copyBackground(80, 133, 199, 95, 50, 66, dir_dibujo3, dir_zona_pantalla);
-
- if (parpadeo == 5 && flags[18] == 0)
- copyBackground(52, 172, 226, 106, 3, 4, dir_dibujo3, dir_zona_pantalla);
+ if (blinking == 5 && flags[18] == 0)
+ copyBackground(52, 172, 226, 106, 3, 4, drawSurface3, screenSurface);
- diferencia = vez() - conta_ciego_vez;
- if (diferencia >= 10) {
- parpadeo = _rnd->getRandomNumber(10);
- conta_ciego_vez = vez();
+ difference = getTime() - savedTime;
+ if (difference >= 10) {
+ blinking = _rnd->getRandomNumber(10);
+ savedTime = getTime();
}
if (flags[20] == 1)
- copyBackground(182, 133, 199, 95, 50, 66, dir_dibujo3, dir_zona_pantalla);
+ copyBackground(182, 133, 199, 95, 50, 66, drawSurface3, screenSurface);
}
void DrasculaEngine::update_26() {
if (flags[29] == 1)
- copyRect(93, 1, hare_x, hare_y, 45, 78, dir_hare_fondo, dir_zona_pantalla);
-
- copyRect(233, 107, 17, 102, 66, 92, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::update_27_pre() {
- if (flags[5] == 1)
- copyRect(1, 175, 59, 109, 17, 24, dir_dibujo3, dir_zona_pantalla);
-
- if (flags[6] == 1)
- copyRect(19, 177, 161, 103, 18, 22, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::update_27() {
- copyRect(38, 177, 103, 171, 21, 22, dir_dibujo3, dir_zona_pantalla);
- copyRect(60, 162, 228, 156, 18, 37, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::update_29_pre() {
- if (flags[4] == 1)
- copyBackground(12, 113, 247, 49, 41, 84, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::update_29() {
- copyRect(1, 180, 150, 126, 10, 17, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::update_30_pre() {
- if (flags[4] == 1)
- copyBackground(1, 148, 148, 66, 35, 51, dir_dibujo3, dir_zona_pantalla);
-
- if (flags[16] == 1)
- copyBackground(37, 173, 109, 84, 20, 26, dir_dibujo3, dir_zona_pantalla);
-}
+ copyRect(93, 1, curX, curY, 45, 78, backSurface, screenSurface);
-void DrasculaEngine::update_31_pre() {
- if (flags[13] == 1)
- copyBackground(1, 163, 116, 41, 61, 36, dir_dibujo3, dir_zona_pantalla);
-
- if (flags[5] == 1)
- copyBackground(1, 78, 245, 63, 30, 84, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::update_31() {
- copyRect(63, 190, 223, 157, 17, 9, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::update_34_pre() {
- if (flags[7] == 1)
- copyBackground(99, 127, 73, 41, 79, 72, dir_dibujo3, dir_zona_pantalla);
-
- if (flags[8] == 1)
- copyBackground(36, 129, 153, 41, 62, 65, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::update_34() {
- copyRect(5, 171, 234, 126, 29, 23, dir_dibujo3, dir_zona_pantalla);
+ copyRect(233, 107, 17, 102, 66, 92, drawSurface3, screenSurface);
}
void DrasculaEngine::update_35_pre() {
- if (flags[14] == 1)
- copyBackground(1, 86, 246, 65, 68, 87, dir_dibujo3, dir_zona_pantalla);
-
if (flags[17] == 0 && flags[15] == 1)
- copyBackground(111, 150, 118, 52, 40, 23, dir_dibujo3, dir_zona_pantalla);
-
- if (flags[17] == 1)
- copyBackground(70, 150, 118, 52, 40, 23, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::update_35() {
- copyRect(1, 174, 54, 152, 195, 25, dir_dibujo3, dir_zona_pantalla);
-}
-
-
-void DrasculaEngine::update_49_pre() {
- if (flags[6] == 0)
- copyBackground(2, 136, 176, 81, 49, 62, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::update_50() {
- copyRect(4, 153, 118, 95, 67, 44, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::update_53_pre() {
- if (flags[1] == 0)
- copyRect(2, 113, 205, 50, 38, 86, dir_dibujo3, dir_zona_pantalla);
- if (flags[2] == 0)
- copyBackground(41, 159, 27, 117, 25, 40, dir_dibujo3, dir_zona_pantalla);
- if (flags[9] == 1)
- copyBackground(67, 184, 56, 93, 32, 15, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::update_54_pre() {
- if (flags[5] == 1)
- copyBackground(168, 156, 187, 111, 7, 11, dir_dibujo3, dir_zona_pantalla);
- if (flags[12] == 1)
- copyBackground(16, 156, 190, 64, 18, 24, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::update_56_pre() {
- if (flags[10] == 0)
- copyBackground(2, 126, 42, 67, 57, 67, dir_dibujo3, dir_zona_pantalla);
- if (flags[11] == 1)
- copyBackground(60, 160, 128, 97, 103, 38, dir_dibujo3, dir_zona_pantalla);
-}
-
-void DrasculaEngine::update_57() {
- copyRect(7, 113, 166, 61, 62, 82, dir_dibujo3, dir_zona_pantalla);
+ copyBackground(111, 150, 118, 52, 40, 23, drawSurface3, screenSurface);
}
void DrasculaEngine::update_58_pre() {
- if (flags[0] == 0)
- copyBackground(1, 156, 143, 120, 120, 43, dir_dibujo3, dir_zona_pantalla);
- if (flags[1] == 2)
- copyRect(252, 171, 173, 116, 25, 28, dir_dibujo3, dir_zona_pantalla);
if (flags[1] == 0 && flags[0] == 0)
- copyRect(278, 171, 173, 116, 25, 28, dir_dibujo3, dir_zona_pantalla);
+ copyRect(278, 171, 173, 116, 25, 28, drawSurface3, screenSurface);
if (flags[2] == 0) {
- pon_igor();
- pon_dr();
+ placeIgor();
+ placeDrascula();
}
+ // Not possible to put these in an array, as there are other surfaces
+ // copied above
if (flags[3] == 1)
- copyRect(1, 29, 204, 0, 18, 125, dir_dibujo3, dir_zona_pantalla);
+ copyRect(1, 29, 204, 0, 18, 125, drawSurface3, screenSurface);
if (flags[8] == 1)
- copyBackground(20, 60, 30, 64, 46, 95, dir_dibujo3, dir_zona_pantalla);
+ copyBackground(20, 60, 30, 64, 46, 95, drawSurface3, screenSurface);
}
void DrasculaEngine::update_58() {
if (hare_se_ve == 1)
- copyRect(67, 139, 140, 147, 12, 16, dir_dibujo3, dir_zona_pantalla);
+ copyRect(67, 139, 140, 147, 12, 16, drawSurface3, screenSurface);
}
void DrasculaEngine::update_59_pre() {
- if (flags[4] == 0)
- copyRect(1, 146, 65, 106, 83, 40, dir_dibujo3, dir_zona_pantalla);
if (flags[9] == 1) {
- copyBackground(65, 103, 65, 103, 49, 38, dir_dibujo1, dir_zona_pantalla);
- copyRect(1, 105, 65, 103, 49, 38, dir_dibujo3, dir_zona_pantalla);
+ copyBackground(65, 103, 65, 103, 49, 38, bgSurface, screenSurface);
+ copyRect(1, 105, 65, 103, 49, 38, drawSurface3, screenSurface);
}
}
void DrasculaEngine::update_60_pre() {
- int velas_y[] = {158, 172, 186};
- int diferencia;
+ int difference;
if (flags[5] == 0)
- pon_dr();
+ placeDrascula();
- copyBackground(123, velas_y[frame_velas], 142, 14, 39, 13, dir_dibujo3, dir_zona_pantalla);
+ copyBackground(123, _candleY[actorFrames[kFrameCandles]], 142, 14, 39, 13, drawSurface3, screenSurface);
if (flag_tv == 1)
- copyBackground(114, 158, 8, 30, 8, 23, dir_dibujo3, dir_zona_pantalla);
+ copyBackground(114, 158, 8, 30, 8, 23, drawSurface3, screenSurface);
- diferencia = vez() - conta_ciego_vez;
- parpadeo = _rnd->getRandomNumber(7);
- if (parpadeo == 5 && flag_tv == 0)
+ difference = getTime() - savedTime;
+ blinking = _rnd->getRandomNumber(7);
+ if (blinking == 5 && flag_tv == 0)
flag_tv = 1;
- else if (parpadeo == 5 && flag_tv == 1)
+ else if (blinking == 5 && flag_tv == 1)
flag_tv = 0;
- if (diferencia > 6) {
- frame_velas++;
- if (frame_velas == 3)
- frame_velas = 0;
- conta_ciego_vez = vez();
+ if (difference > 6) {
+ actorFrames[kFrameCandles]++;
+ if (actorFrames[kFrameCandles] == 3)
+ actorFrames[kFrameCandles] = 0;
+ savedTime = getTime();
}
}
void DrasculaEngine::update_60() {
- if (hare_y - 10 < y_dr && flags[5] == 0)
- pon_dr();
-}
-
-void DrasculaEngine::update_61() {
- copyRect(1, 154, 83, 122, 131, 44, dir_dibujo3, dir_zona_pantalla);
+ if (curY - 10 < drasculaY && flags[5] == 0)
+ placeDrascula();
}
void DrasculaEngine::update_62_pre() {
- int velas_y[] = { 158, 172, 186 };
- int cirio_x[] = { 14, 19, 24 };
- int pianista_x[] = {1, 91, 61, 31, 91, 31, 1, 61, 31 };
- int borracho_x[] = {1, 42, 83, 124, 165, 206, 247, 1 };
- int diferencia;
+ int difference;
- copyBackground(123, velas_y[frame_velas], 142, 14, 39, 13, dir_dibujo3, dir_zona_pantalla);
- copyBackground(cirio_x[frame_velas], 146, 311, 80, 4, 8, dir_dibujo3, dir_zona_pantalla);
+ copyBackground(123, _candleY[actorFrames[kFrameCandles]], 142, 14, 39, 13, drawSurface3, screenSurface);
+ copyBackground(_candleX[actorFrames[kFrameCandles]], 146, 311, 80, 4, 8, drawSurface3, screenSurface);
- if (parpadeo == 5)
- copyBackground(1, 149, 127, 52, 9, 5, dir_dibujo3, dir_zona_pantalla);
+ if (blinking == 5)
+ copyBackground(1, 149, 127, 52, 9, 5, drawSurface3, screenSurface);
- if (hare_x > 101 && hare_x < 155)
- copyBackground(31, 138, 178, 51, 18, 16, dir_dibujo3, dir_zona_pantalla);
+ if (curX > 101 && curX < 155)
+ copyBackground(31, 138, 178, 51, 18, 16, drawSurface3, screenSurface);
if (flags[11] == 0)
- copyBackground(pianista_x[frame_piano], 157, 245, 130, 29, 42, dir_dibujo3, dir_zona_pantalla);
+ copyBackground(_pianistX[actorFrames[kFramePianist]], 157, 245, 130, 29, 42, drawSurface3, screenSurface);
else if (flags[5] == 0)
- copyBackground(145, 139, 228, 112, 47, 60, dir_hare_dch, dir_zona_pantalla);
+ copyBackground(145, 139, 228, 112, 47, 60, extraSurface, screenSurface);
else
- copyBackground(165, 140, 229, 117, 43, 59, dir_dibujo3, dir_zona_pantalla);
+ copyBackground(165, 140, 229, 117, 43, 59, drawSurface3, screenSurface);
if (flags[12] == 1)
- copyBackground(borracho_x[frame_borracho], 82, 170, 50, 40, 53, dir_dibujo3, dir_zona_pantalla);
+ copyBackground(_drunkX[actorFrames[kFrameDrunk]], 82, 170, 50, 40, 53, drawSurface3, screenSurface);
- diferencia = vez() - conta_ciego_vez;
- if (diferencia > 6) {
+ difference = getTime() - savedTime;
+ if (difference > 6) {
if (flags[12] == 1) {
- frame_borracho++;
- if (frame_borracho == 8) {
- frame_borracho = 0;
+ actorFrames[kFrameDrunk]++;
+ if (actorFrames[kFrameDrunk] == 8) {
+ actorFrames[kFrameDrunk] = 0;
flags[12] = 0;
}
} else if ((_rnd->getRandomNumber(94) == 15) && (flags[13] == 0))
flags[12] = 1;
- frame_velas++;
- if (frame_velas == 3)
- frame_velas = 0;
- frame_piano++;
- if (frame_piano == 9)
- frame_piano = 0;
- parpadeo = _rnd->getRandomNumber(10);
- conta_ciego_vez = vez();
+ actorFrames[kFrameCandles]++;
+ if (actorFrames[kFrameCandles] == 3)
+ actorFrames[kFrameCandles] = 0;
+ actorFrames[kFramePianist]++;
+ if (actorFrames[kFramePianist] == 9)
+ actorFrames[kFramePianist] = 0;
+ blinking = _rnd->getRandomNumber(10);
+ savedTime = getTime();
}
}
void DrasculaEngine::update_62() {
- int borracho_x[] = { 1, 42, 83, 124, 165, 206, 247, 1 };
-
- copyRect(1, 1, 0, 0, 62, 142, dir_dibujo2, dir_zona_pantalla);
+ copyRect(1, 1, 0, 0, 62, 142, drawSurface2, screenSurface);
- if (hare_y + alto_hare < 89) {
- copyRect(205, 1, 180, 9, 82, 80, dir_dibujo3, dir_zona_pantalla);
- copyBackground(borracho_x[frame_borracho], 82, 170, 50, 40, 53, dir_dibujo3, dir_zona_pantalla);
+ if (curY + curHeight < 89) {
+ copyRect(205, 1, 180, 9, 82, 80, drawSurface3, screenSurface);
+ copyBackground(_drunkX[actorFrames[kFrameDrunk]], 82, 170, 50, 40, 53, drawSurface3, screenSurface);
}
}
-void DrasculaEngine::update_63() {
- copyRect(1, 154, 83, 122, 131, 44, dir_dibujo3, dir_zona_pantalla);
-}
+void DrasculaEngine::update_102() {
+ int pendulum_x[] = {40, 96, 152, 208, 264, 40, 96, 152, 208, 208, 152, 264, 40, 96, 152, 208, 264};
+ int difference;
+ byte *pendulumSurface = drawSurface3;
-void DrasculaEngine::update_pendulo() {
- int pendulo_x[] = {40, 96, 152, 208, 264, 40, 96, 152, 208, 208, 152, 264, 40, 96, 152, 208, 264};
- int diferencia;
-
- if (frame_pen <= 4)
- dir_pendulo = dir_dibujo3;
- else if (frame_pen <= 11)
- dir_pendulo = dir_hare_dch;
+ if (actorFrames[kFramePendulum] <= 4)
+ pendulumSurface = drawSurface3;
+ else if (actorFrames[kFramePendulum] <= 11)
+ pendulumSurface = extraSurface;
else
- dir_pendulo = dir_hare_frente;
+ pendulumSurface = frontSurface;
- copyBackground(pendulo_x[frame_pen], 19, 152, 0, 55, 125, dir_pendulo, dir_zona_pantalla);
+ copyBackground(pendulum_x[actorFrames[kFramePendulum]], 19, 152, 0, 55, 125, pendulumSurface, screenSurface);
if (flags[1] == 2)
- copyRect(18, 145, 145, 105, 25, 29, dir_dibujo3, dir_zona_pantalla);
+ copyRect(18, 145, 145, 105, 25, 29, drawSurface3, screenSurface);
if (flags[1] == 0)
- copyRect(44, 145, 145, 105, 25, 29, dir_dibujo3, dir_zona_pantalla);
-
- diferencia = vez() - conta_ciego_vez;
- if (diferencia > 8) {
- frame_pen++;
- if (frame_pen == 17)
- frame_pen = 0;
- conta_ciego_vez = vez();
+ copyRect(44, 145, 145, 105, 25, 29, drawSurface3, screenSurface);
+
+ difference = getTime() - savedTime;
+ if (difference > 8) {
+ actorFrames[kFramePendulum]++;
+ if (actorFrames[kFramePendulum] == 17)
+ actorFrames[kFramePendulum] = 0;
+ savedTime = getTime();
+ }
+}
+
+bool DrasculaEngine::checkAction(int fl) {
+ characterMoved = 0;
+ updateRoom();
+ updateScreen();
+
+ hasAnswer = 1;
+
+ if (menuScreen == 1 && roomParse(200, fl)) {
+ ;
+ } else if (menuScreen != 1 && roomParse(201, fl)) {
+ ;
+ } else if (menuScreen == 1) {
+ if (currentChapter == 1) {
+ hasAnswer = 0;
+ } else if (currentChapter == 2) {
+ if ((pickedObject == kVerbLook && fl == 22 && flags[23] == 0)
+ || (pickedObject == kVerbOpen && fl == 22 && flags[23] == 0)) {
+ talk(164);
+ flags[23] = 1;
+ withoutVerb();
+ addObject(kItemMoney);
+ addObject(kItemTwoCoins);
+ } else if (pickedObject == kVerbLook && fl == 22 && flags[23] == 1)
+ talk(307);
+ else
+ hasAnswer = 0;
+ } else if (currentChapter == 3) {
+ hasAnswer = 0;
+ } else if (currentChapter == 4) {
+ if ((pickedObject == 18 && fl == 19) || (pickedObject == 19 && fl == 18)) {
+ withoutVerb();
+ chooseObject(21);
+ removeObject(18);
+ removeObject(19);
+ } else if (pickedObject == kVerbLook && fl == 9) {
+ talk(482);
+ talk(483);
+ } else if (pickedObject == kVerbLook && fl == 19) {
+ talk(494);
+ talk(495);
+ } else
+ hasAnswer = 0;
+ } else if (currentChapter == 5) {
+ if (pickedObject == kVerbLook && fl == 9) {
+ talk(482);
+ talk(483);
+ } else
+ hasAnswer = 0;
+ } else if (currentChapter == 6) {
+ if (pickedObject == kVerbLook && fl == 9) {
+ talk(482);
+ talk(483);
+ } else
+ hasAnswer = 0;
+ }
+ } else {
+ if (currentChapter == 1) {
+ hasAnswer = 0;
+ } else if (currentChapter == 2) {
+ // Note: the original check was strcmp(num_room, "18.alg")
+ if (pickedObject == 11 && fl == 50 && flags[22] == 0 && roomNumber != 18)
+ talk(315);
+ else
+ hasAnswer = 0;
+ } else if (currentChapter == 3) {
+ if (roomNumber == 13) {
+ if (room(13, fl))
+ return true;
+ } else
+ hasAnswer = 0;
+ } else if (currentChapter == 4) {
+ if (roomNumber == 28)
+ talk(178);
+ else if (pickedObject == 8 && fl == 50 && flags[18] == 0)
+ talk(481);
+ else if (pickedObject == 12 && fl == 50 && flags[18] == 0)
+ talk(487);
+ else if (roomNumber == 21) {
+ if (room(21, fl))
+ return true;
+ } else
+ hasAnswer = 0;
+ } else if (currentChapter == 5) {
+ if (roomNumber == 56) {
+ if (room(56, fl))
+ return true;
+ } else
+ hasAnswer = 0;
+ } else if (currentChapter == 6) {
+ if (pickedObject == kVerbLook && fl == 50 && flags[0] == 1)
+ talk(308);
+ else if (pickedObject == kVerbLook && fl == 50 && flags[0] == 0)
+ talk(310);
+ else if (roomNumber == 102)
+ room(102, fl);
+ else if (roomNumber == 60) {
+ if (room(60, fl))
+ return true;
+ }
+ else
+ hasAnswer = 0;
+ }
+ }
+
+ if (hasAnswer == 0) {
+ hasAnswer = 1;
+
+ room(roomNumber, fl);
+ }
+
+ if (hasAnswer == 0 && (hasName == 1 || menuScreen == 1))
+ room(0, -1);
+
+ return false;
+}
+
+bool DrasculaEngine::room(int rN, int fl) {
+ if (!roomParse(rN, fl)) {
+ // Call room-specific parser
+ char rm[20];
+ sprintf(rm, "room_%d", rN);
+ for (uint i = 0; i < _roomParsers.size(); i++) {
+ if (!strcmp(rm, _roomParsers[i]->desc)) {
+ debug(4, "Calling room parser %d", rN);
+
+ return (this->*(_roomParsers[i]->proc))(fl);
+ }
+ }
+
+ // We did not find any parser, let default one work
+ hasAnswer = 0;
+ }
+
+ return false;
+}
+
+void DrasculaEngine::enterRoom(int roomIndex) {
+ debug(2, "Entering room %d", roomIndex);
+
+ char fileName[20];
+ sprintf(fileName, "%d.ald", roomIndex);
+ int soc, l, martin = 0, objIsExit = 0;
+ float chiquez = 0, pequegnez = 0;
+ char pant1[20], pant2[20], pant3[20], pant4[20];
+ char buffer[256];
+ int palLevel = 0;
+
+ hasName = 0;
+
+ strcpy(currentData, fileName);
+
+ _arj.open(fileName);
+ if (!_arj.isOpen()) {
+ error("missing data file %s", fileName);
+ }
+ int size = _arj.size();
+
+ getIntFromLine(buffer, size, &roomNumber);
+ getIntFromLine(buffer, size, &roomMusic);
+ getStringFromLine(buffer, size, roomDisk);
+ getIntFromLine(buffer, size, &palLevel);
+
+ if (currentChapter == 2)
+ getIntFromLine(buffer, size, &martin);
+
+ if (currentChapter == 2 && martin != 0) {
+ curWidth = martin;
+ getIntFromLine(buffer, size, &curHeight);
+ getIntFromLine(buffer, size, &feetHeight);
+ getIntFromLine(buffer, size, &stepX);
+ getIntFromLine(buffer, size, &stepY);
+
+ getStringFromLine(buffer, size, pant1);
+ getStringFromLine(buffer, size, pant2);
+ getStringFromLine(buffer, size, pant3);
+ getStringFromLine(buffer, size, pant4);
+
+ strcpy(menuBackground, pant4);
+ }
+
+ getIntFromLine(buffer, size, &numRoomObjs);
+
+ for (l = 0; l < numRoomObjs; l++) {
+ getIntFromLine(buffer, size, &objectNum[l]);
+ getStringFromLine(buffer, size, objName[l]);
+ getIntFromLine(buffer, size, &x1[l]);
+ getIntFromLine(buffer, size, &y1[l]);
+ getIntFromLine(buffer, size, &x2[l]);
+ getIntFromLine(buffer, size, &y2[l]);
+ getIntFromLine(buffer, size, &roomObjX[l]);
+ getIntFromLine(buffer, size, &roomObjY[l]);
+ getIntFromLine(buffer, size, &trackObj[l]);
+ getIntFromLine(buffer, size, &visible[l]);
+ getIntFromLine(buffer, size, &isDoor[l]);
+ if (isDoor[l] != 0) {
+ getStringFromLine(buffer, size, _targetSurface[l]);
+ getIntFromLine(buffer, size, &_destX[l]);
+ getIntFromLine(buffer, size, &_destY[l]);
+ getIntFromLine(buffer, size, &trackCharacter_alkeva[l]);
+ getIntFromLine(buffer, size, &alapuertakeva[l]);
+ updateDoor(l);
+ }
+ }
+
+ getIntFromLine(buffer, size, &floorX1);
+ getIntFromLine(buffer, size, &floorY1);
+ getIntFromLine(buffer, size, &floorX2);
+ getIntFromLine(buffer, size, &floorY2);
+
+ if (currentChapter != 2) {
+ getIntFromLine(buffer, size, &far);
+ getIntFromLine(buffer, size, &near);
+ }
+ _arj.close();
+
+ if (currentChapter == 2 && martin != 0) {
+ loadPic(pant2, extraSurface);
+ loadPic(pant1, frontSurface);
+ loadPic(pant4, backSurface);
+ }
+
+ if (currentChapter == 2) {
+ if (martin == 0) {
+ stepX = STEP_X;
+ stepY = STEP_Y;
+ curHeight = CHARACTER_HEIGHT;
+ curWidth = CHARACTER_WIDTH;
+ feetHeight = FEET_HEIGHT;
+ loadPic(97, extraSurface);
+ loadPic(96, frontSurface);
+ loadPic(99, backSurface);
+
+ strcpy(menuBackground, "99.alg");
+ }
+ }
+
+ for (l = 0; l < numRoomObjs; l++) {
+ if (objectNum[l] == objExit)
+ objIsExit = l;
+ }
+
+ if (currentChapter == 2) {
+ if (curX == -1) {
+ curX = _destX[objIsExit];
+ curY = _destY[objIsExit] - curHeight;
+ }
+ characterMoved = 0;
+ }
+
+ loadPic(roomDisk, drawSurface3);
+ loadPic(roomNumber, bgSurface, HALF_PAL);
+
+ copyBackground(0, 171, 0, 0, OBJWIDTH, OBJHEIGHT, backSurface, drawSurface3);
+
+ setDefaultPalette();
+ if (palLevel != 0)
+ setPaletteBase(palLevel);
+ assignBrightPalette();
+ setDefaultPalette();
+ setPaletteBase(palLevel + 2);
+ assignDarkPalette();
+
+ setBrightPalette();
+ changeColor = -1;
+
+ if (currentChapter == 2)
+ color_abc(kColorLightGreen);
+
+ if (currentChapter != 2) {
+ for (l = 0; l <= floorY1; l++)
+ factor_red[l] = far;
+ for (l = floorY1; l <= 201; l++)
+ factor_red[l] = near;
+
+ chiquez = (float)(near - far) / (float)(floorY2 - floorY1);
+ for (l = floorY1; l <= floorY2; l++) {
+ factor_red[l] = (int)(far + pequegnez);
+ pequegnez = pequegnez + chiquez;
+ }
+ }
+
+ if (roomNumber == 24) {
+ for (l = floorY1 - 1; l > 74; l--) {
+ factor_red[l] = (int)(far - pequegnez);
+ pequegnez = pequegnez + chiquez;
+ }
+ }
+
+ if (currentChapter == 5 && roomNumber == 54) {
+ for (l = floorY1 - 1; l > 84; l--) {
+ factor_red[l] = (int)(far - pequegnez);
+ pequegnez = pequegnez + chiquez;
+ }
+ }
+
+ if (currentChapter != 2) {
+ if (curX == -1) {
+ curX = _destX[objIsExit];
+ curY = _destY[objIsExit];
+ curHeight = (CHARACTER_HEIGHT * factor_red[curY]) / 100;
+ curWidth = (CHARACTER_WIDTH * factor_red[curY]) / 100;
+ curY = curY - curHeight;
+ } else {
+ curHeight = (CHARACTER_HEIGHT * factor_red[curY]) / 100;
+ curWidth = (CHARACTER_WIDTH * factor_red[curY]) / 100;
+ }
+ characterMoved = 0;
+ }
+
+ if (currentChapter == 2) {
+ soc = 0;
+ for (l = 0; l < 6; l++) {
+ soc += curWidth;
+ _frameX[l] = soc;
+ }
+ }
+
+ if (currentChapter == 5)
+ hare_se_ve = 1;
+
+ updateVisible();
+
+ if (currentChapter == 1)
+ isDoor[7] = 0;
+
+ if (currentChapter == 2) {
+ if (roomNumber == 14 && flags[39] == 1)
+ roomMusic = 16;
+ else if (roomNumber == 15 && flags[39] == 1)
+ roomMusic = 16;
+ if (roomNumber == 14 && flags[5] == 1)
+ roomMusic = 0;
+ else if (roomNumber == 15 && flags[5] == 1)
+ roomMusic = 0;
+
+ if (previousMusic != roomMusic && roomMusic != 0)
+ playMusic(roomMusic);
+ if (roomMusic == 0)
+ stopMusic();
+ } else {
+ if (previousMusic != roomMusic && roomMusic != 0)
+ playMusic(roomMusic);
+ }
+
+ if (currentChapter == 2) {
+ if (roomNumber == 9 || roomNumber == 2 || roomNumber == 14 || roomNumber == 18)
+ savedTime = getTime();
+ }
+ if (currentChapter == 4) {
+ if (roomNumber == 26)
+ savedTime = getTime();
+ }
+
+ if (currentChapter == 4 && roomNumber == 24 && flags[29] == 1)
+ animation_7_4();
+
+ if (currentChapter == 5) {
+ if (roomNumber == 45)
+ hare_se_ve = 0;
+ if (roomNumber == 49 && flags[7] == 0)
+ animation_4_5();
+ }
+
+ updateRoom();
+}
+
+void DrasculaEngine::clearRoom() {
+ memset(VGA, 0, 64000);
+ _system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200);
+ _system->updateScreen();
+}
+
+bool DrasculaEngine::exitRoom(int l) {
+ debug(2, "Exiting room from door %d", l);
+
+ int roomNum = 0;
+
+ if (currentChapter == 1) {
+ if (objectNum[l] == 105 && flags[0] == 0)
+ talk(442);
+ else {
+ updateDoor(l);
+ if (isDoor[l] != 0) {
+ gotoObject(roomObjX[l], roomObjY[l]);
+ trackProtagonist = trackObj[l];
+ updateRoom();
+ updateScreen();
+ characterMoved = 0;
+ trackProtagonist = trackCharacter_alkeva[l];
+ objExit = alapuertakeva[l];
+ doBreak = 1;
+ previousMusic = roomMusic;
+
+ if (objectNum[l] == 105) {
+ animation_2_1();
+ return true;
+ }
+ clearRoom();
+ sscanf(_targetSurface[l], "%d", &roomNum);
+ curX = -1;
+ enterRoom(roomNum);
+ }
+ }
+ } else if (currentChapter == 2) {
+ updateDoor(l);
+ if (isDoor[l] != 0) {
+ gotoObject(roomObjX[l], roomObjY[l]);
+ characterMoved = 0;
+ trackProtagonist = trackCharacter_alkeva[l];
+ objExit = alapuertakeva[l];
+ doBreak = 1;
+ previousMusic = roomMusic;
+ if (objectNum[l] == 136)
+ animation_2_2();
+ if (objectNum[l] == 124)
+ animation_3_2();
+ if (objectNum[l] == 173) {
+ animation_35_2();
+ return true;
+ } if (objectNum[l] == 146 && flags[39] == 1) {
+ flags[5] = 1;
+ flags[11] = 1;
+ }
+ if (objectNum[l] == 176 && flags[29] == 1) {
+ flags[29] = 0;
+ removeObject(kItemEarWithEarPlug);
+ addObject(kItemEarplugs);
+ }
+ clearRoom();
+ sscanf(_targetSurface[l], "%d", &roomNum);
+ curX =- 1;
+ enterRoom(roomNum);
+ }
+ } else if (currentChapter == 3) {
+ updateDoor(l);
+ if (isDoor[l] != 0 && visible[l] == 1) {
+ gotoObject(roomObjX[l], roomObjY[l]);
+ trackProtagonist = trackObj[l];
+ updateRoom();
+ updateScreen();
+ characterMoved = 0;
+ trackProtagonist = trackCharacter_alkeva[l];
+ objExit = alapuertakeva[l];
+ doBreak = 1;
+ previousMusic = roomMusic;
+ clearRoom();
+ sscanf(_targetSurface[l], "%d", &roomNum);
+ curX =- 1;
+ enterRoom(roomNum);
+ }
+ } else if (currentChapter == 4) {
+ updateDoor(l);
+ if (isDoor[l] != 0) {
+ gotoObject(roomObjX[l], roomObjY[l]);
+ trackProtagonist = trackObj[l];
+ updateRoom();
+ updateScreen();
+ characterMoved = 0;
+ trackProtagonist = trackCharacter_alkeva[l];
+ objExit = alapuertakeva[l];
+ doBreak = 1;
+ previousMusic = roomMusic;
+
+ if (objectNum[l] == 108)
+ gotoObject(171, 78);
+ clearRoom();
+ sscanf(_targetSurface[l], "%d", &roomNum);
+ curX = -1;
+ enterRoom(roomNum);
+ }
+ } else if (currentChapter == 5) {
+ updateDoor(l);
+ if (isDoor[l] != 0 && visible[l] == 1) {
+ gotoObject(roomObjX[l], roomObjY[l]);
+ trackProtagonist = trackObj[l];
+ updateRoom();
+ updateScreen();
+ characterMoved = 0;
+ trackProtagonist = trackCharacter_alkeva[l];
+ objExit = alapuertakeva[l];
+ doBreak = 1;
+ previousMusic = roomMusic;
+ hare_se_ve = 1;
+ clearRoom();
+ sscanf(_targetSurface[l], "%d", &roomNum);
+ curX = -1;
+ enterRoom(roomNum);
+ }
+ } else if (currentChapter == 6) {
+ updateDoor(l);
+ if (isDoor[l] != 0) {
+ gotoObject(roomObjX[l], roomObjY[l]);
+ trackProtagonist = trackObj[l];
+ updateRoom();
+ updateScreen();
+ characterMoved = 0;
+ trackProtagonist = trackCharacter_alkeva[l];
+ objExit = alapuertakeva[l];
+ doBreak = 1;
+ previousMusic = roomMusic;
+ clearRoom();
+ sscanf(_targetSurface[l], "%d", &roomNum);
+ curX = -1;
+ enterRoom(roomNum);
+
+ if (objExit == 105)
+ animation_19_6();
+ }
+ }
+
+ return false;
+}
+
+void DrasculaEngine::updateRoom() {
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
+ updateRefresh_pre();
+ if (currentChapter == 3) {
+ if (flags[0] == 0)
+ moveCharacters();
+ else
+ copyRect(113, 54, curX - 20, curY - 1, 77, 89, drawSurface3, screenSurface);
+ } else {
+ moveCharacters();
+ }
+ updateRefresh();
+}
+
+void DrasculaEngine::updateDoor(int doorNum) {
+ if (currentChapter == 1 || currentChapter == 3 || currentChapter == 5 || currentChapter == 6)
+ return;
+ else if (currentChapter == 2) {
+ if (objectNum[doorNum] == 138)
+ isDoor[doorNum] = flags[0];
+ else if (objectNum[doorNum] == 136)
+ isDoor[doorNum] = flags[8];
+ else if (objectNum[doorNum] == 156)
+ isDoor[doorNum] = flags[16];
+ else if (objectNum[doorNum] == 163)
+ isDoor[doorNum] = flags[17];
+ else if (objectNum[doorNum] == 177)
+ isDoor[doorNum] = flags[15];
+ else if (objectNum[doorNum] == 175)
+ isDoor[doorNum] = flags[40];
+ else if (objectNum[doorNum] == 173)
+ isDoor[doorNum] = flags[36];
+ } else if (currentChapter == 4) {
+ if (objectNum[doorNum] == 101 && flags[0] == 0)
+ isDoor[doorNum] = 0;
+ else if (objectNum[doorNum] == 101 && flags[0] == 1 && flags[28] == 1)
+ isDoor[doorNum] = 1;
+ else if (objectNum[doorNum] == 103)
+ isDoor[doorNum] = flags[0];
+ else if (objectNum[doorNum] == 104)
+ isDoor[doorNum] = flags[1];
+ else if (objectNum[doorNum] == 105)
+ isDoor[doorNum] = flags[1];
+ else if (objectNum[doorNum] == 106)
+ isDoor[doorNum] = flags[2];
+ else if (objectNum[doorNum] == 107)
+ isDoor[doorNum] = flags[2];
+ else if (objectNum[doorNum] == 110)
+ isDoor[doorNum] = flags[6];
+ else if (objectNum[doorNum] == 114)
+ isDoor[doorNum] = flags[4];
+ else if (objectNum[doorNum] == 115)
+ isDoor[doorNum] = flags[4];
+ else if (objectNum[doorNum] == 116 && flags[5] == 0)
+ isDoor[doorNum] = 0;
+ else if (objectNum[doorNum] == 116 && flags[5] == 1 && flags[23] == 1)
+ isDoor[doorNum] = 1;
+ else if (objectNum[doorNum] == 117)
+ isDoor[doorNum] = flags[5];
+ else if (objectNum[doorNum] == 120)
+ isDoor[doorNum] = flags[8];
+ else if (objectNum[doorNum] == 122)
+ isDoor[doorNum] = flags[7];
+ }
+}
+
+void DrasculaEngine::openDoor(int nflag, int doorNum) {
+ if (flags[nflag] == 0) {
+ if (currentChapter == 1 /*|| currentChapter == 4*/) {
+ if (nflag != 7) {
+ playSound(3);
+ flags[nflag] = 1;
+ }
+ } else {
+ playSound(3);
+ flags[nflag] = 1;
+ }
+
+ if (doorNum != NO_DOOR)
+ updateDoor(doorNum);
+ updateRoom();
+ updateScreen();
+ finishSound();
+ withoutVerb();
+ }
+}
+
+void DrasculaEngine::closeDoor(int nflag, int doorNum) {
+ if (flags[nflag] == 1) {
+ playSound(4);
+ flags[nflag] = 0;
+ if (doorNum != NO_DOOR)
+ updateDoor(doorNum);
+ updateRoom();
+ updateScreen();
+ finishSound();
+ withoutVerb();
}
}
diff --git a/engines/drascula/saveload.cpp b/engines/drascula/saveload.cpp
new file mode 100644
index 0000000000..de82899462
--- /dev/null
+++ b/engines/drascula/saveload.cpp
@@ -0,0 +1,255 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "drascula/drascula.h"
+
+namespace Drascula {
+
+bool DrasculaEngine::saveLoadScreen() {
+ char names[10][23];
+ char file[50];
+ char fileEpa[50];
+ int n, n2, num_sav = 0, y = 27;
+ Common::InSaveFile *sav;
+
+ clearRoom();
+
+ snprintf(fileEpa, 50, "%s.epa", _targetName.c_str());
+ if (!(sav = _saveFileMan->openForLoading(fileEpa))) {
+ Common::OutSaveFile *epa;
+ if (!(epa = _saveFileMan->openForSaving(fileEpa)))
+ error("Can't open %s file", fileEpa);
+ for (n = 0; n < NUM_SAVES; n++)
+ epa->writeString("*\n");
+ epa->finalize();
+ delete epa;
+ if (!(sav = _saveFileMan->openForLoading(fileEpa))) {
+ error("Can't open %s file", fileEpa);
+ }
+ }
+ for (n = 0; n < NUM_SAVES; n++)
+ sav->readLine(names[n], 23);
+ delete sav;
+
+ loadPic("savescr.alg", bgSurface, HALF_PAL);
+
+ color_abc(kColorLightGreen);
+
+ select[0] = 0;
+
+ for (;;) {
+ y = 27;
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
+ for (n = 0; n < NUM_SAVES; n++) {
+ print_abc(names[n], 116, y);
+ y = y + 9;
+ }
+ print_abc(select, 117, 15);
+ setCursorTable();
+ updateScreen();
+ y = 27;
+
+ updateEvents();
+
+ if (leftMouseButton == 1) {
+ delay(50);
+ for (n = 0; n < NUM_SAVES; n++) {
+ if (mouseX > 115 && mouseY > y + (9 * n) && mouseX < 115 + 175 && mouseY < y + 10 + (9 * n)) {
+ strcpy(select, names[n]);
+
+ if (strcmp(select, "*"))
+ selectionMade = 1;
+ else {
+ enterName();
+ strcpy(names[n], select);
+ if (selectionMade == 1) {
+ snprintf(file, 50, "%s%02d", _targetName.c_str(), n + 1);
+ saveGame(file);
+ Common::OutSaveFile *tsav;
+ if (!(tsav = _saveFileMan->openForSaving(fileEpa))) {
+ error("Can't open %s file", fileEpa);
+ }
+ for (n = 0; n < NUM_SAVES; n++) {
+ tsav->writeString(names[n]);
+ tsav->writeString("\n");
+ }
+ tsav->finalize();
+ delete tsav;
+ }
+ }
+
+ print_abc(select, 117, 15);
+ y = 27;
+ for (n2 = 0; n2 < NUM_SAVES; n2++) {
+ print_abc(names[n2], 116, y);
+ y = y + 9;
+ }
+ if (selectionMade == 1) {
+ snprintf(file, 50, "%s%02d", _targetName.c_str(), n + 1);
+ }
+ num_sav = n;
+ }
+ }
+
+ if (mouseX > 117 && mouseY > 15 && mouseX < 295 && mouseY < 24 && selectionMade == 1) {
+ enterName();
+ strcpy(names[num_sav], select);
+ print_abc(select, 117, 15);
+ y = 27;
+ for (n2 = 0; n2 < NUM_SAVES; n2++) {
+ print_abc(names[n2], 116, y);
+ y = y + 9;
+ }
+
+ if (selectionMade == 1) {
+ snprintf(file, 50, "%s%02d", _targetName.c_str(), n + 1);
+ saveGame(file);
+ Common::OutSaveFile *tsav;
+ if (!(tsav = _saveFileMan->openForSaving(fileEpa))) {
+ error("Can't open %s file", fileEpa);
+ }
+ for (n = 0; n < NUM_SAVES; n++) {
+ tsav->writeString(names[n]);
+ tsav->writeString("\n");
+ }
+ tsav->finalize();
+ delete tsav;
+ }
+ }
+
+ if (mouseX > 125 && mouseY > 123 && mouseX < 199 && mouseY < 149 && selectionMade == 1) {
+ if (!loadGame(file))
+ return false;
+ break;
+ } else if (mouseX > 208 && mouseY > 123 && mouseX < 282 && mouseY < 149 && selectionMade == 1) {
+ saveGame(file);
+ Common::OutSaveFile *tsav;
+ if (!(tsav = _saveFileMan->openForSaving(fileEpa))) {
+ error("Can't open %s file", fileEpa);
+ }
+ for (n = 0; n < NUM_SAVES; n++) {
+ tsav->writeString(names[n]);
+ tsav->writeString("\n");
+ }
+ tsav->finalize();
+ delete tsav;
+ } else if (mouseX > 168 && mouseY > 154 && mouseX < 242 && mouseY < 180)
+ break;
+ else if (selectionMade == 0) {
+ print_abc("Please select a slot", 117, 15);
+ }
+ updateScreen();
+ delay(200);
+ }
+ y = 26;
+
+ delay(5);
+ }
+
+ clearRoom();
+ loadPic(roomNumber, bgSurface, HALF_PAL);
+ selectionMade = 0;
+
+ return true;
+}
+
+bool DrasculaEngine::loadGame(const char *gameName) {
+ int l, savedChapter, roomNum = 0;
+ Common::InSaveFile *sav;
+
+ previousMusic = roomMusic;
+ menuScreen = 0;
+ if (currentChapter != 1)
+ clearRoom();
+
+ if (!(sav = _saveFileMan->openForLoading(gameName))) {
+ error("missing savegame file");
+ }
+
+ savedChapter = sav->readSint32LE();
+ if (savedChapter != currentChapter) {
+ strcpy(saveName, gameName);
+ currentChapter = savedChapter - 1;
+ hay_que_load = 1;
+ return false;
+ }
+ sav->read(currentData, 20);
+ curX = sav->readSint32LE();
+ curY = sav->readSint32LE();
+ trackProtagonist = sav->readSint32LE();
+
+ for (l = 1; l < 43; l++) {
+ inventoryObjects[l] = sav->readSint32LE();
+ }
+
+ for (l = 0; l < NUM_FLAGS; l++) {
+ flags[l] = sav->readSint32LE();
+ }
+
+ takeObject = sav->readSint32LE();
+ pickedObject = sav->readSint32LE();
+ hay_que_load = 0;
+ sscanf(currentData, "%d.ald", &roomNum);
+ enterRoom(roomNum);
+ withoutVerb();
+
+ return true;
+}
+
+void DrasculaEngine::saveGame(char gameName[]) {
+ Common::OutSaveFile *out;
+ int l;
+
+ if (!(out = _saveFileMan->openForSaving(gameName))) {
+ error("Unable to open the file");
+ }
+ out->writeSint32LE(currentChapter);
+ out->write(currentData, 20);
+ out->writeSint32LE(curX);
+ out->writeSint32LE(curY);
+ out->writeSint32LE(trackProtagonist);
+
+ for (l = 1; l < 43; l++) {
+ out->writeSint32LE(inventoryObjects[l]);
+ }
+
+ for (l = 0; l < NUM_FLAGS; l++) {
+ out->writeSint32LE(flags[l]);
+ }
+
+ out->writeSint32LE(takeObject);
+ out->writeSint32LE(pickedObject);
+
+ out->finalize();
+ if (out->ioFailed())
+ warning("Can't write file '%s'. (Disk full?)", gameName);
+
+ delete out;
+
+ playSound(99);
+ finishSound();
+}
+
+} // End of namespace Drascula
diff --git a/engines/drascula/sound.cpp b/engines/drascula/sound.cpp
new file mode 100644
index 0000000000..840d6c7cb5
--- /dev/null
+++ b/engines/drascula/sound.cpp
@@ -0,0 +1,159 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "drascula/drascula.h"
+
+namespace Drascula {
+
+void DrasculaEngine::updateVolume(Audio::Mixer::SoundType soundType, int prevVolume) {
+ int vol = _mixer->getVolumeForSoundType(soundType) / 16;
+ if (mouseY < prevVolume && vol < 15)
+ vol++;
+ if (mouseY > prevVolume && vol > 0)
+ vol--;
+ _mixer->setVolumeForSoundType(soundType, vol * 16);
+}
+
+void DrasculaEngine::volumeControls() {
+ int masterVolume, voiceVolume, musicVolume;
+
+ copyRect(1, 56, 73, 63, 177, 97, tableSurface, screenSurface);
+ updateScreen(73, 63, 73, 63, 177, 97, screenSurface);
+
+ masterVolume = 72 + 61 - ((_mixer->getVolumeForSoundType(Audio::Mixer::kPlainSoundType) / 16) * 4);
+ voiceVolume = 72 + 61 - ((_mixer->getVolumeForSoundType(Audio::Mixer::kSFXSoundType) / 16) * 4);
+ musicVolume = 72 + 61 - ((_mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType) / 16) * 4);
+
+ for (;;) {
+ updateRoom();
+
+ copyRect(1, 56, 73, 63, 177, 97, tableSurface, screenSurface);
+
+ copyBackground(183, 56, 82, masterVolume, 39, 2 + ((_mixer->getVolumeForSoundType(Audio::Mixer::kPlainSoundType) / 16) * 4), tableSurface, screenSurface);
+ copyBackground(183, 56, 138, voiceVolume, 39, 2 + ((_mixer->getVolumeForSoundType(Audio::Mixer::kSFXSoundType) / 16) * 4), tableSurface, screenSurface);
+ copyBackground(183, 56, 194, musicVolume, 39, 2 + ((_mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType) / 16) * 4), tableSurface, screenSurface);
+
+ setCursorTable();
+
+ updateScreen();
+
+ updateEvents();
+
+ if (rightMouseButton == 1) {
+ delay(100);
+ break;
+ }
+ if (leftMouseButton == 1) {
+ delay(100);
+ if (mouseX > 80 && mouseX < 121) {
+ updateVolume(Audio::Mixer::kPlainSoundType, mouseY);
+ masterVolume = 72 + 61 - ((_mixer->getVolumeForSoundType(Audio::Mixer::kPlainSoundType) / 16) * 4);
+ }
+
+ if (mouseX > 136 && mouseX < 178) {
+ updateVolume(Audio::Mixer::kSFXSoundType, mouseY);
+ voiceVolume = 72 + 61 - ((_mixer->getVolumeForSoundType(Audio::Mixer::kSFXSoundType) / 16) * 4);
+ }
+
+ if (mouseX > 192 && mouseX < 233) {
+ updateVolume(Audio::Mixer::kMusicSoundType, mouseY);
+ musicVolume = 72 + 61 - ((_mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType) / 16) * 4);
+ }
+ }
+
+ }
+
+ updateEvents();
+}
+
+void DrasculaEngine::playSound(int soundNum) {
+ char file[20];
+ sprintf(file, "s%i.als", soundNum);
+
+ playFile(file);
+}
+
+void DrasculaEngine::finishSound() {
+ delay(1);
+
+ while (soundIsActive())
+ _system->delayMillis(10);
+}
+
+void DrasculaEngine::playMusic(int p) {
+ AudioCD.stop();
+ AudioCD.play(p - 1, 1, 0, 0);
+}
+
+void DrasculaEngine::stopMusic() {
+ AudioCD.stop();
+}
+
+int DrasculaEngine::musicStatus() {
+ return AudioCD.isPlaying();
+}
+
+void DrasculaEngine::stopSound() {
+ _mixer->stopHandle(_soundHandle);
+}
+
+void DrasculaEngine::MusicFadeout() {
+ int org_vol = _mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType);
+ for (;;) {
+ int vol = _mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType);
+ vol -= 10;
+ if (vol < 0)
+ vol = 0;
+ _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, vol);
+ if (vol == 0)
+ break;
+ updateEvents();
+ _system->updateScreen();
+ _system->delayMillis(50);
+ }
+ AudioCD.stop();
+ _system->delayMillis(100);
+ _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, org_vol);
+}
+
+void DrasculaEngine::playFile(const char *fname) {
+ if (_arj.open(fname)) {
+ int soundSize = _arj.size();
+ byte *soundData = (byte *)malloc(soundSize);
+ _arj.seek(32);
+ _arj.read(soundData, soundSize);
+ _arj.close();
+
+ _mixer->playRaw(Audio::Mixer::kSFXSoundType, &_soundHandle, soundData, soundSize - 64,
+ 11025, Audio::Mixer::FLAG_AUTOFREE | Audio::Mixer::FLAG_UNSIGNED);
+ } else
+ warning("playFile: Could not open %s", fname);
+}
+
+bool DrasculaEngine::soundIsActive() {
+ return _mixer->isSoundHandleActive(_soundHandle);
+}
+
+} // End of namespace Drascula
diff --git a/engines/drascula/talk.cpp b/engines/drascula/talk.cpp
index 3dea8c21a1..4d3187a0fd 100644
--- a/engines/drascula/talk.cpp
+++ b/engines/drascula/talk.cpp
@@ -27,2027 +27,942 @@
namespace Drascula {
-void DrasculaEngine::talk_igor_dch(const char *dicho, const char *filename) {
- int tiempou;
- long tiempol;
+int x_talk_dch[6] = {1, 25, 49, 73, 97, 121};
+int x_talk_izq[6] = {145, 169, 193, 217, 241, 265};
- int x_talk[8] = { 56, 82, 108, 134, 160, 186, 212, 238 };
- int cara;
+void DrasculaEngine::talkInit(const char *filename) {
+ _rnd->setSeed((unsigned int)_system->getMillis() / 2);
- int longitud;
- longitud = strlen(dicho);
-
- tiempol = _system->getMillis();
- tiempou = (unsigned int)tiempol / 2;
- _rnd->setSeed(tiempou);
-
- buffer_teclado();
-
- color_abc(BLANCO);
-
- if (hay_sb == 1) {
- sku = new Common::File;
- sku->open(filename);
- if (!sku->isOpen()) {
- error("no puedo abrir archivo de voz");
- }
- ctvd_init(2);
- ctvd_speaker(1);
- ctvd_output(sku);
- }
-
-bucless:
-
- cara = _rnd->getRandomNumber(7);
-
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
-
- updateRefresh_pre();
-
- pon_igor();
- pon_dr();
- copyBackground(x_igor + 17, y_igor, x_igor + 17, y_igor, 37, 24, dir_dibujo1, dir_zona_pantalla);
-
- copyRect(x_talk[cara], 148, x_igor + 17, y_igor, 25, 24, dir_hare_frente, dir_zona_pantalla);
-
- updateRefresh();
-
- if (con_voces == 0)
- centra_texto(dicho, x_igor + 26, y_igor);
-
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- pause(3);
-
- byte key = getscan();
- if (num_ejec == 1 && key == Common::KEYCODE_ESCAPE)
- term_int = 1;
- if (key != 0)
- ctvd_stop();
- buffer_teclado();
- if (hay_sb == 1) {
- if (LookForFree() != 0)
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- longitud = longitud - 2;
- if (longitud > 0)
- goto bucless;
- }
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- pon_igor();
- pon_dr();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ playFile(filename);
}
-void DrasculaEngine::talk_dr_izq(const char *dicho, const char *filename) {
- int tiempou;
- long tiempol;
-
- int x_talk[8] = { 1, 40, 79, 118, 157, 196, 235, 274 };
- int cara;
-
- int longitud;
- longitud = strlen(dicho);
-
- tiempol = _system->getMillis();
- tiempou = (unsigned int)tiempol / 2;
- _rnd->setSeed(tiempou);
-
- buffer_teclado();
+bool DrasculaEngine::isTalkFinished(int* length) {
+ byte key = getScan();
+ if (key != 0)
+ stopSound();
+ if (soundIsActive())
+ return false;
- color_abc(ROJO);
+ return true;
+}
- if (hay_sb == 1) {
- sku = new Common::File;
- sku->open(filename);
- if (!sku->isOpen()) {
- error("no puedo abrir archivo de voz");
+// talker types:
+// 0: talk_igor_dch
+// 1: talk_igor_front
+// 2: talk_igor_door
+// 3: talk_igor_seated
+// 4: talk_igor_wig
+void DrasculaEngine::talk_igor(int index, int talkerType) {
+ char filename[20];
+ sprintf(filename, "I%i.als", index);
+ const char *said = _texti[_lang][index];
+ int x_talk0[8] = { 56, 82, 108, 134, 160, 186, 212, 238 };
+ int x_talk1[8] = { 56, 86, 116, 146, 176, 206, 236, 266 };
+ int x_talk3[4] = { 80, 102, 124, 146 };
+ int x_talk4[4] = { 119, 158, 197, 236 };
+ int face;
+ int length = strlen(said);
+
+ color_abc(kColorWhite);
+
+ talkInit(filename);
+
+ do {
+ if (talkerType == kIgorDch || talkerType == kIgorFront) {
+ face = _rnd->getRandomNumber(7);
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
+ updateRefresh_pre();
+ } else if (talkerType == kIgorSeated || talkerType == kIgorWig) {
+ face = _rnd->getRandomNumber(3);
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
+ updateRefresh_pre();
}
- ctvd_init(2);
- ctvd_speaker(1);
- ctvd_output(sku);
- }
-
-bucless:
-
- cara = _rnd->getRandomNumber(7);
-
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
-
- updateRefresh_pre();
-
- pon_igor();
- pon_dr();
- if (num_ejec == 6)
- pon_hare();
-
- copyBackground(x_dr, y_dr, x_dr, y_dr, 38, 31, dir_dibujo1, dir_zona_pantalla);
- if (num_ejec == 6)
- copyRect(x_talk[cara], 90, x_dr, y_dr, 38, 31, dir_dibujo2, dir_zona_pantalla);
- else
- copyRect(x_talk[cara], 90, x_dr, y_dr, 38, 31, dir_hare_fondo, dir_zona_pantalla);
-
- updateRefresh();
-
- if (con_voces == 0)
- centra_texto(dicho, x_dr + 19, y_dr);
-
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- pause(3);
+
+ if (talkerType == kIgorDch) {
+ placeIgor();
+ placeDrascula();
+ copyBackground(igorX + 17, igorY, igorX + 17, igorY, 37, 24, bgSurface, screenSurface);
+ copyRect(x_talk0[face], 148, igorX + 17, igorY, 25, 24, frontSurface, screenSurface);
+ updateRefresh();
+ if (withVoices == 0)
+ centerText(said, igorX + 26, igorY);
+ updateScreen();
+ pause(3);
+ } else if (talkerType == kIgorFront) {
+ if (currentChapter == 1 || currentChapter == 4)
+ placeIgor();
+ if (currentChapter == 1)
+ placeDrascula();
+ if (currentChapter == 1 || currentChapter == 6)
+ copyBackground(igorX, igorY, igorX, igorY, 29, 25, bgSurface, screenSurface);
+ copyRect(x_talk1[face], 173, igorX, igorY, 29, 25, frontSurface, screenSurface);
+ updateRefresh();
+ if (withVoices == 0)
+ centerText(said, igorX + 26, igorY);
+ updateScreen();
+ pause(3);
+ } else if (talkerType == kIgorDoor) {
+ updateRoom();
+ if (withVoices == 0)
+ centerText(said, 87, 66);
+ updateScreen();
+ } else if (talkerType == kIgorSeated || talkerType == kIgorWig) {
+ if (talkerType == kIgorSeated)
+ copyBackground(x_talk3[face], 109, 207, 92, 21, 23, drawSurface3, screenSurface);
+ else
+ copyBackground(x_talk4[face], 78, 199, 94, 38, 27, drawSurface3, screenSurface);
+ moveCharacters();
+ updateRefresh();
+ if (withVoices == 0)
+ centerText(said, 221, 102);
+
+ updateScreen();
+ pause(3);
+ }
+ } while (!isTalkFinished(&length));
- byte key = getscan();
- if (num_ejec == 1 && key == Common::KEYCODE_ESCAPE)
- term_int = 1;
- if (key != 0)
- ctvd_stop();
- buffer_teclado();
- if (hay_sb == 1) {
- if (LookForFree() != 0)
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- longitud = longitud - 2;
- if (longitud > 0)
- goto bucless;
+ if ((talkerType == kIgorFront && currentChapter == 6) ||
+ talkerType == kIgorDoor || talkerType == kIgorSeated || talkerType == kIgorWig) {
+ updateRoom();
}
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- pon_igor();
- pon_dr();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ if (talkerType == kIgorDch || (talkerType == kIgorFront && currentChapter == 1)) {
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
+ placeIgor();
+ placeDrascula();
+ }
+ updateScreen();
}
-void DrasculaEngine::talk_dr_dch(const char *dicho, const char *filename) {
- int tiempou;
- long tiempol;
-
+// Talker type 0: talk_dr_izq, 1: talk_dr_dch
+void DrasculaEngine::talk_drascula(int index, int talkerType) {
+ const char *said = _textd[_lang][index];
+ char filename[20];
+ sprintf(filename, "d%i.als", index);
int x_talk[8] = { 1, 40, 79, 118, 157, 196, 235, 274 };
- int cara;
+ int face;
+ int length = strlen(said);
+ int offset = (talkerType == 0) ? 0 : 7;
+ int offset2 = (talkerType == 0) ? 90 : 58;
- int longitud;
- longitud = strlen(dicho);
+ color_abc(kColorRed);
- tiempol = _system->getMillis();
- tiempou = (unsigned int)tiempol / 2;
- _rnd->setSeed(tiempou);
+ talkInit(filename);
- buffer_teclado();
+ do {
+ face = _rnd->getRandomNumber(7);
- color_abc(ROJO);
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
- if (hay_sb == 1) {
- sku = new Common::File;
- sku->open(filename);
- if (!sku->isOpen()) {
- error("no puedo abrir archivo de voz");
- }
- ctvd_init(2);
- ctvd_speaker(1);
- ctvd_output(sku);
- }
+ updateRefresh_pre();
-bucless:
+ placeIgor();
+ placeDrascula();
+ if (currentChapter == 6)
+ moveCharacters();
- cara = _rnd->getRandomNumber(7);
+ copyBackground(drasculaX, drasculaY, drasculaX, drasculaY, 38 + offset, 31, bgSurface, screenSurface);
+ if (currentChapter == 6)
+ copyRect(x_talk[face], offset2, drasculaX + offset, drasculaY, 38, 31, drawSurface2, screenSurface);
+ else
+ copyRect(x_talk[face], offset2, drasculaX + offset, drasculaY, 38, 31, backSurface, screenSurface);
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- updateRefresh_pre();
+ updateRefresh();
- pon_igor();
- pon_dr();
- if (num_ejec == 6)
- pon_hare();
+ if (withVoices == 0)
+ centerText(said, drasculaX + 19, drasculaY);
- copyBackground(x_dr, y_dr, x_dr, y_dr, 45, 31, dir_dibujo1, dir_zona_pantalla);
- if (num_ejec != 6)
- copyRect(x_talk[cara], 58, x_dr + 7, y_dr, 38, 31, dir_hare_fondo, dir_zona_pantalla);
- else
- copyRect(x_talk[cara], 58, x_dr + 7, y_dr, 38, 31, dir_dibujo2, dir_zona_pantalla);
+ updateScreen();
- updateRefresh();
+ pause(3);
- if (con_voces == 0)
- centra_texto(dicho, x_dr + 19, y_dr);
+ } while (!isTalkFinished(&length));
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ if (talkerType == 0)
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
- pause(3);
+ if (talkerType == 1 && currentChapter == 6)
+ updateRoom();
- byte key = getscan();
- if (num_ejec == 1 && key == Common::KEYCODE_ESCAPE)
- term_int = 1;
- if (key != 0)
- ctvd_stop();
- buffer_teclado();
- if (hay_sb == 1) {
- if (LookForFree() != 0)
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- longitud = longitud - 2;
- if (longitud > 0)
- goto bucless;
- }
+ placeIgor();
+ placeDrascula();
- if (num_ejec == 6)
- updateRoom();
+ if (talkerType == 1 && currentChapter == 6)
+ moveCharacters();
- pon_igor();
- pon_dr();
- if (num_ejec == 6)
- pon_hare();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateScreen();
}
-void DrasculaEngine::talk_solo(const char *dicho, const char *filename) {
- int tiempou;
- long tiempol;
+void DrasculaEngine::talk_solo(const char *said, const char *filename) {
+ int length = strlen(said);
- int longitud;
- longitud = strlen(dicho);
-
- tiempol = _system->getMillis();
- tiempou = (unsigned int)tiempol / 2;
- _rnd->setSeed(tiempou);
-
- if (num_ejec == 1)
+ if (currentChapter == 1)
color_abc(color_solo);
- else if (num_ejec == 4)
- color_abc(ROJO);
-
- if (hay_sb == 1) {
- sku = new Common::File;
- sku->open(filename);
- if (!sku->isOpen()) {
- error("no puedo abrir archivo de voz");
+ else if (currentChapter == 4)
+ color_abc(kColorRed);
+
+ talkInit(filename);
+
+ if (currentChapter == 6)
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
+
+ do {
+ if (withVoices == 0) {
+ if (currentChapter == 1)
+ centerText(said, 156, 90);
+ else if (currentChapter == 6)
+ centerText(said, 213, 72);
+ else if (currentChapter == 5)
+ centerText(said, 173, 92);
}
- ctvd_init(2);
- ctvd_speaker(1);
- ctvd_output(sku);
- }
+ updateScreen();
+ } while (!isTalkFinished(&length));
- if (num_ejec == 6)
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
-
-bucless:
-
- if (con_voces == 0) {
- if (num_ejec == 1)
- centra_texto(dicho, 156, 90);
- else if (num_ejec == 6)
- centra_texto(dicho, 213, 72);
- else if (num_ejec == 5)
- centra_texto(dicho, 173, 92);
- }
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- byte key = getscan();
- if (num_ejec == 1 && key == Common::KEYCODE_ESCAPE)
- term_int = 1;
- if (key != 0)
- ctvd_stop();
- buffer_teclado();
- if (hay_sb == 1) {
- if (LookForFree() != 0)
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- longitud = longitud - 2;
- if (longitud > 0)
- goto bucless;
- }
- if (num_ejec == 6) {
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ if (currentChapter == 6) {
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
+ updateScreen();
}
}
-void DrasculaEngine::talk_igor_frente(const char *dicho, const char *filename) {
- int tiempou;
- long tiempol;
-
- int x_talk[8] = { 56, 86, 116, 146, 176, 206, 236, 266 };
- int cara;
-
- int longitud;
- longitud = strlen(dicho);
-
- tiempol = _system->getMillis();
- tiempou = (unsigned int)tiempol / 2;
- _rnd->setSeed(tiempou);
-
- buffer_teclado();
-
- color_abc(BLANCO);
-
- if (hay_sb == 1) {
- sku = new Common::File;
- sku->open(filename);
- if (!sku->isOpen()) {
- error("no puedo abrir archivo de voz");
- }
- ctvd_init(2);
- ctvd_speaker(1);
- ctvd_output(sku);
- }
-
-bucless:
-
- cara = _rnd->getRandomNumber(7);
-
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
-
- updateRefresh_pre();
-
- if (num_ejec == 1 || num_ejec == 4)
- pon_igor();
- if (num_ejec == 1)
- pon_dr();
- if (num_ejec == 1 || num_ejec == 6)
- copyBackground(x_igor, y_igor, x_igor, y_igor, 29, 25, dir_dibujo1, dir_zona_pantalla);
- copyRect(x_talk[cara], 173, x_igor, y_igor, 29, 25, dir_hare_frente, dir_zona_pantalla);
-
- updateRefresh();
-
- if (con_voces == 0)
- centra_texto(dicho, x_igor + 26, y_igor);
+void DrasculaEngine::talk_bartender(int index, int talkerType) {
+ char filename[20];
+ sprintf(filename, "t%i.als", index);
+ const char *said;
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- pause(3);
-
- byte key = getscan();
- if (num_ejec == 1 && key == Common::KEYCODE_ESCAPE)
- term_int = 1;
- if (key != 0)
- ctvd_stop();
- buffer_teclado();
- if (hay_sb == 1) {
- if (LookForFree() != 0)
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- longitud = longitud - 2;
- if (longitud > 0)
- goto bucless;
- }
-
- if (num_ejec == 6) {
- updateRoom();
- }
-
- if (num_ejec == 1) {
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- pon_igor();
- pon_dr();
+ // Line 82 is a special case
+ if (index != 82)
+ said = _textt[_lang][index];
+ else {
+ sprintf(filename, "d%i.als", index);
+ said = _textd[_lang][index];
}
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-}
-
-void DrasculaEngine::talk_tabernero(const char *dicho, const char *filename) {
- int tiempou;
- long tiempol;
int x_talk[9] = { 1, 23, 45, 67, 89, 111, 133, 155, 177 };
- int cara;
-
- int longitud;
- longitud = strlen(dicho);
-
- tiempol = _system->getMillis();
- tiempou = (unsigned int)tiempol / 2;
- _rnd->setSeed(tiempou);
-
- buffer_teclado();
-
- color_abc(MARRON);
-
- if (hay_sb == 1) {
- sku = new Common::File;
- sku->open(filename);
- if (!sku->isOpen()) {
- error("no puedo abrir archivo de voz");
+ int face;
+ int length = strlen(said);
+
+ color_abc(kColorMaroon);
+
+ talkInit(filename);
+
+ do {
+ if (talkerType == 0) {
+ if (currentChapter == 1) {
+ if (musicStatus() == 0)
+ playMusic(roomMusic);
+ } else if (currentChapter == 2) {
+ if (musicStatus() == 0 && flags[11] == 0 && roomMusic != 0)
+ playMusic(roomMusic);
+ }
+
+ face = _rnd->getRandomNumber(8);
+ } else {
+ face = _rnd->getRandomNumber(5);
}
- ctvd_init(2);
- ctvd_speaker(1);
- ctvd_output(sku);
- }
-
-bucless:
-
- if (num_ejec == 1) {
- if (music_status() == 0)
- playmusic(musica_room);
- } else if (num_ejec == 2) {
- if (music_status() == 0 && flags[11] == 0 && musica_room != 0)
- playmusic(musica_room);
- }
-
- cara = _rnd->getRandomNumber(8);
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
- updateRefresh_pre();
-
- copyBackground(x_talk[cara], 2, 121, 44, 21, 24, dir_hare_dch, dir_zona_pantalla);
- pon_hare();
- updateRefresh();
+ updateRefresh_pre();
- if (con_voces == 0)
- centra_texto(dicho, 132, 45);
+ if (talkerType == 0)
+ copyBackground(x_talk[face], 2, 121, 44, 21, 24, extraSurface, screenSurface);
+ else
+ copyBackground(x_talk[face], 130, 151, 43, 21, 24, drawSurface3, screenSurface);
+ moveCharacters();
+ updateRefresh();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ if (withVoices == 0)
+ centerText(said, 132, 45);
- pause(3);
+ updateScreen();
- byte key = getscan();
- if (key != 0)
- ctvd_stop();
- buffer_teclado();
- if (hay_sb == 1) {
- if (LookForFree() != 0)
- goto bucless;
- delete(sku);
- ctvd_terminate();
- } else {
- longitud = longitud - 2;
- if (longitud > 0)
- goto bucless;
- }
+ pause(3);
+ } while (!isTalkFinished(&length));
updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateScreen();
}
-void DrasculaEngine::talk_bj(const char *dicho, const char *filename) {
- int tiempou;
- long tiempol;
-
+void DrasculaEngine::talk_bj(int index) {
+ char filename[20];
+ sprintf(filename, "BJ%i.als", index);
+ const char *said = _textbj[_lang][index];
int x_talk[5] = { 64, 92, 120, 148, 176 };
- int cara;
+ int face;
+ int length = strlen(said);
- int longitud;
- longitud = strlen(dicho);
+ color_abc(kColorWhite);
- tiempol = _system->getMillis();
- tiempou = (unsigned int)tiempol / 2;
- _rnd->setSeed(tiempou);
+ talkInit(filename);
- buffer_teclado();
+ do {
+ if (currentChapter != 5) {
+ face = _rnd->getRandomNumber(4);
- color_abc(BLANCO);
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
- if (hay_sb == 1) {
- sku = new Common::File;
- sku->open(filename);
- if (!sku->isOpen()) {
- error("no puedo abrir archivo de voz");
- }
- ctvd_init(2);
- ctvd_speaker(1);
- ctvd_output(sku);
- }
+ updateRefresh_pre();
-bucless:
- if (num_ejec != 5) {
- cara = _rnd->getRandomNumber(4);
+ copyBackground(bjX + 2, bjY - 1, bjX + 2, bjY - 1, 27, 40,
+ bgSurface, screenSurface);
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ copyRect(x_talk[face], 99, bjX + 2, bjY - 1, 27, 40,
+ drawSurface3, screenSurface);
+ moveCharacters();
+ updateRefresh();
- updateRefresh_pre();
+ if (withVoices == 0)
+ centerText(said, bjX + 7, bjY);
- copyBackground(x_bj + 2, y_bj - 1, x_bj + 2, y_bj - 1, 27, 40,
- dir_dibujo1, dir_zona_pantalla);
+ updateScreen();
- copyRect(x_talk[cara], 99, x_bj + 2, y_bj - 1, 27, 40,
- dir_dibujo3, dir_zona_pantalla);
- pon_hare();
- updateRefresh();
+ pause(3);
+ } else {
+ updateRoom();
- if (con_voces == 0)
- centra_texto(dicho, x_bj + 7, y_bj);
+ if (withVoices == 0)
+ centerText(said, 93, 80);
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- pause(3);
- } else {
- updateRoom();
-
- if (con_voces == 0)
- centra_texto(dicho, 93, 80);
-
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- }
-
- byte key = getscan();
- if (num_ejec == 1 && key == Common::KEYCODE_ESCAPE)
- term_int = 1;
- if (key != 0)
- ctvd_stop();
- buffer_teclado();
- if (hay_sb == 1) {
- if (LookForFree() != 0)
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- longitud = longitud - 2;
- if (longitud > 0)
- goto bucless;
- }
+ updateScreen();
+ }
+ } while (!isTalkFinished(&length));
updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateScreen();
}
-void DrasculaEngine::talk(const char *dicho, const char *filename) {
- int tiempou;
- long tiempol;
+void DrasculaEngine::talk(int index) {
+ char name[20];
+ sprintf(name, "%i.als", index);
+ talk(_text[_lang][index], name);
+}
- int suma_1_pixel = 0;
- if (num_ejec != 2)
- suma_1_pixel = 1;
+void DrasculaEngine::talk(const char *said, const char *filename) {
+ int talkOffset = 0;
+ if (currentChapter != 2)
+ talkOffset = 1;
int y_mask_talk = 170;
- int x_talk_dch[6] = { 1, 25, 49, 73, 97, 121 };
- int x_talk_izq[6] = { 145, 169, 193, 217, 241, 265 };
- int cara;
-
- int longitud;
- longitud = strlen(dicho);
+ int face;
+ int length = strlen(said);
- if (num_ejec == 6) {
- if (flags[0] == 0 && (!strcmp(num_room, "102.alg"))) {
- talk_pen(dicho, filename);
+ if (currentChapter == 6) {
+ if (flags[0] == 0 && roomNumber == 102) {
+ talk_pen(said, filename, 0);
return;
}
- if (flags[0] == 0 && (!strcmp(num_room, "58.alg"))) {
- talk_pen2(dicho, filename);
+ if (flags[0] == 0 && roomNumber == 58) {
+ talk_pen(said, filename, 1);
return;
}
}
- tiempol = _system->getMillis();
- tiempou = (unsigned int)tiempol / 2;
- _rnd->setSeed(tiempou);
-
- if (num_ejec != 2) {
- if (factor_red[hare_y + alto_hare] == 100)
- suma_1_pixel = 0;
+ if (currentChapter != 2) {
+ if (factor_red[curY + curHeight] == 100)
+ talkOffset = 0;
}
- if (num_ejec == 2)
- buffer_teclado();
-
- if (num_ejec == 4) {
- if (strcmp(num_room, "24.alg") || flags[29] == 0) {
- color_abc(AMARILLO);
+ if (currentChapter == 4) {
+ if (roomNumber == 24 || flags[29] == 0) {
+ color_abc(kColorYellow);
}
} else {
- color_abc(AMARILLO);
- }
- if (hay_sb == 1) {
- sku = new Common::File;
- sku->open(filename);
- if (!sku->isOpen()) {
- error("no puedo abrir archivo de voz");
- }
- ctvd_init(2);
- ctvd_speaker(1);
- ctvd_output(sku);
+ color_abc(kColorYellow);
}
-bucless:
-
- cara = _rnd->getRandomNumber(5);
+ talkInit(filename);
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ do {
+ face = _rnd->getRandomNumber(5);
- updateRefresh_pre();
- if (num_ejec == 2)
- copyBackground(hare_x, hare_y, ANCHOBJ + 1, 0, ancho_hare, alto_talk - 1, dir_zona_pantalla, dir_dibujo3);
- else
- copyBackground(hare_x, hare_y, ANCHOBJ + 1, 0, (int)(((float)ancho_hare / 100) * factor_red[hare_y + alto_hare]),
- (int)(((float)(alto_talk - 1) / 100) * factor_red[hare_y + alto_hare]),
- dir_zona_pantalla, dir_dibujo3);
-
- pon_hare();
-
- if (num_ejec == 2) {
- if (!strcmp(fondo_y_menu, "99.alg") || !strcmp(fondo_y_menu, "994.alg"))
- copyBackground(ANCHOBJ + 1, 0, hare_x, hare_y, ancho_hare, alto_talk - 1, dir_dibujo3, dir_zona_pantalla);
- } else {
- copyBackground(ANCHOBJ + 1, 0, hare_x, hare_y, (int)(((float)ancho_hare / 100) * factor_red[hare_y + alto_hare]),
- (int)(((float)(alto_talk - 1) / 100) * factor_red[hare_y + alto_hare]),
- dir_dibujo3, dir_zona_pantalla);
- }
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
- if (sentido_hare == 0) {
- if (num_ejec == 2)
- copyRect(x_talk_izq[cara], y_mask_talk, hare_x + 8, hare_y - 1, ancho_talk, alto_talk,
- dir_hare_dch, dir_zona_pantalla);
- else
- reduce_hare_chico(x_talk_izq[cara], y_mask_talk, hare_x + (int)((8.0f / 100) * factor_red[hare_y + alto_hare]),
- hare_y, ancho_talk, alto_talk, factor_red[hare_y + alto_hare],
- dir_hare_dch, dir_zona_pantalla);
-
- updateRefresh();
- } else if (sentido_hare == 1) {
- if (num_ejec == 2)
- copyRect(x_talk_dch[cara], y_mask_talk, hare_x + 12, hare_y, ancho_talk, alto_talk,
- dir_hare_dch, dir_zona_pantalla);
- else
- reduce_hare_chico(x_talk_dch[cara], y_mask_talk, hare_x + (int)((12.0f / 100) * factor_red[hare_y + alto_hare]),
- hare_y, ancho_talk, alto_talk, factor_red[hare_y + alto_hare], dir_hare_dch, dir_zona_pantalla);
- updateRefresh();
- } else if (sentido_hare == 2) {
- if (num_ejec == 2)
- copyRect(x_talk_izq[cara], y_mask_talk, hare_x + 12, hare_y, ancho_talk, alto_talk,
- dir_hare_frente, dir_zona_pantalla);
- else
- reduce_hare_chico(x_talk_izq[cara], y_mask_talk,
- suma_1_pixel + hare_x + (int)((12.0f / 100) * factor_red[hare_y + alto_hare]),
- hare_y, ancho_talk, alto_talk, factor_red[hare_y + alto_hare],
- dir_hare_frente, dir_zona_pantalla);
- updateRefresh();
- } else if (sentido_hare == 3) {
- if (num_ejec == 2)
- copyRect(x_talk_dch[cara], y_mask_talk, hare_x + 8, hare_y, ancho_talk, alto_talk,
- dir_hare_frente, dir_zona_pantalla);
+ updateRefresh_pre();
+ if (currentChapter == 2)
+ copyBackground(curX, curY, OBJWIDTH + 1, 0, curWidth, talkHeight - 1, screenSurface, drawSurface3);
else
- reduce_hare_chico(x_talk_dch[cara], y_mask_talk,
- suma_1_pixel + hare_x + (int)((8.0f / 100) * factor_red[hare_y + alto_hare]),
- hare_y, ancho_talk,alto_talk, factor_red[hare_y + alto_hare],
- dir_hare_frente, dir_zona_pantalla);
- updateRefresh();
- }
+ copyBackground(curX, curY, OBJWIDTH + 1, 0, (int)(((float)curWidth / 100) * factor_red[curY + curHeight]),
+ (int)(((float)(talkHeight - 1) / 100) * factor_red[curY + curHeight]),
+ screenSurface, drawSurface3);
+
+ moveCharacters();
+
+ if (currentChapter == 2) {
+ if (!strcmp(menuBackground, "99.alg") || !strcmp(menuBackground, "994.alg"))
+ copyBackground(OBJWIDTH + 1, 0, curX, curY, curWidth, talkHeight - 1, drawSurface3, screenSurface);
+ } else {
+ copyBackground(OBJWIDTH + 1, 0, curX, curY, (int)(((float)curWidth / 100) * factor_red[curY + curHeight]),
+ (int)(((float)(talkHeight - 1) / 100) * factor_red[curY + curHeight]),
+ drawSurface3, screenSurface);
+ }
- if (con_voces == 0)
- centra_texto(dicho, hare_x, hare_y);
+ if (trackProtagonist == 0) {
+ if (currentChapter == 2)
+ copyRect(x_talk_izq[face], y_mask_talk, curX + 8, curY - 1, talkWidth, talkHeight,
+ extraSurface, screenSurface);
+ else
+ reduce_hare_chico(x_talk_izq[face], y_mask_talk, curX + (int)((8.0f / 100) * factor_red[curY + curHeight]),
+ curY, talkWidth, talkHeight, factor_red[curY + curHeight],
+ extraSurface, screenSurface);
+
+ updateRefresh();
+ } else if (trackProtagonist == 1) {
+ if (currentChapter == 2)
+ copyRect(x_talk_dch[face], y_mask_talk, curX + 12, curY, talkWidth, talkHeight,
+ extraSurface, screenSurface);
+ else
+ reduce_hare_chico(x_talk_dch[face], y_mask_talk, curX + (int)((12.0f / 100) * factor_red[curY + curHeight]),
+ curY, talkWidth, talkHeight, factor_red[curY + curHeight], extraSurface, screenSurface);
+ updateRefresh();
+ } else if (trackProtagonist == 2) {
+ if (currentChapter == 2)
+ copyRect(x_talk_izq[face], y_mask_talk, curX + 12, curY, talkWidth, talkHeight,
+ frontSurface, screenSurface);
+ else
+ reduce_hare_chico(x_talk_izq[face], y_mask_talk,
+ talkOffset + curX + (int)((12.0f / 100) * factor_red[curY + curHeight]),
+ curY, talkWidth, talkHeight, factor_red[curY + curHeight],
+ frontSurface, screenSurface);
+ updateRefresh();
+ } else if (trackProtagonist == 3) {
+ if (currentChapter == 2)
+ copyRect(x_talk_dch[face], y_mask_talk, curX + 8, curY, talkWidth, talkHeight,
+ frontSurface, screenSurface);
+ else
+ reduce_hare_chico(x_talk_dch[face], y_mask_talk,
+ talkOffset + curX + (int)((8.0f / 100) * factor_red[curY + curHeight]),
+ curY, talkWidth,talkHeight, factor_red[curY + curHeight],
+ frontSurface, screenSurface);
+ updateRefresh();
+ }
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ if (withVoices == 0)
+ centerText(said, curX, curY);
- pause(3);
+ updateScreen();
- byte key = getscan();
- if (num_ejec == 1 && key == Common::KEYCODE_ESCAPE)
- term_int = 1;
- if (key != 0)
- ctvd_stop();
- buffer_teclado();
- if (hay_sb == 1) {
- if (LookForFree() != 0)
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- longitud = longitud - 2;
- if (longitud > 0)
- goto bucless;
- }
+ pause(3);
+ } while (!isTalkFinished(&length));
updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateScreen();
- if (num_ejec == 1) {
- if (music_status() == 0 && flags[11] == 0 && corta_musica == 0)
- playmusic(musica_room);
+ if (currentChapter == 1) {
+ if (musicStatus() == 0 && flags[11] == 0 && musicStopped == 0)
+ playMusic(roomMusic);
}
}
-void DrasculaEngine::talk_pianista(const char *dicho, const char *filename) {
- int tiempou;
- long tiempol;
+void DrasculaEngine::talk_pianist(int index) {
+ char filename[20];
+ sprintf(filename, "P%i.als", index);
+ const char* said = _textp[_lang][index];
int x_talk[4] = { 97, 145, 193, 241 };
- int cara;
- int longitud;
- longitud = strlen(dicho);
-
- tiempol = _system->getMillis();
- tiempou = (unsigned int)tiempol / 2;
- _rnd->setSeed(tiempou);
-
- buffer_teclado();
-
- color_abc(BLANCO);
-
- if (hay_sb == 1) {
- sku = new Common::File;
- sku->open(filename);
- if (!sku->isOpen()) {
- error("no puedo abrir archivo de voz");
- }
- ctvd_init(2);
- ctvd_speaker(1);
- ctvd_output(sku);
- }
-
-bucless:
+ int coords[7] = { 139, 228, 112, 47, 60, 221, 128 };
- cara = _rnd->getRandomNumber(3);
-
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
-
- updateRefresh_pre();
-
- copyBackground(x_talk[cara], 139, 228, 112, 47, 60,
- dir_hare_dch, dir_zona_pantalla);
- pon_hare();
- updateRefresh();
-
- if (con_voces == 0)
- centra_texto(dicho, 221, 128);
-
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- pause(3);
-
- byte key = getscan();
- if (key != 0)
- ctvd_stop();
- buffer_teclado();
- if (hay_sb == 1) {
- if (LookForFree() != 0)
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- longitud = longitud - 2;
- if (longitud > 0)
- goto bucless;
- }
-
- updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ color_abc(kColorWhite);
+ talk_generic(said, filename, x_talk, 4, coords, extraSurface);
}
-void DrasculaEngine::talk_borracho(const char *dicho, const char *filename) {
- int tiempou;
- long tiempol;
-
+void DrasculaEngine::talk_drunk(int index) {
+ char filename[20];
+ sprintf(filename, "B%i.als", index);
+ const char *said = _textb[_lang][index];
int x_talk[8] = { 1, 21, 41, 61, 81, 101, 121, 141 };
- int cara;
- int longitud;
- longitud = strlen(dicho);
+ int coords[7] = { 29, 177, 50, 19, 19, 181, 54 };
- tiempol = _system->getMillis();
- tiempou = (unsigned int)tiempol / 2;
- _rnd->setSeed(tiempou);
-
- if (num_ejec == 1) {
- loadPic("an11y13.alg");
- decompressPic(dir_hare_frente, 1);
- }
+ if (currentChapter == 1)
+ loadPic("an11y13.alg", frontSurface);
flags[13] = 1;
-bebiendo:
-
- if (flags[12] == 1) {
+ while (flags[12] == 1) {
updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- goto bebiendo;
- }
-
- buffer_teclado();
-
- color_abc(VERDE_OSCURO);
-
- if (hay_sb == 1) {
- sku = new Common::File;
- sku->open(filename);
- if (!sku->isOpen()) {
- error("no puedo abrir archivo de voz\n");
- }
- ctvd_init(2);
- ctvd_speaker(1);
- ctvd_output(sku);
+ updateScreen();
}
-bucless:
-
- cara = _rnd->getRandomNumber(7);
-
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
-
- updateRefresh_pre();
-
- copyBackground(x_talk[cara], 29, 177, 50, 19, 19, dir_hare_frente, dir_zona_pantalla);
- pon_hare();
- updateRefresh();
-
- if (con_voces == 0)
- centra_texto(dicho, 181, 54);
-
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ color_abc(kColorDarkGreen);
- pause(3);
-
- byte key = getscan();
- if (key != 0)
- ctvd_stop();
- buffer_teclado();
- if (hay_sb == 1) {
- if (LookForFree() != 0)
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- longitud = longitud - 2;
- if (longitud > 0)
- goto bucless;
- }
-
- updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ talk_generic(said, filename, x_talk, 8, coords, frontSurface);
flags[13] = 0;
- if (num_ejec == 1) {
- loadPic("96.alg");
- decompressPic(dir_hare_frente, 1);
- }
+ if (currentChapter == 1)
+ loadPic("96.alg", frontSurface);
- if (num_ejec == 1) {
- if (music_status() == 0 && flags[11] == 0)
- playmusic(musica_room);
- } else if (num_ejec == 2) {
- if (music_status() == 0 && flags[11] == 0 && musica_room != 0)
- playmusic(musica_room);
+ if (currentChapter == 1) {
+ if (musicStatus() == 0 && flags[11] == 0)
+ playMusic(roomMusic);
+ } else if (currentChapter == 2) {
+ if (musicStatus() == 0 && flags[11] == 0 && roomMusic != 0)
+ playMusic(roomMusic);
}
}
-void DrasculaEngine::talk_vb(const char *dicho, const char *filename) {
- int tiempou;
- long tiempol;
-
+void DrasculaEngine::talk_vonBraun(int index) {
+ char filename[20];
+ sprintf(filename, "VB%i.als", index);
+ const char *said = _textvb[_lang][index];
int x_talk[6] = {1, 27, 53, 79, 105, 131};
- int cara;
+ int face;
+ int length = strlen(said);
- int longitud;
- longitud = strlen(dicho);
+ color_abc(kColorBrown);
- tiempol = _system->getMillis();
- tiempou = (unsigned int)tiempol / 2;
- _rnd->setSeed(tiempou);
+ talkInit(filename);
- buffer_teclado();
+ copyBackground(vonBraunX + 5, 64, OBJWIDTH + 1, 0, 25, 27, bgSurface, drawSurface3);
- color_abc(VON_BRAUN);
+ do {
+ if (trackVonBraun == 1) {
+ face = _rnd->getRandomNumber(5);
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
- if (hay_sb == 1) {
- sku = new Common::File;
- sku->open(filename);
- if (!sku->isOpen()) {
- error("no puedo abrir archivo de voz");
- }
- ctvd_init(2);
- ctvd_speaker(1);
- ctvd_output(sku);
- }
-
- copyBackground(vb_x + 5, 64, ANCHOBJ + 1, 0, 25, 27, dir_dibujo1, dir_dibujo3);
-
-bucless:
+ moveCharacters();
+ moveVonBraun();
- if (sentido_vb == 1) {
- cara = _rnd->getRandomNumber(5);
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
-
- pon_hare();
- pon_vb();
-
- copyBackground(ANCHOBJ + 1, 0, vb_x + 5, 64, 25, 27, dir_dibujo3, dir_zona_pantalla);
- copyRect(x_talk[cara], 34, vb_x + 5, 64, 25, 27, dir_hare_frente, dir_zona_pantalla);
- updateRefresh();
- }
-
- if (con_voces == 0)
- centra_texto(dicho, vb_x, 66);
+ copyBackground(OBJWIDTH + 1, 0, vonBraunX + 5, 64, 25, 27, drawSurface3, screenSurface);
+ copyRect(x_talk[face], 34, vonBraunX + 5, 64, 25, 27, frontSurface, screenSurface);
+ updateRefresh();
+ }
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ if (withVoices == 0)
+ centerText(said, vonBraunX, 66);
- pause(3);
+ updateScreen();
- int key = getscan();
- if (key != 0)
- ctvd_stop();
- buffer_teclado();
- if (hay_sb == 1) {
- if (LookForFree() != 0)
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- longitud = longitud - 2;
- if (longitud > 0)
- goto bucless;
- }
+ pause(3);
+ } while (!isTalkFinished(&length));
updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- if (music_status() == 0 && flags[11] == 0 && musica_room != 0)
- playmusic(musica_room);
+ updateScreen();
+ if (musicStatus() == 0 && flags[11] == 0 && roomMusic != 0)
+ playMusic(roomMusic);
}
-void DrasculaEngine::talk_vbpuerta(const char *dicho, const char *filename) {
- int tiempou;
- long tiempol;
-
- int longitud;
- longitud = strlen(dicho);
+void DrasculaEngine::talk_vonBraunpuerta(int index) {
+ char filename[20];
+ sprintf(filename, "VB%i.als", index);
+ const char *said = _textvb[_lang][index];
+ int length = strlen(said);
- tiempol = _system->getMillis();
- tiempou = (unsigned int)tiempol / 2;
- _rnd->setSeed(tiempou);
+ color_abc(kColorBrown);
- buffer_teclado();
+ talkInit(filename);
- color_abc(VON_BRAUN);
+ do {
+ updateRoom();
- if (hay_sb == 1) {
- sku = new Common::File;
- sku->open(filename);
- if (!sku->isOpen()) {
- error("no puedo abrir archivo de voz");
- }
- ctvd_init(2);
- ctvd_speaker(1);
- ctvd_output(sku);
- }
+ if (withVoices == 0)
+ centerText(said, 150, 80);
-bucless:
+ updateScreen();
+ } while (!isTalkFinished(&length));
updateRoom();
- if (con_voces == 0)
- centra_texto(dicho, 150, 80);
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- int key = getscan();
- if (key != 0)
- ctvd_stop();
- buffer_teclado();
- if (hay_sb == 1) {
- if (LookForFree() != 0)
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- longitud = longitud - 2;
- if (longitud > 0)
- goto bucless;
- }
-
- updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- if (music_status() == 0 && flags[11] == 0 && musica_room != 0)
- playmusic(musica_room);
+ updateScreen();
+ if (musicStatus() == 0 && flags[11] == 0 && roomMusic != 0)
+ playMusic(roomMusic);
}
-void DrasculaEngine::talk_ciego(const char *dicho, const char *filename, const char *sincronia) {
- byte *num_cara;
+void DrasculaEngine::talk_blind(int index) {
+ // Special case: a second array is used for sync here
+ // Also, the blind man's texts in the first array and his
+ // voice files start from 58, not 1
+ char filename[20];
+ sprintf(filename, "d%i.als", index + TEXTD_START - 1);
+ const char *said = _textd[_lang][index + TEXTD_START - 1];
+ const char *syncChar = _textd1[_lang][index - 1];
+
+ byte *faceBuffer;
int p = 0;
- int pos_ciego[6];
- int cara = 0;
+ int pos_blind[6] = { 0, 2, 73, 1, 126, 149 };
+ int length = strlen(said);
- int longitud;
- longitud = strlen(dicho);
+ color_abc(kColorBrown);
- buffer_teclado();
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
+ updateScreen();
- color_abc(VON_BRAUN);
+ talkInit(filename);
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ do {
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
+ pos_blind[5] = 149;
+ char c = toupper(syncChar[p]);
- if (hay_sb == 1) {
- sku = new Common::File;
- sku->open(filename);
- if (!sku->isOpen()) {
- error("no puedo abrir archivo de voz");
+ if (c == '0' || c == '2' || c == '4' || c == '6')
+ pos_blind[0] = 1;
+ else
+ pos_blind[0] = 132;
+
+ if (c == '0' || c == '1')
+ faceBuffer = drawSurface3;
+ else if (c == '2' || c == '3')
+ faceBuffer = extraSurface;
+ else if (c == '4' || c == '5')
+ faceBuffer = backSurface;
+ else {
+ faceBuffer = frontSurface;
+ pos_blind[5] = 146;
}
- ctvd_init(2);
- ctvd_speaker(1);
- ctvd_output(sku);
- }
-
- pos_ciego[1] = 2;
- pos_ciego[2] = 73;
- pos_ciego[3] = 1;
- pos_ciego[4] = 126;
- pos_ciego[5] = 149;
-
-bucless:
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- pos_ciego[5] = 149;
- char c = toupper(sincronia[p]);
- if (c == '0')
- cara = 0;
- if (c == '1')
- cara = 1;
- if (c == '2')
- cara = 2;
- if (c == '3')
- cara = 3;
- if (c == '4')
- cara = 4;
- if (c == '5')
- cara = 5;
- if (c == '6')
- cara = 6;
- if (c == '7')
- cara = 7;
-
- if (cara == 0 || cara == 2 || cara == 4 || cara == 6)
- pos_ciego[0] = 1;
- else
- pos_ciego[0] = 132;
-
- if (cara == 0)
- num_cara = dir_dibujo3;
- else if (cara == 1)
- num_cara = dir_dibujo3;
- else if (cara == 2)
- num_cara = dir_hare_dch;
- else if (cara == 3)
- num_cara = dir_hare_dch;
- else if (cara == 4)
- num_cara = dir_hare_fondo;
- else if (cara == 5)
- num_cara = dir_hare_fondo;
- else {
- num_cara = dir_hare_frente;
- pos_ciego[5] = 146;
- }
-
- copyRectClip( pos_ciego, num_cara, dir_zona_pantalla);
- if (con_voces == 0)
- centra_texto(dicho, 310, 71);
+ copyRectClip( pos_blind, faceBuffer, screenSurface);
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- pause(2);
- p++;
+ if (withVoices == 0)
+ centerText(said, 310, 71);
- int key = getscan();
- if (key != 0)
- ctvd_stop();
- buffer_teclado();
- if (hay_sb == 1) {
- if (LookForFree() != 0)
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- longitud = longitud - 2;
- if (longitud > 0)
- goto bucless;
- }
+ updateScreen();
+ pause(2);
+ p++;
+ } while (!isTalkFinished(&length));
}
-void DrasculaEngine::talk_hacker(const char *dicho, const char *filename) {
- int tiempou;
- long tiempol;
-
- int longitud;
- longitud = strlen(dicho);
-
- tiempol = _system->getMillis();
- tiempou = (unsigned int)tiempol / 2;
- _rnd->setSeed(tiempou);
+void DrasculaEngine::talk_hacker(int index) {
+ char filename[20];
+ sprintf(filename, "d%i.als", index);
+ const char *said = _textd[_lang][index];
+ int length = strlen(said);
- buffer_teclado();
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
+ updateScreen();
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ color_abc(kColorYellow);
- color_abc(AMARILLO);
+ talkInit(filename);
- if (hay_sb == 1) {
- sku = new Common::File;
- sku->open(filename);
- if (!sku->isOpen()) {
- error("no puedo abrir archivo de voz");
- }
- ctvd_init(2);
- ctvd_speaker(1);
- ctvd_output(sku);
- }
-
-bucless:
- if (con_voces == 0)
- centra_texto(dicho, 156, 170);
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- int key = getscan();
- if (key != 0)
- ctvd_stop();
- if (hay_sb == 1) {
- if (LookForFree() != 0)
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- longitud = longitud - 2;
- if (longitud > 0)
- goto bucless;
- }
-
- key = 0;
+ do {
+ if (withVoices == 0)
+ centerText(said, 156, 170);
+ updateScreen();
+ } while (!isTalkFinished(&length));
}
-void DrasculaEngine::talk_lobo(const char *dicho, const char *filename) {
- int tiempou;
- long tiempol;
-
+void DrasculaEngine::talk_werewolf(int index) {
+ char filename[20];
+ sprintf(filename, "L%i.als", index);
+ const char *said = _textl[_lang][index];
int x_talk[9] = {52, 79, 106, 133, 160, 187, 214, 241, 268};
- int cara;
-
- int longitud;
- longitud = strlen(dicho);
-
- tiempol = _system->getMillis();
- tiempou = (unsigned int)tiempol / 2;
- _rnd->setSeed(tiempou);
-
- color_abc(ROJO);
-
- if (hay_sb == 1) {
- sku = new Common::File;
- sku->open(filename);
- if (!sku->isOpen()) {
- error("no puedo abrir archivo de voz");
- }
- ctvd_init(2);
- ctvd_speaker(1);
- ctvd_output(sku);
- }
+ int coords[7] = { 136, 198, 81, 26, 24, 203, 78 };
-bucless:
-
- cara = _rnd->getRandomNumber(8);
-
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
-
- updateRefresh_pre();
-
- copyBackground(x_talk[cara], 136, 198, 81, 26, 24, dir_dibujo3, dir_zona_pantalla);
- pon_hare();
- updateRefresh();
-
- if (con_voces == 0)
- centra_texto(dicho, 203, 78);
-
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- pause(3);
-
- int key = getscan();
- if (key != 0)
- ctvd_stop();
- buffer_teclado();
- if (hay_sb == 1) {
- if (LookForFree() != 0)
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- longitud = longitud - 2;
- if (longitud > 0)
- goto bucless;
- }
-
- updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ color_abc(kColorRed);
+ talk_generic(said, filename, x_talk, 9, coords, drawSurface3);
}
-void DrasculaEngine::talk_mus(const char *dicho, const char *filename) {
- int tiempou;
- long tiempol;
-
+void DrasculaEngine::talk_mus(int index) {
+ char filename[20];
+ sprintf(filename, "E%i.als", index);
+ const char *said = _texte[_lang][index];
int x_talk[8] = { 16, 35, 54, 73, 92, 111, 130, 149};
- int cara;
+ int coords[7] = { 156, 190, 64, 18, 24, 197, 64 };
- int longitud;
- longitud = strlen(dicho);
-
- tiempol = _system->getMillis();
- tiempou = (unsigned int)tiempol / 2;
- _rnd->setSeed(tiempou);
-
- buffer_teclado();
-
- color_abc(BLANCO);
-
- if (hay_sb == 1) {
- sku = new Common::File;
- sku->open(filename);
- if (!sku->isOpen()) {
- error("no puedo abrir archivo de voz");
- }
- ctvd_init(2);
- ctvd_speaker(1);
- ctvd_output(sku);
- }
-
-bucless:
-
- cara = _rnd->getRandomNumber(7);
-
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
-
- updateRefresh_pre();
-
- copyBackground(x_talk[cara], 156, 190, 64, 18, 24, dir_dibujo3, dir_zona_pantalla);
- pon_hare();
- updateRefresh();
-
- if (con_voces == 0)
- centra_texto(dicho, 197, 64);
-
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- pause(3);
-
- int key = getscan();
- if (key != 0)
- ctvd_stop();
- buffer_teclado();
- if (hay_sb == 1) {
- if (LookForFree() != 0)
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- longitud = longitud - 2;
- if (longitud > 0)
- goto bucless;
- }
-
- updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ color_abc(kColorWhite);
+ talk_generic(said, filename, x_talk, 8, coords, drawSurface3);
}
-void DrasculaEngine::talk_pen(const char *dicho, const char *filename) {
- int tiempou;
- long tiempol;
-
+void DrasculaEngine::talk_pen(const char *said, const char *filename, int talkerType) {
int x_talk[8] = {112, 138, 164, 190, 216, 242, 268, 294};
- int cara;
-
- int longitud;
- longitud = strlen(dicho);
+ int x_talk2[5] = {122, 148, 174, 200, 226};
+ int face;
+ int length = strlen(said);
flags[1] = 1;
- updateRoom();
- copyRect(44, 145, 145, 105, 25, 29, dir_dibujo3, dir_zona_pantalla);
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- tiempol = _system->getMillis();
- tiempou = (unsigned int)tiempol / 2;
- _rnd->setSeed(tiempou);
-
- buffer_teclado();
-
- color_abc(AMARILLO);
-
- if (hay_sb == 1) {
- sku = new Common::File;
- sku->open(filename);
- if (!sku->isOpen()) {
- error("no puedo abrir archivo de voz");
- }
- ctvd_init(2);
- ctvd_speaker(1);
- ctvd_output(sku);
- }
-
-bucless:
-
- cara = _rnd->getRandomNumber(7);
-
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
-
- updateRefresh_pre();
-
- copyRect(x_talk[cara], 145, 145, 105, 25, 29, dir_dibujo3, dir_zona_pantalla);
-
- updateRefresh();
-
- if (con_voces == 0)
- centra_texto(dicho, 160, 105);
-
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- pause(3);
-
- int key = getscan();
- if (key != 0)
- ctvd_stop();
- buffer_teclado();
- if (hay_sb == 1) {
- if (LookForFree() != 0)
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- longitud = longitud - 2;
- if (longitud > 0)
- goto bucless;
+ if (talkerType == 0) {
+ updateRoom();
+ copyRect(44, 145, 145, 105, 25, 29, drawSurface3, screenSurface);
+ updateScreen();
}
- flags[1] = 0;
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- updateRefresh_pre();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-}
-
-void DrasculaEngine::talk_pen2(const char *dicho, const char *filename) {
- int tiempou;
- long tiempol;
-
- int x_talk[5]={122, 148, 174, 200, 226};
- int cara;
+ color_abc(kColorYellow);
- int longitud;
- longitud = strlen(dicho);
+ talkInit(filename);
- flags[1] = 1;
+ do {
+ if (talkerType == 0)
+ face = _rnd->getRandomNumber(7);
+ else
+ face = _rnd->getRandomNumber(4);
- tiempol = _system->getMillis();
- tiempou = (unsigned int)tiempol / 2;
- _rnd->setSeed(tiempou);
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
+ updateRefresh_pre();
- buffer_teclado();
+ if (talkerType == 0)
+ copyRect(x_talk[face], 145, 145, 105, 25, 29, drawSurface3, screenSurface);
+ else
+ copyBackground(x_talk2[face], 171, 173, 116, 25, 28, drawSurface3, screenSurface);
- color_abc(AMARILLO);
+ updateRefresh();
- if (hay_sb == 1) {
- sku = new Common::File;
- sku->open(filename);
- if (!sku->isOpen()) {
- error("no puedo abrir archivo de voz");
+ if (withVoices == 0) {
+ if (talkerType == 0)
+ centerText(said, 160, 105);
+ else
+ centerText(said, 195, 107);
}
- ctvd_init(2);
- ctvd_speaker(1);
- ctvd_output(sku);
- }
-
-bucless:
-
- cara = _rnd->getRandomNumber(4);
-
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
-
- updateRefresh_pre();
- copyBackground(x_talk[cara], 171, 173, 116, 25, 28, dir_dibujo3, dir_zona_pantalla);
+ updateScreen();
- updateRefresh();
-
- if (con_voces == 0)
- centra_texto(dicho, 195, 107);
-
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- pause(3);
-
- int key = getscan();
- if (key != 0)
- ctvd_stop();
- buffer_teclado();
- if (hay_sb == 1) {
- if (LookForFree() != 0)
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- longitud = longitud - 2;
- if (longitud > 0)
- goto bucless;
- }
+ pause(3);
+ } while (!isTalkFinished(&length));
flags[1] = 0;
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
updateRefresh_pre();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateScreen();
}
-void DrasculaEngine::talk_taber2(const char *dicho, const char *filename) {
- int tiempou;
- long tiempol;
-
- int x_talk[6] = {1, 23, 45, 67, 89, 111};
- int cara;
-
- int longitud;
- longitud = strlen(dicho);
-
- tiempol = _system->getMillis();
- tiempou = (unsigned int)tiempol / 2;
- _rnd->setSeed(tiempou);
-
- buffer_teclado();
-
- color_abc(MARRON);
-
- if (hay_sb == 1) {
- sku = new Common::File;
- sku->open(filename);
- if (!sku->isOpen()) {
- error("no puedo abrir archivo de voz");
- }
- ctvd_init(2);
- ctvd_speaker(1);
- ctvd_output(sku);
- }
-
-bucless:
-
- cara = _rnd->getRandomNumber(5);
-
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
-
- updateRefresh_pre();
-
- copyBackground(x_talk[cara], 130, 151, 43, 21, 24, dir_dibujo3, dir_zona_pantalla);
- pon_hare();
- updateRefresh();
-
- if (con_voces == 0)
- centra_texto(dicho, 132, 45);
-
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- pause(3);
-
- int key = getscan();
- if (key != 0)
- ctvd_stop();
- buffer_teclado();
- if (hay_sb == 1) {
- if (LookForFree() != 0)
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- longitud = longitud - 2;
- if (longitud > 0)
- goto bucless;
- }
-
- updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-}
-
-void DrasculaEngine::talk_bj_cama(const char *dicho, const char *filename) {
- int tiempou;
- long tiempol;
-
+void DrasculaEngine::talk_bj_bed(int index) {
+ char filename[20];
+ sprintf(filename, "BJ%i.als", index);
+ const char *said = _textbj[_lang][index];
int x_talk[5] = {51, 101, 151, 201, 251};
- int cara;
-
- int longitud;
- longitud = strlen(dicho);
+ int face;
+ int length = strlen(said);
- tiempol = _system->getMillis();
- tiempou = (unsigned int)tiempol / 2;
- _rnd->setSeed(tiempou);
+ color_abc(kColorWhite);
- buffer_teclado();
+ talkInit(filename);
- color_abc(BLANCO);
+ do {
+ face = _rnd->getRandomNumber(4);
- if (hay_sb == 1) {
- sku = new Common::File;
- sku->open(filename);
- if (!sku->isOpen()) {
- error("no puedo abrir archivo de voz");
- }
- ctvd_init(2);
- ctvd_speaker(1);
- ctvd_output(sku);
- }
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
-bucless:
-
- cara = _rnd->getRandomNumber(4);
-
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
-
- updateRefresh_pre();
+ updateRefresh_pre();
- copyBackground(65, 103, 65, 103, 49, 38, dir_dibujo1, dir_zona_pantalla);
- copyRect(x_talk[cara], 105, 65, 103, 49, 38, dir_dibujo3, dir_zona_pantalla);
- pon_hare();
- updateRefresh();
+ copyBackground(65, 103, 65, 103, 49, 38, bgSurface, screenSurface);
+ copyRect(x_talk[face], 105, 65, 103, 49, 38, drawSurface3, screenSurface);
+ moveCharacters();
+ updateRefresh();
- if (con_voces == 0)
- centra_texto(dicho, 104, 102);
+ if (withVoices == 0)
+ centerText(said, 104, 102);
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateScreen();
- pause(3);
+ pause(3);
+ } while (!isTalkFinished(&length));
- int key = getscan();
- if (key != 0)
- ctvd_stop();
- buffer_teclado();
- if (hay_sb == 1) {
- if (LookForFree() != 0)
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- longitud = longitud - 2;
- if (longitud > 0)
- goto bucless;
- }
updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateScreen();
}
-void DrasculaEngine::talk_htel(const char *dicho, const char *filename) {
- int tiempou;
- long tiempol;
- char *num_cara;
-
+void DrasculaEngine::talk_htel(int index) {
+ char filename[20];
+ sprintf(filename, "%i.als", index);
+ const char *said = _text[_lang][index];
+ char *faceBuffer;
int x_talk[3] = {1, 94, 187};
- int cara, pantalla;
+ int face, curScreen;
+ int length = strlen(said);
- int longitud;
- longitud = strlen(dicho);
+ color_abc(kColorYellow);
- tiempol = _system->getMillis();
- tiempou = (unsigned int)tiempol / 2;
- _rnd->setSeed(tiempou);
+ talkInit(filename);
- buffer_teclado();
-
- color_abc(AMARILLO);
-
- if (hay_sb == 1) {
- sku = new Common::File;
- sku->open(filename);
- if (!sku->isOpen()) {
- error("no puedo abrir archivo de voz");
- }
- ctvd_init(2);
- ctvd_speaker(1);
- ctvd_output(sku);
- }
+ do {
+ face = _rnd->getRandomNumber(2);
+ curScreen = _rnd->getRandomNumber(2);
-bucless:
-
- cara = _rnd->getRandomNumber(2);
- pantalla = _rnd->getRandomNumber(2);
-
- if (cara == 0 && pantalla == 0)
- num_cara = (char *)dir_dibujo3;
- else if (pantalla == 1)
- num_cara = (char *)dir_hare_frente;
- else
- num_cara = (char *)dir_hare_fondo;
-
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ if (face == 0 && curScreen == 0)
+ faceBuffer = (char *)drawSurface3;
+ else if (curScreen == 1)
+ faceBuffer = (char *)frontSurface;
+ else
+ faceBuffer = (char *)backSurface;
- copyBackground(x_talk[cara], 1, 45, 24, 92, 108, (byte *)num_cara, dir_zona_pantalla);
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
- if (con_voces == 0)
- centra_texto(dicho, 90, 50);
+ copyBackground(x_talk[face], 1, 45, 24, 92, 108, (byte *)faceBuffer, screenSurface);
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
- pause(3);
+ if (withVoices == 0)
+ centerText(said, 90, 50);
- int key = getscan();
- if (key != 0)
- ctvd_stop();
- buffer_teclado();
- if (hay_sb == 1) {
- if (LookForFree() != 0)
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- longitud = longitud - 2;
- if (longitud > 0)
- goto bucless;
- }
+ updateScreen();
+ pause(3);
+ } while (!isTalkFinished(&length));
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
+ updateScreen();
}
-void DrasculaEngine::talk_sinc(const char *dicho, const char *filename, const char *sincronia) {
- int suma_1_pixel = 1;
+void DrasculaEngine::talk_sync(const char *said, const char *filename, const char *syncChar) {
+ int talkOffset = 1;
int y_mask_talk = 170;
- int x_talk_dch[6] = {1, 25, 49, 73, 97, 121};
- int x_talk_izq[6] = {145, 169, 193, 217, 241, 265};
- int p, cara = 0;
-
- int longitud;
- longitud = strlen(dicho);
+ int p, face = 0;
+ int length = strlen(said);
+ char buf[2];
- buffer_teclado();
+ color_abc(kColorYellow);
- color_abc(AMARILLO);
-
- if (num_ejec == 1) {
- if (factor_red[hare_y + alto_hare] == 100)
- suma_1_pixel = 0;
+ if (currentChapter == 1) {
+ if (factor_red[curY + curHeight] == 100)
+ talkOffset = 0;
}
p = 0;
- if (hay_sb == 1) {
- sku = new Common::File;
- sku->open(filename);
- if (!sku->isOpen()) {
- error("no puedo abrir archivo de voz");
- }
- ctvd_init(2);
- ctvd_speaker(1);
- ctvd_output(sku);
- }
+ talkInit(filename);
-bucless:
-
- if (sincronia[p] == '0')
- cara = 0;
- if (sincronia[p] == '1')
- cara = 1;
- if (sincronia[p] == '2')
- cara = 2;
- if (sincronia[p] == '3')
- cara = 3;
- if (sincronia[p] == '4')
- cara = 4;
- if (sincronia[p] == '5')
- cara = 5;
- if (sincronia[p] == '6')
- cara = 6;
- if (sincronia[p] == '7')
- cara = 7;
-
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
+ do {
+ strncpy(buf, &syncChar[p], 1);
+ face = atoi(buf);
- updateRefresh_pre();
- if (num_ejec == 2)
- copyBackground(hare_x, hare_y, ANCHOBJ + 1, 0, ancho_hare, alto_talk - 1, dir_zona_pantalla, dir_dibujo3);
- else
- copyBackground(hare_x, hare_y, ANCHOBJ + 1, 0, (int)(((float)ancho_hare / 100) * factor_red[hare_y + alto_hare]),
- (int)(((float)(alto_talk - 1) / 100) * factor_red[hare_y + alto_hare]), dir_zona_pantalla, dir_dibujo3);
- pon_hare();
- if (num_ejec == 2) {
- if (alto_hare != 56)
- copyBackground(ANCHOBJ + 1, 0, hare_x, hare_y, ancho_hare, alto_talk - 1, dir_dibujo3, dir_zona_pantalla);
- } else
- copyBackground(ANCHOBJ + 1, 0, hare_x, hare_y, (int)(((float)ancho_hare / 100) * factor_red[hare_y + alto_hare]),
- (int)(((float)(alto_talk - 1) / 100) * factor_red[hare_y + alto_hare]), dir_dibujo3, dir_zona_pantalla);
-
- if (sentido_hare == 0) {
- if (num_ejec == 2)
- copyRect(x_talk_izq[cara], y_mask_talk, hare_x + 8, hare_y - 1, ancho_talk, alto_talk, dir_hare_dch, dir_zona_pantalla);
- else
- reduce_hare_chico(x_talk_izq[cara], y_mask_talk, (int)(hare_x + (8.0f / 100) * factor_red[hare_y + alto_hare]),
- hare_y, ancho_talk, alto_talk, factor_red[hare_y + alto_hare], dir_hare_dch, dir_zona_pantalla);
- updateRefresh();
- } else if (sentido_hare == 1) {
- if (num_ejec == 2)
- copyRect(x_talk_dch[cara], y_mask_talk, hare_x + 12, hare_y, ancho_talk, alto_talk, dir_hare_dch, dir_zona_pantalla);
- else
- reduce_hare_chico(x_talk_dch[cara], y_mask_talk, (int)(hare_x + (12.0f / 100) * factor_red[hare_y + alto_hare]),
- hare_y, ancho_talk, alto_talk, factor_red[hare_y + alto_hare], dir_hare_dch, dir_zona_pantalla);
- updateRefresh();
- } else if (sentido_hare == 2) {
- if (num_ejec == 2)
- copyRect(x_talk_izq[cara], y_mask_talk, hare_x + 12, hare_y, ancho_talk, alto_talk, dir_hare_frente, dir_zona_pantalla);
- else
- reduce_hare_chico(x_talk_izq[cara], y_mask_talk,
- (int)(suma_1_pixel + hare_x + (12.0f / 100) * factor_red[hare_y + alto_hare]), hare_y,
- ancho_talk, alto_talk, factor_red[hare_y + alto_hare], dir_hare_frente, dir_zona_pantalla);
- updateRefresh();
- } else if (sentido_hare == 3) {
- if (num_ejec == 2)
- copyRect(x_talk_dch[cara], y_mask_talk, hare_x + 8, hare_y, ancho_talk, alto_talk, dir_hare_frente, dir_zona_pantalla);
- else
- reduce_hare_chico(x_talk_dch[cara], y_mask_talk,
- (int)(suma_1_pixel + hare_x + (8.0f / 100) * factor_red[hare_y + alto_hare]), hare_y,
- ancho_talk, alto_talk, factor_red[hare_y + alto_hare], dir_hare_frente, dir_zona_pantalla);
- updateRefresh();
- }
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
- if (con_voces == 0)
- centra_texto(dicho, hare_x, hare_y);
+ updateRefresh_pre();
+ if (currentChapter == 2)
+ copyBackground(curX, curY, OBJWIDTH + 1, 0, curWidth, talkHeight - 1, screenSurface, drawSurface3);
+ else
+ copyBackground(curX, curY, OBJWIDTH + 1, 0, (int)(((float)curWidth / 100) * factor_red[curY + curHeight]),
+ (int)(((float)(talkHeight - 1) / 100) * factor_red[curY + curHeight]), screenSurface, drawSurface3);
+ moveCharacters();
+ if (currentChapter == 2) {
+ if (curHeight != 56)
+ copyBackground(OBJWIDTH + 1, 0, curX, curY, curWidth, talkHeight - 1, drawSurface3, screenSurface);
+ } else
+ copyBackground(OBJWIDTH + 1, 0, curX, curY, (int)(((float)curWidth / 100) * factor_red[curY + curHeight]),
+ (int)(((float)(talkHeight - 1) / 100) * factor_red[curY + curHeight]), drawSurface3, screenSurface);
+
+ if (trackProtagonist == 0) {
+ if (currentChapter == 2)
+ copyRect(x_talk_izq[face], y_mask_talk, curX + 8, curY - 1, talkWidth, talkHeight, extraSurface, screenSurface);
+ else
+ reduce_hare_chico(x_talk_izq[face], y_mask_talk, (int)(curX + (8.0f / 100) * factor_red[curY + curHeight]),
+ curY, talkWidth, talkHeight, factor_red[curY + curHeight], extraSurface, screenSurface);
+ updateRefresh();
+ } else if (trackProtagonist == 1) {
+ if (currentChapter == 2)
+ copyRect(x_talk_dch[face], y_mask_talk, curX + 12, curY, talkWidth, talkHeight, extraSurface, screenSurface);
+ else
+ reduce_hare_chico(x_talk_dch[face], y_mask_talk, (int)(curX + (12.0f / 100) * factor_red[curY + curHeight]),
+ curY, talkWidth, talkHeight, factor_red[curY + curHeight], extraSurface, screenSurface);
+ updateRefresh();
+ } else if (trackProtagonist == 2) {
+ if (currentChapter == 2)
+ copyRect(x_talk_izq[face], y_mask_talk, curX + 12, curY, talkWidth, talkHeight, frontSurface, screenSurface);
+ else
+ reduce_hare_chico(x_talk_izq[face], y_mask_talk,
+ (int)(talkOffset + curX + (12.0f / 100) * factor_red[curY + curHeight]), curY,
+ talkWidth, talkHeight, factor_red[curY + curHeight], frontSurface, screenSurface);
+ updateRefresh();
+ } else if (trackProtagonist == 3) {
+ if (currentChapter == 2)
+ copyRect(x_talk_dch[face], y_mask_talk, curX + 8, curY, talkWidth, talkHeight, frontSurface, screenSurface);
+ else
+ reduce_hare_chico(x_talk_dch[face], y_mask_talk,
+ (int)(talkOffset + curX + (8.0f / 100) * factor_red[curY + curHeight]), curY,
+ talkWidth, talkHeight, factor_red[curY + curHeight], frontSurface, screenSurface);
+ updateRefresh();
+ }
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ if (withVoices == 0)
+ centerText(said, curX, curY);
- p++;
- pause(3);
+ updateScreen();
- int key = getscan();
- if (key != 0)
- ctvd_stop();
- buffer_teclado();
- if (hay_sb == 1) {
- if (LookForFree() != 0)
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- longitud = longitud - 2;
- if (longitud > 0)
- goto bucless;
- }
+ p++;
+ pause(3);
+ } while (!isTalkFinished(&length));
- if (num_ejec == 1 && music_status() == 0 && flags[11] == 0)
- playmusic(musica_room);
- if (num_ejec == 2 && music_status() == 0 && flags[11] == 0 && musica_room != 0)
- playmusic(musica_room);
+ if (currentChapter == 1 && musicStatus() == 0 && flags[11] == 0)
+ playMusic(roomMusic);
+ if (currentChapter == 2 && musicStatus() == 0 && flags[11] == 0 && roomMusic != 0)
+ playMusic(roomMusic);
}
-void DrasculaEngine::talk_baul(const char *dicho, const char *filename) {
- int tiempou;
- long tiempol;
- int cara = 0, cara_antes;
- int longitud;
-
- longitud = strlen(dicho);
-
- tiempol = _system->getMillis();
- tiempou = (unsigned int)tiempol / 2;
- _rnd->setSeed(tiempou);
-
- buffer_teclado();
+void DrasculaEngine::talk_baul(int index) {
+ char filename[20];
+ sprintf(filename, "d%i.als", index);
+ const char *said = _text[_lang][index];
+ int face = 0, cara_antes;
+ int length = strlen(said);
cara_antes = flags[19];
- color_abc(MARRON);
-
- if (hay_sb == 1) {
- sku = new Common::File;
- sku->open(filename);
- if (!sku->isOpen()) {
- error("no puedo abrir archivo de voz");
- }
- ctvd_init(2);
- ctvd_speaker(1);
- ctvd_output(sku);
- }
-
-bucless:
+ color_abc(kColorMaroon);
- if (cara == 1)
- cara = 0;
- else
- cara = 1;
+ talkInit(filename);
- flags[19] = cara;
- updateRoom();
+ do {
+ face = (face == 1) ? 0 : 1;
- if (con_voces == 0)
- centra_texto(dicho, 263, 69);
+ flags[19] = face;
+ updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ if (withVoices == 0)
+ centerText(said, 263, 69);
- pause(4);
+ updateScreen();
- int key = getscan();
- if (key != 0)
- ctvd_stop();
- buffer_teclado();
- if (hay_sb == 1) {
- if (LookForFree() != 0)
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- longitud = longitud - 2;
- if (longitud > 0)
- goto bucless;
- }
+ pause(4);
+ } while (!isTalkFinished(&length));
flags[19] = cara_antes;
updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-}
-
-void DrasculaEngine::talk_igorpuerta(const char *dicho, const char *filename) {
- int tiempou;
- long tiempol;
-
- int longitud;
- longitud = strlen(dicho);
-
- tiempol = _system->getMillis();
- tiempou = (unsigned int)tiempol / 2;
- _rnd->setSeed(tiempou);
-
- buffer_teclado();
-
- color_abc(BLANCO);
-
- if (hay_sb == 1){
- sku = new Common::File;
- sku->open(filename);
- if (!sku->isOpen()) {
- error("no puedo abrir archivo de voz");
- }
- ctvd_init(2);
- ctvd_speaker(1);
- ctvd_output(sku);
- }
-
-bucless:
-
- updateRoom();
- if (con_voces == 0)
- centra_texto(dicho, 87, 66);
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- int key = getscan();
- if (key != 0)
- ctvd_stop();
- buffer_teclado();
- if (hay_sb == 1) {
- if (LookForFree() != 0)
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- longitud = longitud - 2;
- if (longitud > 0)
- goto bucless;
- }
-
- updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateScreen();
}
-void DrasculaEngine::talk_igor_sentado(const char *dicho, const char *filename) {
- int tiempou;
- long tiempol;
+void DrasculaEngine::talk_dr_grande(int index) {
+ char filename[20];
+ sprintf(filename, "D%i.als", index);
+ const char *said = _textd[_lang][index];
+ int x_talk[4] = {47, 93, 139, 185};
+ int face;
+ int l = 0;
+ int length = strlen(said);
- int x_talk[4] = { 80, 102, 124, 146 };
- int cara;
+ color_abc(kColorRed);
- int longitud;
- longitud = strlen(dicho);
+ talkInit(filename);
- tiempol = _system->getMillis();
- tiempou = (unsigned int)tiempol / 2;
- _rnd->setSeed(tiempou);
+ do {
+ face = _rnd->getRandomNumber(3);
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
+ copyBackground(interf_x[l] + 24, interf_y[l], 0, 45, 39, 31, drawSurface2, screenSurface);
+ copyBackground(x_talk[face], 1, 171, 68, 45, 48, drawSurface2, screenSurface);
+ l++;
+ if (l == 7)
+ l = 0;
- buffer_teclado();
+ if (withVoices == 0)
+ centerText(said, 191, 69);
- color_abc(BLANCO);
+ updateScreen();
- if (hay_sb == 1) {
- sku = new Common::File;
- sku->open(filename);
- if (!sku->isOpen()) {
- error("no puedo abrir archivo de voz");
- }
- ctvd_init(2);
- ctvd_speaker(1);
- ctvd_output(sku);
- }
-
-bucless:
-
- cara = _rnd->getRandomNumber(3);
-
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
-
- updateRefresh_pre();
-
- copyBackground(x_talk[cara], 109, 207, 92, 21, 23, dir_dibujo3, dir_zona_pantalla);
- pon_hare();
- updateRefresh();
-
- if (con_voces == 0)
- centra_texto(dicho, 221, 102);
-
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
-
- pause(3);
-
- int key = getscan();
- if (key != 0)
- ctvd_stop();
- buffer_teclado();
- if (hay_sb == 1) {
- if (LookForFree() != 0)
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- longitud = longitud - 2;
- if (longitud > 0)
- goto bucless;
- }
+ pause(3);
- updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ byte key = getScan();
+ if (key == Common::KEYCODE_ESCAPE)
+ term_int = 1;
+ } while (!isTalkFinished(&length));
}
-void DrasculaEngine::talk_igor_peluca(const char *dicho, const char *filename) {
- int tiempou;
- long tiempol;
-
- int x_talk[4] = {119, 158, 197, 236};
- int cara = 0;
-
- int longitud;
- longitud = strlen(dicho);
+void DrasculaEngine::talk_generic(const char* said, const char* filename, int* faces, int faceCount, int* coords, byte* surface) {
+ int face;
+ int length = strlen(said);
+ talkInit(filename);
- tiempol = _system->getMillis();
- tiempou = (unsigned int)tiempol / 2;
- _rnd->setSeed(tiempou);
+ do {
+ face = _rnd->getRandomNumber(faceCount - 1);
- buffer_teclado();
-
- color_abc(BLANCO);
-
- if (hay_sb == 1){
- sku = new Common::File;
- sku->open(filename);
- if (!sku->isOpen()) {
- error("no puedo abrir archivo de voz");
- }
- ctvd_init(2);
- ctvd_speaker(1);
- ctvd_output(sku);
- }
-
-bucless:
-
- _rnd->getRandomNumber(3);
-
- copyBackground(0, 0, 0, 0, 320, 200, dir_dibujo1, dir_zona_pantalla);
-
- updateRefresh_pre();
-
- copyBackground(x_talk[cara], 78, 199, 94, 38, 27, dir_dibujo3, dir_zona_pantalla);
- pon_hare();
- updateRefresh();
-
- if (con_voces == 0)
- centra_texto(dicho, 221, 102);
+ copyBackground(0, 0, 0, 0, 320, 200, bgSurface, screenSurface);
+ updateRefresh_pre();
+ copyBackground(faces[face], coords[0], coords[1], coords[2],
+ coords[3], coords[4], surface, screenSurface);
+ moveCharacters();
+ updateRefresh();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ if (withVoices == 0)
+ centerText(said, coords[5], coords[6]);
- pause(3);
+ updateScreen();
- int key = getscan();
- if (key != 0)
- ctvd_stop();
- buffer_teclado();
- if (hay_sb == 1){
- if (LookForFree() != 0)
- goto bucless;
- delete sku;
- sku = NULL;
- ctvd_terminate();
- } else {
- longitud = longitud - 2;
- if (longitud > 0)
- goto bucless;
- }
+ pause(3);
+ } while (!isTalkFinished(&length));
updateRoom();
- updateScreen(0, 0, 0, 0, 320, 200, dir_zona_pantalla);
+ updateScreen();
}
} // End of namespace Drascula
diff --git a/engines/gob/coktelvideo.cpp b/engines/gob/coktelvideo.cpp
index d508dc75f9..415790e67b 100644
--- a/engines/gob/coktelvideo.cpp
+++ b/engines/gob/coktelvideo.cpp
@@ -123,8 +123,9 @@ bool Imd::load(Common::SeekableReadStream &stream) {
return false;
}
- _soundSliceLength = 1000 / (_soundFreq / _soundSliceSize);
- _frameLength = _soundSliceLength;
+ _soundSliceLength = (uint32) (((double) (1000 << 16)) /
+ ((double) _soundFreq / (double) _soundSliceSize));
+ _frameLength = _soundSliceLength >> 16;
_soundStage = 1;
_hasSound = true;
@@ -270,6 +271,13 @@ void Imd::disableSound() {
_mixer = 0;
}
+bool Imd::isSoundPlaying() const {
+ if (_audioStream && _mixer->isSoundHandleActive(_audioHandle))
+ return true;
+
+ return false;
+}
+
void Imd::seekFrame(int32 frame, int16 whence, bool restart) {
if (!_stream)
// Nothing to do
@@ -318,11 +326,11 @@ void Imd::waitEndFrame() {
return;
if (_skipFrames == 0) {
- int32 waitTime = (_curFrame * _soundSliceLength) -
- (g_system->getMillis() - _soundStartTime);
+ int32 waitTime = (int16) (((_curFrame * _soundSliceLength) -
+ ((g_system->getMillis() - _soundStartTime) << 16)) >> 16);
if (waitTime < 0) {
- _skipFrames = -waitTime / _soundSliceLength;
+ _skipFrames = -waitTime / (_soundSliceLength >> 16);
warning("Video A/V sync broken, skipping %d frame(s)", _skipFrames + 1);
} else if (waitTime > 0)
g_system->delayMillis(waitTime);
@@ -333,6 +341,11 @@ void Imd::waitEndFrame() {
g_system->delayMillis(_frameLength);
}
+void Imd::notifyPaused(uint32 duration) {
+ if (_soundStage == 2)
+ _soundStartTime += duration;
+}
+
void Imd::copyCurrentFrame(byte *dest,
uint16 left, uint16 top, uint16 width, uint16 height,
uint16 x, uint16 y, uint16 pitch, int16 transp) {
@@ -931,10 +944,9 @@ bool Vmd::load(Common::SeekableReadStream &stream) {
_soundSliceSize = -_soundSliceSize;
}
- _soundSliceLength = (uint16) (1000.0 /
+ _soundSliceLength = (uint32) (((double) (1000 << 16)) /
((double) _soundFreq / (double) _soundSliceSize));
-
- _frameLength = _soundSliceLength;
+ _frameLength = _soundSliceLength >> 16;
_soundStage = 1;
_audioStream = Audio::makeAppendableAudioStream(_soundFreq,
@@ -1066,8 +1078,8 @@ CoktelVideo::State Vmd::processFrame(uint16 frame) {
state.flags |= kStateNoVideoData;
state.left = 0x7FFF;
- state.right = 0x7FFF;
- state.top = 0;
+ state.top = 0x7FFF;
+ state.right = 0;
state.bottom = 0;
if (!_vidMem)
@@ -1121,6 +1133,8 @@ CoktelVideo::State Vmd::processFrame(uint16 frame) {
} else if (part.type == kPartTypeVideo) {
state.flags &= ~kStateNoVideoData;
+ uint32 size = part.size;
+
// New palette
if (part.flags & 2) {
uint8 index = _stream->readByte();
@@ -1130,9 +1144,12 @@ CoktelVideo::State Vmd::processFrame(uint16 frame) {
_stream->skip((255 - count) * 3);
state.flags |= kStatePalette;
+
+ size -= (768 + 2);
}
- _stream->read(_frameData, part.size);
+ _stream->read(_frameData, size);
+
if (renderFrame(part.left, part.top, part.right, part.bottom)) {
// Rendering succeeded, merging areas
state.left = MIN(state.left, part.left);
diff --git a/engines/gob/coktelvideo.h b/engines/gob/coktelvideo.h
index 4f9543e8d0..348e5e3ab1 100644
--- a/engines/gob/coktelvideo.h
+++ b/engines/gob/coktelvideo.h
@@ -134,11 +134,14 @@ public:
/** Use an own memory block as video memory. */
virtual void setVideoMemory() = 0;
- /** Play sound (if the IMD has sound). */
+ /** Play sound (if the video has sound). */
virtual void enableSound(Audio::Mixer &mixer) = 0;
/** Don't play sound or stop currently playing sound. */
virtual void disableSound() = 0;
+ /** Is sound currently playing? */
+ virtual bool isSoundPlaying() const = 0;
+
/** Seek to a specific frame.
*
* @param frame The frame to which to seek.
@@ -152,6 +155,9 @@ public:
/** Wait for the frame to end. */
virtual void waitEndFrame() = 0;
+ /** Notifies the video that it was paused for duration ms. */
+ virtual void notifyPaused(uint32 duration) = 0;
+
/** Copy the current frame.
*
* @param dest The memory to which to copy the current frame.
@@ -184,7 +190,11 @@ public:
int16 getHeight() const { return _height; }
uint16 getFramesCount() const { return _framesCount; }
uint16 getCurrentFrame() const { return _curFrame; }
- int16 getFrameRate() const { if (_hasSound) return 1000 / _soundSliceLength; return _frameRate; }
+ int16 getFrameRate() const {
+ if (_hasSound)
+ return 1000 / (_soundSliceLength >> 16);
+ return _frameRate;
+ }
uint32 getSyncLag() const { return _skipFrames; }
const byte *getPalette() const { return _palette; }
@@ -203,11 +213,15 @@ public:
void enableSound(Audio::Mixer &mixer);
void disableSound();
+ bool isSoundPlaying() const;
+
void seekFrame(int32 frame, int16 whence = SEEK_SET, bool restart = false);
State nextFrame();
void waitEndFrame();
+ void notifyPaused(uint32 duration);
+
void copyCurrentFrame(byte *dest,
uint16 left, uint16 top, uint16 width, uint16 height,
uint16 x, uint16 y, uint16 pitch, int16 transp = -1);
@@ -250,7 +264,7 @@ protected:
int16 _soundFreq;
int16 _soundSliceSize;
int16 _soundSlicesCount;
- uint16 _soundSliceLength;
+ uint32 _soundSliceLength;
Audio::AppendableAudioStream *_audioStream;
Audio::SoundHandle _audioHandle;
diff --git a/engines/gob/dataio.cpp b/engines/gob/dataio.cpp
index 1fb43e96bb..8ae11b8755 100644
--- a/engines/gob/dataio.cpp
+++ b/engines/gob/dataio.cpp
@@ -23,7 +23,6 @@
*
*/
-
#include "common/endian.h"
#include "gob/gob.h"
@@ -233,8 +232,10 @@ int16 DataIO::getChunk(const char *chunkName) {
if (_chunkPos[file * MAX_SLOT_COUNT + slot] == -1)
break;
- if (slot == MAX_SLOT_COUNT)
+ if (slot == MAX_SLOT_COUNT) {
+ warning("Chunk slots full");
return -1;
+ }
dataDesc = _dataFiles[file];
for (int16 chunk = 0; chunk < _numDataChunks[file]; chunk++, dataDesc++) {
diff --git a/engines/gob/detection.cpp b/engines/gob/detection.cpp
index 7637605dcd..8351f2ecfb 100644
--- a/engines/gob/detection.cpp
+++ b/engines/gob/detection.cpp
@@ -23,7 +23,6 @@
*
*/
-
#include "base/plugins.h"
#include "common/advancedDetector.h"
@@ -1685,6 +1684,71 @@ static const GOBGameDescription gameDescriptions[] = {
kFeatures640,
"intro"
},
+ { // Supplied by DjDiabolik in bug report #1971294
+ {
+ "woodruff",
+ "",
+ AD_ENTRY1s("intro.stk", "60348a87651f92e8492ee070556a96d8", 7069736),
+ EN_GRB,
+ kPlatformPC,
+ Common::ADGF_NO_FLAGS
+ },
+ kGameTypeWoodruff,
+ kFeatures640,
+ "intro"
+ },
+ { // Supplied by DjDiabolik in bug report #1971294
+ {
+ "woodruff",
+ "",
+ AD_ENTRY1s("intro.stk", "60348a87651f92e8492ee070556a96d8", 7069736),
+ DE_DEU,
+ kPlatformPC,
+ Common::ADGF_NO_FLAGS
+ },
+ kGameTypeWoodruff,
+ kFeatures640,
+ "intro"
+ },
+ { // Supplied by DjDiabolik in bug report #1971294
+ {
+ "woodruff",
+ "",
+ AD_ENTRY1s("intro.stk", "60348a87651f92e8492ee070556a96d8", 7069736),
+ FR_FRA,
+ kPlatformPC,
+ Common::ADGF_NO_FLAGS
+ },
+ kGameTypeWoodruff,
+ kFeatures640,
+ "intro"
+ },
+ { // Supplied by DjDiabolik in bug report #1971294
+ {
+ "woodruff",
+ "",
+ AD_ENTRY1s("intro.stk", "60348a87651f92e8492ee070556a96d8", 7069736),
+ IT_ITA,
+ kPlatformPC,
+ Common::ADGF_NO_FLAGS
+ },
+ kGameTypeWoodruff,
+ kFeatures640,
+ "intro"
+ },
+ { // Supplied by DjDiabolik in bug report #1971294
+ {
+ "woodruff",
+ "",
+ AD_ENTRY1s("intro.stk", "60348a87651f92e8492ee070556a96d8", 7069736),
+ ES_ESP,
+ kPlatformPC,
+ Common::ADGF_NO_FLAGS
+ },
+ kGameTypeWoodruff,
+ kFeatures640,
+ "intro"
+ },
{
{
"dynasty",
diff --git a/engines/gob/draw.cpp b/engines/gob/draw.cpp
index 2a4732954c..8a7de9bdaa 100644
--- a/engines/gob/draw.cpp
+++ b/engines/gob/draw.cpp
@@ -23,7 +23,6 @@
*
*/
-
#include "common/endian.h"
#include "gob/gob.h"
diff --git a/engines/gob/draw_v1.cpp b/engines/gob/draw_v1.cpp
index 959a064b7d..b5bc56b6f5 100644
--- a/engines/gob/draw_v1.cpp
+++ b/engines/gob/draw_v1.cpp
@@ -23,7 +23,6 @@
*
*/
-
#include "common/endian.h"
#include "graphics/cursorman.h"
@@ -31,9 +30,10 @@
#include "gob/draw.h"
#include "gob/global.h"
#include "gob/util.h"
-#include "gob/cdrom.h"
#include "gob/game.h"
#include "gob/scenery.h"
+#include "gob/inter.h"
+#include "gob/sound/sound.h"
namespace Gob {
@@ -170,7 +170,7 @@ void Draw_v1::printTotText(int16 id) {
int16 spriteRight, spriteBottom;
char buf[20];
- _vm->_cdrom->playMultMusic();
+ _vm->_sound->cdPlayMultMusic();
if (!_vm->_game->_totTextData || !_vm->_game->_totTextData->dataPtr)
return;
diff --git a/engines/gob/draw_v2.cpp b/engines/gob/draw_v2.cpp
index 8f7d5b325b..378ff0dcdf 100644
--- a/engines/gob/draw_v2.cpp
+++ b/engines/gob/draw_v2.cpp
@@ -23,7 +23,6 @@
*
*/
-
#include "common/endian.h"
#include "graphics/cursorman.h"
@@ -33,6 +32,7 @@
#include "gob/util.h"
#include "gob/game.h"
#include "gob/scenery.h"
+#include "gob/inter.h"
#include "gob/video.h"
namespace Gob {
@@ -178,13 +178,13 @@ void Draw_v2::animateCursor(int16 cursor) {
_vm->_util->delay(5);
}
}
- } else
+ } else {
blitCursor();
+ _cursorX = newX;
+ _cursorY = newY;
+ }
_showCursor &= ~1;
-
- _cursorX = newX;
- _cursorY = newY;
}
void Draw_v2::printTotText(int16 id) {
@@ -246,22 +246,29 @@ void Draw_v2::printTotText(int16 id) {
}
if (_renderFlags & RENDERFLAG_FROMSPLIT) {
- destY = _vm->_video->_splitStart;
+ int16 start;
+
+ start = _vm->_video->_splitStart;
+
+ destY = start;
spriteBottom = READ_LE_UINT16(ptr + 6) - READ_LE_UINT16(ptr + 2);
+
if (_renderFlags & RENDERFLAG_DOUBLECOORDS)
spriteBottom *= 3;
- spriteBottom += _vm->_video->_splitStart;
+
+ spriteBottom += start;
+
if (_renderFlags & RENDERFLAG_DOUBLECOORDS) {
- spriteBottom += _backDeltaX;
- destY += _backDeltaX;
+ spriteBottom += _backDeltaY;
+ destY += _backDeltaY;
}
} else {
+ destY = READ_LE_UINT16(ptr + 2);
+ spriteBottom = READ_LE_UINT16(ptr + 6);
+
if (_renderFlags & RENDERFLAG_DOUBLECOORDS) {
- destY = READ_LE_UINT16(ptr + 2) * 2;
- spriteBottom = READ_LE_UINT16(ptr + 6) * 2;
- } else {
- destY = READ_LE_UINT16(ptr + 2);
- spriteBottom = READ_LE_UINT16(ptr + 6);
+ destY *= 2;
+ spriteBottom *= 2;
}
}
@@ -629,8 +636,7 @@ void Draw_v2::spriteOperation(int16 operation) {
_destSpriteX += _backDeltaX;
_destSpriteY += _backDeltaY;
if ((operation == DRAW_DRAWLINE) ||
- ((operation >= DRAW_DRAWBAR) &&
- (operation <= DRAW_FILLRECTABS))) {
+ ((operation >= DRAW_DRAWBAR) && (operation <= DRAW_FILLRECTABS))) {
_spriteRight += _backDeltaX;
_spriteBottom += _backDeltaY;
}
@@ -646,6 +652,24 @@ void Draw_v2::spriteOperation(int16 operation) {
int16 destSurface = _destSurface;
int16 sourceSurface = _sourceSurface;
+ if (_vm->_video->_splitSurf && ((_destSurface == 20) || (_destSurface == 21))) {
+ if ((_destSpriteY >= _vm->_video->_splitStart)) {
+ _destSpriteY -= _vm->_video->_splitStart;
+ if ((operation == DRAW_DRAWLINE) ||
+ ((operation >= DRAW_DRAWBAR) && (operation <= DRAW_FILLRECTABS)))
+ _spriteBottom -= _vm->_video->_splitStart;
+
+ _destSurface += 4;
+ }
+
+ if ((_spriteTop >= _vm->_video->_splitStart) && (operation == DRAW_BLITSURF)) {
+ _spriteTop -= _vm->_video->_splitStart;
+ if (_destSurface < 24)
+ _destSurface += 4;
+ }
+
+ }
+
adjustCoords(0, &_destSpriteX, &_destSpriteY);
if ((operation != DRAW_LOADSPRITE) && (_needAdjust != 2)) {
adjustCoords(0, &_spriteRight, &_spriteBottom);
diff --git a/engines/gob/driver_vga.cpp b/engines/gob/driver_vga.cpp
index 08235f16e2..f68ce47783 100644
--- a/engines/gob/driver_vga.cpp
+++ b/engines/gob/driver_vga.cpp
@@ -23,7 +23,6 @@
*
*/
-
#include "common/endian.h"
#include "graphics/primitives.h"
@@ -110,10 +109,16 @@ void VGAVideoDriver::drawSprite(SurfaceDesc *source, SurfaceDesc *dest,
int16 width = MIN((right - left) + 1, (int) dest->getWidth());
int16 height = MIN((bottom - top) + 1, (int) dest->getHeight());
+ if ((width < 1) || (height < 1))
+ return;
+
byte *srcPos = source->getVidMem() + (top * source->getWidth()) + left;
byte *destPos = dest->getVidMem() + (y * dest->getWidth()) + x;
+ uint32 size = width * height;
+
if (transp) {
+
while (height--) {
for (int16 i = 0; i < width; ++i) {
if (srcPos[i])
@@ -123,13 +128,26 @@ void VGAVideoDriver::drawSprite(SurfaceDesc *source, SurfaceDesc *dest,
srcPos += source->getWidth();
destPos += dest->getWidth();
}
+
+ } else if (((srcPos >= destPos) && (srcPos <= (destPos + size))) ||
+ ((destPos >= srcPos) && (destPos <= (srcPos + size)))) {
+
+ while (height--) {
+ memmove(destPos, srcPos, width);
+
+ srcPos += source->getWidth();
+ destPos += dest->getWidth();
+ }
+
} else {
+
while (height--) {
memcpy(destPos, srcPos, width);
srcPos += source->getWidth();
destPos += dest->getWidth();
}
+
}
}
diff --git a/engines/gob/game.cpp b/engines/gob/game.cpp
index 666f46fde1..73fa820fa0 100644
--- a/engines/gob/game.cpp
+++ b/engines/gob/game.cpp
@@ -23,7 +23,6 @@
*
*/
-
#include "common/endian.h"
#include "gob/gob.h"
@@ -35,7 +34,7 @@
#include "gob/parse.h"
#include "gob/draw.h"
#include "gob/mult.h"
-#include "gob/music.h"
+#include "gob/sound/sound.h"
namespace Gob {
@@ -60,9 +59,6 @@ Game::Game(GobEngine *vm) : _vm(vm) {
_collStackElemSizes[i] = 0;
}
- _infIns = 0;
- _infogrames = 0;
-
_curTotFile[0] = 0;
_curExtFile[0] = 0;
_totToLoad[0] = 0;
@@ -105,10 +101,6 @@ Game::Game(GobEngine *vm) : _vm(vm) {
}
Game::~Game() {
- delete _infIns;
-
- for (int i = 0; i < 60; i++)
- _soundSamples[i].free();
}
byte *Game::loadExtData(int16 itemId, int16 *pResWidth,
@@ -295,16 +287,7 @@ void Game::freeSoundSlot(int16 slot) {
if (slot == -1)
slot = _vm->_parse->parseValExpr();
- if ((slot < 0) || (slot >= 60) || _soundSamples[slot].empty())
- return;
-
- SoundDesc &sample = _soundSamples[slot];
-
- if (sample.getType() == SOUND_ADL)
- if (_vm->_adlib && (_vm->_adlib->getIndex() == slot))
- _vm->_adlib->stopPlay();
-
- _vm->_snd->freeSample(sample);
+ _vm->_sound->sampleFree(_vm->_sound->sampleGetBySlot(slot));
}
void Game::evaluateScroll(int16 x, int16 y) {
@@ -367,7 +350,7 @@ int16 Game::checkKeys(int16 *pMouseX, int16 *pMouseY,
_vm->_util->processInput(true);
- if (_vm->_mult->_multData && _vm->_global->_inter_variables &&
+ if (_vm->_mult->_multData && _vm->_inter->_variables &&
(VAR(58) != 0)) {
if (_vm->_mult->_multData->frameStart != (int) VAR(58) - 1)
_vm->_mult->_multData->frameStart++;
@@ -380,7 +363,7 @@ int16 Game::checkKeys(int16 *pMouseX, int16 *pMouseY,
if ((_vm->_inter->_soundEndTimeKey != 0) &&
(_vm->_util->getTimeKey() >= _vm->_inter->_soundEndTimeKey)) {
- _vm->_snd->stopSound(_vm->_inter->_soundStopVal);
+ _vm->_sound->blasterStop(_vm->_inter->_soundStopVal);
_vm->_inter->_soundEndTimeKey = 0;
}
@@ -497,8 +480,7 @@ void Game::totSub(int8 flags, const char *newTotFile) {
_extTableArray[_backupedCount] = _extTable;
_extHandleArray[_backupedCount] = _extHandle;
_imFileDataArray[_backupedCount] = _imFileData;
- _variablesArray[_backupedCount] = _vm->_global->_inter_variables;
- _variablesSizesArray[_backupedCount] = _vm->_global->_inter_variablesSizes;
+ _variablesArray[_backupedCount] = _vm->_inter->_variables;
strcpy(_curTotFileArray[_backupedCount], _curTotFile);
curBackupPos = _curBackupPos;
@@ -508,10 +490,8 @@ void Game::totSub(int8 flags, const char *newTotFile) {
_totTextData = 0;
_totFileData = 0;
_totResourceTable = 0;
- if (flags & 1) {
- _vm->_global->_inter_variables = 0;
- _vm->_global->_inter_variablesSizes = 0;
- }
+ if (flags & 1)
+ _vm->_inter->_variables = 0;
strncpy0(_curTotFile, newTotFile, 9);
strcat(_curTotFile, ".TOT");
@@ -531,9 +511,8 @@ void Game::totSub(int8 flags, const char *newTotFile) {
popCollisions();
- if ((flags & 1) && _vm->_global->_inter_variables) {
- delete[] _vm->_global->_inter_variables;
- delete[] _vm->_global->_inter_variablesSizes;
+ if ((flags & 1) && _vm->_inter->_variables) {
+ _vm->_inter->delocateVars();
}
_backupedCount--;
@@ -547,8 +526,7 @@ void Game::totSub(int8 flags, const char *newTotFile) {
_extTable = _extTableArray[_backupedCount];
_extHandle = _extHandleArray[_backupedCount];
_imFileData = _imFileDataArray[_backupedCount];
- _vm->_global->_inter_variables = _variablesArray[_backupedCount];
- _vm->_global->_inter_variablesSizes = _variablesSizesArray[_backupedCount];
+ _vm->_inter->_variables = _variablesArray[_backupedCount];
strcpy(_curTotFile, _curTotFileArray[_backupedCount]);
strcpy(_curExtFile, _curTotFile);
_curExtFile[strlen(_curExtFile) - 4] = '\0';
@@ -580,8 +558,7 @@ void Game::switchTotSub(int16 index, int16 skipPlay) {
_extTableArray[_backupedCount] = _extTable;
_extHandleArray[_backupedCount] = _extHandle;
_imFileDataArray[_backupedCount] = _imFileData;
- _variablesArray[_backupedCount] = _vm->_global->_inter_variables;
- _variablesSizesArray[_backupedCount] = _vm->_global->_inter_variablesSizes;
+ _variablesArray[_backupedCount] = _vm->_inter->_variables;
strcpy(_curTotFileArray[_backupedCount], _curTotFile);
_backupedCount++;
}
@@ -597,8 +574,7 @@ void Game::switchTotSub(int16 index, int16 skipPlay) {
_imFileData = _imFileDataArray[_curBackupPos];
_extTable = _extTableArray[_curBackupPos];
_extHandle = _extHandleArray[_curBackupPos];
- _vm->_global->_inter_variables = _variablesArray[_curBackupPos];
- _vm->_global->_inter_variablesSizes = _variablesSizesArray[_curBackupPos];
+ _vm->_inter->_variables = _variablesArray[_curBackupPos];
strcpy(_curTotFile, _curTotFileArray[_curBackupPos]);
strcpy(_curExtFile, _curTotFile);
_curExtFile[strlen(_curExtFile) - 4] = '\0';
@@ -625,8 +601,7 @@ void Game::switchTotSub(int16 index, int16 skipPlay) {
_extTable = _extTableArray[_curBackupPos];
_extHandle = _extHandleArray[_curBackupPos];
_imFileData = _imFileDataArray[_curBackupPos];
- _vm->_global->_inter_variables = _variablesArray[_curBackupPos];
- _vm->_global->_inter_variablesSizes = _variablesSizesArray[_curBackupPos];
+ _vm->_inter->_variables = _variablesArray[_curBackupPos];
strcpy(_curTotFile, _curTotFileArray[_curBackupPos]);
strcpy(_curExtFile, _curTotFile);
_curExtFile[strlen(_curExtFile) - 4] = '\0';
diff --git a/engines/gob/game.h b/engines/gob/game.h
index 5cf5e1bea6..15f6ab963a 100644
--- a/engines/gob/game.h
+++ b/engines/gob/game.h
@@ -26,9 +26,7 @@
#ifndef GOB_GAME_H
#define GOB_GAME_H
-#include "sound/mods/infogrames.h"
-
-#include "gob/sound.h"
+#include "gob/variables.h"
namespace Gob {
@@ -119,12 +117,6 @@ public:
int16 _extHandle;
- SoundDesc _soundSamples[60];
-
- Audio::Infogrames::Instruments *_infIns;
- Audio::Infogrames *_infogrames;
- Audio::SoundHandle _infHandle;
-
char _totToLoad[20];
int32 _startTimeKey;
@@ -210,9 +202,8 @@ protected:
ExtTable *_extTableArray[5];
int16 _extHandleArray[5];
byte *_imFileDataArray[5];
- byte *_variablesArray[5];
+ Variables *_variablesArray[5];
char _curTotFileArray[5][14];
- byte *_variablesSizesArray[5];
GobEngine *_vm;
diff --git a/engines/gob/game_v1.cpp b/engines/gob/game_v1.cpp
index e9e37a027b..66deea8ec4 100644
--- a/engines/gob/game_v1.cpp
+++ b/engines/gob/game_v1.cpp
@@ -23,7 +23,6 @@
*
*/
-
#include "common/endian.h"
#include "common/stream.h"
@@ -32,15 +31,13 @@
#include "gob/global.h"
#include "gob/util.h"
#include "gob/dataio.h"
-#include "gob/music.h"
-#include "gob/cdrom.h"
#include "gob/draw.h"
#include "gob/inter.h"
#include "gob/mult.h"
#include "gob/video.h"
#include "gob/parse.h"
-#include "gob/sound.h"
#include "gob/scenery.h"
+#include "gob/sound/sound.h"
namespace Gob {
@@ -74,11 +71,11 @@ void Game_v1::playTot(int16 skipPlay) {
_vm->_draw->_fontToSprite[i].height = -1;
}
- if (_vm->_platform == Common::kPlatformMacintosh) {
- if (_vm->_adlib)
- _vm->_adlib->stopPlay();
- } else
- _vm->_cdrom->stopPlaying();
+ if (_vm->getPlatform() == Common::kPlatformMacintosh)
+ _vm->_sound->adlibStop();
+ else
+ _vm->_sound->cdStop();
+
_vm->_draw->animateCursor(4);
_vm->_inter->initControlVars(1);
_vm->_mult->initAll();
@@ -169,12 +166,8 @@ void Game_v1::playTot(int16 skipPlay) {
_vm->_global->_inter_animDataSize =
READ_LE_UINT16(_totFileData + 0x38);
- if (!_vm->_global->_inter_variables) {
- variablesCount = READ_LE_UINT16(_totFileData + 0x2C);
- _vm->_global->_inter_variables = new byte[variablesCount * 4];
- _vm->_global->_inter_variablesSizes = new byte[variablesCount * 4];
- _vm->_global->clearVars(variablesCount);
- }
+ if (!_vm->_inter->_variables)
+ _vm->_inter->allocateVars(READ_LE_UINT16(_totFileData + 0x2C));
_vm->_global->_inter_execPtr = _totFileData;
_vm->_global->_inter_execPtr += READ_LE_UINT32(_totFileData + 0x64);
@@ -229,7 +222,7 @@ void Game_v1::playTot(int16 skipPlay) {
for (int i = 0; i < SPRITES_COUNT; i++)
_vm->_draw->freeSprite(i);
- _vm->_snd->stopSound(0);
+ _vm->_sound->blasterStop(0);
for (int i = 0; i < 20; i++)
freeSoundSlot(i);
diff --git a/engines/gob/game_v2.cpp b/engines/gob/game_v2.cpp
index 45542541e3..adf75176ab 100644
--- a/engines/gob/game_v2.cpp
+++ b/engines/gob/game_v2.cpp
@@ -23,7 +23,6 @@
*
*/
-
#include "common/endian.h"
#include "common/stream.h"
@@ -38,9 +37,9 @@
#include "gob/mult.h"
#include "gob/parse.h"
#include "gob/scenery.h"
-#include "gob/sound.h"
#include "gob/video.h"
#include "gob/videoplayer.h"
+#include "gob/sound/sound.h"
namespace Gob {
@@ -55,7 +54,6 @@ void Game_v2::playTot(int16 skipPlay) {
int16 _captureCounter;
int16 breakFrom;
int16 nestLevel;
- int32 variablesCount;
int32 totSize;
byte *filePtr;
byte *savedIP;
@@ -73,7 +71,7 @@ void Game_v2::playTot(int16 skipPlay) {
if (skipPlay <= 0) {
while (!_vm->_quitRequested) {
- if (_vm->_global->_inter_variables)
+ if (_vm->_inter->_variables)
_vm->_draw->animateCursor(4);
if (skipPlay != -1) {
@@ -205,12 +203,8 @@ void Game_v2::playTot(int16 skipPlay) {
_vm->_global->_inter_animDataSize =
READ_LE_UINT16(_totFileData + 0x38);
- if (!_vm->_global->_inter_variables) {
- variablesCount = READ_LE_UINT16(_totFileData + 0x2C);
- _vm->_global->_inter_variables = new byte[variablesCount * 4];
- _vm->_global->_inter_variablesSizes = new byte[variablesCount * 4];
- _vm->_global->clearVars(variablesCount);
- }
+ if (!_vm->_inter->_variables)
+ _vm->_inter->allocateVars(READ_LE_UINT16(_totFileData + 0x2C));
_vm->_global->_inter_execPtr = _totFileData;
_vm->_global->_inter_execPtr +=
@@ -265,11 +259,14 @@ void Game_v2::playTot(int16 skipPlay) {
if (skipPlay != -1) {
_vm->_goblin->freeObjects();
- _vm->_snd->stopSound(0);
+ _vm->_sound->blasterStop(0);
+
+ for (int i = 0; i < Sound::kSoundsCount; i++) {
+ SoundDesc *sound = _vm->_sound->sampleGetBySlot(i);
- for (int i = 0; i < 60; i++)
- if (_soundSamples[i].getType() == SOUND_SND)
- _vm->_snd->freeSample(_soundSamples[i]);
+ if (sound && (sound->getType() == SOUND_SND))
+ _vm->_sound->sampleFree(sound);
+ }
}
_vm->_vidPlayer->primaryClose();
@@ -630,13 +627,15 @@ void Game_v2::collisionsBlock(void) {
Collision *collArea;
int16 timeKey;
byte *savedIP;
+ byte collAreaStart;
if (_shouldPushColls)
pushCollisions(0);
- collArea = _collisionAreas;
- while (collArea->left != 0xFFFF)
- collArea++;
+ collAreaStart = 0;
+ while (_collisionAreas[collAreaStart].left != 0xFFFF)
+ collAreaStart++;
+ collArea = &_collisionAreas[collAreaStart];
_shouldPushColls = 0;
collResId = -1;
@@ -962,7 +961,7 @@ void Game_v2::collisionsBlock(void) {
continue;
_activeCollResId = collPtr->id;
- _activeCollIndex = i;
+ _activeCollIndex = i + collAreaStart;
_vm->_inter->storeMouse();
if (VAR(16) != 0)
break;
@@ -1004,7 +1003,7 @@ void Game_v2::collisionsBlock(void) {
if ((collPtr->id & 0xF000) == 0x8000)
if (++counter == descIndex) {
_activeCollResId = collPtr->id;
- _activeCollIndex = i;
+ _activeCollIndex = i + collAreaStart;
break;
}
}
@@ -1404,7 +1403,7 @@ int16 Game_v2::inputArea(int16 xPos, int16 yPos, int16 width, int16 height,
flag = 1;
- if (_vm->_global->_inter_variables)
+ if (_vm->_inter->_variables)
WRITE_VAR(56, pos);
while (1) {
diff --git a/engines/gob/global.cpp b/engines/gob/global.cpp
index 1445601017..acca5564dd 100644
--- a/engines/gob/global.cpp
+++ b/engines/gob/global.cpp
@@ -123,8 +123,6 @@ Global::Global(GobEngine *vm) : _vm(vm) {
_inter_resStr[0] = 0;
_inter_resVal = 0;
- _inter_variablesSizes = 0;
- _inter_variables = 0;
_inter_execPtr = 0;
_inter_animDataSize = 10;
diff --git a/engines/gob/global.h b/engines/gob/global.h
index 45c179d277..32651cf15d 100644
--- a/engines/gob/global.h
+++ b/engines/gob/global.h
@@ -123,8 +123,6 @@ public:
char _inter_resStr[200];
int32 _inter_resVal;
- byte *_inter_variablesSizes; // 0: single byte, 1: two bytes, 3: four bytes
- byte *_inter_variables;
byte *_inter_execPtr;
int16 _inter_animDataSize;
@@ -134,73 +132,11 @@ public:
// Can be 1, 2 or 3 for normal, double and triple speed, respectively
uint8 _speedFactor;
- void clearVars(uint32 count) {
- uint32 size = count * 4;
-
- memset(_inter_variables, 0, size);
- memset(_inter_variablesSizes, 0, size);
- for (uint32 i = 0; i < size; i += 4)
- _inter_variablesSizes[i] = 3;
- }
-
- void writeVarSizeStr(uint32 offset, uint32 len) {
- uint32 i;
- uint32 inVar;
- uint32 varOff;
-
- inVar = offset % 4;
- varOff = (offset >> 2) << 2;
- for (i = 0; i < 4; i++) {
- if (_inter_variablesSizes[varOff + i] == 3)
- _inter_variablesSizes[varOff + i] = 0;
- else if ((inVar == (i+1)) && (_inter_variablesSizes[varOff + i] == 1))
- _inter_variablesSizes[varOff + i] = 0;
- }
- memset(_inter_variablesSizes + offset, 0, len);
- }
-
- void writeVar(uint32 offset, uint32 val) {
- WRITE_UINT32(_inter_variables + offset, val);
- writeVarSize(offset, 3);
- }
- void writeVar(uint32 offset, uint16 val) {
- WRITE_UINT16(_inter_variables + offset, val);
- writeVarSize(offset, 1);
- }
- void writeVar(uint32 offset, uint8 val) {
- (*(uint8 *)(_inter_variables + offset)) = val;
- writeVarSize(offset, 0);
- }
- void writeVar(uint32 offset, const char *str) {
- writeVarSizeStr(offset, strlen(str));
- strcpy((char *) (_inter_variables + offset), str);
- }
-
Global(GobEngine *vm);
~Global();
protected:
GobEngine *_vm;
-
- void writeVarSize(uint32 offset, byte n) {
- uint32 i;
- uint32 inVar;
- uint32 varOff;
-
- inVar = offset % 4;
- varOff = (offset >> 2) << 2;
- for (i = 0; i < 4; i++) {
- if (_inter_variablesSizes[varOff + i] == 3)
- _inter_variablesSizes[varOff + i] = 0;
- else if ((inVar == (i+1)) && (_inter_variablesSizes[varOff + i] == 1))
- _inter_variablesSizes[varOff + i] = 0;
- }
-
- _inter_variablesSizes[offset] = n;
- for (; n > 0; n--)
- _inter_variablesSizes[offset + n] = 0;
- }
-
};
} // End of namespace Gob
diff --git a/engines/gob/gob.cpp b/engines/gob/gob.cpp
index 863665357b..a3fe0ebbe2 100644
--- a/engines/gob/gob.cpp
+++ b/engines/gob/gob.cpp
@@ -23,7 +23,6 @@
*
*/
-
#include "common/endian.h"
#include "common/events.h"
@@ -37,18 +36,16 @@
#include "gob/util.h"
#include "gob/dataio.h"
#include "gob/game.h"
-#include "gob/sound.h"
+#include "gob/sound/sound.h"
#include "gob/init.h"
#include "gob/inter.h"
#include "gob/draw.h"
-#include "gob/cdrom.h"
#include "gob/goblin.h"
#include "gob/map.h"
#include "gob/mult.h"
#include "gob/palanim.h"
#include "gob/parse.h"
#include "gob/scenery.h"
-#include "gob/music.h"
#include "gob/videoplayer.h"
#include "gob/saveload.h"
@@ -71,13 +68,14 @@ const Common::Language GobEngine::_gobToScummVMLang[] = {
GobEngine::GobEngine(OSystem *syst) : Engine(syst) {
_vm = this;
- _snd = 0; _adlib = 0; _mult = 0;
- _game = 0; _global = 0; _cdrom = 0;
- _dataIO = 0; _goblin = 0; _vidPlayer = 0;
- _init = 0; _inter = 0; _map = 0;
- _palAnim = 0; _parse = 0; _scenery = 0;
- _draw = 0; _util = 0; _video = 0;
- _saveLoad = 0;
+ _sound = 0; _mult = 0; _game = 0;
+ _global = 0; _dataIO = 0; _goblin = 0;
+ _vidPlayer = 0; _init = 0; _inter = 0;
+ _map = 0; _palAnim = 0; _parse = 0;
+ _scenery = 0; _draw = 0; _util = 0;
+ _video = 0; _saveLoad = 0;
+
+ _pauseStart = 0;
// Setup mixer
_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume"));
@@ -89,21 +87,24 @@ GobEngine::GobEngine(OSystem *syst) : Engine(syst) {
Common::addSpecialDebugLevel(kDebugFuncOp, "FuncOpcodes", "Script FuncOpcodes debug level");
Common::addSpecialDebugLevel(kDebugDrawOp, "DrawOpcodes", "Script DrawOpcodes debug level");
Common::addSpecialDebugLevel(kDebugGobOp, "GoblinOpcodes", "Script GoblinOpcodes debug level");
- Common::addSpecialDebugLevel(kDebugMusic, "Music", "CD, Adlib and Infogrames music debug level");
+ Common::addSpecialDebugLevel(kDebugSound, "Sound", "Sound output debug level");
Common::addSpecialDebugLevel(kDebugParser, "Parser", "Parser debug level");
Common::addSpecialDebugLevel(kDebugGameFlow, "Gameflow", "Gameflow debug level");
Common::addSpecialDebugLevel(kDebugFileIO, "FileIO", "File Input/Output debug level");
+ Common::addSpecialDebugLevel(kDebugSaveLoad, "SaveLoad", "Saving/Loading debug level");
Common::addSpecialDebugLevel(kDebugGraphics, "Graphics", "Graphics debug level");
+ Common::addSpecialDebugLevel(kDebugVideo, "Video", "IMD/VMD video debug level");
Common::addSpecialDebugLevel(kDebugCollisions, "Collisions", "Collisions debug level");
syst->getEventManager()->registerRandomSource(_rnd, "gob");
}
GobEngine::~GobEngine() {
+ deinitGameParts();
+
// Stop all mixer streams (except for the permanent ones).
_vm->_mixer->stopAll();
- deinitGameParts();
delete[] _startTot;
delete[] _startTot0;
}
@@ -118,6 +119,12 @@ void GobEngine::shutdown() {
_quitRequested = true;
}
+const char *GobEngine::getLangDesc(int16 language) const {
+ if ((language < 0) || (language > 8))
+ language = 2;
+ return Common::getLanguageDescription(_gobToScummVMLang[language]);
+}
+
void GobEngine::validateLanguage() {
if (_vm->_global->_languageWanted != _vm->_global->_language) {
warning("Your game version doesn't support the requested language %s",
@@ -140,6 +147,30 @@ void GobEngine::validateVideoMode(int16 videoMode) {
error("Video mode 0x%X is not supported!", videoMode);
}
+Common::Platform GobEngine::getPlatform() const {
+ return _platform;
+}
+
+GameType GobEngine::getGameType() const {
+ return _gameType;
+}
+
+bool GobEngine::isCD() const {
+ return (_features & kFeaturesCD) != 0;
+}
+
+bool GobEngine::isEGA() const {
+ return (_features & kFeaturesEGA) != 0;
+}
+
+bool GobEngine::is640() const {
+ return (_features & kFeatures640) != 0;
+}
+
+bool GobEngine::hasAdlib() const {
+ return (_features & kFeaturesAdlib) != 0;
+}
+
int GobEngine::init() {
if (!initGameParts()) {
GUIErrorMessage("GobEngine::init(): Unknown version of game engine");
@@ -219,8 +250,26 @@ int GobEngine::init() {
return 0;
}
+void GobEngine::pauseEngineIntern(bool pause) {
+ if (pause) {
+ _pauseStart = _system->getMillis();
+ } else {
+ uint32 duration = _system->getMillis() - _pauseStart;
+
+ _vm->_vidPlayer->notifyPaused(duration);
+
+ _vm->_game->_startTimeKey += duration;
+ _vm->_draw->_cursorTimeKey += duration;
+ if (_vm->_inter->_soundEndTimeKey != 0)
+ _vm->_inter->_soundEndTimeKey += duration;
+ }
+
+ _mixer->pauseAll(pause);
+}
+
bool GobEngine::initGameParts() {
- _adlib = 0;
+ _noMusic = MidiDriver::parseMusicDriver(ConfMan.get("music_driver")) == MD_NULL;
+
_saveLoad = 0;
_global = new Global(this);
@@ -228,8 +277,7 @@ bool GobEngine::initGameParts() {
_dataIO = new DataIO(this);
_palAnim = new PalAnim(this);
_vidPlayer = new VideoPlayer(this);
- _cdrom = new CDROM(this);
- _snd = new Snd(this);
+ _sound = new Sound(this);
switch (_gameType) {
case kGameTypeGob1:
@@ -327,7 +375,7 @@ bool GobEngine::initGameParts() {
_map = new Map_v4(this);
_goblin = new Goblin_v4(this);
_scenery = new Scenery_v2(this);
- _saveLoad = new SaveLoad_v3(this, _targetName.c_str());
+ _saveLoad = new SaveLoad_v4(this, _targetName.c_str());
break;
default:
@@ -336,10 +384,6 @@ bool GobEngine::initGameParts() {
break;
}
- _noMusic = MidiDriver::parseMusicDriver(ConfMan.get("music_driver")) == MD_NULL;
- if (!_noMusic && hasAdlib())
- _adlib = new Adlib(this);
-
if (is640()) {
_video->_surfWidth = _width = 640;
_video->_surfHeight = _video->_splitHeight1 = _height = 480;
@@ -360,15 +404,12 @@ bool GobEngine::initGameParts() {
}
void GobEngine::deinitGameParts() {
- delete _snd; _snd = 0;
- delete _adlib; _adlib = 0;
+ delete _saveLoad; _saveLoad = 0;
delete _mult; _mult = 0;
+ delete _vidPlayer; _vidPlayer = 0;
delete _game; _game = 0;
delete _global; _global = 0;
- delete _cdrom; _cdrom = 0;
- delete _dataIO; _dataIO = 0;
delete _goblin; _goblin = 0;
- delete _vidPlayer; _vidPlayer = 0;
delete _init; _init = 0;
delete _inter; _inter = 0;
delete _map; _map = 0;
@@ -378,7 +419,8 @@ void GobEngine::deinitGameParts() {
delete _draw; _draw = 0;
delete _util; _util = 0;
delete _video; _video = 0;
- delete _saveLoad; _saveLoad = 0;
+ delete _sound; _sound = 0;
+ delete _dataIO; _dataIO = 0;
}
} // End of namespace Gob
diff --git a/engines/gob/gob.h b/engines/gob/gob.h
index e23e917a7c..ae2b53bc31 100644
--- a/engines/gob/gob.h
+++ b/engines/gob/gob.h
@@ -35,11 +35,10 @@
namespace Gob {
class Game;
-class Snd;
+class Sound;
class Video;
class Global;
class Draw;
-class CDROM;
class DataIO;
class Goblin;
class VideoPlayer;
@@ -52,31 +51,33 @@ class Parse;
class Scenery;
class Util;
class SaveLoad;
-class Adlib;
-
-#define VARP(offs) (_vm->_global->_inter_variables + (offs))
-#define WRITE_VARO_UINT32(offs, val) _vm->_global->writeVar(offs, (uint32) (val))
-#define WRITE_VARO_UINT16(offs, val) _vm->_global->writeVar(offs, (uint16) (val))
-#define WRITE_VARO_UINT8(offs, val) _vm->_global->writeVar(offs, (uint8) (val))
-#define WRITE_VARO_STR(offs, str) _vm->_global->writeVar(offs, (const char *) (str))
-#define WRITE_VAR_UINT32(var, val) WRITE_VARO_UINT32((var) << 2, (val))
-#define WRITE_VAR_UINT16(var, val) WRITE_VARO_UINT16((var) << 2, (val))
-#define WRITE_VAR_UINT8(var, val) WRITE_VARO_UINT8((var) << 2, (val))
-#define WRITE_VAR_STR(var, str) WRITE_VARO_STR((var) << 2, (str))
-#define READ_VARO_UINT32(offs) READ_UINT32(VARP(offs))
-#define READ_VARO_UINT16(offs) READ_UINT16(VARP(offs))
-#define READ_VARO_UINT8(offs) (*((uint8 *) VARP(offs)))
-#define READ_VAR_UINT32(var) READ_VARO_UINT32((var) << 2)
-#define READ_VAR_UINT16(var) READ_VARO_UINT16((var) << 2)
-#define READ_VAR_UINT8(var) READ_VARO_UINT8((var) << 2)
-#define GET_VARO_STR(offs) ((char *) VARP(offs))
-#define GET_VAR_STR(var) GET_VARO_STR((var) << 2)
-
-#define WRITE_VAR_OFFSET(offs, val) WRITE_VARO_UINT32((offs), (val))
-#define WRITE_VAR(var, val) WRITE_VAR_UINT32((var), (val))
-#define VAR_OFFSET(offs) READ_VARO_UINT32(offs)
-#define VAR(var) READ_VAR_UINT32(var)
-#define VAR_ADDRESS(var) ((uint32 *) VARP((var) << 2))
+
+#define WRITE_VAR_UINT32(var, val) _vm->_inter->_variables->writeVar32(var, val)
+#define WRITE_VAR_UINT16(var, val) _vm->_inter->_variables->writeVar16(var, val)
+#define WRITE_VAR_UINT8(var, val) _vm->_inter->_variables->writeVar8(var, val)
+#define WRITE_VAR_STR(var, str) _vm->_inter->_variables->writeVarString(var, str)
+#define WRITE_VARO_UINT32(off, val) _vm->_inter->_variables->writeOff32(off, val)
+#define WRITE_VARO_UINT16(off, val) _vm->_inter->_variables->writeOff16(off, val)
+#define WRITE_VARO_UINT8(off, val) _vm->_inter->_variables->writeOff8(off, val)
+#define WRITE_VARO_STR(off, str) _vm->_inter->_variables->writeOffString(off, str)
+#define READ_VAR_UINT32(var) _vm->_inter->_variables->readVar32(var)
+#define READ_VAR_UINT16(var) _vm->_inter->_variables->readVar16(var)
+#define READ_VAR_UINT8(var) _vm->_inter->_variables->readVar8(var)
+#define READ_VARO_UINT32(off) _vm->_inter->_variables->readOff32(off)
+#define READ_VARO_UINT16(off) _vm->_inter->_variables->readOff16(off)
+#define READ_VARO_UINT8(off) _vm->_inter->_variables->readOff8(off)
+#define GET_VAR_STR(var) _vm->_inter->_variables->getAddressVarString(var, 0)
+#define GET_VARO_STR(off) _vm->_inter->_variables->getAddressOffString(off, 0)
+#define GET_VAR_FSTR(var) _vm->_inter->_variables->getAddressVarString(var)
+#define GET_VARO_FSTR(off) _vm->_inter->_variables->getAddressOffString(off)
+
+#define VAR_ADDRESS(var) _vm->_inter->_variables->getAddressVar32(var)
+
+#define WRITE_VAR_OFFSET(off, val) WRITE_VARO_UINT32((off), (val))
+#define WRITE_VAR(var, val) WRITE_VAR_UINT32((var), (val))
+#define VAR_OFFSET(off) READ_VARO_UINT32(off)
+#define VAR(var) READ_VAR_UINT32(var)
+
enum GameType {
kGameTypeNone = 0,
@@ -102,12 +103,14 @@ enum {
kDebugFuncOp = 1 << 0,
kDebugDrawOp = 1 << 1,
kDebugGobOp = 1 << 2,
- kDebugMusic = 1 << 3, // CD, Adlib and Infogrames music
+ kDebugSound = 1 << 3,
kDebugParser = 1 << 4,
kDebugGameFlow = 1 << 5,
kDebugFileIO = 1 << 6,
- kDebugGraphics = 1 << 7,
- kDebugCollisions = 1 << 8
+ kDebugSaveLoad = 1 << 7,
+ kDebugGraphics = 1 << 8,
+ kDebugVideo = 1 << 9,
+ kDebugCollisions = 1 << 10
};
inline char *strncpy0(char *dest, const char *src, size_t n) {
@@ -171,12 +174,19 @@ private:
struct GOBGameDescription;
class GobEngine : public Engine {
-protected:
+private:
GobEngine *_vm;
+ GameType _gameType;
+ int32 _features;
+ Common::Platform _platform;
+
+ uint32 _pauseStart;
+
int go();
int init();
+ void pauseEngineIntern(bool pause);
bool initGameParts();
void deinitGameParts();
@@ -185,11 +195,7 @@ public:
Common::RandomSource _rnd;
- GameType _gameType;
- int32 _features;
Common::Language _language;
- Common::Platform _platform;
-
uint16 _width;
uint16 _height;
uint8 _mode;
@@ -204,10 +210,9 @@ public:
Util *_util;
DataIO *_dataIO;
Game *_game;
- Snd *_snd;
+ Sound *_sound;
Video *_video;
Draw *_draw;
- CDROM *_cdrom;
Goblin *_goblin;
Init *_init;
Map *_map;
@@ -217,24 +222,20 @@ public:
Scenery *_scenery;
Inter *_inter;
SaveLoad *_saveLoad;
- Adlib *_adlib;
VideoPlayer *_vidPlayer;
void shutdown();
- const char *getLangDesc(int16 language) {
- if ((language < 0) || (language > 8))
- language = 2;
- return Common::getLanguageDescription(_gobToScummVMLang[language]);
- }
+ const char *getLangDesc(int16 language) const;
void validateLanguage();
void validateVideoMode(int16 videoMode);
- GameType getGameType() { return _gameType; }
- bool isCD() { return (_features & kFeaturesCD) != 0; }
- bool isEGA() { return (_features & kFeaturesEGA) != 0; }
- bool is640() { return (_features & kFeatures640) != 0; }
- bool hasAdlib() { return (_features & kFeaturesAdlib) != 0; }
+ Common::Platform getPlatform() const;
+ GameType getGameType() const;
+ bool isCD() const;
+ bool isEGA() const;
+ bool is640() const;
+ bool hasAdlib() const;
GobEngine(OSystem *syst);
virtual ~GobEngine();
diff --git a/engines/gob/goblin.cpp b/engines/gob/goblin.cpp
index 64a2b15ef4..e7aed0790e 100644
--- a/engines/gob/goblin.cpp
+++ b/engines/gob/goblin.cpp
@@ -32,7 +32,8 @@
#include "gob/map.h"
#include "gob/mult.h"
#include "gob/scenery.h"
-#include "gob/sound.h"
+#include "gob/inter.h"
+#include "gob/sound/sound.h"
namespace Gob {
@@ -164,7 +165,7 @@ Goblin::~Goblin() {
for (col = 0; col < 6; col++)
if (_goblins[i]->realStateMach[state][col])
delete _goblins[i]->realStateMach[state][col];
- delete []_goblins[i]->realStateMach;
+ delete[] _goblins[i]->realStateMach;
}
delete _goblins[i];
}
@@ -176,7 +177,7 @@ Goblin::~Goblin() {
for (col = 0; col < 6; col++)
if (_objects[i]->realStateMach[state][col])
delete _objects[i]->realStateMach[state][col];
- delete []_objects[i]->realStateMach;
+ delete[] _objects[i]->realStateMach;
}
delete _objects[i];
}
@@ -255,8 +256,8 @@ void Goblin::sortByOrder(Util::List *list) {
void Goblin::playSound(SoundDesc &snd, int16 repCount, int16 freq) {
if (!snd.empty()) {
- _vm->_snd->stopSound(0);
- _vm->_snd->playSample(snd, repCount, freq);
+ _vm->_sound->blasterStop(0);
+ _vm->_sound->blasterPlay(&snd, repCount, freq);
}
}
@@ -1216,7 +1217,7 @@ void Goblin::zeroObjects(void) {
_objects[i] = 0;
for (int i = 0; i < 16; i++)
- _vm->_snd->freeSample(_soundData[i]);
+ _vm->_sound->sampleFree(&_soundData[i]);
}
void Goblin::freeAllObjects(void) {
@@ -1717,12 +1718,12 @@ void Goblin::playSounds(Mult::Mult_Object *obj) {
if (!speaker) {
sndSlot = obj->goblinStates[animData->state][i].sndItem;
- _vm->_snd->stopSound(0);
+ _vm->_sound->blasterStop(0);
if (sndSlot < _soundSlotsCount)
- _vm->_snd->playSample(_vm->_game->_soundSamples[_soundSlots[sndSlot] & 0x7FFF],
+ _vm->_sound->blasterPlay(_vm->_sound->sampleGetBySlot(_soundSlots[sndSlot] & 0x7FFF),
repCount, frequency);
} else
- _vm->_snd->speakerOn(frequency, repCount * 10);
+ _vm->_sound->speakerOn(frequency, repCount * 10);
}
}
diff --git a/engines/gob/goblin.h b/engines/gob/goblin.h
index f7ac4aa549..3fd8a9f93b 100644
--- a/engines/gob/goblin.h
+++ b/engines/gob/goblin.h
@@ -27,8 +27,8 @@
#define GOB_GOBLIN_H
#include "gob/util.h"
-#include "gob/sound.h"
#include "gob/mult.h"
+#include "gob/sound/sounddesc.h"
namespace Gob {
diff --git a/engines/gob/goblin_v1.cpp b/engines/gob/goblin_v1.cpp
index f7bdbf10a5..6ac086767b 100644
--- a/engines/gob/goblin_v1.cpp
+++ b/engines/gob/goblin_v1.cpp
@@ -23,7 +23,6 @@
*
*/
-
#include "common/endian.h"
#include "gob/gob.h"
@@ -32,7 +31,7 @@
#include "gob/map.h"
#include "gob/mult.h"
#include "gob/scenery.h"
-#include "gob/sound.h"
+#include "gob/sound/sound.h"
namespace Gob {
@@ -48,7 +47,7 @@ void Goblin_v1::freeObjects(void) {
int16 col;
for (int i = 0; i < 16; i++)
- _vm->_snd->freeSample(_soundData[i]);
+ _vm->_sound->sampleFree(&_soundData[i]);
for (int i = 0; i < 4; i++) {
if (_goblins[i] == 0)
@@ -488,19 +487,19 @@ void Goblin_v1::moveAdvance(Mult::Mult_Object *obj, Gob_Object *gobDesc,
if ((gobDesc->state >= 0) && (gobDesc->state < 10) &&
(gobDesc->stateMach == gobDesc->realStateMach) &&
((gobDesc->curFrame == 3) || (gobDesc->curFrame == 6))) {
- _vm->_snd->speakerOn(10 * _vm->_util->getRandom(3) + 50, 5);
+ _vm->_sound->speakerOn(10 * _vm->_util->getRandom(3) + 50, 5);
}
if ((_currentGoblin == 0) &&
(gobDesc->stateMach == gobDesc->realStateMach) &&
((gobDesc->state == 10) || (gobDesc->state == 11)) &&
(gobDesc->curFrame == 9)) {
- _vm->_snd->stopSound(0);
+ _vm->_sound->blasterStop(0);
if (_itemIndInPocket != -1)
- _vm->_snd->playSample(_soundData[14], 1, 9000);
+ _vm->_sound->blasterPlay(&_soundData[14], 1, 9000);
else
- _vm->_snd->playSample(_soundData[14], 1, 5000);
+ _vm->_sound->blasterPlay(&_soundData[14], 1, 5000);
}
if (_boreCounter++ == 120) {
diff --git a/engines/gob/goblin_v2.cpp b/engines/gob/goblin_v2.cpp
index c9e155ad08..9144e35070 100644
--- a/engines/gob/goblin_v2.cpp
+++ b/engines/gob/goblin_v2.cpp
@@ -23,7 +23,6 @@
*
*/
-
#include "common/endian.h"
#include "gob/gob.h"
@@ -34,6 +33,7 @@
#include "gob/map.h"
#include "gob/mult.h"
#include "gob/scenery.h"
+#include "gob/inter.h"
namespace Gob {
diff --git a/engines/gob/goblin_v4.cpp b/engines/gob/goblin_v4.cpp
index 167946e30d..1df5aab606 100644
--- a/engines/gob/goblin_v4.cpp
+++ b/engines/gob/goblin_v4.cpp
@@ -29,6 +29,7 @@
#include "gob/mult.h"
#include "gob/map.h"
#include "gob/scenery.h"
+#include "gob/inter.h"
namespace Gob {
diff --git a/engines/gob/init.cpp b/engines/gob/init.cpp
index 4d184c53d3..c2f8b48626 100644
--- a/engines/gob/init.cpp
+++ b/engines/gob/init.cpp
@@ -23,7 +23,6 @@
*
*/
-
#include "common/endian.h"
#include "gob/gob.h"
@@ -31,13 +30,13 @@
#include "gob/global.h"
#include "gob/util.h"
#include "gob/dataio.h"
-#include "gob/cdrom.h"
#include "gob/draw.h"
#include "gob/game.h"
#include "gob/palanim.h"
-#include "gob/sound.h"
+#include "gob/inter.h"
#include "gob/video.h"
#include "gob/videoplayer.h"
+#include "gob/sound/sound.h"
namespace Gob {
@@ -51,8 +50,8 @@ void Init::cleanup(void) {
_vm->_video->freeDriver();
_vm->_global->_primarySurfDesc = 0;
- _vm->_snd->speakerOff();
- _vm->_snd->stopSound(0);
+ _vm->_sound->speakerOff();
+ _vm->_sound->blasterStop(0);
_vm->_dataIO->closeDataFile();
}
@@ -64,7 +63,6 @@ void Init::initGame(const char *totName) {
char *infPtr;
char *infEnd;
char buffer[128];
- int32 varsCount;
initVideo();
@@ -92,8 +90,6 @@ void Init::initGame(const char *totName) {
_vm->_game->_totTextData = 0;
_vm->_game->_totFileData = 0;
_vm->_game->_totResourceTable = 0;
- _vm->_global->_inter_variables = 0;
- _vm->_global->_inter_variablesSizes = 0;
_palDesc = new Video::PalDesc;
_vm->validateVideoMode(_vm->_global->_videoMode);
@@ -159,18 +155,14 @@ void Init::initGame(const char *totName) {
DataStream *stream = _vm->_dataIO->openAsStream(handle, true);
stream->seek(0x2C);
- varsCount = stream->readUint16LE();
+ _vm->_inter->allocateVars(stream->readUint16LE());
delete stream;
- _vm->_global->_inter_variables = new byte[varsCount * 4];
- _vm->_global->_inter_variablesSizes = new byte[varsCount * 4];
- _vm->_global->clearVars(varsCount);
-
strcpy(_vm->_game->_curTotFile, buffer);
- _vm->_cdrom->testCD(1, "GOB");
- _vm->_cdrom->readLIC("gob.lic");
+ _vm->_sound->cdTest(1, "GOB");
+ _vm->_sound->cdLoadLIC("gob.lic");
// Search for a Coktel logo animation or image to display
imdHandle = _vm->_dataIO->openData("coktel.imd");
@@ -213,11 +205,9 @@ void Init::initGame(const char *totName) {
_vm->_game->start();
- _vm->_cdrom->stopPlaying();
- _vm->_cdrom->freeLICbuffer();
+ _vm->_sound->cdStop();
+ _vm->_sound->cdUnloadLIC();
- delete[] _vm->_global->_inter_variables;
- delete[] _vm->_global->_inter_variablesSizes;
delete[] _vm->_game->_totFileData;
if (_vm->_game->_totTextData) {
if (_vm->_game->_totTextData->items)
diff --git a/engines/gob/init_v1.cpp b/engines/gob/init_v1.cpp
index 8065c4dc8c..90456f927c 100644
--- a/engines/gob/init_v1.cpp
+++ b/engines/gob/init_v1.cpp
@@ -23,7 +23,6 @@
*
*/
-
#include "common/endian.h"
#include "gob/gob.h"
diff --git a/engines/gob/init_v2.cpp b/engines/gob/init_v2.cpp
index bb29f4e8fd..b468c15c25 100644
--- a/engines/gob/init_v2.cpp
+++ b/engines/gob/init_v2.cpp
@@ -23,7 +23,6 @@
*
*/
-
#include "common/endian.h"
#include "gob/gob.h"
@@ -50,8 +49,8 @@ void Init_v2::initVideo() {
_vm->_global->_inVM = 0;
_vm->_global->_colorCount = 16;
- if (((_vm->_platform == Common::kPlatformPC) ||
- (_vm->_platform == Common::kPlatformMacintosh)) &&
+ if (((_vm->getPlatform() == Common::kPlatformPC) ||
+ (_vm->getPlatform() == Common::kPlatformMacintosh)) &&
((_vm->_global->_videoMode == 0x13) ||
(_vm->_global->_videoMode == 0x14)))
_vm->_global->_colorCount = 256;
diff --git a/engines/gob/inter.cpp b/engines/gob/inter.cpp
index de3ac4b1f5..9c39653a1d 100644
--- a/engines/gob/inter.cpp
+++ b/engines/gob/inter.cpp
@@ -23,6 +23,7 @@
*
*/
+#include <time.h> // FIXME: for Inter::renewTimeInVars()
#include "common/endian.h"
@@ -34,9 +35,7 @@
#include "gob/game.h"
#include "gob/parse.h"
#include "gob/scenery.h"
-#include "gob/sound.h"
-
-#include <time.h> // FIXME: for Inter::renewTimeInVars()
+#include "gob/sound/sound.h"
namespace Gob {
@@ -61,6 +60,12 @@ Inter::Inter(GobEngine *vm) : _vm(vm) {
_pastePos = 0;
_noBusyWait = false;
+
+ _variables = 0;
+}
+
+Inter::~Inter() {
+ delocateVars();
}
void Inter::initControlVars(char full) {
@@ -154,7 +159,7 @@ void Inter::storeKey(int16 key) {
WRITE_VAR(12, _vm->_util->getTimeKey() - _vm->_game->_startTimeKey);
storeMouse();
- WRITE_VAR(1, _vm->_snd->_playingSound);
+ WRITE_VAR(1, _vm->_sound->blasterPlayingSound());
if (key == 0x4800)
key = 0x0B;
@@ -280,4 +285,18 @@ void Inter::callSub(int16 retFlag) {
_terminate = 1;
}
+void Inter::allocateVars(uint32 count) {
+ if ((_vm->getPlatform() == Common::kPlatformAmiga) ||
+ (_vm->getPlatform() == Common::kPlatformMacintosh) ||
+ (_vm->getPlatform() == Common::kPlatformAtariST))
+ _variables = new VariablesBE(count * 4);
+ else
+ _variables = new VariablesLE(count * 4);
+}
+
+void Inter::delocateVars() {
+ delete _variables;
+ _variables = 0;
+}
+
} // End of namespace Gob
diff --git a/engines/gob/inter.h b/engines/gob/inter.h
index 582e57a2d4..60b3974d6d 100644
--- a/engines/gob/inter.h
+++ b/engines/gob/inter.h
@@ -27,6 +27,7 @@
#define GOB_INTER_H
#include "gob/goblin.h"
+#include "gob/variables.h"
namespace Gob {
@@ -48,6 +49,8 @@ public:
uint32 _soundEndTimeKey;
int16 _soundStopVal;
+ Variables *_variables;
+
void initControlVars(char full);
int16 load16();
char evalExpr(int16 *pRes);
@@ -59,11 +62,14 @@ public:
void funcBlock(int16 retFlag);
void callSub(int16 retFlag);
+ void allocateVars(uint32 count);
+ void delocateVars();
+
virtual int16 loadSound(int16 slot) = 0;
virtual void animPalette() = 0;
Inter(GobEngine *vm);
- virtual ~Inter() {}
+ virtual ~Inter();
protected:
struct OpFuncParams {
@@ -83,7 +89,7 @@ protected:
int16 _animPalHighIndex[8];
int16 _animPalDir[8];
- char _pasteBuf[300];
+ byte _pasteBuf[300];
byte _pasteSizeBuf[300];
int16 _pastePos;
@@ -519,6 +525,7 @@ protected:
virtual const char *getOpcodeFuncDesc(byte i, byte j);
virtual const char *getOpcodeGoblinDesc(int i);
+ void o4_initScreen();
void o4_playVmdOrMusic();
};
diff --git a/engines/gob/inter_bargon.cpp b/engines/gob/inter_bargon.cpp
index 702950d539..d493fb00d3 100644
--- a/engines/gob/inter_bargon.cpp
+++ b/engines/gob/inter_bargon.cpp
@@ -23,7 +23,6 @@
*
*/
-
#include "common/endian.h"
#include "gob/gob.h"
@@ -34,9 +33,9 @@
#include "gob/draw.h"
#include "gob/game.h"
#include "gob/palanim.h"
-#include "gob/sound.h"
#include "gob/video.h"
#include "gob/videoplayer.h"
+#include "gob/sound/sound.h"
namespace Gob {
@@ -768,9 +767,9 @@ void Inter_Bargon::oBargon_intro2(OpGobParams &params) {
return;
for (i = 0; i < 4; i++)
- _vm->_snd->loadSample(samples[i], sndFiles[i]);
- _vm->_snd->playComposition(comp, 0, samples, 4);
- _vm->_snd->waitEndPlay(true, false);
+ _vm->_sound->sampleLoad(&samples[i], sndFiles[i]);
+ _vm->_sound->blasterPlayComposition(comp, 0, samples, 4);
+ _vm->_sound->blasterWaitEndPlay(true, false);
_vm->_palAnim->fade(0, 0, 0);
_vm->_video->clearSurf(_vm->_draw->_frontSurface);
}
@@ -787,12 +786,12 @@ void Inter_Bargon::oBargon_intro3(OpGobParams &params) {
static const char *palFiles[] = {"2ou2.clt", "2ou3.clt", "2ou4.clt", "2ou5.clt"};
for (int i = 0; i < 2; i++)
- _vm->_snd->loadSample(samples[i], sndFiles[i]);
+ _vm->_sound->sampleLoad(&samples[i], sndFiles[i]);
for (int i = 0; i < 4; i++)
palettes[i] = _vm->_dataIO->getData(palFiles[i]);
palBak = _vm->_global->_pPaletteDesc->vgaPal;
- _vm->_snd->playComposition(comp, 0, samples, 2);
+ _vm->_sound->blasterPlayComposition(comp, 0, samples, 2);
for (int i = 0; i < 20; i++) {
for (int j = 0; j < 4; j++) {
_vm->_global->_pPaletteDesc->vgaPal = (Video::Color *) palettes[j];
@@ -801,7 +800,7 @@ void Inter_Bargon::oBargon_intro3(OpGobParams &params) {
}
if ((_vm->_game->checkKeys(&mouseX, &mouseY, &buttons, 0) == 0x11B) ||
_vm->_quitRequested) {
- _vm->_snd->stopSound(10);
+ _vm->_sound->blasterStop(10);
_vm->_palAnim->fade(0, -2, 0);
_vm->_video->clearSurf(_vm->_draw->_frontSurface);
memset((char *) _vm->_draw->_vgaPalette, 0, 768);
@@ -811,7 +810,7 @@ void Inter_Bargon::oBargon_intro3(OpGobParams &params) {
break;
}
}
- _vm->_snd->waitEndPlay(false, false);
+ _vm->_sound->blasterWaitEndPlay(false, false);
_vm->_global->_pPaletteDesc->vgaPal = palBak;
for (int i = 0; i < 4; i++)
diff --git a/engines/gob/inter_v1.cpp b/engines/gob/inter_v1.cpp
index 9707a628b4..e2b8d65112 100644
--- a/engines/gob/inter_v1.cpp
+++ b/engines/gob/inter_v1.cpp
@@ -23,7 +23,6 @@
*
*/
-
#include "common/endian.h"
#include "common/file.h"
@@ -32,8 +31,6 @@
#include "gob/global.h"
#include "gob/util.h"
#include "gob/dataio.h"
-#include "gob/music.h"
-#include "gob/cdrom.h"
#include "gob/draw.h"
#include "gob/game.h"
#include "gob/goblin.h"
@@ -43,8 +40,8 @@
#include "gob/palanim.h"
#include "gob/parse.h"
#include "gob/scenery.h"
-#include "gob/sound.h"
#include "gob/video.h"
+#include "gob/sound/sound.h"
namespace Gob {
@@ -932,16 +929,16 @@ void Inter_v1::o1_initMult() {
_vm->_mult->_objCount * sizeof(Mult::Mult_Object));
for (int i = 0; i < _vm->_mult->_objCount; i++) {
- _vm->_mult->_objects[i].pPosX =
- (int32 *)(_vm->_global->_inter_variables +
- i * 4 + (posXVar / 4) * 4);
- _vm->_mult->_objects[i].pPosY =
- (int32 *)(_vm->_global->_inter_variables +
- i * 4 + (posYVar / 4) * 4);
+ uint32 offPosX = i * 4 + (posXVar / 4) * 4;
+ uint32 offPosY = i * 4 + (posYVar / 4) * 4;
+ uint32 offAnim = animDataVar + i * 4 * _vm->_global->_inter_animDataSize;
+
+ _vm->_mult->_objects[i].pPosX = (int32 *) _variables->getAddressOff32(offPosX);
+ _vm->_mult->_objects[i].pPosY = (int32 *) _variables->getAddressOff32(offPosY);
_vm->_mult->_objects[i].pAnimData =
- (Mult::Mult_AnimData *) (_vm->_global->_inter_variables +
- animDataVar + i * 4 * _vm->_global->_inter_animDataSize);
+ (Mult::Mult_AnimData *) _variables->getAddressOff8(offAnim,
+ _vm->_global->_inter_animDataSize);
_vm->_mult->_objects[i].pAnimData->isStatic = 1;
_vm->_mult->_objects[i].tick = 0;
@@ -1071,12 +1068,8 @@ void Inter_v1::o1_loadCurLayer() {
void Inter_v1::o1_playCDTrack() {
evalExpr(0);
- if (_vm->_platform == Common::kPlatformMacintosh) {
- if (_vm->_adlib)
- _vm->_adlib->playTrack(_vm->_global->_inter_resStr);
- } else
- // Used in gob1 CD
- _vm->_cdrom->startTrack(_vm->_global->_inter_resStr);
+ _vm->_sound->adlibPlayBgMusic(); // Mac version
+ _vm->_sound->cdPlay(_vm->_global->_inter_resStr); // PC CD version
}
void Inter_v1::o1_getCDTrackPos() {
@@ -1088,19 +1081,15 @@ void Inter_v1::o1_getCDTrackPos() {
_vm->_util->longDelay(1);
- int pos = _vm->_cdrom->getTrackPos();
+ int pos = _vm->_sound->cdGetTrackPos();
if (pos == -1)
pos = 32767;
WRITE_VAR(5, pos);
}
void Inter_v1::o1_stopCD() {
- if (_vm->_platform == Common::kPlatformMacintosh) {
- if (_vm->_adlib)
- _vm->_adlib->stopPlay();
- } else
- // Used in gob1 CD
- _vm->_cdrom->stopPlaying();
+ _vm->_sound->adlibStop(); // Mac version
+ _vm->_sound->cdStop(); // PC CD version
}
void Inter_v1::o1_loadFontToSprite() {
@@ -1685,7 +1674,7 @@ bool Inter_v1::o1_keyFunc(OpFuncParams &params) {
break;
default:
- _vm->_snd->speakerOnUpdate(cmd);
+ _vm->_sound->speakerOnUpdate(cmd);
if (cmd < 20) {
_vm->_util->delay(cmd);
_noBusyWait = true;
@@ -1759,12 +1748,12 @@ bool Inter_v1::o1_renewTimeInVars(OpFuncParams &params) {
}
bool Inter_v1::o1_speakerOn(OpFuncParams &params) {
- _vm->_snd->speakerOn(_vm->_parse->parseValExpr(), -1);
+ _vm->_sound->speakerOn(_vm->_parse->parseValExpr(), -1);
return false;
}
bool Inter_v1::o1_speakerOff(OpFuncParams &params) {
- _vm->_snd->speakerOff();
+ _vm->_sound->speakerOff();
return false;
}
@@ -1978,10 +1967,10 @@ bool Inter_v1::o1_playSound(OpFuncParams &params) {
repCount = _vm->_parse->parseValExpr();
frequency = _vm->_parse->parseValExpr();
- SoundDesc &sample = _vm->_game->_soundSamples[index];
+ SoundDesc *sample = _vm->_sound->sampleGetBySlot(index);
_soundEndTimeKey = 0;
- if (sample.empty())
+ if (!sample || sample->empty())
return false;
if (repCount < 0) {
@@ -1991,31 +1980,28 @@ bool Inter_v1::o1_playSound(OpFuncParams &params) {
repCount = -repCount;
_soundEndTimeKey = _vm->_util->getTimeKey();
- freq2 = frequency ? frequency : sample._frequency;
+ freq2 = frequency ? frequency : sample->_frequency;
endRep = MAX(repCount - 1, 1);
- _soundStopVal = sample.calcFadeOutLength(freq2);
- _soundEndTimeKey += sample.calcLength(endRep, freq2, true);
+ _soundStopVal = sample->calcFadeOutLength(freq2);
+ _soundEndTimeKey += sample->calcLength(endRep, freq2, true);
}
- if (sample.getType() == SOUND_ADL) {
- if (_vm->_adlib) {
- _vm->_adlib->load(sample.getData(), sample.size(), index);
- _vm->_adlib->setRepeating(repCount - 1);
- _vm->_adlib->startPlay();
- }
+ if (sample->getType() == SOUND_ADL) {
+ _vm->_sound->adlibLoad(sample->getData(), sample->size(), index);
+ _vm->_sound->adlibSetRepeating(repCount - 1);
+ _vm->_sound->adlibPlay();
} else {
- _vm->_snd->stopSound(0);
- _vm->_snd->playSample(sample, repCount - 1, frequency);
+ _vm->_sound->blasterStop(0);
+ _vm->_sound->blasterPlay(sample, repCount - 1, frequency);
}
return false;
}
bool Inter_v1::o1_stopSound(OpFuncParams &params) {
- if (_vm->_adlib)
- _vm->_adlib->stopPlay();
- _vm->_snd->stopSound(_vm->_parse->parseValExpr());
+ _vm->_sound->adlibStop();
+ _vm->_sound->blasterStop(_vm->_parse->parseValExpr());
_soundEndTimeKey = 0;
return false;
@@ -2032,7 +2018,7 @@ bool Inter_v1::o1_freeSoundSlot(OpFuncParams &params) {
}
bool Inter_v1::o1_waitEndPlay(OpFuncParams &params) {
- _vm->_snd->waitEndPlay();
+ _vm->_sound->blasterWaitEndPlay();
return false;
}
@@ -2046,7 +2032,7 @@ bool Inter_v1::o1_playComposition(OpFuncParams &params) {
for (int i = 0; i < 50; i++)
composition[i] = (int16) VAR_OFFSET(dataVar + i * 4);
- _vm->_snd->playComposition(composition, freqVal);
+ _vm->_sound->blasterPlayComposition(composition, freqVal);
return false;
}
@@ -2083,8 +2069,7 @@ bool Inter_v1::o1_prepareStr(OpFuncParams &params) {
int16 strVar;
strVar = _vm->_parse->parseVarIndex();
- _vm->_util->prepareStr(GET_VARO_STR(strVar));
- _vm->_global->writeVarSizeStr(strVar, strlen(GET_VARO_STR(strVar)));
+ _vm->_util->prepareStr(GET_VARO_FSTR(strVar));
return false;
}
@@ -2095,8 +2080,9 @@ bool Inter_v1::o1_insertStr(OpFuncParams &params) {
strVar = _vm->_parse->parseVarIndex();
evalExpr(0);
pos = _vm->_parse->parseValExpr();
- _vm->_util->insertStr(_vm->_global->_inter_resStr, GET_VARO_STR(strVar), pos);
- _vm->_global->writeVarSizeStr(strVar, strlen(GET_VARO_STR(strVar)));
+
+ char *str = GET_VARO_FSTR(strVar);
+ _vm->_util->insertStr(_vm->_global->_inter_resStr, str, pos);
return false;
}
@@ -2236,7 +2222,7 @@ bool Inter_v1::o1_readData(OpFuncParams &params) {
if (((dataVar >> 2) == 59) && (size == 4))
WRITE_VAR(59, stream->readUint32LE());
else
- retSize = stream->read(_vm->_global->_inter_variables + dataVar, size);
+ retSize = stream->read((byte *) _variables->getAddressOff8(dataVar, size), size);
if (retSize == size)
WRITE_VAR(1, 0);
@@ -2803,11 +2789,9 @@ void Inter_v1::o1_animateObjects(OpGobParams &params) {
void Inter_v1::o1_drawObjects(OpGobParams &params) {
_vm->_goblin->drawObjects();
- if (_vm->_platform == Common::kPlatformMacintosh) {
- if (_vm->_adlib)
- _vm->_adlib->playBgMusic();
- } else if (_vm->_cdrom->getTrackPos() == -1)
- _vm->_cdrom->playBgMusic();
+ _vm->_sound->adlibPlayBgMusic(); // Mac version
+ if (_vm->_sound->cdGetTrackPos() == -1)
+ _vm->_sound->cdPlayBgMusic(); // PC CD version
}
void Inter_v1::o1_loadMap(OpGobParams &params) {
@@ -2993,9 +2977,11 @@ int16 Inter_v1::loadSound(int16 slot) {
dataSize = (uint32) ((int32) totSize);
}
- if (dataPtr)
- _vm->_game->_soundSamples[slot].load(SOUND_SND, source,
- dataPtr, dataSize);
+ if (dataPtr) {
+ SoundDesc *sample = _vm->_sound->sampleGetBySlot(slot);
+ if (sample)
+ sample->load(SOUND_SND, source, dataPtr, dataSize);
+ }
return 0;
}
diff --git a/engines/gob/inter_v2.cpp b/engines/gob/inter_v2.cpp
index be510df08a..d8c33fcce6 100644
--- a/engines/gob/inter_v2.cpp
+++ b/engines/gob/inter_v2.cpp
@@ -23,7 +23,6 @@
*
*/
-
#include "common/endian.h"
#include "sound/mixer.h"
#include "sound/mods/infogrames.h"
@@ -33,8 +32,6 @@
#include "gob/global.h"
#include "gob/util.h"
#include "gob/dataio.h"
-#include "gob/music.h"
-#include "gob/cdrom.h"
#include "gob/draw.h"
#include "gob/game.h"
#include "gob/goblin.h"
@@ -42,10 +39,10 @@
#include "gob/mult.h"
#include "gob/parse.h"
#include "gob/scenery.h"
-#include "gob/sound.h"
#include "gob/video.h"
#include "gob/saveload.h"
#include "gob/videoplayer.h"
+#include "gob/sound/sound.h"
namespace Gob {
@@ -899,26 +896,23 @@ void Inter_v2::o2_initMult() {
if (_terminate)
return;
- _vm->_mult->_orderArray = new uint8[_vm->_mult->_objCount];
+ _vm->_mult->_orderArray = new int8[_vm->_mult->_objCount];
memset(_vm->_mult->_orderArray, 0, _vm->_mult->_objCount * sizeof(int8));
_vm->_mult->_objects = new Mult::Mult_Object[_vm->_mult->_objCount];
memset(_vm->_mult->_objects, 0,
_vm->_mult->_objCount * sizeof(Mult::Mult_Object));
for (int i = 0; i < _vm->_mult->_objCount; i++) {
- _vm->_mult->_objects[i].pPosX =
- (int32 *)(_vm->_global->_inter_variables +
- i * 4 + (posXVar / 4) * 4);
- _vm->_mult->_objects[i].pPosY =
- (int32 *)(_vm->_global->_inter_variables +
- i * 4 + (posYVar / 4) * 4);
+ uint32 offPosX = i * 4 + (posXVar / 4) * 4;
+ uint32 offPosY = i * 4 + (posYVar / 4) * 4;
+ uint32 offAnim = animDataVar + i * 4 * _vm->_global->_inter_animDataSize;
+
+ _vm->_mult->_objects[i].pPosX = (int32 *) _variables->getAddressOff32(offPosX);
+ _vm->_mult->_objects[i].pPosY = (int32 *) _variables->getAddressOff32(offPosY);
_vm->_mult->_objects[i].pAnimData =
- (Mult::Mult_AnimData *) (_vm->_global->_inter_variables +
- animDataVar + i * 4 * _vm->_global->_inter_animDataSize);
- memset(_vm->_global->_inter_variablesSizes +
- i * 4 * _vm->_global->_inter_animDataSize, 0,
- _vm->_global->_inter_animDataSize);
+ (Mult::Mult_AnimData *) _variables->getAddressOff8(offAnim,
+ _vm->_global->_inter_animDataSize);
_vm->_mult->_objects[i].pAnimData->isStatic = 1;
_vm->_mult->_objects[i].tick = 0;
@@ -1086,16 +1080,18 @@ void Inter_v2::o2_playCDTrack() {
_vm->_draw->blitInvalidated();
evalExpr(0);
- _vm->_cdrom->startTrack(_vm->_global->_inter_resStr);
+ _vm->_sound->cdPlay(_vm->_global->_inter_resStr);
}
void Inter_v2::o2_waitCDTrackEnd() {
- while (_vm->_cdrom->getTrackPos() >= 0)
+ debugC(1, kDebugSound, "CDROM: Waiting for playback to end");
+
+ while (_vm->_sound->cdGetTrackPos() >= 0)
_vm->_util->longDelay(1);
}
void Inter_v2::o2_stopCD() {
- _vm->_cdrom->stopPlaying();
+ _vm->_sound->cdStop();
}
void Inter_v2::o2_readLIC() {
@@ -1105,11 +1101,11 @@ void Inter_v2::o2_readLIC() {
strncpy0(path, _vm->_global->_inter_resStr, 35);
strcat(path, ".LIC");
- _vm->_cdrom->readLIC(path);
+ _vm->_sound->cdLoadLIC(path);
}
void Inter_v2::o2_freeLIC() {
- _vm->_cdrom->freeLICbuffer();
+ _vm->_sound->cdUnloadLIC();
}
void Inter_v2::o2_getCDTrackPos() {
@@ -1121,8 +1117,8 @@ void Inter_v2::o2_getCDTrackPos() {
varPos = _vm->_parse->parseVarIndex();
varName = _vm->_parse->parseVarIndex();
- WRITE_VAR_OFFSET(varPos, _vm->_cdrom->getTrackPos(GET_VARO_STR(varName)));
- WRITE_VARO_STR(varName, _vm->_cdrom->getCurTrack());
+ WRITE_VAR_OFFSET(varPos, _vm->_sound->cdGetTrackPos(GET_VARO_STR(varName)));
+ WRITE_VARO_STR(varName, _vm->_sound->cdGetCurrentTrack());
}
void Inter_v2::o2_loadFontToSprite() {
@@ -1187,10 +1183,7 @@ void Inter_v2::o2_copyVars() {
varOff = _vm->_parse->parseVarIndex();
_vm->_global->_inter_execPtr++;
- memcpy(_pasteBuf + _pastePos, _vm->_global->_inter_variables + varOff,
- _vm->_global->_inter_animDataSize * 4);
- memcpy(_pasteSizeBuf + _pastePos,
- _vm->_global->_inter_variablesSizes + varOff,
+ _variables->copyTo(varOff, _pasteBuf + _pastePos, _pasteSizeBuf + _pastePos,
_vm->_global->_inter_animDataSize * 4);
_pastePos += _vm->_global->_inter_animDataSize * 4;
@@ -1200,6 +1193,7 @@ void Inter_v2::o2_copyVars() {
} else {
if (evalExpr(&varOff) == 20)
_vm->_global->_inter_resVal = 0;
+
memcpy(_pasteBuf + _pastePos, &_vm->_global->_inter_resVal, 4);
memcpy(_pasteSizeBuf + _pastePos, &_vm->_global->_inter_resVal, 4);
_pastePos += 4;
@@ -1223,8 +1217,7 @@ void Inter_v2::o2_pasteVars() {
assert(sizeV == sizeS);
_pastePos -= sizeV;
- memcpy(_vm->_global->_inter_variables + varOff, _pasteBuf + _pastePos, sizeV);
- memcpy(_vm->_global->_inter_variablesSizes + varOff, _pasteSizeBuf + _pastePos, sizeS);
+ _variables->copyFrom(varOff, _pasteBuf + _pastePos, _pasteSizeBuf + _pastePos, sizeV);
}
}
@@ -1434,46 +1427,17 @@ void Inter_v2::o2_initScreen() {
if (height > 0)
_vm->_video->_surfHeight = height;
- if (videoMode == 0x18) {
-
- if (_vm->_video->_surfWidth < _vm->_width)
- _vm->_video->_screenDeltaX = (_vm->_width - _vm->_video->_surfWidth) / 2;
- else
- _vm->_video->_screenDeltaX = 0;
-
- _vm->_global->_mouseMinX = _vm->_video->_screenDeltaX;
- _vm->_global->_mouseMaxX = _vm->_video->_screenDeltaX + _vm->_video->_surfWidth - 1;
-
-
- int16 screenHeight = _vm->_video->_surfHeight;
-
- _vm->_video->_surfHeight += offY;
+ _vm->_video->_splitHeight1 = MIN<int16>(_vm->_height, _vm->_video->_surfHeight - offY);
+ _vm->_video->_splitHeight2 = offY;
+ _vm->_video->_splitStart = _vm->_video->_surfHeight - offY;
- _vm->_video->_splitHeight1 = MIN<int16>(_vm->_height, screenHeight - offY);
- _vm->_video->_splitHeight2 = offY;
- _vm->_video->_splitStart = screenHeight;
+ _vm->_video->_screenDeltaX = 0;
+ _vm->_video->_screenDeltaY = 0;
- if ((_vm->_video->_surfHeight + offY) < _vm->_height)
- _vm->_video->_screenDeltaY = (_vm->_height - (screenHeight + offY)) / 2;
- else
- _vm->_video->_screenDeltaY = 0;
-
- _vm->_global->_mouseMaxY = (screenHeight + _vm->_video->_screenDeltaY) - offY - 1;
- _vm->_global->_mouseMinY = _vm->_video->_screenDeltaY;
-
- } else {
- _vm->_video->_splitHeight1 = MIN<int16>(_vm->_height, _vm->_video->_surfHeight - offY);
- _vm->_video->_splitHeight2 = offY;
- _vm->_video->_splitStart = _vm->_video->_surfHeight - offY;
-
- _vm->_video->_screenDeltaX = 0;
- _vm->_video->_screenDeltaY = 0;
-
- _vm->_global->_mouseMinX = 0;
- _vm->_global->_mouseMinY = 0;
- _vm->_global->_mouseMaxX = _vm->_width;
- _vm->_global->_mouseMaxY = _vm->_height - _vm->_video->_splitHeight2 - 1;
- }
+ _vm->_global->_mouseMinX = 0;
+ _vm->_global->_mouseMinY = 0;
+ _vm->_global->_mouseMaxX = _vm->_width;
+ _vm->_global->_mouseMaxY = _vm->_height - _vm->_video->_splitHeight2 - 1;
_vm->_draw->closeScreen();
_vm->_util->clearPalette();
@@ -1532,18 +1496,27 @@ void Inter_v2::o2_scroll() {
}
void Inter_v2::o2_setScrollOffset() {
- int16 offset;
+ int16 offsetX, offsetY;
- offset = _vm->_parse->parseValExpr();
+ offsetX = _vm->_parse->parseValExpr();
+ offsetY = _vm->_parse->parseValExpr();
- if (offset == -1) {
- _vm->_parse->parseValExpr();
+ if (offsetX == -1) {
WRITE_VAR(2, _vm->_draw->_scrollOffsetX);
WRITE_VAR(3, _vm->_draw->_scrollOffsetY);
} else {
- _vm->_draw->_scrollOffsetX = offset;
- _vm->_draw->_scrollOffsetY = _vm->_parse->parseValExpr();
+ int16 screenW = _vm->_video->_surfWidth;
+ int16 screenH = _vm->_video->_surfHeight;
+
+ if (screenW > _vm->_width)
+ screenW -= _vm->_width;
+ if (screenH > _vm->_height)
+ screenH -= _vm->_height;
+
+ _vm->_draw->_scrollOffsetX = CLIP<int16>(offsetX, 0, screenW);
+ _vm->_draw->_scrollOffsetY = CLIP<int16>(offsetY, 0, screenH);
}
+
_vm->_util->setScrollOffset();
_noBusyWait = true;
}
@@ -1574,8 +1547,12 @@ void Inter_v2::o2_playImd() {
palEnd = _vm->_parse->parseValExpr();
palCmd = 1 << (flags & 0x3F);
+ debugC(1, kDebugVideo, "Playing video \"%s\" @ %d+%d, frames %d - %d, "
+ "paletteCmd %d (%d - %d), flags %X", _vm->_global->_inter_resStr, x, y,
+ startFrame, lastFrame, palCmd, palStart, palEnd, flags);
+
if ((imd[0] != 0) && !_vm->_vidPlayer->primaryOpen(imd, x, y, flags)) {
- WRITE_VAR(11, -1);
+ WRITE_VAR(11, (uint32) -1);
return;
}
@@ -1607,6 +1584,12 @@ void Inter_v2::o2_getImdInfo() {
varWidth = _vm->_parse->parseVarIndex();
varHeight = _vm->_parse->parseVarIndex();
+ // WORKAROUND: The nut rolling animation in the administration center
+ // in Woodruff is called "noixroul", but the scripts think it's "noixroule".
+ if ((_vm->getGameType() == kGameTypeWoodruff) &&
+ (!scumm_stricmp(_vm->_global->_inter_resStr, "noixroule")))
+ strcpy(_vm->_global->_inter_resStr, "noixroul");
+
_vm->_vidPlayer->writeVideoInfo(_vm->_global->_inter_resStr, varX, varY,
varFrames, varWidth, varHeight);
}
@@ -1883,10 +1866,9 @@ bool Inter_v2::o2_stopSound(OpFuncParams &params) {
expr = _vm->_parse->parseValExpr();
if (expr < 0) {
- if (_vm->_adlib)
- _vm->_adlib->stopPlay();
+ _vm->_sound->adlibStop();
} else
- _vm->_snd->stopSound(expr);
+ _vm->_sound->blasterStop(expr);
_soundEndTimeKey = 0;
return false;
@@ -1915,7 +1897,7 @@ bool Inter_v2::o2_checkData(OpFuncParams &params) {
int16 handle;
int16 varOff;
int32 size;
- SaveType type;
+ SaveLoad::SaveMode mode;
evalExpr(0);
varOff = _vm->_parse->parseVarIndex();
@@ -1923,8 +1905,8 @@ bool Inter_v2::o2_checkData(OpFuncParams &params) {
size = -1;
handle = 1;
- type = _vm->_saveLoad->getSaveType(_vm->_global->_inter_resStr);
- if (type == kSaveNone) {
+ mode = _vm->_saveLoad->getSaveMode(_vm->_global->_inter_resStr);
+ if (mode == SaveLoad::kSaveModeNone) {
handle = _vm->_dataIO->openData(_vm->_global->_inter_resStr);
if (handle >= 0) {
@@ -1932,8 +1914,8 @@ bool Inter_v2::o2_checkData(OpFuncParams &params) {
size = _vm->_dataIO->getDataSize(_vm->_global->_inter_resStr);
} else
warning("File \"%s\" not found", _vm->_global->_inter_resStr);
- } else
- size = _vm->_saveLoad->getSize(type);
+ } else if (mode == SaveLoad::kSaveModeSave)
+ size = _vm->_saveLoad->getSize(_vm->_global->_inter_resStr);
if (size == -1)
handle = -1;
@@ -1954,7 +1936,7 @@ bool Inter_v2::o2_readData(OpFuncParams &params) {
int16 dataVar;
int16 handle;
byte *buf;
- SaveType type;
+ SaveLoad::SaveMode mode;
evalExpr(0);
dataVar = _vm->_parse->parseVarIndex();
@@ -1966,13 +1948,14 @@ bool Inter_v2::o2_readData(OpFuncParams &params) {
debugC(2, kDebugFileIO, "Read from file \"%s\" (%d, %d bytes at %d)",
_vm->_global->_inter_resStr, dataVar, size, offset);
- type = _vm->_saveLoad->getSaveType(_vm->_global->_inter_resStr);
- if (type != kSaveNone) {
+ mode = _vm->_saveLoad->getSaveMode(_vm->_global->_inter_resStr);
+ if (mode == SaveLoad::kSaveModeSave) {
WRITE_VAR(1, 1);
- if (_vm->_saveLoad->load(type, dataVar, size, offset))
+ if (_vm->_saveLoad->load(_vm->_global->_inter_resStr, dataVar, size, offset))
WRITE_VAR(1, 0);
return false;
- }
+ } else if (mode == SaveLoad::kSaveModeIgnore)
+ return false;
if (size < 0) {
warning("Attempted to read a raw sprite from file \"%s\"",
@@ -1983,8 +1966,7 @@ bool Inter_v2::o2_readData(OpFuncParams &params) {
size = READ_LE_UINT32(_vm->_game->_totFileData + 0x2C) * 4;
}
- buf = _vm->_global->_inter_variables + dataVar;
- memset(_vm->_global->_inter_variablesSizes + dataVar, 0, size);
+ buf = _variables->getAddressOff8(dataVar, size);
if (_vm->_global->_inter_resStr[0] == 0) {
WRITE_VAR(1, size);
@@ -2009,7 +1991,7 @@ bool Inter_v2::o2_readData(OpFuncParams &params) {
WRITE_VAR(59, stream->readUint32LE());
// The scripts in some versions divide through 256^3 then,
// effectively doing a LE->BE conversion
- if ((_vm->_platform != Common::kPlatformPC) && (VAR(59) < 256))
+ if ((_vm->getPlatform() != Common::kPlatformPC) && (VAR(59) < 256))
WRITE_VAR(59, SWAP_BYTES_32(VAR(59)));
} else
retSize = stream->read(buf, size);
@@ -2025,7 +2007,7 @@ bool Inter_v2::o2_writeData(OpFuncParams &params) {
int32 offset;
int32 size;
int16 dataVar;
- SaveType type;
+ SaveLoad::SaveMode mode;
evalExpr(0);
dataVar = _vm->_parse->parseVarIndex();
@@ -2038,11 +2020,11 @@ bool Inter_v2::o2_writeData(OpFuncParams &params) {
WRITE_VAR(1, 1);
- type = _vm->_saveLoad->getSaveType(_vm->_global->_inter_resStr);
- if (type != kSaveNone) {
- if (_vm->_saveLoad->save(type, dataVar, size, offset))
+ mode = _vm->_saveLoad->getSaveMode(_vm->_global->_inter_resStr);
+ if (mode == SaveLoad::kSaveModeSave) {
+ if (_vm->_saveLoad->save(_vm->_global->_inter_resStr, dataVar, size, offset))
WRITE_VAR(1, 0);
- } else
+ } else if (mode == SaveLoad::kSaveModeNone)
warning("Attempted to write to file \"%s\"", _vm->_global->_inter_resStr);
return false;
@@ -2054,29 +2036,10 @@ void Inter_v2::o2_loadInfogramesIns(OpGobParams &params) {
varName = load16();
- if (_vm->_noMusic)
- return;
-
strncpy0(fileName, GET_VAR_STR(varName), 15);
strcat(fileName, ".INS");
- debugC(1, kDebugMusic, "Loading Infogrames instrument file \"%s\"",
- fileName);
-
- if (_vm->_game->_infogrames) {
- _vm->_mixer->stopHandle(_vm->_game->_infHandle);
- delete _vm->_game->_infogrames;
- _vm->_game->_infogrames = 0;
- }
-
- if (_vm->_game->_infIns)
- delete _vm->_game->_infIns;
- _vm->_game->_infIns = new Audio::Infogrames::Instruments;
- if (!_vm->_game->_infIns->load(fileName)) {
- warning("Couldn't load instruments file");
- delete _vm->_game->_infIns;
- _vm->_game->_infIns = 0;
- }
+ _vm->_sound->infogramesLoadInstruments(fileName);
}
void Inter_v2::o2_playInfogrames(OpGobParams &params) {
@@ -2085,58 +2048,23 @@ void Inter_v2::o2_playInfogrames(OpGobParams &params) {
varName = load16();
- if (_vm->_noMusic)
- return;
-
strncpy0(fileName, GET_VAR_STR(varName), 15);
strcat(fileName, ".DUM");
- debugC(1, kDebugMusic, "Playing Infogrames music file \"%s\"", fileName);
- if (!_vm->_game->_infIns) {
- _vm->_game->_infIns = new Audio::Infogrames::Instruments;
-
- if (!_vm->_game->_infIns->load("i1.ins")) {
- warning("Couldn't load instruments file");
- delete _vm->_game->_infIns;
- _vm->_game->_infIns = 0;
- }
- }
-
- if (_vm->_game->_infIns) {
- _vm->_mixer->stopHandle(_vm->_game->_infHandle);
- delete _vm->_game->_infogrames;
- _vm->_game->_infogrames =
- new Audio::Infogrames(*_vm->_game->_infIns, true,
- _vm->_mixer->getOutputRate(),
- _vm->_mixer->getOutputRate() / 75);
-
- if (!_vm->_game->_infogrames->load(fileName)) {
- warning("Couldn't load infogrames music");
- delete _vm->_game->_infogrames;
- _vm->_game->_infogrames = 0;
- } else
- _vm->_mixer->playInputStream(Audio::Mixer::kMusicSoundType,
- &_vm->_game->_infHandle, _vm->_game->_infogrames,
- -1, 255, 0, false);
- }
+ _vm->_sound->infogramesLoadSong(fileName);
+ _vm->_sound->infogramesPlay();
}
void Inter_v2::o2_startInfogrames(OpGobParams &params) {
load16();
- if (_vm->_game->_infogrames &&
- !_vm->_mixer->isSoundHandleActive(_vm->_game->_infHandle)) {
- _vm->_game->_infogrames->restart();
- _vm->_mixer->playInputStream(Audio::Mixer::kMusicSoundType,
- &_vm->_game->_infHandle, _vm->_game->_infogrames,
- -1, 255, 0, false);
- }
+ _vm->_sound->infogramesPlay();
}
void Inter_v2::o2_stopInfogrames(OpGobParams &params) {
load16();
- _vm->_mixer->stopHandle(_vm->_game->_infHandle);
+ _vm->_sound->infogramesStop();
}
void Inter_v2::o2_handleGoblins(OpGobParams &params) {
@@ -2172,15 +2100,15 @@ int16 Inter_v2::loadSound(int16 search) {
} else {
id = load16();
- for (slot = 0; slot < 60; slot++)
- if (_vm->_game->_soundSamples[slot].isId(id)) {
+ for (slot = 0; slot < Sound::kSoundsCount; slot++)
+ if (_vm->_sound->sampleGetBySlot(slot)->isId(id)) {
slotIdMask = 0x8000;
break;
}
- if (slot == 60) {
- for (slot = 59; slot >= 0; slot--) {
- if (_vm->_game->_soundSamples[slot].empty())
+ if (slot == Sound::kSoundsCount) {
+ for (slot = (Sound::kSoundsCount - 1); slot >= 0; slot--) {
+ if (_vm->_sound->sampleGetBySlot(slot)->empty())
break;
}
@@ -2192,7 +2120,9 @@ int16 Inter_v2::loadSound(int16 search) {
}
}
- _vm->_game->freeSoundSlot(slot);
+ SoundDesc *sample = _vm->_sound->sampleGetBySlot(slot);
+
+ _vm->_sound->sampleFree(sample, true, slot);
if (id == -1) {
char sndfile[14];
@@ -2224,8 +2154,8 @@ int16 Inter_v2::loadSound(int16 search) {
}
if (dataPtr) {
- _vm->_game->_soundSamples[slot].load(type, source, dataPtr, dataSize);
- _vm->_game->_soundSamples[slot]._id = id;
+ sample->load(type, source, dataPtr, dataSize);
+ sample->_id = id;
}
return slot | slotIdMask;
diff --git a/engines/gob/inter_v4.cpp b/engines/gob/inter_v4.cpp
index b24e54ffbd..fb895dd5b2 100644
--- a/engines/gob/inter_v4.cpp
+++ b/engines/gob/inter_v4.cpp
@@ -29,9 +29,11 @@
#include "gob/gob.h"
#include "gob/inter.h"
#include "gob/global.h"
+#include "gob/draw.h"
#include "gob/game.h"
#include "gob/parse.h"
#include "gob/videoplayer.h"
+#include "gob/sound/sound.h"
namespace Gob {
@@ -278,7 +280,7 @@ void Inter_v4::setupOpcodes() {
{NULL, ""},
{NULL, ""},
/* 80 */
- OPCODE(o2_initScreen),
+ OPCODE(o4_initScreen),
OPCODE(o2_scroll),
OPCODE(o2_setScrollOffset),
OPCODE(o4_playVmdOrMusic),
@@ -503,7 +505,7 @@ void Inter_v4::setupOpcodes() {
/* 30 */
OPCODE(o1_returnTo),
OPCODE(o1_loadSpriteContent),
- OPCODE(o3_copySprite),
+ OPCODE(o1_copySprite),
OPCODE(o1_fillRect),
/* 34 */
OPCODE(o1_drawLine),
@@ -641,7 +643,7 @@ void Inter_v4::setupOpcodes() {
void Inter_v4::executeDrawOpcode(byte i) {
debugC(1, kDebugDrawOp, "opcodeDraw %d [0x%X] (%s)",
- i, i, getOpcodeDrawDesc(i));
+ i, i, getOpcodeDrawDesc(i));
OpcodeDrawProcV4 op = _opcodesDrawV4[i].proc;
@@ -652,8 +654,10 @@ void Inter_v4::executeDrawOpcode(byte i) {
}
bool Inter_v4::executeFuncOpcode(byte i, byte j, OpFuncParams &params) {
- debugC(1, kDebugFuncOp, "opcodeFunc %d.%d [0x%X.0x%X] (%s)",
- i, j, i, j, getOpcodeFuncDesc(i, j));
+ debugC(1, kDebugFuncOp, "opcodeFunc %d.%d [0x%X.0x%X] (%s) - %s, %d, %d",
+ i, j, i, j, getOpcodeFuncDesc(i, j), _vm->_game->_curTotFile,
+ (uint) (_vm->_global->_inter_execPtr - _vm->_game->_totFileData),
+ (uint) (_vm->_global->_inter_execPtr - _vm->_game->_totFileData - params.counter - 4));
if ((i > 4) || (j > 15)) {
warning("unimplemented opcodeFunc: %d.%d", i, j);
@@ -672,7 +676,7 @@ bool Inter_v4::executeFuncOpcode(byte i, byte j, OpFuncParams &params) {
void Inter_v4::executeGoblinOpcode(int i, OpGobParams &params) {
debugC(1, kDebugGobOp, "opcodeGoblin %d [0x%X] (%s)",
- i, i, getOpcodeGoblinDesc(i));
+ i, i, getOpcodeGoblinDesc(i));
OpcodeGoblinProcV4 op = NULL;
@@ -683,6 +687,8 @@ void Inter_v4::executeGoblinOpcode(int i, OpGobParams &params) {
}
if (op == NULL) {
+ warning("unimplemented opcodeGoblin: %d", i);
+
int16 val;
_vm->_global->_inter_execPtr -= 2;
@@ -710,6 +716,86 @@ const char *Inter_v4::getOpcodeGoblinDesc(int i) {
return "";
}
+void Inter_v4::o4_initScreen() {
+ int16 offY;
+ int16 videoMode;
+ int16 width, height;
+
+ offY = load16();
+
+ videoMode = offY & 0xFF;
+ offY = (offY >> 8) & 0xFF;
+
+ width = _vm->_parse->parseValExpr();
+ height = _vm->_parse->parseValExpr();
+
+ _vm->_video->clearScreen();
+
+ _vm->_global->_fakeVideoMode = videoMode;
+
+ // Some versions require this
+ if (videoMode == 0xD)
+ videoMode = _vm->_mode;
+
+ if ((videoMode == _vm->_global->_videoMode) && (width == -1))
+ return;
+
+ if (width > 0)
+ _vm->_video->_surfWidth = width;
+ if (height > 0)
+ _vm->_video->_surfHeight = height;
+
+ _vm->_video->_screenDeltaX = 0;
+ if (_vm->_video->_surfWidth < _vm->_width)
+ _vm->_video->_screenDeltaX = (_vm->_width - _vm->_video->_surfWidth) / 2;
+
+ _vm->_global->_mouseMinX = _vm->_video->_screenDeltaX;
+ _vm->_global->_mouseMaxX = _vm->_video->_screenDeltaX + _vm->_video->_surfWidth - 1;
+
+ _vm->_video->_splitStart = _vm->_video->_surfHeight - offY;
+
+ _vm->_video->_splitHeight1 = MIN<int16>(_vm->_height, _vm->_video->_surfHeight);
+ _vm->_video->_splitHeight2 = offY;
+
+ if ((_vm->_video->_surfHeight + offY) < _vm->_height)
+ _vm->_video->_screenDeltaY = (_vm->_height - (_vm->_video->_surfHeight + offY)) / 2;
+ else
+ _vm->_video->_screenDeltaY = 0;
+
+ _vm->_global->_mouseMaxY = (_vm->_video->_surfHeight + _vm->_video->_screenDeltaY) - offY - 1;
+ _vm->_global->_mouseMinY = _vm->_video->_screenDeltaY;
+
+ _vm->_draw->closeScreen();
+ _vm->_util->clearPalette();
+ memset(_vm->_global->_redPalette, 0, 256);
+ memset(_vm->_global->_greenPalette, 0, 256);
+ memset(_vm->_global->_bluePalette, 0, 256);
+
+ _vm->_video->_splitSurf = 0;
+ _vm->_draw->_spritesArray[24] = 0;
+ _vm->_draw->_spritesArray[25] = 0;
+
+ _vm->_global->_videoMode = videoMode;
+ _vm->_video->initPrimary(videoMode);
+ WRITE_VAR(15, _vm->_global->_fakeVideoMode);
+
+ _vm->_global->_setAllPalette = true;
+
+ _vm->_util->setMousePos(_vm->_global->_inter_mouseX,
+ _vm->_global->_inter_mouseY);
+ _vm->_util->clearPalette();
+
+ _vm->_draw->initScreen();
+
+ _vm->_util->setScrollOffset();
+
+ if (offY > 0) {
+ _vm->_draw->_spritesArray[24] = new SurfaceDesc(videoMode, _vm->_width, offY);
+ _vm->_draw->_spritesArray[25] = new SurfaceDesc(videoMode, _vm->_width, offY);
+ _vm->_video->_splitSurf = _vm->_draw->_spritesArray[25];
+ }
+}
+
void Inter_v4::o4_playVmdOrMusic() {
char fileName[128];
int16 x, y;
@@ -725,6 +811,12 @@ void Inter_v4::o4_playVmdOrMusic() {
evalExpr(0);
strncpy0(fileName, _vm->_global->_inter_resStr, 127);
+ // WORKAROUND: The nut rolling animation in the administration center
+ // in Woodruff is called "noixroul", but the scripts think it's "noixroule".
+ if ((_vm->getGameType() == kGameTypeWoodruff) &&
+ (!scumm_stricmp(fileName, "noixroule")))
+ strcpy(fileName, "noixroul");
+
x = _vm->_parse->parseValExpr();
y = _vm->_parse->parseValExpr();
startFrame = _vm->_parse->parseValExpr();
@@ -735,11 +827,14 @@ void Inter_v4::o4_playVmdOrMusic() {
palEnd = _vm->_parse->parseValExpr();
palCmd = 1 << (flags & 0x3F);
+ debugC(1, kDebugVideo, "Playing video \"%s\" @ %d+%d, frames %d - %d, "
+ "paletteCmd %d (%d - %d), flags %X", fileName, x, y, startFrame, lastFrame,
+ palCmd, palStart, palEnd, flags);
+
close = false;
if (lastFrame == -1) {
close = true;
} else if (lastFrame == -3) {
- warning("Woodruff Stub: Video/Music command -3: Play background video %s, %d, %d, %d, %d", fileName, startFrame, x, y, VAR_OFFSET(7872));
_vm->_mult->_objects[startFrame].pAnimData->animation = -startFrame - 1;
@@ -763,16 +858,19 @@ void Inter_v4::o4_playVmdOrMusic() {
warning("Woodruff Stub: Video/Music command -4: Play background video %s", fileName);
return;
} else if (lastFrame == -5) {
- warning("Woodruff Stub: Video/Music command -5: Stop background music");
+ _vm->_sound->bgStop();
return;
} else if (lastFrame == -6) {
- warning("Woodruff Stub: Video/Music command -6: Load background video %s", fileName);
+ return;
+ } else if (lastFrame == -7) {
return;
} else if (lastFrame == -8) {
warning("Woodruff Stub: Video/Music command -8: Play background video %s", fileName);
return;
} else if (lastFrame == -9) {
- warning("Woodruff Stub: Video/Music command -9: Play background music %s (%d-%d)", fileName, palEnd, palStart);
+ _vm->_sound->bgStop();
+ _vm->_sound->bgSetPlayMode(BackgroundAtmosphere::kPlayModeRandom);
+ _vm->_sound->bgPlay(fileName, palStart);
return;
} else if (lastFrame < 0) {
warning("Unknown Video/Music command: %d, %s", lastFrame, fileName);
@@ -785,7 +883,7 @@ void Inter_v4::o4_playVmdOrMusic() {
}
if ((fileName[0] != 0) && !_vm->_vidPlayer->primaryOpen(fileName, x, y, flags)) {
- WRITE_VAR(11, -1);
+ WRITE_VAR(11, (uint32) -1);
return;
}
diff --git a/engines/gob/map.cpp b/engines/gob/map.cpp
index cd8f9e3758..75867aaa6c 100644
--- a/engines/gob/map.cpp
+++ b/engines/gob/map.cpp
@@ -23,8 +23,6 @@
*
*/
-
-
#include "gob/gob.h"
#include "gob/map.h"
#include "gob/goblin.h"
diff --git a/engines/gob/map_v1.cpp b/engines/gob/map_v1.cpp
index c4b68fad85..4ac99d2465 100644
--- a/engines/gob/map_v1.cpp
+++ b/engines/gob/map_v1.cpp
@@ -23,15 +23,14 @@
*
*/
-
#include "common/stream.h"
#include "gob/gob.h"
#include "gob/map.h"
#include "gob/dataio.h"
#include "gob/goblin.h"
-#include "gob/sound.h"
#include "gob/mult.h"
+#include "gob/sound/sound.h"
namespace Gob {
@@ -160,7 +159,7 @@ void Map_v1::loadSounds(Common::SeekableReadStream &data) {
strcpy(sndNames[i], buf);
}
- _vm->_snd->loadSample(_vm->_goblin->_soundData[14], "diamant1.snd");
+ _vm->_sound->sampleLoad(&_vm->_goblin->_soundData[14], "diamant1.snd");
for (int i = 0; i < count; i++) {
handle = _vm->_dataIO->openData(sndNames[i]);
@@ -168,7 +167,7 @@ void Map_v1::loadSounds(Common::SeekableReadStream &data) {
continue;
_vm->_dataIO->closeData(handle);
- _vm->_snd->loadSample(_vm->_goblin->_soundData[i], sndNames[i]);
+ _vm->_sound->sampleLoad(&_vm->_goblin->_soundData[i], sndNames[i]);
}
}
diff --git a/engines/gob/map_v2.cpp b/engines/gob/map_v2.cpp
index 2c383f5bb2..bd9f5b3efc 100644
--- a/engines/gob/map_v2.cpp
+++ b/engines/gob/map_v2.cpp
@@ -23,7 +23,6 @@
*
*/
-
#include "common/stream.h"
#include "gob/gob.h"
@@ -57,12 +56,12 @@ void Map_v2::loadMapObjects(const char *avjFile) {
uint32 passPos;
var = _vm->_parse->parseVarIndex();
- variables = _vm->_global->_inter_variables + var;
+ variables = _vm->_inter->_variables->getAddressOff8(var, 0);
id = _vm->_inter->load16();
if (id == -1) {
- _passMap = (int8 *)(_vm->_global->_inter_variables + var);
+ _passMap = (int8 *) _vm->_inter->_variables->getAddressOff8(var, 0);
return;
}
@@ -105,18 +104,17 @@ void Map_v2::loadMapObjects(const char *avjFile) {
// In the original asm, this writes byte-wise into the variables-array
tmpPos = mapData.pos();
mapData.seek(passPos);
- if (variables != _vm->_global->_inter_variables) {
- byte *sizes;
+ if ((variables != 0) &&
+ (variables != _vm->_inter->_variables->getAddressOff8(0, 0))) {
_passMap = (int8 *) variables;
mapHeight = _screenHeight / _tilesHeight;
mapWidth = _screenWidth / _tilesWidth;
- sizes = _vm->_global->_inter_variablesSizes +
- (((byte *) _passMap) - _vm->_global->_inter_variables);
+
for (int i = 0; i < mapHeight; i++) {
for (int j = 0; j < mapWidth; j++)
setPass(j, i, mapData.readSByte());
- memset(sizes + i * _passWidth, 0, mapWidth);
+ _vm->_inter->_variables->getAddressOff8(var + i * _passWidth, mapWidth);
}
}
mapData.seek(tmpPos);
diff --git a/engines/gob/map_v4.cpp b/engines/gob/map_v4.cpp
index 721f040341..3a74c4b6aa 100644
--- a/engines/gob/map_v4.cpp
+++ b/engines/gob/map_v4.cpp
@@ -54,7 +54,7 @@ void Map_v4::loadMapObjects(const char *avjFile) {
uint32 passPos;
var = _vm->_parse->parseVarIndex();
- variables = _vm->_global->_inter_variables + var;
+ variables = _vm->_inter->_variables->getAddressOff8(var, 0);
id = _vm->_inter->load16();
@@ -62,7 +62,7 @@ void Map_v4::loadMapObjects(const char *avjFile) {
warning("Woodruff Stub: loadMapObjects ID >= 65520");
return;
} else if (id == -1) {
- _passMap = (int8 *)(_vm->_global->_inter_variables + var);
+ _passMap = (int8 *) _vm->_inter->_variables->getAddressOff8(var, 0);
return;
}
@@ -113,25 +113,24 @@ void Map_v4::loadMapObjects(const char *avjFile) {
}
if (_widthByte == 4)
- _mapWidth = (int16) READ_VARO_UINT16(68);
+ _mapWidth = VAR(17);
_passWidth = _mapWidth;
// In the original asm, this writes byte-wise into the variables-array
tmpPos = mapData.pos();
mapData.seek(passPos);
- if (variables != _vm->_global->_inter_variables) {
- byte *sizes;
+ if ((variables != 0) &&
+ (variables != _vm->_inter->_variables->getAddressOff8(0, 0))) {
_passMap = (int8 *) variables;
mapHeight = _screenHeight / _tilesHeight;
mapWidth = _screenWidth / _tilesWidth;
- sizes = _vm->_global->_inter_variablesSizes +
- (((byte *) _passMap) - _vm->_global->_inter_variables);
+
for (int i = 0; i < mapHeight; i++) {
for (int j = 0; j < mapWidth; j++)
setPass(j, i, mapData.readSByte());
- memset(sizes + i * _passWidth, 0, mapWidth);
+ _vm->_inter->_variables->getAddressOff8(var + i * _passWidth, mapWidth);
}
}
mapData.seek(tmpPos);
diff --git a/engines/gob/module.mk b/engines/gob/module.mk
index aa2a235327..45048a0899 100644
--- a/engines/gob/module.mk
+++ b/engines/gob/module.mk
@@ -1,7 +1,6 @@
MODULE := engines/gob
MODULE_OBJS := \
- cdrom.o \
dataio.o \
detection.o \
draw.o \
@@ -38,7 +37,6 @@ MODULE_OBJS := \
mult.o \
mult_v1.o \
mult_v2.o \
- music.o \
palanim.o \
parse.o \
parse_v1.o \
@@ -46,14 +44,24 @@ MODULE_OBJS := \
saveload.o \
saveload_v2.o \
saveload_v3.o \
+ saveload_v4.o \
scenery.o \
scenery_v1.o \
scenery_v2.o \
- sound.o \
util.o \
+ variables.o \
video.o \
video_v1.o \
- video_v2.o
+ video_v2.o \
+ sound/sound.o \
+ sound/sounddesc.o \
+ sound/pcspeaker.o \
+ sound/adlib.o \
+ sound/infogrames.o \
+ sound/soundmixer.o \
+ sound/soundblaster.o \
+ sound/cdrom.o \
+ sound/bgatmosphere.o
# This module can be built as a plugin
ifeq ($(ENABLE_GOB), DYNAMIC_PLUGIN)
diff --git a/engines/gob/mult.cpp b/engines/gob/mult.cpp
index 70b6d33136..3d6a7942f9 100644
--- a/engines/gob/mult.cpp
+++ b/engines/gob/mult.cpp
@@ -23,7 +23,6 @@
*
*/
-
#include "common/endian.h"
#include "gob/gob.h"
@@ -34,9 +33,10 @@
#include "gob/game.h"
#include "gob/palanim.h"
#include "gob/scenery.h"
-#include "gob/sound.h"
#include "gob/video.h"
#include "gob/videoplayer.h"
+#include "gob/inter.h"
+#include "gob/sound/sound.h"
namespace Gob {
@@ -188,7 +188,7 @@ void Mult::playMult(int16 startFrame, int16 endFrame, char checkEscape,
if (_frame >= endFrame)
stopNoClear = true;
- if (_vm->_snd->_playingSound)
+ if (_vm->_sound->blasterPlayingSound())
stop = false;
_vm->_util->processInput();
@@ -225,8 +225,8 @@ void Mult::playMult(int16 startFrame, int16 endFrame, char checkEscape,
_animDataAllocated = false;
}
- if (_vm->_snd->_playingSound)
- _vm->_snd->stopSound(10);
+ if (_vm->_sound->blasterPlayingSound())
+ _vm->_sound->blasterStop(10);
WRITE_VAR(57, (uint32) -1);
} else
@@ -415,21 +415,24 @@ void Mult::doSoundAnim(bool &stop, int16 frame) {
if (sndKey->cmd != -1) {
if ((sndKey->cmd == 1) || (sndKey->cmd == 4)) {
- SoundDesc &sample = _vm->_game->_soundSamples[sndKey->soundIndex];
+ SoundDesc *sample = _vm->_sound->sampleGetBySlot(sndKey->soundIndex);
- _vm->_snd->stopSound(0);
- if (!sample.empty())
- _vm->_snd->playSample(sample, sndKey->repCount,
+ _vm->_sound->blasterStop(0);
+ if (sample && !sample->empty())
+ _vm->_sound->blasterPlay(sample, sndKey->repCount,
sndKey->freq, sndKey->fadeLength);
}
} else {
- if (_vm->_snd->_playingSound)
- _vm->_snd->stopSound(sndKey->fadeLength);
+ if (_vm->_sound->blasterPlayingSound())
+ _vm->_sound->blasterStop(sndKey->fadeLength);
}
}
}
void Mult::clearObjectVideos() {
+ if (!_objects)
+ return;
+
for (int i = 0; i < _objCount; i++)
if (_objects[i].videoSlot > 0)
_vm->_vidPlayer->slotClose(_objects[i].videoSlot - 1);
diff --git a/engines/gob/mult.h b/engines/gob/mult.h
index c283191ec8..aaf2e2826c 100644
--- a/engines/gob/mult.h
+++ b/engines/gob/mult.h
@@ -40,7 +40,7 @@ public:
uint8 layer;
uint8 frame;
int8 animType;
- uint8 order;
+ int8 order;
int8 isPaused;
int8 isStatic;
int8 maxTick;
@@ -229,7 +229,7 @@ public:
int16 *_renderData;
Mult_Object **_renderObjs;
- uint8 *_orderArray;
+ int8 *_orderArray;
SurfaceDesc::Ptr _animSurf;
int16 _animLeft;
diff --git a/engines/gob/mult_v1.cpp b/engines/gob/mult_v1.cpp
index 78071f1dd8..22683437e7 100644
--- a/engines/gob/mult_v1.cpp
+++ b/engines/gob/mult_v1.cpp
@@ -23,7 +23,6 @@
*
*/
-
#include "common/endian.h"
#include "common/stream.h"
diff --git a/engines/gob/mult_v2.cpp b/engines/gob/mult_v2.cpp
index 02211880ba..3a83ac1867 100644
--- a/engines/gob/mult_v2.cpp
+++ b/engines/gob/mult_v2.cpp
@@ -23,7 +23,6 @@
*
*/
-
#include "common/endian.h"
#include "common/stream.h"
@@ -526,14 +525,14 @@ void Mult_v2::playMultInit() {
delete[] _animArrayData;
_objects = new Mult_Object[_objCount];
- _orderArray = new uint8[_objCount];
+ _orderArray = new int8[_objCount];
_renderObjs = new Mult_Object*[_objCount];
_animArrayX = new int32[_objCount];
_animArrayY = new int32[_objCount];
_animArrayData = new Mult_AnimData[_objCount];
memset(_objects, 0, _objCount * sizeof(Mult_Object));
- memset(_orderArray, 0, _objCount * sizeof(uint8));
+ memset(_orderArray, 0, _objCount * sizeof(int8));
memset(_renderObjs, 0, _objCount * sizeof(Mult_Object *));
memset(_animArrayX, 0, _objCount * sizeof(int32));
memset(_animArrayY, 0, _objCount * sizeof(int32));
@@ -686,6 +685,11 @@ void Mult_v2::newCycleAnim(Mult_Object &animObj) {
return;
animLayer = _vm->_scenery->getAnimLayer(nAnim, nLayer);
+ } else {
+ if (animObj.videoSlot > 0) {
+ _vm->_video->retrace();
+ _vm->_vidPlayer->slotWaitEndFrame(animObj.videoSlot - 1, true);
+ }
}
if (animData.animType == 4) {
@@ -693,7 +697,7 @@ void Mult_v2::newCycleAnim(Mult_Object &animObj) {
animData.frame = 0;
animData.isPaused = 1;
if (animData.animation < 0)
- warning("TODO: AnimType 4, animation: %d", animData.animation);
+ warning("Woodruff Stub: AnimType 4, animation: %d", animData.animation);
return;
}
@@ -701,9 +705,8 @@ void Mult_v2::newCycleAnim(Mult_Object &animObj) {
animData.animType = 11;
if (animData.animType == 11) {
- if (animData.isBusy != 0) {
- warning("TODO: AnimType 11");
- }
+ if (animData.isBusy != 0)
+ warning("Woodruff Stub: AnimType 11");
return;
}
@@ -750,27 +753,39 @@ void Mult_v2::newCycleAnim(Mult_Object &animObj) {
case 5:
animData.isStatic = 1;
animData.frame = 0;
+ if ((animData.animation < 0) && (animObj.videoSlot > 0)) {
+ _vm->_vidPlayer->slotClose(animObj.videoSlot - 1);
+ animObj.videoSlot = 0;
+ }
+
break;
case 6:
case 7:
animData.frame--;
animData.isPaused = 1;
+/*
if ((animData.animation < 0) && (animObj.videoSlot > 0)) {
if (_vm->_vidPlayer->getFlags(animObj.videoSlot - 1) & 0x1000) {
_vm->_vidPlayer->slotClose(animObj.videoSlot - 1);
animObj.videoSlot = 0;
}
}
+*/
+ break;
+
+ case 10:
+ warning("Woodruff Stub: AnimType 10");
break;
}
+
animData.newCycle = 1;
}
void Mult_v2::animate() {
- uint8 minOrder = 100;
- uint8 maxOrder = 0;
- uint8 *orderArray;
+ int8 minOrder = 100;
+ int8 maxOrder = 0;
+ int8 *orderArray;
int orderArrayPos = 0;
int8 animIndices[150];
int numAnims = 0;
@@ -952,60 +967,58 @@ void Mult_v2::animate() {
Mult_Object &animObj1 = *_renderObjs[orderArray[i]];
Mult_AnimData &animData1 = *(animObj1.pAnimData);
- if (!animObj1.needRedraw && !animData1.isStatic) {
- for (int j = 0; j < orderArrayPos; j++) {
- Mult_Object &animObj2 = *_renderObjs[orderArray[j]];
+ if (!animObj1.needRedraw) {
- if (!animObj2.needRedraw)
- continue;
+ if (!animData1.isStatic) {
+ for (int j = 0; j < orderArrayPos; j++) {
+ Mult_Object &animObj2 = *_renderObjs[orderArray[j]];
+
+ if (!animObj2.needRedraw)
+ continue;
- if ((animObj1.newRight >= animObj2.newLeft) &&
- (animObj2.newRight >= animObj1.newLeft) &&
- (animObj1.newBottom >= animObj2.newTop) &&
- (animObj2.newBottom >= animObj1.newTop)) {
+ if ((animObj1.newRight >= animObj2.newLeft) &&
+ (animObj2.newRight >= animObj1.newLeft) &&
+ (animObj1.newBottom >= animObj2.newTop) &&
+ (animObj2.newBottom >= animObj1.newTop)) {
- _vm->_scenery->_toRedrawLeft = animObj2.newLeft;
- _vm->_scenery->_toRedrawRight = animObj2.newRight;
- _vm->_scenery->_toRedrawTop = animObj2.newTop;
- _vm->_scenery->_toRedrawBottom = animObj2.newBottom;
+ _vm->_scenery->_toRedrawLeft = animObj2.newLeft;
+ _vm->_scenery->_toRedrawRight = animObj2.newRight;
+ _vm->_scenery->_toRedrawTop = animObj2.newTop;
+ _vm->_scenery->_toRedrawBottom = animObj2.newBottom;
- _vm->_scenery->updateAnim(animData1.layer, animData1.frame,
- animData1.animation, 12, *animObj1.pPosX, *animObj1.pPosY, 1);
- _vm->_scenery->updateStatic(animData1.order + 1);
+ _vm->_scenery->updateAnim(animData1.layer, animData1.frame,
+ animData1.animation, 12, *animObj1.pPosX, *animObj1.pPosY, 1);
+ _vm->_scenery->updateStatic(animData1.order + 1);
+ }
}
}
- } else if (!animData1.isStatic) {
- _vm->_scenery->updateAnim(animData1.layer, animData1.frame,
- animData1.animation, 10, *animObj1.pPosX, *animObj1.pPosY, 1);
-
- if (_vm->_scenery->_toRedrawLeft != -12345) {
- if (_vm->_global->_pressedKeys[0x36]) {
- _vm->_video->drawLine(_vm->_draw->_frontSurface,
- _vm->_scenery->_toRedrawLeft, _vm->_scenery->_toRedrawTop,
- _vm->_scenery->_toRedrawRight, _vm->_scenery->_toRedrawTop, 15);
- _vm->_video->drawLine(_vm->_draw->_frontSurface,
- _vm->_scenery->_toRedrawLeft, _vm->_scenery->_toRedrawBottom,
- _vm->_scenery->_toRedrawRight, _vm->_scenery->_toRedrawBottom, 15);
- _vm->_video->drawLine(_vm->_draw->_frontSurface,
- _vm->_scenery->_toRedrawLeft, _vm->_scenery->_toRedrawTop,
- _vm->_scenery->_toRedrawLeft, _vm->_scenery->_toRedrawBottom, 15);
- _vm->_video->drawLine(_vm->_draw->_frontSurface,
- _vm->_scenery->_toRedrawRight, _vm->_scenery->_toRedrawTop,
- _vm->_scenery->_toRedrawRight, _vm->_scenery->_toRedrawBottom, 15);
- }
- animObj1.lastLeft = _vm->_scenery->_toRedrawLeft;
- animObj1.lastRight = _vm->_scenery->_toRedrawRight;
- animObj1.lastTop = _vm->_scenery->_toRedrawTop;
- animObj1.lastBottom = _vm->_scenery->_toRedrawBottom;
- } else
- animObj1.lastLeft = -1;
+
} else {
- _vm->_scenery->_toRedrawLeft = animObj1.newLeft;
- _vm->_scenery->_toRedrawRight = animObj1.newRight;
- _vm->_scenery->_toRedrawTop = animObj1.newTop;
- _vm->_scenery->_toRedrawBottom = animObj1.newBottom;
+
+ if (animData1.isStatic != 0) {
+ _vm->_scenery->_toRedrawLeft = animObj1.newLeft;
+ _vm->_scenery->_toRedrawRight = animObj1.newRight;
+ _vm->_scenery->_toRedrawTop = animObj1.newTop;
+ _vm->_scenery->_toRedrawBottom = animObj1.newBottom;
+ } else {
+ _vm->_scenery->updateAnim(animData1.layer, animData1.frame,
+ animData1.animation, 10, *animObj1.pPosX, *animObj1.pPosY, 1);
+
+ if (_vm->_scenery->_toRedrawLeft != -12345) {
+ animObj1.lastLeft = _vm->_scenery->_toRedrawLeft;
+ animObj1.lastRight = _vm->_scenery->_toRedrawRight;
+ animObj1.lastTop = _vm->_scenery->_toRedrawTop;
+ animObj1.lastBottom = _vm->_scenery->_toRedrawBottom;
+ } else {
+ animObj1.lastLeft = -1;
+ }
+
+ }
+
+ _vm->_scenery->updateStatic(animData1.order + 1);
+
}
- _vm->_scenery->updateStatic(animData1.order + 1);
+
}
// Advance animations
diff --git a/engines/gob/parse.cpp b/engines/gob/parse.cpp
index af12626c83..ad1f53bb6f 100644
--- a/engines/gob/parse.cpp
+++ b/engines/gob/parse.cpp
@@ -23,7 +23,6 @@
*
*/
-
#include "common/endian.h"
#include "gob/gob.h"
@@ -45,7 +44,7 @@ int32 Parse::encodePtr(byte *ptr, int type) {
offset = ptr - _vm->_game->_totFileData;
break;
case kInterVar:
- offset = ptr - _vm->_global->_inter_variables;
+ offset = ptr - ((byte *) _vm->_inter->_variables->getAddressOff8(0, 0));
break;
case kResStr:
offset = ptr - ((byte *) _vm->_global->_inter_resStr);
@@ -65,7 +64,7 @@ byte *Parse::decodePtr(int32 n) {
ptr = _vm->_game->_totFileData;
break;
case kInterVar:
- ptr = _vm->_global->_inter_variables;
+ ptr = (byte *) _vm->_inter->_variables->getAddressOff8(0, 0);
break;
case kResStr:
ptr = (byte *) _vm->_global->_inter_resStr;
diff --git a/engines/gob/parse_v1.cpp b/engines/gob/parse_v1.cpp
index 2b84ac5cee..3c5f90c068 100644
--- a/engines/gob/parse_v1.cpp
+++ b/engines/gob/parse_v1.cpp
@@ -23,7 +23,6 @@
*
*/
-
#include "common/endian.h"
#include "gob/gob.h"
@@ -376,7 +375,7 @@ int16 Parse_v1::parseExpr(byte stopToken, byte *arg_2) {
case 25:
*operPtr = 22;
temp = _vm->_inter->load16() * 4;
- *valPtr = encodePtr(_vm->_global->_inter_variables + temp,
+ *valPtr = encodePtr(_vm->_inter->_variables->getAddressOff8(temp, 0),
kInterVar);
if (*_vm->_global->_inter_execPtr == 13) {
_vm->_global->_inter_execPtr++;
@@ -404,8 +403,8 @@ int16 Parse_v1::parseExpr(byte stopToken, byte *arg_2) {
*valPtr = VAR(temp + offset);
break;
}
- *valPtr = encodePtr(_vm->_global->_inter_variables +
- temp * 4 + offset * _vm->_global->_inter_animDataSize * 4,
+ *valPtr = encodePtr(_vm->_inter->_variables->getAddressOff8(
+ temp * 4 + offset * _vm->_global->_inter_animDataSize * 4, 0),
kInterVar);
if (*_vm->_global->_inter_execPtr == 13) {
_vm->_global->_inter_execPtr++;
diff --git a/engines/gob/parse_v2.cpp b/engines/gob/parse_v2.cpp
index 65315c083a..a2e6b8fb37 100644
--- a/engines/gob/parse_v2.cpp
+++ b/engines/gob/parse_v2.cpp
@@ -23,7 +23,6 @@
*
*/
-
#include "common/endian.h"
#include "gob/gob.h"
@@ -409,8 +408,8 @@ int16 Parse_v2::parseExpr(byte stopToken, byte *arg_2) {
else if (operation == 27)
*valPtr = (int16) READ_VARO_UINT16(temp * 2 + offset * 2);
else if (operation == 28) {
- *valPtr = encodePtr(_vm->_global->_inter_variables +
- temp * 4 + offset * _vm->_global->_inter_animDataSize * 4,
+ *valPtr = encodePtr(_vm->_inter->_variables->getAddressOff8(
+ temp * 4 + offset * _vm->_global->_inter_animDataSize * 4, 0),
kInterVar);
if (*_vm->_global->_inter_execPtr == 13) {
_vm->_global->_inter_execPtr++;
@@ -468,7 +467,7 @@ int16 Parse_v2::parseExpr(byte stopToken, byte *arg_2) {
case 25:
*operPtr = 22;
temp = _vm->_inter->load16() * 4;
- *valPtr = encodePtr(_vm->_global->_inter_variables + temp, kInterVar);
+ *valPtr = encodePtr(_vm->_inter->_variables->getAddressOff8(temp, 0), kInterVar);
if (*_vm->_global->_inter_execPtr == 13) {
_vm->_global->_inter_execPtr++;
temp += parseValExpr(12);
diff --git a/engines/gob/saveload.cpp b/engines/gob/saveload.cpp
index 717bc143a6..2788716858 100644
--- a/engines/gob/saveload.cpp
+++ b/engines/gob/saveload.cpp
@@ -24,456 +24,714 @@
*/
#include "common/endian.h"
-#include "common/file.h"
+#include "common/savefile.h"
#include "gob/gob.h"
#include "gob/saveload.h"
-#include "gob/global.h"
#include "gob/draw.h"
-#include "gob/video.h"
namespace Gob {
-SaveLoad::SaveLoad(GobEngine *vm, const char *targetName) : _vm(vm) {
- _curSlot = -1;
+TempSprite::TempSprite() {
+ _sprite = 0;
+ _width = _height = 0;
+ _size = -1;
+ memset(_palette, 0, 768);
+}
- _stagesCount = 0;
- _buffer = 0;
+TempSprite::~TempSprite() {
+ delete[] _sprite;
+}
- _tempSprite = 0;
- memset(_tempPal, 0, 768);
- _tempSpriteSize = -1;
+int TempSprite::getSpriteIndex(int32 size) const {
+ if (size < -1000)
+ size += 1000;
- _saveFiles = new char*[5];
+ return -size - 1;
+}
- assert(_saveFiles);
+bool TempSprite::getSpritePalette(int32 size) const {
+ return size < -1000;
+}
- _saveFiles[0] = new char[strlen(targetName) + 5];
- _saveFiles[1] = 0;
- _saveFiles[2] = new char[strlen(targetName) + 5];
- _saveFiles[3] = _saveFiles[0];
- _saveFiles[4] = 0;
+bool TempSprite::getProperties(int16 dataVar, int32 size, int32 offset,
+ int &index, bool &palette) const {
- assert(_saveFiles[0] && _saveFiles[2]);
+ if (size >= 0) {
+ warning("Invalid index (%d)", size);
+ return false;
+ }
- sprintf(_saveFiles[0], "%s.s00", targetName);
- sprintf(_saveFiles[2], "%s.blo", targetName);
-}
+ index = getSpriteIndex(size);
+ palette = getSpritePalette(size);
-SaveLoad::~SaveLoad() {
- if (_buffer) {
- for (int i = 0; i < _stagesCount; i++)
- delete[] _buffer[i];
- delete[] _buffer;
+ if ((index < 0) || (index >= SPRITES_COUNT)) {
+ warning("Index out of range (%d)", index);
+ return false;
}
- delete _tempSprite;
+ return true;
+}
- delete[] _saveFiles[0];
- delete[] _saveFiles[2];
- delete[] _saveFiles;
+int32 TempSprite::getSize() const {
+ return _size;
}
-const char *SaveLoad::setCurSlot(int slot) {
- static char *slotBase = _saveFiles[0] + strlen(_saveFiles[0]) - 2;
+bool TempSprite::saveSprite(const SurfaceDesc &surfDesc) {
+ delete[] _sprite;
+
+ _width = surfDesc.getWidth();
+ _height = surfDesc.getHeight();
+ _size = _width * _height;
+ _sprite = new byte[_size];
- if (_curSlot != slot) {
- _curSlot = slot;
+ memcpy(_sprite, surfDesc.getVidMem(), _size);
- if (_curSlot >= 0)
- snprintf(slotBase, 3, "%02d", slot);
+ return true;
+}
+
+bool TempSprite::savePalette(const Video::Color *palette) {
+ memcpy((byte *) _palette, (byte *) palette, 768);
+ return true;
+}
+
+bool TempSprite::loadSprite(SurfaceDesc &surfDesc) {
+ if (!_sprite) {
+ warning("No sprite saved");
+ return false;
+ }
+
+ if (_size != (surfDesc.getWidth() * surfDesc.getHeight())) {
+ warning("Dimensions don't match (%dx%d - %dx%d",
+ _width, _height, surfDesc.getWidth(), surfDesc.getHeight());
+ return false;
}
- return _saveFiles[0];
+ memcpy(surfDesc.getVidMem(), _sprite, _size);
+
+ return true;
}
-uint32 SaveLoad::read(Common::ReadStream &in, byte *buf,
- byte *sizes, uint32 count) {
- uint32 nRead;
+bool TempSprite::loadPalette(Video::Color *palette) {
+ memcpy((byte *) palette, (byte *) _palette, 768);
+ return true;
+}
- nRead = in.read(buf, count);
- if (nRead != count) {
- warning("Can't read data: requested %d, got %d", count, nRead);
- return 0;
+bool TempSprite::toBuffer(byte *buffer, int32 size, bool palette) const {
+
+ int32 haveSize = _size + (palette ? 768 : 0);
+ if (size != haveSize) {
+ warning("Sizes don't match (%d != %d)", size, haveSize);
+ return false;
}
- nRead = in.read(sizes, count);
- if (nRead != count) {
- warning("Can't read data sizes: requested %d, got %d", count, nRead);
- return 0;
+ if (palette) {
+ memcpy(buffer, (byte *) _palette, 768);
+ buffer += 768;
}
- return count;
+ memcpy(buffer, _sprite, _size);
+
+ return true;
}
-uint32 SaveLoad::write(Common::WriteStream &out, byte *buf,
- byte *sizes, uint32 count) {
- uint32 written;
+bool TempSprite::fromBuffer(const byte *buffer, int32 size, bool palette) {
+ if (palette) {
+ memcpy((byte *) _palette, buffer, 768);
+ buffer += 768;
+ size -= 768;
+ }
- written = out.write(buf, count);
- if (written != count) {
- warning("Can't write data: requested %d, wrote %d", count, written);
- return 0;
+ _size = size;
+
+ delete[] _sprite;
+ _sprite = new byte[_size];
+
+ memcpy(_sprite, buffer, _size);
+
+ return true;
+}
+
+
+PlainSave::PlainSave() {
+}
+
+PlainSave::~PlainSave() {
+}
+
+bool PlainSave::save(int16 dataVar, int32 size, int32 offset, const char *name,
+ const Variables *variables) {
+
+ if ((size <= 0) || (offset != 0)) {
+ warning("Invalid size (%d) or offset (%d)", size, offset);
+ return false;
}
- written = out.write(sizes, count);
- if (written != count) {
- warning("Can't write data: requested %d, wrote %d", count, written);
- return 0;
+ byte *vars = new byte[size];
+ byte *varSizes = new byte[size];
+
+ if (!variables->copyTo(dataVar, vars, varSizes, size)) {
+ delete[] vars;
+ delete[] varSizes;
+ warning("dataVar (%d) or size (%d) out of range", dataVar, size);
+ return false;
}
- return count;
+ bool result = save(0, size, offset, name, vars, varSizes);
+
+ delete[] vars;
+ delete[] varSizes;
+
+ return result;
}
-bool SaveLoad::loadDataEndian(Common::ReadStream &in,
- int16 dataVar, uint32 size) {
+bool PlainSave::load(int16 dataVar, int32 size, int32 offset, const char *name,
+ Variables *variables) {
- bool retVal = false;
+ if ((size <= 0) || (offset != 0)) {
+ warning("Invalid size (%d) or offset (%d)", size, offset);
+ return false;
+ }
- byte *varBuf = new byte[size];
- byte *sizeBuf = new byte[size];
+ byte *vars = new byte[size];
+ byte *varSizes = new byte[size];
- assert(varBuf && sizeBuf);
+ bool result = load(0, size, offset, name, vars, varSizes);
- if (read(in, varBuf, sizeBuf, size) == size) {
- if (fromEndian(varBuf, sizeBuf, size)) {
- memcpy(_vm->_global->_inter_variables + dataVar, varBuf, size);
- memcpy(_vm->_global->_inter_variablesSizes + dataVar, sizeBuf, size);
- retVal = true;
+ if (result && variables) {
+ if (!variables->copyFrom(dataVar, vars, varSizes, size)) {
+ delete[] vars;
+ delete[] varSizes;
+ warning("dataVar (%d) or size (%d) out of range", dataVar, size);
+ return false;
}
}
- delete[] varBuf;
- delete[] sizeBuf;
+ delete[] vars;
+ delete[] varSizes;
- return retVal;
+ return result;
}
-bool SaveLoad::saveDataEndian(Common::WriteStream &out,
- int16 dataVar, uint32 size) {
+bool PlainSave::save(int16 dataVar, int32 size, int32 offset, const char *name,
+ const byte *variables, const byte *variableSizes) const {
- bool retVal = false;
+ if ((size <= 0) || (offset != 0)) {
+ warning("Invalid size (%d) or offset (%d)", size, offset);
+ return false;
+ }
- byte *varBuf = new byte[size];
- byte *sizeBuf = new byte[size];
+ Common::SaveFileManager *saveMan = g_system->getSavefileManager();
+ Common::OutSaveFile *out = saveMan->openForSaving(name);
- assert(varBuf && sizeBuf);
+ if (!out) {
+ warning("Can't open file \"%s\" for writing", name);
+ return false;
+ }
- memcpy(varBuf, _vm->_global->_inter_variables + dataVar, size);
- memcpy(sizeBuf, _vm->_global->_inter_variablesSizes + dataVar, size);
+ bool retVal;
+ retVal = SaveLoad::saveDataEndian(*out, dataVar, size, variables, variableSizes);
- if (toEndian(varBuf, sizeBuf, size))
- if (write(out, varBuf, sizeBuf, size) == size)
- retVal = true;
+ out->finalize();
+ if (out->ioFailed()) {
+ warning("Can't write to file \"%s\"", name);
+ retVal = false;
+ }
- delete[] varBuf;
- delete[] sizeBuf;
+ delete out;
+ return retVal;
+}
+
+bool PlainSave::load(int16 dataVar, int32 size, int32 offset, const char *name,
+ byte *variables, byte *variableSizes) const {
+
+ if ((size <= 0) || (offset != 0)) {
+ warning("Invalid size (%d) or offset (%d)", size, offset);
+ return false;
+ }
+
+ Common::SaveFileManager *saveMan = g_system->getSavefileManager();
+ Common::InSaveFile *in = saveMan->openForLoading(name);
+
+ if (!in) {
+ warning("Can't open file \"%s\" for reading", name);
+ return false;
+ }
+ bool retVal = SaveLoad::loadDataEndian(*in, dataVar, size, variables, variableSizes);
+ delete in;
return retVal;
}
-int32 SaveLoad::getSize(SaveType type) {
- switch (type) {
- case kSaveNone:
- return -1;
- break;
- case kSaveGame:
- return getSizeGame();
- break;
+StagedSave::StagedSave() {
+ _mode = kModeNone;
+ _name = 0;
+ _loaded = false;
+}
- case kSaveTempSprite:
- return getSizeTempSprite();
- break;
+StagedSave::~StagedSave() {
+ clear();
+}
- case kSaveNotes:
- return getSizeNotes();
- break;
+void StagedSave::addStage(int32 size, bool endianed) {
+ int32 offset = 0;
- case kSaveScreenshot:
- return getSizeScreenshot();
- break;
+ if (!_stages.empty())
+ offset = _stages[_stages.size() - 1].offset +
+ _stages[_stages.size() - 1].size;
- case kSaveIgnore:
- return -1;
- break;
- }
+ Stage stage(size, offset, endianed);
+ _stages.push_back(stage);
+}
+
+int StagedSave::findStage(int16 dataVar, int32 size, int32 offset) const {
+ for (uint i = 0; i < _stages.size(); i++)
+ if ((_stages[i].size == size) &&
+ (_stages[i].offset == offset))
+ return i;
return -1;
}
-bool SaveLoad::load(SaveType type, int16 dataVar, int32 size, int32 offset) {
- switch (type) {
- case kSaveNone:
- return false;
- break;
-
- case kSaveGame:
- return loadGame(dataVar, size, offset);
- break;
+bool StagedSave::allSaved() const {
+ for (uint i = 0; i < _stages.size(); i++)
+ if (!_stages[i].bufVar)
+ return false;
- case kSaveTempSprite:
- return loadTempSprite(dataVar, size, offset);
- break;
+ return true;
+}
- case kSaveNotes:
- return loadNotes(dataVar, size, offset);
- break;
+uint32 StagedSave::getSize() const {
+ uint32 size = 0;
- case kSaveScreenshot:
- return loadScreenshot(dataVar, size, offset);
- break;
+ for (uint i = 0; i < _stages.size(); i++) {
+ if (_stages[i].endianed)
+ size += 2 * _stages[i].size;
+ else
+ size += _stages[i].size;
+ }
+
+ return size;
+}
- case kSaveIgnore:
- return true;
- break;
+void StagedSave::clear() {
+ for (uint i = 0; i < _stages.size(); i++) {
+ delete[] _stages[i].bufVar;
+ delete[] _stages[i].bufVarSizes;
+ _stages[i].bufVar = 0;
+ _stages[i].bufVarSizes = 0;
}
- return false;
+ delete[] _name;
+ _name = 0;
+
+ _mode = kModeNone;
+ _loaded = false;
}
-bool SaveLoad::save(SaveType type, int16 dataVar, int32 size, int32 offset) {
- switch (type) {
- case kSaveNone:
- return false;
- break;
+void StagedSave::assertMode(Mode mode, const char *name) {
+ if ((_mode != mode) || ((name[0] != '\0') && strcmp(_name, name))) {
+ clear();
+ _mode = mode;
+ _name = new char[strlen(name) + 1];
+ strcpy(_name, name);
+ }
+}
- case kSaveGame:
- return saveGame(dataVar, size, offset);
- break;
+bool StagedSave::save(int16 dataVar, int32 size, int32 offset, const char *name,
+ const Variables *variables) {
- case kSaveTempSprite:
- return saveTempSprite(dataVar, size, offset);
- break;
+ if ((dataVar < 0) || (size <= 0) || (offset < 0)) {
+ warning("Invalid dataVar (%d), size (%d) or offset (%d)", dataVar, size, offset);
+ return false;
+ }
- case kSaveNotes:
- return saveNotes(dataVar, size, offset);
- break;
+ byte *vars = 0, *varSizes = 0;
- case kSaveScreenshot:
- return saveScreenshot(dataVar, size, offset);
- break;
+ if (variables) {
+ vars = new byte[size];
+ varSizes = new byte[size];
- case kSaveIgnore:
- return true;
- break;
+ if (!variables->copyTo(dataVar, vars, varSizes, size)) {
+ delete[] vars;
+ delete[] varSizes;
+ warning("dataVar (%d) or size (%d) out of range", dataVar, size);
+ return false;
+ }
}
- return false;
-}
+ bool result = save(0, size, offset, name, vars, varSizes);
+
+ delete[] vars;
+ delete[] varSizes;
-int32 SaveLoad::getSizeTempSprite() {
- return _tempSpriteSize;
+ return result;
}
-bool SaveLoad::loadTempSprite(int16 dataVar, int32 size, int32 offset) {
- int index;
- bool readPal;
+bool StagedSave::load(int16 dataVar, int32 size, int32 offset, const char *name,
+ Variables *variables) {
- if (size >= 0) {
- warning("Invalid attempt at loading from the temporary sprite");
+ if ((dataVar < 0) || (size <= 0) || (offset < 0)) {
+ warning("Invalid dataVar (%d), size (%d) or offset (%d)", dataVar, size, offset);
return false;
}
- index = getSpriteIndex(size);
- readPal = getSpritePalette(size);
+ byte *vars = new byte[size];
+ byte *varSizes = new byte[size];
- if ((index < 0) || (index >= SPRITES_COUNT)) {
- warning("Index out of range while loading from the temporary "
- "sprite (%d)", index);
- return false;
+ bool result = load(0, size, offset, name, vars, varSizes);
+
+ if (result && variables) {
+ if (!variables->copyFrom(dataVar, vars, varSizes, size)) {
+ delete[] vars;
+ delete[] varSizes;
+ warning("dataVar (%d) or size (%d) out of range", dataVar, size);
+ return false;
+ }
}
- return loadTempSprite(index, readPal);
+ delete[] vars;
+ delete[] varSizes;
+
+ return result;
}
-bool SaveLoad::saveTempSprite(int16 dataVar, int32 size, int32 offset) {
- int index;
- bool readPal;
+bool StagedSave::save(int16 dataVar, int32 size, int32 offset, const char *name,
+ const byte *variables, const byte *variableSizes) {
- if (size >= 0) {
- warning("Invalid attempt at saving to the temporary sprite");
+ if ((dataVar < 0) || (size <= 0) || (offset < 0)) {
+ warning("Invalid dataVar (%d), size (%d) or offset (%d)", dataVar, size, offset);
return false;
}
- index = getSpriteIndex(size);
- readPal = getSpritePalette(size);
+ int stage = findStage(dataVar, size, offset);
+ if (stage == -1) {
+ warning("Invalid saving procedure");
+ return false;
+ }
- if ((index < 0) || (index >= SPRITES_COUNT)) {
- warning("Index out of range while saving to the temporary sprite (%d)",
- index);
+ if (!variables || (_stages[stage].endianed && !variableSizes)) {
+ warning("Missing data");
return false;
}
- return saveTempSprite(index, readPal);
-}
+ assertMode(kModeSave, name);
-bool SaveLoad::loadTempSprite(uint32 index, bool palette) {
- SurfaceDesc *sprite;
+ _stages[stage].bufVar = new byte[size];
+ memcpy(_stages[stage].bufVar, variables + dataVar, size);
- if (palette) {
- memcpy((char *) _vm->_global->_pPaletteDesc->vgaPal,
- (char *) _tempPal, 768);
- _vm->_video->setFullPalette(_vm->_global->_pPaletteDesc);
+ if (_stages[stage].endianed) {
+ _stages[stage].bufVarSizes = new byte[size];
+ memcpy(_stages[stage].bufVarSizes, variableSizes + dataVar, size);
+ }
+
+ if (allSaved()) {
+ bool result = write();
+ clear();
+ return result;
}
- sprite = _vm->_draw->_spritesArray[index];
+ return true;
+}
+
+bool StagedSave::load(int16 dataVar, int32 size, int32 offset, const char *name,
+ byte *variables, byte *variableSizes) {
- if (!sprite) {
- warning("Couldn't load from the temporary sprite: "
- "No such sprite %d", index);
+ if ((dataVar < 0) || (size <= 0) || (offset < 0)) {
+ warning("Invalid dataVar (%d), size (%d) or offset (%d)", dataVar, size, offset);
return false;
}
- if ((sprite->getWidth() != _tempSprite->getWidth()) ||
- (sprite->getHeight() != _tempSprite->getHeight())) {
- warning("Resolution doesn't match while loading from the "
- "temporary sprite (%d: %dx%d vs. %dx%d)", index,
- sprite->getWidth(), sprite->getHeight(),
- _tempSprite->getWidth(), _tempSprite->getHeight());
+ int stage = findStage(dataVar, size, offset);
+ if (stage == -1) {
+ warning("Invalid loading procedure");
return false;
}
- _vm->_video->drawSprite(_tempSprite, sprite, 0, 0,
- sprite->getWidth() - 1, sprite->getHeight() - 1, 0, 0, 0);
+ assertMode(kModeLoad, name);
- if (index == 21) {
- _vm->_draw->forceBlit();
- _vm->_video->retrace();
+ if (!_loaded) {
+ if (!read()) {
+ clear();
+ return false;
+ }
}
+ if (variables)
+ memcpy(variables + dataVar, _stages[stage].bufVar, size);
+ if (_stages[stage].endianed && variableSizes)
+ memcpy(variableSizes + dataVar, _stages[stage].bufVarSizes, size);
+
return true;
}
-bool SaveLoad::saveTempSprite(uint32 index, bool palette) {
- SurfaceDesc *sprite = _vm->_draw->_spritesArray[index];
+bool StagedSave::write() const {
+ Common::SaveFileManager *saveMan = g_system->getSavefileManager();
+ Common::OutSaveFile *out = saveMan->openForSaving(_name);
- if (!sprite) {
- warning("Couldn't save to the temporary sprite: "
- "No such sprite %d", index);
+ if (!out) {
+ warning("Can't open file \"%s\" for writing", _name);
return false;
}
- delete _tempSprite;
- _tempSprite = _vm->_video->initSurfDesc(_vm->_global->_videoMode,
- sprite->getWidth(), sprite->getHeight(), 0);
+ bool result = true;
+ for (uint i = 0; (i < _stages.size()) && result; i++) {
+ if (!_stages[i].endianed) {
- _vm->_video->drawSprite(sprite, _tempSprite, 0, 0,
- sprite->getWidth() - 1, sprite->getHeight() - 1, 0, 0, 0);
+ uint32 written = out->write(_stages[i].bufVar, _stages[i].size);
- _tempSpriteSize = _vm->_draw->getSpriteRectSize(index);
+ result = (written == ((uint32) _stages[i].size));
+ if (!result)
+ warning("Can't write data: requested %d, wrote %d", _stages[i].size, written);
- if (palette) {
- memcpy((char *) _tempPal,
- (char *) _vm->_global->_pPaletteDesc->vgaPal, 768);
- _tempSpriteSize += 768;
+ } else
+ result = SaveLoad::saveDataEndian(*out, 0, _stages[i].size,
+ _stages[i].bufVar, _stages[i].bufVarSizes);
}
- return true;
+ if (result) {
+ out->finalize();
+ if (out->ioFailed()) {
+ warning("Can't write to file \"%s\"", _name);
+ result = false;
+ }
+ }
+
+ delete out;
+ return result;
}
-bool SaveLoad::loadSprite(Common::ReadStream &in, int32 size) {
- SurfaceDesc *sprite;
- byte *buf;
- int nRead;
- int index;
- bool readPal;
+bool StagedSave::read() {
+ Common::SaveFileManager *saveMan = g_system->getSavefileManager();
+ Common::InSaveFile *in = saveMan->openForLoading(_name);
- if (size >= 0) {
- warning("Invalid attempt at loading a sprite");
+ if (!in) {
+ warning("Can't open file \"%s\" for reading", _name);
return false;
}
- index = getSpriteIndex(size);
- readPal = getSpritePalette(size);
-
- if ((index < 0) || (index >= SPRITES_COUNT)) {
- warning("Index out of range while loading a sprite (%d)",
- index);
+ uint32 saveSize = getSize();
+ if (in->size() != saveSize) {
+ warning("Wrong size (%d != %d)", in->size(), saveSize);
return false;
}
- size = _vm->_draw->getSpriteRectSize(index);
- sprite = _vm->_draw->_spritesArray[index];
+ bool result = true;
+ for (uint i = 0; ((i < _stages.size()) && result); i++) {
+ _stages[i].bufVar = new byte[_stages[i].size];
- if (!sprite) {
- warning("Couldn't load sprite: No such sprite %d", index);
- return false;
- }
+ if (!_stages[i].endianed) {
- buf = new byte[MAX<int>(768, size)];
- assert(buf);
+ uint32 nRead = in->read(_stages[i].bufVar, _stages[i].size);
- if (readPal) {
- nRead = in.read(buf, 768);
- if (nRead != 768) {
- warning("Couldn't read a palette: requested 768, got %d", nRead);
- delete[] buf;
- return false;
- }
+ result = (nRead == ((uint32) _stages[i].size));
+ if (!result)
+ warning("Can't read data: requested %d, got %d", _stages[i].size, nRead);
- memcpy((char *) _vm->_global->_pPaletteDesc->vgaPal,
- (char *) buf, 768);
- _vm->_video->setFullPalette(_vm->_global->_pPaletteDesc);
- }
+ } else {
+ _stages[i].bufVarSizes = new byte[_stages[i].size];
- nRead = in.read(buf, size);
- if (nRead != size) {
- warning("Couldn't read sprite data: requested %d, got %d", size, nRead);
- delete[] buf;
- return false;
+ result = SaveLoad::loadDataEndian(*in, 0, _stages[i].size,
+ _stages[i].bufVar, _stages[i].bufVarSizes);
+ }
}
- memcpy((char *) sprite->getVidMem(), buf, size);
+ if (result)
+ _loaded = true;
+
+ delete in;
+ return result;
+}
+
+
+PagedBuffer::PagedBuffer(uint32 pageSize) {
+
+ _size = 0;
+ _pageSize = pageSize;
+}
+
+PagedBuffer::~PagedBuffer() {
+ clear();
+}
+
+bool PagedBuffer::empty() const {
+ return _pages.empty();
+}
+
+uint32 PagedBuffer::getSize() const {
+ return _size;
+}
+
+void PagedBuffer::clear() {
+ for (uint i = 0; i < _pages.size(); i++)
+ delete[] _pages[i];
+ _pages.clear();
+ _size = 0;
+}
+
+bool PagedBuffer::write(const byte *buffer, uint32 size, uint32 offset) {
+ grow(size, offset);
+
+ uint page = offset / _pageSize;
+ while (size > 0) {
+ if (!_pages[page])
+ _pages[page] = new byte[_pageSize];
+
+ uint32 pStart = offset % _pageSize;
+ uint32 n = MIN(size, _pageSize - pStart);
+
+ memcpy(_pages[page] + pStart, buffer, n);
+
+ buffer += n;
+ offset += n;
+ size -= n;
+ page++;
+ }
- delete[] buf;
return true;
}
-bool SaveLoad::saveSprite(Common::WriteStream &out, int32 size) {
- SurfaceDesc *sprite;
- int written;
- int index;
- bool readPal;
+bool PagedBuffer::read(byte *buffer, uint32 size, uint32 offset) const {
+ uint page = offset / _pageSize;
- if (size >= 0) {
- warning("Invalid attempt at saving a sprite");
- return false;
+ while (size > 0) {
+ if (offset >= _size) {
+ memset(buffer, 0, size);
+ break;
+ }
+
+ uint32 pStart = offset % _pageSize;
+ uint32 n = MIN(MIN(size, _pageSize - pStart), _size - offset);
+
+ if (_pages[page])
+ memcpy(buffer, _pages[page] + pStart, n);
+ else
+ memset(buffer, 0, n);
+
+ buffer += n;
+ offset += n;
+ size -= n;
+ page++;
}
- index = getSpriteIndex(size);
- readPal = getSpritePalette(size);
+ return true;
+}
- if ((index < 0) || (index >= SPRITES_COUNT)) {
- warning("Index out of range while saving a sprite (%d)",
- index);
- return false;
+uint32 PagedBuffer::writeToStream(Common::WriteStream &out) const {
+ for (uint i = 0; i < _pages.size(); i++) {
+ if (!_pages[i]) {
+ for (uint32 j = 0; j < _pageSize; j++)
+ out.writeByte(0);
+ } else
+ out.write(_pages[i], _pageSize);
}
- size = _vm->_draw->getSpriteRectSize(index);
- sprite = _vm->_draw->_spritesArray[index];
+ return _size;
+}
+
+uint32 PagedBuffer::readFromStream(Common::ReadStream &in) {
+ clear();
- if (!sprite) {
- warning("Couldn't save sprite: No such sprite %d", index);
- return false;
+ while (!in.eos()) {
+ byte *buffer = new byte[_pageSize];
+
+ _size += in.read(buffer, _pageSize);
+
+ _pages.push_back(buffer);
}
- if (readPal) {
- written = out.write((char *) _vm->_global->_pPaletteDesc->vgaPal, 768);
- if (written != 768) {
- warning("Couldn't write a palette: requested 768, wrote %d", written);
- return false;
- }
+ return _size;
+}
+
+void PagedBuffer::grow(uint32 size, uint32 offset) {
+ uint32 eSize = offset + size;
+
+ while (_size < eSize) {
+ _pages.push_back(0);
+ _size += MIN(_pageSize, eSize - _size);
}
+}
+
+
+SaveLoad::SaveLoad(GobEngine *vm, const char *targetName) : _vm(vm) {
+
+ _targetName = new char[strlen(targetName) + 1];
+ strcpy(_targetName, targetName);
+}
+
+SaveLoad::~SaveLoad() {
+ delete[] _targetName;
+}
- written = out.write((char *) sprite->getVidMem(), size);
- if (written != size) {
- warning("Couldn't write a sprite: requested %d, wrote %d",
- size, written);
+int32 SaveLoad::getSize(const char *fileName) {
+ int type;
+
+ type = getSaveType(stripPath(fileName));
+ if (type == -1)
+ return -1;
+
+ debugC(3, kDebugSaveLoad, "Requested size of save file \"%s\" (type %d)",
+ fileName, type);
+
+ return getSizeVersioned(type);
+}
+
+bool SaveLoad::load(const char *fileName, int16 dataVar, int32 size, int32 offset) {
+ int type;
+
+ type = getSaveType(stripPath(fileName));
+ if (type == -1)
return false;
- }
- return true;
+ debugC(3, kDebugSaveLoad, "Requested loading of save file \"%s\" (type %d) - %d, %d, %d",
+ fileName, type, dataVar, size, offset);
+
+ return loadVersioned(type, dataVar, size, offset);
+}
+
+bool SaveLoad::save(const char *fileName, int16 dataVar, int32 size, int32 offset) {
+ int type;
+
+ type = getSaveType(stripPath(fileName));
+ if (type == -1)
+ return false;
+
+ debugC(3, kDebugSaveLoad, "Requested saving of save file \"%s\" (type %d) - %d, %d, %d",
+ fileName, type, dataVar, size, offset);
+
+ return saveVersioned(type, dataVar, size, offset);
+}
+
+const char *SaveLoad::stripPath(const char *fileName) {
+ const char *backSlash;
+ if ((backSlash = strrchr(fileName, '\\')))
+ return backSlash + 1;
+
+ return fileName;
+}
+
+char *SaveLoad::setCurrentSlot(char *destName, int slot) {
+ char *slotBase = destName + strlen(destName) - 2;
+
+ snprintf(slotBase, 3, "%02d", slot);
+
+ return destName;
+}
+
+void SaveLoad::buildIndex(byte *buffer, char *name, int n, int32 size, int32 offset) {
+ Common::SaveFileManager *saveMan = g_system->getSavefileManager();
+ Common::InSaveFile *in;
+
+ for (int i = 0; i < n; i++, buffer += size) {
+ in = saveMan->openForLoading(setCurrentSlot(name, i));
+ if (in) {
+ in->seek(offset);
+ in->read(buffer, size);
+ delete in;
+ } else
+ memset(buffer, 0, size);
+ }
}
bool SaveLoad::fromEndian(byte *buf, const byte *sizes, uint32 count) {
@@ -514,4 +772,89 @@ bool SaveLoad::toEndian(byte *buf, const byte *sizes, uint32 count) {
return true;
}
+uint32 SaveLoad::read(Common::ReadStream &in,
+ byte *buf, byte *sizes, uint32 count) {
+ uint32 nRead;
+
+ nRead = in.read(buf, count);
+ if (nRead != count) {
+ warning("Can't read data: requested %d, got %d", count, nRead);
+ return 0;
+ }
+
+ nRead = in.read(sizes, count);
+ if (nRead != count) {
+ warning("Can't read data sizes: requested %d, got %d", count, nRead);
+ return 0;
+ }
+
+ return count;
+}
+
+uint32 SaveLoad::write(Common::WriteStream &out,
+ const byte *buf, const byte *sizes, uint32 count) {
+ uint32 written;
+
+ written = out.write(buf, count);
+ if (written != count) {
+ warning("Can't write data: requested %d, wrote %d", count, written);
+ return 0;
+ }
+
+ written = out.write(sizes, count);
+ if (written != count) {
+ warning("Can't write data: requested %d, wrote %d", count, written);
+ return 0;
+ }
+
+ return count;
+}
+
+bool SaveLoad::loadDataEndian(Common::ReadStream &in,
+ int16 dataVar, uint32 size, byte *variables, byte *variableSizes) {
+
+ bool retVal = false;
+
+ byte *varBuf = new byte[size];
+ byte *sizeBuf = new byte[size];
+
+ assert(varBuf && sizeBuf);
+
+ if (read(in, varBuf, sizeBuf, size) == size) {
+ if (fromEndian(varBuf, sizeBuf, size)) {
+ memcpy(variables + dataVar, varBuf, size);
+ memcpy(variableSizes + dataVar, sizeBuf, size);
+ retVal = true;
+ }
+ }
+
+ delete[] varBuf;
+ delete[] sizeBuf;
+
+ return retVal;
+}
+
+bool SaveLoad::saveDataEndian(Common::WriteStream &out,
+ int16 dataVar, uint32 size, const byte *variables, const byte *variableSizes) {
+
+ bool retVal = false;
+
+ byte *varBuf = new byte[size];
+ byte *sizeBuf = new byte[size];
+
+ assert(varBuf && sizeBuf);
+
+ memcpy(varBuf, variables + dataVar, size);
+ memcpy(sizeBuf, variableSizes + dataVar, size);
+
+ if (toEndian(varBuf, sizeBuf, size))
+ if (write(out, varBuf, sizeBuf, size) == size)
+ retVal = true;
+
+ delete[] varBuf;
+ delete[] sizeBuf;
+
+ return retVal;
+}
+
} // End of namespace Gob
diff --git a/engines/gob/saveload.h b/engines/gob/saveload.h
index bf1e4c01a8..29f7ee2594 100644
--- a/engines/gob/saveload.h
+++ b/engines/gob/saveload.h
@@ -26,143 +26,380 @@
#ifndef GOB_SAVELOAD_H
#define GOB_SAVELOAD_H
+#include "common/array.h"
#include "common/stream.h"
#include "gob/video.h"
+#include "gob/variables.h"
namespace Gob {
-enum SaveType {
- kSaveNone = -1,
- kSaveGame,
- kSaveTempSprite,
- kSaveNotes,
- kSaveScreenshot,
- kSaveIgnore
+class TempSprite {
+public:
+ TempSprite();
+ ~TempSprite();
+
+ bool getProperties(int16 dataVar, int32 size, int32 offset,
+ int &index, bool &palette) const;
+
+ int32 getSize() const;
+
+ bool saveSprite(const SurfaceDesc &surfDesc);
+ bool savePalette(const Video::Color *palette);
+ bool loadSprite(SurfaceDesc &surfDesc);
+ bool loadPalette(Video::Color *palette);
+
+ bool toBuffer(byte *buffer, int32 size, bool palette) const;
+ bool fromBuffer(const byte *buffer, int32 size, bool palette);
+
+private:
+ byte *_sprite;
+ int16 _width;
+ int16 _height;
+ int32 _size;
+ Video::Color _palette[256];
+
+ int getSpriteIndex(int32 size) const;
+ bool getSpritePalette(int32 size) const;
};
-class SaveLoad {
+class PlainSave {
+public:
+ PlainSave();
+ ~PlainSave();
+
+ bool save(int16 dataVar, int32 size, int32 offset, const char *name,
+ const Variables *variables);
+ bool load(int16 dataVar, int32 size, int32 offset, const char *name,
+ Variables *variables);
+
+ bool save(int16 dataVar, int32 size, int32 offset, const char *name,
+ const byte *variables, const byte *variableSizes) const;
+ bool load(int16 dataVar, int32 size, int32 offset, const char *name,
+ byte *variables, byte *variableSizes) const;
+};
+
+class StagedSave {
public:
- int32 getSize(SaveType type);
- bool load(SaveType type, int16 dataVar, int32 size, int32 offset);
- bool save(SaveType type, int16 dataVar, int32 size, int32 offset);
+ StagedSave();
+ ~StagedSave();
+
+ void addStage(int32 size, bool endianed = true);
- virtual SaveType getSaveType(const char *fileName) = 0;
+ bool save(int16 dataVar, int32 size, int32 offset, const char *name,
+ const Variables *variables);
+ bool load(int16 dataVar, int32 size, int32 offset, const char *name,
+ Variables *variables);
+
+ bool save(int16 dataVar, int32 size, int32 offset, const char *name,
+ const byte *variables, const byte *variableSizes);
+ bool load(int16 dataVar, int32 size, int32 offset, const char *name,
+ byte *variables, byte *variableSizes);
+
+private:
+ struct Stage {
+ byte *bufVar;
+ byte *bufVarSizes;
+ int32 size;
+ int32 offset;
+ bool endianed;
+
+ Stage(int32 s = 0, int32 off = 0, bool end = true) :
+ bufVar(0), bufVarSizes(0), size(s), offset(off), endianed(end) {}
+ };
+
+ enum Mode {
+ kModeNone,
+ kModeSave,
+ kModeLoad
+ };
+
+ Common::Array<Stage> _stages;
+ enum Mode _mode;
+ char *_name;
+
+ bool _loaded;
+
+ int findStage(int16 dataVar, int32 size, int32 offset) const;
+ bool allSaved() const;
+
+ uint32 getSize() const;
+
+ void clear();
+ void assertMode(Mode mode, const char *name);
+
+ bool write() const;
+ bool read();
+};
+
+class PagedBuffer {
+public:
+ PagedBuffer(uint32 pageSize = 1024);
+ ~PagedBuffer();
+
+ bool empty() const;
+ uint32 getSize() const;
+
+ void clear();
+
+ bool write(const byte *buffer, uint32 size, uint32 offset);
+ bool read(byte *buffer, uint32 size, uint32 offset) const;
+
+ uint32 writeToStream(Common::WriteStream &out) const;
+ uint32 readFromStream(Common::ReadStream &in);
+
+private:
+ uint32 _size;
+ uint32 _pageSize;
+ Common::Array<byte *> _pages;
+
+ void grow(uint32 size, uint32 offset);
+};
+
+class SaveLoad {
+public:
+ enum SaveMode {
+ kSaveModeNone,
+ kSaveModeIgnore,
+ kSaveModeSave
+ };
SaveLoad(GobEngine *vm, const char *targetName);
virtual ~SaveLoad();
-protected:
- int _curSlot;
- char **_saveFiles;
+ virtual SaveMode getSaveMode(const char *fileName) = 0;
- int _stagesCount;
- byte **_buffer;
+ int32 getSize(const char *fileName);
+ bool load(const char *fileName, int16 dataVar, int32 size, int32 offset);
+ bool save(const char *fileName, int16 dataVar, int32 size, int32 offset);
- // While using the notepad or changing the font, the original executable
- // temporarily dumps Draw::_backSurface to a file. Since that's not really
- // a nice thing to do, we work around it.
- SurfaceDesc *_tempSprite;
- Video::Color _tempPal[256];
- int32 _tempSpriteSize;
+ char *setCurrentSlot(char *destName, int slot);
+ void buildIndex(byte *buffer, char *name, int n, int32 size, int32 offset = 0);
+ static const char *stripPath(const char *fileName);
+
+ static bool fromEndian(byte *buf, const byte *sizes, uint32 count);
+ static bool toEndian(byte *buf, const byte *sizes, uint32 count);
+ static uint32 read(Common::ReadStream &in,
+ byte *buf, byte *sizes, uint32 count);
+ static uint32 write(Common::WriteStream &out,
+ const byte *buf, const byte *sizes, uint32 count);
+
+ static bool loadDataEndian(Common::ReadStream &in,
+ int16 dataVar, uint32 size, byte *variables, byte *variableSizes);
+ static bool saveDataEndian(Common::WriteStream &out,
+ int16 dataVar, uint32 size, const byte *variables, const byte *variableSizes);
+
+protected:
GobEngine *_vm;
- int getSpriteIndex(int32 size) {
- if (size < -1000)
- size += 1000;
-
- return -size - 1;
- }
- bool getSpritePalette(int32 size) {
- return size < -1000;
- }
-
- const char *setCurSlot(int slot);
- bool fromEndian(byte *buf, const byte *sizes, uint32 count);
- bool toEndian(byte *buf, const byte *sizes, uint32 count);
- uint32 read(Common::ReadStream &in, byte *buf,
- byte *sizes, uint32 count);
- uint32 write(Common::WriteStream &out, byte *buf,
- byte *sizes, uint32 count);
-
- bool loadDataEndian(Common::ReadStream &in, int16 dataVar, uint32 size);
- bool saveDataEndian(Common::WriteStream &out, int16 dataVar, uint32 size);
-
- bool loadTempSprite(uint32 index, bool palette);
- bool saveTempSprite(uint32 index, bool palette);
- bool loadSprite(Common::ReadStream &in, int32 size);
- bool saveSprite(Common::WriteStream &out, int32 size);
-
- int32 getSizeTempSprite();
- bool loadTempSprite(int16 dataVar, int32 size, int32 offset);
- bool saveTempSprite(int16 dataVar, int32 size, int32 offset);
-
- virtual uint32 getSaveGameSize() = 0;
-
- virtual int32 getSizeGame() = 0;
- virtual int32 getSizeNotes() = 0;
- virtual int32 getSizeScreenshot() = 0;
- virtual bool loadGame(int16 dataVar, int32 size, int32 offset) = 0;
- virtual bool loadNotes(int16 dataVar, int32 size, int32 offset) = 0;
- virtual bool loadScreenshot(int16 dataVar, int32 size, int32 offset) = 0;
- virtual bool saveGame(int16 dataVar, int32 size, int32 offset) = 0;
- virtual bool saveNotes(int16 dataVar, int32 size, int32 offset) = 0;
- virtual bool saveScreenshot(int16 dataVar, int32 size, int32 offset) = 0;
+ char *_targetName;
+
+ virtual int getSaveType(const char *fileName) = 0;
+
+ virtual int32 getSizeVersioned(int type) = 0;
+ virtual bool loadVersioned(int type, int16 dataVar, int32 size, int32 offset) = 0;
+ virtual bool saveVersioned(int type, int16 dataVar, int32 size, int32 offset) = 0;
};
class SaveLoad_v2 : public SaveLoad {
public:
- virtual SaveType getSaveType(const char *fileName);
+ enum SaveType {
+ kSaveGame,
+ kSaveTempSprite,
+ kSaveNotes
+ };
SaveLoad_v2(GobEngine *vm, const char *targetName);
- virtual ~SaveLoad_v2() {}
+ virtual ~SaveLoad_v2();
+
+ virtual SaveMode getSaveMode(const char *fileName);
protected:
- virtual uint32 getSaveGameSize();
-
- virtual int32 getSizeGame();
- virtual int32 getSizeNotes();
- virtual int32 getSizeScreenshot();
- virtual bool loadGame(int16 dataVar, int32 size, int32 offset);
- virtual bool loadNotes(int16 dataVar, int32 size, int32 offset);
- virtual bool loadScreenshot(int16 dataVar, int32 size, int32 offset);
- virtual bool saveGame(int16 dataVar, int32 size, int32 offset);
- virtual bool saveNotes(int16 dataVar, int32 size, int32 offset);
- virtual bool saveScreenshot(int16 dataVar, int32 size, int32 offset);
-
- void initBuffer();
+ struct SaveFile {
+ const char *sourceName;
+ char *destName;
+ SaveMode mode;
+ SaveType type;
+ };
+
+ static SaveFile _saveFiles[];
+
+ int32 _varSize;
+
+ TempSprite _tmpSprite;
+ PlainSave _notes;
+ StagedSave _save;
+
+ byte _indexBuffer[600];
+ bool _hasIndex;
+
+ virtual int getSaveType(const char *fileName);
+
+ virtual int32 getSizeVersioned(int type);
+ virtual bool loadVersioned(int type, int16 dataVar, int32 size, int32 offset);
+ virtual bool saveVersioned(int type, int16 dataVar, int32 size, int32 offset);
+
+ int getSlot(int32 offset) const;
+ int getSlotRemainder(int32 offset) const;
+
+ int32 getSizeGame(SaveFile &saveFile);
+ int32 getSizeTempSprite(SaveFile &saveFile);
+ int32 getSizeNotes(SaveFile &saveFile);
+
+ bool loadGame(SaveFile &saveFile, int16 dataVar, int32 size, int32 offset);
+ bool loadTempSprite(SaveFile &saveFile, int16 dataVar, int32 size, int32 offset);
+ bool loadNotes(SaveFile &saveFile, int16 dataVar, int32 size, int32 offset);
+
+ bool saveGame(SaveFile &saveFile, int16 dataVar, int32 size, int32 offset);
+ bool saveTempSprite(SaveFile &saveFile, int16 dataVar, int32 size, int32 offset);
+ bool saveNotes(SaveFile &saveFile, int16 dataVar, int32 size, int32 offset);
+
+ void assertInited();
};
-class SaveLoad_v3 : public SaveLoad_v2 {
-public:
- virtual SaveType getSaveType(const char *fileName);
+enum SaveType {
+ kSaveNone = -1,
+ kSaveGame,
+ kSaveTempSprite,
+ kSaveNotes,
+ kSaveScreenshot,
+ kSaveIgnore
+};
- SaveLoad_v3(GobEngine *vm, const char *targetName, uint32 screenshotSize = 19968,
+class SaveLoad_v3 : public SaveLoad {
+public:
+ enum SaveType {
+ kSaveNone,
+ kSaveGame,
+ kSaveTempSprite,
+ kSaveNotes,
+ kSaveScreenshot
+ };
+
+ SaveLoad_v3(GobEngine *vm, const char *targetName,
+ uint32 screenshotSize = 19968,
int32 indexOffset = 40, int32 screenshotOffset = 80);
- virtual ~SaveLoad_v3() {}
+ virtual ~SaveLoad_v3();
+
+ virtual SaveMode getSaveMode(const char *fileName);
protected:
+ struct SaveFile {
+ const char *sourceName;
+ char *destName;
+ SaveMode mode;
+ SaveType type;
+ int slot;
+ };
+
bool _useScreenshots;
bool _firstSizeGame;
- int8 _saveSlot;
uint32 _screenshotSize;
int32 _indexOffset;
int32 _screenshotOffset;
- virtual uint32 getSaveGameSize();
+ static SaveFile _saveFiles[];
+
+ int32 _varSize;
+
+ TempSprite _screenshot;
+ TempSprite _tmpSprite;
+ PlainSave _notes;
+ StagedSave _save;
+
+ byte _propBuffer[1000];
+ byte _indexBuffer[1200];
+ bool _hasIndex;
+
+ virtual int getSaveType(const char *fileName);
+
+ virtual int32 getSizeVersioned(int type);
+ virtual bool loadVersioned(int type, int16 dataVar, int32 size, int32 offset);
+ virtual bool saveVersioned(int type, int16 dataVar, int32 size, int32 offset);
+
+ int getSlot(int32 offset) const;
+ int getSlotRemainder(int32 offset) const;
+
+ int32 getSizeGame(SaveFile &saveFile);
+ int32 getSizeTempSprite(SaveFile &saveFile);
+ int32 getSizeNotes(SaveFile &saveFile);
+ int32 getSizeScreenshot(SaveFile &saveFile);
+
+ bool loadGame(SaveFile &saveFile, int16 dataVar, int32 size, int32 offset);
+ bool loadTempSprite(SaveFile &saveFile, int16 dataVar, int32 size, int32 offset);
+ bool loadNotes(SaveFile &saveFile, int16 dataVar, int32 size, int32 offset);
+ bool loadScreenshot(SaveFile &saveFile, int16 dataVar, int32 size, int32 offset);
+
+ bool saveGame(SaveFile &saveFile, int16 dataVar, int32 size, int32 offset);
+ bool saveTempSprite(SaveFile &saveFile, int16 dataVar, int32 size, int32 offset);
+ bool saveNotes(SaveFile &saveFile, int16 dataVar, int32 size, int32 offset);
+ bool saveScreenshot(SaveFile &saveFile, int16 dataVar, int32 size, int32 offset);
+
+ void assertInited();
+
+ void buildScreenshotIndex(byte *buffer, char *name, int n);
+};
+
+class SaveLoad_v4 : public SaveLoad {
+public:
+ enum SaveType {
+ kSaveNone,
+ kSaveScreenProps,
+ kSaveGame,
+ kSaveGameScreenProps
+ };
+
+ bool _firstSizeGame;
+
+ SaveLoad_v4(GobEngine *vm, const char *targetName);
+ virtual ~SaveLoad_v4();
+
+ virtual SaveMode getSaveMode(const char *fileName);
+
+protected:
+ struct SaveFile {
+ const char *sourceName;
+ char *destName;
+ SaveMode mode;
+ SaveType type;
+ };
+
+ static SaveFile _saveFiles[];
+
+ int32 _varSize;
+
+ StagedSave _save;
+
+ byte _propBuffer[1000];
+ byte _indexBuffer[1200];
+ bool _hasIndex;
+
+ byte *_screenProps;
+
+ virtual int getSaveType(const char *fileName);
+
+ virtual int32 getSizeVersioned(int type);
+ virtual bool loadVersioned(int type, int16 dataVar, int32 size, int32 offset);
+ virtual bool saveVersioned(int type, int16 dataVar, int32 size, int32 offset);
+
+ int getSlot(int32 offset) const;
+ int getSlotRemainder(int32 offset) const;
+
+ int32 getSizeScreenProps(SaveFile &saveFile);
+ int32 getSizeGame(SaveFile &saveFile);
+ int32 getSizeGameScreenProps(SaveFile &saveFile);
+
+ bool loadScreenProps(SaveFile &saveFile, int16 dataVar, int32 size, int32 offset);
+ bool loadGame(SaveFile &saveFile, int16 dataVar, int32 size, int32 offset);
+ bool loadGameScreenProps(SaveFile &saveFile, int16 dataVar, int32 size, int32 offset);
- virtual int32 getSizeGame();
- virtual int32 getSizeScreenshot();
- virtual bool loadGame(int16 dataVar, int32 size, int32 offset);
- virtual bool loadScreenshot(int16 dataVar, int32 size, int32 offset);
- virtual bool saveGame(int16 dataVar, int32 size, int32 offset);
- virtual bool saveNotes(int16 dataVar, int32 size, int32 offset);
- virtual bool saveScreenshot(int16 dataVar, int32 size, int32 offset);
+ bool saveScreenProps(SaveFile &saveFile, int16 dataVar, int32 size, int32 offset);
+ bool saveGame(SaveFile &saveFile, int16 dataVar, int32 size, int32 offset);
+ bool saveGameScreenProps(SaveFile &saveFile, int16 dataVar, int32 size, int32 offset);
- bool saveGame(int32 screenshotSize);
- void initBuffer();
+ void assertInited();
};
} // End of namespace Gob
diff --git a/engines/gob/saveload_v2.cpp b/engines/gob/saveload_v2.cpp
index ab7211b216..a92fe8cf01 100644
--- a/engines/gob/saveload_v2.cpp
+++ b/engines/gob/saveload_v2.cpp
@@ -24,273 +24,344 @@
*/
#include "common/endian.h"
-#include "common/file.h"
+#include "common/savefile.h"
#include "gob/gob.h"
#include "gob/saveload.h"
#include "gob/global.h"
#include "gob/game.h"
+#include "gob/draw.h"
+#include "gob/inter.h"
namespace Gob {
+SaveLoad_v2::SaveFile SaveLoad_v2::_saveFiles[] = {
+ { "cat.inf", 0, kSaveModeSave, kSaveGame},
+ { "cat.cat", 0, kSaveModeSave, kSaveGame},
+ { "save.inf", 0, kSaveModeSave, kSaveTempSprite},
+ { "bloc.inf", 0, kSaveModeSave, kSaveNotes}
+};
+
SaveLoad_v2::SaveLoad_v2(GobEngine *vm, const char *targetName) :
- SaveLoad(vm, targetName) {
+ SaveLoad(vm, targetName) {
+
+ _saveFiles[0].destName = new char[strlen(targetName) + 5];
+ _saveFiles[1].destName = _saveFiles[0].destName;
+ _saveFiles[2].destName = 0;
+ _saveFiles[3].destName = new char[strlen(targetName) + 5];
- _stagesCount = 1;
+ sprintf(_saveFiles[0].destName, "%s.s00", targetName);
+ sprintf(_saveFiles[3].destName, "%s.blo", targetName);
+
+ _varSize = 0;
+ _hasIndex = false;
}
-SaveType SaveLoad_v2::getSaveType(const char *fileName) {
- const char *backSlash;
- if ((backSlash = strrchr(fileName, '\\')))
- fileName = backSlash + 1;
-
- if (!scumm_stricmp(fileName, "cat.inf"))
- return kSaveGame;
- if (!scumm_stricmp(fileName, "cat.cat"))
- return kSaveGame;
- if (!scumm_stricmp(fileName, "save.inf"))
- return kSaveTempSprite;
- if (!scumm_stricmp(fileName, "bloc.inf"))
- return kSaveNotes;
-
- return kSaveNone;
+SaveLoad_v2::~SaveLoad_v2() {
+ delete[] _saveFiles[0].destName;
+ delete[] _saveFiles[3].destName;
}
-uint32 SaveLoad_v2::getSaveGameSize() {
- return 80 + (READ_LE_UINT32(_vm->_game->_totFileData + 0x2C) * 4) * 2;
+SaveLoad::SaveMode SaveLoad_v2::getSaveMode(const char *fileName) {
+ fileName = stripPath(fileName);
+
+ for (int i = 0; i < ARRAYSIZE(_saveFiles); i++)
+ if (!scumm_stricmp(fileName, _saveFiles[i].sourceName))
+ return _saveFiles[i].mode;
+
+ return kSaveModeNone;
}
-int32 SaveLoad_v2::getSizeNotes() {
- Common::SaveFileManager *saveMan = g_system->getSavefileManager();
- Common::InSaveFile *in;
- int32 size = -1;
+int SaveLoad_v2::getSaveType(const char *fileName) {
+ for (int i = 0; i < ARRAYSIZE(_saveFiles); i++)
+ if (!scumm_stricmp(fileName, _saveFiles[i].sourceName))
+ return i;
- in = saveMan->openForLoading(_saveFiles[(int) kSaveNotes]);
- if (in) {
- size = in->size();
- delete in;
+ return -1;
+}
+
+int32 SaveLoad_v2::getSizeVersioned(int type) {
+ assertInited();
+
+ switch (_saveFiles[type].type) {
+ case kSaveGame:
+ return getSizeGame(_saveFiles[type]);
+ case kSaveTempSprite:
+ return getSizeTempSprite(_saveFiles[type]);
+ case kSaveNotes:
+ return getSizeNotes(_saveFiles[type]);
}
- return size;
+ return -1;
}
-int32 SaveLoad_v2::getSizeGame() {
+bool SaveLoad_v2::loadVersioned(int type, int16 dataVar, int32 size, int32 offset) {
+ assertInited();
+
+ switch (_saveFiles[type].type) {
+ case kSaveGame:
+ if (loadGame(_saveFiles[type], dataVar, size, offset))
+ return true;
+
+ warning("While loading from slot %d", getSlot(offset));
+ break;
+
+ case kSaveTempSprite:
+ if(loadTempSprite(_saveFiles[type], dataVar, size, offset))
+ return true;
+
+ warning("While loading the temporary sprite");
+ break;
+
+ case kSaveNotes:
+ if (loadNotes(_saveFiles[type], dataVar, size, offset))
+ return true;
+
+ warning("While loading the notes");
+ break;
+ }
+
+ return false;
+}
+
+bool SaveLoad_v2::saveVersioned(int type, int16 dataVar, int32 size, int32 offset) {
+ assertInited();
+
+ switch (_saveFiles[type].type) {
+ case kSaveGame:
+ if (saveGame(_saveFiles[type], dataVar, size, offset))
+ return true;
+
+ warning("While saving to slot %d", getSlot(offset));
+ break;
+
+ case kSaveTempSprite:
+ if(saveTempSprite(_saveFiles[type], dataVar, size, offset))
+ return true;
+
+ warning("While saving the temporary sprite");
+ break;
+
+ case kSaveNotes:
+ if (saveNotes(_saveFiles[type], dataVar, size, offset))
+ return true;
+
+ warning("While saving the notes");
+ break;
+ }
+
+ return false;
+}
+
+int SaveLoad_v2::getSlot(int32 offset) const {
+ return ((offset - 600) / _varSize);
+}
+
+int SaveLoad_v2::getSlotRemainder(int32 offset) const {
+ return ((offset - 600) % _varSize);
+}
+
+int32 SaveLoad_v2::getSizeGame(SaveFile &saveFile) {
Common::SaveFileManager *saveMan = g_system->getSavefileManager();
Common::InSaveFile *in;
for (int i = 14; i >= 0; i--) {
- in = saveMan->openForLoading(setCurSlot(i));
+ in = saveMan->openForLoading(setCurrentSlot(saveFile.destName, i));
if (in) {
delete in;
- return (i + 1) * READ_LE_UINT32(_vm->_game->_totFileData + 0x2C) *
- 4 + 600;
+ return (i + 1) * _varSize + 600;
}
}
return -1;
}
-int32 SaveLoad_v2::getSizeScreenshot() {
- return -1;
+int32 SaveLoad_v2::getSizeTempSprite(SaveFile &saveFile) {
+ return _tmpSprite.getSize();
}
-bool SaveLoad_v2::loadGame(int16 dataVar, int32 size, int32 offset) {
+int32 SaveLoad_v2::getSizeNotes(SaveFile &saveFile) {
Common::SaveFileManager *saveMan = g_system->getSavefileManager();
Common::InSaveFile *in;
- int32 varSize = READ_LE_UINT32(_vm->_game->_totFileData + 0x2C) * 4;
+ int32 size = -1;
+
+ in = saveMan->openForLoading(saveFile.destName);
+ if (in) {
+ size = in->size();
+ delete in;
+ }
+
+ return size;
+}
+
+bool SaveLoad_v2::loadGame(SaveFile &saveFile,
+ int16 dataVar, int32 size, int32 offset) {
if (size == 0) {
dataVar = 0;
- size = varSize;
+ size = _varSize;
}
- int slot = (offset - 600) / varSize;
- int slotR = (offset - 600) % varSize;
+ if (offset == 0) {
+ debugC(3, kDebugSaveLoad, "Loading save index");
- if ((offset == 0) && (size == 600)) {
-
- byte *varBuf = _vm->_global->_inter_variables + dataVar;
- for (int i = 0; i < 15; i++, varBuf += 40) {
- in = saveMan->openForLoading(setCurSlot(i));
- if (in) {
- in->read(varBuf, 40);
- delete in;
- } else
- memset(varBuf, 0, 40);
+ if (size != 600) {
+ warning("Requested index has wrong size (%d)", size);
+ return false;
}
- memset(_vm->_global->_inter_variablesSizes + dataVar, 0, 600);
- return true;
- } else if ((offset > 0) && (slot < 15) &&
- (slotR == 0) && (size == varSize)) {
+ SaveLoad::buildIndex(_vm->_inter->_variables->getAddressOff8(dataVar, 600),
+ saveFile.destName, 15, 40);
+
+ } else {
+ int slot = getSlot(offset);
+ int slotRem = getSlotRemainder(offset);
+
+ debugC(2, kDebugSaveLoad, "Loading from slot %d", slot);
- in = saveMan->openForLoading(setCurSlot(slot));
- if (!in) {
- warning("Can't open file for slot %d", slot);
+ SaveLoad::setCurrentSlot(saveFile.destName, slot);
+
+ if ((slot >= 15) || (slotRem != 0)) {
+ warning("Invalid loading procedure (%d, %d, %d, %d, %d)",
+ dataVar, size, offset, slot, slotRem);
return false;
}
- uint32 sGameSize = getSaveGameSize();
- uint32 fSize = in->size();
- if (fSize != sGameSize) {
- warning("Can't load from slot %d: Wrong size (%d, %d)", slot,
- fSize, sGameSize);
- delete in;
+ if (!_save.load(dataVar, size, 40, saveFile.destName, _vm->_inter->_variables))
return false;
- }
+ }
- in->seek(80);
- if (loadDataEndian(*in, dataVar, size)) {
- delete in;
- debugC(1, kDebugFileIO, "Loading from slot %d", slot);
- return true;
- }
- delete in;
+ return true;
+}
- } else
- warning("Invalid loading procedure (%d, %d, %d, %d)",
- offset, size, slot, slotR);
+bool SaveLoad_v2::loadTempSprite(SaveFile &saveFile,
+ int16 dataVar, int32 size, int32 offset) {
- return false;
-}
+ debugC(3, kDebugSaveLoad, "Loading from the temporary sprite");
-bool SaveLoad_v2::loadNotes(int16 dataVar, int32 size, int32 offset) {
- bool retVal;
+ int index;
+ bool palette;
- if ((size <= 0) || (offset != 0)) {
- warning("Invalid attempt at loading the notes (%d, %d)", size, offset);
+ if (!_tmpSprite.getProperties(dataVar, size, offset, index, palette))
return false;
- }
-
- Common::SaveFileManager *saveMan = g_system->getSavefileManager();
- char *sName = _saveFiles[(int) kSaveNotes];
- Common::InSaveFile *in = saveMan->openForLoading(sName);
- if (!in) {
- warning("Can't open file \"%s\" for reading", sName);
+ if (!_tmpSprite.loadSprite(*_vm->_draw->_spritesArray[index]))
return false;
+
+ if (palette) {
+ if (!_tmpSprite.loadPalette(_vm->_global->_pPaletteDesc->vgaPal))
+ return false;
+
+ _vm->_video->setFullPalette(_vm->_global->_pPaletteDesc);
}
- retVal = loadDataEndian(*in, dataVar, size);
- delete in;
- return retVal;
-}
+ if (index == 21) {
+ _vm->_draw->forceBlit();
+ _vm->_video->retrace();
+ }
-bool SaveLoad_v2::loadScreenshot(int16 dataVar, int32 size, int32 offset) {
- return false;
+ return true;
}
-bool SaveLoad_v2::saveGame(int16 dataVar, int32 size, int32 offset) {
- int32 varSize = READ_LE_UINT32(_vm->_game->_totFileData + 0x2C) * 4;
+bool SaveLoad_v2::loadNotes(SaveFile &saveFile,
+ int16 dataVar, int32 size, int32 offset) {
+
+ debugC(2, kDebugSaveLoad, "Loading the notes");
+
+ return _notes.load(dataVar, size, offset, saveFile.destName, _vm->_inter->_variables);
+}
- initBuffer();
+bool SaveLoad_v2::saveGame(SaveFile &saveFile,
+ int16 dataVar, int32 size, int32 offset) {
if (size == 0) {
dataVar = 0;
- size = varSize;
+ size = _varSize;
}
- int slot = (offset - 600) / varSize;
- int slotR = (offset - 600) % varSize;
+ if (offset == 0) {
+ debugC(3, kDebugSaveLoad, "Saving save index");
- if ((offset == 0) && (size == 600)) {
+ if (size != 600) {
+ warning("Requested index has wrong size (%d)", size);
+ return false;
+ }
- delete[] _buffer[0];
- _buffer[0] = new byte[1200];
- assert(_buffer[0]);
+ _vm->_inter->_variables->copyTo(dataVar, _indexBuffer, 0, 600);
+ _hasIndex = true;
- memcpy(_buffer[0], _vm->_global->_inter_variables + dataVar, 600);
- memset(_buffer[0] + 600, 0, 600);
+ } else {
+ int slot = getSlot(offset);
+ int slotRem = getSlotRemainder(offset);
- return true;
+ debugC(2, kDebugSaveLoad, "Saving to slot %d", slot);
- } else if ((offset > 0) && (slot < 15) &&
- (slotR == 0) && (size == varSize)) {
+ SaveLoad::setCurrentSlot(saveFile.destName, slot);
- if (!_buffer[0]) {
- warning("Tried to save without writing the index first");
+ if ((slot >= 15) || (slotRem != 0)) {
+ warning("Invalid saving procedure (%d, %d, %d, %d, %d)",
+ dataVar, size, offset, slot, slotRem);
return false;
}
- Common::SaveFileManager *saveMan = g_system->getSavefileManager();
- Common::OutSaveFile *out;
-
- out = saveMan->openForSaving(setCurSlot(slot));
- if (!out) {
- warning("Can't open file for slot %d for writing", slot);
- delete[] _buffer[0];
- _buffer[0] = 0;
+ if (!_hasIndex) {
+ warning("No index written yet");
return false;
}
- bool retVal = false;
+ _hasIndex = false;
- if (out->write(_buffer[0] + slot * 40, 40) == 40)
- if (out->write(_buffer[0] + 600 + slot * 40, 40) == 40)
- if (saveDataEndian(*out, dataVar, size)) {
- out->finalize();
- if (!out->ioFailed())
- retVal = true;
- }
-
- if (!retVal)
- warning("Can't save to slot %d", slot);
- else
- debugC(1, kDebugFileIO, "Saved to slot %d", slot);
-
- delete[] _buffer[0];
- _buffer[0] = 0;
- delete out;
+ byte sizes[40];
+ memset(sizes, 0, 40);
+ if(!_save.save(0, 40, 0, saveFile.destName, _indexBuffer + (slot * 40), sizes))
+ return false;
- return retVal;
+ if (!_save.save(dataVar, size, 40, saveFile.destName, _vm->_inter->_variables))
+ return false;
- } else
- warning("Invalid saving procedure (%d, %d, %d, %d)",
- offset, size, slot, slotR);
+ }
- return false;
+ return true;
}
-bool SaveLoad_v2::saveNotes(int16 dataVar, int32 size, int32 offset) {
- bool retVal;
+bool SaveLoad_v2::saveTempSprite(SaveFile &saveFile,
+ int16 dataVar, int32 size, int32 offset) {
- if ((size <= 0) || (offset != 0)) {
- warning("Invalid attempt at saving the notes (%d, %d)", size, offset);
- return false;
- }
+ debugC(3, kDebugSaveLoad, "Saving to the temporary sprite");
- Common::SaveFileManager *saveMan = g_system->getSavefileManager();
- char *sName = _saveFiles[(int) kSaveNotes];
+ int index;
+ bool palette;
- Common::OutSaveFile *out = saveMan->openForSaving(sName);
- if (!out) {
- warning("Can't open file \"%s\" for writing", sName);
+ if (!_tmpSprite.getProperties(dataVar, size, offset, index, palette))
return false;
- }
- retVal = saveDataEndian(*out, dataVar, size);
+ if (!_tmpSprite.saveSprite(*_vm->_draw->_spritesArray[index]))
+ return false;
- out->finalize();
- if (out->ioFailed()) {
- warning("Can't save notes");
- retVal = false;
- }
+ if (palette)
+ if (!_tmpSprite.savePalette(_vm->_global->_pPaletteDesc->vgaPal))
+ return false;
- delete out;
- return retVal;
+ return true;
}
-bool SaveLoad_v2::saveScreenshot(int16 dataVar, int32 size, int32 offset) {
+bool SaveLoad_v2::saveNotes(SaveFile &saveFile,
+ int16 dataVar, int32 size, int32 offset) {
+
+ debugC(2, kDebugSaveLoad, "Saving the notes");
+
+ return _notes.save(dataVar, size, offset, saveFile.destName, _vm->_inter->_variables);
return false;
}
-void SaveLoad_v2::initBuffer() {
- if (_buffer)
+void SaveLoad_v2::assertInited() {
+ if (_varSize > 0)
return;
- _buffer = new byte*[_stagesCount];
- assert(_buffer);
- _buffer[0] = 0;
+ _varSize = READ_LE_UINT32(_vm->_game->_totFileData + 0x2C) * 4;
+
+ _save.addStage(40);
+ _save.addStage(_varSize);
}
} // End of namespace Gob
diff --git a/engines/gob/saveload_v3.cpp b/engines/gob/saveload_v3.cpp
index 4a4036fded..67879db3d1 100644
--- a/engines/gob/saveload_v3.cpp
+++ b/engines/gob/saveload_v3.cpp
@@ -24,62 +24,181 @@
*/
#include "common/endian.h"
-#include "common/file.h"
+#include "common/savefile.h"
#include "gob/gob.h"
#include "gob/saveload.h"
#include "gob/global.h"
#include "gob/game.h"
+#include "gob/draw.h"
+#include "gob/inter.h"
namespace Gob {
+SaveLoad_v3::SaveFile SaveLoad_v3::_saveFiles[] = {
+ { "cat.inf", 0, kSaveModeSave, kSaveGame, -1},
+ { "ima.inf", 0, kSaveModeSave, kSaveScreenshot, -1},
+ { "intro.$$$", 0, kSaveModeSave, kSaveTempSprite, -1},
+ { "bloc.inf", 0, kSaveModeSave, kSaveNotes, -1},
+ { "prot", 0, kSaveModeIgnore, kSaveNone, -1},
+ { "config", 0, kSaveModeIgnore, kSaveNone, -1},
+};
+
SaveLoad_v3::SaveLoad_v3(GobEngine *vm, const char *targetName,
uint32 screenshotSize, int32 indexOffset, int32 screenshotOffset) :
- SaveLoad_v2(vm, targetName) {
+ SaveLoad(vm, targetName) {
_screenshotSize = screenshotSize;
_indexOffset = indexOffset;
_screenshotOffset = screenshotOffset;
- _saveSlot = -1;
- _stagesCount = 3;
-
_useScreenshots = false;
_firstSizeGame = true;
+
+ _saveFiles[0].destName = new char[strlen(targetName) + 5];
+ _saveFiles[1].destName = _saveFiles[0].destName;
+ _saveFiles[2].destName = 0;
+ _saveFiles[3].destName = new char[strlen(targetName) + 5];
+ _saveFiles[4].destName = 0;
+ _saveFiles[5].destName = 0;
+
+ sprintf(_saveFiles[0].destName, "%s.s00", targetName);
+ sprintf(_saveFiles[3].destName, "%s.blo", targetName);
+
+ _varSize = 0;
+ _hasIndex = false;
+ memset(_propBuffer, 0, 1000);
}
-SaveType SaveLoad_v3::getSaveType(const char *fileName) {
- const char *backSlash;
- if ((backSlash = strrchr(fileName, '\\')))
- fileName = backSlash + 1;
-
- if (!scumm_stricmp(fileName, "cat.inf"))
- return kSaveGame;
- if (!scumm_stricmp(fileName, "ima.inf"))
- return kSaveScreenshot;
- if (!scumm_stricmp(fileName, "intro.$$$"))
- return kSaveTempSprite;
- if (!scumm_stricmp(fileName, "bloc.inf"))
- return kSaveNotes;
- if (!scumm_stricmp(fileName, "prot"))
- return kSaveIgnore;
- if (!scumm_stricmp(fileName, "config"))
- return kSaveIgnore;
-
- return kSaveNone;
+SaveLoad_v3::~SaveLoad_v3() {
+ delete[] _saveFiles[0].destName;
+ delete[] _saveFiles[3].destName;
}
-uint32 SaveLoad_v3::getSaveGameSize() {
- uint32 size;
+SaveLoad::SaveMode SaveLoad_v3::getSaveMode(const char *fileName) {
+ fileName = stripPath(fileName);
- size = 1040 + (READ_LE_UINT32(_vm->_game->_totFileData + 0x2C) * 4) * 2;
- if (_useScreenshots)
- size += _screenshotSize;
+ for (int i = 0; i < ARRAYSIZE(_saveFiles); i++)
+ if (!scumm_stricmp(fileName, _saveFiles[i].sourceName))
+ return _saveFiles[i].mode;
- return size;
+ return kSaveModeNone;
+}
+
+int SaveLoad_v3::getSaveType(const char *fileName) {
+ for (int i = 0; i < ARRAYSIZE(_saveFiles); i++)
+ if (!scumm_stricmp(fileName, _saveFiles[i].sourceName))
+ return i;
+
+ return -1;
+}
+
+int32 SaveLoad_v3::getSizeVersioned(int type) {
+ assertInited();
+
+ switch (_saveFiles[type].type) {
+ case kSaveGame:
+ return getSizeGame(_saveFiles[type]);
+ case kSaveTempSprite:
+ return getSizeTempSprite(_saveFiles[type]);
+ case kSaveNotes:
+ return getSizeNotes(_saveFiles[type]);
+ case kSaveScreenshot:
+ return getSizeScreenshot(_saveFiles[type]);
+ default:
+ break;
+ }
+
+ return -1;
+}
+
+bool SaveLoad_v3::loadVersioned(int type, int16 dataVar, int32 size, int32 offset) {
+ assertInited();
+
+ switch (_saveFiles[type].type) {
+ case kSaveGame:
+ if (loadGame(_saveFiles[type], dataVar, size, offset))
+ return true;
+
+ warning("While loading from slot %d", getSlot(offset));
+ break;
+
+ case kSaveTempSprite:
+ if(loadTempSprite(_saveFiles[type], dataVar, size, offset))
+ return true;
+
+ warning("While loading the temporary sprite");
+ break;
+
+ case kSaveNotes:
+ if (loadNotes(_saveFiles[type], dataVar, size, offset))
+ return true;
+
+ warning("While loading the notes");
+ break;
+
+ case kSaveScreenshot:
+ if (loadScreenshot(_saveFiles[type], dataVar, size, offset))
+ return true;
+
+ warning("While loading a screenshot");
+ break;
+
+ default:
+ break;
+ }
+
+ return false;
}
-int32 SaveLoad_v3::getSizeGame() {
+bool SaveLoad_v3::saveVersioned(int type, int16 dataVar, int32 size, int32 offset) {
+ assertInited();
+
+ switch (_saveFiles[type].type) {
+ case kSaveGame:
+ if (saveGame(_saveFiles[type], dataVar, size, offset))
+ return true;
+
+ warning("While saving to slot %d", getSlot(offset));
+ break;
+
+ case kSaveTempSprite:
+ if(saveTempSprite(_saveFiles[type], dataVar, size, offset))
+ return true;
+
+ warning("While saving the temporary sprite");
+ break;
+
+ case kSaveNotes:
+ if (saveNotes(_saveFiles[type], dataVar, size, offset))
+ return true;
+
+ warning("While saving the notes");
+ break;
+
+ case kSaveScreenshot:
+ if (saveScreenshot(_saveFiles[type], dataVar, size, offset))
+ return true;
+
+ warning("While saving a screenshot");
+ break;
+
+ default:
+ break;
+ }
+
+ return false;
+}
+
+int SaveLoad_v3::getSlot(int32 offset) const {
+ return ((offset - 1700) / _varSize);
+}
+
+int SaveLoad_v3::getSlotRemainder(int32 offset) const {
+ return ((offset - 1700) % _varSize);
+}
+
+int32 SaveLoad_v3::getSizeGame(SaveFile &saveFile) {
if (_firstSizeGame) {
_firstSizeGame = false;
return -1;
@@ -89,358 +208,403 @@ int32 SaveLoad_v3::getSizeGame() {
Common::InSaveFile *in;
int32 size = -1;
- int slot = _curSlot;
+ int slot = saveFile.slot;
for (int i = 29; i >= 0; i--) {
- in = saveMan->openForLoading(setCurSlot(i));
+ in = saveMan->openForLoading(setCurrentSlot(saveFile.destName, i));
if (in) {
delete in;
- size = (i + 1) * READ_LE_UINT32(_vm->_game->_totFileData + 0x2C) *
- 4 + 1700;
+ size = (i + 1) * _varSize + 1700;
break;
}
}
- setCurSlot(slot);
+ setCurrentSlot(saveFile.destName, slot);
return size;
}
-int32 SaveLoad_v3::getSizeScreenshot() {
+int32 SaveLoad_v3::getSizeTempSprite(SaveFile &saveFile) {
+ return _tmpSprite.getSize();
+}
+
+int32 SaveLoad_v3::getSizeNotes(SaveFile &saveFile) {
Common::SaveFileManager *saveMan = g_system->getSavefileManager();
Common::InSaveFile *in;
int32 size = -1;
- _useScreenshots = true;
- int slot = _curSlot;
+ in = saveMan->openForLoading(saveFile.destName);
+ if (in) {
+ size = in->size();
+ delete in;
+ }
+
+ return size;
+}
+
+int32 SaveLoad_v3::getSizeScreenshot(SaveFile &saveFile) {
+ if (!_useScreenshots) {
+ _useScreenshots = true;
+ _save.addStage(_screenshotSize, false);
+ }
+
+ Common::SaveFileManager *saveMan = g_system->getSavefileManager();
+ Common::InSaveFile *in;
+ int32 size = -1;
+
+ int slot = saveFile.slot;
for (int i = 29; i >= 0; i--) {
- in = saveMan->openForLoading(setCurSlot(i));
+ in = saveMan->openForLoading(setCurrentSlot(saveFile.destName, i));
if (in) {
delete in;
size = (i + 1) * _screenshotSize + _screenshotOffset;
break;
}
}
- setCurSlot(slot);
+ setCurrentSlot(saveFile.destName, slot);
return size;
}
-bool SaveLoad_v3::loadGame(int16 dataVar, int32 size, int32 offset) {
- int32 varSize = READ_LE_UINT32(_vm->_game->_totFileData + 0x2C) * 4;
- Common::SaveFileManager *saveMan = g_system->getSavefileManager();
- Common::InSaveFile *in;
+bool SaveLoad_v3::loadGame(SaveFile &saveFile,
+ int16 dataVar, int32 size, int32 offset) {
- int slot = (offset - 1700) / varSize;
- int slotR = (offset - 1700) % varSize;
-
- initBuffer();
+ if (size == 0) {
+ dataVar = 0;
+ size = _varSize;
+ }
- if ((size > 0) && (offset < 500) && ((size + offset) <= 500)) {
+ if (offset < 500) {
+ debugC(3, kDebugSaveLoad, "Loading global properties");
- memcpy(_vm->_global->_inter_variables + dataVar,
- _buffer[0] + offset, size);
- memcpy(_vm->_global->_inter_variablesSizes + dataVar,
- _buffer[0] + offset + 500, size);
- return true;
+ if ((size + offset) > 500) {
+ warning("Wrong global properties list size (%d, %d)", size, offset);
+ return false;
+ }
- } else if ((size == 1200) && (offset == 500)) {
+ _vm->_inter->_variables->copyFrom(dataVar,
+ _propBuffer + offset, _propBuffer + offset + 500, size);
- memset(_buffer[1], 0, 1200);
+ } else if (offset == 500) {
+ debugC(3, kDebugSaveLoad, "Loading save index");
- slot = _curSlot;
- for (int i = 0; i < 30; i++) {
- in = saveMan->openForLoading(setCurSlot(i));
- if (in) {
- in->seek(1000);
- in->read(_buffer[1] + i * 40, 40);
- delete in;
- }
+ if (size != 1200) {
+ warning("Requested index has wrong size (%d)", size);
+ return false;
}
- setCurSlot(slot);
- memcpy(_vm->_global->_inter_variables + dataVar, _buffer[1], 1200);
- memset(_vm->_global->_inter_variablesSizes + dataVar, 0, 1200);
- return true;
+ int slot = saveFile.slot;
+
+ SaveLoad::buildIndex(_vm->_inter->_variables->getAddressOff8(dataVar, 1200),
+ saveFile.destName, 30, 40, 1000);
- } else if ((offset > 0) && (slot < 30) &&
- (slotR == 0) && (size == 0)) {
+ setCurrentSlot(saveFile.destName, slot);
- in = saveMan->openForLoading(setCurSlot(slot));
- if (!in) {
- warning("Can't open file for slot %d", slot);
+ } else {
+ saveFile.slot = getSlot(offset);
+ int slotRem = getSlotRemainder(offset);
+
+ debugC(2, kDebugSaveLoad, "Loading from slot %d", saveFile.slot);
+
+ SaveLoad::setCurrentSlot(saveFile.destName, saveFile.slot);
+
+ if ((saveFile.slot < 0) || (saveFile.slot >= 30) || (slotRem != 0)) {
+ warning("Invalid loading procedure (%d, %d, %d, %d, %d)",
+ dataVar, size, offset, saveFile.slot, slotRem);
return false;
}
- uint32 sGameSize = getSaveGameSize();
- uint32 fSize = in->size();
- if (fSize != sGameSize) {
- warning("Can't load from slot %d: Wrong size (%d, %d)", slot,
- fSize, sGameSize);
- delete in;
+ if (!_save.load(dataVar, size, 540, saveFile.destName, _vm->_inter->_variables))
return false;
- }
+ }
- byte varBuf[500], sizeBuf[500];
- if (read(*in, varBuf, sizeBuf, 500) == 500) {
- if (fromEndian(varBuf, sizeBuf, 500)) {
- memcpy(_buffer[0], varBuf, 500);
- memcpy(_buffer[0] + 500, sizeBuf, 500);
- in->seek(1040);
- if (loadDataEndian(*in, 0, varSize)) {
- delete in;
- debugC(1, kDebugFileIO, "Loading from slot %d", slot);
- return true;
- }
- }
- }
- delete in;
+ return true;
+}
- } else
- warning("Invalid loading procedure (%d, %d, %d, %d)",
- offset, size, slot, slotR);
+bool SaveLoad_v3::loadTempSprite(SaveFile &saveFile,
+ int16 dataVar, int32 size, int32 offset) {
- return false;
+ debugC(3, kDebugSaveLoad, "Loading from the temporary sprite");
+
+ int index;
+ bool palette;
+
+ if (!_tmpSprite.getProperties(dataVar, size, offset, index, palette))
+ return false;
+
+ if (!_tmpSprite.loadSprite(*_vm->_draw->_spritesArray[index]))
+ return false;
+
+ if (palette) {
+ if (!_tmpSprite.loadPalette(_vm->_global->_pPaletteDesc->vgaPal))
+ return false;
+
+ _vm->_video->setFullPalette(_vm->_global->_pPaletteDesc);
+ }
+
+ if (index == 21) {
+ _vm->_draw->forceBlit();
+ _vm->_video->retrace();
+ }
+
+ return true;
}
-bool SaveLoad_v3::loadScreenshot(int16 dataVar, int32 size, int32 offset) {
- Common::SaveFileManager *saveMan = g_system->getSavefileManager();
- Common::InSaveFile *in;
+bool SaveLoad_v3::loadNotes(SaveFile &saveFile,
+ int16 dataVar, int32 size, int32 offset) {
- int slot = (offset - _screenshotOffset) / _screenshotSize;
- int slotR = (offset - _screenshotOffset) % _screenshotSize;
+ debugC(2, kDebugSaveLoad, "Loading the notes");
- _useScreenshots = true;
- if ((size == 40) && (offset == _indexOffset)) {
- char buf[40];
+ return _notes.load(dataVar, size, offset, saveFile.destName, _vm->_inter->_variables);
+}
- memset(buf, 0, 40);
+bool SaveLoad_v3::loadScreenshot(SaveFile &saveFile,
+ int16 dataVar, int32 size, int32 offset) {
- slot = _curSlot;
- for (int i = 0; i < 30; i++) {
- in = saveMan->openForLoading(setCurSlot(i));
- if (in) {
- delete in;
- buf[i] = 1;
- }
+ debugC(3, kDebugSaveLoad, "Loading a screenshot");
+
+ if (!_useScreenshots) {
+ _useScreenshots = true;
+ _save.addStage(_screenshotSize, false);
+ }
+
+ if (offset == _indexOffset) {
+ if (size != 40) {
+ warning("Requested index has wrong size (%d)", size);
+ return false;
}
- setCurSlot(slot);
- memcpy(_vm->_global->_inter_variables + dataVar, buf, 40);
- memset(_vm->_global->_inter_variablesSizes + dataVar, 0, 40);
- return true;
+ byte buffer[40];
+ memset(buffer, 0, 40);
+
+ int slot = saveFile.slot;
+ buildScreenshotIndex(buffer, saveFile.destName, 30);
+ setCurrentSlot(saveFile.destName, slot);
- } else if ((offset > 0) && (slot < 30) &&
- (slotR == 0) && (size < 0)) {
+ memcpy(_vm->_inter->_variables->getAddressOff8(dataVar, 40), buffer, 40);
- int32 varSize = READ_LE_UINT32(_vm->_game->_totFileData + 0x2C) * 4;
+ } else {
+ saveFile.slot = (offset - _screenshotOffset) / _screenshotSize;
+ int slotRem = (offset - _screenshotOffset) % _screenshotSize;
- in = saveMan->openForLoading(setCurSlot(slot));
- if (!in) {
- warning("Can't open file for slot %d", slot);
+ SaveLoad::setCurrentSlot(saveFile.destName, saveFile.slot);
+
+ if ((saveFile.slot < 0) || (saveFile.slot >= 30) || (slotRem != 0)) {
+ warning("Invalid loading procedure (%d, %d, %d, %d, %d)",
+ dataVar, size, offset, saveFile.slot, slotRem);
return false;
}
- uint32 sGameSize = getSaveGameSize();
- uint32 fSize = in->size();
- if (fSize != sGameSize) {
- warning("Can't load screenshot from slot %d: Wrong size (%d, %d)",
- slot, fSize, sGameSize);
- delete in;
+ byte *buffer = new byte[_screenshotSize];
+
+ if (!_save.load(0, _screenshotSize, _varSize + 540, saveFile.destName, buffer, 0)) {
+ delete[] buffer;
return false;
}
- in->seek(1040 + varSize * 2);
+ int index;
+ bool palette;
- bool success = loadSprite(*in, size);
- delete in;
- return success;
+ if (!_screenshot.getProperties(dataVar, size, offset, index, palette)) {
+ delete[] buffer;
+ return false;
+ }
- } else
- warning("Invalid attempt at loading a screenshot (%d, %d, %d, %d)",
- offset, size, slot, slotR);
+ if (!_screenshot.fromBuffer(buffer, _screenshotSize, palette)) {
+ delete[] buffer;
+ return false;
+ }
- return false;
-}
+ if (!_screenshot.loadSprite(*_vm->_draw->_spritesArray[index])) {
+ delete[] buffer;
+ return false;
+ }
-bool SaveLoad_v3::saveGame(int16 dataVar, int32 size, int32 offset) {
- int32 varSize = READ_LE_UINT32(_vm->_game->_totFileData + 0x2C) * 4;
+ if (palette) {
+ if (!_screenshot.loadPalette(_vm->_global->_pPaletteDesc->vgaPal)) {
+ delete[] buffer;
+ return false;
+ }
+ _vm->_video->setFullPalette(_vm->_global->_pPaletteDesc);
+ }
+
+ delete[] buffer;
+ }
- int slot = (offset - 1700) / varSize;
- int slotR = (offset - 1700) % varSize;
+ return true;
+}
- initBuffer();
+bool SaveLoad_v3::saveGame(SaveFile &saveFile,
+ int16 dataVar, int32 size, int32 offset) {
- if ((size > 0) && (offset < 500) && ((size + offset) <= 500)) {
+ if (size == 0) {
+ dataVar = 0;
+ size = _varSize;
+ }
- memcpy(_buffer[0] + offset,
- _vm->_global->_inter_variables + dataVar, size);
- memcpy(_buffer[0] + offset + 500,
- _vm->_global->_inter_variablesSizes + dataVar, size);
+ if (offset < 500) {
+ debugC(3, kDebugSaveLoad, "Loading global properties");
- return true;
+ if ((size + offset) > 500) {
+ warning("Wrong global properties list size (%d, %d)", size, offset);
+ return false;
+ }
- } else if ((size > 0) && (offset >= 500) && (offset < 1700) &&
- ((size + offset) <= 1700)) {
+ _vm->_inter->_variables->copyTo(dataVar,
+ _propBuffer + offset, _propBuffer + offset + 500, size);
- memcpy(_buffer[1] + offset - 500,
- _vm->_global->_inter_variables + dataVar, size);
+ } else if (offset == 500) {
+ debugC(3, kDebugSaveLoad, "Saving save index");
- return true;
+ if (size != 1200) {
+ warning("Requested index has wrong size (%d)", size);
+ return false;
+ }
- } else if ((offset > 0) && (slot < 30) &&
- (slotR == 0) && (size == 0)) {
+ _vm->_inter->_variables->copyTo(dataVar, _indexBuffer, 0, size);
+ _hasIndex = true;
- _saveSlot = -1;
+ } else {
+ saveFile.slot = getSlot(offset);
+ int slotRem = getSlotRemainder(offset);
- delete _buffer[2];
- _buffer[2] = new byte[varSize * 2];
- assert(_buffer[2]);
+ debugC(2, kDebugSaveLoad, "Saving to slot %d", saveFile.slot);
- memcpy(_buffer[2], _vm->_global->_inter_variables, varSize);
- memcpy(_buffer[2] + varSize,
- _vm->_global->_inter_variablesSizes, varSize);
+ SaveLoad::setCurrentSlot(saveFile.destName, saveFile.slot);
- if (!toEndian(_buffer[2], _buffer[2] + varSize, varSize)) {
- delete _buffer[2];
- _buffer[2] = 0;
+ if ((saveFile.slot < 0) || (saveFile.slot >= 30) || (slotRem != 0)) {
+ warning("Invalid saving procedure (%d, %d, %d, %d, %d)",
+ dataVar, size, offset, saveFile.slot, slotRem);
return false;
}
- _saveSlot = slot;
+ if (!_hasIndex) {
+ warning("No index written yet");
+ return false;
+ }
- if (!_useScreenshots)
- return saveGame(0);
+ _hasIndex = false;
- return true;
+ if(!_save.save(0, 500, 0, saveFile.destName, _propBuffer, _propBuffer + 500))
+ return false;
- } else
- warning("Invalid saving procedure (%d, %d, %d, %d)",
- offset, size, slot, slotR);
+ if(!_save.save(0, 40, 500, saveFile.destName, _indexBuffer + (saveFile.slot * 40), 0))
+ return false;
- return false;
-}
+ if (!_save.save(dataVar, size, 540, saveFile.destName, _vm->_inter->_variables))
+ return false;
+
+ }
-bool SaveLoad_v3::saveNotes(int16 dataVar, int32 size, int32 offset) {
- return SaveLoad_v2::saveNotes(dataVar, size - 160, offset);
+ return true;
}
-bool SaveLoad_v3::saveScreenshot(int16 dataVar, int32 size, int32 offset) {
- int slot = (offset - _screenshotOffset) / _screenshotSize;
- int slotR = (offset - _screenshotOffset) % _screenshotSize;
+bool SaveLoad_v3::saveTempSprite(SaveFile &saveFile,
+ int16 dataVar, int32 size, int32 offset) {
- _useScreenshots = true;
+ debugC(3, kDebugSaveLoad, "Saving to the temporary sprite");
- if ((offset < _screenshotOffset) && (size > 0)) {
+ int index;
+ bool palette;
- return true;
+ if (!_tmpSprite.getProperties(dataVar, size, offset, index, palette))
+ return false;
- } else if ((offset > 0) && (slot < 30) &&
- (slotR == 0) && (size < 0)) {
+ if (!_tmpSprite.saveSprite(*_vm->_draw->_spritesArray[index]))
+ return false;
+
+ if (palette)
+ if (!_tmpSprite.savePalette(_vm->_global->_pPaletteDesc->vgaPal))
+ return false;
+
+ return true;
+}
- return saveGame(size);
+bool SaveLoad_v3::saveNotes(SaveFile &saveFile,
+ int16 dataVar, int32 size, int32 offset) {
- } else
- warning("Invalid attempt at saving a screenshot (%d, %d, %d, %d)",
- offset, size, slot, slotR);
+ debugC(2, kDebugSaveLoad, "Saving the notes");
+ return _notes.save(dataVar, size - 160, offset, saveFile.destName, _vm->_inter->_variables);
return false;
}
-bool SaveLoad_v3::saveGame(int32 screenshotSize) {
- int8 slot = _saveSlot;
-
- _saveSlot = -1;
+bool SaveLoad_v3::saveScreenshot(SaveFile &saveFile,
+ int16 dataVar, int32 size, int32 offset) {
- initBuffer();
+ debugC(3, kDebugSaveLoad, "Saving a screenshot");
- if ((slot < 0) || (slot > 29)) {
- warning("Can't save to slot %d: Out of range", slot);
- delete[] _buffer[2];
- _buffer[2] = 0;
- return false;
+ if (!_useScreenshots) {
+ _useScreenshots = true;
+ _save.addStage(_screenshotSize, false);
}
- if (!_buffer[2]) {
- warning("Can't save to slot %d: No data", slot);
- return false;
- }
+ if (offset >= _screenshotOffset) {
- Common::SaveFileManager *saveMan = g_system->getSavefileManager();
- Common::OutSaveFile *out;
+ saveFile.slot = (offset - _screenshotOffset) / _screenshotSize;
+ int slotRem = (offset - _screenshotOffset) % _screenshotSize;
- out = saveMan->openForSaving(setCurSlot(slot));
- if (!out) {
- warning("Can't open file for slot %d for writing", slot);
- delete[] _buffer[2];
- _buffer[2] = 0;
- return false;
- }
+ setCurrentSlot(saveFile.destName, saveFile.slot);
+
+ if ((saveFile.slot < 0) || (saveFile.slot >= 30) || (slotRem != 0)) {
+ warning("Invalid saving procedure (%d, %d, %d, %d, %d)",
+ dataVar, size, offset, saveFile.slot, slotRem);
+ return false;
+ }
- int32 varSize = READ_LE_UINT32(_vm->_game->_totFileData + 0x2C) * 4;
- byte varBuf[500], sizeBuf[500];
+ int index;
+ bool palette;
- memcpy(varBuf, _buffer[0], 500);
- memcpy(sizeBuf, _buffer[0] + 500, 500);
+ if (!_screenshot.getProperties(dataVar, size, offset, index, palette))
+ return false;
- bool retVal = false;
- if (toEndian(varBuf, sizeBuf, 500))
- if (write(*out, varBuf, sizeBuf, 500) == 500)
- if (out->write(_buffer[1] + slot * 40, 40) == 40)
- if (out->write(_buffer[2], varSize * 2) == ((uint32) (varSize * 2))) {
- out->flush();
- if (!out->ioFailed())
- retVal = true;
- }
+ if (!_screenshot.saveSprite(*_vm->_draw->_spritesArray[index]))
+ return false;
- delete[] _buffer[2];
- _buffer[2] = 0;
+ if (palette)
+ if (!_screenshot.savePalette(_vm->_global->_pPaletteDesc->vgaPal))
+ return false;
- if (!retVal) {
- warning("Can't save to slot %d", slot);
- delete out;
- return false;
- }
+
+ byte *buffer = new byte[_screenshotSize];
- if (_useScreenshots) {
- if (screenshotSize >= 0) {
- warning("Can't save to slot %d: Screenshot expected", slot);
- delete out;
+ if (!_screenshot.toBuffer(buffer, _screenshotSize, palette)) {
+ delete[] buffer;
return false;
}
- if (!saveSprite(*out, screenshotSize)) {
- delete out;
+ if (!_save.save(0, _screenshotSize, _varSize + 540, saveFile.destName, buffer, 0)) {
+ delete[] buffer;
return false;
}
- }
- out->finalize();
- if (out->ioFailed()) {
- warning("Can't save to slot %d", slot);
- delete out;
- return false;
+ delete[] buffer;
}
- debugC(1, kDebugFileIO, "Saved to slot %d", slot);
- delete out;
return true;
}
-void SaveLoad_v3::initBuffer() {
- if (_buffer)
+void SaveLoad_v3::assertInited() {
+ if (_varSize > 0)
return;
- _buffer = new byte*[_stagesCount];
-
- assert(_buffer);
+ _varSize = READ_LE_UINT32(_vm->_game->_totFileData + 0x2C) * 4;
- _buffer[0] = new byte[1000];
- _buffer[1] = new byte[1200];
- _buffer[2] = 0;
+ _save.addStage(500);
+ _save.addStage(40, false);
+ _save.addStage(_varSize);
+}
- assert(_buffer[0] && _buffer[1]);
+void SaveLoad_v3::buildScreenshotIndex(byte *buffer, char *name, int n) {
+ Common::SaveFileManager *saveMan = g_system->getSavefileManager();
+ Common::InSaveFile *in;
- memset(_buffer[0], 0, 1000);
- memset(_buffer[1], 0, 1200);
+ memset(buffer, 0, n);
+ for (int i = 0; i < n; i++) {
+ in = saveMan->openForLoading(setCurrentSlot(name, i));
+ if (in) {
+ delete in;
+ buffer[i] = 1;
+ }
+ }
}
} // End of namespace Gob
diff --git a/engines/gob/saveload_v4.cpp b/engines/gob/saveload_v4.cpp
new file mode 100644
index 0000000000..a6548dd82d
--- /dev/null
+++ b/engines/gob/saveload_v4.cpp
@@ -0,0 +1,439 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "common/endian.h"
+
+#include "gob/gob.h"
+#include "gob/saveload.h"
+#include "gob/game.h"
+#include "gob/inter.h"
+
+namespace Gob {
+
+SaveLoad_v4::SaveFile SaveLoad_v4::_saveFiles[] = {
+ { "save.tmp", 0, kSaveModeSave, kSaveScreenProps },
+ { "cat.inf", 0, kSaveModeSave, kSaveGame },
+ { "save0.tmp", 0, kSaveModeSave, kSaveGameScreenProps },
+ { "save1.tmp", 0, kSaveModeSave, kSaveGameScreenProps },
+ { "save2.tmp", 0, kSaveModeSave, kSaveGameScreenProps },
+ { "save3.tmp", 0, kSaveModeSave, kSaveGameScreenProps },
+ { "save4.tmp", 0, kSaveModeSave, kSaveGameScreenProps },
+ { "save5.tmp", 0, kSaveModeSave, kSaveGameScreenProps },
+ { "save6.tmp", 0, kSaveModeSave, kSaveGameScreenProps },
+ { "save7.tmp", 0, kSaveModeSave, kSaveGameScreenProps },
+ { "save8.tmp", 0, kSaveModeSave, kSaveGameScreenProps },
+ { "save9.tmp", 0, kSaveModeSave, kSaveGameScreenProps }
+};
+
+SaveLoad_v4::SaveLoad_v4(GobEngine *vm, const char *targetName) :
+ SaveLoad(vm, targetName) {
+
+ _firstSizeGame = true;
+
+ _saveFiles[0].destName = 0;
+ _saveFiles[1].destName = new char[strlen(targetName) + 5];
+ _saveFiles[2].destName = _saveFiles[1].destName;
+ _saveFiles[3].destName = _saveFiles[1].destName;
+ _saveFiles[4].destName = _saveFiles[1].destName;
+ _saveFiles[5].destName = _saveFiles[1].destName;
+ _saveFiles[6].destName = _saveFiles[1].destName;
+ _saveFiles[7].destName = _saveFiles[1].destName;
+ _saveFiles[8].destName = _saveFiles[1].destName;
+ _saveFiles[9].destName = _saveFiles[1].destName;
+ _saveFiles[10].destName = _saveFiles[1].destName;
+ _saveFiles[11].destName = _saveFiles[1].destName;
+
+ sprintf(_saveFiles[1].destName, "%s.s00", targetName);
+
+ _varSize = 0;
+ _hasIndex = false;
+ memset(_propBuffer, 0, 1000);
+
+ _screenProps = new byte[512000];
+ memset(_screenProps, 0, 512000);
+}
+
+SaveLoad_v4::~SaveLoad_v4() {
+ delete[] _screenProps;
+ delete[] _saveFiles[1].destName;
+}
+
+SaveLoad::SaveMode SaveLoad_v4::getSaveMode(const char *fileName) {
+ fileName = stripPath(fileName);
+
+ for (int i = 0; i < ARRAYSIZE(_saveFiles); i++)
+ if (!scumm_stricmp(fileName, _saveFiles[i].sourceName))
+ return _saveFiles[i].mode;
+
+ return kSaveModeNone;
+}
+
+int SaveLoad_v4::getSaveType(const char *fileName) {
+ for (int i = 0; i < ARRAYSIZE(_saveFiles); i++)
+ if (!scumm_stricmp(fileName, _saveFiles[i].sourceName))
+ return i;
+
+ return -1;
+}
+
+int32 SaveLoad_v4::getSizeVersioned(int type) {
+ assertInited();
+
+ switch (_saveFiles[type].type) {
+ case kSaveScreenProps:
+ return getSizeScreenProps(_saveFiles[type]);
+ case kSaveGame:
+ return getSizeGame(_saveFiles[type]);
+ case kSaveGameScreenProps:
+ return getSizeGameScreenProps(_saveFiles[type]);
+ default:
+ break;
+ }
+
+ return -1;
+}
+
+bool SaveLoad_v4::loadVersioned(int type, int16 dataVar, int32 size, int32 offset) {
+ assertInited();
+
+ switch (_saveFiles[type].type) {
+ case kSaveScreenProps:
+ if (loadScreenProps(_saveFiles[type], dataVar, size, offset))
+ return true;
+
+ warning("While loading screen properties");
+ break;
+
+ case kSaveGame:
+ if (loadGame(_saveFiles[type], dataVar, size, offset))
+ return true;
+
+ warning("While loading from slot %d", getSlot(offset));
+ break;
+
+ case kSaveGameScreenProps:
+ if (loadGameScreenProps(_saveFiles[type], dataVar, size, offset))
+ return true;
+
+ warning("While loading screen properties from slot %d", getSlot(offset));
+ break;
+
+ default:
+ break;
+ }
+
+ return false;
+}
+
+bool SaveLoad_v4::saveVersioned(int type, int16 dataVar, int32 size, int32 offset) {
+ assertInited();
+
+ switch (_saveFiles[type].type) {
+ case kSaveScreenProps:
+ if (saveScreenProps(_saveFiles[type], dataVar, size, offset))
+ return true;
+
+ warning("While saving screen properties");
+ break;
+
+ case kSaveGame:
+ if (saveGame(_saveFiles[type], dataVar, size, offset))
+ return true;
+
+ warning("While saving to slot %d", getSlot(offset));
+ break;
+
+ case kSaveGameScreenProps:
+ if (saveGameScreenProps(_saveFiles[type], dataVar, size, offset))
+ return true;
+
+ warning("While saving screen properties to slot %d", getSlot(offset));
+ break;
+
+ default:
+ break;
+ }
+
+ return false;
+}
+
+int SaveLoad_v4::getSlot(int32 offset) const {
+ return ((offset - 1700) / _varSize);
+}
+
+int SaveLoad_v4::getSlotRemainder(int32 offset) const {
+ return ((offset - 1700) % _varSize);
+}
+
+int32 SaveLoad_v4::getSizeScreenProps(SaveFile &saveFile) {
+ return 256000;
+}
+
+int32 SaveLoad_v4::getSizeGame(SaveFile &saveFile) {
+ if (_firstSizeGame) {
+ _firstSizeGame = false;
+ return -1;
+ }
+
+ Common::SaveFileManager *saveMan = g_system->getSavefileManager();
+ Common::InSaveFile *in;
+ int32 size = -1;
+
+ for (int i = 29; i >= 0; i--) {
+ in = saveMan->openForLoading(setCurrentSlot(saveFile.destName, i));
+ if (in) {
+ delete in;
+ size = (i + 1) * _varSize + 1700;
+ break;
+ }
+ }
+
+ return size;
+}
+
+int32 SaveLoad_v4::getSizeGameScreenProps(SaveFile &saveFile) {
+ return -1;
+
+ Common::SaveFileManager *saveMan = g_system->getSavefileManager();
+ Common::InSaveFile *in;
+
+ setCurrentSlot(saveFile.destName, saveFile.sourceName[4] - '0');
+ in = saveMan->openForLoading(saveFile.destName);
+
+ if (!in)
+ return -1;
+
+ int32 size = in->size();
+
+ delete in;
+
+ return size;
+}
+
+bool SaveLoad_v4::loadScreenProps(SaveFile &saveFile,
+ int16 dataVar, int32 size, int32 offset) {
+
+ // Using a sprite as a buffer
+ if (size <= 0)
+ return true;
+
+ if ((offset < 0) || (size + offset) > 256000) {
+ warning("Invalid size (%d) or offset (%d)", size, offset);
+ return false;
+ }
+
+ debugC(3, kDebugSaveLoad, "Loading screen properties (%d, %d, %d)",
+ dataVar, size, offset);
+
+ _vm->_inter->_variables->copyFrom(dataVar,
+ _screenProps + offset, _screenProps + 256000 + offset, size);
+
+ return true;
+}
+
+bool SaveLoad_v4::loadGame(SaveFile &saveFile,
+ int16 dataVar, int32 size, int32 offset) {
+
+ if (size == 0) {
+ dataVar = 0;
+ size = _varSize;
+ }
+
+ if (offset < 500) {
+ debugC(3, kDebugSaveLoad, "Loading global properties");
+
+ if ((size + offset) > 500) {
+ warning("Wrong global properties list size (%d, %d)", size, offset);
+ return false;
+ }
+
+ _vm->_inter->_variables->copyFrom(dataVar,
+ _propBuffer + offset, _propBuffer + offset + 500, size);
+
+ } else if (offset == 500) {
+ debugC(3, kDebugSaveLoad, "Loading save index");
+
+ if (size != 1200) {
+ warning("Requested index has wrong size (%d)", size);
+ return false;
+ }
+
+ SaveLoad::buildIndex(_vm->_inter->_variables->getAddressOff8(dataVar, 1200),
+ saveFile.destName, 30, 40, 1000);
+
+ } else {
+ int slot = getSlot(offset);
+ int slotRem = getSlotRemainder(offset);
+
+ debugC(2, kDebugSaveLoad, "Loading from slot %d", slot);
+
+ SaveLoad::setCurrentSlot(saveFile.destName, slot);
+
+ if ((slot < 0) || (slot >= 30) || (slotRem != 0)) {
+ warning("Invalid loading procedure (%d, %d, %d, %d, %d)",
+ dataVar, size, offset, slot, slotRem);
+ return false;
+ }
+
+ if (!_save.load(dataVar, size, 540, saveFile.destName, _vm->_inter->_variables))
+ return false;
+ }
+
+ return true;
+}
+
+bool SaveLoad_v4::loadGameScreenProps(SaveFile &saveFile,
+ int16 dataVar, int32 size, int32 offset) {
+
+ if (size != -5) {
+ warning("Invalid loading procedure (%d, %d, %d)", dataVar, size, offset);
+ return false;
+ }
+
+ setCurrentSlot(saveFile.destName, saveFile.sourceName[4] - '0');
+
+ if (!_save.load(0, 256000, _varSize + 540, saveFile.destName,
+ _screenProps, _screenProps + 256000))
+ return false;
+
+ return true;
+}
+
+bool SaveLoad_v4::saveScreenProps(SaveFile &saveFile,
+ int16 dataVar, int32 size, int32 offset) {
+
+ // Using a sprite as a buffer
+ if (size <= 0)
+ return true;
+
+ if ((offset < 0) || (size + offset) > 256000) {
+ warning("Invalid size (%d) or offset (%d)", size, offset);
+ return false;
+ }
+
+ debugC(3, kDebugSaveLoad, "Saving screen properties (%d, %d, %d)",
+ dataVar, size, offset);
+
+ _vm->_inter->_variables->copyTo(dataVar,
+ _screenProps + offset, _screenProps + 256000 + offset, size);
+
+ return true;
+}
+
+bool SaveLoad_v4::saveGame(SaveFile &saveFile,
+ int16 dataVar, int32 size, int32 offset) {
+
+ if (size == 0) {
+ dataVar = 0;
+ size = _varSize;
+ }
+
+ if (offset < 500) {
+ debugC(3, kDebugSaveLoad, "Loading global properties");
+
+ if ((size + offset) > 500) {
+ warning("Wrong global properties list size (%d, %d)", size, offset);
+ return false;
+ }
+
+ _vm->_inter->_variables->copyTo(dataVar,
+ _propBuffer + offset, _propBuffer + offset + 500, size);
+
+ } else if (offset == 500) {
+ debugC(3, kDebugSaveLoad, "Saving save index");
+
+ if (size != 1200) {
+ warning("Requested index has wrong size (%d)", size);
+ return false;
+ }
+
+ _vm->_inter->_variables->copyTo(dataVar, _indexBuffer, 0, size);
+ _hasIndex = true;
+
+ } else {
+ int slot = getSlot(offset);
+ int slotRem = getSlotRemainder(offset);
+
+ debugC(2, kDebugSaveLoad, "Saving to slot %d", slot);
+
+ SaveLoad::setCurrentSlot(saveFile.destName, slot);
+
+ if ((slot < 0) || (slot >= 30) || (slotRem != 0)) {
+ warning("Invalid saving procedure (%d, %d, %d, %d, %d)",
+ dataVar, size, offset, slot, slotRem);
+ return false;
+ }
+
+ if (!_hasIndex) {
+ warning("No index written yet");
+ return false;
+ }
+
+ _hasIndex = false;
+
+ if(!_save.save(0, 500, 0, saveFile.destName, _propBuffer, _propBuffer + 500))
+ return false;
+
+ if(!_save.save(0, 40, 500, saveFile.destName, _indexBuffer + (slot * 40), 0))
+ return false;
+
+ if (!_save.save(dataVar, size, 540, saveFile.destName, _vm->_inter->_variables))
+ return false;
+
+ }
+
+ return true;
+}
+
+bool SaveLoad_v4::saveGameScreenProps(SaveFile &saveFile,
+ int16 dataVar, int32 size, int32 offset) {
+
+ if (size != -5) {
+ warning("Invalid saving procedure (%d, %d, %d)", dataVar, size, offset);
+ return false;
+ }
+
+ setCurrentSlot(saveFile.destName, saveFile.sourceName[4] - '0');
+
+ if (!_save.save(0, 256000, _varSize + 540, saveFile.destName,
+ _screenProps, _screenProps + 256000))
+ return false;
+
+ return true;
+}
+
+void SaveLoad_v4::assertInited() {
+ if (_varSize > 0)
+ return;
+
+ _varSize = READ_LE_UINT32(_vm->_game->_totFileData + 0x2C) * 4;
+
+ _save.addStage(500);
+ _save.addStage(40, false);
+ _save.addStage(_varSize);
+ _save.addStage(256000);
+}
+
+} // End of namespace Gob
diff --git a/engines/gob/scenery.cpp b/engines/gob/scenery.cpp
index 3f9ec9e6f2..6b52cdbbd6 100644
--- a/engines/gob/scenery.cpp
+++ b/engines/gob/scenery.cpp
@@ -23,7 +23,6 @@
*
*/
-
#include "common/endian.h"
#include "common/stream.h"
@@ -101,7 +100,6 @@ int16 Scenery::loadStatic(char search) {
byte *extData = 0;
byte *dataPtr;
Static *ptr;
- int16 pictDescId;
int16 width;
int16 height;
int16 sprResId;
@@ -144,8 +142,6 @@ int16 Scenery::loadStatic(char search) {
dataPtr += 2;
ptr->layers = new StaticLayer[ptr->layersCount];
- ptr->pieces = new PieceDesc*[picsCount];
- ptr->piecesFromExt = new bool[picsCount];
for (int i = 0; i < ptr->layersCount; i++) {
int16 offset = READ_LE_UINT16(dataPtr + i * 2);
@@ -155,9 +151,9 @@ int16 Scenery::loadStatic(char search) {
ptr->layers[i].planes = new StaticPlane[ptr->layers[i].planeCount];
for (int j = 0; j < ptr->layers[i].planeCount; ++j) {
- ptr->layers[i].planes[j].pictIndex = layerData.readSByte();
- ptr->layers[i].planes[j].pieceIndex = layerData.readSByte();
- ptr->layers[i].planes[j].drawOrder = layerData.readSByte();
+ ptr->layers[i].planes[j].pictIndex = layerData.readByte();
+ ptr->layers[i].planes[j].pieceIndex = layerData.readByte();
+ ptr->layers[i].planes[j].drawOrder = layerData.readByte();
ptr->layers[i].planes[j].destX = layerData.readSint16LE();
ptr->layers[i].planes[j].destY = layerData.readSint16LE();
ptr->layers[i].planes[j].transp = layerData.readSByte();
@@ -167,18 +163,13 @@ int16 Scenery::loadStatic(char search) {
backsPtr++;
}
+ ptr->pieces = new PieceDesc*[picsCount];
+ ptr->piecesCount = new uint32[picsCount];
+
for (int i = 0; i < picsCount; i++) {
- pictDescId = _vm->_inter->load16();
+ int16 pictDescId = _vm->_inter->load16();
- if (pictDescId >= 30000) {
- ptr->pieces[i] =
- (PieceDesc *) _vm->_game->loadExtData(pictDescId, 0, 0);
- ptr->piecesFromExt[i] = true;
- } else {
- ptr->pieces[i] =
- (PieceDesc *) _vm->_game->loadTotResource(pictDescId);
- ptr->piecesFromExt[i] = false;
- }
+ loadPieces(pictDescId, ptr->pieces[i], ptr->piecesCount[i]);
width = _vm->_inter->load16();
height = _vm->_inter->load16();
@@ -225,8 +216,7 @@ void Scenery::freeStatic(int16 index) {
return;
for (int i = 0; i < _staticPictCount[index]; i++) {
- if (_statics[index].piecesFromExt[i])
- delete[] _statics[index].pieces[i];
+ delete[] _statics[index].pieces[i];
spr = _staticPictToSprite[index * 7 + i];
_spriteRefs[spr]--;
@@ -240,7 +230,7 @@ void Scenery::freeStatic(int16 index) {
delete[] _statics[index].layers[i].planes;
delete[] _statics[index].layers;
delete[] _statics[index].pieces;
- delete[] _statics[index].piecesFromExt;
+ delete[] _statics[index].piecesCount;
_statics[index].layersCount = 0;
_staticPictCount[index] = -1;
@@ -254,8 +244,8 @@ void Scenery::renderStatic(int16 scenery, int16 layer) {
int16 order;
int16 plane;
- int16 pieceIndex;
- int16 pictIndex;
+ uint16 pieceIndex;
+ uint16 pictIndex;
int16 left;
int16 right;
@@ -278,7 +268,7 @@ void Scenery::renderStatic(int16 scenery, int16 layer) {
}
planeCount = layerPtr->planeCount;
- for (order = 0; order < 40; order++) {
+ for (order = 0; order < 100; order++) {
for (plane = 0, planePtr = layerPtr->planes;
plane < planeCount; plane++, planePtr++) {
if (planePtr->drawOrder != order)
@@ -287,12 +277,21 @@ void Scenery::renderStatic(int16 scenery, int16 layer) {
pieceIndex = planePtr->pieceIndex;
pictIndex = planePtr->pictIndex - 1;
+ if (pictIndex >= _staticPictCount[scenery])
+ continue;
+
+ if (!ptr->pieces || !ptr->pieces[pictIndex])
+ continue;
+
+ if (pieceIndex >= ptr->piecesCount[pictIndex])
+ continue;
+
_vm->_draw->_destSpriteX = planePtr->destX;
_vm->_draw->_destSpriteY = planePtr->destY;
- left = FROM_LE_16(ptr->pieces[pictIndex][pieceIndex].left);
- right = FROM_LE_16(ptr->pieces[pictIndex][pieceIndex].right);
- top = FROM_LE_16(ptr->pieces[pictIndex][pieceIndex].top);
- bottom = FROM_LE_16(ptr->pieces[pictIndex][pieceIndex].bottom);
+ left = ptr->pieces[pictIndex][pieceIndex].left;
+ right = ptr->pieces[pictIndex][pieceIndex].right;
+ top = ptr->pieces[pictIndex][pieceIndex].top;
+ bottom = ptr->pieces[pictIndex][pieceIndex].bottom;
_vm->_draw->_sourceSurface =
_staticPictToSprite[scenery * 7 + pictIndex];
@@ -314,8 +313,8 @@ void Scenery::updateStatic(int16 orderFrom, byte index, byte layer) {
int16 planeCount;
int16 order;
int16 plane;
- int16 pieceIndex;
- int16 pictIndex;
+ uint16 pieceIndex;
+ uint16 pictIndex;
int16 left;
int16 right;
@@ -330,7 +329,7 @@ void Scenery::updateStatic(int16 orderFrom, byte index, byte layer) {
planeCount = layerPtr->planeCount;
- for (order = orderFrom; order < 40; order++) {
+ for (order = orderFrom; order < 100; order++) {
for (planePtr = layerPtr->planes, plane = 0;
plane < planeCount; plane++, planePtr++) {
if (planePtr->drawOrder != order)
@@ -338,13 +337,23 @@ void Scenery::updateStatic(int16 orderFrom, byte index, byte layer) {
pieceIndex = planePtr->pieceIndex;
pictIndex = planePtr->pictIndex - 1;
+
+ if (pictIndex >= _staticPictCount[index])
+ continue;
+
+ if (!pictPtr || !pictPtr[pictIndex])
+ continue;
+
+ if (pieceIndex >= _statics[index].piecesCount[pictIndex])
+ continue;
+
_vm->_draw->_destSpriteX = planePtr->destX;
_vm->_draw->_destSpriteY = planePtr->destY;
- left = FROM_LE_16(pictPtr[pictIndex][pieceIndex].left);
- right = FROM_LE_16(pictPtr[pictIndex][pieceIndex].right);
- top = FROM_LE_16(pictPtr[pictIndex][pieceIndex].top);
- bottom = FROM_LE_16(pictPtr[pictIndex][pieceIndex].bottom);
+ left = pictPtr[pictIndex][pieceIndex].left;
+ right = pictPtr[pictIndex][pieceIndex].right;
+ top = pictPtr[pictIndex][pieceIndex].top;
+ bottom = pictPtr[pictIndex][pieceIndex].bottom;
if (_vm->_draw->_destSpriteX > _toRedrawRight)
continue;
@@ -415,7 +424,6 @@ int16 Scenery::loadAnim(char search) {
byte *extData;
byte *dataPtr;
Animation *ptr;
- int16 pictDescId;
int16 width;
int16 height;
int16 sprResId;
@@ -454,9 +462,6 @@ int16 Scenery::loadAnim(char search) {
dataPtr += 2;
ptr->layers = new AnimLayer[ptr->layersCount];
- ptr->pieces = new PieceDesc*[picsCount];
- ptr->piecesFromExt = new bool[picsCount];
- ptr->sizes = new uint16[picsCount];
for (i = 0; i < ptr->layersCount; i++) {
int16 offset = READ_LE_UINT16(dataPtr + i * 2);
@@ -492,23 +497,13 @@ int16 Scenery::loadAnim(char search) {
}
}
+ ptr->pieces = new PieceDesc*[picsCount];
+ ptr->piecesCount = new uint32[picsCount];
+
for (i = 0; i < picsCount; i++) {
- pictDescId = _vm->_inter->load16();
- if (pictDescId >= 30000) {
- uint32 size;
-
- ptr->pieces[i] =
- (PieceDesc *) _vm->_game->loadExtData(pictDescId, 0, 0, &size);
- ptr->piecesFromExt[i] = true;
- ptr->sizes[i] = size / 8;
- } else {
- int16 size;
+ int16 pictDescId = _vm->_inter->load16();
- ptr->pieces[i] =
- (PieceDesc *) _vm->_game->loadTotResource(pictDescId, &size);
- ptr->piecesFromExt[i] = false;
- ptr->sizes[i] = size / 8;
- }
+ loadPieces(pictDescId, ptr->pieces[i], ptr->piecesCount[i]);
width = _vm->_inter->load16();
height = _vm->_inter->load16();
@@ -554,8 +549,7 @@ void Scenery::freeAnim(int16 index) {
return;
for (int i = 0; i < _animPictCount[index]; i++) {
- if (_animations[index].piecesFromExt[i])
- delete[] _animations[index].pieces[i];
+ delete[] _animations[index].pieces[i];
spr = _animPictToSprite[index * 7 + i];
_spriteRefs[spr]--;
@@ -569,8 +563,7 @@ void Scenery::freeAnim(int16 index) {
delete[] _animations[index].layers[i].frames;
delete[] _animations[index].layers;
delete[] _animations[index].pieces;
- delete[] _animations[index].piecesFromExt;
- delete[] _animations[index].sizes;
+ delete[] _animations[index].piecesCount;
_animPictCount[index] = 0;
}
@@ -620,8 +613,8 @@ void Scenery::updateAnim(int16 layer, int16 frame, int16 animation, int16 flags,
Mult::Mult_Object &obj = _vm->_mult->_objects[-animation - 1];
- if (!_vm->_vidPlayer->slotIsOpen(obj.videoSlot - 1)) {
- _toRedrawLeft = -1234;
+ if ((obj.videoSlot == 0) || !_vm->_vidPlayer->slotIsOpen(obj.videoSlot - 1)) {
+ _toRedrawLeft = -12345;
return;
}
@@ -629,8 +622,17 @@ void Scenery::updateAnim(int16 layer, int16 frame, int16 animation, int16 flags,
frame = _vm->_vidPlayer->getFramesCount(obj.videoSlot - 1) - 1;
// Seek to frame
- while (_vm->_vidPlayer->getCurrentFrame(obj.videoSlot - 1) <= frame)
- _vm->_vidPlayer->slotPlay(obj.videoSlot - 1);
+ if (_vm->_vidPlayer->getCurrentFrame(obj.videoSlot - 1) < 256) {
+ while (_vm->_vidPlayer->getCurrentFrame(obj.videoSlot - 1) <= frame)
+ _vm->_vidPlayer->slotPlay(obj.videoSlot - 1);
+ } else {
+ int16 curFrame = _vm->_vidPlayer->getCurrentFrame(obj.videoSlot - 1);
+ uint8 frameWrap = curFrame / 256;
+ frame = (frame + 1) % 256;
+
+ while (_vm->_vidPlayer->getCurrentFrame(obj.videoSlot - 1) < (frameWrap * 256 + frame))
+ _vm->_vidPlayer->slotPlay(obj.videoSlot - 1);
+ }
destX = 0;
destY = 0;
@@ -724,7 +726,7 @@ void Scenery::updateAnim(int16 layer, int16 frame, int16 animation, int16 flags,
}
- if (flags & 4) {
+ if (!(flags & 4)) {
_animLeft = _toRedrawLeft = left;
_animTop = _toRedrawTop = top;
_animRight = _toRedrawRight = right;
@@ -812,20 +814,19 @@ void Scenery::updateAnim(int16 layer, int16 frame, int16 animation, int16 flags,
pictIndex = (pictIndex & 15) - 1;
- if ((pictIndex == 0xFFFF) || (_animPictCount[animation] <= pictIndex)) {
- warning("Scenery::updateAnim: pictIndex out of range");
- return;
- }
+ if (pictIndex >= _animPictCount[animation])
+ continue;
- if (_animations[animation].sizes[pictIndex] <= pieceIndex) {
- warning("Scenery::updateAnim: pieceIndex out of range");
+ if (!pictPtr[pictIndex])
continue;
- }
- left = READ_LE_UINT16(&pictPtr[pictIndex][pieceIndex].left);
- right = READ_LE_UINT16(&pictPtr[pictIndex][pieceIndex].right);
- top = READ_LE_UINT16(&pictPtr[pictIndex][pieceIndex].top);
- bottom = READ_LE_UINT16(&pictPtr[pictIndex][pieceIndex].bottom);
+ if (pieceIndex >= _animations[animation].piecesCount[pictIndex])
+ continue;
+
+ left = pictPtr[pictIndex][pieceIndex].left;
+ right = pictPtr[pictIndex][pieceIndex].right;
+ top = pictPtr[pictIndex][pieceIndex].top;
+ bottom = pictPtr[pictIndex][pieceIndex].bottom;
if (flags & 2) {
if (destX < _vm->_mult->_animLeft) {
@@ -946,4 +947,42 @@ Scenery::AnimLayer *Scenery::getAnimLayer(uint16 index, uint16 layer) {
return &_animations[index].layers[layer];
}
+void Scenery::loadPieces(int16 pictDescId, PieceDesc *&pieceDesc, uint32 &piecesCount) {
+ byte *data;
+ uint32 size;
+ bool fromExt = false;
+
+ if (pictDescId >= 30000) {
+ fromExt = true;
+
+ uint32 eSize;
+
+ data = _vm->_game->loadExtData(pictDescId, 0, 0, &eSize);
+ size = eSize;
+ } else {
+ int16 tSize;
+
+ data = _vm->_game->loadTotResource(pictDescId, &tSize);
+ size = tSize;
+ }
+
+ if (!data)
+ error("Scenery::loadPieces(): Can't load pictDescId %d", pictDescId);
+
+ piecesCount = size / 8;
+ pieceDesc = new PieceDesc[piecesCount];
+
+ Common::MemoryReadStream pieceData(data, size);
+
+ for (uint32 i = 0; i < piecesCount; i++) {
+ pieceDesc[i].left = (int16) pieceData.readUint16LE();
+ pieceDesc[i].right = (int16) pieceData.readUint16LE();
+ pieceDesc[i].top = (int16) pieceData.readUint16LE();
+ pieceDesc[i].bottom = (int16) pieceData.readUint16LE();
+ }
+
+ if (fromExt)
+ delete[] data;
+}
+
} // End of namespace Gob
diff --git a/engines/gob/scenery.h b/engines/gob/scenery.h
index a1a1304d4d..21bf29deda 100644
--- a/engines/gob/scenery.h
+++ b/engines/gob/scenery.h
@@ -34,16 +34,16 @@ public:
#include "common/pack-start.h" // START STRUCT PACKING
struct PieceDesc {
- int16 left; //NOTE:
- int16 right; //These are stored in Little Endian format
- int16 top; //And should be converted by client code when accessed
- int16 bottom; //i.e. use FROM_LE_16()
+ int16 left;
+ int16 right;
+ int16 top;
+ int16 bottom;
} PACKED_STRUCT;
struct StaticPlane {
- int8 pictIndex;
- int8 pieceIndex;
- int8 drawOrder;
+ uint8 pictIndex;
+ uint8 pieceIndex;
+ uint8 drawOrder;
int16 destX;
int16 destY;
int8 transp;
@@ -82,19 +82,16 @@ public:
int16 layersCount;
StaticLayer *layers;
PieceDesc **pieces;
- bool *piecesFromExt;
- Static() : layersCount(0), layers(0), pieces(0),
- piecesFromExt(0) {}
+ uint32 *piecesCount;
+ Static() : layersCount(0), layers(0), pieces(0), piecesCount(0) {}
};
struct Animation {
int16 layersCount;
AnimLayer *layers;
PieceDesc **pieces;
- bool *piecesFromExt;
- uint16 *sizes;
- Animation() : layersCount(0), layers(0), pieces(0),
- piecesFromExt(0) {}
+ uint32 *piecesCount;
+ Animation() : layersCount(0), layers(0), pieces(0), piecesCount(0) {}
};
int16 _curStatic;
@@ -151,6 +148,8 @@ protected:
GobEngine *_vm;
+ void loadPieces(int16 pictDescId, PieceDesc *&pieceDesc, uint32 &piecesCount);
+
void updateStatic(int16 orderFrom, byte index, byte layer);
};
diff --git a/engines/gob/scenery_v1.cpp b/engines/gob/scenery_v1.cpp
index 5d3eb15a95..605b098693 100644
--- a/engines/gob/scenery_v1.cpp
+++ b/engines/gob/scenery_v1.cpp
@@ -23,13 +23,12 @@
*
*/
-
#include "common/endian.h"
#include "gob/gob.h"
#include "gob/scenery.h"
#include "gob/util.h"
-#include "gob/cdrom.h"
+#include "gob/sound/sound.h"
namespace Gob {
@@ -37,11 +36,11 @@ Scenery_v1::Scenery_v1(GobEngine *vm) : Scenery(vm) {
}
int16 Scenery_v1::loadAnim(char search) {
- if (_vm->_cdrom->_cdPlaying) {
- while (_vm->_cdrom->getTrackPos() != -1)
+ if (_vm->_sound->cdIsPlaying()) {
+ while (_vm->_sound->cdGetTrackPos() != -1)
_vm->_util->longDelay(50);
- _vm->_cdrom->_cdPlaying = false;
+ _vm->_sound->cdStop();
}
return Scenery::loadAnim(search);
diff --git a/engines/gob/scenery_v2.cpp b/engines/gob/scenery_v2.cpp
index 6ed377af64..1a0de6f291 100644
--- a/engines/gob/scenery_v2.cpp
+++ b/engines/gob/scenery_v2.cpp
@@ -23,7 +23,6 @@
*
*/
-
#include "common/endian.h"
#include "gob/gob.h"
diff --git a/engines/gob/sound.cpp b/engines/gob/sound.cpp
deleted file mode 100644
index 6b227cfb0e..0000000000
--- a/engines/gob/sound.cpp
+++ /dev/null
@@ -1,374 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- *
- */
-
-
-#include "common/endian.h"
-
-#include "gob/gob.h"
-#include "gob/sound.h"
-#include "gob/global.h"
-#include "gob/util.h"
-#include "gob/dataio.h"
-#include "gob/game.h"
-
-namespace Gob {
-
-void SoundDesc::set(SoundType type, SoundSource src,
- byte *data, uint32 dSize) {
-
- free();
-
- _type = type;
- _source = src;
- _data = _dataPtr = data;
- _size = dSize;
-}
-
-void SoundDesc::load(SoundType type, SoundSource src,
- byte *data, uint32 dSize) {
-
- free();
-
- _source = src;
- switch (type) {
- case SOUND_ADL:
- loadADL(data, dSize);
- break;
- case SOUND_SND:
- loadSND(data, dSize);
- break;
- }
-}
-
-void SoundDesc::free() {
- if (_source != SOUND_TOT)
- delete[] _data;
- _data = _dataPtr = 0;
- _id = 0;
-}
-
-void SoundDesc::convToSigned() {
- if ((_type == SOUND_SND) && _data && _dataPtr)
- for (uint32 i = 0; i < _size; i++)
- _dataPtr[i] ^= 0x80;
-}
-
-void SoundDesc::loadSND(byte *data, uint32 dSize) {
- assert(dSize > 6);
-
- _type = SOUND_SND;
- _data = data;
- _dataPtr = data + 6;
- _frequency = MAX((int16) READ_BE_UINT16(data + 4), (int16) 4700);
- _flag = data[0] ? (data[0] & 0x7F) : 8;
- data[0] = 0;
- _size = MIN(READ_BE_UINT32(data), dSize - 6);
-}
-
-void SoundDesc::loadADL(byte *data, uint32 dSize) {
- _type = SOUND_ADL;
- _data = _dataPtr = data;
- _size = dSize;
-}
-
-Snd::Snd(GobEngine *vm) : _vm(vm) {
- _playingSound = 0;
- _curSoundDesc = 0;
-
- _rate = _vm->_mixer->getOutputRate();
- _end = true;
- _data = 0;
- _length = 0;
- _freq = 0;
- _repCount = 0;
-
- _offset = 0;
- _offsetFrac = 0;
- _offsetInc = 0;
-
- _cur = 0;
- _last = 0;
-
- _fade = false;
- _fadeVol = 65536;
- _fadeVolStep = 0;
- _fadeSamples = 0;
- _curFadeSamples = 0;
-
- _compositionSamples = 0;
- _compositionSampleCount = 0;
- _compositionPos = -1;
-
- _speakerStream = new Audio::PCSpeaker(_vm->_mixer->getOutputRate());
-
- _vm->_mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_handle,
- this, -1, 255, 0, false, true);
- _vm->_mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_speakerHandle,
- _speakerStream, -1, 50, 0, false, true);
-}
-
-Snd::~Snd() {
- // stop permanent streams manually:
-
- // First the speaker stream
- _vm->_mixer->stopHandle(_speakerHandle);
- delete _speakerStream;
-
- // Next, this stream (class Snd is an AudioStream, too)
- _vm->_mixer->stopHandle(_handle);
-}
-
-void Snd::speakerOn(int16 frequency, int32 length) {
- _speakerStream->play(Audio::PCSpeaker::kWaveFormSquare, frequency, length);
-}
-
-void Snd::speakerOff() {
- _speakerStream->stop();
-}
-
-void Snd::speakerOnUpdate(uint32 milis) {
- if (_speakerStream->isPlaying())
- _speakerStream->stop(milis);
-}
-
-void Snd::stopSound(int16 fadeLength, SoundDesc *sndDesc) {
- Common::StackLock slock(_mutex);
-
- if (sndDesc && (sndDesc != _curSoundDesc))
- return;
-
- if (fadeLength <= 0) {
- _data = 0;
- _end = true;
- _playingSound = 0;
- _curSoundDesc = 0;
- return;
- }
-
- _fade = true;
- _fadeVol = 65536;
- _fadeSamples = (int) (fadeLength * (((double) _rate) / 10.0));
- _fadeVolStep = MAX((int32) 1, (int32) (65536 / _fadeSamples));
- _curFadeSamples = 0;
-}
-
-void Snd::setRepeating(int32 repCount) {
- Common::StackLock slock(_mutex);
-
- _repCount = repCount;
-}
-
-void Snd::waitEndPlay(bool interruptible, bool stopComp) {
- if (stopComp)
- _compositionPos = -1;
- while (!_end && !_vm->_quitRequested) {
- if (interruptible && (_vm->_util->checkKey() == 0x11B)) {
- WRITE_VAR(57, -1);
- return;
- }
- _vm->_util->longDelay(200);
- }
- stopSound(0);
-}
-
-void Snd::stopComposition() {
- if (_compositionPos != -1) {
- stopSound(0);
- _compositionPos = -1;
- }
-}
-
-void Snd::nextCompositionPos() {
- int8 slot;
-
- while ((++_compositionPos < 50) &&
- ((slot = _composition[_compositionPos]) != -1)) {
- if ((slot >= 0) && (slot < _compositionSampleCount)) {
- SoundDesc &sample = _compositionSamples[slot];
- if (!sample.empty() && (sample.getType() == SOUND_SND)) {
- setSample(sample, 1, 0, 0);
- return;
- }
- }
- if (_compositionPos == 49)
- _compositionPos = -1;
- }
- _compositionPos = -1;
-}
-
-void Snd::playComposition(int16 *composition, int16 freqVal,
- SoundDesc *sndDescs, int8 sndCount) {
- int i;
-
- waitEndPlay();
- stopComposition();
-
- _compositionSamples = sndDescs ? sndDescs : _vm->_game->_soundSamples;
- _compositionSampleCount = sndCount;
-
- i = -1;
- do {
- i++;
- _composition[i] = composition[i];
- } while ((i < 50) && (composition[i] != -1));
-
- _compositionPos = -1;
- nextCompositionPos();
-}
-
-void Snd::setSample(SoundDesc &sndDesc, int16 repCount, int16 frequency,
- int16 fadeLength) {
-
- if (frequency <= 0)
- frequency = sndDesc._frequency;
-
- _curSoundDesc = &sndDesc;
- sndDesc._repCount = repCount - 1;
- sndDesc._frequency = frequency;
-
- _data = (int8 *) sndDesc.getData();
- _length = sndDesc.size();
- _freq = frequency;
-
- _repCount = repCount;
- _end = false;
- _playingSound = 1;
-
- _offset = 0;
- _offsetFrac = 0;
- _offsetInc = (_freq << FRAC_BITS) / _rate;
-
- _last = _cur;
- _cur = _data[0];
-
- _curFadeSamples = 0;
- if (fadeLength == 0) {
- _fade = false;
- _fadeVol = 65536;
- _fadeSamples = 0;
- _fadeVolStep = 0;
- } else {
- _fade = true;
- _fadeVol = 0;
- _fadeSamples = (int) (fadeLength * (((double) _rate) / 10.0));
- _fadeVolStep = - MAX((int32) 1, (int32) (65536 / _fadeSamples));
- }
-}
-
-bool Snd::loadSample(SoundDesc &sndDesc, const char *fileName) {
- byte *data;
- uint32 size;
-
- data = (byte *) _vm->_dataIO->getData(fileName);
- if (!data)
- return false;
-
- size = _vm->_dataIO->getDataSize(fileName);
- sndDesc.load(SOUND_SND, SOUND_FILE, data, size);
-
- return true;
-}
-
-void Snd::freeSample(SoundDesc &sndDesc) {
- stopSound(0, &sndDesc);
- sndDesc.free();
-}
-
-void Snd::playSample(SoundDesc &sndDesc, int16 repCount, int16 frequency,
- int16 fadeLength) {
- Common::StackLock slock(_mutex);
-
- if (!_end)
- return;
-
- setSample(sndDesc, repCount, frequency, fadeLength);
-}
-
-void Snd::checkEndSample() {
- if (_compositionPos != -1)
- nextCompositionPos();
- else if ((_repCount == -1) || (--_repCount > 0)) {
- _offset = 0;
- _offsetFrac = 0;
- _end = false;
- _playingSound = 1;
- } else {
- _end = true;
- _playingSound = 0;
- }
-}
-
-int Snd::readBuffer(int16 *buffer, const int numSamples) {
- Common::StackLock slock(_mutex);
-
- for (int i = 0; i < numSamples; i++) {
- if (!_data)
- return i;
- if (_end || (_offset >= _length))
- checkEndSample();
- if (_end)
- return i;
-
- // Linear interpolation. See sound/rate.cpp
-
- int16 val = (_last + (((_cur - _last) * _offsetFrac +
- FRAC_HALF) >> FRAC_BITS)) << 8;
- *buffer++ = (val * _fadeVol) >> 16;
-
- _offsetFrac += _offsetInc;
-
- // Was there an integral change?
- if (fracToInt(_offsetFrac) > 0) {
- _last = _cur;
- _cur = _data[_offset];
- _offset += fracToInt(_offsetFrac);
- _offsetFrac &= FRAC_LO_MASK;
- }
-
- if (_fade) {
-
- if (++_curFadeSamples >= _fadeSamples) {
- if (_fadeVolStep > 0) {
- _data = 0;
- _end = true;
- _playingSound = 0;
- _compositionPos = -1;
- _curSoundDesc = 0;
- } else {
- _fadeVol = 65536;
- _fade = false;
- }
- } else
- _fadeVol -= _fadeVolStep;
-
- if (_fadeVol < 0)
- _fadeVol = 0;
-
- }
- }
- return numSamples;
-}
-
-} // End of namespace Gob
diff --git a/engines/gob/sound.h b/engines/gob/sound.h
deleted file mode 100644
index 6780c201b5..0000000000
--- a/engines/gob/sound.h
+++ /dev/null
@@ -1,172 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- *
- */
-
-#ifndef GOB_SOUND_H
-#define GOB_SOUND_H
-
-#include "common/mutex.h"
-#include "common/frac.h"
-#include "sound/audiostream.h"
-#include "sound/mixer.h"
-#include "sound/softsynth/pcspk.h"
-
-namespace Gob {
-
-enum SoundType {
- SOUND_SND,
- SOUND_ADL
-};
-
-enum SoundSource {
- SOUND_FILE,
- SOUND_TOT,
- SOUND_EXT
-};
-
-class SoundDesc {
-public:
- int16 _repCount;
- int16 _frequency;
- int16 _flag;
- int16 _id;
-
- byte *getData() { return _dataPtr; }
- uint32 size() { return _size; }
- bool empty() { return !_dataPtr; }
- bool isId(int16 id) { return _dataPtr && _id == id; }
- SoundType getType() { return _type; }
-
- void set(SoundType type, SoundSource src, byte *data, uint32 dSize);
- void load(SoundType type, SoundSource src, byte *data, uint32 dSize);
- void free();
- void convToSigned();
-
- // Which fade out length to use when the fade starts half-way through?
- int16 calcFadeOutLength(int16 frequency) {
- return (10 * (_size / 2)) / frequency;
- }
- uint32 calcLength(int16 repCount, int16 frequency, bool fade) {
- uint32 fadeSize = fade ? _size / 2 : 0;
- return ((_size * repCount - fadeSize) * 1000) / frequency;
- }
-
- SoundDesc() : _data(0), _dataPtr(0), _size(0), _type(SOUND_SND),
- _source(SOUND_FILE), _repCount(0), _frequency(0),
- _flag(0), _id(0) {}
- ~SoundDesc() { free(); }
-
-private:
- byte *_data;
- byte *_dataPtr;
- uint32 _size;
-
- SoundType _type;
- SoundSource _source;
-
- void loadSND(byte *data, uint32 dSize);
- void loadADL(byte *data, uint32 dSize);
-};
-
-class Snd : public Audio::AudioStream {
-public:
- char _playingSound;
-
- Snd(GobEngine *vm);
- ~Snd();
-
- void speakerOn(int16 frequency, int32 length);
- void speakerOff();
- void speakerOnUpdate(uint32 milis);
- void stopSound(int16 fadeLength, SoundDesc *sndDesc = 0);
-
- bool loadSample(SoundDesc &sndDesc, const char *fileName);
- void freeSample(SoundDesc &sndDesc);
- void playSample(SoundDesc &sndDesc, int16 repCount,
- int16 frequency, int16 fadeLength = 0);
-
- void playComposition(int16 *composition, int16 freqVal,
- SoundDesc *sndDescs = 0, int8 sndCount = 60);
- void stopComposition();
- void setRepeating(int32 repCount);
- void waitEndPlay(bool interruptible = false, bool stopComp = true);
-
- static void convToSigned(byte *buffer, int length) {
- while (length-- > 0)
- *buffer++ ^= 0x80;
- }
-
- int readBuffer(int16 *buffer, const int numSamples);
- bool isStereo() const { return false; }
- bool endOfData() const { return _end; }
- bool endOfStream() const { return false; }
- int getRate() const { return _rate; }
-
-protected:
- Audio::PCSpeaker *_speakerStream;
- Audio::SoundHandle _speakerHandle;
-
- Audio::SoundHandle *_activeHandle;
- Audio::SoundHandle _compositionHandle;
-
- SoundDesc *_compositionSamples;
- int8 _compositionSampleCount;
- int16 _composition[50];
- int8 _compositionPos;
-
- Audio::SoundHandle _handle;
- Common::Mutex _mutex;
- SoundDesc *_curSoundDesc;
- bool _end;
- int8 *_data;
- uint32 _length;
- uint32 _rate;
- int32 _freq;
- int32 _repCount;
-
- uint32 _offset;
- frac_t _offsetFrac;
- frac_t _offsetInc;
-
- int16 _cur;
- int16 _last;
-
- bool _fade;
- int32 _fadeVol;
- int32 _fadeVolStep;
- uint8 _fadeLength;
- uint32 _fadeSamples;
- uint32 _curFadeSamples;
-
- GobEngine *_vm;
-
- void setSample(SoundDesc &sndDesc, int16 repCount,
- int16 frequency, int16 fadeLength);
- void checkEndSample();
- void nextCompositionPos();
-};
-
-} // End of namespace Gob
-
-#endif // GOB_SOUND_H
diff --git a/engines/gob/music.cpp b/engines/gob/sound/adlib.cpp
index 7be046c02a..b3d392ad1e 100644
--- a/engines/gob/music.cpp
+++ b/engines/gob/sound/adlib.cpp
@@ -24,91 +24,55 @@
*/
#include "common/file.h"
-
#include "common/endian.h"
#include "gob/gob.h"
-#include "gob/music.h"
-#include "gob/game.h"
-#include "gob/util.h"
+#include "gob/sound/adlib.h"
namespace Gob {
-const char *Adlib::_tracks[][2] = {
- {"avt00.tot", "mine"},
- {"avt001.tot", "nuit"},
- {"avt002.tot", "campagne"},
- {"avt003.tot", "extsor1"},
- {"avt004.tot", "interieure"},
- {"avt005.tot", "zombie"},
- {"avt006.tot", "zombie"},
- {"avt007.tot", "campagne"},
- {"avt008.tot", "campagne"},
- {"avt009.tot", "extsor1"},
- {"avt010.tot", "extsor1"},
- {"avt011.tot", "interieure"},
- {"avt012.tot", "zombie"},
- {"avt014.tot", "nuit"},
- {"avt015.tot", "interieure"},
- {"avt016.tot", "statue"},
- {"avt017.tot", "zombie"},
- {"avt018.tot", "statue"},
- {"avt019.tot", "mine"},
- {"avt020.tot", "statue"},
- {"avt021.tot", "mine"},
- {"avt022.tot", "zombie"}
-};
-
-const char *Adlib::_trackFiles[] = {
-// "musmac1.adl", // TODO: This track isn't played correctly at all yet
- "musmac2.adl",
- "musmac3.adl",
- "musmac4.adl",
- "musmac5.adl",
- "musmac6.adl"
-};
-
-const unsigned char Adlib::_operators[] = {0, 1, 2, 8, 9, 10, 16, 17, 18};
-const unsigned char Adlib::_volRegNums[] = {
+const unsigned char AdLib::_operators[] = {0, 1, 2, 8, 9, 10, 16, 17, 18};
+const unsigned char AdLib::_volRegNums[] = {
3, 4, 5,
11, 12, 13,
19, 20, 21
};
-Adlib::Adlib(GobEngine *vm) : _vm(vm) {
- int i;
-
+AdLib::AdLib(Audio::Mixer &mixer) : _mixer(&mixer) {
_index = -1;
_data = 0;
_playPos = 0;
_dataSize = 0;
- _rate = _vm->_mixer->getOutputRate();
+
+ _rate = _mixer->getOutputRate();
_opl = makeAdlibOPL(_rate);
+
_first = true;
_ended = false;
_playing = false;
_needFree = false;
+
_repCount = -1;
_samplesTillPoll = 0;
- for (i = 0; i < 16; i ++)
+ for (int i = 0; i < 16; i ++)
_pollNotes[i] = 0;
setFreqs();
- _vm->_mixer->playInputStream(Audio::Mixer::kMusicSoundType, &_handle,
+ _mixer->playInputStream(Audio::Mixer::kMusicSoundType, &_handle,
this, -1, 255, 0, false, true);
}
-Adlib::~Adlib() {
+AdLib::~AdLib() {
Common::StackLock slock(_mutex);
- _vm->_mixer->stopHandle(_handle);
+ _mixer->stopHandle(_handle);
OPLDestroy(_opl);
if (_data && _needFree)
delete[] _data;
}
-int Adlib::readBuffer(int16 *buffer, const int numSamples) {
+int AdLib::readBuffer(int16 *buffer, const int numSamples) {
Common::StackLock slock(_mutex);
int samples;
int render;
@@ -160,12 +124,12 @@ int Adlib::readBuffer(int16 *buffer, const int numSamples) {
return numSamples;
}
-void Adlib::writeOPL(byte reg, byte val) {
- debugC(6, kDebugMusic, "writeOPL(%02X, %02X)", reg, val);
+void AdLib::writeOPL(byte reg, byte val) {
+ debugC(6, kDebugSound, "writeOPL(%02X, %02X)", reg, val);
OPLWriteReg(_opl, reg, val);
}
-void Adlib::setFreqs() {
+void AdLib::setFreqs() {
byte lin;
byte col;
long val = 0;
@@ -191,7 +155,7 @@ void Adlib::setFreqs() {
}
}
-void Adlib::reset() {
+void AdLib::reset() {
_first = true;
OPLResetChip(_opl);
_samplesTillPoll = 0;
@@ -209,13 +173,13 @@ void Adlib::reset() {
writeOPL(0x01, 0x20);
}
-void Adlib::setVoices() {
+void AdLib::setVoices() {
// Definitions of the 9 instruments
for (int i = 0; i < 9; i++)
setVoice(i, i, true);
}
-void Adlib::setVoice(byte voice, byte instr, bool set) {
+void AdLib::setVoice(byte voice, byte instr, bool set) {
int i;
int j;
uint16 strct[27];
@@ -251,7 +215,7 @@ void Adlib::setVoice(byte voice, byte instr, bool set) {
}
}
-void Adlib::setKey(byte voice, byte note, bool on, bool spec) {
+void AdLib::setKey(byte voice, byte note, bool on, bool spec) {
short freq = 0;
short octa = 0;
@@ -317,12 +281,12 @@ void Adlib::setKey(byte voice, byte note, bool on, bool spec) {
warning("Voice %d, note %02X unknown\n", voice, note);
}
-void Adlib::setVolume(byte voice, byte volume) {
+void AdLib::setVolume(byte voice, byte volume) {
volume = 0x3F - (volume * 0x7E + 0x7F) / 0xFE;
writeOPL(0x40 + _volRegNums[voice], volume);
}
-void Adlib::pollMusic() {
+void AdLib::pollMusic() {
unsigned char instr;
byte channel;
byte note;
@@ -419,24 +383,7 @@ void Adlib::pollMusic() {
_samplesTillPoll = tempo * (_rate / 1000);
}
-void Adlib::playBgMusic() {
- for (int i = 0; i < ARRAYSIZE(_tracks); i++)
- if (!scumm_stricmp(_vm->_game->_curTotFile, _tracks[i][0])) {
- playTrack(_tracks[i][1]);
- break;
- }
-}
-
-void Adlib::playTrack(const char *trackname) {
- if (_playing) return;
-
- debugC(1, kDebugMusic, "Adlib::playTrack(%s)", trackname);
- unload();
- load(_trackFiles[_vm->_util->getRandom(ARRAYSIZE(_trackFiles))]);
- startPlay();
-}
-
-bool Adlib::load(const char *fileName) {
+bool AdLib::load(const char *fileName) {
Common::File song;
unload();
@@ -457,7 +404,7 @@ bool Adlib::load(const char *fileName) {
return true;
}
-void Adlib::load(byte *data, uint32 size, int index) {
+bool AdLib::load(byte *data, uint32 size, int index) {
unload();
_repCount = 0;
@@ -468,9 +415,11 @@ void Adlib::load(byte *data, uint32 size, int index) {
reset();
setVoices();
_playPos = _data + 3 + (_data[1] + 1) * 0x38;
+
+ return true;
}
-void Adlib::unload() {
+void AdLib::unload() {
_playing = false;
_index = -1;
@@ -480,4 +429,29 @@ void Adlib::unload() {
_needFree = false;
}
+bool AdLib::isPlaying() const {
+ return _playing;
+}
+
+bool AdLib::getRepeating() const {
+ return _repCount != 0;
+}
+
+void AdLib::setRepeating(int32 repCount) {
+ _repCount = repCount;
+}
+
+int AdLib::getIndex() const {
+ return _index;
+}
+
+void AdLib::startPlay() {
+ if (_data) _playing = true;
+}
+
+void AdLib::stopPlay() {
+ Common::StackLock slock(_mutex);
+ _playing = false;
+}
+
} // End of namespace Gob
diff --git a/engines/gob/music.h b/engines/gob/sound/adlib.h
index 199ea515b0..4cd83d5883 100644
--- a/engines/gob/music.h
+++ b/engines/gob/sound/adlib.h
@@ -23,8 +23,8 @@
*
*/
-#ifndef GOB_MUSIC_H
-#define GOB_MUSIC_H
+#ifndef GOB_SOUND_ADLIB_H
+#define GOB_SOUND_ADLIB_H
#include "common/mutex.h"
#include "sound/audiostream.h"
@@ -35,61 +35,63 @@ namespace Gob {
class GobEngine;
-class Adlib : public Audio::AudioStream {
+class AdLib : public Audio::AudioStream {
public:
- Adlib(GobEngine *vm);
- ~Adlib();
-
- void lock() { _mutex.lock(); }
- void unlock() { _mutex.unlock(); }
- bool playing() const { return _playing; }
- bool getRepeating() const { return _repCount != 0; }
- void setRepeating (int32 repCount) { _repCount = repCount; }
- int getIndex() const { return _index; }
- void startPlay() { if (_data) _playing = true; }
- void stopPlay() {
- Common::StackLock slock(_mutex);
- _playing = false;
- }
- void playTrack(const char *trackname);
- void playBgMusic();
+ AdLib(Audio::Mixer &mixer);
+ ~AdLib();
+
+ bool isPlaying() const;
+ int getIndex() const;
+ bool getRepeating() const;
+
+ void setRepeating(int32 repCount);
+
+ void startPlay();
+ void stopPlay();
+
bool load(const char *fileName);
- void load(byte *data, uint32 size, int index = -1);
+ bool load(byte *data, uint32 size, int index = -1);
void unload();
// AudioStream API
- int readBuffer(int16 *buffer, const int numSamples);
- bool isStereo() const { return false; }
- bool endOfData() const { return !_playing; }
- bool endOfStream() const { return false; }
- int getRate() const { return _rate; }
+ int readBuffer(int16 *buffer, const int numSamples);
+ bool isStereo() const { return false; }
+ bool endOfData() const { return !_playing; }
+ bool endOfStream() const { return false; }
+ int getRate() const { return _rate; }
protected:
- static const char *_tracks[][2];
- static const char *_trackFiles[];
static const unsigned char _operators[];
static const unsigned char _volRegNums [];
+
+ Audio::Mixer *_mixer;
Audio::SoundHandle _handle;
FM_OPL *_opl;
- int _index;
+
+ Common::Mutex _mutex;
+
+ uint32 _rate;
+
byte *_data;
byte *_playPos;
uint32 _dataSize;
- uint32 _rate;
+
short _freqs[25][12];
byte _notes[11];
byte _notCol[11];
byte _notLin[11];
bool _notOn[11];
byte _pollNotes[16];
+
int _samplesTillPoll;
int32 _repCount;
+
bool _playing;
bool _first;
bool _ended;
bool _needFree;
- Common::Mutex _mutex;
- GobEngine *_vm;
+
+ int _index;
void writeOPL(byte reg, byte val);
void setFreqs();
@@ -103,4 +105,4 @@ protected:
} // End of namespace Gob
-#endif // GOB_MUSIC_H
+#endif // GOB_SOUND_ADLIB_H
diff --git a/engines/gob/sound/bgatmosphere.cpp b/engines/gob/sound/bgatmosphere.cpp
new file mode 100644
index 0000000000..f5a7fe0fdb
--- /dev/null
+++ b/engines/gob/sound/bgatmosphere.cpp
@@ -0,0 +1,128 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "common/system.h"
+#include "common/events.h"
+
+#include "gob/sound/bgatmosphere.h"
+
+namespace Gob {
+
+BackgroundAtmosphere::BackgroundAtmosphere(Audio::Mixer &mixer) :
+ SoundMixer(mixer, Audio::Mixer::kMusicSoundType) {
+
+ _playMode = kPlayModeLinear;
+ _queuePos = -1;
+ _shaded = false;
+
+ g_system->getEventManager()->registerRandomSource(_rnd, "gobBA");
+}
+
+BackgroundAtmosphere::~BackgroundAtmosphere() {
+ queueClear();
+}
+
+void BackgroundAtmosphere::play() {
+ Common::StackLock slock(_mutex);
+
+ _queuePos = -1;
+ getNextQueuePos();
+
+ if (_queuePos == -1)
+ return;
+
+ SoundMixer::play(*_queue[_queuePos], 1, 0);
+}
+
+void BackgroundAtmosphere::stop() {
+ SoundMixer::stop(0);
+}
+
+void BackgroundAtmosphere::setPlayMode(PlayMode mode) {
+ _playMode = mode;
+}
+
+void BackgroundAtmosphere::queueSample(SoundDesc &sndDesc) {
+ Common::StackLock slock(_mutex);
+
+ _queue.push_back(&sndDesc);
+}
+
+void BackgroundAtmosphere::queueClear() {
+ Common::StackLock slock(_mutex);
+
+ SoundMixer::stop(0);
+ for (uint i = 0; i < _queue.size(); i++)
+ delete _queue[i];
+
+ _queue.clear();
+ _queuePos = -1;
+}
+
+void BackgroundAtmosphere::checkEndSample() {
+ Common::StackLock slock(_mutex);
+
+ getNextQueuePos();
+
+ if (_queuePos == -1) {
+ _end = true;
+ _playingSound = 0;
+ } else {
+ SoundMixer::setSample(*_queue[_queuePos], 1, 0, 0);
+ if (_shaded)
+ _fadeVol = 20000;
+ }
+}
+
+void BackgroundAtmosphere::getNextQueuePos() {
+ if (_queue.size() == 0) {
+ _queuePos = -1;
+ return;
+ }
+
+ switch (_playMode) {
+
+ case kPlayModeLinear:
+ _queuePos = (_queuePos + 1) % _queue.size();
+ break;
+
+ case kPlayModeRandom:
+ _queuePos = _rnd.getRandomNumber(_queue.size() - 1);
+ break;
+
+ }
+}
+
+void BackgroundAtmosphere::shade() {
+ _shaded = true;
+ _fadeVol = 32768;
+}
+
+void BackgroundAtmosphere::unshade() {
+ _shaded = false;
+ _fadeVol = 65536;
+}
+
+} // End of namespace Gob
diff --git a/backends/platform/gp32/gp32std_input.h b/engines/gob/sound/bgatmosphere.h
index bd784d3432..72b5614282 100644
--- a/backends/platform/gp32/gp32std_input.h
+++ b/engines/gob/sound/bgatmosphere.h
@@ -23,31 +23,53 @@
*
*/
-#ifndef __GP32STD_INPUT_H
-#define __GP32STD_INPUT_H
+#ifndef GOB_SOUND_BGATMOSPHERE_H
+#define GOB_SOUND_BGATMOSPHERE_H
-#include "common/scummsys.h"
+#include "sound/mixer.h"
+#include "common/mutex.h"
-#define BUTTON_DOWN 1
-#define BUTTON_UP 2
+#include "gob/sound/sounddesc.h"
+#include "gob/sound/soundmixer.h"
-struct GP32BtnEvent {
- uint16 type;
- uint16 button;
-};
+namespace Gob {
+
+class BackgroundAtmosphere : private SoundMixer {
+public:
+ enum PlayMode {
+ kPlayModeLinear,
+ kPlayModeRandom
+ };
+
+ BackgroundAtmosphere(Audio::Mixer &mixer);
+ ~BackgroundAtmosphere();
+
+ void play();
+ void stop();
+
+ void setPlayMode(PlayMode mode);
-extern int gp_trapKey();
+ void queueSample(SoundDesc &sndDesc);
+ void queueClear();
-extern bool gp_getButtonEvent(uint32 *nKeyUD, uint16 *nKeyP);
+ void shade();
+ void unshade();
-#define gpd_getEventDown(a) (((a) >> 12) & 0x0fff)
-#define gpd_getEventUp(a) ((a) & 0x0fff)
-#define gpd_getEventPressed(a) ((a) & 0x0fff)
-#define gpd_getButtonDown(a,button) ((a) & (button) << 12)
-#define gpd_getButtonUp(a,button) ((a) & (button))
-#define gpd_getButtonPressed(a,button) ((a) & (button))
+private:
+ PlayMode _playMode;
+
+ Common::Array<SoundDesc *> _queue;
+ int _queuePos;
+ bool _shaded;
+
+ Common::Mutex _mutex;
+
+ Common::RandomSource _rnd;
+
+ void checkEndSample();
+ void getNextQueuePos();
+};
-extern bool gp_pollButtonEvent(GP32BtnEvent *ev);
-extern bool gp_getButtonPressed(uint16 button);
+} // End of namespace Gob
-#endif
+#endif // GOB_SOUND_BGATMOSPHERE_H
diff --git a/engines/gob/cdrom.cpp b/engines/gob/sound/cdrom.cpp
index c037d24bbe..eef8025cc2 100644
--- a/engines/gob/cdrom.cpp
+++ b/engines/gob/sound/cdrom.cpp
@@ -23,20 +23,16 @@
*
*/
-
#include "common/endian.h"
+#include "common/util.h"
#include "sound/audiocd.h"
#include "gob/gob.h"
-#include "gob/cdrom.h"
-#include "gob/global.h"
-#include "gob/util.h"
-#include "gob/dataio.h"
-#include "gob/game.h"
+#include "gob/sound/cdrom.h"
namespace Gob {
-CDROM::CDROM(GobEngine *vm) : _vm(vm) {
+CDROM::CDROM() {
_cdPlaying = false;
_LICbuffer = 0;
@@ -47,116 +43,46 @@ CDROM::CDROM(GobEngine *vm) : _vm(vm) {
_startTime = 0;
}
-void CDROM::readLIC(const char *fname) {
- char tmp[80];
- int handle;
- uint16 version, startChunk, pos;
+CDROM::~CDROM() {
+}
- freeLICbuffer();
+void CDROM::readLIC(DataStream &stream) {
+ uint16 version, startChunk, pos;
+ freeLICBuffer();
*_curTrack = 0;
- strncpy0(tmp, fname, 79);
-
- handle = _vm->_dataIO->openData(tmp);
-
- if (handle == -1)
- return;
-
- _vm->_dataIO->closeData(handle);
-
- _vm->_dataIO->getUnpackedData(tmp);
-
- handle = _vm->_dataIO->openData(tmp);
- DataStream *stream = _vm->_dataIO->openAsStream(handle, true);
-
- version = stream->readUint16LE();
- startChunk = stream->readUint16LE();
- _numTracks = stream->readUint16LE();
+ version = stream.readUint16LE();
+ startChunk = stream.readUint16LE();
+ _numTracks = stream.readUint16LE();
if (version != 3)
- error("%s: Unknown version %d", fname, version);
+ error("Unknown version %d while reading LIC", version);
- stream->seek(50);
+ stream.seek(50);
for (int i = 0; i < startChunk; i++) {
- pos = stream->readUint16LE();
+ pos = stream.readUint16LE();
if (!pos)
break;
- stream->skip(pos);
+ stream.skip(pos);
}
_LICbuffer = new byte[_numTracks * 22];
- stream->read(_LICbuffer, _numTracks * 22);
-
- delete stream;
+ stream.read(_LICbuffer, _numTracks * 22);
}
-void CDROM::freeLICbuffer() {
+void CDROM::freeLICBuffer() {
delete[] _LICbuffer;
_LICbuffer = 0;
}
-void CDROM::playBgMusic() {
- static const char *tracks[][2] = {
- {"avt00.tot", "mine"},
- {"avt001.tot", "nuit"},
- {"avt002.tot", "campagne"},
- {"avt003.tot", "extsor1"},
- {"avt004.tot", "interieure"},
- {"avt005.tot", "zombie"},
- {"avt006.tot", "zombie"},
- {"avt007.tot", "campagne"},
- {"avt008.tot", "campagne"},
- {"avt009.tot", "extsor1"},
- {"avt010.tot", "extsor1"},
- {"avt011.tot", "interieure"},
- {"avt012.tot", "zombie"},
- {"avt014.tot", "nuit"},
- {"avt015.tot", "interieure"},
- {"avt016.tot", "statue"},
- {"avt017.tot", "zombie"},
- {"avt018.tot", "statue"},
- {"avt019.tot", "mine"},
- {"avt020.tot", "statue"},
- {"avt021.tot", "mine"},
- {"avt022.tot", "zombie"}
- };
-
- for (int i = 0; i < ARRAYSIZE(tracks); i++)
- if (!scumm_stricmp(_vm->_game->_curTotFile, tracks[i][0])) {
- startTrack(tracks[i][1]);
- break;
- }
-}
-
-void CDROM::playMultMusic() {
- static const char *tracks[][6] = {
- {"avt005.tot", "fra1", "all1", "ang1", "esp1", "ita1"},
- {"avt006.tot", "fra2", "all2", "ang2", "esp2", "ita2"},
- {"avt012.tot", "fra3", "all3", "ang3", "esp3", "ita3"},
- {"avt016.tot", "fra4", "all4", "ang4", "esp4", "ita4"},
- {"avt019.tot", "fra5", "all5", "ang5", "esp5", "ita5"},
- {"avt022.tot", "fra6", "all6", "ang6", "esp6", "ita6"}
- };
-
- // Default to "ang?" for other languages (including EN_USA)
- int language = _vm->_global->_language <= 4 ? _vm->_global->_language : 2;
- for (int i = 0; i < ARRAYSIZE(tracks); i++)
- if (!scumm_stricmp(_vm->_game->_curTotFile, tracks[i][0])) {
- startTrack(tracks[i][language + 1]);
- break;
- }
-}
-
void CDROM::startTrack(const char *trackName) {
if (!_LICbuffer)
return;
- debugC(1, kDebugMusic, "CDROM::startTrack(%s)", trackName);
-
byte *matchPtr = getTrackBuffer(trackName);
if (!matchPtr) {
warning("Track \"%s\" not found", trackName);
@@ -175,7 +101,7 @@ void CDROM::startTrack(const char *trackName) {
play(start, end);
- _startTime = _vm->_util->getTimeKey();
+ _startTime = g_system->getMillis();
_trackStop = _startTime + (end - start + 1 + 150) * 40 / 3;
}
@@ -186,17 +112,19 @@ void CDROM::play(uint32 from, uint32 to) {
// HSG encodes frame information into a double word:
// minute multiplied by 4500, plus second multiplied by 75,
// plus frame, minus 150
- debugC(1, kDebugMusic, "CDROM::play(%d, %d)", from, to);
-
AudioCD.play(1, 1, from, to - from + 1);
_cdPlaying = true;
}
-int32 CDROM::getTrackPos(const char *keyTrack) {
+bool CDROM::isPlaying() const {
+ return _cdPlaying;
+}
+
+int32 CDROM::getTrackPos(const char *keyTrack) const {
byte *keyBuffer = getTrackBuffer(keyTrack);
- uint32 curPos = (_vm->_util->getTimeKey() - _startTime) * 3 / 40;
+ uint32 curPos = (g_system->getMillis() - _startTime) * 3 / 40;
- if (_cdPlaying && (_vm->_util->getTimeKey() < _trackStop)) {
+ if (_cdPlaying && (g_system->getMillis() < _trackStop)) {
if (keyBuffer && _curTrackBuffer && (keyBuffer != _curTrackBuffer)) {
uint32 kStart = READ_LE_UINT32(keyBuffer + 12);
uint32 kEnd = READ_LE_UINT32(keyBuffer + 16);
@@ -216,7 +144,7 @@ int32 CDROM::getTrackPos(const char *keyTrack) {
return -1;
}
-const char *CDROM::getCurTrack() {
+const char *CDROM::getCurTrack() const {
return _curTrack;
}
@@ -227,8 +155,6 @@ void CDROM::stopPlaying() {
}
void CDROM::stop() {
- debugC(1, kDebugMusic, "CDROM::stop()");
-
_curTrackBuffer = 0;
AudioCD.stop();
_cdPlaying = false;
@@ -248,7 +174,7 @@ void CDROM::testCD(int trySubst, const char *label) {
// CD secor reading
}
-byte *CDROM::getTrackBuffer(const char *trackName) {
+byte *CDROM::getTrackBuffer(const char *trackName) const {
if (!_LICbuffer || !trackName)
return 0;
diff --git a/engines/gob/cdrom.h b/engines/gob/sound/cdrom.h
index 25490de5dc..201f7adb75 100644
--- a/engines/gob/cdrom.h
+++ b/engines/gob/sound/cdrom.h
@@ -23,29 +23,30 @@
*
*/
-#ifndef GOB_CDROM_H
-#define GOB_CDROM_H
+#ifndef GOB_SOUND_CDROM_H
+#define GOB_SOUND_CDROM_H
+
+#include "gob/dataio.h"
namespace Gob {
class CDROM {
public:
- bool _cdPlaying;
+ CDROM();
+ ~CDROM();
- void readLIC(const char *fname);
- void freeLICbuffer();
+ void readLIC(DataStream &stream);
+ void freeLICBuffer();
void startTrack(const char *trackName);
- void playBgMusic();
- void playMultMusic();
- void play(uint32 from, uint32 to);
- int32 getTrackPos(const char *keyTrack = 0);
- const char *getCurTrack();
void stopPlaying();
- void stop();
- void testCD(int trySubst, const char *label);
- CDROM(GobEngine *vm);
+ bool isPlaying() const;
+
+ int32 getTrackPos(const char *keyTrack = 0) const;
+ const char *getCurTrack() const;
+
+ void testCD(int trySubst, const char *label);
protected:
byte *_LICbuffer;
@@ -54,11 +55,14 @@ protected:
uint16 _numTracks;
uint32 _trackStop;
uint32 _startTime;
- GobEngine *_vm;
+ bool _cdPlaying;
+
+ void play(uint32 from, uint32 to);
+ void stop();
- byte *getTrackBuffer(const char *trackName);
+ byte *getTrackBuffer(const char *trackName) const;
};
} // End of namespace Gob
-#endif // GOB_CDROM_H
+#endif // GOB_SOUND_CDROM_H
diff --git a/engines/gob/sound/infogrames.cpp b/engines/gob/sound/infogrames.cpp
new file mode 100644
index 0000000000..0b46f3485c
--- /dev/null
+++ b/engines/gob/sound/infogrames.cpp
@@ -0,0 +1,103 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "gob/sound/infogrames.h"
+
+namespace Gob {
+
+Infogrames::Infogrames(Audio::Mixer &mixer) : _mixer(&mixer) {
+ _instruments = 0;
+ _song = 0;
+}
+
+Infogrames::~Infogrames() {
+ clearSong();
+ clearInstruments();
+}
+
+bool Infogrames::loadInstruments(const char *fileName) {
+ clearSong();
+ clearInstruments();
+
+ return loadInst(fileName);
+}
+
+bool Infogrames::loadSong(const char *fileName) {
+ clearSong();
+
+ if (!_instruments)
+ if (!loadInst("i1.ins"))
+ return false;
+
+ _song = new Audio::Infogrames(*_instruments, true,
+ _mixer->getOutputRate(), _mixer->getOutputRate() / 75);
+
+ if (!_song->load(fileName)) {
+ warning("Couldn't load infogrames music");
+ clearSong();
+ return false;
+ }
+
+ return true;
+}
+
+void Infogrames::play() {
+ if (_song && !_mixer->isSoundHandleActive(_handle)) {
+ _song->restart();
+ _mixer->playInputStream(Audio::Mixer::kMusicSoundType,
+ &_handle, _song, -1, 255, 0, false);
+ }
+}
+
+void Infogrames::stop() {
+ _mixer->stopHandle(_handle);
+}
+
+void Infogrames::clearInstruments() {
+ delete _instruments;
+ _instruments = 0;
+}
+
+void Infogrames::clearSong() {
+ if (_song) {
+ _mixer->stopHandle(_handle);
+
+ delete _song;
+ _song = 0;
+ }
+}
+
+bool Infogrames::loadInst(const char *fileName) {
+ _instruments = new Audio::Infogrames::Instruments;
+ if (!_instruments->load(fileName)) {
+ warning("Couldn't load instruments file");
+ clearInstruments();
+ return false;
+ }
+
+ return true;
+}
+
+} // End of namespace Gob
diff --git a/backends/platform/gp32/globals.h b/engines/gob/sound/infogrames.h
index 49f11ddb4e..4a20dceb22 100644
--- a/backends/platform/gp32/globals.h
+++ b/engines/gob/sound/infogrames.h
@@ -23,22 +23,38 @@
*
*/
-#ifndef __GLOBALS_H
-#define __GLOBALS_H
+#ifndef GOB_SOUND_INFOGRAMES_H
+#define GOB_SOUND_INFOGRAMES_H
-enum {
- FM_QUALITY_LOW = 0,
- FM_QUALITY_MED,
- FM_QUALITY_HI
-};
+#include "sound/mixer.h"
+#include "sound/mods/infogrames.h"
+
+namespace Gob {
+
+class Infogrames {
+public:
+ Infogrames(Audio::Mixer &mixer);
+ ~Infogrames();
+
+ bool loadInstruments(const char *fileName);
+ bool loadSong(const char *fileName);
+
+ void play();
+ void stop();
+
+private:
+ Audio::Mixer *_mixer;
+
+ Audio::Infogrames::Instruments *_instruments;
+ Audio::Infogrames *_song;
+ Audio::SoundHandle _handle;
+
+ void clearInstruments();
+ void clearSong();
-struct GlobalVars {
- uint16 cpuSpeed;
- uint16 gammaRamp;
- uint8 fmQuality;
- uint32 sampleRate;
+ bool loadInst(const char *fileName);
};
-extern GlobalVars g_vars;
+} // End of namespace Gob
-#endif
+#endif // GOB_SOUND_INFOGRAMES_H
diff --git a/engines/gob/sound/pcspeaker.cpp b/engines/gob/sound/pcspeaker.cpp
new file mode 100644
index 0000000000..0d1fc0a6db
--- /dev/null
+++ b/engines/gob/sound/pcspeaker.cpp
@@ -0,0 +1,55 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "gob/sound/pcspeaker.h"
+
+namespace Gob {
+
+PCSpeaker::PCSpeaker(Audio::Mixer &mixer) : _mixer(&mixer) {
+
+ _stream = new Audio::PCSpeaker(_mixer->getOutputRate());
+ _mixer->playInputStream(Audio::Mixer::kSFXSoundType,
+ &_handle, _stream, -1, 50, 0, false, true);
+}
+
+PCSpeaker::~PCSpeaker() {
+ _mixer->stopHandle(_handle);
+ delete _stream;
+}
+
+void PCSpeaker::speakerOn(int16 frequency, int32 length) {
+ _stream->play(Audio::PCSpeaker::kWaveFormSquare, frequency, length);
+}
+
+void PCSpeaker::speakerOff() {
+ _stream->stop();
+}
+
+void PCSpeaker::onUpdate(uint32 millis) {
+ if (_stream->isPlaying())
+ _stream->stop(millis);
+}
+
+} // End of namespace Gob
diff --git a/backends/platform/PalmOS/Src/be_save.h b/engines/gob/sound/pcspeaker.h
index c0aaf2a46c..8c4fb08021 100644
--- a/backends/platform/PalmOS/Src/be_save.h
+++ b/engines/gob/sound/pcspeaker.h
@@ -23,14 +23,30 @@
*
*/
-#ifndef BACKEND_SAVES_PALM_H
-#define BACKEND_SAVES_PALM_H
+#ifndef GOB_SOUND_PCSPEAKER_H
+#define GOB_SOUND_PCSPEAKER_H
-#include "saves/default/default-saves.h"
+#include "sound/mixer.h"
+#include "sound/softsynth/pcspk.h"
-class PalmSaveFileManager : public DefaultSaveFileManager {
+namespace Gob {
+
+class PCSpeaker {
public:
- Common::StringList listSavefiles(const char *pattern);
+ PCSpeaker(Audio::Mixer &mixer);
+ ~PCSpeaker();
+
+ void speakerOn(int16 frequency, int32 length = -1);
+ void speakerOff();
+ void onUpdate(uint32 millis);
+
+private:
+ Audio::Mixer *_mixer;
+
+ Audio::PCSpeaker *_stream;
+ Audio::SoundHandle _handle;
};
-#endif
+} // End of namespace Gob
+
+#endif // GOB_SOUND_PCSPEAKER_H
diff --git a/engines/gob/sound/sound.cpp b/engines/gob/sound/sound.cpp
new file mode 100644
index 0000000000..2d2bf8e043
--- /dev/null
+++ b/engines/gob/sound/sound.cpp
@@ -0,0 +1,582 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "gob/gob.h"
+#include "gob/sound/sound.h"
+#include "gob/global.h"
+#include "gob/util.h"
+#include "gob/dataio.h"
+#include "gob/game.h"
+#include "gob/inter.h"
+
+namespace Gob {
+
+Sound::Sound(GobEngine *vm) : _vm(vm) {
+ _pcspeaker = new PCSpeaker(*_vm->_mixer);
+ _blaster = new SoundBlaster(*_vm->_mixer);
+
+ _adlib = 0;
+ _infogrames = 0;
+ _cdrom = 0;
+ _bgatmos = 0;
+
+ if (!_vm->_noMusic && _vm->hasAdlib())
+ _adlib = new AdLib(*_vm->_mixer);
+ if (!_vm->_noMusic && (_vm->getPlatform() == Common::kPlatformAmiga))
+ _infogrames = new Infogrames(*_vm->_mixer);
+ if (_vm->isCD())
+ _cdrom = new CDROM;
+ if (_vm->getGameType() == kGameTypeWoodruff)
+ _bgatmos = new BackgroundAtmosphere(*_vm->_mixer);
+}
+
+Sound::~Sound() {
+ delete _pcspeaker;
+ delete _blaster;
+ delete _adlib;
+ delete _infogrames;
+ delete _cdrom;
+ delete _bgatmos;
+
+ for (int i = 0; i < kSoundsCount; i++)
+ _sounds[i].free();
+}
+
+void Sound::convToSigned(byte *buffer, int length) {
+ while (length-- > 0)
+ *buffer++ ^= 0x80;
+}
+
+SoundDesc *Sound::sampleGetBySlot(int slot) {
+ if ((slot < 0) || (slot >= kSoundsCount))
+ return 0;
+
+ return &_sounds[slot];
+}
+
+const SoundDesc *Sound::sampleGetBySlot(int slot) const {
+ if ((slot < 0) || (slot >= kSoundsCount))
+ return 0;
+
+ return &_sounds[slot];
+}
+
+int Sound::sampleGetNextFreeSlot() const {
+ for (int i = 0; i < kSoundsCount; i++)
+ if (_sounds[i].empty())
+ return i;
+
+ return -1;
+}
+
+bool Sound::sampleLoad(SoundDesc *sndDesc, const char *fileName, bool tryExist) {
+ if (!sndDesc)
+ return false;
+
+ debugC(2, kDebugSound, "Loading sample \"%s\"", fileName);
+
+ int16 handle = _vm->_dataIO->openData(fileName);
+ if (handle < 0) {
+ warning("Can't open sample file \"%s\"", fileName);
+ return false;
+ }
+
+ _vm->_dataIO->closeData(handle);
+
+ byte *data;
+ uint32 size;
+
+ data = (byte *) _vm->_dataIO->getData(fileName);
+ if (!data)
+ return false;
+
+ size = _vm->_dataIO->getDataSize(fileName);
+ sndDesc->load(SOUND_SND, SOUND_FILE, data, size);
+
+ return true;
+}
+
+void Sound::sampleFree(SoundDesc *sndDesc, bool noteAdlib, int index) {
+ if (!sndDesc || sndDesc->empty())
+ return;
+
+ if (sndDesc->getType() == SOUND_ADL) {
+
+ if (_adlib && noteAdlib)
+ if ((index == -1) || (_adlib->getIndex() == index))
+ _adlib->stopPlay();
+
+ } else {
+
+ if (_blaster)
+ _blaster->stopSound(0, sndDesc);
+
+ }
+
+ sndDesc->free();
+}
+
+void Sound::speakerOn(int16 frequency, int32 length) {
+ if (!_pcspeaker)
+ return;
+
+ debugC(1, kDebugSound, "PCSpeaker: Playing tone (%d, %d)", frequency, length);
+
+ _pcspeaker->speakerOn(frequency, length);
+}
+
+void Sound::speakerOff() {
+ if (!_pcspeaker)
+ return;
+
+ debugC(1, kDebugSound, "PCSpeaker: Stopping tone");
+
+ _pcspeaker->speakerOff();
+}
+
+void Sound::speakerOnUpdate(uint32 millis) {
+ if (!_pcspeaker)
+ return;
+
+ _pcspeaker->onUpdate(millis);
+}
+
+bool Sound::infogramesLoadInstruments(const char *fileName) {
+ if (!_infogrames)
+ return false;
+
+ debugC(1, kDebugSound, "Infogrames: Loading instruments \"%s\"", fileName);
+
+ return _infogrames->loadInstruments(fileName);
+}
+
+bool Sound::infogramesLoadSong(const char *fileName) {
+ if (!_infogrames)
+ return false;
+
+ debugC(1, kDebugSound, "Infogrames: Loading song \"%s\"", fileName);
+
+ return _infogrames->loadSong(fileName);
+}
+
+void Sound::infogramesPlay() {
+ if (!_infogrames)
+ return;
+
+ debugC(1, kDebugSound, "Infogrames: Starting playback");
+
+ _infogrames->play();
+}
+
+void Sound::infogramesStop() {
+ if (!_infogrames)
+ return;
+
+ debugC(1, kDebugSound, "Infogrames: Stopping playback");
+
+ _infogrames->stop();
+}
+
+bool Sound::adlibLoad(const char *fileName) {
+ if (!_adlib)
+ return false;
+
+ debugC(1, kDebugSound, "Adlib: Loading data (\"%s\")", fileName);
+
+ return _adlib->load(fileName);
+}
+
+bool Sound::adlibLoad(byte *data, uint32 size, int index) {
+ if (!_adlib)
+ return false;
+
+ debugC(1, kDebugSound, "Adlib: Loading data (%d)", index);
+
+ return _adlib->load(data, size, index);
+}
+
+void Sound::adlibUnload() {
+ if (!_adlib)
+ return;
+
+ debugC(1, kDebugSound, "Adlib: Unloading data");
+
+ _adlib->unload();
+}
+
+void Sound::adlibPlayTrack(const char *trackname) {
+ if (!_adlib || _adlib->isPlaying())
+ return;
+
+ debugC(1, kDebugSound, "Adlib: Playing track \"%s\"", trackname);
+
+ _adlib->unload();
+ _adlib->load(trackname);
+ _adlib->startPlay();
+}
+
+void Sound::adlibPlayBgMusic() {
+ if (!_adlib)
+ return;
+
+ static const char *tracks[] = {
+// "musmac1.adl", // TODO: This track isn't played correctly at all yet
+ "musmac2.adl",
+ "musmac3.adl",
+ "musmac4.adl",
+ "musmac5.adl",
+ "musmac6.adl"
+ };
+
+ int track = _vm->_util->getRandom(ARRAYSIZE(tracks));
+ adlibPlayTrack(tracks[track]);
+}
+
+void Sound::adlibPlay() {
+ if (!_adlib)
+ return;
+
+ debugC(1, kDebugSound, "Adlib: Starting playback");
+
+ _adlib->startPlay();
+}
+
+void Sound::adlibStop() {
+ if (!_adlib)
+ return;
+
+ debugC(1, kDebugSound, "Adlib: Stopping playback");
+
+ _adlib->stopPlay();
+}
+
+bool Sound::adlibIsPlaying() const {
+ if (!_adlib)
+ return false;
+
+ return _adlib->isPlaying();
+}
+
+int Sound::adlibGetIndex() const {
+ if (!_adlib)
+ return -1;
+
+ return _adlib->getIndex();
+}
+
+bool Sound::adlibGetRepeating() const {
+ if (!_adlib)
+ return false;
+
+ return _adlib->getRepeating();
+}
+
+void Sound::adlibSetRepeating(int32 repCount) {
+ if (!_adlib)
+ return;
+
+ _adlib->setRepeating(repCount);
+}
+
+void Sound::blasterPlay(SoundDesc *sndDesc, int16 repCount,
+ int16 frequency, int16 fadeLength) {
+ if (!_blaster || !sndDesc)
+ return;
+
+ debugC(1, kDebugSound, "SoundBlaster: Playing sample (%d, %d, %d)",
+ repCount, frequency, fadeLength);
+
+ _blaster->playSample(*sndDesc, repCount, frequency, fadeLength);
+}
+
+void Sound::blasterStop(int16 fadeLength, SoundDesc *sndDesc) {
+ if (!_blaster)
+ return;
+
+ debugC(1, kDebugSound, "SoundBlaster: Stopping playback");
+
+ _blaster->stopSound(fadeLength, sndDesc);
+}
+
+void Sound::blasterPlayComposition(int16 *composition, int16 freqVal,
+ SoundDesc *sndDescs, int8 sndCount) {
+ if (!_blaster)
+ return;
+
+ debugC(1, kDebugSound, "SoundBlaster: Playing composition (%d, %d)",
+ freqVal, sndCount);
+
+ blasterWaitEndPlay();
+ _blaster->stopComposition();
+
+ if (!sndDescs)
+ sndDescs = _sounds;
+
+ _blaster->playComposition(composition, freqVal, sndDescs, sndCount);
+}
+
+void Sound::blasterStopComposition() {
+ if (!_blaster)
+ return;
+
+ debugC(1, kDebugSound, "SoundBlaster: Stopping composition");
+
+ _blaster->stopComposition();
+}
+
+char Sound::blasterPlayingSound() const {
+ if (!_blaster)
+ return 0;
+
+ return _blaster->getPlayingSound();
+}
+
+void Sound::blasterSetRepeating(int32 repCount) {
+ if (!_blaster)
+ return;
+
+ _blaster->setRepeating(repCount);
+}
+
+void Sound::blasterWaitEndPlay(bool interruptible, bool stopComp) {
+ if (!_blaster)
+ return;
+
+ debugC(1, kDebugSound, "SoundBlaster: Waiting for playback to end");
+
+ if (stopComp)
+ _blaster->endComposition();
+
+ while (_blaster->isPlaying() && !_vm->_quitRequested) {
+ if (interruptible && (_vm->_util->checkKey() == 0x11B)) {
+ WRITE_VAR(57, (uint32) -1);
+ return;
+ }
+ _vm->_util->longDelay(200);
+ }
+
+ _blaster->stopSound(0);
+}
+
+void Sound::cdLoadLIC(const char *fname) {
+ if (!_cdrom)
+ return;
+
+ debugC(1, kDebugSound, "CDROM: Loading LIC \"%s\"", fname);
+
+ int handle = _vm->_dataIO->openData(fname);
+
+ if (handle == -1)
+ return;
+
+ _vm->_dataIO->closeData(handle);
+
+ _vm->_dataIO->getUnpackedData(fname);
+
+ handle = _vm->_dataIO->openData(fname);
+ DataStream *stream = _vm->_dataIO->openAsStream(handle, true);
+
+ _cdrom->readLIC(*stream);
+
+ delete stream;
+}
+
+void Sound::cdUnloadLIC() {
+ if (!_cdrom)
+ return;
+
+ debugC(1, kDebugSound, "CDROM: Unloading LIC");
+
+ _cdrom->freeLICBuffer();
+}
+
+void Sound::cdPlayBgMusic() {
+ if (!_cdrom)
+ return;
+
+ static const char *tracks[][2] = {
+ {"avt00.tot", "mine"},
+ {"avt001.tot", "nuit"},
+ {"avt002.tot", "campagne"},
+ {"avt003.tot", "extsor1"},
+ {"avt004.tot", "interieure"},
+ {"avt005.tot", "zombie"},
+ {"avt006.tot", "zombie"},
+ {"avt007.tot", "campagne"},
+ {"avt008.tot", "campagne"},
+ {"avt009.tot", "extsor1"},
+ {"avt010.tot", "extsor1"},
+ {"avt011.tot", "interieure"},
+ {"avt012.tot", "zombie"},
+ {"avt014.tot", "nuit"},
+ {"avt015.tot", "interieure"},
+ {"avt016.tot", "statue"},
+ {"avt017.tot", "zombie"},
+ {"avt018.tot", "statue"},
+ {"avt019.tot", "mine"},
+ {"avt020.tot", "statue"},
+ {"avt021.tot", "mine"},
+ {"avt022.tot", "zombie"}
+ };
+
+ for (int i = 0; i < ARRAYSIZE(tracks); i++)
+ if (!scumm_stricmp(_vm->_game->_curTotFile, tracks[i][0])) {
+ debugC(1, kDebugSound, "CDROM: Playing background music \"%s\" (\"%s\")",
+ tracks[i][1], _vm->_game->_curTotFile);
+
+ _cdrom->startTrack(tracks[i][1]);
+ break;
+ }
+}
+
+void Sound::cdPlayMultMusic() {
+ if (!_cdrom)
+ return;
+
+ static const char *tracks[][6] = {
+ {"avt005.tot", "fra1", "all1", "ang1", "esp1", "ita1"},
+ {"avt006.tot", "fra2", "all2", "ang2", "esp2", "ita2"},
+ {"avt012.tot", "fra3", "all3", "ang3", "esp3", "ita3"},
+ {"avt016.tot", "fra4", "all4", "ang4", "esp4", "ita4"},
+ {"avt019.tot", "fra5", "all5", "ang5", "esp5", "ita5"},
+ {"avt022.tot", "fra6", "all6", "ang6", "esp6", "ita6"}
+ };
+
+ // Default to "ang?" for other languages (including EN_USA)
+ int language = _vm->_global->_language <= 4 ? _vm->_global->_language : 2;
+ for (int i = 0; i < ARRAYSIZE(tracks); i++)
+ if (!scumm_stricmp(_vm->_game->_curTotFile, tracks[i][0])) {
+ debugC(1, kDebugSound, "CDROM: Playing mult music \"%s\" (\"%s\")",
+ tracks[i][language + 1], _vm->_game->_curTotFile);
+
+ _cdrom->startTrack(tracks[i][language + 1]);
+ break;
+ }
+}
+
+void Sound::cdPlay(const char *trackName) {
+ if (!_cdrom)
+ return;
+
+ debugC(1, kDebugSound, "CDROM: Playing track \"%s\"", trackName);
+ _cdrom->startTrack(trackName);
+}
+
+void Sound::cdStop() {
+ if (!_cdrom)
+ return;
+
+ debugC(1, kDebugSound, "CDROM: Stopping playback");
+ _cdrom->stopPlaying();
+}
+
+bool Sound::cdIsPlaying() const {
+ if (!_cdrom)
+ return false;
+
+ return _cdrom->isPlaying();
+}
+
+int32 Sound::cdGetTrackPos(const char *keyTrack) const {
+ if (!_cdrom)
+ return -1;
+
+ return _cdrom->getTrackPos(keyTrack);
+}
+
+const char *Sound::cdGetCurrentTrack() const {
+ if (!_cdrom)
+ return "";
+
+ return _cdrom->getCurTrack();
+}
+
+void Sound::cdTest(int trySubst, const char *label) {
+ if (!_cdrom)
+ return;
+
+ _cdrom->testCD(trySubst, label);
+}
+
+void Sound::bgPlay(const char *base, int count) {
+ if (!_bgatmos)
+ return;
+
+ debugC(1, kDebugSound, "BackgroundAtmosphere: Playing \"%s\" (%d)", base, count);
+
+ _bgatmos->stop();
+ _bgatmos->queueClear();
+
+ int length = strlen(base) + 7;
+ char *fileName = new char[length];
+ SoundDesc *sndDesc;
+
+ for (int i = 1; i <= count; i++) {
+ snprintf(fileName, length, "%s%02d.SND", base, i);
+
+ sndDesc = new SoundDesc;
+ if (sampleLoad(sndDesc, fileName))
+ _bgatmos->queueSample(*sndDesc);
+ }
+
+ _bgatmos->play();
+}
+
+void Sound::bgStop() {
+ if (!_bgatmos)
+ return;
+
+ debugC(1, kDebugSound, "BackgroundAtmosphere: Stopping playback");
+
+ _bgatmos->stop();
+ _bgatmos->queueClear();
+}
+
+void Sound::bgSetPlayMode(BackgroundAtmosphere::PlayMode mode) {
+ if (!_bgatmos)
+ return;
+
+ _bgatmos->setPlayMode(mode);
+}
+
+void Sound::bgShade() {
+ if (!_bgatmos)
+ return;
+
+ debugC(1, kDebugSound, "BackgroundAtmosphere: Shading playback");
+
+ _bgatmos->shade();
+}
+
+void Sound::bgUnshade() {
+ if (!_bgatmos)
+ return;
+
+ debugC(1, kDebugSound, "BackgroundAtmosphere: Unshading playback");
+
+ _bgatmos->unshade();
+}
+
+} // End of namespace Gob
diff --git a/engines/gob/sound/sound.h b/engines/gob/sound/sound.h
new file mode 100644
index 0000000000..b59510e4bb
--- /dev/null
+++ b/engines/gob/sound/sound.h
@@ -0,0 +1,147 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#ifndef GOB_SOUND_SOUND_H
+#define GOB_SOUND_SOUND_H
+
+#include "gob/sound/sounddesc.h"
+#include "gob/sound/pcspeaker.h"
+#include "gob/sound/soundblaster.h"
+#include "gob/sound/adlib.h"
+#include "gob/sound/infogrames.h"
+#include "gob/sound/cdrom.h"
+#include "gob/sound/bgatmosphere.h"
+
+namespace Gob {
+
+class Sound {
+public:
+ static const int kSoundsCount = 60;
+
+ Sound(GobEngine *vm);
+ ~Sound();
+
+ static void convToSigned(byte *buffer, int length);
+
+ // Samples
+ SoundDesc *sampleGetBySlot(int slot);
+ const SoundDesc *sampleGetBySlot(int slot) const;
+ int sampleGetNextFreeSlot() const;
+
+ bool sampleLoad(SoundDesc *sndDesc, const char *fileName, bool tryExist = true);
+ void sampleFree(SoundDesc *sndDesc, bool noteAdlib = false, int index = -1);
+
+
+ // SoundBlaster
+ void blasterPlay(SoundDesc *sndDesc, int16 repCount,
+ int16 frequency, int16 fadeLength = 0);
+ void blasterStop(int16 fadeLength, SoundDesc *sndDesc = 0);
+
+ void blasterPlayComposition(int16 *composition, int16 freqVal,
+ SoundDesc *sndDescs = 0, int8 sndCount = kSoundsCount);
+ void blasterStopComposition();
+
+ char blasterPlayingSound() const;
+
+ void blasterSetRepeating(int32 repCount);
+ void blasterWaitEndPlay(bool interruptible = false, bool stopComp = true);
+
+
+ // PCSpeaker
+ void speakerOn(int16 frequency, int32 length = -1);
+ void speakerOff();
+ void speakerOnUpdate(uint32 millis);
+
+
+ // AdLib
+ bool adlibLoad(const char *fileName);
+ bool adlibLoad(byte *data, uint32 size, int index = -1);
+ void adlibUnload();
+
+ void adlibPlayTrack(const char *trackname);
+ void adlibPlayBgMusic();
+
+ void adlibPlay();
+ void adlibStop();
+
+ bool adlibIsPlaying() const;
+
+ int adlibGetIndex() const;
+ bool adlibGetRepeating() const;
+
+ void adlibSetRepeating(int32 repCount);
+
+
+ // Infogrames
+ bool infogramesLoadInstruments(const char *fileName);
+ bool infogramesLoadSong(const char *fileName);
+
+ void infogramesPlay();
+ void infogramesStop();
+
+
+ // CD-ROM
+ void cdLoadLIC(const char *fname);
+ void cdUnloadLIC();
+
+ void cdPlayBgMusic();
+ void cdPlayMultMusic();
+
+ void cdPlay(const char *trackName);
+ void cdStop();
+
+ bool cdIsPlaying() const;
+
+ int32 cdGetTrackPos(const char *keyTrack = 0) const;
+ const char *cdGetCurrentTrack() const;
+
+ void cdTest(int trySubst, const char *label);
+
+
+ // Background Atmosphere
+ void bgPlay(const char *base, int count);
+ void bgStop();
+
+ void bgSetPlayMode(BackgroundAtmosphere::PlayMode mode);
+
+ void bgShade();
+ void bgUnshade();
+
+private:
+ GobEngine *_vm;
+
+ SoundDesc _sounds[kSoundsCount];
+
+ PCSpeaker *_pcspeaker;
+ SoundBlaster *_blaster;
+ AdLib *_adlib;
+ Infogrames *_infogrames;
+ CDROM *_cdrom;
+ BackgroundAtmosphere *_bgatmos;
+};
+
+} // End of namespace Gob
+
+#endif // GOB_SOUND_H
diff --git a/engines/gob/sound/soundblaster.cpp b/engines/gob/sound/soundblaster.cpp
new file mode 100644
index 0000000000..eeedfaa3cb
--- /dev/null
+++ b/engines/gob/sound/soundblaster.cpp
@@ -0,0 +1,126 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "gob/sound/soundblaster.h"
+
+namespace Gob {
+
+SoundBlaster::SoundBlaster(Audio::Mixer &mixer) : SoundMixer(mixer, Audio::Mixer::kSFXSoundType) {
+ _curSoundDesc = 0;
+
+ _compositionSamples = 0;
+ _compositionSampleCount = 0;
+ _compositionPos = -1;
+}
+
+SoundBlaster::~SoundBlaster() {
+}
+
+void SoundBlaster::playSample(SoundDesc &sndDesc, int16 repCount,
+ int16 frequency, int16 fadeLength) {
+ SoundMixer::play(sndDesc, repCount, frequency, fadeLength);
+}
+
+void SoundBlaster::stopSound(int16 fadeLength, SoundDesc *sndDesc) {
+ Common::StackLock slock(_mutex);
+
+ if (sndDesc && (sndDesc != _curSoundDesc))
+ return;
+
+ if (fadeLength <= 0)
+ _curSoundDesc = 0;
+
+ SoundMixer::stop(fadeLength);
+}
+
+void SoundBlaster::stopComposition() {
+ if (_compositionPos != -1) {
+ stopSound(0);
+ _compositionPos = -1;
+ }
+}
+
+void SoundBlaster::endComposition() {
+ _compositionPos = -1;
+}
+
+void SoundBlaster::nextCompositionPos() {
+ int8 slot;
+
+ while ((++_compositionPos < 50) &&
+ ((slot = _composition[_compositionPos]) != -1)) {
+ if ((slot >= 0) && (slot < _compositionSampleCount)) {
+ SoundDesc &sample = _compositionSamples[slot];
+ if (!sample.empty() && (sample.getType() == SOUND_SND)) {
+ setSample(sample, 1, 0, 0);
+ return;
+ }
+ }
+ if (_compositionPos == 49)
+ _compositionPos = -1;
+ }
+ _compositionPos = -1;
+}
+
+void SoundBlaster::playComposition(int16 *composition, int16 freqVal,
+ SoundDesc *sndDescs, int8 sndCount) {
+
+ _compositionSamples = sndDescs;
+ _compositionSampleCount = sndCount;
+
+ int i = -1;
+ do {
+ i++;
+ _composition[i] = composition[i];
+ } while ((i < 50) && (composition[i] != -1));
+
+ _compositionPos = -1;
+ nextCompositionPos();
+}
+
+void SoundBlaster::setSample(SoundDesc &sndDesc, int16 repCount, int16 frequency,
+ int16 fadeLength) {
+
+ _curSoundDesc = &sndDesc;
+ SoundMixer::setSample(sndDesc, repCount, frequency, fadeLength);
+}
+
+void SoundBlaster::checkEndSample() {
+ if (_compositionPos != -1)
+ nextCompositionPos();
+ else
+ SoundMixer::checkEndSample();
+}
+
+void SoundBlaster::endFade() {
+ if (_fadeVolStep > 0) {
+ _compositionPos = -1;
+ _curSoundDesc = 0;
+ }
+
+ SoundMixer::endFade();
+}
+
+} // End of namespace Gob
diff --git a/engines/gob/sound/soundblaster.h b/engines/gob/sound/soundblaster.h
new file mode 100644
index 0000000000..c57e4a443e
--- /dev/null
+++ b/engines/gob/sound/soundblaster.h
@@ -0,0 +1,71 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#ifndef GOB_SOUND_SOUNDBLASTER_H
+#define GOB_SOUND_SOUNDBLASTER_H
+
+#include "common/mutex.h"
+#include "sound/mixer.h"
+
+#include "gob/sound/sounddesc.h"
+#include "gob/sound/soundmixer.h"
+
+namespace Gob {
+
+class SoundBlaster : public SoundMixer {
+public:
+ SoundBlaster(Audio::Mixer &mixer);
+ ~SoundBlaster();
+
+ void playSample(SoundDesc &sndDesc, int16 repCount,
+ int16 frequency, int16 fadeLength = 0);
+ void stopSound(int16 fadeLength, SoundDesc *sndDesc = 0);
+
+ void playComposition(int16 *composition, int16 freqVal,
+ SoundDesc *sndDescs = 0, int8 sndCount = 60);
+ void stopComposition();
+ void endComposition();
+
+protected:
+ Common::Mutex _mutex;
+
+ SoundDesc *_compositionSamples;
+ int8 _compositionSampleCount;
+ int16 _composition[50];
+ int8 _compositionPos;
+
+ SoundDesc *_curSoundDesc;
+
+ void setSample(SoundDesc &sndDesc, int16 repCount,
+ int16 frequency, int16 fadeLength);
+ void checkEndSample();
+ void endFade();
+
+ void nextCompositionPos();
+};
+
+} // End of namespace Gob
+
+#endif // GOB_SOUND_SOUNDBLASTER_H
diff --git a/engines/gob/sound/sounddesc.cpp b/engines/gob/sound/sounddesc.cpp
new file mode 100644
index 0000000000..e0885d9faa
--- /dev/null
+++ b/engines/gob/sound/sounddesc.cpp
@@ -0,0 +1,116 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "common/util.h"
+
+#include "gob/sound/sounddesc.h"
+
+namespace Gob {
+
+SoundDesc::SoundDesc() {
+ _data = _dataPtr = 0;
+ _size = 0;
+
+ _type = SOUND_SND;
+ _source = SOUND_FILE;
+
+ _repCount = 0;
+ _frequency = 0;
+ _flag = 0;
+ _id = 0;
+}
+
+SoundDesc::~SoundDesc() {
+ free();
+}
+
+void SoundDesc::set(SoundType type, SoundSource src,
+ byte *data, uint32 dSize) {
+
+ free();
+
+ _type = type;
+ _source = src;
+ _data = _dataPtr = data;
+ _size = dSize;
+}
+
+void SoundDesc::load(SoundType type, SoundSource src,
+ byte *data, uint32 dSize) {
+
+ free();
+
+ _source = src;
+ switch (type) {
+ case SOUND_ADL:
+ loadADL(data, dSize);
+ break;
+ case SOUND_SND:
+ loadSND(data, dSize);
+ break;
+ }
+}
+
+void SoundDesc::free() {
+ if (_source != SOUND_TOT)
+ delete[] _data;
+ _data = _dataPtr = 0;
+ _id = 0;
+}
+
+void SoundDesc::convToSigned() {
+ if ((_type == SOUND_SND) && _data && _dataPtr)
+ for (uint32 i = 0; i < _size; i++)
+ _dataPtr[i] ^= 0x80;
+}
+
+int16 SoundDesc::calcFadeOutLength(int16 frequency) {
+ return (10 * (_size / 2)) / frequency;
+}
+
+uint32 SoundDesc::calcLength(int16 repCount, int16 frequency, bool fade) {
+ uint32 fadeSize = fade ? _size / 2 : 0;
+ return ((_size * repCount - fadeSize) * 1000) / frequency;
+}
+
+void SoundDesc::loadSND(byte *data, uint32 dSize) {
+ assert(dSize > 6);
+
+ _type = SOUND_SND;
+ _data = data;
+ _dataPtr = data + 6;
+ _frequency = MAX((int16) READ_BE_UINT16(data + 4), (int16) 4700);
+ _flag = data[0] ? (data[0] & 0x7F) : 8;
+ data[0] = 0;
+ _size = MIN(READ_BE_UINT32(data), dSize - 6);
+}
+
+void SoundDesc::loadADL(byte *data, uint32 dSize) {
+ _type = SOUND_ADL;
+ _data = _dataPtr = data;
+ _size = dSize;
+}
+
+} // End of namespace Gob
diff --git a/engines/gob/sound/sounddesc.h b/engines/gob/sound/sounddesc.h
new file mode 100644
index 0000000000..ed4447254c
--- /dev/null
+++ b/engines/gob/sound/sounddesc.h
@@ -0,0 +1,85 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#ifndef GOB_SOUND_SOUNDDESC_H
+#define GOB_SOUND_SOUNDDESC_H
+
+#include "common/endian.h"
+
+namespace Gob {
+
+enum SoundType {
+ SOUND_SND,
+ SOUND_ADL
+};
+
+enum SoundSource {
+ SOUND_FILE,
+ SOUND_TOT,
+ SOUND_EXT
+};
+
+class SoundDesc {
+public:
+ int16 _repCount;
+ int16 _frequency;
+ int16 _flag;
+ int16 _id;
+
+ byte *getData() { return _dataPtr; }
+
+ uint32 size() const { return _size; }
+ bool empty() const { return !_dataPtr; }
+ SoundType getType() const { return _type; }
+
+ bool isId(int16 id) const { return _dataPtr && (_id == id); }
+
+ void set(SoundType type, SoundSource src, byte *data, uint32 dSize);
+ void load(SoundType type, SoundSource src, byte *data, uint32 dSize);
+ void free();
+ void convToSigned();
+
+ // Which fade out length to use when the fade starts half-way through?
+ int16 calcFadeOutLength(int16 frequency);
+ uint32 calcLength(int16 repCount, int16 frequency, bool fade);
+
+ SoundDesc();
+ ~SoundDesc();
+
+private:
+ byte *_data;
+ byte *_dataPtr;
+ uint32 _size;
+
+ SoundType _type;
+ SoundSource _source;
+
+ void loadSND(byte *data, uint32 dSize);
+ void loadADL(byte *data, uint32 dSize);
+};
+
+} // End of namespace Gob
+
+#endif // GOB_SOUND_SOUNDDESC_H
diff --git a/engines/gob/sound/soundmixer.cpp b/engines/gob/sound/soundmixer.cpp
new file mode 100644
index 0000000000..1a287d782f
--- /dev/null
+++ b/engines/gob/sound/soundmixer.cpp
@@ -0,0 +1,204 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "gob/sound/soundmixer.h"
+
+namespace Gob {
+
+SoundMixer::SoundMixer(Audio::Mixer &mixer, Audio::Mixer::SoundType type) : _mixer(&mixer) {
+ _playingSound = 0;
+
+ _rate = _mixer->getOutputRate();
+ _end = true;
+ _data = 0;
+ _length = 0;
+ _freq = 0;
+ _repCount = 0;
+
+ _offset = 0;
+ _offsetFrac = 0;
+ _offsetInc = 0;
+
+ _cur = 0;
+ _last = 0;
+
+ _fade = false;
+ _fadeVol = 65536;
+ _fadeVolStep = 0;
+ _fadeSamples = 0;
+ _curFadeSamples = 0;
+
+ _mixer->playInputStream(type, &_handle, this, -1, 255, 0, false, true);
+}
+
+SoundMixer::~SoundMixer() {
+ _mixer->stopHandle(_handle);
+}
+
+bool SoundMixer::isPlaying() const {
+ return !_end;
+}
+
+char SoundMixer::getPlayingSound() const {
+ return _playingSound;
+}
+
+void SoundMixer::stop(int16 fadeLength) {
+ Common::StackLock slock(_mutex);
+
+ if (fadeLength <= 0) {
+ _data = 0;
+ _end = true;
+ _playingSound = 0;
+ return;
+ }
+
+ _fade = true;
+ _fadeVol = 65536;
+ _fadeSamples = (int) (fadeLength * (((double) _rate) / 10.0));
+ _fadeVolStep = MAX((int32) 1, (int32) (65536 / _fadeSamples));
+ _curFadeSamples = 0;
+}
+
+void SoundMixer::setRepeating(int32 repCount) {
+ Common::StackLock slock(_mutex);
+
+ _repCount = repCount;
+}
+
+void SoundMixer::setSample(SoundDesc &sndDesc, int16 repCount, int16 frequency,
+ int16 fadeLength) {
+
+ if (frequency <= 0)
+ frequency = sndDesc._frequency;
+
+ sndDesc._repCount = repCount - 1;
+ sndDesc._frequency = frequency;
+
+ _data = (int8 *) sndDesc.getData();
+ _length = sndDesc.size();
+ _freq = frequency;
+
+ _repCount = repCount;
+ _end = false;
+ _playingSound = 1;
+
+ _offset = 0;
+ _offsetFrac = 0;
+ _offsetInc = (_freq << FRAC_BITS) / _rate;
+
+ _last = _cur;
+ _cur = _data[0];
+
+ _curFadeSamples = 0;
+ if (fadeLength == 0) {
+ _fade = false;
+ _fadeVol = 65536;
+ _fadeSamples = 0;
+ _fadeVolStep = 0;
+ } else {
+ _fade = true;
+ _fadeVol = 0;
+ _fadeSamples = (int) (fadeLength * (((double) _rate) / 10.0));
+ _fadeVolStep = - MAX((int32) 1, (int32) (65536 / _fadeSamples));
+ }
+}
+
+void SoundMixer::play(SoundDesc &sndDesc, int16 repCount, int16 frequency,
+ int16 fadeLength) {
+ Common::StackLock slock(_mutex);
+
+ if (!_end)
+ return;
+
+ setSample(sndDesc, repCount, frequency, fadeLength);
+}
+
+void SoundMixer::checkEndSample() {
+ if ((_repCount == -1) || (--_repCount > 0)) {
+ _offset = 0;
+ _offsetFrac = 0;
+ _end = false;
+ _playingSound = 1;
+ } else {
+ _end = true;
+ _playingSound = 0;
+ }
+}
+
+int SoundMixer::readBuffer(int16 *buffer, const int numSamples) {
+ Common::StackLock slock(_mutex);
+
+ for (int i = 0; i < numSamples; i++) {
+ if (!_data)
+ return i;
+ if (_end || (_offset >= _length))
+ checkEndSample();
+ if (_end)
+ return i;
+
+ // Linear interpolation. See sound/rate.cpp
+
+ int16 val = (_last + (((_cur - _last) * _offsetFrac +
+ FRAC_HALF) >> FRAC_BITS)) << 8;
+ *buffer++ = (val * _fadeVol) >> 16;
+
+ _offsetFrac += _offsetInc;
+
+ // Was there an integral change?
+ if (fracToInt(_offsetFrac) > 0) {
+ _last = _cur;
+ _cur = _data[_offset];
+ _offset += fracToInt(_offsetFrac);
+ _offsetFrac &= FRAC_LO_MASK;
+ }
+
+ if (_fade) {
+
+ if (++_curFadeSamples >= _fadeSamples)
+ endFade();
+ else
+ _fadeVol -= _fadeVolStep;
+
+ if (_fadeVol < 0)
+ _fadeVol = 0;
+
+ }
+ }
+ return numSamples;
+}
+
+void SoundMixer::endFade() {
+ if (_fadeVolStep > 0) {
+ _data = 0;
+ _end = true;
+ _playingSound = 0;
+ } else {
+ _fadeVol = 65536;
+ _fade = false;
+ }
+}
+
+} // End of namespace Gob
diff --git a/engines/gob/sound/soundmixer.h b/engines/gob/sound/soundmixer.h
new file mode 100644
index 0000000000..5789885a99
--- /dev/null
+++ b/engines/gob/sound/soundmixer.h
@@ -0,0 +1,95 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#ifndef GOB_SOUND_SOUNDMIXER_H
+#define GOB_SOUND_SOUNDMIXER_H
+
+#include "common/mutex.h"
+#include "common/frac.h"
+#include "sound/audiostream.h"
+#include "sound/mixer.h"
+
+#include "gob/sound/sounddesc.h"
+
+namespace Gob {
+
+class SoundMixer : public Audio::AudioStream {
+public:
+ SoundMixer(Audio::Mixer &mixer, Audio::Mixer::SoundType type = Audio::Mixer::kPlainSoundType);
+ ~SoundMixer();
+
+ virtual void play(SoundDesc &sndDesc, int16 repCount,
+ int16 frequency, int16 fadeLength = 0);
+ virtual void stop(int16 fadeLength);
+
+ bool isPlaying() const;
+ char getPlayingSound() const;
+
+ void setRepeating(int32 repCount);
+
+ int readBuffer(int16 *buffer, const int numSamples);
+ bool isStereo() const { return false; }
+ bool endOfData() const { return _end; }
+ bool endOfStream() const { return false; }
+ int getRate() const { return _rate; }
+
+protected:
+ Audio::Mixer *_mixer;
+
+ Audio::SoundHandle _handle;
+ Common::Mutex _mutex;
+
+ bool _end;
+ int8 *_data;
+ uint32 _length;
+ uint32 _rate;
+ int32 _freq;
+ int32 _repCount;
+
+ uint32 _offset;
+ frac_t _offsetFrac;
+ frac_t _offsetInc;
+
+ int16 _cur;
+ int16 _last;
+
+ bool _fade;
+ int32 _fadeVol;
+ int32 _fadeVolStep;
+ uint8 _fadeLength;
+ uint32 _fadeSamples;
+ uint32 _curFadeSamples;
+
+ char _playingSound;
+
+ virtual void setSample(SoundDesc &sndDesc, int16 repCount,
+ int16 frequency, int16 fadeLength);
+ virtual void checkEndSample();
+ virtual void endFade();
+};
+
+} // End of namespace Gob
+
+#endif // GOB_SOUND_SOUNDMIXER_H
diff --git a/engines/gob/util.cpp b/engines/gob/util.cpp
index 8e573ddb1a..4987426fe0 100644
--- a/engines/gob/util.cpp
+++ b/engines/gob/util.cpp
@@ -23,7 +23,6 @@
*
*/
-
#include "common/events.h"
#include "gob/gob.h"
@@ -32,8 +31,8 @@
#include "gob/dataio.h"
#include "gob/draw.h"
#include "gob/game.h"
-#include "gob/sound.h"
#include "gob/video.h"
+#include "gob/sound/sound.h"
namespace Gob {
@@ -60,7 +59,7 @@ void Util::beep(int16 freq) {
if (_vm->_global->_soundFlags == 0)
return;
- _vm->_snd->speakerOn(freq, 50);
+ _vm->_sound->speakerOn(freq, 50);
}
void Util::delay(uint16 msecs) {
diff --git a/engines/gob/variables.cpp b/engines/gob/variables.cpp
new file mode 100644
index 0000000000..0eea2f6547
--- /dev/null
+++ b/engines/gob/variables.cpp
@@ -0,0 +1,311 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "common/endian.h"
+
+#include "gob/gob.h"
+#include "gob/variables.h"
+
+namespace Gob {
+
+Variables::Variables(uint32 size) {
+ _size = size;
+
+ _vars = new byte[_size];
+ _sizes = new byte[_size];
+
+ clear();
+}
+
+Variables::~Variables() {
+ delete[] _vars;
+ delete[] _sizes;
+}
+
+void Variables::clear() {
+ memset(_vars, 0, _size);
+
+ // All variables are 32 bit wide per default
+ memset(_sizes, 0, _size);
+ for (uint32 i = 0; i < _size; i += 4)
+ _sizes[i] = kSize32;
+}
+
+void Variables::clearSize(uint32 offset) {
+ uint32 inVar = offset % 4;
+ uint32 varOff = (offset >> 2) << 2;
+
+ // Clearing out the old size
+ for (uint32 i = 0; i < 4; i++) {
+ if (_sizes[varOff + i] == kSize32)
+ _sizes[varOff + i] = kSize8;
+ else if ((inVar == (i + 1)) && (_sizes[varOff + i] == kSize16))
+ _sizes[varOff + i] = kSize8;
+ }
+}
+
+void Variables::writeSize(uint32 offset, byte n) {
+ clearSize(offset);
+
+ _sizes[offset] = n;
+ // Setting following bytes of size to 8 bit, for easy clearing out afterwards
+ for (; n > 0; n--)
+ _sizes[offset + n] = kSize8;
+}
+
+void Variables::writeSizeString(uint32 offset, uint32 length) {
+ clearSize(offset);
+
+ memset(_sizes + offset, kSize8, length);
+}
+
+void Variables::writeVar8(uint32 var, uint8 value) {
+ writeOff8(var * 4, value);
+}
+
+void Variables::writeVar16(uint32 var, uint16 value) {
+ writeOff16(var * 4, value);
+}
+
+void Variables::writeVar32(uint32 var, uint32 value) {
+ writeOff32(var * 4, value);
+}
+
+void Variables::writeVarString(uint32 var, const char *value) {
+ writeOffString(var * 4, value);
+}
+
+void Variables::writeOff8(uint32 offset, uint8 value) {
+ write8(_vars + offset, value);
+ writeSize(offset, kSize8);
+}
+
+void Variables::writeOff16(uint32 offset, uint16 value) {
+ write16(_vars + offset, value);
+ writeSize(offset, kSize16);
+}
+
+void Variables::writeOff32(uint32 offset, uint32 value) {
+ write32(_vars + offset, value);
+ writeSize(offset, kSize32);
+}
+
+void Variables::writeOffString(uint32 offset, const char *value) {
+ strcpy((char *) (_vars + offset), value);
+ writeSizeString(offset, strlen(value));
+}
+
+uint8 Variables::readVar8(uint32 var) const {
+ return readOff8(var * 4);
+}
+
+uint16 Variables::readVar16(uint32 var) const {
+ return readOff16(var * 4);
+}
+
+uint32 Variables::readVar32(uint32 var) const {
+ return readOff32(var * 4);
+}
+
+void Variables::readVarString(uint32 var, char *value, uint32 length) {
+ readOffString(var * 4, value, length);
+}
+
+uint8 Variables::readOff8(uint32 offset) const {
+ return read8(_vars + offset);
+}
+
+uint16 Variables::readOff16(uint32 offset) const {
+ return read16(_vars + offset);
+}
+
+uint32 Variables::readOff32(uint32 offset) const {
+ return read32(_vars + offset);
+}
+
+void Variables::readOffString(uint32 offset, char *value, uint32 length) {
+ strncpy0(value, (const char *) (_vars + offset), length - 1);
+}
+
+const uint8 *Variables::getAddressVar8(uint32 var) const {
+ return getAddressOff8(var * 4);
+}
+
+uint8 *Variables::getAddressVar8(uint32 var, uint32 n) {
+ return getAddressOff8(var * 4, n);
+}
+
+const uint16 *Variables::getAddressVar16(uint32 var) const {
+ return getAddressOff16(var * 4);
+}
+
+uint16 *Variables::getAddressVar16(uint32 var, uint32 n) {
+ return getAddressOff16(var * 4, n);
+}
+
+const uint32 *Variables::getAddressVar32(uint32 var) const {
+ return getAddressOff32(var * 4);
+}
+
+uint32 *Variables::getAddressVar32(uint32 var, uint32 n) {
+ return getAddressOff32(var * 4, n);
+}
+
+const char *Variables::getAddressVarString(uint32 var) const {
+ return getAddressOffString(var * 4);
+}
+
+char *Variables::getAddressVarString(uint32 var, uint32 n) {
+ return getAddressOffString(var * 4, n);
+}
+
+const uint8 *Variables::getAddressOff8(uint32 offset) const {
+ return ((const uint8 *) (_vars + offset));
+}
+
+uint8 *Variables::getAddressOff8(uint32 offset, uint32 n) {
+ for (uint32 i = 0; i < n; i++)
+ writeSize(offset + i, kSize8);
+
+ return ((uint8 *) (_vars + offset));
+}
+
+const uint16 *Variables::getAddressOff16(uint32 offset) const {
+ return ((const uint16 *) (_vars + offset));
+}
+
+uint16 *Variables::getAddressOff16(uint32 offset, uint32 n) {
+ for (uint32 i = 0; i < n; i++)
+ writeSize(offset + i * 2, kSize16);
+
+ return ((uint16 *) (_vars + offset));
+}
+
+const uint32 *Variables::getAddressOff32(uint32 offset) const {
+ return ((const uint32 *) (_vars + offset));
+}
+
+uint32 *Variables::getAddressOff32(uint32 offset, uint32 n) {
+ for (uint32 i = 0; i < n; i++)
+ writeSize(offset + i * 4, kSize32);
+
+ return ((uint32 *) (_vars + offset));
+}
+
+const char *Variables::getAddressOffString(uint32 offset) const {
+ return ((const char *) (_vars + offset));
+}
+
+char *Variables::getAddressOffString(uint32 offset, uint32 n) {
+ writeSizeString(offset, (n == 0xFFFFFFFF) ? strlen((char *) (_vars + offset)) : n);
+
+ return ((char *) (_vars + offset));
+}
+
+bool Variables::copyTo(uint32 offset, byte *variables, byte *sizes, uint32 n) const {
+ if ((offset + n) > _size)
+ return false;
+
+ if (variables)
+ memcpy(variables, _vars + offset, n);
+ if (sizes)
+ memcpy(sizes, _sizes + offset, n);
+
+ return true;
+}
+
+bool Variables::copyFrom(uint32 offset, const byte *variables, const byte *sizes, uint32 n) {
+ if (((offset + n) > _size) || !variables || !sizes)
+ return false;
+
+ memcpy(_vars + offset, variables, n);
+ memcpy(_sizes + offset, sizes, n);
+
+ return true;
+}
+
+
+VariablesLE::VariablesLE(uint32 size) : Variables(size) {
+}
+
+VariablesLE::~VariablesLE() {
+}
+
+void VariablesLE::write8(byte *buf, uint8 data) const {
+ *buf = (byte) data;
+}
+
+void VariablesLE::write16(byte *buf, uint16 data) const {
+ WRITE_LE_UINT16(buf, data);
+}
+
+void VariablesLE::write32(byte *buf, uint32 data) const {
+ WRITE_LE_UINT32(buf, data);
+}
+
+uint8 VariablesLE::read8(const byte *buf) const {
+ return (uint8) *buf;
+}
+
+uint16 VariablesLE::read16(const byte *buf) const {
+ return READ_LE_UINT16(buf);
+}
+
+uint32 VariablesLE::read32(const byte *buf) const {
+ return READ_LE_UINT32(buf);
+}
+
+
+VariablesBE::VariablesBE(uint32 size) : Variables(size) {
+}
+
+VariablesBE::~VariablesBE() {
+}
+
+void VariablesBE::write8(byte *buf, uint8 data) const {
+ *buf = (byte) data;
+}
+
+void VariablesBE::write16(byte *buf, uint16 data) const {
+ WRITE_BE_UINT16(buf, data);
+}
+
+void VariablesBE::write32(byte *buf, uint32 data) const {
+ WRITE_BE_UINT32(buf, data);
+}
+
+uint8 VariablesBE::read8(const byte *buf) const {
+ return (uint8) *buf;
+}
+
+uint16 VariablesBE::read16(const byte *buf) const {
+ return READ_BE_UINT16(buf);
+}
+
+uint32 VariablesBE::read32(const byte *buf) const {
+ return READ_BE_UINT32(buf);
+}
+
+} // End of namespace Gob
diff --git a/engines/gob/variables.h b/engines/gob/variables.h
new file mode 100644
index 0000000000..5989ed38ee
--- /dev/null
+++ b/engines/gob/variables.h
@@ -0,0 +1,147 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#ifndef GOB_VARIABLES_H
+#define GOB_VARIABLES_H
+
+namespace Gob {
+
+class Variables {
+public:
+ Variables(uint32 size);
+ virtual ~Variables();
+
+ void writeVar8(uint32 var, uint8 value);
+ void writeVar16(uint32 var, uint16 value);
+ void writeVar32(uint32 var, uint32 value);
+
+ void writeVarString(uint32 var, const char *value);
+
+ void writeOff8(uint32 offset, uint8 value);
+ void writeOff16(uint32 offset, uint16 value);
+ void writeOff32(uint32 offset, uint32 value);
+
+ void writeOffString(uint32 offset, const char *value);
+
+ uint8 readVar8(uint32 var) const;
+ uint16 readVar16(uint32 var) const;
+ uint32 readVar32(uint32 var) const;
+
+ void readVarString(uint32 var, char *value, uint32 length);
+
+ uint8 readOff8(uint32 offset) const;
+ uint16 readOff16(uint32 offset) const;
+ uint32 readOff32(uint32 offset) const;
+
+ void readOffString(uint32 offset, char *value, uint32 length);
+
+
+ const uint8 *getAddressVar8(uint32 var) const;
+ uint8 *getAddressVar8(uint32 var, uint32 n = 1);
+
+ const uint16 *getAddressVar16(uint32 var) const;
+ uint16 *getAddressVar16(uint32 var, uint32 n = 1);
+
+ const uint32 *getAddressVar32(uint32 var) const;
+ uint32 *getAddressVar32(uint32 var, uint32 n = 1);
+
+ const char *getAddressVarString(uint32 var) const;
+ char *getAddressVarString(uint32 var, uint32 n = 0xFFFFFFFF);
+
+ const uint8 *getAddressOff8(uint32 offset) const;
+ uint8 *getAddressOff8(uint32 offset, uint32 n = 1);
+
+ const uint16 *getAddressOff16(uint32 offset) const;
+ uint16 *getAddressOff16(uint32 offset, uint32 n = 1);
+
+ const uint32 *getAddressOff32(uint32 offset) const;
+ uint32 *getAddressOff32(uint32 offset, uint32 n = 1);
+
+ const char *getAddressOffString(uint32 offset) const;
+ char *getAddressOffString(uint32 offset, uint32 n = 0xFFFFFFFF);
+
+
+ bool copyTo(uint32 offset, byte *variables, byte *sizes, uint32 n) const;
+ bool copyFrom(uint32 offset, const byte *variables, const byte *sizes, uint32 n);
+
+protected:
+ virtual void write8(byte *buf, uint8 data) const = 0;
+ virtual void write16(byte *buf, uint16 data) const = 0;
+ virtual void write32(byte *buf, uint32 data) const = 0;
+
+ virtual uint8 read8(const byte *buf) const = 0;
+ virtual uint16 read16(const byte *buf) const = 0;
+ virtual uint32 read32(const byte *buf) const = 0;
+
+private:
+ // Basically the number of additional bytes occupied
+ static const byte kSize8 = 0;
+ static const byte kSize16 = 1;
+ static const byte kSize32 = 3;
+
+ uint32 _size;
+
+ byte *_vars;
+ byte *_sizes;
+
+ void clear();
+ void clearSize(uint32 offset);
+ void writeSize(uint32 offset, byte n);
+ void writeSizeString(uint32 offset, uint32 length);
+};
+
+class VariablesLE : public Variables {
+public:
+ VariablesLE(uint32 size);
+ ~VariablesLE();
+
+protected:
+ void write8(byte *buf, uint8 data) const;
+ void write16(byte *buf, uint16 data) const;
+ void write32(byte *buf, uint32 data) const;
+
+ uint8 read8(const byte *buf) const;
+ uint16 read16(const byte *buf) const;
+ uint32 read32(const byte *buf) const;
+};
+
+class VariablesBE : public Variables {
+public:
+ VariablesBE(uint32 size);
+ ~VariablesBE();
+
+protected:
+ void write8(byte *buf, uint8 data) const;
+ void write16(byte *buf, uint16 data) const;
+ void write32(byte *buf, uint32 data) const;
+
+ uint8 read8(const byte *buf) const;
+ uint16 read16(const byte *buf) const;
+ uint32 read32(const byte *buf) const;
+};
+
+} // End of namespace Gob
+
+#endif // GOB_VARIABLES_H
diff --git a/engines/gob/video.cpp b/engines/gob/video.cpp
index 9a004318b8..453613d1ae 100644
--- a/engines/gob/video.cpp
+++ b/engines/gob/video.cpp
@@ -23,7 +23,6 @@
*
*/
-
#include "common/endian.h"
#include "graphics/cursorman.h"
@@ -87,10 +86,14 @@ void SurfaceDesc::swap(SurfaceDesc &surf) {
Video::Video(GobEngine *vm) : _vm(vm) {
_doRangeClamp = false;
_videoDriver = 0;
+
_surfWidth = 320;
_surfHeight = 200;
+
_scrollOffsetX = 0;
_scrollOffsetY = 0;
+
+ _splitSurf = 0;
_splitHeight1 = 200;
_splitHeight2 = 0;
_splitStart = 0;
@@ -179,21 +182,34 @@ void Video::retrace(bool mouse) {
int screenOffset = _scrollOffsetY * _surfWidth + _scrollOffsetX;
int screenX = _screenDeltaX;
int screenY = _screenDeltaY;
- int screenWidth = _vm->_width;
- int screenHeight = _splitHeight1;
+ int screenWidth = MIN<int>(_surfWidth - _scrollOffsetX, _vm->_width);
+ int screenHeight = MIN<int>(_surfHeight - _splitHeight2 - _scrollOffsetY, _vm->_height);
g_system->copyRectToScreen(_vm->_global->_primarySurfDesc->getVidMem() + screenOffset,
_surfWidth, screenX, screenY, screenWidth, screenHeight);
- if (_splitHeight2 > 0) {
+ if (_splitSurf) {
+
+ screenOffset = 0;
+ screenX = 0;
+ screenY = _vm->_height - _splitSurf->getHeight();
+ screenWidth = MIN<int>(_vm->_width, _splitSurf->getWidth());
+ screenHeight = _splitSurf->getHeight();
+
+ g_system->copyRectToScreen(_splitSurf->getVidMem() + screenOffset,
+ _splitSurf->getWidth(), screenX, screenY, screenWidth, screenHeight);
+
+ } else if (_splitHeight2 > 0) {
+
screenOffset = _splitStart * _surfWidth;
screenX = 0;
screenY = _vm->_height - _splitHeight2;
- screenWidth = _vm->_width;
+ screenWidth = MIN<int>(_surfWidth, _vm->_width);
screenHeight = _splitHeight2;
g_system->copyRectToScreen(_vm->_global->_primarySurfDesc->getVidMem() + screenOffset,
_surfWidth, screenX, screenY, screenWidth, screenHeight);
+
}
g_system->updateScreen();
diff --git a/engines/gob/video.h b/engines/gob/video.h
index 4a585d8857..1338885588 100644
--- a/engines/gob/video.h
+++ b/engines/gob/video.h
@@ -37,10 +37,11 @@ class SurfaceDesc : public ReferenceCounter<SurfaceDesc> {
public:
int16 _vidMode;
- int16 getWidth() { return _width; }
- int16 getHeight() { return _height; }
+ int16 getWidth() const { return _width; }
+ int16 getHeight() const { return _height; }
byte *getVidMem() { return _vidMem; }
- bool hasOwnVidMem() { return _ownVidMem; }
+ const byte *getVidMem() const { return _vidMem; }
+ bool hasOwnVidMem() const { return _ownVidMem; }
void setVidMem(byte *vidMem);
void resize(int16 width, int16 height);
@@ -97,13 +98,18 @@ public:
};
bool _doRangeClamp;
+
int16 _surfWidth;
int16 _surfHeight;
+
int16 _scrollOffsetX;
int16 _scrollOffsetY;
+
+ SurfaceDesc::Ptr _splitSurf;
int16 _splitHeight1;
int16 _splitHeight2;
int16 _splitStart;
+
int16 _screenDeltaX;
int16 _screenDeltaY;
diff --git a/engines/gob/video_v1.cpp b/engines/gob/video_v1.cpp
index 4ed3b04bad..3c9627c041 100644
--- a/engines/gob/video_v1.cpp
+++ b/engines/gob/video_v1.cpp
@@ -23,7 +23,6 @@
*
*/
-
#include "common/endian.h"
#include "gob/gob.h"
diff --git a/engines/gob/video_v2.cpp b/engines/gob/video_v2.cpp
index 52b349ca67..ab0c7e52db 100644
--- a/engines/gob/video_v2.cpp
+++ b/engines/gob/video_v2.cpp
@@ -23,7 +23,6 @@
*
*/
-
#include "common/endian.h"
#include "gob/gob.h"
diff --git a/engines/gob/videoplayer.cpp b/engines/gob/videoplayer.cpp
index e088646498..909d39a63b 100644
--- a/engines/gob/videoplayer.cpp
+++ b/engines/gob/videoplayer.cpp
@@ -33,6 +33,7 @@
#include "gob/palanim.h"
#include "gob/inter.h"
#include "gob/map.h"
+#include "gob/sound/sound.h"
namespace Gob {
@@ -289,6 +290,8 @@ void VideoPlayer::primaryPlay(int16 startFrame, int16 lastFrame, int16 breakKey,
if (doPlay(startFrame, breakKey, palCmd, palStart, palEnd, palFrame, endFrame))
break;
+ evalBgShading(video);
+
if (fade) {
_vm->_palAnim->fade(_vm->_global->_pPaletteDesc, -2, 0);
fade = false;
@@ -299,18 +302,27 @@ void VideoPlayer::primaryPlay(int16 startFrame, int16 lastFrame, int16 breakKey,
startFrame++;
}
+ evalBgShading(video);
+
if (reverseTo >= 0) {
int16 toFrame = video.getFramesCount() - reverseTo;
for (int i = video.getCurrentFrame(); i >= toFrame; i--) {
video.seekFrame(i, SEEK_SET, true);
- if (doPlay(i, breakKey, 0, 0, 0, 0, 0)) {
+
+ bool b = doPlay(i, breakKey, 0, 0, 0, 0, 0);
+ evalBgShading(video);
+
+ if (b) {
_vm->_palAnim->fade(0, -2, 0);
memset((char *) _vm->_draw->_vgaPalette, 0, 768);
}
+
if (!_noCursorSwitch)
video.waitEndFrame();
}
}
+
+ evalBgShading(video);
}
void VideoPlayer::primaryClose() {
@@ -334,17 +346,32 @@ int VideoPlayer::slotOpen(const char *videoFile, Type which) {
}
video->getVideo()->setVideoMemory();
- video->getVideo()->disableSound();
+ video->getVideo()->enableSound(*_vm->_mixer);
+
+ int slot = getNextFreeSlot();
- _videoSlots.push_back(video);
+ _videoSlots[slot] = video;
WRITE_VAR(7, video->getVideo()->getFramesCount());
- return _videoSlots.size() - 1;
+ return slot;
+}
+
+int VideoPlayer::getNextFreeSlot() {
+ uint slot;
+
+ for (slot = 0; slot < _videoSlots.size(); slot++)
+ if (!_videoSlots[slot])
+ break;
+
+ if (slot == _videoSlots.size())
+ _videoSlots.push_back(0);
+
+ return slot;
}
void VideoPlayer::slotPlay(int slot, int16 frame) {
- if ((slot < 0) || (((uint) slot) >= _videoSlots.size()))
+ if ((slot < 0) || (((uint) slot) >= _videoSlots.size()) || !_videoSlots[slot])
return;
CoktelVideo &video = *(_videoSlots[slot]->getVideo());
@@ -360,21 +387,23 @@ void VideoPlayer::slotPlay(int slot, int16 frame) {
_videoSlots[slot]->nextFrame();
WRITE_VAR(11, frame);
+
+ evalBgShading(video);
}
void VideoPlayer::slotClose(int slot) {
- if ((slot < 0) || (((uint) slot) >= _videoSlots.size()))
+ if ((slot < 0) || (((uint) slot) >= _videoSlots.size()) || !_videoSlots[slot])
return;
delete _videoSlots[slot];
- _videoSlots.remove_at(slot);
+ _videoSlots[slot] = 0;
}
void VideoPlayer::slotCopyFrame(int slot, byte *dest,
uint16 left, uint16 top, uint16 width, uint16 height,
uint16 x, uint16 y, uint16 pitch, int16 transp) {
- if ((slot < 0) || (((uint) slot) >= _videoSlots.size()))
+ if ((slot < 0) || (((uint) slot) >= _videoSlots.size()) || !_videoSlots[slot])
return;
_videoSlots[slot]->getVideo()->copyCurrentFrame(dest,
@@ -382,14 +411,24 @@ void VideoPlayer::slotCopyFrame(int slot, byte *dest,
}
void VideoPlayer::slotCopyPalette(int slot, int16 palStart, int16 palEnd) {
- if ((slot < 0) || (((uint) slot) >= _videoSlots.size()))
+ if ((slot < 0) || (((uint) slot) >= _videoSlots.size()) || !_videoSlots[slot])
return;
copyPalette(*(_videoSlots[slot]->getVideo()), palStart, palEnd);
}
+void VideoPlayer::slotWaitEndFrame(int slot, bool onlySound) {
+ if ((slot < 0) || (((uint) slot) >= _videoSlots.size()) || !_videoSlots[slot])
+ return;
+
+ CoktelVideo &video = *(_videoSlots[slot]->getVideo());
+
+ if (!onlySound || (video.getFeatures() & CoktelVideo::kFeaturesSound))
+ video.waitEndFrame();
+}
+
bool VideoPlayer::slotIsOpen(int slot) const {
- if ((slot >= 0) && (((uint) slot) < _videoSlots.size()))
+ if ((slot >= 0) && (((uint) slot) < _videoSlots.size()) && _videoSlots[slot])
return true;
return false;
@@ -399,7 +438,7 @@ const VideoPlayer::Video *VideoPlayer::getVideoBySlot(int slot) const {
if (slot < 0) {
if (_primaryVideo->isOpen())
return _primaryVideo;
- } else if (((uint) slot) < _videoSlots.size())
+ } else if (((uint) slot) < _videoSlots.size() && _videoSlots[slot])
return _videoSlots[slot];
return 0;
@@ -503,7 +542,7 @@ bool VideoPlayer::doPlay(int16 frame, int16 breakKey,
_vm->_draw->_noInvalidated = true;
}
- if (state.flags & CoktelVideo::kStatePalette) {
+ if ((state.flags & CoktelVideo::kStatePalette) && (palCmd > 1)) {
copyPalette(*(_primaryVideo->getVideo()), palStart, palEnd);
if (!_backSurf)
@@ -563,14 +602,13 @@ void VideoPlayer::writeVideoInfo(const char *videoFile, int16 varX, int16 varY,
if (primaryOpen(videoFile)) {
int16 x, y, width, height;
- if ((VAR_OFFSET(varX) != 0xFFFFFFFF) ||
- !_primaryVideo->getVideo()->getAnchor(1, 2, x, y, width, height)) {
+ x = _primaryVideo->getVideo()->getX();
+ y = _primaryVideo->getVideo()->getY();
+ width = _primaryVideo->getVideo()->getWidth();
+ height = _primaryVideo->getVideo()->getHeight();
- x = _primaryVideo->getVideo()->getX();
- y = _primaryVideo->getVideo()->getY();
- width = _primaryVideo->getVideo()->getWidth();
- height = _primaryVideo->getVideo()->getHeight();
- }
+ if (VAR_OFFSET(varX) == 0xFFFFFFFF)
+ _primaryVideo->getVideo()->getAnchor(1, 2, x, y, width, height);
WRITE_VAR_OFFSET(varX, x);
WRITE_VAR_OFFSET(varY, y);
@@ -580,12 +618,28 @@ void VideoPlayer::writeVideoInfo(const char *videoFile, int16 varX, int16 varY,
primaryClose();
} else {
- WRITE_VAR_OFFSET(varX, -1);
- WRITE_VAR_OFFSET(varY, -1);
- WRITE_VAR_OFFSET(varFrames, -1);
- WRITE_VAR_OFFSET(varWidth, -1);
- WRITE_VAR_OFFSET(varHeight, -1);
+ WRITE_VAR_OFFSET(varX, (uint32) -1);
+ WRITE_VAR_OFFSET(varY, (uint32) -1);
+ WRITE_VAR_OFFSET(varFrames, (uint32) -1);
+ WRITE_VAR_OFFSET(varWidth, (uint32) -1);
+ WRITE_VAR_OFFSET(varHeight, (uint32) -1);
}
}
+void VideoPlayer::evalBgShading(CoktelVideo &video) {
+ if (video.isSoundPlaying())
+ _vm->_sound->bgShade();
+ else
+ _vm->_sound->bgUnshade();
+}
+
+void VideoPlayer::notifyPaused(uint32 duration) {
+ if (_primaryVideo->isOpen())
+ _primaryVideo->getVideo()->notifyPaused(duration);
+
+ for (uint i = 0; i < _videoSlots.size(); i++)
+ if (_videoSlots[i] && _videoSlots[i]->isOpen())
+ _videoSlots[i]->getVideo()->notifyPaused(duration);
+}
+
} // End of namespace Gob
diff --git a/engines/gob/videoplayer.h b/engines/gob/videoplayer.h
index fd3c68aa1a..b7aa7313b0 100644
--- a/engines/gob/videoplayer.h
+++ b/engines/gob/videoplayer.h
@@ -68,6 +68,7 @@ public:
uint16 left, uint16 top, uint16 width, uint16 height,
uint16 x, uint16 y, uint16 pitch, int16 transp = -1);
void slotCopyPalette(int slot, int16 palStart = -1, int16 palEnd = -1);
+ void slotWaitEndFrame(int slot, bool onlySound = false);
bool slotIsOpen(int slot) const;
@@ -82,6 +83,8 @@ public:
void writeVideoInfo(const char *videoFile, int16 varX, int16 varY,
int16 varFrames, int16 varWidth, int16 varHeight);
+ void notifyPaused(uint32 duration);
+
private:
class Video {
public:
@@ -127,10 +130,13 @@ private:
const Video *getVideoBySlot(int slot = -1) const;
+ int getNextFreeSlot();
+
void copyPalette(CoktelVideo &video, int16 palStart = -1, int16 palEnd = -1);
bool doPlay(int16 frame, int16 breakKey,
uint16 palCmd, int16 palStart, int16 palEnd,
int16 palFrame, int16 endFrame);
+ void evalBgShading(CoktelVideo &video);
};
} // End of namespace Gob
diff --git a/engines/kyra/animator_hof.cpp b/engines/kyra/animator_hof.cpp
index 9314f8604e..c5d44d10af 100644
--- a/engines/kyra/animator_hof.cpp
+++ b/engines/kyra/animator_hof.cpp
@@ -127,19 +127,15 @@ void KyraEngine_HoF::updateItemAnimations() {
return;
const ItemAnimData_v2 *s = &_itemAnimData[_nextAnimItem];
- ActiveItemAnim *a = &_activeItemAnim[_nextAnimItem];
-
- if (++_nextAnimItem == 14) {
- _nextAnimItem = 0;
- return;
- }
+ ActiveItemAnim *a = &_activeItemAnim[_nextAnimItem];
+ _nextAnimItem = ++_nextAnimItem % _itemAnimDataSize;
uint32 ctime = _system->getMillis();
if (ctime < a->nextFrame)
return;
uint16 shpIdx = s->frames[a->currentFrame].index + 64;
- if ((s->itemIndex == _handItemSet || s->itemIndex == _itemInHand) && (!_mouseState && _screen->isMouseVisible())) {
+ if (s->itemIndex == _mouseState && s->itemIndex == _itemInHand && _screen->isMouseVisible()) {
nextFrame = true;
_screen->setMouseCursor(8, 15, getShapePtr(shpIdx));
}
diff --git a/engines/kyra/animator_v1.cpp b/engines/kyra/animator_lok.cpp
index ea56efd9fb..1baa78b203 100644
--- a/engines/kyra/animator_v1.cpp
+++ b/engines/kyra/animator_lok.cpp
@@ -25,15 +25,15 @@
#include "common/endian.h"
-#include "kyra/kyra_v1.h"
+#include "kyra/kyra_lok.h"
#include "kyra/screen.h"
-#include "kyra/animator_v1.h"
+#include "kyra/animator_lok.h"
#include "kyra/sprites.h"
#include "common/system.h"
namespace Kyra {
-Animator_v1::Animator_v1(KyraEngine_v1 *vm, OSystem *system) {
+Animator_LoK::Animator_LoK(KyraEngine_LoK *vm, OSystem *system) {
_vm = vm;
_screen = vm->screen();
_initOk = false;
@@ -48,14 +48,14 @@ Animator_v1::Animator_v1(KyraEngine_v1 *vm, OSystem *system) {
memset(_actorBkgBackUp[1], 0, _screen->getRectSize(8, 69));
}
-Animator_v1::~Animator_v1() {
+Animator_LoK::~Animator_LoK() {
close();
- delete [] _actorBkgBackUp[0];
- delete [] _actorBkgBackUp[1];
+ delete[] _actorBkgBackUp[0];
+ delete[] _actorBkgBackUp[1];
}
-void Animator_v1::init(int actors_, int items_, int sprites_) {
- debugC(9, kDebugLevelAnimator, "Animator_v1::init(%d, %d, %d)", actors_, items_, sprites_);
+void Animator_LoK::init(int actors_, int items_, int sprites_) {
+ debugC(9, kDebugLevelAnimator, "Animator_LoK::init(%d, %d, %d)", actors_, items_, sprites_);
_screenObjects = new AnimObject[actors_ + items_ + sprites_];
assert(_screenObjects);
memset(_screenObjects, 0, sizeof(AnimObject) * (actors_ + items_ + sprites_));
@@ -67,16 +67,16 @@ void Animator_v1::init(int actors_, int items_, int sprites_) {
_initOk = true;
}
-void Animator_v1::close() {
- debugC(9, kDebugLevelAnimator, "Animator_v1::close()");
+void Animator_LoK::close() {
+ debugC(9, kDebugLevelAnimator, "Animator_LoK::close()");
if (_initOk) {
_initOk = false;
- delete [] _screenObjects;
+ delete[] _screenObjects;
_screenObjects = _actors = _items = _sprites = _objectQueue = 0;
}
}
-void Animator_v1::initAnimStateList() {
+void Animator_LoK::initAnimStateList() {
AnimObject *animStates = _screenObjects;
animStates[0].index = 0;
animStates[0].active = 1;
@@ -118,8 +118,8 @@ void Animator_v1::initAnimStateList() {
}
}
-void Animator_v1::preserveAllBackgrounds() {
- debugC(9, kDebugLevelAnimator, "Animator_v1::preserveAllBackgrounds()");
+void Animator_LoK::preserveAllBackgrounds() {
+ debugC(9, kDebugLevelAnimator, "Animator_LoK::preserveAllBackgrounds()");
uint8 curPage = _screen->_curPage;
_screen->_curPage = 2;
@@ -134,8 +134,8 @@ void Animator_v1::preserveAllBackgrounds() {
_screen->_curPage = curPage;
}
-void Animator_v1::flagAllObjectsForBkgdChange() {
- debugC(9, kDebugLevelAnimator, "Animator_v1::flagAllObjectsForBkgdChange()");
+void Animator_LoK::flagAllObjectsForBkgdChange() {
+ debugC(9, kDebugLevelAnimator, "Animator_LoK::flagAllObjectsForBkgdChange()");
AnimObject *curObject = _objectQueue;
while (curObject) {
curObject->bkgdChangeFlag = 1;
@@ -143,8 +143,8 @@ void Animator_v1::flagAllObjectsForBkgdChange() {
}
}
-void Animator_v1::flagAllObjectsForRefresh() {
- debugC(9, kDebugLevelAnimator, "Animator_v1::flagAllObjectsForRefresh()");
+void Animator_LoK::flagAllObjectsForRefresh() {
+ debugC(9, kDebugLevelAnimator, "Animator_LoK::flagAllObjectsForRefresh()");
AnimObject *curObject = _objectQueue;
while (curObject) {
curObject->refreshFlag = 1;
@@ -152,8 +152,8 @@ void Animator_v1::flagAllObjectsForRefresh() {
}
}
-void Animator_v1::restoreAllObjectBackgrounds() {
- debugC(9, kDebugLevelAnimator, "Animator_v1::restoreAllObjectBackground()");
+void Animator_LoK::restoreAllObjectBackgrounds() {
+ debugC(9, kDebugLevelAnimator, "Animator_LoK::restoreAllObjectBackground()");
AnimObject *curObject = _objectQueue;
_screen->_curPage = 2;
@@ -169,8 +169,8 @@ void Animator_v1::restoreAllObjectBackgrounds() {
_screen->_curPage = 0;
}
-void Animator_v1::preserveAnyChangedBackgrounds() {
- debugC(9, kDebugLevelAnimator, "Animator_v1::preserveAnyChangedBackgrounds()");
+void Animator_LoK::preserveAnyChangedBackgrounds() {
+ debugC(9, kDebugLevelAnimator, "Animator_LoK::preserveAnyChangedBackgrounds()");
AnimObject *curObject = _objectQueue;
_screen->_curPage = 2;
@@ -185,8 +185,8 @@ void Animator_v1::preserveAnyChangedBackgrounds() {
_screen->_curPage = 0;
}
-void Animator_v1::preserveOrRestoreBackground(AnimObject *obj, bool restore) {
- debugC(9, kDebugLevelAnimator, "Animator_v1::preserveOrRestoreBackground(%p, %d)", (const void *)obj, restore);
+void Animator_LoK::preserveOrRestoreBackground(AnimObject *obj, bool restore) {
+ debugC(9, kDebugLevelAnimator, "Animator_LoK::preserveOrRestoreBackground(%p, %d)", (const void *)obj, restore);
int x = 0, y = 0, width = obj->width, height = obj->height;
if (restore) {
@@ -217,8 +217,8 @@ void Animator_v1::preserveOrRestoreBackground(AnimObject *obj, bool restore) {
_screen->copyRegionToBuffer(_screen->_curPage, x << 3, y, width << 3, height, obj->background);
}
-void Animator_v1::prepDrawAllObjects() {
- debugC(9, kDebugLevelAnimator, "Animator_v1::prepDrawAllObjects()");
+void Animator_LoK::prepDrawAllObjects() {
+ debugC(9, kDebugLevelAnimator, "Animator_LoK::prepDrawAllObjects()");
AnimObject *curObject = _objectQueue;
int drawPage = 2;
int flagUnk1 = 0, flagUnk2 = 0, flagUnk3 = 0;
@@ -363,8 +363,8 @@ void Animator_v1::prepDrawAllObjects() {
}
}
-void Animator_v1::copyChangedObjectsForward(int refreshFlag) {
- debugC(9, kDebugLevelAnimator, "Animator_v1::copyChangedObjectsForward(%d)", refreshFlag);
+void Animator_LoK::copyChangedObjectsForward(int refreshFlag) {
+ debugC(9, kDebugLevelAnimator, "Animator_LoK::copyChangedObjectsForward(%d)", refreshFlag);
for (AnimObject *curObject = _objectQueue; curObject; curObject = curObject->nextAnimObject) {
if (curObject->active) {
@@ -404,16 +404,16 @@ void Animator_v1::copyChangedObjectsForward(int refreshFlag) {
}
}
-void Animator_v1::updateAllObjectShapes() {
- debugC(9, kDebugLevelAnimator, "Animator_v1::updateAllObjectShapes()");
+void Animator_LoK::updateAllObjectShapes() {
+ debugC(9, kDebugLevelAnimator, "Animator_LoK::updateAllObjectShapes()");
restoreAllObjectBackgrounds();
preserveAnyChangedBackgrounds();
prepDrawAllObjects();
copyChangedObjectsForward(0);
}
-void Animator_v1::animRemoveGameItem(int index) {
- debugC(9, kDebugLevelAnimator, "Animator_v1::animRemoveGameItem(%d)", index);
+void Animator_LoK::animRemoveGameItem(int index) {
+ debugC(9, kDebugLevelAnimator, "Animator_LoK::animRemoveGameItem(%d)", index);
restoreAllObjectBackgrounds();
AnimObject *animObj = &_items[index];
@@ -427,8 +427,8 @@ void Animator_v1::animRemoveGameItem(int index) {
objectRemoveQueue(_objectQueue, animObj);
}
-void Animator_v1::animAddGameItem(int index, uint16 sceneId) {
- debugC(9, kDebugLevelAnimator, "Animator_v1::animRemoveGameItem(%d, %d)", index, sceneId);
+void Animator_LoK::animAddGameItem(int index, uint16 sceneId) {
+ debugC(9, kDebugLevelAnimator, "Animator_LoK::animRemoveGameItem(%d, %d)", index, sceneId);
restoreAllObjectBackgrounds();
assert(sceneId < _vm->_roomTableSize);
Room *currentRoom = &_vm->_roomTable[sceneId];
@@ -453,8 +453,8 @@ void Animator_v1::animAddGameItem(int index, uint16 sceneId) {
animObj->bkgdChangeFlag = 1;
}
-void Animator_v1::animAddNPC(int character) {
- debugC(9, kDebugLevelAnimator, "Animator_v1::animAddNPC(%d)", character);
+void Animator_LoK::animAddNPC(int character) {
+ debugC(9, kDebugLevelAnimator, "Animator_LoK::animAddNPC(%d)", character);
restoreAllObjectBackgrounds();
AnimObject *animObj = &_actors[character];
const Character *ch = &_vm->_characterList[character];
@@ -478,8 +478,8 @@ void Animator_v1::animAddNPC(int character) {
animObj->bkgdChangeFlag = 1;
}
-Animator_v1::AnimObject *Animator_v1::objectRemoveQueue(AnimObject *queue, AnimObject *rem) {
- debugC(9, kDebugLevelAnimator, "Animator_v1::objectRemoveQueue(%p, %p)", (const void *)queue, (const void *)rem);
+Animator_LoK::AnimObject *Animator_LoK::objectRemoveQueue(AnimObject *queue, AnimObject *rem) {
+ debugC(9, kDebugLevelAnimator, "Animator_LoK::objectRemoveQueue(%p, %p)", (const void *)queue, (const void *)rem);
AnimObject *cur = queue;
AnimObject *prev = queue;
@@ -512,14 +512,14 @@ Animator_v1::AnimObject *Animator_v1::objectRemoveQueue(AnimObject *queue, AnimO
return queue;
}
-Animator_v1::AnimObject *Animator_v1::objectAddHead(AnimObject *queue, AnimObject *head) {
- debugC(9, kDebugLevelAnimator, "Animator_v1::objectAddHead(%p, %p)", (const void *)queue, (const void *)head);
+Animator_LoK::AnimObject *Animator_LoK::objectAddHead(AnimObject *queue, AnimObject *head) {
+ debugC(9, kDebugLevelAnimator, "Animator_LoK::objectAddHead(%p, %p)", (const void *)queue, (const void *)head);
head->nextAnimObject = queue;
return head;
}
-Animator_v1::AnimObject *Animator_v1::objectQueue(AnimObject *queue, AnimObject *add) {
- debugC(9, kDebugLevelAnimator, "Animator_v1::objectQueue(%p, %p)", (const void *)queue, (const void *)add);
+Animator_LoK::AnimObject *Animator_LoK::objectQueue(AnimObject *queue, AnimObject *add) {
+ debugC(9, kDebugLevelAnimator, "Animator_LoK::objectQueue(%p, %p)", (const void *)queue, (const void *)add);
if (add->drawY <= queue->drawY || !queue) {
add->nextAnimObject = queue;
return add;
@@ -544,16 +544,16 @@ Animator_v1::AnimObject *Animator_v1::objectQueue(AnimObject *queue, AnimObject
return queue;
}
-void Animator_v1::addObjectToQueue(AnimObject *object) {
- debugC(9, kDebugLevelAnimator, "Animator_v1::addObjectToQueue(%p)", (const void *)object);
+void Animator_LoK::addObjectToQueue(AnimObject *object) {
+ debugC(9, kDebugLevelAnimator, "Animator_LoK::addObjectToQueue(%p)", (const void *)object);
if (!_objectQueue)
_objectQueue = objectAddHead(0, object);
else
_objectQueue = objectQueue(_objectQueue, object);
}
-void Animator_v1::refreshObject(AnimObject *object) {
- debugC(9, kDebugLevelAnimator, "Animator_v1::refreshObject(%p)", (const void *)object);
+void Animator_LoK::refreshObject(AnimObject *object) {
+ debugC(9, kDebugLevelAnimator, "Animator_LoK::refreshObject(%p)", (const void *)object);
_objectQueue = objectRemoveQueue(_objectQueue, object);
if (_objectQueue)
_objectQueue = objectQueue(_objectQueue, object);
@@ -561,8 +561,8 @@ void Animator_v1::refreshObject(AnimObject *object) {
_objectQueue = objectAddHead(0, object);
}
-void Animator_v1::makeBrandonFaceMouse() {
- debugC(9, kDebugLevelAnimator, "Animator_v1::makeBrandonFaceMouse()");
+void Animator_LoK::makeBrandonFaceMouse() {
+ debugC(9, kDebugLevelAnimator, "Animator_LoK::makeBrandonFaceMouse()");
Common::Point mouse = _vm->getMousePos();
if (mouse.x >= _vm->_currentCharacter->x1)
_vm->_currentCharacter->facing = 3;
@@ -572,22 +572,22 @@ void Animator_v1::makeBrandonFaceMouse() {
updateAllObjectShapes();
}
-int16 Animator_v1::fetchAnimWidth(const uint8 *shape, int16 mult) {
- debugC(9, kDebugLevelAnimator, "Animator_v1::fetchAnimWidth(%p, %d)", (const void *)shape, mult);
+int16 Animator_LoK::fetchAnimWidth(const uint8 *shape, int16 mult) {
+ debugC(9, kDebugLevelAnimator, "Animator_LoK::fetchAnimWidth(%p, %d)", (const void *)shape, mult);
if (_vm->gameFlags().useAltShapeHeader)
shape += 2;
return (((int16)READ_LE_UINT16((shape+3))) * mult) >> 8;
}
-int16 Animator_v1::fetchAnimHeight(const uint8 *shape, int16 mult) {
- debugC(9, kDebugLevelAnimator, "Animator_v1::fetchAnimHeight(%p, %d)", (const void *)shape, mult);
+int16 Animator_LoK::fetchAnimHeight(const uint8 *shape, int16 mult) {
+ debugC(9, kDebugLevelAnimator, "Animator_LoK::fetchAnimHeight(%p, %d)", (const void *)shape, mult);
if (_vm->gameFlags().useAltShapeHeader)
shape += 2;
return (int16)(((int8)*(shape+2)) * mult) >> 8;
}
-void Animator_v1::setBrandonAnimSeqSize(int width, int height) {
- debugC(9, kDebugLevelAnimator, "Animator_v1::setBrandonAnimSeqSize(%d, %d)", width, height);
+void Animator_LoK::setBrandonAnimSeqSize(int width, int height) {
+ debugC(9, kDebugLevelAnimator, "Animator_LoK::setBrandonAnimSeqSize(%d, %d)", width, height);
restoreAllObjectBackgrounds();
_brandonAnimSeqSizeWidth = _actors[0].width;
_brandonAnimSeqSizeHeight = _actors[0].height;
@@ -596,16 +596,16 @@ void Animator_v1::setBrandonAnimSeqSize(int width, int height) {
preserveAllBackgrounds();
}
-void Animator_v1::resetBrandonAnimSeqSize() {
- debugC(9, kDebugLevelAnimator, "Animator_v1::resetBrandonAnimSeqSize()");
+void Animator_LoK::resetBrandonAnimSeqSize() {
+ debugC(9, kDebugLevelAnimator, "Animator_LoK::resetBrandonAnimSeqSize()");
restoreAllObjectBackgrounds();
_actors[0].width = _brandonAnimSeqSizeWidth;
_actors[0].height = _brandonAnimSeqSizeHeight;
preserveAllBackgrounds();
}
-void Animator_v1::animRefreshNPC(int character) {
- debugC(9, kDebugLevelAnimator, "Animator_v1::animRefreshNPC(%d)", character);
+void Animator_LoK::animRefreshNPC(int character) {
+ debugC(9, kDebugLevelAnimator, "Animator_LoK::animRefreshNPC(%d)", character);
AnimObject *animObj = &_actors[character];
Character *ch = &_vm->characterList()[character];
@@ -663,8 +663,8 @@ void Animator_v1::animRefreshNPC(int character) {
refreshObject(animObj);
}
-void Animator_v1::setCharacterDefaultFrame(int character) {
- debugC(9, kDebugLevelAnimator, "Animator_v1::setCharacterDefaultFrame()");
+void Animator_LoK::setCharacterDefaultFrame(int character) {
+ debugC(9, kDebugLevelAnimator, "Animator_LoK::setCharacterDefaultFrame()");
static uint16 initFrameTable[] = {
7, 41, 77, 0, 0
};
@@ -676,8 +676,8 @@ void Animator_v1::setCharacterDefaultFrame(int character) {
// edit->unk6 = 1;
}
-void Animator_v1::setCharactersHeight() {
- debugC(9, kDebugLevelAnimator, "Animator_v1::setCharactersHeight()");
+void Animator_LoK::setCharactersHeight() {
+ debugC(9, kDebugLevelAnimator, "Animator_LoK::setCharactersHeight()");
static int8 initHeightTable[] = {
48, 40, 48, 47, 56,
44, 42, 47, 38, 35,
diff --git a/engines/kyra/animator_v1.h b/engines/kyra/animator_lok.h
index 3ae0b23da4..ba5882c710 100644
--- a/engines/kyra/animator_v1.h
+++ b/engines/kyra/animator_lok.h
@@ -23,14 +23,14 @@
*
*/
-#ifndef KYRA_ANIMATOR_V1_H
-#define KYRA_ANIMATOR_V1_H
+#ifndef KYRA_ANIMATOR_LOK_H
+#define KYRA_ANIMATOR_LOK_H
namespace Kyra {
-class KyraEngine_v1;
+class KyraEngine_LoK;
class Screen;
-class Animator_v1 {
+class Animator_LoK {
public:
struct AnimObject {
uint8 index;
@@ -53,8 +53,8 @@ public:
AnimObject *nextAnimObject;
};
- Animator_v1(KyraEngine_v1 *vm, OSystem *system);
- virtual ~Animator_v1();
+ Animator_LoK(KyraEngine_LoK *vm, OSystem *system);
+ virtual ~Animator_LoK();
operator bool() const { return _initOk; }
@@ -101,7 +101,7 @@ public:
int _brandonScaleY;
protected:
- KyraEngine_v1 *_vm;
+ KyraEngine_LoK *_vm;
Screen *_screen;
OSystem *_system;
bool _initOk;
diff --git a/engines/kyra/animator_mr.cpp b/engines/kyra/animator_mr.cpp
index ab3d347549..9702499fe7 100644
--- a/engines/kyra/animator_mr.cpp
+++ b/engines/kyra/animator_mr.cpp
@@ -196,6 +196,58 @@ void KyraEngine_MR::refreshAnimObjects(int force) {
}
}
+void KyraEngine_MR::updateItemAnimations() {
+ debugC(9, kDebugLevelAnimator, "KyraEngine_MR::updateItemAnimations()");
+ bool nextFrame = false;
+
+ if (_itemAnimData[0].itemIndex == -1)
+ return;
+
+ const ItemAnimData_v2 *s = &_itemAnimData[_nextAnimItem];
+ ActiveItemAnim *a = &_activeItemAnim[_nextAnimItem];
+ _nextAnimItem = ++_nextAnimItem % 10;
+
+ uint32 ctime = _system->getMillis();
+ if (ctime < a->nextFrame)
+ return;
+
+ uint16 shpIdx = s->frames[a->currentFrame].index + 248;
+ if (s->itemIndex == _mouseState && s->itemIndex == _itemInHand && _screen->isMouseVisible()) {
+ nextFrame = true;
+ _screen->setMouseCursor(12, 19, getShapePtr(shpIdx));
+ }
+
+ if (_inventoryState) {
+ for (int i = 0; i < 10; i++) {
+ if (s->itemIndex == _mainCharacter.inventory[i]) {
+ nextFrame = true;
+ _screen->drawShape(2, getShapePtr(422 + i), 9, 0, 0, 0);
+ _screen->drawShape(2, getShapePtr(shpIdx), 9, 0, 0, 0);
+ _screen->hideMouse();
+ _screen->copyRegion(9, 0, _inventoryX[i], _inventoryY[i], 24, 20, 2, 0, Screen::CR_NO_P_CHECK);
+ _screen->showMouse();
+ }
+ }
+ }
+
+ _screen->updateScreen();
+
+ for (int i = 17; i < 66; i++) {
+ AnimObj *animObject = &_animObjects[i];
+ if (animObject->shapeIndex2 == s->itemIndex + 248) {
+ animObject->shapePtr = getShapePtr(shpIdx);
+ animObject->shapeIndex1 = shpIdx;
+ animObject->needRefresh = true;
+ nextFrame = true;
+ }
+ }
+
+ if (nextFrame) {
+ a->nextFrame = _system->getMillis() + (s->frames[a->currentFrame].delay * _tickLength);
+ a->currentFrame = ++a->currentFrame % s->numFrames;
+ }
+}
+
void KyraEngine_MR::updateCharacterAnim(int charId) {
debugC(9, kDebugLevelAnimator, "KyraEngine_MR::updateCharacterAnim(%d)", charId);
diff --git a/engines/kyra/debugger.cpp b/engines/kyra/debugger.cpp
index 51e4d17487..7ae5414d82 100644
--- a/engines/kyra/debugger.cpp
+++ b/engines/kyra/debugger.cpp
@@ -27,7 +27,7 @@
#include "common/config-manager.h"
#include "common/system.h"
#include "kyra/debugger.h"
-#include "kyra/kyra_v1.h"
+#include "kyra/kyra_lok.h"
#include "kyra/kyra_v2.h"
#include "kyra/kyra_hof.h"
#include "kyra/screen.h"
@@ -36,7 +36,7 @@
namespace Kyra {
-Debugger::Debugger(KyraEngine *vm)
+Debugger::Debugger(KyraEngine_v1 *vm)
: ::GUI::Debugger() {
_vm = vm;
@@ -190,22 +190,23 @@ bool Debugger::cmd_setTimerCountdown(int argc, const char **argv) {
#pragma mark -
-Debugger_v1::Debugger_v1(KyraEngine_v1 *vm)
+Debugger_LoK::Debugger_LoK(KyraEngine_LoK *vm)
: Debugger(vm), _vm(vm) {
- DCmd_Register("rooms", WRAP_METHOD(Debugger_v1, cmd_listRooms));
- DCmd_Register("give", WRAP_METHOD(Debugger_v1, cmd_giveItem));
- DCmd_Register("birthstones", WRAP_METHOD(Debugger_v1, cmd_listBirthstones));
+ DCmd_Register("enter", WRAP_METHOD(Debugger_LoK, cmd_enterRoom));
+ DCmd_Register("rooms", WRAP_METHOD(Debugger_LoK, cmd_listRooms));
+ DCmd_Register("give", WRAP_METHOD(Debugger_LoK, cmd_giveItem));
+ DCmd_Register("birthstones", WRAP_METHOD(Debugger_LoK, cmd_listBirthstones));
}
-void Debugger_v1::preEnter() {
+void Debugger_LoK::preEnter() {
//_vm->midi.pause(1);
}
-void Debugger_v1::postEnter() {
+void Debugger_LoK::postEnter() {
//_vm->midi.pause(0);
}
-bool Debugger_v1::cmd_enterRoom(int argc, const char **argv) {
+bool Debugger_LoK::cmd_enterRoom(int argc, const char **argv) {
uint direction = 0;
if (argc > 1) {
int room = atoi(argv[1]);
@@ -244,7 +245,7 @@ bool Debugger_v1::cmd_enterRoom(int argc, const char **argv) {
return true;
}
-bool Debugger_v1::cmd_listRooms(int argc, const char **argv) {
+bool Debugger_LoK::cmd_listRooms(int argc, const char **argv) {
for (int i = 0; i < _vm->_roomTableSize; i++) {
DebugPrintf("%-3i: %-10s", i, _vm->_roomFilenameTable[_vm->_roomTable[i].nameIndex]);
if (!(i % 8))
@@ -255,7 +256,7 @@ bool Debugger_v1::cmd_listRooms(int argc, const char **argv) {
return true;
}
-bool Debugger_v1::cmd_giveItem(int argc, const char **argv) {
+bool Debugger_LoK::cmd_giveItem(int argc, const char **argv) {
if (argc == 2) {
int item = atoi(argv[1]);
@@ -274,7 +275,7 @@ bool Debugger_v1::cmd_giveItem(int argc, const char **argv) {
return true;
}
-bool Debugger_v1::cmd_listBirthstones(int argc, const char **argv) {
+bool Debugger_LoK::cmd_listBirthstones(int argc, const char **argv) {
DebugPrintf("Needed Birthstone gems:\n");
for (int i = 0; i < ARRAYSIZE(_vm->_birthstoneGemTable); ++i)
DebugPrintf("%-2d '%s'\n", _vm->_birthstoneGemTable[i], _vm->_itemList[_vm->_birthstoneGemTable[i]]);
@@ -421,9 +422,8 @@ bool Debugger_v2::cmd_giveItem(int argc, const char **argv) {
if (argc == 2) {
int item = atoi(argv[1]);
- // Kyrandia 2 has only 178 items (-1 to 176), otherwise it will crash
- if (item < -1 || item > 176) {
- DebugPrintf("itemid must be any value between (including) -1 and 176\n");
+ if (item < -1 || item > _vm->engineDesc().maxItemId) {
+ DebugPrintf("itemid must be any value between (including) -1 and %d\n", _vm->engineDesc().maxItemId);
return true;
}
diff --git a/engines/kyra/debugger.h b/engines/kyra/debugger.h
index ab5657bbde..7cdfa26e93 100644
--- a/engines/kyra/debugger.h
+++ b/engines/kyra/debugger.h
@@ -30,18 +30,18 @@
namespace Kyra {
-class KyraEngine;
class KyraEngine_v1;
+class KyraEngine_LoK;
class KyraEngine_v2;
class KyraEngine_HoF;
class Debugger : public ::GUI::Debugger {
public:
- Debugger(KyraEngine *vm);
+ Debugger(KyraEngine_v1 *vm);
virtual ~Debugger() {} // we need this for __SYMBIAN32__ archaic gcc/UIQ
protected:
- KyraEngine *_vm;
+ KyraEngine_v1 *_vm;
bool cmd_setScreenDebug(int argc, const char **argv);
bool cmd_loadPalette(int argc, const char **argv);
@@ -54,13 +54,13 @@ protected:
bool cmd_setTimerCountdown(int argc, const char **argv);
};
-class Debugger_v1 : public Debugger {
+class Debugger_LoK : public Debugger {
public:
- Debugger_v1(KyraEngine_v1 *vm);
- virtual ~Debugger_v1() {} // we need this for __SYMBIAN32__ archaic gcc/UIQ
+ Debugger_LoK(KyraEngine_LoK *vm);
+ virtual ~Debugger_LoK() {} // we need this for __SYMBIAN32__ archaic gcc/UIQ
protected:
- KyraEngine_v1 *_vm;
+ KyraEngine_LoK *_vm;
virtual void preEnter();
virtual void postEnter();
diff --git a/engines/kyra/detection.cpp b/engines/kyra/detection.cpp
index b921314e68..344121b503 100644
--- a/engines/kyra/detection.cpp
+++ b/engines/kyra/detection.cpp
@@ -22,8 +22,8 @@
* $Id$
*/
-#include "kyra/kyra.h"
#include "kyra/kyra_v1.h"
+#include "kyra/kyra_lok.h"
#include "kyra/kyra_hof.h"
#include "kyra/kyra_mr.h"
@@ -41,22 +41,25 @@ struct KYRAGameDescription {
namespace {
-#define FLAGS(x, y, z, a, b, id) { Common::UNK_LANG, Common::kPlatformUnknown, x, y, z, a, b, id }
+#define FLAGS(x, y, z, a, b, c, id) { Common::UNK_LANG, Common::kPlatformUnknown, x, y, z, a, b, c, id }
-#define KYRA1_FLOPPY_FLAGS FLAGS(false, false, false, false, false, Kyra::GI_KYRA1)
-#define KYRA1_AMIGA_FLAGS FLAGS(false, false, false, false, false, Kyra::GI_KYRA1)
-#define KYRA1_TOWNS_FLAGS FLAGS(false, true, false, false, false, Kyra::GI_KYRA1)
-#define KYRA1_TOWNS_SJIS_FLAGS FLAGS(false, true, false, true, false, Kyra::GI_KYRA1)
-#define KYRA1_CD_FLAGS FLAGS(false, true, true, false, false, Kyra::GI_KYRA1)
-#define KYRA1_DEMO_FLAGS FLAGS(true, false, false, false, false, Kyra::GI_KYRA1)
+#define KYRA1_FLOPPY_FLAGS FLAGS(false, false, false, false, false, false, Kyra::GI_KYRA1)
+#define KYRA1_AMIGA_FLAGS FLAGS(false, false, false, false, false, false, Kyra::GI_KYRA1)
+#define KYRA1_TOWNS_FLAGS FLAGS(false, true, false, false, false, false, Kyra::GI_KYRA1)
+#define KYRA1_TOWNS_SJIS_FLAGS FLAGS(false, true, false, true, false, false, Kyra::GI_KYRA1)
+#define KYRA1_CD_FLAGS FLAGS(false, true, true, false, false, false, Kyra::GI_KYRA1)
+#define KYRA1_DEMO_FLAGS FLAGS(true, false, false, false, false, false, Kyra::GI_KYRA1)
-#define KYRA2_CD_FLAGS FLAGS(false, false, true, false, false, Kyra::GI_KYRA2)
-#define KYRA2_CD_DEMO_FLAGS FLAGS(true, false, true, false, false, Kyra::GI_KYRA2)
-#define KYRA2_DEMO_FLAGS FLAGS(true, false, false, false, false, Kyra::GI_KYRA2)
-#define KYRA2_TOWNS_FLAGS FLAGS(false, false, false, false, false, Kyra::GI_KYRA2)
-#define KYRA2_TOWNS_SJIS_FLAGS FLAGS(false, false, false, true, false, Kyra::GI_KYRA2)
+#define KYRA2_FLOPPY_FLAGS FLAGS(false, false, false, false, false, false, Kyra::GI_KYRA2)
+#define KYRA2_FLOPPY_CMP_FLAGS FLAGS(false, false, false, false, false, true, Kyra::GI_KYRA2)
+#define KYRA2_CD_FLAGS FLAGS(false, false, true, false, false, false, Kyra::GI_KYRA2)
+#define KYRA2_CD_DEMO_FLAGS FLAGS(true, false, true, false, false, false, Kyra::GI_KYRA2)
+#define KYRA2_DEMO_FLAGS FLAGS(true, false, false, false, false, false, Kyra::GI_KYRA2)
+#define KYRA2_TOWNS_FLAGS FLAGS(false, false, false, false, false, false, Kyra::GI_KYRA2)
+#define KYRA2_TOWNS_SJIS_FLAGS FLAGS(false, false, false, true, false, false, Kyra::GI_KYRA2)
-#define KYRA3_CD_FLAGS FLAGS(false, false, true, false, true, Kyra::GI_KYRA3)
+#define KYRA3_CD_FLAGS FLAGS(false, false, true, false, true, true, Kyra::GI_KYRA3)
+#define KYRA3_CD_INS_FLAGS FLAGS(false, false, true, false, true, true, Kyra::GI_KYRA3)
const KYRAGameDescription adGameDescs[] = {
{
@@ -279,7 +282,7 @@ const KYRAGameDescription adGameDescs[] = {
AD_ENTRY1("GEMCUT.PAK", "d8327fc4b7a72b23c900fa13aef4093a"),
Common::IT_ITA,
Common::kPlatformPC,
- Common::ADGF_NO_FLAGS
+ Common::ADGF_CD
},
KYRA1_CD_FLAGS
},
@@ -296,6 +299,66 @@ const KYRAGameDescription adGameDescs[] = {
KYRA1_DEMO_FLAGS
},
+ { // Floppy version
+ {
+ "kyra2",
+ 0,
+ AD_ENTRY1("WESTWOOD.001", "3f52dda68c4f7696c8309038be9f4151"),
+ Common::EN_ANY,
+ Common::kPlatformPC,
+ Common::ADGF_NO_FLAGS
+ },
+ KYRA2_FLOPPY_CMP_FLAGS
+ },
+
+ { // Floppy version
+ {
+ "kyra2",
+ 0,
+ AD_ENTRY1("WESTWOOD.001", "d787b9559afddfe058b84c0b3a787224"),
+ Common::DE_DEU,
+ Common::kPlatformPC,
+ Common::ADGF_NO_FLAGS
+ },
+ KYRA2_FLOPPY_CMP_FLAGS
+ },
+
+ { // // Floppy version extracted
+ {
+ "kyra2",
+ "Extracted",
+ AD_ENTRY1("FATE.PAK", "1ba18be685ad8e5a0ab5d46a0ce4d345"),
+ Common::EN_ANY,
+ Common::kPlatformPC,
+ Common::ADGF_NO_FLAGS
+ },
+ KYRA2_FLOPPY_FLAGS
+ },
+
+ { // Floppy version extracted
+ {
+ "kyra2",
+ "Extracted",
+ AD_ENTRY1("FATE.PAK", "262fb69dd8e52e596c7aefc6456f7c1b"),
+ Common::DE_DEU,
+ Common::kPlatformPC,
+ Common::ADGF_NO_FLAGS
+ },
+ KYRA2_FLOPPY_FLAGS
+ },
+
+ { // Floppy version extracted
+ {
+ "kyra2",
+ "Extracted",
+ AD_ENTRY1("FATE.PAK", "f7de11506b4c8fdf64bc763206c3e4e7"),
+ Common::FR_FRA,
+ Common::kPlatformPC,
+ Common::ADGF_NO_FLAGS
+ },
+ KYRA2_FLOPPY_FLAGS
+ },
+
{ // CD version
{
"kyra2",
@@ -401,11 +464,65 @@ const KYRAGameDescription adGameDescs[] = {
KYRA2_TOWNS_SJIS_FLAGS
},
+ // Kyra3
+
+ // non installed version
+ {
+ {
+ "kyra3",
+ 0,
+ {
+ { "ONETIME.PAK", 0, "3833ff312757b8e6147f464cca0a6587", -1 },
+ { "WESTWOOD.001", 0, 0, -1 },
+ { 0, 0, 0, 0 }
+ },
+ Common::EN_ANY,
+ Common::kPlatformPC,
+ Common::ADGF_DROPLANGUAGE
+ },
+ KYRA3_CD_INS_FLAGS
+ },
{
{
"kyra3",
0,
- AD_ENTRY1("ONETIME.PAK", "3833ff312757b8e6147f464cca0a6587"),
+ {
+ { "ONETIME.PAK", 0, "3833ff312757b8e6147f464cca0a6587", -1 },
+ { "WESTWOOD.001", 0, 0, -1 },
+ { 0, 0, 0, 0 }
+ },
+ Common::DE_DEU,
+ Common::kPlatformPC,
+ Common::ADGF_DROPLANGUAGE
+ },
+ KYRA3_CD_INS_FLAGS
+ },
+ {
+ {
+ "kyra3",
+ 0,
+ {
+ { "ONETIME.PAK", 0, "3833ff312757b8e6147f464cca0a6587", -1 },
+ { "WESTWOOD.001", 0, 0, -1 },
+ { 0, 0, 0, 0 }
+ },
+ Common::FR_FRA,
+ Common::kPlatformPC,
+ Common::ADGF_DROPLANGUAGE
+ },
+ KYRA3_CD_INS_FLAGS
+ },
+
+ // installed version
+ {
+ {
+ "kyra3",
+ 0,
+ {
+ { "ONETIME.PAK", 0, "3833ff312757b8e6147f464cca0a6587", -1 },
+ { "AUD.PAK", 0, 0, -1 },
+ { 0, 0, 0, 0 }
+ },
Common::EN_ANY,
Common::kPlatformPC,
Common::ADGF_DROPLANGUAGE
@@ -416,7 +533,11 @@ const KYRAGameDescription adGameDescs[] = {
{
"kyra3",
0,
- AD_ENTRY1("ONETIME.PAK", "3833ff312757b8e6147f464cca0a6587"),
+ {
+ { "ONETIME.PAK", 0, "3833ff312757b8e6147f464cca0a6587", -1 },
+ { "AUD.PAK", 0, 0, -1 },
+ { 0, 0, 0, 0 }
+ },
Common::DE_DEU,
Common::kPlatformPC,
Common::ADGF_DROPLANGUAGE
@@ -427,7 +548,11 @@ const KYRAGameDescription adGameDescs[] = {
{
"kyra3",
0,
- AD_ENTRY1("ONETIME.PAK", "3833ff312757b8e6147f464cca0a6587"),
+ {
+ { "ONETIME.PAK", 0, "3833ff312757b8e6147f464cca0a6587", -1 },
+ { "AUD.PAK", 0, 0, -1 },
+ { 0, 0, 0, 0 }
+ },
Common::FR_FRA,
Common::kPlatformPC,
Common::ADGF_DROPLANGUAGE
@@ -435,7 +560,7 @@ const KYRAGameDescription adGameDescs[] = {
KYRA3_CD_FLAGS
},
- { AD_TABLE_END_MARKER, FLAGS(0, 0, 0, 0, 0, 0) }
+ { AD_TABLE_END_MARKER, FLAGS(0, 0, 0, 0, 0, 0, 0) }
};
const PlainGameDescriptor gameList[] = {
@@ -506,7 +631,7 @@ bool KyraMetaEngine::createInstance(OSystem *syst, Engine **engine, const Common
switch (flags.gameID) {
case Kyra::GI_KYRA1:
- *engine = new Kyra::KyraEngine_v1(syst, flags);
+ *engine = new Kyra::KyraEngine_LoK(syst, flags);
break;
case Kyra::GI_KYRA2:
*engine = new Kyra::KyraEngine_HoF(syst, flags);
@@ -524,7 +649,7 @@ bool KyraMetaEngine::createInstance(OSystem *syst, Engine **engine, const Common
SaveStateList KyraMetaEngine::listSaves(const char *target) const {
Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
- Kyra::KyraEngine::SaveHeader header;
+ Kyra::KyraEngine_v1::SaveHeader header;
Common::String pattern = target;
pattern += ".???";
@@ -540,7 +665,7 @@ SaveStateList KyraMetaEngine::listSaves(const char *target) const {
if (slotNum >= 0 && slotNum <= 999) {
Common::InSaveFile *in = saveFileMan->openForLoading(file->c_str());
if (in) {
- if (Kyra::KyraEngine::readSaveHeader(in, header) == Kyra::KyraEngine::kRSHENoError)
+ if (Kyra::KyraEngine_v1::readSaveHeader(in, header) == Kyra::KyraEngine_v1::kRSHENoError)
saveList.push_back(SaveStateDescriptor(slotNum, header.description, *file));
delete in;
}
diff --git a/engines/kyra/gui.cpp b/engines/kyra/gui.cpp
index d2e02671c9..96ea233025 100644
--- a/engines/kyra/gui.cpp
+++ b/engines/kyra/gui.cpp
@@ -33,10 +33,9 @@
namespace Kyra {
-GUI::GUI(KyraEngine *kyra)
+GUI::GUI(KyraEngine_v1 *kyra)
: _vm(kyra), _screen(kyra->screen()), _text(kyra->text()) {
_menuButtonList = 0;
- _haveScrollButtons = false;
_redrawButtonFunctor = BUTTON_FUNCTOR(GUI, this, &GUI::redrawButtonCallback);
_redrawShadedButtonFunctor = BUTTON_FUNCTOR(GUI, this, &GUI::redrawShadedButtonCallback);
@@ -148,13 +147,12 @@ void GUI::initMenu(Menu &menu) {
}
if (menu.scrollUpButtonX != -1) {
- _haveScrollButtons = true;
-
Button *scrollUpButton = getScrollUpButton();
scrollUpButton->x = menu.scrollUpButtonX + menu.x;
scrollUpButton->y = menu.scrollUpButtonY + menu.y;
scrollUpButton->buttonCallback = getScrollUpButtonHandler();
scrollUpButton->nextButton = 0;
+ scrollUpButton->mouseWheel = -1;
_menuButtonList = addButtonToList(_menuButtonList, scrollUpButton);
updateMenuButton(scrollUpButton);
@@ -164,11 +162,10 @@ void GUI::initMenu(Menu &menu) {
scrollDownButton->y = menu.scrollDownButtonY + menu.y;
scrollDownButton->buttonCallback = getScrollDownButtonHandler();
scrollDownButton->nextButton = 0;
+ scrollDownButton->mouseWheel = 1;
_menuButtonList = addButtonToList(_menuButtonList, scrollDownButton);
updateMenuButton(scrollDownButton);
- } else {
- _haveScrollButtons = false;
}
_screen->showMouse();
@@ -342,7 +339,7 @@ int GUI::getNextSavegameSlot() {
#pragma mark -
-MainMenu::MainMenu(KyraEngine *vm) : _vm(vm), _screen(0) {
+MainMenu::MainMenu(KyraEngine_v1 *vm) : _vm(vm), _screen(0) {
_screen = _vm->screen();
_nextUpdate = 0;
_system = g_system;
@@ -382,7 +379,7 @@ bool MainMenu::getInput() {
while (_system->getEventManager()->pollEvent(event)) {
switch (event.type) {
case Common::EVENT_QUIT:
- _quitFlag = true;
+ _vm->quitGame();
break;
case Common::EVENT_LBUTTONUP:
return true;
@@ -396,7 +393,6 @@ bool MainMenu::getInput() {
int MainMenu::handle(int dim) {
debugC(9, kDebugLevelMain, "MainMenu::handle(%d)", dim);
int command = -1;
- _quitFlag = false;
uint8 colorMap[16];
memset(colorMap, 0, sizeof(colorMap));
@@ -436,7 +432,7 @@ int MainMenu::handle(int dim) {
Common::Rect menuRect(x + 16, y + 4, x + width - 16, y + 4 + fh * 4);
- while (!_quitFlag) {
+ while (!_vm->quit()) {
updateAnimation();
bool mousePressed = getInput();
@@ -467,7 +463,7 @@ int MainMenu::handle(int dim) {
_system->delayMillis(10);
}
- if (_quitFlag)
+ if (_vm->quit())
command = -1;
_screen->copyRegion(backUpX, backUpY, backUpX, backUpY, backUpWidth, backUpHeight, 3, 0);
diff --git a/engines/kyra/gui.h b/engines/kyra/gui.h
index a04ac20de3..1361bdb399 100644
--- a/engines/kyra/gui.h
+++ b/engines/kyra/gui.h
@@ -26,7 +26,7 @@
#ifndef KYRA_GUI_H
#define KYRA_GUI_H
-#include "kyra/kyra.h"
+#include "kyra/kyra_v1.h"
#include "common/ptr.h"
#include "common/array.h"
@@ -75,6 +75,8 @@ struct Button {
uint16 flags2;
+ int8 mouseWheel;
+
Callback buttonCallback;
};
@@ -133,14 +135,14 @@ class TextDisplayer;
class GUI {
public:
- GUI(KyraEngine *vm);
+ GUI(KyraEngine_v1 *vm);
virtual ~GUI() {}
// button specific
virtual Button *addButtonToList(Button *list, Button *newButton);
virtual void processButton(Button *button) = 0;
- virtual int processButtonList(Button *buttonList, uint16 inputFlags) = 0;
+ virtual int processButtonList(Button *buttonList, uint16 inputFlags, int8 mouseWheel) = 0;
virtual int redrawShadedButtonCallback(Button *button);
virtual int redrawButtonCallback(Button *button);
@@ -152,12 +154,11 @@ public:
void processHighlights(Menu &menu, int mouseX, int mouseY);
protected:
- KyraEngine *_vm;
+ KyraEngine_v1 *_vm;
Screen *_screen;
TextDisplayer *_text;
Button *_menuButtonList;
- bool _haveScrollButtons;
bool _displayMenu;
bool _displaySubMenu;
bool _cancelSubMenu;
@@ -195,7 +196,7 @@ class Movie;
class MainMenu {
public:
- MainMenu(KyraEngine *vm);
+ MainMenu(KyraEngine_v1 *vm);
virtual ~MainMenu() {}
struct Animation {
@@ -218,12 +219,10 @@ public:
void init(StaticData data, Animation anim);
int handle(int dim);
private:
- KyraEngine *_vm;
+ KyraEngine_v1 *_vm;
Screen *_screen;
OSystem *_system;
- bool _quitFlag;
-
StaticData _static;
struct AnimIntern {
int curFrame;
diff --git a/engines/kyra/gui_hof.cpp b/engines/kyra/gui_hof.cpp
index d1fcaa4712..555934cb7f 100644
--- a/engines/kyra/gui_hof.cpp
+++ b/engines/kyra/gui_hof.cpp
@@ -23,7 +23,7 @@
*
*/
-#include "kyra/kyra.h"
+#include "kyra/kyra_v1.h"
#include "kyra/kyra_hof.h"
#include "kyra/screen.h"
#include "kyra/wsamovie.h"
@@ -271,7 +271,7 @@ void KyraEngine_HoF::redrawInventory(int page) {
}
void KyraEngine_HoF::scrollInventoryWheel() {
- WSAMovieV2 movie(this, _screen);
+ WSAMovie_v2 movie(this, _screen);
movie.open("INVWHEEL.WSA", 0, 0);
int frames = movie.opened() ? movie.frames() : 6;
memcpy(_screenBuffer, _screen->getCPagePtr(2), 64000);
@@ -348,7 +348,7 @@ int KyraEngine_HoF::bookButton(Button *button) {
return 0;
}
- if (_handItemSet != -1) {
+ if (_mouseState != -1) {
snd_playSoundEffect(0x0D);
return 0;
}
@@ -455,12 +455,12 @@ void KyraEngine_HoF::showBookPage() {
char filename[16];
sprintf(filename, "PAGE%.01X.", _bookCurPage);
- strcat(filename, _languageExtension[_lang]);
+ strcat(filename, (_flags.isTalkie || _flags.platform == Common::kPlatformFMTowns || _lang) ? _languageExtension[_lang] : "TXT");
uint8 *leftPage = _res->fileData(filename, 0);
int leftPageY = _bookPageYOffset[_bookCurPage];
sprintf(filename, "PAGE%.01X.", _bookCurPage+1);
- strcat(filename, _languageExtension[_lang]);
+ strcat(filename, (_flags.isTalkie || _flags.platform == Common::kPlatformFMTowns || _lang) ? _languageExtension[_lang] : "TXT");
uint8 *rightPage = (_bookCurPage != _bookMaxPage) ? _res->fileData(filename, 0) : 0;
int rightPageY = _bookPageYOffset[_bookCurPage+1];
@@ -468,13 +468,13 @@ void KyraEngine_HoF::showBookPage() {
if (leftPage) {
bookDecodeText(leftPage);
bookPrintText(2, leftPage, 20, leftPageY+20, 0x31);
- delete [] leftPage;
+ delete[] leftPage;
}
if (rightPage) {
bookDecodeText(rightPage);
bookPrintText(2, rightPage, 176, rightPageY+20, 0x31);
- delete [] rightPage;
+ delete[] rightPage;
}
_screen->showMouse();
}
@@ -515,6 +515,7 @@ void KyraEngine_HoF::bookLoop() {
_screen->updateScreen();
_screen->showMouse();
}
+ _system->delayMillis(10);
}
_screen->clearPage(2);
}
@@ -600,7 +601,7 @@ int KyraEngine_HoF::cauldronButton(Button *button) {
return 0;
}
- if (!_screen->isMouseVisible() || _handItemSet < -1)
+ if (!_screen->isMouseVisible() || _mouseState < -1)
return 0;
if (queryGameFlag(0xE4)) {
@@ -666,6 +667,8 @@ int KyraEngine_HoF::cauldronButton(Button *button) {
#pragma mark -
int GUI_HoF::optionsButton(Button *button) {
+ PauseTimer pause(*_vm->_timer);
+
_restartGame = false;
_reloadTemporarySave = false;
@@ -678,8 +681,8 @@ int GUI_HoF::optionsButton(Button *button) {
_vm->showMessage(0, 0xCF);
- if (_vm->_handItemSet < -1) {
- _vm->_handItemSet = -1;
+ if (_vm->_mouseState < -1) {
+ _vm->_mouseState = -1;
_screen->hideMouse();
_screen->setMouseCursor(1, 1, _vm->getShapePtr(0));
_screen->showMouse();
@@ -824,10 +827,10 @@ void GUI_HoF::drawSliderBar(int slider, const uint8 *shape) {
int position = 0;
if (_vm->gameFlags().isTalkie) {
- position = _vm->getVolume(KyraEngine::kVolumeEntry(slider));
+ position = _vm->getVolume(KyraEngine_v1::kVolumeEntry(slider));
} else {
if (slider < 2)
- position = _vm->getVolume(KyraEngine::kVolumeEntry(slider));
+ position = _vm->getVolume(KyraEngine_v1::kVolumeEntry(slider));
else if (slider == 2)
position = (_vm->_configWalkspeed == 3) ? 97 : 2;
else if (slider == 3)
@@ -897,7 +900,7 @@ int GUI_HoF::audioOptions(Button *caller) {
restorePage1(_vm->_screenBuffer);
backUpPage1(_vm->_screenBuffer);
- if (speechEnabled && !_vm->textEnabled() && (!_vm->speechEnabled() || _vm->getVolume(KyraEngine::kVolumeSpeech) == 2)) {
+ if (speechEnabled && !_vm->textEnabled() && (!_vm->speechEnabled() || _vm->getVolume(KyraEngine_v1::kVolumeSpeech) == 2)) {
_vm->_configVoice = 0;
choiceDialog(0x1D, 0);
}
@@ -975,7 +978,7 @@ int GUI_HoF::gameOptionsTalkie(Button *caller) {
if (textEnabled && !_vm->textEnabled() && !_vm->speechEnabled()) {
_vm->_configVoice = 1;
- _vm->setVolume(KyraEngine::kVolumeSpeech, 75);
+ _vm->setVolume(KyraEngine_v1::kVolumeSpeech, 75);
choiceDialog(0x1E, 0);
}
@@ -1051,10 +1054,10 @@ int GUI_HoF::sliderHandler(Button *caller) {
int oldVolume = 0;
if (_vm->gameFlags().isTalkie) {
- oldVolume = _vm->getVolume(KyraEngine::kVolumeEntry(button));
+ oldVolume = _vm->getVolume(KyraEngine_v1::kVolumeEntry(button));
} else {
if (button < 2)
- oldVolume = _vm->getVolume(KyraEngine::kVolumeEntry(button));
+ oldVolume = _vm->getVolume(KyraEngine_v1::kVolumeEntry(button));
else if (button == 2)
oldVolume = (_vm->_configWalkspeed == 3) ? 97 : 2;
else if (button == 3)
@@ -1089,7 +1092,7 @@ int GUI_HoF::sliderHandler(Button *caller) {
_vm->_configVoice = 1;
}
- _vm->setVolume(KyraEngine::kVolumeEntry(button), newVolume);
+ _vm->setVolume(KyraEngine_v1::kVolumeEntry(button), newVolume);
switch (button) {
case 0:
@@ -1109,7 +1112,7 @@ int GUI_HoF::sliderHandler(Button *caller) {
}
} else {
if (button < 2) {
- _vm->setVolume(KyraEngine::kVolumeEntry(button), newVolume);
+ _vm->setVolume(KyraEngine_v1::kVolumeEntry(button), newVolume);
if (button == 0)
lastMusicCommand = _vm->_lastMusicCommand;
else
@@ -1126,7 +1129,7 @@ int GUI_HoF::sliderHandler(Button *caller) {
if (playSoundEffect)
_vm->snd_playSoundEffect(0x18);
else if (lastMusicCommand >= 0)
- _vm->snd_playWanderScoreViaMap(lastMusicCommand, 1);
+ _vm->snd_playWanderScoreViaMap(lastMusicCommand, 0);
_screen->updateScreen();
return 0;
diff --git a/engines/kyra/gui_v1.cpp b/engines/kyra/gui_lok.cpp
index e5a0c42281..6fa30c9e9a 100644
--- a/engines/kyra/gui_v1.cpp
+++ b/engines/kyra/gui_lok.cpp
@@ -23,13 +23,14 @@
*
*/
-#include "kyra/kyra_v1.h"
+#include "kyra/kyra_lok.h"
#include "kyra/screen.h"
#include "kyra/script.h"
#include "kyra/text.h"
-#include "kyra/animator_v1.h"
+#include "kyra/animator_lok.h"
#include "kyra/sound.h"
-#include "kyra/gui_v1.h"
+#include "kyra/gui_lok.h"
+#include "kyra/timer.h"
#include "common/config-manager.h"
#include "common/savefile.h"
@@ -38,13 +39,13 @@
namespace Kyra {
-void KyraEngine_v1::initMainButtonList() {
+void KyraEngine_LoK::initMainButtonList() {
_buttonList = &_buttonData[0];
for (int i = 0; _buttonDataListPtr[i]; ++i)
_buttonList = _gui->addButtonToList(_buttonList, _buttonDataListPtr[i]);
}
-int KyraEngine_v1::buttonInventoryCallback(Button *caller) {
+int KyraEngine_LoK::buttonInventoryCallback(Button *caller) {
int itemOffset = caller->index - 2;
uint8 inventoryItem = _currentCharacter->inventoryItems[itemOffset];
if (_itemInHand == -1) {
@@ -88,7 +89,7 @@ int KyraEngine_v1::buttonInventoryCallback(Button *caller) {
return 0;
}
-int KyraEngine_v1::buttonAmuletCallback(Button *caller) {
+int KyraEngine_LoK::buttonAmuletCallback(Button *caller) {
if (!(_deathHandler & 8))
return 1;
int jewel = caller->index - 0x14;
@@ -186,30 +187,30 @@ int KyraEngine_v1::buttonAmuletCallback(Button *caller) {
#pragma mark -
-GUI_v1::GUI_v1(KyraEngine_v1 *vm, Screen_v1 *screen) : GUI(vm), _vm(vm), _screen(screen) {
+GUI_LoK::GUI_LoK(KyraEngine_LoK *vm, Screen_LoK *screen) : GUI(vm), _vm(vm), _screen(screen) {
_menu = 0;
initStaticResource();
- _scrollUpFunctor = BUTTON_FUNCTOR(GUI_v1, this, &GUI_v1::scrollUp);
- _scrollDownFunctor = BUTTON_FUNCTOR(GUI_v1, this, &GUI_v1::scrollDown);
+ _scrollUpFunctor = BUTTON_FUNCTOR(GUI_LoK, this, &GUI_LoK::scrollUp);
+ _scrollDownFunctor = BUTTON_FUNCTOR(GUI_LoK, this, &GUI_LoK::scrollDown);
}
-GUI_v1::~GUI_v1() {
- delete [] _menu;
+GUI_LoK::~GUI_LoK() {
+ delete[] _menu;
}
-int GUI_v1::processButtonList(Button *list, uint16 inputFlag) {
- if (_haveScrollButtons) {
- if (_mouseWheel < 0)
- scrollUp(&_scrollUpButton);
- else if (_mouseWheel > 0)
- scrollDown(&_scrollDownButton);
- }
+int GUI_LoK::processButtonList(Button *list, uint16 inputFlag, int8 mouseWheel) {
while (list) {
if (list->flags & 8) {
list = list->nextButton;
continue;
}
+ if (mouseWheel && list->mouseWheel == mouseWheel && list->buttonCallback) {
+ if ((*list->buttonCallback.get())(list)) {
+ break;
+ }
+ }
+
int x = list->x;
int y = list->y;
assert(_screen->getScreenDim(list->dimTableIndex) != 0);
@@ -271,7 +272,7 @@ int GUI_v1::processButtonList(Button *list, uint16 inputFlag) {
return 0;
}
-void GUI_v1::processButton(Button *button) {
+void GUI_LoK::processButton(Button *button) {
if (!button)
return;
@@ -315,7 +316,7 @@ void GUI_v1::processButton(Button *button) {
(*callback.get())(button);
}
-void GUI_v1::setGUILabels() {
+void GUI_LoK::setGUILabels() {
int offset = 0;
int offsetOptions = 0;
int offsetMainMenu = 0;
@@ -336,6 +337,8 @@ void GUI_v1::setGUILabels() {
} else if (_vm->gameFlags().lang == Common::ES_ESP) {
offsetOn = offsetMainMenu = offsetOptions = offset = -4;
menuLabelGarbageOffset = 72;
+ } else if (_vm->gameFlags().lang == Common::IT_ITA) {
+ offsetOn = offsetMainMenu = offsetOptions = offset = 32;
} else if (_vm->gameFlags().lang == Common::DE_DEU) {
offset = offsetMainMenu = offsetOn = offsetOptions = 24;
} else if (_vm->gameFlags().platform == Common::kPlatformFMTowns || _vm->gameFlags().platform == Common::kPlatformPC98) {
@@ -405,7 +408,9 @@ void GUI_v1::setGUILabels() {
_onCDString = _vm->_guiStrings[21];
}
-int GUI_v1::buttonMenuCallback(Button *caller) {
+int GUI_LoK::buttonMenuCallback(Button *caller) {
+ PauseTimer pause(*_vm->_timer);
+
_displayMenu = true;
assert(_vm->_guiStrings);
@@ -420,7 +425,7 @@ int GUI_v1::buttonMenuCallback(Button *caller) {
*/
setGUILabels();
- if (_vm->_currentCharacter->sceneId == 210 && _vm->_deathHandler == 0xFF) {
+ if (_vm->_currentCharacter->sceneId == 210 && _vm->_deathHandler == -1) {
_vm->snd_playSoundEffect(0x36);
return 0;
}
@@ -457,7 +462,7 @@ int GUI_v1::buttonMenuCallback(Button *caller) {
while (_displayMenu && !_vm->_quitFlag) {
Common::Point mouse = _vm->getMousePos();
processHighlights(_menu[_toplevelMenu], mouse.x, mouse.y);
- processButtonList(_menuButtonList, 0);
+ processButtonList(_menuButtonList, 0, 0);
getInput();
}
@@ -472,7 +477,7 @@ int GUI_v1::buttonMenuCallback(Button *caller) {
return 0;
}
-void GUI_v1::getInput() {
+void GUI_LoK::getInput() {
Common::Event event;
static uint32 lastScreenUpdate = 0;
uint32 now = _vm->_system->getMillis();
@@ -515,15 +520,15 @@ void GUI_v1::getInput() {
_vm->_system->delayMillis(3);
}
-int GUI_v1::resumeGame(Button *button) {
- debugC(9, kDebugLevelGUI, "GUI_v1::resumeGame()");
+int GUI_LoK::resumeGame(Button *button) {
+ debugC(9, kDebugLevelGUI, "GUI_LoK::resumeGame()");
updateMenuButton(button);
_displayMenu = false;
return 0;
}
-void GUI_v1::setupSavegames(Menu &menu, int num) {
+void GUI_LoK::setupSavegames(Menu &menu, int num) {
Common::InSaveFile *in;
static char savenames[5][31];
uint8 startSlot;
@@ -541,7 +546,7 @@ void GUI_v1::setupSavegames(Menu &menu, int num) {
for (int i = startSlot; i < num; ++i)
menu.item[i].enabled = 0;
- KyraEngine::SaveHeader header;
+ KyraEngine_v1::SaveHeader header;
for (int i = startSlot; i < num && uint(_savegameOffset + i) < _saveSlots.size(); i++) {
if ((in = _vm->openSaveForReading(_vm->getSavegameFilename(_saveSlots[i + _savegameOffset]), header))) {
strncpy(savenames[i], header.description.c_str(), 31);
@@ -553,8 +558,8 @@ void GUI_v1::setupSavegames(Menu &menu, int num) {
}
}
-int GUI_v1::saveGameMenu(Button *button) {
- debugC(9, kDebugLevelGUI, "GUI_v1::saveGameMenu()");
+int GUI_LoK::saveGameMenu(Button *button) {
+ debugC(9, kDebugLevelGUI, "GUI_LoK::saveGameMenu()");
updateSaveList();
updateMenuButton(button);
@@ -566,7 +571,7 @@ int GUI_v1::saveGameMenu(Button *button) {
_menu[2].menuNameString = _vm->_guiStrings[8]; // Select a position to save to:
_specialSavegameString = _vm->_guiStrings[9]; // [ EMPTY SLOT ]
for (int i = 0; i < 5; i++)
- _menu[2].item[i].callback = BUTTON_FUNCTOR(GUI_v1, this, &GUI_v1::saveGame);
+ _menu[2].item[i].callback = BUTTON_FUNCTOR(GUI_LoK, this, &GUI_LoK::saveGame);
_savegameOffset = 0;
setupSavegames(_menu[2], 5);
@@ -581,7 +586,7 @@ int GUI_v1::saveGameMenu(Button *button) {
getInput();
Common::Point mouse = _vm->getMousePos();
processHighlights(_menu[2], mouse.x, mouse.y);
- processButtonList(_menuButtonList, 0);
+ processButtonList(_menuButtonList, 0, _mouseWheel);
}
_screen->loadPageFromDisk("SEENPAGE.TMP", 0);
@@ -596,8 +601,8 @@ int GUI_v1::saveGameMenu(Button *button) {
return 0;
}
-int GUI_v1::loadGameMenu(Button *button) {
- debugC(9, kDebugLevelGUI, "GUI_v1::loadGameMenu()");
+int GUI_LoK::loadGameMenu(Button *button) {
+ debugC(9, kDebugLevelGUI, "GUI_LoK::loadGameMenu()");
updateSaveList();
if (_vm->_menuDirectlyToLoad) {
@@ -613,7 +618,7 @@ int GUI_v1::loadGameMenu(Button *button) {
_specialSavegameString = _vm->_newGameString[0]; //[ START A NEW GAME ]
_menu[2].menuNameString = _vm->_guiStrings[7]; // Which game would you like to reload?
for (int i = 0; i < 5; i++)
- _menu[2].item[i].callback = BUTTON_FUNCTOR(GUI_v1, this, &GUI_v1::loadGame);
+ _menu[2].item[i].callback = BUTTON_FUNCTOR(GUI_LoK, this, &GUI_LoK::loadGame);
_savegameOffset = 0;
setupSavegames(_menu[2], 5);
@@ -630,7 +635,7 @@ int GUI_v1::loadGameMenu(Button *button) {
getInput();
Common::Point mouse = _vm->getMousePos();
processHighlights(_menu[2], mouse.x, mouse.y);
- processButtonList(_menuButtonList, 0);
+ processButtonList(_menuButtonList, 0, _mouseWheel);
}
_screen->loadPageFromDisk("SEENPAGE.TMP", 0);
@@ -649,7 +654,7 @@ int GUI_v1::loadGameMenu(Button *button) {
return 0;
}
-void GUI_v1::redrawTextfield() {
+void GUI_LoK::redrawTextfield() {
_screen->fillRect(38, 91, 287, 102, 250);
_text->printText(_savegameName, 38, 92, 253, 0, 0);
@@ -661,7 +666,7 @@ void GUI_v1::redrawTextfield() {
_screen->updateScreen();
}
-void GUI_v1::updateSavegameString() {
+void GUI_LoK::updateSavegameString() {
int length;
if (_keyPressed.keycode) {
@@ -688,8 +693,8 @@ void GUI_v1::updateSavegameString() {
_keyPressed.reset();
}
-int GUI_v1::saveGame(Button *button) {
- debugC(9, kDebugLevelGUI, "GUI_v1::saveGame()");
+int GUI_LoK::saveGame(Button *button) {
+ debugC(9, kDebugLevelGUI, "GUI_LoK::saveGame()");
updateMenuButton(button);
_vm->_gameToLoad = _menu[2].item[button->index-0xC].saveSlot;
@@ -719,7 +724,7 @@ int GUI_v1::saveGame(Button *button) {
updateSavegameString();
Common::Point mouse = _vm->getMousePos();
processHighlights(_menu[3], mouse.x, mouse.y);
- processButtonList(_menuButtonList, 0);
+ processButtonList(_menuButtonList, 0, 0);
}
if (_cancelSubMenu) {
@@ -737,16 +742,16 @@ int GUI_v1::saveGame(Button *button) {
return 0;
}
-int GUI_v1::savegameConfirm(Button *button) {
- debugC(9, kDebugLevelGUI, "GUI_v1::savegameConfirm()");
+int GUI_LoK::savegameConfirm(Button *button) {
+ debugC(9, kDebugLevelGUI, "GUI_LoK::savegameConfirm()");
updateMenuButton(button);
_displaySubMenu = false;
return 0;
}
-int GUI_v1::loadGame(Button *button) {
- debugC(9, kDebugLevelGUI, "GUI_v1::loadGame()");
+int GUI_LoK::loadGame(Button *button) {
+ debugC(9, kDebugLevelGUI, "GUI_LoK::loadGame()");
updateMenuButton(button);
_displaySubMenu = false;
_vm->_gameToLoad = _menu[2].item[button->index-0xC].saveSlot;
@@ -754,8 +759,8 @@ int GUI_v1::loadGame(Button *button) {
return 0;
}
-int GUI_v1::cancelSubMenu(Button *button) {
- debugC(9, kDebugLevelGUI, "GUI_v1::cancelSubMenu()");
+int GUI_LoK::cancelSubMenu(Button *button) {
+ debugC(9, kDebugLevelGUI, "GUI_LoK::cancelSubMenu()");
updateMenuButton(button);
_displaySubMenu = false;
_cancelSubMenu = true;
@@ -763,8 +768,8 @@ int GUI_v1::cancelSubMenu(Button *button) {
return 0;
}
-int GUI_v1::quitPlaying(Button *button) {
- debugC(9, kDebugLevelGUI, "GUI_v1::quitPlaying()");
+int GUI_LoK::quitPlaying(Button *button) {
+ debugC(9, kDebugLevelGUI, "GUI_LoK::quitPlaying()");
updateMenuButton(button);
if (quitConfirm(_vm->_guiStrings[14])) { // Are you sure you want to quit playing?
@@ -777,8 +782,8 @@ int GUI_v1::quitPlaying(Button *button) {
return 0;
}
-bool GUI_v1::quitConfirm(const char *str) {
- debugC(9, kDebugLevelGUI, "GUI_v1::quitConfirm()");
+bool GUI_LoK::quitConfirm(const char *str) {
+ debugC(9, kDebugLevelGUI, "GUI_LoK::quitConfirm()");
_screen->loadPageFromDisk("SEENPAGE.TMP", 0);
_screen->savePageToDisk("SEENPAGE.TMP", 0);
@@ -794,7 +799,7 @@ bool GUI_v1::quitConfirm(const char *str) {
getInput();
Common::Point mouse = _vm->getMousePos();
processHighlights(_menu[1], mouse.x, mouse.y);
- processButtonList(_menuButtonList, 0);
+ processButtonList(_menuButtonList, 0, 0);
}
_screen->loadPageFromDisk("SEENPAGE.TMP", 0);
@@ -803,8 +808,8 @@ bool GUI_v1::quitConfirm(const char *str) {
return !_cancelSubMenu;
}
-int GUI_v1::quitConfirmYes(Button *button) {
- debugC(9, kDebugLevelGUI, "GUI_v1::quitConfirmYes()");
+int GUI_LoK::quitConfirmYes(Button *button) {
+ debugC(9, kDebugLevelGUI, "GUI_LoK::quitConfirmYes()");
updateMenuButton(button);
_displaySubMenu = false;
_cancelSubMenu = false;
@@ -812,8 +817,8 @@ int GUI_v1::quitConfirmYes(Button *button) {
return 0;
}
-int GUI_v1::quitConfirmNo(Button *button) {
- debugC(9, kDebugLevelGUI, "GUI_v1::quitConfirmNo()");
+int GUI_LoK::quitConfirmNo(Button *button) {
+ debugC(9, kDebugLevelGUI, "GUI_LoK::quitConfirmNo()");
updateMenuButton(button);
_displaySubMenu = false;
_cancelSubMenu = true;
@@ -821,8 +826,8 @@ int GUI_v1::quitConfirmNo(Button *button) {
return 0;
}
-int GUI_v1::gameControlsMenu(Button *button) {
- debugC(9, kDebugLevelGUI, "GUI_v1::gameControlsMenu()");
+int GUI_LoK::gameControlsMenu(Button *button) {
+ debugC(9, kDebugLevelGUI, "GUI_LoK::gameControlsMenu()");
_vm->readSettings();
@@ -839,14 +844,14 @@ int GUI_v1::gameControlsMenu(Button *button) {
}
_menu[5].item[3].labelString = _voiceTextString; //"Voice / Text "
- _menu[5].item[3].callback = BUTTON_FUNCTOR(GUI_v1, this, &GUI_v1::controlsChangeVoice);
+ _menu[5].item[3].callback = BUTTON_FUNCTOR(GUI_LoK, this, &GUI_LoK::controlsChangeVoice);
} else {
//_menu[5].height = 136;
//_menu[5].item[5].y = 110;
_menu[5].item[4].enabled = 0;
_menu[5].item[3].labelString = _textSpeedString; // "Text speed "
- _menu[5].item[3].callback = BUTTON_FUNCTOR(GUI_v1, this, &GUI_v1::controlsChangeText);
+ _menu[5].item[3].callback = BUTTON_FUNCTOR(GUI_LoK, this, &GUI_LoK::controlsChangeText);
}
setupControls(_menu[5]);
@@ -860,7 +865,7 @@ int GUI_v1::gameControlsMenu(Button *button) {
getInput();
Common::Point mouse = _vm->getMousePos();
processHighlights(_menu[5], mouse.x, mouse.y);
- processButtonList(_menuButtonList, 0);
+ processButtonList(_menuButtonList, 0, 0);
}
_screen->loadPageFromDisk("SEENPAGE.TMP", 0);
@@ -873,8 +878,8 @@ int GUI_v1::gameControlsMenu(Button *button) {
return 0;
}
-void GUI_v1::setupControls(Menu &menu) {
- debugC(9, kDebugLevelGUI, "GUI_v1::setupControls()");
+void GUI_LoK::setupControls(Menu &menu) {
+ debugC(9, kDebugLevelGUI, "GUI_LoK::setupControls()");
switch (_vm->_configMusic) {
case 0:
@@ -970,8 +975,8 @@ void GUI_v1::setupControls(Menu &menu) {
initMenu(menu);
}
-int GUI_v1::controlsChangeMusic(Button *button) {
- debugC(9, kDebugLevelGUI, "GUI_v1::controlsChangeMusic()");
+int GUI_LoK::controlsChangeMusic(Button *button) {
+ debugC(9, kDebugLevelGUI, "GUI_LoK::controlsChangeMusic()");
updateMenuButton(button);
_vm->_configMusic = ++_vm->_configMusic % ((_vm->gameFlags().platform == Common::kPlatformFMTowns || _vm->gameFlags().platform == Common::kPlatformPC98) ? 3 : 2);
@@ -979,8 +984,8 @@ int GUI_v1::controlsChangeMusic(Button *button) {
return 0;
}
-int GUI_v1::controlsChangeSounds(Button *button) {
- debugC(9, kDebugLevelGUI, "GUI_v1::controlsChangeSounds()");
+int GUI_LoK::controlsChangeSounds(Button *button) {
+ debugC(9, kDebugLevelGUI, "GUI_LoK::controlsChangeSounds()");
updateMenuButton(button);
_vm->_configSounds = !_vm->_configSounds;
@@ -988,8 +993,8 @@ int GUI_v1::controlsChangeSounds(Button *button) {
return 0;
}
-int GUI_v1::controlsChangeWalk(Button *button) {
- debugC(9, kDebugLevelGUI, "GUI_v1::controlsChangeWalk()");
+int GUI_LoK::controlsChangeWalk(Button *button) {
+ debugC(9, kDebugLevelGUI, "GUI_LoK::controlsChangeWalk()");
updateMenuButton(button);
_vm->_configWalkspeed = ++_vm->_configWalkspeed % 5;
@@ -998,8 +1003,8 @@ int GUI_v1::controlsChangeWalk(Button *button) {
return 0;
}
-int GUI_v1::controlsChangeText(Button *button) {
- debugC(9, kDebugLevelGUI, "GUI_v1::controlsChangeText()");
+int GUI_LoK::controlsChangeText(Button *button) {
+ debugC(9, kDebugLevelGUI, "GUI_LoK::controlsChangeText()");
updateMenuButton(button);
_vm->_configTextspeed = ++_vm->_configTextspeed % 4;
@@ -1007,8 +1012,8 @@ int GUI_v1::controlsChangeText(Button *button) {
return 0;
}
-int GUI_v1::controlsChangeVoice(Button *button) {
- debugC(9, kDebugLevelGUI, "GUI_v1::controlsChangeVoice()");
+int GUI_LoK::controlsChangeVoice(Button *button) {
+ debugC(9, kDebugLevelGUI, "GUI_LoK::controlsChangeVoice()");
updateMenuButton(button);
_vm->_configVoice = ++_vm->_configVoice % 3;
@@ -1016,14 +1021,14 @@ int GUI_v1::controlsChangeVoice(Button *button) {
return 0;
}
-int GUI_v1::controlsApply(Button *button) {
- debugC(9, kDebugLevelGUI, "GUI_v1::controlsApply()");
+int GUI_LoK::controlsApply(Button *button) {
+ debugC(9, kDebugLevelGUI, "GUI_LoK::controlsApply()");
_vm->writeSettings();
return cancelSubMenu(button);
}
-int GUI_v1::scrollUp(Button *button) {
- debugC(9, kDebugLevelGUI, "GUI_v1::scrollUp()");
+int GUI_LoK::scrollUp(Button *button) {
+ debugC(9, kDebugLevelGUI, "GUI_LoK::scrollUp()");
updateMenuButton(button);
if (_savegameOffset > 0) {
@@ -1034,8 +1039,8 @@ int GUI_v1::scrollUp(Button *button) {
return 0;
}
-int GUI_v1::scrollDown(Button *button) {
- debugC(9, kDebugLevelGUI, "GUI_v1::scrollDown()");
+int GUI_LoK::scrollDown(Button *button) {
+ debugC(9, kDebugLevelGUI, "GUI_LoK::scrollDown()");
updateMenuButton(button);
_savegameOffset++;
@@ -1047,7 +1052,7 @@ int GUI_v1::scrollDown(Button *button) {
return 0;
}
-void GUI_v1::fadePalette() {
+void GUI_LoK::fadePalette() {
if (_vm->gameFlags().platform == Common::kPlatformAmiga)
return;
@@ -1067,7 +1072,7 @@ void GUI_v1::fadePalette() {
_screen->fadePalette(_screen->_currentPalette, 2);
}
-void GUI_v1::restorePalette() {
+void GUI_LoK::restorePalette() {
if (_vm->gameFlags().platform == Common::kPlatformAmiga)
return;
@@ -1077,8 +1082,8 @@ void GUI_v1::restorePalette() {
#pragma mark -
-void KyraEngine_v1::drawAmulet() {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::drawAmulet()");
+void KyraEngine_LoK::drawAmulet() {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::drawAmulet()");
static const int16 amuletTable1[] = {0x167, 0x162, 0x15D, 0x158, 0x153, 0x150, 0x155, 0x15A, 0x15F, 0x164, 0x145, -1};
static const int16 amuletTable3[] = {0x167, 0x162, 0x15D, 0x158, 0x153, 0x14F, 0x154, 0x159, 0x15E, 0x163, 0x144, -1};
static const int16 amuletTable2[] = {0x167, 0x162, 0x15D, 0x158, 0x153, 0x152, 0x157, 0x15C, 0x161, 0x166, 0x147, -1};
diff --git a/engines/kyra/gui_v1.h b/engines/kyra/gui_lok.h
index 5f6d438689..607ef0b605 100644
--- a/engines/kyra/gui_v1.h
+++ b/engines/kyra/gui_lok.h
@@ -23,77 +23,84 @@
*
*/
-#ifndef KYRA_GUI_V1_H
-#define KYRA_GUI_V1_H
+#ifndef KYRA_GUI_LOK_H
+#define KYRA_GUI_LOK_H
#include "kyra/gui.h"
namespace Kyra {
#define GUI_V1_BUTTON(button, a, b, c, d, e, f, g, h, i, j, k) \
- button.nextButton = 0; \
- button.index = a; \
- button.unk6 = button.unk8 = 0; \
- button.data0Val1 = b; \
- button.data1Val1 = c; \
- button.data2Val1 = d; \
- button.data0ShapePtr = button.data1ShapePtr = button.data2ShapePtr = 0; \
- button.flags = e; \
- button.dimTableIndex = f; \
- button.x = g; \
- button.y = h; \
- button.width = i; \
- button.height = j; \
- button.flags2 = k
+ do { \
+ button.nextButton = 0; \
+ button.index = a; \
+ button.unk6 = button.unk8 = 0; \
+ button.data0Val1 = b; \
+ button.data1Val1 = c; \
+ button.data2Val1 = d; \
+ button.data0ShapePtr = button.data1ShapePtr = button.data2ShapePtr = 0; \
+ button.flags = e; \
+ button.dimTableIndex = f; \
+ button.x = g; \
+ button.y = h; \
+ button.width = i; \
+ button.height = j; \
+ button.flags2 = k; \
+ button.mouseWheel = 0; \
+ } while (0)
#define GUI_V1_MENU(menu, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) \
- menu.x = a; \
- menu.y = b; \
- menu.width = c; \
- menu.height = d; \
- menu.bkgdColor = e; \
- menu.color1 = f; \
- menu.color2 = g; \
- menu.menuNameString = h; \
- menu.textColor = i; \
- menu.titleX = j; \
- menu.titleY = k; \
- menu.highlightedItem = l; \
- menu.numberOfItems = m; \
- menu.scrollUpButtonX = n; \
- menu.scrollUpButtonY = o; \
- menu.scrollDownButtonX = p; \
- menu.scrollDownButtonY = q
+ do { \
+ menu.x = a; \
+ menu.y = b; \
+ menu.width = c; \
+ menu.height = d; \
+ menu.bkgdColor = e; \
+ menu.color1 = f; \
+ menu.color2 = g; \
+ menu.menuNameString = h; \
+ menu.textColor = i; \
+ menu.titleX = j; \
+ menu.titleY = k; \
+ menu.highlightedItem = l; \
+ menu.numberOfItems = m; \
+ menu.scrollUpButtonX = n; \
+ menu.scrollUpButtonY = o; \
+ menu.scrollDownButtonX = p; \
+ menu.scrollDownButtonY = q; \
+ } while (0)
#define GUI_V1_MENU_ITEM(item, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v) \
- item.enabled = a; \
- item.itemString = d; \
- item.x = e; \
- item.y = g; \
- item.width = h; \
- item.height = i; \
- item.textColor = j; \
- item.highlightColor = k; \
- item.titleX = l; \
- item.bkgdColor = n; \
- item.color1 = o; \
- item.color2 = p; \
- item.saveSlot = q; \
- item.labelString = r; \
- item.labelX = s; \
- item.labelY = t; \
- item.unk1F = v
-
-class KyraEngine_v1;
-
-class GUI_v1 : public GUI {
- friend class KyraEngine_v1;
+ do { \
+ item.enabled = a; \
+ item.itemString = d; \
+ item.x = e; \
+ item.y = g; \
+ item.width = h; \
+ item.height = i; \
+ item.textColor = j; \
+ item.highlightColor = k; \
+ item.titleX = l; \
+ item.bkgdColor = n; \
+ item.color1 = o; \
+ item.color2 = p; \
+ item.saveSlot = q; \
+ item.labelString = r; \
+ item.labelX = s; \
+ item.labelY = t; \
+ item.unk1F = v; \
+ } while (0)
+
+class KyraEngine_LoK;
+
+class GUI_LoK : public GUI {
+ friend class KyraEngine_LoK;
public:
- GUI_v1(KyraEngine_v1 *vm, Screen_v1 *screen);
- ~GUI_v1();
+ GUI_LoK(KyraEngine_LoK *vm, Screen_LoK *screen);
+ ~GUI_LoK();
void processButton(Button *button);
- int processButtonList(Button *buttonList, uint16 inputFlags);
+ int processButtonList(Button *buttonList, uint16 inputFlags, int8 mouseWheel);
int buttonMenuCallback(Button *caller);
private:
@@ -147,8 +154,8 @@ private:
const char *getMenuItemTitle(const MenuItem &menuItem) { return menuItem.itemString; }
const char *getMenuItemLabel(const MenuItem &menuItem) { return menuItem.labelString; }
- KyraEngine_v1 *_vm;
- Screen_v1 *_screen;
+ KyraEngine_LoK *_vm;
+ Screen_LoK *_screen;
bool _menuRestoreScreen;
uint8 _toplevelMenu;
diff --git a/engines/kyra/gui_mr.cpp b/engines/kyra/gui_mr.cpp
index 8d27938aff..6822b303c3 100644
--- a/engines/kyra/gui_mr.cpp
+++ b/engines/kyra/gui_mr.cpp
@@ -194,7 +194,7 @@ void KyraEngine_MR::showInventory() {
_screen->hideMouse();
if (_itemInHand < 0) {
- _handItemSet = -1;
+ _mouseState = -1;
_screen->setMouseCursor(0, 0, getShapePtr(0));
}
@@ -559,6 +559,7 @@ int KyraEngine_MR::buttonInventory(Button *button) {
}
int KyraEngine_MR::buttonMoodChange(Button *button) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::buttonMoodChange(%p)", (const void*)button);
if (queryGameFlag(0x219)) {
snd_playSoundEffect(0x0D, 0xC8);
return 0;
@@ -626,6 +627,7 @@ int KyraEngine_MR::buttonMoodChange(Button *button) {
}
int KyraEngine_MR::buttonShowScore(Button *button) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::buttonShowScore(%p)", (const void*)button);
strcpy(_stringBuffer, (const char*)getTableEntry(_cCodeFile, 18));
char *buffer = _stringBuffer;
@@ -649,6 +651,7 @@ int KyraEngine_MR::buttonShowScore(Button *button) {
}
int KyraEngine_MR::buttonJesterStaff(Button *button) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::buttonJesterStaff(%p)", (const void*)button);
makeCharFacingMouse();
if (_itemInHand == 27) {
_screen->hideMouse();
@@ -679,6 +682,457 @@ int KyraEngine_MR::buttonJesterStaff(Button *button) {
return 0;
}
+void KyraEngine_MR::showAlbum() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::showAlbum()");
+ if (!_screen->isMouseVisible() || queryGameFlag(4) || _mouseState != -1)
+ return;
+
+ if (!loadLanguageFile("ALBUM.", _album.file))
+ error("Couldn't load ALBUM");
+
+ if (!queryGameFlag(0x8B))
+ _album.wsa->open("ALBMGNTH.WSA", 1, 0);
+ _album.backUpRect = new uint8[3100];
+ assert(_album.backUpRect);
+ _album.backUpPage = new uint8[64000];
+ assert(_album.backUpPage);
+ _album.nextPage = _album.curPage;
+
+ _screen->copyRegionToBuffer(0, 0, 0, 320, 200, _screenBuffer);
+ _screen->copyRegionToBuffer(4, 0, 0, 320, 200, _album.backUpPage);
+
+ memcpy(_screen->getPalette(1), _screen->getPalette(0), 768);
+ _screen->fadeToBlack(9);
+
+ int itemInHand = _itemInHand;
+ removeHandItem();
+
+ _res->loadFileToBuf("ALBUM.COL", _screen->getPalette(0), 768);
+ loadAlbumPage();
+ loadAlbumPageWSA();
+
+ if (_album.leftPage.wsa->opened()) {
+ _album.leftPage.wsa->setX(_albumWSAX[_album.nextPage+0]);
+ _album.leftPage.wsa->setY(_albumWSAY[_album.nextPage+0]);
+ _album.leftPage.wsa->setDrawPage(2);
+
+ _album.leftPage.wsa->displayFrame(_album.leftPage.curFrame, 0x4000);
+ }
+ if (_album.rightPage.wsa->opened()) {
+ _album.rightPage.wsa->setX(_albumWSAX[_album.nextPage+1]);
+ _album.rightPage.wsa->setY(_albumWSAY[_album.nextPage+1]);
+ _album.rightPage.wsa->setDrawPage(2);
+
+ _album.rightPage.wsa->displayFrame(_album.rightPage.curFrame, 0x4000);
+ }
+
+ printAlbumPageText();
+ _screen->copyRegion(0, 0, 0, 0, 320, 200, 2, 0, Screen::CR_NO_P_CHECK);
+ _screen->updateScreen();
+ _screen->fadePalette(_screen->getPalette(0), 9);
+
+ processAlbum();
+
+ _screen->fadeToBlack(9);
+ _album.wsa->close();
+
+ setHandItem(itemInHand);
+ updateMouse();
+
+ restorePage3();
+ _screen->copyBlockToPage(0, 0, 0, 320, 200, _screenBuffer);
+ _screen->copyBlockToPage(4, 0, 0, 320, 200, _album.backUpPage);
+
+ memcpy(_screen->getPalette(0), _screen->getPalette(1), 768);
+ _screen->fadePalette(_screen->getPalette(0), 9);
+
+ delete[] _album.backUpRect;
+ _album.backUpRect = 0;
+ delete[] _album.backUpPage;
+ _album.backUpPage = 0;
+ delete[] _album.file;
+ _album.file = 0;
+
+ _eventList.clear();
+}
+
+void KyraEngine_MR::loadAlbumPage() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::loadAlbumPage()");
+
+ char filename[16];
+ int num = _album.curPage / 2;
+
+ if (num == 0) {
+ strcpy(filename, "ALBUM0.CPS");
+ } else if (num >= 1 && num <= 6) {
+ --num;
+ num %= 2;
+ snprintf(filename, 16, "ALBUM%d.CPS", num+1);
+ } else {
+ strcpy(filename, "ALBUM3.CPS");
+ }
+
+ _screen->copyRegion(0, 0, 0, 0, 320, 200, 2, 4, Screen::CR_NO_P_CHECK);
+ _screen->loadBitmap(filename, 3, 3, 0);
+}
+
+void KyraEngine_MR::loadAlbumPageWSA() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::loadAlbumPageWSA()");
+ char filename[16];
+
+ _album.leftPage.curFrame = 0;
+ _album.leftPage.maxFrame = 0;
+ _album.leftPage.wsa->close();
+
+ _album.rightPage.curFrame = 0;
+ _album.rightPage.maxFrame = 0;
+ _album.rightPage.wsa->close();
+
+ if (_album.curPage) {
+ snprintf(filename, 16, "PAGE%x.WSA", _album.curPage);
+ _album.leftPage.wsa->open(filename, 1, 0);
+ _album.leftPage.maxFrame = _album.leftPage.wsa->frames()-1;
+ }
+
+ if (_album.curPage != 14) {
+ snprintf(filename, 16, "PAGE%x.WSA", _album.curPage+1);
+ _album.rightPage.wsa->open(filename, 1, 0);
+ _album.rightPage.maxFrame = _album.leftPage.wsa->frames()-1;
+ }
+}
+
+void KyraEngine_MR::printAlbumPageText() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::printAlbumPageText()");
+
+ static const uint8 posY[] = {
+ 0x41, 0x55, 0x55, 0x55, 0x55, 0x55, 0x5A, 0x5A,
+ 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x3C
+ };
+
+ const int leftY = posY[_album.curPage];
+ const int rightY = posY[_album.curPage+1];
+
+ for (int i = 0; i < 5; ++i) {
+ const char *str = (const char *)getTableEntry(_album.file, _album.curPage*5+i);
+ int y = i * 10 + leftY + 20;
+ printAlbumText(2, str, 20, y, 10);
+ }
+
+ for (int i = 0; i < 5; ++i) {
+ const char *str = (const char *)getTableEntry(_album.file, (_album.curPage+1)*5+i);
+ int y = i * 10 + rightY + 20;
+ printAlbumText(2, str, 176, y, 10);
+ }
+
+ albumBackUpRect();
+}
+
+void KyraEngine_MR::printAlbumText(int page, const char *str, int x, int y, uint8 c0) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::printAlbumText(%d, '%s', %d, %d, %d)", page, str, x, y, c0);
+ int oldPage = _screen->_curPage;
+ _screen->_curPage = page;
+
+ static const uint8 colorMap[] = { 0, 0x87, 0xA3, 0 };
+ _screen->setTextColor(colorMap, 0, 3);
+
+ Screen::FontId oldFont = _screen->setFont(Screen::FID_BOOKFONT_FNT);
+ _screen->_charWidth = -2;
+
+ _screen->printText(str, x, y, c0, 0);
+
+ _screen->_charWidth = 0;
+ _screen->setFont(oldFont);
+ _screen->_curPage = oldPage;
+}
+
+void KyraEngine_MR::processAlbum() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::processAlbum()");
+ Button albumButtons[5];
+
+ GUI_V2_BUTTON(albumButtons[0], 36, 0, 0, 1, 1, 1, 0x4487, 0, 130, 190, 10, 10, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0);
+ albumButtons[0].buttonCallback = BUTTON_FUNCTOR(KyraEngine_MR, this, &KyraEngine_MR::albumPrevPage);
+ GUI_V2_BUTTON(albumButtons[1], 37, 0, 0, 1, 1, 1, 0x4487, 0, 177, 190, 10, 10, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0);
+ albumButtons[1].buttonCallback = BUTTON_FUNCTOR(KyraEngine_MR, this, &KyraEngine_MR::albumNextPage);
+ GUI_V2_BUTTON(albumButtons[2], 38, 0, 0, 1, 1, 1, 0x4487, 0, 0, 0, 320, 8, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0);
+ albumButtons[2].buttonCallback = BUTTON_FUNCTOR(KyraEngine_MR, this, &KyraEngine_MR::albumClose);
+ GUI_V2_BUTTON(albumButtons[3], 39, 0, 0, 1, 1, 1, 0x4487, 0, 8, 8, 144, 180, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0);
+ albumButtons[3].buttonCallback = BUTTON_FUNCTOR(KyraEngine_MR, this, &KyraEngine_MR::albumPrevPage);
+ GUI_V2_BUTTON(albumButtons[4], 40, 0, 0, 1, 1, 1, 0x4487, 0, 170, 8, 142, 180, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0);
+ albumButtons[4].buttonCallback = BUTTON_FUNCTOR(KyraEngine_MR, this, &KyraEngine_MR::albumNextPage);
+
+ Button *buttonList = 0;
+ for (int i = 0; i < 5; ++i)
+ buttonList = _gui->addButtonToList(buttonList, &albumButtons[i]);
+
+ _album.leftPage.timer = _album.rightPage.timer = _system->getMillis();
+ albumNewPage();
+ _album.running = true;
+
+ while (_album.running && !_quitFlag) {
+ updateInput();
+ checkInput(buttonList);
+ removeInputTop();
+
+ musicUpdate(0);
+
+ if (_album.curPage != _album.nextPage) {
+ int oldPage = _album.curPage;
+ _album.curPage = _album.nextPage;
+
+ _album.leftPage.wsa->close();
+ _album.rightPage.wsa->close();
+
+ loadAlbumPage();
+ loadAlbumPageWSA();
+
+ if (_album.leftPage.wsa->opened()) {
+ _album.leftPage.wsa->setX(_albumWSAX[_album.nextPage+0]);
+ _album.leftPage.wsa->setY(_albumWSAY[_album.nextPage+0]);
+ _album.leftPage.wsa->setDrawPage(2);
+
+ _album.leftPage.wsa->displayFrame(_album.leftPage.curFrame, 0x4000);
+ }
+ if (_album.rightPage.wsa->opened()) {
+ _album.rightPage.wsa->setX(_albumWSAX[_album.nextPage+1]);
+ _album.rightPage.wsa->setY(_albumWSAY[_album.nextPage+1]);
+ _album.rightPage.wsa->setDrawPage(2);
+
+ _album.rightPage.wsa->displayFrame(_album.rightPage.curFrame, 0x4000);
+ }
+
+ printAlbumPageText();
+
+ snd_playSoundEffect(0x85, 0x80);
+ albumSwitchPages(oldPage, _album.nextPage, 4);
+
+ _album.leftPage.timer = _album.rightPage.timer = 0;
+ albumNewPage();
+
+ _eventList.clear();
+ }
+
+ albumUpdateAnims();
+ _system->delayMillis(10);
+ }
+
+ _album.leftPage.wsa->close();
+ _album.rightPage.wsa->close();
+}
+
+void KyraEngine_MR::albumNewPage() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::albumNewPage()");
+ int page = _album.nextPage / 2;
+ if (!queryGameFlag(0x84+page)) {
+ albumAnim1();
+ delayWithTicks(8);
+
+ int id = _album.curPage / 2 + 100;
+ albumChat((const char *)getTableEntry(_album.file, id), 205, id);
+
+ if (id == 107) {
+ _screen->copyRegion(76, 100, 76, 100, 244, 100, 2, 0, Screen::CR_NO_P_CHECK);
+ albumChat((const char *)getTableEntry(_album.file, 108), 205, 108);
+ _screen->copyRegion(76, 100, 76, 100, 244, 100, 2, 0, Screen::CR_NO_P_CHECK);
+ albumChat((const char *)getTableEntry(_album.file, 109), 205, 109);
+ }
+
+ delayWithTicks(5);
+ albumAnim2();
+
+ setGameFlag(0x84+page);
+ _album.isPage14 = (_album.nextPage == 14);
+ }
+}
+
+void KyraEngine_MR::albumUpdateAnims() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::albumUpdateAnims()");
+ if (_album.nextPage == 14 && !_album.isPage14)
+ return;
+
+ uint32 nextRun = 0;
+
+ nextRun = _album.leftPage.timer + 5 * _tickLength;
+ if (nextRun < _system->getMillis() && _album.leftPage.wsa->opened()) {
+ _album.leftPage.wsa->setX(_albumWSAX[_album.nextPage+0]);
+ _album.leftPage.wsa->setY(_albumWSAY[_album.nextPage+0]);
+ _album.leftPage.wsa->setDrawPage(2);
+
+ _album.leftPage.wsa->displayFrame(_album.leftPage.curFrame, 0x4000);
+ _screen->copyRegion(40, 17, 40, 17, 87, 73, 2, 0, Screen::CR_NO_P_CHECK);
+
+ ++_album.leftPage.curFrame;
+ _album.leftPage.timer = _system->getMillis();
+
+ if (_album.leftPage.curFrame > _album.leftPage.maxFrame) {
+ _album.leftPage.curFrame = 0;
+ if (_album.nextPage == 14) {
+ _album.isPage14 = false;
+ _album.leftPage.timer += 100000 * _tickLength;
+ } else {
+ _album.leftPage.timer += 180 * _tickLength;
+ }
+ }
+ }
+
+ nextRun = _album.rightPage.timer + 5 * _tickLength;
+ if (nextRun < _system->getMillis() && _album.rightPage.wsa->opened()) {
+ _album.rightPage.wsa->setX(_albumWSAX[_album.nextPage+1]);
+ _album.rightPage.wsa->setY(_albumWSAY[_album.nextPage+1]);
+ _album.rightPage.wsa->setDrawPage(2);
+
+ _album.rightPage.wsa->displayFrame(_album.rightPage.curFrame, 0x4000);
+ _screen->copyRegion(194, 20, 194, 20, 85, 69, 2, 0, Screen::CR_NO_P_CHECK);
+
+ ++_album.rightPage.curFrame;
+ _album.rightPage.timer = _system->getMillis();
+
+ if (_album.rightPage.curFrame > _album.rightPage.maxFrame) {
+ _album.rightPage.curFrame = 0;
+ _album.rightPage.timer += 180 * _tickLength;
+ }
+ }
+
+ _screen->updateScreen();
+}
+
+void KyraEngine_MR::albumAnim1() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::albumAnim1()");
+ _album.wsa->setX(-100);
+ _album.wsa->setY(90);
+ _album.wsa->setDrawPage(2);
+
+ for (int i = 6; i >= 3; --i) {
+ albumRestoreRect();
+ _album.wsa->displayFrame(i, 0x4000);
+ albumUpdateRect();
+ delayWithTicks(1);
+ }
+
+ albumRestoreRect();
+ _album.wsa->displayFrame(14, 0x4000);
+ albumUpdateRect();
+ delayWithTicks(1);
+}
+
+void KyraEngine_MR::albumAnim2() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::albumAnim2()");
+ _album.wsa->setX(-100);
+ _album.wsa->setY(90);
+ _album.wsa->setDrawPage(2);
+
+ for (int i = 3; i <= 6; ++i) {
+ albumRestoreRect();
+ _album.wsa->displayFrame(i, 0x4000);
+ albumUpdateRect();
+ delayWithTicks(1);
+ }
+
+ albumRestoreRect();
+ _screen->copyRegion(0, 100, 0, 100, 320, 100, 2, 0, Screen::CR_NO_P_CHECK);
+ _screen->updateScreen();
+}
+
+void KyraEngine_MR::albumBackUpRect() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::albumBackUpRect()");
+ _screen->copyRegionToBuffer(2, 0, 146, 62, 50, _album.backUpRect);
+}
+
+void KyraEngine_MR::albumRestoreRect() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::albumRestoreRect()");
+ _screen->copyBlockToPage(2, 0, 146, 62, 50, _album.backUpRect);
+}
+
+void KyraEngine_MR::albumUpdateRect() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::albumUpdateRect()");
+ _screen->copyRegion(0, 146, 0, 146, 62, 50, 2, 0, Screen::CR_NO_P_CHECK);
+ _screen->updateScreen();
+}
+
+void KyraEngine_MR::albumSwitchPages(int oldPage, int newPage, int srcPage) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::albumSwitchPages(%d, %d, %d)", oldPage, newPage, srcPage);
+ if (newPage > oldPage) {
+ _screen->wsaFrameAnimationStep(0xA0, 0x07, 0xA0, 0x07, 0x96, 0xBA, 0x64, 0xBA, srcPage, 0, 2);
+
+ _screen->copyRegion(260, 7, 260, 7, 50, 186, 2, 0, Screen::CR_NO_P_CHECK);
+ _screen->updateScreen();
+ delayWithTicks(1);
+
+ _screen->wsaFrameAnimationStep(0xA0, 0x07, 0xA0, 0x07, 0x96, 0xBA, 0x32, 0xBA, srcPage, 0, 2);
+
+ _screen->copyRegion(210, 7, 210, 7, 50, 186, 2, 0, Screen::CR_NO_P_CHECK);
+ _screen->updateScreen();
+ delayWithTicks(1);
+
+ _screen->copyRegion(160, 7, 160, 7, 50, 186, 2, 0, Screen::CR_NO_P_CHECK);
+ _screen->updateScreen();
+ delayWithTicks(1);
+
+ _screen->wsaFrameAnimationStep(0x10, 0x07, 0x6E, 0x07, 0x96, 0xBA, 0x32, 0xBA, 2, 0, 2);
+ _screen->updateScreen();
+ delayWithTicks(1);
+
+ _screen->wsaFrameAnimationStep(0x10, 0x07, 0x3C, 0x07, 0x96, 0xBA, 0x64, 0xBA, 2, 0, 2);
+ _screen->updateScreen();
+ delayWithTicks(1);
+
+ _screen->copyRegion(10, 7, 10, 7, 150, 186, 2, 0, Screen::CR_NO_P_CHECK);
+ _screen->updateScreen();
+ } else {
+ _screen->wsaFrameAnimationStep(0x0A, 0x07, 0x3C, 0x07, 0x96, 0xBA, 0x64, 0xBA, srcPage, 0, 2);
+
+ _screen->copyRegion(10, 7, 10, 7, 50, 186, 2, 0, Screen::CR_NO_P_CHECK);
+ _screen->updateScreen();
+ delayWithTicks(1);
+
+ _screen->wsaFrameAnimationStep(0x0A, 0x07, 0x6E, 0x07, 0x96, 0xBA, 0x32, 0xBA, srcPage, 0, 2);
+
+ _screen->copyRegion(60, 7, 60, 7, 50, 186, 2, 0, Screen::CR_NO_P_CHECK);
+ _screen->updateScreen();
+ delayWithTicks(1);
+
+ _screen->copyRegion(110, 7, 110, 7, 50, 186, 2, 0, Screen::CR_NO_P_CHECK);
+ _screen->updateScreen();
+ delayWithTicks(1);
+
+ _screen->wsaFrameAnimationStep(0xA0, 0x07, 0xA0, 0x07, 0x96, 0xBA, 0x32, 0xBA, 2, 0, 2);
+ _screen->updateScreen();
+ delayWithTicks(1);
+
+ _screen->wsaFrameAnimationStep(0xA0, 0x07, 0xA0, 0x07, 0x96, 0xBA, 0x64, 0xBA, 2, 0, 2);
+ _screen->updateScreen();
+ delayWithTicks(1);
+
+ _screen->copyRegion(160, 7, 160, 7, 150, 186, 2, 0, Screen::CR_NO_P_CHECK);
+ _screen->updateScreen();
+ }
+}
+
+int KyraEngine_MR::albumNextPage(Button *caller) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::albumNextPage(%p)", (const void *)caller);
+ _album.nextPage = _album.curPage + 2;
+ if (_album.nextPage >= 16) {
+ _album.nextPage -= 2;
+ _album.running = false;
+ }
+ return 0;
+}
+
+int KyraEngine_MR::albumPrevPage(Button *caller) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::albumPrevPage(%p)", (const void *)caller);
+ _album.nextPage = _album.curPage - 2;
+ if (_album.nextPage < 0) {
+ _album.nextPage = 0;
+ _album.running = false;
+ }
+ return 0;
+}
+
+int KyraEngine_MR::albumClose(Button *caller) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::albumClose(%p)", (const void *)caller);
+ _album.running = false;
+ return 0;
+}
+
#pragma mark -
GUI_MR::GUI_MR(KyraEngine_MR *vm) : GUI_v2(vm), _vm(vm), _screen(vm->_screen) {
@@ -704,6 +1158,11 @@ void GUI_MR::flagButtonDisable(Button *button) {
}
}
+void GUI_MR::getInput() {
+ _vm->musicUpdate(0);
+ GUI_v2::getInput();
+}
+
const char *GUI_MR::getMenuTitle(const Menu &menu) {
if (!menu.menuNameId)
return 0;
@@ -784,6 +1243,8 @@ int GUI_MR::quitGame(Button *caller) {
}
int GUI_MR::optionsButton(Button *button) {
+ PauseTimer pause(*_vm->_timer);
+
_vm->musicUpdate(0);
_screen->hideMouse();
@@ -801,8 +1262,8 @@ int GUI_MR::optionsButton(Button *button) {
_vm->showMessage(0, 0xF0, 0xF0);
- if (_vm->_handItemSet < -1) {
- _vm->_handItemSet = -1;
+ if (_vm->_mouseState < -1) {
+ _vm->_mouseState = -1;
_screen->hideMouse();
_screen->setMouseCursor(1, 1, _vm->getShapePtr(0));
_screen->showMouse();
@@ -938,6 +1399,7 @@ int GUI_MR::loadMenu(Button *caller) {
} else if (_vm->_gameToLoad >= 0) {
restorePage1(_vm->_screenBuffer);
restorePalette();
+ _vm->_menuDirectlyToLoad = false;
_vm->loadGame(_vm->getSavegameFilename(_vm->_gameToLoad));
if (_vm->_gameToLoad == 0) {
_restartGame = true;
@@ -982,7 +1444,7 @@ int GUI_MR::gameOptions(Button *caller) {
if (textEnabled && !_vm->textEnabled() && !_vm->speechEnabled()) {
_vm->_configVoice = 1;
- _vm->setVolume(KyraEngine::kVolumeSpeech, 75);
+ _vm->setVolume(KyraEngine_v1::kVolumeSpeech, 75);
choiceDialog(0x1E, 0);
}
@@ -1077,15 +1539,26 @@ int GUI_MR::toggleSkipSupport(Button *caller) {
return 0;
}
+int GUI_MR::toggleHeliumMode(Button *caller) {
+ updateMenuButton(caller);
+ _vm->_configHelium ^= 1;
+ if (_vm->_configHelium)
+ _audioOptions.item[3].itemId = 18;
+ else
+ _audioOptions.item[3].itemId = 17;
+ renewHighlight(_audioOptions);
+ return 0;
+}
+
int GUI_MR::audioOptions(Button *caller) {
updateMenuButton(caller);
restorePage1(_vm->_screenBuffer);
backUpPage1(_vm->_screenBuffer);
- //if (_configHelium)
- // _audioOptions.item[3].itemId = 18;
- //else
+ if (_vm->_configHelium)
+ _audioOptions.item[3].itemId = 18;
+ else
_audioOptions.item[3].itemId = 17;
initMenu(_audioOptions);
@@ -1124,7 +1597,7 @@ int GUI_MR::audioOptions(Button *caller) {
restorePage1(_vm->_screenBuffer);
backUpPage1(_vm->_screenBuffer);
- if (speechEnabled && !_vm->textEnabled() && (!_vm->speechEnabled() || _vm->getVolume(KyraEngine::kVolumeSpeech) == 2)) {
+ if (speechEnabled && !_vm->textEnabled() && (!_vm->speechEnabled() || _vm->getVolume(KyraEngine_v1::kVolumeSpeech) == 2)) {
_vm->_configVoice = 0;
choiceDialog(0x1D, 0);
}
@@ -1147,7 +1620,7 @@ int GUI_MR::sliderHandler(Button *caller) {
assert(button >= 0 && button <= 3);
- int oldVolume = _vm->getVolume(KyraEngine::kVolumeEntry(button));
+ int oldVolume = _vm->getVolume(KyraEngine_v1::kVolumeEntry(button));
int newVolume = oldVolume;
if (caller->index >= 24 && caller->index <= 27)
@@ -1175,7 +1648,7 @@ int GUI_MR::sliderHandler(Button *caller) {
_vm->_configVoice = 1;
}
- _vm->setVolume(KyraEngine::kVolumeEntry(button), newVolume);
+ _vm->setVolume(KyraEngine_v1::kVolumeEntry(button), newVolume);
switch (button) {
case 0:
@@ -1200,7 +1673,7 @@ int GUI_MR::sliderHandler(Button *caller) {
if (playSoundEffect)
_vm->snd_playSoundEffect(0x18, 0xC8);
else if (lastMusicCommand >= 0)
- _vm->snd_playWanderScoreViaMap(lastMusicCommand, 1);
+ _vm->snd_playWanderScoreViaMap(lastMusicCommand, 0);
_screen->updateScreen();
return 0;
@@ -1212,7 +1685,7 @@ void GUI_MR::drawSliderBar(int slider, const uint8 *shape) {
int x = menuX + _sliderBarsPosition[slider*2+0] + 10;
int y = menuY + _sliderBarsPosition[slider*2+1];
- int position = _vm->getVolume(KyraEngine::kVolumeEntry(slider));
+ int position = _vm->getVolume(KyraEngine_v1::kVolumeEntry(slider));
position = MAX(2, position);
position = MIN(97, position);
diff --git a/engines/kyra/gui_mr.h b/engines/kyra/gui_mr.h
index d73b21b73b..5bd3569031 100644
--- a/engines/kyra/gui_mr.h
+++ b/engines/kyra/gui_mr.h
@@ -48,6 +48,8 @@ public:
int optionsButton(Button *button);
private:
+ void getInput();
+
const char *getMenuTitle(const Menu &menu);
const char *getMenuItemTitle(const MenuItem &menuItem);
const char *getMenuItemLabel(const MenuItem &menuItem);
@@ -77,6 +79,7 @@ private:
int changeLanguage(Button *caller);
int toggleStudioSFX(Button *caller);
int toggleSkipSupport(Button *caller);
+ int toggleHeliumMode(Button *caller);
KyraEngine_MR *_vm;
Screen_MR *_screen;
diff --git a/engines/kyra/gui_v2.cpp b/engines/kyra/gui_v2.cpp
index d835c4f8d5..2819c4f077 100644
--- a/engines/kyra/gui_v2.cpp
+++ b/engines/kyra/gui_v2.cpp
@@ -43,6 +43,8 @@ GUI_v2::GUI_v2(KyraEngine_v2 *vm) : GUI(vm), _vm(vm), _screen(vm->screen_v2()) {
_scrollUpFunctor = BUTTON_FUNCTOR(GUI_v2, this, &GUI_v2::scrollUpButton);
_scrollDownFunctor = BUTTON_FUNCTOR(GUI_v2, this, &GUI_v2::scrollDownButton);
_sliderHandlerFunctor = BUTTON_FUNCTOR(GUI_v2, this, &GUI_v2::sliderHandler);
+ _savegameOffset = 0;
+ _isDeleteMenu = false;
}
Button *GUI_v2::addButtonToList(Button *list, Button *newButton) {
@@ -138,7 +140,7 @@ void GUI_v2::processButton(Button *button) {
_screen->updateScreen();
}
-int GUI_v2::processButtonList(Button *buttonList, uint16 inputFlag) {
+int GUI_v2::processButtonList(Button *buttonList, uint16 inputFlag, int8 mouseWheel) {
static uint16 flagsModifier = 0;
if (!buttonList)
@@ -234,6 +236,12 @@ int GUI_v2::processButtonList(Button *buttonList, uint16 inputFlag) {
}
bool unk1 = false;
+
+ if (mouseWheel && buttonList->mouseWheel == mouseWheel) {
+ progress = true;
+ unk1 = true;
+ }
+
if (!progress)
buttonList->flags2 &= ~6;
@@ -407,6 +415,8 @@ void GUI_v2::getInput() {
_isOptionsMenu = false;
_isDeleteMenu = false;
}
+
+ _vm->delay(10);
}
void GUI_v2::renewHighlight(Menu &menu) {
@@ -441,7 +451,7 @@ void GUI_v2::setupSavegameNames(Menu &menu, int num) {
if (_isSaveMenu && _savegameOffset == 0)
startSlot = 1;
- KyraEngine::SaveHeader header;
+ KyraEngine_v1::SaveHeader header;
Common::InSaveFile *in;
for (int i = startSlot; i < num && uint(_savegameOffset + i) < _saveSlots.size(); ++i) {
if ((in = _vm->openSaveForReading(_vm->getSavegameFilename(_saveSlots[i + _savegameOffset]), header)) != 0) {
@@ -844,7 +854,7 @@ void GUI_v2::checkTextfieldInput() {
}
}
- processButtonList(_menuButtonList, keys | 0x8000);
+ processButtonList(_menuButtonList, keys | 0x8000, 0);
}
void GUI_v2::drawTextfieldBlock(int x, int y, uint8 c) {
diff --git a/engines/kyra/gui_v2.h b/engines/kyra/gui_v2.h
index 4e94b58742..161752627b 100644
--- a/engines/kyra/gui_v2.h
+++ b/engines/kyra/gui_v2.h
@@ -31,65 +31,72 @@
namespace Kyra {
#define GUI_V2_BUTTON(button, a, b, c, d, e, f, h, i, j, k, l, m, n, o, p, q, r, s, t) \
- button.nextButton = 0; \
- button.index = a; \
- button.unk6 = b; \
- button.unk8 = c; \
- button.data0Val1 = d; \
- button.data1Val1 = e; \
- button.data2Val1 = f; \
- button.flags = h; \
- button.data0ShapePtr = button.data1ShapePtr = button.data2ShapePtr = 0; \
- button.dimTableIndex = i; \
- button.x = j; \
- button.y = k; \
- button.width = l; \
- button.height = m; \
- button.data0Val2 = n; \
- button.data0Val3 = o; \
- button.data1Val2 = p; \
- button.data1Val3 = q; \
- button.data2Val2 = r; \
- button.data2Val3 = s; \
- button.flags2 = t;
+ do { \
+ button.nextButton = 0; \
+ button.index = a; \
+ button.unk6 = b; \
+ button.unk8 = c; \
+ button.data0Val1 = d; \
+ button.data1Val1 = e; \
+ button.data2Val1 = f; \
+ button.flags = h; \
+ button.data0ShapePtr = button.data1ShapePtr = button.data2ShapePtr = 0; \
+ button.dimTableIndex = i; \
+ button.x = j; \
+ button.y = k; \
+ button.width = l; \
+ button.height = m; \
+ button.data0Val2 = n; \
+ button.data0Val3 = o; \
+ button.data1Val2 = p; \
+ button.data1Val3 = q; \
+ button.data2Val2 = r; \
+ button.data2Val3 = s; \
+ button.flags2 = t; \
+ button.mouseWheel = 0; \
+ } while (0)
#define GUI_V2_MENU(menu, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) \
- menu.x = a; \
- menu.y = b; \
- menu.width = c; \
- menu.height = d; \
- menu.bkgdColor = e; \
- menu.color1 = f; \
- menu.color2 = g; \
- menu.menuNameId = h; \
- menu.textColor = i; \
- menu.titleX = j; \
- menu.titleY = k; \
- menu.highlightedItem = l; \
- menu.numberOfItems = m; \
- menu.scrollUpButtonX = n; \
- menu.scrollUpButtonY = o; \
- menu.scrollDownButtonX = p; \
- menu.scrollDownButtonY = q
+ do { \
+ menu.x = a; \
+ menu.y = b; \
+ menu.width = c; \
+ menu.height = d; \
+ menu.bkgdColor = e; \
+ menu.color1 = f; \
+ menu.color2 = g; \
+ menu.menuNameId = h; \
+ menu.textColor = i; \
+ menu.titleX = j; \
+ menu.titleY = k; \
+ menu.highlightedItem = l; \
+ menu.numberOfItems = m; \
+ menu.scrollUpButtonX = n; \
+ menu.scrollUpButtonY = o; \
+ menu.scrollDownButtonX = p; \
+ menu.scrollDownButtonY = q; \
+ } while (0)
#define GUI_V2_MENU_ITEM(item, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) \
- item.enabled = a; \
- item.itemId = b; \
- item.x = c; \
- item.y = d; \
- item.width = e; \
- item.height = f; \
- item.textColor = g; \
- item.highlightColor = h; \
- item.titleX = i; \
- item.bkgdColor = j; \
- item.color1 = k; \
- item.color2 = l; \
- item.saveSlot = m; \
- item.labelId = n; \
- item.labelX = o; \
- item.labelY = p; \
- item.unk1F = q
+ do { \
+ item.enabled = a; \
+ item.itemId = b; \
+ item.x = c; \
+ item.y = d; \
+ item.width = e; \
+ item.height = f; \
+ item.textColor = g; \
+ item.highlightColor = h; \
+ item.titleX = i; \
+ item.bkgdColor = j; \
+ item.color1 = k; \
+ item.color2 = l; \
+ item.saveSlot = m; \
+ item.labelId = n; \
+ item.labelX = o; \
+ item.labelY = p; \
+ item.unk1F = q; \
+ } while (0)
class KyraEngine_v2;
class Screen_v2;
@@ -103,7 +110,7 @@ public:
Button *addButtonToList(Button *list, Button *newButton);
void processButton(Button *button);
- int processButtonList(Button *button, uint16 inputFlag);
+ int processButtonList(Button *button, uint16 inputFlag, int8 mouseWheel);
protected:
void updateButton(Button *button);
@@ -125,7 +132,7 @@ protected:
virtual uint8 textFieldColor2() const = 0;
virtual uint8 textFieldColor3() const = 0;
protected:
- void getInput();
+ virtual void getInput();
Button _menuButtons[7];
Button _scrollUpButton;
diff --git a/engines/kyra/items_hof.cpp b/engines/kyra/items_hof.cpp
index da3062fe2c..4dfc73a5ad 100644
--- a/engines/kyra/items_hof.cpp
+++ b/engines/kyra/items_hof.cpp
@@ -83,7 +83,7 @@ void KyraEngine_HoF::updateWaterFlasks() {
bool KyraEngine_HoF::dropItem(int unk1, uint16 item, int x, int y, int unk2) {
debugC(9, kDebugLevelMain, "KyraEngine_HoF::dropItem(%d, %u, %d, %d, %d)", unk1, item, x, y, unk2);
- if (_handItemSet <= -1)
+ if (_mouseState <= -1)
return false;
bool success = processItemDrop(_mainCharacter.sceneId, item, x, y, unk1, unk2);
diff --git a/engines/kyra/items_v1.cpp b/engines/kyra/items_lok.cpp
index ae3ba2821a..8eb62c20c2 100644
--- a/engines/kyra/items_v1.cpp
+++ b/engines/kyra/items_lok.cpp
@@ -23,14 +23,14 @@
*
*/
-#include "kyra/kyra_v1.h"
+#include "kyra/kyra_lok.h"
#include "kyra/seqplayer.h"
#include "kyra/screen.h"
#include "kyra/resource.h"
#include "kyra/sound.h"
#include "kyra/sprites.h"
#include "kyra/wsamovie.h"
-#include "kyra/animator_v1.h"
+#include "kyra/animator_lok.h"
#include "kyra/text.h"
#include "common/system.h"
@@ -38,7 +38,7 @@
namespace Kyra {
-int KyraEngine_v1::findDuplicateItemShape(int shape) {
+int KyraEngine_LoK::findDuplicateItemShape(int shape) {
static uint8 dupTable[] = {
0x48, 0x46, 0x49, 0x47, 0x4a, 0x46, 0x4b, 0x47,
0x4c, 0x46, 0x4d, 0x47, 0x5b, 0x5a, 0x5c, 0x5a,
@@ -55,8 +55,8 @@ int KyraEngine_v1::findDuplicateItemShape(int shape) {
return -1;
}
-void KyraEngine_v1::addToNoDropRects(int x, int y, int w, int h) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::addToNoDropRects(%d, %d, %d, %d)", x, y, w, h);
+void KyraEngine_LoK::addToNoDropRects(int x, int y, int w, int h) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::addToNoDropRects(%d, %d, %d, %d)", x, y, w, h);
for (int rect = 0; rect < 11; ++rect) {
if (_noDropRects[rect].x == -1) {
_noDropRects[rect].x = x;
@@ -68,13 +68,13 @@ void KyraEngine_v1::addToNoDropRects(int x, int y, int w, int h) {
}
}
-void KyraEngine_v1::clearNoDropRects() {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::clearNoDropRects()");
+void KyraEngine_LoK::clearNoDropRects() {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::clearNoDropRects()");
memset(_noDropRects, -1, sizeof(_noDropRects));
}
-byte KyraEngine_v1::findFreeItemInScene(int scene) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::findFreeItemInScene(%d)", scene);
+byte KyraEngine_LoK::findFreeItemInScene(int scene) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::findFreeItemInScene(%d)", scene);
assert(scene < _roomTableSize);
Room *room = &_roomTable[scene];
for (int i = 0; i < 12; ++i) {
@@ -84,8 +84,8 @@ byte KyraEngine_v1::findFreeItemInScene(int scene) {
return 0xFF;
}
-byte KyraEngine_v1::findItemAtPos(int x, int y) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::findItemAtPos(%d, %d)", x, y);
+byte KyraEngine_LoK::findItemAtPos(int x, int y) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::findItemAtPos(%d, %d)", x, y);
assert(_currentCharacter->sceneId < _roomTableSize);
const uint8 *itemsTable = _roomTable[_currentCharacter->sceneId].itemsTable;
const uint16 *xposOffset = _roomTable[_currentCharacter->sceneId].itemsXPos;
@@ -120,8 +120,8 @@ byte KyraEngine_v1::findItemAtPos(int x, int y) {
return returnValue;
}
-void KyraEngine_v1::placeItemInGenericMapScene(int item, int index) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::placeItemInGenericMapScene(%d, %d)", item, index);
+void KyraEngine_LoK::placeItemInGenericMapScene(int item, int index) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::placeItemInGenericMapScene(%d, %d)", item, index);
static const uint16 itemMapSceneMinTable[] = {
0x0000, 0x0011, 0x006D, 0x0025, 0x00C7, 0x0000
};
@@ -175,32 +175,32 @@ void KyraEngine_v1::placeItemInGenericMapScene(int item, int index) {
}
}
-void KyraEngine_v1::createMouseItem(int item) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::createMouseItem(%d)", item);
+void KyraEngine_LoK::setHandItem(uint16 item) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::setHandItem(%u)", item);
_screen->hideMouse();
setMouseItem(item);
_itemInHand = item;
_screen->showMouse();
}
-void KyraEngine_v1::destroyMouseItem() {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::destroyMouseItem()");
+void KyraEngine_LoK::removeHandItem() {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::removeHandItem()");
_screen->hideMouse();
_screen->setMouseCursor(1, 1, _shapes[0]);
_itemInHand = -1;
_screen->showMouse();
}
-void KyraEngine_v1::setMouseItem(int item) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::setMouseItem(%d)", item);
- if (item == -1)
+void KyraEngine_LoK::setMouseItem(uint16 item) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::setMouseItem(%u)", item);
+ if (item == 0xFFFF)
_screen->setMouseCursor(1, 1, _shapes[6]);
else
_screen->setMouseCursor(8, 15, _shapes[216+item]);
}
-void KyraEngine_v1::wipeDownMouseItem(int xpos, int ypos) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::wipeDownMouseItem(%d, %d)", xpos, ypos);
+void KyraEngine_LoK::wipeDownMouseItem(int xpos, int ypos) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::wipeDownMouseItem(%d, %d)", xpos, ypos);
if (_itemInHand == -1)
return;
xpos -= 8;
@@ -222,12 +222,12 @@ void KyraEngine_v1::wipeDownMouseItem(int xpos, int ypos) {
}
restoreItemRect1(xpos, ypos);
_screen->resetShapeHeight(_shapes[216+_itemInHand]);
- destroyMouseItem();
+ removeHandItem();
_screen->showMouse();
}
-void KyraEngine_v1::setupSceneItems() {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::setupSceneItems()");
+void KyraEngine_LoK::setupSceneItems() {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::setupSceneItems()");
uint16 sceneId = _currentCharacter->sceneId;
assert(sceneId < _roomTableSize);
Room *currentRoom = &_roomTable[sceneId];
@@ -264,8 +264,8 @@ void KyraEngine_v1::setupSceneItems() {
}
}
-int KyraEngine_v1::countItemsInScene(uint16 sceneId) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::countItemsInScene(%d)", sceneId);
+int KyraEngine_LoK::countItemsInScene(uint16 sceneId) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::countItemsInScene(%d)", sceneId);
assert(sceneId < _roomTableSize);
Room *currentRoom = &_roomTable[sceneId];
@@ -279,8 +279,8 @@ int KyraEngine_v1::countItemsInScene(uint16 sceneId) {
return items;
}
-int KyraEngine_v1::processItemDrop(uint16 sceneId, uint8 item, int x, int y, int unk1, int unk2) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::processItemDrop(%d, %d, %d, %d, %d, %d)", sceneId, item, x, y, unk1, unk2);
+int KyraEngine_LoK::processItemDrop(uint16 sceneId, uint8 item, int x, int y, int unk1, int unk2) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::processItemDrop(%d, %d, %d, %d, %d, %d)", sceneId, item, x, y, unk1, unk2);
int freeItem = -1;
uint8 itemIndex = findItemAtPos(x, y);
if (unk1)
@@ -420,7 +420,7 @@ int KyraEngine_v1::processItemDrop(uint16 sceneId, uint8 item, int x, int y, int
itemSpecialFX(x, y, item);
if (unk1 == 0)
- destroyMouseItem();
+ removeHandItem();
itemDropDown(x, y, destX, destY, freeItem, item);
@@ -432,8 +432,8 @@ int KyraEngine_v1::processItemDrop(uint16 sceneId, uint8 item, int x, int y, int
return 1;
}
-void KyraEngine_v1::exchangeItemWithMouseItem(uint16 sceneId, int itemIndex) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::exchangeItemWithMouseItem(%d, %d)", sceneId, itemIndex);
+void KyraEngine_LoK::exchangeItemWithMouseItem(uint16 sceneId, int itemIndex) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::exchangeItemWithMouseItem(%d, %d)", sceneId, itemIndex);
_screen->hideMouse();
_animator->animRemoveGameItem(itemIndex);
assert(sceneId < _roomTableSize);
@@ -452,8 +452,8 @@ void KyraEngine_v1::exchangeItemWithMouseItem(uint16 sceneId, int itemIndex) {
clickEventHandler2();
}
-void KyraEngine_v1::addItemToRoom(uint16 sceneId, uint8 item, int itemIndex, int x, int y) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::addItemToRoom(%d, %d, %d, %d, %d)", sceneId, item, itemIndex, x, y);
+void KyraEngine_LoK::addItemToRoom(uint16 sceneId, uint8 item, int itemIndex, int x, int y) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::addItemToRoom(%d, %d, %d, %d, %d)", sceneId, item, itemIndex, x, y);
assert(sceneId < _roomTableSize);
Room *currentRoom = &_roomTable[sceneId];
currentRoom->itemsTable[itemIndex] = item;
@@ -462,8 +462,8 @@ void KyraEngine_v1::addItemToRoom(uint16 sceneId, uint8 item, int itemIndex, int
currentRoom->needInit[itemIndex] = 1;
}
-int KyraEngine_v1::checkNoDropRects(int x, int y) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::checkNoDropRects(%d, %d)", x, y);
+int KyraEngine_LoK::checkNoDropRects(int x, int y) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::checkNoDropRects(%d, %d)", x, y);
if (_lastProcessedItemHeight < 1 || _lastProcessedItemHeight > 16)
_lastProcessedItemHeight = 16;
if (_noDropRects[0].x == -1)
@@ -492,8 +492,8 @@ int KyraEngine_v1::checkNoDropRects(int x, int y) {
return 0;
}
-int KyraEngine_v1::isDropable(int x, int y) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::isDropable(%d, %d)", x, y);
+int KyraEngine_LoK::isDropable(int x, int y) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::isDropable(%d, %d)", x, y);
x -= 8;
y -= 1;
@@ -507,8 +507,8 @@ int KyraEngine_v1::isDropable(int x, int y) {
return 1;
}
-void KyraEngine_v1::itemDropDown(int x, int y, int destX, int destY, byte freeItem, int item) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::itemDropDown(%d, %d, %d, %d, %d, %d)", x, y, destX, destY, freeItem, item);
+void KyraEngine_LoK::itemDropDown(int x, int y, int destX, int destY, byte freeItem, int item) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::itemDropDown(%d, %d, %d, %d, %d, %d)", x, y, destX, destY, freeItem, item);
assert(_currentCharacter->sceneId < _roomTableSize);
Room *currentRoom = &_roomTable[_currentCharacter->sceneId];
if (x == destX && y == destY) {
@@ -591,8 +591,8 @@ void KyraEngine_v1::itemDropDown(int x, int y, int destX, int destY, byte freeIt
_screen->showMouse();
}
-void KyraEngine_v1::dropItem(int unk1, int item, int x, int y, int unk2) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::dropItem(%d, %d, %d, %d, %d)", unk1, item, x, y, unk2);
+void KyraEngine_LoK::dropItem(int unk1, int item, int x, int y, int unk2) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::dropItem(%d, %d, %d, %d, %d)", unk1, item, x, y, unk2);
if (processItemDrop(_currentCharacter->sceneId, item, x, y, unk1, unk2))
return;
snd_playSoundEffect(54);
@@ -603,16 +603,16 @@ void KyraEngine_v1::dropItem(int unk1, int item, int x, int y, int unk2) {
drawSentenceCommand(_noDropList[1], 6);
}
-void KyraEngine_v1::itemSpecialFX(int x, int y, int item) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::itemSpecialFX(%d, %d, %d)", x, y, item);
+void KyraEngine_LoK::itemSpecialFX(int x, int y, int item) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::itemSpecialFX(%d, %d, %d)", x, y, item);
if (item == 41)
itemSpecialFX1(x, y, item);
else
itemSpecialFX2(x, y, item);
}
-void KyraEngine_v1::itemSpecialFX1(int x, int y, int item) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::itemSpecialFX1(%d, %d, %d)", x, y, item);
+void KyraEngine_LoK::itemSpecialFX1(int x, int y, int item) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::itemSpecialFX1(%d, %d, %d)", x, y, item);
uint8 *shape = _shapes[216+item];
x -= 8;
int startY = y;
@@ -632,8 +632,8 @@ void KyraEngine_v1::itemSpecialFX1(int x, int y, int item) {
_screen->showMouse();
}
-void KyraEngine_v1::itemSpecialFX2(int x, int y, int item) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::itemSpecialFX2(%d, %d, %d)", x, y, item);
+void KyraEngine_LoK::itemSpecialFX2(int x, int y, int item) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::itemSpecialFX2(%d, %d, %d)", x, y, item);
x -= 8;
y -= 15;
int yAdd = (int8)(((16 - _itemTable[item].height) >> 1) & 0xFF);
@@ -660,8 +660,8 @@ void KyraEngine_v1::itemSpecialFX2(int x, int y, int item) {
restoreItemRect0(x, y);
}
-void KyraEngine_v1::magicOutMouseItem(int animIndex, int itemPos) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::magicOutMouseItem(%d, %d)", animIndex, itemPos);
+void KyraEngine_LoK::magicOutMouseItem(int animIndex, int itemPos) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::magicOutMouseItem(%d, %d)", animIndex, itemPos);
int videoPageBackUp = _screen->_curPage;
_screen->_curPage = 0;
int x = 0, y = 0;
@@ -744,8 +744,8 @@ void KyraEngine_v1::magicOutMouseItem(int animIndex, int itemPos) {
_screen->_curPage = videoPageBackUp;
}
-void KyraEngine_v1::magicInMouseItem(int animIndex, int item, int itemPos) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::magicInMouseItem(%d, %d, %d)", animIndex, item, itemPos);
+void KyraEngine_LoK::magicInMouseItem(int animIndex, int item, int itemPos) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::magicInMouseItem(%d, %d, %d)", animIndex, item, itemPos);
int videoPageBackUp = _screen->_curPage;
_screen->_curPage = 0;
int x = 0, y = 0;
@@ -817,8 +817,8 @@ void KyraEngine_v1::magicInMouseItem(int animIndex, int item, int itemPos) {
_screen->_curPage = videoPageBackUp;
}
-void KyraEngine_v1::specialMouseItemFX(int shape, int x, int y, int animIndex, int tableIndex, int loopStart, int maxLoops) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::specialMouseItemFX(%d, %d, %d, %d, %d, %d, %d)", shape, x, y, animIndex, tableIndex, loopStart, maxLoops);
+void KyraEngine_LoK::specialMouseItemFX(int shape, int x, int y, int animIndex, int tableIndex, int loopStart, int maxLoops) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::specialMouseItemFX(%d, %d, %d, %d, %d, %d, %d)", shape, x, y, animIndex, tableIndex, loopStart, maxLoops);
static const uint8 table1[] = {
0x23, 0x45, 0x55, 0x72, 0x84, 0xCF, 0x00, 0x00
};
@@ -840,8 +840,8 @@ void KyraEngine_v1::specialMouseItemFX(int shape, int x, int y, int animIndex, i
processSpecialMouseItemFX(shape, x, y, tableValue, loopStart, maxLoops);
}
-void KyraEngine_v1::processSpecialMouseItemFX(int shape, int x, int y, int tableValue, int loopStart, int maxLoops) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::processSpecialMouseItemFX(%d, %d, %d, %d, %d, %d)", shape, x, y, tableValue, loopStart, maxLoops);
+void KyraEngine_LoK::processSpecialMouseItemFX(int shape, int x, int y, int tableValue, int loopStart, int maxLoops) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::processSpecialMouseItemFX(%d, %d, %d, %d, %d, %d)", shape, x, y, tableValue, loopStart, maxLoops);
uint8 shapeColorTable[16];
uint8 *shapePtr = _shapes[shape] + 10;
if (_flags.useAltShapeHeader)
@@ -859,8 +859,8 @@ void KyraEngine_v1::processSpecialMouseItemFX(int shape, int x, int y, int table
_screen->drawShape(0, _shapes[shape], x, y, 0, 0x8000, shapeColorTable);
}
-void KyraEngine_v1::updatePlayerItemsForScene() {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::updatePlayerItemsForScene()");
+void KyraEngine_LoK::updatePlayerItemsForScene() {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::updatePlayerItemsForScene()");
if (_itemInHand >= 29 && _itemInHand < 33) {
++_itemInHand;
if (_itemInHand > 33)
@@ -900,7 +900,7 @@ void KyraEngine_v1::updatePlayerItemsForScene() {
_screen->showMouse();
}
-void KyraEngine_v1::redrawInventory(int page) {
+void KyraEngine_LoK::redrawInventory(int page) {
int videoPageBackUp = _screen->_curPage;
_screen->_curPage = page;
_screen->hideMouse();
@@ -916,26 +916,26 @@ void KyraEngine_v1::redrawInventory(int page) {
_screen->updateScreen();
}
-void KyraEngine_v1::backUpItemRect0(int xpos, int ypos) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::backUpItemRect0(%d, %d)", xpos, ypos);
+void KyraEngine_LoK::backUpItemRect0(int xpos, int ypos) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::backUpItemRect0(%d, %d)", xpos, ypos);
_screen->rectClip(xpos, ypos, 3<<3, 24);
_screen->copyRegionToBuffer(_screen->_curPage, xpos, ypos, 3<<3, 24, _itemBkgBackUp[0]);
}
-void KyraEngine_v1::restoreItemRect0(int xpos, int ypos) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::restoreItemRect0(%d, %d)", xpos, ypos);
+void KyraEngine_LoK::restoreItemRect0(int xpos, int ypos) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::restoreItemRect0(%d, %d)", xpos, ypos);
_screen->rectClip(xpos, ypos, 3<<3, 24);
_screen->copyBlockToPage(_screen->_curPage, xpos, ypos, 3<<3, 24, _itemBkgBackUp[0]);
}
-void KyraEngine_v1::backUpItemRect1(int xpos, int ypos) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::backUpItemRect1(%d, %d)", xpos, ypos);
+void KyraEngine_LoK::backUpItemRect1(int xpos, int ypos) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::backUpItemRect1(%d, %d)", xpos, ypos);
_screen->rectClip(xpos, ypos, 4<<3, 32);
_screen->copyRegionToBuffer(_screen->_curPage, xpos, ypos, 4<<3, 32, _itemBkgBackUp[1]);
}
-void KyraEngine_v1::restoreItemRect1(int xpos, int ypos) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::restoreItemRect1(%d, %d)", xpos, ypos);
+void KyraEngine_LoK::restoreItemRect1(int xpos, int ypos) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::restoreItemRect1(%d, %d)", xpos, ypos);
_screen->rectClip(xpos, ypos, 4<<3, 32);
_screen->copyBlockToPage(_screen->_curPage, xpos, ypos, 4<<3, 32, _itemBkgBackUp[1]);
}
diff --git a/engines/kyra/items_mr.cpp b/engines/kyra/items_mr.cpp
index 8ace9f8a3c..299c826e80 100644
--- a/engines/kyra/items_mr.cpp
+++ b/engines/kyra/items_mr.cpp
@@ -97,7 +97,7 @@ void KyraEngine_MR::setMouseCursor(uint16 item) {
void KyraEngine_MR::setItemMouseCursor() {
debugC(9, kDebugLevelMain, "KyraEngine_MR::setItemMouseCursor()");
- _handItemSet = _itemInHand;
+ _mouseState = _itemInHand;
if (_itemInHand == -1)
_screen->setMouseCursor(0, 0, _gameShapes[0]);
else
@@ -107,7 +107,7 @@ void KyraEngine_MR::setItemMouseCursor() {
bool KyraEngine_MR::dropItem(int unk1, uint16 item, int x, int y, int unk2) {
debugC(9, kDebugLevelMain, "KyraEngine_MR::dropItem(%d, %d, %d, %d, %d)", unk1, item, x, y, unk2);
- if (_handItemSet <= -1)
+ if (_mouseState <= -1)
return false;
if (processItemDrop(_mainCharacter.sceneId, item, x, y, unk1, unk2))
diff --git a/engines/kyra/items_v2.cpp b/engines/kyra/items_v2.cpp
index 78768c70ab..83f637b06f 100644
--- a/engines/kyra/items_v2.cpp
+++ b/engines/kyra/items_v2.cpp
@@ -30,7 +30,7 @@ namespace Kyra {
void KyraEngine_v2::initItemList(int size) {
debugC(9, kDebugLevelMain, "KyraEngine_v2::initItemList(%d)", size);
- delete [] _itemList;
+ delete[] _itemList;
_itemList = new Item[size];
assert(_itemList);
@@ -112,7 +112,7 @@ void KyraEngine_v2::removeHandItem() {
scr->hideMouse();
scr->setMouseCursor(0, 0, getShapePtr(0));
_itemInHand = -1;
- _handItemSet = -1;
+ _mouseState = -1;
scr->showMouse();
}
diff --git a/engines/kyra/kyra.cpp b/engines/kyra/kyra.cpp
deleted file mode 100644
index 05d8b79a4e..0000000000
--- a/engines/kyra/kyra.cpp
+++ /dev/null
@@ -1,393 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- *
- */
-
-#include "common/config-manager.h"
-
-#include "sound/mididrv.h"
-#include "sound/mixer.h"
-
-#include "kyra/kyra.h"
-#include "kyra/sound.h"
-#include "kyra/resource.h"
-#include "kyra/screen.h"
-#include "kyra/text.h"
-#include "kyra/timer.h"
-#include "kyra/script.h"
-
-namespace Kyra {
-
-KyraEngine::KyraEngine(OSystem *system, const GameFlags &flags)
- : Engine(system), _flags(flags) {
- _res = 0;
- _sound = 0;
- _text = 0;
- _staticres = 0;
- _timer = 0;
- _emc = 0;
-
- _gameSpeed = 60;
- _tickLength = (uint8)(1000.0 / _gameSpeed);
-
- _quitFlag = false;
-
- _speechFile = "";
- _trackMap = 0;
- _trackMapSize = 0;
- _lastMusicCommand = -1;
- _curSfxFile = _curMusicTheme = -1;
-
- _gameToLoad = -1;
-
- memset(_flagsTable, 0, sizeof(_flagsTable));
-
- // sets up all engine specific debug levels
- Common::addSpecialDebugLevel(kDebugLevelScriptFuncs, "ScriptFuncs", "Script function debug level");
- Common::addSpecialDebugLevel(kDebugLevelScript, "Script", "Script interpreter debug level");
- Common::addSpecialDebugLevel(kDebugLevelSprites, "Sprites", "Sprite debug level");
- Common::addSpecialDebugLevel(kDebugLevelScreen, "Screen", "Screen debug level");
- Common::addSpecialDebugLevel(kDebugLevelSound, "Sound", "Sound debug level");
- Common::addSpecialDebugLevel(kDebugLevelAnimator, "Animator", "Animator debug level");
- Common::addSpecialDebugLevel(kDebugLevelMain, "Main", "Generic debug level");
- Common::addSpecialDebugLevel(kDebugLevelGUI, "GUI", "GUI debug level");
- Common::addSpecialDebugLevel(kDebugLevelSequence, "Sequence", "Sequence debug level");
- Common::addSpecialDebugLevel(kDebugLevelMovie, "Movie", "Movie debug level");
- Common::addSpecialDebugLevel(kDebugLevelTimer, "Timer", "Timer debug level");
-
- system->getEventManager()->registerRandomSource(_rnd, "kyra");
-}
-
-int KyraEngine::init() {
- registerDefaultSettings();
-
- // Setup mixer
- _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume"));
- _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume"));
- _mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, ConfMan.getInt("speech_volume"));
-
- if (!_flags.useDigSound) {
- // We prefer AdLib over native MIDI, since our AdLib playback code is much
- // more mature than our MIDI player. For example we are missing MT-32 support
- // and it seems our MIDI playback code has threading issues (see bug #1506583
- // "KYRA1: Crash on exceeded polyphony" for more information).
- int midiDriver = MidiDriver::detectMusicDriver(MDT_MIDI | MDT_ADLIB/* | MDT_PREFER_MIDI*/);
-
- if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98) {
- // TODO: currently we don't support the PC98 sound data,
- // but since it has the FM-Towns data files, we just use the
- // FM-Towns driver
- if (_flags.gameID == GI_KYRA1)
- _sound = new SoundTowns(this, _mixer);
- else
- _sound = new SoundTowns_v2(this, _mixer);
- } else if (midiDriver == MD_ADLIB) {
- _sound = new SoundAdlibPC(this, _mixer);
- assert(_sound);
- } else {
- bool native_mt32 = ((midiDriver == MD_MT32) || ConfMan.getBool("native_mt32"));
-
- MidiDriver *driver = MidiDriver::createMidi(midiDriver);
- assert(driver);
- if (native_mt32)
- driver->property(MidiDriver::PROP_CHANNEL_MASK, 0x03FE);
-
- SoundMidiPC *soundMidiPc = new SoundMidiPC(this, _mixer, driver);
- _sound = soundMidiPc;
- assert(_sound);
- soundMidiPc->hasNativeMT32(native_mt32);
-
- // Unlike some SCUMM games, it's not that the MIDI sounds are
- // missing. It's just that at least at the time of writing they
- // are decidedly inferior to the Adlib ones.
- if (ConfMan.getBool("multi_midi")) {
- SoundAdlibPC *adlib = new SoundAdlibPC(this, _mixer);
- assert(adlib);
-
- _sound = new MixedSoundDriver(this, _mixer, soundMidiPc, adlib);
- assert(_sound);
- }
- }
- }
-
- if (_sound)
- _sound->updateVolumeSettings();
-
- _res = new Resource(this);
- assert(_res);
- _res->reset();
- _staticres = new StaticResource(this);
- assert(_staticres);
- if (!_staticres->init())
- error("_staticres->init() failed");
- if (!screen()->init())
- error("screen()->init() failed");
- _timer = new TimerManager(this, _system);
- assert(_timer);
- setupTimers();
- _emc = new EMCInterpreter(this);
- assert(_emc);
-
- setupOpcodeTable();
- readSettings();
-
- if (ConfMan.hasKey("save_slot")) {
- _gameToLoad = ConfMan.getInt("save_slot");
- if (!saveFileLoadable(_gameToLoad))
- _gameToLoad = -1;
- }
-
- _lang = 0;
- Common::Language lang = Common::parseLanguage(ConfMan.get("language"));
-
- if (_flags.gameID == GI_KYRA2 || _flags.gameID == GI_KYRA3) {
- switch (lang) {
- case Common::EN_ANY:
- case Common::EN_USA:
- case Common::EN_GRB:
- _lang = 0;
- break;
-
- case Common::FR_FRA:
- _lang = 1;
- break;
-
- case Common::DE_DEU:
- _lang = 2;
- break;
-
- case Common::JA_JPN:
- _lang = 3;
- break;
-
- default:
- warning("unsupported language, switching back to English");
- _lang = 0;
- break;
- }
- }
-
- return 0;
-}
-
-KyraEngine::~KyraEngine() {
- for (Common::Array<const Opcode*>::iterator i = _opcodes.begin(); i != _opcodes.end(); ++i)
- delete *i;
- _opcodes.clear();
-
- delete _res;
- delete _staticres;
- delete _sound;
- delete _text;
- delete _timer;
- delete _emc;
-}
-
-void KyraEngine::quitGame() {
- debugC(9, kDebugLevelMain, "KyraEngine::quitGame()");
- _quitFlag = true;
- // Nothing to do here
-}
-
-Common::Point KyraEngine::getMousePos() const {
- Common::Point mouse = _eventMan->getMousePos();
-
- if (_flags.useHiResOverlay) {
- mouse.x >>= 1;
- mouse.y >>= 1;
- }
-
- return mouse;
-}
-
-void KyraEngine::setMousePos(int x, int y) {
- if (_flags.useHiResOverlay) {
- x <<= 1;
- y <<= 1;
- }
- _system->warpMouse(x, y);
-}
-
-int KyraEngine::setGameFlag(int flag) {
- _flagsTable[flag >> 3] |= (1 << (flag & 7));
- return 1;
-}
-
-int KyraEngine::queryGameFlag(int flag) const {
- return ((_flagsTable[flag >> 3] >> (flag & 7)) & 1);
-}
-
-int KyraEngine::resetGameFlag(int flag) {
- _flagsTable[flag >> 3] &= ~(1 << (flag & 7));
- return 0;
-}
-
-void KyraEngine::delayUntil(uint32 timestamp, bool updateTimers, bool update, bool isMainLoop) {
- while (_system->getMillis() < timestamp && !_quitFlag) {
- if (timestamp - _system->getMillis() >= 10)
- delay(10, update, isMainLoop);
- }
-}
-
-void KyraEngine::delay(uint32 amount, bool update, bool isMainLoop) {
- _system->delayMillis(amount);
-}
-
-void KyraEngine::delayWithTicks(int ticks) {
- delay(ticks * _tickLength);
-}
-
-void KyraEngine::registerDefaultSettings() {
- if (_flags.gameID != GI_KYRA3)
- ConfMan.registerDefault("cdaudio", (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98));
-}
-
-void KyraEngine::readSettings() {
- _configWalkspeed = ConfMan.getInt("walkspeed");
- _configMusic = 0;
-
- if (!ConfMan.getBool("music_mute")) {
- _configMusic = 1;
- if (_flags.gameID != GI_KYRA3 && ConfMan.getBool("cdaudio") && (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98))
- _configMusic = 2;
- }
- _configSounds = ConfMan.getBool("sfx_mute") ? 0 : 1;
-
- if (_sound) {
- _sound->enableMusic(_configMusic);
- _sound->enableSFX(_configSounds);
- }
-
- bool speechMute = ConfMan.getBool("speech_mute");
- bool subtitles = ConfMan.getBool("subtitles");
-
- if (!speechMute && subtitles)
- _configVoice = 2; // Voice & Text
- else if (!speechMute && !subtitles)
- _configVoice = 1; // Voice only
- else
- _configVoice = 0; // Text only
-
- setWalkspeed(_configWalkspeed);
-}
-
-void KyraEngine::writeSettings() {
- bool speechMute, subtitles;
-
- ConfMan.setInt("walkspeed", _configWalkspeed);
- ConfMan.setBool("music_mute", _configMusic == 0);
- if (_flags.gameID != GI_KYRA3)
- ConfMan.setBool("cdaudio", _configMusic == 2);
- ConfMan.setBool("sfx_mute", _configSounds == 0);
-
- switch (_configVoice) {
- case 0: // Text only
- speechMute = true;
- subtitles = true;
- break;
- case 1: // Voice only
- speechMute = false;
- subtitles = false;
- break;
- default: // Voice & Text
- speechMute = false;
- subtitles = true;
- break;
- }
-
- if (_sound) {
- if (!_configMusic)
- _sound->beginFadeOut();
- _sound->enableMusic(_configMusic);
- _sound->enableSFX(_configSounds);
- }
-
- ConfMan.setBool("speech_mute", speechMute);
- ConfMan.setBool("subtitles", subtitles);
-
- ConfMan.flushToDisk();
-}
-
-bool KyraEngine::speechEnabled() {
- return _flags.isTalkie && (_configVoice == 1 || _configVoice == 2);
-}
-
-bool KyraEngine::textEnabled() {
- return !_flags.isTalkie || (_configVoice == 0 || _configVoice == 2);
-}
-
-inline int convertValueToMixer(int value) {
- value -= 2;
- return (value * Audio::Mixer::kMaxMixerVolume) / 95;
-}
-
-inline int convertValueFromMixer(int value) {
- return (value * 95) / Audio::Mixer::kMaxMixerVolume + 2;
-}
-
-void KyraEngine::setVolume(kVolumeEntry vol, uint8 value) {
- switch (vol) {
- case kVolumeMusic:
- ConfMan.setInt("music_volume", convertValueToMixer(value));
- break;
-
- case kVolumeSfx:
- ConfMan.setInt("sfx_volume", convertValueToMixer(value));
- break;
-
- case kVolumeSpeech:
- ConfMan.setInt("speech_volume", convertValueToMixer(value));
- break;
- }
-
- // Resetup mixer
- _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume"));
- _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume"));
- _mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, ConfMan.getInt("speech_volume"));
- if (_sound)
- _sound->updateVolumeSettings();
-}
-
-uint8 KyraEngine::getVolume(kVolumeEntry vol) {
- switch (vol) {
- case kVolumeMusic:
- return convertValueFromMixer(ConfMan.getInt("music_volume"));
- break;
-
- case kVolumeSfx:
- return convertValueFromMixer(ConfMan.getInt("sfx_volume"));
- break;
-
- case kVolumeSpeech:
- if (speechEnabled())
- return convertValueFromMixer(ConfMan.getInt("speech_volume"));
- else
- return 2;
- break;
- }
-
- return 2;
-}
-
-} // End of namespace Kyra
-
diff --git a/engines/kyra/kyra.h b/engines/kyra/kyra.h
deleted file mode 100644
index 18a4a52fe2..0000000000
--- a/engines/kyra/kyra.h
+++ /dev/null
@@ -1,268 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- *
- */
-
-#ifndef KYRA_KYRA_H
-#define KYRA_KYRA_H
-
-#include "engines/engine.h"
-
-#include "common/array.h"
-#include "common/events.h"
-
-#include "kyra/script.h"
-
-namespace Common {
-class InSaveFile;
-class OutSaveFile;
-} // end of namespace Common
-
-class KyraMetaEngine;
-
-namespace Kyra {
-
-struct GameFlags {
- Common::Language lang;
- Common::Platform platform;
-
- bool isDemo : 1;
- bool useAltShapeHeader : 1; // alternative shape header (uses 2 bytes more, those are unused though)
- bool isTalkie : 1;
- bool useHiResOverlay : 1;
- bool useDigSound : 1;
-
- byte gameID;
-};
-
-enum {
- GI_KYRA1 = 0,
- GI_KYRA2 = 1,
- GI_KYRA3 = 2
-};
-
-struct AudioDataStruct {
- const char * const *_fileList;
- const int _fileListLen;
- const void * const _cdaTracks;
- const int _cdaNumTracks;
-};
-
-// TODO: this is just the start of makeing the debug output of the kyra engine a bit more useable
-// in the future we maybe merge some flags and/or create new ones
-enum kDebugLevels {
- kDebugLevelScriptFuncs = 1 << 0, // prints debug output of o#_* functions
- kDebugLevelScript = 1 << 1, // prints debug output of "EMCInterpreter" functions
- kDebugLevelSprites = 1 << 2, // prints debug output of "Sprites" functions
- kDebugLevelScreen = 1 << 3, // prints debug output of "Screen" functions
- kDebugLevelSound = 1 << 4, // prints debug output of "Sound" functions
- kDebugLevelAnimator = 1 << 5, // prints debug output of "ScreenAnimator" functions
- kDebugLevelMain = 1 << 6, // prints debug output of common "KyraEngine(_v#)" functions && "TextDisplayer" functions
- kDebugLevelGUI = 1 << 7, // prints debug output of "KyraEngine*" gui functions
- kDebugLevelSequence = 1 << 8, // prints debug output of "SeqPlayer" functions
- kDebugLevelMovie = 1 << 9, // prints debug output of movie specific funtions
- kDebugLevelTimer = 1 << 10 // prints debug output of "TimerManager" functions
-};
-
-enum kMusicDataID {
- kMusicIntro = 0,
- kMusicIngame,
- kMusicFinale
-};
-
-class Screen;
-class Resource;
-class Sound;
-class Movie;
-class TextDisplayer;
-class StaticResource;
-class TimerManager;
-
-class KyraEngine : public Engine {
-friend class Debugger;
-friend class ::KyraMetaEngine;
-friend class GUI;
-public:
- KyraEngine(OSystem *system, const GameFlags &flags);
- virtual ~KyraEngine();
-
- bool quit() const { return _quitFlag; }
-
- uint8 game() const { return _flags.gameID; }
- const GameFlags &gameFlags() const { return _flags; }
-
- // access to Kyra specific functionallity
- Resource *resource() { return _res; }
- virtual Screen *screen() = 0;
- virtual TextDisplayer *text() { return _text; }
- Sound *sound() { return _sound; }
- StaticResource *staticres() { return _staticres; }
- TimerManager *timer() { return _timer; }
-
- uint32 tickLength() const { return _tickLength; }
-
- Common::RandomSource _rnd;
-
- // input
- void setMousePos(int x, int y);
- Common::Point getMousePos() const;
-
- // config specific
- bool speechEnabled();
- bool textEnabled();
-
- enum kVolumeEntry {
- kVolumeMusic = 0,
- kVolumeSfx = 1,
- kVolumeSpeech = 2
- };
-
- // volume reaches from 2 to 97
- void setVolume(kVolumeEntry vol, uint8 value);
- uint8 getVolume(kVolumeEntry vol);
-
- // quit handling
- virtual void quitGame();
-
- // game flag handling
- int setGameFlag(int flag);
- int queryGameFlag(int flag) const;
- int resetGameFlag(int flag);
-
- // sound
- virtual void snd_playTheme(int file, int track);
- virtual void snd_playSoundEffect(int id, int volume=0xFF);
- virtual void snd_playWanderScoreViaMap(int command, int restart);
- virtual void snd_playVoiceFile(int id) = 0;
- virtual bool snd_voiceIsPlaying();
- virtual void snd_stopVoice();
-
- // delay functionallity
- virtual void delayUntil(uint32 timestamp, bool updateGameTimers = false, bool update = false, bool isMainLoop = false);
- virtual void delay(uint32 millis, bool update = false, bool isMainLoop = false);
- virtual void delayWithTicks(int ticks);
-
-protected:
- virtual int go() = 0;
- virtual int init();
-
- // quit Handling
- bool _quitFlag;
-
- // intern
- Resource *_res;
- Sound *_sound;
- TextDisplayer *_text;
- StaticResource *_staticres;
- TimerManager *_timer;
- EMCInterpreter *_emc;
-
- // config specific
- virtual void registerDefaultSettings();
- virtual void readSettings();
- virtual void writeSettings();
-
- uint8 _configWalkspeed;
-
- int _configMusic;
- bool _configSounds;
- uint8 _configVoice;
-
- // game speed
- virtual bool skipFlag() const = 0;
- virtual void resetSkipFlag(bool removeEvent = true) = 0;
-
- uint16 _tickLength;
- uint16 _gameSpeed;
-
- // timer
- virtual void setupTimers() = 0;
-
- virtual void setWalkspeed(uint8 speed) = 0;
-
- // detection
- GameFlags _flags;
- int _lang;
-
- // opcode
- virtual void setupOpcodeTable() = 0;
- Common::Array<const Opcode*> _opcodes;
-
- // game flags
- uint8 _flagsTable[100]; // TODO: check this value
-
- // sound
- Common::String _speechFile;
-
- int _curMusicTheme;
- int _curSfxFile;
- int16 _lastMusicCommand;
-
- const int8 *_trackMap;
- int _trackMapSize;
-
- // pathfinder
- virtual int findWay(int x, int y, int toX, int toY, int *moveTable, int moveTableSize);
- int findSubPath(int x, int y, int toX, int toY, int *moveTable, int start, int end);
- int getFacingFromPointToPoint(int x, int y, int toX, int toY);
- int getOppositeFacingDirection(int dir);
- void changePosTowardsFacing(int &x, int &y, int facing);
- int getMoveTableSize(int *moveTable);
- virtual bool lineIsPassable(int x, int y) = 0;
-
- static const int8 _addXPosTable[];
- static const int8 _addYPosTable[];
-
- // save/load
- int _gameToLoad;
-
- const char *getSavegameFilename(int num);
- bool saveFileLoadable(int slot);
-
- struct SaveHeader {
- Common::String description;
- uint32 version;
- byte gameID;
- uint32 flags;
-
- bool originalSave; // savegame from original interpreter
- bool oldHeader; // old scummvm save header
- };
-
- enum kReadSaveHeaderError {
- kRSHENoError = 0,
- kRSHEInvalidType = 1,
- kRSHEInvalidVersion = 2,
- kRSHEIoError = 3
- };
-
- static kReadSaveHeaderError readSaveHeader(Common::InSaveFile *file, SaveHeader &header);
-
- Common::InSaveFile *openSaveForReading(const char *filename, SaveHeader &header);
- Common::OutSaveFile *openSaveForWriting(const char *filename, const char *saveName) const;
-};
-
-} // End of namespace Kyra
-
-#endif
-
diff --git a/engines/kyra/kyra_hof.cpp b/engines/kyra/kyra_hof.cpp
index c25af91bec..57f0dcc24a 100644
--- a/engines/kyra/kyra_hof.cpp
+++ b/engines/kyra/kyra_hof.cpp
@@ -23,7 +23,7 @@
*
*/
-#include "kyra/kyra.h"
+#include "kyra/kyra_v1.h"
#include "kyra/kyra_hof.h"
#include "kyra/screen.h"
#include "kyra/resource.h"
@@ -49,11 +49,13 @@ const KyraEngine_v2::EngineDesc KyraEngine_HoF::_hofEngineDesc = {
8,
// Animation script specific
- 33
+ 33,
+
+ // Item specific
+ 175
};
KyraEngine_HoF::KyraEngine_HoF(OSystem *system, const GameFlags &flags) : KyraEngine_v2(system, flags, _hofEngineDesc), _updateFunctor(this, &KyraEngine_HoF::update) {
- _mouseSHPBuf = 0;
_screen = 0;
_text = 0;
@@ -79,7 +81,7 @@ KyraEngine_HoF::KyraEngine_HoF(OSystem *system, const GameFlags &flags) : KyraEn
_oldTalkFile = -1;
_currentTalkFile = 0;
_lastSfxTrack = -1;
- _handItemSet = -1;
+ _mouseState = -1;
_unkHandleSceneChangeFlag = false;
_pathfinderFlag = 0;
_mouseX = _mouseY = 0;
@@ -140,13 +142,14 @@ KyraEngine_HoF::KyraEngine_HoF(OSystem *system, const GameFlags &flags) : KyraEn
_menuDirectlyToLoad = false;
_menu = 0;
+ _chatIsNote = false;
+ memset(&_npcScriptData, 0, sizeof(_npcScriptData));
}
KyraEngine_HoF::~KyraEngine_HoF() {
cleanup();
seq_uninit();
- delete [] _mouseSHPBuf;
delete _screen;
delete _text;
delete _gui;
@@ -157,29 +160,67 @@ KyraEngine_HoF::~KyraEngine_HoF() {
if (_sequenceSoundList) {
for (int i = 0; i < _sequenceSoundListSize; i++) {
if (_sequenceSoundList[i])
- delete [] _sequenceSoundList[i];
+ delete[] _sequenceSoundList[i];
}
- delete [] _sequenceSoundList;
+ delete[] _sequenceSoundList;
_sequenceSoundList = NULL;
}
if (_dlgBuffer)
- delete [] _dlgBuffer;
+ delete[] _dlgBuffer;
for (int i = 0; i < 19; i++)
- delete [] _conversationState[i];
- delete [] _conversationState;
+ delete[] _conversationState[i];
+ delete[] _conversationState;
for (Common::Array<const TIMOpcode*>::iterator i = _timOpcodes.begin(); i != _timOpcodes.end(); ++i)
delete *i;
_timOpcodes.clear();
}
+void KyraEngine_HoF::pauseEngineIntern(bool pause) {
+ KyraEngine_v2::pauseEngineIntern(pause);
+
+ if (!pause) {
+ uint32 pausedTime = _system->getMillis() - _pauseStart;
+ _pauseStart = 0;
+
+ // sequence player
+ //
+ // Timers in KyraEngine_HoF::seq_cmpFadeFrame() and KyraEngine_HoF::seq_animatedSubFrame()
+ // have been left out for now. I think we don't need them here.
+
+ _seqStartTime += pausedTime;
+ _seqSubFrameStartTime += pausedTime;
+ _seqEndTime += pausedTime;
+ _seqSubFrameEndTimeInternal += pausedTime;
+ _seqWsaChatTimeout += pausedTime;
+ _seqWsaChatFrameTimeout += pausedTime;
+
+ for (int x = 0; x < 10; x++) {
+ if (_activeText[x].duration != -1)
+ _activeText[x].startTime += pausedTime;
+ }
+
+ for (int x = 0; x < 8; x++) {
+ if (_activeWSA[x].flags != -1)
+ _activeWSA[x].nextFrame += pausedTime;
+ }
+
+ _nextIdleAnim += pausedTime;
+
+ for (int x = 0; x < _itemAnimDataSize; x++)
+ _activeItemAnim[x].nextFrame += pausedTime;
+
+ _tim->refreshTimersAfterPause(pausedTime);
+ }
+}
+
int KyraEngine_HoF::init() {
_screen = new Screen_HoF(this, _system);
assert(_screen);
_screen->setResolution();
- KyraEngine::init();
+ KyraEngine_v1::init();
initStaticResource();
_debugger = new Debugger_HoF(this);
@@ -218,11 +259,14 @@ int KyraEngine_HoF::init() {
if (_flags.isDemo && !_flags.isTalkie)
return 0;
- _mouseSHPBuf = _res->fileData("PWGMOUSE.SHP", 0);
- assert(_mouseSHPBuf);
+ _res->exists("PWGMOUSE.SHP", true);
+ uint8 *shapes = _res->fileData("PWGMOUSE.SHP", 0);
+ assert(shapes);
for (int i = 0; i < 2; i++)
- addShapeToPool(_screen->getPtrToShape(_mouseSHPBuf, i), i);
+ addShapeToPool(shapes, i, i);
+
+ delete[] shapes;
_screen->setMouseCursor(0, 0, getShapePtr(0));
return 0;
@@ -280,10 +324,7 @@ void KyraEngine_HoF::startup() {
allocAnimObjects(1, 10, 30);
_screen->_curPage = 0;
- delete [] _mouseSHPBuf;
- _mouseSHPBuf = 0;
- _gameShapes.clear();
memset(_sceneShapeTable, 0, sizeof(_sceneShapeTable));
_gamePlayBuffer = new uint8[46080];
_unkBuf500Bytes = new uint8[500];
@@ -316,18 +357,16 @@ void KyraEngine_HoF::startup() {
_screen->setShapePages(5, 3);
- memset(&_mainCharacter, 0, sizeof(_mainCharacter));
_mainCharacter.height = 0x30;
_mainCharacter.facing = 4;
_mainCharacter.animFrame = 0x12;
- memset(_mainCharacter.inventory, -1, sizeof(_mainCharacter.inventory));
memset(_sceneAnims, 0, sizeof(_sceneAnims));
for (int i = 0; i < ARRAYSIZE(_sceneAnimMovie); ++i)
- _sceneAnimMovie[i] = new WSAMovieV2(this, _screen);
+ _sceneAnimMovie[i] = new WSAMovie_v2(this, _screen);
memset(_wsaSlots, 0, sizeof(_wsaSlots));
for (int i = 0; i < ARRAYSIZE(_wsaSlots); ++i)
- _wsaSlots[i] = new WSAMovieV2(this, _screen);
+ _wsaSlots[i] = new WSAMovie_v2(this, _screen);
_screen->_curPage = 0;
@@ -448,7 +487,7 @@ void KyraEngine_HoF::runLoop() {
update();
if (inputFlag == 198 || inputFlag == 199) {
- _unk3 = _handItemSet;
+ _unk3 = _mouseState;
handleInput(_mouseX, _mouseY);
}
@@ -567,7 +606,7 @@ bool KyraEngine_HoF::handleInputUnkSub(int x, int y) {
if (y > 143 || _deathHandler > -1 || queryGameFlag(0x164))
return false;
- if (_handItemSet <= -3 && findItem(_mainCharacter.sceneId, 13) >= 0) {
+ if (_mouseState <= -3 && findItem(_mainCharacter.sceneId, 13) >= 0) {
updateCharFacing();
objectChat(getTableString(0xFC, _cCodeBuffer, 1), 0, 0x83, 0xFC);
return true;
@@ -722,17 +761,16 @@ void KyraEngine_HoF::updateMouse() {
yOffset = 9;
}
- if (type != 0 && _handItemSet != type && _screen->isMouseVisible()) {
- _mouseState = _handItemSet = type;
+ if (type != 0 && _mouseState != type && _screen->isMouseVisible()) {
+ _mouseState = type;
_screen->hideMouse();
_screen->setMouseCursor(xOffset, yOffset, getShapePtr(shapeIndex));
_screen->showMouse();
}
- if (type == 0 && _handItemSet != _itemInHand && _screen->isMouseVisible()) {
+ if (type == 0 && _mouseState != _itemInHand && _screen->isMouseVisible()) {
if ((mouse.y > 145) || (mouse.x > 6 && mouse.x < 312 && mouse.y > 6 && mouse.y < 135)) {
- _mouseState = 0;
- _handItemSet = _itemInHand;
+ _mouseState = _itemInHand;
_screen->hideMouse();
if (_itemInHand == -1)
_screen->setMouseCursor(0, 0, getShapePtr(0));
@@ -743,44 +781,25 @@ void KyraEngine_HoF::updateMouse() {
}
}
-void KyraEngine_HoF::delay(uint32 amount, bool updateGame, bool isMainLoop) {
- uint32 start = _system->getMillis();
- do {
- if (updateGame) {
- if (_chatText)
- updateWithText();
- else
- update();
- } else {
- updateInput();
- }
-
- if (amount > 0)
- _system->delayMillis(amount > 10 ? 10 : amount);
- } while (!skipFlag() && _system->getMillis() < start + amount && !_quitFlag);
-}
-
void KyraEngine_HoF::cleanup() {
- delete [] _inventoryButtons; _inventoryButtons = 0;
+ delete[] _inventoryButtons; _inventoryButtons = 0;
- delete [] _gamePlayBuffer; _gamePlayBuffer = 0;
- delete [] _unkBuf500Bytes; _unkBuf500Bytes = 0;
- delete [] _unkBuf200kByte; _unkBuf200kByte = 0;
+ delete[] _gamePlayBuffer; _gamePlayBuffer = 0;
+ delete[] _unkBuf500Bytes; _unkBuf500Bytes = 0;
+ delete[] _unkBuf200kByte; _unkBuf200kByte = 0;
freeSceneShapePtrs();
if (_optionsBuffer != _cCodeBuffer)
- delete [] _optionsBuffer;
+ delete[] _optionsBuffer;
_optionsBuffer = 0;
- delete [] _cCodeBuffer; _cCodeBuffer = 0;
- delete [] _chapterBuffer; _chapterBuffer = 0;
+ delete[] _cCodeBuffer; _cCodeBuffer = 0;
+ delete[] _chapterBuffer; _chapterBuffer = 0;
- delete [] _talkObjectList; _talkObjectList = 0;
- delete [] _shapeDescTable; _shapeDescTable = 0;
+ delete[] _talkObjectList; _talkObjectList = 0;
+ delete[] _shapeDescTable; _shapeDescTable = 0;
- delete [] _gfxBackUpRect; _gfxBackUpRect = 0;
-
- delete [] _sceneList; _sceneList = 0;
+ delete[] _gfxBackUpRect; _gfxBackUpRect = 0;
for (int i = 0; i < ARRAYSIZE(_sceneAnimMovie); ++i) {
delete _sceneAnimMovie[i];
@@ -791,9 +810,11 @@ void KyraEngine_HoF::cleanup() {
_wsaSlots[i] = 0;
}
for (int i = 0; i < ARRAYSIZE(_buttonShapes); ++i) {
- delete [] _buttonShapes[i];
+ delete[] _buttonShapes[i];
_buttonShapes[i] = 0;
}
+
+ _emc->unload(&_npcScriptData);
}
#pragma mark - Localization
@@ -803,7 +824,7 @@ void KyraEngine_HoF::loadCCodeBuffer(const char *file) {
strcpy(tempString, file);
changeFileExtension(tempString);
- delete [] _cCodeBuffer;
+ delete[] _cCodeBuffer;
_cCodeBuffer = _res->fileData(tempString, 0);
}
@@ -812,7 +833,7 @@ void KyraEngine_HoF::loadOptionsBuffer(const char *file) {
strcpy(tempString, file);
changeFileExtension(tempString);
- delete [] _optionsBuffer;
+ delete[] _optionsBuffer;
_optionsBuffer = _res->fileData(tempString, 0);
}
@@ -827,7 +848,7 @@ void KyraEngine_HoF::loadChapterBuffer(int chapter) {
strcpy(tempString, chapterFilenames[chapter-1]);
changeFileExtension(tempString);
- delete [] _chapterBuffer;
+ delete[] _chapterBuffer;
_chapterBuffer = _res->fileData(tempString, 0);
_currentChapter = chapter;
}
@@ -1008,7 +1029,7 @@ void KyraEngine_HoF::loadMouseShapes() {
_screen->loadBitmap("_MOUSE.CSH", 3, 3, 0);
for (int i = 0; i <= 8; ++i)
- addShapeToPool(_screen->makeShapeCopy(_screen->getCPagePtr(3), i), i);
+ addShapeToPool(_screen->getCPagePtr(3), i, i);
}
void KyraEngine_HoF::loadItemShapes() {
@@ -1033,7 +1054,7 @@ void KyraEngine_HoF::loadCharacterShapes(int shapes) {
uint8 *data = _res->fileData(file, 0);
for (int i = 9; i <= 32; ++i)
addShapeToPool(data, i, i-9);
- delete [] data;
+ delete[] data;
_characterShapeFile = shapes;
}
@@ -1070,6 +1091,8 @@ void KyraEngine_HoF::runStartScript(int script, int unk1) {
}
void KyraEngine_HoF::loadNPCScript() {
+ _emc->unload(&_npcScriptData);
+
char filename[12];
strcpy(filename, "_NPC.EMC");
@@ -1382,7 +1405,7 @@ int KyraEngine_HoF::initAnimationShapes(uint8 *filedata) {
void KyraEngine_HoF::uninitAnimationShapes(int count, uint8 *filedata) {
for (int i = 0; i < count; ++i)
remShapeFromPool(i+33);
- delete [] filedata;
+ delete[] filedata;
setNextIdleAnimTimer();
}
@@ -1541,7 +1564,7 @@ void KyraEngine_HoF::snd_playSoundEffect(int track, int volume) {
else if (_flags.platform == Common::kPlatformPC)
// TODO ?? Maybe there is a way to let users select whether they want
// voc, midi or adl sfx (even though it makes no sense to choose anything but voc).
- KyraEngine::snd_playSoundEffect(track);
+ KyraEngine_v1::snd_playSoundEffect(track);
}
#pragma mark -
@@ -1552,7 +1575,7 @@ void KyraEngine_HoF::loadInvWsa(const char *filename, int run, int delayTime, in
wsaFlags |= 2;
if (!_invWsa.wsa)
- _invWsa.wsa = new WSAMovieV2(this, _screen);
+ _invWsa.wsa = new WSAMovie_v2(this, _screen);
if (!_invWsa.wsa->open(filename, wsaFlags, 0))
error("Couldn't open inventory WSA file '%s'", filename);
@@ -1969,7 +1992,7 @@ void KyraEngine_HoF::playTim(const char *filename) {
#pragma mark -
void KyraEngine_HoF::registerDefaultSettings() {
- KyraEngine::registerDefaultSettings();
+ KyraEngine_v1::registerDefaultSettings();
// Most settings already have sensible defaults. This one, however, is
// specific to the Kyra engine.
@@ -2000,13 +2023,13 @@ void KyraEngine_HoF::writeSettings() {
ConfMan.set("language", Common::getLanguageCode(_flags.lang));
- KyraEngine::writeSettings();
+ KyraEngine_v1::writeSettings();
}
void KyraEngine_HoF::readSettings() {
int talkspeed = ConfMan.getInt("talkspeed");
_configTextspeed = (talkspeed*95)/255 + 2;
- KyraEngine::readSettings();
+ KyraEngine_v1::readSettings();
}
} // end of namespace Kyra
diff --git a/engines/kyra/kyra_hof.h b/engines/kyra/kyra_hof.h
index 1e6c23331e..866dd55d16 100644
--- a/engines/kyra/kyra_hof.h
+++ b/engines/kyra/kyra_hof.h
@@ -97,22 +97,17 @@ enum kNestedSequencesDemo {
kSequenceDemoDig
};
-class WSAMovieV2;
+class WSAMovie_v2;
class KyraEngine_HoF;
class TextDisplayer_HoF;
struct TIM;
-typedef int (KyraEngine_HoF::*SeqProc)(WSAMovieV2*, int, int, int);
-
-struct FrameControl {
- uint16 index;
- uint16 delay;
-};
+typedef int (KyraEngine_HoF::*SeqProc)(WSAMovie_v2*, int, int, int);
struct ActiveWSA {
int16 flags;
- WSAMovieV2 *movie;
+ WSAMovie_v2 *movie;
uint16 startFrame;
uint16 endFrame;
uint16 frameDelay;
@@ -179,17 +174,6 @@ struct ItemAnimData_v1 {
const uint16 *frames;
};
-struct ItemAnimData_v2 {
- int16 itemIndex;
- uint8 numFrames;
- const FrameControl *frames;
-};
-
-struct ActiveItemAnim {
- uint16 currentFrame;
- uint32 nextFrame;
-};
-
class KyraEngine_HoF : public KyraEngine_v2 {
friend class Debugger_HoF;
friend class TextDisplayer_HoF;
@@ -198,6 +182,8 @@ public:
KyraEngine_HoF(OSystem *system, const GameFlags &flags);
~KyraEngine_HoF();
+ void pauseEngineIntern(bool pause);
+
Screen *screen() { return _screen; }
Screen_v2 *screen_v2() const { return _screen; }
GUI_v2 *gui_v2() const { return _gui; }
@@ -209,52 +195,52 @@ protected:
// intro/outro
void seq_playSequences(int startSeq, int endSeq = -1);
- int seq_introWestwood(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_introTitle(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_introOverview(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_introLibrary(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_introHand(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_introPoint(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_introZanfaun(WSAMovieV2 *wsaObj, int x, int y, int frm);
-
- int seq_introOver1(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_introOver2(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_introForest(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_introDragon(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_introDarm(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_introLibrary2(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_introMarco(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_introHand1a(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_introHand1b(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_introHand1c(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_introHand2(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_introHand3(WSAMovieV2 *wsaObj, int x, int y, int frm);
-
- int seq_finaleFunters(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_finaleFerb(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_finaleFish(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_finaleFheep(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_finaleFarmer(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_finaleFuards(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_finaleFirates(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_finaleFrash(WSAMovieV2 *wsaObj, int x, int y, int frm);
-
- int seq_finaleFiggle(WSAMovieV2 *wsaObj, int x, int y, int frm);
-
- int seq_demoVirgin(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_demoWestwood(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_demoTitle(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_demoHill(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_demoOuthome(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_demoWharf(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_demoDinob(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_demoFisher(WSAMovieV2 *wsaObj, int x, int y, int frm);
-
- int seq_demoWharf2(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_demoDinob2(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_demoWater(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_demoBail(WSAMovieV2 *wsaObj, int x, int y, int frm);
- int seq_demoDig(WSAMovieV2 *wsaObj, int x, int y, int frm);
+ int seq_introWestwood(WSAMovie_v2 *wsaObj, int x, int y, int frm);
+ int seq_introTitle(WSAMovie_v2 *wsaObj, int x, int y, int frm);
+ int seq_introOverview(WSAMovie_v2 *wsaObj, int x, int y, int frm);
+ int seq_introLibrary(WSAMovie_v2 *wsaObj, int x, int y, int frm);
+ int seq_introHand(WSAMovie_v2 *wsaObj, int x, int y, int frm);
+ int seq_introPoint(WSAMovie_v2 *wsaObj, int x, int y, int frm);
+ int seq_introZanfaun(WSAMovie_v2 *wsaObj, int x, int y, int frm);
+
+ int seq_introOver1(WSAMovie_v2 *wsaObj, int x, int y, int frm);
+ int seq_introOver2(WSAMovie_v2 *wsaObj, int x, int y, int frm);
+ int seq_introForest(WSAMovie_v2 *wsaObj, int x, int y, int frm);
+ int seq_introDragon(WSAMovie_v2 *wsaObj, int x, int y, int frm);
+ int seq_introDarm(WSAMovie_v2 *wsaObj, int x, int y, int frm);
+ int seq_introLibrary2(WSAMovie_v2 *wsaObj, int x, int y, int frm);
+ int seq_introMarco(WSAMovie_v2 *wsaObj, int x, int y, int frm);
+ int seq_introHand1a(WSAMovie_v2 *wsaObj, int x, int y, int frm);
+ int seq_introHand1b(WSAMovie_v2 *wsaObj, int x, int y, int frm);
+ int seq_introHand1c(WSAMovie_v2 *wsaObj, int x, int y, int frm);
+ int seq_introHand2(WSAMovie_v2 *wsaObj, int x, int y, int frm);
+ int seq_introHand3(WSAMovie_v2 *wsaObj, int x, int y, int frm);
+
+ int seq_finaleFunters(WSAMovie_v2 *wsaObj, int x, int y, int frm);
+ int seq_finaleFerb(WSAMovie_v2 *wsaObj, int x, int y, int frm);
+ int seq_finaleFish(WSAMovie_v2 *wsaObj, int x, int y, int frm);
+ int seq_finaleFheep(WSAMovie_v2 *wsaObj, int x, int y, int frm);
+ int seq_finaleFarmer(WSAMovie_v2 *wsaObj, int x, int y, int frm);
+ int seq_finaleFuards(WSAMovie_v2 *wsaObj, int x, int y, int frm);
+ int seq_finaleFirates(WSAMovie_v2 *wsaObj, int x, int y, int frm);
+ int seq_finaleFrash(WSAMovie_v2 *wsaObj, int x, int y, int frm);
+
+ int seq_finaleFiggle(WSAMovie_v2 *wsaObj, int x, int y, int frm);
+
+ int seq_demoVirgin(WSAMovie_v2 *wsaObj, int x, int y, int frm);
+ int seq_demoWestwood(WSAMovie_v2 *wsaObj, int x, int y, int frm);
+ int seq_demoTitle(WSAMovie_v2 *wsaObj, int x, int y, int frm);
+ int seq_demoHill(WSAMovie_v2 *wsaObj, int x, int y, int frm);
+ int seq_demoOuthome(WSAMovie_v2 *wsaObj, int x, int y, int frm);
+ int seq_demoWharf(WSAMovie_v2 *wsaObj, int x, int y, int frm);
+ int seq_demoDinob(WSAMovie_v2 *wsaObj, int x, int y, int frm);
+ int seq_demoFisher(WSAMovie_v2 *wsaObj, int x, int y, int frm);
+
+ int seq_demoWharf2(WSAMovie_v2 *wsaObj, int x, int y, int frm);
+ int seq_demoDinob2(WSAMovie_v2 *wsaObj, int x, int y, int frm);
+ int seq_demoWater(WSAMovie_v2 *wsaObj, int x, int y, int frm);
+ int seq_demoBail(WSAMovie_v2 *wsaObj, int x, int y, int frm);
+ int seq_demoDig(WSAMovie_v2 *wsaObj, int x, int y, int frm);
void seq_sequenceCommand(int command);
void seq_loadNestedSequence(int wsaNum, int seqNum);
@@ -275,7 +261,7 @@ protected:
char *seq_preprocessString(const char *str, int width);
void seq_printCreditsString(uint16 strIndex, int x, int y, const uint8 *colorMap, uint8 textcolor);
void seq_playWsaSyncDialogue(uint16 strIndex, uint16 vocIndex, int textColor, int x, int y, int width,
- WSAMovieV2 * wsa, int firstframe, int lastframe, int wsaXpos, int wsaYpos);
+ WSAMovie_v2 * wsa, int firstframe, int lastframe, int wsaXpos, int wsaYpos);
void seq_finaleActorScreen();
void seq_displayScrollText(uint8 *data, const ScreenDim *d, int tempPage1, int tempPage2, int speed, int step, Screen::FontId fid1, Screen::FontId fid2, const uint8 *shapeData = 0, const char *const *specialData = 0);
void seq_scrollPage();
@@ -291,8 +277,6 @@ protected:
TextDisplayer_HoF *_text;
TIMInterpreter *_tim;
- uint8 *_mouseSHPBuf;
-
static const int8 _dosTrackMap[];
static const int _dosTrackMapSize;
@@ -329,8 +313,6 @@ protected:
void dinoRide();
- int _mouseState;
-
void handleInput(int x, int y);
bool handleInputUnkSub(int x, int y);
@@ -350,7 +332,7 @@ protected:
uint8 *_sceneShapeTable[50];
- WSAMovieV2 *_wsaSlots[10];
+ WSAMovie_v2 *_wsaSlots[10];
void freeSceneShapePtrs();
@@ -675,9 +657,6 @@ protected:
void setWalkspeed(uint8 speed);
- // delay
- void delay(uint32 millis, bool updateGame = false, bool isMainLoop = false);
-
// ingame static sequence handling
void seq_makeBookOrCauldronAppear(int type);
void seq_makeBookAppear();
@@ -690,7 +669,7 @@ protected:
int delay;
bool running;
uint32 timer;
- WSAMovieV2 *wsa;
+ WSAMovie_v2 *wsa;
} _invWsa;
// TODO: move inside KyraEngine_HoF::InventoryWsa?
@@ -732,7 +711,6 @@ protected:
int o2_wipeDownMouseItem(EMCState *script);
int o2_getElapsedSecs(EMCState *script);
int o2_getTimerDelay(EMCState *script);
- //int o2_playSoundEffect(EMCState *script);
int o2_delaySecs(EMCState *script);
int o2_setTimerDelay(EMCState *script);
int o2_setScaleTableItem(EMCState *script);
@@ -759,17 +737,14 @@ protected:
int o2_setLayerFlag(EMCState *script);
int o2_setZanthiaPos(EMCState *script);
int o2_loadMusicTrack(EMCState *script);
- int o2_playSoundEffect(EMCState *script);
int o2_setSceneAnimPos(EMCState *script);
- int o2_blockInRegion(EMCState *script);
- int o2_blockOutRegion(EMCState *script);
int o2_setCauldronState(EMCState *script);
int o2_showItemString(EMCState *script);
int o2_isAnySoundPlaying(EMCState *script);
int o2_setDrawNoShapeFlag(EMCState *script);
int o2_setRunFlag(EMCState *script);
int o2_showLetter(EMCState *script);
- int o2_fillRect(EMCState *script);
+ int o2_playFireflyScore(EMCState *script);
int o2_encodeShape(EMCState *script);
int o2_defineSceneAnim(EMCState *script);
int o2_updateSceneAnim(EMCState *script);
@@ -805,7 +780,7 @@ protected:
int o2_updateTwoSceneAnims(EMCState *script);
int o2_getRainbowRoomData(EMCState *script);
int o2_drawSceneShapeEx(EMCState *script);
- int o2_getBoolFromStack(EMCState *script);
+ int o2_midiSoundFadeout(EMCState *script);
int o2_getSfxDriver(EMCState *script);
int o2_getVocSupport(EMCState *script);
int o2_getMusicDriver(EMCState *script);
@@ -876,14 +851,19 @@ protected:
static const uint8 _seqTextColorPresets[];
char *_seqProcessedString;
- WSAMovieV2 *_seqWsa;
+ WSAMovie_v2 *_seqWsa;
bool _abortIntroFlag;
int _menuChoice;
uint32 _seqFrameDelay;
uint32 _seqStartTime;
+ uint32 _seqSubFrameStartTime;
uint32 _seqEndTime;
+ uint32 _seqSubFrameEndTimeInternal;
+ uint32 _seqWsaChatTimeout;
+ uint32 _seqWsaChatFrameTimeout;
+
int _seqFrameCounter;
int _seqScrollTextCounter;
int _seqWsaCurrentFrame;
diff --git a/engines/kyra/kyra_lok.cpp b/engines/kyra/kyra_lok.cpp
new file mode 100644
index 0000000000..c852f6e3ee
--- /dev/null
+++ b/engines/kyra/kyra_lok.cpp
@@ -0,0 +1,1044 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "kyra/kyra_lok.h"
+
+#include "common/file.h"
+#include "common/events.h"
+#include "common/system.h"
+#include "common/savefile.h"
+
+#include "gui/message.h"
+
+#include "kyra/resource.h"
+#include "kyra/screen.h"
+#include "kyra/script.h"
+#include "kyra/seqplayer.h"
+#include "kyra/sound.h"
+#include "kyra/sprites.h"
+#include "kyra/wsamovie.h"
+#include "kyra/animator_lok.h"
+#include "kyra/text.h"
+#include "kyra/debugger.h"
+#include "kyra/timer.h"
+
+namespace Kyra {
+
+KyraEngine_LoK::KyraEngine_LoK(OSystem *system, const GameFlags &flags)
+ : KyraEngine_v1(system, flags) {
+ _skipFlag = false;
+
+ _seq_Forest = _seq_KallakWriting = _seq_KyrandiaLogo = _seq_KallakMalcolm =
+ _seq_MalcolmTree = _seq_WestwoodLogo = _seq_Demo1 = _seq_Demo2 = _seq_Demo3 =
+ _seq_Demo4 = 0;
+
+ _seq_WSATable = _seq_CPSTable = _seq_COLTable = _seq_textsTable = 0;
+ _seq_WSATable_Size = _seq_CPSTable_Size = _seq_COLTable_Size = _seq_textsTable_Size = 0;
+
+ _roomFilenameTable = _characterImageTable = 0;
+ _roomFilenameTableSize = _characterImageTableSize = 0;
+ _itemList = _takenList = _placedList = _droppedList = _noDropList = 0;
+ _itemList_Size = _takenList_Size = _placedList_Size = _droppedList_Size = _noDropList_Size = 0;
+ _putDownFirst = _waitForAmulet = _blackJewel = _poisonGone = _healingTip = 0;
+ _putDownFirst_Size = _waitForAmulet_Size = _blackJewel_Size = _poisonGone_Size = _healingTip_Size = 0;
+ _thePoison = _fluteString = _wispJewelStrings = _magicJewelString = _flaskFull = _fullFlask = 0;
+ _thePoison_Size = _fluteString_Size = _wispJewelStrings_Size = 0;
+ _magicJewelString_Size = _flaskFull_Size = _fullFlask_Size = 0;
+
+ _defaultShapeTable = 0;
+ _healingShapeTable = _healingShape2Table = 0;
+ _defaultShapeTableSize = _healingShapeTableSize = _healingShape2TableSize = 0;
+ _posionDeathShapeTable = _fluteAnimShapeTable = 0;
+ _posionDeathShapeTableSize = _fluteAnimShapeTableSize = 0;
+ _winterScrollTable = _winterScroll1Table = _winterScroll2Table = 0;
+ _winterScrollTableSize = _winterScroll1TableSize = _winterScroll2TableSize = 0;
+ _drinkAnimationTable = _brandonToWispTable = _magicAnimationTable = _brandonStoneTable = 0;
+ _drinkAnimationTableSize = _brandonToWispTableSize = _magicAnimationTableSize = _brandonStoneTableSize = 0;
+ memset(&_specialPalettes, 0, sizeof(_specialPalettes));
+ _sprites = 0;
+ _animator = 0;
+ _seq = 0;
+ _characterList = 0;
+ _movFacingTable = 0;
+ _buttonData = 0;
+ _buttonDataListPtr = 0;
+ memset(_shapes, 0, sizeof(_shapes));
+ memset(_movieObjects, 0, sizeof(_movieObjects));
+ _finalA = _finalB = _finalC = 0;
+ _endSequenceBackUpRect = 0;
+ memset(_panPagesTable, 0, sizeof(_panPagesTable));
+ memset(_sceneAnimTable, 0, sizeof(_sceneAnimTable));
+ _currHeadShape = 0;
+ _speechPlayTime = 0;
+
+ memset(&_itemBkgBackUp, 0, sizeof(_itemBkgBackUp));
+}
+
+KyraEngine_LoK::~KyraEngine_LoK() {
+ for (int i = 0; i < ARRAYSIZE(_movieObjects); ++i) {
+ if (_movieObjects[i])
+ _movieObjects[i]->close();
+ delete _movieObjects[i];
+ _movieObjects[i] = 0;
+ }
+
+ closeFinalWsa();
+ if (_emc) {
+ _emc->unload(&_npcScriptData);
+ _emc->unload(&_scriptClickData);
+ }
+
+ Common::clearAllSpecialDebugLevels();
+
+ delete _screen;
+ delete _sprites;
+ delete _animator;
+ delete _seq;
+
+ delete[] _characterList;
+
+ delete[] _movFacingTable;
+
+ delete[] _gui->_scrollUpButton.data0ShapePtr;
+ delete[] _gui->_scrollUpButton.data1ShapePtr;
+ delete[] _gui->_scrollUpButton.data2ShapePtr;
+ delete[] _gui->_scrollDownButton.data0ShapePtr;
+ delete[] _gui->_scrollDownButton.data1ShapePtr;
+ delete[] _gui->_scrollDownButton.data2ShapePtr;
+
+ delete[] _buttonData;
+ delete[] _buttonDataListPtr;
+
+ delete _gui;
+
+ delete[] _itemBkgBackUp[0];
+ delete[] _itemBkgBackUp[1];
+
+ for (int i = 0; i < ARRAYSIZE(_shapes); ++i) {
+ if (_shapes[i] != 0) {
+ delete[] _shapes[i];
+ for (int i2 = 0; i2 < ARRAYSIZE(_shapes); i2++) {
+ if (_shapes[i2] == _shapes[i] && i2 != i) {
+ _shapes[i2] = 0;
+ }
+ }
+ _shapes[i] = 0;
+ }
+ }
+
+ for (int i = 0; i < ARRAYSIZE(_sceneAnimTable); ++i)
+ delete[] _sceneAnimTable[i];
+}
+
+int KyraEngine_LoK::init() {
+ _screen = new Screen_LoK(this, _system);
+ assert(_screen);
+ _screen->setResolution();
+
+ KyraEngine_v1::init();
+
+ _sprites = new Sprites(this, _system);
+ assert(_sprites);
+ _seq = new SeqPlayer(this, _system);
+ assert(_seq);
+ _animator = new Animator_LoK(this, _system);
+ assert(_animator);
+ _animator->init(5, 11, 12);
+ assert(*_animator);
+ _text = new TextDisplayer(this, screen());
+ assert(_text);
+ _gui = new GUI_LoK(this, _screen);
+ assert(_gui);
+
+ initStaticResource();
+
+ _sound->setSoundList(&_soundData[kMusicIntro]);
+
+ _trackMap = _dosTrackMap;
+ _trackMapSize = _dosTrackMapSize;
+
+ if (!_sound->init())
+ error("Couldn't init sound");
+
+ _sound->loadSoundFile(0);
+
+ setupButtonData();
+
+ _paletteChanged = 1;
+ _currentCharacter = 0;
+ _characterList = new Character[11];
+ assert(_characterList);
+ memset(_characterList, 0, sizeof(Character)*11);
+
+ for (int i = 0; i < 11; ++i)
+ memset(_characterList[i].inventoryItems, 0xFF, sizeof(_characterList[i].inventoryItems));
+
+ _characterList[0].sceneId = 5;
+ _characterList[0].height = 48;
+ _characterList[0].facing = 3;
+ _characterList[0].currentAnimFrame = 7;
+
+ memset(&_npcScriptData, 0, sizeof(EMCData));
+ memset(&_scriptClickData, 0, sizeof(EMCData));
+
+ memset(&_npcScript, 0, sizeof(EMCState));
+ memset(&_scriptMain, 0, sizeof(EMCState));
+ memset(&_scriptClick, 0, sizeof(EMCState));
+
+ _debugger = new Debugger_LoK(this);
+ assert(_debugger);
+ memset(_shapes, 0, sizeof(_shapes));
+
+ for (int i = 0; i < ARRAYSIZE(_movieObjects); ++i)
+ _movieObjects[i] = createWSAMovie();
+
+ memset(_flagsTable, 0, sizeof(_flagsTable));
+
+ _abortWalkFlag = false;
+ _abortWalkFlag2 = false;
+ _talkingCharNum = -1;
+ _charSayUnk3 = -1;
+ memset(_currSentenceColor, 0, 3);
+ _startSentencePalIndex = -1;
+ _fadeText = false;
+
+ _cauldronState = 0;
+ _crystalState[0] = _crystalState[1] = -1;
+
+ _brandonStatusBit = 0;
+ _brandonStatusBit0x02Flag = _brandonStatusBit0x20Flag = 10;
+ _brandonPosX = _brandonPosY = -1;
+ _poisonDeathCounter = 0;
+
+ memset(_itemTable, 0, sizeof(_itemTable));
+ memset(_exitList, 0xFFFF, sizeof(_exitList));
+ _exitListPtr = 0;
+ _pathfinderFlag = _pathfinderFlag2 = 0;
+ _lastFindWayRet = 0;
+ _sceneChangeState = _loopFlag2 = 0;
+
+ _movFacingTable = new int[150];
+ assert(_movFacingTable);
+ _movFacingTable[0] = 8;
+
+ _skipFlag = false;
+
+ _marbleVaseItem = -1;
+ memset(_foyerItemTable, -1, sizeof(_foyerItemTable));
+ _itemInHand = -1;
+ _handleInput = false;
+
+ _currentRoom = 0xFFFF;
+ _scenePhasingFlag = 0;
+ _lastProcessedItem = 0;
+ _lastProcessedItemHeight = 16;
+
+ _unkScreenVar1 = 1;
+ _unkScreenVar2 = 0;
+ _unkScreenVar3 = 0;
+ _unkAmuletVar = 0;
+
+ _endSequenceNeedLoading = 1;
+ _malcolmFlag = 0;
+ _beadStateVar = 0;
+ _endSequenceSkipFlag = 0;
+ _unkEndSeqVar2 = 0;
+ _endSequenceBackUpRect = 0;
+ _unkEndSeqVar4 = 0;
+ _unkEndSeqVar5 = 0;
+ _lastDisplayedPanPage = 0;
+ memset(_panPagesTable, 0, sizeof(_panPagesTable));
+ _finalA = _finalB = _finalC = 0;
+ memset(&_kyragemFadingState, 0, sizeof(_kyragemFadingState));
+ _kyragemFadingState.gOffset = 0x13;
+ _kyragemFadingState.bOffset = 0x13;
+
+ _mousePressFlag = false;
+
+ _menuDirectlyToLoad = false;
+
+ _lastMusicCommand = 0;
+
+ return 0;
+}
+
+int KyraEngine_LoK::go() {
+ if (_res->getFileSize("6.FNT"))
+ _screen->loadFont(Screen::FID_6_FNT, "6.FNT");
+ _screen->loadFont(Screen::FID_8_FNT, "8FAT.FNT");
+ _screen->setScreenDim(0);
+
+ _abortIntroFlag = false;
+
+ if (_flags.isDemo) {
+ seq_demo();
+ } else {
+ setGameFlag(0xF3);
+ setGameFlag(0xFD);
+ if (_gameToLoad == -1) {
+ setGameFlag(0xEF);
+ seq_intro();
+ if (_quitFlag)
+ return 0;
+ if (_skipIntroFlag && _abortIntroFlag)
+ resetGameFlag(0xEF);
+ }
+ startup();
+ resetGameFlag(0xEF);
+ mainLoop();
+ }
+ return 0;
+}
+
+
+void KyraEngine_LoK::startup() {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::startup()");
+ static const uint8 colorMap[] = { 0, 0, 0, 0, 12, 12, 12, 0, 0, 0, 0, 0 };
+ _screen->setTextColorMap(colorMap);
+ _sound->setSoundList(&_soundData[kMusicIngame]);
+ _sound->loadSoundFile(0);
+// _screen->setFont(Screen::FID_6_FNT);
+ _screen->setAnimBlockPtr(3750);
+ memset(_sceneAnimTable, 0, sizeof(_sceneAnimTable));
+ loadMouseShapes();
+ _currentCharacter = &_characterList[0];
+ for (int i = 1; i < 5; ++i)
+ _animator->setCharacterDefaultFrame(i);
+ for (int i = 5; i <= 10; ++i)
+ setCharactersPositions(i);
+ _animator->setCharactersHeight();
+ resetBrandonPoisonFlags();
+ _screen->_curPage = 0;
+ // XXX
+ for (int i = 0; i < 12; ++i) {
+ int size = _screen->getRectSize(3, 24);
+ _shapes[361+i] = new byte[size];
+ }
+
+ _itemBkgBackUp[0] = new uint8[_screen->getRectSize(3, 24)];
+ memset(_itemBkgBackUp[0], 0, _screen->getRectSize(3, 24));
+ _itemBkgBackUp[1] = new uint8[_screen->getRectSize(4, 32)];
+ memset(_itemBkgBackUp[1], 0, _screen->getRectSize(4, 32));
+
+ for (int i = 0; i < _roomTableSize; ++i) {
+ for (int item = 0; item < 12; ++item) {
+ _roomTable[i].itemsTable[item] = 0xFF;
+ _roomTable[i].itemsXPos[item] = 0xFFFF;
+ _roomTable[i].itemsYPos[item] = 0xFF;
+ _roomTable[i].needInit[item] = 0;
+ }
+ }
+
+ loadCharacterShapes();
+ loadSpecialEffectShapes();
+ loadItems();
+ loadButtonShapes();
+ initMainButtonList();
+ loadMainScreen();
+ _screen->loadPalette("PALETTE.COL", _screen->_currentPalette);
+
+ // XXX
+ _animator->initAnimStateList();
+ setCharactersInDefaultScene();
+
+ if (!_emc->load("_STARTUP.EMC", &_npcScriptData, &_opcodes))
+ error("Could not load \"_STARTUP.EMC\" script");
+ _emc->init(&_scriptMain, &_npcScriptData);
+
+ if (!_emc->start(&_scriptMain, 0))
+ error("Could not start script function 0 of script \"_STARTUP.EMC\"");
+
+ while (_emc->isValid(&_scriptMain))
+ _emc->run(&_scriptMain);
+
+ _emc->unload(&_npcScriptData);
+
+ if (!_emc->load("_NPC.EMC", &_npcScriptData, &_opcodes))
+ error("Could not load \"_NPC.EMC\" script");
+
+ snd_playTheme(1, -1);
+ if (_gameToLoad == -1) {
+ enterNewScene(_currentCharacter->sceneId, _currentCharacter->facing, 0, 0, 1);
+ if (_abortIntroFlag && _skipIntroFlag) {
+ _menuDirectlyToLoad = true;
+ _screen->setMouseCursor(1, 1, _shapes[0]);
+ _screen->showMouse();
+ _gui->buttonMenuCallback(0);
+ _menuDirectlyToLoad = false;
+ } else
+ saveGame(getSavegameFilename(0), "New game");
+ } else {
+ _screen->setFont(Screen::FID_8_FNT);
+ loadGame(getSavegameFilename(_gameToLoad));
+ _gameToLoad = -1;
+ }
+}
+
+void KyraEngine_LoK::mainLoop() {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::mainLoop()");
+
+ while (!_quitFlag) {
+ int32 frameTime = (int32)_system->getMillis();
+ _skipFlag = false;
+
+ if (_currentCharacter->sceneId == 210) {
+ updateKyragemFading();
+ if (seq_playEnd() && _deathHandler != 8)
+ break;
+ }
+
+ if (_deathHandler != -1) {
+ snd_playWanderScoreViaMap(0, 1);
+ snd_playSoundEffect(49);
+ _screen->hideMouse();
+ _screen->setMouseCursor(1, 1, _shapes[0]);
+ removeHandItem();
+ _screen->showMouse();
+ _gui->buttonMenuCallback(0);
+ _deathHandler = -1;
+ }
+
+ if ((_brandonStatusBit & 2) && _brandonStatusBit0x02Flag)
+ _animator->animRefreshNPC(0);
+
+ if ((_brandonStatusBit & 0x20) && _brandonStatusBit0x20Flag) {
+ _animator->animRefreshNPC(0);
+ _brandonStatusBit0x20Flag = 0;
+ }
+
+ _screen->showMouse();
+
+ _gui->processButtonList(_buttonList, 0, 0);
+ updateMousePointer();
+ _timer->update();
+ updateTextFade();
+
+ _handleInput = true;
+ delay((frameTime + _gameSpeed) - _system->getMillis(), true, true);
+ _handleInput = false;
+
+ _sound->process();
+ }
+}
+
+void KyraEngine_LoK::delayUntil(uint32 timestamp, bool updateTimers, bool update, bool isMainLoop) {
+ while (_system->getMillis() < timestamp && !_quitFlag) {
+ if (updateTimers)
+ _timer->update();
+
+ if (timestamp - _system->getMillis() >= 10)
+ delay(10, update, isMainLoop);
+ }
+}
+
+void KyraEngine_LoK::delay(uint32 amount, bool update, bool isMainLoop) {
+ Common::Event event;
+
+ uint32 start = _system->getMillis();
+ do {
+ while (_eventMan->pollEvent(event)) {
+ switch (event.type) {
+ case Common::EVENT_KEYDOWN:
+ if (event.kbd.keycode >= '1' && event.kbd.keycode <= '9' &&
+ (event.kbd.flags == Common::KBD_CTRL || event.kbd.flags == Common::KBD_ALT) && isMainLoop) {
+ const char *saveLoadSlot = getSavegameFilename(9 - (event.kbd.keycode - '0') + 990);
+
+ if (event.kbd.flags == Common::KBD_CTRL)
+ loadGame(saveLoadSlot);
+ else {
+ char savegameName[14];
+ sprintf(savegameName, "Quicksave %d", event.kbd.keycode - '0');
+ saveGame(saveLoadSlot, savegameName);
+ }
+ } else if (event.kbd.flags == Common::KBD_CTRL) {
+ if (event.kbd.keycode == 'd')
+ _debugger->attach();
+ else if (event.kbd.keycode == 'q')
+ _quitFlag = true;
+ } else if (event.kbd.keycode == '.') {
+ _skipFlag = true;
+ } else if (event.kbd.keycode == Common::KEYCODE_RETURN || event.kbd.keycode == Common::KEYCODE_SPACE || event.kbd.keycode == Common::KEYCODE_ESCAPE) {
+ _abortIntroFlag = true;
+ _skipFlag = true;
+ }
+
+ break;
+ case Common::EVENT_MOUSEMOVE:
+ _animator->_updateScreen = true;
+ break;
+ case Common::EVENT_QUIT:
+ quitGame();
+ break;
+ case Common::EVENT_LBUTTONDOWN:
+ _mousePressFlag = true;
+ break;
+ case Common::EVENT_LBUTTONUP:
+ _mousePressFlag = false;
+
+ if (_abortWalkFlag2)
+ _abortWalkFlag = true;
+
+ if (_handleInput) {
+ _handleInput = false;
+ processInput();
+ _handleInput = true;
+ } else
+ _skipFlag = true;
+
+ break;
+ default:
+ break;
+ }
+ }
+
+ if (_debugger->isAttached())
+ _debugger->onFrame();
+
+ if (update) {
+ _sprites->updateSceneAnims();
+ _animator->updateAllObjectShapes();
+ updateTextFade();
+ updateMousePointer();
+ }
+
+ if (_currentCharacter && _currentCharacter->sceneId == 210 && update)
+ updateKyragemFading();
+
+ if (_skipFlag && !_abortIntroFlag && !queryGameFlag(0xFE))
+ _skipFlag = false;
+
+ if (amount > 0 && !_skipFlag && !_quitFlag)
+ _system->delayMillis(10);
+
+ if (_skipFlag)
+ _sound->voiceStop();
+ } while (!_skipFlag && _system->getMillis() < start + amount && !_quitFlag);
+}
+
+void KyraEngine_LoK::waitForEvent() {
+ bool finished = false;
+ Common::Event event;
+
+ while (!finished && !_quitFlag) {
+ while (_eventMan->pollEvent(event)) {
+ switch (event.type) {
+ case Common::EVENT_KEYDOWN:
+ finished = true;
+ break;
+ case Common::EVENT_QUIT:
+ quitGame();
+ break;
+ case Common::EVENT_LBUTTONDOWN:
+ finished = true;
+ _skipFlag = true;
+ break;
+ default:
+ break;
+ }
+ }
+
+ if (_debugger->isAttached())
+ _debugger->onFrame();
+
+ _system->delayMillis(10);
+ }
+}
+
+void KyraEngine_LoK::delayWithTicks(int ticks) {
+ uint32 nextTime = _system->getMillis() + ticks * _tickLength;
+
+ while (_system->getMillis() < nextTime) {
+ _sprites->updateSceneAnims();
+ _animator->updateAllObjectShapes();
+
+ if (_currentCharacter->sceneId == 210) {
+ updateKyragemFading();
+ seq_playEnd();
+ }
+
+ if (_skipFlag)
+ break;
+
+ if (nextTime - _system->getMillis() >= 10)
+ delay(10);
+ }
+}
+
+#pragma mark -
+#pragma mark - Animation/shape specific code
+#pragma mark -
+
+void KyraEngine_LoK::setupShapes123(const Shape *shapeTable, int endShape, int flags) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::setupShapes123(%p, %d, %d)", (const void *)shapeTable, endShape, flags);
+
+ for (int i = 123; i <= 172; ++i)
+ _shapes[i] = 0;
+
+ uint8 curImage = 0xFF;
+ int curPageBackUp = _screen->_curPage;
+ _screen->_curPage = 8; // we are using page 8 here in the original page 2 was backuped and then used for this stuff
+ int shapeFlags = 2;
+ if (flags)
+ shapeFlags = 3;
+ for (int i = 123; i < 123+endShape; ++i) {
+ uint8 newImage = shapeTable[i-123].imageIndex;
+ if (newImage != curImage && newImage != 0xFF) {
+ assert(_characterImageTable);
+ _screen->loadBitmap(_characterImageTable[newImage], 8, 8, 0);
+ curImage = newImage;
+ }
+ _shapes[i] = _screen->encodeShape(shapeTable[i-123].x<<3, shapeTable[i-123].y, shapeTable[i-123].w<<3, shapeTable[i-123].h, shapeFlags);
+ assert(i-7 < _defaultShapeTableSize);
+ _defaultShapeTable[i-7].xOffset = shapeTable[i-123].xOffset;
+ _defaultShapeTable[i-7].yOffset = shapeTable[i-123].yOffset;
+ _defaultShapeTable[i-7].w = shapeTable[i-123].w;
+ _defaultShapeTable[i-7].h = shapeTable[i-123].h;
+ }
+ _screen->_curPage = curPageBackUp;
+}
+
+void KyraEngine_LoK::freeShapes123() {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::freeShapes123()");
+
+ for (int i = 123; i <= 172; ++i) {
+ delete[] _shapes[i];
+ _shapes[i] = 0;
+ }
+}
+
+#pragma mark -
+#pragma mark - Misc stuff
+#pragma mark -
+
+Movie *KyraEngine_LoK::createWSAMovie() {
+ if (_flags.platform == Common::kPlatformAmiga)
+ return new WSAMovieAmiga(this);
+
+ return new WSAMovie_v1(this);
+}
+
+void KyraEngine_LoK::setBrandonPoisonFlags(int reset) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::setBrandonPoisonFlags(%d)", reset);
+ _brandonStatusBit |= 1;
+
+ if (reset)
+ _poisonDeathCounter = 0;
+
+ for (int i = 0; i < 0x100; ++i)
+ _brandonPoisonFlagsGFX[i] = i;
+
+ _brandonPoisonFlagsGFX[0x99] = 0x34;
+ _brandonPoisonFlagsGFX[0x9A] = 0x35;
+ _brandonPoisonFlagsGFX[0x9B] = 0x37;
+ _brandonPoisonFlagsGFX[0x9C] = 0x38;
+ _brandonPoisonFlagsGFX[0x9D] = 0x2B;
+}
+
+void KyraEngine_LoK::resetBrandonPoisonFlags() {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::resetBrandonPoisonFlags()");
+ _brandonStatusBit = 0;
+
+ for (int i = 0; i < 0x100; ++i)
+ _brandonPoisonFlagsGFX[i] = i;
+}
+
+#pragma mark -
+#pragma mark - Input
+#pragma mark -
+
+void KyraEngine_LoK::processInput() {
+ Common::Point mouse = getMousePos();
+ int xpos = mouse.x;
+ int ypos = mouse.y;
+
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::processInput(%d, %d)", xpos, ypos);
+ _abortWalkFlag2 = false;
+
+ if (processInputHelper(xpos, ypos))
+ return;
+
+ uint8 item = findItemAtPos(xpos, ypos);
+ if (item == 0xFF) {
+ _changedScene = false;
+ int handled = clickEventHandler(xpos, ypos);
+ if (_changedScene || handled)
+ return;
+ }
+
+ // XXX _deathHandler specific
+ if (ypos <= 158) {
+ uint16 exit = 0xFFFF;
+ if (xpos < 12) {
+ exit = _walkBlockWest;
+ } else if (xpos >= 308) {
+ exit = _walkBlockEast;
+ } else if (ypos >= 136) {
+ exit = _walkBlockSouth;
+ } else if (ypos < 12) {
+ exit = _walkBlockNorth;
+ }
+
+ if (exit != 0xFFFF) {
+ _abortWalkFlag2 = true;
+ handleSceneChange(xpos, ypos, 1, 1);
+ _abortWalkFlag2 = false;
+ return;
+ } else {
+ int script = checkForNPCScriptRun(xpos, ypos);
+ if (script >= 0) {
+ runNpcScript(script);
+ return;
+ }
+ if (_itemInHand != -1) {
+ if (ypos < 155) {
+ if (hasClickedOnExit(xpos, ypos)) {
+ _abortWalkFlag2 = true;
+ handleSceneChange(xpos, ypos, 1, 1);
+ _abortWalkFlag2 = false;
+ return;
+ }
+ dropItem(0, _itemInHand, xpos, ypos, 1);
+ }
+ } else {
+ if (ypos <= 155) {
+ _abortWalkFlag2 = true;
+ handleSceneChange(xpos, ypos, 1, 1);
+ _abortWalkFlag2 = false;
+ }
+ }
+ }
+ }
+}
+
+int KyraEngine_LoK::processInputHelper(int xpos, int ypos) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::processInputHelper(%d, %d)", xpos, ypos);
+ uint8 item = findItemAtPos(xpos, ypos);
+ if (item != 0xFF) {
+ if (_itemInHand == -1) {
+ _screen->hideMouse();
+ _animator->animRemoveGameItem(item);
+ snd_playSoundEffect(53);
+ assert(_currentCharacter->sceneId < _roomTableSize);
+ Room *currentRoom = &_roomTable[_currentCharacter->sceneId];
+ int item2 = currentRoom->itemsTable[item];
+ currentRoom->itemsTable[item] = 0xFF;
+ setMouseItem(item2);
+ assert(_itemList && _takenList);
+ updateSentenceCommand(_itemList[item2], _takenList[0], 179);
+ _itemInHand = item2;
+ _screen->showMouse();
+ clickEventHandler2();
+ return 1;
+ } else {
+ exchangeItemWithMouseItem(_currentCharacter->sceneId, item);
+ return 1;
+ }
+ }
+ return 0;
+}
+
+int KyraEngine_LoK::clickEventHandler(int xpos, int ypos) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::clickEventHandler(%d, %d)", xpos, ypos);
+ _emc->init(&_scriptClick, &_scriptClickData);
+ _scriptClick.regs[1] = xpos;
+ _scriptClick.regs[2] = ypos;
+ _scriptClick.regs[3] = 0;
+ _scriptClick.regs[4] = _itemInHand;
+ _emc->start(&_scriptClick, 1);
+
+ while (_emc->isValid(&_scriptClick))
+ _emc->run(&_scriptClick);
+
+ return _scriptClick.regs[3];
+}
+
+void KyraEngine_LoK::updateMousePointer(bool forceUpdate) {
+ int shape = 0;
+
+ int newMouseState = 0;
+ int newX = 0;
+ int newY = 0;
+ Common::Point mouse = getMousePos();
+ if (mouse.y <= 158) {
+ if (mouse.x >= 12) {
+ if (mouse.x >= 308) {
+ if (_walkBlockEast == 0xFFFF) {
+ newMouseState = -2;
+ } else {
+ newMouseState = -5;
+ shape = 3;
+ newX = 7;
+ newY = 5;
+ }
+ } else if (mouse.y >= 136) {
+ if (_walkBlockSouth == 0xFFFF) {
+ newMouseState = -2;
+ } else {
+ newMouseState = -4;
+ shape = 4;
+ newX = 5;
+ newY = 7;
+ }
+ } else if (mouse.y < 12) {
+ if (_walkBlockNorth == 0xFFFF) {
+ newMouseState = -2;
+ } else {
+ newMouseState = -6;
+ shape = 2;
+ newX = 5;
+ newY = 1;
+ }
+ }
+ } else {
+ if (_walkBlockWest == 0xFFFF) {
+ newMouseState = -2;
+ } else {
+ newMouseState = -3;
+ newX = 1;
+ newY = shape = 5;
+ }
+ }
+ }
+
+ if (mouse.x >= _entranceMouseCursorTracks[0] && mouse.y >= _entranceMouseCursorTracks[1]
+ && mouse.x <= _entranceMouseCursorTracks[2] && mouse.y <= _entranceMouseCursorTracks[3]) {
+ switch (_entranceMouseCursorTracks[4]) {
+ case 0:
+ newMouseState = -6;
+ shape = 2;
+ newX = 5;
+ newY = 1;
+ break;
+
+ case 2:
+ newMouseState = -5;
+ shape = 3;
+ newX = 7;
+ newY = 5;
+ break;
+
+ case 4:
+ newMouseState = -4;
+ shape = 4;
+ newX = 5;
+ newY = 7;
+ break;
+
+ case 6:
+ newMouseState = -3;
+ shape = 5;
+ newX = 1;
+ newY = 5;
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ if (newMouseState == -2) {
+ shape = 6;
+ newX = 4;
+ newY = 4;
+ }
+
+ if ((newMouseState && _mouseState != newMouseState) || (newMouseState && forceUpdate)) {
+ _mouseState = newMouseState;
+ _screen->hideMouse();
+ _screen->setMouseCursor(newX, newY, _shapes[shape]);
+ _screen->showMouse();
+ }
+
+ if (!newMouseState) {
+ if (_mouseState != _itemInHand || forceUpdate) {
+ if (mouse.y > 158 || (mouse.x >= 12 && mouse.x < 308 && mouse.y < 136 && mouse.y >= 12) || forceUpdate) {
+ _mouseState = _itemInHand;
+ _screen->hideMouse();
+ if (_itemInHand == -1)
+ _screen->setMouseCursor(1, 1, _shapes[0]);
+ else
+ _screen->setMouseCursor(8, 15, _shapes[216+_itemInHand]);
+ _screen->showMouse();
+ }
+ }
+ }
+}
+
+bool KyraEngine_LoK::hasClickedOnExit(int xpos, int ypos) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::hasClickedOnExit(%d, %d)", xpos, ypos);
+ if (xpos < 16 || xpos >= 304)
+ return true;
+
+ if (ypos < 8)
+ return true;
+
+ if (ypos < 136 || ypos > 155)
+ return false;
+
+ return true;
+}
+
+void KyraEngine_LoK::clickEventHandler2() {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::clickEventHandler2()");
+
+ Common::Point mouse = getMousePos();
+
+ _emc->init(&_scriptClick, &_scriptClickData);
+ _scriptClick.regs[0] = _currentCharacter->sceneId;
+ _scriptClick.regs[1] = mouse.x;
+ _scriptClick.regs[2] = mouse.y;
+ _scriptClick.regs[4] = _itemInHand;
+ _emc->start(&_scriptClick, 6);
+
+ while (_emc->isValid(&_scriptClick))
+ _emc->run(&_scriptClick);
+}
+
+int KyraEngine_LoK::checkForNPCScriptRun(int xpos, int ypos) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::checkForNPCScriptRun(%d, %d)", xpos, ypos);
+ int returnValue = -1;
+ const Character *currentChar = _currentCharacter;
+ int charLeft = 0, charRight = 0, charTop = 0, charBottom = 0;
+
+ int scaleFactor = _scaleTable[currentChar->y1];
+ int addX = (((scaleFactor*8)*3)>>8)>>1;
+ int addY = ((scaleFactor*3)<<4)>>8;
+
+ charLeft = currentChar->x1 - addX;
+ charRight = currentChar->x1 + addX;
+ charTop = currentChar->y1 - addY;
+ charBottom = currentChar->y1;
+
+ if (xpos >= charLeft && charRight >= xpos && charTop <= ypos && charBottom >= ypos)
+ return 0;
+
+ if (xpos > 304 || xpos < 16)
+ return -1;
+
+ for (int i = 1; i < 5; ++i) {
+ currentChar = &_characterList[i];
+
+ if (currentChar->sceneId != _currentCharacter->sceneId)
+ continue;
+
+ charLeft = currentChar->x1 - 12;
+ charRight = currentChar->x1 + 11;
+ charTop = currentChar->y1 - 48;
+ // if (!i)
+ // charBottom = currentChar->y2 - 16;
+ // else
+ charBottom = currentChar->y1;
+
+ if (xpos < charLeft || xpos > charRight || ypos < charTop || charBottom < ypos)
+ continue;
+
+ if (returnValue != -1) {
+ if (currentChar->y1 >= _characterList[returnValue].y1)
+ returnValue = i;
+ } else {
+ returnValue = i;
+ }
+ }
+
+ return returnValue;
+}
+
+void KyraEngine_LoK::runNpcScript(int func) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::runNpcScript(%d)", func);
+ _emc->init(&_npcScript, &_npcScriptData);
+ _emc->start(&_npcScript, func);
+ _npcScript.regs[0] = _currentCharacter->sceneId;
+ _npcScript.regs[4] = _itemInHand;
+ _npcScript.regs[5] = func;
+
+ while (_emc->isValid(&_npcScript))
+ _emc->run(&_npcScript);
+}
+
+void KyraEngine_LoK::checkAmuletAnimFlags() {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::checkSpecialAnimFlags()");
+
+ if (_brandonStatusBit & 2) {
+ seq_makeBrandonNormal2();
+ _timer->setCountdown(19, 300);
+ }
+
+ if (_brandonStatusBit & 0x20) {
+ seq_makeBrandonNormal();
+ _timer->setCountdown(19, 300);
+ }
+}
+
+#pragma mark -
+
+void KyraEngine_LoK::registerDefaultSettings() {
+ KyraEngine_v1::registerDefaultSettings();
+
+ // Most settings already have sensible defaults. This one, however, is
+ // specific to the Kyra engine.
+ ConfMan.registerDefault("walkspeed", 2);
+}
+
+void KyraEngine_LoK::readSettings() {
+ int talkspeed = ConfMan.getInt("talkspeed");
+
+ // The default talk speed is 60. This should be mapped to "Normal".
+
+ if (talkspeed == 0)
+ _configTextspeed = 3; // Clickable
+ if (talkspeed <= 50)
+ _configTextspeed = 0; // Slow
+ else if (talkspeed <= 150)
+ _configTextspeed = 1; // Normal
+ else
+ _configTextspeed = 2; // Fast
+
+ KyraEngine_v1::readSettings();
+}
+
+void KyraEngine_LoK::writeSettings() {
+ int talkspeed;
+
+ switch (_configTextspeed) {
+ case 0: // Slow
+ talkspeed = 1;
+ break;
+ case 1: // Normal
+ talkspeed = 60;
+ break;
+ case 2: // Fast
+ talkspeed = 255;
+ break;
+ default: // Clickable
+ talkspeed = 0;
+ break;
+ }
+
+ ConfMan.setInt("talkspeed", talkspeed);
+
+ KyraEngine_v1::writeSettings();
+}
+
+} // end of namespace Kyra
diff --git a/engines/kyra/kyra_lok.h b/engines/kyra/kyra_lok.h
new file mode 100644
index 0000000000..cb3062847e
--- /dev/null
+++ b/engines/kyra/kyra_lok.h
@@ -0,0 +1,806 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#ifndef KYRA_KYRA_LOK_H
+#define KYRA_KYRA_LOK_H
+
+#include "kyra/kyra_v1.h"
+#include "kyra/script.h"
+#include "kyra/screen_lok.h"
+#include "kyra/gui_lok.h"
+
+namespace Kyra {
+
+class Movie;
+class SoundDigital;
+class SeqPlayer;
+class Sprites;
+class Animator_LoK;
+class TextDisplayer;
+class KyraEngine_LoK;
+
+struct Character {
+ uint16 sceneId;
+ uint8 height;
+ uint8 facing;
+ uint16 currentAnimFrame;
+ uint8 inventoryItems[10];
+ int16 x1, y1, x2, y2;
+};
+
+struct Shape {
+ uint8 imageIndex;
+ int8 xOffset, yOffset;
+ uint8 x, y, w, h;
+};
+
+struct Room {
+ uint8 nameIndex;
+ uint16 northExit;
+ uint16 eastExit;
+ uint16 southExit;
+ uint16 westExit;
+ uint8 itemsTable[12];
+ uint16 itemsXPos[12];
+ uint8 itemsYPos[12];
+ uint8 needInit[12];
+};
+
+struct Item {
+ uint8 unk1;
+ uint8 height;
+ uint8 unk2;
+ uint8 unk3;
+};
+
+struct SeqLoop {
+ const uint8 *ptr;
+ uint16 count;
+};
+
+struct SceneExits {
+ uint16 northXPos;
+ uint8 northYPos;
+ uint16 eastXPos;
+ uint8 eastYPos;
+ uint16 southXPos;
+ uint8 southYPos;
+ uint16 westXPos;
+ uint8 westYPos;
+};
+
+struct BeadState {
+ int16 x;
+ int16 y;
+ int16 width;
+ int16 height;
+ int16 dstX;
+ int16 dstY;
+ int16 width2;
+ int16 unk8;
+ int16 unk9;
+ int16 tableIndex;
+};
+
+class KyraEngine_LoK : public KyraEngine_v1 {
+ friend class MusicPlayer;
+ friend class Debugger_LoK;
+ friend class Animator_LoK;
+ friend class GUI_LoK;
+public:
+ KyraEngine_LoK(OSystem *system, const GameFlags &flags);
+ ~KyraEngine_LoK();
+
+ //TODO: proper extended implementation of KyraEngine_v1::pauseEngineIntern.
+ // _sprites and _seqplayer should be paused here too, to avoid some animation glitches,
+ // also parts of the hardcoded Malcolm fight might need some special handling.
+
+ Screen *screen() { return _screen; }
+ Animator_LoK *animator() { return _animator; }
+ virtual Movie *createWSAMovie();
+
+ uint8 **shapes() { return _shapes; }
+ Character *currentCharacter() { return _currentCharacter; }
+ Character *characterList() { return _characterList; }
+ uint16 brandonStatus() { return _brandonStatusBit; }
+
+ // TODO: remove me with workaround in animator.cpp l209
+ uint16 getScene() { return _currentRoom; }
+
+ int _paletteChanged;
+ int16 _northExitHeight;
+
+ typedef void (KyraEngine_LoK::*IntroProc)();
+
+ // static data access
+ const char * const*seqWSATable() { return _seq_WSATable; }
+ const char * const*seqCPSTable() { return _seq_CPSTable; }
+ const char * const*seqCOLTable() { return _seq_COLTable; }
+ const char * const*seqTextsTable() { return _seq_textsTable; }
+
+ const uint8 * const*palTable1() { return &_specialPalettes[0]; }
+ const uint8 * const*palTable2() { return &_specialPalettes[29]; }
+
+protected:
+ virtual int go();
+ virtual int init();
+
+public:
+ // sequences
+ // -> misc
+ bool seq_skipSequence() const;
+protected:
+ // -> demo
+ void seq_demo();
+
+ // -> intro
+ void seq_intro();
+ void seq_introLogos();
+ void seq_introStory();
+ void seq_introMalcolmTree();
+ void seq_introKallakWriting();
+ void seq_introKallakMalcolm();
+
+ // -> ingame animations
+ void seq_createAmuletJewel(int jewel, int page, int noSound, int drawOnly);
+ void seq_brandonHealing();
+ void seq_brandonHealing2();
+ void seq_poisonDeathNow(int now);
+ void seq_poisonDeathNowAnim();
+ void seq_playFluteAnimation();
+ void seq_winterScroll1();
+ void seq_winterScroll2();
+ void seq_makeBrandonInv();
+ void seq_makeBrandonNormal();
+ void seq_makeBrandonNormal2();
+ void seq_makeBrandonWisp();
+ void seq_dispelMagicAnimation();
+ void seq_fillFlaskWithWater(int item, int type);
+ void seq_playDrinkPotionAnim(int item, int unk2, int flags);
+ void seq_brandonToStone();
+
+ // -> end fight
+ int seq_playEnd();
+ void seq_playEnding();
+
+ int handleMalcolmFlag();
+ int handleBeadState();
+ void initBeadState(int x, int y, int x2, int y2, int unk1, BeadState *ptr);
+ int processBead(int x, int y, int &x2, int &y2, BeadState *ptr);
+
+ // -> credits
+ void seq_playCredits();
+
+public:
+ // delay
+ void delayUntil(uint32 timestamp, bool updateGameTimers = false, bool update = false, bool isMainLoop = false);
+ void delay(uint32 millis, bool update = false, bool isMainLoop = false);
+ void delayWithTicks(int ticks);
+ void waitForEvent();
+
+ // TODO
+ void registerDefaultSettings();
+ void readSettings();
+ void writeSettings();
+
+ void snd_playSoundEffect(int track, int volume=0xFF);
+ void snd_playWanderScoreViaMap(int command, int restart);
+ virtual void snd_playVoiceFile(int id);
+ void snd_voiceWaitForFinish(bool ingame = true);
+ uint32 snd_getVoicePlayTime();
+
+protected:
+ int32 _speechPlayTime;
+
+ void saveGame(const char *fileName, const char *saveName);
+ void loadGame(const char *fileName);
+
+protected:
+ // input
+ void processInput();
+ int processInputHelper(int xpos, int ypos);
+ int clickEventHandler(int xpos, int ypos);
+ void clickEventHandler2();
+ void updateMousePointer(bool forceUpdate = false);
+ bool hasClickedOnExit(int xpos, int ypos);
+
+ bool _skipFlag;
+ bool skipFlag() const { return _skipFlag; }
+ void resetSkipFlag(bool removeEvent = true) { _skipFlag = false; }
+
+ // scene
+ // -> init
+ void loadSceneMsc();
+ void startSceneScript(int brandonAlive);
+ void setupSceneItems();
+ void initSceneData(int facing, int unk1, int brandonAlive);
+ void initSceneObjectList(int brandonAlive);
+ void initSceneScreen(int brandonAlive);
+ void setupSceneResource(int sceneId);
+
+ // -> process
+ void enterNewScene(int sceneId, int facing, int unk1, int unk2, int brandonAlive);
+ int handleSceneChange(int xpos, int ypos, int unk1, int frameReset);
+ int processSceneChange(int *table, int unk1, int frameReset);
+ int changeScene(int facing);
+
+ // -> modification
+ void transcendScenes(int roomIndex, int roomName);
+ void setSceneFile(int roomIndex, int roomName);
+
+ // -> pathfinder
+ int findWay(int x, int y, int toX, int toY, int *moveTable, int moveTableSize);
+ bool lineIsPassable(int x, int y);
+
+ // -> item handling
+ // --> misc
+ void addItemToRoom(uint16 sceneId, uint8 item, int itemIndex, int x, int y);
+
+ // --> drop handling
+ void itemDropDown(int x, int y, int destX, int destY, byte freeItem, int item);
+ int processItemDrop(uint16 sceneId, uint8 item, int x, int y, int unk1, int unk2);
+ void dropItem(int unk1, int item, int x, int y, int unk2);
+
+ // --> dropped item handling
+ int countItemsInScene(uint16 sceneId);
+ void exchangeItemWithMouseItem(uint16 sceneId, int itemIndex);
+ byte findFreeItemInScene(int scene);
+ byte findItemAtPos(int x, int y);
+
+ // --> drop area handling
+ void addToNoDropRects(int x, int y, int w, int h);
+ void clearNoDropRects();
+ int isDropable(int x, int y);
+ int checkNoDropRects(int x, int y);
+
+ // --> player items handling
+ void updatePlayerItemsForScene();
+
+ // --> item GFX handling
+ void backUpItemRect0(int xpos, int ypos);
+ void restoreItemRect0(int xpos, int ypos);
+ void backUpItemRect1(int xpos, int ypos);
+ void restoreItemRect1(int xpos, int ypos);
+
+ // items
+ // -> misc
+ void placeItemInGenericMapScene(int item, int index);
+
+ // -> mouse item
+ void setHandItem(uint16 item);
+ void removeHandItem();
+ void setMouseItem(uint16 item);
+
+ // -> graphics effects
+ void wipeDownMouseItem(int xpos, int ypos);
+ void itemSpecialFX(int x, int y, int item);
+ void itemSpecialFX1(int x, int y, int item);
+ void itemSpecialFX2(int x, int y, int item);
+ void magicOutMouseItem(int animIndex, int itemPos);
+ void magicInMouseItem(int animIndex, int item, int itemPos);
+ void specialMouseItemFX(int shape, int x, int y, int animIndex, int tableIndex, int loopStart, int maxLoops);
+ void processSpecialMouseItemFX(int shape, int x, int y, int tableValue, int loopStart, int maxLoops);
+
+ // character
+ // -> movement
+ void moveCharacterToPos(int character, int facing, int xpos, int ypos);
+ void setCharacterPositionWithUpdate(int character);
+ int setCharacterPosition(int character, int *facingTable);
+ void setCharacterPositionHelper(int character, int *facingTable);
+ void setCharactersPositions(int character);
+
+ // -> brandon
+ void setBrandonPoisonFlags(int reset);
+ void resetBrandonPoisonFlags();
+
+ // chat
+ // -> process
+ void characterSays(int vocFile, const char *chatStr, int8 charNum, int8 chatDuration);
+ void waitForChatToFinish(int vocFile, int16 chatDuration, const char *str, uint8 charNum);
+
+ // -> initialization
+ int initCharacterChat(int8 charNum);
+ void backupChatPartnerAnimFrame(int8 charNum);
+ void restoreChatPartnerAnimFrame(int8 charNum);
+ int8 getChatPartnerNum();
+
+ // -> deinitialization
+ void endCharacterChat(int8 charNum, int16 arg_4);
+
+ // graphics
+ // -> misc
+ int findDuplicateItemShape(int shape);
+ void updateKyragemFading();
+
+ // -> interface
+ void loadMainScreen(int page = 3);
+ void redrawInventory(int page);
+public:
+ void drawSentenceCommand(const char *sentence, int unk1);
+ void updateSentenceCommand(const char *str1, const char *str2, int unk1);
+ void updateTextFade();
+
+protected:
+ // -> amulet
+ void drawJewelPress(int jewel, int drawSpecial);
+ void drawJewelsFadeOutStart();
+ void drawJewelsFadeOutEnd(int jewel);
+
+ // -> shape handling
+ void setupShapes123(const Shape *shapeTable, int endShape, int flags);
+ void freeShapes123();
+
+ // misc (TODO)
+ void startup();
+ void mainLoop();
+
+ int checkForNPCScriptRun(int xpos, int ypos);
+ void runNpcScript(int func);
+
+ void loadMouseShapes();
+ void loadCharacterShapes();
+ void loadSpecialEffectShapes();
+ void loadItems();
+ void loadButtonShapes();
+ void initMainButtonList();
+ void setCharactersInDefaultScene();
+ void setupPanPages();
+ void freePanPages();
+ void closeFinalWsa();
+
+ //void setTimer19();
+ void setupTimers();
+ void timerUpdateHeadAnims(int timerNum);
+ void timerSetFlags1(int timerNum);
+ void timerSetFlags2(int timerNum);
+ void timerSetFlags3(int timerNum);
+ void timerCheckAnimFlag1(int timerNum);
+ void timerCheckAnimFlag2(int timerNum);
+ void checkAmuletAnimFlags();
+ void timerRedrawAmulet(int timerNum);
+ void timerFadeText(int timerNum);
+ void updateAnimFlag1(int timerNum);
+ void updateAnimFlag2(int timerNum);
+ void drawAmulet();
+ void setTextFadeTimerCountdown(int16 countdown);
+ void setWalkspeed(uint8 newSpeed);
+
+ int buttonInventoryCallback(Button *caller);
+ int buttonAmuletCallback(Button *caller);
+
+ bool _skipIntroFlag;
+ bool _abortIntroFlag;
+ bool _menuDirectlyToLoad;
+ bool _abortWalkFlag;
+ bool _abortWalkFlag2;
+ bool _mousePressFlag;
+ uint8 *_itemBkgBackUp[2];
+ uint8 *_shapes[373];
+ int8 _itemInHand;
+ bool _handleInput;
+ bool _changedScene;
+ int _unkScreenVar1, _unkScreenVar2, _unkScreenVar3;
+ int _beadStateVar;
+ int _unkAmuletVar;
+
+ int _malcolmFlag;
+ int _endSequenceSkipFlag;
+ int _endSequenceNeedLoading;
+ int _unkEndSeqVar2;
+ uint8 *_endSequenceBackUpRect;
+ int _unkEndSeqVar4;
+ int _unkEndSeqVar5;
+ int _lastDisplayedPanPage;
+ uint8 *_panPagesTable[20];
+ Movie *_finalA, *_finalB, *_finalC;
+
+ Movie *_movieObjects[10];
+
+ uint16 _entranceMouseCursorTracks[8];
+ uint16 _walkBlockNorth;
+ uint16 _walkBlockEast;
+ uint16 _walkBlockSouth;
+ uint16 _walkBlockWest;
+
+ int32 _scaleMode;
+ int16 _scaleTable[145];
+
+ Rect _noDropRects[11];
+
+ int8 _birthstoneGemTable[4];
+ int8 _idolGemsTable[3];
+
+ int8 _marbleVaseItem;
+ int8 _foyerItemTable[3];
+
+ int8 _cauldronState;
+ int8 _crystalState[2];
+
+ uint16 _brandonStatusBit;
+ uint8 _brandonStatusBit0x02Flag;
+ uint8 _brandonStatusBit0x20Flag;
+ uint8 _brandonPoisonFlagsGFX[256];
+ int16 _brandonInvFlag;
+ uint8 _poisonDeathCounter;
+ int _brandonPosX;
+ int _brandonPosY;
+
+ uint16 _currentChatPartnerBackupFrame;
+ uint16 _currentCharAnimFrame;
+
+ int8 *_sceneAnimTable[50];
+
+ Item _itemTable[145];
+ int _lastProcessedItem;
+ int _lastProcessedItemHeight;
+
+ int16 *_exitListPtr;
+ int16 _exitList[11];
+ SceneExits _sceneExits;
+ uint16 _currentRoom;
+ int _scenePhasingFlag;
+
+ int _sceneChangeState;
+ int _loopFlag2;
+
+ int _pathfinderFlag;
+ int _pathfinderFlag2;
+ int _lastFindWayRet;
+ int *_movFacingTable;
+
+ int8 _talkingCharNum;
+ int8 _charSayUnk2;
+ int8 _charSayUnk3;
+ int8 _currHeadShape;
+ uint8 _currSentenceColor[3];
+ int8 _startSentencePalIndex;
+ bool _fadeText;
+
+ uint8 _configTextspeed;
+
+ Animator_LoK *_animator;
+ SeqPlayer *_seq;
+ Sprites *_sprites;
+ Screen_LoK *_screen;
+
+ EMCState _scriptMain;
+
+ EMCState _npcScript;
+ EMCData _npcScriptData;
+
+ EMCState _scriptClick;
+ EMCData _scriptClickData;
+
+ Character *_characterList;
+ Character *_currentCharacter;
+
+ Button *_buttonList;
+ GUI_LoK *_gui;
+
+ struct KyragemState {
+ uint16 nextOperation;
+ uint16 rOffset;
+ uint16 gOffset;
+ uint16 bOffset;
+ uint32 timerCount;
+ } _kyragemFadingState;
+
+ static const int8 _dosTrackMap[];
+ static const int _dosTrackMapSize;
+
+ // TODO: get rid of all variables having pointers to the static resources if possible
+ // i.e. let them directly use the _staticres functions
+ void initStaticResource();
+
+ const uint8 *_seq_Forest;
+ const uint8 *_seq_KallakWriting;
+ const uint8 *_seq_KyrandiaLogo;
+ const uint8 *_seq_KallakMalcolm;
+ const uint8 *_seq_MalcolmTree;
+ const uint8 *_seq_WestwoodLogo;
+ const uint8 *_seq_Demo1;
+ const uint8 *_seq_Demo2;
+ const uint8 *_seq_Demo3;
+ const uint8 *_seq_Demo4;
+ const uint8 *_seq_Reunion;
+
+ const char * const*_seq_WSATable;
+ const char * const*_seq_CPSTable;
+ const char * const*_seq_COLTable;
+ const char * const*_seq_textsTable;
+
+ int _seq_WSATable_Size;
+ int _seq_CPSTable_Size;
+ int _seq_COLTable_Size;
+ int _seq_textsTable_Size;
+
+ const char * const*_itemList;
+ const char * const*_takenList;
+ const char * const*_placedList;
+ const char * const*_droppedList;
+ const char * const*_noDropList;
+ const char * const*_putDownFirst;
+ const char * const*_waitForAmulet;
+ const char * const*_blackJewel;
+ const char * const*_poisonGone;
+ const char * const*_healingTip;
+ const char * const*_thePoison;
+ const char * const*_fluteString;
+ const char * const*_wispJewelStrings;
+ const char * const*_magicJewelString;
+ const char * const*_flaskFull;
+ const char * const*_fullFlask;
+ const char * const*_veryClever;
+ const char * const*_homeString;
+ const char * const*_newGameString;
+
+ int _itemList_Size;
+ int _takenList_Size;
+ int _placedList_Size;
+ int _droppedList_Size;
+ int _noDropList_Size;
+ int _putDownFirst_Size;
+ int _waitForAmulet_Size;
+ int _blackJewel_Size;
+ int _poisonGone_Size;
+ int _healingTip_Size;
+ int _thePoison_Size;
+ int _fluteString_Size;
+ int _wispJewelStrings_Size;
+ int _magicJewelString_Size;
+ int _flaskFull_Size;
+ int _fullFlask_Size;
+ int _veryClever_Size;
+ int _homeString_Size;
+ int _newGameString_Size;
+
+ const char * const*_characterImageTable;
+ int _characterImageTableSize;
+
+ const char * const*_guiStrings;
+ int _guiStringsSize;
+
+ const char * const*_configStrings;
+ int _configStringsSize;
+
+ Shape *_defaultShapeTable;
+ int _defaultShapeTableSize;
+
+ const Shape *_healingShapeTable;
+ int _healingShapeTableSize;
+ const Shape *_healingShape2Table;
+ int _healingShape2TableSize;
+
+ const Shape *_posionDeathShapeTable;
+ int _posionDeathShapeTableSize;
+
+ const Shape *_fluteAnimShapeTable;
+ int _fluteAnimShapeTableSize;
+
+ const Shape *_winterScrollTable;
+ int _winterScrollTableSize;
+ const Shape *_winterScroll1Table;
+ int _winterScroll1TableSize;
+ const Shape *_winterScroll2Table;
+ int _winterScroll2TableSize;
+
+ const Shape *_drinkAnimationTable;
+ int _drinkAnimationTableSize;
+
+ const Shape *_brandonToWispTable;
+ int _brandonToWispTableSize;
+
+ const Shape *_magicAnimationTable;
+ int _magicAnimationTableSize;
+
+ const Shape *_brandonStoneTable;
+ int _brandonStoneTableSize;
+
+ Room *_roomTable;
+ int _roomTableSize;
+ const char * const*_roomFilenameTable;
+ int _roomFilenameTableSize;
+
+ const uint8 *_amuleteAnim;
+
+ const uint8 * const*_specialPalettes;
+
+ const char *const *_soundFiles;
+ int _soundFilesSize;
+ const char *const *_soundFilesIntro;
+ int _soundFilesIntroSize;
+ const int32 *_cdaTrackTable;
+ int _cdaTrackTableSize;
+ const AudioDataStruct * _soundData;
+
+ // positions of the inventory
+ static const uint16 _itemPosX[];
+ static const uint8 _itemPosY[];
+
+ void setupButtonData();
+ Button *_buttonData;
+ Button **_buttonDataListPtr;
+
+ static const uint8 _magicMouseItemStartFrame[];
+ static const uint8 _magicMouseItemEndFrame[];
+ static const uint8 _magicMouseItemStartFrame2[];
+ static const uint8 _magicMouseItemEndFrame2[];
+
+ static const uint16 _amuletX[];
+ static const uint16 _amuletY[];
+ static const uint16 _amuletX2[];
+ static const uint16 _amuletY2[];
+protected:
+ void setupOpcodeTable();
+
+ // Opcodes
+ int o1_magicInMouseItem(EMCState *script);
+ int o1_characterSays(EMCState *script);
+ int o1_delay(EMCState *script);
+ int o1_drawSceneAnimShape(EMCState *script);
+ int o1_runNPCScript(EMCState *script);
+ int o1_setSpecialExitList(EMCState *script);
+ int o1_walkPlayerToPoint(EMCState *script);
+ int o1_dropItemInScene(EMCState *script);
+ int o1_drawAnimShapeIntoScene(EMCState *script);
+ int o1_savePageToDisk(EMCState *script);
+ int o1_sceneAnimOn(EMCState *script);
+ int o1_sceneAnimOff(EMCState *script);
+ int o1_getElapsedSeconds(EMCState *script);
+ int o1_mouseIsPointer(EMCState *script);
+ int o1_runSceneAnimUntilDone(EMCState *script);
+ int o1_fadeSpecialPalette(EMCState *script);
+ int o1_phaseInSameScene(EMCState *script);
+ int o1_setScenePhasingFlag(EMCState *script);
+ int o1_resetScenePhasingFlag(EMCState *script);
+ int o1_queryScenePhasingFlag(EMCState *script);
+ int o1_sceneToDirection(EMCState *script);
+ int o1_setBirthstoneGem(EMCState *script);
+ int o1_placeItemInGenericMapScene(EMCState *script);
+ int o1_setBrandonStatusBit(EMCState *script);
+ int o1_delaySecs(EMCState *script);
+ int o1_getCharacterScene(EMCState *script);
+ int o1_runNPCSubscript(EMCState *script);
+ int o1_magicOutMouseItem(EMCState *script);
+ int o1_internalAnimOn(EMCState *script);
+ int o1_forceBrandonToNormal(EMCState *script);
+ int o1_poisonDeathNow(EMCState *script);
+ int o1_setScaleMode(EMCState *script);
+ int o1_openWSAFile(EMCState *script);
+ int o1_closeWSAFile(EMCState *script);
+ int o1_runWSAFromBeginningToEnd(EMCState *script);
+ int o1_displayWSAFrame(EMCState *script);
+ int o1_enterNewScene(EMCState *script);
+ int o1_setSpecialEnterXAndY(EMCState *script);
+ int o1_runWSAFrames(EMCState *script);
+ int o1_popBrandonIntoScene(EMCState *script);
+ int o1_restoreAllObjectBackgrounds(EMCState *script);
+ int o1_setCustomPaletteRange(EMCState *script);
+ int o1_loadPageFromDisk(EMCState *script);
+ int o1_customPrintTalkString(EMCState *script);
+ int o1_restoreCustomPrintBackground(EMCState *script);
+ int o1_getCharacterX(EMCState *script);
+ int o1_getCharacterY(EMCState *script);
+ int o1_setCharacterFacing(EMCState *script);
+ int o1_copyWSARegion(EMCState *script);
+ int o1_printText(EMCState *script);
+ int o1_loadSoundFile(EMCState *script);
+ int o1_displayWSAFrameOnHidPage(EMCState *script);
+ int o1_displayWSASequentialFrames(EMCState *script);
+ int o1_refreshCharacter(EMCState *script);
+ int o1_internalAnimOff(EMCState *script);
+ int o1_changeCharactersXAndY(EMCState *script);
+ int o1_clearSceneAnimatorBeacon(EMCState *script);
+ int o1_querySceneAnimatorBeacon(EMCState *script);
+ int o1_refreshSceneAnimator(EMCState *script);
+ int o1_placeItemInOffScene(EMCState *script);
+ int o1_wipeDownMouseItem(EMCState *script);
+ int o1_placeCharacterInOtherScene(EMCState *script);
+ int o1_getKey(EMCState *script);
+ int o1_specificItemInInventory(EMCState *script);
+ int o1_popMobileNPCIntoScene(EMCState *script);
+ int o1_mobileCharacterInScene(EMCState *script);
+ int o1_hideMobileCharacter(EMCState *script);
+ int o1_unhideMobileCharacter(EMCState *script);
+ int o1_setCharacterLocation(EMCState *script);
+ int o1_walkCharacterToPoint(EMCState *script);
+ int o1_specialEventDisplayBrynnsNote(EMCState *script);
+ int o1_specialEventRemoveBrynnsNote(EMCState *script);
+ int o1_setLogicPage(EMCState *script);
+ int o1_fatPrint(EMCState *script);
+ int o1_preserveAllObjectBackgrounds(EMCState *script);
+ int o1_updateSceneAnimations(EMCState *script);
+ int o1_sceneAnimationActive(EMCState *script);
+ int o1_setCharacterMovementDelay(EMCState *script);
+ int o1_getCharacterFacing(EMCState *script);
+ int o1_bkgdScrollSceneAndMasksRight(EMCState *script);
+ int o1_dispelMagicAnimation(EMCState *script);
+ int o1_findBrightestFireberry(EMCState *script);
+ int o1_setFireberryGlowPalette(EMCState *script);
+ int o1_setDeathHandlerFlag(EMCState *script);
+ int o1_drinkPotionAnimation(EMCState *script);
+ int o1_makeAmuletAppear(EMCState *script);
+ int o1_drawItemShapeIntoScene(EMCState *script);
+ int o1_setCharacterCurrentFrame(EMCState *script);
+ int o1_waitForConfirmationMouseClick(EMCState *script);
+ int o1_pageFlip(EMCState *script);
+ int o1_setSceneFile(EMCState *script);
+ int o1_getItemInMarbleVase(EMCState *script);
+ int o1_setItemInMarbleVase(EMCState *script);
+ int o1_addItemToInventory(EMCState *script);
+ int o1_intPrint(EMCState *script);
+ int o1_shakeScreen(EMCState *script);
+ int o1_createAmuletJewel(EMCState *script);
+ int o1_setSceneAnimCurrXY(EMCState *script);
+ int o1_poisonBrandonAndRemaps(EMCState *script);
+ int o1_fillFlaskWithWater(EMCState *script);
+ int o1_getCharacterMovementDelay(EMCState *script);
+ int o1_getBirthstoneGem(EMCState *script);
+ int o1_queryBrandonStatusBit(EMCState *script);
+ int o1_playFluteAnimation(EMCState *script);
+ int o1_playWinterScrollSequence(EMCState *script);
+ int o1_getIdolGem(EMCState *script);
+ int o1_setIdolGem(EMCState *script);
+ int o1_totalItemsInScene(EMCState *script);
+ int o1_restoreBrandonsMovementDelay(EMCState *script);
+ int o1_setEntranceMouseCursorTrack(EMCState *script);
+ int o1_itemAppearsOnGround(EMCState *script);
+ int o1_setNoDrawShapesFlag(EMCState *script);
+ int o1_fadeEntirePalette(EMCState *script);
+ int o1_itemOnGroundHere(EMCState *script);
+ int o1_queryCauldronState(EMCState *script);
+ int o1_setCauldronState(EMCState *script);
+ int o1_queryCrystalState(EMCState *script);
+ int o1_setCrystalState(EMCState *script);
+ int o1_setPaletteRange(EMCState *script);
+ int o1_shrinkBrandonDown(EMCState *script);
+ int o1_growBrandonUp(EMCState *script);
+ int o1_setBrandonScaleXAndY(EMCState *script);
+ int o1_resetScaleMode(EMCState *script);
+ int o1_getScaleDepthTableValue(EMCState *script);
+ int o1_setScaleDepthTableValue(EMCState *script);
+ int o1_message(EMCState *script);
+ int o1_checkClickOnNPC(EMCState *script);
+ int o1_getFoyerItem(EMCState *script);
+ int o1_setFoyerItem(EMCState *script);
+ int o1_setNoItemDropRegion(EMCState *script);
+ int o1_walkMalcolmOn(EMCState *script);
+ int o1_passiveProtection(EMCState *script);
+ int o1_setPlayingLoop(EMCState *script);
+ int o1_brandonToStoneSequence(EMCState *script);
+ int o1_brandonHealingSequence(EMCState *script);
+ int o1_protectCommandLine(EMCState *script);
+ int o1_pauseMusicSeconds(EMCState *script);
+ int o1_resetMaskRegion(EMCState *script);
+ int o1_setPaletteChangeFlag(EMCState *script);
+ int o1_vocUnload(EMCState *script);
+ int o1_vocLoad(EMCState *script);
+ int o1_dummy(EMCState *script);
+};
+
+} // end of namespace Kyra
+
+#endif
+
diff --git a/engines/kyra/kyra_mr.cpp b/engines/kyra/kyra_mr.cpp
index 61546fc2e7..8a49b8e155 100644
--- a/engines/kyra/kyra_mr.cpp
+++ b/engines/kyra/kyra_mr.cpp
@@ -23,7 +23,7 @@
*
*/
-#include "kyra/kyra.h"
+#include "kyra/kyra_v1.h"
#include "kyra/kyra_mr.h"
#include "kyra/screen_mr.h"
#include "kyra/wsamovie.h"
@@ -50,13 +50,16 @@ const KyraEngine_v2::EngineDesc KyraEngine_MR::_mrEngineDesc = {
9,
// Animation script specific
- 9
+ 9,
+
+ // Item specific
+ 71
};
KyraEngine_MR::KyraEngine_MR(OSystem *system, const GameFlags &flags) : KyraEngine_v2(system, flags, _mrEngineDesc) {
_soundDigital = 0;
_musicSoundChannel = -1;
- _menuAudioFile = "TITLE1.AUD";
+ _menuAudioFile = "TITLE1";
_lastMusicCommand = -1;
_itemBuffer1 = _itemBuffer2 = 0;
_scoreFile = 0;
@@ -71,13 +74,13 @@ KyraEngine_MR::KyraEngine_MR(OSystem *system, const GameFlags &flags) : KyraEngi
_gfxBackUpRect = 0;
_paletteOverlay = 0;
_sceneList = 0;
- memset(&_mainCharacter, 0, sizeof(_mainCharacter));
_mainCharacter.sceneId = 9;
_mainCharacter.height = 0x4C;
_mainCharacter.facing = 5;
_mainCharacter.animFrame = 0x57;
_mainCharacter.walkspeed = 5;
- memset(_mainCharacter.inventory, -1, sizeof(_mainCharacter.inventory));
+ memset(_activeItemAnim, 0, sizeof(_activeItemAnim));
+ _nextAnimItem = 0;
_text = 0;
_commandLineY = 189;
_inventoryState = false;
@@ -96,7 +99,7 @@ KyraEngine_MR::KyraEngine_MR(OSystem *system, const GameFlags &flags) : KyraEngi
_unk5 = 0;
_unkSceneScreenFlag1 = false;
_noScriptEnter = true;
- _itemInHand = _handItemSet = -1;
+ _itemInHand = _mouseState = -1;
_unk3 = -1;
_unk4 = 0;
_loadingState = false;
@@ -140,6 +143,12 @@ KyraEngine_MR::KyraEngine_MR(OSystem *system, const GameFlags &flags) : KyraEngi
_menuDirectlyToLoad = false;
_optionsFile = 0;
_actorFile = 0;
+ _chatAltFlag = false;
+ _albumChatActive = false;
+ memset(&_album, 0, sizeof(_album));
+ _configHelium = false;
+ _fadeOutMusicChannel = -1;
+ memset(_scaleTable, 0, sizeof(_scaleTable));
}
KyraEngine_MR::~KyraEngine_MR() {
@@ -152,6 +161,7 @@ KyraEngine_MR::~KyraEngine_MR() {
delete[] _cCodeFile;
delete[] _scenesFile;
delete[] _itemFile;
+ delete[] _actorFile;
delete[] _gamePlayBuffer;
delete[] _interface;
delete[] _interfaceCommandLine;
@@ -165,7 +175,6 @@ KyraEngine_MR::~KyraEngine_MR() {
delete[] _gfxBackUpRect;
delete[] _paletteOverlay;
- delete[] _sceneList;
for (ShapeMap::iterator i = _gameShapes.begin(); i != _gameShapes.end(); ++i) {
delete[] i->_value;
@@ -187,6 +196,10 @@ KyraEngine_MR::~KyraEngine_MR() {
delete[] _mainButtonData;
delete _gui;
delete[] _optionsFile;
+
+ delete _album.wsa;
+ delete _album.leftPage.wsa;
+ delete _album.rightPage.wsa;
}
int KyraEngine_MR::init() {
@@ -194,7 +207,8 @@ int KyraEngine_MR::init() {
assert(_screen);
_screen->setResolution();
- KyraEngine::init();
+ KyraEngine_v1::init();
+ initStaticResource();
_debugger = new Debugger_v2(this);
assert(_debugger);
@@ -203,7 +217,7 @@ int KyraEngine_MR::init() {
assert(_soundDigital);
if (!_soundDigital->init())
error("_soundDigital->init() failed");
- KyraEngine::_text = _text = new TextDisplayer_MR(this, _screen);
+ KyraEngine_v1::_text = _text = new TextDisplayer_MR(this, _screen);
assert(_text);
_gui = new GUI_MR(this);
assert(_gui);
@@ -272,6 +286,8 @@ int KyraEngine_MR::go() {
delayUntil(nextRun);
}
+ _eventList.clear();
+
switch (_menu->handle(3)) {
case 2:
_menuDirectlyToLoad = true;
@@ -312,7 +328,7 @@ int KyraEngine_MR::go() {
}
void KyraEngine_MR::initMainMenu() {
- _menuAnim = new WSAMovieV2(this, _screen);
+ _menuAnim = new WSAMovie_v2(this, _screen);
_menuAnim->open("REVENGE.WSA", 1, _screen->getPalette(0));
_menuAnim->setX(0);
_menuAnim->setY(0);
@@ -354,7 +370,10 @@ void KyraEngine_MR::playVQA(const char *name) {
snprintf(filename, sizeof(filename), "%s%d.VQA", name, size);
if (vqa.open(filename)) {
- _soundDigital->stopAllSounds();
+ for (int i = 0; i < 4; ++i) {
+ if (i != _musicSoundChannel)
+ _soundDigital->stopSound(i);
+ }
_screen->hideMouse();
memcpy(_screen->getPalette(1), _screen->getPalette(0), 768);
@@ -386,14 +405,12 @@ void KyraEngine_MR::playMenuAudioFile() {
if (_soundDigital->isPlaying(_musicSoundChannel))
return;
- _musicSoundChannel = _soundDigital->playSound(_menuAudioFile, 0xFF, Audio::Mixer::kMusicSoundType);
+ _musicSoundChannel = _soundDigital->playSound(_menuAudioFile, 0xFF, Audio::Mixer::kMusicSoundType, 255, true);
}
void KyraEngine_MR::snd_playWanderScoreViaMap(int track, int force) {
debugC(9, kDebugLevelMain, "KyraEngine_MR::snd_playWanderScoreViaMap(%d, %d)", track, force);
- // XXX byte_3C87C compare
-
if (_musicSoundChannel != -1 && !_soundDigital->isPlaying(_musicSoundChannel))
force = 1;
else if (_musicSoundChannel == -1)
@@ -407,7 +424,9 @@ void KyraEngine_MR::snd_playWanderScoreViaMap(int track, int force) {
if (_musicSoundChannel == -1) {
assert(track < _soundListSize && track >= 0);
- _musicSoundChannel = _soundDigital->playSound(_soundList[track], 0xFF, Audio::Mixer::kMusicSoundType);
+ char file[13];
+ sprintf(file, "%s", _soundList[track]);
+ _musicSoundChannel = _soundDigital->playSound(file, 0xFF, Audio::Mixer::kMusicSoundType);
}
_lastMusicCommand = track;
@@ -463,7 +482,8 @@ void KyraEngine_MR::snd_playSoundEffect(int item, int volume) {
debugC(9, kDebugLevelMain, "KyraEngine_MR::snd_playSoundEffect(%d, %d)", item, volume);
if (_sfxFileMap[item*2+0] != 0xFF) {
char filename[16];
- snprintf(filename, 16, "%s.AUD", _sfxFileList[_sfxFileMap[item*2+0]]);
+ assert(_sfxFileMap[item*2+0] < _sfxFileListSize);
+ snprintf(filename, 16, "%s", _sfxFileList[_sfxFileMap[item*2+0]]);
uint8 priority = _sfxFileMap[item*2+1];
_soundDigital->playSound(filename, priority, Audio::Mixer::kSFXSoundType, volume);
@@ -478,7 +498,7 @@ void KyraEngine_MR::playVoice(int high, int low) {
void KyraEngine_MR::snd_playVoiceFile(int file) {
debugC(9, kDebugLevelMain, "KyraEngine_MR::snd_playVoiceFile(%d)", file);
char filename[16];
- snprintf(filename, 16, "%u.AUD", (uint)file);
+ snprintf(filename, 16, "%.08u", (uint)file);
_voiceSoundChannel = _soundDigital->playSound(filename, 0xFE, Audio::Mixer::kSpeechSoundType, 255);
}
@@ -531,14 +551,19 @@ void KyraEngine_MR::initMouseShapes() {
assert(data);
for (int i = 0; i <= 6; ++i)
_gameShapes[i] = _screen->makeShapeCopy(data, i);
- delete [] data;
+ delete[] data;
}
void KyraEngine_MR::startup() {
debugC(9, kDebugLevelMain, "KyraEngine_MR::startup()");
- musicUpdate(0);
- memset(_flagsTable, 0, sizeof(_flagsTable));
+ _album.wsa = new WSAMovie_v2(this, _screen);
+ assert(_album.wsa);
+ _album.leftPage.wsa = new WSAMovie_v2(this, _screen);
+ assert(_album.leftPage.wsa);
+ _album.rightPage.wsa = new WSAMovie_v2(this, _screen);
+ assert(_album.rightPage.wsa);
+ musicUpdate(0);
_gamePlayBuffer = new uint8[64000];
musicUpdate(0);
@@ -552,7 +577,6 @@ void KyraEngine_MR::startup() {
_stringBuffer = new char[500];
//XXX
musicUpdate(0);
- _costPalBuffer = new uint8[864];
//XXX
allocAnimObjects(1, 16, 50);
@@ -590,7 +614,7 @@ void KyraEngine_MR::startup() {
for (int i = 0; i < 16; ++i) {
_sceneAnims[i].flags = 0;
- _sceneAnimMovie[i] = new WSAMovieV2(this, _screen);
+ _sceneAnimMovie[i] = new WSAMovie_v2(this, _screen);
assert(_sceneAnimMovie[i]);
}
@@ -647,7 +671,7 @@ void KyraEngine_MR::startup() {
musicUpdate(0);
runStartupScript(1, 0);
_res->exists("MOODOMTR.WSA", true);
- _invWsa = new WSAMovieV2(this, _screen);
+ _invWsa = new WSAMovie_v2(this, _screen);
assert(_invWsa);
_invWsa->open("MOODOMTR.WSA", 1, 0);
_invWsaFrame = 6;
@@ -672,7 +696,11 @@ void KyraEngine_MR::startup() {
void KyraEngine_MR::loadCostPal() {
debugC(9, kDebugLevelMain, "KyraEngine_MR::loadCostPal()");
- _costPalBuffer = _res->fileData("_COSTPAL.DAT", 0);
+ _res->exists("_COSTPAL.DAT", true);
+ uint32 size = 0;
+ _costPalBuffer = _res->fileData("_COSTPAL.DAT", &size);
+ assert(_costPalBuffer);
+ assert(size == 864);
}
void KyraEngine_MR::loadShadowShape() {
@@ -725,7 +753,7 @@ void KyraEngine_MR::initItems() {
memcpy(_itemBuffer1, itemsDat , 72);
memcpy(_itemBuffer2, itemsDat+72, 144);
- delete [] itemsDat;
+ delete[] itemsDat;
_screen->_curPage = 0;
}
@@ -791,7 +819,7 @@ void KyraEngine_MR::loadCharacterShapes(int newShapes) {
ShapeMap::iterator iter = _gameShapes.find(i);
if (iter != _gameShapes.end()) {
- delete iter->_value;
+ delete[] iter->_value;
iter->_value = 0;
}
}
@@ -978,7 +1006,7 @@ void KyraEngine_MR::runLoop() {
_timer->update();
if (inputFlag == 198 || inputFlag == 199) {
- _unk3 = _handItemSet;
+ _unk3 = _mouseState;
Common::Point mouse = getMousePos();
handleInput(mouse.x, mouse.y);
}
@@ -1122,7 +1150,7 @@ void KyraEngine_MR::update() {
updateMouse();
updateSpecialSceneScripts();
updateCommandLine();
- //XXX
+ updateItemAnimations();
musicUpdate(0);
_screen->updateScreen();
@@ -1134,7 +1162,7 @@ void KyraEngine_MR::updateWithText() {
musicUpdate(0);
updateMouse();
- //XXX
+ updateItemAnimations();
updateSpecialSceneScripts();
updateCommandLine();
musicUpdate(0);
@@ -1160,13 +1188,13 @@ void KyraEngine_MR::updateMouse() {
if (mouse.y > 187) {
bool setItemCursor = false;
- if (_handItemSet == -6) {
+ if (_mouseState == -6) {
if (mouse.x < 311)
setItemCursor = true;
- } else if (_handItemSet == -5) {
+ } else if (_mouseState == -5) {
if (mouse.x < _sceneMinX || mouse.x > _sceneMaxX)
setItemCursor = true;
- } else if (_handItemSet == -4) {
+ } else if (_mouseState == -4) {
if (mouse.x > 8)
setItemCursor = true;
}
@@ -1183,8 +1211,8 @@ void KyraEngine_MR::updateMouse() {
hideInventory();
}
- if (hasItemCollision && _handItemSet < -1 && _itemInHand < 0) {
- _handItemSet = -1;
+ if (hasItemCollision && _mouseState < -1 && _itemInHand < 0) {
+ _mouseState = -1;
_itemInHand = -1;
_screen->setMouseCursor(0, 0, _gameShapes[0]);
}
@@ -1261,29 +1289,16 @@ void KyraEngine_MR::updateMouse() {
}
}
- if (type != 0 && type != _handItemSet && !hasItemCollision) {
- _handItemSet = type;
+ if (type != 0 && type != _mouseState && !hasItemCollision) {
+ _mouseState = type;
_screen->setMouseCursor(offsetX, offsetY, _gameShapes[shape]);
- } else if (type == 0 && _handItemSet != _itemInHand && mouse.x > 8 && mouse.x < 311 && mouse.y < 171 && mouse.y > 8) {
+ } else if (type == 0 && _mouseState != _itemInHand && mouse.x > 8 && mouse.x < 311 && mouse.y < 171 && mouse.y > 8) {
setItemMouseCursor();
- } else if (mouse.y > 187 && _handItemSet > -4 && type == 0 && !_inventoryState) {
+ } else if (mouse.y > 187 && _mouseState > -4 && type == 0 && !_inventoryState) {
showInventory();
}
}
-void KyraEngine_MR::delay(uint32 millis, bool doUpdate, bool isMainLoop) {
- debugC(9, kDebugLevelMain, "KyraEngine_MR::delay(%d, %d, %d)", millis, doUpdate, isMainLoop);
- uint32 endTime = _system->getMillis() + millis;
- while (endTime > _system->getMillis()) {
- if (doUpdate) {
- //XXX
- update();
- }
-
- _system->delayMillis(10);
- }
-}
-
#pragma mark -
void KyraEngine_MR::makeCharFacingMouse() {
@@ -1501,13 +1516,14 @@ void KyraEngine_MR::resetSkipFlag(bool removeEvent) {
void KyraEngine_MR::registerDefaultSettings() {
debugC(9, kDebugLevelMain, "KyraEngine_MR::registerDefaultSettings()");
- KyraEngine::registerDefaultSettings();
+ KyraEngine_v1::registerDefaultSettings();
// Most settings already have sensible defaults. This one, however, is
// specific to the Kyra engine.
ConfMan.registerDefault("walkspeed", 5);
ConfMan.registerDefault("studio_audience", true);
ConfMan.registerDefault("skip_support", true);
+ ConfMan.registerDefault("helium_mode", false);
}
void KyraEngine_MR::writeSettings() {
@@ -1531,16 +1547,18 @@ void KyraEngine_MR::writeSettings() {
ConfMan.setBool("studio_audience", _configStudio);
ConfMan.setBool("skip_support", _configSkip);
+ ConfMan.setBool("helium_mode", _configHelium);
- KyraEngine::writeSettings();
+ KyraEngine_v1::writeSettings();
}
void KyraEngine_MR::readSettings() {
debugC(9, kDebugLevelMain, "KyraEngine_MR::readSettings()");
- KyraEngine::readSettings();
+ KyraEngine_v1::readSettings();
_configStudio = ConfMan.getBool("studio_audience");
_configSkip = ConfMan.getBool("skip_support");
+ _configHelium = ConfMan.getBool("helium_mode");
}
} // end of namespace Kyra
diff --git a/engines/kyra/kyra_mr.h b/engines/kyra/kyra_mr.h
index 3dba3ec8d9..5af138373c 100644
--- a/engines/kyra/kyra_mr.h
+++ b/engines/kyra/kyra_mr.h
@@ -23,8 +23,8 @@
*
*/
-#ifndef KYRA_KYRA_V3_H
-#define KYRA_KYRA_V3_H
+#ifndef KYRA_KYRA_MR_H
+#define KYRA_KYRA_MR_H
#include "kyra/kyra_v2.h"
#include "kyra/screen_mr.h"
@@ -39,7 +39,7 @@ namespace Kyra {
class SoundDigital;
class Screen_MR;
class MainMenu;
-class WSAMovieV2;
+class WSAMovie_v2;
class TextDisplayer_MR;
struct Button;
@@ -50,11 +50,17 @@ public:
KyraEngine_MR(OSystem *system, const GameFlags &flags);
~KyraEngine_MR();
+ //TODO: proper extended implementation of KyraEngine_v2::pauseEngineIntern.
+ // Idle animation time, item animations and album animations should be taken
+ // care of, but since those would just produce minor glitches it's not that
+ // important.
+
Screen *screen() { return _screen; }
Screen_v2 *screen_v2() const { return _screen; }
GUI_v2 *gui_v2() const { return _gui; }
SoundDigital *soundDigital() { return _soundDigital; }
int language() const { return _lang; }
+ bool heliumMode() const { return _configHelium; }
int go();
@@ -66,11 +72,14 @@ private:
// config
bool _configStudio;
bool _configSkip;
+ bool _configHelium;
void registerDefaultSettings();
void writeSettings();
void readSettings();
+ void initStaticResource();
+
// --
Screen_MR *_screen;
SoundDigital *_soundDigital;
@@ -98,8 +107,6 @@ private:
void updateWithText();
void updateMouse();
- void delay(uint32 millis, bool update = false, bool isMainLoop = false);
-
// sound specific
private:
void playMenuAudioFile();
@@ -108,8 +115,8 @@ private:
int _fadeOutMusicChannel;
const char *_menuAudioFile;
- static const char *_soundList[];
- static const int _soundListSize;
+ const char *const *_soundList;
+ int _soundListSize;
void snd_playWanderScoreViaMap(int track, int force);
void stopMusicTrack();
@@ -119,10 +126,10 @@ private:
void snd_playSoundEffect(int item, int volume);
- static const uint8 _sfxFileMap[];
- static const int _sfxFileMapSize;
- static const char *_sfxFileList[];
- static const int _sfxFileListSize;
+ const uint8 *_sfxFileMap;
+ int _sfxFileMapSize;
+ const char *const *_sfxFileList;
+ int _sfxFileListSize;
int _voiceSoundChannel;
@@ -157,7 +164,7 @@ private:
void initMainMenu();
void uninitMainMenu();
- WSAMovieV2 *_menuAnim;
+ WSAMovie_v2 *_menuAnim;
// timer
void setupTimers();
@@ -177,7 +184,8 @@ private:
private:
// main menu
- static const char *_mainMenuStrings[];
+ const char *const *_mainMenuStrings;
+ int _mainMenuStringsSize;
// animator
uint8 *_gamePlayBuffer;
@@ -194,6 +202,7 @@ private:
void refreshAnimObjects(int force);
bool _loadingState;
+ void updateItemAnimations();
void updateCharacterAnim(int charId);
void updateSceneAnim(int anim, int newFrame);
@@ -209,6 +218,10 @@ private:
bool _nextIdleType;
void showIdleAnim();
+ const ItemAnimData_v2 *_itemAnimData;
+ ActiveItemAnim _activeItemAnim[10];
+ int _nextAnimItem;
+
// interface
uint8 *_interface;
uint8 *_interfaceCommandLine;
@@ -247,7 +260,7 @@ private:
void clearInventorySlot(int slot, int page);
void drawInventorySlot(int page, int item, int slot);
- WSAMovieV2 *_invWsa;
+ WSAMovie_v2 *_invWsa;
int _invWsaFrame;
// localization
@@ -282,12 +295,12 @@ private:
bool isDropable(int x, int y);
- static const uint8 _itemMagicTable[];
+ const uint8 *_itemMagicTable;
bool itemListMagic(int handItem, int itemSlot);
bool itemInventoryMagic(int handItem, int invSlot);
- static const uint8 _itemStringMap[];
- static const uint _itemStringMapSize;
+ const uint8 *_itemStringMap;
+ int _itemStringMapSize;
static const uint8 _itemStringPickUp[];
static const uint8 _itemStringDrop[];
static const uint8 _itemStringInv[];
@@ -415,6 +428,11 @@ private:
void goodConscienceChat(const char *str, int vocHigh, int vocLow);
void goodConscienceChatWaitToFinish();
+ bool _albumChatActive;
+ void albumChat(const char *str, int vocHigh, int vocLow);
+ void albumChatInit(const char *str, int object, int vocHigh, int vocLow);
+ void albumChatWaitToFinish();
+
void malcolmSceneStartupChat();
byte _newSceneDlgState[40];
@@ -503,14 +521,64 @@ private:
int _score;
int _scoreMax;
- static const int8 _scoreTable[];
- static const int _scoreTableSize;
+ const uint8 *_scoreTable;
+ int _scoreTableSize;
+
int8 _scoreFlagTable[26];
bool updateScore(int scoreId, int strId);
void scoreIncrease(int count, const char *str);
void eelScript();
+ // Album
+ struct Album {
+ uint8 *backUpPage;
+ uint8 *file;
+ WSAMovie_v2 *wsa;
+ uint8 *backUpRect;
+
+ struct PageMovie {
+ WSAMovie_v2 *wsa;
+ int curFrame;
+ int maxFrame;
+ uint32 timer;
+ };
+
+ PageMovie leftPage, rightPage;
+
+ int curPage, nextPage;
+ bool running;
+ bool isPage14;
+ } _album;
+
+ static const int8 _albumWSAX[];
+ static const int8 _albumWSAY[];
+
+ void showAlbum();
+
+ void loadAlbumPage();
+ void loadAlbumPageWSA();
+
+ void printAlbumPageText();
+ void printAlbumText(int page, const char *str, int x, int y, uint8 c0);
+
+ void processAlbum();
+
+ void albumNewPage();
+ void albumUpdateAnims();
+ void albumAnim1();
+ void albumAnim2();
+
+ void albumBackUpRect();
+ void albumRestoreRect();
+ void albumUpdateRect();
+
+ void albumSwitchPages(int oldPage, int newPage, int srcPage);
+
+ int albumNextPage(Button *caller);
+ int albumPrevPage(Button *caller);
+ int albumClose(Button *caller);
+
// save/load
void saveGame(const char *fileName, const char *saveName);
void loadGame(const char *fileName);
@@ -527,6 +595,7 @@ private:
int o3_setCharacterAnimFrameFromFacing(EMCState *script);
int o3_showBadConscience(EMCState *script);
int o3_hideBadConscience(EMCState *script);
+ int o3_showAlbum(EMCState *script);
int o3_setInventorySlot(EMCState *script);
int o3_getInventorySlot(EMCState *script);
int o3_addItemToInventory(EMCState *script);
@@ -548,6 +617,7 @@ private:
int o3_drawSceneShapeOnPage(EMCState *script);
int o3_checkInRect(EMCState *script);
int o3_updateConversations(EMCState *script);
+ int o3_removeItemSlot(EMCState *script);
int o3_setSceneDim(EMCState *script);
int o3_setSceneAnimPosAndFrame(EMCState *script);
int o3_removeItemInstances(EMCState *script);
@@ -560,7 +630,7 @@ private:
int o3_playSoundEffect(EMCState *script);
int o3_getScore(EMCState *script);
int o3_daggerWarning(EMCState *script);
- int o3_blockOutRegion(EMCState *script);
+ int o3_blockOutWalkableRegion(EMCState *script);
int o3_showSceneStringsMessage(EMCState *script);
int o3_showGoodConscience(EMCState *script);
int o3_goodConscienceChat(EMCState *script);
diff --git a/engines/kyra/kyra_v1.cpp b/engines/kyra/kyra_v1.cpp
index e9bb25fe5f..1cc1d728bf 100644
--- a/engines/kyra/kyra_v1.cpp
+++ b/engines/kyra/kyra_v1.cpp
@@ -23,1024 +23,386 @@
*
*/
-#include "kyra/kyra_v1.h"
-
-#include "common/file.h"
-#include "common/events.h"
-#include "common/system.h"
-#include "common/savefile.h"
+#include "common/config-manager.h"
-#include "gui/message.h"
+#include "sound/mididrv.h"
+#include "sound/mixer.h"
+#include "kyra/kyra_v1.h"
+#include "kyra/sound.h"
#include "kyra/resource.h"
#include "kyra/screen.h"
-#include "kyra/script.h"
-#include "kyra/seqplayer.h"
-#include "kyra/sound.h"
-#include "kyra/sprites.h"
-#include "kyra/wsamovie.h"
-#include "kyra/animator_v1.h"
#include "kyra/text.h"
-#include "kyra/debugger.h"
#include "kyra/timer.h"
+#include "kyra/script.h"
+#include "kyra/debugger.h"
namespace Kyra {
KyraEngine_v1::KyraEngine_v1(OSystem *system, const GameFlags &flags)
- : KyraEngine(system, flags) {
- _skipFlag = false;
-
- _seq_Forest = _seq_KallakWriting = _seq_KyrandiaLogo = _seq_KallakMalcolm =
- _seq_MalcolmTree = _seq_WestwoodLogo = _seq_Demo1 = _seq_Demo2 = _seq_Demo3 =
- _seq_Demo4 = 0;
-
- _seq_WSATable = _seq_CPSTable = _seq_COLTable = _seq_textsTable = 0;
- _seq_WSATable_Size = _seq_CPSTable_Size = _seq_COLTable_Size = _seq_textsTable_Size = 0;
-
- _roomFilenameTable = _characterImageTable = 0;
- _roomFilenameTableSize = _characterImageTableSize = 0;
- _itemList = _takenList = _placedList = _droppedList = _noDropList = 0;
- _itemList_Size = _takenList_Size = _placedList_Size = _droppedList_Size = _noDropList_Size = 0;
- _putDownFirst = _waitForAmulet = _blackJewel = _poisonGone = _healingTip = 0;
- _putDownFirst_Size = _waitForAmulet_Size = _blackJewel_Size = _poisonGone_Size = _healingTip_Size = 0;
- _thePoison = _fluteString = _wispJewelStrings = _magicJewelString = _flaskFull = _fullFlask = 0;
- _thePoison_Size = _fluteString_Size = _wispJewelStrings_Size = 0;
- _magicJewelString_Size = _flaskFull_Size = _fullFlask_Size = 0;
-
- _defaultShapeTable = 0;
- _healingShapeTable = _healingShape2Table = 0;
- _defaultShapeTableSize = _healingShapeTableSize = _healingShape2TableSize = 0;
- _posionDeathShapeTable = _fluteAnimShapeTable = 0;
- _posionDeathShapeTableSize = _fluteAnimShapeTableSize = 0;
- _winterScrollTable = _winterScroll1Table = _winterScroll2Table = 0;
- _winterScrollTableSize = _winterScroll1TableSize = _winterScroll2TableSize = 0;
- _drinkAnimationTable = _brandonToWispTable = _magicAnimationTable = _brandonStoneTable = 0;
- _drinkAnimationTableSize = _brandonToWispTableSize = _magicAnimationTableSize = _brandonStoneTableSize = 0;
- memset(&_specialPalettes, 0, sizeof(_specialPalettes));
+ : Engine(system), _flags(flags) {
+ _res = 0;
+ _sound = 0;
+ _text = 0;
+ _staticres = 0;
+ _timer = 0;
+ _emc = 0;
_debugger = 0;
- _sprites = 0;
- _animator = 0;
- _seq = 0;
- _characterList = 0;
- _movFacingTable = 0;
- _buttonData = 0;
- _buttonDataListPtr = 0;
- memset(_shapes, 0, sizeof(_shapes));
- memset(_movieObjects, 0, sizeof(_movieObjects));
- _finalA = _finalB = _finalC = 0;
- _endSequenceBackUpRect = 0;
- memset(_panPagesTable, 0, sizeof(_panPagesTable));
- memset(_sceneAnimTable, 0, sizeof(_sceneAnimTable));
- _currHeadShape = 0;
-
- memset(&_itemBkgBackUp, 0, sizeof(_itemBkgBackUp));
-}
-
-KyraEngine_v1::~KyraEngine_v1() {
- for (int i = 0; i < ARRAYSIZE(_movieObjects); ++i) {
- if (_movieObjects[i])
- _movieObjects[i]->close();
- delete _movieObjects[i];
- _movieObjects[i] = 0;
- }
-
- closeFinalWsa();
- if (_emc) {
- _emc->unload(&_npcScriptData);
- _emc->unload(&_scriptClickData);
- }
-
- Common::clearAllSpecialDebugLevels();
-
- delete _screen;
- delete _debugger;
- delete _sprites;
- delete _animator;
- delete _seq;
-
- delete [] _characterList;
-
- delete [] _movFacingTable;
-
- delete [] _gui->_scrollUpButton.data0ShapePtr;
- delete [] _gui->_scrollUpButton.data1ShapePtr;
- delete [] _gui->_scrollUpButton.data2ShapePtr;
- delete [] _gui->_scrollDownButton.data0ShapePtr;
- delete [] _gui->_scrollDownButton.data1ShapePtr;
- delete [] _gui->_scrollDownButton.data2ShapePtr;
-
- delete [] _buttonData;
- delete [] _buttonDataListPtr;
-
- delete _gui;
-
- delete [] _itemBkgBackUp[0];
- delete [] _itemBkgBackUp[1];
-
- for (int i = 0; i < ARRAYSIZE(_shapes); ++i) {
- if (_shapes[i] != 0) {
- delete [] _shapes[i];
- for (int i2 = 0; i2 < ARRAYSIZE(_shapes); i2++) {
- if (_shapes[i2] == _shapes[i] && i2 != i) {
- _shapes[i2] = 0;
- }
- }
- _shapes[i] = 0;
- }
- }
-
- for (int i = 0; i < ARRAYSIZE(_sceneAnimTable); ++i)
- delete [] _sceneAnimTable[i];
-}
-
-int KyraEngine_v1::init() {
- _screen = new Screen_v1(this, _system);
- assert(_screen);
- _screen->setResolution();
-
- KyraEngine::init();
-
- _sprites = new Sprites(this, _system);
- assert(_sprites);
- _seq = new SeqPlayer(this, _system);
- assert(_seq);
- _animator = new Animator_v1(this, _system);
- assert(_animator);
- _animator->init(5, 11, 12);
- assert(*_animator);
- _text = new TextDisplayer(this, screen());
- assert(_text);
- _gui = new GUI_v1(this, _screen);
- assert(_gui);
-
- initStaticResource();
-
- _sound->setSoundList(&_soundData[kMusicIntro]);
-
- _trackMap = _dosTrackMap;
- _trackMapSize = _dosTrackMapSize;
-
- if (!_sound->init())
- error("Couldn't init sound");
- _sound->loadSoundFile(0);
+ _gameSpeed = 60;
+ _tickLength = (uint8)(1000.0 / _gameSpeed);
- setupButtonData();
+ _quitFlag = false;
- _paletteChanged = 1;
- _currentCharacter = 0;
- _characterList = new Character[11];
- assert(_characterList);
- memset(_characterList, 0, sizeof(Character)*11);
+ _speechFile = "";
+ _trackMap = 0;
+ _trackMapSize = 0;
+ _lastMusicCommand = -1;
+ _curSfxFile = _curMusicTheme = -1;
- for (int i = 0; i < 11; ++i)
- memset(_characterList[i].inventoryItems, 0xFF, sizeof(_characterList[i].inventoryItems));
+ _gameToLoad = -1;
- _characterList[0].sceneId = 5;
- _characterList[0].height = 48;
- _characterList[0].facing = 3;
- _characterList[0].currentAnimFrame = 7;
-
- memset(&_npcScriptData, 0, sizeof(EMCData));
- memset(&_scriptClickData, 0, sizeof(EMCData));
-
- memset(&_npcScript, 0, sizeof(EMCState));
- memset(&_scriptMain, 0, sizeof(EMCState));
- memset(&_scriptClick, 0, sizeof(EMCState));
-
- _debugger = new Debugger_v1(this);
- assert(_debugger);
- memset(_shapes, 0, sizeof(_shapes));
-
- for (int i = 0; i < ARRAYSIZE(_movieObjects); ++i)
- _movieObjects[i] = createWSAMovie();
+ _mouseState = -1;
+ _deathHandler = -1;
memset(_flagsTable, 0, sizeof(_flagsTable));
- _abortWalkFlag = false;
- _abortWalkFlag2 = false;
- _talkingCharNum = -1;
- _charSayUnk3 = -1;
- memset(_currSentenceColor, 0, 3);
- _startSentencePalIndex = -1;
- _fadeText = false;
-
- _cauldronState = 0;
- _crystalState[0] = _crystalState[1] = -1;
-
- _brandonStatusBit = 0;
- _brandonStatusBit0x02Flag = _brandonStatusBit0x20Flag = 10;
- _brandonPosX = _brandonPosY = -1;
- _deathHandler = 0xFF;
- _poisonDeathCounter = 0;
-
- memset(_itemTable, 0, sizeof(_itemTable));
- memset(_exitList, 0xFFFF, sizeof(_exitList));
- _exitListPtr = 0;
- _pathfinderFlag = _pathfinderFlag2 = 0;
- _lastFindWayRet = 0;
- _sceneChangeState = _loopFlag2 = 0;
-
- _movFacingTable = new int[150];
- assert(_movFacingTable);
- _movFacingTable[0] = 8;
-
- _skipFlag = false;
-
- _marbleVaseItem = -1;
- memset(_foyerItemTable, -1, sizeof(_foyerItemTable));
- _mouseState = _itemInHand = -1;
- _handleInput = false;
-
- _currentRoom = 0xFFFF;
- _scenePhasingFlag = 0;
- _lastProcessedItem = 0;
- _lastProcessedItemHeight = 16;
-
- _unkScreenVar1 = 1;
- _unkScreenVar2 = 0;
- _unkScreenVar3 = 0;
- _unkAmuletVar = 0;
-
- _endSequenceNeedLoading = 1;
- _malcolmFlag = 0;
- _beadStateVar = 0;
- _endSequenceSkipFlag = 0;
- _unkEndSeqVar2 = 0;
- _endSequenceBackUpRect = 0;
- _unkEndSeqVar4 = 0;
- _unkEndSeqVar5 = 0;
- _lastDisplayedPanPage = 0;
- memset(_panPagesTable, 0, sizeof(_panPagesTable));
- _finalA = _finalB = _finalC = 0;
- memset(&_kyragemFadingState, 0, sizeof(_kyragemFadingState));
- _kyragemFadingState.gOffset = 0x13;
- _kyragemFadingState.bOffset = 0x13;
-
- _mousePressFlag = false;
-
- _menuDirectlyToLoad = false;
-
- _lastMusicCommand = 0;
-
- return 0;
+ // sets up all engine specific debug levels
+ Common::addSpecialDebugLevel(kDebugLevelScriptFuncs, "ScriptFuncs", "Script function debug level");
+ Common::addSpecialDebugLevel(kDebugLevelScript, "Script", "Script interpreter debug level");
+ Common::addSpecialDebugLevel(kDebugLevelSprites, "Sprites", "Sprite debug level");
+ Common::addSpecialDebugLevel(kDebugLevelScreen, "Screen", "Screen debug level");
+ Common::addSpecialDebugLevel(kDebugLevelSound, "Sound", "Sound debug level");
+ Common::addSpecialDebugLevel(kDebugLevelAnimator, "Animator", "Animator debug level");
+ Common::addSpecialDebugLevel(kDebugLevelMain, "Main", "Generic debug level");
+ Common::addSpecialDebugLevel(kDebugLevelGUI, "GUI", "GUI debug level");
+ Common::addSpecialDebugLevel(kDebugLevelSequence, "Sequence", "Sequence debug level");
+ Common::addSpecialDebugLevel(kDebugLevelMovie, "Movie", "Movie debug level");
+ Common::addSpecialDebugLevel(kDebugLevelTimer, "Timer", "Timer debug level");
+
+ system->getEventManager()->registerRandomSource(_rnd, "kyra");
}
-int KyraEngine_v1::go() {
- if (_res->getFileSize("6.FNT"))
- _screen->loadFont(Screen::FID_6_FNT, "6.FNT");
- _screen->loadFont(Screen::FID_8_FNT, "8FAT.FNT");
- _screen->setScreenDim(0);
-
- _abortIntroFlag = false;
-
- if (_flags.isDemo) {
- seq_demo();
- } else {
- setGameFlag(0xF3);
- setGameFlag(0xFD);
- if (_gameToLoad == -1) {
- setGameFlag(0xEF);
- seq_intro();
- if (_quitFlag)
- return 0;
- if (_skipIntroFlag && _abortIntroFlag)
- resetGameFlag(0xEF);
- }
- startup();
- resetGameFlag(0xEF);
- mainLoop();
- }
- return 0;
+::GUI::Debugger *KyraEngine_v1::getDebugger() {
+ return _debugger;
}
+void KyraEngine_v1::pauseEngineIntern(bool pause) {
+ Engine::pauseEngineIntern(pause);
+ _timer->pause(pause);
+}
-void KyraEngine_v1::startup() {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::startup()");
- static const uint8 colorMap[] = { 0, 0, 0, 0, 12, 12, 12, 0, 0, 0, 0, 0 };
- _screen->setTextColorMap(colorMap);
- _sound->setSoundList(&_soundData[kMusicIngame]);
- _sound->loadSoundFile(0);
-// _screen->setFont(Screen::FID_6_FNT);
- _screen->setAnimBlockPtr(3750);
- memset(_sceneAnimTable, 0, sizeof(_sceneAnimTable));
- loadMouseShapes();
- _currentCharacter = &_characterList[0];
- for (int i = 1; i < 5; ++i)
- _animator->setCharacterDefaultFrame(i);
- for (int i = 5; i <= 10; ++i)
- setCharactersPositions(i);
- _animator->setCharactersHeight();
- resetBrandonPoisonFlags();
- _screen->_curPage = 0;
- // XXX
- for (int i = 0; i < 12; ++i) {
- int size = _screen->getRectSize(3, 24);
- _shapes[361+i] = new byte[size];
- }
-
- _itemBkgBackUp[0] = new uint8[_screen->getRectSize(3, 24)];
- memset(_itemBkgBackUp[0], 0, _screen->getRectSize(3, 24));
- _itemBkgBackUp[1] = new uint8[_screen->getRectSize(4, 32)];
- memset(_itemBkgBackUp[1], 0, _screen->getRectSize(4, 32));
-
- for (int i = 0; i < _roomTableSize; ++i) {
- for (int item = 0; item < 12; ++item) {
- _roomTable[i].itemsTable[item] = 0xFF;
- _roomTable[i].itemsXPos[item] = 0xFFFF;
- _roomTable[i].itemsYPos[item] = 0xFF;
- _roomTable[i].needInit[item] = 0;
+int KyraEngine_v1::init() {
+ registerDefaultSettings();
+
+ // Setup mixer
+ _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume"));
+ _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume"));
+ _mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, ConfMan.getInt("speech_volume"));
+
+ if (!_flags.useDigSound) {
+ // We prefer AdLib over native MIDI, since our AdLib playback code is much
+ // more mature than our MIDI player. For example we are missing MT-32 support
+ // and it seems our MIDI playback code has threading issues (see bug #1506583
+ // "KYRA1: Crash on exceeded polyphony" for more information).
+ int midiDriver = MidiDriver::detectMusicDriver(MDT_MIDI | MDT_ADLIB/* | MDT_PREFER_MIDI*/);
+
+ if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98) {
+ // TODO: currently we don't support the PC98 sound data,
+ // but since it has the FM-Towns data files, we just use the
+ // FM-Towns driver
+ if (_flags.gameID == GI_KYRA1)
+ _sound = new SoundTowns(this, _mixer);
+ else
+ _sound = new SoundTowns_v2(this, _mixer);
+ } else if (midiDriver == MD_ADLIB) {
+ _sound = new SoundAdlibPC(this, _mixer);
+ assert(_sound);
+ } else {
+ bool native_mt32 = ((midiDriver == MD_MT32) || ConfMan.getBool("native_mt32"));
+
+ MidiDriver *driver = MidiDriver::createMidi(midiDriver);
+ assert(driver);
+ if (native_mt32)
+ driver->property(MidiDriver::PROP_CHANNEL_MASK, 0x03FE);
+
+ SoundMidiPC *soundMidiPc = new SoundMidiPC(this, _mixer, driver);
+ _sound = soundMidiPc;
+ assert(_sound);
+ soundMidiPc->hasNativeMT32(native_mt32);
+
+ // Unlike some SCUMM games, it's not that the MIDI sounds are
+ // missing. It's just that at least at the time of writing they
+ // are decidedly inferior to the Adlib ones.
+ if (ConfMan.getBool("multi_midi")) {
+ SoundAdlibPC *adlib = new SoundAdlibPC(this, _mixer);
+ assert(adlib);
+
+ _sound = new MixedSoundDriver(this, _mixer, soundMidiPc, adlib);
+ assert(_sound);
+ }
}
}
- loadCharacterShapes();
- loadSpecialEffectShapes();
- loadItems();
- loadButtonShapes();
- initMainButtonList();
- loadMainScreen();
- _screen->loadPalette("PALETTE.COL", _screen->_currentPalette);
-
- // XXX
- _animator->initAnimStateList();
- setCharactersInDefaultScene();
-
- if (!_emc->load("_STARTUP.EMC", &_npcScriptData, &_opcodes))
- error("Could not load \"_STARTUP.EMC\" script");
- _emc->init(&_scriptMain, &_npcScriptData);
-
- if (!_emc->start(&_scriptMain, 0))
- error("Could not start script function 0 of script \"_STARTUP.EMC\"");
-
- while (_emc->isValid(&_scriptMain))
- _emc->run(&_scriptMain);
-
- _emc->unload(&_npcScriptData);
-
- if (!_emc->load("_NPC.EMC", &_npcScriptData, &_opcodes))
- error("Could not load \"_NPC.EMC\" script");
-
- snd_playTheme(1, -1);
- if (_gameToLoad == -1) {
- enterNewScene(_currentCharacter->sceneId, _currentCharacter->facing, 0, 0, 1);
- if (_abortIntroFlag && _skipIntroFlag) {
- _menuDirectlyToLoad = true;
- _screen->setMouseCursor(1, 1, _shapes[0]);
- _screen->showMouse();
- _gui->buttonMenuCallback(0);
- _menuDirectlyToLoad = false;
- } else
- saveGame(getSavegameFilename(0), "New game");
- } else {
- _screen->setFont(Screen::FID_8_FNT);
- loadGame(getSavegameFilename(_gameToLoad));
- _gameToLoad = -1;
+ if (_sound)
+ _sound->updateVolumeSettings();
+
+ _res = new Resource(this);
+ assert(_res);
+ _res->reset();
+ _staticres = new StaticResource(this);
+ assert(_staticres);
+ if (!_staticres->init())
+ error("_staticres->init() failed");
+ if (!screen()->init())
+ error("screen()->init() failed");
+ _timer = new TimerManager(this, _system);
+ assert(_timer);
+ setupTimers();
+ _emc = new EMCInterpreter(this);
+ assert(_emc);
+
+ setupOpcodeTable();
+ readSettings();
+
+ if (ConfMan.hasKey("save_slot")) {
+ _gameToLoad = ConfMan.getInt("save_slot");
+ if (!saveFileLoadable(_gameToLoad))
+ _gameToLoad = -1;
}
-}
-void KyraEngine_v1::mainLoop() {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::mainLoop()");
+ _lang = 0;
+ Common::Language lang = Common::parseLanguage(ConfMan.get("language"));
- while (!_quitFlag) {
- int32 frameTime = (int32)_system->getMillis();
- _skipFlag = false;
+ if (_flags.gameID == GI_KYRA2 || _flags.gameID == GI_KYRA3) {
+ switch (lang) {
+ case Common::EN_ANY:
+ case Common::EN_USA:
+ case Common::EN_GRB:
+ _lang = 0;
+ break;
- if (_currentCharacter->sceneId == 210) {
- updateKyragemFading();
- if (seq_playEnd() && _deathHandler != 8)
- break;
- }
+ case Common::FR_FRA:
+ _lang = 1;
+ break;
- if (_deathHandler != 0xFF) {
- snd_playWanderScoreViaMap(0, 1);
- snd_playSoundEffect(49);
- _screen->hideMouse();
- _screen->setMouseCursor(1, 1, _shapes[0]);
- destroyMouseItem();
- _screen->showMouse();
- _gui->buttonMenuCallback(0);
- _deathHandler = 0xFF;
- }
+ case Common::DE_DEU:
+ _lang = 2;
+ break;
- if ((_brandonStatusBit & 2) && _brandonStatusBit0x02Flag)
- _animator->animRefreshNPC(0);
+ case Common::JA_JPN:
+ _lang = 3;
+ break;
- if ((_brandonStatusBit & 0x20) && _brandonStatusBit0x20Flag) {
- _animator->animRefreshNPC(0);
- _brandonStatusBit0x20Flag = 0;
+ default:
+ warning("unsupported language, switching back to English");
+ _lang = 0;
+ break;
}
-
- _screen->showMouse();
-
- _gui->processButtonList(_buttonList, 0);
- updateMousePointer();
- _timer->update();
- updateTextFade();
-
- _handleInput = true;
- delay((frameTime + _gameSpeed) - _system->getMillis(), true, true);
- _handleInput = false;
-
- _sound->process();
}
-}
-
-void KyraEngine_v1::delayUntil(uint32 timestamp, bool updateTimers, bool update, bool isMainLoop) {
- while (_system->getMillis() < timestamp && !_quitFlag) {
- if (updateTimers)
- _timer->update();
- if (timestamp - _system->getMillis() >= 10)
- delay(10, update, isMainLoop);
- }
+ return 0;
}
-void KyraEngine_v1::delay(uint32 amount, bool update, bool isMainLoop) {
- Common::Event event;
-
- uint32 start = _system->getMillis();
- do {
- while (_eventMan->pollEvent(event)) {
- switch (event.type) {
- case Common::EVENT_KEYDOWN:
- if (event.kbd.keycode >= '1' && event.kbd.keycode <= '9' &&
- (event.kbd.flags == Common::KBD_CTRL || event.kbd.flags == Common::KBD_ALT) && isMainLoop) {
- const char *saveLoadSlot = getSavegameFilename(9 - (event.kbd.keycode - '0') + 990);
-
- if (event.kbd.flags == Common::KBD_CTRL)
- loadGame(saveLoadSlot);
- else {
- char savegameName[14];
- sprintf(savegameName, "Quicksave %d", event.kbd.keycode - '0');
- saveGame(saveLoadSlot, savegameName);
- }
- } else if (event.kbd.flags == Common::KBD_CTRL) {
- if (event.kbd.keycode == 'd')
- _debugger->attach();
- else if (event.kbd.keycode == 'q')
- _quitFlag = true;
- } else if (event.kbd.keycode == '.') {
- _skipFlag = true;
- } else if (event.kbd.keycode == Common::KEYCODE_RETURN || event.kbd.keycode == Common::KEYCODE_SPACE || event.kbd.keycode == Common::KEYCODE_ESCAPE) {
- _abortIntroFlag = true;
- _skipFlag = true;
- }
-
- break;
- case Common::EVENT_MOUSEMOVE:
- _animator->_updateScreen = true;
- break;
- case Common::EVENT_QUIT:
- quitGame();
- break;
- case Common::EVENT_LBUTTONDOWN:
- _mousePressFlag = true;
- break;
- case Common::EVENT_LBUTTONUP:
- _mousePressFlag = false;
-
- if (_abortWalkFlag2)
- _abortWalkFlag = true;
-
- if (_handleInput) {
- _handleInput = false;
- processInput();
- _handleInput = true;
- } else
- _skipFlag = true;
-
- break;
- default:
- break;
- }
- }
-
- if (_debugger->isAttached())
- _debugger->onFrame();
-
- if (update) {
- _sprites->updateSceneAnims();
- _animator->updateAllObjectShapes();
- updateTextFade();
- updateMousePointer();
- }
-
- if (_currentCharacter && _currentCharacter->sceneId == 210 && update)
- updateKyragemFading();
-
- if (_skipFlag && !_abortIntroFlag && !queryGameFlag(0xFE))
- _skipFlag = false;
-
- if (amount > 0 && !_skipFlag && !_quitFlag)
- _system->delayMillis(10);
-
- if (_skipFlag)
- _sound->voiceStop();
- } while (!_skipFlag && _system->getMillis() < start + amount && !_quitFlag);
+KyraEngine_v1::~KyraEngine_v1() {
+ for (Common::Array<const Opcode*>::iterator i = _opcodes.begin(); i != _opcodes.end(); ++i)
+ delete *i;
+ _opcodes.clear();
+
+ delete _res;
+ delete _staticres;
+ delete _sound;
+ delete _text;
+ delete _timer;
+ delete _emc;
+ delete _debugger;
}
-void KyraEngine_v1::waitForEvent() {
- bool finished = false;
- Common::Event event;
-
- while (!finished && !_quitFlag) {
- while (_eventMan->pollEvent(event)) {
- switch (event.type) {
- case Common::EVENT_KEYDOWN:
- finished = true;
- break;
- case Common::EVENT_QUIT:
- quitGame();
- break;
- case Common::EVENT_LBUTTONDOWN:
- finished = true;
- _skipFlag = true;
- break;
- default:
- break;
- }
- }
-
- if (_debugger->isAttached())
- _debugger->onFrame();
-
- _system->delayMillis(10);
- }
+void KyraEngine_v1::quitGame() {
+ debugC(9, kDebugLevelMain, "KyraEngine_v1::quitGame()");
+ _quitFlag = true;
+ // Nothing to do here
}
-void KyraEngine_v1::delayWithTicks(int ticks) {
- uint32 nextTime = _system->getMillis() + ticks * _tickLength;
-
- while (_system->getMillis() < nextTime) {
- _sprites->updateSceneAnims();
- _animator->updateAllObjectShapes();
+Common::Point KyraEngine_v1::getMousePos() const {
+ Common::Point mouse = _eventMan->getMousePos();
- if (_currentCharacter->sceneId == 210) {
- updateKyragemFading();
- seq_playEnd();
- }
-
- if (_skipFlag)
- break;
-
- if (nextTime - _system->getMillis() >= 10)
- delay(10);
+ if (_flags.useHiResOverlay) {
+ mouse.x >>= 1;
+ mouse.y >>= 1;
}
-}
-#pragma mark -
-#pragma mark - Animation/shape specific code
-#pragma mark -
-
-void KyraEngine_v1::setupShapes123(const Shape *shapeTable, int endShape, int flags) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::setupShapes123(%p, %d, %d)", (const void *)shapeTable, endShape, flags);
-
- for (int i = 123; i <= 172; ++i)
- _shapes[i] = 0;
-
- uint8 curImage = 0xFF;
- int curPageBackUp = _screen->_curPage;
- _screen->_curPage = 8; // we are using page 8 here in the original page 2 was backuped and then used for this stuff
- int shapeFlags = 2;
- if (flags)
- shapeFlags = 3;
- for (int i = 123; i < 123+endShape; ++i) {
- uint8 newImage = shapeTable[i-123].imageIndex;
- if (newImage != curImage && newImage != 0xFF) {
- assert(_characterImageTable);
- _screen->loadBitmap(_characterImageTable[newImage], 8, 8, 0);
- curImage = newImage;
- }
- _shapes[i] = _screen->encodeShape(shapeTable[i-123].x<<3, shapeTable[i-123].y, shapeTable[i-123].w<<3, shapeTable[i-123].h, shapeFlags);
- assert(i-7 < _defaultShapeTableSize);
- _defaultShapeTable[i-7].xOffset = shapeTable[i-123].xOffset;
- _defaultShapeTable[i-7].yOffset = shapeTable[i-123].yOffset;
- _defaultShapeTable[i-7].w = shapeTable[i-123].w;
- _defaultShapeTable[i-7].h = shapeTable[i-123].h;
- }
- _screen->_curPage = curPageBackUp;
+ return mouse;
}
-void KyraEngine_v1::freeShapes123() {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::freeShapes123()");
-
- for (int i = 123; i <= 172; ++i) {
- delete [] _shapes[i];
- _shapes[i] = 0;
+void KyraEngine_v1::setMousePos(int x, int y) {
+ if (_flags.useHiResOverlay) {
+ x <<= 1;
+ y <<= 1;
}
+ _system->warpMouse(x, y);
}
-#pragma mark -
-#pragma mark - Misc stuff
-#pragma mark -
-
-Movie *KyraEngine_v1::createWSAMovie() {
- if (_flags.platform == Common::kPlatformAmiga)
- return new WSAMovieAmiga(this);
-
- return new WSAMovieV1(this);
+int KyraEngine_v1::setGameFlag(int flag) {
+ _flagsTable[flag >> 3] |= (1 << (flag & 7));
+ return 1;
}
-void KyraEngine_v1::setBrandonPoisonFlags(int reset) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::setBrandonPoisonFlags(%d)", reset);
- _brandonStatusBit |= 1;
-
- if (reset)
- _poisonDeathCounter = 0;
-
- for (int i = 0; i < 0x100; ++i)
- _brandonPoisonFlagsGFX[i] = i;
-
- _brandonPoisonFlagsGFX[0x99] = 0x34;
- _brandonPoisonFlagsGFX[0x9A] = 0x35;
- _brandonPoisonFlagsGFX[0x9B] = 0x37;
- _brandonPoisonFlagsGFX[0x9C] = 0x38;
- _brandonPoisonFlagsGFX[0x9D] = 0x2B;
+int KyraEngine_v1::queryGameFlag(int flag) const {
+ return ((_flagsTable[flag >> 3] >> (flag & 7)) & 1);
}
-void KyraEngine_v1::resetBrandonPoisonFlags() {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::resetBrandonPoisonFlags()");
- _brandonStatusBit = 0;
-
- for (int i = 0; i < 0x100; ++i)
- _brandonPoisonFlagsGFX[i] = i;
+int KyraEngine_v1::resetGameFlag(int flag) {
+ _flagsTable[flag >> 3] &= ~(1 << (flag & 7));
+ return 0;
}
-#pragma mark -
-#pragma mark - Input
-#pragma mark -
-
-void KyraEngine_v1::processInput() {
- Common::Point mouse = getMousePos();
- int xpos = mouse.x;
- int ypos = mouse.y;
-
- debugC(9, kDebugLevelMain, "KyraEngine_v1::processInput(%d, %d)", xpos, ypos);
- _abortWalkFlag2 = false;
-
- if (processInputHelper(xpos, ypos))
- return;
-
- uint8 item = findItemAtPos(xpos, ypos);
- if (item == 0xFF) {
- _changedScene = false;
- int handled = clickEventHandler(xpos, ypos);
- if (_changedScene || handled)
- return;
- }
-
- // XXX _deathHandler specific
- if (ypos <= 158) {
- uint16 exit = 0xFFFF;
- if (xpos < 12) {
- exit = _walkBlockWest;
- } else if (xpos >= 308) {
- exit = _walkBlockEast;
- } else if (ypos >= 136) {
- exit = _walkBlockSouth;
- } else if (ypos < 12) {
- exit = _walkBlockNorth;
- }
-
- if (exit != 0xFFFF) {
- _abortWalkFlag2 = true;
- handleSceneChange(xpos, ypos, 1, 1);
- _abortWalkFlag2 = false;
- return;
- } else {
- int script = checkForNPCScriptRun(xpos, ypos);
- if (script >= 0) {
- runNpcScript(script);
- return;
- }
- if (_itemInHand != -1) {
- if (ypos < 155) {
- if (hasClickedOnExit(xpos, ypos)) {
- _abortWalkFlag2 = true;
- handleSceneChange(xpos, ypos, 1, 1);
- _abortWalkFlag2 = false;
- return;
- }
- dropItem(0, _itemInHand, xpos, ypos, 1);
- }
- } else {
- if (ypos <= 155) {
- _abortWalkFlag2 = true;
- handleSceneChange(xpos, ypos, 1, 1);
- _abortWalkFlag2 = false;
- }
- }
- }
+void KyraEngine_v1::delayUntil(uint32 timestamp, bool updateTimers, bool update, bool isMainLoop) {
+ while (_system->getMillis() < timestamp && !_quitFlag) {
+ if (timestamp - _system->getMillis() >= 10)
+ delay(10, update, isMainLoop);
}
}
-int KyraEngine_v1::processInputHelper(int xpos, int ypos) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::processInputHelper(%d, %d)", xpos, ypos);
- uint8 item = findItemAtPos(xpos, ypos);
- if (item != 0xFF) {
- if (_itemInHand == -1) {
- _screen->hideMouse();
- _animator->animRemoveGameItem(item);
- snd_playSoundEffect(53);
- assert(_currentCharacter->sceneId < _roomTableSize);
- Room *currentRoom = &_roomTable[_currentCharacter->sceneId];
- int item2 = currentRoom->itemsTable[item];
- currentRoom->itemsTable[item] = 0xFF;
- setMouseItem(item2);
- assert(_itemList && _takenList);
- updateSentenceCommand(_itemList[item2], _takenList[0], 179);
- _itemInHand = item2;
- _screen->showMouse();
- clickEventHandler2();
- return 1;
- } else {
- exchangeItemWithMouseItem(_currentCharacter->sceneId, item);
- return 1;
- }
- }
- return 0;
+void KyraEngine_v1::delay(uint32 amount, bool update, bool isMainLoop) {
+ _system->delayMillis(amount);
}
-int KyraEngine_v1::clickEventHandler(int xpos, int ypos) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::clickEventHandler(%d, %d)", xpos, ypos);
- _emc->init(&_scriptClick, &_scriptClickData);
- _scriptClick.regs[1] = xpos;
- _scriptClick.regs[2] = ypos;
- _scriptClick.regs[3] = 0;
- _scriptClick.regs[4] = _itemInHand;
- _emc->start(&_scriptClick, 1);
-
- while (_emc->isValid(&_scriptClick))
- _emc->run(&_scriptClick);
+void KyraEngine_v1::delayWithTicks(int ticks) {
+ delay(ticks * _tickLength);
+}
- return _scriptClick.regs[3];
+void KyraEngine_v1::registerDefaultSettings() {
+ if (_flags.gameID != GI_KYRA3)
+ ConfMan.registerDefault("cdaudio", (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98));
}
-void KyraEngine_v1::updateMousePointer(bool forceUpdate) {
- int shape = 0;
-
- int newMouseState = 0;
- int newX = 0;
- int newY = 0;
- Common::Point mouse = getMousePos();
- if (mouse.y <= 158) {
- if (mouse.x >= 12) {
- if (mouse.x >= 308) {
- if (_walkBlockEast == 0xFFFF) {
- newMouseState = -2;
- } else {
- newMouseState = -5;
- shape = 3;
- newX = 7;
- newY = 5;
- }
- } else if (mouse.y >= 136) {
- if (_walkBlockSouth == 0xFFFF) {
- newMouseState = -2;
- } else {
- newMouseState = -4;
- shape = 4;
- newX = 5;
- newY = 7;
- }
- } else if (mouse.y < 12) {
- if (_walkBlockNorth == 0xFFFF) {
- newMouseState = -2;
- } else {
- newMouseState = -6;
- shape = 2;
- newX = 5;
- newY = 1;
- }
- }
- } else {
- if (_walkBlockWest == 0xFFFF) {
- newMouseState = -2;
- } else {
- newMouseState = -3;
- newX = 1;
- newY = shape = 5;
- }
- }
+void KyraEngine_v1::readSettings() {
+ _configWalkspeed = ConfMan.getInt("walkspeed");
+ _configMusic = 0;
+
+ if (!ConfMan.getBool("music_mute")) {
+ _configMusic = 1;
+ if (_flags.gameID != GI_KYRA3 && ConfMan.getBool("cdaudio") && (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98))
+ _configMusic = 2;
}
+ _configSounds = ConfMan.getBool("sfx_mute") ? 0 : 1;
- if (mouse.x >= _entranceMouseCursorTracks[0] && mouse.y >= _entranceMouseCursorTracks[1]
- && mouse.x <= _entranceMouseCursorTracks[2] && mouse.y <= _entranceMouseCursorTracks[3]) {
- switch (_entranceMouseCursorTracks[4]) {
- case 0:
- newMouseState = -6;
- shape = 2;
- newX = 5;
- newY = 1;
- break;
+ if (_sound) {
+ _sound->enableMusic(_configMusic);
+ _sound->enableSFX(_configSounds);
+ }
- case 2:
- newMouseState = -5;
- shape = 3;
- newX = 7;
- newY = 5;
- break;
+ bool speechMute = ConfMan.getBool("speech_mute");
+ bool subtitles = ConfMan.getBool("subtitles");
- case 4:
- newMouseState = -4;
- shape = 4;
- newX = 5;
- newY = 7;
- break;
+ if (!speechMute && subtitles)
+ _configVoice = 2; // Voice & Text
+ else if (!speechMute && !subtitles)
+ _configVoice = 1; // Voice only
+ else
+ _configVoice = 0; // Text only
- case 6:
- newMouseState = -3;
- shape = 5;
- newX = 1;
- newY = 5;
- break;
+ setWalkspeed(_configWalkspeed);
+}
- default:
- break;
- }
+void KyraEngine_v1::writeSettings() {
+ bool speechMute, subtitles;
+
+ ConfMan.setInt("walkspeed", _configWalkspeed);
+ ConfMan.setBool("music_mute", _configMusic == 0);
+ if (_flags.gameID != GI_KYRA3)
+ ConfMan.setBool("cdaudio", _configMusic == 2);
+ ConfMan.setBool("sfx_mute", _configSounds == 0);
+
+ switch (_configVoice) {
+ case 0: // Text only
+ speechMute = true;
+ subtitles = true;
+ break;
+ case 1: // Voice only
+ speechMute = false;
+ subtitles = false;
+ break;
+ default: // Voice & Text
+ speechMute = false;
+ subtitles = true;
+ break;
}
- if (newMouseState == -2) {
- shape = 6;
- newX = 4;
- newY = 4;
+ if (_sound) {
+ if (!_configMusic)
+ _sound->beginFadeOut();
+ _sound->enableMusic(_configMusic);
+ _sound->enableSFX(_configSounds);
}
- if ((newMouseState && _mouseState != newMouseState) || (newMouseState && forceUpdate)) {
- _mouseState = newMouseState;
- _screen->hideMouse();
- _screen->setMouseCursor(newX, newY, _shapes[shape]);
- _screen->showMouse();
- }
+ ConfMan.setBool("speech_mute", speechMute);
+ ConfMan.setBool("subtitles", subtitles);
- if (!newMouseState) {
- if (_mouseState != _itemInHand || forceUpdate) {
- if (mouse.y > 158 || (mouse.x >= 12 && mouse.x < 308 && mouse.y < 136 && mouse.y >= 12) || forceUpdate) {
- _mouseState = _itemInHand;
- _screen->hideMouse();
- if (_itemInHand == -1)
- _screen->setMouseCursor(1, 1, _shapes[0]);
- else
- _screen->setMouseCursor(8, 15, _shapes[216+_itemInHand]);
- _screen->showMouse();
- }
- }
- }
+ ConfMan.flushToDisk();
}
-bool KyraEngine_v1::hasClickedOnExit(int xpos, int ypos) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::hasClickedOnExit(%d, %d)", xpos, ypos);
- if (xpos < 16 || xpos >= 304)
- return true;
-
- if (ypos < 8)
- return true;
-
- if (ypos < 136 || ypos > 155)
- return false;
-
- return true;
+bool KyraEngine_v1::speechEnabled() {
+ return _flags.isTalkie && (_configVoice == 1 || _configVoice == 2);
}
-void KyraEngine_v1::clickEventHandler2() {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::clickEventHandler2()");
-
- Common::Point mouse = getMousePos();
-
- _emc->init(&_scriptClick, &_scriptClickData);
- _scriptClick.regs[0] = _currentCharacter->sceneId;
- _scriptClick.regs[1] = mouse.x;
- _scriptClick.regs[2] = mouse.y;
- _scriptClick.regs[4] = _itemInHand;
- _emc->start(&_scriptClick, 6);
-
- while (_emc->isValid(&_scriptClick))
- _emc->run(&_scriptClick);
+bool KyraEngine_v1::textEnabled() {
+ return !_flags.isTalkie || (_configVoice == 0 || _configVoice == 2);
}
-int KyraEngine_v1::checkForNPCScriptRun(int xpos, int ypos) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::checkForNPCScriptRun(%d, %d)", xpos, ypos);
- int returnValue = -1;
- const Character *currentChar = _currentCharacter;
- int charLeft = 0, charRight = 0, charTop = 0, charBottom = 0;
-
- int scaleFactor = _scaleTable[currentChar->y1];
- int addX = (((scaleFactor*8)*3)>>8)>>1;
- int addY = ((scaleFactor*3)<<4)>>8;
-
- charLeft = currentChar->x1 - addX;
- charRight = currentChar->x1 + addX;
- charTop = currentChar->y1 - addY;
- charBottom = currentChar->y1;
-
- if (xpos >= charLeft && charRight >= xpos && charTop <= ypos && charBottom >= ypos)
- return 0;
-
- if (xpos > 304 || xpos < 16)
- return -1;
-
- for (int i = 1; i < 5; ++i) {
- currentChar = &_characterList[i];
-
- if (currentChar->sceneId != _currentCharacter->sceneId)
- continue;
-
- charLeft = currentChar->x1 - 12;
- charRight = currentChar->x1 + 11;
- charTop = currentChar->y1 - 48;
- // if (!i)
- // charBottom = currentChar->y2 - 16;
- // else
- charBottom = currentChar->y1;
-
- if (xpos < charLeft || xpos > charRight || ypos < charTop || charBottom < ypos)
- continue;
-
- if (returnValue != -1) {
- if (currentChar->y1 >= _characterList[returnValue].y1)
- returnValue = i;
- } else {
- returnValue = i;
- }
- }
-
- return returnValue;
+inline int convertValueToMixer(int value) {
+ value -= 2;
+ return (value * Audio::Mixer::kMaxMixerVolume) / 95;
}
-void KyraEngine_v1::runNpcScript(int func) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::runNpcScript(%d)", func);
- _emc->init(&_npcScript, &_npcScriptData);
- _emc->start(&_npcScript, func);
- _npcScript.regs[0] = _currentCharacter->sceneId;
- _npcScript.regs[4] = _itemInHand;
- _npcScript.regs[5] = func;
-
- while (_emc->isValid(&_npcScript))
- _emc->run(&_npcScript);
+inline int convertValueFromMixer(int value) {
+ return (value * 95) / Audio::Mixer::kMaxMixerVolume + 2;
}
-void KyraEngine_v1::checkAmuletAnimFlags() {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::checkSpecialAnimFlags()");
-
- if (_brandonStatusBit & 2) {
- seq_makeBrandonNormal2();
- _timer->setCountdown(19, 300);
- }
+void KyraEngine_v1::setVolume(kVolumeEntry vol, uint8 value) {
+ switch (vol) {
+ case kVolumeMusic:
+ ConfMan.setInt("music_volume", convertValueToMixer(value));
+ break;
- if (_brandonStatusBit & 0x20) {
- seq_makeBrandonNormal();
- _timer->setCountdown(19, 300);
+ case kVolumeSfx:
+ ConfMan.setInt("sfx_volume", convertValueToMixer(value));
+ break;
+
+ case kVolumeSpeech:
+ ConfMan.setInt("speech_volume", convertValueToMixer(value));
+ break;
}
-}
-
-#pragma mark -
-
-void KyraEngine_v1::registerDefaultSettings() {
- KyraEngine::registerDefaultSettings();
-
- // Most settings already have sensible defaults. This one, however, is
- // specific to the Kyra engine.
- ConfMan.registerDefault("walkspeed", 2);
-}
-
-void KyraEngine_v1::readSettings() {
- int talkspeed = ConfMan.getInt("talkspeed");
-
- // The default talk speed is 60. This should be mapped to "Normal".
-
- if (talkspeed == 0)
- _configTextspeed = 3; // Clickable
- if (talkspeed <= 50)
- _configTextspeed = 0; // Slow
- else if (talkspeed <= 150)
- _configTextspeed = 1; // Normal
- else
- _configTextspeed = 2; // Fast
- KyraEngine::readSettings();
+ // Resetup mixer
+ _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume"));
+ _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume"));
+ _mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, ConfMan.getInt("speech_volume"));
+ if (_sound)
+ _sound->updateVolumeSettings();
}
-void KyraEngine_v1::writeSettings() {
- int talkspeed;
-
- switch (_configTextspeed) {
- case 0: // Slow
- talkspeed = 1;
- break;
- case 1: // Normal
- talkspeed = 60;
+uint8 KyraEngine_v1::getVolume(kVolumeEntry vol) {
+ switch (vol) {
+ case kVolumeMusic:
+ return convertValueFromMixer(ConfMan.getInt("music_volume"));
break;
- case 2: // Fast
- talkspeed = 255;
+
+ case kVolumeSfx:
+ return convertValueFromMixer(ConfMan.getInt("sfx_volume"));
break;
- default: // Clickable
- talkspeed = 0;
+
+ case kVolumeSpeech:
+ if (speechEnabled())
+ return convertValueFromMixer(ConfMan.getInt("speech_volume"));
+ else
+ return 2;
break;
}
- ConfMan.setInt("talkspeed", talkspeed);
-
- KyraEngine::writeSettings();
+ return 2;
}
-} // end of namespace Kyra
+} // End of namespace Kyra
+
diff --git a/engines/kyra/kyra_v1.h b/engines/kyra/kyra_v1.h
index 50791c3ade..4f38ceca98 100644
--- a/engines/kyra/kyra_v1.h
+++ b/engines/kyra/kyra_v1.h
@@ -26,796 +26,281 @@
#ifndef KYRA_KYRA_V1_H
#define KYRA_KYRA_V1_H
-#include "kyra/kyra.h"
+#include "engines/engine.h"
+
+#include "common/array.h"
+#include "common/events.h"
+
#include "kyra/script.h"
-#include "kyra/screen_v1.h"
-#include "kyra/gui_v1.h"
+
+namespace Common {
+class InSaveFile;
+class OutSaveFile;
+} // end of namespace Common
+
+class KyraMetaEngine;
namespace Kyra {
-class Movie;
-class SoundDigital;
-class SeqPlayer;
-class Sprites;
-class Debugger;
-class Animator_v1;
-class TextDisplayer;
-class KyraEngine_v1;
-
-struct Character {
- uint16 sceneId;
- uint8 height;
- uint8 facing;
- uint16 currentAnimFrame;
- uint8 inventoryItems[10];
- int16 x1, y1, x2, y2;
-};
+struct GameFlags {
+ Common::Language lang;
+ Common::Platform platform;
-struct Shape {
- uint8 imageIndex;
- int8 xOffset, yOffset;
- uint8 x, y, w, h;
-};
+ bool isDemo : 1;
+ bool useAltShapeHeader : 1; // alternative shape header (uses 2 bytes more, those are unused though)
+ bool isTalkie : 1;
+ bool useHiResOverlay : 1;
+ bool useDigSound : 1;
+ bool useInstallerPackage : 1;
-struct Room {
- uint8 nameIndex;
- uint16 northExit;
- uint16 eastExit;
- uint16 southExit;
- uint16 westExit;
- uint8 itemsTable[12];
- uint16 itemsXPos[12];
- uint8 itemsYPos[12];
- uint8 needInit[12];
+ byte gameID;
};
-struct Item {
- uint8 unk1;
- uint8 height;
- uint8 unk2;
- uint8 unk3;
+enum {
+ GI_KYRA1 = 0,
+ GI_KYRA2 = 1,
+ GI_KYRA3 = 2
};
-struct SeqLoop {
- const uint8 *ptr;
- uint16 count;
+struct AudioDataStruct {
+ const char * const *_fileList;
+ const int _fileListLen;
+ const void * const _cdaTracks;
+ const int _cdaNumTracks;
};
-struct SceneExits {
- uint16 northXPos;
- uint8 northYPos;
- uint16 eastXPos;
- uint8 eastYPos;
- uint16 southXPos;
- uint8 southYPos;
- uint16 westXPos;
- uint8 westYPos;
+// TODO: this is just the start of makeing the debug output of the kyra engine a bit more useable
+// in the future we maybe merge some flags and/or create new ones
+enum kDebugLevels {
+ kDebugLevelScriptFuncs = 1 << 0, // prints debug output of o#_* functions
+ kDebugLevelScript = 1 << 1, // prints debug output of "EMCInterpreter" functions
+ kDebugLevelSprites = 1 << 2, // prints debug output of "Sprites" functions
+ kDebugLevelScreen = 1 << 3, // prints debug output of "Screen" functions
+ kDebugLevelSound = 1 << 4, // prints debug output of "Sound" functions
+ kDebugLevelAnimator = 1 << 5, // prints debug output of "ScreenAnimator" functions
+ kDebugLevelMain = 1 << 6, // prints debug output of common "KyraEngine(_v#)" functions && "TextDisplayer" functions
+ kDebugLevelGUI = 1 << 7, // prints debug output of "KyraEngine*" gui functions
+ kDebugLevelSequence = 1 << 8, // prints debug output of "SeqPlayer" functions
+ kDebugLevelMovie = 1 << 9, // prints debug output of movie specific funtions
+ kDebugLevelTimer = 1 << 10 // prints debug output of "TimerManager" functions
};
-struct BeadState {
- int16 x;
- int16 y;
- int16 width;
- int16 height;
- int16 dstX;
- int16 dstY;
- int16 width2;
- int16 unk8;
- int16 unk9;
- int16 tableIndex;
+enum kMusicDataID {
+ kMusicIntro = 0,
+ kMusicIngame,
+ kMusicFinale
};
-class KyraEngine_v1 : public KyraEngine {
- friend class MusicPlayer;
- friend class Debugger_v1;
- friend class Animator_v1;
- friend class GUI_v1;
+class Screen;
+class Resource;
+class Sound;
+class Movie;
+class TextDisplayer;
+class StaticResource;
+class TimerManager;
+class Debugger;
+
+class KyraEngine_v1 : public Engine {
+friend class Debugger;
+friend class ::KyraMetaEngine;
+friend class GUI;
public:
KyraEngine_v1(OSystem *system, const GameFlags &flags);
- ~KyraEngine_v1();
+ virtual ~KyraEngine_v1();
+
+ ::GUI::Debugger *getDebugger();
- Screen *screen() { return _screen; }
- Animator_v1 *animator() { return _animator; }
- virtual Movie *createWSAMovie();
+ virtual void pauseEngineIntern(bool pause);
- uint8 **shapes() { return _shapes; }
- Character *currentCharacter() { return _currentCharacter; }
- Character *characterList() { return _characterList; }
- uint16 brandonStatus() { return _brandonStatusBit; }
+ bool quit() const { return _quitFlag; }
- // TODO: remove me with workaround in animator.cpp l209
- uint16 getScene() { return _currentRoom; }
+ uint8 game() const { return _flags.gameID; }
+ const GameFlags &gameFlags() const { return _flags; }
- int _paletteChanged;
- int16 _northExitHeight;
+ // access to Kyra specific functionallity
+ Resource *resource() { return _res; }
+ virtual Screen *screen() = 0;
+ virtual TextDisplayer *text() { return _text; }
+ Sound *sound() { return _sound; }
+ StaticResource *staticres() { return _staticres; }
+ TimerManager *timer() { return _timer; }
- typedef void (KyraEngine_v1::*IntroProc)();
+ uint32 tickLength() const { return _tickLength; }
- // static data access
- const char * const*seqWSATable() { return _seq_WSATable; }
- const char * const*seqCPSTable() { return _seq_CPSTable; }
- const char * const*seqCOLTable() { return _seq_COLTable; }
- const char * const*seqTextsTable() { return _seq_textsTable; }
+ Common::RandomSource _rnd;
- const uint8 * const*palTable1() { return &_specialPalettes[0]; }
- const uint8 * const*palTable2() { return &_specialPalettes[29]; }
+ // input
+ void setMousePos(int x, int y);
+ Common::Point getMousePos() const;
+
+ // config specific
+ bool speechEnabled();
+ bool textEnabled();
+
+ enum kVolumeEntry {
+ kVolumeMusic = 0,
+ kVolumeSfx = 1,
+ kVolumeSpeech = 2
+ };
+
+ // volume reaches from 2 to 97
+ void setVolume(kVolumeEntry vol, uint8 value);
+ uint8 getVolume(kVolumeEntry vol);
+
+ // quit handling
+ virtual void quitGame();
+
+ // game flag handling
+ int setGameFlag(int flag);
+ int queryGameFlag(int flag) const;
+ int resetGameFlag(int flag);
+
+ // sound
+ virtual void snd_playTheme(int file, int track);
+ virtual void snd_playSoundEffect(int id, int volume=0xFF);
+ virtual void snd_playWanderScoreViaMap(int command, int restart);
+ virtual void snd_playVoiceFile(int id) = 0;
+ virtual bool snd_voiceIsPlaying();
+ virtual void snd_stopVoice();
+
+ // delay functionallity
+ virtual void delayUntil(uint32 timestamp, bool updateGameTimers = false, bool update = false, bool isMainLoop = false);
+ virtual void delay(uint32 millis, bool update = false, bool isMainLoop = false);
+ virtual void delayWithTicks(int ticks);
protected:
- virtual int go();
+ virtual int go() = 0;
virtual int init();
-public:
- // sequences
- // -> misc
- bool seq_skipSequence() const;
-protected:
- // -> demo
- void seq_demo();
-
- // -> intro
- void seq_intro();
- void seq_introLogos();
- void seq_introStory();
- void seq_introMalcolmTree();
- void seq_introKallakWriting();
- void seq_introKallakMalcolm();
-
- // -> ingame animations
- void seq_createAmuletJewel(int jewel, int page, int noSound, int drawOnly);
- void seq_brandonHealing();
- void seq_brandonHealing2();
- void seq_poisonDeathNow(int now);
- void seq_poisonDeathNowAnim();
- void seq_playFluteAnimation();
- void seq_winterScroll1();
- void seq_winterScroll2();
- void seq_makeBrandonInv();
- void seq_makeBrandonNormal();
- void seq_makeBrandonNormal2();
- void seq_makeBrandonWisp();
- void seq_dispelMagicAnimation();
- void seq_fillFlaskWithWater(int item, int type);
- void seq_playDrinkPotionAnim(int item, int unk2, int flags);
- void seq_brandonToStone();
-
- // -> end fight
- int seq_playEnd();
- void seq_playEnding();
-
- int handleMalcolmFlag();
- int handleBeadState();
- void initBeadState(int x, int y, int x2, int y2, int unk1, BeadState *ptr);
- int processBead(int x, int y, int &x2, int &y2, BeadState *ptr);
-
- // -> credits
- void seq_playCredits();
+ // quit Handling
+ bool _quitFlag;
-public:
- // delay
- void delayUntil(uint32 timestamp, bool updateGameTimers = false, bool update = false, bool isMainLoop = false);
- void delay(uint32 millis, bool update = false, bool isMainLoop = false);
- void delayWithTicks(int ticks);
- void waitForEvent();
-
- // TODO
- void registerDefaultSettings();
- void readSettings();
- void writeSettings();
-
- void snd_playSoundEffect(int track, int volume=0xFF);
- void snd_playWanderScoreViaMap(int command, int restart);
- virtual void snd_playVoiceFile(int id);
- void snd_voiceWaitForFinish(bool ingame = true);
+ // intern
+ Resource *_res;
+ Sound *_sound;
+ TextDisplayer *_text;
+ StaticResource *_staticres;
+ TimerManager *_timer;
+ EMCInterpreter *_emc;
+ Debugger *_debugger;
-protected:
- void saveGame(const char *fileName, const char *saveName);
- void loadGame(const char *fileName);
+ // config specific
+ virtual void registerDefaultSettings();
+ virtual void readSettings();
+ virtual void writeSettings();
-protected:
- // input
- void processInput();
- int processInputHelper(int xpos, int ypos);
- int clickEventHandler(int xpos, int ypos);
- void clickEventHandler2();
- void updateMousePointer(bool forceUpdate = false);
- bool hasClickedOnExit(int xpos, int ypos);
-
- bool _skipFlag;
- bool skipFlag() const { return _skipFlag; }
- void resetSkipFlag(bool removeEvent = true) { _skipFlag = false; }
-
- // scene
- // -> init
- void loadSceneMsc();
- void startSceneScript(int brandonAlive);
- void setupSceneItems();
- void initSceneData(int facing, int unk1, int brandonAlive);
- void initSceneObjectList(int brandonAlive);
- void initSceneScreen(int brandonAlive);
- void setupSceneResource(int sceneId);
-
- // -> process
- void enterNewScene(int sceneId, int facing, int unk1, int unk2, int brandonAlive);
- int handleSceneChange(int xpos, int ypos, int unk1, int frameReset);
- int processSceneChange(int *table, int unk1, int frameReset);
- int changeScene(int facing);
-
- // -> modification
- void transcendScenes(int roomIndex, int roomName);
- void setSceneFile(int roomIndex, int roomName);
-
- // -> pathfinder
- int findWay(int x, int y, int toX, int toY, int *moveTable, int moveTableSize);
- bool lineIsPassable(int x, int y);
-
- // -> item handling
- // --> misc
- void addItemToRoom(uint16 sceneId, uint8 item, int itemIndex, int x, int y);
-
- // --> drop handling
- void itemDropDown(int x, int y, int destX, int destY, byte freeItem, int item);
- int processItemDrop(uint16 sceneId, uint8 item, int x, int y, int unk1, int unk2);
- void dropItem(int unk1, int item, int x, int y, int unk2);
-
- // --> dropped item handling
- int countItemsInScene(uint16 sceneId);
- void exchangeItemWithMouseItem(uint16 sceneId, int itemIndex);
- byte findFreeItemInScene(int scene);
- byte findItemAtPos(int x, int y);
-
- // --> drop area handling
- void addToNoDropRects(int x, int y, int w, int h);
- void clearNoDropRects();
- int isDropable(int x, int y);
- int checkNoDropRects(int x, int y);
-
- // --> player items handling
- void updatePlayerItemsForScene();
-
- // --> item GFX handling
- void backUpItemRect0(int xpos, int ypos);
- void restoreItemRect0(int xpos, int ypos);
- void backUpItemRect1(int xpos, int ypos);
- void restoreItemRect1(int xpos, int ypos);
+ uint8 _configWalkspeed;
- // items
- // -> misc
- void placeItemInGenericMapScene(int item, int index);
-
- // -> mouse item
- void createMouseItem(int item);
- void destroyMouseItem();
- void setMouseItem(int item);
-
- // -> graphics effects
- void wipeDownMouseItem(int xpos, int ypos);
- void itemSpecialFX(int x, int y, int item);
- void itemSpecialFX1(int x, int y, int item);
- void itemSpecialFX2(int x, int y, int item);
- void magicOutMouseItem(int animIndex, int itemPos);
- void magicInMouseItem(int animIndex, int item, int itemPos);
- void specialMouseItemFX(int shape, int x, int y, int animIndex, int tableIndex, int loopStart, int maxLoops);
- void processSpecialMouseItemFX(int shape, int x, int y, int tableValue, int loopStart, int maxLoops);
-
- // character
- // -> movement
- void moveCharacterToPos(int character, int facing, int xpos, int ypos);
- void setCharacterPositionWithUpdate(int character);
- int setCharacterPosition(int character, int *facingTable);
- void setCharacterPositionHelper(int character, int *facingTable);
- void setCharactersPositions(int character);
-
- // -> brandon
- void setBrandonPoisonFlags(int reset);
- void resetBrandonPoisonFlags();
-
- // chat
- // -> process
- void characterSays(int vocFile, const char *chatStr, int8 charNum, int8 chatDuration);
- void waitForChatToFinish(int vocFile, int16 chatDuration, const char *str, uint8 charNum);
-
- // -> initialization
- int initCharacterChat(int8 charNum);
- void backupChatPartnerAnimFrame(int8 charNum);
- void restoreChatPartnerAnimFrame(int8 charNum);
- int8 getChatPartnerNum();
-
- // -> deinitialization
- void endCharacterChat(int8 charNum, int16 arg_4);
-
- // graphics
- // -> misc
- int findDuplicateItemShape(int shape);
- void updateKyragemFading();
-
- // -> interface
- void loadMainScreen(int page = 3);
- void redrawInventory(int page);
-public:
- void drawSentenceCommand(const char *sentence, int unk1);
- void updateSentenceCommand(const char *str1, const char *str2, int unk1);
- void updateTextFade();
+ int _configMusic;
+ bool _configSounds;
+ uint8 _configVoice;
-protected:
- // -> amulet
- void drawJewelPress(int jewel, int drawSpecial);
- void drawJewelsFadeOutStart();
- void drawJewelsFadeOutEnd(int jewel);
-
- // -> shape handling
- void setupShapes123(const Shape *shapeTable, int endShape, int flags);
- void freeShapes123();
-
- // misc (TODO)
- void startup();
- void mainLoop();
-
- int checkForNPCScriptRun(int xpos, int ypos);
- void runNpcScript(int func);
-
- void loadMouseShapes();
- void loadCharacterShapes();
- void loadSpecialEffectShapes();
- void loadItems();
- void loadButtonShapes();
- void initMainButtonList();
- void setCharactersInDefaultScene();
- void setupPanPages();
- void freePanPages();
- void closeFinalWsa();
-
- //void setTimer19();
- void setupTimers();
- void timerUpdateHeadAnims(int timerNum);
- void timerSetFlags1(int timerNum);
- void timerSetFlags2(int timerNum);
- void timerSetFlags3(int timerNum);
- void timerCheckAnimFlag1(int timerNum);
- void timerCheckAnimFlag2(int timerNum);
- void checkAmuletAnimFlags();
- void timerRedrawAmulet(int timerNum);
- void timerFadeText(int timerNum);
- void updateAnimFlag1(int timerNum);
- void updateAnimFlag2(int timerNum);
- void drawAmulet();
- void setTextFadeTimerCountdown(int16 countdown);
- void setWalkspeed(uint8 newSpeed);
-
- int buttonInventoryCallback(Button *caller);
- int buttonAmuletCallback(Button *caller);
-
- bool _skipIntroFlag;
- bool _abortIntroFlag;
- bool _menuDirectlyToLoad;
- bool _abortWalkFlag;
- bool _abortWalkFlag2;
- bool _mousePressFlag;
- uint8 *_itemBkgBackUp[2];
- uint8 *_shapes[373];
- int8 _itemInHand;
- int _mouseState;
- bool _handleInput;
- bool _changedScene;
- int _unkScreenVar1, _unkScreenVar2, _unkScreenVar3;
- int _beadStateVar;
- int _unkAmuletVar;
-
- int _malcolmFlag;
- int _endSequenceSkipFlag;
- int _endSequenceNeedLoading;
- int _unkEndSeqVar2;
- uint8 *_endSequenceBackUpRect;
- int _unkEndSeqVar4;
- int _unkEndSeqVar5;
- int _lastDisplayedPanPage;
- uint8 *_panPagesTable[20];
- Movie *_finalA, *_finalB, *_finalC;
-
- Movie *_movieObjects[10];
-
- uint16 _entranceMouseCursorTracks[8];
- uint16 _walkBlockNorth;
- uint16 _walkBlockEast;
- uint16 _walkBlockSouth;
- uint16 _walkBlockWest;
-
- int32 _scaleMode;
- int16 _scaleTable[145];
-
- Rect _noDropRects[11];
-
- int8 _birthstoneGemTable[4];
- int8 _idolGemsTable[3];
-
- int8 _marbleVaseItem;
- int8 _foyerItemTable[3];
-
- int8 _cauldronState;
- int8 _crystalState[2];
-
- uint16 _brandonStatusBit;
- uint8 _brandonStatusBit0x02Flag;
- uint8 _brandonStatusBit0x20Flag;
- uint8 _brandonPoisonFlagsGFX[256];
- uint8 _deathHandler;
- int16 _brandonInvFlag;
- uint8 _poisonDeathCounter;
- int _brandonPosX;
- int _brandonPosY;
-
- uint16 _currentChatPartnerBackupFrame;
- uint16 _currentCharAnimFrame;
-
- int8 *_sceneAnimTable[50];
-
- Item _itemTable[145];
- int _lastProcessedItem;
- int _lastProcessedItemHeight;
-
- int16 *_exitListPtr;
- int16 _exitList[11];
- SceneExits _sceneExits;
- uint16 _currentRoom;
- int _scenePhasingFlag;
-
- int _sceneChangeState;
- int _loopFlag2;
-
- int _pathfinderFlag;
- int _pathfinderFlag2;
- int _lastFindWayRet;
- int *_movFacingTable;
-
- int8 _talkingCharNum;
- int8 _charSayUnk2;
- int8 _charSayUnk3;
- int8 _currHeadShape;
- uint8 _currSentenceColor[3];
- int8 _startSentencePalIndex;
- bool _fadeText;
-
- uint8 _configTextspeed;
-
- Animator_v1 *_animator;
- SeqPlayer *_seq;
- Sprites *_sprites;
- Screen_v1 *_screen;
- Debugger *_debugger;
+ // game speed
+ virtual bool skipFlag() const = 0;
+ virtual void resetSkipFlag(bool removeEvent = true) = 0;
- EMCState _scriptMain;
-
- EMCState _npcScript;
- EMCData _npcScriptData;
-
- EMCState _scriptClick;
- EMCData _scriptClickData;
-
- Character *_characterList;
- Character *_currentCharacter;
-
- Button *_buttonList;
- GUI_v1 *_gui;
-
- struct KyragemState {
- uint16 nextOperation;
- uint16 rOffset;
- uint16 gOffset;
- uint16 bOffset;
- uint32 timerCount;
- } _kyragemFadingState;
-
- static const int8 _dosTrackMap[];
- static const int _dosTrackMapSize;
-
- // TODO: get rid of all variables having pointers to the static resources if possible
- // i.e. let them directly use the _staticres functions
- void initStaticResource();
-
- const uint8 *_seq_Forest;
- const uint8 *_seq_KallakWriting;
- const uint8 *_seq_KyrandiaLogo;
- const uint8 *_seq_KallakMalcolm;
- const uint8 *_seq_MalcolmTree;
- const uint8 *_seq_WestwoodLogo;
- const uint8 *_seq_Demo1;
- const uint8 *_seq_Demo2;
- const uint8 *_seq_Demo3;
- const uint8 *_seq_Demo4;
- const uint8 *_seq_Reunion;
-
- const char * const*_seq_WSATable;
- const char * const*_seq_CPSTable;
- const char * const*_seq_COLTable;
- const char * const*_seq_textsTable;
-
- int _seq_WSATable_Size;
- int _seq_CPSTable_Size;
- int _seq_COLTable_Size;
- int _seq_textsTable_Size;
-
- const char * const*_itemList;
- const char * const*_takenList;
- const char * const*_placedList;
- const char * const*_droppedList;
- const char * const*_noDropList;
- const char * const*_putDownFirst;
- const char * const*_waitForAmulet;
- const char * const*_blackJewel;
- const char * const*_poisonGone;
- const char * const*_healingTip;
- const char * const*_thePoison;
- const char * const*_fluteString;
- const char * const*_wispJewelStrings;
- const char * const*_magicJewelString;
- const char * const*_flaskFull;
- const char * const*_fullFlask;
- const char * const*_veryClever;
- const char * const*_homeString;
- const char * const*_newGameString;
-
- int _itemList_Size;
- int _takenList_Size;
- int _placedList_Size;
- int _droppedList_Size;
- int _noDropList_Size;
- int _putDownFirst_Size;
- int _waitForAmulet_Size;
- int _blackJewel_Size;
- int _poisonGone_Size;
- int _healingTip_Size;
- int _thePoison_Size;
- int _fluteString_Size;
- int _wispJewelStrings_Size;
- int _magicJewelString_Size;
- int _flaskFull_Size;
- int _fullFlask_Size;
- int _veryClever_Size;
- int _homeString_Size;
- int _newGameString_Size;
-
- const char * const*_characterImageTable;
- int _characterImageTableSize;
-
- const char * const*_guiStrings;
- int _guiStringsSize;
-
- const char * const*_configStrings;
- int _configStringsSize;
-
- Shape *_defaultShapeTable;
- int _defaultShapeTableSize;
-
- const Shape *_healingShapeTable;
- int _healingShapeTableSize;
- const Shape *_healingShape2Table;
- int _healingShape2TableSize;
-
- const Shape *_posionDeathShapeTable;
- int _posionDeathShapeTableSize;
-
- const Shape *_fluteAnimShapeTable;
- int _fluteAnimShapeTableSize;
-
- const Shape *_winterScrollTable;
- int _winterScrollTableSize;
- const Shape *_winterScroll1Table;
- int _winterScroll1TableSize;
- const Shape *_winterScroll2Table;
- int _winterScroll2TableSize;
-
- const Shape *_drinkAnimationTable;
- int _drinkAnimationTableSize;
-
- const Shape *_brandonToWispTable;
- int _brandonToWispTableSize;
-
- const Shape *_magicAnimationTable;
- int _magicAnimationTableSize;
-
- const Shape *_brandonStoneTable;
- int _brandonStoneTableSize;
-
- Room *_roomTable;
- int _roomTableSize;
- const char * const*_roomFilenameTable;
- int _roomFilenameTableSize;
-
- const uint8 *_amuleteAnim;
-
- const uint8 * const*_specialPalettes;
-
- const char *const *_soundFiles;
- int _soundFilesSize;
- const char *const *_soundFilesIntro;
- int _soundFilesIntroSize;
- const int32 *_cdaTrackTable;
- int _cdaTrackTableSize;
- const AudioDataStruct * _soundData;
-
- static const int8 _charXPosTable[];
- static const int8 _charYPosTable[];
-
- // positions of the inventory
- static const uint16 _itemPosX[];
- static const uint8 _itemPosY[];
-
- void setupButtonData();
- Button *_buttonData;
- Button **_buttonDataListPtr;
-
- static const uint8 _magicMouseItemStartFrame[];
- static const uint8 _magicMouseItemEndFrame[];
- static const uint8 _magicMouseItemStartFrame2[];
- static const uint8 _magicMouseItemEndFrame2[];
-
- static const uint16 _amuletX[];
- static const uint16 _amuletY[];
- static const uint16 _amuletX2[];
- static const uint16 _amuletY2[];
-protected:
- void setupOpcodeTable();
+ uint16 _tickLength;
+ uint16 _gameSpeed;
+
+ // run
+ int8 _deathHandler;
+
+ // timer
+ virtual void setupTimers() = 0;
+
+ virtual void setWalkspeed(uint8 speed) = 0;
+
+ // detection
+ GameFlags _flags;
+ int _lang;
+
+ // opcode
+ virtual void setupOpcodeTable() = 0;
+ Common::Array<const Opcode*> _opcodes;
- // Opcodes
- int o1_magicInMouseItem(EMCState *script);
- int o1_characterSays(EMCState *script);
- int o1_pauseTicks(EMCState *script);
- int o1_drawSceneAnimShape(EMCState *script);
int o1_queryGameFlag(EMCState *script);
int o1_setGameFlag(EMCState *script);
int o1_resetGameFlag(EMCState *script);
- int o1_runNPCScript(EMCState *script);
- int o1_setSpecialExitList(EMCState *script);
- int o1_blockInWalkableRegion(EMCState *script);
- int o1_blockOutWalkableRegion(EMCState *script);
- int o1_walkPlayerToPoint(EMCState *script);
- int o1_dropItemInScene(EMCState *script);
- int o1_drawAnimShapeIntoScene(EMCState *script);
- int o1_createMouseItem(EMCState *script);
- int o1_savePageToDisk(EMCState *script);
- int o1_sceneAnimOn(EMCState *script);
- int o1_sceneAnimOff(EMCState *script);
- int o1_getElapsedSeconds(EMCState *script);
- int o1_mouseIsPointer(EMCState *script);
- int o1_destroyMouseItem(EMCState *script);
- int o1_runSceneAnimUntilDone(EMCState *script);
- int o1_fadeSpecialPalette(EMCState *script);
- int o1_playAdlibSound(EMCState *script);
- int o1_playAdlibScore(EMCState *script);
- int o1_phaseInSameScene(EMCState *script);
- int o1_setScenePhasingFlag(EMCState *script);
- int o1_resetScenePhasingFlag(EMCState *script);
- int o1_queryScenePhasingFlag(EMCState *script);
- int o1_sceneToDirection(EMCState *script);
- int o1_setBirthstoneGem(EMCState *script);
- int o1_placeItemInGenericMapScene(EMCState *script);
- int o1_setBrandonStatusBit(EMCState *script);
- int o1_pauseSeconds(EMCState *script);
- int o1_getCharactersLocation(EMCState *script);
- int o1_runNPCSubscript(EMCState *script);
- int o1_magicOutMouseItem(EMCState *script);
- int o1_internalAnimOn(EMCState *script);
- int o1_forceBrandonToNormal(EMCState *script);
- int o1_poisonDeathNow(EMCState *script);
- int o1_setScaleMode(EMCState *script);
- int o1_openWSAFile(EMCState *script);
- int o1_closeWSAFile(EMCState *script);
- int o1_runWSAFromBeginningToEnd(EMCState *script);
- int o1_displayWSAFrame(EMCState *script);
- int o1_enterNewScene(EMCState *script);
- int o1_setSpecialEnterXAndY(EMCState *script);
- int o1_runWSAFrames(EMCState *script);
- int o1_popBrandonIntoScene(EMCState *script);
- int o1_restoreAllObjectBackgrounds(EMCState *script);
- int o1_setCustomPaletteRange(EMCState *script);
- int o1_loadPageFromDisk(EMCState *script);
- int o1_customPrintTalkString(EMCState *script);
- int o1_restoreCustomPrintBackground(EMCState *script);
+ int o1_getRand(EMCState *script);
int o1_hideMouse(EMCState *script);
int o1_showMouse(EMCState *script);
- int o1_getCharacterX(EMCState *script);
- int o1_getCharacterY(EMCState *script);
- int o1_changeCharactersFacing(EMCState *script);
- int o1_copyWSARegion(EMCState *script);
- int o1_printText(EMCState *script);
- int o1_random(EMCState *script);
- int o1_loadSoundFile(EMCState *script);
- int o1_displayWSAFrameOnHidPage(EMCState *script);
- int o1_displayWSASequentialFrames(EMCState *script);
- int o1_drawCharacterStanding(EMCState *script);
- int o1_internalAnimOff(EMCState *script);
- int o1_changeCharactersXAndY(EMCState *script);
- int o1_clearSceneAnimatorBeacon(EMCState *script);
- int o1_querySceneAnimatorBeacon(EMCState *script);
- int o1_refreshSceneAnimator(EMCState *script);
- int o1_placeItemInOffScene(EMCState *script);
- int o1_wipeDownMouseItem(EMCState *script);
- int o1_placeCharacterInOtherScene(EMCState *script);
- int o1_getKey(EMCState *script);
- int o1_specificItemInInventory(EMCState *script);
- int o1_popMobileNPCIntoScene(EMCState *script);
- int o1_mobileCharacterInScene(EMCState *script);
- int o1_hideMobileCharacter(EMCState *script);
- int o1_unhideMobileCharacter(EMCState *script);
- int o1_setCharactersLocation(EMCState *script);
- int o1_walkCharacterToPoint(EMCState *script);
- int o1_specialEventDisplayBrynnsNote(EMCState *script);
- int o1_specialEventRemoveBrynnsNote(EMCState *script);
- int o1_setLogicPage(EMCState *script);
- int o1_fatPrint(EMCState *script);
- int o1_preserveAllObjectBackgrounds(EMCState *script);
- int o1_updateSceneAnimations(EMCState *script);
- int o1_sceneAnimationActive(EMCState *script);
- int o1_setCharactersMovementDelay(EMCState *script);
- int o1_getCharactersFacing(EMCState *script);
- int o1_bkgdScrollSceneAndMasksRight(EMCState *script);
- int o1_dispelMagicAnimation(EMCState *script);
- int o1_findBrightestFireberry(EMCState *script);
- int o1_setFireberryGlowPalette(EMCState *script);
- int o1_setDeathHandlerFlag(EMCState *script);
- int o1_drinkPotionAnimation(EMCState *script);
- int o1_makeAmuletAppear(EMCState *script);
- int o1_drawItemShapeIntoScene(EMCState *script);
- int o1_setCharactersCurrentFrame(EMCState *script);
- int o1_waitForConfirmationMouseClick(EMCState *script);
- int o1_pageFlip(EMCState *script);
- int o1_setSceneFile(EMCState *script);
- int o1_getItemInMarbleVase(EMCState *script);
- int o1_setItemInMarbleVase(EMCState *script);
- int o1_addItemToInventory(EMCState *script);
- int o1_intPrint(EMCState *script);
- int o1_shakeScreen(EMCState *script);
- int o1_createAmuletJewel(EMCState *script);
- int o1_setSceneAnimCurrXY(EMCState *script);
- int o1_poisonBrandonAndRemaps(EMCState *script);
- int o1_fillFlaskWithWater(EMCState *script);
- int o1_getCharactersMovementDelay(EMCState *script);
- int o1_getBirthstoneGem(EMCState *script);
- int o1_queryBrandonStatusBit(EMCState *script);
- int o1_playFluteAnimation(EMCState *script);
- int o1_playWinterScrollSequence(EMCState *script);
- int o1_getIdolGem(EMCState *script);
- int o1_setIdolGem(EMCState *script);
- int o1_totalItemsInScene(EMCState *script);
- int o1_restoreBrandonsMovementDelay(EMCState *script);
int o1_setMousePos(EMCState *script);
+ int o1_setHandItem(EMCState *script);
+ int o1_removeHandItem(EMCState *script);
int o1_getMouseState(EMCState *script);
- int o1_setEntranceMouseCursorTrack(EMCState *script);
- int o1_itemAppearsOnGround(EMCState *script);
- int o1_setNoDrawShapesFlag(EMCState *script);
- int o1_fadeEntirePalette(EMCState *script);
- int o1_itemOnGroundHere(EMCState *script);
- int o1_queryCauldronState(EMCState *script);
- int o1_setCauldronState(EMCState *script);
- int o1_queryCrystalState(EMCState *script);
- int o1_setCrystalState(EMCState *script);
- int o1_setPaletteRange(EMCState *script);
- int o1_shrinkBrandonDown(EMCState *script);
- int o1_growBrandonUp(EMCState *script);
- int o1_setBrandonScaleXAndY(EMCState *script);
- int o1_resetScaleMode(EMCState *script);
- int o1_getScaleDepthTableValue(EMCState *script);
- int o1_setScaleDepthTableValue(EMCState *script);
- int o1_message(EMCState *script);
- int o1_checkClickOnNPC(EMCState *script);
- int o1_getFoyerItem(EMCState *script);
- int o1_setFoyerItem(EMCState *script);
- int o1_setNoItemDropRegion(EMCState *script);
- int o1_walkMalcolmOn(EMCState *script);
- int o1_passiveProtection(EMCState *script);
- int o1_setPlayingLoop(EMCState *script);
- int o1_brandonToStoneSequence(EMCState *script);
- int o1_brandonHealingSequence(EMCState *script);
- int o1_protectCommandLine(EMCState *script);
- int o1_pauseMusicSeconds(EMCState *script);
- int o1_resetMaskRegion(EMCState *script);
- int o1_setPaletteChangeFlag(EMCState *script);
+ int o1_setDeathHandler(EMCState *script);
+ int o1_playWanderScoreViaMap(EMCState *script);
int o1_fillRect(EMCState *script);
- int o1_dummy(EMCState *script);
- int o1_vocUnload(EMCState *script);
- int o1_vocLoad(EMCState *script);
+ int o1_blockInWalkableRegion(EMCState *script);
+ int o1_blockOutWalkableRegion(EMCState *script);
+ int o1_playSoundEffect(EMCState *script);
+
+ // items
+ int _mouseState;
+
+ virtual void setHandItem(uint16 item) = 0;
+ virtual void removeHandItem() = 0;
+
+ // game flags
+ uint8 _flagsTable[100]; // TODO: check this value
+
+ // sound
+ Common::String _speechFile;
+
+ int _curMusicTheme;
+ int _curSfxFile;
+ int16 _lastMusicCommand;
+
+ const int8 *_trackMap;
+ int _trackMapSize;
+
+ // pathfinder
+ virtual int findWay(int x, int y, int toX, int toY, int *moveTable, int moveTableSize);
+ int findSubPath(int x, int y, int toX, int toY, int *moveTable, int start, int end);
+ int getFacingFromPointToPoint(int x, int y, int toX, int toY);
+ int getOppositeFacingDirection(int dir);
+ void changePosTowardsFacing(int &x, int &y, int facing);
+ int getMoveTableSize(int *moveTable);
+ virtual bool lineIsPassable(int x, int y) = 0;
+
+ static const int8 _addXPosTable[];
+ static const int8 _addYPosTable[];
+
+ // Character
+
+ static const int8 _charAddXPosTable[];
+ static const int8 _charAddYPosTable[];
+
+ // save/load
+ int _gameToLoad;
+
+ const char *getSavegameFilename(int num);
+ bool saveFileLoadable(int slot);
+
+ struct SaveHeader {
+ Common::String description;
+ uint32 version;
+ byte gameID;
+ uint32 flags;
+
+ bool originalSave; // savegame from original interpreter
+ bool oldHeader; // old scummvm save header
+ };
+
+ enum kReadSaveHeaderError {
+ kRSHENoError = 0,
+ kRSHEInvalidType = 1,
+ kRSHEInvalidVersion = 2,
+ kRSHEIoError = 3
+ };
+
+ static kReadSaveHeaderError readSaveHeader(Common::InSaveFile *file, SaveHeader &header);
+
+ Common::InSaveFile *openSaveForReading(const char *filename, SaveHeader &header);
+ Common::OutSaveFile *openSaveForWriting(const char *filename, const char *saveName) const;
};
-} // end of namespace Kyra
+} // End of namespace Kyra
#endif
diff --git a/engines/kyra/kyra_v2.cpp b/engines/kyra/kyra_v2.cpp
index 176f8e4e2f..12da338843 100644
--- a/engines/kyra/kyra_v2.cpp
+++ b/engines/kyra/kyra_v2.cpp
@@ -29,7 +29,7 @@
namespace Kyra {
-KyraEngine_v2::KyraEngine_v2(OSystem *system, const GameFlags &flags, const EngineDesc &desc) : KyraEngine(system, flags), _desc(desc) {
+KyraEngine_v2::KyraEngine_v2(OSystem *system, const GameFlags &flags, const EngineDesc &desc) : KyraEngine_v1(system, flags), _desc(desc) {
memset(&_sceneAnims, 0, sizeof(_sceneAnims));
memset(&_sceneAnimMovie, 0, sizeof(_sceneAnimMovie));
@@ -64,18 +64,25 @@ KyraEngine_v2::KyraEngine_v2(OSystem *system, const GameFlags &flags, const Engi
memset(_hiddenItems, -1, sizeof(_hiddenItems));
- _debugger = 0;
_screenBuffer = 0;
+
+ memset(&_mainCharacter, 0, sizeof(_mainCharacter));
+ memset(&_mainCharacter.inventory, -1, sizeof(_mainCharacter.inventory));
+
+ _pauseStart = 0;
}
KyraEngine_v2::~KyraEngine_v2() {
- for (ShapeMap::iterator i = _gameShapes.begin(); i != _gameShapes.end(); ++i) {
- delete[] i->_value;
- i->_value = 0;
+ if (!(_flags.isDemo && !_flags.isTalkie)) {
+ for (ShapeMap::iterator i = _gameShapes.begin(); i != _gameShapes.end(); ++i) {
+ delete[] i->_value;
+ i->_value = 0;
+ }
+ _gameShapes.clear();
}
- _gameShapes.clear();
delete[] _itemList;
+ delete[] _sceneList;
_emc->unload(&_sceneScriptData);
@@ -85,15 +92,50 @@ KyraEngine_v2::~KyraEngine_v2() {
delete *i;
_opcodesAnimation.clear();
- delete _debugger;
delete[] _screenBuffer;
}
+void KyraEngine_v2::pauseEngineIntern(bool pause) {
+ KyraEngine_v1::pauseEngineIntern(pause);
+
+ if (!pause) {
+ uint32 pausedTime = _system->getMillis() - _pauseStart;
+
+ for (int i = 0; i < ARRAYSIZE(_sceneSpecialScriptsTimer); ++i) {
+ if (_sceneSpecialScriptsTimer[i])
+ _sceneSpecialScriptsTimer[i] += pausedTime;
+ }
+
+ } else {
+ _pauseStart = _system->getMillis();
+ }
+}
+
+void KyraEngine_v2::delay(uint32 amount, bool updateGame, bool isMainLoop) {
+ debugC(9, kDebugLevelMain, "KyraEngine_v2::delay(%u, %d, %d)", amount, updateGame, isMainLoop);
+
+ uint32 start = _system->getMillis();
+ do {
+ if (updateGame) {
+ if (_chatText)
+ updateWithText();
+ else
+ update();
+ } else {
+ updateInput();
+ }
+
+ if (amount > 0)
+ _system->delayMillis(amount > 10 ? 10 : amount);
+ } while (!skipFlag() && _system->getMillis() < start + amount && !_quitFlag);
+}
+
int KyraEngine_v2::checkInput(Button *buttonList, bool mainLoop) {
debugC(9, kDebugLevelMain, "KyraEngine_v2::checkInput(%p, %d)", (const void*)buttonList, mainLoop);
updateInput();
int keys = 0;
+ int8 mouseWheel = 0;
while (_eventList.size()) {
Common::Event event = *_eventList.begin();
@@ -135,6 +177,14 @@ int KyraEngine_v2::checkInput(Button *buttonList, bool mainLoop) {
breakLoop = true;
} break;
+ case Common::EVENT_WHEELUP:
+ mouseWheel = -1;
+ break;
+
+ case Common::EVENT_WHEELDOWN:
+ mouseWheel = 1;
+ break;
+
default:
break;
}
@@ -148,7 +198,7 @@ int KyraEngine_v2::checkInput(Button *buttonList, bool mainLoop) {
_eventList.erase(_eventList.begin());
}
- return gui_v2()->processButtonList(buttonList, keys | 0x8000);
+ return gui_v2()->processButtonList(buttonList, keys | 0x8000, mouseWheel);
}
void KyraEngine_v2::updateInput() {
@@ -178,6 +228,8 @@ void KyraEngine_v2::updateInput() {
// fall through
case Common::EVENT_LBUTTONUP:
+ case Common::EVENT_WHEELUP:
+ case Common::EVENT_WHEELDOWN:
_eventList.push_back(event);
break;
@@ -223,20 +275,18 @@ void KyraEngine_v2::addShapeToPool(const uint8 *data, int realIndex, int shape)
debugC(9, kDebugLevelMain, "KyraEngine_v2::addShapeToPool(%p, %d, %d)", data, realIndex, shape);
remShapeFromPool(realIndex);
_gameShapes[realIndex] = screen_v2()->makeShapeCopy(data, shape);
- assert(_gameShapes[realIndex]);
}
void KyraEngine_v2::addShapeToPool(uint8 *shpData, int index) {
debugC(9, kDebugLevelMain, "KyraEngine_v2::addShapeToPool(%p, %d)", shpData, index);
remShapeFromPool(index);
_gameShapes[index] = shpData;
- assert(_gameShapes[index]);
}
void KyraEngine_v2::remShapeFromPool(int idx) {
ShapeMap::iterator iter = _gameShapes.find(idx);
if (iter != _gameShapes.end()) {
- delete [] iter->_value;
+ delete[] iter->_value;
iter->_value = 0;
}
}
@@ -294,8 +344,8 @@ int KyraEngine_v2::updateCharPos(int *table, int force) {
debugC(9, kDebugLevelMain, "KyraEngine_v2::updateCharPos(%p, %d)", (const void*)table, force);
if (_updateCharPosNextUpdate > _system->getMillis() && !force)
return 0;
- _mainCharacter.x1 += _updateCharPosXTable[_mainCharacter.facing];
- _mainCharacter.y1 += _updateCharPosYTable[_mainCharacter.facing];
+ _mainCharacter.x1 += _charAddXPosTable[_mainCharacter.facing];
+ _mainCharacter.y1 += _charAddYPosTable[_mainCharacter.facing];
updateCharAnimFrame(0, table);
_updateCharPosNextUpdate = _system->getMillis() + getCharacterWalkspeed() * _tickLength;
return 1;
diff --git a/engines/kyra/kyra_v2.h b/engines/kyra/kyra_v2.h
index f0d26ca011..24f7aad614 100644
--- a/engines/kyra/kyra_v2.h
+++ b/engines/kyra/kyra_v2.h
@@ -26,7 +26,7 @@
#ifndef KYRA_KYRA_V2_H
#define KYRA_KYRA_V2_H
-#include "kyra/kyra.h"
+#include "kyra/kyra_v1.h"
#include "kyra/gui.h"
#include "kyra/wsamovie.h"
@@ -35,10 +35,25 @@
namespace Kyra {
+struct FrameControl {
+ uint16 index;
+ uint16 delay;
+};
+
+struct ItemAnimData_v2 {
+ int16 itemIndex;
+ uint8 numFrames;
+ const FrameControl *frames;
+};
+
+struct ActiveItemAnim {
+ uint16 currentFrame;
+ uint32 nextFrame;
+};
+
class Screen_v2;
-class Debugger_v2;
-class KyraEngine_v2 : public KyraEngine {
+class KyraEngine_v2 : public KyraEngine_v1 {
friend class Debugger_v2;
friend class GUI_v2;
public:
@@ -52,23 +67,29 @@ public:
// Animation script specific
const int animScriptFrameAdd;
+
+ // Item specific
+ const int maxItemId;
};
KyraEngine_v2(OSystem *system, const GameFlags &flags, const EngineDesc &desc);
~KyraEngine_v2();
+ virtual void pauseEngineIntern(bool pause);
+
virtual Screen_v2 *screen_v2() const = 0;
virtual GUI *gui_v2() const = 0;
+ void delay(uint32 time, bool update = false, bool isMainLoop = false);
+
const EngineDesc &engineDesc() const { return _desc; }
protected:
EngineDesc _desc;
- Debugger_v2 *_debugger;
// run
+ uint32 _pauseStart;
bool _runFlag;
bool _showOutro;
- int8 _deathHandler;
virtual void update() = 0;
virtual void updateWithText() = 0;
@@ -211,7 +232,7 @@ protected:
};
SceneAnim _sceneAnims[16];
- WSAMovieV2 *_sceneAnimMovie[16];
+ WSAMovie_v2 *_sceneAnimMovie[16];
void freeSceneAnims();
@@ -299,7 +320,6 @@ protected:
int _itemListSize;
int _itemInHand;
- int _handItemSet;
int findFreeItem();
int countAllItems();
@@ -338,8 +358,6 @@ protected:
void updateCharPosWithUpdate();
uint32 _updateCharPosNextUpdate;
- static const int8 _updateCharPosXTable[];
- static const int8 _updateCharPosYTable[];
virtual int getCharacterWalkspeed() const = 0;
virtual void updateCharAnimFrame(int num, int *table) = 0;
@@ -374,22 +392,10 @@ protected:
int o2_moveCharacter(EMCState *script);
int o2_checkForItem(EMCState *script);
int o2_defineItem(EMCState *script);
- int o2_queryGameFlag(EMCState *script);
- int o2_resetGameFlag(EMCState *script);
- int o2_setGameFlag(EMCState *script);
- int o2_setHandItem(EMCState *script);
- int o2_removeHandItem(EMCState *script);
- int o2_handItemSet(EMCState *script);
- int o2_hideMouse(EMCState *script);
int o2_addSpecialExit(EMCState *script);
- int o2_setMousePos(EMCState *script);
- int o2_showMouse(EMCState *script);
int o2_delay(EMCState *script);
int o2_update(EMCState *script);
int o2_getShapeFlag1(EMCState *script);
- int o2_playWanderScoreViaMap(EMCState *script);
- int o2_getRand(EMCState *script);
- int o2_setDeathHandler(EMCState *script);
int o2_waitForConfirmationClick(EMCState *script);
int o2_randomSceneChat(EMCState *script);
int o2_setDlgIndex(EMCState *script);
diff --git a/engines/kyra/module.mk b/engines/kyra/module.mk
index aec2778def..ebb63b4b4e 100644
--- a/engines/kyra/module.mk
+++ b/engines/kyra/module.mk
@@ -1,49 +1,50 @@
MODULE := engines/kyra
MODULE_OBJS := \
- animator_v1.o \
+ animator_lok.o \
animator_v2.o \
animator_hof.o \
animator_mr.o \
debugger.o \
detection.o \
gui.o \
- gui_v1.o \
+ gui_lok.o \
gui_v2.o \
gui_hof.o \
gui_mr.o \
- items_v1.o \
+ items_lok.o \
items_v2.o \
items_hof.o \
items_mr.o \
- kyra.o \
kyra_v1.o \
+ kyra_lok.o \
kyra_v2.o \
kyra_hof.o \
kyra_mr.o \
resource.o \
saveload.o \
- saveload_v1.o \
+ saveload_lok.o \
saveload_hof.o \
saveload_mr.o \
- scene.o \
scene_v1.o \
+ scene_lok.o \
scene_v2.o \
scene_hof.o \
scene_mr.o \
screen.o \
- screen_v1.o \
+ screen_lok.o \
screen_v2.o \
screen_hof.o \
screen_mr.o \
script_v1.o \
+ script_lok.o \
script_v2.o \
script_hof.o \
script_mr.o \
script.o \
script_tim.o \
seqplayer.o \
- sequences_v1.o \
+ sequences_lok.o \
sequences_v2.o \
sequences_hof.o \
sequences_mr.o \
@@ -51,15 +52,15 @@ MODULE_OBJS := \
sound_digital.o \
sound_towns.o \
sound.o \
- sound_v1.o \
+ sound_lok.o \
sprites.o \
staticres.o \
text.o \
- text_v1.o \
+ text_lok.o \
text_hof.o \
text_mr.o \
timer.o \
- timer_v1.o \
+ timer_lok.o \
timer_hof.o \
timer_mr.o \
vqa.o \
diff --git a/engines/kyra/resource.cpp b/engines/kyra/resource.cpp
index b2564221fc..afd7eacfda 100644
--- a/engines/kyra/resource.cpp
+++ b/engines/kyra/resource.cpp
@@ -30,22 +30,24 @@
#include "common/fs.h"
#include "common/func.h"
-#include "gui/message.h"
-
#include "kyra/resource.h"
namespace Kyra {
-Resource::Resource(KyraEngine *vm) : _loaders(), _map(), _vm(vm) {
+Resource::Resource(KyraEngine_v1 *vm) : _loaders(), _map(), _vm(vm) {
initializeLoaders();
}
Resource::~Resource() {
_map.clear();
_loaders.clear();
+
+ clearCompFileList();
+ _compLoaders.clear();
}
bool Resource::reset() {
+ clearCompFileList();
unloadAllPakFiles();
FilesystemNode dir(ConfMan.get("path"));
@@ -53,13 +55,10 @@ bool Resource::reset() {
if (!dir.exists() || !dir.isDirectory())
error("invalid game path '%s'", dir.getPath().c_str());
- if (_vm->game() != GI_KYRA3) {
- if (!loadPakFile(StaticResource::staticDataFilename()) || !StaticResource::checkKyraDat()) {
- Common::String errorMessage = "You're missing the '" + StaticResource::staticDataFilename() + "' file or it got corrupted, (re)get it from the ScummVM website";
- ::GUI::MessageDialog errorMsg(errorMessage);
- errorMsg.runModal();
- error(errorMessage.c_str());
- }
+ if (!loadPakFile(StaticResource::staticDataFilename()) || !StaticResource::checkKyraDat()) {
+ Common::String errorMessage = "You're missing the '" + StaticResource::staticDataFilename() + "' file or it got corrupted, (re)get it from the ScummVM website";
+ _vm->GUIErrorMessage(errorMessage);
+ error(errorMessage.c_str());
}
if (_vm->game() == GI_KYRA1) {
@@ -71,17 +70,32 @@ bool Resource::reset() {
if (_vm->gameFlags().isTalkie)
loadPakFile("CHAPTER1.VRM");
} else if (_vm->game() == GI_KYRA2) {
+ if (_vm->gameFlags().useInstallerPackage)
+ tryLoadCompFiles();
+
// mouse pointer, fonts, etc. required for initializing
if (_vm->gameFlags().isDemo && !_vm->gameFlags().isTalkie) {
loadPakFile("GENERAL.PAK");
} else {
+ if (_vm->gameFlags().isTalkie) {
+ // Add default file directories
+ Common::File::addDefaultDirectory(ConfMan.get("path") + "hof_cd");
+ Common::File::addDefaultDirectory(ConfMan.get("path") + "HOF_CD");
+ }
+
loadPakFile("INTROGEN.PAK");
loadPakFile("OTHER.PAK");
}
return true;
} else if (_vm->game() == GI_KYRA3) {
- loadPakFile("WESTWOOD.001");
+ if (_vm->gameFlags().useInstallerPackage)
+ loadPakFile("WESTWOOD.001");
+
+ // Add default file directories
+ Common::File::addDefaultDirectory(ConfMan.get("path") + "malcolm");
+ Common::File::addDefaultDirectory(ConfMan.get("path") + "MALCOLM");
+
loadFileList("FILEDATA.FDT");
return true;
@@ -212,7 +226,7 @@ bool Resource::loadFileList(const Common::String &filedata) {
buffer[12] = 0;
f.seek(offset + 16, SEEK_SET);
- Common::String filename = (char*)buffer;
+ Common::String filename = Common::String((char*)buffer);
filename.toUppercase();
if (filename.hasSuffix(".PAK")) {
@@ -253,6 +267,13 @@ void Resource::unloadPakFile(const Common::String &filename) {
}
}
+void Resource::clearCompFileList() {
+ for (CompFileMap::iterator i = _compFiles.begin(); i != _compFiles.end(); ++i)
+ delete[] i->_value.data;
+
+ _compFiles.clear();
+}
+
bool Resource::isInPakList(const Common::String &filename) {
if (!isAccessable(filename))
return false;
@@ -293,6 +314,8 @@ bool Resource::exists(const char *file, bool errorOutOnFail) {
}
uint32 Resource::getFileSize(const char *file) {
+ CompFileMap::iterator compEntry;
+
if (Common::File::exists(file)) {
Common::File f;
if (f.open(file))
@@ -314,12 +337,14 @@ bool Resource::loadFileToBuf(const char *file, void *buf, uint32 maxSize) {
return false;
memset(buf, 0, maxSize);
- stream->read(buf, stream->size());
+ stream->read(buf, (maxSize <= stream->size()) ? maxSize : stream->size());
delete stream;
return true;
}
Common::SeekableReadStream *Resource::getFileStream(const Common::String &file) {
+ CompFileMap::iterator compEntry;
+
if (Common::File::exists(file)) {
Common::File *stream = new Common::File();
if (!stream->open(file)) {
@@ -328,6 +353,8 @@ Common::SeekableReadStream *Resource::getFileStream(const Common::String &file)
error("Couldn't open file '%s'", file.c_str());
}
return stream;
+ } else if ((compEntry = _compFiles.find(file)) != _compFiles.end()) {
+ return new Common::MemoryReadStream(compEntry->_value.data, compEntry->_value.size, false);
} else {
if (!isAccessable(file))
return 0;
@@ -376,19 +403,35 @@ bool Resource::isAccessable(const Common::String &file) {
}
void Resource::checkFile(const Common::String &file) {
- if (_map.find(file) == _map.end() && Common::File::exists(file)) {
- Common::File temp;
- if (temp.open(file)) {
+ if (_map.find(file) == _map.end()) {
+ CompFileMap::const_iterator iter;
+
+ if (Common::File::exists(file)) {
+ Common::File temp;
+ if (temp.open(file)) {
+ ResFileEntry entry;
+ entry.parent = "";
+ entry.size = temp.size();
+ entry.mounted = file.compareToIgnoreCase(StaticResource::staticDataFilename()) != 0;
+ entry.preload = false;
+ entry.prot = false;
+ entry.type = ResFileEntry::kAutoDetect;
+ entry.offset = 0;
+ _map[file] = entry;
+ temp.close();
+
+ detectFileTypes();
+ }
+ } else if ((iter = _compFiles.find(file)) != _compFiles.end()) {
ResFileEntry entry;
entry.parent = "";
- entry.size = temp.size();
- entry.mounted = file.compareToIgnoreCase(StaticResource::staticDataFilename()) != 0;
+ entry.size = iter->_value.size;
+ entry.mounted = false;
entry.preload = false;
entry.prot = false;
entry.type = ResFileEntry::kAutoDetect;
entry.offset = 0;
_map[file] = entry;
- temp.close();
detectFileTypes();
}
@@ -425,6 +468,13 @@ void Resource::detectFileTypes() {
}
}
+void Resource::tryLoadCompFiles() {
+ for (CCompLoaderIterator i = _compLoaders.begin(); i != _compLoaders.end(); ++i) {
+ if ((*i)->checkForFiles())
+ (*i)->loadFile(_compFiles);
+ }
+}
+
#pragma mark -
#pragma mark - ResFileLodaer
#pragma mark -
@@ -492,6 +542,20 @@ bool ResLoaderPak::isLoadable(const Common::String &filename, Common::SeekableRe
return true;
}
+namespace {
+
+Common::String readString(Common::SeekableReadStream &stream) {
+ Common::String result;
+ char c = 0;
+
+ while ((c = stream.readByte()) != 0)
+ result += c;
+
+ return result;
+}
+
+} // end of anonymous namespace
+
bool ResLoaderPak::loadFile(const Common::String &filename, Common::SeekableReadStream &stream, FileList &files) const {
uint32 filesize = stream.size();
@@ -559,6 +623,33 @@ bool ResLoaderPak::loadFile(const Common::String &filename, Common::SeekableRead
startoffset = endoffset;
}
+ FileList::const_iterator iter = Common::find(files.begin(), files.end(), Common::String("LINKLIST"));
+ if (iter != files.end()) {
+ stream.seek(iter->entry.offset, SEEK_SET);
+
+ uint32 magic = stream.readUint32BE();
+
+ if (magic != MKID_BE('SCVM'))
+ error("LINKLIST file does not contain 'SCVM' header");
+
+ uint32 links = stream.readUint32BE();
+ for (uint i = 0; i < links; ++i) {
+ Common::String linksTo = readString(stream);
+ uint32 sources = stream.readUint32BE();
+
+ iter = Common::find(files.begin(), files.end(), linksTo);
+ if (iter == files.end())
+ error("PAK file link destination '%s' not found", linksTo.c_str());
+
+ for (uint j = 0; j < sources; ++j) {
+ Common::String dest = readString(stream);
+ files.push_back(File(dest, iter->entry));
+ // Better safe than sorry, we update the 'iter' value, in case push_back invalidated it
+ iter = Common::find(files.begin(), files.end(), linksTo);
+ }
+ }
+ }
+
return true;
}
@@ -571,7 +662,7 @@ Common::SeekableReadStream *ResLoaderPak::loadFileFromArchive(const Common::Stri
return stream;
}
-class ResLoaderIns : public ResArchiveLoader {
+class ResLoaderInsMalcolm : public ResArchiveLoader {
public:
bool checkFilename(Common::String filename) const;
bool isLoadable(const Common::String &filename, Common::SeekableReadStream &stream) const;
@@ -579,16 +670,18 @@ public:
Common::SeekableReadStream *loadFileFromArchive(const Common::String &file, Common::SeekableReadStream *archive, const ResFileEntry entry) const;
ResFileEntry::kType getType() const {
- return ResFileEntry::kIns;
+ return ResFileEntry::kInsMal;
}
};
-bool ResLoaderIns::checkFilename(Common::String filename) const {
+bool ResLoaderInsMalcolm::checkFilename(Common::String filename) const {
filename.toUppercase();
- return (filename.hasSuffix(".001"));
+ if (!filename.hasSuffix(".001"))
+ return false;
+ return true;
}
-bool ResLoaderIns::isLoadable(const Common::String &filename, Common::SeekableReadStream &stream) const {
+bool ResLoaderInsMalcolm::isLoadable(const Common::String &filename, Common::SeekableReadStream &stream) const {
stream.seek(3);
uint32 size = stream.readUint32LE();
@@ -602,7 +695,7 @@ bool ResLoaderIns::isLoadable(const Common::String &filename, Common::SeekableRe
return (buffer[0] == 0x0D && buffer[1] == 0x0A);
}
-bool ResLoaderIns::loadFile(const Common::String &filename, Common::SeekableReadStream &stream, FileList &files) const {
+bool ResLoaderInsMalcolm::loadFile(const Common::String &filename, Common::SeekableReadStream &stream, FileList &files) const {
Common::List<Common::String> filenames;
// thanks to eriktorbjorn for this code (a bit modified though)
@@ -647,7 +740,7 @@ bool ResLoaderIns::loadFile(const Common::String &filename, Common::SeekableRead
return true;
}
-Common::SeekableReadStream *ResLoaderIns::loadFileFromArchive(const Common::String &file, Common::SeekableReadStream *archive, const ResFileEntry entry) const {
+Common::SeekableReadStream *ResLoaderInsMalcolm::loadFileFromArchive(const Common::String &file, Common::SeekableReadStream *archive, const ResFileEntry entry) const {
assert(archive);
archive->seek(entry.offset, SEEK_SET);
@@ -714,7 +807,7 @@ bool ResLoaderTlk::loadFile(const Common::String &filename, Common::SeekableRead
entry.offset = resOffset+4;
char realFilename[20];
- snprintf(realFilename, 20, "%u.AUD", resFilename);
+ snprintf(realFilename, 20, "%.08u.AUD", resFilename);
uint32 curOffset = stream.pos();
stream.seek(resOffset, SEEK_SET);
@@ -737,11 +830,669 @@ Common::SeekableReadStream *ResLoaderTlk::loadFileFromArchive(const Common::Stri
}
#pragma mark -
+#pragma mark - CompFileLoader
+#pragma mark -
+
+class FileExpanderSource {
+public:
+ FileExpanderSource(const uint8 *data, int dataSize) : _dataPtr(data), _endofBuffer(data + dataSize), _bitsLeft(8), _key(0), _index(0) {}
+ ~FileExpanderSource() {}
+
+ void advSrcRefresh();
+ void advSrcBitsBy1();
+ void advSrcBitsByIndex(uint8 newIndex);
+
+ uint8 getKeyLower() { return _key & 0xff; }
+ void setIndex(uint8 index) { _index = index; }
+ uint16 getKeyMasked(uint8 newIndex);
+ uint16 keyMaskedAlign(uint16 val);
+
+ void copyBytes(uint8 *& dst);
+
+private:
+ const uint8 *_dataPtr;
+ const uint8 *_endofBuffer;
+ uint16 _key;
+ int8 _bitsLeft;
+ uint8 _index;
+};
+
+void FileExpanderSource::advSrcBitsBy1() {
+ _key >>= 1;
+ if (!--_bitsLeft) {
+ if (_dataPtr < _endofBuffer)
+ _key = ((*_dataPtr++) << 8 ) | (_key & 0xff);
+ _bitsLeft = 8;
+ }
+}
+
+void FileExpanderSource::advSrcBitsByIndex(uint8 newIndex) {
+ _index = newIndex;
+ _bitsLeft -= _index;
+ if (_bitsLeft <= 0) {
+ _key >>= (_index + _bitsLeft);
+ _index = -_bitsLeft;
+ _bitsLeft = 8 - _index;
+ if (_dataPtr < _endofBuffer)
+ _key = (*_dataPtr++ << 8) | (_key & 0xff);
+ }
+ _key >>= _index;
+}
+
+uint16 FileExpanderSource::getKeyMasked(uint8 newIndex) {
+ static const uint8 mskTable[] = { 0x0F, 0x01, 0x03, 0x07, 0x0F, 0x1F, 0x3F, 0x7F, 0xFF };
+ _index = newIndex;
+ uint16 res = 0;
+
+ if (_index > 8) {
+ newIndex = _index - 8;
+ res = (_key & 0xff) & mskTable[8];
+ advSrcBitsByIndex(8);
+ _index = newIndex;
+ res |= (((_key & 0xff) & mskTable[_index]) << 8);
+ advSrcBitsByIndex(_index);
+ } else {
+ res = (_key & 0xff) & mskTable[_index];
+ advSrcBitsByIndex(_index);
+ }
+
+ return res;
+}
+
+void FileExpanderSource::copyBytes(uint8 *& dst) {
+ advSrcBitsByIndex(_bitsLeft);
+ uint16 r = (READ_LE_UINT16(_dataPtr) ^ _key) + 1;
+ _dataPtr += 2;
+
+ if (r)
+ error("decompression failure");
+
+ memcpy(dst, _dataPtr, _key);
+ _dataPtr += _key;
+ dst += _key;
+}
+
+uint16 FileExpanderSource::keyMaskedAlign(uint16 val) {
+ val -= 0x101;
+ _index = (val & 0xff) >> 2;
+ int16 b = ((_bitsLeft << 8) | _index) - 1;
+ _bitsLeft = b >> 8;
+ _index = b & 0xff;
+ uint16 res = (((val & 3) + 4) << _index) + 0x101;
+ return res + getKeyMasked(_index);
+}
+
+void FileExpanderSource::advSrcRefresh() {
+ _key = READ_LE_UINT16(_dataPtr);
+ if (_dataPtr < _endofBuffer - 1)
+ _dataPtr += 2;
+ _bitsLeft = 8;
+}
+
+class FileExpander {
+public:
+ FileExpander();
+ ~FileExpander();
+
+ bool process(uint8 *dst, const uint8 *src, uint32 outsize, uint32 insize);
+
+private:
+ void generateTables(uint8 srcIndex, uint8 dstIndex, uint8 dstIndex2, int cnt);
+ uint8 calcCmdAndIndex(const uint8 *tbl, int16 &para);
+
+ FileExpanderSource *_src;
+ uint8 *_tables[9];
+ uint16 *_tables16[3];
+};
+
+FileExpander::FileExpander() : _src(0) {
+ _tables[0] = new uint8[3914];
+ assert(_tables[0]);
+
+ _tables[1] = _tables[0] + 320;
+ _tables[2] = _tables[0] + 352;
+ _tables[3] = _tables[0] + 864;
+ _tables[4] = _tables[0] + 2016;
+ _tables[5] = _tables[0] + 2528;
+ _tables[6] = _tables[0] + 2656;
+ _tables[7] = _tables[0] + 2736;
+ _tables[8] = _tables[0] + 2756;
+
+ _tables16[0] = (uint16 *)(_tables[0] + 3268);
+ _tables16[1] = (uint16 *)(_tables[0] + 3302);
+ _tables16[2] = (uint16 *)(_tables[0] + 3338);
+}
+
+FileExpander::~FileExpander() {
+ delete _src;
+ delete[] _tables[0];
+}
+
+bool FileExpander::process(uint8 *dst, const uint8 *src, uint32 outsize, uint32 compressedSize) {
+ static const uint8 indexTable[] = {
+ 0x10, 0x11, 0x12, 0x00, 0x08, 0x07, 0x09, 0x06, 0x0A,
+ 0x05, 0x0B, 0x04, 0x0C, 0x03, 0x0D, 0x02, 0x0E, 0x01, 0x0F
+ };
+
+ memset(_tables[0], 0, 3914);
+
+ uint8 *d = dst;
+ uint16 tableSize0 = 0;
+ uint16 tableSize1 = 0;
+ bool needrefresh = true;
+ bool postprocess = false;
+
+ _src = new FileExpanderSource(src, compressedSize);
+
+ while (d < dst + outsize) {
+
+ if (needrefresh) {
+ needrefresh = false;
+ _src->advSrcRefresh();
+ }
+
+ _src->advSrcBitsBy1();
+
+ int mode = _src->getKeyMasked(2) - 1;
+ if (mode == 1) {
+ tableSize0 = _src->getKeyMasked(5) + 257;
+ tableSize1 = _src->getKeyMasked(5) + 1;
+ memset(_tables[7], 0, 19);
+
+ const uint8 *itbl = indexTable;
+ int numbytes = _src->getKeyMasked(4) + 4;
+
+ while (numbytes--)
+ _tables[7][*itbl++] = _src->getKeyMasked(3);
+
+ generateTables(7, 8, 255, 19);
+
+ int cnt = tableSize0 + tableSize1;
+ uint8 *tmp = _tables[0];
+
+ while (cnt) {
+ uint16 cmd = _src->getKeyLower();
+ cmd = READ_LE_UINT16(&_tables[8][cmd << 1]);
+ _src->advSrcBitsByIndex(_tables[7][cmd]);
+
+ if (cmd < 16) {
+ *tmp++ = cmd;
+ cnt--;
+ } else {
+ uint8 tmpI = 0;
+ if (cmd == 16) {
+ cmd = _src->getKeyMasked(2) + 3;
+ tmpI = *(tmp - 1);
+ } else if (cmd == 17) {
+ cmd = _src->getKeyMasked(3) + 3;
+ } else {
+ cmd = _src->getKeyMasked(7) + 11;
+ }
+ _src->setIndex(tmpI);
+ memset(tmp, tmpI, cmd);
+ tmp += cmd;
+
+ cnt -= cmd;
+ if (cnt < 0)
+ error("decompression failure");
+ }
+ }
+
+ memcpy(_tables[1], _tables[0] + tableSize0, tableSize1);
+ generateTables(0, 2, 3, tableSize0);
+ generateTables(1, 4, 5, tableSize1);
+ postprocess = true;
+ } else if (mode < 0) {
+ _src->copyBytes(d);
+ postprocess = false;
+ needrefresh = true;
+ } else if (mode == 0){
+ uint8 *d2 = _tables[0];
+ memset(d2, 8, 144);
+ memset(d2 + 144, 9, 112);
+ memset(d2 + 256, 7, 24);
+ memset(d2 + 280, 8, 8);
+ d2 = _tables[1];
+ memset(d2, 5, 32);
+ tableSize0 = 288;
+ tableSize1 = 32;
+
+ generateTables(0, 2, 3, tableSize0);
+ generateTables(1, 4, 5, tableSize1);
+ postprocess = true;
+ } else {
+ error("decompression failure");
+ }
+
+ if (!postprocess)
+ continue;
+
+ int16 cmd = 0;
+
+ do {
+ cmd = ((int16*) _tables[2])[_src->getKeyLower()];
+ _src->advSrcBitsByIndex(cmd < 0 ? calcCmdAndIndex(_tables[3], cmd) : _tables[0][cmd]);
+
+ if (cmd == 0x11d) {
+ cmd = 0x200;
+ } else if (cmd > 0x108) {
+ cmd = _src->keyMaskedAlign(cmd);
+ }
+
+ if (!(cmd >> 8)) {
+ *d++ = cmd & 0xff;
+ } else if (cmd != 0x100) {
+ cmd -= 0xfe;
+ int16 offset = ((int16*) _tables[4])[_src->getKeyLower()];
+ _src->advSrcBitsByIndex(offset < 0 ? calcCmdAndIndex(_tables[5], offset) : _tables[1][offset]);
+ if ((offset & 0xff) >= 4) {
+ uint8 newIndex = ((offset & 0xff) >> 1) - 1;
+ offset = (((offset & 1) + 2) << newIndex);
+ offset += _src->getKeyMasked(newIndex);
+ }
+
+ uint8 *s2 = d - 1 - offset;
+ if (s2 >= dst) {
+ while (cmd--)
+ *d++ = *s2++;
+ } else {
+ uint32 pos = dst - s2;
+ s2 += (d - dst);
+
+ if (pos < (uint32) cmd) {
+ cmd -= pos;
+ while (pos--)
+ *d++ = *s2++;
+ s2 = dst;
+ }
+ while (cmd--)
+ *d++ = *s2++;
+ }
+ }
+ } while (cmd != 0x100);
+ }
+
+ delete _src;
+ _src = 0;
+
+ return true;
+}
+
+void FileExpander::generateTables(uint8 srcIndex, uint8 dstIndex, uint8 dstIndex2, int cnt) {
+ const uint8 *tbl1 = _tables[srcIndex];
+ const uint8 *tbl2 = _tables[dstIndex];
+ const uint8 *tbl3 = dstIndex2 == 0xff ? 0 : _tables[dstIndex2];
+
+ if (!cnt)
+ return;
+
+ const uint8 *s = tbl1;
+ memset(_tables16[0], 0, 32);
+
+ for (int i = 0; i < cnt; i++)
+ _tables16[0][(*s++)]++;
+
+ _tables16[1][1] = 0;
+
+ for (uint16 i = 1, r = 0; i < 16; i++) {
+ r = (r + _tables16[0][i]) << 1;
+ _tables16[1][i + 1] = r;
+ }
+
+ if (_tables16[1][16]) {
+ uint16 r = 0;
+ for (uint16 i = 1; i < 16; i++)
+ r += _tables16[0][i];
+ if (r > 1)
+ error("decompression failure");
+ }
+
+ s = tbl1;
+ uint16 *d = _tables16[2];
+ for (int i = 0; i < cnt; i++) {
+ uint16 t = *s++;
+ if (t) {
+ _tables16[1][t]++;
+ t = _tables16[1][t] - 1;
+ }
+ *d++ = t;
+ }
+
+ s = tbl1;
+ d = _tables16[2];
+ for (int i = 0; i < cnt; i++) {
+ int8 t = ((int8)(*s++)) - 1;
+ if (t > 0) {
+ uint16 v1 = *d;
+ uint16 v2 = 0;
+
+ do {
+ v2 = (v2 << 1) | (v1 & 1);
+ v1 >>= 1;
+ } while (--t && v1);
+
+ t++;
+ uint8 c1 = (v1 & 1);
+ while (t--) {
+ uint8 c2 = v2 >> 15;
+ v2 = (v2 << 1) | c1;
+ c1 = c2;
+ };
+
+ *d++ = v2;
+ } else {
+ d++;
+ }
+ }
+
+ memset((void*) tbl2, 0, 512);
+
+ cnt--;
+ s = tbl1 + cnt;
+ d = &_tables16[2][cnt];
+ uint16 * bt = (uint16*) tbl3;
+ uint16 inc = 0;
+ uint16 cnt2 = 0;
+
+ do {
+ uint8 t = *s--;
+ uint16 *s2 = (uint16*) tbl2;
+
+ if (t && t < 9) {
+ inc = 1 << t;
+ uint16 o = *d;
+
+ do {
+ s2[o] = cnt;
+ o += inc;
+ } while (!(o & 0xf00));
+
+ } else if (t > 8) {
+ if (!bt)
+ error("decompression failure");
+
+ t -= 8;
+ uint8 shiftCnt = 1;
+ uint8 v = (*d) >> 8;
+ s2 = &((uint16*) tbl2)[*d & 0xff];
+
+ do {
+ if (!*s2) {
+ *s2 = (uint16)(~cnt2);
+ *(uint32*)&bt[cnt2] = 0;
+ cnt2 += 2;
+ }
+
+ s2 = &bt[(uint16)(~*s2)];
+ if (v & shiftCnt)
+ s2++;
+
+ shiftCnt <<= 1;
+ } while (--t);
+ *s2 = cnt;
+ }
+ d--;
+ } while (--cnt >= 0);
+}
+
+uint8 FileExpander::calcCmdAndIndex(const uint8 *tbl, int16 &para) {
+ const uint16 *t = (const uint16*)tbl;
+ _src->advSrcBitsByIndex(8);
+ uint8 newIndex = 0;
+ uint16 v = _src->getKeyLower();
+
+ do {
+ newIndex++;
+ para = t[((~para) & 0xfffe) | (v & 1)];
+ v >>= 1;
+ } while (para < 0);
+
+ return newIndex;
+}
+
+class CompLoaderInsHof : public CompArchiveLoader {
+public:
+ bool checkForFiles() const;
+ bool loadFile(CompFileMap &loadTo) const;
+
+private:
+ struct Archive {
+ Common::String filename;
+ uint32 firstFile;
+ uint32 startOffset;
+ uint32 lastFile;
+ uint32 endOffset;
+ uint32 totalSize;
+ };
+};
+
+bool CompLoaderInsHof::checkForFiles() const {
+ return (Common::File::exists("WESTWOOD.001") && Common::File::exists("WESTWOOD.002"));
+}
+
+bool CompLoaderInsHof::loadFile(CompFileMap &loadTo) const {
+ Common::File tmpFile;
+
+ uint32 pos = 0;
+ uint32 bytesleft = 0;
+ bool startFile = true;
+
+ Common::String filenameBase = "WESTWOOD.";
+ Common::String filenameTemp;
+ char filenameExt[4];
+
+ while (filenameBase.lastChar() != '.')
+ filenameBase.deleteLastChar();
+
+ Archive newArchive;
+
+ Common::List<Archive> archives;
+
+ for (int8 currentFile = 1; currentFile; currentFile++) {
+ sprintf(filenameExt, "%03d", currentFile);
+ filenameTemp = filenameBase + Common::String(filenameExt);
+
+ if (!tmpFile.open(filenameTemp)) {
+ debug(3, "couldn't open file '%s'\n", filenameTemp.c_str());
+ break;
+ }
+
+ tmpFile.seek(pos);
+ uint8 fileId = tmpFile.readByte();
+ pos++;
+
+ uint32 size = tmpFile.size() - 1;
+ if (startFile) {
+ size -= 4;
+ if (fileId == currentFile) {
+ size -= 6;
+ pos += 6;
+ tmpFile.seek(6, SEEK_CUR);
+ } else {
+ size = size + 1 - pos;
+ }
+ newArchive.filename = filenameBase;
+ bytesleft = newArchive.totalSize = tmpFile.readUint32LE();
+ pos += 4;
+ newArchive.firstFile = currentFile;
+ newArchive.startOffset = pos;
+ startFile = false;
+ }
+
+ uint32 cs = MIN(size, bytesleft);
+ bytesleft -= cs;
+
+ tmpFile.close();
+
+ pos += cs;
+ if (cs == size) {
+ if (!bytesleft) {
+ newArchive.lastFile = currentFile;
+ newArchive.endOffset = --pos;
+ archives.push_back(newArchive);
+ currentFile = -1;
+ } else {
+ pos = 0;
+ }
+ } else {
+ startFile = true;
+ bytesleft = size - cs;
+ newArchive.lastFile = currentFile--;
+ newArchive.endOffset = --pos;
+ archives.push_back(newArchive);
+ }
+ }
+
+ FileExpander exp;
+ CompFileEntry newEntry;
+ uint32 insize = 0;
+ uint32 outsize = 0;
+ uint8 *inbuffer = 0;
+ uint8 *outbuffer = 0;
+ uint32 inPart1 = 0;
+ uint32 inPart2 = 0;
+ Common::String entryStr;
+
+ pos = 0;
+
+ const uint32 kExecSize = 0x0bba;
+ const uint32 kHeaderSize = 30;
+ const uint32 kHeaderSize2 = 46;
+
+ for (Common::List<Archive>::iterator a = archives.begin(); a != archives.end(); ++a) {
+ startFile = true;
+ for (uint32 i = a->firstFile; i != (a->lastFile + 1); i++) {
+ sprintf(filenameExt, "%03d", i);
+ filenameTemp = a->filename + Common::String(filenameExt);
+
+ if (!tmpFile.open(filenameTemp)) {
+ debug(3, "couldn't open file '%s'\n", filenameTemp.c_str());
+ break;
+ }
+
+ uint32 size = (i == a->lastFile) ? a->endOffset : tmpFile.size();
+
+ if (startFile) {
+ startFile = false;
+ pos = a->startOffset + kExecSize;
+ if (pos > size) {
+ pos -= size;
+ tmpFile.close();
+ continue;
+ }
+ } else {
+ if (inPart2) {
+ tmpFile.seek(1);
+ tmpFile.read(inbuffer + inPart1, inPart2);
+ inPart2 = 0;
+ exp.process(outbuffer, inbuffer, outsize, insize);
+ delete[] inbuffer;
+ inbuffer = 0;
+ newEntry.data = outbuffer;
+ newEntry.size = outsize;
+ loadTo[entryStr] = newEntry;
+ }
+ pos++;
+ }
+
+ while (pos < size) {
+ uint8 hdr[43];
+ uint32 m = 0;
+ tmpFile.seek(pos);
+
+ if (pos + 42 > size) {
+ m = size - pos;
+ uint32 b = 42 - m;
+
+ if (m >= 4) {
+ uint32 id = tmpFile.readUint32LE();
+ if (id == 0x06054B50) {
+ startFile = true;
+ break;
+ } else {
+ tmpFile.seek(pos);
+ }
+ }
+
+ sprintf(filenameExt, "%03d", i + 1);
+ filenameTemp = a->filename + Common::String(filenameExt);
+
+ Common::File tmpFile2;
+ tmpFile2.open(filenameTemp);
+ tmpFile.read(hdr, m);
+ tmpFile2.read(hdr + m, b);
+ tmpFile2.close();
+
+ } else {
+ tmpFile.read(hdr, 42);
+ }
+
+ uint32 id = READ_LE_UINT32(hdr);
+
+ if (id == 0x04034B50) {
+ if (hdr[8] != 8)
+ error("compression type not implemented");
+ insize = READ_LE_UINT32(hdr + 18);
+ outsize = READ_LE_UINT32(hdr + 22);
+
+ uint16 filestrlen = READ_LE_UINT16(hdr + 26);
+ *(hdr + 30 + filestrlen) = 0;
+ entryStr = Common::String((const char *)(hdr + 30));
+ pos += (kHeaderSize + filestrlen - m);
+ tmpFile.seek(pos);
+
+ outbuffer = new uint8[outsize];
+ if (!outbuffer)
+ error("Out of memory: Can't uncompress installer files");
+
+ if (!inbuffer) {
+ inbuffer = new uint8[insize];
+ if (!inbuffer)
+ error("Out of memory: Can't uncompress installer files");
+ }
+
+ if ((pos + insize) > size) {
+ // this is for files that are split between two archive files
+ inPart1 = size - pos;
+ inPart2 = insize - inPart1;
+ tmpFile.read(inbuffer, inPart1);
+ } else {
+ tmpFile.read(inbuffer, insize);
+ inPart2 = 0;
+ exp.process(outbuffer, inbuffer, outsize, insize);
+ delete[] inbuffer;
+ inbuffer = 0;
+ newEntry.data = outbuffer;
+ newEntry.size = outsize;
+ loadTo[entryStr] = newEntry;
+ }
+
+ pos += insize;
+ if (pos > size) {
+ pos -= size;
+ break;
+ }
+ } else {
+ uint32 filestrlen = READ_LE_UINT32(hdr + 28);
+ pos += (kHeaderSize2 + filestrlen - m);
+ }
+ }
+ tmpFile.close();
+ }
+ }
+
+ archives.clear();
+ return true;
+}
+
+#pragma mark -
void Resource::initializeLoaders() {
_loaders.push_back(LoaderList::value_type(new ResLoaderPak()));
- _loaders.push_back(LoaderList::value_type(new ResLoaderIns()));
+ _loaders.push_back(LoaderList::value_type(new ResLoaderInsMalcolm()));
_loaders.push_back(LoaderList::value_type(new ResLoaderTlk()));
+
+ _compLoaders.push_back(CompLoaderList::value_type(new CompLoaderInsHof()));
}
const ResArchiveLoader *Resource::getLoader(ResFileEntry::kType type) const {
@@ -755,3 +1506,4 @@ const ResArchiveLoader *Resource::getLoader(ResFileEntry::kType type) const {
} // end of namespace Kyra
+
diff --git a/engines/kyra/resource.h b/engines/kyra/resource.h
index f414cacee8..d43f730e6b 100644
--- a/engines/kyra/resource.h
+++ b/engines/kyra/resource.h
@@ -36,7 +36,7 @@
#include "common/stream.h"
#include "common/ptr.h"
-#include "kyra/kyra.h"
+#include "kyra/kyra_v1.h"
#include "kyra/kyra_hof.h"
namespace Kyra {
@@ -52,7 +52,7 @@ struct ResFileEntry {
enum kType {
kRaw = 0,
kPak = 1,
- kIns = 2,
+ kInsMal = 2,
kTlk = 3,
kAutoDetect
};
@@ -60,7 +60,13 @@ struct ResFileEntry {
uint32 offset;
};
+struct CompFileEntry {
+ uint32 size;
+ uint8 *data;
+};
+
typedef Common::HashMap<Common::String, ResFileEntry, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> ResFileMap;
+typedef Common::HashMap<Common::String, CompFileEntry, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> CompFileMap;
class Resource;
class ResArchiveLoader {
@@ -69,6 +75,10 @@ public:
File() : filename(), entry() {}
File(const Common::String &f, const ResFileEntry &e) : filename(f), entry(e) {}
+ bool operator ==(const Common::String &r) const {
+ return filename.equalsIgnoreCase(r);
+ }
+
Common::String filename;
ResFileEntry entry;
};
@@ -86,9 +96,17 @@ public:
protected:
};
+class CompArchiveLoader {
+public:
+ virtual ~CompArchiveLoader() {}
+
+ virtual bool checkForFiles() const = 0;
+ virtual bool loadFile(CompFileMap &loadTo) const = 0;
+};
+
class Resource {
public:
- Resource(KyraEngine *vm);
+ Resource(KyraEngine_v1 *vm);
~Resource();
bool reset();
@@ -122,89 +140,97 @@ protected:
LoaderList _loaders;
ResFileMap _map;
- KyraEngine *_vm;
+ typedef Common::List<Common::SharedPtr<CompArchiveLoader> > CompLoaderList;
+ typedef CompLoaderList::iterator CompLoaderIterator;
+ typedef CompLoaderList::const_iterator CCompLoaderIterator;
+ CompLoaderList _compLoaders;
+ CompFileMap _compFiles;
+
+ void tryLoadCompFiles();
+ void clearCompFileList();
+
+ KyraEngine_v1 *_vm;
};
-// TODO?: maybe prefix all things here with 'kKyra1' instead of 'k'
enum kKyraResources {
kLoadAll = -1,
- kForestSeq,
- kKallakWritingSeq,
- kKyrandiaLogoSeq,
- kKallakMalcolmSeq,
- kMalcolmTreeSeq,
- kWestwoodLogoSeq,
+ k1ForestSeq,
+ k1KallakWritingSeq,
+ k1KyrandiaLogoSeq,
+ k1KallakMalcolmSeq,
+ k1MalcolmTreeSeq,
+ k1WestwoodLogoSeq,
- kDemo1Seq,
- kDemo2Seq,
- kDemo3Seq,
- kDemo4Seq,
+ k1Demo1Seq,
+ k1Demo2Seq,
+ k1Demo3Seq,
+ k1Demo4Seq,
- kAmuleteAnimSeq,
+ k1AmuleteAnimSeq,
- kOutroReunionSeq,
+ k1OutroReunionSeq,
- kIntroCPSStrings,
- kIntroCOLStrings,
- kIntroWSAStrings,
- kIntroStrings,
+ k1IntroCPSStrings,
+ k1IntroCOLStrings,
+ k1IntroWSAStrings,
+ k1IntroStrings,
- kOutroHomeString,
+ k1OutroHomeString,
- kRoomFilenames,
- kRoomList,
+ k1RoomFilenames,
+ k1RoomList,
- kCharacterImageFilenames,
+ k1CharacterImageFilenames,
- kItemNames,
- kTakenStrings,
- kPlacedStrings,
- kDroppedStrings,
- kNoDropStrings,
+ k1ItemNames,
+ k1TakenStrings,
+ k1PlacedStrings,
+ k1DroppedStrings,
+ k1NoDropStrings,
- kPutDownString,
- kWaitAmuletString,
- kBlackJewelString,
- kPoisonGoneString,
- kHealingTipString,
- kWispJewelStrings,
- kMagicJewelStrings,
+ k1PutDownString,
+ k1WaitAmuletString,
+ k1BlackJewelString,
+ k1PoisonGoneString,
+ k1HealingTipString,
+ k1WispJewelStrings,
+ k1MagicJewelStrings,
- kThePoisonStrings,
- kFluteStrings,
+ k1ThePoisonStrings,
+ k1FluteStrings,
- kFlaskFullString,
- kFullFlaskString,
+ k1FlaskFullString,
+ k1FullFlaskString,
- kVeryCleverString,
- kNewGameString,
+ k1VeryCleverString,
+ k1NewGameString,
- kDefaultShapes,
- kHealing1Shapes,
- kHealing2Shapes,
- kPoisonDeathShapes,
- kFluteShapes,
- kWinter1Shapes,
- kWinter2Shapes,
- kWinter3Shapes,
- kDrinkShapes,
- kWispShapes,
- kMagicAnimShapes,
- kBranStoneShapes,
+ k1DefaultShapes,
+ k1Healing1Shapes,
+ k1Healing2Shapes,
+ k1PoisonDeathShapes,
+ k1FluteShapes,
+ k1Winter1Shapes,
+ k1Winter2Shapes,
+ k1Winter3Shapes,
+ k1DrinkShapes,
+ k1WispShapes,
+ k1MagicAnimShapes,
+ k1BranStoneShapes,
- kPaletteList,
+ k1PaletteList,
- kGUIStrings,
- kConfigStrings,
+ k1GUIStrings,
+ k1ConfigStrings,
- kAudioTracks,
- kAudioTracksIntro,
+ k1AudioTracks,
+ k1AudioTracksIntro,
- kKyra1TownsSFXwdTable,
- kKyra1TownsSFXbtTable,
- kKyra1TownsCDATable,
- kCreditsStrings,
+ k1TownsSFXwdTable,
+ k1TownsSFXbtTable,
+ k1TownsCDATable,
+ k1CreditsStrings,
k2SeqplayPakFiles,
k2SeqplayCredits,
@@ -229,6 +255,15 @@ enum kKyraResources {
k2IngameShapeAnimData,
k2IngameTlkDemoStrings,
+ k3MainMenuStrings,
+ k3MusicFiles,
+ k3ScoreTable,
+ k3SfxFiles,
+ k3SfxMap,
+ k3ItemAnimData,
+ k3ItemMagicTable,
+ k3ItemStringMap,
+
kMaxResIDs
};
@@ -239,7 +274,7 @@ class StaticResource {
public:
static const Common::String staticDataFilename() { return "kyra.dat"; }
- StaticResource(KyraEngine *vm) : _vm(vm), _resList(), _fileLoader(0), _builtIn(0), _filenameTable(0) {}
+ StaticResource(KyraEngine_v1 *vm) : _vm(vm), _resList(), _fileLoader(0), _builtIn(0), _filenameTable(0) {}
~StaticResource() { deinit(); }
static bool checkKyraDat();
@@ -253,8 +288,8 @@ public:
const Room *loadRoomTable(int id, int &entries);
const uint8 * const*loadPaletteTable(int id, int &entries);
const HofSeqData *loadHofSequenceData(int id, int &entries);
- const ItemAnimData_v1 *loadHofShapeAnimDataV1(int id, int &entries);
- const ItemAnimData_v2 *loadHofShapeAnimDataV2(int id, int &entries);
+ const ItemAnimData_v1 *loadShapeAnimData_v1(int id, int &entries);
+ const ItemAnimData_v2 *loadShapeAnimData_v2(int id, int &entries);
// use '-1' to prefetch/unload all ids
// prefetchId retruns false if only on of the resources
@@ -263,9 +298,9 @@ public:
bool prefetchId(int id);
void unloadId(int id);
private:
- void outputError();
+ void outputError(const Common::String &error);
- KyraEngine *_vm;
+ KyraEngine_v1 *_vm;
struct FilenameTable;
struct ResData;
@@ -284,8 +319,8 @@ private:
bool loadRoomTable(const char *filename, void *&ptr, int &size);
bool loadPaletteTable(const char *filename, void *&ptr, int &size);
bool loadHofSequenceData(const char *filename, void *&ptr, int &size);
- bool loadHofShapeAnimDataV1(const char *filename, void *&ptr, int &size);
- bool loadHofShapeAnimDataV2(const char *filename, void *&ptr, int &size);
+ bool loadShapeAnimData_v1(const char *filename, void *&ptr, int &size);
+ bool loadShapeAnimData_v2(const char *filename, void *&ptr, int &size);
void freeRawData(void *&ptr, int &size);
void freeStringTable(void *&ptr, int &size);
@@ -354,3 +389,4 @@ private:
+
diff --git a/engines/kyra/saveload.cpp b/engines/kyra/saveload.cpp
index fa3266685f..22f934ba69 100644
--- a/engines/kyra/saveload.cpp
+++ b/engines/kyra/saveload.cpp
@@ -27,9 +27,9 @@
#include "common/savefile.h"
#include "common/system.h"
-#include "kyra/kyra.h"
+#include "kyra/kyra_v1.h"
-#define CURRENT_SAVE_VERSION 11
+#define CURRENT_SAVE_VERSION 13
#define GF_FLOPPY (1 << 0)
#define GF_TALKIE (1 << 1)
@@ -37,7 +37,7 @@
namespace Kyra {
-KyraEngine::kReadSaveHeaderError KyraEngine::readSaveHeader(Common::InSaveFile *in, SaveHeader &header) {
+KyraEngine_v1::kReadSaveHeaderError KyraEngine_v1::readSaveHeader(Common::InSaveFile *in, SaveHeader &header) {
uint32 type = in->readUint32BE();
header.originalSave = false;
header.oldHeader = false;
@@ -70,6 +70,11 @@ KyraEngine::kReadSaveHeaderError KyraEngine::readSaveHeader(Common::InSaveFile *
header.description = descriptionBuffer;
header.gameID = GI_KYRA2;
break;
+ } else if (type == MKID_BE('MBL4') && header.version == 102) {
+ saveOk = true;
+ header.description = descriptionBuffer;
+ header.gameID = GI_KYRA3;
+ break;
}
}
@@ -103,14 +108,14 @@ KyraEngine::kReadSaveHeaderError KyraEngine::readSaveHeader(Common::InSaveFile *
return (in->ioFailed() ? kRSHEIoError : kRSHENoError);
}
-Common::InSaveFile *KyraEngine::openSaveForReading(const char *filename, SaveHeader &header) {
- debugC(9, kDebugLevelMain, "KyraEngine::openSaveForReading('%s', -)", filename);
+Common::InSaveFile *KyraEngine_v1::openSaveForReading(const char *filename, SaveHeader &header) {
+ debugC(9, kDebugLevelMain, "KyraEngine_v1::openSaveForReading('%s', -)", filename);
Common::InSaveFile *in = 0;
if (!(in = _saveFileMan->openForLoading(filename)))
return 0;
- kReadSaveHeaderError errorCode = KyraEngine::readSaveHeader(in, header);
+ kReadSaveHeaderError errorCode = KyraEngine_v1::readSaveHeader(in, header);
if (errorCode != kRSHENoError) {
if (errorCode == kRSHEInvalidType)
warning("No ScummVM Kyra engine savefile header.");
@@ -154,8 +159,8 @@ Common::InSaveFile *KyraEngine::openSaveForReading(const char *filename, SaveHea
return in;
}
-Common::OutSaveFile *KyraEngine::openSaveForWriting(const char *filename, const char *saveName) const {
- debugC(9, kDebugLevelMain, "KyraEngine::openSaveForWriting('%s', '%s')", filename, saveName);
+Common::OutSaveFile *KyraEngine_v1::openSaveForWriting(const char *filename, const char *saveName) const {
+ debugC(9, kDebugLevelMain, "KyraEngine_v1::openSaveForWriting('%s', '%s')", filename, saveName);
if (_quitFlag)
return 0;
@@ -186,7 +191,7 @@ Common::OutSaveFile *KyraEngine::openSaveForWriting(const char *filename, const
return out;
}
-const char *KyraEngine::getSavegameFilename(int num) {
+const char *KyraEngine_v1::getSavegameFilename(int num) {
static Common::String filename;
assert(num >= 0 && num <= 999);
@@ -199,7 +204,7 @@ const char *KyraEngine::getSavegameFilename(int num) {
return filename.c_str();
}
-bool KyraEngine::saveFileLoadable(int slot) {
+bool KyraEngine_v1::saveFileLoadable(int slot) {
if (slot < 0 || slot > 999)
return false;
diff --git a/engines/kyra/saveload_v1.cpp b/engines/kyra/saveload_lok.cpp
index 7e871876a0..8af73acc61 100644
--- a/engines/kyra/saveload_v1.cpp
+++ b/engines/kyra/saveload_lok.cpp
@@ -27,16 +27,16 @@
#include "common/savefile.h"
#include "common/system.h"
-#include "kyra/kyra_v1.h"
-#include "kyra/animator_v1.h"
+#include "kyra/kyra_lok.h"
+#include "kyra/animator_lok.h"
#include "kyra/screen.h"
#include "kyra/resource.h"
#include "kyra/sound.h"
#include "kyra/timer.h"
namespace Kyra {
-void KyraEngine_v1::loadGame(const char *fileName) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::loadGame('%s')", fileName);
+void KyraEngine_LoK::loadGame(const char *fileName) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::loadGame('%s')", fileName);
SaveHeader header;
Common::InSaveFile *in = openSaveForReading(fileName, header);
@@ -183,7 +183,7 @@ void KyraEngine_v1::loadGame(const char *fileName) {
_screen->copyRegion(0, 0, 0, 0, 320, 200, 8, 0);
}
- createMouseItem(_itemInHand);
+ setHandItem(_itemInHand);
_animator->setBrandonAnimSeqSize(3, 48);
redrawInventory(0);
_animator->_noDrawShapesFlag = 1;
@@ -218,8 +218,8 @@ void KyraEngine_v1::loadGame(const char *fileName) {
delete in;
}
-void KyraEngine_v1::saveGame(const char *fileName, const char *saveName) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::saveGame('%s', '%s')", fileName, saveName);
+void KyraEngine_LoK::saveGame(const char *fileName, const char *saveName) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::saveGame('%s', '%s')", fileName, saveName);
if (_quitFlag)
return;
diff --git a/engines/kyra/saveload_mr.cpp b/engines/kyra/saveload_mr.cpp
index 8b727862a5..51efc33723 100644
--- a/engines/kyra/saveload_mr.cpp
+++ b/engines/kyra/saveload_mr.cpp
@@ -49,15 +49,16 @@ void KyraEngine_MR::saveGame(const char *fileName, const char *saveName) {
out->writeSint16BE(_lastMusicCommand);
out->writeByte(_currentChapter);
out->writeByte(_characterShapeFile);
- //XXX
+ out->writeByte(_album.curPage);
out->writeSint16BE(_score);
out->writeSint16BE(_scoreMax);
out->writeByte(_malcolmsMood);
- out->write(_conversationState, sizeof(_conversationState));
- out->write(_newSceneDlgState, sizeof(_newSceneDlgState));
+ for (int i = 0; i < 30; ++i)
+ out->write(_conversationState[i], 30);
+ out->write(_newSceneDlgState, 40);
for (int i = 0; i < 100; ++i)
out->writeUint16BE(_hiddenItems[i]);
- out->write(_scoreFlagTable, sizeof(_scoreFlagTable));
+ out->write(_scoreFlagTable, 26);
out->writeUint16BE(_mainCharacter.sceneId);
out->writeSint16BE(_mainCharacter.dlgIndex);
@@ -88,6 +89,7 @@ void KyraEngine_MR::saveGame(const char *fileName, const char *saveName) {
out->writeSint16BE(_talkObjectList[i].x);
out->writeSint16BE(_talkObjectList[i].y);
out->writeByte(_talkObjectList[i].color);
+ out->writeByte(_talkObjectList[i].sceneId);
}
for (int i = 0; i < 98; ++i) {
@@ -129,6 +131,9 @@ void KyraEngine_MR::loadGame(const char *fileName) {
return;
}
+ if (header.originalSave)
+ warning("Trying to load savegame from original interpreter, while this is possible, it is not officially supported");
+
if (_inventoryState) {
updateCharacterAnim(0);
restorePage3();
@@ -148,32 +153,58 @@ void KyraEngine_MR::loadGame(const char *fileName) {
_screen->hideMouse();
- _timer->loadDataFromFile(in, header.version);
+ if (!header.originalSave) {
+ _timer->loadDataFromFile(in, header.version);
- uint32 flagsSize = in.readUint32BE();
- assert(flagsSize <= sizeof(_flagsTable));
- in.read(_flagsTable, flagsSize);
+ uint32 flagsSize = in.readUint32BE();
+ assert(flagsSize <= sizeof(_flagsTable));
+ in.read(_flagsTable, flagsSize);
+ }
- // usually we have to save the flag set by opcode 10 here
_lastMusicCommand = in.readSint16();
_currentChapter = in.readByte();
_characterShapeFile = in.readByte();
- //XXX
+
+ if (header.version >= 12 || header.originalSave)
+ _album.curPage = in.readByte();
+ if (header.originalSave)
+ in.readByte();
+
_score = in.readSint16();
_scoreMax = in.readSint16();
_malcolmsMood = in.readByte();
- in.read(_conversationState, sizeof(_conversationState));
- in.read(_newSceneDlgState, sizeof(_newSceneDlgState));
+
+ if (header.originalSave)
+ in.seek(8, SEEK_CUR);
+
+ for (int i = 0; i < 30; ++i)
+ in.read(_conversationState[i], 30);
+
+ if (!header.originalSave) {
+ in.read(_newSceneDlgState, 40);
+ } else {
+ for (int i = 0; i < 40; ++i)
+ _newSceneDlgState[i] = in.readUint16();
+ }
+
for (int i = 0; i < 100; ++i)
_hiddenItems[i] = in.readUint16();
- in.read(_scoreFlagTable, sizeof(_scoreFlagTable));
+
+ if (header.originalSave)
+ in.read(_flagsTable, 69);
+ in.read(_scoreFlagTable, 26);
_mainCharacter.sceneId = in.readUint16();
_mainCharacter.dlgIndex = in.readSint16();
_mainCharacter.height = in.readByte();
_mainCharacter.facing = in.readByte();
_mainCharacter.animFrame = in.readUint16();
- _mainCharacter.walkspeed = in.readByte();
+ if (!header.originalSave) {
+ _mainCharacter.walkspeed = in.readByte();
+ } else {
+ in.seek(2, SEEK_CUR);
+ _mainCharacter.walkspeed = in.readUint32();
+ }
for (int i = 0; i < 10; ++i)
_mainCharacter.inventory[i] = in.readUint16();
_mainCharacter.x1 = in.readSint16();
@@ -188,7 +219,7 @@ void KyraEngine_MR::loadGame(const char *fileName) {
_itemList[i].sceneId = in.readUint16();
_itemList[i].x = in.readSint16();
_itemList[i].y = in.readSint16();
- if (header.version <= 9)
+ if (header.version <= 9 || header.originalSave)
in.readUint16();
}
@@ -199,11 +230,25 @@ void KyraEngine_MR::loadGame(const char *fileName) {
_talkObjectList[i].x = in.readSint16();
_talkObjectList[i].y = in.readSint16();
_talkObjectList[i].color = in.readByte();
+ if (header.version >= 13 || header.originalSave)
+ _talkObjectList[i].sceneId = in.readByte();
}
for (int i = 0; i < 98; ++i) {
- in.read(_sceneList[i].filename1, 10);
- in.read(_sceneList[i].filename2, 10);
+ if (!header.originalSave) {
+ in.read(_sceneList[i].filename1, 10);
+ } else {
+ in.read(_sceneList[i].filename1, 9);
+ _sceneList[i].filename1[9] = 0;
+ }
+
+ if (!header.originalSave) {
+ in.read(_sceneList[i].filename2, 10);
+ } else {
+ in.read(_sceneList[i].filename2, 9);
+ _sceneList[i].filename2[9] = 0;
+ }
+
_sceneList[i].exit1 = in.readUint16();
_sceneList[i].exit2 = in.readUint16();
_sceneList[i].exit3 = in.readUint16();
@@ -213,6 +258,26 @@ void KyraEngine_MR::loadGame(const char *fileName) {
}
_itemInHand = in.readSint16();
+
+ if (header.originalSave) {
+ uint32 currentTime = _system->getMillis();
+
+ for (int i = 0; i < 6; ++i)
+ _timer->setDelay(i, in.readSint32LE());
+
+ for (int i = 0; i < 6; ++i) {
+ if (in.readUint16LE())
+ _timer->enable(i);
+ else
+ _timer->disable(i);
+ }
+
+ for (int i = 0; i < 6; ++i)
+ _timer->setNextRun(i, currentTime + (in.readUint32LE() * _tickLength));
+
+ _timer->resetNextRun();
+ }
+
_sceneExit1 = in.readUint16();
_sceneExit2 = in.readUint16();
_sceneExit3 = in.readUint16();
diff --git a/engines/kyra/scene.cpp b/engines/kyra/scene.cpp
deleted file mode 100644
index f3e41b2d39..0000000000
--- a/engines/kyra/scene.cpp
+++ /dev/null
@@ -1,383 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- *
- */
-
-#include "kyra/kyra.h"
-#include "kyra/screen.h"
-
-namespace Kyra {
-
-int KyraEngine::findWay(int x, int y, int toX, int toY, int *moveTable, int moveTableSize) {
- debugC(9, kDebugLevelMain, "KyraEngine::findWay(%d, %d, %d, %d, %p, %d)", x, y, toX, toY, (const void *)moveTable, moveTableSize);
- x &= 0xFFFC; toX &= 0xFFFC;
- y &= 0xFFFE; toY &= 0xFFFE;
- x = (int16)x; y = (int16)y; toX = (int16)toX; toY = (int16)toY;
-
- if (x == toY && y == toY) {
- moveTable[0] = 8;
- return 0;
- }
-
- int curX = x;
- int curY = y;
- int tempValue = 0;
- int lastUsedEntry = 0;
- int *pathTable1 = new int[0x7D0];
- int *pathTable2 = new int[0x7D0];
- assert(pathTable1 && pathTable2);
-
- while (true) {
- int newFacing = getFacingFromPointToPoint(x, y, toX, toY);
- changePosTowardsFacing(curX, curY, newFacing);
-
- if (curX == toX && curY == toY) {
- if (!lineIsPassable(curX, curY))
- break;
- moveTable[lastUsedEntry++] = newFacing;
- break;
- }
-
- if (lineIsPassable(curX, curY)) {
- if (lastUsedEntry == moveTableSize) {
- delete [] pathTable1;
- delete [] pathTable2;
- return 0x7D00;
- }
- // debug drawing
- /*if (curX >= 0 && curY >= 0 && curX < 320 && curY < 200) {
- screen()->setPagePixel(0, curX, curY, 11);
- screen()->updateScreen();
- //waitTicks(5);
- }*/
- moveTable[lastUsedEntry++] = newFacing;
- x = curX;
- y = curY;
- continue;
- }
-
- int temp = 0;
- while (true) {
- newFacing = getFacingFromPointToPoint(curX, curY, toX, toY);
- changePosTowardsFacing(curX, curY, newFacing);
- // debug drawing
- /*if (curX >= 0 && curY >= 0 && curX < 320 && curY < 200) {
- screen()->setPagePixel(0, curX, curY, 8);
- screen()->updateScreen();
- //waitTicks(5);
- }*/
-
- if (!lineIsPassable(curX, curY)) {
- if (curX != toX || curY != toY)
- continue;
- }
-
- if (curX == toX && curY == toY) {
- if (!lineIsPassable(curX, curY)) {
- tempValue = 0;
- temp = 0;
- break;
- }
- }
-
- temp = findSubPath(x, y, curX, curY, pathTable1, 1, 0x7D0);
- tempValue = findSubPath(x, y, curX, curY, pathTable2, 0, 0x7D0);
- if (curX == toX && curY == toY) {
- if (temp == 0x7D00 && tempValue == 0x7D00) {
- delete [] pathTable1;
- delete [] pathTable2;
- return 0x7D00;
- }
- }
-
- if (temp != 0x7D00 || tempValue != 0x7D00)
- break;
- }
-
- if (temp < tempValue) {
- if (lastUsedEntry + temp > moveTableSize) {
- delete [] pathTable1;
- delete [] pathTable2;
- return 0x7D00;
- }
- memcpy(&moveTable[lastUsedEntry], pathTable1, temp*sizeof(int));
- lastUsedEntry += temp;
- } else {
- if (lastUsedEntry + tempValue > moveTableSize) {
- delete [] pathTable1;
- delete [] pathTable2;
- return 0x7D00;
- }
- memcpy(&moveTable[lastUsedEntry], pathTable2, tempValue*sizeof(int));
- lastUsedEntry += tempValue;
- }
- x = curX;
- y = curY;
- if (curX == toX && curY == toY)
- break;
- }
-
- delete [] pathTable1;
- delete [] pathTable2;
- moveTable[lastUsedEntry] = 8;
- return lastUsedEntry;
-}
-
-int KyraEngine::findSubPath(int x, int y, int toX, int toY, int *moveTable, int start, int end) {
- debugC(9, kDebugLevelMain, "KyraEngine::findSubPath(%d, %d, %d, %d, %p, %d, %d)", x, y, toX, toY, (const void *)moveTable, start, end);
- // only used for debug specific code
- //static uint16 unkTable[] = { 8, 5 };
- static const int8 facingTable1[] = { 7, 0, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 7, 0 };
- static const int8 facingTable2[] = { -1, 0, -1, 2, -1, 4, -1, 6, -1, 2, -1, 4, -1, 6, -1, 0 };
- static const int8 facingTable3[] = { 2, 4, 4, 6, 6, 0, 0, 2, 6, 6, 0, 0, 2, 2, 4, 4 };
- static const int8 addPosTableX[] = { -1, 0, -1, 4, -1, 0, -1, -4, -1, -4, -1, 0, -1, 4, -1, 0 };
- static const int8 addPosTableY[] = { -1, 2, -1, 0, -1, -2, -1, 0, -1, 0, -1, 2, -1, 0, -1, -2 };
-
- // debug specific
- /*++unkTable[start];
- while (screen()->getPalette(0)[unkTable[start]] != 0x0F) {
- ++unkTable[start];
- }*/
-
- int xpos1 = x, xpos2 = x;
- int ypos1 = y, ypos2 = y;
- int newFacing = getFacingFromPointToPoint(x, y, toX, toY);
- int position = 0;
-
- while (position != end) {
- int newFacing2 = newFacing;
- while (true) {
- changePosTowardsFacing(xpos1, ypos1, facingTable1[start*8 + newFacing2]);
- if (!lineIsPassable(xpos1, ypos1)) {
- if (facingTable1[start*8 + newFacing2] == newFacing)
- return 0x7D00;
- newFacing2 = facingTable1[start*8 + newFacing2];
- xpos1 = x;
- ypos1 = y;
- continue;
- }
- newFacing = facingTable1[start*8 + newFacing2];
- break;
- }
- // debug drawing
- /*if (xpos1 >= 0 && ypos1 >= 0 && xpos1 < 320 && ypos1 < 200) {
- screen()->setPagePixel(0, xpos1, ypos1, unkTable[start]);
- screen()->updateScreen();
- //waitTicks(5);
- }*/
- if (newFacing & 1) {
- int temp = xpos1 + addPosTableX[newFacing + start * 8];
- if (toX == temp) {
- temp = ypos1 + addPosTableY[newFacing + start * 8];
- if (toY == temp) {
- moveTable[position++] = facingTable2[newFacing + start * 8];
- return position;
- }
- }
- }
-
- moveTable[position++] = newFacing;
- x = xpos1;
- y = ypos1;
-
- if (x == toX && y == toY)
- return position;
-
- if (xpos1 == xpos2 && ypos1 == ypos2)
- break;
-
- newFacing = facingTable3[start*8 + newFacing];
- }
-
- return 0x7D00;
-}
-
-int KyraEngine::getFacingFromPointToPoint(int x, int y, int toX, int toY) {
- debugC(9, kDebugLevelMain, "KyraEngine::getFacingFromPointToPoint(%d, %d, %d, %d)", x, y, toX, toY);
- static const int facingTable[] = {
- 1, 0, 1, 2, 3, 4, 3, 2, 7, 0, 7, 6, 5, 4, 5, 6
- };
-
- int facingEntry = 0;
- int ydiff = y - toY;
- if (ydiff < 0) {
- ++facingEntry;
- ydiff = -ydiff;
- }
- facingEntry <<= 1;
-
- int xdiff = toX - x;
- if (xdiff < 0) {
- ++facingEntry;
- xdiff = -xdiff;
- }
-
- if (xdiff >= ydiff) {
- int temp = ydiff;
- ydiff = xdiff;
- xdiff = temp;
-
- facingEntry <<= 1;
- } else {
- facingEntry <<= 1;
- facingEntry += 1;
- }
- int temp = (ydiff + 1) >> 1;
-
- if (xdiff < temp) {
- facingEntry <<= 1;
- facingEntry += 1;
- } else {
- facingEntry <<= 1;
- }
-
- assert(facingEntry < ARRAYSIZE(facingTable));
- return facingTable[facingEntry];
-}
-
-
-int KyraEngine::getOppositeFacingDirection(int dir) {
- debugC(9, kDebugLevelMain, "KyraEngine::getOppositeFacingDirection(%d)", dir);
- switch (dir) {
- case 0:
- return 2;
- case 1:
- return 1;
- case 3:
- return 7;
- case 4:
- return 6;
- case 5:
- return 5;
- case 6:
- return 4;
- case 7:
- return 3;
- default:
- break;
- }
- return 0;
-}
-
-void KyraEngine::changePosTowardsFacing(int &x, int &y, int facing) {
- debugC(9, kDebugLevelMain, "KyraEngine::changePosTowardsFacing(%d, %d, %d)", x, y, facing);
- x += _addXPosTable[facing];
- y += _addYPosTable[facing];
-}
-
-int KyraEngine::getMoveTableSize(int *moveTable) {
- debugC(9, kDebugLevelMain, "KyraEngine::getMoveTableSize(%p)", (const void *)moveTable);
- int retValue = 0;
- if (moveTable[0] == 8)
- return 0;
-
- static const int facingTable[] = {
- 4, 5, 6, 7, 0, 1, 2, 3
- };
- static const int unkTable[] = {
- -1, -1, 1, 2, -1, 6, 7, -1,
- -1, -1, -1, -1, 2, -1, 0, -1,
- 1, -1, -1, -1, 3, 4, -1, 0,
- 2, -1, -1, -1, -1, -1, 4, -1,
- -1, 2, 3, -1, -1, -1, 5, 6,
- 6, -1, 4, -1, -1, -1, -1, -1,
- 7, 0, -1, 4, 5, -1, -1, -1,
- -1, -1, 0, -1, 6, -1, -1, -1
- };
-
- int *oldPosition = moveTable;
- int *tempPosition = moveTable;
- int *curPosition = moveTable + 1;
- retValue = 1;
-
- while (*curPosition != 8) {
- if (*oldPosition == facingTable[*curPosition]) {
- retValue -= 2;
- *oldPosition = 9;
- *curPosition = 9;
-
- while (tempPosition != moveTable) {
- --tempPosition;
- if (*tempPosition != 9)
- break;
- }
-
- if (tempPosition == moveTable && *tempPosition == 9) {
- while (*tempPosition != 8 && *tempPosition == 9)
- ++tempPosition;
-
- if (*tempPosition == 8)
- return 0;
- }
-
- oldPosition = tempPosition;
- curPosition = oldPosition+1;
-
- while (*curPosition != 8 && *curPosition == 9)
- ++curPosition;
-
- continue;
- }
-
- if (unkTable[*curPosition+((*oldPosition)*8)] != -1) {
- --retValue;
- *oldPosition = unkTable[*curPosition+((*oldPosition)*8)];
- *curPosition = 9;
-
- if (tempPosition != oldPosition) {
- curPosition = oldPosition;
- oldPosition = tempPosition;
- while (true) {
- if (tempPosition == moveTable)
- break;
-
- --tempPosition;
- if (*tempPosition != 9)
- break;
-
- }
- } else {
- while (true) {
- ++curPosition;
- if (*curPosition != 9)
- break;
- }
- }
- continue;
- }
-
- tempPosition = oldPosition;
- oldPosition = curPosition;
- ++retValue;
-
- while (true) {
- ++curPosition;
- if (*curPosition != 9)
- break;
- }
- }
-
- return retValue;
-}
-
-} // end of namespace Kyra
diff --git a/engines/kyra/scene_hof.cpp b/engines/kyra/scene_hof.cpp
index 3fc7947253..1882386b03 100644
--- a/engines/kyra/scene_hof.cpp
+++ b/engines/kyra/scene_hof.cpp
@@ -98,7 +98,7 @@ void KyraEngine_HoF::enterNewScene(uint16 newScene, int facing, int unk1, int un
_emc->run(&_sceneScriptState);
}
- Common::for_each(_wsaSlots, _wsaSlots+ARRAYSIZE(_wsaSlots), Common::mem_fun(&WSAMovieV2::close));
+ Common::for_each(_wsaSlots, _wsaSlots+ARRAYSIZE(_wsaSlots), Common::mem_fun(&WSAMovie_v2::close));
_specialExitCount = 0;
memset(_specialExitTable, -1, sizeof(_specialExitTable));
@@ -322,6 +322,8 @@ int KyraEngine_HoF::trySceneChange(int *moveTable, int unk1, int updateChar) {
refreshAnimObjectsIfNeed();
updateType = -1;
}
+
+ delay(10);
}
if (updateChar)
@@ -702,7 +704,7 @@ void KyraEngine_HoF::initSceneScreen(int unk1) {
void KyraEngine_HoF::freeSceneShapePtrs() {
debugC(9, kDebugLevelMain, "KyraEngine_HoF::freeSceneShapePtrs()");
for (int i = 0; i < ARRAYSIZE(_sceneShapeTable); ++i)
- delete [] _sceneShapeTable[i];
+ delete[] _sceneShapeTable[i];
memset(_sceneShapeTable, 0, sizeof(_sceneShapeTable));
}
diff --git a/engines/kyra/scene_lok.cpp b/engines/kyra/scene_lok.cpp
new file mode 100644
index 0000000000..e4ae67f751
--- /dev/null
+++ b/engines/kyra/scene_lok.cpp
@@ -0,0 +1,1284 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "kyra/kyra_lok.h"
+#include "kyra/seqplayer.h"
+#include "kyra/screen.h"
+#include "kyra/resource.h"
+#include "kyra/sound.h"
+#include "kyra/sprites.h"
+#include "kyra/wsamovie.h"
+#include "kyra/animator_lok.h"
+#include "kyra/text.h"
+#include "kyra/script.h"
+#include "kyra/timer.h"
+
+#include "common/system.h"
+#include "common/savefile.h"
+
+namespace Kyra {
+
+void KyraEngine_LoK::enterNewScene(int sceneId, int facing, int unk1, int unk2, int brandonAlive) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::enterNewScene(%d, %d, %d, %d, %d)", sceneId, facing, unk1, unk2, brandonAlive);
+ int unkVar1 = 1;
+ _screen->hideMouse();
+ _handleInput = false;
+ _abortWalkFlag = false;
+ _abortWalkFlag2 = false;
+
+ if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98) {
+ int newSfxFile = -1;
+ if (_currentCharacter->sceneId == 7 && sceneId == 24)
+ newSfxFile = 2;
+ else if (_currentCharacter->sceneId == 25 && sceneId == 109)
+ newSfxFile = 3;
+ else if (_currentCharacter->sceneId == 120 && sceneId == 37)
+ newSfxFile = 4;
+ else if (_currentCharacter->sceneId == 52 && sceneId == 199)
+ newSfxFile = 5;
+ else if (_currentCharacter->sceneId == 37 && sceneId == 120)
+ newSfxFile = 3;
+ else if (_currentCharacter->sceneId == 109 && sceneId == 25)
+ newSfxFile = 2;
+ else if (_currentCharacter->sceneId == 24 && sceneId == 7)
+ newSfxFile = 1;
+
+ if (newSfxFile != -1) {
+ _curSfxFile = newSfxFile;
+ _sound->loadSoundFile(_curSfxFile);
+ }
+ }
+
+ switch (_currentCharacter->sceneId) {
+ case 1:
+ if (sceneId == 0) {
+ moveCharacterToPos(0, 0, _currentCharacter->x1, 84);
+ unkVar1 = 0;
+ }
+ break;
+
+ case 3:
+ if (sceneId == 2) {
+ moveCharacterToPos(0, 6, 155, _currentCharacter->y1);
+ unkVar1 = 0;
+ }
+ break;
+
+ case 26:
+ if (sceneId == 27) {
+ moveCharacterToPos(0, 6, 155, _currentCharacter->y1);
+ unkVar1 = 0;
+ }
+ break;
+
+ case 44:
+ if (sceneId == 45) {
+ moveCharacterToPos(0, 2, 192, _currentCharacter->y1);
+ unkVar1 = 0;
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ if (unkVar1 && unk1) {
+ int xpos = _currentCharacter->x1;
+ int ypos = _currentCharacter->y1;
+ switch (facing) {
+ case 0:
+ ypos = _currentCharacter->y1 - 6;
+ break;
+
+ case 2:
+ xpos = 336;
+ break;
+
+ case 4:
+ ypos = 143;
+ break;
+
+ case 6:
+ xpos = -16;
+ break;
+
+ default:
+ break;
+ }
+
+ moveCharacterToPos(0, facing, xpos, ypos);
+ }
+
+ for (int i = 0; i < ARRAYSIZE(_movieObjects); ++i)
+ _movieObjects[i]->close();
+
+ if (!brandonAlive) {
+ _emc->init(&_scriptClick, &_scriptClickData);
+ _emc->start(&_scriptClick, 5);
+ while (_emc->isValid(&_scriptClick))
+ _emc->run(&_scriptClick);
+ }
+
+ memset(_entranceMouseCursorTracks, 0xFFFF, sizeof(uint16)*4);
+ _currentCharacter->sceneId = sceneId;
+
+ assert(sceneId < _roomTableSize);
+ assert(_roomTable[sceneId].nameIndex < _roomFilenameTableSize);
+
+ Room *currentRoom = &_roomTable[sceneId];
+
+ setupSceneResource(sceneId);
+
+ _currentRoom = sceneId;
+
+ int tableId = _roomTable[sceneId].nameIndex;
+ char fileNameBuffer[32];
+ strcpy(fileNameBuffer, _roomFilenameTable[tableId]);
+ strcat(fileNameBuffer, ".DAT");
+ _sprites->loadDat(fileNameBuffer, _sceneExits);
+ _sprites->setupSceneAnims();
+ _emc->unload(&_scriptClickData);
+ loadSceneMsc();
+
+ _walkBlockNorth = currentRoom->northExit;
+ _walkBlockEast = currentRoom->eastExit;
+ _walkBlockSouth = currentRoom->southExit;
+ _walkBlockWest = currentRoom->westExit;
+
+ if (_walkBlockNorth == 0xFFFF)
+ _screen->blockOutRegion(0, 0, 320, (_northExitHeight & 0xFF)+3);
+ if (_walkBlockEast == 0xFFFF)
+ _screen->blockOutRegion(312, 0, 8, 139);
+ if (_walkBlockSouth == 0xFFFF)
+ _screen->blockOutRegion(0, 135, 320, 8);
+ if (_walkBlockWest == 0xFFFF)
+ _screen->blockOutRegion(0, 0, 8, 139);
+
+ if (!brandonAlive)
+ updatePlayerItemsForScene();
+
+ startSceneScript(brandonAlive);
+ setupSceneItems();
+
+ initSceneData(facing, unk2, brandonAlive);
+
+ _loopFlag2 = 0;
+ _screen->showMouse();
+ if (!brandonAlive)
+ seq_poisonDeathNow(0);
+ updateMousePointer(true);
+ _changedScene = true;
+}
+
+void KyraEngine_LoK::transcendScenes(int roomIndex, int roomName) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::transcendScenes(%d, %d)", roomIndex, roomName);
+ assert(roomIndex < _roomTableSize);
+
+ if (_flags.isTalkie) {
+ char file[32];
+ assert(roomIndex < _roomTableSize);
+ int tableId = _roomTable[roomIndex].nameIndex;
+ assert(tableId < _roomFilenameTableSize);
+ strcpy(file, _roomFilenameTable[tableId]);
+ strcat(file, ".VRM");
+ _res->unloadPakFile(file);
+ }
+
+ _roomTable[roomIndex].nameIndex = roomName;
+ _unkScreenVar2 = 1;
+ _unkScreenVar3 = 1;
+ _unkScreenVar1 = 0;
+ _brandonPosX = _currentCharacter->x1;
+ _brandonPosY = _currentCharacter->y1;
+ enterNewScene(roomIndex, _currentCharacter->facing, 0, 0, 0);
+ _unkScreenVar1 = 1;
+ _unkScreenVar2 = 0;
+ _unkScreenVar3 = 0;
+}
+
+void KyraEngine_LoK::setSceneFile(int roomIndex, int roomName) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::setSceneFile(%d, %d)", roomIndex, roomName);
+ assert(roomIndex < _roomTableSize);
+ _roomTable[roomIndex].nameIndex = roomName;
+}
+
+void KyraEngine_LoK::moveCharacterToPos(int character, int facing, int xpos, int ypos) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::moveCharacterToPos(%d, %d, %d, %d)", character, facing, xpos, ypos);
+ Character *ch = &_characterList[character];
+ ch->facing = facing;
+ _screen->hideMouse();
+ xpos = (int16)(xpos & 0xFFFC);
+ ypos = (int16)(ypos & 0xFFFE);
+ _timer->disable(19);
+ _timer->disable(14);
+ _timer->disable(18);
+ uint32 nextFrame = 0;
+
+ switch (facing) {
+ case 0:
+ while (ypos < ch->y1) {
+ nextFrame = _timer->getDelay(5 + character) * _tickLength + _system->getMillis();
+ setCharacterPositionWithUpdate(character);
+ delayUntil(nextFrame, true);
+ }
+ break;
+
+ case 2:
+ while (ch->x1 < xpos) {
+ nextFrame = _timer->getDelay(5 + character) * _tickLength + _system->getMillis();
+ setCharacterPositionWithUpdate(character);
+ delayUntil(nextFrame, true);
+ }
+ break;
+
+ case 4:
+ while (ypos > ch->y1) {
+ nextFrame = _timer->getDelay(5 + character) * _tickLength + _system->getMillis();
+ setCharacterPositionWithUpdate(character);
+ delayUntil(nextFrame, true);
+ }
+ break;
+
+ case 6:
+ while (ch->x1 > xpos) {
+ nextFrame = _timer->getDelay(5 + character) * _tickLength + _system->getMillis();
+ setCharacterPositionWithUpdate(character);
+ delayUntil(nextFrame, true);
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ _timer->enable(19);
+ _timer->enable(14);
+ _timer->enable(18);
+ _screen->showMouse();
+}
+
+void KyraEngine_LoK::setCharacterPositionWithUpdate(int character) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::setCharacterPositionWithUpdate(%d)", character);
+ setCharacterPosition(character, 0);
+ _sprites->updateSceneAnims();
+ _timer->update();
+ _animator->updateAllObjectShapes();
+ updateTextFade();
+
+ if (_currentCharacter->sceneId == 210)
+ updateKyragemFading();
+}
+
+int KyraEngine_LoK::setCharacterPosition(int character, int *facingTable) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::setCharacterPosition(%d, %p)", character, (const void *)facingTable);
+
+ if (character == 0) {
+ _currentCharacter->x1 += _charAddXPosTable[_currentCharacter->facing];
+ _currentCharacter->y1 += _charAddYPosTable[_currentCharacter->facing];
+ setCharacterPositionHelper(0, facingTable);
+ return 1;
+ } else {
+ _characterList[character].x1 += _charAddXPosTable[_characterList[character].facing];
+ _characterList[character].y1 += _charAddYPosTable[_characterList[character].facing];
+ if (_characterList[character].sceneId == _currentCharacter->sceneId)
+ setCharacterPositionHelper(character, 0);
+ }
+ return 0;
+}
+
+void KyraEngine_LoK::setCharacterPositionHelper(int character, int *facingTable) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::setCharacterPositionHelper(%d, %p)", character, (const void *)facingTable);
+ Character *ch = &_characterList[character];
+ ++ch->currentAnimFrame;
+ int facing = ch->facing;
+ if (facingTable) {
+ if (*facingTable != *(facingTable - 1)) {
+ if (*(facingTable - 1) == *(facingTable + 1)) {
+ facing = getOppositeFacingDirection(*(facingTable - 1));
+ *facingTable = *(facingTable - 1);
+ }
+ }
+ }
+
+ static uint8 facingIsZero[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
+ static uint8 facingIsFour[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
+
+ if (facing == 0) {
+ ++facingIsZero[character];
+ } else {
+ bool resetTables = false;
+ if (facing != 7) {
+ if (facing - 1 != 0) {
+ if (facing != 4) {
+ if (facing == 3 || facing == 5) {
+ if (facingIsFour[character] > 2)
+ facing = 4;
+ resetTables = true;
+ }
+ } else {
+ ++facingIsFour[character];
+ }
+ } else {
+ if (facingIsZero[character] > 2)
+ facing = 0;
+ resetTables = true;
+ }
+ } else {
+ if (facingIsZero[character] > 2)
+ facing = 0;
+ resetTables = true;
+ }
+
+ if (resetTables) {
+ facingIsZero[character] = 0;
+ facingIsFour[character] = 0;
+ }
+ }
+
+ static const uint16 maxAnimationFrame[] = {
+ 0x000F, 0x0031, 0x0055, 0x0000, 0x0000, 0x0000,
+ 0x0008, 0x002A, 0x004E, 0x0000, 0x0000, 0x0000,
+ 0x0022, 0x0046, 0x006A, 0x0000, 0x0000, 0x0000,
+ 0x001D, 0x0041, 0x0065, 0x0000, 0x0000, 0x0000,
+ 0x001F, 0x0043, 0x0067, 0x0000, 0x0000, 0x0000,
+ 0x0028, 0x004C, 0x0070, 0x0000, 0x0000, 0x0000,
+ 0x0023, 0x0047, 0x006B, 0x0000, 0x0000, 0x0000
+ };
+
+ if (facing == 0) {
+ if (maxAnimationFrame[36+character] > ch->currentAnimFrame)
+ ch->currentAnimFrame = maxAnimationFrame[36+character];
+ if (maxAnimationFrame[30+character] < ch->currentAnimFrame)
+ ch->currentAnimFrame = maxAnimationFrame[36+character];
+ } else if (facing == 4) {
+ if (maxAnimationFrame[18+character] > ch->currentAnimFrame)
+ ch->currentAnimFrame = maxAnimationFrame[18+character];
+ if (maxAnimationFrame[12+character] < ch->currentAnimFrame)
+ ch->currentAnimFrame = maxAnimationFrame[18+character];
+ } else {
+ if (maxAnimationFrame[18+character] < ch->currentAnimFrame)
+ ch->currentAnimFrame = maxAnimationFrame[30+character];
+ if (maxAnimationFrame[character] == ch->currentAnimFrame)
+ ch->currentAnimFrame = maxAnimationFrame[6+character];
+ if (maxAnimationFrame[character] < ch->currentAnimFrame)
+ ch->currentAnimFrame = maxAnimationFrame[6+character]+2;
+ }
+
+ if (character == 0 && (_brandonStatusBit & 0x10))
+ ch->currentAnimFrame = 88;
+
+ _animator->animRefreshNPC(character);
+}
+
+void KyraEngine_LoK::loadSceneMsc() {
+ assert(_currentCharacter->sceneId < _roomTableSize);
+ int tableId = _roomTable[_currentCharacter->sceneId].nameIndex;
+ assert(tableId < _roomFilenameTableSize);
+ char fileNameBuffer[32];
+ strcpy(fileNameBuffer, _roomFilenameTable[tableId]);
+ strcat(fileNameBuffer, ".MSC");
+ _screen->fillRect(0, 0, 319, 199, 0, 5);
+ _res->exists(fileNameBuffer, true);
+ _screen->loadBitmap(fileNameBuffer, 3, 5, 0);
+}
+
+void KyraEngine_LoK::startSceneScript(int brandonAlive) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::startSceneScript(%d)", brandonAlive);
+ assert(_currentCharacter->sceneId < _roomTableSize);
+ int tableId = _roomTable[_currentCharacter->sceneId].nameIndex;
+ assert(tableId < _roomFilenameTableSize);
+ char fileNameBuffer[32];
+ strcpy(fileNameBuffer, _roomFilenameTable[tableId]);
+ strcat(fileNameBuffer, ".CPS");
+ _screen->clearPage(3);
+ _res->exists(fileNameBuffer, true);
+ // FIXME: check this hack for amiga version
+ _screen->loadBitmap(fileNameBuffer, 3, 3, (_flags.platform == Common::kPlatformAmiga ? _screen->getPalette(0) : 0));
+ _sprites->loadSceneShapes();
+ _exitListPtr = 0;
+
+ _scaleMode = 1;
+ for (int i = 0; i < 145; ++i)
+ _scaleTable[i] = 256;
+
+ clearNoDropRects();
+ _emc->init(&_scriptClick, &_scriptClickData);
+ strcpy(fileNameBuffer, _roomFilenameTable[tableId]);
+ strcat(fileNameBuffer, ".EMC");
+ _res->exists(fileNameBuffer, true);
+ _emc->unload(&_scriptClickData);
+ _emc->load(fileNameBuffer, &_scriptClickData, &_opcodes);
+ _emc->start(&_scriptClick, 0);
+ _scriptClick.regs[0] = _currentCharacter->sceneId;
+ _scriptClick.regs[7] = brandonAlive;
+
+ while (_emc->isValid(&_scriptClick))
+ _emc->run(&_scriptClick);
+}
+
+void KyraEngine_LoK::initSceneData(int facing, int unk1, int brandonAlive) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::initSceneData(%d, %d, %d)", facing, unk1, brandonAlive);
+
+ int16 xpos2 = 0;
+ int setFacing = 1;
+
+ int16 xpos = 0, ypos = 0;
+
+ if (_brandonPosX == -1 && _brandonPosY == -1) {
+ switch (facing + 1) {
+ case 0:
+ xpos = ypos = -1;
+ break;
+
+ case 1: case 2: case 8:
+ xpos = _sceneExits.southXPos;
+ ypos = _sceneExits.southYPos;
+ break;
+
+ case 3:
+ xpos = _sceneExits.westXPos;
+ ypos = _sceneExits.westYPos;
+ break;
+
+ case 4: case 5: case 6:
+ xpos = _sceneExits.northXPos;
+ ypos = _sceneExits.northYPos;
+ break;
+
+ case 7:
+ xpos = _sceneExits.eastXPos;
+ ypos = _sceneExits.eastYPos;
+ break;
+
+ default:
+ break;
+ }
+
+ if ((uint8)(_northExitHeight & 0xFF) + 2 >= ypos)
+ ypos = (_northExitHeight & 0xFF) + 4;
+ if (xpos >= 308)
+ xpos = 304;
+ if ((uint8)(_northExitHeight >> 8) - 2 <= ypos)
+ ypos = (_northExitHeight >> 8) - 4;
+ if (xpos <= 12)
+ xpos = 16;
+ }
+
+ if (_brandonPosX > -1)
+ xpos = _brandonPosX;
+ if (_brandonPosY > -1)
+ ypos = _brandonPosY;
+
+ int16 ypos2 = 0;
+ if (_brandonPosX > -1 && _brandonPosY > -1) {
+ switch (_currentCharacter->sceneId) {
+ case 1:
+ _currentCharacter->x1 = xpos;
+ _currentCharacter->x2 = xpos;
+ _currentCharacter->y1 = ypos;
+ _currentCharacter->y2 = ypos;
+ facing = 4;
+ xpos2 = 192;
+ ypos2 = 104;
+ setFacing = 0;
+ unk1 = 1;
+ break;
+
+ case 3:
+ _currentCharacter->x1 = xpos;
+ _currentCharacter->x2 = xpos;
+ _currentCharacter->y1 = ypos;
+ _currentCharacter->y2 = ypos;
+ facing = 2;
+ xpos2 = 204;
+ ypos2 = 94;
+ setFacing = 0;
+ unk1 = 1;
+ break;
+
+ case 26:
+ _currentCharacter->x1 = xpos;
+ _currentCharacter->x2 = xpos;
+ _currentCharacter->y1 = ypos;
+ _currentCharacter->y2 = ypos;
+ facing = 2;
+ xpos2 = 192;
+ ypos2 = 128;
+ setFacing = 0;
+ unk1 = 1;
+ break;
+
+ case 44:
+ _currentCharacter->x1 = xpos;
+ _currentCharacter->x2 = xpos;
+ _currentCharacter->y1 = ypos;
+ _currentCharacter->y2 = ypos;
+ facing = 6;
+ xpos2 = 156;
+ ypos2 = 96;
+ setFacing = 0;
+ unk1 = 1;
+ break;
+
+ case 37:
+ _currentCharacter->x1 = xpos;
+ _currentCharacter->x2 = xpos;
+ _currentCharacter->y1 = ypos;
+ _currentCharacter->y2 = ypos;
+ facing = 2;
+ xpos2 = 148;
+ ypos2 = 114;
+ setFacing = 0;
+ unk1 = 1;
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ _brandonPosX = _brandonPosY = -1;
+
+ if (unk1 && setFacing) {
+ ypos2 = ypos;
+ xpos2 = xpos;
+ switch (facing) {
+ case 0:
+ ypos = 142;
+ break;
+
+ case 2:
+ xpos = -16;
+ break;
+
+ case 4:
+ ypos = (uint8)(_northExitHeight & 0xFF) - 4;
+ break;
+
+ case 6:
+ xpos = 336;
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ xpos2 = (int16)(xpos2 & 0xFFFC);
+ ypos2 = (int16)(ypos2 & 0xFFFE);
+ xpos = (int16)(xpos & 0xFFFC);
+ ypos = (int16)(ypos & 0xFFFE);
+ _currentCharacter->facing = facing;
+ _currentCharacter->x1 = xpos;
+ _currentCharacter->x2 = xpos;
+ _currentCharacter->y1 = ypos;
+ _currentCharacter->y2 = ypos;
+
+ initSceneObjectList(brandonAlive);
+
+ if (unk1 && brandonAlive == 0)
+ moveCharacterToPos(0, facing, xpos2, ypos2);
+
+ _scriptClick.regs[4] = _itemInHand;
+ _scriptClick.regs[7] = brandonAlive;
+ _emc->start(&_scriptClick, 3);
+ while (_emc->isValid(&_scriptClick))
+ _emc->run(&_scriptClick);
+}
+
+void KyraEngine_LoK::initSceneObjectList(int brandonAlive) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::initSceneObjectList(%d)", brandonAlive);
+ for (int i = 0; i < 28; ++i)
+ _animator->actors()[i].active = 0;
+
+ int startAnimFrame = 0;
+
+ Animator_LoK::AnimObject *curAnimState = _animator->actors();
+ curAnimState->active = 1;
+ curAnimState->drawY = _currentCharacter->y1;
+ curAnimState->sceneAnimPtr = _shapes[_currentCharacter->currentAnimFrame];
+ curAnimState->animFrameNumber = _currentCharacter->currentAnimFrame;
+ startAnimFrame = _currentCharacter->currentAnimFrame-7;
+ int xOffset = _defaultShapeTable[startAnimFrame].xOffset;
+ int yOffset = _defaultShapeTable[startAnimFrame].yOffset;
+
+ if (_scaleMode) {
+ curAnimState->x1 = _currentCharacter->x1;
+ curAnimState->y1 = _currentCharacter->y1;
+
+ _animator->_brandonScaleX = _scaleTable[_currentCharacter->y1];
+ _animator->_brandonScaleY = _scaleTable[_currentCharacter->y1];
+
+ curAnimState->x1 += (_animator->_brandonScaleX * xOffset) >> 8;
+ curAnimState->y1 += (_animator->_brandonScaleY * yOffset) >> 8;
+ } else {
+ curAnimState->x1 = _currentCharacter->x1 + xOffset;
+ curAnimState->y1 = _currentCharacter->y1 + yOffset;
+ }
+
+ curAnimState->x2 = curAnimState->x1;
+ curAnimState->y2 = curAnimState->y1;
+ curAnimState->refreshFlag = 1;
+ curAnimState->bkgdChangeFlag = 1;
+ _animator->clearQueue();
+ _animator->addObjectToQueue(curAnimState);
+
+ int listAdded = 0;
+ int addedObjects = 1;
+
+ for (int i = 1; i < 5; ++i) {
+ Character *ch = &_characterList[i];
+ curAnimState = &_animator->actors()[addedObjects];
+ if (ch->sceneId != _currentCharacter->sceneId) {
+ curAnimState->active = 0;
+ curAnimState->refreshFlag = 0;
+ curAnimState->bkgdChangeFlag = 0;
+ ++addedObjects;
+ continue;
+ }
+
+ curAnimState->drawY = ch->y1;
+ curAnimState->sceneAnimPtr = _shapes[ch->currentAnimFrame];
+ curAnimState->animFrameNumber = ch->currentAnimFrame;
+ startAnimFrame = ch->currentAnimFrame-7;
+ xOffset = _defaultShapeTable[startAnimFrame].xOffset;
+ yOffset = _defaultShapeTable[startAnimFrame].yOffset;
+ if (_scaleMode) {
+ curAnimState->x1 = ch->x1;
+ curAnimState->y1 = ch->y1;
+
+ _animator->_brandonScaleX = _scaleTable[ch->y1];
+ _animator->_brandonScaleY = _scaleTable[ch->y1];
+
+ curAnimState->x1 += (_animator->_brandonScaleX * xOffset) >> 8;
+ curAnimState->y1 += (_animator->_brandonScaleY * yOffset) >> 8;
+ } else {
+ curAnimState->x1 = ch->x1 + xOffset;
+ curAnimState->y1 = ch->y1 + yOffset;
+ }
+ curAnimState->x2 = curAnimState->x1;
+ curAnimState->y2 = curAnimState->y1;
+ curAnimState->active = 1;
+ curAnimState->refreshFlag = 1;
+ curAnimState->bkgdChangeFlag = 1;
+
+ if (ch->facing >= 1 && ch->facing <= 3)
+ curAnimState->flags |= 1;
+ else if (ch->facing >= 5 && ch->facing <= 7)
+ curAnimState->flags &= 0xFFFFFFFE;
+
+ _animator->addObjectToQueue(curAnimState);
+
+ ++addedObjects;
+ ++listAdded;
+ if (listAdded < 2)
+ i = 5;
+ }
+
+ for (int i = 0; i < 11; ++i) {
+ curAnimState = &_animator->sprites()[i];
+
+ if (_sprites->_anims[i].play) {
+ curAnimState->active = 1;
+ curAnimState->refreshFlag = 1;
+ curAnimState->bkgdChangeFlag = 1;
+ } else {
+ curAnimState->active = 0;
+ curAnimState->refreshFlag = 0;
+ curAnimState->bkgdChangeFlag = 0;
+ }
+ curAnimState->height = _sprites->_anims[i].height;
+ curAnimState->height2 = _sprites->_anims[i].height2;
+ curAnimState->width = _sprites->_anims[i].width + 1;
+ curAnimState->width2 = _sprites->_anims[i].width2;
+ curAnimState->drawY = _sprites->_anims[i].drawY;
+ curAnimState->x1 = curAnimState->x2 = _sprites->_anims[i].x;
+ curAnimState->y1 = curAnimState->y2 = _sprites->_anims[i].y;
+ curAnimState->background = _sprites->_anims[i].background;
+ curAnimState->sceneAnimPtr = _sprites->_sceneShapes[_sprites->_anims[i].sprite];
+
+ curAnimState->disable = _sprites->_anims[i].disable;
+
+ if (_sprites->_anims[i].unk2)
+ curAnimState->flags = 0x800;
+ else
+ curAnimState->flags = 0;
+
+ if (_sprites->_anims[i].flipX)
+ curAnimState->flags |= 0x1;
+
+ _animator->addObjectToQueue(curAnimState);
+ }
+
+ for (int i = 0; i < 12; ++i) {
+ curAnimState = &_animator->items()[i];
+ Room *curRoom = &_roomTable[_currentCharacter->sceneId];
+ byte curItem = curRoom->itemsTable[i];
+ if (curItem != 0xFF) {
+ curAnimState->drawY = curRoom->itemsYPos[i];
+ curAnimState->sceneAnimPtr = _shapes[216+curItem];
+ curAnimState->animFrameNumber = (int16)0xFFFF;
+ curAnimState->y1 = curRoom->itemsYPos[i];
+ curAnimState->x1 = curRoom->itemsXPos[i];
+
+ curAnimState->x1 -= (_animator->fetchAnimWidth(curAnimState->sceneAnimPtr, _scaleTable[curAnimState->drawY])) >> 1;
+ curAnimState->y1 -= _animator->fetchAnimHeight(curAnimState->sceneAnimPtr, _scaleTable[curAnimState->drawY]);
+
+ curAnimState->x2 = curAnimState->x1;
+ curAnimState->y2 = curAnimState->y1;
+
+ curAnimState->active = 1;
+ curAnimState->refreshFlag = 1;
+ curAnimState->bkgdChangeFlag = 1;
+
+ _animator->addObjectToQueue(curAnimState);
+ } else {
+ curAnimState->active = 0;
+ curAnimState->refreshFlag = 0;
+ curAnimState->bkgdChangeFlag = 0;
+ }
+ }
+
+ _animator->preserveAnyChangedBackgrounds();
+ curAnimState = _animator->actors();
+ curAnimState->bkgdChangeFlag = 1;
+ curAnimState->refreshFlag = 1;
+ for (int i = 1; i < 28; ++i) {
+ curAnimState = &_animator->objects()[i];
+ if (curAnimState->active) {
+ curAnimState->bkgdChangeFlag = 1;
+ curAnimState->refreshFlag = 1;
+ }
+ }
+ _animator->restoreAllObjectBackgrounds();
+ _animator->preserveAnyChangedBackgrounds();
+ _animator->prepDrawAllObjects();
+ initSceneScreen(brandonAlive);
+ _animator->copyChangedObjectsForward(0);
+}
+
+void KyraEngine_LoK::initSceneScreen(int brandonAlive) {
+ if (_flags.platform == Common::kPlatformAmiga) {
+ if (_unkScreenVar1 && !queryGameFlag(0xF0)) {
+ memset(_screen->getPalette(2), 0, 32*3);
+ if (_currentCharacter->sceneId != 117 || !queryGameFlag(0xB3))
+ _screen->setScreenPalette(_screen->getPalette(2));
+ }
+
+ if (_unkScreenVar2 == 1)
+ _screen->shuffleScreen(8, 8, 304, 128, 2, 0, _unkScreenVar3, false);
+ else
+ _screen->copyRegion(8, 8, 8, 8, 304, 128, 2, 0);
+
+ if (_unkScreenVar1 && !queryGameFlag(0xA0)) {
+ if (_currentCharacter->sceneId == 45 && _paletteChanged)
+ memcpy(_screen->getPalette(0) + 12*3, _screen->getPalette(4) + 12*3, 2);
+
+ if (_currentCharacter->sceneId >= 229 && _currentCharacter->sceneId <= 245 && (_brandonStatusBit & 1))
+ memcpy(_screen->getPalette(0), _screen->getPalette(0) + 320*3, 64);
+
+ _screen->setScreenPalette(_screen->getPalette(0));
+ }
+ } else {
+ if (_unkScreenVar1 && !queryGameFlag(0xA0)) {
+ for (int i = 0; i < 60; ++i) {
+ uint16 col = _screen->getPalette(0)[684+i];
+ col += _screen->getPalette(1)[684+i] << 1;
+ col >>= 2;
+ _screen->getPalette(0)[684+i] = col;
+ }
+ _screen->setScreenPalette(_screen->getPalette(0));
+ }
+
+ if (_unkScreenVar2 == 1)
+ _screen->shuffleScreen(8, 8, 304, 128, 2, 0, _unkScreenVar3, false);
+ else
+ _screen->copyRegion(8, 8, 8, 8, 304, 128, 2, 0);
+
+ if (_unkScreenVar1 && _paletteChanged) {
+ if (!queryGameFlag(0xA0)) {
+ memcpy(_screen->getPalette(0) + 684, _screen->getPalette(1) + 684, 60);
+ _screen->setScreenPalette(_screen->getPalette(0));
+ } else {
+ memset(_screen->getPalette(0), 0, 768);
+ }
+ }
+ }
+
+ if (!_emc->start(&_scriptClick, 2))
+ error("Could not start script function 2 of scene script");
+
+ _scriptClick.regs[7] = brandonAlive;
+
+ while (_emc->isValid(&_scriptClick))
+ _emc->run(&_scriptClick);
+
+ setTextFadeTimerCountdown(-1);
+ if (_currentCharacter->sceneId == 210) {
+ if (_itemInHand != -1)
+ magicOutMouseItem(2, -1);
+
+ _screen->hideMouse();
+ for (int i = 0; i < 10; ++i) {
+ if (_currentCharacter->inventoryItems[i] != 0xFF)
+ magicOutMouseItem(2, i);
+ }
+ _screen->showMouse();
+ }
+}
+
+int KyraEngine_LoK::handleSceneChange(int xpos, int ypos, int unk1, int frameReset) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::handleSceneChange(%d, %d, %d, %d)", xpos, ypos, unk1, frameReset);
+ if (queryGameFlag(0xEF))
+ unk1 = 0;
+
+ int sceneId = _currentCharacter->sceneId;
+ _pathfinderFlag = 0;
+
+ if (xpos < 12) {
+ if (_roomTable[sceneId].westExit != 0xFFFF) {
+ xpos = 12;
+ ypos = _sceneExits.westYPos;
+ _pathfinderFlag = 7;
+ }
+ } else if (xpos >= 308) {
+ if (_roomTable[sceneId].eastExit != 0xFFFF) {
+ xpos = 307;
+ ypos = _sceneExits.eastYPos;
+ _pathfinderFlag = 13;
+ }
+ }
+
+ if (ypos <= (_northExitHeight&0xFF)+2) {
+ if (_roomTable[sceneId].northExit != 0xFFFF) {
+ xpos = _sceneExits.northXPos;
+ ypos = _northExitHeight & 0xFF;
+ _pathfinderFlag = 14;
+ }
+ } else if (ypos >= 136) {
+ if (_roomTable[sceneId].southExit != 0xFFFF) {
+ xpos = _sceneExits.southXPos;
+ ypos = 136;
+ _pathfinderFlag = 11;
+ }
+ }
+
+ int temp = xpos - _currentCharacter->x1;
+ if (ABS(temp) < 4) {
+ temp = ypos - _currentCharacter->y1;
+ if (ABS(temp) < 2)
+ return 0;
+ }
+
+ int x = (int16)(_currentCharacter->x1 & 0xFFFC);
+ int y = (int16)(_currentCharacter->y1 & 0xFFFE);
+ xpos = (int16)(xpos & 0xFFFC);
+ ypos = (int16)(ypos & 0xFFFE);
+
+ int ret = findWay(x, y, xpos, ypos, _movFacingTable, 150);
+ _pathfinderFlag = 0;
+
+ if (ret >= _lastFindWayRet)
+ _lastFindWayRet = ret;
+
+ if (ret == 0x7D00 || ret == 0)
+ return 0;
+
+ return processSceneChange(_movFacingTable, unk1, frameReset);
+}
+
+int KyraEngine_LoK::processSceneChange(int *table, int unk1, int frameReset) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::processSceneChange(%p, %d, %d)", (const void *)table, unk1, frameReset);
+ if (queryGameFlag(0xEF))
+ unk1 = 0;
+
+ int *tableStart = table;
+ _sceneChangeState = 0;
+ _loopFlag2 = 0;
+ bool running = true;
+ int returnValue = 0;
+ uint32 nextFrame = 0;
+ _abortWalkFlag = false;
+ _mousePressFlag = false;
+
+ while (running) {
+ if (_abortWalkFlag) {
+ *table = 8;
+ _currentCharacter->currentAnimFrame = 7;
+ _animator->animRefreshNPC(0);
+ _animator->updateAllObjectShapes();
+ processInput();
+ return 0;
+ }
+ bool forceContinue = false;
+ switch (*table) {
+ case 0: case 1: case 2:
+ case 3: case 4: case 5:
+ case 6: case 7:
+ _currentCharacter->facing = getOppositeFacingDirection(*table);
+ break;
+
+ case 8:
+ forceContinue = true;
+ running = false;
+ break;
+
+ default:
+ ++table;
+ forceContinue = true;
+ break;
+ }
+
+ returnValue = changeScene(_currentCharacter->facing);
+ if (returnValue) {
+ running = false;
+ _abortWalkFlag = false;
+ }
+
+ if (unk1) {
+ if (_mousePressFlag) {
+ running = false;
+ _sceneChangeState = 1;
+ }
+ }
+
+ if (forceContinue || !running)
+ continue;
+
+ int temp = 0;
+ if (table == tableStart || table[1] == 8)
+ temp = setCharacterPosition(0, 0);
+ else
+ temp = setCharacterPosition(0, table);
+
+ if (temp)
+ ++table;
+
+ nextFrame = _timer->getDelay(5) * _tickLength + _system->getMillis();
+ while (_system->getMillis() < nextFrame) {
+ _timer->update();
+
+ if (_currentCharacter->sceneId == 210) {
+ updateKyragemFading();
+ if (seq_playEnd() || _beadStateVar == 4 || _beadStateVar == 5) {
+ *table = 8;
+ running = false;
+ break;
+ }
+ }
+
+ if ((nextFrame - _system->getMillis()) >= 10)
+ delay(10, true);
+ }
+ }
+
+ if (frameReset && !(_brandonStatusBit & 2))
+ _currentCharacter->currentAnimFrame = 7;
+
+ _animator->animRefreshNPC(0);
+ _animator->updateAllObjectShapes();
+ return returnValue;
+}
+
+int KyraEngine_LoK::changeScene(int facing) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::changeScene(%d)", facing);
+ if (queryGameFlag(0xEF)) {
+ if (_currentCharacter->sceneId == 5)
+ return 0;
+ }
+
+ int xpos = _charAddXPosTable[facing] + _currentCharacter->x1;
+ int ypos = _charAddYPosTable[facing] + _currentCharacter->y1;
+
+ if (xpos >= 12 && xpos <= 308) {
+ if (!lineIsPassable(xpos, ypos))
+ return false;
+ }
+
+ if (_exitListPtr) {
+ int16 *ptr = _exitListPtr;
+ // this loop should be only entered one time, seems to be some hack in the original
+ while (true) {
+ if (*ptr == -1)
+ break;
+
+ if (*ptr > _currentCharacter->x1 || _currentCharacter->y1 < ptr[1] || _currentCharacter->x1 > ptr[2] || _currentCharacter->y1 > ptr[3]) {
+ ptr += 10;
+ break;
+ }
+
+ _brandonPosX = ptr[6];
+ _brandonPosY = ptr[7];
+ uint16 sceneId = ptr[5];
+ facing = ptr[4];
+ int unk1 = ptr[8];
+ int unk2 = ptr[9];
+
+ if (sceneId == 0xFFFF) {
+ switch (facing) {
+ case 0:
+ sceneId = _roomTable[_currentCharacter->sceneId].northExit;
+ break;
+
+ case 2:
+ sceneId = _roomTable[_currentCharacter->sceneId].eastExit;
+ break;
+
+ case 4:
+ sceneId = _roomTable[_currentCharacter->sceneId].southExit;
+ break;
+
+ case 6:
+ sceneId = _roomTable[_currentCharacter->sceneId].westExit;
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ _currentCharacter->facing = facing;
+ _animator->animRefreshNPC(0);
+ _animator->updateAllObjectShapes();
+ enterNewScene(sceneId, facing, unk1, unk2, 0);
+ resetGameFlag(0xEE);
+ return 1;
+ }
+ }
+
+ int returnValue = 0;
+ facing = 0;
+
+ if ((_northExitHeight & 0xFF) + 2 >= ypos || (_northExitHeight & 0xFF) + 2 >= _currentCharacter->y1) {
+ facing = 0;
+ returnValue = 1;
+ }
+
+ if (xpos >= 308 || (_currentCharacter->x1 + 4) >= 308) {
+ facing = 2;
+ returnValue = 1;
+ }
+
+ if (((_northExitHeight >> 8) & 0xFF) - 2 < ypos || ((_northExitHeight >> 8) & 0xFF) - 2 < _currentCharacter->y1) {
+ facing = 4;
+ returnValue = 1;
+ }
+
+ if (xpos <= 12 || _currentCharacter->y1 <= 12) {
+ facing = 6;
+ returnValue = 1;
+ }
+
+ if (!returnValue)
+ return 0;
+
+ uint16 sceneId = 0xFFFF;
+ switch (facing) {
+ case 0:
+ sceneId = _roomTable[_currentCharacter->sceneId].northExit;
+ break;
+
+ case 2:
+ sceneId = _roomTable[_currentCharacter->sceneId].eastExit;
+ break;
+
+ case 4:
+ sceneId = _roomTable[_currentCharacter->sceneId].southExit;
+ break;
+
+ default:
+ sceneId = _roomTable[_currentCharacter->sceneId].westExit;
+ break;
+ }
+
+ if (sceneId == 0xFFFF)
+ return 0;
+
+ enterNewScene(sceneId, facing, 1, 1, 0);
+ return returnValue;
+}
+
+void KyraEngine_LoK::setCharactersInDefaultScene() {
+ static const uint32 defaultSceneTable[][4] = {
+ { 0xFFFF, 0x0004, 0x0003, 0xFFFF },
+ { 0xFFFF, 0x0022, 0xFFFF, 0x0000 },
+ { 0xFFFF, 0x001D, 0x0021, 0xFFFF },
+ { 0xFFFF, 0x0000, 0x0000, 0xFFFF }
+ };
+
+ for (int i = 1; i < 5; ++i) {
+ Character *cur = &_characterList[i];
+ //cur->field_20 = 0;
+
+ const uint32 *curTable = defaultSceneTable[i-1];
+ cur->sceneId = curTable[0];
+
+ if (cur->sceneId == _currentCharacter->sceneId)
+ //++cur->field_20;
+ cur->sceneId = curTable[1/*cur->field_20*/];
+
+ //cur->field_23 = curTable[cur->field_20+1];
+ }
+}
+
+void KyraEngine_LoK::setCharactersPositions(int character) {
+ static uint16 initXPosTable[] = {
+ 0x3200, 0x0024, 0x2230, 0x2F00, 0x0020, 0x002B,
+ 0x00CA, 0x00F0, 0x0082, 0x00A2, 0x0042
+ };
+ static uint8 initYPosTable[] = {
+ 0x00, 0xA2, 0x00, 0x42, 0x00,
+ 0x67, 0x67, 0x60, 0x5A, 0x71,
+ 0x76
+ };
+
+ assert(character < ARRAYSIZE(initXPosTable));
+ Character *edit = &_characterList[character];
+ edit->x1 = edit->x2 = initXPosTable[character];
+ edit->y1 = edit->y2 = initYPosTable[character];
+}
+
+#pragma mark -
+#pragma mark - Pathfinder
+#pragma mark -
+
+int KyraEngine_LoK::findWay(int x, int y, int toX, int toY, int *moveTable, int moveTableSize) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::findWay(%d, %d, %d, %d, %p, %d)", x, y, toX, toY, (const void *)moveTable, moveTableSize);
+ int ret = KyraEngine_v1::findWay(x, y, toX, toY, moveTable, moveTableSize);
+ if (ret == 0x7D00)
+ return 0;
+ return getMoveTableSize(moveTable);
+}
+
+bool KyraEngine_LoK::lineIsPassable(int x, int y) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::lineIsPassable(%d, %d)", x, y);
+ if (queryGameFlag(0xEF)) {
+ if (_currentCharacter->sceneId == 5)
+ return true;
+ }
+
+ if (_pathfinderFlag & 2) {
+ if (x >= 312)
+ return false;
+ }
+
+ if (_pathfinderFlag & 4) {
+ if (y >= 136)
+ return false;
+ }
+
+ if (_pathfinderFlag & 8) {
+ if (x < 8)
+ return false;
+ }
+
+ if (_pathfinderFlag2) {
+ if (x <= 8 || x >= 312)
+ return true;
+ if (y < (_northExitHeight & 0xFF) || y > 135)
+ return true;
+ }
+
+ if (y > 137)
+ return false;
+
+ if (y < 0)
+ y = 0;
+
+ int ypos = 8;
+ if (_scaleMode) {
+ ypos = (_scaleTable[y] >> 5) + 1;
+ if (8 < ypos)
+ ypos = 8;
+ }
+
+ x -= (ypos >> 1);
+
+ int xpos = x;
+ int xtemp = xpos + ypos - 1;
+ if (x < 0)
+ xpos = 0;
+
+ if (xtemp > 319)
+ xtemp = 319;
+
+ for (; xpos < xtemp; ++xpos) {
+ if (!_screen->getShapeFlag1(xpos, y))
+ return false;
+ }
+ return true;
+}
+
+#pragma mark -
+
+void KyraEngine_LoK::setupSceneResource(int sceneId) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::setupSceneResource(%d)", sceneId);
+ if (!_flags.isTalkie)
+ return;
+
+ if (_currentRoom != 0xFFFF) {
+ assert(_currentRoom < _roomTableSize);
+ int tableId = _roomTable[_currentRoom].nameIndex;
+ assert(tableId < _roomFilenameTableSize);
+
+ // unload our old room
+ char file[64];
+ strcpy(file, _roomFilenameTable[tableId]);
+ strcat(file, ".VRM");
+ _res->unloadPakFile(file);
+
+ strcpy(file, _roomFilenameTable[tableId]);
+ strcat(file, ".PAK");
+ _res->unloadPakFile(file);
+
+ strcpy(file, _roomFilenameTable[tableId]);
+ strcat(file, ".APK");
+ _res->unloadPakFile(file);
+ }
+
+ assert(sceneId < _roomTableSize);
+ int tableId = _roomTable[sceneId].nameIndex;
+ assert(tableId < _roomFilenameTableSize);
+
+ // load our new room
+ char file[64];
+ strcpy(file, _roomFilenameTable[tableId]);
+ strcat(file, ".VRM");
+ if (_res->exists(file))
+ _res->loadPakFile(file);
+
+ strcpy(file, _roomFilenameTable[tableId]);
+ strcat(file, ".PAK");
+ if (_res->exists(file))
+ _res->loadPakFile(file);
+
+ strcpy(file, _roomFilenameTable[tableId]);
+ strcat(file, ".APK");
+ if (_res->exists(file))
+ _res->loadPakFile(file);
+}
+
+} // end of namespace Kyra
+
diff --git a/engines/kyra/scene_mr.cpp b/engines/kyra/scene_mr.cpp
index 196c87424d..e4a3a5c54e 100644
--- a/engines/kyra/scene_mr.cpp
+++ b/engines/kyra/scene_mr.cpp
@@ -182,7 +182,7 @@ void KyraEngine_MR::enterNewScene(uint16 sceneId, int facing, int unk1, int unk2
if (_itemInHand < 0) {
_itemInHand = -1;
- _handItemSet = -1;
+ _mouseState = -1;
_screen->setMouseCursor(0, 0, _gameShapes[0]);
}
@@ -311,7 +311,7 @@ void KyraEngine_MR::enterNewSceneUnk2(int unk1) {
void KyraEngine_MR::unloadScene() {
debugC(9, kDebugLevelMain, "KyraEngine_MR::unloadScene()");
- delete [] _sceneStrings;
+ delete[] _sceneStrings;
_sceneStrings = 0;
musicUpdate(0);
_emc->unload(&_sceneScriptData);
@@ -325,7 +325,7 @@ void KyraEngine_MR::unloadScene() {
void KyraEngine_MR::freeSceneShapes() {
debugC(9, kDebugLevelMain, "KyraEngine_MR::freeSceneShapes()");
for (uint i = 0; i < ARRAYSIZE(_sceneShapes); ++i) {
- delete [] _sceneShapes[i];
+ delete[] _sceneShapes[i];
_sceneShapes[i] = 0;
}
}
@@ -430,6 +430,8 @@ void KyraEngine_MR::initSceneScript(int unk1) {
_screen->_curPage = pageBackUp;
musicUpdate(0);
}
+ delete stream;
+ stream = 0;
musicUpdate(0);
strcpy(filename, scene.filename1);
@@ -691,7 +693,7 @@ int KyraEngine_MR::trySceneChange(int *moveTable, int unk1, int updateChar) {
if (ret)
++moveTable;
- update();
+ delay(10, true);
}
if (updateChar)
diff --git a/engines/kyra/scene_v1.cpp b/engines/kyra/scene_v1.cpp
index c5d1de82a9..65171ad831 100644
--- a/engines/kyra/scene_v1.cpp
+++ b/engines/kyra/scene_v1.cpp
@@ -24,1261 +24,360 @@
*/
#include "kyra/kyra_v1.h"
-#include "kyra/seqplayer.h"
#include "kyra/screen.h"
-#include "kyra/resource.h"
-#include "kyra/sound.h"
-#include "kyra/sprites.h"
-#include "kyra/wsamovie.h"
-#include "kyra/animator_v1.h"
-#include "kyra/text.h"
-#include "kyra/script.h"
-#include "kyra/timer.h"
-
-#include "common/system.h"
-#include "common/savefile.h"
namespace Kyra {
-void KyraEngine_v1::enterNewScene(int sceneId, int facing, int unk1, int unk2, int brandonAlive) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::enterNewScene(%d, %d, %d, %d, %d)", sceneId, facing, unk1, unk2, brandonAlive);
- int unkVar1 = 1;
- _screen->hideMouse();
- _handleInput = false;
- _abortWalkFlag = false;
- _abortWalkFlag2 = false;
-
- if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98) {
- int newSfxFile = -1;
- if (_currentCharacter->sceneId == 7 && sceneId == 24)
- newSfxFile = 2;
- else if (_currentCharacter->sceneId == 25 && sceneId == 109)
- newSfxFile = 3;
- else if (_currentCharacter->sceneId == 120 && sceneId == 37)
- newSfxFile = 4;
- else if (_currentCharacter->sceneId == 52 && sceneId == 199)
- newSfxFile = 5;
- else if (_currentCharacter->sceneId == 37 && sceneId == 120)
- newSfxFile = 3;
- else if (_currentCharacter->sceneId == 109 && sceneId == 25)
- newSfxFile = 2;
- else if (_currentCharacter->sceneId == 24 && sceneId == 7)
- newSfxFile = 1;
-
- if (newSfxFile != -1) {
- _curSfxFile = newSfxFile;
- _sound->loadSoundFile(_curSfxFile);
- }
- }
-
- switch (_currentCharacter->sceneId) {
- case 1:
- if (sceneId == 0) {
- moveCharacterToPos(0, 0, _currentCharacter->x1, 84);
- unkVar1 = 0;
- }
- break;
-
- case 3:
- if (sceneId == 2) {
- moveCharacterToPos(0, 6, 155, _currentCharacter->y1);
- unkVar1 = 0;
- }
- break;
-
- case 26:
- if (sceneId == 27) {
- moveCharacterToPos(0, 6, 155, _currentCharacter->y1);
- unkVar1 = 0;
- }
- break;
-
- case 44:
- if (sceneId == 45) {
- moveCharacterToPos(0, 2, 192, _currentCharacter->y1);
- unkVar1 = 0;
- }
- break;
+int KyraEngine_v1::findWay(int x, int y, int toX, int toY, int *moveTable, int moveTableSize) {
+ debugC(9, kDebugLevelMain, "KyraEngine_v1::findWay(%d, %d, %d, %d, %p, %d)", x, y, toX, toY, (const void *)moveTable, moveTableSize);
+ x &= 0xFFFC; toX &= 0xFFFC;
+ y &= 0xFFFE; toY &= 0xFFFE;
+ x = (int16)x; y = (int16)y; toX = (int16)toX; toY = (int16)toY;
- default:
- break;
+ if (x == toY && y == toY) {
+ moveTable[0] = 8;
+ return 0;
}
- if (unkVar1 && unk1) {
- int xpos = _currentCharacter->x1;
- int ypos = _currentCharacter->y1;
- switch (facing) {
- case 0:
- ypos = _currentCharacter->y1 - 6;
- break;
-
- case 2:
- xpos = 336;
- break;
-
- case 4:
- ypos = 143;
- break;
+ int curX = x;
+ int curY = y;
+ int tempValue = 0;
+ int lastUsedEntry = 0;
+ int *pathTable1 = new int[0x7D0];
+ int *pathTable2 = new int[0x7D0];
+ assert(pathTable1 && pathTable2);
- case 6:
- xpos = -16;
- break;
+ while (true) {
+ int newFacing = getFacingFromPointToPoint(x, y, toX, toY);
+ changePosTowardsFacing(curX, curY, newFacing);
- default:
+ if (curX == toX && curY == toY) {
+ if (!lineIsPassable(curX, curY))
+ break;
+ moveTable[lastUsedEntry++] = newFacing;
break;
}
- moveCharacterToPos(0, facing, xpos, ypos);
- }
-
- for (int i = 0; i < ARRAYSIZE(_movieObjects); ++i)
- _movieObjects[i]->close();
-
- if (!brandonAlive) {
- _emc->init(&_scriptClick, &_scriptClickData);
- _emc->start(&_scriptClick, 5);
- while (_emc->isValid(&_scriptClick))
- _emc->run(&_scriptClick);
- }
-
- memset(_entranceMouseCursorTracks, 0xFFFF, sizeof(uint16)*4);
- _currentCharacter->sceneId = sceneId;
-
- assert(sceneId < _roomTableSize);
- assert(_roomTable[sceneId].nameIndex < _roomFilenameTableSize);
-
- Room *currentRoom = &_roomTable[sceneId];
-
- setupSceneResource(sceneId);
-
- _currentRoom = sceneId;
-
- int tableId = _roomTable[sceneId].nameIndex;
- char fileNameBuffer[32];
- strcpy(fileNameBuffer, _roomFilenameTable[tableId]);
- strcat(fileNameBuffer, ".DAT");
- _sprites->loadDat(fileNameBuffer, _sceneExits);
- _sprites->setupSceneAnims();
- _emc->unload(&_scriptClickData);
- loadSceneMsc();
-
- _walkBlockNorth = currentRoom->northExit;
- _walkBlockEast = currentRoom->eastExit;
- _walkBlockSouth = currentRoom->southExit;
- _walkBlockWest = currentRoom->westExit;
-
- if (_walkBlockNorth == 0xFFFF)
- _screen->blockOutRegion(0, 0, 320, (_northExitHeight & 0xFF)+3);
- if (_walkBlockEast == 0xFFFF)
- _screen->blockOutRegion(312, 0, 8, 139);
- if (_walkBlockSouth == 0xFFFF)
- _screen->blockOutRegion(0, 135, 320, 8);
- if (_walkBlockWest == 0xFFFF)
- _screen->blockOutRegion(0, 0, 8, 139);
-
- if (!brandonAlive)
- updatePlayerItemsForScene();
-
- startSceneScript(brandonAlive);
- setupSceneItems();
-
- initSceneData(facing, unk2, brandonAlive);
-
- _loopFlag2 = 0;
- _screen->showMouse();
- if (!brandonAlive)
- seq_poisonDeathNow(0);
- updateMousePointer(true);
- _changedScene = true;
-}
-
-void KyraEngine_v1::transcendScenes(int roomIndex, int roomName) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::transcendScenes(%d, %d)", roomIndex, roomName);
- assert(roomIndex < _roomTableSize);
-
- if (_flags.isTalkie) {
- char file[32];
- assert(roomIndex < _roomTableSize);
- int tableId = _roomTable[roomIndex].nameIndex;
- assert(tableId < _roomFilenameTableSize);
- strcpy(file, _roomFilenameTable[tableId]);
- strcat(file, ".VRM");
- _res->unloadPakFile(file);
- }
-
- _roomTable[roomIndex].nameIndex = roomName;
- _unkScreenVar2 = 1;
- _unkScreenVar3 = 1;
- _unkScreenVar1 = 0;
- _brandonPosX = _currentCharacter->x1;
- _brandonPosY = _currentCharacter->y1;
- enterNewScene(roomIndex, _currentCharacter->facing, 0, 0, 0);
- _unkScreenVar1 = 1;
- _unkScreenVar2 = 0;
- _unkScreenVar3 = 0;
-}
-
-void KyraEngine_v1::setSceneFile(int roomIndex, int roomName) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::setSceneFile(%d, %d)", roomIndex, roomName);
- assert(roomIndex < _roomTableSize);
- _roomTable[roomIndex].nameIndex = roomName;
-}
-
-void KyraEngine_v1::moveCharacterToPos(int character, int facing, int xpos, int ypos) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::moveCharacterToPos(%d, %d, %d, %d)", character, facing, xpos, ypos);
- Character *ch = &_characterList[character];
- ch->facing = facing;
- _screen->hideMouse();
- xpos = (int16)(xpos & 0xFFFC);
- ypos = (int16)(ypos & 0xFFFE);
- _timer->disable(19);
- _timer->disable(14);
- _timer->disable(18);
- uint32 nextFrame = 0;
-
- switch (facing) {
- case 0:
- while (ypos < ch->y1) {
- nextFrame = _timer->getDelay(5 + character) * _tickLength + _system->getMillis();
- setCharacterPositionWithUpdate(character);
- delayUntil(nextFrame, true);
- }
- break;
-
- case 2:
- while (ch->x1 < xpos) {
- nextFrame = _timer->getDelay(5 + character) * _tickLength + _system->getMillis();
- setCharacterPositionWithUpdate(character);
- delayUntil(nextFrame, true);
- }
- break;
-
- case 4:
- while (ypos > ch->y1) {
- nextFrame = _timer->getDelay(5 + character) * _tickLength + _system->getMillis();
- setCharacterPositionWithUpdate(character);
- delayUntil(nextFrame, true);
- }
- break;
-
- case 6:
- while (ch->x1 > xpos) {
- nextFrame = _timer->getDelay(5 + character) * _tickLength + _system->getMillis();
- setCharacterPositionWithUpdate(character);
- delayUntil(nextFrame, true);
- }
- break;
-
- default:
- break;
- }
-
- _timer->enable(19);
- _timer->enable(14);
- _timer->enable(18);
- _screen->showMouse();
-}
-
-void KyraEngine_v1::setCharacterPositionWithUpdate(int character) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::setCharacterPositionWithUpdate(%d)", character);
- setCharacterPosition(character, 0);
- _sprites->updateSceneAnims();
- _timer->update();
- _animator->updateAllObjectShapes();
- updateTextFade();
-
- if (_currentCharacter->sceneId == 210)
- updateKyragemFading();
-}
-
-int KyraEngine_v1::setCharacterPosition(int character, int *facingTable) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::setCharacterPosition(%d, %p)", character, (const void *)facingTable);
-
- if (character == 0) {
- _currentCharacter->x1 += _charXPosTable[_currentCharacter->facing];
- _currentCharacter->y1 += _charYPosTable[_currentCharacter->facing];
- setCharacterPositionHelper(0, facingTable);
- return 1;
- } else {
- _characterList[character].x1 += _charXPosTable[_characterList[character].facing];
- _characterList[character].y1 += _charYPosTable[_characterList[character].facing];
- if (_characterList[character].sceneId == _currentCharacter->sceneId)
- setCharacterPositionHelper(character, 0);
- }
- return 0;
-}
-
-void KyraEngine_v1::setCharacterPositionHelper(int character, int *facingTable) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::setCharacterPositionHelper(%d, %p)", character, (const void *)facingTable);
- Character *ch = &_characterList[character];
- ++ch->currentAnimFrame;
- int facing = ch->facing;
- if (facingTable) {
- if (*facingTable != *(facingTable - 1)) {
- if (*(facingTable - 1) == *(facingTable + 1)) {
- facing = getOppositeFacingDirection(*(facingTable - 1));
- *facingTable = *(facingTable - 1);
+ if (lineIsPassable(curX, curY)) {
+ if (lastUsedEntry == moveTableSize) {
+ delete[] pathTable1;
+ delete[] pathTable2;
+ return 0x7D00;
}
+ // debug drawing
+ /*if (curX >= 0 && curY >= 0 && curX < 320 && curY < 200) {
+ screen()->setPagePixel(0, curX, curY, 11);
+ screen()->updateScreen();
+ delayWithTicks(5);
+ }*/
+ moveTable[lastUsedEntry++] = newFacing;
+ x = curX;
+ y = curY;
+ continue;
}
- }
- static uint8 facingIsZero[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
- static uint8 facingIsFour[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
+ int temp = 0;
+ while (true) {
+ newFacing = getFacingFromPointToPoint(curX, curY, toX, toY);
+ changePosTowardsFacing(curX, curY, newFacing);
+ // debug drawing
+ /*if (curX >= 0 && curY >= 0 && curX < 320 && curY < 200) {
+ screen()->setPagePixel(0, curX, curY, 8);
+ screen()->updateScreen();
+ delayWithTicks(5);
+ }*/
+
+ if (!lineIsPassable(curX, curY)) {
+ if (curX != toX || curY != toY)
+ continue;
+ }
- if (facing == 0) {
- ++facingIsZero[character];
- } else {
- bool resetTables = false;
- if (facing != 7) {
- if (facing - 1 != 0) {
- if (facing != 4) {
- if (facing == 3 || facing == 5) {
- if (facingIsFour[character] > 2)
- facing = 4;
- resetTables = true;
- }
- } else {
- ++facingIsFour[character];
+ if (curX == toX && curY == toY) {
+ if (!lineIsPassable(curX, curY)) {
+ tempValue = 0;
+ temp = 0;
+ break;
}
- } else {
- if (facingIsZero[character] > 2)
- facing = 0;
- resetTables = true;
}
- } else {
- if (facingIsZero[character] > 2)
- facing = 0;
- resetTables = true;
- }
-
- if (resetTables) {
- facingIsZero[character] = 0;
- facingIsFour[character] = 0;
- }
- }
-
- static const uint16 maxAnimationFrame[] = {
- 0x000F, 0x0031, 0x0055, 0x0000, 0x0000, 0x0000,
- 0x0008, 0x002A, 0x004E, 0x0000, 0x0000, 0x0000,
- 0x0022, 0x0046, 0x006A, 0x0000, 0x0000, 0x0000,
- 0x001D, 0x0041, 0x0065, 0x0000, 0x0000, 0x0000,
- 0x001F, 0x0043, 0x0067, 0x0000, 0x0000, 0x0000,
- 0x0028, 0x004C, 0x0070, 0x0000, 0x0000, 0x0000,
- 0x0023, 0x0047, 0x006B, 0x0000, 0x0000, 0x0000
- };
-
- if (facing == 0) {
- if (maxAnimationFrame[36+character] > ch->currentAnimFrame)
- ch->currentAnimFrame = maxAnimationFrame[36+character];
- if (maxAnimationFrame[30+character] < ch->currentAnimFrame)
- ch->currentAnimFrame = maxAnimationFrame[36+character];
- } else if (facing == 4) {
- if (maxAnimationFrame[18+character] > ch->currentAnimFrame)
- ch->currentAnimFrame = maxAnimationFrame[18+character];
- if (maxAnimationFrame[12+character] < ch->currentAnimFrame)
- ch->currentAnimFrame = maxAnimationFrame[18+character];
- } else {
- if (maxAnimationFrame[18+character] < ch->currentAnimFrame)
- ch->currentAnimFrame = maxAnimationFrame[30+character];
- if (maxAnimationFrame[character] == ch->currentAnimFrame)
- ch->currentAnimFrame = maxAnimationFrame[6+character];
- if (maxAnimationFrame[character] < ch->currentAnimFrame)
- ch->currentAnimFrame = maxAnimationFrame[6+character]+2;
- }
-
- if (character == 0 && (_brandonStatusBit & 0x10))
- ch->currentAnimFrame = 88;
-
- _animator->animRefreshNPC(character);
-}
-
-void KyraEngine_v1::loadSceneMsc() {
- assert(_currentCharacter->sceneId < _roomTableSize);
- int tableId = _roomTable[_currentCharacter->sceneId].nameIndex;
- assert(tableId < _roomFilenameTableSize);
- char fileNameBuffer[32];
- strcpy(fileNameBuffer, _roomFilenameTable[tableId]);
- strcat(fileNameBuffer, ".MSC");
- _screen->fillRect(0, 0, 319, 199, 0, 5);
- _res->exists(fileNameBuffer, true);
- _screen->loadBitmap(fileNameBuffer, 3, 5, 0);
-}
-
-void KyraEngine_v1::startSceneScript(int brandonAlive) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::startSceneScript(%d)", brandonAlive);
- assert(_currentCharacter->sceneId < _roomTableSize);
- int tableId = _roomTable[_currentCharacter->sceneId].nameIndex;
- assert(tableId < _roomFilenameTableSize);
- char fileNameBuffer[32];
- strcpy(fileNameBuffer, _roomFilenameTable[tableId]);
- strcat(fileNameBuffer, ".CPS");
- _screen->clearPage(3);
- _res->exists(fileNameBuffer, true);
- // FIXME: check this hack for amiga version
- _screen->loadBitmap(fileNameBuffer, 3, 3, (_flags.platform == Common::kPlatformAmiga ? _screen->getPalette(0) : 0));
- _sprites->loadSceneShapes();
- _exitListPtr = 0;
-
- _scaleMode = 1;
- for (int i = 0; i < 145; ++i)
- _scaleTable[i] = 256;
-
- clearNoDropRects();
- _emc->init(&_scriptClick, &_scriptClickData);
- strcpy(fileNameBuffer, _roomFilenameTable[tableId]);
- strcat(fileNameBuffer, ".EMC");
- _res->exists(fileNameBuffer, true);
- _emc->unload(&_scriptClickData);
- _emc->load(fileNameBuffer, &_scriptClickData, &_opcodes);
- _emc->start(&_scriptClick, 0);
- _scriptClick.regs[0] = _currentCharacter->sceneId;
- _scriptClick.regs[7] = brandonAlive;
-
- while (_emc->isValid(&_scriptClick))
- _emc->run(&_scriptClick);
-}
-
-void KyraEngine_v1::initSceneData(int facing, int unk1, int brandonAlive) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::initSceneData(%d, %d, %d)", facing, unk1, brandonAlive);
-
- int16 xpos2 = 0;
- int setFacing = 1;
-
- int16 xpos = 0, ypos = 0;
-
- if (_brandonPosX == -1 && _brandonPosY == -1) {
- switch (facing + 1) {
- case 0:
- xpos = ypos = -1;
- break;
-
- case 1: case 2: case 8:
- xpos = _sceneExits.southXPos;
- ypos = _sceneExits.southYPos;
- break;
-
- case 3:
- xpos = _sceneExits.westXPos;
- ypos = _sceneExits.westYPos;
- break;
-
- case 4: case 5: case 6:
- xpos = _sceneExits.northXPos;
- ypos = _sceneExits.northYPos;
- break;
-
- case 7:
- xpos = _sceneExits.eastXPos;
- ypos = _sceneExits.eastYPos;
- break;
-
- default:
- break;
- }
-
- if ((uint8)(_northExitHeight & 0xFF) + 2 >= ypos)
- ypos = (_northExitHeight & 0xFF) + 4;
- if (xpos >= 308)
- xpos = 304;
- if ((uint8)(_northExitHeight >> 8) - 2 <= ypos)
- ypos = (_northExitHeight >> 8) - 4;
- if (xpos <= 12)
- xpos = 16;
- }
-
- if (_brandonPosX > -1)
- xpos = _brandonPosX;
- if (_brandonPosY > -1)
- ypos = _brandonPosY;
-
- int16 ypos2 = 0;
- if (_brandonPosX > -1 && _brandonPosY > -1) {
- switch (_currentCharacter->sceneId) {
- case 1:
- _currentCharacter->x1 = xpos;
- _currentCharacter->x2 = xpos;
- _currentCharacter->y1 = ypos;
- _currentCharacter->y2 = ypos;
- facing = 4;
- xpos2 = 192;
- ypos2 = 104;
- setFacing = 0;
- unk1 = 1;
- break;
-
- case 3:
- _currentCharacter->x1 = xpos;
- _currentCharacter->x2 = xpos;
- _currentCharacter->y1 = ypos;
- _currentCharacter->y2 = ypos;
- facing = 2;
- xpos2 = 204;
- ypos2 = 94;
- setFacing = 0;
- unk1 = 1;
- break;
-
- case 26:
- _currentCharacter->x1 = xpos;
- _currentCharacter->x2 = xpos;
- _currentCharacter->y1 = ypos;
- _currentCharacter->y2 = ypos;
- facing = 2;
- xpos2 = 192;
- ypos2 = 128;
- setFacing = 0;
- unk1 = 1;
- break;
-
- case 44:
- _currentCharacter->x1 = xpos;
- _currentCharacter->x2 = xpos;
- _currentCharacter->y1 = ypos;
- _currentCharacter->y2 = ypos;
- facing = 6;
- xpos2 = 156;
- ypos2 = 96;
- setFacing = 0;
- unk1 = 1;
- break;
-
- case 37:
- _currentCharacter->x1 = xpos;
- _currentCharacter->x2 = xpos;
- _currentCharacter->y1 = ypos;
- _currentCharacter->y2 = ypos;
- facing = 2;
- xpos2 = 148;
- ypos2 = 114;
- setFacing = 0;
- unk1 = 1;
- break;
-
- default:
- break;
- }
- }
-
- _brandonPosX = _brandonPosY = -1;
-
- if (unk1 && setFacing) {
- ypos2 = ypos;
- xpos2 = xpos;
- switch (facing) {
- case 0:
- ypos = 142;
- break;
-
- case 2:
- xpos = -16;
- break;
-
- case 4:
- ypos = (uint8)(_northExitHeight & 0xFF) - 4;
- break;
-
- case 6:
- xpos = 336;
- break;
-
- default:
- break;
- }
- }
-
- xpos2 = (int16)(xpos2 & 0xFFFC);
- ypos2 = (int16)(ypos2 & 0xFFFE);
- xpos = (int16)(xpos & 0xFFFC);
- ypos = (int16)(ypos & 0xFFFE);
- _currentCharacter->facing = facing;
- _currentCharacter->x1 = xpos;
- _currentCharacter->x2 = xpos;
- _currentCharacter->y1 = ypos;
- _currentCharacter->y2 = ypos;
-
- initSceneObjectList(brandonAlive);
-
- if (unk1 && brandonAlive == 0)
- moveCharacterToPos(0, facing, xpos2, ypos2);
-
- _scriptClick.regs[4] = _itemInHand;
- _scriptClick.regs[7] = brandonAlive;
- _emc->start(&_scriptClick, 3);
- while (_emc->isValid(&_scriptClick))
- _emc->run(&_scriptClick);
-}
-
-void KyraEngine_v1::initSceneObjectList(int brandonAlive) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::initSceneObjectList(%d)", brandonAlive);
- for (int i = 0; i < 28; ++i)
- _animator->actors()[i].active = 0;
-
- int startAnimFrame = 0;
-
- Animator_v1::AnimObject *curAnimState = _animator->actors();
- curAnimState->active = 1;
- curAnimState->drawY = _currentCharacter->y1;
- curAnimState->sceneAnimPtr = _shapes[_currentCharacter->currentAnimFrame];
- curAnimState->animFrameNumber = _currentCharacter->currentAnimFrame;
- startAnimFrame = _currentCharacter->currentAnimFrame-7;
- int xOffset = _defaultShapeTable[startAnimFrame].xOffset;
- int yOffset = _defaultShapeTable[startAnimFrame].yOffset;
-
- if (_scaleMode) {
- curAnimState->x1 = _currentCharacter->x1;
- curAnimState->y1 = _currentCharacter->y1;
-
- _animator->_brandonScaleX = _scaleTable[_currentCharacter->y1];
- _animator->_brandonScaleY = _scaleTable[_currentCharacter->y1];
-
- curAnimState->x1 += (_animator->_brandonScaleX * xOffset) >> 8;
- curAnimState->y1 += (_animator->_brandonScaleY * yOffset) >> 8;
- } else {
- curAnimState->x1 = _currentCharacter->x1 + xOffset;
- curAnimState->y1 = _currentCharacter->y1 + yOffset;
- }
-
- curAnimState->x2 = curAnimState->x1;
- curAnimState->y2 = curAnimState->y1;
- curAnimState->refreshFlag = 1;
- curAnimState->bkgdChangeFlag = 1;
- _animator->clearQueue();
- _animator->addObjectToQueue(curAnimState);
-
- int listAdded = 0;
- int addedObjects = 1;
-
- for (int i = 1; i < 5; ++i) {
- Character *ch = &_characterList[i];
- curAnimState = &_animator->actors()[addedObjects];
- if (ch->sceneId != _currentCharacter->sceneId) {
- curAnimState->active = 0;
- curAnimState->refreshFlag = 0;
- curAnimState->bkgdChangeFlag = 0;
- ++addedObjects;
- continue;
- }
-
- curAnimState->drawY = ch->y1;
- curAnimState->sceneAnimPtr = _shapes[ch->currentAnimFrame];
- curAnimState->animFrameNumber = ch->currentAnimFrame;
- startAnimFrame = ch->currentAnimFrame-7;
- xOffset = _defaultShapeTable[startAnimFrame].xOffset;
- yOffset = _defaultShapeTable[startAnimFrame].yOffset;
- if (_scaleMode) {
- curAnimState->x1 = ch->x1;
- curAnimState->y1 = ch->y1;
- _animator->_brandonScaleX = _scaleTable[ch->y1];
- _animator->_brandonScaleY = _scaleTable[ch->y1];
-
- curAnimState->x1 += (_animator->_brandonScaleX * xOffset) >> 8;
- curAnimState->y1 += (_animator->_brandonScaleY * yOffset) >> 8;
- } else {
- curAnimState->x1 = ch->x1 + xOffset;
- curAnimState->y1 = ch->y1 + yOffset;
- }
- curAnimState->x2 = curAnimState->x1;
- curAnimState->y2 = curAnimState->y1;
- curAnimState->active = 1;
- curAnimState->refreshFlag = 1;
- curAnimState->bkgdChangeFlag = 1;
-
- if (ch->facing >= 1 && ch->facing <= 3)
- curAnimState->flags |= 1;
- else if (ch->facing >= 5 && ch->facing <= 7)
- curAnimState->flags &= 0xFFFFFFFE;
-
- _animator->addObjectToQueue(curAnimState);
-
- ++addedObjects;
- ++listAdded;
- if (listAdded < 2)
- i = 5;
- }
-
- for (int i = 0; i < 11; ++i) {
- curAnimState = &_animator->sprites()[i];
-
- if (_sprites->_anims[i].play) {
- curAnimState->active = 1;
- curAnimState->refreshFlag = 1;
- curAnimState->bkgdChangeFlag = 1;
- } else {
- curAnimState->active = 0;
- curAnimState->refreshFlag = 0;
- curAnimState->bkgdChangeFlag = 0;
- }
- curAnimState->height = _sprites->_anims[i].height;
- curAnimState->height2 = _sprites->_anims[i].height2;
- curAnimState->width = _sprites->_anims[i].width + 1;
- curAnimState->width2 = _sprites->_anims[i].width2;
- curAnimState->drawY = _sprites->_anims[i].drawY;
- curAnimState->x1 = curAnimState->x2 = _sprites->_anims[i].x;
- curAnimState->y1 = curAnimState->y2 = _sprites->_anims[i].y;
- curAnimState->background = _sprites->_anims[i].background;
- curAnimState->sceneAnimPtr = _sprites->_sceneShapes[_sprites->_anims[i].sprite];
-
- curAnimState->disable = _sprites->_anims[i].disable;
-
- if (_sprites->_anims[i].unk2)
- curAnimState->flags = 0x800;
- else
- curAnimState->flags = 0;
-
- if (_sprites->_anims[i].flipX)
- curAnimState->flags |= 0x1;
-
- _animator->addObjectToQueue(curAnimState);
- }
-
- for (int i = 0; i < 12; ++i) {
- curAnimState = &_animator->items()[i];
- Room *curRoom = &_roomTable[_currentCharacter->sceneId];
- byte curItem = curRoom->itemsTable[i];
- if (curItem != 0xFF) {
- curAnimState->drawY = curRoom->itemsYPos[i];
- curAnimState->sceneAnimPtr = _shapes[216+curItem];
- curAnimState->animFrameNumber = (int16)0xFFFF;
- curAnimState->y1 = curRoom->itemsYPos[i];
- curAnimState->x1 = curRoom->itemsXPos[i];
-
- curAnimState->x1 -= (_animator->fetchAnimWidth(curAnimState->sceneAnimPtr, _scaleTable[curAnimState->drawY])) >> 1;
- curAnimState->y1 -= _animator->fetchAnimHeight(curAnimState->sceneAnimPtr, _scaleTable[curAnimState->drawY]);
-
- curAnimState->x2 = curAnimState->x1;
- curAnimState->y2 = curAnimState->y1;
-
- curAnimState->active = 1;
- curAnimState->refreshFlag = 1;
- curAnimState->bkgdChangeFlag = 1;
-
- _animator->addObjectToQueue(curAnimState);
- } else {
- curAnimState->active = 0;
- curAnimState->refreshFlag = 0;
- curAnimState->bkgdChangeFlag = 0;
- }
- }
-
- _animator->preserveAnyChangedBackgrounds();
- curAnimState = _animator->actors();
- curAnimState->bkgdChangeFlag = 1;
- curAnimState->refreshFlag = 1;
- for (int i = 1; i < 28; ++i) {
- curAnimState = &_animator->objects()[i];
- if (curAnimState->active) {
- curAnimState->bkgdChangeFlag = 1;
- curAnimState->refreshFlag = 1;
- }
- }
- _animator->restoreAllObjectBackgrounds();
- _animator->preserveAnyChangedBackgrounds();
- _animator->prepDrawAllObjects();
- initSceneScreen(brandonAlive);
- _animator->copyChangedObjectsForward(0);
-}
+ temp = findSubPath(x, y, curX, curY, pathTable1, 1, 0x7D0);
+ tempValue = findSubPath(x, y, curX, curY, pathTable2, 0, 0x7D0);
+ if (curX == toX && curY == toY) {
+ if (temp == 0x7D00 && tempValue == 0x7D00) {
+ delete[] pathTable1;
+ delete[] pathTable2;
+ return 0x7D00;
+ }
+ }
-void KyraEngine_v1::initSceneScreen(int brandonAlive) {
- if (_flags.platform == Common::kPlatformAmiga) {
- if (_unkScreenVar1 && !queryGameFlag(0xF0)) {
- memset(_screen->getPalette(2), 0, 32*3);
- if (_currentCharacter->sceneId != 117 || !queryGameFlag(0xB3))
- _screen->setScreenPalette(_screen->getPalette(2));
+ if (temp != 0x7D00 || tempValue != 0x7D00)
+ break;
}
- if (_unkScreenVar2 == 1)
- _screen->shuffleScreen(8, 8, 304, 128, 2, 0, _unkScreenVar3, false);
- else
- _screen->copyRegion(8, 8, 8, 8, 304, 128, 2, 0);
-
- if (_unkScreenVar1 && !queryGameFlag(0xA0)) {
- if (_currentCharacter->sceneId == 45 && _paletteChanged)
- memcpy(_screen->getPalette(0) + 12*3, _screen->getPalette(4) + 12*3, 2);
-
- if (_currentCharacter->sceneId >= 229 && _currentCharacter->sceneId <= 245 && (_brandonStatusBit & 1))
- memcpy(_screen->getPalette(0), _screen->getPalette(0) + 320*3, 64);
-
- _screen->setScreenPalette(_screen->getPalette(0));
- }
- } else {
- if (_unkScreenVar1 && !queryGameFlag(0xA0)) {
- for (int i = 0; i < 60; ++i) {
- uint16 col = _screen->getPalette(0)[684+i];
- col += _screen->getPalette(1)[684+i] << 1;
- col >>= 2;
- _screen->getPalette(0)[684+i] = col;
+ if (temp < tempValue) {
+ if (lastUsedEntry + temp > moveTableSize) {
+ delete[] pathTable1;
+ delete[] pathTable2;
+ return 0x7D00;
}
- _screen->setScreenPalette(_screen->getPalette(0));
- }
-
- if (_unkScreenVar2 == 1)
- _screen->shuffleScreen(8, 8, 304, 128, 2, 0, _unkScreenVar3, false);
- else
- _screen->copyRegion(8, 8, 8, 8, 304, 128, 2, 0);
-
- if (_unkScreenVar1 && _paletteChanged) {
- if (!queryGameFlag(0xA0)) {
- memcpy(_screen->getPalette(0) + 684, _screen->getPalette(1) + 684, 60);
- _screen->setScreenPalette(_screen->getPalette(0));
- } else {
- memset(_screen->getPalette(0), 0, 768);
+ memcpy(&moveTable[lastUsedEntry], pathTable1, temp*sizeof(int));
+ lastUsedEntry += temp;
+ } else {
+ if (lastUsedEntry + tempValue > moveTableSize) {
+ delete[] pathTable1;
+ delete[] pathTable2;
+ return 0x7D00;
}
+ memcpy(&moveTable[lastUsedEntry], pathTable2, tempValue*sizeof(int));
+ lastUsedEntry += tempValue;
}
+ x = curX;
+ y = curY;
+ if (curX == toX && curY == toY)
+ break;
}
- if (!_emc->start(&_scriptClick, 2))
- error("Could not start script function 2 of scene script");
-
- _scriptClick.regs[7] = brandonAlive;
-
- while (_emc->isValid(&_scriptClick))
- _emc->run(&_scriptClick);
-
- setTextFadeTimerCountdown(-1);
- if (_currentCharacter->sceneId == 210) {
- if (_itemInHand != -1)
- magicOutMouseItem(2, -1);
-
- _screen->hideMouse();
- for (int i = 0; i < 10; ++i) {
- if (_currentCharacter->inventoryItems[i] != 0xFF)
- magicOutMouseItem(2, i);
- }
- _screen->showMouse();
- }
-}
-
-int KyraEngine_v1::handleSceneChange(int xpos, int ypos, int unk1, int frameReset) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::handleSceneChange(%d, %d, %d, %d)", xpos, ypos, unk1, frameReset);
- if (queryGameFlag(0xEF))
- unk1 = 0;
-
- int sceneId = _currentCharacter->sceneId;
- _pathfinderFlag = 0;
-
- if (xpos < 12) {
- if (_roomTable[sceneId].westExit != 0xFFFF) {
- xpos = 12;
- ypos = _sceneExits.westYPos;
- _pathfinderFlag = 7;
- }
- } else if (xpos >= 308) {
- if (_roomTable[sceneId].eastExit != 0xFFFF) {
- xpos = 307;
- ypos = _sceneExits.eastYPos;
- _pathfinderFlag = 13;
- }
- }
-
- if (ypos <= (_northExitHeight&0xFF)+2) {
- if (_roomTable[sceneId].northExit != 0xFFFF) {
- xpos = _sceneExits.northXPos;
- ypos = _northExitHeight & 0xFF;
- _pathfinderFlag = 14;
- }
- } else if (ypos >= 136) {
- if (_roomTable[sceneId].southExit != 0xFFFF) {
- xpos = _sceneExits.southXPos;
- ypos = 136;
- _pathfinderFlag = 11;
- }
- }
-
- int temp = xpos - _currentCharacter->x1;
- if (ABS(temp) < 4) {
- temp = ypos - _currentCharacter->y1;
- if (ABS(temp) < 2)
- return 0;
- }
-
- int x = (int16)(_currentCharacter->x1 & 0xFFFC);
- int y = (int16)(_currentCharacter->y1 & 0xFFFE);
- xpos = (int16)(xpos & 0xFFFC);
- ypos = (int16)(ypos & 0xFFFE);
-
- int ret = findWay(x, y, xpos, ypos, _movFacingTable, 150);
- _pathfinderFlag = 0;
-
- if (ret >= _lastFindWayRet)
- _lastFindWayRet = ret;
-
- if (ret == 0x7D00 || ret == 0)
- return 0;
-
- return processSceneChange(_movFacingTable, unk1, frameReset);
+ delete[] pathTable1;
+ delete[] pathTable2;
+ moveTable[lastUsedEntry] = 8;
+ return lastUsedEntry;
}
-int KyraEngine_v1::processSceneChange(int *table, int unk1, int frameReset) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::processSceneChange(%p, %d, %d)", (const void *)table, unk1, frameReset);
- if (queryGameFlag(0xEF))
- unk1 = 0;
-
- int *tableStart = table;
- _sceneChangeState = 0;
- _loopFlag2 = 0;
- bool running = true;
- int returnValue = 0;
- uint32 nextFrame = 0;
- _abortWalkFlag = false;
- _mousePressFlag = false;
-
- while (running) {
- if (_abortWalkFlag) {
- *table = 8;
- _currentCharacter->currentAnimFrame = 7;
- _animator->animRefreshNPC(0);
- _animator->updateAllObjectShapes();
- processInput();
- return 0;
- }
- bool forceContinue = false;
- switch (*table) {
- case 0: case 1: case 2:
- case 3: case 4: case 5:
- case 6: case 7:
- _currentCharacter->facing = getOppositeFacingDirection(*table);
- break;
-
- case 8:
- forceContinue = true;
- running = false;
- break;
-
- default:
- ++table;
- forceContinue = true;
+int KyraEngine_v1::findSubPath(int x, int y, int toX, int toY, int *moveTable, int start, int end) {
+ debugC(9, kDebugLevelMain, "KyraEngine_v1::findSubPath(%d, %d, %d, %d, %p, %d, %d)", x, y, toX, toY, (const void *)moveTable, start, end);
+ // only used for debug specific code
+ //static uint16 unkTable[] = { 8, 5 };
+ static const int8 facingTable1[] = { 7, 0, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 7, 0 };
+ static const int8 facingTable2[] = { -1, 0, -1, 2, -1, 4, -1, 6, -1, 2, -1, 4, -1, 6, -1, 0 };
+ static const int8 facingTable3[] = { 2, 4, 4, 6, 6, 0, 0, 2, 6, 6, 0, 0, 2, 2, 4, 4 };
+ static const int8 addPosTableX[] = { -1, 0, -1, 4, -1, 0, -1, -4, -1, -4, -1, 0, -1, 4, -1, 0 };
+ static const int8 addPosTableY[] = { -1, 2, -1, 0, -1, -2, -1, 0, -1, 0, -1, 2, -1, 0, -1, -2 };
+
+ // debug specific
+ /*++unkTable[start];
+ while (screen()->getPalette(0)[unkTable[start]] != 0x0F) {
+ ++unkTable[start];
+ }*/
+
+ int xpos1 = x, xpos2 = x;
+ int ypos1 = y, ypos2 = y;
+ int newFacing = getFacingFromPointToPoint(x, y, toX, toY);
+ int position = 0;
+
+ while (position != end) {
+ int newFacing2 = newFacing;
+ while (true) {
+ changePosTowardsFacing(xpos1, ypos1, facingTable1[start*8 + newFacing2]);
+ if (!lineIsPassable(xpos1, ypos1)) {
+ if (facingTable1[start*8 + newFacing2] == newFacing)
+ return 0x7D00;
+ newFacing2 = facingTable1[start*8 + newFacing2];
+ xpos1 = x;
+ ypos1 = y;
+ continue;
+ }
+ newFacing = facingTable1[start*8 + newFacing2];
break;
}
-
- returnValue = changeScene(_currentCharacter->facing);
- if (returnValue) {
- running = false;
- _abortWalkFlag = false;
- }
-
- if (unk1) {
- if (_mousePressFlag) {
- running = false;
- _sceneChangeState = 1;
+ // debug drawing
+ /*if (xpos1 >= 0 && ypos1 >= 0 && xpos1 < 320 && ypos1 < 200) {
+ screen()->setPagePixel(0, xpos1, ypos1, unkTable[start]);
+ screen()->updateScreen();
+ delayWithTicks(5);
+ }*/
+ if (newFacing & 1) {
+ int temp = xpos1 + addPosTableX[newFacing + start * 8];
+ if (toX == temp) {
+ temp = ypos1 + addPosTableY[newFacing + start * 8];
+ if (toY == temp) {
+ moveTable[position++] = facingTable2[newFacing + start * 8];
+ return position;
+ }
}
}
- if (forceContinue || !running)
- continue;
-
- int temp = 0;
- if (table == tableStart || table[1] == 8)
- temp = setCharacterPosition(0, 0);
- else
- temp = setCharacterPosition(0, table);
-
- if (temp)
- ++table;
+ moveTable[position++] = newFacing;
+ x = xpos1;
+ y = ypos1;
- nextFrame = _timer->getDelay(5) * _tickLength + _system->getMillis();
- while (_system->getMillis() < nextFrame) {
- _timer->update();
+ if (x == toX && y == toY)
+ return position;
- if (_currentCharacter->sceneId == 210) {
- updateKyragemFading();
- if (seq_playEnd() || _beadStateVar == 4 || _beadStateVar == 5) {
- *table = 8;
- running = false;
- break;
- }
- }
+ if (xpos1 == xpos2 && ypos1 == ypos2)
+ break;
- if ((nextFrame - _system->getMillis()) >= 10)
- delay(10, true);
- }
+ newFacing = facingTable3[start*8 + newFacing];
}
- if (frameReset && !(_brandonStatusBit & 2))
- _currentCharacter->currentAnimFrame = 7;
-
- _animator->animRefreshNPC(0);
- _animator->updateAllObjectShapes();
- return returnValue;
+ return 0x7D00;
}
-int KyraEngine_v1::changeScene(int facing) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::changeScene(%d)", facing);
- if (queryGameFlag(0xEF)) {
- if (_currentCharacter->sceneId == 5)
- return 0;
- }
-
- int xpos = _charXPosTable[facing] + _currentCharacter->x1;
- int ypos = _charYPosTable[facing] + _currentCharacter->y1;
+int KyraEngine_v1::getFacingFromPointToPoint(int x, int y, int toX, int toY) {
+ debugC(9, kDebugLevelMain, "KyraEngine_v1::getFacingFromPointToPoint(%d, %d, %d, %d)", x, y, toX, toY);
+ static const int facingTable[] = {
+ 1, 0, 1, 2, 3, 4, 3, 2, 7, 0, 7, 6, 5, 4, 5, 6
+ };
- if (xpos >= 12 && xpos <= 308) {
- if (!lineIsPassable(xpos, ypos))
- return false;
+ int facingEntry = 0;
+ int ydiff = y - toY;
+ if (ydiff < 0) {
+ ++facingEntry;
+ ydiff = -ydiff;
}
+ facingEntry <<= 1;
- if (_exitListPtr) {
- int16 *ptr = _exitListPtr;
- // this loop should be only entered one time, seems to be some hack in the original
- while (true) {
- if (*ptr == -1)
- break;
-
- if (*ptr > _currentCharacter->x1 || _currentCharacter->y1 < ptr[1] || _currentCharacter->x1 > ptr[2] || _currentCharacter->y1 > ptr[3]) {
- ptr += 10;
- break;
- }
-
- _brandonPosX = ptr[6];
- _brandonPosY = ptr[7];
- uint16 sceneId = ptr[5];
- facing = ptr[4];
- int unk1 = ptr[8];
- int unk2 = ptr[9];
-
- if (sceneId == 0xFFFF) {
- switch (facing) {
- case 0:
- sceneId = _roomTable[_currentCharacter->sceneId].northExit;
- break;
-
- case 2:
- sceneId = _roomTable[_currentCharacter->sceneId].eastExit;
- break;
-
- case 4:
- sceneId = _roomTable[_currentCharacter->sceneId].southExit;
- break;
-
- case 6:
- sceneId = _roomTable[_currentCharacter->sceneId].westExit;
- break;
-
- default:
- break;
- }
- }
-
- _currentCharacter->facing = facing;
- _animator->animRefreshNPC(0);
- _animator->updateAllObjectShapes();
- enterNewScene(sceneId, facing, unk1, unk2, 0);
- resetGameFlag(0xEE);
- return 1;
- }
+ int xdiff = toX - x;
+ if (xdiff < 0) {
+ ++facingEntry;
+ xdiff = -xdiff;
}
- int returnValue = 0;
- facing = 0;
+ if (xdiff >= ydiff) {
+ int temp = ydiff;
+ ydiff = xdiff;
+ xdiff = temp;
- if ((_northExitHeight & 0xFF) + 2 >= ypos || (_northExitHeight & 0xFF) + 2 >= _currentCharacter->y1) {
- facing = 0;
- returnValue = 1;
+ facingEntry <<= 1;
+ } else {
+ facingEntry <<= 1;
+ facingEntry += 1;
}
+ int temp = (ydiff + 1) >> 1;
- if (xpos >= 308 || (_currentCharacter->x1 + 4) >= 308) {
- facing = 2;
- returnValue = 1;
+ if (xdiff < temp) {
+ facingEntry <<= 1;
+ facingEntry += 1;
+ } else {
+ facingEntry <<= 1;
}
- if (((_northExitHeight >> 8) & 0xFF) - 2 < ypos || ((_northExitHeight >> 8) & 0xFF) - 2 < _currentCharacter->y1) {
- facing = 4;
- returnValue = 1;
- }
+ assert(facingEntry < ARRAYSIZE(facingTable));
+ return facingTable[facingEntry];
+}
- if (xpos <= 12 || _currentCharacter->y1 <= 12) {
- facing = 6;
- returnValue = 1;
- }
- if (!returnValue)
- return 0;
-
- uint16 sceneId = 0xFFFF;
- switch (facing) {
+int KyraEngine_v1::getOppositeFacingDirection(int dir) {
+ debugC(9, kDebugLevelMain, "KyraEngine_v1::getOppositeFacingDirection(%d)", dir);
+ switch (dir) {
case 0:
- sceneId = _roomTable[_currentCharacter->sceneId].northExit;
- break;
-
- case 2:
- sceneId = _roomTable[_currentCharacter->sceneId].eastExit;
- break;
-
+ return 2;
+ case 1:
+ return 1;
+ case 3:
+ return 7;
case 4:
- sceneId = _roomTable[_currentCharacter->sceneId].southExit;
- break;
-
+ return 6;
+ case 5:
+ return 5;
+ case 6:
+ return 4;
+ case 7:
+ return 3;
default:
- sceneId = _roomTable[_currentCharacter->sceneId].westExit;
break;
}
-
- if (sceneId == 0xFFFF)
- return 0;
-
- enterNewScene(sceneId, facing, 1, 1, 0);
- return returnValue;
-}
-
-void KyraEngine_v1::setCharactersInDefaultScene() {
- static const uint32 defaultSceneTable[][4] = {
- { 0xFFFF, 0x0004, 0x0003, 0xFFFF },
- { 0xFFFF, 0x0022, 0xFFFF, 0x0000 },
- { 0xFFFF, 0x001D, 0x0021, 0xFFFF },
- { 0xFFFF, 0x0000, 0x0000, 0xFFFF }
- };
-
- for (int i = 1; i < 5; ++i) {
- Character *cur = &_characterList[i];
- //cur->field_20 = 0;
-
- const uint32 *curTable = defaultSceneTable[i-1];
- cur->sceneId = curTable[0];
-
- if (cur->sceneId == _currentCharacter->sceneId)
- //++cur->field_20;
- cur->sceneId = curTable[1/*cur->field_20*/];
-
- //cur->field_23 = curTable[cur->field_20+1];
- }
+ return 0;
}
-void KyraEngine_v1::setCharactersPositions(int character) {
- static uint16 initXPosTable[] = {
- 0x3200, 0x0024, 0x2230, 0x2F00, 0x0020, 0x002B,
- 0x00CA, 0x00F0, 0x0082, 0x00A2, 0x0042
- };
- static uint8 initYPosTable[] = {
- 0x00, 0xA2, 0x00, 0x42, 0x00,
- 0x67, 0x67, 0x60, 0x5A, 0x71,
- 0x76
- };
-
- assert(character < ARRAYSIZE(initXPosTable));
- Character *edit = &_characterList[character];
- edit->x1 = edit->x2 = initXPosTable[character];
- edit->y1 = edit->y2 = initYPosTable[character];
+void KyraEngine_v1::changePosTowardsFacing(int &x, int &y, int facing) {
+ debugC(9, kDebugLevelMain, "KyraEngine_v1::changePosTowardsFacing(%d, %d, %d)", x, y, facing);
+ x += _addXPosTable[facing];
+ y += _addYPosTable[facing];
}
-#pragma mark -
-#pragma mark - Pathfinder
-#pragma mark -
-
-int KyraEngine_v1::findWay(int x, int y, int toX, int toY, int *moveTable, int moveTableSize) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::findWay(%d, %d, %d, %d, %p, %d)", x, y, toX, toY, (const void *)moveTable, moveTableSize);
- int ret = KyraEngine::findWay(x, y, toX, toY, moveTable, moveTableSize);
- if (ret == 0x7D00)
+int KyraEngine_v1::getMoveTableSize(int *moveTable) {
+ debugC(9, kDebugLevelMain, "KyraEngine_v1::getMoveTableSize(%p)", (const void *)moveTable);
+ int retValue = 0;
+ if (moveTable[0] == 8)
return 0;
- return getMoveTableSize(moveTable);
-}
-
-bool KyraEngine_v1::lineIsPassable(int x, int y) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::lineIsPassable(%d, %d)", x, y);
- if (queryGameFlag(0xEF)) {
- if (_currentCharacter->sceneId == 5)
- return true;
- }
-
- if (_pathfinderFlag & 2) {
- if (x >= 312)
- return false;
- }
- if (_pathfinderFlag & 4) {
- if (y >= 136)
- return false;
- }
+ static const int facingTable[] = {
+ 4, 5, 6, 7, 0, 1, 2, 3
+ };
+ static const int unkTable[] = {
+ -1, -1, 1, 2, -1, 6, 7, -1,
+ -1, -1, -1, -1, 2, -1, 0, -1,
+ 1, -1, -1, -1, 3, 4, -1, 0,
+ 2, -1, -1, -1, -1, -1, 4, -1,
+ -1, 2, 3, -1, -1, -1, 5, 6,
+ 6, -1, 4, -1, -1, -1, -1, -1,
+ 7, 0, -1, 4, 5, -1, -1, -1,
+ -1, -1, 0, -1, 6, -1, -1, -1
+ };
- if (_pathfinderFlag & 8) {
- if (x < 8)
- return false;
- }
+ int *oldPosition = moveTable;
+ int *tempPosition = moveTable;
+ int *curPosition = moveTable + 1;
+ retValue = 1;
- if (_pathfinderFlag2) {
- if (x <= 8 || x >= 312)
- return true;
- if (y < (_northExitHeight & 0xFF) || y > 135)
- return true;
- }
+ while (*curPosition != 8) {
+ if (*oldPosition == facingTable[*curPosition]) {
+ retValue -= 2;
+ *oldPosition = 9;
+ *curPosition = 9;
- if (y > 137)
- return false;
-
- if (y < 0)
- y = 0;
+ while (tempPosition != moveTable) {
+ --tempPosition;
+ if (*tempPosition != 9)
+ break;
+ }
- int ypos = 8;
- if (_scaleMode) {
- ypos = (_scaleTable[y] >> 5) + 1;
- if (8 < ypos)
- ypos = 8;
- }
+ if (tempPosition == moveTable && *tempPosition == 9) {
+ while (*tempPosition != 8 && *tempPosition == 9)
+ ++tempPosition;
- x -= (ypos >> 1);
+ if (*tempPosition == 8)
+ return 0;
+ }
- int xpos = x;
- int xtemp = xpos + ypos - 1;
- if (x < 0)
- xpos = 0;
+ oldPosition = tempPosition;
+ curPosition = oldPosition+1;
- if (xtemp > 319)
- xtemp = 319;
+ while (*curPosition != 8 && *curPosition == 9)
+ ++curPosition;
- for (; xpos < xtemp; ++xpos) {
- if (!_screen->getShapeFlag1(xpos, y))
- return false;
- }
- return true;
-}
+ continue;
+ }
-#pragma mark -
+ if (unkTable[*curPosition+((*oldPosition)*8)] != -1) {
+ --retValue;
+ *oldPosition = unkTable[*curPosition+((*oldPosition)*8)];
+ *curPosition = 9;
-void KyraEngine_v1::setupSceneResource(int sceneId) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::setupSceneResource(%d)", sceneId);
- if (!_flags.isTalkie)
- return;
+ if (tempPosition != oldPosition) {
+ curPosition = oldPosition;
+ oldPosition = tempPosition;
+ while (true) {
+ if (tempPosition == moveTable)
+ break;
- if (_currentRoom != 0xFFFF) {
- assert(_currentRoom < _roomTableSize);
- int tableId = _roomTable[_currentRoom].nameIndex;
- assert(tableId < _roomFilenameTableSize);
+ --tempPosition;
+ if (*tempPosition != 9)
+ break;
- // unload our old room
- char file[64];
- strcpy(file, _roomFilenameTable[tableId]);
- strcat(file, ".VRM");
- _res->unloadPakFile(file);
+ }
+ } else {
+ while (true) {
+ ++curPosition;
+ if (*curPosition != 9)
+ break;
+ }
+ }
+ continue;
+ }
- strcpy(file, _roomFilenameTable[tableId]);
- strcat(file, ".PAK");
- _res->unloadPakFile(file);
+ tempPosition = oldPosition;
+ oldPosition = curPosition;
+ ++retValue;
- strcpy(file, _roomFilenameTable[tableId]);
- strcat(file, ".APK");
- _res->unloadPakFile(file);
+ while (true) {
+ ++curPosition;
+ if (*curPosition != 9)
+ break;
+ }
}
- assert(sceneId < _roomTableSize);
- int tableId = _roomTable[sceneId].nameIndex;
- assert(tableId < _roomFilenameTableSize);
-
- // load our new room
- char file[64];
- strcpy(file, _roomFilenameTable[tableId]);
- strcat(file, ".VRM");
- if (_res->exists(file))
- _res->loadPakFile(file);
-
- strcpy(file, _roomFilenameTable[tableId]);
- strcat(file, ".PAK");
- if (_res->exists(file))
- _res->loadPakFile(file);
-
- strcpy(file, _roomFilenameTable[tableId]);
- strcat(file, ".APK");
- if (_res->exists(file))
- _res->loadPakFile(file);
+ return retValue;
}
} // end of namespace Kyra
-
diff --git a/engines/kyra/scene_v2.cpp b/engines/kyra/scene_v2.cpp
index 5d811bcf44..3bf81bfb39 100644
--- a/engines/kyra/scene_v2.cpp
+++ b/engines/kyra/scene_v2.cpp
@@ -90,7 +90,7 @@ int KyraEngine_v2::findWay(int x, int y, int toX, int toY, int *moveTable, int m
debugC(9, kDebugLevelMain, "KyraEngine_v2::findWay(%d, %d, %d, %d, %p, %d)", x, y, toX, toY, (const void *)moveTable, moveTableSize);
x &= ~3; toX &= ~3;
y &= ~1; toY &= ~1;
- int size = KyraEngine::findWay(x, y, toX, toY, moveTable, moveTableSize);
+ int size = KyraEngine_v1::findWay(x, y, toX, toY, moveTable, moveTableSize);
static bool usePostProcess = false;
if (size && !usePostProcess) {
usePostProcess = true;
@@ -98,7 +98,7 @@ int KyraEngine_v2::findWay(int x, int y, int toX, int toY, int *moveTable, int m
temp = pathfinderInitPositionIndexTable(temp, x, y);
pathfinderFinializePath(moveTable, temp, x, y, moveTableSize);
usePostProcess = false;
- }
+ }
return usePostProcess ? size : getMoveTableSize(moveTable);
}
@@ -106,13 +106,14 @@ bool KyraEngine_v2::directLinePassable(int x, int y, int toX, int toY) {
debugC(9, kDebugLevelMain, "KyraEngine_v2::directLinePassable(%d, %d, %d, %d)", x, y, toX, toY);
Screen *scr = screen();
- while (x != toX && y != toY) {
+ while (x != toX || y != toY) {
int facing = getFacingFromPointToPoint(x, y, toX, toY);
x += _addXPosTable[facing];
y += _addYPosTable[facing];
if (!scr->getShapeFlag1(x, y))
return false;
}
+
return true;
}
diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp
index 298483465e..f00c47ceea 100644
--- a/engines/kyra/screen.cpp
+++ b/engines/kyra/screen.cpp
@@ -28,40 +28,41 @@
#include "common/system.h"
#include "graphics/cursorman.h"
#include "kyra/screen.h"
-#include "kyra/kyra.h"
+#include "kyra/kyra_v1.h"
#include "kyra/resource.h"
namespace Kyra {
-Screen::Screen(KyraEngine *vm, OSystem *system)
+Screen::Screen(KyraEngine_v1 *vm, OSystem *system)
: _system(system), _vm(vm), _sjisInvisibleColor(0) {
_debugEnabled = false;
+ _maskMinY = _maskMaxY = -1;
}
Screen::~Screen() {
for (int i = 0; i < SCREEN_OVLS_NUM; ++i)
- delete [] _sjisOverlayPtrs[i];
+ delete[] _sjisOverlayPtrs[i];
- delete [] _pagePtrs[0];
+ delete[] _pagePtrs[0];
for (int f = 0; f < ARRAYSIZE(_fonts); ++f) {
delete[] _fonts[f].fontData;
_fonts[f].fontData = NULL;
}
- delete [] _sjisFontData;
- delete [] _sjisTempPage;
- delete [] _currentPalette;
- delete [] _screenPalette;
- delete [] _decodeShapeBuffer;
- delete [] _animBlockPtr;
+ delete[] _sjisFontData;
+ delete[] _sjisTempPage;
+ delete[] _currentPalette;
+ delete[] _screenPalette;
+ delete[] _decodeShapeBuffer;
+ delete[] _animBlockPtr;
if (_vm->gameFlags().platform != Common::kPlatformAmiga) {
for (int i = 0; i < ARRAYSIZE(_palettes); ++i)
- delete [] _palettes[i];
+ delete[] _palettes[i];
}
- delete [] _dirtyRects;
+ delete[] _dirtyRects;
}
bool Screen::init() {
@@ -307,14 +308,16 @@ const uint8 *Screen::getCPagePtr(int pageNum) const {
uint8 *Screen::getPageRect(int pageNum, int x, int y, int w, int h) {
debugC(9, kDebugLevelScreen, "Screen::getPageRect(%d, %d, %d, %d, %d)", pageNum, x, y, w, h);
assert(pageNum < SCREEN_PAGE_NUM);
- if (pageNum == 0 || pageNum == 1) addDirtyRect(x, y, w, h);
+ if (pageNum == 0 || pageNum == 1)
+ addDirtyRect(x, y, w, h);
return _pagePtrs[pageNum] + y * SCREEN_W + x;
}
void Screen::clearPage(int pageNum) {
debugC(9, kDebugLevelScreen, "Screen::clearPage(%d)", pageNum);
assert(pageNum < SCREEN_PAGE_NUM);
- if (pageNum == 0 || pageNum == 1) _forceFullUpdate = true;
+ if (pageNum == 0 || pageNum == 1)
+ _forceFullUpdate = true;
memset(getPagePtr(pageNum), 0, SCREEN_PAGE_SIZE);
clearOverlayPage(pageNum);
}
@@ -329,7 +332,8 @@ int Screen::setCurPage(int pageNum) {
void Screen::clearCurPage() {
debugC(9, kDebugLevelScreen, "Screen::clearCurPage()");
- if (_curPage == 0 || _curPage == 1) _forceFullUpdate = true;
+ if (_curPage == 0 || _curPage == 1)
+ _forceFullUpdate = true;
memset(getPagePtr(_curPage), 0, SCREEN_PAGE_SIZE);
clearOverlayPage(_curPage);
}
@@ -478,7 +482,7 @@ void Screen::copyToPage0(int y, int h, uint8 page, uint8 *seqBuf) {
}
addDirtyRect(0, y, SCREEN_W, h);
// This would remove the text in the end sequence of
- // the FM-Towns version.
+ // the (Kyrandia 1) FM-Towns version.
// Since this method is just used for the Seqplayer
// this shouldn't be a problem anywhere else, so it's
// safe to disable the call here.
@@ -576,7 +580,8 @@ void Screen::copyPage(uint8 srcPage, uint8 dstPage) {
memcpy(dst, src, SCREEN_W * SCREEN_H);
copyOverlayRegion(0, 0, 0, 0, SCREEN_W, SCREEN_H, srcPage, dstPage);
- if (dstPage == 0 || dstPage == 1) _forceFullUpdate = true;
+ if (dstPage == 0 || dstPage == 1)
+ _forceFullUpdate = true;
}
void Screen::copyBlockToPage(int pageNum, int x, int y, int w, int h, const uint8 *src) {
@@ -843,7 +848,7 @@ void Screen::drawLine(bool vertical, int x, int y, int length, int color) {
void Screen::setAnimBlockPtr(int size) {
debugC(9, kDebugLevelScreen, "Screen::setAnimBlockPtr(%d)", size);
- delete [] _animBlockPtr;
+ delete[] _animBlockPtr;
_animBlockPtr = new uint8[size];
assert(_animBlockPtr);
memset(_animBlockPtr, 0, size);
@@ -867,18 +872,18 @@ bool Screen::loadFont(FontId fontId, const char *filename) {
error("fontId %d is invalid", fontId);
if (fnt->fontData)
- delete [] fnt->fontData;
+ delete[] fnt->fontData;
uint32 sz = 0;
uint8 *fontData = fnt->fontData = _vm->resource()->fileData(filename, &sz);
if (!fontData || !sz)
- error("couldn't load font file '%s'", filename);
+ error("Couldn't load font file '%s'", filename);
uint16 fontSig = READ_LE_UINT16(fontData + 2);
if (fontSig != 0x500)
- error("Invalid font data (file '%s')", filename);
+ error("Invalid font data (file '%s', fontSig: %.04X)", filename, fontSig);
fnt->charWidthTable = fontData + READ_LE_UINT16(fontData + 8);
fnt->charSizeOffset = READ_LE_UINT16(fontData + 4);
@@ -934,15 +939,14 @@ int Screen::getTextWidth(const char *str) const {
if (c == 0) {
break;
} else if (c == '\r') {
- if (curLineLen > maxLineLen) {
+ if (curLineLen > maxLineLen)
maxLineLen = curLineLen;
- } else {
+ else
curLineLen = 0;
- }
} else {
- if (c <= 0x7F || !_useSJIS)
+ if (c <= 0x7F || !_useSJIS) {
curLineLen += getCharWidth(c);
- else {
+ } else {
c = READ_LE_UINT16(str - 1);
++str;
curLineLen += getCharWidth(c);
@@ -1894,11 +1898,10 @@ void Screen::wrapped_decodeFrameDelta(uint8 *dst, const uint8 *src) {
void Screen::decodeFrameDeltaPage(uint8 *dst, const uint8 *src, int pitch, bool noXor) {
debugC(9, kDebugLevelScreen, "Screen::decodeFrameDeltaPage(%p, %p, %d, %d)", (const void *)dst, (const void *)src, pitch, noXor);
- if (noXor) {
+ if (noXor)
wrapped_decodeFrameDeltaPage<true>(dst, src, pitch);
- } else {
+ else
wrapped_decodeFrameDeltaPage<false>(dst, src, pitch);
- }
}
void Screen::convertAmigaGfx(uint8 *data, int w, int h, bool offscreen) {
@@ -1933,7 +1936,7 @@ void Screen::convertAmigaGfx(uint8 *data, int w, int h, bool offscreen) {
for (int y = 0; y < h; ++y) {
for (int x = 0; x < w; ++x) {
int bytePos = x/8+y*40;
- int bitPos = 7-x&7;
+ int bitPos = 7-(x&7);
byte colorIndex = 0;
colorIndex |= (((tmp[bytePos + 8000 * 0] & (1 << bitPos)) >> bitPos) & 0x1) << 0;
@@ -2235,7 +2238,7 @@ uint8 *Screen::encodeShape(int x, int y, int w, int h, int flags) {
uint8 *newShape2 = new uint8[shapeSize];
assert(newShape2);
memcpy(newShape2, newShape, shapeSize);
- delete [] newShape;
+ delete[] newShape;
newShape = newShape2;
} else {
dst = shapePtrBackUp;
@@ -2469,7 +2472,7 @@ void Screen::setMouseCursor(int x, int y, byte *shape) {
copyRegionToBuffer(8, xOffset, 0, mouseWidth, mouseHeight, cursor);
CursorMan.replaceCursor(cursor, mouseWidth, mouseHeight, x, y, 0);
CursorMan.showMouse(true);
- delete [] cursor;
+ delete[] cursor;
// makes sure that the cursor is drawn
// we do not use Screen::updateScreen here
@@ -2642,7 +2645,7 @@ void Screen::shakeScreen(int times) {
}
void Screen::loadBitmap(const char *filename, int tempPage, int dstPage, uint8 *palData, bool skip) {
- debugC(9, kDebugLevelScreen, "KyraEngine::loadBitmap('%s', %d, %d, %p, %d)", filename, tempPage, dstPage, (void *)palData, skip);
+ debugC(9, kDebugLevelScreen, "KyraEngine_v1::loadBitmap('%s', %d, %d, %p, %d)", filename, tempPage, dstPage, (void *)palData, skip);
uint32 fileSize;
uint8 *srcData = _vm->resource()->fileData(filename, &fileSize);
@@ -2694,7 +2697,7 @@ void Screen::loadBitmap(const char *filename, int tempPage, int dstPage, uint8 *
if (skip)
srcData -= 4;
- delete [] srcData;
+ delete[] srcData;
}
bool Screen::loadPalette(const char *filename, uint8 *palData) {
@@ -2722,7 +2725,7 @@ bool Screen::loadPalette(const char *filename, uint8 *palData) {
memcpy(palData, srcData, fileSize);
}
}
- delete [] srcData;
+ delete[] srcData;
return true;
}
diff --git a/engines/kyra/screen.h b/engines/kyra/screen.h
index bf23747daf..f8c85a2bac 100644
--- a/engines/kyra/screen.h
+++ b/engines/kyra/screen.h
@@ -35,7 +35,7 @@ namespace Kyra {
typedef Common::Functor0<void> UpdateFunctor;
-class KyraEngine;
+class KyraEngine_v1;
struct Rect {
int x, y;
@@ -96,7 +96,7 @@ public:
FID_NUM
};
- Screen(KyraEngine *vm, OSystem *system);
+ Screen(KyraEngine_v1 *vm, OSystem *system);
virtual ~Screen();
// init
@@ -301,7 +301,7 @@ protected:
void addDirtyRect(int x, int y, int w, int h);
OSystem *_system;
- KyraEngine *_vm;
+ KyraEngine_v1 *_vm;
// shape
int drawShapeMarginNoScaleUpwind(uint8 *&dst, const uint8 *&src, int &cnt);
diff --git a/engines/kyra/screen_hof.cpp b/engines/kyra/screen_hof.cpp
index 9192626159..2378c870a8 100644
--- a/engines/kyra/screen_hof.cpp
+++ b/engines/kyra/screen_hof.cpp
@@ -31,13 +31,7 @@
namespace Kyra {
Screen_HoF::Screen_HoF(KyraEngine_HoF *vm, OSystem *system)
- : Screen_v2(vm, system) {
- _vm = vm;
- _wsaFrameAnimBuffer = new uint8[1024];
-}
-
-Screen_HoF::~Screen_HoF() {
- delete [] _wsaFrameAnimBuffer;
+ : Screen_v2(vm, system), _vm(vm) {
}
void Screen_HoF::setScreenDim(int dim) {
@@ -74,80 +68,10 @@ void Screen_HoF::generateGrayOverlay(const uint8 *srcPal, uint8 *grayOverlay, in
grayOverlay[i] = findLeastDifferentColor(tmpPal + 3 * i, srcPal, lastColor);
}
-void Screen_HoF::wsaFrameAnimationStep(int x1, int y1, int x2, int y2,
- int w1, int h1, int w2, int h2, int srcPage, int dstPage, int dim) {
-
- if (!(w1 || h1 || w2 || h2))
- return;
-
- ScreenDim cdm = _screenDimTable[dim];
- cdm.sx <<= 3;
- cdm.w <<= 3;
-
- int na = 0, nb = 0, nc = w2;
-
- if (!calcBounds(cdm.w, cdm.h, x2, y2, w2, h2, na, nb, nc))
- return;
-
- const uint8 *src = getPagePtr(srcPage) + y1 * 320;
- uint8 *dst = getPagePtr(dstPage) + (y2 + cdm.sy) * 320;
-
- int u = -1;
-
- do {
- int t = (nb * h1) / h2;
- if (t != u) {
- u = t;
- const uint8 *s = src + (x1 + t) * 320;
- uint8 *dt = (uint8*) _wsaFrameAnimBuffer;
-
- t = w2 - w1;
- if (!t) {
- memcpy(dt, s, w2);
- } else if (t > 0) {
- if (w1 == 1) {
- memset(dt, *s, w2);
- } else {
- t = ((((((w2 - w1 + 1) & 0xffff) << 8) / w1) + 0x100) & 0xffff) << 8;
- int bp = 0;
- for (int i = 0; i < w1; i++) {
- int cnt = (t >> 16);
- bp += (t & 0xffff);
- if (bp > 0xffff) {
- bp -= 0xffff;
- cnt++;
- }
- memset(dt, *s++, cnt);
- dt += cnt;
- }
- }
- } else {
- if (w2 == 1) {
- *dt = *s;
- } else {
- t = (((((w1 - w2) & 0xffff) << 8) / w2) & 0xffff) << 8;
- int bp = 0;
- for (int i = 0; i < w2; i++) {
- *dt++ = *s++;
- bp += (t & 0xffff);
- if (bp > 0xffff) {
- bp -= 0xffff;
- s++;
- }
- s += (t >> 16);
- }
- }
- }
- }
- memcpy(dst + x2 + cdm.sx, _wsaFrameAnimBuffer + na, w2);
- dst += 320;
- } while (++nb < h2);
-}
-
void Screen_HoF::cmpFadeFrameStep(int srcPage, int srcW, int srcH, int srcX, int srcY, int dstPage, int dstW,
int dstH, int dstX, int dstY, int cmpW, int cmpH, int cmpPage) {
- if (!(cmpW || cmpH ))
+ if (!cmpW || !cmpH)
return;
int r1, r2, r3, r4, r5, r6;
@@ -192,8 +116,7 @@ void Screen_HoF::copyPageMemory(int srcPage, int srcPos, int dstPage, int dstPos
memcpy(dst, src, numBytes);
}
-
-void Screen_HoF::copyRegionEx(int srcPage, int srcW, int srcH, int dstPage, int dstX,int dstY, int dstW, int dstH, const ScreenDim *dim, bool flag) {
+void Screen_HoF::copyRegionEx(int srcPage, int srcW, int srcH, int dstPage, int dstX, int dstY, int dstW, int dstH, const ScreenDim *dim, bool flag) {
int x0 = dim->sx << 3;
int y0 = dim->sy;
int w0 = dim->w << 3;
@@ -229,51 +152,5 @@ void Screen_HoF::copyRegionEx(int srcPage, int srcW, int srcH, int dstPage, int
}
}
-bool Screen_HoF::calcBounds(int w0, int h0, int &x1, int &y1, int &w1, int &h1, int &x2, int &y2, int &w2) {
- x2 = 0;
- y2 = 0;
- w2 = w1;
-
- int t = x1 + w1;
- if (t < 1) {
- w1 = h1 = -1;
- } else {
- if (t <= x1) {
- x2 = w1 - t;
- w1 = t;
- x1 = 0;
- }
- t = w0 - x1;
- if (t < 1) {
- w1 = h1 = -1;
- } else {
- if (t <= w1) {
- w1 = t;
- }
- w2 -= w1;
- t = h1 + y1;
- if (t < 1) {
- w1 = h1 = -1;
- } else {
- if (t <= y1) {
- y2 = h1 - t;
- h1 = t;
- y1 = 0;
- }
- t = h0 - y1;
- if (t < 1) {
- w1 = h1 = -1;
- } else {
- if (t <= h1) {
- h1 = t;
- }
- }
- }
- }
- }
-
- return (w1 == -1) ? false : true;
-}
-
} // end of namespace Kyra
diff --git a/engines/kyra/screen_hof.h b/engines/kyra/screen_hof.h
index a6df749538..088e8b7f55 100644
--- a/engines/kyra/screen_hof.h
+++ b/engines/kyra/screen_hof.h
@@ -36,15 +36,12 @@ class Screen_HoF : public Screen_v2 {
friend class Debugger_v2;
public:
Screen_HoF(KyraEngine_HoF *vm, OSystem *system);
- ~Screen_HoF();
void setScreenDim(int dim);
const ScreenDim *getScreenDim(int dim);
// sequence player
void generateGrayOverlay(const uint8 *srcPal, uint8 *grayOverlay, int factor, int addR, int addG, int addB, int lastColor, bool flag);
- bool calcBounds(int w0, int h0, int &x1, int &y1, int &w1, int &h1, int &x2, int &y2, int &w2);
- void wsaFrameAnimationStep(int x1, int y1, int x2, int y2, int w1, int h1, int w2, int h2, int srcPage, int dstPage, int dim);
void cmpFadeFrameStep(int srcPage, int srcW, int srcH, int srcX, int srcY, int dstPage, int dstW, int dstH, int dstX, int dstY, int cmpW, int cmpH, int cmpPage);
void copyPageMemory(int srcPage, int srcPos, int dstPage, int dstPos, int numBytes);
void copyRegionEx(int srcPage, int srcW, int srcH, int dstPage, int dstX,int dstY, int dstW, int dstH, const ScreenDim *d, bool flag = false);
@@ -53,8 +50,6 @@ private:
static const ScreenDim _screenDimTable[];
static const int _screenDimTableCount;
-
- uint8 *_wsaFrameAnimBuffer;
};
} // End of namespace Kyra
diff --git a/engines/kyra/screen_v1.cpp b/engines/kyra/screen_lok.cpp
index 9454418fd5..011c90dde9 100644
--- a/engines/kyra/screen_v1.cpp
+++ b/engines/kyra/screen_lok.cpp
@@ -23,36 +23,36 @@
*
*/
-#include "kyra/kyra_v1.h"
-#include "kyra/screen_v1.h"
+#include "kyra/kyra_lok.h"
+#include "kyra/screen_lok.h"
namespace Kyra {
#define BITBLIT_RECTS 10
-Screen_v1::Screen_v1(KyraEngine_v1 *vm, OSystem *system)
+Screen_LoK::Screen_LoK(KyraEngine_LoK *vm, OSystem *system)
: Screen(vm, system) {
_vm = vm;
}
-Screen_v1::~Screen_v1() {
- delete [] _bitBlitRects;
+Screen_LoK::~Screen_LoK() {
+ delete[] _bitBlitRects;
for (int i = 0; i < ARRAYSIZE(_saveLoadPage); ++i) {
- delete [] _saveLoadPage[i];
+ delete[] _saveLoadPage[i];
_saveLoadPage[i] = 0;
}
for (int i = 0; i < ARRAYSIZE(_saveLoadPageOvl); ++i) {
- delete [] _saveLoadPageOvl[i];
+ delete[] _saveLoadPageOvl[i];
_saveLoadPageOvl[i] = 0;
}
- delete [] _unkPtr1;
- delete [] _unkPtr2;
+ delete[] _unkPtr1;
+ delete[] _unkPtr2;
}
-bool Screen_v1::init() {
+bool Screen_LoK::init() {
if (!Screen::init())
return false;
@@ -73,20 +73,20 @@ bool Screen_v1::init() {
return true;
}
-void Screen_v1::setScreenDim(int dim) {
- debugC(9, kDebugLevelScreen, "Screen_v1::setScreenDim(%d)", dim);
+void Screen_LoK::setScreenDim(int dim) {
+ debugC(9, kDebugLevelScreen, "Screen_LoK::setScreenDim(%d)", dim);
assert(dim < _screenDimTableCount);
_curDim = &_screenDimTable[dim];
}
-const ScreenDim *Screen_v1::getScreenDim(int dim) {
- debugC(9, kDebugLevelScreen, "Screen_v1::getScreenDim(%d)", dim);
+const ScreenDim *Screen_LoK::getScreenDim(int dim) {
+ debugC(9, kDebugLevelScreen, "Screen_LoK::getScreenDim(%d)", dim);
assert(dim < _screenDimTableCount);
return &_screenDimTable[dim];
}
-void Screen_v1::fadeSpecialPalette(int palIndex, int startIndex, int size, int fadeTime) {
- debugC(9, kDebugLevelScreen, "Screen_v1::fadeSpecialPalette(%d, %d, %d, %d)", palIndex, startIndex, size, fadeTime);
+void Screen_LoK::fadeSpecialPalette(int palIndex, int startIndex, int size, int fadeTime) {
+ debugC(9, kDebugLevelScreen, "Screen_LoK::fadeSpecialPalette(%d, %d, %d, %d)", palIndex, startIndex, size, fadeTime);
assert(_vm->palTable1()[palIndex]);
assert(_currentPalette);
@@ -99,8 +99,8 @@ void Screen_v1::fadeSpecialPalette(int palIndex, int startIndex, int size, int f
_system->updateScreen();
}
-void Screen_v1::addBitBlitRect(int x, int y, int w, int h) {
- debugC(9, kDebugLevelScreen, "Screen_v1::addBitBlitRects(%d, %d, %d, %d)", x, y, w, h);
+void Screen_LoK::addBitBlitRect(int x, int y, int w, int h) {
+ debugC(9, kDebugLevelScreen, "Screen_LoK::addBitBlitRects(%d, %d, %d, %d)", x, y, w, h);
if (_bitBlitNum >= BITBLIT_RECTS)
error("too many bit blit rects");
@@ -111,8 +111,8 @@ void Screen_v1::addBitBlitRect(int x, int y, int w, int h) {
++_bitBlitNum;
}
-void Screen_v1::bitBlitRects() {
- debugC(9, kDebugLevelScreen, "Screen_v1::bitBlitRects()");
+void Screen_LoK::bitBlitRects() {
+ debugC(9, kDebugLevelScreen, "Screen_LoK::bitBlitRects()");
Rect *cur = _bitBlitRects;
while (_bitBlitNum) {
_bitBlitNum--;
@@ -121,8 +121,8 @@ void Screen_v1::bitBlitRects() {
}
}
-void Screen_v1::savePageToDisk(const char *file, int page) {
- debugC(9, kDebugLevelScreen, "Screen_v1::savePageToDisk('%s', %d)", file, page);
+void Screen_LoK::savePageToDisk(const char *file, int page) {
+ debugC(9, kDebugLevelScreen, "Screen_LoK::savePageToDisk('%s', %d)", file, page);
if (!_saveLoadPage[page/2]) {
_saveLoadPage[page/2] = new uint8[SCREEN_W * SCREEN_H];
assert(_saveLoadPage[page/2]);
@@ -145,10 +145,10 @@ void Screen_v1::savePageToDisk(const char *file, int page) {
}
}
-void Screen_v1::loadPageFromDisk(const char *file, int page) {
- debugC(9, kDebugLevelScreen, "Screen_v1::loadPageFromDisk('%s', %d)", file, page);
+void Screen_LoK::loadPageFromDisk(const char *file, int page) {
+ debugC(9, kDebugLevelScreen, "Screen_LoK::loadPageFromDisk('%s', %d)", file, page);
copyBlockToPage(page, 0, 0, SCREEN_W, SCREEN_H, _saveLoadPage[page/2]);
- delete [] _saveLoadPage[page/2];
+ delete[] _saveLoadPage[page/2];
if (_saveLoadPageOvl[page/2]) {
uint8 *dstPage = getOverlayPtr(page);
@@ -158,24 +158,24 @@ void Screen_v1::loadPageFromDisk(const char *file, int page) {
}
memcpy(dstPage, _saveLoadPageOvl[page/2], SCREEN_OVL_SJIS_SIZE);
- delete [] _saveLoadPageOvl[page/2];
+ delete[] _saveLoadPageOvl[page/2];
_saveLoadPageOvl[page/2] = 0;
} _saveLoadPage[page/2] = 0;
}
-void Screen_v1::deletePageFromDisk(int page) {
- debugC(9, kDebugLevelScreen, "Screen_v1::deletePageFromDisk(%d)", page);
- delete [] _saveLoadPage[page/2];
+void Screen_LoK::deletePageFromDisk(int page) {
+ debugC(9, kDebugLevelScreen, "Screen_LoK::deletePageFromDisk(%d)", page);
+ delete[] _saveLoadPage[page/2];
_saveLoadPage[page/2] = 0;
if (_saveLoadPageOvl[page/2]) {
- delete [] _saveLoadPageOvl[page/2];
+ delete[] _saveLoadPageOvl[page/2];
_saveLoadPageOvl[page/2] = 0;
}
}
-void Screen_v1::copyBackgroundBlock(int x, int page, int flag) {
- debugC(9, kDebugLevelScreen, "Screen_v1::copyBackgroundBlock(%d, %d, %d)", x, page, flag);
+void Screen_LoK::copyBackgroundBlock(int x, int page, int flag) {
+ debugC(9, kDebugLevelScreen, "Screen_LoK::copyBackgroundBlock(%d, %d, %d)", x, page, flag);
if (x < 1)
return;
@@ -216,17 +216,17 @@ void Screen_v1::copyBackgroundBlock(int x, int page, int flag) {
_curPage = oldVideoPage;
}
-void Screen_v1::copyBackgroundBlock2(int x) {
- debugC(9, kDebugLevelScreen, "Screen_v1::copyBackgroundBlock2(%d)", x);
+void Screen_LoK::copyBackgroundBlock2(int x) {
+ debugC(9, kDebugLevelScreen, "Screen_LoK::copyBackgroundBlock2(%d)", x);
copyBackgroundBlock(x, 4, 1);
}
-void Screen_v1::setTextColorMap(const uint8 *cmap) {
- debugC(9, kDebugLevelScreen, "Screen_v1::setTextColorMap(%p)", (const void *)cmap);
+void Screen_LoK::setTextColorMap(const uint8 *cmap) {
+ debugC(9, kDebugLevelScreen, "Screen_LoK::setTextColorMap(%p)", (const void *)cmap);
setTextColor(cmap, 0, 11);
}
-int Screen_v1::getRectSize(int x, int y) {
+int Screen_LoK::getRectSize(int x, int y) {
if (x < 1)
x = 1;
else if (x > 40)
diff --git a/engines/kyra/screen_v1.h b/engines/kyra/screen_lok.h
index 10219ae6b5..74df23a543 100644
--- a/engines/kyra/screen_v1.h
+++ b/engines/kyra/screen_lok.h
@@ -23,19 +23,19 @@
*
*/
-#ifndef KYRA_SCREEN_V1_H
-#define KYRA_SCREEN_V1_H
+#ifndef KYRA_SCREEN_LOK_H
+#define KYRA_SCREEN_LOK_H
#include "kyra/screen.h"
namespace Kyra {
-class KyraEngine_v1;
+class KyraEngine_LoK;
-class Screen_v1 : public Screen {
+class Screen_LoK : public Screen {
public:
- Screen_v1(KyraEngine_v1 *vm, OSystem *system);
- virtual ~Screen_v1();
+ Screen_LoK(KyraEngine_LoK *vm, OSystem *system);
+ virtual ~Screen_LoK();
bool init();
@@ -59,7 +59,7 @@ public:
void bitBlitRects();
protected:
- KyraEngine_v1 *_vm;
+ KyraEngine_LoK *_vm;
static const ScreenDim _screenDimTable[];
static const int _screenDimTableCount;
diff --git a/engines/kyra/screen_v2.cpp b/engines/kyra/screen_v2.cpp
index 704296c534..e26ef87bad 100644
--- a/engines/kyra/screen_v2.cpp
+++ b/engines/kyra/screen_v2.cpp
@@ -29,6 +29,15 @@
namespace Kyra {
+Screen_v2::Screen_v2(KyraEngine_v1 *vm, OSystem *system) : Screen(vm, system), _wsaFrameAnimBuffer(0) {
+ _wsaFrameAnimBuffer = new uint8[1024];
+ assert(_wsaFrameAnimBuffer);
+}
+
+Screen_v2::~Screen_v2() {
+ delete[] _wsaFrameAnimBuffer;
+}
+
uint8 *Screen_v2::generateOverlay(const uint8 *palette, uint8 *buffer, int startColor, uint16 factor) {
if (!palette || !buffer)
return buffer;
@@ -290,6 +299,9 @@ uint8 *Screen_v2::makeShapeCopy(const uint8 *src, int index) {
debugC(9, kDebugLevelScreen, "Screen_v2::makeShapeCopy(%p, %d)", (const void *)src, index);
const uint8 *shape = getPtrToShape(src, index);
+ if (!shape)
+ return 0;
+
int size = getShapeSize(shape);
uint8 *copy = new uint8[size];
@@ -333,5 +345,121 @@ void Screen_v2::setTextColorMap(const uint8 *cmap) {
setTextColor(cmap, 0, 15);
}
+void Screen_v2::wsaFrameAnimationStep(int x1, int y1, int x2, int y2,
+ int w1, int h1, int w2, int h2, int srcPage, int dstPage, int dim) {
+
+ if (!(w1 || h1 || w2 || h2))
+ return;
+
+ ScreenDim cdm = *getScreenDim(dim);
+ cdm.sx <<= 3;
+ cdm.w <<= 3;
+
+ int na = 0, nb = 0, nc = w2;
+
+ if (!calcBounds(cdm.w, cdm.h, x2, y2, w2, h2, na, nb, nc))
+ return;
+
+ const uint8 *src = getPagePtr(srcPage) + y1 * 320;
+ uint8 *dst = getPagePtr(dstPage) + (y2 + cdm.sy) * 320;
+
+ int u = -1;
+
+ do {
+ int t = (nb * h1) / h2;
+ if (t != u) {
+ u = t;
+ const uint8 *s = src + (x1 + t) * 320;
+ uint8 *dt = (uint8 *)_wsaFrameAnimBuffer;
+
+ t = w2 - w1;
+ if (!t) {
+ memcpy(dt, s, w2);
+ } else if (t > 0) {
+ if (w1 == 1) {
+ memset(dt, *s, w2);
+ } else {
+ t = ((((((w2 - w1 + 1) & 0xffff) << 8) / w1) + 0x100) & 0xffff) << 8;
+ int bp = 0;
+ for (int i = 0; i < w1; i++) {
+ int cnt = (t >> 16);
+ bp += (t & 0xffff);
+ if (bp > 0xffff) {
+ bp -= 0xffff;
+ cnt++;
+ }
+ memset(dt, *s++, cnt);
+ dt += cnt;
+ }
+ }
+ } else {
+ if (w2 == 1) {
+ *dt = *s;
+ } else {
+ t = (((((w1 - w2) & 0xffff) << 8) / w2) & 0xffff) << 8;
+ int bp = 0;
+ for (int i = 0; i < w2; i++) {
+ *dt++ = *s++;
+ bp += (t & 0xffff);
+ if (bp > 0xffff) {
+ bp -= 0xffff;
+ s++;
+ }
+ s += (t >> 16);
+ }
+ }
+ }
+ }
+ memcpy(dst + x2 + cdm.sx, _wsaFrameAnimBuffer + na, w2);
+ dst += 320;
+ } while (++nb < h2);
+}
+
+bool Screen_v2::calcBounds(int w0, int h0, int &x1, int &y1, int &w1, int &h1, int &x2, int &y2, int &w2) {
+ x2 = 0;
+ y2 = 0;
+ w2 = w1;
+
+ int t = x1 + w1;
+ if (t < 1) {
+ w1 = h1 = -1;
+ } else {
+ if (t <= x1) {
+ x2 = w1 - t;
+ w1 = t;
+ x1 = 0;
+ }
+ t = w0 - x1;
+ if (t < 1) {
+ w1 = h1 = -1;
+ } else {
+ if (t <= w1) {
+ w1 = t;
+ }
+ w2 -= w1;
+ t = h1 + y1;
+ if (t < 1) {
+ w1 = h1 = -1;
+ } else {
+ if (t <= y1) {
+ y2 = h1 - t;
+ h1 = t;
+ y1 = 0;
+ }
+ t = h0 - y1;
+ if (t < 1) {
+ w1 = h1 = -1;
+ } else {
+ if (t <= h1) {
+ h1 = t;
+ }
+ }
+ }
+ }
+ }
+
+ return (w1 == -1) ? false : true;
+}
+
} // end of namespace Kyra
diff --git a/engines/kyra/screen_v2.h b/engines/kyra/screen_v2.h
index 5679dadf39..f624228445 100644
--- a/engines/kyra/screen_v2.h
+++ b/engines/kyra/screen_v2.h
@@ -33,7 +33,8 @@ namespace Kyra {
class Screen_v2 : public Screen {
public:
- Screen_v2(KyraEngine *vm, OSystem *system) : Screen(vm, system) {}
+ Screen_v2(KyraEngine_v1 *vm, OSystem *system);
+ ~Screen_v2();
// screen page handling
void copyWsaRect(int x, int y, int w, int h, int dimState, int plotFunc, const uint8 *src,
@@ -57,13 +58,18 @@ public:
// rect handling
int getRectSize(int w, int h);
+ bool calcBounds(int w0, int h0, int &x1, int &y1, int &w1, int &h1, int &x2, int &y2, int &w2);
// text display
void setTextColorMap(const uint8 *cmap);
// layer handling
virtual int getLayer(int x, int y);
+
+ // special WSA handling
+ void wsaFrameAnimationStep(int x1, int y1, int x2, int y2, int w1, int h1, int w2, int h2, int srcPage, int dstPage, int dim);
protected:
+ uint8 *_wsaFrameAnimBuffer;
};
} // end of namespace Kyra
diff --git a/engines/kyra/script.cpp b/engines/kyra/script.cpp
index e9dc34e581..ef3e259cfa 100644
--- a/engines/kyra/script.cpp
+++ b/engines/kyra/script.cpp
@@ -28,12 +28,12 @@
#include "common/stream.h"
#include "common/util.h"
#include "common/system.h"
-#include "kyra/kyra.h"
+#include "kyra/kyra_v1.h"
#include "kyra/resource.h"
#include "kyra/script.h"
namespace Kyra {
-EMCInterpreter::EMCInterpreter(KyraEngine *vm) : _vm(vm) {
+EMCInterpreter::EMCInterpreter(KyraEngine_v1 *vm) : _vm(vm) {
#define COMMAND(x) { &EMCInterpreter::x, #x }
static CommandEntry commandProcs[] = {
// 0x00
@@ -139,9 +139,9 @@ void EMCInterpreter::unload(EMCData *data) {
if (!data)
return;
- delete [] data->text;
- delete [] data->ordr;
- delete [] data->data;
+ delete[] data->text;
+ delete[] data->ordr;
+ delete[] data->data;
data->text = 0;
data->ordr = data->data = 0;
diff --git a/engines/kyra/script.h b/engines/kyra/script.h
index df86ec79c3..de52093f66 100644
--- a/engines/kyra/script.h
+++ b/engines/kyra/script.h
@@ -27,6 +27,7 @@
#define KYRA_SCRIPT_H
#include "common/stream.h"
+#include "common/array.h"
#include "common/func.h"
namespace Kyra {
@@ -63,7 +64,7 @@ struct EMCState {
#define AVTL_CHUNK 0x4C545641
class Resource;
-class KyraEngine;
+class KyraEngine_v1;
class ScriptFileParser {
public:
@@ -89,7 +90,7 @@ private:
class EMCInterpreter {
public:
- EMCInterpreter(KyraEngine *vm);
+ EMCInterpreter(KyraEngine_v1 *vm);
bool load(const char *filename, EMCData *data, const Common::Array<const Opcode*> *opcodes);
void unload(EMCData *data);
@@ -101,7 +102,7 @@ public:
bool run(EMCState *script);
protected:
- KyraEngine *_vm;
+ KyraEngine_v1 *_vm;
int16 _parameter;
typedef void (EMCInterpreter::*CommandProc)(EMCState*);
diff --git a/engines/kyra/script_hof.cpp b/engines/kyra/script_hof.cpp
index ff28e08960..91fbfb3e49 100644
--- a/engines/kyra/script_hof.cpp
+++ b/engines/kyra/script_hof.cpp
@@ -723,12 +723,6 @@ int KyraEngine_HoF::o2_loadMusicTrack(EMCState *script) {
return 0;
}
-int KyraEngine_HoF::o2_playSoundEffect(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_playSoundEffect(%p) (%d)", (const void *)script, stackPos(0));
- snd_playSoundEffect(stackPos(0));
- return 0;
-}
-
int KyraEngine_HoF::o2_setSceneAnimPos(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setSceneAnimPos(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
_sceneAnims[stackPos(0)].x = stackPos(1);
@@ -736,18 +730,6 @@ int KyraEngine_HoF::o2_setSceneAnimPos(EMCState *script) {
return 0;
}
-int KyraEngine_HoF::o2_blockInRegion(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_blockInRegion(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
- _screen->blockInRegion(stackPos(0), stackPos(1), stackPos(2)-stackPos(0)+1, stackPos(3)-stackPos(1)+1);
- return 0;
-}
-
-int KyraEngine_HoF::o2_blockOutRegion(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_blockOutRegion(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
- _screen->blockOutRegion(stackPos(0), stackPos(1), stackPos(2)-stackPos(0)+1, stackPos(3)-stackPos(1)+1);
- return 0;
-}
-
int KyraEngine_HoF::o2_setCauldronState(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setCauldronState(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
setCauldronState(stackPos(0), stackPos(1) != 0);
@@ -778,7 +760,7 @@ int KyraEngine_HoF::o2_showItemString(EMCState *script) {
int KyraEngine_HoF::o2_isAnySoundPlaying(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_isAnySoundPlaying(%p) ()", (const void *)script);
- return _sound->voiceIsPlaying();
+ return _sound->voiceIsPlaying() ? 1 : 0;
}
int KyraEngine_HoF::o2_setDrawNoShapeFlag(EMCState *script) {
@@ -818,7 +800,7 @@ int KyraEngine_HoF::o2_showLetter(EMCState *script) {
_screen->fadeToBlack(0x14);
sprintf(filename, "LETTER%.1d.", letter);
- strcat(filename, _languageExtension[_lang]);
+ strcat(filename, (_flags.isTalkie || _flags.platform == Common::kPlatformFMTowns || _lang) ? _languageExtension[_lang] : "TXT");
uint8 *letterBuffer = _res->fileData(filename, 0);
if (letterBuffer) {
@@ -856,10 +838,14 @@ int KyraEngine_HoF::o2_showLetter(EMCState *script) {
return 0;
}
-int KyraEngine_HoF::o2_fillRect(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_fillRect(%p) (%d, %d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5));
- _screen->fillRect(stackPos(1), stackPos(2), stackPos(1)+stackPos(3), stackPos(2)+stackPos(4), stackPos(5), stackPos(0));
- return 0;
+int KyraEngine_HoF::o2_playFireflyScore(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_playFireflyScore(%p) ()", (const void *)script);
+ if (_sound->getSfxType() == Sound::kAdlib || _sound->getSfxType() == Sound::kMidiMT32 || _sound->getSfxType() == Sound::kMidiGM) {
+ snd_playWanderScoreViaMap(86, 1);
+ return 1;
+ } else {
+ return 0;
+ }
}
int KyraEngine_HoF::o2_encodeShape(EMCState *script) {
@@ -910,14 +896,22 @@ int KyraEngine_HoF::o2_updateSceneAnim(EMCState *script) {
// Raziel^.
//
// We know currently of some different animations where this happens.
- // - Where Marco is dangling from the flesh-eating plant (see bug #1923638 "HoF: Marco missing animation frames").
- // - After giving the ticket to the captain. He would move very fast (barely noticeable) onto the ship
- // without this delay.
- // - The scene after giving the sandwitch to the guards in the city. (see bug #1926838 "HoF: Animation plays too fast")
- // This scene script calls o2_delay though, but since this updates the scene animation scripts again there is no delay
- // for the animation.
- if ((stackPos(0) == 2 && _mainCharacter.sceneId == 3) || (stackPos(0) == 3 && _mainCharacter.sceneId == 33) ||
- ((stackPos(0) == 1 || stackPos(0) == 2) && _mainCharacter.sceneId == 19))
+ // - Where Marco is dangling from the flesh-eating plant (see bug
+ // #1923638 "HoF: Marco missing animation frames").
+ // - After giving the ticket to the captain. He would move very fast
+ // (barely noticeable) onto the ship without this delay.
+ // - The scene after giving the sandwitch to the guards in the city.
+ // (see bug #1926838 "HoF: Animation plays too fast")
+ // This scene script calls o2_delay though, but since this updates
+ // the scene animation scripts again there is no delay for the
+ // animation.
+ // - When the sheriff enters the jail, either to lock you up or to throw
+ // away the key. (see bug #1926838 "HoF: Animation plays too fast").
+
+ if ((stackPos(0) == 2 && _mainCharacter.sceneId == 3) ||
+ (stackPos(0) == 3 && _mainCharacter.sceneId == 33) ||
+ ((stackPos(0) == 1 || stackPos(0) == 2) && _mainCharacter.sceneId == 19) ||
+ ((stackPos(0) == 1 || stackPos(0) == 2) && _mainCharacter.sceneId == 27))
_sceneSpecialScriptsTimer[_lastProcessedSceneScript] = _system->getMillis() + _tickLength * 6;
_specialSceneScriptRunFlag = false;
@@ -1325,9 +1319,20 @@ int KyraEngine_HoF::o2_drawSceneShapeEx(EMCState *script) {
return 0;
}
-int KyraEngine_HoF::o2_getBoolFromStack(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_getBoolFromStack(%p) ()", (const void *)script);
- return stackPos(0) ? 1 : 0;
+int KyraEngine_HoF::o2_midiSoundFadeout(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_midiSoundFadeout(%p) ()", (const void *)script);
+ if (!stackPos(0)) {
+ if ((_sound->getMusicType() == Sound::kMidiMT32 || _sound->getMusicType() == Sound::kMidiGM) &&
+ (_sound->getSfxType() == Sound::kMidiMT32 || _sound->getSfxType() == Sound::kMidiGM)) {
+ _sound->beginFadeOut();
+ delay(2000, true);
+ _lastMusicCommand = -1;
+ } else {
+ return 0;
+ }
+ }
+
+ return 1;
}
int KyraEngine_HoF::o2_getSfxDriver(EMCState *script) {
@@ -1539,25 +1544,25 @@ void KyraEngine_HoF::setupOpcodeTable() {
Opcode(o2_removeItemFromInventory);
Opcode(o2_countItemInInventory);
Opcode(o2_countItemsInScene);
- Opcode(o2_queryGameFlag);
+ Opcode(o1_queryGameFlag);
// 0x28
- Opcode(o2_resetGameFlag);
- Opcode(o2_setGameFlag);
- Opcode(o2_setHandItem);
- Opcode(o2_removeHandItem);
+ Opcode(o1_resetGameFlag);
+ Opcode(o1_setGameFlag);
+ Opcode(o1_setHandItem);
+ Opcode(o1_removeHandItem);
// 0x2c
- Opcode(o2_handItemSet);
- Opcode(o2_hideMouse);
+ Opcode(o1_getMouseState);
+ Opcode(o1_hideMouse);
Opcode(o2_addSpecialExit);
- Opcode(o2_setMousePos);
+ Opcode(o1_setMousePos);
// 0x30
- Opcode(o2_showMouse);
+ Opcode(o1_showMouse);
OpcodeUnImpl();
Opcode(o2_wipeDownMouseItem);
Opcode(o2_getElapsedSecs);
// 0x34
Opcode(o2_getTimerDelay);
- Opcode(o2_playSoundEffect);
+ Opcode(o1_playSoundEffect);
Opcode(o2_delaySecs);
Opcode(o2_delay);
// 0x38
@@ -1601,29 +1606,29 @@ void KyraEngine_HoF::setupOpcodeTable() {
Opcode(o2_setZanthiaPos);
Opcode(o2_loadMusicTrack);
// 0x58
- Opcode(o2_playWanderScoreViaMap);
- Opcode(o2_playSoundEffect);
+ Opcode(o1_playWanderScoreViaMap);
+ Opcode(o1_playSoundEffect);
Opcode(o2_setSceneAnimPos);
- Opcode(o2_blockInRegion);
+ Opcode(o1_blockInWalkableRegion);
// 0x5c
- Opcode(o2_blockOutRegion);
+ Opcode(o1_blockOutWalkableRegion);
OpcodeUnImpl();
Opcode(o2_setCauldronState);
Opcode(o2_showItemString);
// 0x60
- Opcode(o2_getRand);
+ Opcode(o1_getRand);
Opcode(o2_isAnySoundPlaying);
- Opcode(o2_setDeathHandler);
+ Opcode(o1_setDeathHandler);
Opcode(o2_setDrawNoShapeFlag);
// 0x64
Opcode(o2_setRunFlag);
Opcode(o2_showLetter);
OpcodeUnImpl();
- Opcode(o2_fillRect);
+ Opcode(o1_fillRect);
// 0x68
OpcodeUnImpl();
OpcodeUnImpl();
- OpcodeUnImpl();
+ Opcode(o2_playFireflyScore);
Opcode(o2_waitForConfirmationClick);
// 0x6c
Opcode(o2_encodeShape);
@@ -1694,7 +1699,7 @@ void KyraEngine_HoF::setupOpcodeTable() {
Opcode(o2_updateTwoSceneAnims);
Opcode(o2_getRainbowRoomData);
Opcode(o2_drawSceneShapeEx);
- Opcode(o2_getBoolFromStack);
+ Opcode(o2_midiSoundFadeout);
// 0xa4
Opcode(o2_getSfxDriver);
Opcode(o2_getVocSupport);
@@ -1716,7 +1721,7 @@ void KyraEngine_HoF::setupOpcodeTable() {
// 0x00
Opcode(o2a_setAnimationShapes);
Opcode(o2a_setCharacterFrame);
- Opcode(o2_playSoundEffect);
+ Opcode(o1_playSoundEffect);
Opcode(o2_fadeScenePal);
// 0x04
_flags.isTalkie ? Opcode(o2a_setResetFrame) : Opcode(o2_dummy);
diff --git a/engines/kyra/script_lok.cpp b/engines/kyra/script_lok.cpp
new file mode 100644
index 0000000000..efa0f8e48f
--- /dev/null
+++ b/engines/kyra/script_lok.cpp
@@ -0,0 +1,1987 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+
+#include "common/endian.h"
+#include "common/system.h"
+
+#include "kyra/kyra_lok.h"
+#include "kyra/script.h"
+#include "kyra/screen.h"
+#include "kyra/sprites.h"
+#include "kyra/wsamovie.h"
+#include "kyra/animator_lok.h"
+#include "kyra/text.h"
+#include "kyra/timer.h"
+#include "kyra/sound.h"
+
+namespace Kyra {
+int KyraEngine_LoK::o1_magicInMouseItem(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_magicInMouseItem(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ magicInMouseItem(stackPos(0), stackPos(1), -1);
+ return 0;
+}
+
+int KyraEngine_LoK::o1_characterSays(EMCState *script) {
+ _skipFlag = false;
+ if (_flags.isTalkie) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_characterSays(%p) (%d, '%s', %d, %d)", (const void *)script, stackPos(0), stackPosString(1), stackPos(2), stackPos(3));
+ characterSays(stackPos(0), stackPosString(1), stackPos(2), stackPos(3));
+ } else {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_characterSays(%p) ('%s', %d, %d)", (const void *)script, stackPosString(0), stackPos(1), stackPos(2));
+ const char *string = stackPosString(0);
+
+ if ((_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98) && _flags.lang == Common::JA_JPN) {
+ static const uint8 townsString1[] = {
+ 0x83, 0x75, 0x83, 0x89, 0x83, 0x93, 0x83, 0x83, 0x93, 0x81,
+ 0x41, 0x82, 0xDC, 0x82, 0xBD, 0x97, 0x88, 0x82, 0xBD, 0x82,
+ 0xCC, 0x82, 0xA9, 0x81, 0x48, 0x00, 0x00, 0x00
+ };
+ static const uint8 townsString2[] = {
+ 0x83, 0x75, 0x83, 0x89, 0x83, 0x93, 0x83, 0x5C, 0x83, 0x93,
+ 0x81, 0x41, 0x82, 0xDC, 0x82, 0xBD, 0x97, 0x88, 0x82, 0xBD,
+ 0x82, 0xCC, 0x82, 0xA9, 0x81, 0x48, 0x00, 0x00
+ };
+
+ if (strncmp((const char *)townsString1, string, sizeof(townsString1)) == 0)
+ string = (const char *)townsString2;
+ }
+
+ characterSays(-1, string, stackPos(1), stackPos(2));
+ }
+
+ return 0;
+}
+
+int KyraEngine_LoK::o1_delay(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_delay(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ if (stackPos(1)) {
+ warning("STUB: special o1_delay");
+ // delete this after correct implementing
+ delayWithTicks(stackPos(0));
+ } else {
+ delayWithTicks(stackPos(0));
+ }
+ return 0;
+}
+
+int KyraEngine_LoK::o1_drawSceneAnimShape(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_drawSceneAnimShape(%p) (%d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
+ _screen->drawShape(stackPos(4), _sprites->_sceneShapes[stackPos(0)], stackPos(1), stackPos(2), 0, (stackPos(3) != 0) ? 1 : 0);
+ return 0;
+}
+
+int KyraEngine_LoK::o1_runNPCScript(EMCState *script) {
+ warning("STUB: o1_runNPCScript");
+ return 0;
+}
+
+int KyraEngine_LoK::o1_setSpecialExitList(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_setSpecialExitList(%p) (%d, %d, %d, %d, %d, %d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5), stackPos(6), stackPos(7), stackPos(8), stackPos(9));
+
+ for (int i = 0; i < 10; ++i)
+ _exitList[i] = stackPos(i);
+ _exitListPtr = _exitList;
+
+ return 0;
+}
+
+int KyraEngine_LoK::o1_walkPlayerToPoint(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_walkPlayerToPoint(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
+
+ int normalTimers = stackPos(2);
+ if (!normalTimers) {
+ _timer->disable(19);
+ _timer->disable(14);
+ _timer->disable(18);
+ }
+
+ int reinitScript = handleSceneChange(stackPos(0), stackPos(1), stackPos(2), stackPos(3));
+
+ if (!normalTimers) {
+ _timer->enable(19);
+ _timer->enable(14);
+ _timer->enable(18);
+ }
+
+ if (reinitScript)
+ _emc->init(script, script->dataPtr);
+
+ if (_sceneChangeState) {
+ _sceneChangeState = 0;
+ return 1;
+ }
+ return 0;
+}
+
+int KyraEngine_LoK::o1_dropItemInScene(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_dropItemInScene(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
+ int item = stackPos(0);
+ int xpos = stackPos(1);
+ int ypos = stackPos(2);
+
+ byte freeItem = findFreeItemInScene(_currentCharacter->sceneId);
+ if (freeItem != 0xFF) {
+ int sceneId = _currentCharacter->sceneId;
+ Room *room = &_roomTable[sceneId];
+ room->itemsXPos[freeItem] = xpos;
+ room->itemsYPos[freeItem] = ypos;
+ room->itemsTable[freeItem] = item;
+
+ _animator->animAddGameItem(freeItem, sceneId);
+ _animator->updateAllObjectShapes();
+ } else {
+ if (item == 43)
+ placeItemInGenericMapScene(item, 0);
+ else
+ placeItemInGenericMapScene(item, 1);
+ }
+ return 0;
+}
+
+int KyraEngine_LoK::o1_drawAnimShapeIntoScene(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_drawAnimShapeIntoScene(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
+ _screen->hideMouse();
+ _animator->restoreAllObjectBackgrounds();
+ int shape = stackPos(0);
+ int xpos = stackPos(1);
+ int ypos = stackPos(2);
+ int flags = (stackPos(3) != 0) ? 1 : 0;
+ _screen->drawShape(2, _sprites->_sceneShapes[shape], xpos, ypos, 0, flags);
+ _screen->drawShape(0, _sprites->_sceneShapes[shape], xpos, ypos, 0, flags);
+ _animator->flagAllObjectsForBkgdChange();
+ _animator->preserveAnyChangedBackgrounds();
+ _animator->flagAllObjectsForRefresh();
+ _animator->updateAllObjectShapes();
+ _screen->showMouse();
+ return 0;
+}
+
+int KyraEngine_LoK::o1_savePageToDisk(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_savePageToDisk(%p) ('%s', %d)", (const void *)script, stackPosString(0), stackPos(1));
+ _screen->savePageToDisk(stackPosString(0), stackPos(1));
+ return 0;
+}
+
+int KyraEngine_LoK::o1_sceneAnimOn(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_sceneAnimOn(%p) (%d)", (const void *)script, stackPos(0));
+ _sprites->_anims[stackPos(0)].play = true;
+ return 0;
+}
+
+int KyraEngine_LoK::o1_sceneAnimOff(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_sceneAnimOff(%p) (%d)", (const void *)script, stackPos(0));
+ _sprites->_anims[stackPos(0)].play = false;
+ return 0;
+}
+
+int KyraEngine_LoK::o1_getElapsedSeconds(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_getElapsedSeconds(%p) ()", (const void *)script);
+ return _system->getMillis() / 1000;
+}
+
+int KyraEngine_LoK::o1_mouseIsPointer(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_mouseIsPointer(%p) ()", (const void *)script);
+ if (_itemInHand == -1)
+ return 1;
+ return 0;
+}
+
+int KyraEngine_LoK::o1_runSceneAnimUntilDone(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_runSceneAnimUntilDone(%p) (%d)", (const void *)script, stackPos(0));
+ _screen->hideMouse();
+ _animator->restoreAllObjectBackgrounds();
+ _sprites->_anims[stackPos(0)].play = true;
+ _animator->sprites()[stackPos(0)].active = 1;
+ _animator->flagAllObjectsForBkgdChange();
+ _animator->preserveAnyChangedBackgrounds();
+ while (_sprites->_anims[stackPos(0)].play) {
+ _sprites->updateSceneAnims();
+ _animator->updateAllObjectShapes();
+ delay(10);
+ }
+ _animator->restoreAllObjectBackgrounds();
+ _screen->showMouse();
+ return 0;
+}
+
+int KyraEngine_LoK::o1_fadeSpecialPalette(EMCState *script) {
+ if (_flags.platform == Common::kPlatformAmiga) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_fadeSpecialPalette(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
+ if (_currentCharacter->sceneId != 45) {
+ if (stackPos(0) == 13) {
+ memcpy(_screen->getPalette(0), _screen->getPalette(0) + 384*3, 32*3);
+ _screen->setScreenPalette(_screen->getPalette(0));
+ }
+ } else {
+ warning("KyraEngine_LoK::o1_fadeSpecialPalette not implemented");
+ }
+ } else {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_fadeSpecialPalette(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
+ _screen->fadeSpecialPalette(stackPos(0), stackPos(1), stackPos(2), stackPos(3));
+ }
+ return 0;
+}
+
+int KyraEngine_LoK::o1_phaseInSameScene(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_phaseInSameScene(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ transcendScenes(stackPos(0), stackPos(1));
+ return 0;
+}
+
+int KyraEngine_LoK::o1_setScenePhasingFlag(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_setScenePhasingFlag(%p) ()", (const void *)script);
+ _scenePhasingFlag = 1;
+ return 1;
+}
+
+int KyraEngine_LoK::o1_resetScenePhasingFlag(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_resetScenePhasingFlag(%p) ()", (const void *)script);
+ _scenePhasingFlag = 0;
+ return 0;
+}
+
+int KyraEngine_LoK::o1_queryScenePhasingFlag(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_queryScenePhasingFlag(%p) ()", (const void *)script);
+ return _scenePhasingFlag;
+}
+
+int KyraEngine_LoK::o1_sceneToDirection(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_sceneToDirection(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ assert(stackPos(0) < _roomTableSize);
+ Room *curRoom = &_roomTable[stackPos(0)];
+ uint16 returnValue = 0xFFFF;
+ switch (stackPos(1)) {
+ case 0:
+ returnValue = curRoom->northExit;
+ break;
+
+ case 2:
+ returnValue = curRoom->eastExit;
+ break;
+
+ case 4:
+ returnValue = curRoom->southExit;
+ break;
+
+ case 6:
+ returnValue = curRoom->westExit;
+ break;
+
+ default:
+ break;
+ }
+ if (returnValue == 0xFFFF)
+ return -1;
+ return returnValue;
+}
+
+int KyraEngine_LoK::o1_setBirthstoneGem(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_setBirthstoneGem(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ int index = stackPos(0);
+ if (index < 4 && index >= 0) {
+ _birthstoneGemTable[index] = stackPos(1);
+ return 1;
+ }
+ return 0;
+}
+
+int KyraEngine_LoK::o1_placeItemInGenericMapScene(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_placeItemInGenericMapScene(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ placeItemInGenericMapScene(stackPos(0), stackPos(1));
+ return 0;
+}
+
+int KyraEngine_LoK::o1_setBrandonStatusBit(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_setBrandonStatusBit(%p) (%d)", (const void *)script, stackPos(0));
+ _brandonStatusBit |= stackPos(0);
+ return 0;
+}
+
+int KyraEngine_LoK::o1_delaySecs(EMCState *script) {
+ if (_flags.isTalkie && speechEnabled()) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_voiceDelay(%p) (%d)", (const void *)script, stackPos(0));
+ if (stackPos(0) == 0) {
+ snd_voiceWaitForFinish(true);
+ } else if (stackPos(0) < 0) {
+ uint32 time = ABS(stackPos(0)) * _tickLength;
+ delay(time, true);
+ }
+ } else {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_delaySecs(%p) (%d)", (const void *)script, stackPos(0));
+ if (stackPos(0) >= 0 && !_skipFlag)
+ delay(stackPos(0)*1000, true);
+ }
+
+ _skipFlag = false;
+ return 0;
+}
+
+int KyraEngine_LoK::o1_getCharacterScene(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_getCharacterScene(%p) (%d)", (const void *)script, stackPos(0));
+ return _characterList[stackPos(0)].sceneId;
+}
+
+int KyraEngine_LoK::o1_runNPCSubscript(EMCState *script) {
+ warning("STUB: o1_runNPCSubscript");
+ return 0;
+}
+
+int KyraEngine_LoK::o1_magicOutMouseItem(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_magicOutMouseItem(%p) (%d)", (const void *)script, stackPos(0));
+ magicOutMouseItem(stackPos(0), -1);
+ return 0;
+}
+
+int KyraEngine_LoK::o1_internalAnimOn(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_internalAnimOn(%p) (%d)", (const void *)script, stackPos(0));
+ _animator->sprites()[stackPos(0)].active = 1;
+ return 0;
+}
+
+int KyraEngine_LoK::o1_forceBrandonToNormal(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_forceBrandonToNormal(%p) ()", (const void *)script);
+ checkAmuletAnimFlags();
+ return 0;
+}
+
+int KyraEngine_LoK::o1_poisonDeathNow(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_poisonDeathNow(%p) ()", (const void *)script);
+ seq_poisonDeathNow(1);
+ return 0;
+}
+
+int KyraEngine_LoK::o1_setScaleMode(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_setScaleMode(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
+ int len = stackPos(0);
+ int setValue1 = stackPos(1);
+ int start2 = stackPos(2);
+ int setValue2 = stackPos(3);
+ for (int i = 0; i < len; ++i)
+ _scaleTable[i] = setValue1;
+ int temp = setValue2 - setValue1;
+ int temp2 = start2 - len;
+ for (int i = len, offset = 0; i < start2; ++i, ++offset)
+ _scaleTable[i] = (offset * temp) / temp2 + setValue1;
+ for (int i = start2; i < 145; ++i)
+ _scaleTable[i] = setValue2;
+ _scaleMode = 1;
+ return _scaleMode;
+}
+
+int KyraEngine_LoK::o1_openWSAFile(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_openWSAFile(%p) ('%s', %d, %d, %d)", (const void *)script, stackPosString(0), stackPos(1), stackPos(2), stackPos(3));
+
+ const char *filename = stackPosString(0);
+ int wsaIndex = stackPos(1);
+
+ _movieObjects[wsaIndex]->open(filename, (stackPos(3) != 0) ? 1 : 0, 0);
+ assert(_movieObjects[wsaIndex]->opened());
+
+ return 0;
+}
+
+int KyraEngine_LoK::o1_closeWSAFile(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_closeWSAFile(%p) (%d)", (const void *)script, stackPos(0));
+
+ int wsaIndex = stackPos(0);
+ if (_movieObjects[wsaIndex])
+ _movieObjects[wsaIndex]->close();
+
+ return 0;
+}
+
+int KyraEngine_LoK::o1_runWSAFromBeginningToEnd(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_runWSAFromBeginningToEnd(%p) (%d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
+
+ _screen->hideMouse();
+
+ bool running = true;
+
+ int xpos = stackPos(0);
+ int ypos = stackPos(1);
+ int waitTime = stackPos(2);
+ int wsaIndex = stackPos(3);
+ int worldUpdate = stackPos(4);
+ int wsaFrame = 0;
+
+ _movieObjects[wsaIndex]->setX(xpos);
+ _movieObjects[wsaIndex]->setY(ypos);
+ _movieObjects[wsaIndex]->setDrawPage(0);
+ while (running) {
+ _movieObjects[wsaIndex]->displayFrame(wsaFrame++);
+ _animator->_updateScreen = true;
+ if (wsaFrame >= _movieObjects[wsaIndex]->frames())
+ running = false;
+
+ uint32 continueTime = waitTime * _tickLength + _system->getMillis();
+ while (_system->getMillis() < continueTime) {
+ if (worldUpdate) {
+ _sprites->updateSceneAnims();
+ _animator->updateAllObjectShapes();
+ } else {
+ _screen->updateScreen();
+ }
+ if (continueTime - _system->getMillis() >= 10)
+ delay(10);
+ }
+ }
+
+ _screen->showMouse();
+
+ return 0;
+}
+
+int KyraEngine_LoK::o1_displayWSAFrame(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_displayWSAFrame(%p) (%d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
+ int frame = stackPos(0);
+ int xpos = stackPos(1);
+ int ypos = stackPos(2);
+ int waitTime = stackPos(3);
+ int wsaIndex = stackPos(4);
+ _screen->hideMouse();
+ _movieObjects[wsaIndex]->setX(xpos);
+ _movieObjects[wsaIndex]->setY(ypos);
+ _movieObjects[wsaIndex]->setDrawPage(0);
+ _movieObjects[wsaIndex]->displayFrame(frame);
+ _animator->_updateScreen = true;
+ uint32 continueTime = waitTime * _tickLength + _system->getMillis();
+ while (_system->getMillis() < continueTime) {
+ _sprites->updateSceneAnims();
+ _animator->updateAllObjectShapes();
+ if (_skipFlag)
+ break;
+
+ if (continueTime - _system->getMillis() >= 10)
+ delay(10);
+ }
+ _screen->showMouse();
+ return 0;
+}
+
+int KyraEngine_LoK::o1_enterNewScene(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_enterNewScene(%p) (%d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
+ enterNewScene(stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
+ return 0;
+}
+
+int KyraEngine_LoK::o1_setSpecialEnterXAndY(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_setSpecialEnterXAndY(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ _brandonPosX = stackPos(0);
+ _brandonPosY = stackPos(1);
+ if (_brandonPosX + 1 == 0 && _brandonPosY + 1 == 0)
+ _currentCharacter->currentAnimFrame = 88;
+ return 0;
+}
+
+int KyraEngine_LoK::o1_runWSAFrames(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_runWSAFrames(%p) (%d, %d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5));
+ int xpos = stackPos(0);
+ int ypos = stackPos(1);
+ int delayTime = stackPos(2);
+ int startFrame = stackPos(3);
+ int endFrame = stackPos(4);
+ int wsaIndex = stackPos(5);
+ _screen->hideMouse();
+ _movieObjects[wsaIndex]->setX(xpos);
+ _movieObjects[wsaIndex]->setY(ypos);
+ _movieObjects[wsaIndex]->setDrawPage(0);
+ for (; startFrame <= endFrame; ++startFrame) {
+ uint32 nextRun = _system->getMillis() + delayTime * _tickLength;
+ _movieObjects[wsaIndex]->displayFrame(startFrame);
+ _animator->_updateScreen = true;
+ while (_system->getMillis() < nextRun) {
+ _sprites->updateSceneAnims();
+ _animator->updateAllObjectShapes();
+ if (nextRun - _system->getMillis() >= 10)
+ delay(10);
+ }
+ }
+ _screen->showMouse();
+ return 0;
+}
+
+int KyraEngine_LoK::o1_popBrandonIntoScene(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_popBrandonIntoScene(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
+ int changeScaleMode = stackPos(3);
+ int xpos = (int16)(stackPos(0) & 0xFFFC);
+ int ypos = (int16)(stackPos(1) & 0xFFFE);
+ int facing = stackPos(2);
+ _currentCharacter->x1 = _currentCharacter->x2 = xpos;
+ _currentCharacter->y1 = _currentCharacter->y2 = ypos;
+ _currentCharacter->facing = facing;
+ _currentCharacter->currentAnimFrame = 7;
+ int xOffset = _defaultShapeTable[0].xOffset;
+ int yOffset = _defaultShapeTable[0].yOffset;
+ int width = _defaultShapeTable[0].w << 3;
+ int height = _defaultShapeTable[0].h;
+ Animator_LoK::AnimObject *curAnim = _animator->actors();
+
+ if (changeScaleMode) {
+ curAnim->x1 = _currentCharacter->x1;
+ curAnim->y1 = _currentCharacter->y1;
+ _animator->_brandonScaleY = _scaleTable[_currentCharacter->y1];
+ _animator->_brandonScaleX = _animator->_brandonScaleY;
+
+ int animWidth = _animator->fetchAnimWidth(curAnim->sceneAnimPtr, _animator->_brandonScaleX) >> 1;
+ int animHeight = _animator->fetchAnimHeight(curAnim->sceneAnimPtr, _animator->_brandonScaleY);
+
+ animWidth = (xOffset * animWidth) / width;
+ animHeight = (yOffset * animHeight) / height;
+
+ curAnim->x2 = curAnim->x1 += animWidth;
+ curAnim->y2 = curAnim->y1 += animHeight;
+ } else {
+ curAnim->x2 = curAnim->x1 = _currentCharacter->x1 + xOffset;
+ curAnim->y2 = curAnim->y1 = _currentCharacter->y1 + yOffset;
+ }
+
+ int scaleModeBackup = _scaleMode;
+ if (changeScaleMode)
+ _scaleMode = 1;
+
+ _animator->animRefreshNPC(0);
+ _animator->preserveAllBackgrounds();
+ _animator->prepDrawAllObjects();
+ _animator->copyChangedObjectsForward(0);
+
+ _scaleMode = scaleModeBackup;
+
+ return 0;
+}
+
+int KyraEngine_LoK::o1_restoreAllObjectBackgrounds(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_restoreAllObjectBackgrounds(%p) (%d)", (const void *)script, stackPos(0));
+ int disable = stackPos(0);
+ int activeBackup = 0;
+ if (disable) {
+ activeBackup = _animator->actors()->active;
+ _animator->actors()->active = 0;
+ }
+ _animator->restoreAllObjectBackgrounds();
+ if (disable)
+ _animator->actors()->active = activeBackup;
+ return 0;
+}
+
+int KyraEngine_LoK::o1_setCustomPaletteRange(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_setCustomPaletteRange(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
+ memcpy(_screen->getPalette(1) + stackPos(1)*3, _specialPalettes[stackPos(0)], stackPos(2)*3);
+ return 0;
+}
+
+int KyraEngine_LoK::o1_loadPageFromDisk(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_loadPageFromDisk(%p) ('%s', %d)", (const void *)script, stackPosString(0), stackPos(1));
+ _screen->loadPageFromDisk(stackPosString(0), stackPos(1));
+ _animator->_updateScreen = true;
+ return 0;
+}
+
+int KyraEngine_LoK::o1_customPrintTalkString(EMCState *script) {
+ if (_flags.isTalkie) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_customPrintTalkString(%p) (%d, '%s', %d, %d, %d)", (const void *)script, stackPos(0), stackPosString(1), stackPos(2), stackPos(3), stackPos(4) & 0xFF);
+
+ if (speechEnabled()) {
+ snd_voiceWaitForFinish();
+ snd_playVoiceFile(stackPos(0));
+ }
+
+ _skipFlag = false;
+ if (textEnabled())
+ _text->printTalkTextMessage(stackPosString(1), stackPos(2), stackPos(3), stackPos(4) & 0xFF, 0, 2);
+ } else {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_customPrintTalkString(%p) ('%s', %d, %d, %d)", (const void *)script, stackPosString(0), stackPos(1), stackPos(2), stackPos(3) & 0xFF);
+ _skipFlag = false;
+ _text->printTalkTextMessage(stackPosString(0), stackPos(1), stackPos(2), stackPos(3) & 0xFF, 0, 2);
+ }
+ _screen->updateScreen();
+ return 0;
+}
+
+int KyraEngine_LoK::o1_restoreCustomPrintBackground(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_restoreCustomPrintBackground(%p) ()", (const void *)script);
+ _text->restoreTalkTextMessageBkgd(2, 0);
+ return 0;
+}
+
+int KyraEngine_LoK::o1_getCharacterX(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_getCharacterX(%p) (%d)", (const void *)script, stackPos(0));
+ return _characterList[stackPos(0)].x1;
+}
+
+int KyraEngine_LoK::o1_getCharacterY(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_getCharacterY(%p) (%d)", (const void *)script, stackPos(0));
+ return _characterList[stackPos(0)].y1;
+}
+
+int KyraEngine_LoK::o1_setCharacterFacing(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_setCharacterFacing(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
+ int character = stackPos(0);
+ int facing = stackPos(1);
+ int newAnimFrame = stackPos(2);
+
+ _animator->restoreAllObjectBackgrounds();
+ if (newAnimFrame != -1)
+ _characterList[character].currentAnimFrame = newAnimFrame;
+ _characterList[character].facing = facing;
+ _animator->animRefreshNPC(character);
+ _animator->preserveAllBackgrounds();
+ _animator->prepDrawAllObjects();
+ _animator->copyChangedObjectsForward(0);
+
+ return 0;
+}
+
+int KyraEngine_LoK::o1_copyWSARegion(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_copyWSARegion(%p) (%d, %d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5));
+ int xpos = stackPos(0);
+ int ypos = stackPos(1);
+ int width = stackPos(2);
+ int height = stackPos(3);
+ int srcPage = stackPos(4);
+ int dstPage = stackPos(5);
+ _screen->copyRegion(xpos, ypos, xpos, ypos, width, height, srcPage, dstPage);
+ _animator->_updateScreen = true;
+ return 0;
+}
+
+int KyraEngine_LoK::o1_printText(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_printText(%p) ('%s', %d, %d, 0x%X, 0x%X)", (const void *)script, stackPosString(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
+ if (_flags.lang == Common::JA_JPN && stackPos(3) == 7)
+ _screen->printText(stackPosString(0), stackPos(1), stackPos(2), 0, 0x80);
+ else
+ _screen->printText(stackPosString(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
+ _screen->updateScreen();
+ return 0;
+}
+
+int KyraEngine_LoK::o1_loadSoundFile(EMCState *script) {
+ warning("STUB: o1_loadSoundFile");
+ return 0;
+}
+
+int KyraEngine_LoK::o1_displayWSAFrameOnHidPage(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_displayWSAFrameOnHidPage(%p) (%d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
+ int frame = stackPos(0);
+ int xpos = stackPos(1);
+ int ypos = stackPos(2);
+ int waitTime = stackPos(3);
+ int wsaIndex = stackPos(4);
+
+ _screen->hideMouse();
+ uint32 continueTime = waitTime * _tickLength + _system->getMillis();
+ _movieObjects[wsaIndex]->setX(xpos);
+ _movieObjects[wsaIndex]->setY(ypos);
+ _movieObjects[wsaIndex]->setDrawPage(2);
+ _movieObjects[wsaIndex]->displayFrame(frame);
+ _animator->_updateScreen = true;
+ while (_system->getMillis() < continueTime) {
+ _sprites->updateSceneAnims();
+ _animator->updateAllObjectShapes();
+ if (_skipFlag)
+ break;
+
+ if (continueTime - _system->getMillis() >= 10)
+ delay(10);
+ }
+ _screen->showMouse();
+
+ return 0;
+}
+
+int KyraEngine_LoK::o1_displayWSASequentialFrames(EMCState *script) {
+ if (_flags.isTalkie)
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_displayWSASequentialFrames(%p) (%d, %d, %d, %d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5), stackPos(6), stackPos(7));
+ else
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_displayWSASequentialFrames(%p) (%d, %d, %d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5), stackPos(6));
+ int startFrame = stackPos(0);
+ int endFrame = stackPos(1);
+ int xpos = stackPos(2);
+ int ypos = stackPos(3);
+ int waitTime = stackPos(4);
+ int wsaIndex = stackPos(5);
+ int maxTime = stackPos(6);
+
+ if (_flags.isTalkie) {
+ int specialTime = stackPos(7);
+ if (specialTime) {
+ uint32 voiceTime = snd_getVoicePlayTime();
+ if (voiceTime) {
+ int displayFrames = ABS(endFrame-startFrame)+1;
+ displayFrames *= maxTime;
+ assert(displayFrames != 0);
+
+ bool voiceSync = false;
+
+ if (specialTime < 0) {
+ voiceSync = true;
+ specialTime = ABS(specialTime);
+ }
+
+ voiceTime *= specialTime;
+ voiceTime /= 100;
+
+ if (voiceSync) {
+ uint32 voicePlayedTime = _sound->voicePlayedTime(_speechFile.c_str());
+ if (voicePlayedTime >= voiceTime)
+ voiceTime = 0;
+ else
+ voiceTime -= voicePlayedTime;
+ }
+
+ waitTime = voiceTime / displayFrames;
+ waitTime /= _tickLength;
+ }
+ }
+ }
+
+ if (maxTime - 1 <= 0)
+ maxTime = 1;
+
+ _movieObjects[wsaIndex]->setX(xpos);
+ _movieObjects[wsaIndex]->setY(ypos);
+ _movieObjects[wsaIndex]->setDrawPage(0);
+
+ // Workaround for bug #1498221 "KYRA1: Glitches when meeting Zanthia"
+ // the original didn't do a forced screen update after displaying a wsa frame
+ // while we have to do it, which make brandon disappear for a short moment,
+ // what shouldn't happen. So we're not updating the screen for this special
+ // case too.
+ if (startFrame == 18 && endFrame == 18 && _currentRoom == 45) {
+ _movieObjects[wsaIndex]->displayFrame(18);
+ delay(waitTime * _tickLength);
+ return 0;
+ }
+
+ int curTime = 0;
+ _screen->hideMouse();
+ while (curTime < maxTime) {
+ if (endFrame >= startFrame) {
+ int frame = startFrame;
+ while (endFrame >= frame) {
+ uint32 continueTime = waitTime * _tickLength + _system->getMillis();
+ _movieObjects[wsaIndex]->displayFrame(frame);
+ if (waitTime)
+ _animator->_updateScreen = true;
+ while (_system->getMillis() < continueTime) {
+ _sprites->updateSceneAnims();
+ _animator->updateAllObjectShapes();
+ if (_skipFlag)
+ break;
+
+ if (continueTime - _system->getMillis() >= 10)
+ delay(10);
+ }
+ ++frame;
+ }
+ } else {
+ int frame = startFrame;
+ while (endFrame <= frame) {
+ uint32 continueTime = waitTime * _tickLength + _system->getMillis();
+ _movieObjects[wsaIndex]->displayFrame(frame);
+ if (waitTime)
+ _animator->_updateScreen = true;
+ while (_system->getMillis() < continueTime) {
+ _sprites->updateSceneAnims();
+ _animator->updateAllObjectShapes();
+ if (_skipFlag)
+ break;
+
+ if (continueTime - _system->getMillis() >= 10)
+ delay(10);
+ }
+ --frame;
+ }
+ }
+
+ if (_skipFlag)
+ break;
+ else
+ ++curTime;
+ }
+ _screen->showMouse();
+
+ return 0;
+}
+
+int KyraEngine_LoK::o1_refreshCharacter(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_refreshCharacter(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
+ int character = stackPos(0);
+ int animFrame = stackPos(1);
+ int newFacing = stackPos(2);
+ int updateShapes = stackPos(3);
+ _characterList[character].currentAnimFrame = animFrame;
+ if (newFacing != -1)
+ _characterList[character].facing = newFacing;
+ _animator->animRefreshNPC(character);
+ if (updateShapes)
+ _animator->updateAllObjectShapes();
+ return 0;
+}
+
+int KyraEngine_LoK::o1_internalAnimOff(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_internalAnimOff(%p) (%d)", (const void *)script, stackPos(0));
+ _animator->sprites()[stackPos(0)].active = 0;
+ return 0;
+}
+
+int KyraEngine_LoK::o1_changeCharactersXAndY(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_changeCharactersXAndY(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
+ Character *ch = &_characterList[stackPos(0)];
+ int16 x = stackPos(1);
+ int16 y = stackPos(2);
+ if (x != -1 && y != -1) {
+ x &= 0xFFFC;
+ y &= 0xFFFE;
+ }
+ _animator->restoreAllObjectBackgrounds();
+ ch->x1 = ch->x2 = x;
+ ch->y1 = ch->y2 = y;
+ _animator->preserveAllBackgrounds();
+ return 0;
+}
+
+int KyraEngine_LoK::o1_clearSceneAnimatorBeacon(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_clearSceneAnimatorBeacon(%p) ()", (const void *)script);
+ _sprites->_sceneAnimatorBeaconFlag = 0;
+ return 0;
+}
+
+int KyraEngine_LoK::o1_querySceneAnimatorBeacon(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_querySceneAnimatorBeacon(%p) ()", (const void *)script);
+ return _sprites->_sceneAnimatorBeaconFlag;
+}
+
+int KyraEngine_LoK::o1_refreshSceneAnimator(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_refreshSceneAnimator(%p) ()", (const void *)script);
+ _sprites->updateSceneAnims();
+ _animator->updateAllObjectShapes();
+ return 0;
+}
+
+int KyraEngine_LoK::o1_placeItemInOffScene(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_placeItemInOffScene(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
+ int item = stackPos(0);
+ int xpos = stackPos(1);
+ int ypos = stackPos(2);
+ int sceneId = stackPos(3);
+
+ byte freeItem = findFreeItemInScene(sceneId);
+ if (freeItem != 0xFF) {
+ assert(sceneId < _roomTableSize);
+ Room *room = &_roomTable[sceneId];
+
+ room->itemsTable[freeItem] = item;
+ room->itemsXPos[freeItem] = xpos;
+ room->itemsYPos[freeItem] = ypos;
+ }
+ return 0;
+}
+
+int KyraEngine_LoK::o1_wipeDownMouseItem(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_wipeDownMouseItem(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
+ _screen->hideMouse();
+ wipeDownMouseItem(stackPos(1), stackPos(2));
+ removeHandItem();
+ _screen->showMouse();
+ return 0;
+}
+
+int KyraEngine_LoK::o1_placeCharacterInOtherScene(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_placeCharacterInOtherScene(%p) (%d, %d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5));
+ int id = stackPos(0);
+ int sceneId = stackPos(1);
+ int xpos = (int16)(stackPos(2) & 0xFFFC);
+ int ypos = (int16)(stackPos(3) & 0xFFFE);
+ int facing = stackPos(4);
+ int animFrame = stackPos(5);
+
+ _characterList[id].sceneId = sceneId;
+ _characterList[id].x1 = _characterList[id].x2 = xpos;
+ _characterList[id].y1 = _characterList[id].y2 = ypos;
+ _characterList[id].facing = facing;
+ _characterList[id].currentAnimFrame = animFrame;
+ return 0;
+}
+
+int KyraEngine_LoK::o1_getKey(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_getKey(%p) ()", (const void *)script);
+ waitForEvent();
+ return 0;
+}
+
+int KyraEngine_LoK::o1_specificItemInInventory(EMCState *script) {
+ warning("STUB: o1_specificItemInInventory");
+ return 0;
+}
+
+int KyraEngine_LoK::o1_popMobileNPCIntoScene(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_popMobileNPCIntoScene(%p) (%d, %d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), (int16)(stackPos(4) & 0xFFFC), (int8)(stackPos(5) & 0xFE));
+ int character = stackPos(0);
+ int sceneId = stackPos(1);
+ int animFrame = stackPos(2);
+ int facing = stackPos(3);
+ int16 xpos = (int16)(stackPos(4) & 0xFFFC);
+ int8 ypos = (int16)(stackPos(5) & 0xFFFE);
+ Character *curChar = &_characterList[character];
+
+ curChar->sceneId = sceneId;
+ curChar->currentAnimFrame = animFrame;
+ curChar->facing = facing;
+ curChar->x1 = curChar->x2 = xpos;
+ curChar->y1 = curChar->y2 = ypos;
+
+ _animator->animAddNPC(character);
+ _animator->updateAllObjectShapes();
+ return 0;
+}
+
+int KyraEngine_LoK::o1_mobileCharacterInScene(EMCState *script) {
+ warning("STUB: o1_mobileCharacterInScene");
+ return 0;
+}
+
+int KyraEngine_LoK::o1_hideMobileCharacter(EMCState *script) {
+ warning("STUB: o1_hideMobileCharacter");
+ return 0;
+}
+
+int KyraEngine_LoK::o1_unhideMobileCharacter(EMCState *script) {
+ warning("STUB: o1_unhideMobileCharacter");
+ return 0;
+}
+
+int KyraEngine_LoK::o1_setCharacterLocation(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_setCharacterLocation(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ Character *ch = &_characterList[stackPos(0)];
+ Animator_LoK::AnimObject *animObj = &_animator->actors()[stackPos(0)];
+ int newScene = stackPos(1);
+ if (_currentCharacter->sceneId == ch->sceneId) {
+ if (_currentCharacter->sceneId != newScene)
+ animObj->active = 0;
+ } else if (_currentCharacter->sceneId == newScene) {
+ if (_currentCharacter->sceneId != ch->sceneId)
+ animObj->active = 1;
+ }
+
+ ch->sceneId = stackPos(1);
+ return 0;
+}
+
+int KyraEngine_LoK::o1_walkCharacterToPoint(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_walkCharacterToPoint(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
+ int character = stackPos(0);
+ int toX = stackPos(1);
+ int toY = stackPos(2);
+ _pathfinderFlag2 = 1;
+ uint32 nextFrame;
+ int findWayReturn = findWay(_characterList[character].x1, _characterList[character].y1, toX, toY, _movFacingTable, 150);
+ _pathfinderFlag2 = 0;
+
+ if (_lastFindWayRet < findWayReturn)
+ _lastFindWayRet = findWayReturn;
+ if (findWayReturn == 0x7D00 || findWayReturn == 0)
+ return 0;
+
+ int *curPos = _movFacingTable;
+ bool running = true;
+ while (running) {
+ bool forceContinue = false;
+ switch (*curPos) {
+ case 0:
+ _characterList[character].facing = 2;
+ break;
+
+ case 1:
+ _characterList[character].facing = 1;
+ break;
+
+ case 2:
+ _characterList[character].facing = 0;
+ break;
+
+ case 3:
+ _characterList[character].facing = 7;
+ break;
+
+ case 4:
+ _characterList[character].facing = 6;
+ break;
+
+ case 5:
+ _characterList[character].facing = 5;
+ break;
+
+ case 6:
+ _characterList[character].facing = 4;
+ break;
+
+ case 7:
+ _characterList[character].facing = 3;
+ break;
+
+ case 8:
+ running = 0;
+ break;
+
+ default:
+ ++curPos;
+ forceContinue = true;
+ break;
+ }
+
+ if (forceContinue || !running)
+ continue;
+
+ setCharacterPosition(character, 0);
+ ++curPos;
+
+ nextFrame = _timer->getDelay(5 + character) * _tickLength + _system->getMillis();
+ while (_system->getMillis() < nextFrame) {
+ _sprites->updateSceneAnims();
+ updateMousePointer();
+ _timer->update();
+ _animator->updateAllObjectShapes();
+ updateTextFade();
+ if ((nextFrame - _system->getMillis()) >= 10)
+ delay(10);
+ }
+ }
+ return 0;
+}
+
+int KyraEngine_LoK::o1_specialEventDisplayBrynnsNote(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_specialEventDisplayBrynnsNote(%p) ()", (const void *)script);
+ _screen->hideMouse();
+ _screen->savePageToDisk("HIDPAGE.TMP", 2);
+ _screen->savePageToDisk("SEENPAGE.TMP", 0);
+ if (_flags.isTalkie) {
+ if (_flags.lang == Common::EN_ANY || _flags.lang == Common::IT_ITA)
+ _screen->loadBitmap("NOTEENG.CPS", 3, 3, 0);
+ else if (_flags.lang == Common::FR_FRA)
+ _screen->loadBitmap("NOTEFRE.CPS", 3, 3, 0);
+ else if (_flags.lang == Common::DE_DEU)
+ _screen->loadBitmap("NOTEGER.CPS", 3, 3, 0);
+ } else {
+ _screen->loadBitmap("NOTE.CPS", 3, 3, 0);
+ }
+ _screen->copyRegion(63, 8, 63, 8, 194, 128, 2, 0);
+ _screen->updateScreen();
+ _screen->showMouse();
+ _screen->setFont(Screen::FID_6_FNT);
+ return 0;
+}
+
+int KyraEngine_LoK::o1_specialEventRemoveBrynnsNote(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_specialEventRemoveBrynnsNote(%p) ()", (const void *)script);
+ _screen->hideMouse();
+ _screen->loadPageFromDisk("SEENPAGE.TMP", 0);
+ _screen->loadPageFromDisk("HIDPAGE.TMP", 2);
+ _screen->updateScreen();
+ _screen->showMouse();
+ _screen->setFont(Screen::FID_8_FNT);
+ return 0;
+}
+
+int KyraEngine_LoK::o1_setLogicPage(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_setLogicPage(%p) (%d)", (const void *)script, stackPos(0));
+ _screen->_curPage = stackPos(0);
+ return stackPos(0);
+}
+
+int KyraEngine_LoK::o1_fatPrint(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_fatPrint(%p) ('%s', %d, %d, %d, %d, %d)", (const void *)script, stackPosString(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5));
+
+ // Workaround for bug #1582672 ("KYRA1: Text crippled and drawn wrong")
+ // I'm not sure how the original handles this, since it seems to call
+ // printText also, maybe it fails somewhere inside...
+ // TODO: fix the reason for this workaround
+ if (_currentRoom == 117)
+ return 0;
+ _text->printText(stackPosString(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5));
+ return 0;
+}
+
+int KyraEngine_LoK::o1_preserveAllObjectBackgrounds(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_preserveAllObjectBackgrounds(%p) ()", (const void *)script);
+ _animator->preserveAllBackgrounds();
+ return 0;
+}
+
+int KyraEngine_LoK::o1_updateSceneAnimations(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_updateSceneAnimations(%p) (%d)", (const void *)script, stackPos(0));
+ int times = stackPos(0);
+ while (times--) {
+ _sprites->updateSceneAnims();
+ _animator->updateAllObjectShapes();
+ }
+ return 0;
+}
+
+int KyraEngine_LoK::o1_sceneAnimationActive(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_sceneAnimationActive(%p) (%d)", (const void *)script, stackPos(0));
+ return _sprites->_anims[stackPos(0)].play;
+}
+
+int KyraEngine_LoK::o1_setCharacterMovementDelay(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_setCharacterMovementDelay(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ _timer->setDelay(stackPos(0)+5, stackPos(1));
+ return 0;
+}
+
+int KyraEngine_LoK::o1_getCharacterFacing(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_getCharacterFacing(%p) (%d)", (const void *)script, stackPos(0));
+ return _characterList[stackPos(0)].facing;
+}
+
+int KyraEngine_LoK::o1_bkgdScrollSceneAndMasksRight(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_bkgdScrollSceneAndMasksRight(%p) (%d)", (const void *)script, stackPos(0));
+ _screen->copyBackgroundBlock(stackPos(0), 2, 0);
+ _screen->copyBackgroundBlock2(stackPos(0));
+ // update the whole screen
+ _screen->copyRegion(7, 7, 7, 7, 305, 129, 3, 0);
+ // Don't do a screen update here, see bug #1910180 "KYRA1: Screen 'flash'"
+ // it would cause to draw the screen with a wrong palette and thus look
+ // strange for the user. Since this opcode should be just called on scene
+ // initialization anyway, there should be no problem with not updating the
+ // screen right now.
+ return 0;
+}
+
+int KyraEngine_LoK::o1_dispelMagicAnimation(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_dispelMagicAnimation(%p) ()", (const void *)script);
+ seq_dispelMagicAnimation();
+ return 0;
+}
+
+int KyraEngine_LoK::o1_findBrightestFireberry(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_findBrightestFireberry(%p) ()", (const void *)script);
+ if (_currentCharacter->sceneId >= 187 && _currentCharacter->sceneId <= 198)
+ return 29;
+
+ if (_currentCharacter->sceneId == 133 || _currentCharacter->sceneId == 137 ||
+ _currentCharacter->sceneId == 165 || _currentCharacter->sceneId == 173)
+ return 29;
+
+ if (_itemInHand == 28)
+ return 28;
+
+ int brightestFireberry = 107;
+ if (_itemInHand >= 29 && _itemInHand <= 33)
+ brightestFireberry = _itemInHand;
+ for (int i = 0; i < 10; ++i) {
+ uint8 item = _currentCharacter->inventoryItems[i];
+ if (item == 0xFF)
+ continue;
+ if (item == 28)
+ return 28;
+ if (item >= 29 && item <= 33) {
+ if (item < brightestFireberry)
+ brightestFireberry = item;
+ }
+ }
+ assert(_currentCharacter->sceneId < _roomTableSize);
+ Room *curRoom = &_roomTable[_currentCharacter->sceneId];
+ for (int i = 0; i < 12; ++i) {
+ uint8 item = curRoom->itemsTable[i];
+ if (item == 0xFF)
+ continue;
+ if (item == 28)
+ return 28;
+ if (item >= 29 && item <= 33) {
+ if (item < brightestFireberry)
+ brightestFireberry = item;
+ }
+ }
+ if (brightestFireberry == 107)
+ return -1;
+ return brightestFireberry;
+}
+
+int KyraEngine_LoK::o1_setFireberryGlowPalette(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_setFireberryGlowPalette(%p) (%d)", (const void *)script, stackPos(0));
+ int palIndex = 0;
+ switch (stackPos(0)) {
+ case 0x1E:
+ palIndex = 9;
+ break;
+
+ case 0x1F:
+ palIndex = 10;
+ break;
+
+ case 0x20:
+ palIndex = 11;
+ break;
+
+ case 0x21:
+ case -1:
+ palIndex = 12;
+ break;
+
+ default:
+ palIndex = 8;
+ break;
+ }
+ if (_brandonStatusBit & 2) {
+ if (_currentCharacter->sceneId != 133 && _currentCharacter->sceneId != 137 &&
+ _currentCharacter->sceneId != 165 && _currentCharacter->sceneId != 173 &&
+ (_currentCharacter->sceneId < 187 || _currentCharacter->sceneId > 198)) {
+ palIndex = 14;
+ }
+ }
+ const uint8 *palette = _specialPalettes[palIndex];
+ memcpy(_screen->getPalette(1) + 684, palette, 44);
+ return 0;
+}
+
+int KyraEngine_LoK::o1_drinkPotionAnimation(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_drinkPotionAnimation(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
+ seq_playDrinkPotionAnim(stackPos(0), stackPos(1), stackPos(2));
+ return 0;
+}
+
+int KyraEngine_LoK::o1_makeAmuletAppear(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_makeAmuletAppear(%p) ()", (const void *)script);
+ WSAMovie_v1 amulet(this);
+ amulet.open("AMULET.WSA", 1, 0);
+ amulet.setX(224);
+ amulet.setY(152);
+ amulet.setDrawPage(0);
+ if (amulet.opened()) {
+ assert(_amuleteAnim);
+ _screen->hideMouse();
+ snd_playSoundEffect(0x70);
+ uint32 nextTime = 0;
+ for (int i = 0; _amuleteAnim[i] != 0xFF; ++i) {
+ nextTime = _system->getMillis() + 5 * _tickLength;
+
+ uint8 code = _amuleteAnim[i];
+ if (code == 3 || code == 7)
+ snd_playSoundEffect(0x71);
+
+ if (code == 5)
+ snd_playSoundEffect(0x72);
+
+ if (code == 14)
+ snd_playSoundEffect(0x73);
+
+ amulet.displayFrame(code);
+ _animator->_updateScreen = true;
+
+ while (_system->getMillis() < nextTime) {
+ _sprites->updateSceneAnims();
+ _animator->updateAllObjectShapes();
+ if (nextTime - _system->getMillis() >= 10)
+ delay(10);
+ }
+ }
+ _screen->showMouse();
+ }
+ setGameFlag(0x2D);
+ return 0;
+}
+
+int KyraEngine_LoK::o1_drawItemShapeIntoScene(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_drawItemShapeIntoScene(%p) (%d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
+ int item = stackPos(0);
+ int x = stackPos(1);
+ int y = stackPos(2);
+ int flags = stackPos(3);
+ int onlyHidPage = stackPos(4);
+
+ if (flags)
+ flags = 1;
+
+ if (onlyHidPage) {
+ _screen->drawShape(2, _shapes[216+item], x, y, 0, flags);
+ } else {
+ _screen->hideMouse();
+ _animator->restoreAllObjectBackgrounds();
+ _screen->drawShape(2, _shapes[216+item], x, y, 0, flags);
+ _screen->drawShape(0, _shapes[216+item], x, y, 0, flags);
+ _animator->flagAllObjectsForBkgdChange();
+ _animator->preserveAnyChangedBackgrounds();
+ _animator->flagAllObjectsForRefresh();
+ _animator->updateAllObjectShapes();
+ _screen->showMouse();
+ }
+ return 0;
+}
+
+int KyraEngine_LoK::o1_setCharacterCurrentFrame(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_setCharacterCurrentFrame(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ _characterList[stackPos(0)].currentAnimFrame = stackPos(1);
+ return 0;
+}
+
+int KyraEngine_LoK::o1_waitForConfirmationMouseClick(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_waitForConfirmationMouseClick(%p) ()", (const void *)script);
+ // if (mouseEnabled) {
+ while (!_mousePressFlag) {
+ updateMousePointer();
+ _sprites->updateSceneAnims();
+ _animator->updateAllObjectShapes();
+ delay(10);
+ }
+
+ while (_mousePressFlag) {
+ updateMousePointer();
+ _sprites->updateSceneAnims();
+ _animator->updateAllObjectShapes();
+ delay(10);
+ }
+ // }
+ _gui->processButtonList(_buttonList, 0, 0);
+ _skipFlag = false;
+ Common::Point mouse = getMousePos();
+ script->regs[1] = mouse.x;
+ script->regs[2] = mouse.y;
+ return 0;
+}
+
+int KyraEngine_LoK::o1_pageFlip(EMCState *script) {
+ warning("STUB: o1_pageFlip");
+ return 0;
+}
+
+int KyraEngine_LoK::o1_setSceneFile(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_setSceneFile(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ setSceneFile(stackPos(0), stackPos(1));
+ return 0;
+}
+
+int KyraEngine_LoK::o1_getItemInMarbleVase(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_getItemInMarbleVase(%p) ()", (const void *)script);
+ return _marbleVaseItem;
+}
+
+int KyraEngine_LoK::o1_setItemInMarbleVase(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_setItemInMarbleVase(%p) (%d)", (const void *)script, stackPos(0));
+ _marbleVaseItem = stackPos(0);
+ return 0;
+}
+
+int KyraEngine_LoK::o1_addItemToInventory(EMCState *script) {
+ warning("STUB: o1_addItemToInventory");
+ return 0;
+}
+
+int KyraEngine_LoK::o1_intPrint(EMCState *script) {
+ warning("STUB: o1_intPrint");
+ return 0;
+}
+
+int KyraEngine_LoK::o1_shakeScreen(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_shakeScreen(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ int waitTicks = stackPos(1);
+ int times = stackPos(0);
+
+ for (int i = 0; i < times; ++i) {
+ _screen->shakeScreen(1);
+ delay(waitTicks * _tickLength);
+ }
+
+ return 0;
+}
+
+int KyraEngine_LoK::o1_createAmuletJewel(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_createAmuletJewel(%p) (%d)", (const void *)script, stackPos(0));
+ seq_createAmuletJewel(stackPos(0), 0, 0, 0);
+ return 0;
+}
+
+int KyraEngine_LoK::o1_setSceneAnimCurrXY(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_setSceneAnimCurrXY(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
+ _sprites->_anims[stackPos(0)].x = stackPos(1);
+ _sprites->_anims[stackPos(0)].y = stackPos(2);
+ return 0;
+}
+
+int KyraEngine_LoK::o1_poisonBrandonAndRemaps(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_poisonBrandonAndRemaps(%p) ()", (const void *)script);
+ setBrandonPoisonFlags(1);
+ return 0;
+}
+
+int KyraEngine_LoK::o1_fillFlaskWithWater(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_fillFlaskWithWater(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ seq_fillFlaskWithWater(stackPos(0), stackPos(1));
+ return 0;
+}
+
+int KyraEngine_LoK::o1_getCharacterMovementDelay(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_getCharacterMovementDelay(%p) (%d)", (const void *)script, stackPos(0));
+ return _timer->getDelay(stackPos(0)+5);
+}
+
+int KyraEngine_LoK::o1_getBirthstoneGem(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_getBirthstoneGem(%p) (%d)", (const void *)script, stackPos(0));
+ if (stackPos(0) < 4)
+ return _birthstoneGemTable[stackPos(0)];
+ return 0;
+}
+
+int KyraEngine_LoK::o1_queryBrandonStatusBit(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_queryBrandonStatusBit(%p) (%d)", (const void *)script, stackPos(0));
+ if (_brandonStatusBit & stackPos(0))
+ return 1;
+ return 0;
+}
+
+int KyraEngine_LoK::o1_playFluteAnimation(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_playFluteAnimation(%p) ()", (const void *)script);
+ seq_playFluteAnimation();
+ return 0;
+}
+
+int KyraEngine_LoK::o1_playWinterScrollSequence(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_playWinterScrollSequence(%p) (%d)", (const void *)script, stackPos(0));
+ if (!stackPos(0))
+ seq_winterScroll2();
+ else
+ seq_winterScroll1();
+ return 0;
+}
+
+int KyraEngine_LoK::o1_getIdolGem(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_getIdolGem(%p) (%d)", (const void *)script, stackPos(0));
+ return _idolGemsTable[stackPos(0)];
+}
+
+int KyraEngine_LoK::o1_setIdolGem(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_setIdolGem(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ _idolGemsTable[stackPos(0)] = stackPos(1);
+ return 0;
+}
+
+int KyraEngine_LoK::o1_totalItemsInScene(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_totalItemsInScene(%p) (%d)", (const void *)script, stackPos(0));
+ return countItemsInScene(stackPos(0));
+}
+
+int KyraEngine_LoK::o1_restoreBrandonsMovementDelay(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_restoreBrandonsMovementDelay(%p) ()", (const void *)script);
+ setWalkspeed(_configWalkspeed);
+ return 0;
+}
+
+int KyraEngine_LoK::o1_setEntranceMouseCursorTrack(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_setEntranceMouseCursorTrack(%p) (%d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
+ _entranceMouseCursorTracks[0] = stackPos(0);
+ _entranceMouseCursorTracks[1] = stackPos(1);
+ _entranceMouseCursorTracks[2] = stackPos(0) + stackPos(2) - 1;
+ _entranceMouseCursorTracks[3] = stackPos(1) + stackPos(3) - 1;
+ _entranceMouseCursorTracks[4] = stackPos(4);
+ return 0;
+}
+
+int KyraEngine_LoK::o1_itemAppearsOnGround(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_itemAppearsOnGround(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
+ processItemDrop(_currentCharacter->sceneId, stackPos(0), stackPos(1), stackPos(2), 2, 0);
+ return 0;
+}
+
+int KyraEngine_LoK::o1_setNoDrawShapesFlag(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_setNoDrawShapesFlag(%p) (%d)", (const void *)script, stackPos(0));
+ _animator->_noDrawShapesFlag = stackPos(0);
+ return 0;
+}
+
+int KyraEngine_LoK::o1_fadeEntirePalette(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_fadeEntirePalette(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ int cmd = stackPos(0);
+ uint8 *fadePal = 0;
+
+ if (_flags.platform == Common::kPlatformAmiga) {
+ if (cmd == 0) {
+ fadePal = _screen->getPalette(2);
+ memset(fadePal, 0, 32*3);
+ memcpy(_screen->getPalette(4), _screen->getPalette(0), 32*3);
+ } else if (cmd == 1) {
+ fadePal = _screen->getPalette(0);
+ memcpy(_screen->getPalette(0), _screen->getPalette(4), 32*3);
+ } else if (cmd == 2) {
+ fadePal = _screen->getPalette(0);
+ memset(_screen->getPalette(2), 0, 32*3);
+ }
+ } else {
+ if (cmd == 0) {
+ fadePal = _screen->getPalette(2);
+ uint8 *screenPal = _screen->getPalette(0);
+ uint8 *backUpPal = _screen->getPalette(3);
+
+ memcpy(backUpPal, screenPal, sizeof(uint8)*768);
+ memset(fadePal, 0, sizeof(uint8)*768);
+ } else if (cmd == 1) {
+ //fadePal = _screen->getPalette(3);
+ warning("unimplemented o1_fadeEntirePalette function");
+ return 0;
+ } else if (cmd == 2) {
+ memset(_screen->getPalette(2), 0, 768);
+ memcpy(_screen->getPalette(0), _screen->getPalette(1), 768);
+ fadePal = _screen->getPalette(0);
+ }
+ }
+
+ _screen->fadePalette(fadePal, stackPos(1));
+ return 0;
+}
+
+int KyraEngine_LoK::o1_itemOnGroundHere(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_itemOnGroundHere(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ assert(stackPos(0) < _roomTableSize);
+ Room *curRoom = &_roomTable[stackPos(0)];
+ for (int i = 0; i < 12; ++i) {
+ if (curRoom->itemsTable[i] == stackPos(1))
+ return 1;
+ }
+ return 0;
+}
+
+int KyraEngine_LoK::o1_queryCauldronState(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_queryCauldronState(%p) ()", (const void *)script);
+ return _cauldronState;
+}
+
+int KyraEngine_LoK::o1_setCauldronState(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_setCauldronState(%p) (%d)", (const void *)script, stackPos(0));
+ _cauldronState = stackPos(0);
+ return _cauldronState;
+}
+
+int KyraEngine_LoK::o1_queryCrystalState(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_queryCrystalState(%p) (%d)", (const void *)script, stackPos(0));
+ if (!stackPos(0))
+ return _crystalState[0];
+ else if (stackPos(0) == 1)
+ return _crystalState[1];
+ return -1;
+}
+
+int KyraEngine_LoK::o1_setCrystalState(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_setCrystalState(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ if (!stackPos(0))
+ _crystalState[0] = stackPos(1);
+ else if (stackPos(0) == 1)
+ _crystalState[1] = stackPos(1);
+ return stackPos(1);
+}
+
+int KyraEngine_LoK::o1_setPaletteRange(EMCState *script) {
+ warning("STUB: o1_setPaletteRange");
+ return 0;
+}
+
+int KyraEngine_LoK::o1_shrinkBrandonDown(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_shrinkBrandonDown(%p) (%d)", (const void *)script, stackPos(0));
+ int delayTime = stackPos(0);
+ checkAmuletAnimFlags();
+ int scaleValue = _scaleTable[_currentCharacter->y1];
+ int scale = 0;
+
+ if (_scaleMode)
+ scale = scaleValue;
+ else
+ scale = 256;
+
+ int scaleModeBackUp = _scaleMode;
+ _scaleMode = 1;
+ int scaleEnd = scale >> 1;
+ for (; scaleEnd <= scale; --scale) {
+ _scaleTable[_currentCharacter->y1] = scale;
+ _animator->animRefreshNPC(0);
+ delayWithTicks(1);
+ }
+ delayWithTicks(delayTime); // XXX
+ _scaleTable[_currentCharacter->y1] = scaleValue;
+ _scaleMode = scaleModeBackUp;
+ return 0;
+}
+
+int KyraEngine_LoK::o1_growBrandonUp(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_growBrandonUp(%p) ()", (const void *)script);
+ int scaleValue = _scaleTable[_currentCharacter->y1];
+ int scale = 0;
+ if (_scaleMode)
+ scale = scaleValue;
+ else
+ scale = 256;
+
+ int scaleModeBackUp = _scaleMode;
+ _scaleMode = 1;
+ for (int curScale = scale >> 1; curScale <= scale; ++curScale) {
+ _scaleTable[_currentCharacter->y1] = curScale;
+ _animator->animRefreshNPC(0);
+ delayWithTicks(1);
+ }
+ _scaleTable[_currentCharacter->y1] = scaleValue;
+ _scaleMode = scaleModeBackUp;
+ return 0;
+}
+
+int KyraEngine_LoK::o1_setBrandonScaleXAndY(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_setBrandonScaleXAndY(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ _animator->_brandonScaleX = stackPos(0);
+ _animator->_brandonScaleY = stackPos(1);
+ return 0;
+}
+
+int KyraEngine_LoK::o1_resetScaleMode(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_resetScaleMode(%p) ()", (const void *)script);
+ _scaleMode = 0;
+ return 0;
+}
+
+int KyraEngine_LoK::o1_getScaleDepthTableValue(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_getScaleDepthTableValue(%p) (%d)", (const void *)script, stackPos(0));
+ assert(stackPos(0) < ARRAYSIZE(_scaleTable));
+ return _scaleTable[stackPos(0)];
+}
+
+int KyraEngine_LoK::o1_setScaleDepthTableValue(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_setScaleDepthTableValue(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ assert(stackPos(0) < ARRAYSIZE(_scaleTable));
+ _scaleTable[stackPos(0)] = stackPos(1);
+ return stackPos(1);
+}
+
+int KyraEngine_LoK::o1_message(EMCState *script) {
+ if (_flags.isTalkie) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_message(%p) (%d, '%s', %d)", (const void *)script, stackPos(0), stackPosString(1), stackPos(2));
+ drawSentenceCommand(stackPosString(1), stackPos(2));
+ } else {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_message(%p) ('%s', %d)", (const void *)script, stackPosString(0), stackPos(1));
+ drawSentenceCommand(stackPosString(0), stackPos(1));
+ }
+
+ return 0;
+}
+
+int KyraEngine_LoK::o1_checkClickOnNPC(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_checkClickOnNPC(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ return checkForNPCScriptRun(stackPos(0), stackPos(1));
+}
+
+int KyraEngine_LoK::o1_getFoyerItem(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_getFoyerItem(%p) (%d)", (const void *)script, stackPos(0));
+ assert(stackPos(0) < ARRAYSIZE(_foyerItemTable));
+ return _foyerItemTable[stackPos(0)];
+}
+
+int KyraEngine_LoK::o1_setFoyerItem(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_setFoyerItem(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ assert(stackPos(0) < ARRAYSIZE(_foyerItemTable));
+ _foyerItemTable[stackPos(0)] = stackPos(1);
+ return stackPos(1);
+}
+
+int KyraEngine_LoK::o1_setNoItemDropRegion(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_setNoItemDropRegion(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
+ addToNoDropRects(stackPos(0), stackPos(1), stackPos(2), stackPos(3));
+ return 0;
+}
+
+int KyraEngine_LoK::o1_walkMalcolmOn(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_walkMalcolmOn(%p) ()", (const void *)script);
+ if (!_malcolmFlag)
+ _malcolmFlag = 1;
+ return 0;
+}
+
+int KyraEngine_LoK::o1_passiveProtection(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_passiveProtection(%p) ()", (const void *)script);
+ return 1;
+}
+
+int KyraEngine_LoK::o1_setPlayingLoop(EMCState *script) {
+ warning("STUB: o1_setPlayingLoop");
+ return 0;
+}
+
+int KyraEngine_LoK::o1_brandonToStoneSequence(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_brandonToStoneSequence(%p) ()", (const void *)script);
+ seq_brandonToStone();
+ return 0;
+}
+
+int KyraEngine_LoK::o1_brandonHealingSequence(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_brandonHealingSequence(%p) ()", (const void *)script);
+ seq_brandonHealing();
+ return 0;
+}
+
+int KyraEngine_LoK::o1_protectCommandLine(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_protectCommandLine(%p) (%d)", (const void *)script, stackPos(0));
+ return stackPos(0);
+}
+
+int KyraEngine_LoK::o1_pauseMusicSeconds(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_pauseMusicSeconds(%p) ()", (const void *)script);
+ // if music disabled
+ // return
+ delay(stackPos(0)*1000, true);
+ return 0;
+}
+
+int KyraEngine_LoK::o1_resetMaskRegion(EMCState *script) {
+ warning("STUB: o1_resetMaskRegion");
+ return 0;
+}
+
+int KyraEngine_LoK::o1_setPaletteChangeFlag(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_setPaletteChangeFlag(%p) (%d)", (const void *)script, stackPos(0));
+ _paletteChanged = stackPos(0);
+ return _paletteChanged;
+}
+
+int KyraEngine_LoK::o1_vocUnload(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_vocUnload(%p) ()", (const void *)script);
+ // this should unload all voc files (not needed)
+ return 0;
+}
+
+int KyraEngine_LoK::o1_vocLoad(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_vocLoad(%p) (%d)", (const void *)script, stackPos(0));
+ // this should load the specified voc file (not needed)
+ return 0;
+}
+
+int KyraEngine_LoK::o1_dummy(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_dummy(%p) ()", (const void *)script);
+ return 0;
+}
+
+#pragma mark -
+
+typedef Common::Functor1Mem<EMCState*, int, KyraEngine_LoK> OpcodeV1;
+#define SetOpcodeTable(x) table = &x;
+#define Opcode(x) table->push_back(new OpcodeV1(this, &KyraEngine_LoK::x))
+void KyraEngine_LoK::setupOpcodeTable() {
+ Common::Array<const Opcode *> *table = 0;
+
+ SetOpcodeTable(_opcodes);
+ // 0x00
+ Opcode(o1_magicInMouseItem);
+ Opcode(o1_characterSays);
+ Opcode(o1_delay);
+ Opcode(o1_drawSceneAnimShape);
+ // 0x04
+ Opcode(o1_queryGameFlag);
+ Opcode(o1_setGameFlag);
+ Opcode(o1_resetGameFlag);
+ Opcode(o1_runNPCScript);
+ // 0x08
+ Opcode(o1_setSpecialExitList);
+ Opcode(o1_blockInWalkableRegion);
+ Opcode(o1_blockOutWalkableRegion);
+ Opcode(o1_walkPlayerToPoint);
+ // 0x0c
+ Opcode(o1_dropItemInScene);
+ Opcode(o1_drawAnimShapeIntoScene);
+ Opcode(o1_setHandItem);
+ Opcode(o1_savePageToDisk);
+ // 0x10
+ Opcode(o1_sceneAnimOn);
+ Opcode(o1_sceneAnimOff);
+ Opcode(o1_getElapsedSeconds);
+ Opcode(o1_mouseIsPointer);
+ // 0x14
+ Opcode(o1_removeHandItem);
+ Opcode(o1_runSceneAnimUntilDone);
+ Opcode(o1_fadeSpecialPalette);
+ Opcode(o1_playSoundEffect);
+ // 0x18
+ Opcode(o1_playWanderScoreViaMap);
+ Opcode(o1_phaseInSameScene);
+ Opcode(o1_setScenePhasingFlag);
+ Opcode(o1_resetScenePhasingFlag);
+ // 0x1c
+ Opcode(o1_queryScenePhasingFlag);
+ Opcode(o1_sceneToDirection);
+ Opcode(o1_setBirthstoneGem);
+ Opcode(o1_placeItemInGenericMapScene);
+ // 0x20
+ Opcode(o1_setBrandonStatusBit);
+ Opcode(o1_delaySecs);
+ Opcode(o1_getCharacterScene);
+ Opcode(o1_runNPCSubscript);
+ // 0x24
+ Opcode(o1_magicOutMouseItem);
+ Opcode(o1_internalAnimOn);
+ Opcode(o1_forceBrandonToNormal);
+ Opcode(o1_poisonDeathNow);
+ // 0x28
+ Opcode(o1_setScaleMode);
+ Opcode(o1_openWSAFile);
+ Opcode(o1_closeWSAFile);
+ Opcode(o1_runWSAFromBeginningToEnd);
+ // 0x2c
+ Opcode(o1_displayWSAFrame);
+ Opcode(o1_enterNewScene);
+ Opcode(o1_setSpecialEnterXAndY);
+ Opcode(o1_runWSAFrames);
+ // 0x30
+ Opcode(o1_popBrandonIntoScene);
+ Opcode(o1_restoreAllObjectBackgrounds);
+ Opcode(o1_setCustomPaletteRange);
+ Opcode(o1_loadPageFromDisk);
+ // 0x34
+ Opcode(o1_customPrintTalkString);
+ Opcode(o1_restoreCustomPrintBackground);
+ Opcode(o1_hideMouse);
+ Opcode(o1_showMouse);
+ // 0x38
+ Opcode(o1_getCharacterX);
+ Opcode(o1_getCharacterY);
+ Opcode(o1_setCharacterFacing);
+ Opcode(o1_copyWSARegion);
+ // 0x3c
+ Opcode(o1_printText);
+ Opcode(o1_getRand);
+ Opcode(o1_loadSoundFile);
+ Opcode(o1_displayWSAFrameOnHidPage);
+ // 0x40
+ Opcode(o1_displayWSASequentialFrames);
+ Opcode(o1_refreshCharacter);
+ Opcode(o1_internalAnimOff);
+ Opcode(o1_changeCharactersXAndY);
+ // 0x44
+ Opcode(o1_clearSceneAnimatorBeacon);
+ Opcode(o1_querySceneAnimatorBeacon);
+ Opcode(o1_refreshSceneAnimator);
+ Opcode(o1_placeItemInOffScene);
+ // 0x48
+ Opcode(o1_wipeDownMouseItem);
+ Opcode(o1_placeCharacterInOtherScene);
+ Opcode(o1_getKey);
+ Opcode(o1_specificItemInInventory);
+ // 0x4c
+ Opcode(o1_popMobileNPCIntoScene);
+ Opcode(o1_mobileCharacterInScene);
+ Opcode(o1_hideMobileCharacter);
+ Opcode(o1_unhideMobileCharacter);
+ // 0x50
+ Opcode(o1_setCharacterLocation);
+ Opcode(o1_walkCharacterToPoint);
+ Opcode(o1_specialEventDisplayBrynnsNote);
+ Opcode(o1_specialEventRemoveBrynnsNote);
+ // 0x54
+ Opcode(o1_setLogicPage);
+ Opcode(o1_fatPrint);
+ Opcode(o1_preserveAllObjectBackgrounds);
+ Opcode(o1_updateSceneAnimations);
+ // 0x58
+ Opcode(o1_sceneAnimationActive);
+ Opcode(o1_setCharacterMovementDelay);
+ Opcode(o1_getCharacterFacing);
+ Opcode(o1_bkgdScrollSceneAndMasksRight);
+ // 0x5c
+ Opcode(o1_dispelMagicAnimation);
+ Opcode(o1_findBrightestFireberry);
+ Opcode(o1_setFireberryGlowPalette);
+ Opcode(o1_setDeathHandler);
+ // 0x60
+ Opcode(o1_drinkPotionAnimation);
+ Opcode(o1_makeAmuletAppear);
+ Opcode(o1_drawItemShapeIntoScene);
+ Opcode(o1_setCharacterCurrentFrame);
+ // 0x64
+ Opcode(o1_waitForConfirmationMouseClick);
+ Opcode(o1_pageFlip);
+ Opcode(o1_setSceneFile);
+ Opcode(o1_getItemInMarbleVase);
+ // 0x68
+ Opcode(o1_setItemInMarbleVase);
+ Opcode(o1_addItemToInventory);
+ Opcode(o1_intPrint);
+ Opcode(o1_shakeScreen);
+ // 0x6c
+ Opcode(o1_createAmuletJewel);
+ Opcode(o1_setSceneAnimCurrXY);
+ Opcode(o1_poisonBrandonAndRemaps);
+ Opcode(o1_fillFlaskWithWater);
+ // 0x70
+ Opcode(o1_getCharacterMovementDelay);
+ Opcode(o1_getBirthstoneGem);
+ Opcode(o1_queryBrandonStatusBit);
+ Opcode(o1_playFluteAnimation);
+ // 0x74
+ Opcode(o1_playWinterScrollSequence);
+ Opcode(o1_getIdolGem);
+ Opcode(o1_setIdolGem);
+ Opcode(o1_totalItemsInScene);
+ // 0x78
+ Opcode(o1_restoreBrandonsMovementDelay);
+ Opcode(o1_setMousePos);
+ Opcode(o1_getMouseState);
+ Opcode(o1_setEntranceMouseCursorTrack);
+ // 0x7c
+ Opcode(o1_itemAppearsOnGround);
+ Opcode(o1_setNoDrawShapesFlag);
+ Opcode(o1_fadeEntirePalette);
+ Opcode(o1_itemOnGroundHere);
+ // 0x80
+ Opcode(o1_queryCauldronState);
+ Opcode(o1_setCauldronState);
+ Opcode(o1_queryCrystalState);
+ Opcode(o1_setCrystalState);
+ // 0x84
+ Opcode(o1_setPaletteRange);
+ Opcode(o1_shrinkBrandonDown);
+ Opcode(o1_growBrandonUp);
+ Opcode(o1_setBrandonScaleXAndY);
+ // 0x88
+ Opcode(o1_resetScaleMode);
+ Opcode(o1_getScaleDepthTableValue);
+ Opcode(o1_setScaleDepthTableValue);
+ Opcode(o1_message);
+ // 0x8c
+ Opcode(o1_checkClickOnNPC);
+ Opcode(o1_getFoyerItem);
+ Opcode(o1_setFoyerItem);
+ Opcode(o1_setNoItemDropRegion);
+ // 0x90
+ Opcode(o1_walkMalcolmOn);
+ Opcode(o1_passiveProtection);
+ Opcode(o1_setPlayingLoop);
+ Opcode(o1_brandonToStoneSequence);
+ // 0x94
+ Opcode(o1_brandonHealingSequence);
+ Opcode(o1_protectCommandLine);
+ Opcode(o1_pauseMusicSeconds);
+ Opcode(o1_resetMaskRegion);
+ // 0x98
+ Opcode(o1_setPaletteChangeFlag);
+ Opcode(o1_fillRect);
+ Opcode(o1_vocUnload);
+ Opcode(o1_vocLoad);
+ // 0x9c
+ Opcode(o1_dummy);
+}
+#undef Opcode
+
+} // end of namespace Kyra
+
diff --git a/engines/kyra/script_mr.cpp b/engines/kyra/script_mr.cpp
index 8746ec83d7..9a059ead2a 100644
--- a/engines/kyra/script_mr.cpp
+++ b/engines/kyra/script_mr.cpp
@@ -134,6 +134,12 @@ int KyraEngine_MR::o3_hideBadConscience(EMCState *script) {
return 0;
}
+int KyraEngine_MR::o3_showAlbum(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_showAlbum(%p) ()", (const void *)script);
+ showAlbum();
+ return 0;
+}
+
int KyraEngine_MR::o3_setInventorySlot(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_setInventorySlot(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
const int slot = MAX<int16>(0, MIN<int16>(10, stackPos(0)));
@@ -551,7 +557,7 @@ int KyraEngine_MR::o3_updateConversations(EMCState *script) {
convs[0] = 0;
convs[1] = 4;
convs[2] = 0;
- convs[4] = 1;
+ convs[3] = 1;
break;
case 10:
@@ -588,6 +594,13 @@ int KyraEngine_MR::o3_updateConversations(EMCState *script) {
return 1;
}
+int KyraEngine_MR::o3_removeItemSlot(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_removeItemSlot(%p) (%d)", (const void *)script, stackPos(0));
+ deleteItemAnimEntry(stackPos(0));
+ _itemList[stackPos(0)].id = 0xFFFF;
+ return 1;
+}
+
int KyraEngine_MR::o3_setSceneDim(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_setSceneDim(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
_sceneMinX = stackPos(0);
@@ -798,8 +811,8 @@ int KyraEngine_MR::o3_daggerWarning(EMCState *script) {
return selection;
}
-int KyraEngine_MR::o3_blockOutRegion(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_blockOutRegion(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
+int KyraEngine_MR::o3_blockOutWalkableRegion(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_blockOutWalkableRegion(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
const int x1 = stackPos(0);
int y1 = stackPos(1);
const int x2 = stackPos(2);
@@ -1169,7 +1182,7 @@ void KyraEngine_MR::setupOpcodeTable() {
Opcode(o3_hideBadConscience);
// 0x18
OpcodeUnImpl();
- OpcodeUnImpl();
+ Opcode(o3_showAlbum);
Opcode(o3_setInventorySlot);
Opcode(o3_getInventorySlot);
// 0x1c
@@ -1186,19 +1199,19 @@ void KyraEngine_MR::setupOpcodeTable() {
Opcode(o3_removeInventoryItemInstances);
Opcode(o3_countInventoryItemInstances);
Opcode(o3_npcChatSequence);
- Opcode(o2_queryGameFlag);
+ Opcode(o1_queryGameFlag);
// 0x28
- Opcode(o2_resetGameFlag);
- Opcode(o2_setGameFlag);
- Opcode(o2_setHandItem);
- Opcode(o2_removeHandItem);
+ Opcode(o1_resetGameFlag);
+ Opcode(o1_setGameFlag);
+ Opcode(o1_setHandItem);
+ Opcode(o1_removeHandItem);
// 0x2c
- Opcode(o2_handItemSet);
- Opcode(o2_hideMouse);
+ Opcode(o1_getMouseState);
+ Opcode(o1_hideMouse);
Opcode(o2_addSpecialExit);
- Opcode(o2_setMousePos);
+ Opcode(o1_setMousePos);
// 0x30
- Opcode(o2_showMouse);
+ Opcode(o1_showMouse);
Opcode(o3_badConscienceChat);
Opcode(o3_wipeDownMouseItem);
Opcode(o3_dummy);
@@ -1220,7 +1233,7 @@ void KyraEngine_MR::setupOpcodeTable() {
// 0x40
Opcode(o3_checkInRect);
Opcode(o3_updateConversations);
- OpcodeUnImpl();
+ Opcode(o3_removeItemSlot);
Opcode(o3_dummy);
// 0x44
Opcode(o3_dummy);
@@ -1248,19 +1261,19 @@ void KyraEngine_MR::setupOpcodeTable() {
Opcode(o3_setMalcolmPos);
Opcode(o3_stopMusic);
// 0x58
- Opcode(o2_playWanderScoreViaMap);
+ Opcode(o1_playWanderScoreViaMap);
Opcode(o3_playSoundEffect);
Opcode(o3_getScore);
Opcode(o3_daggerWarning);
// 0x5c
- Opcode(o3_blockOutRegion);
+ Opcode(o3_blockOutWalkableRegion);
Opcode(o3_dummy);
Opcode(o3_showSceneStringsMessage);
OpcodeUnImpl();
// 0x60
- Opcode(o2_getRand);
+ Opcode(o1_getRand);
Opcode(o3_dummy);
- Opcode(o2_setDeathHandler);
+ Opcode(o1_setDeathHandler);
Opcode(o3_showGoodConscience);
// 0x64
Opcode(o3_goodConscienceChat);
@@ -1366,7 +1379,7 @@ void KyraEngine_MR::setupOpcodeTable() {
Opcode(o3_dummy);
// 0x0a
Opcode(o2a_setResetFrame);
- Opcode(o2_getRand);
+ Opcode(o1_getRand);
Opcode(o3_getMalcolmShapes);
Opcode(o3_dummy);
@@ -1374,8 +1387,8 @@ void KyraEngine_MR::setupOpcodeTable() {
// 0x00
Opcode(o3d_updateAnim);
Opcode(o3d_delay);
- Opcode(o2_getRand);
- Opcode(o2_queryGameFlag);
+ Opcode(o1_getRand);
+ Opcode(o1_queryGameFlag);
// 0x04
Opcode(o3_dummy);
}
diff --git a/engines/kyra/script_tim.cpp b/engines/kyra/script_tim.cpp
index 67e076cbf8..4ad6464424 100644
--- a/engines/kyra/script_tim.cpp
+++ b/engines/kyra/script_tim.cpp
@@ -31,7 +31,7 @@
namespace Kyra {
-TIMInterpreter::TIMInterpreter(KyraEngine *vm, OSystem *system) : _vm(vm), _system(system), _currentTim(0) {
+TIMInterpreter::TIMInterpreter(KyraEngine_v1 *vm, OSystem *system) : _vm(vm), _system(system), _currentTim(0) {
#define COMMAND(x) { &TIMInterpreter::x, #x }
#define COMMAND_UNIMPL() { 0, 0 }
static CommandEntry commandProcs[] = {
@@ -118,7 +118,8 @@ TIM *TIMInterpreter::load(const char *filename, const Common::Array<const TIMOpc
for (uint i = 0; i < avtlChunkSize; ++i)
tim->avtl[i] = READ_LE_UINT16(tim->avtl + i);
- for (int i = 0; i < 10; ++i)
+ int num = (avtlChunkSize < TIM::kCountFuncs) ? avtlChunkSize : (int)TIM::kCountFuncs;
+ for (int i = 0; i < num; ++i)
tim->func[i].avtl = tim->avtl + tim->avtl[i];
return tim;
@@ -128,8 +129,8 @@ void TIMInterpreter::unload(TIM *&tim) const {
if (!tim)
return;
- delete [] tim->text;
- delete [] tim->avtl;
+ delete[] tim->text;
+ delete[] tim->avtl;
delete tim;
tim = 0;
}
@@ -145,7 +146,7 @@ void TIMInterpreter::exec(TIM *tim, bool loop) {
}
do {
- for (_currentFunc = 0; _currentFunc < 10; ++_currentFunc) {
+ for (_currentFunc = 0; _currentFunc < TIM::kCountFuncs; ++_currentFunc) {
TIM::Function &cur = _currentTim->func[_currentFunc];
if (_currentTim->procFunc != -1)
@@ -184,6 +185,18 @@ void TIMInterpreter::exec(TIM *tim, bool loop) {
} while (loop);
}
+void TIMInterpreter::refreshTimersAfterPause(uint32 elapsedTime) {
+ if (!_currentTim)
+ return;
+
+ for (int i = 0; i < TIM::kCountFuncs; i++) {
+ if (_currentTim->func[i].lastTime)
+ _currentTim->func[i].lastTime += elapsedTime;
+ if (_currentTim->func[i].nextTime)
+ _currentTim->func[i].nextTime += elapsedTime;
+ }
+}
+
int TIMInterpreter::execCommand(int cmd, const uint16 *param) {
if (cmd < 0 || cmd >= _commandsSize) {
warning("Calling unimplemented TIM command %d", cmd);
@@ -206,7 +219,7 @@ int TIMInterpreter::cmd_initFunc0(const uint16 *param) {
}
int TIMInterpreter::cmd_stopCurFunc(const uint16 *param) {
- if (_currentFunc < 10)
+ if (_currentFunc < TIM::kCountFuncs)
_currentTim->func[_currentFunc].ip = 0;
if (!_currentFunc)
_finished = true;
@@ -215,7 +228,7 @@ int TIMInterpreter::cmd_stopCurFunc(const uint16 *param) {
int TIMInterpreter::cmd_initFunc(const uint16 *param) {
uint16 func = *param;
- assert(func < 10);
+ assert(func < TIM::kCountFuncs);
if (_currentTim->func[func].avtl)
_currentTim->func[func].ip = _currentTim->func[func].avtl;
else
@@ -225,13 +238,13 @@ int TIMInterpreter::cmd_initFunc(const uint16 *param) {
int TIMInterpreter::cmd_stopFunc(const uint16 *param) {
uint16 func = *param;
- assert(func < 10);
+ assert(func < TIM::kCountFuncs);
_currentTim->func[func].ip = 0;
return 1;
}
int TIMInterpreter::cmd_resetAllRuntimes(const uint16 *param) {
- for (int i = 0; i < 10; ++i) {
+ for (int i = 0; i < TIM::kCountFuncs; ++i) {
if (_currentTim->func[i].ip)
_currentTim->func[i].nextTime = _system->getMillis();
}
@@ -255,7 +268,7 @@ int TIMInterpreter::cmd_execOpcode(const uint16 *param) {
int TIMInterpreter::cmd_initFuncNow(const uint16 *param) {
uint16 func = *param;
- assert(func < 10);
+ assert(func < TIM::kCountFuncs);
_currentTim->func[func].ip = _currentTim->func[func].avtl;
_currentTim->func[func].lastTime = _currentTim->func[func].nextTime = _system->getMillis();
return 1;
@@ -263,7 +276,7 @@ int TIMInterpreter::cmd_initFuncNow(const uint16 *param) {
int TIMInterpreter::cmd_stopFuncNow(const uint16 *param) {
uint16 func = *param;
- assert(func < 10);
+ assert(func < TIM::kCountFuncs);
_currentTim->func[func].ip = 0;
_currentTim->func[func].lastTime = _currentTim->func[func].nextTime = _system->getMillis();
return 1;
diff --git a/engines/kyra/script_tim.h b/engines/kyra/script_tim.h
index 2ffbf89d65..cd715ff4ef 100644
--- a/engines/kyra/script_tim.h
+++ b/engines/kyra/script_tim.h
@@ -26,7 +26,7 @@
#ifndef KYRA_SCRIPT_TIM_H
#define KYRA_SCRIPT_TIM_H
-#include "kyra/kyra.h"
+#include "kyra/kyra_v1.h"
#include "common/array.h"
#include "common/func.h"
@@ -40,6 +40,10 @@ struct TIM {
int16 procFunc;
uint16 procParam;
+ enum {
+ kCountFuncs = 10
+ };
+
struct Function {
const uint16 *ip;
@@ -47,7 +51,7 @@ struct TIM {
uint32 nextTime;
const uint16 *avtl;
- } func[10];
+ } func[kCountFuncs];
uint16 *avtl;
uint8 *text;
@@ -57,7 +61,7 @@ struct TIM {
class TIMInterpreter {
public:
- TIMInterpreter(KyraEngine *vm, OSystem *system);
+ TIMInterpreter(KyraEngine_v1 *vm, OSystem *system);
TIM *load(const char *filename, const Common::Array<const TIMOpcode*> *opcodes);
void unload(TIM *&tim) const;
@@ -69,8 +73,9 @@ public:
void stopCurFunc() { if (_currentTim) cmd_stopCurFunc(0); }
void play(const char *filename);
+ void refreshTimersAfterPause(uint32 elapsedTime);
private:
- KyraEngine *_vm;
+ KyraEngine_v1 *_vm;
OSystem *_system;
TIM *_currentTim;
diff --git a/engines/kyra/script_v1.cpp b/engines/kyra/script_v1.cpp
index a258482802..f74c7e3560 100644
--- a/engines/kyra/script_v1.cpp
+++ b/engines/kyra/script_v1.cpp
@@ -23,74 +23,10 @@
*
*/
-
-#include "common/endian.h"
-#include "common/system.h"
-
#include "kyra/kyra_v1.h"
-#include "kyra/script.h"
#include "kyra/screen.h"
-#include "kyra/sprites.h"
-#include "kyra/wsamovie.h"
-#include "kyra/animator_v1.h"
-#include "kyra/text.h"
-#include "kyra/timer.h"
namespace Kyra {
-int KyraEngine_v1::o1_magicInMouseItem(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_magicInMouseItem(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- magicInMouseItem(stackPos(0), stackPos(1), -1);
- return 0;
-}
-
-int KyraEngine_v1::o1_characterSays(EMCState *script) {
- _skipFlag = false;
- if (_flags.isTalkie) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_characterSays(%p) (%d, '%s', %d, %d)", (const void *)script, stackPos(0), stackPosString(1), stackPos(2), stackPos(3));
- characterSays(stackPos(0), stackPosString(1), stackPos(2), stackPos(3));
- } else {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_characterSays(%p) ('%s', %d, %d)", (const void *)script, stackPosString(0), stackPos(1), stackPos(2));
- const char *string = stackPosString(0);
-
- if ((_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98) && _flags.lang == Common::JA_JPN) {
- static const uint8 townsString1[] = {
- 0x83, 0x75, 0x83, 0x89, 0x83, 0x93, 0x83, 0x83, 0x93, 0x81,
- 0x41, 0x82, 0xDC, 0x82, 0xBD, 0x97, 0x88, 0x82, 0xBD, 0x82,
- 0xCC, 0x82, 0xA9, 0x81, 0x48, 0x00, 0x00, 0x00
- };
- static const uint8 townsString2[] = {
- 0x83, 0x75, 0x83, 0x89, 0x83, 0x93, 0x83, 0x5C, 0x83, 0x93,
- 0x81, 0x41, 0x82, 0xDC, 0x82, 0xBD, 0x97, 0x88, 0x82, 0xBD,
- 0x82, 0xCC, 0x82, 0xA9, 0x81, 0x48, 0x00, 0x00
- };
-
- if (strncmp((const char *)townsString1, string, sizeof(townsString1)) == 0)
- string = (const char *)townsString2;
- }
-
- characterSays(-1, string, stackPos(1), stackPos(2));
- }
-
- return 0;
-}
-
-int KyraEngine_v1::o1_pauseTicks(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_pauseTicks(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- if (stackPos(1)) {
- warning("STUB: special o1_pauseTicks");
- // delete this after correct implementing
- delayWithTicks(stackPos(0));
- } else {
- delayWithTicks(stackPos(0));
- }
- return 0;
-}
-
-int KyraEngine_v1::o1_drawSceneAnimShape(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_drawSceneAnimShape(%p) (%d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
- _screen->drawShape(stackPos(4), _sprites->_sceneShapes[stackPos(0)], stackPos(1), stackPos(2), 0, (stackPos(3) != 0) ? 1 : 0);
- return 0;
-}
int KyraEngine_v1::o1_queryGameFlag(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_queryGameFlag(%p) (0x%X)", (const void *)script, stackPos(0));
@@ -107,1408 +43,21 @@ int KyraEngine_v1::o1_resetGameFlag(EMCState *script) {
return resetGameFlag(stackPos(0));
}
-int KyraEngine_v1::o1_runNPCScript(EMCState *script) {
- warning("STUB: o1_runNPCScript");
- return 0;
-}
-
-int KyraEngine_v1::o1_setSpecialExitList(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setSpecialExitList(%p) (%d, %d, %d, %d, %d, %d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5), stackPos(6), stackPos(7), stackPos(8), stackPos(9));
-
- for (int i = 0; i < 10; ++i)
- _exitList[i] = stackPos(i);
- _exitListPtr = _exitList;
-
- return 0;
-}
-
-int KyraEngine_v1::o1_blockInWalkableRegion(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_blockInWalkableRegion(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
- _screen->blockInRegion(stackPos(0), stackPos(1), stackPos(2)-stackPos(0)+1, stackPos(3)-stackPos(1)+1);
- return 0;
-}
-
-int KyraEngine_v1::o1_blockOutWalkableRegion(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_blockOutWalkableRegion(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
- _screen->blockOutRegion(stackPos(0), stackPos(1), stackPos(2)-stackPos(0)+1, stackPos(3)-stackPos(1)+1);
- return 0;
-}
-
-int KyraEngine_v1::o1_walkPlayerToPoint(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_walkPlayerToPoint(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
-
- int normalTimers = stackPos(2);
- if (!normalTimers) {
- _timer->disable(19);
- _timer->disable(14);
- _timer->disable(18);
- }
-
- int reinitScript = handleSceneChange(stackPos(0), stackPos(1), stackPos(2), stackPos(3));
-
- if (!normalTimers) {
- _timer->enable(19);
- _timer->enable(14);
- _timer->enable(18);
- }
-
- if (reinitScript)
- _emc->init(script, script->dataPtr);
-
- if (_sceneChangeState) {
- _sceneChangeState = 0;
- return 1;
- }
- return 0;
-}
-
-int KyraEngine_v1::o1_dropItemInScene(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_dropItemInScene(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
- int item = stackPos(0);
- int xpos = stackPos(1);
- int ypos = stackPos(2);
-
- byte freeItem = findFreeItemInScene(_currentCharacter->sceneId);
- if (freeItem != 0xFF) {
- int sceneId = _currentCharacter->sceneId;
- Room *room = &_roomTable[sceneId];
- room->itemsXPos[freeItem] = xpos;
- room->itemsYPos[freeItem] = ypos;
- room->itemsTable[freeItem] = item;
-
- _animator->animAddGameItem(freeItem, sceneId);
- _animator->updateAllObjectShapes();
- } else {
- if (item == 43)
- placeItemInGenericMapScene(item, 0);
- else
- placeItemInGenericMapScene(item, 1);
- }
- return 0;
-}
-
-int KyraEngine_v1::o1_drawAnimShapeIntoScene(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_drawAnimShapeIntoScene(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
- _screen->hideMouse();
- _animator->restoreAllObjectBackgrounds();
- int shape = stackPos(0);
- int xpos = stackPos(1);
- int ypos = stackPos(2);
- int flags = (stackPos(3) != 0) ? 1 : 0;
- _screen->drawShape(2, _sprites->_sceneShapes[shape], xpos, ypos, 0, flags);
- _screen->drawShape(0, _sprites->_sceneShapes[shape], xpos, ypos, 0, flags);
- _animator->flagAllObjectsForBkgdChange();
- _animator->preserveAnyChangedBackgrounds();
- _animator->flagAllObjectsForRefresh();
- _animator->updateAllObjectShapes();
- _screen->showMouse();
- return 0;
-}
-
-int KyraEngine_v1::o1_createMouseItem(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_createMouseItem(%p) (%d)", (const void *)script, stackPos(0));
- createMouseItem(stackPos(0));
- return 0;
-}
-
-int KyraEngine_v1::o1_savePageToDisk(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_savePageToDisk(%p) ('%s', %d)", (const void *)script, stackPosString(0), stackPos(1));
- _screen->savePageToDisk(stackPosString(0), stackPos(1));
- return 0;
-}
-
-int KyraEngine_v1::o1_sceneAnimOn(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_sceneAnimOn(%p) (%d)", (const void *)script, stackPos(0));
- _sprites->_anims[stackPos(0)].play = true;
- return 0;
-}
-
-int KyraEngine_v1::o1_sceneAnimOff(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_sceneAnimOff(%p) (%d)", (const void *)script, stackPos(0));
- _sprites->_anims[stackPos(0)].play = false;
- return 0;
-}
-
-int KyraEngine_v1::o1_getElapsedSeconds(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_getElapsedSeconds(%p) ()", (const void *)script);
- return _system->getMillis() / 1000;
-}
-
-int KyraEngine_v1::o1_mouseIsPointer(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_mouseIsPointer(%p) ()", (const void *)script);
- if (_itemInHand == -1)
- return 1;
- return 0;
-}
-
-int KyraEngine_v1::o1_destroyMouseItem(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_destroyMouseItem(%p) ()", (const void *)script);
- destroyMouseItem();
- return 0;
-}
-
-int KyraEngine_v1::o1_runSceneAnimUntilDone(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_runSceneAnimUntilDone(%p) (%d)", (const void *)script, stackPos(0));
- _screen->hideMouse();
- _animator->restoreAllObjectBackgrounds();
- _sprites->_anims[stackPos(0)].play = true;
- _animator->sprites()[stackPos(0)].active = 1;
- _animator->flagAllObjectsForBkgdChange();
- _animator->preserveAnyChangedBackgrounds();
- while (_sprites->_anims[stackPos(0)].play) {
- _sprites->updateSceneAnims();
- _animator->updateAllObjectShapes();
- delay(10);
- }
- _animator->restoreAllObjectBackgrounds();
- _screen->showMouse();
- return 0;
-}
-
-int KyraEngine_v1::o1_fadeSpecialPalette(EMCState *script) {
- if (_flags.platform == Common::kPlatformAmiga) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_fadeSpecialPalette(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
- if (_currentCharacter->sceneId != 45) {
- if (stackPos(0) == 13) {
- memcpy(_screen->getPalette(0), _screen->getPalette(0) + 384*3, 32*3);
- _screen->setScreenPalette(_screen->getPalette(0));
- }
- } else {
- warning("KyraEngine_v1::o1_fadeSpecialPalette not implemented");
- }
- } else {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_fadeSpecialPalette(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
- _screen->fadeSpecialPalette(stackPos(0), stackPos(1), stackPos(2), stackPos(3));
- }
- return 0;
-}
-
-int KyraEngine_v1::o1_playAdlibSound(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_playAdlibSound(%p) (%d)", (const void *)script, stackPos(0));
- snd_playSoundEffect(stackPos(0));
- return 0;
-}
-
-int KyraEngine_v1::o1_playAdlibScore(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_playAdlibScore(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- snd_playWanderScoreViaMap(stackPos(0), stackPos(1));
- return 0;
-}
-
-int KyraEngine_v1::o1_phaseInSameScene(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_phaseInSameScene(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- transcendScenes(stackPos(0), stackPos(1));
- return 0;
-}
-
-int KyraEngine_v1::o1_setScenePhasingFlag(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setScenePhasingFlag(%p) ()", (const void *)script);
- _scenePhasingFlag = 1;
- return 1;
-}
-
-int KyraEngine_v1::o1_resetScenePhasingFlag(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_resetScenePhasingFlag(%p) ()", (const void *)script);
- _scenePhasingFlag = 0;
- return 0;
-}
-
-int KyraEngine_v1::o1_queryScenePhasingFlag(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_queryScenePhasingFlag(%p) ()", (const void *)script);
- return _scenePhasingFlag;
-}
-
-int KyraEngine_v1::o1_sceneToDirection(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_sceneToDirection(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- assert(stackPos(0) < _roomTableSize);
- Room *curRoom = &_roomTable[stackPos(0)];
- uint16 returnValue = 0xFFFF;
- switch (stackPos(1)) {
- case 0:
- returnValue = curRoom->northExit;
- break;
-
- case 2:
- returnValue = curRoom->eastExit;
- break;
-
- case 4:
- returnValue = curRoom->southExit;
- break;
-
- case 6:
- returnValue = curRoom->westExit;
- break;
-
- default:
- break;
- }
- if (returnValue == 0xFFFF)
- return -1;
- return returnValue;
-}
-
-int KyraEngine_v1::o1_setBirthstoneGem(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setBirthstoneGem(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- int index = stackPos(0);
- if (index < 4 && index >= 0) {
- _birthstoneGemTable[index] = stackPos(1);
- return 1;
- }
- return 0;
-}
-
-int KyraEngine_v1::o1_placeItemInGenericMapScene(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_placeItemInGenericMapScene(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- placeItemInGenericMapScene(stackPos(0), stackPos(1));
- return 0;
-}
-
-int KyraEngine_v1::o1_setBrandonStatusBit(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setBrandonStatusBit(%p) (%d)", (const void *)script, stackPos(0));
- _brandonStatusBit |= stackPos(0);
- return 0;
-}
-
-int KyraEngine_v1::o1_pauseSeconds(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_pauseSeconds(%p) (%d)", (const void *)script, stackPos(0));
- if (stackPos(0) > 0 && !_skipFlag)
- delay(stackPos(0)*1000, true);
- _skipFlag = false;
- return 0;
-}
-
-int KyraEngine_v1::o1_getCharactersLocation(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_getCharactersLocation(%p) (%d)", (const void *)script, stackPos(0));
- return _characterList[stackPos(0)].sceneId;
-}
-
-int KyraEngine_v1::o1_runNPCSubscript(EMCState *script) {
- warning("STUB: o1_runNPCSubscript");
- return 0;
-}
-
-int KyraEngine_v1::o1_magicOutMouseItem(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_magicOutMouseItem(%p) (%d)", (const void *)script, stackPos(0));
- magicOutMouseItem(stackPos(0), -1);
- return 0;
-}
-
-int KyraEngine_v1::o1_internalAnimOn(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_internalAnimOn(%p) (%d)", (const void *)script, stackPos(0));
- _animator->sprites()[stackPos(0)].active = 1;
- return 0;
-}
-
-int KyraEngine_v1::o1_forceBrandonToNormal(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_forceBrandonToNormal(%p) ()", (const void *)script);
- checkAmuletAnimFlags();
- return 0;
-}
-
-int KyraEngine_v1::o1_poisonDeathNow(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_poisonDeathNow(%p) ()", (const void *)script);
- seq_poisonDeathNow(1);
- return 0;
-}
-
-int KyraEngine_v1::o1_setScaleMode(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setScaleMode(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
- int len = stackPos(0);
- int setValue1 = stackPos(1);
- int start2 = stackPos(2);
- int setValue2 = stackPos(3);
- for (int i = 0; i < len; ++i)
- _scaleTable[i] = setValue1;
- int temp = setValue2 - setValue1;
- int temp2 = start2 - len;
- for (int i = len, offset = 0; i < start2; ++i, ++offset)
- _scaleTable[i] = (offset * temp) / temp2 + setValue1;
- for (int i = start2; i < 145; ++i)
- _scaleTable[i] = setValue2;
- _scaleMode = 1;
- return _scaleMode;
-}
-
-int KyraEngine_v1::o1_openWSAFile(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_openWSAFile(%p) ('%s', %d, %d, %d)", (const void *)script, stackPosString(0), stackPos(1), stackPos(2), stackPos(3));
-
- const char *filename = stackPosString(0);
- int wsaIndex = stackPos(1);
-
- _movieObjects[wsaIndex]->open(filename, (stackPos(3) != 0) ? 1 : 0, 0);
- assert(_movieObjects[wsaIndex]->opened());
-
- return 0;
-}
-
-int KyraEngine_v1::o1_closeWSAFile(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_closeWSAFile(%p) (%d)", (const void *)script, stackPos(0));
-
- int wsaIndex = stackPos(0);
- if (_movieObjects[wsaIndex])
- _movieObjects[wsaIndex]->close();
-
- return 0;
-}
-
-int KyraEngine_v1::o1_runWSAFromBeginningToEnd(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_runWSAFromBeginningToEnd(%p) (%d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
-
- _screen->hideMouse();
-
- bool running = true;
-
- int xpos = stackPos(0);
- int ypos = stackPos(1);
- int waitTime = stackPos(2);
- int wsaIndex = stackPos(3);
- int worldUpdate = stackPos(4);
- int wsaFrame = 0;
-
- _movieObjects[wsaIndex]->setX(xpos);
- _movieObjects[wsaIndex]->setY(ypos);
- _movieObjects[wsaIndex]->setDrawPage(0);
- while (running) {
- _movieObjects[wsaIndex]->displayFrame(wsaFrame++);
- _animator->_updateScreen = true;
- if (wsaFrame >= _movieObjects[wsaIndex]->frames())
- running = false;
-
- uint32 continueTime = waitTime * _tickLength + _system->getMillis();
- while (_system->getMillis() < continueTime) {
- if (worldUpdate) {
- _sprites->updateSceneAnims();
- _animator->updateAllObjectShapes();
- } else {
- _screen->updateScreen();
- }
- if (continueTime - _system->getMillis() >= 10)
- delay(10);
- }
- }
-
- _screen->showMouse();
-
- return 0;
-}
-
-int KyraEngine_v1::o1_displayWSAFrame(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_displayWSAFrame(%p) (%d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
- int frame = stackPos(0);
- int xpos = stackPos(1);
- int ypos = stackPos(2);
- int waitTime = stackPos(3);
- int wsaIndex = stackPos(4);
- _screen->hideMouse();
- _movieObjects[wsaIndex]->setX(xpos);
- _movieObjects[wsaIndex]->setY(ypos);
- _movieObjects[wsaIndex]->setDrawPage(0);
- _movieObjects[wsaIndex]->displayFrame(frame);
- _animator->_updateScreen = true;
- uint32 continueTime = waitTime * _tickLength + _system->getMillis();
- while (_system->getMillis() < continueTime) {
- _sprites->updateSceneAnims();
- _animator->updateAllObjectShapes();
- if (_skipFlag)
- break;
-
- if (continueTime - _system->getMillis() >= 10)
- delay(10);
- }
- _screen->showMouse();
- return 0;
-}
-
-int KyraEngine_v1::o1_enterNewScene(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_enterNewScene(%p) (%d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
- enterNewScene(stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
- return 0;
-}
-
-int KyraEngine_v1::o1_setSpecialEnterXAndY(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setSpecialEnterXAndY(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- _brandonPosX = stackPos(0);
- _brandonPosY = stackPos(1);
- if (_brandonPosX + 1 == 0 && _brandonPosY + 1 == 0)
- _currentCharacter->currentAnimFrame = 88;
- return 0;
-}
-
-int KyraEngine_v1::o1_runWSAFrames(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_runWSAFrames(%p) (%d, %d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5));
- int xpos = stackPos(0);
- int ypos = stackPos(1);
- int delayTime = stackPos(2);
- int startFrame = stackPos(3);
- int endFrame = stackPos(4);
- int wsaIndex = stackPos(5);
- _screen->hideMouse();
- _movieObjects[wsaIndex]->setX(xpos);
- _movieObjects[wsaIndex]->setY(ypos);
- _movieObjects[wsaIndex]->setDrawPage(0);
- for (; startFrame <= endFrame; ++startFrame) {
- uint32 nextRun = _system->getMillis() + delayTime * _tickLength;
- _movieObjects[wsaIndex]->displayFrame(startFrame);
- _animator->_updateScreen = true;
- while (_system->getMillis() < nextRun) {
- _sprites->updateSceneAnims();
- _animator->updateAllObjectShapes();
- if (nextRun - _system->getMillis() >= 10)
- delay(10);
- }
- }
- _screen->showMouse();
- return 0;
-}
-
-int KyraEngine_v1::o1_popBrandonIntoScene(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_popBrandonIntoScene(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
- int changeScaleMode = stackPos(3);
- int xpos = (int16)(stackPos(0) & 0xFFFC);
- int ypos = (int16)(stackPos(1) & 0xFFFE);
- int facing = stackPos(2);
- _currentCharacter->x1 = _currentCharacter->x2 = xpos;
- _currentCharacter->y1 = _currentCharacter->y2 = ypos;
- _currentCharacter->facing = facing;
- _currentCharacter->currentAnimFrame = 7;
- int xOffset = _defaultShapeTable[0].xOffset;
- int yOffset = _defaultShapeTable[0].yOffset;
- int width = _defaultShapeTable[0].w << 3;
- int height = _defaultShapeTable[0].h;
- Animator_v1::AnimObject *curAnim = _animator->actors();
-
- if (changeScaleMode) {
- curAnim->x1 = _currentCharacter->x1;
- curAnim->y1 = _currentCharacter->y1;
- _animator->_brandonScaleY = _scaleTable[_currentCharacter->y1];
- _animator->_brandonScaleX = _animator->_brandonScaleY;
-
- int animWidth = _animator->fetchAnimWidth(curAnim->sceneAnimPtr, _animator->_brandonScaleX) >> 1;
- int animHeight = _animator->fetchAnimHeight(curAnim->sceneAnimPtr, _animator->_brandonScaleY);
-
- animWidth = (xOffset * animWidth) / width;
- animHeight = (yOffset * animHeight) / height;
-
- curAnim->x2 = curAnim->x1 += animWidth;
- curAnim->y2 = curAnim->y1 += animHeight;
- } else {
- curAnim->x2 = curAnim->x1 = _currentCharacter->x1 + xOffset;
- curAnim->y2 = curAnim->y1 = _currentCharacter->y1 + yOffset;
- }
-
- int scaleModeBackup = _scaleMode;
- if (changeScaleMode)
- _scaleMode = 1;
-
- _animator->animRefreshNPC(0);
- _animator->preserveAllBackgrounds();
- _animator->prepDrawAllObjects();
- _animator->copyChangedObjectsForward(0);
-
- _scaleMode = scaleModeBackup;
-
- return 0;
-}
-
-int KyraEngine_v1::o1_restoreAllObjectBackgrounds(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_restoreAllObjectBackgrounds(%p) (%d)", (const void *)script, stackPos(0));
- int disable = stackPos(0);
- int activeBackup = 0;
- if (disable) {
- activeBackup = _animator->actors()->active;
- _animator->actors()->active = 0;
- }
- _animator->restoreAllObjectBackgrounds();
- if (disable)
- _animator->actors()->active = activeBackup;
- return 0;
-}
-
-int KyraEngine_v1::o1_setCustomPaletteRange(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setCustomPaletteRange(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
- memcpy(_screen->getPalette(1) + stackPos(1)*3, _specialPalettes[stackPos(0)], stackPos(2)*3);
- return 0;
-}
-
-int KyraEngine_v1::o1_loadPageFromDisk(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_loadPageFromDisk(%p) ('%s', %d)", (const void *)script, stackPosString(0), stackPos(1));
- _screen->loadPageFromDisk(stackPosString(0), stackPos(1));
- _animator->_updateScreen = true;
- return 0;
-}
-
-int KyraEngine_v1::o1_customPrintTalkString(EMCState *script) {
- if (_flags.isTalkie) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_customPrintTalkString(%p) (%d, '%s', %d, %d, %d)", (const void *)script, stackPos(0), stackPosString(1), stackPos(2), stackPos(3), stackPos(4) & 0xFF);
-
- if (speechEnabled()) {
- snd_voiceWaitForFinish();
- snd_playVoiceFile(stackPos(0));
- }
-
- _skipFlag = false;
- if (textEnabled())
- _text->printTalkTextMessage(stackPosString(1), stackPos(2), stackPos(3), stackPos(4) & 0xFF, 0, 2);
- } else {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_customPrintTalkString(%p) ('%s', %d, %d, %d)", (const void *)script, stackPosString(0), stackPos(1), stackPos(2), stackPos(3) & 0xFF);
- _skipFlag = false;
- _text->printTalkTextMessage(stackPosString(0), stackPos(1), stackPos(2), stackPos(3) & 0xFF, 0, 2);
- }
- _screen->updateScreen();
- return 0;
-}
-
-int KyraEngine_v1::o1_restoreCustomPrintBackground(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_restoreCustomPrintBackground(%p) ()", (const void *)script);
- _text->restoreTalkTextMessageBkgd(2, 0);
- return 0;
+int KyraEngine_v1::o1_getRand(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_getRand(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ assert(stackPos(0) < stackPos(1));
+ return _rnd.getRandomNumberRng(stackPos(0), stackPos(1));
}
int KyraEngine_v1::o1_hideMouse(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_hideMouse(%p) ()", (const void *)script);
- _screen->hideMouse();
+ screen()->hideMouse();
return 0;
}
int KyraEngine_v1::o1_showMouse(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_showMouse(%p) ()", (const void *)script);
- _screen->showMouse();
- return 0;
-}
-
-int KyraEngine_v1::o1_getCharacterX(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_getCharacterX(%p) (%d)", (const void *)script, stackPos(0));
- return _characterList[stackPos(0)].x1;
-}
-
-int KyraEngine_v1::o1_getCharacterY(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_getCharacterY(%p) (%d)", (const void *)script, stackPos(0));
- return _characterList[stackPos(0)].y1;
-}
-
-int KyraEngine_v1::o1_changeCharactersFacing(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_changeCharactersFacing(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
- int character = stackPos(0);
- int facing = stackPos(1);
- int newAnimFrame = stackPos(2);
-
- _animator->restoreAllObjectBackgrounds();
- if (newAnimFrame != -1)
- _characterList[character].currentAnimFrame = newAnimFrame;
- _characterList[character].facing = facing;
- _animator->animRefreshNPC(character);
- _animator->preserveAllBackgrounds();
- _animator->prepDrawAllObjects();
- _animator->copyChangedObjectsForward(0);
-
- return 0;
-}
-
-int KyraEngine_v1::o1_copyWSARegion(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_copyWSARegion(%p) (%d, %d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5));
- int xpos = stackPos(0);
- int ypos = stackPos(1);
- int width = stackPos(2);
- int height = stackPos(3);
- int srcPage = stackPos(4);
- int dstPage = stackPos(5);
- _screen->copyRegion(xpos, ypos, xpos, ypos, width, height, srcPage, dstPage);
- _animator->_updateScreen = true;
- return 0;
-}
-
-int KyraEngine_v1::o1_printText(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_printText(%p) ('%s', %d, %d, 0x%X, 0x%X)", (const void *)script, stackPosString(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
- if (_flags.lang == Common::JA_JPN && stackPos(3) == 7)
- _screen->printText(stackPosString(0), stackPos(1), stackPos(2), 0, 0x80);
- else
- _screen->printText(stackPosString(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
- _screen->updateScreen();
- return 0;
-}
-
-int KyraEngine_v1::o1_random(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_random(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- assert(stackPos(0) < stackPos(1));
- return _rnd.getRandomNumberRng(stackPos(0), stackPos(1));
-}
-
-int KyraEngine_v1::o1_loadSoundFile(EMCState *script) {
- warning("STUB: o1_loadSoundFile");
- return 0;
-}
-
-int KyraEngine_v1::o1_displayWSAFrameOnHidPage(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_displayWSAFrameOnHidPage(%p) (%d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
- int frame = stackPos(0);
- int xpos = stackPos(1);
- int ypos = stackPos(2);
- int waitTime = stackPos(3);
- int wsaIndex = stackPos(4);
-
- _screen->hideMouse();
- uint32 continueTime = waitTime * _tickLength + _system->getMillis();
- _movieObjects[wsaIndex]->setX(xpos);
- _movieObjects[wsaIndex]->setY(ypos);
- _movieObjects[wsaIndex]->setDrawPage(2);
- _movieObjects[wsaIndex]->displayFrame(frame);
- _animator->_updateScreen = true;
- while (_system->getMillis() < continueTime) {
- _sprites->updateSceneAnims();
- _animator->updateAllObjectShapes();
- if (_skipFlag)
- break;
-
- if (continueTime - _system->getMillis() >= 10)
- delay(10);
- }
- _screen->showMouse();
-
- return 0;
-}
-
-int KyraEngine_v1::o1_displayWSASequentialFrames(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_displayWSASequentialFrames(%p) (%d, %d, %d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5), stackPos(6));
- int startFrame = stackPos(0);
- int endFrame = stackPos(1);
- int xpos = stackPos(2);
- int ypos = stackPos(3);
- int waitTime = stackPos(4);
- int wsaIndex = stackPos(5);
- int maxTime = stackPos(6);
- if (maxTime - 1 <= 0)
- maxTime = 1;
-
- _movieObjects[wsaIndex]->setX(xpos);
- _movieObjects[wsaIndex]->setY(ypos);
- _movieObjects[wsaIndex]->setDrawPage(0);
-
- // Workaround for bug #1498221 "KYRA1: Glitches when meeting Zanthia"
- // the original didn't do a forced screen update after displaying a wsa frame
- // while we have to do it, which make brandon disappear for a short moment,
- // what shouldn't happen. So we're not updating the screen for this special
- // case too.
- if (startFrame == 18 && endFrame == 18 && _currentRoom == 45) {
- _movieObjects[wsaIndex]->displayFrame(18);
- delay(waitTime * _tickLength);
- return 0;
- }
-
- int curTime = 0;
- _screen->hideMouse();
- while (curTime < maxTime) {
- if (endFrame >= startFrame) {
- int frame = startFrame;
- while (endFrame >= frame) {
- uint32 continueTime = waitTime * _tickLength + _system->getMillis();
- _movieObjects[wsaIndex]->displayFrame(frame);
- _animator->_updateScreen = true;
- while (_system->getMillis() < continueTime) {
- _sprites->updateSceneAnims();
- _animator->updateAllObjectShapes();
- if (_skipFlag)
- break;
-
- if (continueTime - _system->getMillis() >= 10)
- delay(10);
- }
- ++frame;
- }
- } else {
- int frame = startFrame;
- while (endFrame <= frame) {
- uint32 continueTime = waitTime * _tickLength + _system->getMillis();
- _movieObjects[wsaIndex]->displayFrame(frame);
- _animator->_updateScreen = true;
- while (_system->getMillis() < continueTime) {
- _sprites->updateSceneAnims();
- _animator->updateAllObjectShapes();
- if (_skipFlag)
- break;
-
- if (continueTime - _system->getMillis() >= 10)
- delay(10);
- }
- --frame;
- }
- }
-
- if (_skipFlag)
- break;
- else
- ++curTime;
- }
- _screen->showMouse();
-
- return 0;
-}
-
-int KyraEngine_v1::o1_drawCharacterStanding(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_drawCharacterStanding(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
- int character = stackPos(0);
- int animFrame = stackPos(1);
- int newFacing = stackPos(2);
- int updateShapes = stackPos(3);
- _characterList[character].currentAnimFrame = animFrame;
- if (newFacing != -1)
- _characterList[character].facing = newFacing;
- _animator->animRefreshNPC(character);
- if (updateShapes)
- _animator->updateAllObjectShapes();
- return 0;
-}
-
-int KyraEngine_v1::o1_internalAnimOff(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_internalAnimOff(%p) (%d)", (const void *)script, stackPos(0));
- _animator->sprites()[stackPos(0)].active = 0;
- return 0;
-}
-
-int KyraEngine_v1::o1_changeCharactersXAndY(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_changeCharactersXAndY(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
- Character *ch = &_characterList[stackPos(0)];
- int16 x = stackPos(1);
- int16 y = stackPos(2);
- if (x != -1 && y != -1) {
- x &= 0xFFFC;
- y &= 0xFFFE;
- }
- _animator->restoreAllObjectBackgrounds();
- ch->x1 = ch->x2 = x;
- ch->y1 = ch->y2 = y;
- _animator->preserveAllBackgrounds();
- return 0;
-}
-
-int KyraEngine_v1::o1_clearSceneAnimatorBeacon(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_clearSceneAnimatorBeacon(%p) ()", (const void *)script);
- _sprites->_sceneAnimatorBeaconFlag = 0;
- return 0;
-}
-
-int KyraEngine_v1::o1_querySceneAnimatorBeacon(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_querySceneAnimatorBeacon(%p) ()", (const void *)script);
- return _sprites->_sceneAnimatorBeaconFlag;
-}
-
-int KyraEngine_v1::o1_refreshSceneAnimator(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_refreshSceneAnimator(%p) ()", (const void *)script);
- _sprites->updateSceneAnims();
- _animator->updateAllObjectShapes();
- return 0;
-}
-
-int KyraEngine_v1::o1_placeItemInOffScene(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_placeItemInOffScene(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
- int item = stackPos(0);
- int xpos = stackPos(1);
- int ypos = stackPos(2);
- int sceneId = stackPos(3);
-
- byte freeItem = findFreeItemInScene(sceneId);
- if (freeItem != 0xFF) {
- assert(sceneId < _roomTableSize);
- Room *room = &_roomTable[sceneId];
-
- room->itemsTable[freeItem] = item;
- room->itemsXPos[freeItem] = xpos;
- room->itemsYPos[freeItem] = ypos;
- }
- return 0;
-}
-
-int KyraEngine_v1::o1_wipeDownMouseItem(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_wipeDownMouseItem(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
- _screen->hideMouse();
- wipeDownMouseItem(stackPos(1), stackPos(2));
- destroyMouseItem();
- _screen->showMouse();
- return 0;
-}
-
-int KyraEngine_v1::o1_placeCharacterInOtherScene(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_placeCharacterInOtherScene(%p) (%d, %d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5));
- int id = stackPos(0);
- int sceneId = stackPos(1);
- int xpos = (int16)(stackPos(2) & 0xFFFC);
- int ypos = (int16)(stackPos(3) & 0xFFFE);
- int facing = stackPos(4);
- int animFrame = stackPos(5);
-
- _characterList[id].sceneId = sceneId;
- _characterList[id].x1 = _characterList[id].x2 = xpos;
- _characterList[id].y1 = _characterList[id].y2 = ypos;
- _characterList[id].facing = facing;
- _characterList[id].currentAnimFrame = animFrame;
- return 0;
-}
-
-int KyraEngine_v1::o1_getKey(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_getKey(%p) ()", (const void *)script);
- waitForEvent();
- return 0;
-}
-
-int KyraEngine_v1::o1_specificItemInInventory(EMCState *script) {
- warning("STUB: o1_specificItemInInventory");
- return 0;
-}
-
-int KyraEngine_v1::o1_popMobileNPCIntoScene(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_popMobileNPCIntoScene(%p) (%d, %d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), (int16)(stackPos(4) & 0xFFFC), (int8)(stackPos(5) & 0xFE));
- int character = stackPos(0);
- int sceneId = stackPos(1);
- int animFrame = stackPos(2);
- int facing = stackPos(3);
- int16 xpos = (int16)(stackPos(4) & 0xFFFC);
- int8 ypos = (int16)(stackPos(5) & 0xFFFE);
- Character *curChar = &_characterList[character];
-
- curChar->sceneId = sceneId;
- curChar->currentAnimFrame = animFrame;
- curChar->facing = facing;
- curChar->x1 = curChar->x2 = xpos;
- curChar->y1 = curChar->y2 = ypos;
-
- _animator->animAddNPC(character);
- _animator->updateAllObjectShapes();
- return 0;
-}
-
-int KyraEngine_v1::o1_mobileCharacterInScene(EMCState *script) {
- warning("STUB: o1_mobileCharacterInScene");
- return 0;
-}
-
-int KyraEngine_v1::o1_hideMobileCharacter(EMCState *script) {
- warning("STUB: o1_hideMobileCharacter");
- return 0;
-}
-
-int KyraEngine_v1::o1_unhideMobileCharacter(EMCState *script) {
- warning("STUB: o1_unhideMobileCharacter");
- return 0;
-}
-
-int KyraEngine_v1::o1_setCharactersLocation(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setCharactersLocation(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- Character *ch = &_characterList[stackPos(0)];
- Animator_v1::AnimObject *animObj = &_animator->actors()[stackPos(0)];
- int newScene = stackPos(1);
- if (_currentCharacter->sceneId == ch->sceneId) {
- if (_currentCharacter->sceneId != newScene)
- animObj->active = 0;
- } else if (_currentCharacter->sceneId == newScene) {
- if (_currentCharacter->sceneId != ch->sceneId)
- animObj->active = 1;
- }
-
- ch->sceneId = stackPos(1);
- return 0;
-}
-
-int KyraEngine_v1::o1_walkCharacterToPoint(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_walkCharacterToPoint(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
- int character = stackPos(0);
- int toX = stackPos(1);
- int toY = stackPos(2);
- _pathfinderFlag2 = 1;
- uint32 nextFrame;
- int findWayReturn = findWay(_characterList[character].x1, _characterList[character].y1, toX, toY, _movFacingTable, 150);
- _pathfinderFlag2 = 0;
-
- if (_lastFindWayRet < findWayReturn)
- _lastFindWayRet = findWayReturn;
- if (findWayReturn == 0x7D00 || findWayReturn == 0)
- return 0;
-
- int *curPos = _movFacingTable;
- bool running = true;
- while (running) {
- bool forceContinue = false;
- switch (*curPos) {
- case 0:
- _characterList[character].facing = 2;
- break;
-
- case 1:
- _characterList[character].facing = 1;
- break;
-
- case 2:
- _characterList[character].facing = 0;
- break;
-
- case 3:
- _characterList[character].facing = 7;
- break;
-
- case 4:
- _characterList[character].facing = 6;
- break;
-
- case 5:
- _characterList[character].facing = 5;
- break;
-
- case 6:
- _characterList[character].facing = 4;
- break;
-
- case 7:
- _characterList[character].facing = 3;
- break;
-
- case 8:
- running = 0;
- break;
-
- default:
- ++curPos;
- forceContinue = true;
- break;
- }
-
- if (forceContinue || !running)
- continue;
-
- setCharacterPosition(character, 0);
- ++curPos;
-
- nextFrame = _timer->getDelay(5 + character) * _tickLength + _system->getMillis();
- while (_system->getMillis() < nextFrame) {
- _sprites->updateSceneAnims();
- updateMousePointer();
- _timer->update();
- _animator->updateAllObjectShapes();
- updateTextFade();
- if ((nextFrame - _system->getMillis()) >= 10)
- delay(10);
- }
- }
- return 0;
-}
-
-int KyraEngine_v1::o1_specialEventDisplayBrynnsNote(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_specialEventDisplayBrynnsNote(%p) ()", (const void *)script);
- _screen->hideMouse();
- _screen->savePageToDisk("HIDPAGE.TMP", 2);
- _screen->savePageToDisk("SEENPAGE.TMP", 0);
- if (_flags.isTalkie) {
- if (_flags.lang == Common::EN_ANY || _flags.lang == Common::IT_ITA)
- _screen->loadBitmap("NOTEENG.CPS", 3, 3, 0);
- else if (_flags.lang == Common::FR_FRA)
- _screen->loadBitmap("NOTEFRE.CPS", 3, 3, 0);
- else if (_flags.lang == Common::DE_DEU)
- _screen->loadBitmap("NOTEGER.CPS", 3, 3, 0);
- } else {
- _screen->loadBitmap("NOTE.CPS", 3, 3, 0);
- }
- _screen->copyRegion(63, 8, 63, 8, 194, 128, 2, 0);
- _screen->updateScreen();
- _screen->showMouse();
- _screen->setFont(Screen::FID_6_FNT);
- return 0;
-}
-
-int KyraEngine_v1::o1_specialEventRemoveBrynnsNote(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_specialEventRemoveBrynnsNote(%p) ()", (const void *)script);
- _screen->hideMouse();
- _screen->loadPageFromDisk("SEENPAGE.TMP", 0);
- _screen->loadPageFromDisk("HIDPAGE.TMP", 2);
- _screen->updateScreen();
- _screen->showMouse();
- _screen->setFont(Screen::FID_8_FNT);
- return 0;
-}
-
-int KyraEngine_v1::o1_setLogicPage(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setLogicPage(%p) (%d)", (const void *)script, stackPos(0));
- _screen->_curPage = stackPos(0);
- return stackPos(0);
-}
-
-int KyraEngine_v1::o1_fatPrint(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_fatPrint(%p) ('%s', %d, %d, %d, %d, %d)", (const void *)script, stackPosString(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5));
-
- // Workaround for bug #1582672 ("KYRA1: Text crippled and drawn wrong")
- // I'm not sure how the original handles this, since it seems to call
- // printText also, maybe it fails somewhere inside...
- // TODO: fix the reason for this workaround
- if (_currentRoom == 117)
- return 0;
- _text->printText(stackPosString(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5));
- return 0;
-}
-
-int KyraEngine_v1::o1_preserveAllObjectBackgrounds(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_preserveAllObjectBackgrounds(%p) ()", (const void *)script);
- _animator->preserveAllBackgrounds();
- return 0;
-}
-
-int KyraEngine_v1::o1_updateSceneAnimations(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_updateSceneAnimations(%p) (%d)", (const void *)script, stackPos(0));
- int times = stackPos(0);
- while (times--) {
- _sprites->updateSceneAnims();
- _animator->updateAllObjectShapes();
- }
- return 0;
-}
-
-int KyraEngine_v1::o1_sceneAnimationActive(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_sceneAnimationActive(%p) (%d)", (const void *)script, stackPos(0));
- return _sprites->_anims[stackPos(0)].play;
-}
-
-int KyraEngine_v1::o1_setCharactersMovementDelay(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setCharactersMovementDelay(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- _timer->setDelay(stackPos(0)+5, stackPos(1));
- return 0;
-}
-
-int KyraEngine_v1::o1_getCharactersFacing(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_getCharactersFacing(%p) (%d)", (const void *)script, stackPos(0));
- return _characterList[stackPos(0)].facing;
-}
-
-int KyraEngine_v1::o1_bkgdScrollSceneAndMasksRight(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_bkgdScrollSceneAndMasksRight(%p) (%d)", (const void *)script, stackPos(0));
- _screen->copyBackgroundBlock(stackPos(0), 2, 0);
- _screen->copyBackgroundBlock2(stackPos(0));
- // update the whole screen
- _screen->copyRegion(7, 7, 7, 7, 305, 129, 3, 0);
- // Don't do a screen update here, see bug #1910180 "KYRA1: Screen 'flash'"
- // it would cause to draw the screen with a wrong palette and thus look
- // strange for the user. Since this opcode should be just called on scene
- // initialization anyway, there should be no problem with not updating the
- // screen right now.
- return 0;
-}
-
-int KyraEngine_v1::o1_dispelMagicAnimation(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_dispelMagicAnimation(%p) ()", (const void *)script);
- seq_dispelMagicAnimation();
- return 0;
-}
-
-int KyraEngine_v1::o1_findBrightestFireberry(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_findBrightestFireberry(%p) ()", (const void *)script);
- if (_currentCharacter->sceneId >= 187 && _currentCharacter->sceneId <= 198)
- return 29;
-
- if (_currentCharacter->sceneId == 133 || _currentCharacter->sceneId == 137 ||
- _currentCharacter->sceneId == 165 || _currentCharacter->sceneId == 173)
- return 29;
-
- if (_itemInHand == 28)
- return 28;
-
- int brightestFireberry = 107;
- if (_itemInHand >= 29 && _itemInHand <= 33)
- brightestFireberry = _itemInHand;
- for (int i = 0; i < 10; ++i) {
- uint8 item = _currentCharacter->inventoryItems[i];
- if (item == 0xFF)
- continue;
- if (item == 28)
- return 28;
- if (item >= 29 && item <= 33) {
- if (item < brightestFireberry)
- brightestFireberry = item;
- }
- }
- assert(_currentCharacter->sceneId < _roomTableSize);
- Room *curRoom = &_roomTable[_currentCharacter->sceneId];
- for (int i = 0; i < 12; ++i) {
- uint8 item = curRoom->itemsTable[i];
- if (item == 0xFF)
- continue;
- if (item == 28)
- return 28;
- if (item >= 29 && item <= 33) {
- if (item < brightestFireberry)
- brightestFireberry = item;
- }
- }
- if (brightestFireberry == 107)
- return -1;
- return brightestFireberry;
-}
-
-int KyraEngine_v1::o1_setFireberryGlowPalette(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setFireberryGlowPalette(%p) (%d)", (const void *)script, stackPos(0));
- int palIndex = 0;
- switch (stackPos(0)) {
- case 0x1E:
- palIndex = 9;
- break;
-
- case 0x1F:
- palIndex = 10;
- break;
-
- case 0x20:
- palIndex = 11;
- break;
-
- case 0x21:
- case -1:
- palIndex = 12;
- break;
-
- default:
- palIndex = 8;
- break;
- }
- if (_brandonStatusBit & 2) {
- if (_currentCharacter->sceneId != 133 && _currentCharacter->sceneId != 137 &&
- _currentCharacter->sceneId != 165 && _currentCharacter->sceneId != 173 &&
- (_currentCharacter->sceneId < 187 || _currentCharacter->sceneId > 198)) {
- palIndex = 14;
- }
- }
- const uint8 *palette = _specialPalettes[palIndex];
- memcpy(_screen->getPalette(1) + 684, palette, 44);
- return 0;
-}
-
-int KyraEngine_v1::o1_setDeathHandlerFlag(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setDeathHandlerFlag(%p) (%d)", (const void *)script, stackPos(0));
- _deathHandler = stackPos(0);
- return 0;
-}
-
-int KyraEngine_v1::o1_drinkPotionAnimation(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_drinkPotionAnimation(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
- seq_playDrinkPotionAnim(stackPos(0), stackPos(1), stackPos(2));
- return 0;
-}
-
-int KyraEngine_v1::o1_makeAmuletAppear(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_makeAmuletAppear(%p) ()", (const void *)script);
- WSAMovieV1 amulet(this);
- amulet.open("AMULET.WSA", 1, 0);
- amulet.setX(224);
- amulet.setY(152);
- amulet.setDrawPage(0);
- if (amulet.opened()) {
- assert(_amuleteAnim);
- _screen->hideMouse();
- snd_playSoundEffect(0x70);
- uint32 nextTime = 0;
- for (int i = 0; _amuleteAnim[i] != 0xFF; ++i) {
- nextTime = _system->getMillis() + 5 * _tickLength;
-
- uint8 code = _amuleteAnim[i];
- if (code == 3 || code == 7)
- snd_playSoundEffect(0x71);
-
- if (code == 5)
- snd_playSoundEffect(0x72);
-
- if (code == 14)
- snd_playSoundEffect(0x73);
-
- amulet.displayFrame(code);
- _animator->_updateScreen = true;
-
- while (_system->getMillis() < nextTime) {
- _sprites->updateSceneAnims();
- _animator->updateAllObjectShapes();
- if (nextTime - _system->getMillis() >= 10)
- delay(10);
- }
- }
- _screen->showMouse();
- }
- setGameFlag(0x2D);
- return 0;
-}
-
-int KyraEngine_v1::o1_drawItemShapeIntoScene(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_drawItemShapeIntoScene(%p) (%d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
- int item = stackPos(0);
- int x = stackPos(1);
- int y = stackPos(2);
- int flags = stackPos(3);
- int onlyHidPage = stackPos(4);
-
- if (flags)
- flags = 1;
-
- if (onlyHidPage) {
- _screen->drawShape(2, _shapes[216+item], x, y, 0, flags);
- } else {
- _screen->hideMouse();
- _animator->restoreAllObjectBackgrounds();
- _screen->drawShape(2, _shapes[216+item], x, y, 0, flags);
- _screen->drawShape(0, _shapes[216+item], x, y, 0, flags);
- _animator->flagAllObjectsForBkgdChange();
- _animator->preserveAnyChangedBackgrounds();
- _animator->flagAllObjectsForRefresh();
- _animator->updateAllObjectShapes();
- _screen->showMouse();
- }
- return 0;
-}
-
-int KyraEngine_v1::o1_setCharactersCurrentFrame(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setCharactersCurrentFrame(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- _characterList[stackPos(0)].currentAnimFrame = stackPos(1);
- return 0;
-}
-
-int KyraEngine_v1::o1_waitForConfirmationMouseClick(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_waitForConfirmationMouseClick(%p) ()", (const void *)script);
- // if (mouseEnabled) {
- while (!_mousePressFlag) {
- updateMousePointer();
- _sprites->updateSceneAnims();
- _animator->updateAllObjectShapes();
- delay(10);
- }
-
- while (_mousePressFlag) {
- updateMousePointer();
- _sprites->updateSceneAnims();
- _animator->updateAllObjectShapes();
- delay(10);
- }
- // }
- _gui->processButtonList(_buttonList, 0);
- _skipFlag = false;
- Common::Point mouse = getMousePos();
- script->regs[1] = mouse.x;
- script->regs[2] = mouse.y;
- return 0;
-}
-
-int KyraEngine_v1::o1_pageFlip(EMCState *script) {
- warning("STUB: o1_pageFlip");
- return 0;
-}
-
-int KyraEngine_v1::o1_setSceneFile(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setSceneFile(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- setSceneFile(stackPos(0), stackPos(1));
- return 0;
-}
-
-int KyraEngine_v1::o1_getItemInMarbleVase(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_getItemInMarbleVase(%p) ()", (const void *)script);
- return _marbleVaseItem;
-}
-
-int KyraEngine_v1::o1_setItemInMarbleVase(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setItemInMarbleVase(%p) (%d)", (const void *)script, stackPos(0));
- _marbleVaseItem = stackPos(0);
- return 0;
-}
-
-int KyraEngine_v1::o1_addItemToInventory(EMCState *script) {
- warning("STUB: o1_addItemToInventory");
- return 0;
-}
-
-int KyraEngine_v1::o1_intPrint(EMCState *script) {
- warning("STUB: o1_intPrint");
- return 0;
-}
-
-int KyraEngine_v1::o1_shakeScreen(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_shakeScreen(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- int waitTicks = stackPos(1);
- int times = stackPos(0);
-
- for (int i = 0; i < times; ++i) {
- _screen->shakeScreen(1);
- delay(waitTicks * _tickLength);
- }
-
- return 0;
-}
-
-int KyraEngine_v1::o1_createAmuletJewel(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_createAmuletJewel(%p) (%d)", (const void *)script, stackPos(0));
- seq_createAmuletJewel(stackPos(0), 0, 0, 0);
- return 0;
-}
-
-int KyraEngine_v1::o1_setSceneAnimCurrXY(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setSceneAnimCurrXY(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
- _sprites->_anims[stackPos(0)].x = stackPos(1);
- _sprites->_anims[stackPos(0)].y = stackPos(2);
- return 0;
-}
-
-int KyraEngine_v1::o1_poisonBrandonAndRemaps(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_poisonBrandonAndRemaps(%p) ()", (const void *)script);
- setBrandonPoisonFlags(1);
- return 0;
-}
-
-int KyraEngine_v1::o1_fillFlaskWithWater(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_fillFlaskWithWater(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- seq_fillFlaskWithWater(stackPos(0), stackPos(1));
- return 0;
-}
-
-int KyraEngine_v1::o1_getCharactersMovementDelay(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_getCharactersMovementDelay(%p) (%d)", (const void *)script, stackPos(0));
- return _timer->getDelay(stackPos(0)+5);
-}
-
-int KyraEngine_v1::o1_getBirthstoneGem(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_getBirthstoneGem(%p) (%d)", (const void *)script, stackPos(0));
- if (stackPos(0) < 4)
- return _birthstoneGemTable[stackPos(0)];
- return 0;
-}
-
-int KyraEngine_v1::o1_queryBrandonStatusBit(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_queryBrandonStatusBit(%p) (%d)", (const void *)script, stackPos(0));
- if (_brandonStatusBit & stackPos(0))
- return 1;
- return 0;
-}
-
-int KyraEngine_v1::o1_playFluteAnimation(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_playFluteAnimation(%p) ()", (const void *)script);
- seq_playFluteAnimation();
- return 0;
-}
-
-int KyraEngine_v1::o1_playWinterScrollSequence(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_playWinterScrollSequence(%p) (%d)", (const void *)script, stackPos(0));
- if (!stackPos(0))
- seq_winterScroll2();
- else
- seq_winterScroll1();
- return 0;
-}
-
-int KyraEngine_v1::o1_getIdolGem(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_getIdolGem(%p) (%d)", (const void *)script, stackPos(0));
- return _idolGemsTable[stackPos(0)];
-}
-
-int KyraEngine_v1::o1_setIdolGem(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setIdolGem(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- _idolGemsTable[stackPos(0)] = stackPos(1);
- return 0;
-}
-
-int KyraEngine_v1::o1_totalItemsInScene(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_totalItemsInScene(%p) (%d)", (const void *)script, stackPos(0));
- return countItemsInScene(stackPos(0));
-}
-
-int KyraEngine_v1::o1_restoreBrandonsMovementDelay(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_restoreBrandonsMovementDelay(%p) ()", (const void *)script);
- setWalkspeed(_configWalkspeed);
+ screen()->showMouse();
return 0;
}
@@ -1518,514 +67,58 @@ int KyraEngine_v1::o1_setMousePos(EMCState *script) {
return 0;
}
-int KyraEngine_v1::o1_getMouseState(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_getMouseState(%p) ()", (const void *)script);
- return _mouseState;
-}
-
-int KyraEngine_v1::o1_setEntranceMouseCursorTrack(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setEntranceMouseCursorTrack(%p) (%d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
- _entranceMouseCursorTracks[0] = stackPos(0);
- _entranceMouseCursorTracks[1] = stackPos(1);
- _entranceMouseCursorTracks[2] = stackPos(0) + stackPos(2) - 1;
- _entranceMouseCursorTracks[3] = stackPos(1) + stackPos(3) - 1;
- _entranceMouseCursorTracks[4] = stackPos(4);
- return 0;
-}
-
-int KyraEngine_v1::o1_itemAppearsOnGround(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_itemAppearsOnGround(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
- processItemDrop(_currentCharacter->sceneId, stackPos(0), stackPos(1), stackPos(2), 2, 0);
- return 0;
-}
-
-int KyraEngine_v1::o1_setNoDrawShapesFlag(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setNoDrawShapesFlag(%p) (%d)", (const void *)script, stackPos(0));
- _animator->_noDrawShapesFlag = stackPos(0);
- return 0;
-}
-
-int KyraEngine_v1::o1_fadeEntirePalette(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_fadeEntirePalette(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- int cmd = stackPos(0);
- uint8 *fadePal = 0;
-
- if (_flags.platform == Common::kPlatformAmiga) {
- if (cmd == 0) {
- fadePal = _screen->getPalette(2);
- memset(fadePal, 0, 32*3);
- memcpy(_screen->getPalette(4), _screen->getPalette(0), 32*3);
- } else if (cmd == 1) {
- fadePal = _screen->getPalette(0);
- memcpy(_screen->getPalette(0), _screen->getPalette(4), 32*3);
- } else if (cmd == 2) {
- fadePal = _screen->getPalette(0);
- memset(_screen->getPalette(2), 0, 32*3);
- }
- } else {
- if (cmd == 0) {
- fadePal = _screen->getPalette(2);
- uint8 *screenPal = _screen->getPalette(0);
- uint8 *backUpPal = _screen->getPalette(3);
-
- memcpy(backUpPal, screenPal, sizeof(uint8)*768);
- memset(fadePal, 0, sizeof(uint8)*768);
- } else if (cmd == 1) {
- //fadePal = _screen->getPalette(3);
- warning("unimplemented o1_fadeEntirePalette function");
- return 0;
- } else if (cmd == 2) {
- memset(_screen->getPalette(2), 0, 768);
- memcpy(_screen->getPalette(0), _screen->getPalette(1), 768);
- fadePal = _screen->getPalette(0);
- }
- }
-
- _screen->fadePalette(fadePal, stackPos(1));
- return 0;
-}
-
-int KyraEngine_v1::o1_itemOnGroundHere(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_itemOnGroundHere(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- assert(stackPos(0) < _roomTableSize);
- Room *curRoom = &_roomTable[stackPos(0)];
- for (int i = 0; i < 12; ++i) {
- if (curRoom->itemsTable[i] == stackPos(1))
- return 1;
- }
- return 0;
-}
-
-int KyraEngine_v1::o1_queryCauldronState(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_queryCauldronState(%p) ()", (const void *)script);
- return _cauldronState;
-}
-
-int KyraEngine_v1::o1_setCauldronState(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setCauldronState(%p) (%d)", (const void *)script, stackPos(0));
- _cauldronState = stackPos(0);
- return _cauldronState;
-}
-
-int KyraEngine_v1::o1_queryCrystalState(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_queryCrystalState(%p) (%d)", (const void *)script, stackPos(0));
- if (!stackPos(0))
- return _crystalState[0];
- else if (stackPos(0) == 1)
- return _crystalState[1];
- return -1;
-}
-
-int KyraEngine_v1::o1_setCrystalState(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setCrystalState(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- if (!stackPos(0))
- _crystalState[0] = stackPos(1);
- else if (stackPos(0) == 1)
- _crystalState[1] = stackPos(1);
- return stackPos(1);
-}
-
-int KyraEngine_v1::o1_setPaletteRange(EMCState *script) {
- warning("STUB: o1_setPaletteRange");
- return 0;
-}
-
-int KyraEngine_v1::o1_shrinkBrandonDown(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_shrinkBrandonDown(%p) (%d)", (const void *)script, stackPos(0));
- int delayTime = stackPos(0);
- checkAmuletAnimFlags();
- int scaleValue = _scaleTable[_currentCharacter->y1];
- int scale = 0;
-
- if (_scaleMode)
- scale = scaleValue;
- else
- scale = 256;
-
- int scaleModeBackUp = _scaleMode;
- _scaleMode = 1;
- int scaleEnd = scale >> 1;
- for (; scaleEnd <= scale; --scale) {
- _scaleTable[_currentCharacter->y1] = scale;
- _animator->animRefreshNPC(0);
- delayWithTicks(1);
- }
- delayWithTicks(delayTime); // XXX
- _scaleTable[_currentCharacter->y1] = scaleValue;
- _scaleMode = scaleModeBackUp;
- return 0;
-}
-
-int KyraEngine_v1::o1_growBrandonUp(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_growBrandonUp(%p) ()", (const void *)script);
- int scaleValue = _scaleTable[_currentCharacter->y1];
- int scale = 0;
- if (_scaleMode)
- scale = scaleValue;
- else
- scale = 256;
-
- int scaleModeBackUp = _scaleMode;
- _scaleMode = 1;
- for (int curScale = scale >> 1; curScale <= scale; ++curScale) {
- _scaleTable[_currentCharacter->y1] = curScale;
- _animator->animRefreshNPC(0);
- delayWithTicks(1);
- }
- _scaleTable[_currentCharacter->y1] = scaleValue;
- _scaleMode = scaleModeBackUp;
+int KyraEngine_v1::o1_setHandItem(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setHandItem(%p) (%d)", (const void *)script, stackPos(0));
+ setHandItem(stackPos(0));
return 0;
}
-int KyraEngine_v1::o1_setBrandonScaleXAndY(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setBrandonScaleXAndY(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- _animator->_brandonScaleX = stackPos(0);
- _animator->_brandonScaleY = stackPos(1);
+int KyraEngine_v1::o1_removeHandItem(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_removeHandItem(%p) ()", (const void *)script);
+ removeHandItem();
return 0;
}
-int KyraEngine_v1::o1_resetScaleMode(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_resetScaleMode(%p) ()", (const void *)script);
- _scaleMode = 0;
- return 0;
-}
-
-int KyraEngine_v1::o1_getScaleDepthTableValue(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_getScaleDepthTableValue(%p) (%d)", (const void *)script, stackPos(0));
- assert(stackPos(0) < ARRAYSIZE(_scaleTable));
- return _scaleTable[stackPos(0)];
-}
-
-int KyraEngine_v1::o1_setScaleDepthTableValue(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setScaleDepthTableValue(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- assert(stackPos(0) < ARRAYSIZE(_scaleTable));
- _scaleTable[stackPos(0)] = stackPos(1);
- return stackPos(1);
-}
-
-int KyraEngine_v1::o1_message(EMCState *script) {
- if (_flags.isTalkie) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_message(%p) (%d, '%s', %d)", (const void *)script, stackPos(0), stackPosString(1), stackPos(2));
- drawSentenceCommand(stackPosString(1), stackPos(2));
- } else {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_message(%p) ('%s', %d)", (const void *)script, stackPosString(0), stackPos(1));
- drawSentenceCommand(stackPosString(0), stackPos(1));
- }
-
- return 0;
-}
-
-int KyraEngine_v1::o1_checkClickOnNPC(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_checkClickOnNPC(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- return checkForNPCScriptRun(stackPos(0), stackPos(1));
-}
-
-int KyraEngine_v1::o1_getFoyerItem(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_getFoyerItem(%p) (%d)", (const void *)script, stackPos(0));
- assert(stackPos(0) < ARRAYSIZE(_foyerItemTable));
- return _foyerItemTable[stackPos(0)];
-}
-
-int KyraEngine_v1::o1_setFoyerItem(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setFoyerItem(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- assert(stackPos(0) < ARRAYSIZE(_foyerItemTable));
- _foyerItemTable[stackPos(0)] = stackPos(1);
- return stackPos(1);
-}
-
-int KyraEngine_v1::o1_setNoItemDropRegion(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setNoItemDropRegion(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
- addToNoDropRects(stackPos(0), stackPos(1), stackPos(2), stackPos(3));
- return 0;
-}
-
-int KyraEngine_v1::o1_walkMalcolmOn(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_walkMalcolmOn(%p) ()", (const void *)script);
- if (!_malcolmFlag)
- _malcolmFlag = 1;
- return 0;
-}
-
-int KyraEngine_v1::o1_passiveProtection(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_passiveProtection(%p) ()", (const void *)script);
- return 1;
-}
-
-int KyraEngine_v1::o1_setPlayingLoop(EMCState *script) {
- warning("STUB: o1_setPlayingLoop");
- return 0;
-}
-
-int KyraEngine_v1::o1_brandonToStoneSequence(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_brandonToStoneSequence(%p) ()", (const void *)script);
- seq_brandonToStone();
- return 0;
-}
-
-int KyraEngine_v1::o1_brandonHealingSequence(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_brandonHealingSequence(%p) ()", (const void *)script);
- seq_brandonHealing();
- return 0;
-}
-
-int KyraEngine_v1::o1_protectCommandLine(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_protectCommandLine(%p) (%d)", (const void *)script, stackPos(0));
- return stackPos(0);
+int KyraEngine_v1::o1_getMouseState(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_getMouseState(%p) ()", (const void *)script);
+ return _mouseState;
}
-int KyraEngine_v1::o1_pauseMusicSeconds(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_pauseMusicSeconds(%p) ()", (const void *)script);
- // if music disabled
- // return
- o1_pauseSeconds(script);
+int KyraEngine_v1::o1_setDeathHandler(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setDeathHandler(%p) (%d)", (const void *)script, stackPos(0));
+ _deathHandler = stackPos(0);
return 0;
}
-int KyraEngine_v1::o1_resetMaskRegion(EMCState *script) {
- warning("STUB: o1_resetMaskRegion");
+int KyraEngine_v1::o1_playWanderScoreViaMap(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_playWanderScoreViaMap(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+ snd_playWanderScoreViaMap(stackPos(0), stackPos(1));
return 0;
}
-int KyraEngine_v1::o1_setPaletteChangeFlag(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_setPaletteChangeFlag(%p) (%d)", (const void *)script, stackPos(0));
- _paletteChanged = stackPos(0);
- return _paletteChanged;
-}
-
int KyraEngine_v1::o1_fillRect(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_fillRect(%p) (%d, %d, %d, %d, %d, 0x%X)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5));
- int videoPageBackup = _screen->_curPage;
- _screen->_curPage = stackPos(0);
- _screen->fillRect(stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5));
- _screen->_curPage = videoPageBackup;
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_fillRect(%p) (%d, %d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5));
+ screen()->fillRect(stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5), stackPos(0));
return 0;
}
-int KyraEngine_v1::o1_vocUnload(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_vocUnload(%p) ()", (const void *)script);
- // this should unload all voc files (not needed)
+int KyraEngine_v1::o1_blockInWalkableRegion(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_blockInWalkableRegion(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
+ screen()->blockInRegion(stackPos(0), stackPos(1), stackPos(2)-stackPos(0)+1, stackPos(3)-stackPos(1)+1);
return 0;
}
-int KyraEngine_v1::o1_vocLoad(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_vocLoad(%p) (%d)", (const void *)script, stackPos(0));
- // this should load the specified voc file (not needed)
+int KyraEngine_v1::o1_blockOutWalkableRegion(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_blockOutWalkableRegion(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
+ screen()->blockOutRegion(stackPos(0), stackPos(1), stackPos(2)-stackPos(0)+1, stackPos(3)-stackPos(1)+1);
return 0;
}
-int KyraEngine_v1::o1_dummy(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_dummy(%p) ()", (const void *)script);
+int KyraEngine_v1::o1_playSoundEffect(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v1::o1_playSoundEffect(%p) (%d)", (const void *)script, stackPos(0));
+ snd_playSoundEffect(stackPos(0));
return 0;
}
-#pragma mark -
-
-typedef Common::Functor1Mem<EMCState*, int, KyraEngine_v1> OpcodeV1;
-#define SetOpcodeTable(x) table = &x;
-#define Opcode(x) table->push_back(new OpcodeV1(this, &KyraEngine_v1::x))
-void KyraEngine_v1::setupOpcodeTable() {
- Common::Array<const Opcode *> *table = 0;
-
- SetOpcodeTable(_opcodes);
- // 0x00
- Opcode(o1_magicInMouseItem);
- Opcode(o1_characterSays);
- Opcode(o1_pauseTicks);
- Opcode(o1_drawSceneAnimShape);
- // 0x04
- Opcode(o1_queryGameFlag);
- Opcode(o1_setGameFlag);
- Opcode(o1_resetGameFlag);
- Opcode(o1_runNPCScript);
- // 0x08
- Opcode(o1_setSpecialExitList);
- Opcode(o1_blockInWalkableRegion);
- Opcode(o1_blockOutWalkableRegion);
- Opcode(o1_walkPlayerToPoint);
- // 0x0c
- Opcode(o1_dropItemInScene);
- Opcode(o1_drawAnimShapeIntoScene);
- Opcode(o1_createMouseItem);
- Opcode(o1_savePageToDisk);
- // 0x10
- Opcode(o1_sceneAnimOn);
- Opcode(o1_sceneAnimOff);
- Opcode(o1_getElapsedSeconds);
- Opcode(o1_mouseIsPointer);
- // 0x14
- Opcode(o1_destroyMouseItem);
- Opcode(o1_runSceneAnimUntilDone);
- Opcode(o1_fadeSpecialPalette);
- Opcode(o1_playAdlibSound);
- // 0x18
- Opcode(o1_playAdlibScore);
- Opcode(o1_phaseInSameScene);
- Opcode(o1_setScenePhasingFlag);
- Opcode(o1_resetScenePhasingFlag);
- // 0x1c
- Opcode(o1_queryScenePhasingFlag);
- Opcode(o1_sceneToDirection);
- Opcode(o1_setBirthstoneGem);
- Opcode(o1_placeItemInGenericMapScene);
- // 0x20
- Opcode(o1_setBrandonStatusBit);
- Opcode(o1_pauseSeconds);
- Opcode(o1_getCharactersLocation);
- Opcode(o1_runNPCSubscript);
- // 0x24
- Opcode(o1_magicOutMouseItem);
- Opcode(o1_internalAnimOn);
- Opcode(o1_forceBrandonToNormal);
- Opcode(o1_poisonDeathNow);
- // 0x28
- Opcode(o1_setScaleMode);
- Opcode(o1_openWSAFile);
- Opcode(o1_closeWSAFile);
- Opcode(o1_runWSAFromBeginningToEnd);
- // 0x2c
- Opcode(o1_displayWSAFrame);
- Opcode(o1_enterNewScene);
- Opcode(o1_setSpecialEnterXAndY);
- Opcode(o1_runWSAFrames);
- // 0x30
- Opcode(o1_popBrandonIntoScene);
- Opcode(o1_restoreAllObjectBackgrounds);
- Opcode(o1_setCustomPaletteRange);
- Opcode(o1_loadPageFromDisk);
- // 0x34
- Opcode(o1_customPrintTalkString);
- Opcode(o1_restoreCustomPrintBackground);
- Opcode(o1_hideMouse);
- Opcode(o1_showMouse);
- // 0x38
- Opcode(o1_getCharacterX);
- Opcode(o1_getCharacterY);
- Opcode(o1_changeCharactersFacing);
- Opcode(o1_copyWSARegion);
- // 0x3c
- Opcode(o1_printText);
- Opcode(o1_random);
- Opcode(o1_loadSoundFile);
- Opcode(o1_displayWSAFrameOnHidPage);
- // 0x40
- Opcode(o1_displayWSASequentialFrames);
- Opcode(o1_drawCharacterStanding);
- Opcode(o1_internalAnimOff);
- Opcode(o1_changeCharactersXAndY);
- // 0x44
- Opcode(o1_clearSceneAnimatorBeacon);
- Opcode(o1_querySceneAnimatorBeacon);
- Opcode(o1_refreshSceneAnimator);
- Opcode(o1_placeItemInOffScene);
- // 0x48
- Opcode(o1_wipeDownMouseItem);
- Opcode(o1_placeCharacterInOtherScene);
- Opcode(o1_getKey);
- Opcode(o1_specificItemInInventory);
- // 0x4c
- Opcode(o1_popMobileNPCIntoScene);
- Opcode(o1_mobileCharacterInScene);
- Opcode(o1_hideMobileCharacter);
- Opcode(o1_unhideMobileCharacter);
- // 0x50
- Opcode(o1_setCharactersLocation);
- Opcode(o1_walkCharacterToPoint);
- Opcode(o1_specialEventDisplayBrynnsNote);
- Opcode(o1_specialEventRemoveBrynnsNote);
- // 0x54
- Opcode(o1_setLogicPage);
- Opcode(o1_fatPrint);
- Opcode(o1_preserveAllObjectBackgrounds);
- Opcode(o1_updateSceneAnimations);
- // 0x58
- Opcode(o1_sceneAnimationActive);
- Opcode(o1_setCharactersMovementDelay);
- Opcode(o1_getCharactersFacing);
- Opcode(o1_bkgdScrollSceneAndMasksRight);
- // 0x5c
- Opcode(o1_dispelMagicAnimation);
- Opcode(o1_findBrightestFireberry);
- Opcode(o1_setFireberryGlowPalette);
- Opcode(o1_setDeathHandlerFlag);
- // 0x60
- Opcode(o1_drinkPotionAnimation);
- Opcode(o1_makeAmuletAppear);
- Opcode(o1_drawItemShapeIntoScene);
- Opcode(o1_setCharactersCurrentFrame);
- // 0x64
- Opcode(o1_waitForConfirmationMouseClick);
- Opcode(o1_pageFlip);
- Opcode(o1_setSceneFile);
- Opcode(o1_getItemInMarbleVase);
- // 0x68
- Opcode(o1_setItemInMarbleVase);
- Opcode(o1_addItemToInventory);
- Opcode(o1_intPrint);
- Opcode(o1_shakeScreen);
- // 0x6c
- Opcode(o1_createAmuletJewel);
- Opcode(o1_setSceneAnimCurrXY);
- Opcode(o1_poisonBrandonAndRemaps);
- Opcode(o1_fillFlaskWithWater);
- // 0x70
- Opcode(o1_getCharactersMovementDelay);
- Opcode(o1_getBirthstoneGem);
- Opcode(o1_queryBrandonStatusBit);
- Opcode(o1_playFluteAnimation);
- // 0x74
- Opcode(o1_playWinterScrollSequence);
- Opcode(o1_getIdolGem);
- Opcode(o1_setIdolGem);
- Opcode(o1_totalItemsInScene);
- // 0x78
- Opcode(o1_restoreBrandonsMovementDelay);
- Opcode(o1_setMousePos);
- Opcode(o1_getMouseState);
- Opcode(o1_setEntranceMouseCursorTrack);
- // 0x7c
- Opcode(o1_itemAppearsOnGround);
- Opcode(o1_setNoDrawShapesFlag);
- Opcode(o1_fadeEntirePalette);
- Opcode(o1_itemOnGroundHere);
- // 0x80
- Opcode(o1_queryCauldronState);
- Opcode(o1_setCauldronState);
- Opcode(o1_queryCrystalState);
- Opcode(o1_setCrystalState);
- // 0x84
- Opcode(o1_setPaletteRange);
- Opcode(o1_shrinkBrandonDown);
- Opcode(o1_growBrandonUp);
- Opcode(o1_setBrandonScaleXAndY);
- // 0x88
- Opcode(o1_resetScaleMode);
- Opcode(o1_getScaleDepthTableValue);
- Opcode(o1_setScaleDepthTableValue);
- Opcode(o1_message);
- // 0x8c
- Opcode(o1_checkClickOnNPC);
- Opcode(o1_getFoyerItem);
- Opcode(o1_setFoyerItem);
- Opcode(o1_setNoItemDropRegion);
- // 0x90
- Opcode(o1_walkMalcolmOn);
- Opcode(o1_passiveProtection);
- Opcode(o1_setPlayingLoop);
- Opcode(o1_brandonToStoneSequence);
- // 0x94
- Opcode(o1_brandonHealingSequence);
- Opcode(o1_protectCommandLine);
- Opcode(o1_pauseMusicSeconds);
- Opcode(o1_resetMaskRegion);
- // 0x98
- Opcode(o1_setPaletteChangeFlag);
- Opcode(o1_fillRect);
- Opcode(o1_vocUnload);
- Opcode(o1_vocLoad);
- // 0x9c
- Opcode(o1_dummy);
-}
-#undef Opcode
-
} // end of namespace Kyra
diff --git a/engines/kyra/script_v2.cpp b/engines/kyra/script_v2.cpp
index fcfb34561f..2af4fda727 100644
--- a/engines/kyra/script_v2.cpp
+++ b/engines/kyra/script_v2.cpp
@@ -103,44 +103,6 @@ int KyraEngine_v2::o2_defineItem(EMCState *script) {
return freeItem;
}
-int KyraEngine_v2::o2_queryGameFlag(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_queryGameFlag(%p) (%d)", (const void *)script, stackPos(0));
- return queryGameFlag(stackPos(0));
-}
-
-int KyraEngine_v2::o2_resetGameFlag(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_resetGameFlag(%p) (%d)", (const void *)script, stackPos(0));
- return resetGameFlag(stackPos(0));
-}
-
-int KyraEngine_v2::o2_setGameFlag(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setGameFlag(%p) (%d)", (const void *)script, stackPos(0));
- return setGameFlag(stackPos(0));
-}
-
-int KyraEngine_v2::o2_setHandItem(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setHandItem(%p) (%d)", (const void *)script, stackPos(0));
- setHandItem(stackPos(0));
- return 0;
-}
-
-int KyraEngine_v2::o2_removeHandItem(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_removeHandItem(%p) ()", (const void *)script);
- removeHandItem();
- return 0;
-}
-
-int KyraEngine_v2::o2_handItemSet(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_handItemSet(%p) ()", (const void *)script);
- return _handItemSet;
-}
-
-int KyraEngine_v2::o2_hideMouse(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_hideMouse(%p) ()", (const void *)script);
- screen()->hideMouse();
- return 0;
-}
-
int KyraEngine_v2::o2_addSpecialExit(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_addSpecialExit(%p) (%d, %d, %d, %d, %d)", (const void *)script,
stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4));
@@ -155,18 +117,6 @@ int KyraEngine_v2::o2_addSpecialExit(EMCState *script) {
return 0;
}
-int KyraEngine_v2::o2_setMousePos(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setMousePos(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- setMousePos(stackPos(0), stackPos(1));
- return 0;
-}
-
-int KyraEngine_v2::o2_showMouse(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_showMouse(%p) ()", (const void *)script);
- screen()->showMouse();
- return 0;
-}
-
int KyraEngine_v2::o2_delay(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_delay(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
if (stackPos(1)) {
@@ -206,24 +156,6 @@ int KyraEngine_v2::o2_getShapeFlag1(EMCState *script) {
return screen()->getShapeFlag1(stackPos(0), stackPos(1));
}
-int KyraEngine_v2::o2_playWanderScoreViaMap(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_playWanderScoreViaMap(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- snd_playWanderScoreViaMap(stackPos(0), stackPos(1));
- return 0;
-}
-
-int KyraEngine_v2::o2_getRand(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_getRand(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
- assert(stackPos(0) < stackPos(1));
- return _rnd.getRandomNumberRng(stackPos(0), stackPos(1));
-}
-
-int KyraEngine_v2::o2_setDeathHandler(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_setDeathHandler(%p) (%d)", (const void *)script, stackPos(0));
- _deathHandler = stackPos(0);
- return 0;
-}
-
int KyraEngine_v2::o2_waitForConfirmationClick(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_waitForConfirmationClick(%p) (%d)", (const void *)script, stackPos(0));
resetSkipFlag();
diff --git a/engines/kyra/seqplayer.cpp b/engines/kyra/seqplayer.cpp
index ddd8beb5dc..73d69ef10c 100644
--- a/engines/kyra/seqplayer.cpp
+++ b/engines/kyra/seqplayer.cpp
@@ -40,7 +40,7 @@
namespace Kyra {
-SeqPlayer::SeqPlayer(KyraEngine_v1 *vm, OSystem *system) {
+SeqPlayer::SeqPlayer(KyraEngine_LoK *vm, OSystem *system) {
_vm = vm;
_system = system;
@@ -110,7 +110,7 @@ void SeqPlayer::makeHandShapes() {
} else {
for (int i = 0; i < ARRAYSIZE(_handShapes); ++i) {
if (_handShapes[i])
- delete [] _handShapes[i];
+ delete[] _handShapes[i];
_handShapes[i] = setPanPages(3, i);
assert(_handShapes[i]);
}
@@ -120,7 +120,7 @@ void SeqPlayer::makeHandShapes() {
void SeqPlayer::freeHandShapes() {
debugC(9, kDebugLevelSequence, "SeqPlayer::freeHandShapes()");
for (int i = 0; i < ARRAYSIZE(_handShapes); ++i) {
- delete [] _handShapes[i];
+ delete[] _handShapes[i];
_handShapes[i] = 0;
}
}
@@ -262,7 +262,7 @@ void SeqPlayer::s1_loadPalette() {
uint8 *srcData;
srcData = _res->fileData(_vm->seqCOLTable()[colNum], &fileSize);
memcpy(_screen->_currentPalette, srcData, fileSize);
- delete [] srcData;
+ delete[] srcData;
}
}
@@ -667,7 +667,7 @@ bool SeqPlayer::playSequence(const uint8 *seqData, bool skipSeq) {
_screen->updateScreen();
}
- delete [] _specialBuffer;
+ delete[] _specialBuffer;
_specialBuffer = 0;
return seqSkippedFlag;
}
diff --git a/engines/kyra/seqplayer.h b/engines/kyra/seqplayer.h
index ce7f4648df..7e1b06d955 100644
--- a/engines/kyra/seqplayer.h
+++ b/engines/kyra/seqplayer.h
@@ -26,13 +26,13 @@
#ifndef KYRA_SEQPLAYER_H
#define KYRA_SEQPLAYER_H
-#include "kyra/kyra_v1.h"
+#include "kyra/kyra_lok.h"
namespace Kyra {
class SeqPlayer {
public:
- SeqPlayer(KyraEngine_v1 *vm, OSystem *system);
+ SeqPlayer(KyraEngine_LoK *vm, OSystem *system);
~SeqPlayer();
void setCopyViewOffs(bool offs) {
@@ -46,7 +46,7 @@ public:
uint8 *setPanPages(int pageNum, int shape);
protected:
- KyraEngine_v1 *_vm;
+ KyraEngine_LoK *_vm;
OSystem *_system;
Screen *_screen;
Sound *_sound;
diff --git a/engines/kyra/sequences_hof.cpp b/engines/kyra/sequences_hof.cpp
index 1c74f48990..169c319347 100644
--- a/engines/kyra/sequences_hof.cpp
+++ b/engines/kyra/sequences_hof.cpp
@@ -23,7 +23,7 @@
*
*/
-#include "kyra/kyra.h"
+#include "kyra/kyra_v1.h"
#include "kyra/kyra_hof.h"
#include "kyra/screen.h"
#include "kyra/wsamovie.h"
@@ -231,7 +231,7 @@ void KyraEngine_HoF::seq_playSequences(int startSeq, int endSeq) {
_seqFrameDelay = cseq.frameDelay;
_seqEndTime = _system->getMillis() + _seqFrameDelay * _tickLength;
while (!((skipFlag() && allowSkip) || _quitFlag || (_abortIntroFlag && allowSkip) || _menuChoice)) {
- uint32 starttime = _system->getMillis();
+ _seqSubFrameStartTime = _system->getMillis();
seq_processWSAs();
if (cb)
(this->*cb)(0, 0, 0, 0);
@@ -246,8 +246,8 @@ void KyraEngine_HoF::seq_playSequences(int startSeq, int endSeq) {
if (now >= _seqEndTime && !_seqSubframePlaying)
break;
- uint32 tdiff = _seqEndTime - starttime;
- int32 dly = _tickLength - (now - starttime);
+ uint32 tdiff = _seqEndTime - _seqSubFrameStartTime;
+ int32 dly = _tickLength - (now - _seqSubFrameStartTime);
if (dly > 0)
delay(MIN<uint32>(dly, tdiff));
}
@@ -263,7 +263,7 @@ void KyraEngine_HoF::seq_playSequences(int startSeq, int endSeq) {
_seqEndTime = _system->getMillis() + dl;
while (!((skipFlag() && allowSkip) || _quitFlag || (_abortIntroFlag && allowSkip) || _menuChoice)) {
- uint32 starttime = _system->getMillis();
+ _seqSubFrameStartTime = _system->getMillis();
seq_processWSAs();
_screen->copyPage(2, 0);
@@ -275,8 +275,8 @@ void KyraEngine_HoF::seq_playSequences(int startSeq, int endSeq) {
break;
}
- uint32 tdiff = _seqEndTime - starttime;
- int32 dly = _tickLength - (now - starttime);
+ uint32 tdiff = _seqEndTime - _seqSubFrameStartTime;
+ int32 dly = _tickLength - (now - _seqSubFrameStartTime);
if (dly > 0)
delay(MIN<uint32>(dly, tdiff));
}
@@ -284,13 +284,12 @@ void KyraEngine_HoF::seq_playSequences(int startSeq, int endSeq) {
seq_sequenceCommand(cseq.finalCommand);
seq_resetAllTextEntries();
- if (_flags.isDemo && !_flags.isTalkie) {
- if (seqNum == kSequenceDemoFisher) {
- _abortIntroFlag = false;
- resetSkipFlag();
- seqNum = kSequenceDemoVirgin;
- }
- } else {
+ if (_abortIntroFlag || skipFlag()) {
+ _sound->haltTrack();
+ _sound->voiceStop();
+ }
+
+ if (!_flags.isDemo || _flags.isTalkie) {
if ((seqNum != kSequenceTitle && seqNum < kSequenceZanfaun &&
(_abortIntroFlag || skipFlag())) || seqNum == kSequenceZanfaun) {
_abortIntroFlag = false;
@@ -301,6 +300,8 @@ void KyraEngine_HoF::seq_playSequences(int startSeq, int endSeq) {
_eventList.clear();
seqNum = kSequenceFirates;
}
+ } else if (seqNum == kSequenceDemoFisher && !(_abortIntroFlag || skipFlag())) {
+ seqNum = kSequenceDemoVirgin;
}
if (_menuChoice) {
@@ -314,8 +315,13 @@ void KyraEngine_HoF::seq_playSequences(int startSeq, int endSeq) {
}
}
+ if (_flags.isDemo && !_flags.isTalkie) {
+ _eventList.clear();
+ _screen->fadeToBlack();
+ }
+
if (!_menuChoice)
- delay(1000);
+ delay(1200);
_screen->setCurPage(oldPage);
_screen->showMouse();
@@ -330,7 +336,7 @@ void KyraEngine_HoF::seq_playSequences(int startSeq, int endSeq) {
seq_uninit();
}
-int KyraEngine_HoF::seq_introWestwood(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+int KyraEngine_HoF::seq_introWestwood(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
debugC(9, kDebugLevelMain, "KyraEngine_HoF::seq_introWestwood(%p, %i, %i, %i)", (const void*)wsaObj, x, y, frm);
if (frm == -2) {
@@ -343,7 +349,7 @@ int KyraEngine_HoF::seq_introWestwood(WSAMovieV2 *wsaObj, int x, int y, int frm)
return 0;
}
-int KyraEngine_HoF::seq_introTitle(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+int KyraEngine_HoF::seq_introTitle(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
debugC(9, kDebugLevelMain, "KyraEngine_HoF::seq_introTitle(%p, %i, %i, %i)", (const void*)wsaObj, x, y, frm);
if (frm == 1) {
@@ -365,18 +371,19 @@ int KyraEngine_HoF::seq_introTitle(WSAMovieV2 *wsaObj, int x, int y, int frm) {
return 0;
}
-int KyraEngine_HoF::seq_introOverview(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+int KyraEngine_HoF::seq_introOverview(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
debugC(9, kDebugLevelMain, "KyraEngine_HoF::seq_introOverview(%p, %i, %i, %i)", (const void*)wsaObj, x, y, frm);
uint8 *tmpPal = &(_screen->getPalette(3)[0x101]);
memset(tmpPal, 0, 256);
- uint32 endtime = 0, now = 0;
+ _seqSubFrameEndTimeInternal = 0;
+ uint32 now = 0;
switch (_seqFrameCounter) {
case 0:
_seqSubframePlaying = true;
_sound->playTrack(4);
- endtime = _system->getMillis() + 60 * _tickLength;
+ _seqSubFrameEndTimeInternal = _system->getMillis() + 60 * _tickLength;
_seqTextColor[1] = _screen->findLeastDifferentColor(_seqTextColorPresets, _screen->getPalette(0) + 3, 255) & 0xff;
memset(_seqTextColorMap, _seqTextColor[1], 16);
@@ -385,8 +392,8 @@ int KyraEngine_HoF::seq_introOverview(WSAMovieV2 *wsaObj, int x, int y, int frm)
_screen->setTextColorMap(_seqTextColorMap);
now = _system->getMillis();
- if (endtime > now)
- delay(endtime - now);
+ if (_seqSubFrameEndTimeInternal > now)
+ delay(_seqSubFrameEndTimeInternal - now);
break;
case 1:
@@ -465,7 +472,7 @@ int KyraEngine_HoF::seq_introOverview(WSAMovieV2 *wsaObj, int x, int y, int frm)
return 0;
}
-int KyraEngine_HoF::seq_introLibrary(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+int KyraEngine_HoF::seq_introLibrary(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
debugC(9, kDebugLevelMain, "KyraEngine_HoF::seq_introLibrary(%p, %i, %i, %i)", (const void*)wsaObj, x, y, frm);
switch (_seqFrameCounter) {
@@ -541,7 +548,7 @@ int KyraEngine_HoF::seq_introLibrary(WSAMovieV2 *wsaObj, int x, int y, int frm)
}
-int KyraEngine_HoF::seq_introHand(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+int KyraEngine_HoF::seq_introHand(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
debugC(9, kDebugLevelMain, "KyraEngine_HoF::seq_introHand(%p, %i, %i, %i)", (const void*)wsaObj, x, y, frm);
switch (_seqFrameCounter) {
@@ -625,7 +632,7 @@ int KyraEngine_HoF::seq_introHand(WSAMovieV2 *wsaObj, int x, int y, int frm) {
return 0;
}
-int KyraEngine_HoF::seq_introPoint(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+int KyraEngine_HoF::seq_introPoint(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
if (frm == -2) {
seq_waitForTextsTimeout();
_seqEndTime = 0;
@@ -658,7 +665,7 @@ int KyraEngine_HoF::seq_introPoint(WSAMovieV2 *wsaObj, int x, int y, int frm) {
return 0;
}
-int KyraEngine_HoF::seq_introZanfaun(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+int KyraEngine_HoF::seq_introZanfaun(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
if (frm == -2) {
seq_waitForTextsTimeout();
_seqEndTime = 0;
@@ -747,7 +754,7 @@ int KyraEngine_HoF::seq_introZanfaun(WSAMovieV2 *wsaObj, int x, int y, int frm)
return 0;
}
-int KyraEngine_HoF::seq_introOver1(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+int KyraEngine_HoF::seq_introOver1(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
if (frm == 2)
seq_waitForTextsTimeout();
else if (frm == 3)
@@ -756,13 +763,13 @@ int KyraEngine_HoF::seq_introOver1(WSAMovieV2 *wsaObj, int x, int y, int frm) {
}
-int KyraEngine_HoF::seq_introOver2(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+int KyraEngine_HoF::seq_introOver2(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
if (frm == 1)
seq_playTalkText(12);
return frm;
}
-int KyraEngine_HoF::seq_introForest(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+int KyraEngine_HoF::seq_introForest(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
if (frm == 11)
seq_waitForTextsTimeout();
else if (frm == 12)
@@ -771,7 +778,7 @@ int KyraEngine_HoF::seq_introForest(WSAMovieV2 *wsaObj, int x, int y, int frm) {
return frm;
}
-int KyraEngine_HoF::seq_introDragon(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+int KyraEngine_HoF::seq_introDragon(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
if (frm == 11)
seq_waitForTextsTimeout();
else if (frm == 3)
@@ -779,17 +786,17 @@ int KyraEngine_HoF::seq_introDragon(WSAMovieV2 *wsaObj, int x, int y, int frm) {
return frm;
}
-int KyraEngine_HoF::seq_introDarm(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+int KyraEngine_HoF::seq_introDarm(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
//NULLSUB (at least in fm-towns version)
return frm;
}
-int KyraEngine_HoF::seq_introLibrary2(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+int KyraEngine_HoF::seq_introLibrary2(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
//NULLSUB (at least in fm-towns version)
return frm;
}
-int KyraEngine_HoF::seq_introMarco(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+int KyraEngine_HoF::seq_introMarco(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
if (frm == 36) {
seq_waitForTextsTimeout();
_seqEndTime = 0;
@@ -797,35 +804,35 @@ int KyraEngine_HoF::seq_introMarco(WSAMovieV2 *wsaObj, int x, int y, int frm) {
return frm;
}
-int KyraEngine_HoF::seq_introHand1a(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+int KyraEngine_HoF::seq_introHand1a(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
//NULLSUB (at least in fm-towns version)
return frm;
}
-int KyraEngine_HoF::seq_introHand1b(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+int KyraEngine_HoF::seq_introHand1b(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
if (frm == 15)
frm = 12;
return frm;
}
-int KyraEngine_HoF::seq_introHand1c(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+int KyraEngine_HoF::seq_introHand1c(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
if (frm == 8)
frm = 4;
return frm;
}
-int KyraEngine_HoF::seq_introHand2(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+int KyraEngine_HoF::seq_introHand2(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
//NULLSUB (at least in fm-towns version)
return frm;
}
-int KyraEngine_HoF::seq_introHand3(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+int KyraEngine_HoF::seq_introHand3(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
//NULLSUB (at least in fm-towns version)
return frm;
}
-int KyraEngine_HoF::seq_finaleFunters(WSAMovieV2 *wsaObj, int x, int y, int frm) {
- uint32 endtime = 0;
+int KyraEngine_HoF::seq_finaleFunters(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
+ _seqSubFrameEndTimeInternal = 0;
int chatX = 0;
int chatY = 0;
int chatW = 0;
@@ -846,12 +853,12 @@ int KyraEngine_HoF::seq_finaleFunters(WSAMovieV2 *wsaObj, int x, int y, int frm)
_seqTextColor[0] = _seqTextColorMap[1] = 0xff;
_screen->setTextColorMap(_seqTextColorMap);
- endtime = _system->getMillis() + 480 * _tickLength;
+ _seqSubFrameEndTimeInternal = _system->getMillis() + 480 * _tickLength;
seq_printCreditsString(81, 240, 70, _seqTextColorMap, 252);
seq_printCreditsString(82, 240, 90, _seqTextColorMap, _seqTextColor[0]);
_screen->copyPage(2, 12);
- delay(endtime - _system->getMillis());
seq_playTalkText(_flags.isTalkie ? 28 : 24);
+ delay(_seqSubFrameEndTimeInternal - _system->getMillis());
_seqTextColor[0] = 1;
if (_flags.isTalkie) {
@@ -908,8 +915,8 @@ int KyraEngine_HoF::seq_finaleFunters(WSAMovieV2 *wsaObj, int x, int y, int frm)
return 0;
}
-int KyraEngine_HoF::seq_finaleFerb(WSAMovieV2 *wsaObj, int x, int y, int frm) {
- uint32 endtime = 0;
+int KyraEngine_HoF::seq_finaleFerb(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
+ _seqSubFrameEndTimeInternal = 0;
int chatX = 0;
int chatY = 0;
int chatW = 0;
@@ -920,7 +927,7 @@ int KyraEngine_HoF::seq_finaleFerb(WSAMovieV2 *wsaObj, int x, int y, int frm) {
switch (frm) {
case -2:
seq_sequenceCommand(9);
- endtime = _system->getMillis() + 480 * _tickLength;
+ _seqSubFrameEndTimeInternal = _system->getMillis() + 480 * _tickLength;
seq_printCreditsString(34, 240, _flags.isTalkie ? 60 : 40, _seqTextColorMap, 252);
seq_printCreditsString(35, 240, _flags.isTalkie ? 70 : 50, _seqTextColorMap, _seqTextColor[0]);
seq_printCreditsString(36, 240, _flags.isTalkie ? 90 : 70, _seqTextColorMap, 252);
@@ -929,7 +936,7 @@ int KyraEngine_HoF::seq_finaleFerb(WSAMovieV2 *wsaObj, int x, int y, int frm) {
seq_printCreditsString(39, 240, _flags.isTalkie ? 130 : 120, _seqTextColorMap, _seqTextColor[0]);
if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98)
seq_printCreditsString(103, 240, 130, _seqTextColorMap, _seqTextColor[0]);
- delay(endtime - _system->getMillis());
+ delay(_seqSubFrameEndTimeInternal - _system->getMillis());
_seqEndTime = 0;
break;
@@ -992,8 +999,8 @@ int KyraEngine_HoF::seq_finaleFerb(WSAMovieV2 *wsaObj, int x, int y, int frm) {
return 0;
}
-int KyraEngine_HoF::seq_finaleFish(WSAMovieV2 *wsaObj, int x, int y, int frm) {
- uint32 endtime = 0;
+int KyraEngine_HoF::seq_finaleFish(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
+ _seqSubFrameEndTimeInternal = 0;
int chatX = 0;
int chatY = 0;
int chatW = 0;
@@ -1002,7 +1009,7 @@ int KyraEngine_HoF::seq_finaleFish(WSAMovieV2 *wsaObj, int x, int y, int frm) {
switch (frm) {
case -2:
seq_sequenceCommand(9);
- endtime = _system->getMillis() + 480 * _tickLength;
+ _seqSubFrameEndTimeInternal = _system->getMillis() + 480 * _tickLength;
seq_printCreditsString(40, 240, _flags.isTalkie ? 55 : 40, _seqTextColorMap, 252);
seq_printCreditsString(41, 240, _flags.isTalkie ? 65 : 50, _seqTextColorMap, _seqTextColor[0]);
@@ -1011,7 +1018,7 @@ int KyraEngine_HoF::seq_finaleFish(WSAMovieV2 *wsaObj, int x, int y, int frm) {
seq_printCreditsString(44, 240, _flags.isTalkie ? 105 : 90, _seqTextColorMap, _seqTextColor[0]);
seq_printCreditsString(93, 240, _flags.isTalkie ? 125 : 110, _seqTextColorMap, 252);
seq_printCreditsString(94, 240, _flags.isTalkie ? 135 : 120, _seqTextColorMap, _seqTextColor[0]);
- delay(endtime - _system->getMillis());
+ delay(_seqSubFrameEndTimeInternal - _system->getMillis());
_seqEndTime = 0;
break;
@@ -1069,8 +1076,8 @@ int KyraEngine_HoF::seq_finaleFish(WSAMovieV2 *wsaObj, int x, int y, int frm) {
return 0;
}
-int KyraEngine_HoF::seq_finaleFheep(WSAMovieV2 *wsaObj, int x, int y, int frm) {
- uint32 endtime = 0;
+int KyraEngine_HoF::seq_finaleFheep(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
+ _seqSubFrameEndTimeInternal = 0;
int chatX = 0;
int chatY = 0;
int chatW = 0;
@@ -1084,7 +1091,7 @@ int KyraEngine_HoF::seq_finaleFheep(WSAMovieV2 *wsaObj, int x, int y, int frm) {
_screen->copyPage(2, 0);
_screen->updateScreen();
seq_sequenceCommand(9);
- endtime = _system->getMillis() + 480 * _tickLength;
+ _seqSubFrameEndTimeInternal = _system->getMillis() + 480 * _tickLength;
seq_printCreditsString(49, 240, 20, _seqTextColorMap, 252);
seq_printCreditsString(50, 240, 30, _seqTextColorMap, _seqTextColor[0]);
seq_printCreditsString(51, 240, 40, _seqTextColorMap, _seqTextColor[0]);
@@ -1101,7 +1108,7 @@ int KyraEngine_HoF::seq_finaleFheep(WSAMovieV2 *wsaObj, int x, int y, int frm) {
seq_printCreditsString(63, 240, 150, _seqTextColorMap, _seqTextColor[0]);
seq_printCreditsString(64, 240, 160, _seqTextColorMap, _seqTextColor[0]);
- delay(endtime - _system->getMillis());
+ delay(_seqSubFrameEndTimeInternal - _system->getMillis());
_seqEndTime = 0;
break;
@@ -1151,8 +1158,8 @@ int KyraEngine_HoF::seq_finaleFheep(WSAMovieV2 *wsaObj, int x, int y, int frm) {
return 0;
}
-int KyraEngine_HoF::seq_finaleFarmer(WSAMovieV2 *wsaObj, int x, int y, int frm) {
- uint32 endtime = 0;
+int KyraEngine_HoF::seq_finaleFarmer(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
+ _seqSubFrameEndTimeInternal = 0;
int chatX = 0;
int chatY = 0;
int chatW = 0;
@@ -1164,7 +1171,7 @@ int KyraEngine_HoF::seq_finaleFarmer(WSAMovieV2 *wsaObj, int x, int y, int frm)
_screen->copyPage(2, 0);
_screen->updateScreen();
seq_sequenceCommand(9);
- endtime = _system->getMillis() + 480 * _tickLength;
+ _seqSubFrameEndTimeInternal = _system->getMillis() + 480 * _tickLength;
seq_printCreditsString(45, 240, 40, _seqTextColorMap, 252);
seq_printCreditsString(46, 240, 50, _seqTextColorMap, _seqTextColor[0]);
seq_printCreditsString(47, 240, 60, _seqTextColorMap, _seqTextColor[0]);
@@ -1177,7 +1184,7 @@ int KyraEngine_HoF::seq_finaleFarmer(WSAMovieV2 *wsaObj, int x, int y, int frm)
seq_printCreditsString(69, 240, 150, _seqTextColorMap, _seqTextColor[0]);
if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98)
seq_printCreditsString(104, 240, 160, _seqTextColorMap, _seqTextColor[0]);
- delay(endtime - _system->getMillis());
+ delay(_seqSubFrameEndTimeInternal - _system->getMillis());
_seqEndTime = 0;
break;
@@ -1221,8 +1228,8 @@ int KyraEngine_HoF::seq_finaleFarmer(WSAMovieV2 *wsaObj, int x, int y, int frm)
return 0;
}
-int KyraEngine_HoF::seq_finaleFuards(WSAMovieV2 *wsaObj, int x, int y, int frm) {
- uint32 endtime = 0;
+int KyraEngine_HoF::seq_finaleFuards(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
+ _seqSubFrameEndTimeInternal = 0;
int chatX = 0;
int chatY = 0;
int chatW = 0;
@@ -1235,7 +1242,7 @@ int KyraEngine_HoF::seq_finaleFuards(WSAMovieV2 *wsaObj, int x, int y, int frm)
switch (frm) {
case -2:
seq_sequenceCommand(9);
- endtime = _system->getMillis() + 480 * _tickLength;
+ _seqSubFrameEndTimeInternal = _system->getMillis() + 480 * _tickLength;
seq_printCreditsString(70, 240, 20, _seqTextColorMap, 252);
seq_printCreditsString(71, 240, 30, _seqTextColorMap, _seqTextColor[0]);
seq_printCreditsString(72, 240, 40, _seqTextColorMap, _seqTextColor[0]);
@@ -1250,7 +1257,7 @@ int KyraEngine_HoF::seq_finaleFuards(WSAMovieV2 *wsaObj, int x, int y, int frm)
seq_printCreditsString(90, 240, 130, _seqTextColorMap, _seqTextColor[0]);
seq_printCreditsString(91, 240, 140, _seqTextColorMap, _seqTextColor[0]);
seq_printCreditsString(92, 240, 150, _seqTextColorMap, _seqTextColor[0]);
- delay(endtime - _system->getMillis());
+ delay(_seqSubFrameEndTimeInternal - _system->getMillis());
_seqEndTime = 0;
break;
@@ -1321,8 +1328,8 @@ int KyraEngine_HoF::seq_finaleFuards(WSAMovieV2 *wsaObj, int x, int y, int frm)
return 0;
}
-int KyraEngine_HoF::seq_finaleFirates(WSAMovieV2 *wsaObj, int x, int y, int frm) {
- uint32 endtime = 0;
+int KyraEngine_HoF::seq_finaleFirates(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
+ _seqSubFrameEndTimeInternal = 0;
int chatX = 0;
int chatY = 0;
int chatW = 0;
@@ -1334,7 +1341,7 @@ int KyraEngine_HoF::seq_finaleFirates(WSAMovieV2 *wsaObj, int x, int y, int frm)
_screen->copyPage(2, 0);
_screen->updateScreen();
seq_sequenceCommand(9);
- endtime = _system->getMillis() + 480 * _tickLength;
+ _seqSubFrameEndTimeInternal = _system->getMillis() + 480 * _tickLength;
seq_printCreditsString(76, 240, 40, _seqTextColorMap, 252);
seq_printCreditsString(77, 240, 50, _seqTextColorMap, 252);
seq_printCreditsString(78, 240, 60, _seqTextColorMap, _seqTextColor[0]);
@@ -1344,7 +1351,7 @@ int KyraEngine_HoF::seq_finaleFirates(WSAMovieV2 *wsaObj, int x, int y, int frm)
seq_printCreditsString(85, 240, 110, _seqTextColorMap, _seqTextColor[0]);
seq_printCreditsString(99, 240, 130, _seqTextColorMap, 252);
seq_printCreditsString(100, 240, 140, _seqTextColorMap, _seqTextColor[0]);
- delay(endtime - _system->getMillis());
+ delay(_seqSubFrameEndTimeInternal - _system->getMillis());
_seqEndTime = 0;
break;
@@ -1413,7 +1420,7 @@ int KyraEngine_HoF::seq_finaleFirates(WSAMovieV2 *wsaObj, int x, int y, int frm)
return 0;
}
-int KyraEngine_HoF::seq_finaleFrash(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+int KyraEngine_HoF::seq_finaleFrash(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
int tmp = 0;
switch (frm) {
@@ -1535,13 +1542,13 @@ void KyraEngine_HoF::seq_finaleActorScreen() {
seq_displayScrollText(dataPtr, &d, 2, 6, 5, 1, Screen::FID_GOLDFONT_FNT, Screen::FID_GOLDFONT_FNT, 0, talkieCreditsSpecial);
delay(120);
- delete [] dataPtr;
+ delete[] dataPtr;
_staticres->unloadId(k2SeqplayCreditsSpecial);
_sound->setSoundList(&_soundData[kMusicFinale]);
_sound->loadSoundFile(0);
}
-int KyraEngine_HoF::seq_finaleFiggle(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+int KyraEngine_HoF::seq_finaleFiggle(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
if (_seqFrameCounter == 10)
_seqEndTime = 0;
if (_seqFrameCounter == 10 || _seqFrameCounter == 5 || _seqFrameCounter == 7)
@@ -1551,18 +1558,18 @@ int KyraEngine_HoF::seq_finaleFiggle(WSAMovieV2 *wsaObj, int x, int y, int frm)
return frm;
}
-int KyraEngine_HoF::seq_demoVirgin(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+int KyraEngine_HoF::seq_demoVirgin(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
if (!frm)
delay(50 * _tickLength);
return 0;
}
-int KyraEngine_HoF::seq_demoWestwood(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+int KyraEngine_HoF::seq_demoWestwood(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
if (!frm)
_sound->playTrack(2);
return 0;
}
-int KyraEngine_HoF::seq_demoTitle(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+int KyraEngine_HoF::seq_demoTitle(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
if (!frm) {
_sound->playTrack(3);
} else if (frm == 25) {
@@ -1573,7 +1580,7 @@ int KyraEngine_HoF::seq_demoTitle(WSAMovieV2 *wsaObj, int x, int y, int frm) {
return 0;
}
-int KyraEngine_HoF::seq_demoHill(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+int KyraEngine_HoF::seq_demoHill(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
if (!frm) {
_sound->playTrack(4);
} else if (frm == 25) {
@@ -1593,7 +1600,7 @@ int KyraEngine_HoF::seq_demoHill(WSAMovieV2 *wsaObj, int x, int y, int frm) {
return 0;
}
-int KyraEngine_HoF::seq_demoOuthome(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+int KyraEngine_HoF::seq_demoOuthome(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
switch (frm) {
case 12:
seq_playTalkText(4);
@@ -1634,7 +1641,7 @@ int KyraEngine_HoF::seq_demoOuthome(WSAMovieV2 *wsaObj, int x, int y, int frm) {
return 0;
}
-int KyraEngine_HoF::seq_demoWharf(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+int KyraEngine_HoF::seq_demoWharf(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
if (!_seqFrameCounter)
seq_loadNestedSequence(0, kSequenceDemoWharf2);
@@ -1675,7 +1682,7 @@ int KyraEngine_HoF::seq_demoWharf(WSAMovieV2 *wsaObj, int x, int y, int frm) {
return 0;
}
-int KyraEngine_HoF::seq_demoDinob(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+int KyraEngine_HoF::seq_demoDinob(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
if (frm == 0) {
if (!(_seqFrameCounter/8)) {
seq_loadNestedSequence(0, kSequenceDemoDinob2);
@@ -1696,7 +1703,7 @@ int KyraEngine_HoF::seq_demoDinob(WSAMovieV2 *wsaObj, int x, int y, int frm) {
return 0;
}
-int KyraEngine_HoF::seq_demoFisher(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+int KyraEngine_HoF::seq_demoFisher(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
if (((_system->getMillis() - _seqStartTime) / (5 * _tickLength)) > 0) {
_seqStartTime = _system->getMillis();
if (!_seqFrameCounter) {
@@ -1738,14 +1745,14 @@ int KyraEngine_HoF::seq_demoFisher(WSAMovieV2 *wsaObj, int x, int y, int frm) {
return 0;
}
-int KyraEngine_HoF::seq_demoWharf2(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+int KyraEngine_HoF::seq_demoWharf2(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
if (frm == 69)
_seqWsaCurrentFrame = 8;
return frm;
}
-int KyraEngine_HoF::seq_demoDinob2(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+int KyraEngine_HoF::seq_demoDinob2(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
switch (frm) {
case 19:
seq_playTalkText(13);
@@ -1775,17 +1782,17 @@ int KyraEngine_HoF::seq_demoDinob2(WSAMovieV2 *wsaObj, int x, int y, int frm) {
return frm;
}
-int KyraEngine_HoF::seq_demoWater(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+int KyraEngine_HoF::seq_demoWater(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
if (frm == 1)
seq_playTalkText(11);
return frm;
}
-int KyraEngine_HoF::seq_demoBail(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+int KyraEngine_HoF::seq_demoBail(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
return frm;
}
-int KyraEngine_HoF::seq_demoDig(WSAMovieV2 *wsaObj, int x, int y, int frm) {
+int KyraEngine_HoF::seq_demoDig(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
return frm;
}
@@ -1806,7 +1813,7 @@ uint32 KyraEngine_HoF::seq_activeTextsTimeLeft() {
}
void KyraEngine_HoF::seq_processWSAs() {
- for (int i = 0; i < 8; i++) {
+ for (int i = 0; i < 8; i++) {
if (_activeWSA[i].flags != -1) {
if (seq_processNextSubFrame(i))
seq_resetActiveWSA(i);
@@ -2045,7 +2052,7 @@ void KyraEngine_HoF::seq_loadNestedSequence(int wsaNum, int seqNum) {
NestedSequence s = _sequences->seqn[seqNum];
if (!_activeWSA[wsaNum].movie) {
- _activeWSA[wsaNum].movie = new WSAMovieV2(this, _screen);
+ _activeWSA[wsaNum].movie = new WSAMovie_v2(this, _screen);
assert(_activeWSA[wsaNum].movie);
}
@@ -2325,17 +2332,20 @@ void KyraEngine_HoF::seq_printCreditsString(uint16 strIndex, int x, int y, const
_seqTextColor[0] = seqTextColor0;
}
-void KyraEngine_HoF::seq_playWsaSyncDialogue(uint16 strIndex, uint16 vocIndex, int textColor, int x, int y, int width, WSAMovieV2 *wsa, int firstframe, int lastframe, int wsaXpos, int wsaYpos) {
+void KyraEngine_HoF::seq_playWsaSyncDialogue(uint16 strIndex, uint16 vocIndex, int textColor, int x, int y, int width, WSAMovie_v2 *wsa, int firstframe, int lastframe, int wsaXpos, int wsaYpos) {
int dur = int(strlen(_sequenceStrings[strIndex])) * (_flags.isTalkie ? 7 : 15);
int entry = textEnabled() ? seq_setTextEntry(strIndex, x, y, dur, width) : strIndex;
_activeText[entry].textcolor = textColor;
- uint32 chatTimeout = _system->getMillis() + dur * _tickLength;
+ _seqWsaChatTimeout = _system->getMillis() + dur * _tickLength;
int curframe = firstframe;
- if (vocIndex && speechEnabled())
+ if (vocIndex && speechEnabled()) {
+ while (_sound->voiceIsPlaying() && !skipFlag())
+ delay(4);
seq_playTalkText(vocIndex);
+ }
- while (_system->getMillis() < chatTimeout && !(_abortIntroFlag || skipFlag())) {
+ while (_system->getMillis() < _seqWsaChatTimeout && !(_abortIntroFlag || skipFlag())) {
if (lastframe < 0) {
int t = ABS(lastframe);
if (t < curframe)
@@ -2345,7 +2355,7 @@ void KyraEngine_HoF::seq_playWsaSyncDialogue(uint16 strIndex, uint16 vocIndex, i
if (ABS(lastframe) < curframe)
curframe = firstframe;
- uint32 frameTimeout = _seqEndTime = _system->getMillis() + _seqFrameDelay * _tickLength;
+ _seqWsaChatFrameTimeout = _seqEndTime = _system->getMillis() + _seqFrameDelay * _tickLength;
if (wsa) {
wsa->setDrawPage(2);
wsa->setX(wsaXpos);
@@ -2358,8 +2368,8 @@ void KyraEngine_HoF::seq_playWsaSyncDialogue(uint16 strIndex, uint16 vocIndex, i
seq_processText();
uint32 tm = _system->getMillis();
- if (frameTimeout > tm && chatTimeout > tm)
- delay(MIN(frameTimeout - tm, chatTimeout - tm));
+ if (_seqWsaChatFrameTimeout > tm && _seqWsaChatTimeout > tm)
+ delay(MIN(_seqWsaChatFrameTimeout - tm, _seqWsaChatTimeout - tm));
if (speechEnabled() && !textEnabled() && !snd_voiceIsPlaying())
break;
@@ -2372,11 +2382,8 @@ void KyraEngine_HoF::seq_playWsaSyncDialogue(uint16 strIndex, uint16 vocIndex, i
if (_abortIntroFlag || skipFlag())
_sound->voiceStop();
- if (lastframe < 0) {
- int t = ABS(lastframe);
- if (t < curframe)
- curframe = t;
- }
+ if (ABS(lastframe) < curframe)
+ curframe = ABS(lastframe);
if (curframe == firstframe)
curframe++;
@@ -2390,27 +2397,46 @@ void KyraEngine_HoF::seq_displayScrollText(uint8 *data, const ScreenDim *d, int
if (!data)
return;
- static const char mark[] = { 5, 13, 0};
+ static const char mark[] = { 5, 13, 0 };
_screen->clearPage(tempPage1);
_screen->clearPage(tempPage2);
_screen->copyRegion(d->sx << 3, d->sy, d->sx << 3, d->sy, d->w << 3, d->h, 0, tempPage1);
- uint8 *tmp = new uint8[397];
- memset(tmp, 0, 397);
- uint8 **tmpStringTable = new uint8*[35];
+ struct ScrollTextData {
+ int16 x;
+ int16 y;
+ uint8 *text;
+ byte unk1;
+ byte height;
+ byte adjust;
+
+ ScrollTextData() {
+ x = 0; // 0 11
+ y = 0; // 2 13
+ text = 0; // 4 15
+ unk1 = 0; // 8 19
+ height = 0; // 9 20
+ adjust = 0; // 10 21
+ }
+ };
+
+ ScrollTextData *textData = new ScrollTextData[36];
uint8 *ptr = data;
- int strTblIndex = 0;
bool loop = true;
int cnt = 0;
while (loop) {
- uint32 endTime = _system->getMillis() + speed * _tickLength;
+ _seqSubFrameEndTimeInternal = _system->getMillis() + speed * _tickLength;
while (cnt < 35 && *ptr) {
- int m = cnt * 11;
- uint16 cH = cnt ? READ_LE_UINT16(&tmp[m + 2]) + tmp[m + 9] + (tmp[m + 9] >> 3) : d->h;
+ uint16 cH;
+
+ if (cnt)
+ cH = textData[cnt].y + textData[cnt].height + (textData[cnt].height >> 3);
+ else
+ cH = d->h;
char *str = (char*)ptr;
@@ -2418,12 +2444,15 @@ void KyraEngine_HoF::seq_displayScrollText(uint8 *data, const ScreenDim *d, int
if (!ptr)
ptr = (uint8*)strchr(str, 0);
- tmp[m + 19] = *ptr;
+ textData[cnt + 1].unk1 = *ptr;
*ptr = 0;
- if (tmp[m + 19])
+ if (textData[cnt + 1].unk1)
ptr++;
- tmp[m + 21] = (*str == 3 || *str == 4) ? tmp[m + 21] = *str++ : 0;
+ if (*str == 3 || *str == 4)
+ textData[cnt + 1].adjust = *str++;
+ else
+ textData[cnt + 1].adjust = 0;
_screen->setFont(fid1);
@@ -2434,18 +2463,25 @@ void KyraEngine_HoF::seq_displayScrollText(uint8 *data, const ScreenDim *d, int
str++;
}
- tmp[m + 20] = _screen->getFontHeight();
+ textData[cnt + 1].height = _screen->getFontHeight();
- WRITE_LE_UINT16(&tmp[m + 11], (tmp[m + 21] == 3) ? 157 - _screen->getTextWidth(str) :
- ((tmp[m + 21] == 4) ? 161 : (((d->w << 3) - _screen->getTextWidth(str)) >> 1) + 1));
+ switch (textData[cnt + 1].adjust) {
+ case 3:
+ textData[cnt + 1].x = 157 - _screen->getTextWidth(str);
+ break;
+ case 4:
+ textData[cnt + 1].x = 161;
+ break;
+ default:
+ textData[cnt + 1].x = (((d->w << 3) - _screen->getTextWidth(str)) >> 1) + 1;
+ break;
+ }
- if (tmp[m + 8] == 5)
- cH -= (tmp[m + 9] + (tmp[m + 9] >> 3));
+ if (textData[cnt].unk1 == 5)
+ cH -= (textData[cnt].height + (textData[cnt].height >> 3));
- WRITE_LE_UINT16(&tmp[m + 13], cH);
- WRITE_LE_UINT32(&tmp[m + 15], strTblIndex);
- tmpStringTable[strTblIndex] = (uint8*) str;
- strTblIndex = (strTblIndex + 1) % 35;
+ textData[cnt + 1].y = cH;
+ textData[cnt + 1].text = (uint8*) str;
cnt++;
}
@@ -2455,11 +2491,10 @@ void KyraEngine_HoF::seq_displayScrollText(uint8 *data, const ScreenDim *d, int
bool palCycle = 0;
while (cnt2 < cnt) {
- int m = cnt2 * 11;
- const char *str = (const char*)tmpStringTable[READ_LE_UINT32(&tmp[m + 15])];
+ const char *str = (const char*)textData[cnt2 + 1].text;
const char *str2 = str;
- uint16 cW = READ_LE_UINT16(&tmp[m + 11]) - 10;
- uint16 cH = READ_LE_UINT16(&tmp[m + 13]);
+ int16 cW = textData[cnt2 + 1].x - 10;
+ int16 cH = textData[cnt2 + 1].y;
int x = (d->sx << 3) + cW;
int y = d->sy + cH;
int col1 = 255;
@@ -2467,7 +2502,7 @@ void KyraEngine_HoF::seq_displayScrollText(uint8 *data, const ScreenDim *d, int
if (cH < d->h) {
_screen->setCurPage(tempPage2);
_screen->setFont(fid1);
- if (tmp[m + 20] != _screen->getFontHeight())
+ if (textData[cnt2 + 1].height != _screen->getFontHeight())
_screen->setFont(fid2);
if (specialData) {
@@ -2498,18 +2533,18 @@ void KyraEngine_HoF::seq_displayScrollText(uint8 *data, const ScreenDim *d, int
_screen->setCurPage(0);
}
- WRITE_LE_UINT16(&tmp[m + 13], READ_LE_UINT16(&tmp[m + 13]) - step);
+ textData[cnt2 + 1].y -= step;
cnt2++;
}
_screen->copyRegion(d->sx << 3, d->sy, d->sx << 3, d->sy, d->w << 3, d->h, tempPage2, 0);
_screen->updateScreen();
- if ((int16)READ_LE_UINT16(&tmp[13]) < -10) {
- tmpStringTable[tmp[15]] += strlen((char*)tmpStringTable[tmp[15]]);
- tmpStringTable[tmp[15]][0] = tmp[19];
+ if (textData[1].y < -10) {
+ textData[1].text += strlen((char*)textData[1].text);
+ textData[1].text[0] = textData[1].unk1;
cnt--;
- memcpy(&tmp[11], &tmp[22], cnt * 11);
+ memcpy(&textData[1], &textData[2], cnt * sizeof(ScrollTextData));
}
if (palCycle) {
@@ -2519,9 +2554,9 @@ void KyraEngine_HoF::seq_displayScrollText(uint8 *data, const ScreenDim *d, int
_screen->setScreenPalette(_screen->_currentPalette);
}
- delayUntil(endTime);
+ delayUntil(_seqSubFrameEndTimeInternal);
- if ((cnt < 36) && ((d->sy + d->h) > (READ_LE_UINT16(&tmp[cnt * 11 + 2]) + tmp[cnt * 11 + 9])) && !skipFlag()) {
+ if ((cnt < 36) && ((d->sy + d->h) > (textData[cnt].y + textData[cnt].height)) && !skipFlag()) {
resetSkipFlag();
delay(_tickLength * 500);
cnt = 0;
@@ -2537,8 +2572,7 @@ void KyraEngine_HoF::seq_displayScrollText(uint8 *data, const ScreenDim *d, int
_abortIntroFlag= false;
resetSkipFlag();
- delete [] tmp;
- delete [] tmpStringTable;
+ delete[] textData;
}
void KyraEngine_HoF::seq_scrollPage() {
@@ -2571,7 +2605,7 @@ void KyraEngine_HoF::seq_scrollPage() {
}
void KyraEngine_HoF::seq_showStarcraftLogo() {
- WSAMovieV2 *ci = new WSAMovieV2(this, _screen);
+ WSAMovie_v2 *ci = new WSAMovie_v2(this, _screen);
assert(ci);
_screen->clearPage(2);
_res->loadPakFile("INTROGEN.PAK");
@@ -2589,20 +2623,20 @@ void KyraEngine_HoF::seq_showStarcraftLogo() {
_screen->copyPage(2, 0);
_screen->fadeFromBlack();
for (int i = 1; i < endframe; i++) {
- uint32 endTime = _system->getMillis() + 50;
+ _seqEndTime = _system->getMillis() + 50;
if (skipFlag())
break;
ci->displayFrame(i, 0);
_screen->copyPage(2, 0);
_screen->updateScreen();
- delay(endTime - _system->getMillis());
+ delay(_seqEndTime - _system->getMillis());
}
if(!skipFlag()) {
- uint32 endTime = _system->getMillis() + 50;
+ _seqEndTime = _system->getMillis() + 50;
ci->displayFrame(0, 0);
_screen->copyPage(2, 0);
_screen->updateScreen();
- delay(endTime - _system->getMillis());
+ delay(_seqEndTime - _system->getMillis());
}
_screen->fadeToBlack();
_screen->showMouse();
@@ -2613,7 +2647,7 @@ void KyraEngine_HoF::seq_showStarcraftLogo() {
void KyraEngine_HoF::seq_init() {
_seqProcessedString = new char[200];
- _seqWsa = new WSAMovieV2(this, _screen);
+ _seqWsa = new WSAMovie_v2(this, _screen);
_activeWSA = new ActiveWSA[8];
_activeText = new ActiveText[10];
@@ -2623,12 +2657,12 @@ void KyraEngine_HoF::seq_init() {
int numShp = -1;
if (_flags.isDemo && !_flags.isTalkie) {
- _demoAnimData = _staticres->loadHofShapeAnimDataV1(k2SeqplayShapeAnimData, _itemAnimDataSize);
+ _demoAnimData = _staticres->loadShapeAnimData_v1(k2SeqplayShapeAnimData, _itemAnimDataSize);
uint8 *shp = _res->fileData("icons.shp", 0);
uint32 outsize = READ_LE_UINT16(shp + 4);
_animShapeFiledata = new uint8[outsize];
Screen::decodeFrame4(shp + 10, _animShapeFiledata, outsize);
- delete [] shp;
+ delete[] shp;
do {
numShp++;
@@ -2647,26 +2681,24 @@ void KyraEngine_HoF::seq_init() {
}
void KyraEngine_HoF::seq_uninit() {
- delete [] _seqProcessedString;
+ delete[] _seqProcessedString;
_seqProcessedString = NULL;
- delete [] _activeWSA;
+ delete[] _activeWSA;
_activeWSA = NULL;
- delete [] _activeText;
+ delete[] _activeText;
_activeText = NULL;
delete _seqWsa;
_seqWsa = NULL;
- delete [] _animShapeFiledata;
+ delete[] _animShapeFiledata;
_animShapeFiledata = 0;
if (_flags.isDemo && !_flags.isTalkie)
_staticres->unloadId(k2SeqplayShapeAnimData);
- _gameShapes.clear();
-
delete _menu;
_menu = 0;
}
@@ -2772,7 +2804,7 @@ void KyraEngine_HoF::seq_makeBookAppear() {
}
closeInvWsa();
- delete [] rect;
+ delete[] rect;
_invWsa.running = false;
_screen->showMouse();
@@ -2780,3 +2812,4 @@ void KyraEngine_HoF::seq_makeBookAppear() {
} // end of namespace Kyra
+
diff --git a/engines/kyra/sequences_v1.cpp b/engines/kyra/sequences_lok.cpp
index 01906d2529..b30568c7e2 100644
--- a/engines/kyra/sequences_v1.cpp
+++ b/engines/kyra/sequences_lok.cpp
@@ -23,14 +23,14 @@
*
*/
-#include "kyra/kyra.h"
+#include "kyra/kyra_lok.h"
#include "kyra/seqplayer.h"
-#include "kyra/screen_v1.h"
+#include "kyra/screen_lok.h"
#include "kyra/resource.h"
#include "kyra/sound.h"
#include "kyra/sprites.h"
#include "kyra/wsamovie.h"
-#include "kyra/animator_v1.h"
+#include "kyra/animator_lok.h"
#include "kyra/text.h"
#include "kyra/timer.h"
@@ -40,8 +40,8 @@
namespace Kyra {
-void KyraEngine_v1::seq_demo() {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::seq_demo()");
+void KyraEngine_LoK::seq_demo() {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::seq_demo()");
snd_playTheme(0, 2);
@@ -90,18 +90,18 @@ void KyraEngine_v1::seq_demo() {
_sound->haltTrack();
}
-void KyraEngine_v1::seq_intro() {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::seq_intro()");
+void KyraEngine_LoK::seq_intro() {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::seq_intro()");
if (_flags.isTalkie)
_res->loadPakFile("INTRO.VRM");
static const IntroProc introProcTable[] = {
- &KyraEngine_v1::seq_introLogos,
- &KyraEngine_v1::seq_introStory,
- &KyraEngine_v1::seq_introMalcolmTree,
- &KyraEngine_v1::seq_introKallakWriting,
- &KyraEngine_v1::seq_introKallakMalcolm
+ &KyraEngine_LoK::seq_introLogos,
+ &KyraEngine_LoK::seq_introStory,
+ &KyraEngine_LoK::seq_introMalcolmTree,
+ &KyraEngine_LoK::seq_introKallakWriting,
+ &KyraEngine_LoK::seq_introKallakMalcolm
};
Common::InSaveFile *in;
@@ -130,8 +130,8 @@ void KyraEngine_v1::seq_intro() {
_res->unloadPakFile("INTRO.VRM");
}
-void KyraEngine_v1::seq_introLogos() {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::seq_introLogos()");
+void KyraEngine_LoK::seq_introLogos() {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::seq_introLogos()");
if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98) {
_screen->loadBitmap("LOGO.CPS", 3, 3, _screen->_currentPalette);
@@ -176,7 +176,7 @@ void KyraEngine_v1::seq_introLogos() {
_screen->setScreenPalette(_screen->_currentPalette);
}
- if (_seq->playSequence(_seq_KyrandiaLogo, _skipFlag) && !seq_skipSequence() || _quitFlag) {
+ if ((_seq->playSequence(_seq_KyrandiaLogo, _skipFlag) && !seq_skipSequence()) || _quitFlag) {
_screen->fadeToBlack();
_screen->clearPage(0);
return;
@@ -232,8 +232,8 @@ void KyraEngine_v1::seq_introLogos() {
_seq->playSequence(_seq_Forest, true);
}
-void KyraEngine_v1::seq_introStory() {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::seq_introStory()");
+void KyraEngine_LoK::seq_introStory() {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::seq_introStory()");
_screen->clearPage(3);
_screen->clearPage(0);
@@ -279,15 +279,15 @@ void KyraEngine_v1::seq_introStory() {
delay(360 * _tickLength);
}
-void KyraEngine_v1::seq_introMalcolmTree() {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::seq_introMalcolmTree()");
+void KyraEngine_LoK::seq_introMalcolmTree() {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::seq_introMalcolmTree()");
_screen->_curPage = 0;
_screen->clearPage(3);
_seq->playSequence(_seq_MalcolmTree, true);
}
-void KyraEngine_v1::seq_introKallakWriting() {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::seq_introKallakWriting()");
+void KyraEngine_LoK::seq_introKallakWriting() {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::seq_introKallakWriting()");
_seq->makeHandShapes();
_screen->setAnimBlockPtr(5060);
_screen->_charWidth = -2;
@@ -295,13 +295,13 @@ void KyraEngine_v1::seq_introKallakWriting() {
_seq->playSequence(_seq_KallakWriting, true);
}
-void KyraEngine_v1::seq_introKallakMalcolm() {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::seq_introKallakMalcolm()");
+void KyraEngine_LoK::seq_introKallakMalcolm() {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::seq_introKallakMalcolm()");
_screen->clearPage(3);
_seq->playSequence(_seq_KallakMalcolm, true);
}
-void KyraEngine_v1::seq_createAmuletJewel(int jewel, int page, int noSound, int drawOnly) {
+void KyraEngine_LoK::seq_createAmuletJewel(int jewel, int page, int noSound, int drawOnly) {
debugC(9, kDebugLevelMain, "seq_createAmuletJewel(%d, %d, %d, %d)", jewel, page, noSound, drawOnly);
static const uint16 specialJewelTable[] = {
0x167, 0x162, 0x15D, 0x158, 0x153, 0xFFFF
@@ -361,7 +361,7 @@ void KyraEngine_v1::seq_createAmuletJewel(int jewel, int page, int noSound, int
setGameFlag(0x55+jewel);
}
-void KyraEngine_v1::seq_brandonHealing() {
+void KyraEngine_LoK::seq_brandonHealing() {
debugC(9, kDebugLevelMain, "seq_brandonHealing()");
if (!(_deathHandler & 8))
return;
@@ -392,7 +392,7 @@ void KyraEngine_v1::seq_brandonHealing() {
_screen->showMouse();
}
-void KyraEngine_v1::seq_brandonHealing2() {
+void KyraEngine_LoK::seq_brandonHealing2() {
debugC(9, kDebugLevelMain, "seq_brandonHealing2()");
_screen->hideMouse();
checkAmuletAnimFlags();
@@ -416,7 +416,7 @@ void KyraEngine_v1::seq_brandonHealing2() {
characterSays(2011, _poisonGone[1], 0, -2);
}
-void KyraEngine_v1::seq_poisonDeathNow(int now) {
+void KyraEngine_LoK::seq_poisonDeathNow(int now) {
debugC(9, kDebugLevelMain, "seq_poisonDeathNow(%d)", now);
if (!(_brandonStatusBit & 1))
return;
@@ -437,7 +437,7 @@ void KyraEngine_v1::seq_poisonDeathNow(int now) {
}
}
-void KyraEngine_v1::seq_poisonDeathNowAnim() {
+void KyraEngine_LoK::seq_poisonDeathNowAnim() {
debugC(9, kDebugLevelMain, "seq_poisonDeathNowAnim()");
_screen->hideMouse();
checkAmuletAnimFlags();
@@ -478,7 +478,7 @@ void KyraEngine_v1::seq_poisonDeathNowAnim() {
_screen->showMouse();
}
-void KyraEngine_v1::seq_playFluteAnimation() {
+void KyraEngine_LoK::seq_playFluteAnimation() {
debugC(9, kDebugLevelMain, "seq_playFluteAnimation()");
_screen->hideMouse();
checkAmuletAnimFlags();
@@ -532,7 +532,7 @@ void KyraEngine_v1::seq_playFluteAnimation() {
}
}
-void KyraEngine_v1::seq_winterScroll1() {
+void KyraEngine_LoK::seq_winterScroll1() {
debugC(9, kDebugLevelMain, "seq_winterScroll1()");
_screen->hideMouse();
checkAmuletAnimFlags();
@@ -613,7 +613,7 @@ void KyraEngine_v1::seq_winterScroll1() {
_screen->showMouse();
}
-void KyraEngine_v1::seq_winterScroll2() {
+void KyraEngine_LoK::seq_winterScroll2() {
debugC(9, kDebugLevelMain, "seq_winterScroll2()");
_screen->hideMouse();
checkAmuletAnimFlags();
@@ -642,7 +642,7 @@ void KyraEngine_v1::seq_winterScroll2() {
_screen->showMouse();
}
-void KyraEngine_v1::seq_makeBrandonInv() {
+void KyraEngine_LoK::seq_makeBrandonInv() {
debugC(9, kDebugLevelMain, "seq_makeBrandonInv()");
if (_deathHandler == 8)
return;
@@ -668,7 +668,7 @@ void KyraEngine_v1::seq_makeBrandonInv() {
_screen->showMouse();
}
-void KyraEngine_v1::seq_makeBrandonNormal() {
+void KyraEngine_LoK::seq_makeBrandonNormal() {
debugC(9, kDebugLevelMain, "seq_makeBrandonNormal()");
_screen->hideMouse();
_brandonStatusBit |= 0x40;
@@ -684,7 +684,7 @@ void KyraEngine_v1::seq_makeBrandonNormal() {
_screen->showMouse();
}
-void KyraEngine_v1::seq_makeBrandonNormal2() {
+void KyraEngine_LoK::seq_makeBrandonNormal2() {
debugC(9, kDebugLevelMain, "seq_makeBrandonNormal2()");
_screen->hideMouse();
assert(_brandonToWispTable);
@@ -710,7 +710,7 @@ void KyraEngine_v1::seq_makeBrandonNormal2() {
_screen->showMouse();
}
-void KyraEngine_v1::seq_makeBrandonWisp() {
+void KyraEngine_LoK::seq_makeBrandonWisp() {
debugC(9, kDebugLevelMain, "seq_makeBrandonWisp()");
if (_deathHandler == 8)
return;
@@ -752,7 +752,7 @@ void KyraEngine_v1::seq_makeBrandonWisp() {
_screen->showMouse();
}
-void KyraEngine_v1::seq_dispelMagicAnimation() {
+void KyraEngine_LoK::seq_dispelMagicAnimation() {
debugC(9, kDebugLevelMain, "seq_dispelMagicAnimation()");
if (_deathHandler == 8)
return;
@@ -794,7 +794,7 @@ void KyraEngine_v1::seq_dispelMagicAnimation() {
_screen->showMouse();
}
-void KyraEngine_v1::seq_fillFlaskWithWater(int item, int type) {
+void KyraEngine_LoK::seq_fillFlaskWithWater(int item, int type) {
debugC(9, kDebugLevelMain, "seq_fillFlaskWithWater(%d, %d)", item, type);
int newItem = -1;
static const uint8 flaskTable1[] = { 0x46, 0x48, 0x4A, 0x4C };
@@ -827,8 +827,8 @@ void KyraEngine_v1::seq_fillFlaskWithWater(int item, int type) {
characterSays(voiceEntries[type], _fullFlask[type], 0, -2);
}
-void KyraEngine_v1::seq_playDrinkPotionAnim(int item, int unk2, int flags) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::seq_playDrinkPotionAnim(%d, %d, %d)", item, unk2, flags);
+void KyraEngine_LoK::seq_playDrinkPotionAnim(int item, int unk2, int flags) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::seq_playDrinkPotionAnim(%d, %d, %d)", item, unk2, flags);
uint8 red, green, blue;
switch (item) {
@@ -919,8 +919,8 @@ void KyraEngine_v1::seq_playDrinkPotionAnim(int item, int unk2, int flags) {
_screen->showMouse();
}
-int KyraEngine_v1::seq_playEnd() {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::seq_playEnd()");
+int KyraEngine_LoK::seq_playEnd() {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::seq_playEnd()");
if (_endSequenceSkipFlag)
return 0;
@@ -931,13 +931,13 @@ int KyraEngine_v1::seq_playEnd() {
if (_endSequenceNeedLoading) {
snd_playWanderScoreViaMap(50, 1);
setupPanPages();
- _finalA = new WSAMovieV1(this);
+ _finalA = new WSAMovie_v1(this);
assert(_finalA);
_finalA->open("finala.wsa", 1, 0);
- _finalB = new WSAMovieV1(this);
+ _finalB = new WSAMovie_v1(this);
assert(_finalB);
_finalB->open("finalb.wsa", 1, 0);
- _finalC = new WSAMovieV1(this);
+ _finalC = new WSAMovie_v1(this);
assert(_finalC);
_endSequenceNeedLoading = 0;
_finalC->open("finalc.wsa", 1, 0);
@@ -981,7 +981,7 @@ int KyraEngine_v1::seq_playEnd() {
_screen->setScreenPalette(_screen->_currentPalette);
_screen->shuffleScreen(8, 8, 304, 128, 2, 0, 1, 0);
uint32 nextTime = _system->getMillis() + 120 * _tickLength;
- _finalA = new WSAMovieV1(this);
+ _finalA = new WSAMovie_v1(this);
assert(_finalA);
_finalA->open("finald.wsa", 1, 0);
_finalA->setX(8); _finalA->setY(8);
@@ -1012,8 +1012,8 @@ int KyraEngine_v1::seq_playEnd() {
return 0;
}
-void KyraEngine_v1::seq_brandonToStone() {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::seq_brandonToStone()");
+void KyraEngine_LoK::seq_brandonToStone() {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::seq_brandonToStone()");
_screen->hideMouse();
assert(_brandonStoneTable);
setupShapes123(_brandonStoneTable, 14, 0);
@@ -1028,8 +1028,8 @@ void KyraEngine_v1::seq_brandonToStone() {
_screen->showMouse();
}
-void KyraEngine_v1::seq_playEnding() {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::seq_playEnding()");
+void KyraEngine_LoK::seq_playEnding() {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::seq_playEnding()");
if (_quitFlag)
return;
_screen->hideMouse();
@@ -1052,8 +1052,8 @@ void KyraEngine_v1::seq_playEnding() {
seq_playCredits();
}
-void KyraEngine_v1::seq_playCredits() {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::seq_playCredits()");
+void KyraEngine_LoK::seq_playCredits() {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::seq_playCredits()");
static const uint8 colorMap[] = { 0, 0, 0xC, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
static const char stringTerms[] = { 0x5, 0xd, 0x0};
static const int numStrings = 250;
@@ -1091,12 +1091,12 @@ void KyraEngine_v1::seq_playCredits() {
if (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98) {
int sizeTmp = 0;
- const uint8 *bufferTmp = _staticres->loadRawData(kCreditsStrings, sizeTmp);
+ const uint8 *bufferTmp = _staticres->loadRawData(k1CreditsStrings, sizeTmp);
buffer = new uint8[sizeTmp];
assert(buffer);
memcpy(buffer, bufferTmp, sizeTmp);
size = sizeTmp;
- _staticres->unloadId(kCreditsStrings);
+ _staticres->unloadId(k1CreditsStrings);
} else {
buffer = _res->fileData("CREDITS.TXT", &size);
assert(buffer);
@@ -1202,20 +1202,20 @@ void KyraEngine_v1::seq_playCredits() {
_system->delayMillis(nextLoop - now);
}
- delete [] buffer;
+ delete[] buffer;
_screen->fadeToBlack();
_screen->clearCurPage();
_screen->showMouse();
}
-bool KyraEngine_v1::seq_skipSequence() const {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::seq_skipSequence()");
+bool KyraEngine_LoK::seq_skipSequence() const {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::seq_skipSequence()");
return _quitFlag || _abortIntroFlag;
}
-int KyraEngine_v1::handleMalcolmFlag() {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::handleMalcolmFlag()");
+int KyraEngine_LoK::handleMalcolmFlag() {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::handleMalcolmFlag()");
static uint16 frame = 0;
static uint32 timer1 = 0;
static uint32 timer2 = 0;
@@ -1383,8 +1383,8 @@ int KyraEngine_v1::handleMalcolmFlag() {
return 0;
}
-int KyraEngine_v1::handleBeadState() {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::handleBeadState()");
+int KyraEngine_LoK::handleBeadState() {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::handleBeadState()");
static uint32 timer1 = 0;
static uint32 timer2 = 0;
static BeadState beadState1 = { -1, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
@@ -1603,8 +1603,8 @@ int KyraEngine_v1::handleBeadState() {
return 0;
}
-void KyraEngine_v1::initBeadState(int x, int y, int x2, int y2, int unk, BeadState *ptr) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::initBeadState(%d, %d, %d, %d, %d, %p)", x, y, x2, y2, unk, (const void *)ptr);
+void KyraEngine_LoK::initBeadState(int x, int y, int x2, int y2, int unk, BeadState *ptr) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::initBeadState(%d, %d, %d, %d, %d, %p)", x, y, x2, y2, unk, (const void *)ptr);
ptr->unk9 = unk;
int xDiff = x2 - x;
int yDiff = y2 - y;
@@ -1637,8 +1637,8 @@ void KyraEngine_v1::initBeadState(int x, int y, int x2, int y2, int unk, BeadSta
ptr->unk8 = unk2;
}
-int KyraEngine_v1::processBead(int x, int y, int &x2, int &y2, BeadState *ptr) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::processBead(%d, %d, %p, %p, %p)", x, y, (const void *)&x2, (const void *)&y2, (const void *)ptr);
+int KyraEngine_LoK::processBead(int x, int y, int &x2, int &y2, BeadState *ptr) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::processBead(%d, %d, %p, %p, %p)", x, y, (const void *)&x2, (const void *)&y2, (const void *)ptr);
if (x == ptr->dstX && y == ptr->dstY)
return 1;
@@ -1674,21 +1674,21 @@ int KyraEngine_v1::processBead(int x, int y, int &x2, int &y2, BeadState *ptr) {
return 0;
}
-void KyraEngine_v1::setupPanPages() {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::setupPanPages()");
+void KyraEngine_LoK::setupPanPages() {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::setupPanPages()");
_screen->savePageToDisk("BKGD.PG", 2);
_screen->loadBitmap("BEAD.CPS", 3, 3, 0);
if (_flags.platform == Common::kPlatformMacintosh || _flags.platform == Common::kPlatformAmiga) {
int pageBackUp = _screen->_curPage;
_screen->_curPage = 2;
- delete [] _panPagesTable[19];
+ delete[] _panPagesTable[19];
_panPagesTable[19] = _screen->encodeShape(0, 0, 16, 9, 0);
assert(_panPagesTable[19]);
int curX = 16;
for (int i = 0; i < 19; ++i) {
- delete [] _panPagesTable[i];
+ delete[] _panPagesTable[i];
_panPagesTable[i] = _screen->encodeShape(curX, 0, 8, 5, 0);
assert(_panPagesTable[i]);
curX += 8;
@@ -1697,7 +1697,7 @@ void KyraEngine_v1::setupPanPages() {
_screen->_curPage = pageBackUp;
} else {
for (int i = 0; i <= 19; ++i) {
- delete [] _panPagesTable[i];
+ delete[] _panPagesTable[i];
_panPagesTable[i] = _seq->setPanPages(3, i);
assert(_panPagesTable[i]);
}
@@ -1705,18 +1705,18 @@ void KyraEngine_v1::setupPanPages() {
_screen->loadPageFromDisk("BKGD.PG", 2);
}
-void KyraEngine_v1::freePanPages() {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::freePanPages()");
+void KyraEngine_LoK::freePanPages() {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::freePanPages()");
delete _endSequenceBackUpRect;
_endSequenceBackUpRect = 0;
for (int i = 0; i <= 19; ++i) {
- delete [] _panPagesTable[i];
+ delete[] _panPagesTable[i];
_panPagesTable[i] = 0;
}
}
-void KyraEngine_v1::closeFinalWsa() {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::closeFinalWsa()");
+void KyraEngine_LoK::closeFinalWsa() {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::closeFinalWsa()");
delete _finalA;
_finalA = 0;
delete _finalB;
@@ -1727,7 +1727,7 @@ void KyraEngine_v1::closeFinalWsa() {
_endSequenceNeedLoading = 1;
}
-void KyraEngine_v1::updateKyragemFading() {
+void KyraEngine_LoK::updateKyragemFading() {
static const uint8 kyraGemPalette[0x28] = {
0x3F, 0x3B, 0x38, 0x34, 0x32, 0x2F, 0x2C, 0x29, 0x25, 0x22,
0x1F, 0x1C, 0x19, 0x16, 0x12, 0x0F, 0x0C, 0x0A, 0x06, 0x03,
@@ -1797,8 +1797,8 @@ void KyraEngine_v1::updateKyragemFading() {
_kyragemFadingState.timerCount = _system->getMillis() + 120 * _tickLength;
}
-void KyraEngine_v1::drawJewelPress(int jewel, int drawSpecial) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::drawJewelPress(%d, %d)", jewel, drawSpecial);
+void KyraEngine_LoK::drawJewelPress(int jewel, int drawSpecial) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::drawJewelPress(%d, %d)", jewel, drawSpecial);
_screen->hideMouse();
int shape = 0;
@@ -1822,8 +1822,8 @@ void KyraEngine_v1::drawJewelPress(int jewel, int drawSpecial) {
_screen->showMouse();
}
-void KyraEngine_v1::drawJewelsFadeOutStart() {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::drawJewelsFadeOutStart()");
+void KyraEngine_LoK::drawJewelsFadeOutStart() {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::drawJewelsFadeOutStart()");
static const uint16 jewelTable1[] = { 0x164, 0x15F, 0x15A, 0x155, 0x150, 0xFFFF };
static const uint16 jewelTable2[] = { 0x163, 0x15E, 0x159, 0x154, 0x14F, 0xFFFF };
static const uint16 jewelTable3[] = { 0x166, 0x160, 0x15C, 0x157, 0x152, 0xFFFF };
@@ -1842,8 +1842,8 @@ void KyraEngine_v1::drawJewelsFadeOutStart() {
}
}
-void KyraEngine_v1::drawJewelsFadeOutEnd(int jewel) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::drawJewelsFadeOutEnd(%d)", jewel);
+void KyraEngine_LoK::drawJewelsFadeOutEnd(int jewel) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::drawJewelsFadeOutEnd(%d)", jewel);
static const uint16 jewelTable[] = { 0x153, 0x158, 0x15D, 0x162, 0x148, 0xFFFF };
int newDelay = 0;
diff --git a/engines/kyra/sequences_mr.cpp b/engines/kyra/sequences_mr.cpp
index 8c826e2048..f41ed9c2f3 100644
--- a/engines/kyra/sequences_mr.cpp
+++ b/engines/kyra/sequences_mr.cpp
@@ -241,7 +241,7 @@ void KyraEngine_MR::uninitAnimationShapes(int count, uint8 *filedata) {
debugC(9, kDebugLevelAnimator, "KyraEngine_MR::uninitAnimationShapes(%d, %p)", count, (const void*)filedata);
for (int i = 0; i < count; ++i)
_gameShapes[9+i] = 0;
- delete [] filedata;
+ delete[] filedata;
setNextIdleAnimTimer();
}
diff --git a/engines/kyra/sequences_v2.cpp b/engines/kyra/sequences_v2.cpp
index aef510a616..cc4b8528a4 100644
--- a/engines/kyra/sequences_v2.cpp
+++ b/engines/kyra/sequences_v2.cpp
@@ -102,17 +102,14 @@ void KyraEngine_v2::processAnimationScript(int allowSkip, int resetChar) {
uint32 delayEnd = _system->getMillis() + _animDelayTime * _tickLength;
- while ((!skipFlag() || !allowSkip) && _system->getMillis() < delayEnd) {
- if (_chatText)
- updateWithText();
- else
- update();
+ while ((!skipFlag() || !allowSkip) && _system->getMillis() < delayEnd)
+ delay(10, true);
- delay(10);
- }
-
- if (skipFlag())
+ if (skipFlag()) {
resetSkipFlag();
+ if (allowSkip)
+ break;
+ }
}
if (resetChar) {
diff --git a/engines/kyra/sound.cpp b/engines/kyra/sound.cpp
index 887e9c7267..f56c43aabd 100644
--- a/engines/kyra/sound.cpp
+++ b/engines/kyra/sound.cpp
@@ -40,7 +40,7 @@
namespace Kyra {
-Sound::Sound(KyraEngine *vm, Audio::Mixer *mixer)
+Sound::Sound(KyraEngine_v1 *vm, Audio::Mixer *mixer)
: _vm(vm), _mixer(mixer), _soundChannels(), _musicEnabled(1),
_sfxEnabled(true), _soundDataList(0) {
}
@@ -50,9 +50,9 @@ Sound::~Sound() {
bool Sound::voiceFileIsPresent(const char *file) {
char filenamebuffer[25];
- for (int i = 0; _supportedCodes[i].fileext; ++i) {
+ for (int i = 0; _supportedCodecs[i].fileext; ++i) {
strcpy(filenamebuffer, file);
- strcat(filenamebuffer, _supportedCodes[i].fileext);
+ strcat(filenamebuffer, _supportedCodecs[i].fileext);
if (_vm->resource()->getFileSize(filenamebuffer) > 0)
return true;
}
@@ -66,51 +66,48 @@ bool Sound::voiceFileIsPresent(const char *file) {
return false;
}
-bool Sound::voicePlay(const char *file, bool isSfx) {
- uint32 fileSize = 0;
- byte *fileData = 0;
- bool found = false;
+int32 Sound::voicePlay(const char *file, bool isSfx) {
char filenamebuffer[25];
int h = 0;
while (_mixer->isSoundHandleActive(_soundChannels[h].channelHandle) && h < kNumChannelHandles)
h++;
if (h >= kNumChannelHandles)
- return false;
+ return 0;
Audio::AudioStream *audioStream = 0;
- for (int i = 0; _supportedCodes[i].fileext; ++i) {
+ for (int i = 0; _supportedCodecs[i].fileext; ++i) {
strcpy(filenamebuffer, file);
- strcat(filenamebuffer, _supportedCodes[i].fileext);
+ strcat(filenamebuffer, _supportedCodecs[i].fileext);
Common::SeekableReadStream *stream = _vm->resource()->getFileStream(filenamebuffer);
if (!stream)
continue;
- audioStream = _supportedCodes[i].streamFunc(stream, true, 0, 0, 1);
- found = true;
+ audioStream = _supportedCodecs[i].streamFunc(stream, true, 0, 0, 1);
break;
}
- if (!found) {
+ if (!audioStream) {
strcpy(filenamebuffer, file);
strcat(filenamebuffer, ".VOC");
- fileData = _vm->resource()->fileData(filenamebuffer, &fileSize);
+ uint32 fileSize = 0;
+ byte *fileData = _vm->resource()->fileData(filenamebuffer, &fileSize);
if (!fileData)
- return false;
+ return 0;
Common::MemoryReadStream vocStream(fileData, fileSize);
audioStream = Audio::makeVOCStream(vocStream);
+
+ delete[] fileData;
+ fileSize = 0;
}
_soundChannels[h].file = file;
_mixer->playInputStream(isSfx ? Audio::Mixer::kSFXSoundType : Audio::Mixer::kSpeechSoundType, &_soundChannels[h].channelHandle, audioStream);
- delete [] fileData;
- fileSize = 0;
-
- return true;
+ return audioStream->getTotalPlayTime();
}
void Sound::voiceStop(const char *file) {
@@ -143,9 +140,21 @@ bool Sound::voiceIsPlaying(const char *file) {
return res;
}
+uint32 Sound::voicePlayedTime(const char *file) {
+ if (!file)
+ return 0;
+
+ for (int i = 0; i < kNumChannelHandles; ++i) {
+ if (_soundChannels[i].file == file)
+ return _mixer->getSoundElapsedTime(_soundChannels[i].channelHandle);
+ }
+
+ return 0;
+}
+
#pragma mark -
-SoundMidiPC::SoundMidiPC(KyraEngine *vm, Audio::Mixer *mixer, MidiDriver *driver) : Sound(vm, mixer) {
+SoundMidiPC::SoundMidiPC(KyraEngine_v1 *vm, Audio::Mixer *mixer, MidiDriver *driver) : Sound(vm, mixer) {
_driver = driver;
_passThrough = false;
@@ -320,7 +329,7 @@ void SoundMidiPC::metaEvent(byte type, byte *data, uint16 length) {
struct DeleterArray {
void operator ()(byte *ptr) {
- delete [] ptr;
+ delete[] ptr;
}
};
@@ -467,8 +476,8 @@ void SoundMidiPC::beginFadeOut() {
#pragma mark -
-void KyraEngine::snd_playTheme(int file, int track) {
- debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine::snd_playTheme(%d, %d)", file, track);
+void KyraEngine_v1::snd_playTheme(int file, int track) {
+ debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine_v1::snd_playTheme(%d, %d)", file, track);
if (_curMusicTheme == file)
return;
@@ -478,13 +487,13 @@ void KyraEngine::snd_playTheme(int file, int track) {
_sound->playTrack(track);
}
-void KyraEngine::snd_playSoundEffect(int track, int volume) {
- debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine::snd_playSoundEffect(%d, %d)", track, volume);
+void KyraEngine_v1::snd_playSoundEffect(int track, int volume) {
+ debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine_v1::snd_playSoundEffect(%d, %d)", track, volume);
_sound->playSoundEffect(track);
}
-void KyraEngine::snd_playWanderScoreViaMap(int command, int restart) {
- debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine::snd_playWanderScoreViaMap(%d, %d)", command, restart);
+void KyraEngine_v1::snd_playWanderScoreViaMap(int command, int restart) {
+ debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine_v1::snd_playWanderScoreViaMap(%d, %d)", command, restart);
if (restart)
_lastMusicCommand = -1;
@@ -527,19 +536,22 @@ void KyraEngine::snd_playWanderScoreViaMap(int command, int restart) {
_lastMusicCommand = command;
}
-void KyraEngine::snd_stopVoice() {
- debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine::snd_stopVoice()");
- _sound->voiceStop(_speechFile.empty() ? 0 : _speechFile.c_str());
+void KyraEngine_v1::snd_stopVoice() {
+ debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine_v1::snd_stopVoice()");
+ if (!_speechFile.empty()) {
+ _sound->voiceStop(_speechFile.c_str());
+ _speechFile.clear();
+ }
}
-bool KyraEngine::snd_voiceIsPlaying() {
- debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine::snd_voiceIsPlaying()");
- return _sound->voiceIsPlaying(_speechFile.empty() ? 0 : _speechFile.c_str());
+bool KyraEngine_v1::snd_voiceIsPlaying() {
+ debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine_v1::snd_voiceIsPlaying()");
+ return _speechFile.empty() ? false : _sound->voiceIsPlaying(_speechFile.c_str());
}
// static res
-const Sound::SpeechCodecs Sound::_supportedCodes[] = {
+const Sound::SpeechCodecs Sound::_supportedCodecs[] = {
#ifdef USE_FLAC
{ ".VOF", Audio::makeFlacStream },
#endif // USE_FLAC
diff --git a/engines/kyra/sound.h b/engines/kyra/sound.h
index 85648f6b7e..1baeb3064a 100644
--- a/engines/kyra/sound.h
+++ b/engines/kyra/sound.h
@@ -18,7 +18,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * LPGL License
+ * LGPL License
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -42,7 +42,7 @@
#ifndef KYRA_SOUND_H
#define KYRA_SOUND_H
-#include "kyra/kyra.h"
+#include "kyra/kyra_v1.h"
#include "common/scummsys.h"
#include "common/file.h"
@@ -61,12 +61,12 @@ namespace Kyra {
/**
* Analog audio output device API for Kyrandia games.
- * It countains functionallity to play music tracks,
+ * It contains functionality to play music tracks,
* sound effects and voices.
*/
class Sound {
public:
- Sound(KyraEngine *vm, Audio::Mixer *mixer);
+ Sound(KyraEngine_v1 *vm, Audio::Mixer *mixer);
virtual ~Sound();
enum kType {
@@ -92,7 +92,7 @@ public:
virtual void process() {}
/**
- * Updates internal volume settings according to ConfigManager
+ * Updates internal volume settings according to ConfigManager.
*/
virtual void updateVolumeSettings() {}
@@ -105,7 +105,7 @@ public:
virtual void setSoundList(const AudioDataStruct *list) { _soundDataList = list; }
/**
- * Checks if a given sound file is present
+ * Checks if a given sound file is present.
*
* @param track track number
* @return true if available, false otherwise
@@ -126,19 +126,19 @@ public:
virtual void playTrack(uint8 track) = 0;
/**
- * Stop playback of the current track
+ * Stop playback of the current track.
*/
virtual void haltTrack() = 0;
/**
- * Plays the specified sound effect
+ * Plays the specified sound effect.
*
* @param track sound effect id
*/
virtual void playSoundEffect(uint8 track) = 0;
/**
- * Checks if the sound driver plays any sound
+ * Checks if the sound driver plays any sound.
*
* @return true if playing, false otherwise
*/
@@ -174,9 +174,9 @@ public:
*
* @param file file to be played
* @param isSfx marks file as sfx instead of voice
- * @return channel the voice file is played on
+ * @return playtime of the voice file (-1 marks unknown playtime)
*/
- virtual bool voicePlay(const char *file, bool isSfx = false);
+ virtual int32 voicePlay(const char *file, bool isSfx = false);
/**
* Checks if a voice is being played.
@@ -186,13 +186,20 @@ public:
bool voiceIsPlaying(const char *file = 0);
/**
+ * Checks how long a voice has been playing
+ *
+ * @return time in milliseconds
+ */
+ uint32 voicePlayedTime(const char *file);
+
+ /**
* Stops playback of the current voice.
*/
void voiceStop(const char *file = 0);
protected:
const char *fileListEntry(int file) const { return (_soundDataList != 0 && file >= 0 && file < _soundDataList->_fileListLen) ? _soundDataList->_fileList[file] : ""; }
const void *cdaData() const { return _soundDataList != 0 ? _soundDataList->_cdaTracks : 0; }
- const int cdaTrackNum() const { return _soundDataList != 0 ? _soundDataList->_cdaNumTracks : 0; }
+ int cdaTrackNum() const { return _soundDataList != 0 ? _soundDataList->_cdaNumTracks : 0; }
enum {
kNumChannelHandles = 4
@@ -209,7 +216,7 @@ protected:
int _currentTheme;
- KyraEngine *_vm;
+ KyraEngine_v1 *_vm;
Audio::Mixer *_mixer;
private:
@@ -225,7 +232,7 @@ private:
uint numLoops);
};
- static const SpeechCodecs _supportedCodes[];
+ static const SpeechCodecs _supportedCodecs[];
};
class AdlibDriver;
@@ -243,7 +250,7 @@ class AdlibDriver;
*/
class SoundAdlibPC : public Sound {
public:
- SoundAdlibPC(KyraEngine *vm, Audio::Mixer *mixer);
+ SoundAdlibPC(KyraEngine_v1 *vm, Audio::Mixer *mixer);
~SoundAdlibPC();
kType getMusicType() const { return kAdlib; }
@@ -298,7 +305,7 @@ private:
*/
class SoundMidiPC : public MidiDriver, public Sound {
public:
- SoundMidiPC(KyraEngine *vm, Audio::Mixer *mixer, MidiDriver *driver);
+ SoundMidiPC(KyraEngine_v1 *vm, Audio::Mixer *mixer, MidiDriver *driver);
~SoundMidiPC();
kType getMusicType() const { return isMT32() ? kMidiMT32 : kMidiGM; }
@@ -378,7 +385,7 @@ private:
class SoundTowns_EuphonyDriver;
class SoundTowns : public MidiDriver, public Sound {
public:
- SoundTowns(KyraEngine *vm, Audio::Mixer *mixer);
+ SoundTowns(KyraEngine_v1 *vm, Audio::Mixer *mixer);
~SoundTowns();
kType getMusicType() const { return kTowns; }
@@ -435,7 +442,7 @@ private:
//class SoundTowns_v2_TwnDriver;
class SoundTowns_v2 : public Sound {
public:
- SoundTowns_v2(KyraEngine *vm, Audio::Mixer *mixer);
+ SoundTowns_v2(KyraEngine_v1 *vm, Audio::Mixer *mixer);
~SoundTowns_v2();
kType getMusicType() const { return kTowns; }
@@ -449,7 +456,7 @@ public:
void haltTrack();
void beginFadeOut();
- bool voicePlay(const char *file, bool isSfx = false);
+ int32 voicePlay(const char *file, bool isSfx = false);
void playSoundEffect(uint8) {}
private:
@@ -463,7 +470,7 @@ private:
class MixedSoundDriver : public Sound {
public:
- MixedSoundDriver(KyraEngine *vm, Audio::Mixer *mixer, Sound *music, Sound *sfx) : Sound(vm, mixer), _music(music), _sfx(sfx) {}
+ MixedSoundDriver(KyraEngine_v1 *vm, Audio::Mixer *mixer, Sound *music, Sound *sfx) : Sound(vm, mixer), _music(music), _sfx(sfx) {}
~MixedSoundDriver() { delete _music; delete _sfx; }
kType getMusicType() const { return _music->getMusicType(); }
@@ -491,6 +498,8 @@ private:
// Digital Audio
class AUDStream;
+class KyraAudioStream;
+class KyraEngine_MR;
/**
* Digital audio output device.
@@ -499,7 +508,7 @@ class AUDStream;
*/
class SoundDigital {
public:
- SoundDigital(KyraEngine *vm, Audio::Mixer *mixer);
+ SoundDigital(KyraEngine_MR *vm, Audio::Mixer *mixer);
~SoundDigital();
bool init() { return true; }
@@ -535,7 +544,7 @@ public:
void stopSound(int channel);
/**
- * Stops playback of all sounds
+ * Stops playback of all sounds.
*/
void stopAllSounds();
@@ -548,7 +557,7 @@ public:
*/
void beginFadeOut(int channel, int ticks);
private:
- KyraEngine *_vm;
+ KyraEngine_MR *_vm;
Audio::Mixer *_mixer;
struct Sound {
@@ -556,8 +565,20 @@ private:
char filename[16];
uint8 priority;
- AUDStream *stream;
+ KyraAudioStream *stream;
} _sounds[4];
+
+ struct AudioCodecs {
+ const char *fileext;
+ Audio::AudioStream *(*streamFunc)(
+ Common::SeekableReadStream *stream,
+ bool disposeAfterUse,
+ uint32 startTime,
+ uint32 duration,
+ uint numLoops);
+ };
+
+ static const AudioCodecs _supportedCodecs[];
};
} // end of namespace Kyra
diff --git a/engines/kyra/sound_adlib.cpp b/engines/kyra/sound_adlib.cpp
index fa5a978665..68a2f0be9c 100644
--- a/engines/kyra/sound_adlib.cpp
+++ b/engines/kyra/sound_adlib.cpp
@@ -18,7 +18,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * LPGL License
+ * LGPL License
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -507,7 +507,7 @@ int AdlibDriver::snd_deinitDriver(va_list &list) {
int AdlibDriver::snd_setSoundData(va_list &list) {
if (_soundData) {
- delete [] _soundData;
+ delete[] _soundData;
_soundData = 0;
}
_soundData = va_arg(list, uint8*);
@@ -2210,7 +2210,7 @@ const int SoundAdlibPC::_kyra1SoundTriggers[] = {
const int SoundAdlibPC::_kyra1NumSoundTriggers = ARRAYSIZE(SoundAdlibPC::_kyra1SoundTriggers);
-SoundAdlibPC::SoundAdlibPC(KyraEngine *vm, Audio::Mixer *mixer)
+SoundAdlibPC::SoundAdlibPC(KyraEngine_v1 *vm, Audio::Mixer *mixer)
: Sound(vm, mixer), _driver(0), _trackEntries(), _soundDataPtr(0) {
memset(_trackEntries, 0, sizeof(_trackEntries));
_v2 = (_vm->gameFlags().gameID == GI_KYRA2);
@@ -2232,7 +2232,7 @@ SoundAdlibPC::SoundAdlibPC(KyraEngine *vm, Audio::Mixer *mixer)
SoundAdlibPC::~SoundAdlibPC() {
delete _driver;
- delete [] _soundDataPtr;
+ delete[] _soundDataPtr;
}
bool SoundAdlibPC::init() {
@@ -2382,7 +2382,7 @@ void SoundAdlibPC::loadSoundFile(uint file) {
memcpy(_soundDataPtr, p, soundDataSize*sizeof(uint8));
- delete [] file_data;
+ delete[] file_data;
file_data = p = 0;
file_size = 0;
diff --git a/engines/kyra/sound_digital.cpp b/engines/kyra/sound_digital.cpp
index f8c6fbdb04..20f3a7f9f9 100644
--- a/engines/kyra/sound_digital.cpp
+++ b/engines/kyra/sound_digital.cpp
@@ -25,11 +25,83 @@
#include "kyra/sound.h"
#include "kyra/resource.h"
+#include "kyra/kyra_mr.h"
#include "sound/audiostream.h"
+#include "sound/mp3.h"
+#include "sound/vorbis.h"
+#include "sound/flac.h"
+
namespace Kyra {
+class KyraAudioStream : public Audio::AudioStream {
+public:
+ KyraAudioStream(Audio::AudioStream *impl) : _impl(impl), _rate(impl->getRate()), _fadeSamples(0), _fadeCount(0), _fading(0), _endOfData(false) {}
+ ~KyraAudioStream() { delete _impl; _impl = 0; }
+
+ int readBuffer(int16 *buffer, const int numSamples);
+ bool isStereo() const { return _impl->isStereo(); }
+ bool endOfData() const { return _impl->endOfData() | _endOfData; }
+ int getRate() const { return _rate; }
+ int32 getTotalPlayTime() const { return _impl->getTotalPlayTime(); }
+
+ void setRate(int newRate) { _rate = newRate; }
+ void beginFadeOut(uint32 millis);
+private:
+ Audio::AudioStream *_impl;
+
+ int _rate;
+
+ int32 _fadeSamples;
+ int32 _fadeCount;
+ int _fading;
+
+ bool _endOfData;
+};
+
+void KyraAudioStream::beginFadeOut(uint32 millis) {
+ _fadeSamples = (millis * getRate()) / 1000;
+ if (_fading == 0)
+ _fadeCount = _fadeSamples;
+ _fading = -1;
+}
+
+int KyraAudioStream::readBuffer(int16 *buffer, const int numSamples) {
+ int samplesRead = _impl->readBuffer(buffer, numSamples);
+
+ if (_fading) {
+ int samplesProcessed = 0;
+ for (; samplesProcessed < samplesRead; ++samplesProcessed) {
+ // To help avoid overflows for long fade times, we divide both
+ // _fadeSamples and _fadeCount when calculating the new sample.
+
+ int32 div = _fadeSamples / 256;
+ if (_fading) {
+ *buffer = (*buffer * (_fadeCount / 256)) / div;
+ ++buffer;
+
+ _fadeCount += _fading;
+
+ if (_fadeCount < 0) {
+ _fadeCount = 0;
+ _endOfData = true;
+ } else if (_fadeCount > _fadeSamples) {
+ _fadeCount = _fadeSamples;
+ _fading = 0;
+ }
+ }
+ }
+
+ if (_endOfData) {
+ memset(buffer, 0, (samplesRead - samplesProcessed) * sizeof(int16));
+ samplesRead = samplesProcessed;
+ }
+ }
+
+ return samplesRead;
+}
+
// Thanks to Torbjorn Andersson (eriktorbjorn) for his aud player on which
// this code is based on
@@ -46,9 +118,6 @@ public:
bool endOfData() const { return _endOfData; }
int getRate() const { return _rate; }
-
- void beginFadeIn(uint32 millis);
- void beginFadeOut(uint32 millis);
private:
Common::SeekableReadStream *_stream;
bool _loop;
@@ -67,10 +136,6 @@ private:
byte *_inBuffer;
uint _inBufferSize;
- int32 _fadeSamples;
- int32 _fadeCount;
- int _fading;
-
int readChunk(int16 *buffer, const int maxSamples);
static const int8 WSTable2Bit[];
@@ -91,9 +156,6 @@ AUDStream::AUDStream(Common::SeekableReadStream *stream, bool loop) : _stream(st
_totalSize = _stream->readUint32LE();
_loop = loop;
- _fadeSamples = 0;
- _fading = 0;
-
// TODO?: add checks
int flags = _stream->readByte(); // flags
int type = _stream->readByte(); // type
@@ -107,25 +169,11 @@ AUDStream::AUDStream(Common::SeekableReadStream *stream, bool loop) : _stream(st
}
AUDStream::~AUDStream() {
- delete [] _outBuffer;
- delete [] _inBuffer;
+ delete[] _outBuffer;
+ delete[] _inBuffer;
delete _stream;
}
-void AUDStream::beginFadeIn(uint32 millis) {
- _fadeSamples = (millis * getRate()) / 1000;
- if (_fading == 0)
- _fadeCount = 0;
- _fading = 1;
-}
-
-void AUDStream::beginFadeOut(uint32 millis) {
- _fadeSamples = (millis * getRate()) / 1000;
- if (_fading == 0)
- _fadeCount = _fadeSamples;
- _fading = -1;
-}
-
int AUDStream::readBuffer(int16 *buffer, const int numSamples) {
int samplesRead = 0, samplesLeft = numSamples;
@@ -174,7 +222,7 @@ int AUDStream::readChunk(int16 *buffer, const int maxSamples) {
if (size == outSize) {
if (outSize > _outBufferSize) {
_outBufferSize = outSize;
- delete [] _outBuffer;
+ delete[] _outBuffer;
_outBuffer = new uint8[_outBufferSize];
assert(_outBuffer);
}
@@ -187,14 +235,14 @@ int AUDStream::readChunk(int16 *buffer, const int maxSamples) {
if (outSize > _outBufferSize) {
_outBufferSize = outSize;
- delete [] _outBuffer;
+ delete[] _outBuffer;
_outBuffer = new uint8[_outBufferSize];
assert(_outBuffer);
}
if (size > _inBufferSize) {
_inBufferSize = size;
- delete [] _inBuffer;
+ delete[] _inBuffer;
_inBuffer = new uint8[_inBufferSize];
assert(_inBuffer);
}
@@ -286,40 +334,19 @@ int AUDStream::readChunk(int16 *buffer, const int maxSamples) {
samplesProcessed += samples;
_bytesLeft -= samples;
- // To help avoid overflows for long fade times, we divide both
- // _fadeSamples and _fadeCount when calculating the new sample.
-
- int32 div = _fadeSamples / 256;
-
while (samples--) {
int16 sample = (_outBuffer[_outBufferOffset++] << 8) ^ 0x8000;
- if (_fading) {
- sample = (sample * (_fadeCount / 256)) / div;
- _fadeCount += _fading;
-
- if (_fadeCount < 0) {
- _fadeCount = 0;
- _endOfData = true;
- } else if (_fadeCount > _fadeSamples) {
- _fadeCount = _fadeSamples;
- _fading = 0;
- }
- }
-
*buffer++ = sample;
}
}
- if (_fading < 0 && _fadeCount == 0)
- _fading = 0;
-
return samplesProcessed;
}
#pragma mark -
-SoundDigital::SoundDigital(KyraEngine *vm, Audio::Mixer *mixer) : _vm(vm), _mixer(mixer), _sounds() {
+SoundDigital::SoundDigital(KyraEngine_MR *vm, Audio::Mixer *mixer) : _vm(vm), _mixer(mixer), _sounds() {
for (uint i = 0; i < ARRAYSIZE(_sounds); ++i)
_sounds[i].stream = 0;
}
@@ -365,7 +392,19 @@ int SoundDigital::playSound(const char *filename, uint8 priority, Audio::Mixer::
}
}
- Common::SeekableReadStream *stream = _vm->resource()->getFileStream(filename);
+ Common::SeekableReadStream *stream = 0;
+ int usedCodec = -1;
+ for (int i = 0; _supportedCodecs[i].fileext; ++i) {
+ Common::String file = filename;
+ file += _supportedCodecs[i].fileext;
+
+ if (!_vm->resource()->exists(file.c_str()))
+ continue;
+
+ stream = _vm->resource()->getFileStream(file);
+ usedCodec = i;
+ }
+
if (!stream) {
warning("Couldn't find soundfile '%s'", filename);
return -1;
@@ -373,7 +412,13 @@ int SoundDigital::playSound(const char *filename, uint8 priority, Audio::Mixer::
strncpy(use->filename, filename, sizeof(use->filename));
use->priority = priority;
- use->stream = new AUDStream(stream, loop);
+ Audio::AudioStream *audioStream = _supportedCodecs[usedCodec].streamFunc(stream, true, 0, 0, loop ? 0 : 1);
+ if (!audioStream) {
+ warning("Couldn't create audio stream for file '%s'", filename);
+ return -1;
+ }
+ use->stream = new KyraAudioStream(audioStream);
+ assert(use->stream);
if (use->stream->endOfData()) {
delete use->stream;
use->stream = 0;
@@ -384,6 +429,9 @@ int SoundDigital::playSound(const char *filename, uint8 priority, Audio::Mixer::
if (volume > 255)
volume = 255;
volume = (volume * Audio::Mixer::kMaxChannelVolume) / 255;
+
+ if (type == Audio::Mixer::kSpeechSoundType && _vm->heliumMode())
+ use->stream->setRate(32765);
_mixer->playInputStream(type, &use->handle, use->stream, -1, volume);
@@ -423,5 +471,30 @@ void SoundDigital::beginFadeOut(int channel, int ticks) {
_sounds[channel].stream->beginFadeOut(ticks * _vm->tickLength());
}
+// static res
+
+namespace {
+
+Audio::AudioStream *makeAUDStream(Common::SeekableReadStream *stream, bool disposeAfterUse, uint32 startTime, uint32 duration, uint numLoops) {
+ return new AUDStream(stream, numLoops == 0 ? true : false);
+}
+
+} // end of anonymous namespace
+
+const SoundDigital::AudioCodecs SoundDigital::_supportedCodecs[] = {
+#ifdef USE_FLAC
+ { ".FLA", Audio::makeFlacStream },
+#endif // USE_FLAC
+#ifdef USE_VORBIS
+ { ".OGG", Audio::makeVorbisStream },
+#endif // USE_VORBIS
+#ifdef USE_MAD
+ { ".MP3", Audio::makeMP3Stream },
+#endif // USE_MAD
+ { ".AUD", makeAUDStream },
+ { 0, 0 }
+};
+
+
} // end of namespace Kyra
diff --git a/engines/kyra/sound_v1.cpp b/engines/kyra/sound_lok.cpp
index 8293eb7508..8a1d16a6b1 100644
--- a/engines/kyra/sound_v1.cpp
+++ b/engines/kyra/sound_lok.cpp
@@ -24,22 +24,22 @@
*/
#include "kyra/sound.h"
-#include "kyra/kyra_v1.h"
+#include "kyra/kyra_lok.h"
namespace Kyra {
-void KyraEngine_v1::snd_playSoundEffect(int track, int volume) {
- debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine_v1::snd_playSoundEffect(%d, %d)", track, volume);
+void KyraEngine_LoK::snd_playSoundEffect(int track, int volume) {
+ debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine_LoK::snd_playSoundEffect(%d, %d)", track, volume);
if ((_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98) && track == 49) {
snd_playWanderScoreViaMap(56, 1);
return;
}
- KyraEngine::snd_playSoundEffect(track);
+ KyraEngine_v1::snd_playSoundEffect(track);
}
-void KyraEngine_v1::snd_playWanderScoreViaMap(int command, int restart) {
- debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine_v1::snd_playWanderScoreViaMap(%d, %d)", command, restart);
+void KyraEngine_LoK::snd_playWanderScoreViaMap(int command, int restart) {
+ debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine_LoK::snd_playWanderScoreViaMap(%d, %d)", command, restart);
if (restart)
_lastMusicCommand = -1;
@@ -57,21 +57,21 @@ void KyraEngine_v1::snd_playWanderScoreViaMap(int command, int restart) {
_sound->haltTrack();
}
} else {
- KyraEngine::snd_playWanderScoreViaMap(command, restart);
+ KyraEngine_v1::snd_playWanderScoreViaMap(command, restart);
}
}
-void KyraEngine_v1::snd_playVoiceFile(int id) {
- debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine_v1::snd_playVoiceFile(%d)", id);
+void KyraEngine_LoK::snd_playVoiceFile(int id) {
+ debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine_LoK::snd_playVoiceFile(%d)", id);
char vocFile[9];
assert(id >= 0 && id < 9999);
sprintf(vocFile, "%03d", id);
_speechFile = vocFile;
- _sound->voicePlay(vocFile);
+ _speechPlayTime = _sound->voicePlay(vocFile);
}
-void KyraEngine_v1::snd_voiceWaitForFinish(bool ingame) {
- debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine_v1::snd_voiceWaitForFinish(%d)", ingame);
+void KyraEngine_LoK::snd_voiceWaitForFinish(bool ingame) {
+ debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine_LoK::snd_voiceWaitForFinish(%d)", ingame);
while (_sound->voiceIsPlaying() && !_skipFlag) {
if (ingame)
delay(10, true);
@@ -80,4 +80,11 @@ void KyraEngine_v1::snd_voiceWaitForFinish(bool ingame) {
}
}
+uint32 KyraEngine_LoK::snd_getVoicePlayTime() {
+ debugC(9, kDebugLevelMain | kDebugLevelSound, "KyraEngine_LoK::snd_getVoicePlayTime()");
+ if (!snd_voiceIsPlaying())
+ return 0;
+ return (_speechPlayTime != -1 ? _speechPlayTime : 0);
+}
+
} // end of namespace Kyra
diff --git a/engines/kyra/sound_towns.cpp b/engines/kyra/sound_towns.cpp
index 9ac865c157..4265533507 100644
--- a/engines/kyra/sound_towns.cpp
+++ b/engines/kyra/sound_towns.cpp
@@ -599,18 +599,18 @@ SoundTowns_EuphonyDriver::~SoundTowns_EuphonyDriver() {
MidiDriver_YM2612::removeLookupTables();
if (_fmInstruments) {
- delete [] _fmInstruments;
+ delete[] _fmInstruments;
_fmInstruments = 0;
}
if (_waveInstruments) {
- delete [] _waveInstruments;
+ delete[] _waveInstruments;
_waveInstruments = 0;
}
for (int i = 0; i < 10; i++) {
if (_waveSounds[i]) {
- delete [] _waveSounds[i];
+ delete[] _waveSounds[i];
_waveSounds[i] = 0;
}
}
@@ -709,14 +709,14 @@ void SoundTowns_EuphonyDriver::send(byte chan, uint32 b) {
void SoundTowns_EuphonyDriver::loadFmInstruments(const byte *instr) {
if (_fmInstruments)
- delete [] _fmInstruments;
+ delete[] _fmInstruments;
_fmInstruments = new uint8[0x1800];
memcpy(_fmInstruments, instr, 0x1800);
}
void SoundTowns_EuphonyDriver::loadWaveInstruments(const byte *instr) {
if (_waveInstruments)
- delete [] _waveInstruments;
+ delete[] _waveInstruments;
_waveInstruments = new uint8[0x1000];
memcpy(_waveInstruments, instr, 0x1000);
@@ -724,7 +724,7 @@ void SoundTowns_EuphonyDriver::loadWaveInstruments(const byte *instr) {
for (uint8 i = 0; i < 10; i++) {
if (_waveSounds[i])
- delete [] _waveSounds[i];
+ delete[] _waveSounds[i];
uint32 numsamples = READ_LE_UINT32(pos + 0x0C);
_waveSounds[i] = new int8[numsamples + 0x20];
memcpy(_waveSounds[i], pos, 0x20);
@@ -1010,7 +1010,7 @@ SoundTowns_EuphonyTrackQueue * SoundTowns_EuphonyTrackQueue::reset() {
void SoundTowns_EuphonyTrackQueue::loadDataToCurrentPosition(uint8 * trackdata, uint32 size, bool loop) {
if (_trackData)
- delete [] _trackData;
+ delete[] _trackData;
_trackData = new uint8[0xC58A];
memset(_trackData, 0, 0xC58A);
Screen::decodeFrame4(trackdata, _trackData, size);
@@ -1051,13 +1051,13 @@ void SoundTowns_EuphonyTrackQueue::release() {
_used = _fchan = _wchan = 0;
if (_trackData) {
- delete [] _trackData;
+ delete[] _trackData;
_trackData = 0;
}
while (i) {
if (i->_trackData) {
- delete [] i->_trackData;
+ delete[] i->_trackData;
i->_trackData = 0;
}
i = i->_next;
@@ -1084,7 +1084,7 @@ void SoundTowns_EuphonyTrackQueue::initDriver() {
_driver->send(0x79B0);
}
-SoundTowns::SoundTowns(KyraEngine *vm, Audio::Mixer *mixer)
+SoundTowns::SoundTowns(KyraEngine_v1 *vm, Audio::Mixer *mixer)
: Sound(vm, mixer), _lastTrack(-1), _currentSFX(0), _sfxFileData(0),
_sfxFileIndex((uint)-1), _sfxWDTable(0), _sfxBTTable(0), _parser(0) {
@@ -1097,7 +1097,7 @@ SoundTowns::SoundTowns(KyraEngine *vm, Audio::Mixer *mixer)
SoundTowns::~SoundTowns() {
AudioCD.stop();
haltTrack();
- delete [] _sfxFileData;
+ delete[] _sfxFileData;
Common::StackLock lock(_mutex);
_driver->setTimerCallback(0, 0);
@@ -1109,8 +1109,8 @@ SoundTowns::~SoundTowns() {
bool SoundTowns::init() {
_vm->checkCD();
int unused = 0;
- _sfxWDTable = _vm->staticres()->loadRawData(kKyra1TownsSFXwdTable, unused);
- _sfxBTTable = _vm->staticres()->loadRawData(kKyra1TownsSFXbtTable, unused);
+ _sfxWDTable = _vm->staticres()->loadRawData(k1TownsSFXwdTable, unused);
+ _sfxBTTable = _vm->staticres()->loadRawData(k1TownsSFXbtTable, unused);
return loadInstruments();
}
@@ -1164,7 +1164,7 @@ void SoundTowns::loadSoundFile(uint file) {
if (_sfxFileIndex == file)
return;
_sfxFileIndex = file;
- delete [] _sfxFileData;
+ delete[] _sfxFileData;
_sfxFileData = _vm->resource()->fileData(fileListEntry(file), 0);
}
@@ -1293,7 +1293,7 @@ bool SoundTowns::loadInstruments() {
_driver->queue()->loadDataToCurrentPosition(twm + 0x0CA0, 0xC58A);
_driver->loadWaveInstruments(_driver->queue()->trackData() + 8);
- delete [] twm;
+ delete[] twm;
_driver->queue()->release();
return true;
@@ -1301,6 +1301,7 @@ bool SoundTowns::loadInstruments() {
void SoundTowns::playEuphonyTrack(uint32 offset, int loop) {
uint8 * twm = _vm->resource()->fileData("twmusic.pak", 0);
+ Common::StackLock lock(_mutex);
if (!_parser) {
_parser = new MidiParser_EuD(_driver->queue());
@@ -1311,7 +1312,7 @@ void SoundTowns::playEuphonyTrack(uint32 offset, int loop) {
_parser->property(MidiParser::mpAutoLoop, loop);
_parser->loadMusic(twm + 0x4b70 + offset, 0xC58A);
- delete [] twm;
+ delete[] twm;
}
void SoundTowns::onTimer(void * data) {
@@ -1357,7 +1358,7 @@ float SoundTowns::semitoneAndSampleRate_to_sampleStep(int8 semiTone, int8 semiTo
// KYRA 2
-SoundTowns_v2::SoundTowns_v2(KyraEngine *vm, Audio::Mixer *mixer)
+SoundTowns_v2::SoundTowns_v2(KyraEngine_v1 *vm, Audio::Mixer *mixer)
: Sound(vm, mixer), _lastTrack(-1), _currentSFX(0), /*_driver(0),*/
_twnTrackData(0) {
}
@@ -1366,7 +1367,7 @@ SoundTowns_v2::~SoundTowns_v2() {
/*if (_driver)
delete _driver;*/
if (_twnTrackData)
- delete [] _twnTrackData;
+ delete[] _twnTrackData;
}
bool SoundTowns_v2::init() {
@@ -1416,7 +1417,7 @@ void SoundTowns_v2::playTrack(uint8 track) {
char musicfile[13];
sprintf(musicfile, fileListEntry(0), track);
if (_twnTrackData)
- delete [] _twnTrackData;
+ delete[] _twnTrackData;
_twnTrackData = _vm->resource()->fileData(musicfile, 0);
//_driver->loadData(_twnTrackData);
}
@@ -1431,7 +1432,7 @@ void SoundTowns_v2::haltTrack() {
//_driver->reset();
}
-bool SoundTowns_v2::voicePlay(const char *file, bool) {
+int32 SoundTowns_v2::voicePlay(const char *file, bool) {
static const uint16 rates[] = { 0x10E1, 0x0CA9, 0x0870, 0x0654, 0x0438, 0x032A, 0x021C, 0x0194 };
int h = 0;
@@ -1439,10 +1440,13 @@ bool SoundTowns_v2::voicePlay(const char *file, bool) {
while (_mixer->isSoundHandleActive(_soundChannels[h].channelHandle) && h < kNumChannelHandles)
h++;
if (h >= kNumChannelHandles)
- return false;
+ return 0;
}
- uint8 * data = _vm->resource()->fileData(file, 0);
+ char filename [13];
+ sprintf(filename, "%s.PCM", file);
+
+ uint8 * data = _vm->resource()->fileData(filename, 0);
uint8 * src = data;
uint16 sfxRate = rates[READ_LE_UINT16(src)];
@@ -1492,8 +1496,8 @@ bool SoundTowns_v2::voicePlay(const char *file, bool) {
_soundChannels[h].file = file;
_mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_soundChannels[h].channelHandle, _currentSFX);
- delete [] data;
- return true;
+ delete[] data;
+ return 1;
}
void SoundTowns_v2::beginFadeOut() {
diff --git a/engines/kyra/sprites.cpp b/engines/kyra/sprites.cpp
index b54192abae..34c2986f25 100644
--- a/engines/kyra/sprites.cpp
+++ b/engines/kyra/sprites.cpp
@@ -30,14 +30,14 @@
#include "common/system.h"
#include "common/events.h"
#include "kyra/screen.h"
-#include "kyra/kyra_v1.h"
+#include "kyra/kyra_lok.h"
#include "kyra/sprites.h"
#include "kyra/resource.h"
-#include "kyra/animator_v1.h"
+#include "kyra/animator_lok.h"
namespace Kyra {
-Sprites::Sprites(KyraEngine_v1 *vm, OSystem *system) {
+Sprites::Sprites(KyraEngine_LoK *vm, OSystem *system) {
_vm = vm;
_res = vm->resource();
_screen = vm->screen();
@@ -52,11 +52,11 @@ Sprites::Sprites(KyraEngine_v1 *vm, OSystem *system) {
}
Sprites::~Sprites() {
- delete [] _dat;
+ delete[] _dat;
freeSceneShapes();
for (int i = 0; i < MAX_NUM_ANIMS; i++) {
if (_anims[i].background)
- delete [] _anims[i].background;
+ delete[] _anims[i].background;
}
}
@@ -66,7 +66,7 @@ void Sprites::setupSceneAnims() {
for (int i = 0; i < MAX_NUM_ANIMS; i++) {
if (_anims[i].background) {
- delete [] _anims[i].background;
+ delete[] _anims[i].background;
_anims[i].background = 0;
}
@@ -140,7 +140,7 @@ void Sprites::updateSceneAnims() {
uint16 sound;
for (int i = 0; i < MAX_NUM_ANIMS; i++) {
- if (_anims[i].script == 0 || !_anims[i].play || _anims[i].nextRun != 0 && _anims[i].nextRun > currTime)
+ if (_anims[i].script == 0 || !_anims[i].play || (_anims[i].nextRun != 0 && _anims[i].nextRun > currTime))
continue;
data = _anims[i].curPos;
@@ -515,7 +515,7 @@ void Sprites::loadDat(const char *filename, SceneExits &exits) {
void Sprites::freeSceneShapes() {
debugC(9, kDebugLevelSprites, "Sprites::freeSceneShapes()");
for (int i = 0; i < ARRAYSIZE(_sceneShapes); i++ ) {
- delete [] _sceneShapes[i];
+ delete[] _sceneShapes[i];
_sceneShapes[i] = 0;
}
}
@@ -554,7 +554,7 @@ void Sprites::loadSceneShapes() {
void Sprites::refreshSceneAnimObject(uint8 animNum, uint8 shapeNum, uint16 x, uint16 y, bool flipX, bool unkFlag) {
debugC(9, kDebugLevelSprites, "Sprites::refreshSceneAnimObject(%i, %i, %i, %i, %i, %i", animNum, shapeNum, x, y, flipX, unkFlag);
- Animator_v1::AnimObject &anim = _vm->animator()->sprites()[animNum];
+ Animator_LoK::AnimObject &anim = _vm->animator()->sprites()[animNum];
anim.refreshFlag = 1;
anim.bkgdChangeFlag = 1;
diff --git a/engines/kyra/sprites.h b/engines/kyra/sprites.h
index 3304458fda..212bfc7428 100644
--- a/engines/kyra/sprites.h
+++ b/engines/kyra/sprites.h
@@ -26,7 +26,7 @@
#ifndef KYRA_SPRITES_H
#define KYRA_SPRITES_H
-#include "kyra/kyra_v1.h"
+#include "kyra/kyra_lok.h"
namespace Kyra {
@@ -63,11 +63,11 @@ struct Anim {
bool disable;
};
-class KyraEngine_v1;
+class KyraEngine_LoK;
class Sprites {
public:
- Sprites(KyraEngine_v1 *vm, OSystem *system);
+ Sprites(KyraEngine_LoK *vm, OSystem *system);
~Sprites();
void updateSceneAnims();
@@ -86,7 +86,7 @@ public:
protected:
void freeSceneShapes();
- KyraEngine_v1 *_vm;
+ KyraEngine_LoK *_vm;
Resource *_res;
OSystem *_system;
Screen *_screen;
diff --git a/engines/kyra/staticres.cpp b/engines/kyra/staticres.cpp
index 16d7ca4d9b..abdf115c1e 100644
--- a/engines/kyra/staticres.cpp
+++ b/engines/kyra/staticres.cpp
@@ -26,24 +26,23 @@
#include "common/endian.h"
#include "common/md5.h"
-#include "kyra/kyra.h"
#include "kyra/kyra_v1.h"
+#include "kyra/kyra_lok.h"
+#include "kyra/kyra_v2.h"
#include "kyra/kyra_hof.h"
#include "kyra/kyra_mr.h"
#include "kyra/screen.h"
-#include "kyra/screen_v1.h"
+#include "kyra/screen_lok.h"
#include "kyra/screen_hof.h"
#include "kyra/screen_mr.h"
#include "kyra/resource.h"
-#include "kyra/gui_v1.h"
+#include "kyra/gui_lok.h"
#include "kyra/gui_hof.h"
#include "kyra/gui_mr.h"
-#include "gui/message.h"
-
namespace Kyra {
-#define RESFILE_VERSION 24
+#define RESFILE_VERSION 28
bool StaticResource::checkKyraDat() {
Common::File kyraDat;
@@ -143,8 +142,8 @@ bool StaticResource::init() {
{ kPaletteTable, proc(loadPaletteTable), proc(freePaletteTable) },
{ k2SeqData, proc(loadHofSequenceData), proc(freeHofSequenceData) },
- { k2ShpAnimDataV1, proc(loadHofShapeAnimDataV1), proc(freeHofShapeAnimDataV1) },
- { k2ShpAnimDataV2, proc(loadHofShapeAnimDataV2), proc(freeHofShapeAnimDataV2) },
+ { k2ShpAnimDataV1, proc(loadShapeAnimData_v1), proc(freeHofShapeAnimDataV1) },
+ { k2ShpAnimDataV2, proc(loadShapeAnimData_v2), proc(freeHofShapeAnimDataV2) },
{ 0, 0, 0 }
};
@@ -154,85 +153,85 @@ bool StaticResource::init() {
// Kyrandia 1 Filenames
static const FilenameTable kyra1StaticRes[] = {
// INTRO / OUTRO sequences
- { kForestSeq, kRawData, "FOREST.SEQ" },
- { kKallakWritingSeq, kRawData, "KALLAK-WRITING.SEQ" },
- { kKyrandiaLogoSeq, kRawData, "KYRANDIA-LOGO.SEQ" },
- { kKallakMalcolmSeq, kRawData, "KALLAK-MALCOLM.SEQ" },
- { kMalcolmTreeSeq, kRawData, "MALCOLM-TREE.SEQ" },
- { kWestwoodLogoSeq, kRawData, "WESTWOOD-LOGO.SEQ" },
- { kDemo1Seq, kRawData, "DEMO1.SEQ" },
- { kDemo2Seq, kRawData, "DEMO2.SEQ" },
- { kDemo3Seq, kRawData, "DEMO3.SEQ" },
- { kDemo4Seq, kRawData, "DEMO4.SEQ" },
- { kOutroReunionSeq, kRawData, "REUNION.SEQ" },
+ { k1ForestSeq, kRawData, "FOREST.SEQ" },
+ { k1KallakWritingSeq, kRawData, "KALLAK-WRITING.SEQ" },
+ { k1KyrandiaLogoSeq, kRawData, "KYRANDIA-LOGO.SEQ" },
+ { k1KallakMalcolmSeq, kRawData, "KALLAK-MALCOLM.SEQ" },
+ { k1MalcolmTreeSeq, kRawData, "MALCOLM-TREE.SEQ" },
+ { k1WestwoodLogoSeq, kRawData, "WESTWOOD-LOGO.SEQ" },
+ { k1Demo1Seq, kRawData, "DEMO1.SEQ" },
+ { k1Demo2Seq, kRawData, "DEMO2.SEQ" },
+ { k1Demo3Seq, kRawData, "DEMO3.SEQ" },
+ { k1Demo4Seq, kRawData, "DEMO4.SEQ" },
+ { k1OutroReunionSeq, kRawData, "REUNION.SEQ" },
// INTRO / OUTRO strings
- { kIntroCPSStrings, kStringList, "INTRO-CPS.TXT" },
- { kIntroCOLStrings, kStringList, "INTRO-COL.TXT" },
- { kIntroWSAStrings, kStringList, "INTRO-WSA.TXT" },
- { kIntroStrings, kLanguageList, "INTRO-STRINGS." },
- { kOutroHomeString, kLanguageList, "HOME." },
+ { k1IntroCPSStrings, kStringList, "INTRO-CPS.TXT" },
+ { k1IntroCOLStrings, kStringList, "INTRO-COL.TXT" },
+ { k1IntroWSAStrings, kStringList, "INTRO-WSA.TXT" },
+ { k1IntroStrings, kLanguageList, "INTRO-STRINGS." },
+ { k1OutroHomeString, kLanguageList, "HOME." },
// INGAME strings
- { kItemNames, kLanguageList, "ITEMLIST." },
- { kTakenStrings, kLanguageList, "TAKEN." },
- { kPlacedStrings, kLanguageList, "PLACED." },
- { kDroppedStrings, kLanguageList, "DROPPED." },
- { kNoDropStrings, kLanguageList, "NODROP." },
- { kPutDownString, kLanguageList, "PUTDOWN." },
- { kWaitAmuletString, kLanguageList, "WAITAMUL." },
- { kBlackJewelString, kLanguageList, "BLACKJEWEL." },
- { kPoisonGoneString, kLanguageList, "POISONGONE." },
- { kHealingTipString, kLanguageList, "HEALINGTIP." },
- { kThePoisonStrings, kLanguageList, "THEPOISON." },
- { kFluteStrings, kLanguageList, "FLUTE." },
- { kWispJewelStrings, kLanguageList, "WISPJEWEL." },
- { kMagicJewelStrings, kLanguageList, "MAGICJEWEL." },
- { kFlaskFullString, kLanguageList, "FLASKFULL." },
- { kFullFlaskString, kLanguageList, "FULLFLASK." },
- { kVeryCleverString, kLanguageList, "VERYCLEVER." },
- { kNewGameString, kLanguageList, "NEWGAME." },
+ { k1ItemNames, kLanguageList, "ITEMLIST." },
+ { k1TakenStrings, kLanguageList, "TAKEN." },
+ { k1PlacedStrings, kLanguageList, "PLACED." },
+ { k1DroppedStrings, kLanguageList, "DROPPED." },
+ { k1NoDropStrings, kLanguageList, "NODROP." },
+ { k1PutDownString, kLanguageList, "PUTDOWN." },
+ { k1WaitAmuletString, kLanguageList, "WAITAMUL." },
+ { k1BlackJewelString, kLanguageList, "BLACKJEWEL." },
+ { k1PoisonGoneString, kLanguageList, "POISONGONE." },
+ { k1HealingTipString, kLanguageList, "HEALINGTIP." },
+ { k1ThePoisonStrings, kLanguageList, "THEPOISON." },
+ { k1FluteStrings, kLanguageList, "FLUTE." },
+ { k1WispJewelStrings, kLanguageList, "WISPJEWEL." },
+ { k1MagicJewelStrings, kLanguageList, "MAGICJEWEL." },
+ { k1FlaskFullString, kLanguageList, "FLASKFULL." },
+ { k1FullFlaskString, kLanguageList, "FULLFLASK." },
+ { k1VeryCleverString, kLanguageList, "VERYCLEVER." },
+ { k1NewGameString, kLanguageList, "NEWGAME." },
// GUI strings table
- { kGUIStrings, kLanguageList, "GUISTRINGS." },
- { kConfigStrings, kLanguageList, "CONFIGSTRINGS." },
+ { k1GUIStrings, kLanguageList, "GUISTRINGS." },
+ { k1ConfigStrings, kLanguageList, "CONFIGSTRINGS." },
// ROOM table/filenames
- { Kyra::kRoomList, StaticResource::kRoomList, "ROOM-TABLE.ROOM" },
- { kRoomFilenames, kStringList, "ROOM-FILENAMES.TXT" },
+ { k1RoomList, kRoomList, "ROOM-TABLE.ROOM" },
+ { k1RoomFilenames, kStringList, "ROOM-FILENAMES.TXT" },
// SHAPE tables
- { kDefaultShapes, kShapeList, "SHAPES-DEFAULT.SHP" },
- { kHealing1Shapes, kShapeList, "HEALING.SHP" },
- { kHealing2Shapes, kShapeList, "HEALING2.SHP" },
- { kPoisonDeathShapes, kShapeList, "POISONDEATH.SHP" },
- { kFluteShapes, kShapeList, "FLUTE.SHP" },
- { kWinter1Shapes, kShapeList, "WINTER1.SHP" },
- { kWinter2Shapes, kShapeList, "WINTER2.SHP" },
- { kWinter3Shapes, kShapeList, "WINTER3.SHP" },
- { kDrinkShapes, kShapeList, "DRINK.SHP" },
- { kWispShapes, kShapeList, "WISP.SHP" },
- { kMagicAnimShapes, kShapeList, "MAGICANIM.SHP" },
- { kBranStoneShapes, kShapeList, "BRANSTONE.SHP" },
+ { k1DefaultShapes, kShapeList, "SHAPES-DEFAULT.SHP" },
+ { k1Healing1Shapes, kShapeList, "HEALING.SHP" },
+ { k1Healing2Shapes, kShapeList, "HEALING2.SHP" },
+ { k1PoisonDeathShapes, kShapeList, "POISONDEATH.SHP" },
+ { k1FluteShapes, kShapeList, "FLUTE.SHP" },
+ { k1Winter1Shapes, kShapeList, "WINTER1.SHP" },
+ { k1Winter2Shapes, kShapeList, "WINTER2.SHP" },
+ { k1Winter3Shapes, kShapeList, "WINTER3.SHP" },
+ { k1DrinkShapes, kShapeList, "DRINK.SHP" },
+ { k1WispShapes, kShapeList, "WISP.SHP" },
+ { k1MagicAnimShapes, kShapeList, "MAGICANIM.SHP" },
+ { k1BranStoneShapes, kShapeList, "BRANSTONE.SHP" },
// IMAGE filename table
- { kCharacterImageFilenames, kStringList, "CHAR-IMAGE.TXT" },
+ { k1CharacterImageFilenames, kStringList, "CHAR-IMAGE.TXT" },
// AMULET anim
- { kAmuleteAnimSeq, kRawData, "AMULETEANIM.SEQ" },
+ { k1AmuleteAnimSeq, kRawData, "AMULETEANIM.SEQ" },
// PALETTE table
- { kPaletteList, kPaletteTable, "1 33 PALTABLE" },
+ { k1PaletteList, kPaletteTable, "1 33 PALTABLE" },
// AUDIO files
- { kAudioTracks, kStringList, "TRACKS.TXT" },
- { kAudioTracksIntro, kStringList, "TRACKSINT.TXT" },
+ { k1AudioTracks, kStringList, "TRACKS.TXT" },
+ { k1AudioTracksIntro, kStringList, "TRACKSINT.TXT" },
// FM-TOWNS specific
- { kKyra1TownsSFXwdTable, kRawData, "SFXWDTABLE" },
- { kKyra1TownsSFXbtTable, kRawData, "SFXBTTABLE" },
- { kKyra1TownsCDATable, kRawData, "CDATABLE" },
- { kCreditsStrings, kRawData, "CREDITS" },
+ { k1TownsSFXwdTable, kRawData, "SFXWDTABLE" },
+ { k1TownsSFXbtTable, kRawData, "SFXBTTABLE" },
+ { k1TownsCDATable, kRawData, "CDATABLE" },
+ { k1CreditsStrings, kRawData, "CREDITS" },
{ 0, 0, 0 }
};
@@ -261,7 +260,20 @@ bool StaticResource::init() {
{ k2IngameTalkObjIndex, kRawData, "I_TALKOBJECTS.MAP" },
{ k2IngameTimJpStrings, kStringList, "I_TIMJPSTR.TXT" },
{ k2IngameShapeAnimData, k2ShpAnimDataV2, "I_INVANIM.SHP" },
- { k2IngameTlkDemoStrings, kLanguageList, "I_TLKDEMO.TXT." },
+ { k2IngameTlkDemoStrings, kLanguageList, "I_TLKDEMO.TXT." },
+
+ { 0, 0, 0 }
+ };
+
+ static const FilenameTable kyra3StaticRes[] = {
+ { k3MainMenuStrings, kStringList, "MAINMENU.TXT" },
+ { k3MusicFiles, kStringList, "SCORE.TRA" },
+ { k3ScoreTable, kRawData, "SCORE.MAP" },
+ { k3SfxFiles, kStringList, "SFXFILES.TRA" },
+ { k3SfxMap, kRawData, "SFXINDEX.MAP" },
+ { k3ItemAnimData, k2ShpAnimDataV2, "INVANIM.SHP" },
+ { k3ItemMagicTable, kRawData, "ITEMMAGIC.MAP" },
+ { k3ItemStringMap, kRawData, "ITEMSTRINGS.MAP" },
{ 0, 0, 0 }
};
@@ -273,23 +285,26 @@ bool StaticResource::init() {
_builtIn = 0;
_filenameTable = kyra2StaticRes;
} else if (_vm->game() == GI_KYRA3) {
- return true;
+ _builtIn = 0;
+ _filenameTable = kyra3StaticRes;
} else {
error("unknown game ID");
}
+ char errorBuffer[100];
int tempSize = 0;
uint8 *temp = getFile("INDEX", tempSize);
if (!temp) {
- warning("No matching INDEX file found ('%s')", getFilename("INDEX"));
- outputError();
+ snprintf(errorBuffer, sizeof(errorBuffer), "is missing an '%s' entry", getFilename("INDEX"));
+ outputError(errorBuffer);
return false;
}
if (tempSize != 3*4) {
- delete [] temp;
- warning("'%s' has illegal filesize %d", getFilename("INDEX"), tempSize);
- outputError();
+ delete[] temp;
+
+ snprintf(errorBuffer, sizeof(errorBuffer), "has incorrect header size for entry '%s'", getFilename("INDEX"));
+ outputError(errorBuffer);
return false;
}
@@ -297,32 +312,29 @@ bool StaticResource::init() {
uint32 gameID = READ_BE_UINT32((temp+4));
uint32 featuresValue = READ_BE_UINT32((temp+8));
- delete [] temp;
+ delete[] temp;
temp = 0;
if (version != RESFILE_VERSION) {
- warning("Invalid KYRA.DAT file version (%u, required %d)", version, RESFILE_VERSION);
- outputError();
+ snprintf(errorBuffer, sizeof(errorBuffer), "has invalid version %d required, you got %d", RESFILE_VERSION, version);
+ outputError(errorBuffer);
return false;
}
if (gameID != _vm->game()) {
- warning("Invalid game id (%u)", gameID);
- outputError();
+ outputError("does not include support for your game");
return false;
}
uint32 gameFeatures = createFeatures(_vm->gameFlags());
if ((featuresValue & GAME_FLAGS) != gameFeatures) {
- warning("Your data file has a different game flags (0x%.08X has the data and your version has 0x%.08X)", (featuresValue & GAME_FLAGS), gameFeatures);
- outputError();
+ outputError("does not include support for your game version");
return false;
}
// load all tables for now
if (!prefetchId(-1)) {
- warning("Couldn't load all needed resources from 'KYRA.DAT'");
- outputError();
+ outputError("is lacking entries for your game version");
return false;
}
return true;
@@ -332,11 +344,10 @@ void StaticResource::deinit() {
unloadId(-1);
}
-void StaticResource::outputError() {
- Common::String errorMessage = "Your '" + StaticResource::staticDataFilename() + "' file is outdated, reget it from the ScummVM website";
- ::GUI::MessageDialog errorMsg(errorMessage);
- errorMsg.runModal();
- error(errorMessage.c_str());
+void StaticResource::outputError(const Common::String &error) {
+ Common::String errorMessage = "Your '" + StaticResource::staticDataFilename() + "' file " + error + ", reget a correct version from the ScummVM website";
+ _vm->GUIErrorMessage(errorMessage);
+ ::error(errorMessage.c_str());
}
const char * const*StaticResource::loadStrings(int id, int &strings) {
@@ -366,11 +377,11 @@ const HofSeqData *StaticResource::loadHofSequenceData(int id, int &entries) {
return (const HofSeqData*)getData(id, k2SeqData, entries);
}
-const ItemAnimData_v1 *StaticResource::loadHofShapeAnimDataV1(int id, int &entries) {
+const ItemAnimData_v1 *StaticResource::loadShapeAnimData_v1(int id, int &entries) {
return (const ItemAnimData_v1*)getData(id, k2ShpAnimDataV1, entries);
}
-const ItemAnimData_v2 *StaticResource::loadHofShapeAnimDataV2(int id, int &entries) {
+const ItemAnimData_v2 *StaticResource::loadShapeAnimData_v2(int id, int &entries) {
return (const ItemAnimData_v2*)getData(id, k2ShpAnimDataV2, entries);
}
@@ -545,7 +556,7 @@ bool StaticResource::loadStringTable(const char *filename, void *&ptr, int &size
curPos += strLen+1;
}
- delete [] filePtr;
+ delete[] filePtr;
ptr = output;
return true;
@@ -579,7 +590,7 @@ bool StaticResource::loadShapeTable(const char *filename, void *&ptr, int &size)
loadTo[i].yOffset = *src++;
}
- delete [] filePtr;
+ delete[] filePtr;
ptr = loadTo;
return true;
@@ -609,7 +620,7 @@ bool StaticResource::loadRoomTable(const char *filename, void *&ptr, int &size)
memset(loadTo[i].needInit, 0, sizeof(loadTo[i].needInit));
}
- delete [] filePtr;
+ delete[] filePtr;
ptr = loadTo;
return true;
@@ -642,7 +653,7 @@ bool StaticResource::loadPaletteTable(const char *filename, void *&ptr, int &siz
snprintf(name, 64, "%s%d.PAL", file, i);
table[(start != 0) ? (i-start) : i] = (char*)getFile(name, size);
if (!table[(start != 0) ? (i-start) : i]) {
- delete [] table;
+ delete[] table;
return false;
}
}
@@ -743,7 +754,7 @@ bool StaticResource::loadHofSequenceData(const char *filename, void *&ptr, int &
}
}
- delete [] filePtr;
+ delete[] filePtr;
HofSeqData *loadTo = new HofSeqData;
assert(loadTo);
@@ -758,7 +769,7 @@ bool StaticResource::loadHofSequenceData(const char *filename, void *&ptr, int &
return true;
}
-bool StaticResource::loadHofShapeAnimDataV1(const char *filename, void *&ptr, int &size) {
+bool StaticResource::loadShapeAnimData_v1(const char *filename, void *&ptr, int &size) {
int filesize;
uint8 *filePtr = getFile(filename, filesize);
uint8 *src = filePtr;
@@ -783,13 +794,13 @@ bool StaticResource::loadHofShapeAnimDataV1(const char *filename, void *&ptr, in
loadTo[i].frames = tmp_f;
}
- delete [] filePtr;
+ delete[] filePtr;
ptr = loadTo;
return true;
}
-bool StaticResource::loadHofShapeAnimDataV2(const char *filename, void *&ptr, int &size) {
+bool StaticResource::loadShapeAnimData_v2(const char *filename, void *&ptr, int &size) {
int filesize;
uint8 *filePtr = getFile(filename, filesize);
uint8 *src = filePtr;
@@ -815,7 +826,7 @@ bool StaticResource::loadHofShapeAnimDataV2(const char *filename, void *&ptr, in
loadTo[i].frames = tmp_f;
}
- delete [] filePtr;
+ delete[] filePtr;
ptr = loadTo;
return true;
@@ -823,7 +834,7 @@ bool StaticResource::loadHofShapeAnimDataV2(const char *filename, void *&ptr, in
void StaticResource::freeRawData(void *&ptr, int &size) {
uint8 *data = (uint8*)ptr;
- delete [] data;
+ delete[] data;
ptr = 0;
size = 0;
}
@@ -831,21 +842,22 @@ void StaticResource::freeRawData(void *&ptr, int &size) {
void StaticResource::freeStringTable(void *&ptr, int &size) {
char **data = (char**)ptr;
while (size--)
- delete [] data[size];
+ delete[] data[size];
+ delete[] data;
ptr = 0;
size = 0;
}
void StaticResource::freeShapeTable(void *&ptr, int &size) {
Shape *data = (Shape*)ptr;
- delete [] data;
+ delete[] data;
ptr = 0;
size = 0;
}
void StaticResource::freeRoomTable(void *&ptr, int &size) {
Room *data = (Room*)ptr;
- delete [] data;
+ delete[] data;
ptr = 0;
size = 0;
}
@@ -854,16 +866,16 @@ void StaticResource::freeHofSequenceData(void *&ptr, int &size) {
HofSeqData *h = (HofSeqData*) ptr;
for (int i = 0; i < h->numSeq; i++) {
- delete [] h->seq[i].wsaFile;
- delete [] h->seq[i].cpsFile;
+ delete[] h->seq[i].wsaFile;
+ delete[] h->seq[i].cpsFile;
}
- delete [] h->seq;
+ delete[] h->seq;
for (int i = 0; i < h->numSeqn; i++) {
- delete [] h->seqn[i].wsaFile;
- delete [] h->seqn[i].wsaControl;
+ delete[] h->seqn[i].wsaFile;
+ delete[] h->seqn[i].wsaControl;
}
- delete [] h->seqn;
+ delete[] h->seqn;
delete h;
ptr = 0;
@@ -873,8 +885,8 @@ void StaticResource::freeHofSequenceData(void *&ptr, int &size) {
void StaticResource::freeHofShapeAnimDataV1(void *&ptr, int &size) {
ItemAnimData_v1 *d= (ItemAnimData_v1*) ptr;
for (int i = 0; i < size; i++)
- delete [] d[i].frames;
- delete [] d;
+ delete[] d[i].frames;
+ delete[] d;
ptr = 0;
size = 0;
}
@@ -882,8 +894,8 @@ void StaticResource::freeHofShapeAnimDataV1(void *&ptr, int &size) {
void StaticResource::freeHofShapeAnimDataV2(void *&ptr, int &size) {
ItemAnimData_v2 *d= (ItemAnimData_v2*) ptr;
for (int i = 0; i < size; i++)
- delete [] d[i].frames;
- delete [] d;
+ delete[] d[i].frames;
+ delete[] d;
ptr = 0;
size = 0;
}
@@ -891,7 +903,7 @@ void StaticResource::freeHofShapeAnimDataV2(void *&ptr, int &size) {
void StaticResource::freePaletteTable(void *&ptr, int &size) {
uint8 **data = (uint8**)ptr;
while (size--)
- delete [] data[size];
+ delete[] data[size];
ptr = 0;
size = 0;
}
@@ -903,8 +915,10 @@ const char *StaticResource::getFilename(const char *name) {
if (_vm->gameFlags().gameID == GI_KYRA2)
filename += ".K2";
+ else if (_vm->gameFlags().gameID == GI_KYRA3)
+ filename += ".K3";
- if (_vm->gameFlags().isTalkie)
+ if (_vm->gameFlags().isTalkie && _vm->gameFlags().gameID != GI_KYRA3)
filename += ".CD";
else if (_vm->gameFlags().isDemo)
filename += ".DEM";
@@ -925,76 +939,76 @@ uint8 *StaticResource::getFile(const char *name, int &size) {
#pragma mark -
-void KyraEngine_v1::initStaticResource() {
+void KyraEngine_LoK::initStaticResource() {
int temp = 0;
- _seq_Forest = _staticres->loadRawData(kForestSeq, temp);
- _seq_KallakWriting = _staticres->loadRawData(kKallakWritingSeq, temp);
- _seq_KyrandiaLogo = _staticres->loadRawData(kKyrandiaLogoSeq, temp);
- _seq_KallakMalcolm = _staticres->loadRawData(kKallakMalcolmSeq, temp);
- _seq_MalcolmTree = _staticres->loadRawData(kMalcolmTreeSeq, temp);
- _seq_WestwoodLogo = _staticres->loadRawData(kWestwoodLogoSeq, temp);
- _seq_Demo1 = _staticres->loadRawData(kDemo1Seq, temp);
- _seq_Demo2 = _staticres->loadRawData(kDemo2Seq, temp);
- _seq_Demo3 = _staticres->loadRawData(kDemo3Seq, temp);
- _seq_Demo4 = _staticres->loadRawData(kDemo4Seq, temp);
- _seq_Reunion = _staticres->loadRawData(kOutroReunionSeq, temp);
-
- _seq_WSATable = _staticres->loadStrings(kIntroWSAStrings, _seq_WSATable_Size);
- _seq_CPSTable = _staticres->loadStrings(kIntroCPSStrings, _seq_CPSTable_Size);
- _seq_COLTable = _staticres->loadStrings(kIntroCOLStrings, _seq_COLTable_Size);
- _seq_textsTable = _staticres->loadStrings(kIntroStrings, _seq_textsTable_Size);
-
- _itemList = _staticres->loadStrings(kItemNames, _itemList_Size);
- _takenList = _staticres->loadStrings(kTakenStrings, _takenList_Size);
- _placedList = _staticres->loadStrings(kPlacedStrings, _placedList_Size);
- _droppedList = _staticres->loadStrings(kDroppedStrings, _droppedList_Size);
- _noDropList = _staticres->loadStrings(kNoDropStrings, _noDropList_Size);
- _putDownFirst = _staticres->loadStrings(kPutDownString, _putDownFirst_Size);
- _waitForAmulet = _staticres->loadStrings(kWaitAmuletString, _waitForAmulet_Size);
- _blackJewel = _staticres->loadStrings(kBlackJewelString, _blackJewel_Size);
- _poisonGone = _staticres->loadStrings(kPoisonGoneString, _poisonGone_Size);
- _healingTip = _staticres->loadStrings(kHealingTipString, _healingTip_Size);
- _thePoison = _staticres->loadStrings(kThePoisonStrings, _thePoison_Size);
- _fluteString = _staticres->loadStrings(kFluteStrings, _fluteString_Size);
- _wispJewelStrings = _staticres->loadStrings(kWispJewelStrings, _wispJewelStrings_Size);
- _magicJewelString = _staticres->loadStrings(kMagicJewelStrings, _magicJewelString_Size);
- _flaskFull = _staticres->loadStrings(kFlaskFullString, _flaskFull_Size);
- _fullFlask = _staticres->loadStrings(kFullFlaskString, _fullFlask_Size);
- _veryClever = _staticres->loadStrings(kVeryCleverString, _veryClever_Size);
- _homeString = _staticres->loadStrings(kOutroHomeString, _homeString_Size);
- _newGameString = _staticres->loadStrings(kNewGameString, _newGameString_Size);
-
- _healingShapeTable = _staticres->loadShapeTable(kHealing1Shapes, _healingShapeTableSize);
- _healingShape2Table = _staticres->loadShapeTable(kHealing2Shapes, _healingShape2TableSize);
- _posionDeathShapeTable = _staticres->loadShapeTable(kPoisonDeathShapes, _posionDeathShapeTableSize);
- _fluteAnimShapeTable = _staticres->loadShapeTable(kFluteShapes, _fluteAnimShapeTableSize);
- _winterScrollTable = _staticres->loadShapeTable(kWinter1Shapes, _winterScrollTableSize);
- _winterScroll1Table = _staticres->loadShapeTable(kWinter2Shapes, _winterScroll1TableSize);
- _winterScroll2Table = _staticres->loadShapeTable(kWinter3Shapes, _winterScroll2TableSize);
- _drinkAnimationTable = _staticres->loadShapeTable(kDrinkShapes, _drinkAnimationTableSize);
- _brandonToWispTable = _staticres->loadShapeTable(kWispShapes, _brandonToWispTableSize);
- _magicAnimationTable = _staticres->loadShapeTable(kMagicAnimShapes, _magicAnimationTableSize);
- _brandonStoneTable = _staticres->loadShapeTable(kBranStoneShapes, _brandonStoneTableSize);
-
- _characterImageTable = _staticres->loadStrings(kCharacterImageFilenames, _characterImageTableSize);
-
- _roomFilenameTable = _staticres->loadStrings(kRoomFilenames, _roomFilenameTableSize);
-
- _amuleteAnim = _staticres->loadRawData(kAmuleteAnimSeq, temp);
-
- _specialPalettes = _staticres->loadPaletteTable(kPaletteList, temp);
-
- _guiStrings = _staticres->loadStrings(kGUIStrings, _guiStringsSize);
- _configStrings = _staticres->loadStrings(kConfigStrings, _configStringsSize);
-
- _soundFiles = _staticres->loadStrings(kAudioTracks, _soundFilesSize);
- _soundFilesIntro = _staticres->loadStrings(kAudioTracksIntro, _soundFilesIntroSize);
- _cdaTrackTable = (const int32*) _staticres->loadRawData(kKyra1TownsCDATable, _cdaTrackTableSize);
+ _seq_Forest = _staticres->loadRawData(k1ForestSeq, temp);
+ _seq_KallakWriting = _staticres->loadRawData(k1KallakWritingSeq, temp);
+ _seq_KyrandiaLogo = _staticres->loadRawData(k1KyrandiaLogoSeq, temp);
+ _seq_KallakMalcolm = _staticres->loadRawData(k1KallakMalcolmSeq, temp);
+ _seq_MalcolmTree = _staticres->loadRawData(k1MalcolmTreeSeq, temp);
+ _seq_WestwoodLogo = _staticres->loadRawData(k1WestwoodLogoSeq, temp);
+ _seq_Demo1 = _staticres->loadRawData(k1Demo1Seq, temp);
+ _seq_Demo2 = _staticres->loadRawData(k1Demo2Seq, temp);
+ _seq_Demo3 = _staticres->loadRawData(k1Demo3Seq, temp);
+ _seq_Demo4 = _staticres->loadRawData(k1Demo4Seq, temp);
+ _seq_Reunion = _staticres->loadRawData(k1OutroReunionSeq, temp);
+
+ _seq_WSATable = _staticres->loadStrings(k1IntroWSAStrings, _seq_WSATable_Size);
+ _seq_CPSTable = _staticres->loadStrings(k1IntroCPSStrings, _seq_CPSTable_Size);
+ _seq_COLTable = _staticres->loadStrings(k1IntroCOLStrings, _seq_COLTable_Size);
+ _seq_textsTable = _staticres->loadStrings(k1IntroStrings, _seq_textsTable_Size);
+
+ _itemList = _staticres->loadStrings(k1ItemNames, _itemList_Size);
+ _takenList = _staticres->loadStrings(k1TakenStrings, _takenList_Size);
+ _placedList = _staticres->loadStrings(k1PlacedStrings, _placedList_Size);
+ _droppedList = _staticres->loadStrings(k1DroppedStrings, _droppedList_Size);
+ _noDropList = _staticres->loadStrings(k1NoDropStrings, _noDropList_Size);
+ _putDownFirst = _staticres->loadStrings(k1PutDownString, _putDownFirst_Size);
+ _waitForAmulet = _staticres->loadStrings(k1WaitAmuletString, _waitForAmulet_Size);
+ _blackJewel = _staticres->loadStrings(k1BlackJewelString, _blackJewel_Size);
+ _poisonGone = _staticres->loadStrings(k1PoisonGoneString, _poisonGone_Size);
+ _healingTip = _staticres->loadStrings(k1HealingTipString, _healingTip_Size);
+ _thePoison = _staticres->loadStrings(k1ThePoisonStrings, _thePoison_Size);
+ _fluteString = _staticres->loadStrings(k1FluteStrings, _fluteString_Size);
+ _wispJewelStrings = _staticres->loadStrings(k1WispJewelStrings, _wispJewelStrings_Size);
+ _magicJewelString = _staticres->loadStrings(k1MagicJewelStrings, _magicJewelString_Size);
+ _flaskFull = _staticres->loadStrings(k1FlaskFullString, _flaskFull_Size);
+ _fullFlask = _staticres->loadStrings(k1FullFlaskString, _fullFlask_Size);
+ _veryClever = _staticres->loadStrings(k1VeryCleverString, _veryClever_Size);
+ _homeString = _staticres->loadStrings(k1OutroHomeString, _homeString_Size);
+ _newGameString = _staticres->loadStrings(k1NewGameString, _newGameString_Size);
+
+ _healingShapeTable = _staticres->loadShapeTable(k1Healing1Shapes, _healingShapeTableSize);
+ _healingShape2Table = _staticres->loadShapeTable(k1Healing2Shapes, _healingShape2TableSize);
+ _posionDeathShapeTable = _staticres->loadShapeTable(k1PoisonDeathShapes, _posionDeathShapeTableSize);
+ _fluteAnimShapeTable = _staticres->loadShapeTable(k1FluteShapes, _fluteAnimShapeTableSize);
+ _winterScrollTable = _staticres->loadShapeTable(k1Winter1Shapes, _winterScrollTableSize);
+ _winterScroll1Table = _staticres->loadShapeTable(k1Winter2Shapes, _winterScroll1TableSize);
+ _winterScroll2Table = _staticres->loadShapeTable(k1Winter3Shapes, _winterScroll2TableSize);
+ _drinkAnimationTable = _staticres->loadShapeTable(k1DrinkShapes, _drinkAnimationTableSize);
+ _brandonToWispTable = _staticres->loadShapeTable(k1WispShapes, _brandonToWispTableSize);
+ _magicAnimationTable = _staticres->loadShapeTable(k1MagicAnimShapes, _magicAnimationTableSize);
+ _brandonStoneTable = _staticres->loadShapeTable(k1BranStoneShapes, _brandonStoneTableSize);
+
+ _characterImageTable = _staticres->loadStrings(k1CharacterImageFilenames, _characterImageTableSize);
+
+ _roomFilenameTable = _staticres->loadStrings(k1RoomFilenames, _roomFilenameTableSize);
+
+ _amuleteAnim = _staticres->loadRawData(k1AmuleteAnimSeq, temp);
+
+ _specialPalettes = _staticres->loadPaletteTable(k1PaletteList, temp);
+
+ _guiStrings = _staticres->loadStrings(k1GUIStrings, _guiStringsSize);
+ _configStrings = _staticres->loadStrings(k1ConfigStrings, _configStringsSize);
+
+ _soundFiles = _staticres->loadStrings(k1AudioTracks, _soundFilesSize);
+ _soundFilesIntro = _staticres->loadStrings(k1AudioTracksIntro, _soundFilesIntroSize);
+ _cdaTrackTable = (const int32*) _staticres->loadRawData(k1TownsCDATable, _cdaTrackTableSize);
// copied static res
// room list
- const Room *tempRoomList = _staticres->loadRoomTable(kRoomList, _roomTableSize);
+ const Room *tempRoomList = _staticres->loadRoomTable(k1RoomList, _roomTableSize);
if (_roomTableSize > 0) {
_roomTable = new Room[_roomTableSize];
@@ -1003,11 +1017,11 @@ void KyraEngine_v1::initStaticResource() {
memcpy(_roomTable, tempRoomList, _roomTableSize*sizeof(Room));
tempRoomList = 0;
- _staticres->unloadId(kRoomList);
+ _staticres->unloadId(k1RoomList);
}
// default shape table
- const Shape *tempShapeTable = _staticres->loadShapeTable(kDefaultShapes, _defaultShapeTableSize);
+ const Shape *tempShapeTable = _staticres->loadShapeTable(k1DefaultShapes, _defaultShapeTableSize);
if (_defaultShapeTableSize > 0) {
_defaultShapeTable = new Shape[_defaultShapeTableSize];
@@ -1016,7 +1030,7 @@ void KyraEngine_v1::initStaticResource() {
memcpy(_defaultShapeTable, tempShapeTable, _defaultShapeTableSize*sizeof(Shape));
tempShapeTable = 0;
- _staticres->unloadId(kDefaultShapes);
+ _staticres->unloadId(k1DefaultShapes);
}
// audio data tables
@@ -1034,7 +1048,7 @@ void KyraEngine_v1::initStaticResource() {
_soundData = (_flags.platform == Common::kPlatformPC) ? soundData_PC : soundData_TOWNS;
}
-void KyraEngine_v1::loadMouseShapes() {
+void KyraEngine_LoK::loadMouseShapes() {
_screen->loadBitmap("MOUSE.CPS", 3, 3, 0);
_screen->_curPage = 2;
_shapes[0] = _screen->encodeShape(0, 0, 8, 10, 0);
@@ -1050,7 +1064,7 @@ void KyraEngine_v1::loadMouseShapes() {
_screen->setShapePages(5, 3);
}
-void KyraEngine_v1::loadCharacterShapes() {
+void KyraEngine_LoK::loadCharacterShapes() {
int curImage = 0xFF;
int videoPage = _screen->_curPage;
_screen->_curPage = 2;
@@ -1071,7 +1085,7 @@ void KyraEngine_v1::loadCharacterShapes() {
_screen->_curPage = videoPage;
}
-void KyraEngine_v1::loadSpecialEffectShapes() {
+void KyraEngine_LoK::loadSpecialEffectShapes() {
_screen->loadBitmap("EFFECTS.CPS", 3, 3, 0);
_screen->_curPage = 2;
@@ -1089,7 +1103,7 @@ void KyraEngine_v1::loadSpecialEffectShapes() {
_shapes[currShape] = _screen->encodeShape((currShape-201) * 16, 106, 16, 16, 1);
}
-void KyraEngine_v1::loadItems() {
+void KyraEngine_LoK::loadItems() {
int shape;
_screen->loadBitmap("JEWELS3.CPS", 3, 3, 0);
@@ -1143,7 +1157,7 @@ void KyraEngine_v1::loadItems() {
delete[] fileData;
}
-void KyraEngine_v1::loadButtonShapes() {
+void KyraEngine_LoK::loadButtonShapes() {
_screen->loadBitmap("BUTTONS2.CPS", 3, 3, 0);
_screen->_curPage = 2;
_gui->_scrollUpButton.data0ShapePtr = _screen->encodeShape(0, 0, 24, 14, 1);
@@ -1155,7 +1169,7 @@ void KyraEngine_v1::loadButtonShapes() {
_screen->_curPage = 0;
}
-void KyraEngine_v1::loadMainScreen(int page) {
+void KyraEngine_LoK::loadMainScreen(int page) {
_screen->clearPage(page);
if (_flags.lang == Common::EN_ANY && !_flags.isTalkie && (_flags.platform == Common::kPlatformPC || _flags.platform == Common::kPlatformAmiga))
@@ -1186,43 +1200,37 @@ void KyraEngine_HoF::initStaticResource() {
_ingamePakList = _staticres->loadStrings(k2IngamePakFiles, _ingamePakListSize);
_sequenceStrings = _staticres->loadStrings(k2SeqplayStrings, _sequenceStringsSize);
_ingameSoundList = _staticres->loadStrings(k2IngameSfxFiles, _ingameSoundListSize);
- _ingameSoundIndex = (const uint16*) _staticres->loadRawData(k2IngameSfxIndex, _ingameSoundIndexSize);
+ _ingameSoundIndex = (const uint16 *)_staticres->loadRawData(k2IngameSfxIndex, _ingameSoundIndexSize);
_musicFileListIntro = _staticres->loadStrings(k2SeqplayIntroTracks, _musicFileListIntroSize);
_musicFileListIngame = _staticres->loadStrings(k2IngameTracks, _musicFileListIngameSize);
_musicFileListFinale = _staticres->loadStrings(k2SeqplayFinaleTracks, _musicFileListFinaleSize);
_cdaTrackTableIntro = _staticres->loadRawData(k2SeqplayIntroCDA, _cdaTrackTableIntroSize);
_cdaTrackTableIngame = _staticres->loadRawData(k2IngameCDA, _cdaTrackTableIngameSize);
_cdaTrackTableFinale = _staticres->loadRawData(k2SeqplayFinaleCDA, _cdaTrackTableFinaleSize);
- _ingameTalkObjIndex = (const uint16*) _staticres->loadRawData(k2IngameTalkObjIndex, _ingameTalkObjIndexSize);
+ _ingameTalkObjIndex = (const uint16 *)_staticres->loadRawData(k2IngameTalkObjIndex, _ingameTalkObjIndexSize);
_ingameTimJpStr = _staticres->loadStrings(k2IngameTimJpStrings, _ingameTimJpStrSize);
- _itemAnimData = _staticres->loadHofShapeAnimDataV2(k2IngameShapeAnimData, _itemAnimDataSize);
+ _itemAnimData = _staticres->loadShapeAnimData_v2(k2IngameShapeAnimData, _itemAnimDataSize);
- // replace sequence talkie files with localized versions and cut off .voc
- // suffix from voc files so as to allow compression specific file extensions
- const char* const* seqSoundList = _staticres->loadStrings(k2SeqplaySfxFiles, _sequenceSoundListSize);
- const char* const* tlkfiles = _staticres->loadStrings(k2SeqplayTlkFiles, tmpSize);
- char ** tmpSndLst = new char*[_sequenceSoundListSize];
+ // replace sequence talkie files with localized versions
+ const char *const *seqSoundList = _staticres->loadStrings(k2SeqplaySfxFiles, _sequenceSoundListSize);
+ const char *const *tlkfiles = _staticres->loadStrings(k2SeqplayTlkFiles, tmpSize);
+ char **tmpSndLst = new char*[_sequenceSoundListSize];
for (int i = 0; i < _sequenceSoundListSize; i++) {
- int len = strlen(seqSoundList[i]);
+ const int len = strlen(seqSoundList[i]);
tmpSndLst[i] = new char[len + 1];
tmpSndLst[i][0] = 0;
- if (_flags.platform == Common::kPlatformPC)
- len -= 4;
-
- if (tlkfiles) {
+ if (tlkfiles && len > 1) {
for (int ii = 0; ii < tmpSize; ii++) {
- if (!scumm_stricmp(&seqSoundList[i][1], &tlkfiles[ii][1]))
- strcpy(tmpSndLst[i], tlkfiles[ii]);
+ if (strlen(tlkfiles[ii]) > 1 && !scumm_stricmp(&seqSoundList[i][1], &tlkfiles[ii][1]))
+ strcpy(tmpSndLst[i], tlkfiles[ii]);
}
}
if (tmpSndLst[i][0] == 0)
strcpy(tmpSndLst[i], seqSoundList[i]);
-
- tmpSndLst[i][len] = 0;
}
tlkfiles = seqSoundList = 0;
@@ -1269,7 +1277,7 @@ void KyraEngine_HoF::initStaticResource() {
&KyraEngine_HoF::seq_introLibrary2, &KyraEngine_HoF::seq_introLibrary2,
&KyraEngine_HoF::seq_introMarco, &KyraEngine_HoF::seq_introHand1a,
&KyraEngine_HoF::seq_introHand1b, &KyraEngine_HoF::seq_introHand1c,
- &KyraEngine_HoF::seq_introHand2, &KyraEngine_HoF::seq_introHand3, 0
+ &KyraEngine_HoF::seq_introHand2, &KyraEngine_HoF::seq_introHand3, 0
};
static const SeqProc hofDemoSequenceCallbacks[] = {
@@ -1289,7 +1297,19 @@ void KyraEngine_HoF::initStaticResource() {
_callbackN = (_flags.isDemo && !_flags.isTalkie) ? hofDemoNestedSequenceCallbacks : hofNestedSequenceCallbacks;
}
-const ScreenDim Screen_v1::_screenDimTable[] = {
+void KyraEngine_MR::initStaticResource() {
+ int tmp = 0;
+ _mainMenuStrings = _staticres->loadStrings(k3MainMenuStrings, _mainMenuStringsSize);
+ _soundList = _staticres->loadStrings(k3MusicFiles, _soundListSize);
+ _scoreTable = _staticres->loadRawData(k3ScoreTable, _scoreTableSize);
+ _sfxFileList = _staticres->loadStrings(k3SfxFiles, _sfxFileListSize);
+ _sfxFileMap = _staticres->loadRawData(k3SfxMap, _sfxFileMapSize);
+ _itemAnimData = _staticres->loadShapeAnimData_v2(k3ItemAnimData, tmp);
+ _itemMagicTable = _staticres->loadRawData(k3ItemMagicTable, tmp);
+ _itemStringMap = _staticres->loadRawData(k3ItemStringMap, _itemStringMapSize);
+}
+
+const ScreenDim Screen_LoK::_screenDimTable[] = {
{ 0x00, 0x00, 0x28, 0xC8, 0x0F, 0x0C, 0x00, 0x00 },
{ 0x08, 0x48, 0x18, 0x38, 0x0F, 0x0C, 0x00, 0x00 },
{ 0x01, 0x08, 0x26, 0x80, 0x0F, 0x0C, 0x00, 0x00 },
@@ -1303,7 +1323,7 @@ const ScreenDim Screen_v1::_screenDimTable[] = {
{ 0x03, 0x28, 0x22, 0x46, 0x0F, 0x0D, 0x00, 0x00 }
};
-const int Screen_v1::_screenDimTableCount = ARRAYSIZE(Screen_v1::_screenDimTable);
+const int Screen_LoK::_screenDimTableCount = ARRAYSIZE(Screen_LoK::_screenDimTable);
const ScreenDim Screen_HoF::_screenDimTable[] = {
{ 0x00, 0x00, 0x28, 0xC8, 0xC7, 0xCF, 0x00, 0x00 },
@@ -1331,31 +1351,31 @@ const ScreenDim Screen_MR::_screenDimTable[] = {
const int Screen_MR::_screenDimTableCount = ARRAYSIZE(Screen_MR::_screenDimTable);
-const int8 KyraEngine::_addXPosTable[] = {
+const int8 KyraEngine_v1::_addXPosTable[] = {
4, 4, 0, -4, -4, -4, 0, 4
};
-const int8 KyraEngine::_addYPosTable[] = {
+const int8 KyraEngine_v1::_addYPosTable[] = {
0, -2, -2, -2, 0, 2, 2, 2
};
-const int8 KyraEngine_v1::_charXPosTable[] = {
+const int8 KyraEngine_v1::_charAddXPosTable[] = {
0, 4, 4, 4, 0, -4, -4, -4
};
-const int8 KyraEngine_v1::_charYPosTable[] = {
+const int8 KyraEngine_v1::_charAddYPosTable[] = {
-2, -2, 0, 2, 2, 2, 0, -2
};
-const uint16 KyraEngine_v1::_itemPosX[] = {
+const uint16 KyraEngine_LoK::_itemPosX[] = {
95, 115, 135, 155, 175, 95, 115, 135, 155, 175
};
-const uint8 KyraEngine_v1::_itemPosY[] = {
+const uint8 KyraEngine_LoK::_itemPosY[] = {
160, 160, 160, 160, 160, 181, 181, 181, 181, 181
};
-void GUI_v1::initStaticResource() {
+void GUI_LoK::initStaticResource() {
GUI_V1_BUTTON(_scrollUpButton, 0x12, 1, 1, 1, 0x483, 0, 0, 0, 0x18, 0x0f, 0);
GUI_V1_BUTTON(_scrollDownButton, 0x13, 1, 1, 1, 0x483, 0, 0, 0, 0x18, 0x0f, 0);
@@ -1366,13 +1386,13 @@ void GUI_v1::initStaticResource() {
GUI_V1_BUTTON(_menuButtonData[4], 0x10, 1, 1, 1, 0x487, 0, 0, 0, 0, 0, 0);
GUI_V1_BUTTON(_menuButtonData[5], 0x11, 1, 1, 1, 0x487, 0, 0, 0, 0, 0, 0);
- delete [] _menu;
+ delete[] _menu;
_menu = new Menu[6];
assert(_menu);
- Button::Callback quitPlayingFunctor = BUTTON_FUNCTOR(GUI_v1, this, &GUI_v1::quitPlaying);
- Button::Callback loadGameMenuFunctor = BUTTON_FUNCTOR(GUI_v1, this, &GUI_v1::loadGameMenu);
- Button::Callback cancelSubMenuFunctor = BUTTON_FUNCTOR(GUI_v1, this, &GUI_v1::cancelSubMenu);
+ Button::Callback quitPlayingFunctor = BUTTON_FUNCTOR(GUI_LoK, this, &GUI_LoK::quitPlaying);
+ Button::Callback loadGameMenuFunctor = BUTTON_FUNCTOR(GUI_LoK, this, &GUI_LoK::loadGameMenu);
+ Button::Callback cancelSubMenuFunctor = BUTTON_FUNCTOR(GUI_LoK, this, &GUI_LoK::cancelSubMenu);
GUI_V1_MENU(_menu[0], -1, -1, 0x100, 0x8B, 248, 249, 250, 0, 251, -1, 8, 0, 5, -1, -1, -1, -1);
GUI_V1_MENU_ITEM(_menu[0].item[0], 1, 0, 0, 0, -1, -1, 0x1E, 0xDC, 0x0F, 252, 253, -1, 0, 248, 249, 250, -1, 0, 0, 0, 0, 0);
@@ -1381,16 +1401,16 @@ void GUI_v1::initStaticResource() {
GUI_V1_MENU_ITEM(_menu[0].item[3], 1, 0, 0, 0, -1, -1, 0x51, 0xDC, 0x0F, 252, 253, -1, 0, 248, 249, 250, -1, 0, 0, 0, 0, 0);
GUI_V1_MENU_ITEM(_menu[0].item[4], 1, 0, 0, 0, -1, 0, 0x6E, 0xDC, 0x0F, 252, 253, -1, 255, 248, 249, 250, -1, 0, 0, 0, 0, 0);
_menu[0].item[0].callback = loadGameMenuFunctor;
- _menu[0].item[1].callback = BUTTON_FUNCTOR(GUI_v1, this, &GUI_v1::saveGameMenu);
- _menu[0].item[2].callback = BUTTON_FUNCTOR(GUI_v1, this, &GUI_v1::gameControlsMenu);
+ _menu[0].item[1].callback = BUTTON_FUNCTOR(GUI_LoK, this, &GUI_LoK::saveGameMenu);
+ _menu[0].item[2].callback = BUTTON_FUNCTOR(GUI_LoK, this, &GUI_LoK::gameControlsMenu);
_menu[0].item[3].callback = quitPlayingFunctor;
- _menu[0].item[4].callback = BUTTON_FUNCTOR(GUI_v1, this, &GUI_v1::resumeGame);
+ _menu[0].item[4].callback = BUTTON_FUNCTOR(GUI_LoK, this, &GUI_LoK::resumeGame);
GUI_V1_MENU(_menu[1], -1, -1, 0x140, 0x38, 248, 249, 250, 0, 254,-1, 8, 0, 2, -1, -1, -1, -1);
GUI_V1_MENU_ITEM(_menu[1].item[0], 1, 0, 0, 0, 0x18, 0, 0x1E, 0x48, 0x0F, 252, 253, -1, 255, 248, 249, 250, -1, 0, 0, 0, 0, 0);
GUI_V1_MENU_ITEM(_menu[1].item[1], 1, 0, 0, 0, 0xD8, 0, 0x1E, 0x48, 0x0F, 252, 253, -1, 255, 248, 249, 250, -1, 0, 0, 0, 0, 0);
- _menu[1].item[0].callback = BUTTON_FUNCTOR(GUI_v1, this, &GUI_v1::quitConfirmYes);
- _menu[1].item[1].callback = BUTTON_FUNCTOR(GUI_v1, this, &GUI_v1::quitConfirmNo);
+ _menu[1].item[0].callback = BUTTON_FUNCTOR(GUI_LoK, this, &GUI_LoK::quitConfirmYes);
+ _menu[1].item[1].callback = BUTTON_FUNCTOR(GUI_LoK, this, &GUI_LoK::quitConfirmNo);
GUI_V1_MENU(_menu[2], -1, -1, 0x120, 0xA0, 248, 249, 250, 0, 251, -1, 8, 0, 6, 132, 22, 132, 124);
GUI_V1_MENU_ITEM(_menu[2].item[0], 1, 0, 0, 0, -1, 255, 0x27, 0x100, 0x0F, 252, 253, 5, 0, 248, 249, 250, -1, 0, 0, 0, 0, 0);
@@ -1404,7 +1424,7 @@ void GUI_v1::initStaticResource() {
GUI_V1_MENU(_menu[3], -1, -1, 288, 67, 248, 249, 250, 0, 251, -1, 8, 0, 2, -1, -1, -1, -1);
GUI_V1_MENU_ITEM(_menu[3].item[0], 1, 0, 0, 0, 24, 0, 44, 85, 15, 252, 253, -1, 255, 248, 249, 250, -1, 0, 0, 0, 0, 0);
GUI_V1_MENU_ITEM(_menu[3].item[1], 1, 0, 0, 0, 179, 0, 44, 85, 15, 252, 253, -1, 255, 248, 249, 250, -1, 0, 0, 0, 0, 0);
- _menu[3].item[0].callback = BUTTON_FUNCTOR(GUI_v1, this, &GUI_v1::savegameConfirm);
+ _menu[3].item[0].callback = BUTTON_FUNCTOR(GUI_LoK, this, &GUI_LoK::savegameConfirm);
_menu[3].item[1].callback = cancelSubMenuFunctor;
GUI_V1_MENU(_menu[4], -1, -1, 0xD0, 0x4C, 248, 249, 250, 0, 251, -1, 8, 0, 2, -1, -1, -1, -1);
@@ -1420,16 +1440,16 @@ void GUI_v1::initStaticResource() {
GUI_V1_MENU_ITEM(_menu[5].item[3], 1, 0, 0, 0, 0xA5, 0, 0x51, 0x80, 0x0F, 252, 253, 5, 0, 248, 249, 250, -1, 0, 0x10, 0x53, 0, 0);
GUI_V1_MENU_ITEM(_menu[5].item[4], 1, 0, 0, 0, 0xA5, 0, 0x62, 0x80, 0x0F, 252, 253, 5, 0, 248, 249, 250, -1, 0, 0x10, 0x65, 0, 0);
GUI_V1_MENU_ITEM(_menu[5].item[5], 1, 0, 0, 0, -1, 0, 0x7F, 0x6C, 0x0F, 252, 253, -1, 255, 248, 249, 250, -1, -0, 0, 0, 0, 0);
- _menu[5].item[0].callback = BUTTON_FUNCTOR(GUI_v1, this, &GUI_v1::controlsChangeMusic);
- _menu[5].item[1].callback = BUTTON_FUNCTOR(GUI_v1, this, &GUI_v1::controlsChangeSounds);
- _menu[5].item[2].callback = BUTTON_FUNCTOR(GUI_v1, this, &GUI_v1::controlsChangeWalk);
- _menu[5].item[4].callback = BUTTON_FUNCTOR(GUI_v1, this, &GUI_v1::controlsChangeText);
- _menu[5].item[5].callback = BUTTON_FUNCTOR(GUI_v1, this, &GUI_v1::controlsApply);
+ _menu[5].item[0].callback = BUTTON_FUNCTOR(GUI_LoK, this, &GUI_LoK::controlsChangeMusic);
+ _menu[5].item[1].callback = BUTTON_FUNCTOR(GUI_LoK, this, &GUI_LoK::controlsChangeSounds);
+ _menu[5].item[2].callback = BUTTON_FUNCTOR(GUI_LoK, this, &GUI_LoK::controlsChangeWalk);
+ _menu[5].item[4].callback = BUTTON_FUNCTOR(GUI_LoK, this, &GUI_LoK::controlsChangeText);
+ _menu[5].item[5].callback = BUTTON_FUNCTOR(GUI_LoK, this, &GUI_LoK::controlsApply);
}
-void KyraEngine_v1::setupButtonData() {
- delete [] _buttonData;
- delete [] _buttonDataListPtr;
+void KyraEngine_LoK::setupButtonData() {
+ delete[] _buttonData;
+ delete[] _buttonDataListPtr;
_buttonData = new Button[15];
assert(_buttonData);
@@ -1437,9 +1457,9 @@ void KyraEngine_v1::setupButtonData() {
assert(_buttonDataListPtr);
GUI_V1_BUTTON(_buttonData[1], 0x01, 1, 1, 1, 0x0487, 0, 0x009, 0xA4, 0x36, 0x1E, 0);
- _buttonData[1].buttonCallback = BUTTON_FUNCTOR(GUI_v1, _gui, &GUI_v1::buttonMenuCallback);
+ _buttonData[1].buttonCallback = BUTTON_FUNCTOR(GUI_LoK, _gui, &GUI_LoK::buttonMenuCallback);
- Button::Callback inventoryFunctor = BUTTON_FUNCTOR(KyraEngine_v1, this, &KyraEngine_v1::buttonInventoryCallback);
+ Button::Callback inventoryFunctor = BUTTON_FUNCTOR(KyraEngine_LoK, this, &KyraEngine_LoK::buttonInventoryCallback);
for (int i = 2; i <= 10; ++i)
_buttonData[i].buttonCallback = inventoryFunctor;
_buttonData[0].buttonCallback = inventoryFunctor;
@@ -1454,7 +1474,7 @@ void KyraEngine_v1::setupButtonData() {
GUI_V1_BUTTON(_buttonData[9], 0x0A, 0, 0, 0, 0x0400, 0, 0x099, 0xB3, 0x13, 0x14, 0);
GUI_V1_BUTTON(_buttonData[10], 0x0B, 0, 0, 0, 0x0400, 0, 0x0AD, 0xB3, 0x13, 0x14, 0);
- Button::Callback amuletFunctor = BUTTON_FUNCTOR(KyraEngine_v1, this, &KyraEngine_v1::buttonAmuletCallback);
+ Button::Callback amuletFunctor = BUTTON_FUNCTOR(KyraEngine_LoK, this, &KyraEngine_LoK::buttonAmuletCallback);
GUI_V1_BUTTON(_buttonData[11], 0x15, 1, 1, 1, 0x0487, 0, 0x0FD, 0x9C, 0x1A, 0x12, 0);
GUI_V1_BUTTON(_buttonData[12], 0x16, 1, 1, 1, 0x0487, 0, 0x0E7, 0xAA, 0x1A, 0x12, 0);
GUI_V1_BUTTON(_buttonData[13], 0x17, 1, 1, 1, 0x0487, 0, 0x0FD, 0xB5, 0x1A, 0x12, 0);
@@ -1467,29 +1487,29 @@ void KyraEngine_v1::setupButtonData() {
_buttonDataListPtr[14] = 0;
}
-const uint8 KyraEngine_v1::_magicMouseItemStartFrame[] = {
+const uint8 KyraEngine_LoK::_magicMouseItemStartFrame[] = {
0xAD, 0xB7, 0xBE, 0x00
};
-const uint8 KyraEngine_v1::_magicMouseItemEndFrame[] = {
+const uint8 KyraEngine_LoK::_magicMouseItemEndFrame[] = {
0xB1, 0xB9, 0xC2, 0x00
};
-const uint8 KyraEngine_v1::_magicMouseItemStartFrame2[] = {
+const uint8 KyraEngine_LoK::_magicMouseItemStartFrame2[] = {
0xB2, 0xBA, 0xC3, 0x00
};
-const uint8 KyraEngine_v1::_magicMouseItemEndFrame2[] = {
+const uint8 KyraEngine_LoK::_magicMouseItemEndFrame2[] = {
0xB6, 0xBD, 0xC8, 0x00
};
-const uint16 KyraEngine_v1::_amuletX[] = { 231, 275, 253, 253 };
-const uint16 KyraEngine_v1::_amuletY[] = { 170, 170, 159, 181 };
+const uint16 KyraEngine_LoK::_amuletX[] = { 231, 275, 253, 253 };
+const uint16 KyraEngine_LoK::_amuletY[] = { 170, 170, 159, 181 };
-const uint16 KyraEngine_v1::_amuletX2[] = { 0x000, 0x0FD, 0x0E7, 0x0FD, 0x113, 0x000 };
-const uint16 KyraEngine_v1::_amuletY2[] = { 0x000, 0x09F, 0x0AA, 0x0B5, 0x0AA, 0x000 };
+const uint16 KyraEngine_LoK::_amuletX2[] = { 0x000, 0x0FD, 0x0E7, 0x0FD, 0x113, 0x000 };
+const uint16 KyraEngine_LoK::_amuletY2[] = { 0x000, 0x09F, 0x0AA, 0x0B5, 0x0AA, 0x000 };
-const int8 KyraEngine_v1::_dosTrackMap[] = {
+const int8 KyraEngine_LoK::_dosTrackMap[] = {
-1, 0, -1, 1, 0, 3, 0, 2,
0, 4, 1, 2, 1, 3, 1, 4,
1, 92, 1, 6, 1, 7, 2, 2,
@@ -1506,18 +1526,10 @@ const int8 KyraEngine_v1::_dosTrackMap[] = {
8, 4, 8, 5, 6, 11, 5, 11
};
-const int KyraEngine_v1::_dosTrackMapSize = ARRAYSIZE(KyraEngine_v1::_dosTrackMap);
+const int KyraEngine_LoK::_dosTrackMapSize = ARRAYSIZE(KyraEngine_LoK::_dosTrackMap);
// kyra engine v2 static data
-const int8 KyraEngine_v2::_updateCharPosXTable[] = {
- 0, 4, 4, 4, 0, -4, -4, -4
-};
-
-const int8 KyraEngine_v2::_updateCharPosYTable[] = {
- -2, -2, 0, 2, 2, 2, 0, -2
-};
-
const int GUI_v2::_sliderBarsPosition[] = {
0x92, 0x1F, 0x92, 0x30, 0x92, 0x41, 0x92, 0x52
};
@@ -1530,16 +1542,16 @@ const char *KyraEngine_HoF::_languageExtension[] = {
"ENG",
"FRE",
"GER",/*,
- "ITA", Italian and Spanish was never included
+ "ITA", Italian and Spanish were never included
"SPA"*/
- "JPN"
+ "JPN",
};
const char *KyraEngine_HoF::_scriptLangExt[] = {
"EMC",
"FMC",
"GMC",/*,
- "IMC", Italian and Spanish was never included
+ "IMC", Italian and Spanish were never included
"SMC"*/
"JMC"
};
@@ -1611,7 +1623,7 @@ const int8 KyraEngine_HoF::_dosTrackMap[] = {
const int KyraEngine_HoF::_dosTrackMapSize = ARRAYSIZE(KyraEngine_HoF::_dosTrackMap);
void KyraEngine_HoF::initInventoryButtonList() {
- delete [] _inventoryButtons;
+ delete[] _inventoryButtons;
_inventoryButtons = new Button[15];
assert(_inventoryButtons);
@@ -1655,19 +1667,15 @@ void GUI_HoF::initStaticData() {
GUI_V2_BUTTON(_scrollUpButton, 0x17, 0, 0, 1, 1, 1, 0x4487, 0, 0, 0, 0x18, 0x0F, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
GUI_V2_BUTTON(_scrollDownButton, 0x18, 0, 0, 1, 1, 1, 0x4487, 0, 0, 0, 0x18, 0x0F, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
- for (int i = 0; i < 4; ++i) {
+ for (int i = 0; i < 4; ++i)
GUI_V2_BUTTON(_sliderButtons[0][i], 0x18+i, 0, 0, 1, 1, 1, 0x4487, 0, 0, 0, 0x0A, 0x0E, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
- }
- for (int i = 0; i < 4; ++i) {
+ for (int i = 0; i < 4; ++i)
GUI_V2_BUTTON(_sliderButtons[1][i], 0x1C+i, 0, 0, 1, 1, 1, 0x4487, 0, 0, 0, 0x0A, 0x0E, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
- }
- for (int i = 0; i < 4; ++i) {
+ for (int i = 0; i < 4; ++i)
GUI_V2_BUTTON(_sliderButtons[2][i], 0x20+i, 0, 0, 0, 0, 0, 0x2200, 0, 0, 0, 0x6E, 0x0E, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
- }
- for (uint i = 0; i < ARRAYSIZE(_menuButtons); ++i) {
+ for (uint i = 0; i < ARRAYSIZE(_menuButtons); ++i)
GUI_V2_BUTTON(_menuButtons[i], 0x10+i, 0, 0, 1, 1, 1, 0x4487, 0, 0, 0, 0, 0, 0xC7, 0xCF, 0xC7, 0xCF, 0xC7, 0xCF, 0);
- }
Button::Callback clickLoadSlotFunctor = BUTTON_FUNCTOR(GUI_HoF, this, &GUI_HoF::clickLoadSlot);
Button::Callback clickSaveSlotFunctor = BUTTON_FUNCTOR(GUI_HoF, this, &GUI_HoF::clickSaveSlot);
@@ -1932,74 +1940,11 @@ const uint8 KyraEngine_HoF::_rainbowRoomData[] = {
// kyra 3 static res
-const char *KyraEngine_MR::_mainMenuStrings[] = {
- "Start a new game",
- "Introduction",
- "Load a game",
- "Exit the game",
- "Nouvelle Partie",
- "Introduction",
- "Charger une partie",
- "Quitter le jeu",
- "Neues Spiel starten",
- "Intro",
- "Spielstand laden",
- "Spiel beenden",
- 0
-};
-
-const char *KyraEngine_MR::_soundList[] = {
- "ARREST1.AUD",
- "BATH1.AUD",
- "OCEAN1.AUD",
- "CLOWN1.AUD",
- "DARM2.AUD",
- "FALL1M.AUD",
- "FALL2.AUD",
- "FISH1.AUD",
- "FISHWNDR.AUD",
- "HERMAN1.AUD",
- "JAIL1.AUD",
- "JUNGLE1.AUD",
- "KATHY1.AUD",
- "NICESINE.AUD",
- "PEGASUS1.AUD",
- "PIRATE1.AUD",
- "PIRATE2.AUD",
- "PIRATE3.AUD",
- "POP3.AUD",
- "PORT1.AUD",
- "QUEEN1.AUD",
- "RUINS1.AUD",
- "SNAKES1.AUD",
- "SPRING1.AUD",
- "STATUE1.AUD",
- "STATUE2.AUD",
- "TITLE1.AUD",
- "UNDER1.AUD",
- "WALKCHP1.AUD",
- "YANK1.AUD",
- "ZAN2.AUD",
- "GROOVE2.AUD",
- "GROOVE3.AUD",
- "KING1.AUD",
- "KING2.AUD",
- "GROOVE1.AUD",
- "JAIL2.AUD",
- "SPIRIT1.AUD",
- "SPRING1A.AUD",
- "POP1.AUD",
- "POP2.AUD",
- "SQUIRL1.AUD"
-};
-
-const int KyraEngine_MR::_soundListSize = ARRAYSIZE(KyraEngine_MR::_soundList);
-
const char *KyraEngine_MR::_languageExtension[] = {
"TRE",
"TRF",
"TRG"/*,
- "TRI", Italian and Spanish was never included
+ "TRI", Italian and Spanish were never included
"TRS"*/
};
@@ -2026,316 +1971,6 @@ const uint8 KyraEngine_MR::_characterFrameTable[] = {
0x36, 0x35, 0x35, 0x33, 0x32, 0x32, 0x34, 0x34
};
-const uint8 KyraEngine_MR::_sfxFileMap[] = {
- 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00,
- 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00,
- 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x99, 0x00,
- 0x46, 0x00, 0xA9, 0x00, 0x33, 0x00, 0x65, 0x00,
- 0x9B, 0x00, 0x17, 0x00, 0xBB, 0x00, 0x64, 0x00,
- 0x55, 0x00, 0xD5, 0x00, 0x66, 0x00, 0xB9, 0x00,
- 0x9A, 0x00, 0xFF, 0x00, 0xCC, 0x00, 0x67, 0x00,
- 0x2E, 0x00, 0xA1, 0x00, 0xD0, 0x00, 0x63, 0x00,
- 0x89, 0x00, 0xBE, 0x00, 0x80, 0x00, 0x1D, 0x00,
- 0x02, 0x00, 0x28, 0x00, 0x91, 0x00, 0x29, 0x00,
- 0xCE, 0x00, 0x8F, 0x00, 0x49, 0x00, 0x2B, 0x00,
- 0x2D, 0x00, 0x2C, 0x00, 0x3E, 0x00, 0x22, 0x00,
- 0x80, 0x00, 0x9C, 0x00, 0x2E, 0x00, 0x04, 0x00,
- 0x47, 0x00, 0xA8, 0x00, 0x51, 0x00, 0x52, 0x00,
- 0x80, 0x00, 0x48, 0x00, 0x38, 0x0A, 0x0C, 0x00,
- 0xD8, 0x00, 0xD1, 0x00, 0xD2, 0x00, 0xD3, 0x00,
- 0xD1, 0x00, 0x6A, 0x00, 0x8A, 0x00, 0xC0, 0x00,
- 0xC1, 0x00, 0xC2, 0x00, 0x9F, 0x00, 0xA3, 0x00,
- 0x90, 0x00, 0xB6, 0x00, 0x37, 0x00, 0x71, 0x00,
- 0x13, 0x00, 0x50, 0x00, 0x5A, 0x00, 0x6E, 0x00,
- 0x70, 0x00, 0x11, 0x00, 0x16, 0x00, 0x14, 0x00,
- 0x43, 0x00, 0xCD, 0x00, 0xAA, 0x00, 0x15, 0x00,
- 0x83, 0x00, 0x19, 0x00, 0xB3, 0x00, 0x6F, 0x00,
- 0x26, 0x00, 0xC8, 0x00, 0xA7, 0x00, 0x98, 0x00,
- 0x87, 0x00, 0xC7, 0x00, 0xA2, 0x00, 0xB0, 0x00,
- 0x12, 0x00, 0xD7, 0x00, 0x56, 0x00, 0x45, 0x00,
- 0x4B, 0x00, 0xAF, 0x00, 0x3B, 0x00, 0x6C, 0x00,
- 0x8E, 0x00, 0x39, 0x00, 0x38, 0x00, 0x92, 0x00,
- 0x4B, 0x00, 0xD0, 0x00, 0x4A, 0x00, 0x9D, 0x00,
- 0x7F, 0x00, 0x6D, 0x00, 0xFF, 0x00, 0xFF, 0x00,
- 0x3D, 0x00, 0x72, 0x00, 0x40, 0x00, 0x66, 0x00,
- 0x01, 0x00, 0xA5, 0x00, 0x00, 0x00, 0x3C, 0x00,
- 0xAC, 0x00, 0x38, 0x00, 0x8B, 0x00, 0xDF, 0x00,
- 0x0E, 0x00, 0x54, 0x00, 0xFF, 0x00, 0xFF, 0x00,
- 0x94, 0x00, 0xAB, 0x00, 0x76, 0x00, 0x58, 0x00,
- 0x6B, 0x00, 0x27, 0x00, 0xFF, 0x00, 0x77, 0x00,
- 0xA6, 0x00, 0x63, 0x00, 0x9E, 0x00, 0xDE, 0x00,
- 0x84, 0x00, 0x85, 0x00, 0x86, 0x00, 0x3F, 0x00,
- 0xCC, 0x00, 0xCC, 0x00, 0xCC, 0x00, 0x93, 0x00,
- 0x9D, 0x00, 0x75, 0x00, 0x75, 0x00, 0x75, 0x00,
- 0x75, 0x00, 0x3A, 0x00, 0xFF, 0x00, 0xFF, 0x00,
- 0xFF, 0x00, 0xAE, 0x00, 0x8C, 0x00, 0x20, 0x00,
- 0xFF, 0x00, 0x32, 0x00, 0x32, 0x00, 0xFF, 0x00,
- 0x4D, 0x00, 0xD9, 0x00, 0x88, 0x00, 0x4D, 0x00,
- 0x4D, 0x00, 0x4D, 0x00, 0x4D, 0x00, 0xA0, 0x00,
- 0x4C, 0x00, 0x8C, 0x00, 0x4C, 0x00, 0x4C, 0x00,
- 0x8C, 0x00, 0x8C, 0x00, 0x5C, 0x00, 0x5D, 0x00,
- 0x60, 0x00, 0x5F, 0x00, 0xC5, 0x00, 0xBF, 0x00,
- 0xFF, 0x00, 0x4F, 0x00, 0x16, 0x00, 0x59, 0x00,
- 0xFF, 0x00, 0x24, 0x00, 0xA4, 0x00, 0xCF, 0x00,
- 0xFF, 0x00, 0x47, 0x00, 0x95, 0x00, 0x96, 0x00,
- 0x7B, 0x00, 0xBD, 0x00, 0xFF, 0x00, 0x34, 0x00,
- 0x35, 0x00, 0x36, 0x00, 0xDE, 0x00, 0xFF, 0x00,
- 0x4B, 0x00, 0xD6, 0x00, 0xFF, 0x00, 0x61, 0x00,
- 0x62, 0x00, 0xFF, 0x00, 0x78, 0x00, 0xFF, 0x00,
- 0x44, 0x00, 0xB4, 0x00, 0xB5, 0x00, 0x42, 0x00,
- 0x27, 0x00, 0xA2, 0x00, 0x27, 0x00, 0x5D, 0x00,
- 0x7A, 0x00, 0x89, 0x00, 0x1A, 0x00, 0x0E, 0x00,
- 0x82, 0x00, 0xFF, 0x00, 0x79, 0x00, 0x2A, 0x00,
- 0x81, 0x00, 0xFF, 0x00, 0x74, 0x00, 0x4E, 0x00,
- 0xB1, 0x00, 0x1B, 0x00, 0x2F, 0x00, 0xBA, 0x00,
- 0xBB, 0x00, 0xBC, 0x00, 0xDA, 0x00, 0xDB, 0x00,
- 0x18, 0x00, 0x5E, 0x00, 0x0D, 0x0A, 0x88, 0x00,
- 0x1E, 0x00, 0x1F, 0x00, 0x20, 0x00, 0x21, 0x00,
- 0x69, 0x00, 0x1C, 0x00, 0x7C, 0x00, 0x30, 0x00,
- 0xC3, 0x00, 0xC4, 0x00, 0xAD, 0x00, 0x25, 0x00,
- 0x53, 0x00, 0xB7, 0x00, 0xB8, 0x00, 0xDC, 0x00,
- 0x8D, 0x00, 0xCB, 0x00, 0xD4, 0x00, 0xB2, 0x00,
- 0xDD, 0x00, 0x57, 0x00, 0x41, 0x00, 0x10, 0x00,
- 0x4C, 0x00, 0xC9, 0x00, 0xFF, 0x00, 0xFF, 0x00,
- 0x7D, 0x00, 0x7E, 0x00, 0xCA, 0x00, 0x03, 0x00,
- 0x04, 0x00, 0x05, 0x00, 0x06, 0x00, 0x07, 0x00,
- 0x08, 0x00, 0x09, 0x00, 0x0A, 0x00, 0x0B, 0x00,
- 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00,
- 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00,
- 0x23, 0x00, 0x97, 0x00, 0x73, 0x00
-};
-
-const int KyraEngine_MR::_sfxFileMapSize = ARRAYSIZE(KyraEngine_MR::_sfxFileMap);
-
-const char *KyraEngine_MR::_sfxFileList[] = {
- "ALARM1",
- "ARMOIRE1",
- "ARROW1",
- "AUDLAFF1",
- "AUDLAFF2",
- "AUDLAFF3",
- "AUDLAFF4",
- "AUDLAFF5",
- "AUDLAFF6",
- "AUDLAFF7",
- "AUDLAFF8",
- "AUDLAFF9",
- "BARK22A",
- "BEAM1",
- "BEDSQK1",
- "BEDSQK2",
- "BIGCLOK1",
- "BIGDOR2",
- "BIRD4",
- "BIRD122",
- "BIRD222",
- "BIRD322",
- "BLAST22D",
- "BLINK1",
- "BOATMIX1",
- "BODYFAL1",
- "BOTLBLOW",
- "BOUNCE3",
- "BOUNCE5",
- "BOW2",
- "BUBL1",
- "BUBL2",
- "BUBL3",
- "BUBL4",
- "BUTTON1",
- "BUTTON2",
- "CANNON1",
- "CASHREG1",
- "CATHY1",
- "CHAIN1",
- "CHATTER1",
- "CHATTER2",
- "CHEESE1",
- "CHICHIC2",
- "CHIPLAF1",
- "CHIPROR1",
- "CLANG1",
- "CLDOOR1",
- "CLEAT1",
- "CLOTHES1",
- "COIN2",
- "COUNTER1",
- "CREAK1",
- "CREAK2",
- "CREAK3",
- "CRIKT22A",
- "CRMAD1",
- "CRNORM1",
- "CRUMBLE1",
- "CRUNCH1",
- "CRYSTAL1",
- "DFLY1",
- "DIAL1",
- "DIGDIRT1",
- "DIZZY1",
- "DODO1",
- "DOORBELL",
- "DOORCL1",
- "DOOROP1",
- "DRIP1",
- "DROPITM1",
- "EAT22A",
- "EATNUT1",
- "ELEC1",
- "EXPLODE2",
- "FALL1",
- "FALLM2",
- "FALLM3",
- "FESTRE1",
- "FISHLAF2",
- "FLAG22A",
- "FLAG22B",
- "FLAG22C",
- "FLPOOF1",
- "FOLDER1",
- "FROG1",
- "FROGJMP1",
- "FSHBUBL1",
- "FUNNEL1",
- "FUSE1",
- "GATE22A",
- "GEM1",
- "GEMFIRE1",
- "GEMLIT1",
- "GEMPUT1",
- "GEMRAIN1",
- "GEMWND1",
- "GIRLLAF1",
- "GIRLLAF2",
- "GLASBRK1",
- "GLOWY1",
- "GOODK33",
- "GROWTWIG",
- "GUNTHER3",
- "H2ODROP2",
- "H2OFALL1",
- "HAMMER1",
- "HAYFALL2",
- "HERMMAG1",
- "HIPRES1",
- "HITHED22",
- "HOWL1",
- "HUM1",
- "HYPNO1",
- "HYPNO2",
- "IMPACT1",
- "JOHAN1",
- "JUNGAMB2",
- "KISS1",
- "KISS2",
- "KNIFE",
- "KNIFHIT1",
- "KNIFSTAB",
- "KNOCK",
- "LAND1",
- "LEVIBAB1",
- "LEVIMAN1",
- "LID",
- "MACHMIX1",
- "MALCFALL",
- "MALCYAWN",
- "MJUMP1",
- "MOO1",
- "MOO2",
- "MOO3",
- "MORPH1",
- "MORPH2",
- "MORPH3",
- "MORPH4",
- "MOTHS1",
- "MSPLASH1",
- "MTLSLAM1",
- "MUDBATH1",
- "NAIL1",
- "NEIGH1",
- "NETCATCH",
- "NETMAL1",
- "NETRIP1",
- "OPDOOR1",
- "OWL1",
- "OWL2",
- "PEDAL3",
- "PEGWING1",
- "PICKUP1",
- "PLUCK3",
- "POLGULP1",
- "POOF1",
- "PORTAL1",
- "POURH2O1",
- "PRIMOR1",
- "PUMP1",
- "PUNCTRE1",
- "RATTLE1",
- "REV2",
- "RING",
- "ROAR3",
- "ROWBOAT1",
- "RUCKUS1",
- "RUMBLE1",
- "SCOLD1",
- "SCRATCH1",
- "SHOVEL1",
- "SHOWER2",
- "SLOTPUL1",
- "SNAKKILL",
- "SNAP1",
- "SNIFF1",
- "SNIFF2",
- "SNIFFM1",
- "SNIP22B",
- "SNORIN1",
- "SNOROUT1",
- "SNORT1",
- "SPITBAL1",
- "SPITBAL2",
- "SPLASH1",
- "SQUEAK1",
- "SQUEAK2",
- "SQUEAK3",
- "STATUE",
- "STAMPED1",
- "STARS1",
- "STONE1",
- "STONE2",
- "STONE3",
- "STRETCH1",
- "STRETCH2",
- "SUNRISE1",
- "SWALLOW1",
- "SWALLOW2",
- "SWAV22B",
- "TELBEL1",
- "TELBEL2",
- "TENNIS1",
- "THROW1",
- "THUMP1",
- "TOILET1",
- "TRAPDOR1",
- "TRICKLE",
- "TROLGRNT",
- "TROLYEL1",
- "TROLYEL2",
- "TUBEDOR1",
- "TWIGSNAP",
- "UMBRLA1",
- "UNLOK22A",
- "VACUUM",
- "WAVELT1",
- "WHIP1",
- "WHIP2",
- "WOODHIT1",
- "YAWN1",
- "ZING",
- "ZIPPER1"
-};
-
-const int KyraEngine_MR::_sfxFileListSize = ARRAYSIZE(KyraEngine_MR::_sfxFileList);
-
const uint8 KyraEngine_MR::_badConscienceFrameTable[] = {
0x13, 0x13, 0x13, 0x18, 0x13, 0x13, 0x13, 0x13,
0x13, 0x13, 0x13, 0x10, 0x13, 0x13, 0x13, 0x13,
@@ -2376,28 +2011,6 @@ const uint8 KyraEngine_MR::_trashItemList[] = {
0x39, 0x40, 0x3E, 0x3D, 0x3C, 0x3F, 0xFF
};
-const uint8 KyraEngine_MR::_itemMagicTable[] = {
- 0x06, 0x05, 0x07, 0xFE, 0x05, 0x06, 0x07, 0xFE,
- 0x03, 0x00, 0x22, 0xFE, 0x00, 0x03, 0x22, 0xFE,
- 0x10, 0x00, 0x20, 0x0F, 0x00, 0x10, 0x0F, 0x20,
- 0x10, 0x22, 0x21, 0x0F, 0x22, 0x10, 0x0F, 0x21,
- 0xFF, 0xFF, 0xFF, 0xFF
-};
-
-const uint8 KyraEngine_MR::_itemStringMap[] = {
- 1, 0, 2, 0, 2, 2, 0, 0,
- 2, 2, 2, 2, 2, 2, 2, 0,
- 0, 0, 0, 0, 0, 0, 3, 1,
- 2, 0, 2, 2, 0, 0, 0, 0,
- 0, 0, 1, 2, 0, 2, 0, 2,
- 0, 0, 2, 0, 0, 0, 0, 1,
- 1, 0, 2, 2, 0, 0, 2, 0,
- 0, 2, 0, 2, 2, 0, 0, 2,
- 0, 0, 0, 0, 2, 0, 0, 2
-};
-
-const uint KyraEngine_MR::_itemStringMapSize = ARRAYSIZE(KyraEngine_MR::_itemStringMap);
-
const uint8 KyraEngine_MR::_itemStringPickUp[] = {
0x4, 0x7, 0x0, 0xA
};
@@ -2410,36 +2023,6 @@ const uint8 KyraEngine_MR::_itemStringInv[] = {
0x6, 0x9, 0x2, 0xC
};
-const int8 KyraEngine_MR::_scoreTable[] = {
- 10, 8, 5, 9, 10, 10, 7, 8,
- 9, 9, 8, 8, 7, 8, 5, 9,
- 6, 10, 7, 8, 5, 9, 6, 6,
- 7, 8, 5, 9, 6, 8, 7, 8,
- 5, 9, 6, 10, 7, 8, 5, 5,
- 5, 7, 5, 7, 10, 5, 10, 5,
- 5, 8, 6, 8, 7, 5, 5, 8,
- 6, 9, 5, 7, 6, 5, 5, 7,
- 7, 7, 6, 5, 8, 6, 10, 5,
- 7, 5, 10, 5, 5, 5, 5, 7,
- 5, 8, 9, 7, 7, 6, 10, 6,
- 5, 10, 8, 5, 8, 6, 10, 5,
- 5, 8, 8, 5, 7, 7, 7, 6,
- 8, 9, 8, 8, 6, 5, 7, 6,
- 5, 8, 15, 7, 9, 6, 6, 8,
- 5, 8, 15, 15, 5, 15, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0
-};
-
-const int KyraEngine_MR::_scoreTableSize = ARRAYSIZE(KyraEngine_MR::_scoreTable);
-
void KyraEngine_MR::initMainButtonList(bool disable) {
if (!_mainButtonListInitialized) {
_mainButtonData = new Button[14];
@@ -2483,19 +2066,15 @@ void GUI_MR::initStaticData() {
GUI_V2_BUTTON(_scrollUpButton, 22, 0, 0, 4, 4, 4, 0x4487, 0, 0, 0, 0x18, 0x0F, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0);
GUI_V2_BUTTON(_scrollDownButton, 23, 0, 0, 4, 4, 4, 0x4487, 0, 0, 0, 0x18, 0x0F, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0);
- for (int i = 0; i < 4; ++i) {
+ for (int i = 0; i < 4; ++i)
GUI_V2_BUTTON(_sliderButtons[0][i], 0x18+i, 0, 0, 1, 1, 1, 0x4487, 0, 0, 0, 0x0A, 0x0E, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0);
- }
- for (int i = 0; i < 4; ++i) {
+ for (int i = 0; i < 4; ++i)
GUI_V2_BUTTON(_sliderButtons[1][i], 0x1C+i, 0, 0, 1, 1, 1, 0x4487, 0, 0, 0, 0x0A, 0x0E, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0);
- }
- for (int i = 0; i < 4; ++i) {
+ for (int i = 0; i < 4; ++i)
GUI_V2_BUTTON(_sliderButtons[2][i], 0x20+i, 0, 0, 0, 0, 0, 0x2200, 0, 0, 0, 0x6E, 0x0E, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0);
- }
- for (uint i = 0; i < ARRAYSIZE(_menuButtons); ++i) {
+ for (uint i = 0; i < ARRAYSIZE(_menuButtons); ++i)
GUI_V2_BUTTON(_menuButtons[i], 0x0F+i, 0, 0, 1, 1, 1, 0x4487, 0, 0, 0, 0, 0, 0xFF, 0xF0, 0xFF, 0xF0, 0xFF, 0xF0, 0);
- }
Button::Callback clickLoadSlotFunctor = BUTTON_FUNCTOR(GUI_MR, this, &GUI_MR::clickLoadSlot);
Button::Callback clickSaveSlotFunctor = BUTTON_FUNCTOR(GUI_MR, this, &GUI_MR::clickSaveSlot);
@@ -2523,6 +2102,7 @@ void GUI_MR::initStaticData() {
GUI_V2_MENU_ITEM(_audioOptions.item[1], 0, 0, 160, 47, 116, 15, 0xFA, 0xFF, 5, 0xD0, 0xD1, 0xCF, -1, 24, 8, 49, 0x0000);
GUI_V2_MENU_ITEM(_audioOptions.item[2], 0, 0, 160, 64, 116, 15, 0xFA, 0xFF, 5, 0xD0, 0xD1, 0xCF, -1, 39, 8, 66, 0x0000);
GUI_V2_MENU_ITEM(_audioOptions.item[3], 1, 0, 152, 81, 116, 15, 0xFA, 0xFF, 5, 0xD0, 0xD1, 0xCF, -1, 47, 8, 83, 0x0000);
+ _audioOptions.item[3].callback = BUTTON_FUNCTOR(GUI_MR, this, &GUI_MR::toggleHeliumMode);
GUI_V2_MENU_ITEM(_audioOptions.item[4], 1, 16, -1, 110, 92, 15, 0xFA, 0xFF, -1, 0xD0, 0xD1, 0xCF, -1, 0, 0, 0, 0x0000);
_audioOptions.item[4].callback = clickQuitOptionsFunctor;
for (int i = 5; i < 7; ++i)
@@ -2592,5 +2172,15 @@ void GUI_MR::initStaticData() {
_deathMenu.item[i].enabled = false;
}
+const int8 KyraEngine_MR::_albumWSAX[] = {
+ 0, 77, -50, 99, -61, 82, -58, 85,
+ -64, 80, -63, 88, -63, 88, -64, 0
+};
+
+const int8 KyraEngine_MR::_albumWSAY[] = {
+ 0, -1, 3, 0, -1, 0, -2, 0,
+ -1, -2, 2, 2, -6, -6, -6, 0
+};
+
} // End of namespace Kyra
diff --git a/engines/kyra/text.cpp b/engines/kyra/text.cpp
index 980b762b23..f8eb10a85e 100644
--- a/engines/kyra/text.cpp
+++ b/engines/kyra/text.cpp
@@ -25,7 +25,7 @@
-#include "kyra/kyra.h"
+#include "kyra/kyra_v1.h"
#include "kyra/screen.h"
#include "kyra/text.h"
@@ -35,7 +35,7 @@
namespace Kyra {
-TextDisplayer::TextDisplayer(KyraEngine *vm, Screen *screen) {
+TextDisplayer::TextDisplayer(KyraEngine_v1 *vm, Screen *screen) {
_screen = screen;
_vm = vm;
@@ -210,7 +210,7 @@ void TextDisplayer::printTalkTextMessage(const char *text, int x, int y, uint8 c
calcWidestLineBounds(x1, x2, w, x);
_talkCoords.x = x1;
_talkCoords.w = w + 2;
- _screen->copyRegion(_talkCoords.x, _talkMessageY, _talkCoords.x, _talkCoords.y, _talkCoords.w, _talkMessageH, srcPage, dstPage);
+ _screen->copyRegion(_talkCoords.x, _talkMessageY, _talkCoords.x, _talkCoords.y, _talkCoords.w, _talkMessageH, srcPage, dstPage, Screen::CR_NO_P_CHECK);
int curPage = _screen->_curPage;
_screen->_curPage = srcPage;
for (int i = 0; i < lineCount; ++i) {
diff --git a/engines/kyra/text.h b/engines/kyra/text.h
index 5ae37e32ef..d45e5f9242 100644
--- a/engines/kyra/text.h
+++ b/engines/kyra/text.h
@@ -31,11 +31,11 @@
#include "kyra/screen.h"
namespace Kyra {
-class KyraEngine;
+class KyraEngine_v1;
class TextDisplayer {
public:
- TextDisplayer(KyraEngine *vm, Screen *screen);
+ TextDisplayer(KyraEngine_v1 *vm, Screen *screen);
virtual ~TextDisplayer() {}
int maxSubstringLen() const { return TALK_SUBSTRING_LEN; }
@@ -60,7 +60,7 @@ public:
bool printed() const { return _talkMessagePrinted; }
protected:
Screen *_screen;
- KyraEngine *_vm;
+ KyraEngine_v1 *_vm;
struct TalkCoords {
uint16 y, x, w;
diff --git a/engines/kyra/text_hof.cpp b/engines/kyra/text_hof.cpp
index dd1796dd02..dd587c5112 100644
--- a/engines/kyra/text_hof.cpp
+++ b/engines/kyra/text_hof.cpp
@@ -107,8 +107,7 @@ char *TextDisplayer_HoF::preprocessString(const char *str) {
int textWidth = _screen->getTextWidth(p);
_screen->_charWidth = 0;
- // longer text strings for German versions
- int maxTextWidth = (_vm->language() == 2 ? 240 : 176);
+ int maxTextWidth = (_vm->language() == 0) ? 176 : 240;
if (textWidth > maxTextWidth) {
if (textWidth > (maxTextWidth*2)) {
@@ -452,7 +451,7 @@ void KyraEngine_HoF::updateDlgBuffer() {
filename[11] = suffix[_lang];
if (_dlgBuffer)
- delete [] _dlgBuffer;
+ delete[] _dlgBuffer;
_dlgBuffer = _res->fileData(filename, 0);
}
@@ -649,7 +648,7 @@ void KyraEngine_HoF::npcChatSequence(const char *str, int objectId, int vocHigh,
}
while (((textEnabled() && _chatEndTime > _system->getMillis()) || (speechEnabled() && snd_voiceIsPlaying())) && !(_quitFlag || skipFlag())) {
- if (!speechEnabled() && chatAnimEndTime > _system->getMillis() || speechEnabled() && snd_voiceIsPlaying()) {
+ if ((!speechEnabled() && chatAnimEndTime > _system->getMillis()) || (speechEnabled() && snd_voiceIsPlaying())) {
_tim->resetFinishedFlag();
while (!_tim->finished() && !skipFlag() && !_quitFlag) {
if (_currentTalkSections.TLKTim)
diff --git a/engines/kyra/text_hof.h b/engines/kyra/text_hof.h
index ef1f481c19..3da6e081f0 100644
--- a/engines/kyra/text_hof.h
+++ b/engines/kyra/text_hof.h
@@ -23,8 +23,8 @@
*
*/
-#ifndef KYRA_TEXT_V2_H
-#define KYRA_TEXT_V2_H
+#ifndef KYRA_TEXT_HOF_H
+#define KYRA_TEXT_HOF_H
#include "kyra/text.h"
diff --git a/engines/kyra/text_v1.cpp b/engines/kyra/text_lok.cpp
index 5534992c6a..f6b0407a75 100644
--- a/engines/kyra/text_v1.cpp
+++ b/engines/kyra/text_lok.cpp
@@ -23,17 +23,17 @@
*
*/
-#include "kyra/kyra_v1.h"
-#include "kyra/screen_v1.h"
+#include "kyra/kyra_lok.h"
+#include "kyra/screen_lok.h"
#include "kyra/text.h"
-#include "kyra/animator_v1.h"
+#include "kyra/animator_lok.h"
#include "kyra/sprites.h"
#include "kyra/timer.h"
namespace Kyra {
-void KyraEngine_v1::waitForChatToFinish(int vocFile, int16 chatDuration, const char *chatStr, uint8 charNum) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::waitForChatToFinish(%i, %s, %i)", chatDuration, chatStr, charNum);
+void KyraEngine_LoK::waitForChatToFinish(int vocFile, int16 chatDuration, const char *chatStr, uint8 charNum) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::waitForChatToFinish(%i, %s, %i)", chatDuration, chatStr, charNum);
bool hasUpdatedNPCs = false;
bool runLoop = true;
bool drawText = textEnabled();
@@ -62,10 +62,8 @@ void KyraEngine_v1::waitForChatToFinish(int vocFile, int16 chatDuration, const c
if (chatDuration != -1)
chatDuration *= _tickLength;
- if (vocFile != -1) {
- snd_voiceWaitForFinish();
+ if (vocFile != -1)
snd_playVoiceFile(vocFile);
- }
_timer->disable(14);
_timer->disable(18);
@@ -154,7 +152,7 @@ void KyraEngine_v1::waitForChatToFinish(int vocFile, int16 chatDuration, const c
//clearKyrandiaButtonIO();
}
-void KyraEngine_v1::endCharacterChat(int8 charNum, int16 convoInitialized) {
+void KyraEngine_LoK::endCharacterChat(int8 charNum, int16 convoInitialized) {
_charSayUnk3 = -1;
if (charNum > 4 && charNum < 11) {
@@ -171,7 +169,7 @@ void KyraEngine_v1::endCharacterChat(int8 charNum, int16 convoInitialized) {
}
}
-void KyraEngine_v1::restoreChatPartnerAnimFrame(int8 charNum) {
+void KyraEngine_LoK::restoreChatPartnerAnimFrame(int8 charNum) {
_talkingCharNum = -1;
if (charNum > 0 && charNum < 5) {
@@ -186,7 +184,7 @@ void KyraEngine_v1::restoreChatPartnerAnimFrame(int8 charNum) {
_animator->updateAllObjectShapes();
}
-void KyraEngine_v1::backupChatPartnerAnimFrame(int8 charNum) {
+void KyraEngine_LoK::backupChatPartnerAnimFrame(int8 charNum) {
_talkingCharNum = 0;
if (charNum < 5 && charNum > 0)
@@ -202,7 +200,7 @@ void KyraEngine_v1::backupChatPartnerAnimFrame(int8 charNum) {
_animator->updateAllObjectShapes();
}
-int8 KyraEngine_v1::getChatPartnerNum() {
+int8 KyraEngine_LoK::getChatPartnerNum() {
uint8 sceneTable[] = {0x2, 0x5, 0x2D, 0x7, 0x1B, 0x8, 0x22, 0x9, 0x30, 0x0A};
int pos = 0;
int partner = -1;
@@ -224,7 +222,7 @@ int8 KyraEngine_v1::getChatPartnerNum() {
return partner;
}
-int KyraEngine_v1::initCharacterChat(int8 charNum) {
+int KyraEngine_LoK::initCharacterChat(int8 charNum) {
int returnValue = 0;
if (_talkingCharNum == -1) {
@@ -258,8 +256,8 @@ int KyraEngine_v1::initCharacterChat(int8 charNum) {
return returnValue;
}
-void KyraEngine_v1::characterSays(int vocFile, const char *chatStr, int8 charNum, int8 chatDuration) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::characterSays('%s', %i, %d)", chatStr, charNum, chatDuration);
+void KyraEngine_LoK::characterSays(int vocFile, const char *chatStr, int8 charNum, int8 chatDuration) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::characterSays('%s', %i, %d)", chatStr, charNum, chatDuration);
uint8 startAnimFrames[] = { 0x10, 0x32, 0x56, 0x0, 0x0, 0x0 };
uint16 chatTicks;
@@ -269,6 +267,8 @@ void KyraEngine_v1::characterSays(int vocFile, const char *chatStr, int8 charNum
if (_currentCharacter->sceneId == 210)
return;
+ snd_voiceWaitForFinish(true);
+
convoInitialized = initCharacterChat(charNum);
chatPartnerNum = getChatPartnerNum();
@@ -338,8 +338,8 @@ void KyraEngine_v1::characterSays(int vocFile, const char *chatStr, int8 charNum
endCharacterChat(charNum, convoInitialized);
}
-void KyraEngine_v1::drawSentenceCommand(const char *sentence, int color) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::drawSentenceCommand('%s', %i)", sentence, color);
+void KyraEngine_LoK::drawSentenceCommand(const char *sentence, int color) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::drawSentenceCommand('%s', %i)", sentence, color);
_screen->hideMouse();
_screen->fillRect(8, 143, 311, 152, 12);
@@ -358,8 +358,8 @@ void KyraEngine_v1::drawSentenceCommand(const char *sentence, int color) {
_fadeText = false;
}
-void KyraEngine_v1::updateSentenceCommand(const char *str1, const char *str2, int color) {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::updateSentenceCommand('%s', '%s', %i)", str1, str2, color);
+void KyraEngine_LoK::updateSentenceCommand(const char *str1, const char *str2, int color) {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::updateSentenceCommand('%s', '%s', %i)", str1, str2, color);
char sentenceCommand[500];
strncpy(sentenceCommand, str1, 500);
if (str2)
@@ -369,8 +369,8 @@ void KyraEngine_v1::updateSentenceCommand(const char *str1, const char *str2, in
_screen->updateScreen();
}
-void KyraEngine_v1::updateTextFade() {
- debugC(9, kDebugLevelMain, "KyraEngine_v1::updateTextFade()");
+void KyraEngine_LoK::updateTextFade() {
+ debugC(9, kDebugLevelMain, "KyraEngine_LoK::updateTextFade()");
if (!_fadeText)
return;
diff --git a/engines/kyra/text_mr.cpp b/engines/kyra/text_mr.cpp
index 35f91c1ccc..16c56da099 100644
--- a/engines/kyra/text_mr.cpp
+++ b/engines/kyra/text_mr.cpp
@@ -55,25 +55,26 @@ char *TextDisplayer_MR::preprocessString(const char *str) {
int count = 0, offs = 0;
if (textWidth > (3*maxTextWidth)) {
count = getCharLength(p, textWidth/4);
- offs = dropCRIntoString(p, getCharLength(p, maxTextWidth), count);
+ offs = dropCRIntoString(p, count, getCharLength(p, maxTextWidth));
p += count + offs;
- }
-
+ // No update of textWidth here
+ }
+
if (textWidth > (2*maxTextWidth)) {
count = getCharLength(p, textWidth/3);
- offs = dropCRIntoString(p, getCharLength(p, maxTextWidth), count);
+ offs = dropCRIntoString(p, count, getCharLength(p, maxTextWidth));
p += count + offs;
textWidth = _screen->getTextWidth(p);
}
count = getCharLength(p, textWidth/2);
- offs = dropCRIntoString(p, getCharLength(p, maxTextWidth), count);
+ offs = dropCRIntoString(p, count, getCharLength(p, maxTextWidth));
p += count + offs;
textWidth = _screen->getTextWidth(p);
if (textWidth > maxTextWidth) {
count = getCharLength(p, textWidth/2);
- offs = dropCRIntoString(p, getCharLength(p, maxTextWidth), count);
+ offs = dropCRIntoString(p, count, getCharLength(p, maxTextWidth));
}
}
@@ -131,6 +132,12 @@ int TextDisplayer_MR::dropCRIntoString(char *str, int minOffs, int maxOffs) {
void TextDisplayer_MR::printText(const char *str, int x, int y, uint8 c0, uint8 c1, uint8 c2, Screen::FontId font) {
debugC(9, kDebugLevelMain, "TextDisplayer_MR::printText('%s', %d, %d, %d, %d, %d)", str, x, y, c0, c1, c2);
+ if (_vm->_albumChatActive) {
+ c0 = 0xEE;
+ c1 = 0xE3;
+ c2 = 0x00;
+ }
+
uint8 colorMap[] = { 0, 255, 240, 240 };
colorMap[3] = c1;
_screen->setTextColor(colorMap, 0, 3);
@@ -226,7 +233,7 @@ void KyraEngine_MR::objectChat(const char *str, int object, int vocHigh, int voc
"MTFR00S.EMC", "MTFR00Q.EMC", "MTFR00E.EMC", "MTFR00T.EMC",
"MTL00S.EMC", "MTL00Q.EMC", "MTL00E.EMC", "MTL00T.EMC",
"MTR00S.EMC", "MTR00Q.EMC", "MTR00E.EMC", "MTR00T.EMC",
- "MTA00S.EMC", "MTA00Q.EMC", "MTA00Q.EMC", "MTA00T.EMC"
+ "MTA00S.EMC", "MTA00Q.EMC", "MTA00E.EMC", "MTA00T.EMC"
};
int chat = talkScriptTable[chatType + _mainCharacter.facing * 4];
@@ -496,6 +503,134 @@ void KyraEngine_MR::goodConscienceChatWaitToFinish() {
}
}
+void KyraEngine_MR::albumChat(const char *str, int vocHigh, int vocLow) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::albumChat('%s', %d, %d)", str, vocHigh, vocLow);
+
+ _talkObjectList[1].x = 190;
+ _talkObjectList[1].y = 188;
+
+ _chatVocHigh = _chatVocLow = -1;
+ _albumChatActive = true;
+ albumChatInit(str, 1, vocHigh, vocLow);
+ _albumChatActive = false;
+
+ _chatText = str;
+ _chatObject = 1;
+ _screen->hideMouse();
+ albumChatWaitToFinish();
+ _screen->showMouse();
+
+ _chatText = 0;
+ _chatObject = -1;
+}
+
+void KyraEngine_MR::albumChatInit(const char *str, int object, int vocHigh, int vocLow) {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::albumChatInit('%s', %d, %d, %d)", str, object, vocHigh, vocLow);
+ Common::String realString;
+
+ while (*str) {
+ if (str[0] == '\\' && str[1] == 'r') {
+ realString += '\r';
+ ++str;
+ } else {
+ realString += *str;
+ }
+
+ ++str;
+ }
+
+ str = realString.c_str();
+
+ str = _text->preprocessString(str);
+ int lineNum = _text->buildMessageSubstrings(str);
+
+ int xPos = 0, yPos = 0;
+
+ if (!object) {
+ int scale = getScale(_mainCharacter.x1, _mainCharacter.y1);
+ yPos = _mainCharacter.y1 - ((_mainCharacter.height * scale) >> 8) - 8;
+ xPos = _mainCharacter.x1;
+ } else {
+ yPos = _talkObjectList[object].y;
+ xPos = _talkObjectList[object].x;
+ }
+
+ yPos -= lineNum * 10;
+ yPos = MAX(yPos, 0);
+ _text->_talkMessageY = yPos;
+ _text->_talkMessageH = lineNum*10;
+
+ int width = _text->getWidestLineWidth(lineNum);
+ _text->calcWidestLineBounds(xPos, yPos, width, xPos);
+ _text->_talkCoords.x = xPos;
+ _text->_talkCoords.w = width + 2;
+
+ _screen->hideMouse();
+
+ if (textEnabled()) {
+ objectChatPrintText(str, object);
+ _chatEndTime = _system->getMillis() + chatCalcDuration(str) * _tickLength;
+ } else {
+ _chatEndTime = _system->getMillis();
+ }
+
+ if (speechEnabled()) {
+ _chatVocHigh = vocHigh;
+ _chatVocLow = vocLow;
+ } else {
+ _chatVocHigh = _chatVocLow = -1;
+ }
+
+ _screen->showMouse();
+}
+
+void KyraEngine_MR::albumChatWaitToFinish() {
+ debugC(9, kDebugLevelMain, "KyraEngine_MR::albumChatWaitToFinish()");
+ if (_chatVocHigh) {
+ playVoice(_chatVocHigh, _chatVocLow);
+ _chatVocHigh = _chatVocLow = -1;
+ }
+
+ bool running = true;
+ const uint32 endTime = _chatEndTime;
+ resetSkipFlag();
+
+ uint32 nextFrame = 0;
+ int frame = 12;
+ while (running && !_quitFlag) {
+ if (nextFrame < _system->getMillis()) {
+ ++frame;
+ if (frame > 22)
+ frame = 13;
+
+ _album.wsa->setX(-100);
+ _album.wsa->setY(90);
+ _album.wsa->setDrawPage(2);
+
+ albumRestoreRect();
+ _album.wsa->displayFrame(frame, 0x4000);
+ albumUpdateRect();
+
+ nextFrame = _system->getMillis() + _rnd.getRandomNumberRng(4, 8) * _tickLength;
+ }
+
+ if (_album.nextPage != 14)
+ albumUpdateAnims();
+ else
+ _screen->updateScreen();
+
+ const uint32 curTime = _system->getMillis();
+ if ((textEnabled() && !speechEnabled() && curTime > endTime) || (speechEnabled() && !snd_voiceIsPlaying()) || skipFlag()) {
+ snd_stopVoice();
+ resetSkipFlag();
+ nextFrame = curTime;
+ running = false;
+ }
+
+ delay(10);
+ }
+}
+
void KyraEngine_MR::malcolmSceneStartupChat() {
debugC(9, kDebugLevelMain, "KyraEngine_MR::malcolmSceneStartupChat()");
diff --git a/engines/kyra/timer.cpp b/engines/kyra/timer.cpp
index 1f25f88c97..777871d65a 100644
--- a/engines/kyra/timer.cpp
+++ b/engines/kyra/timer.cpp
@@ -23,7 +23,7 @@
*
*/
-#include "kyra/kyra.h"
+#include "kyra/kyra_v1.h"
#include "kyra/timer.h"
#include "common/func.h"
@@ -34,7 +34,7 @@ namespace Kyra {
namespace {
struct TimerResync : public Common::UnaryFunction<TimerEntry&, void> {
uint32 _tickLength, _curTime;
- TimerResync(KyraEngine *vm, uint32 curTime) : _tickLength(vm->tickLength()), _curTime(curTime) {}
+ TimerResync(KyraEngine_v1 *vm, uint32 curTime) : _tickLength(vm->tickLength()), _curTime(curTime) {}
void operator()(TimerEntry &entry) const {
if (entry.lastUpdate < 0) {
@@ -62,10 +62,32 @@ struct TimerEqual : public Common::UnaryFunction<const TimerEntry&, bool> {
};
} // end of anonymous namespace
+void TimerManager::pause(bool p) {
+ if (p) {
+ ++_isPaused;
+
+ if (_isPaused == 1) {
+ _isPaused = true;
+ _pauseStart = _system->getMillis();
+ }
+ } else if (!p && _isPaused > 0) {
+ --_isPaused;
+
+ if (_isPaused == 0) {
+ const uint32 pausedTime = _system->getMillis() - _pauseStart;
+ _nextRun += pausedTime;
+
+ for (Iterator pos = _timers.begin(); pos != _timers.end(); ++pos) {
+ pos->lastUpdate += pausedTime;
+ pos->nextRun += pausedTime;
+ }
+ }
+ }
+}
+
void TimerManager::reset() {
- for (Iterator pos = _timers.begin(); pos != _timers.end(); ++pos) {
+ for (Iterator pos = _timers.begin(); pos != _timers.end(); ++pos)
delete pos->func;
- }
_timers.clear();
}
@@ -93,7 +115,7 @@ void TimerManager::addTimer(uint8 id, TimerFunc *func, int countdown, bool enabl
void TimerManager::update() {
debugC(9, kDebugLevelTimer, "TimerManager::update()");
- if (_system->getMillis() < _nextRun)
+ if (_system->getMillis() < _nextRun || _isPaused)
return;
_nextRun += 99999;
@@ -121,8 +143,10 @@ void TimerManager::update() {
void TimerManager::resync() {
debugC(9, kDebugLevelTimer, "TimerManager::resync()");
+ const uint32 curTime = _isPaused ? _pauseStart : _system->getMillis();
+
_nextRun = 0; // force rerun
- Common::for_each(_timers.begin(), _timers.end(), TimerResync(_vm, _system->getMillis()));
+ Common::for_each(_timers.begin(), _timers.end(), TimerResync(_vm, curTime));
}
void TimerManager::resetNextRun() {
@@ -225,7 +249,9 @@ void TimerManager::disable(uint8 id) {
}
void TimerManager::loadDataFromFile(Common::SeekableReadStream &file, int version) {
- debugC(9, kDebugLevelTimer, "TimerManager::loadDataFromFile(%p, %d)", (const void*)&file, version);
+ debugC(9, kDebugLevelTimer, "TimerManager::loadDataFromFile(%p, %d)", (const void *)&file, version);
+
+ const uint32 loadTime = _isPaused ? _pauseStart : _system->getMillis();
if (version <= 7) {
_nextRun = 0;
@@ -240,12 +266,11 @@ void TimerManager::loadDataFromFile(Common::SeekableReadStream &file, int versio
timer->countdown = countdown;
if (nextRun) {
- timer->nextRun = nextRun + _system->getMillis();
+ timer->nextRun = nextRun + loadTime;
timer->lastUpdate = timer->nextRun - countdown * _vm->tickLength();
} else {
- uint32 curTime = _system->getMillis();
- timer->nextRun = curTime;
- timer->lastUpdate = curTime - countdown * _vm->tickLength();
+ timer->nextRun = loadTime;
+ timer->lastUpdate = loadTime - countdown * _vm->tickLength();
}
} else {
warning("Loading timer data for non existing timer %d", i);
@@ -272,14 +297,16 @@ void TimerManager::loadDataFromFile(Common::SeekableReadStream &file, int versio
}
void TimerManager::saveDataToFile(Common::WriteStream &file) const {
- debugC(9, kDebugLevelTimer, "TimerManager::saveDataToFile(%p)", (const void*)&file);
+ debugC(9, kDebugLevelTimer, "TimerManager::saveDataToFile(%p)", (const void *)&file);
+
+ const uint32 saveTime = _isPaused ? _pauseStart : _system->getMillis();
file.writeByte(count());
for (CIterator pos = _timers.begin(); pos != _timers.end(); ++pos) {
file.writeByte(pos->id);
file.writeByte(pos->enabled);
file.writeSint32BE(pos->countdown);
- file.writeSint32BE(pos->lastUpdate - _system->getMillis());
+ file.writeSint32BE(pos->lastUpdate - saveTime);
}
}
diff --git a/engines/kyra/timer.h b/engines/kyra/timer.h
index 0991f0a1b1..691bac3fb5 100644
--- a/engines/kyra/timer.h
+++ b/engines/kyra/timer.h
@@ -26,7 +26,7 @@
#ifndef KYRA_TIMER_H
#define KYRA_TIMER_H
-#include "kyra/kyra.h"
+#include "kyra/kyra_v1.h"
#include "common/list.h"
#include "common/stream.h"
@@ -49,9 +49,11 @@ struct TimerEntry {
class TimerManager {
public:
- TimerManager(KyraEngine *vm, OSystem *sys) : _vm(vm), _system(sys), _timers(), _nextRun(0) {}
+ TimerManager(KyraEngine_v1 *vm, OSystem *sys) : _vm(vm), _system(sys), _timers(), _nextRun(0), _isPaused(0), _pauseStart(0) {}
~TimerManager() { reset(); }
+ void pause(bool p);
+
void reset();
void addTimer(uint8 id, TimerFunc *func, int countdown, bool enabled);
@@ -77,15 +79,26 @@ public:
private:
void resync();
- KyraEngine *_vm;
+ KyraEngine_v1 *_vm;
OSystem *_system;
Common::List<TimerEntry> _timers;
uint32 _nextRun;
+ uint _isPaused;
+ uint32 _pauseStart;
+
typedef Common::List<TimerEntry>::iterator Iterator;
typedef Common::List<TimerEntry>::const_iterator CIterator;
};
+class PauseTimer {
+public:
+ PauseTimer(TimerManager &timer) : _timer(timer) { _timer.pause(true); }
+ ~PauseTimer() { _timer.pause(false); }
+private:
+ TimerManager &_timer;
+};
+
} // end of namespace Kyra
#endif
diff --git a/engines/kyra/timer_v1.cpp b/engines/kyra/timer_lok.cpp
index f5e7c52ba1..69b93b54c3 100644
--- a/engines/kyra/timer_v1.cpp
+++ b/engines/kyra/timer_lok.cpp
@@ -23,20 +23,20 @@
*
*/
-#include "kyra/kyra.h"
#include "kyra/kyra_v1.h"
+#include "kyra/kyra_lok.h"
#include "kyra/screen.h"
-#include "kyra/animator_v1.h"
+#include "kyra/animator_lok.h"
#include "kyra/timer.h"
#include "common/system.h"
namespace Kyra {
-#define TimerV1(x) new Common::Functor1Mem<int, void, KyraEngine_v1>(this, &KyraEngine_v1::x)
+#define TimerV1(x) new Common::Functor1Mem<int, void, KyraEngine_LoK>(this, &KyraEngine_LoK::x)
-void KyraEngine_v1::setupTimers() {
- debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_v1::setupTimers()");
+void KyraEngine_LoK::setupTimers() {
+ debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_LoK::setupTimers()");
for (int i = 0; i <= 4; ++i)
_timer->addTimer(i, 0, -1, 1);
@@ -73,8 +73,8 @@ void KyraEngine_v1::setupTimers() {
_timer->addTimer(33, TimerV1(updateAnimFlag2), 3, 1);
}
-void KyraEngine_v1::timerUpdateHeadAnims(int timerNum) {
- debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_v1::timerUpdateHeadAnims(%i)", timerNum);
+void KyraEngine_LoK::timerUpdateHeadAnims(int timerNum) {
+ debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_LoK::timerUpdateHeadAnims(%i)", timerNum);
static int8 currentFrame = 0;
static const int8 frameTable[] = {4, 5, 4, 5, 4, 5, 0, 1, 4, 5,
4, 4, 6, 4, 8, 1, 9, 4, -1};
@@ -92,8 +92,8 @@ void KyraEngine_v1::timerUpdateHeadAnims(int timerNum) {
_animator->animRefreshNPC(_talkingCharNum);
}
-void KyraEngine_v1::timerSetFlags1(int timerNum) {
- debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_v1::timerSetFlags(%i)", timerNum);
+void KyraEngine_LoK::timerSetFlags1(int timerNum) {
+ debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_LoK::timerSetFlags(%i)", timerNum);
if (_currentCharacter->sceneId == 0x1C)
return;
@@ -111,65 +111,65 @@ void KyraEngine_v1::timerSetFlags1(int timerNum) {
}
}
-void KyraEngine_v1::timerFadeText(int timerNum) {
- debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_v1::timerFadeText(%i)", timerNum);
+void KyraEngine_LoK::timerFadeText(int timerNum) {
+ debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_LoK::timerFadeText(%i)", timerNum);
_fadeText = true;
}
-void KyraEngine_v1::updateAnimFlag1(int timerNum) {
- debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_v1::updateAnimFlag1(%d)", timerNum);
+void KyraEngine_LoK::updateAnimFlag1(int timerNum) {
+ debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_LoK::updateAnimFlag1(%d)", timerNum);
if (_brandonStatusBit & 2) {
_brandonStatusBit0x02Flag = 1;
}
}
-void KyraEngine_v1::updateAnimFlag2(int timerNum) {
- debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_v1::updateAnimFlag2(%d)", timerNum);
+void KyraEngine_LoK::updateAnimFlag2(int timerNum) {
+ debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_LoK::updateAnimFlag2(%d)", timerNum);
if (_brandonStatusBit & 0x20) {
_brandonStatusBit0x20Flag = 1;
}
}
-void KyraEngine_v1::setTextFadeTimerCountdown(int16 countdown) {
- debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_v1::setTextFadeTimerCountdown(%i)", countdown);
+void KyraEngine_LoK::setTextFadeTimerCountdown(int16 countdown) {
+ debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_LoK::setTextFadeTimerCountdown(%i)", countdown);
if (countdown == -1)
countdown = 32000;
_timer->setCountdown(31, countdown*60);
}
-void KyraEngine_v1::timerSetFlags2(int timerNum) {
- debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_v1::timerSetFlags2(%i)", timerNum);
+void KyraEngine_LoK::timerSetFlags2(int timerNum) {
+ debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_LoK::timerSetFlags2(%i)", timerNum);
if (!((uint32*)(_flagsTable+0x2D))[timerNum])
((uint32*)(_flagsTable+0x2D))[timerNum] = 1;
}
-void KyraEngine_v1::timerCheckAnimFlag1(int timerNum) {
- debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_v1::timerCheckAnimFlag1(%i)", timerNum);
+void KyraEngine_LoK::timerCheckAnimFlag1(int timerNum) {
+ debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_LoK::timerCheckAnimFlag1(%i)", timerNum);
if (_brandonStatusBit & 0x20) {
checkAmuletAnimFlags();
_timer->setCountdown(18, -1);
}
}
-void KyraEngine_v1::timerCheckAnimFlag2(int timerNum) {
- debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_v1::timerCheckAnimFlag2(%i)", timerNum);
+void KyraEngine_LoK::timerCheckAnimFlag2(int timerNum) {
+ debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_LoK::timerCheckAnimFlag2(%i)", timerNum);
if (_brandonStatusBit & 0x2) {
checkAmuletAnimFlags();
_timer->setCountdown(14, -1);
}
}
-void KyraEngine_v1::timerRedrawAmulet(int timerNum) {
- debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_v1::timerRedrawAmulet(%i)", timerNum);
+void KyraEngine_LoK::timerRedrawAmulet(int timerNum) {
+ debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_LoK::timerRedrawAmulet(%i)", timerNum);
if (queryGameFlag(0xF1)) {
drawAmulet();
_timer->setCountdown(19, -1);
}
}
-void KyraEngine_v1::setWalkspeed(uint8 newSpeed) {
- debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_v1::setWalkspeed(%i)", newSpeed);
+void KyraEngine_LoK::setWalkspeed(uint8 newSpeed) {
+ debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_LoK::setWalkspeed(%i)", newSpeed);
static const uint8 speeds[] = { 11, 9, 6, 5, 3 };
assert(newSpeed < ARRAYSIZE(speeds));
diff --git a/engines/kyra/timer_mr.cpp b/engines/kyra/timer_mr.cpp
index 53865ba0e3..37a910ccf2 100644
--- a/engines/kyra/timer_mr.cpp
+++ b/engines/kyra/timer_mr.cpp
@@ -64,7 +64,25 @@ void KyraEngine_MR::timerRunSceneScript7(int arg) {
void KyraEngine_MR::timerFleaDeath(int arg) {
debugC(9, kDebugLevelMain | kDebugLevelTimer, "KyraEngine_MR::timerFleaDeath(%d)", arg);
- warning("STUB timerFleaDeath");
+ _timer->setCountdown(4, 5400);
+ saveGame(getSavegameFilename(999), "SECOND CHANCE SAVE GAME");
+ _screen->hideMouse();
+ _timer->disable(4);
+ runAnimationScript("FLEADTH1.EMC", 0, 0, 1, 1);
+ runAnimationScript("FLEADTH2.EMC", 0, 0, 1, 0);
+ showBadConscience();
+ delay(60, true);
+ const char *str1 = (const char *)getTableEntry(_cCodeFile, 130);
+ const char *str2 = (const char *)getTableEntry(_cCodeFile, 131);
+ if (str1 && str2) {
+ badConscienceChat(str1, 204, 130);
+ badConscienceChat(str2, 204, 131);
+ }
+ delay(60, true);
+ hideBadConscience();
+ runAnimationScript("FLEADTH3.EMC", 0, 0, 0, 1);
+ _deathHandler = 9;
+ _screen->showMouse();
}
void KyraEngine_MR::setWalkspeed(uint8 speed) {
diff --git a/engines/kyra/vqa.cpp b/engines/kyra/vqa.cpp
index db7cad941b..3d18f27c7e 100644
--- a/engines/kyra/vqa.cpp
+++ b/engines/kyra/vqa.cpp
@@ -42,7 +42,7 @@
namespace Kyra {
-VQAMovie::VQAMovie(KyraEngine *vm, OSystem *system) {
+VQAMovie::VQAMovie(KyraEngine_v1 *vm, OSystem *system) {
_system = system;
_vm = vm;
_opened = false;
@@ -69,7 +69,7 @@ void *VQAMovie::allocBuffer(int num, uint32 size) {
* We could use realloc() here, but we don't actually need the
* old contents of the buffer.
*/
- delete [] _buffers[num].data;
+ delete[] _buffers[num].data;
_buffers[num].data = new uint8[size];
_buffers[num].size = size;
}
@@ -81,7 +81,7 @@ void *VQAMovie::allocBuffer(int num, uint32 size) {
void VQAMovie::freeBuffers() {
for (int i = 0; i < ARRAYSIZE(_buffers); i++) {
- delete [] _buffers[i].data;
+ delete[] _buffers[i].data;
_buffers[i].data = NULL;
_buffers[i].size = 0;
}
@@ -356,15 +356,14 @@ bool VQAMovie::open(const char *filename) {
void VQAMovie::close() {
debugC(9, kDebugLevelMovie, "VQAMovie::close()");
if (_opened) {
- delete [] _frameInfo;
- delete [] _frame;
- delete [] _codeBook;
- delete [] _partialCodeBook;
- delete [] _vectorPointers;
+ delete[] _frameInfo;
+ delete[] _frame;
+ delete[] _codeBook;
+ delete[] _partialCodeBook;
+ delete[] _vectorPointers;
- if (_vm->_mixer->isSoundHandleActive(_sound)) {
+ if (_vm->_mixer->isSoundHandleActive(_sound))
_vm->_mixer->stopHandle(_sound);
- }
_frameInfo = NULL;
_frame = NULL;
@@ -655,11 +654,10 @@ void VQAMovie::play() {
while (1) {
uint32 elapsedTime;
- if (_vm->_mixer->isSoundHandleActive(_sound)) {
+ if (_vm->_mixer->isSoundHandleActive(_sound))
elapsedTime = _vm->_mixer->getSoundElapsedTime(_sound);
- } else {
+ else
elapsedTime = _system->getMillis() - startTick;
- }
if (elapsedTime >= (i * 1000) / _header.frameRate)
break;
diff --git a/engines/kyra/vqa.h b/engines/kyra/vqa.h
index 35f7d78004..f600f008b7 100644
--- a/engines/kyra/vqa.h
+++ b/engines/kyra/vqa.h
@@ -30,11 +30,11 @@ class OSystem;
namespace Kyra {
-class KyraEngine;
+class KyraEngine_v1;
class VQAMovie {
public:
- VQAMovie(KyraEngine *vm, OSystem *system);
+ VQAMovie(KyraEngine_v1 *vm, OSystem *system);
~VQAMovie();
bool opened() { return _opened; }
@@ -54,7 +54,7 @@ public:
protected:
OSystem *_system;
- KyraEngine *_vm;
+ KyraEngine_v1 *_vm;
bool _opened;
int _x, _y;
diff --git a/engines/kyra/wsamovie.cpp b/engines/kyra/wsamovie.cpp
index 764327d701..110755c3ba 100644
--- a/engines/kyra/wsamovie.cpp
+++ b/engines/kyra/wsamovie.cpp
@@ -27,7 +27,7 @@
#include "common/endian.h"
#include "common/system.h"
-#include "kyra/kyra.h"
+#include "kyra/kyra_v1.h"
#include "kyra/kyra_v2.h"
#include "kyra/screen.h"
#include "kyra/screen_v2.h"
@@ -35,11 +35,11 @@
#include "kyra/resource.h"
namespace Kyra {
-WSAMovieV1::WSAMovieV1(KyraEngine *vm) : Movie(vm) {}
-WSAMovieV1::~WSAMovieV1() { close(); }
+WSAMovie_v1::WSAMovie_v1(KyraEngine_v1 *vm) : Movie(vm) {}
+WSAMovie_v1::~WSAMovie_v1() { close(); }
-int WSAMovieV1::open(const char *filename, int offscreenDecode, uint8 *palBuf) {
- debugC(9, kDebugLevelMovie, "WSAMovieV1::open('%s', %d, %p)", filename, offscreenDecode, (const void *)palBuf);
+int WSAMovie_v1::open(const char *filename, int offscreenDecode, uint8 *palBuf) {
+ debugC(9, kDebugLevelMovie, "WSAMovie_v1::open('%s', %d, %p)", filename, offscreenDecode, (const void *)palBuf);
close();
uint32 flags = 0;
@@ -117,25 +117,25 @@ int WSAMovieV1::open(const char *filename, int offscreenDecode, uint8 *palBuf) {
if (firstFrame)
Screen::decodeFrame4(_frameData, _deltaBuffer, _deltaBufferSize);
- delete [] p;
+ delete[] p;
_opened = true;
return _numFrames;
}
-void WSAMovieV1::close() {
- debugC(9, kDebugLevelMovie, "WSAMovieV1::close()");
+void WSAMovie_v1::close() {
+ debugC(9, kDebugLevelMovie, "WSAMovie_v1::close()");
if (_opened) {
- delete [] _deltaBuffer;
- delete [] _offscreenBuffer;
- delete [] _frameOffsTable;
- delete [] _frameData;
+ delete[] _deltaBuffer;
+ delete[] _offscreenBuffer;
+ delete[] _frameOffsTable;
+ delete[] _frameData;
_opened = false;
}
}
-void WSAMovieV1::displayFrame(int frameNum, ...) {
- debugC(9, kDebugLevelMovie, "WSAMovieV1::displayFrame(%d, ...)", frameNum);
+void WSAMovie_v1::displayFrame(int frameNum, ...) {
+ debugC(9, kDebugLevelMovie, "WSAMovie_v1::displayFrame(%d, ...)", frameNum);
if (frameNum >= _numFrames || !_opened)
return;
@@ -198,8 +198,8 @@ void WSAMovieV1::displayFrame(int frameNum, ...) {
_vm->screen()->copyBlockToPage(_drawPage, _x, _y, _width, _height, _offscreenBuffer);
}
-void WSAMovieV1::processFrame(int frameNum, uint8 *dst) {
- debugC(9, kDebugLevelMovie, "WSAMovieV1::processFrame(%d, %p)", frameNum, (const void *)dst);
+void WSAMovie_v1::processFrame(int frameNum, uint8 *dst) {
+ debugC(9, kDebugLevelMovie, "WSAMovie_v1::processFrame(%d, %p)", frameNum, (const void *)dst);
if (!_opened)
return;
assert(frameNum <= _numFrames);
@@ -213,11 +213,11 @@ void WSAMovieV1::processFrame(int frameNum, uint8 *dst) {
#pragma mark -
-WSAMovieAmiga::WSAMovieAmiga(KyraEngine *vm) : WSAMovieV1(vm), _buffer(0) {}
+WSAMovieAmiga::WSAMovieAmiga(KyraEngine_v1 *vm) : WSAMovie_v1(vm), _buffer(0) {}
int WSAMovieAmiga::open(const char *filename, int offscreenDecode, uint8 *palBuf) {
debugC(9, kDebugLevelMovie, "WSAMovieAmiga::open('%s', %d, %p)", filename, offscreenDecode, (const void *)palBuf);
- int res = WSAMovieV1::open(filename, offscreenDecode, palBuf);
+ int res = WSAMovie_v1::open(filename, offscreenDecode, palBuf);
if (!res)
return 0;
@@ -230,10 +230,10 @@ int WSAMovieAmiga::open(const char *filename, int offscreenDecode, uint8 *palBuf
void WSAMovieAmiga::close() {
debugC(9, kDebugLevelMovie, "WSAMovieAmiga::close()");
if (_opened) {
- delete [] _buffer;
+ delete[] _buffer;
_buffer = 0;
}
- WSAMovieV1::close();
+ WSAMovie_v1::close();
}
void WSAMovieAmiga::displayFrame(int frameNum, ...) {
@@ -342,10 +342,10 @@ void WSAMovieAmiga::processFrame(int frameNum, uint8 *dst) {
#pragma mark -
-WSAMovieV2::WSAMovieV2(KyraEngine *vm, Screen_v2 *screen) : WSAMovieV1(vm), _screen(screen), _xAdd(0), _yAdd(0) {}
+WSAMovie_v2::WSAMovie_v2(KyraEngine_v1 *vm, Screen_v2 *screen) : WSAMovie_v1(vm), _screen(screen), _xAdd(0), _yAdd(0) {}
-int WSAMovieV2::open(const char *filename, int unk1, uint8 *palBuf) {
- debugC(9, kDebugLevelMovie, "WSAMovieV2::open('%s', %d, %p)", filename, unk1, (const void *)palBuf);
+int WSAMovie_v2::open(const char *filename, int unk1, uint8 *palBuf) {
+ debugC(9, kDebugLevelMovie, "WSAMovie_v2::open('%s', %d, %p)", filename, unk1, (const void *)palBuf);
close();
uint32 flags = 0;
@@ -423,14 +423,14 @@ int WSAMovieV2::open(const char *filename, int unk1, uint8 *palBuf) {
if (firstFrame)
Screen::decodeFrame4(_frameData, _deltaBuffer, _deltaBufferSize);
- delete [] p;
+ delete[] p;
_opened = true;
return _numFrames;
}
-void WSAMovieV2::displayFrame(int frameNum, ...) {
- debugC(9, kDebugLevelMovie, "WSAMovieV2::displayFrame(%d, ...)", frameNum);
+void WSAMovie_v2::displayFrame(int frameNum, ...) {
+ debugC(9, kDebugLevelMovie, "WSAMovie_v2::displayFrame(%d, ...)", frameNum);
if (frameNum >= _numFrames || frameNum < 0 || !_opened)
return;
diff --git a/engines/kyra/wsamovie.h b/engines/kyra/wsamovie.h
index d1f3465c07..36cd75b1ab 100644
--- a/engines/kyra/wsamovie.h
+++ b/engines/kyra/wsamovie.h
@@ -32,12 +32,12 @@ class SoundHandle;
} // end of namespace Audio
namespace Kyra {
-class KyraEngine;
+class KyraEngine_v1;
class Screen_v2;
class Movie {
public:
- Movie(KyraEngine *vm) : _vm(vm), _opened(false), _x(-1), _y(-1), _drawPage(-1) {}
+ Movie(KyraEngine_v1 *vm) : _vm(vm), _opened(false), _x(-1), _y(-1), _drawPage(-1) {}
virtual ~Movie() {}
virtual bool opened() { return _opened; }
@@ -53,17 +53,17 @@ public:
virtual void setY(int y) { _y = y; }
virtual void setDrawPage(int page) { _drawPage = page; }
protected:
- KyraEngine *_vm;
+ KyraEngine_v1 *_vm;
bool _opened;
int _x, _y;
int _drawPage;
};
-class WSAMovieV1 : public Movie {
+class WSAMovie_v1 : public Movie {
public:
- WSAMovieV1(KyraEngine *vm);
- virtual ~WSAMovieV1();
+ WSAMovie_v1(KyraEngine_v1 *vm);
+ virtual ~WSAMovie_v1();
virtual int open(const char *filename, int offscreen, uint8 *palette);
virtual void close();
@@ -94,9 +94,9 @@ protected:
uint8 *_frameData;
};
-class WSAMovieAmiga : public WSAMovieV1 {
+class WSAMovieAmiga : public WSAMovie_v1 {
public:
- WSAMovieAmiga(KyraEngine *vm);
+ WSAMovieAmiga(KyraEngine_v1 *vm);
int open(const char *filename, int offscreen, uint8 *palette);
void close();
@@ -107,9 +107,9 @@ private:
uint8 *_buffer;
};
-class WSAMovieV2 : public WSAMovieV1 {
+class WSAMovie_v2 : public WSAMovie_v1 {
public:
- WSAMovieV2(KyraEngine *vm, Screen_v2 *scren);
+ WSAMovie_v2(KyraEngine_v1 *vm, Screen_v2 *scren);
int open(const char *filename, int unk1, uint8 *palette);
diff --git a/engines/lure/game.cpp b/engines/lure/game.cpp
index c87f81618a..f9b31c21c5 100644
--- a/engines/lure/game.cpp
+++ b/engines/lure/game.cpp
@@ -167,6 +167,7 @@ void Game::execute() {
if (system.getMillis() > timerVal + GAME_FRAME_DELAY) {
timerVal = system.getMillis();
nextFrame();
+ res.delayList().tick();
Sound.musicInterface_ContinuePlaying();
}
@@ -177,8 +178,6 @@ void Game::execute() {
tickCheck();
}
- res.delayList().tick();
-
while (events.pollEvent()) {
if (events.type() == Common::EVENT_KEYDOWN) {
uint16 roomNum = room.roomNumber();
diff --git a/engines/lure/lure.cpp b/engines/lure/lure.cpp
index de213b4f5a..06d3b1984e 100644
--- a/engines/lure/lure.cpp
+++ b/engines/lure/lure.cpp
@@ -154,6 +154,16 @@ int LureEngine::go() {
return 0;
}
+void LureEngine::pauseEngineIntern(bool pause) {
+ Engine::pauseEngineIntern(pause);
+
+ if (pause) {
+ Sound.pause();
+ } else {
+ Sound.resume();
+ }
+}
+
void LureEngine::quitGame() {
_system->quit();
}
diff --git a/engines/lure/lure.h b/engines/lure/lure.h
index fa70abc1f0..d66f446247 100644
--- a/engines/lure/lure.h
+++ b/engines/lure/lure.h
@@ -69,6 +69,7 @@ public:
virtual int init();
virtual int go();
+ virtual void pauseEngineIntern(bool pause);
void quitGame();
Disk &disk() { return *_disk; }
diff --git a/engines/lure/res.cpp b/engines/lure/res.cpp
index ce35b50243..f2997d5d17 100644
--- a/engines/lure/res.cpp
+++ b/engines/lure/res.cpp
@@ -85,7 +85,7 @@ void Resources::freeData() {
delete _talkDialogData;
delete _messagesData;
delete _cursors;
- delete [] _charOffsets;
+ delete[] _charOffsets;
}
struct AnimRecordTemp {
diff --git a/engines/lure/res_struct.cpp b/engines/lure/res_struct.cpp
index fcb6b874be..de09f982d1 100644
--- a/engines/lure/res_struct.cpp
+++ b/engines/lure/res_struct.cpp
@@ -760,10 +760,8 @@ RoomExitCoordinateData &RoomExitCoordinates::getData(uint16 destRoomNumber) {
// The following classes hold any sequence offsets that are being delayed
SequenceDelayData::SequenceDelayData(uint16 delay, uint16 seqOffset, bool canClearFlag) {
- OSystem &system = *g_system;
-
- // The delay is in number of seconds
- timeoutCtr = system.getMillis() + delay * 1000;
+ // The delay is in number of seconds - convert it to remaining milliseconds
+ timeoutCtr = delay * 1000;
sequenceOffset = seqOffset;
canClear = canClearFlag;
}
@@ -784,21 +782,23 @@ void SequenceDelayList::add(uint16 delay, uint16 seqOffset, bool canClear) {
}
void SequenceDelayList::tick() {
- uint32 currTime = g_system->getMillis();
SequenceDelayList::iterator i;
- debugC(ERROR_DETAILED, kLureDebugScripts, "Delay List check start at time %d", currTime);
+ debugC(ERROR_DETAILED, kLureDebugScripts, "Delay List check start at time %d",
+ g_system->getMillis());
for (i = begin(); i != end(); i++) {
SequenceDelayData *entry = (*i).get();
debugC(ERROR_DETAILED, kLureDebugScripts, "Delay List check %xh at time %d", entry->sequenceOffset, entry->timeoutCtr);
- if (currTime >= entry->timeoutCtr) {
+ if (entry->timeoutCtr <= GAME_FRAME_DELAY) {
// Timeout reached - delete entry from list and execute the sequence
uint16 seqOffset = entry->sequenceOffset;
erase(i);
Script::execute(seqOffset);
return;
+ } else {
+ entry->timeoutCtr -= GAME_FRAME_DELAY;
}
}
}
@@ -816,14 +816,12 @@ void SequenceDelayList::clear(bool forceClear) {
}
void SequenceDelayList::saveToStream(WriteStream *stream) {
- uint32 currTime = g_system->getMillis();
SequenceDelayList::iterator i;
for (i = begin(); i != end(); ++i) {
SequenceDelayData *entry = (*i).get();
stream->writeUint16LE(entry->sequenceOffset);
- stream->writeUint32LE((currTime > entry->timeoutCtr ) ? 0 :
- entry->timeoutCtr - currTime);
+ stream->writeUint32LE(entry->timeoutCtr);
stream->writeByte(entry->canClear);
}
@@ -833,10 +831,9 @@ void SequenceDelayList::saveToStream(WriteStream *stream) {
void SequenceDelayList::loadFromStream(ReadStream *stream) {
clear(true);
uint16 seqOffset;
- uint32 currTime = g_system->getMillis();
while ((seqOffset = stream->readUint16LE()) != 0) {
- uint32 delay = currTime + stream->readUint32LE();
+ uint32 delay = stream->readUint32LE();
bool canClear = stream->readByte() != 0;
push_back(SequenceDelayList::value_type(SequenceDelayData::load(delay, seqOffset, canClear)));
}
@@ -1008,8 +1005,8 @@ RandomActionSet::RandomActionSet(uint16 *&offset) {
}
RandomActionSet::~RandomActionSet() {
- delete [] _types;
- delete [] _ids;
+ delete[] _types;
+ delete[] _ids;
}
RandomActionSet *RandomActionList::getRoom(uint16 roomNumber) {
diff --git a/engines/m4/converse.cpp b/engines/m4/converse.cpp
index 6480428661..729af6c40f 100644
--- a/engines/m4/converse.cpp
+++ b/engines/m4/converse.cpp
@@ -1110,7 +1110,7 @@ void Converse::setValue(int32 offset, int32 value) {
_variables[hashOffset] = value;
}
-const int32 Converse::getValue(int32 offset) {
+int32 Converse::getValue(int32 offset) {
char hashOffset[10];
sprintf(hashOffset, "%i", offset);
ConvVarHashMap::const_iterator entry = _variables.find(hashOffset);
diff --git a/engines/m4/converse.h b/engines/m4/converse.h
index bea90d9ddf..4bd4524029 100644
--- a/engines/m4/converse.h
+++ b/engines/m4/converse.h
@@ -171,7 +171,7 @@ public:
ConvEntry *getNode(int32 index) { return _convNodes[index]; }
void setValue(int32 offset, int32 value);
- const int32 getValue(int32 offset);
+ int32 getValue(int32 offset);
bool evaluateCondition(int32 leftVal, int32 op, int32 rightVal);
bool performAction(EntryAction *action);
/*
diff --git a/engines/m4/font.cpp b/engines/m4/font.cpp
index c9b9a44f23..119e7297cf 100644
--- a/engines/m4/font.cpp
+++ b/engines/m4/font.cpp
@@ -192,7 +192,7 @@ int32 Font::write(M4Surface *surface, const char *text, int x, int y, int width,
while (*text) {
- char theChar = (*text++) & 0x7F;
+ unsigned char theChar = (*text++) & 0x7F;
int charWidth = _charWidths[theChar];
if (charWidth > 0) {
diff --git a/engines/m4/m4.cpp b/engines/m4/m4.cpp
index 6707639d1c..b2c0eda1ce 100644
--- a/engines/m4/m4.cpp
+++ b/engines/m4/m4.cpp
@@ -396,10 +396,12 @@ int M4Engine::goM4() {
// Show intro
- if (getGameType() == GType_Burger)
+ if (getGameType() == GType_Burger) {
_kernel->newRoom = TITLE_SCENE_BURGER;
- else
+ } else {
_scene->getBackgroundSurface()->loadBackgroundRiddle("main menu");
+ _ws->setBackgroundSurface(_scene->getBackgroundSurface());
+ }
_viewManager->addView(_scene);
diff --git a/engines/m4/script.h b/engines/m4/script.h
index a59bf46e86..2a937040e9 100644
--- a/engines/m4/script.h
+++ b/engines/m4/script.h
@@ -300,7 +300,8 @@ public:
const T& toData(const ScriptValue &value) {
printf("ScriptInterpreter::toData() index = %d; type = %d; max = %d\n", value.value, _data[value.value]->type, _data.size());
assert((uint32)value.value < _data.size());
- return *(_dataCache->load<T>(_scriptFile, _data[value.value]->offset));
+ T *result = _dataCache->load<T>(_scriptFile, _data[value.value]->offset);
+ return *result;
}
const char *getGlobalString(int index) const {
diff --git a/engines/made/database.cpp b/engines/made/database.cpp
index a7970a2e27..55e0e90732 100644
--- a/engines/made/database.cpp
+++ b/engines/made/database.cpp
@@ -39,7 +39,7 @@ namespace Made {
< 0x7FFE object
*/
-Object::Object() {
+Object::Object() : _objData(NULL), _freeData(false) {
}
Object::~Object() {
@@ -47,82 +47,6 @@ Object::~Object() {
delete[] _objData;
}
-int Object::loadVersion2(Common::SeekableReadStream &source) {
- _freeData = true;
- uint16 type = source.readUint16LE();
- if (type == 0x7FFF) {
- _objSize = source.readUint16LE();
- } else if (type == 0x7FFE) {
- _objSize = source.readUint16LE() * 2;
- } else if (type < 0x7FFE) {
- byte count1 = source.readByte();
- byte count2 = source.readByte();
- _objSize = (count1 + count2) * 2;
- }
- source.seek(-4, SEEK_CUR);
- _objSize += 6;
- _objData = new byte[_objSize];
- WRITE_LE_UINT16(_objData, 1);
- source.read(_objData + 2, _objSize - 2);
- return _objSize - 2;
-}
-
-int Object::loadVersion3(Common::SeekableReadStream &source) {
- _freeData = true;
- source.readUint16LE(); // skip flags
- uint16 type = source.readUint16LE();
- if (type == 0x7FFF) {
- _objSize = source.readUint16LE();
- } else if (type == 0x7FFE) {
- _objSize = source.readUint16LE() * 2;
- } else if (type < 0x7FFE) {
- byte count1 = source.readByte();
- byte count2 = source.readByte();
- _objSize = (count1 + count2) * 2;
- }
- source.seek(-6, SEEK_CUR);
- _objSize += 6;
- _objData = new byte[_objSize];
- source.read(_objData, _objSize);
- return _objSize;
-}
-
-int Object::loadVersion3(byte *source) {
- _objData = source;
- _freeData = false;
- if (getClass() < 0x7FFE) {
- _objSize = (getCount1() + getCount2()) * 2;
- } else {
- _objSize = getSize();
- }
- _objSize += 6;
- return _objSize;
-}
-
-uint16 Object::getFlags() const {
- return READ_LE_UINT16(_objData);
-}
-
-uint16 Object::getClass() const {
- return READ_LE_UINT16(_objData + 2);
-}
-
-uint16 Object::getSize() const {
- return READ_LE_UINT16(_objData + 4);
-}
-
-byte Object::getCount1() const {
- return _objData[4];
-}
-
-byte Object::getCount2() const {
- return _objData[5];
-}
-
-byte *Object::getData() {
- return _objData + 6;
-}
-
const char *Object::getString() {
if (getClass() == 0x7FFF)
return (const char*)getData();
@@ -195,15 +119,140 @@ void Object::dump(const char *filename) {
*/
}
+int ObjectV2::load(Common::SeekableReadStream &source) {
+
+ if (_freeData && _objData)
+ delete[] _objData;
+
+ _freeData = true;
+
+ byte header[4];
+ source.read(header, 4);
+
+ uint16 type = READ_LE_UINT16(header);
+ if (type == 0x7FFF) {
+ _objSize = READ_LE_UINT16(header + 2);
+ } else if (type == 0x7FFE) {
+ _objSize = READ_LE_UINT16(header + 2) * 2;
+ } else if (type < 0x7FFE) {
+ byte count1 = header[2];
+ byte count2 = header[3];
+ _objSize = (count1 + count2) * 2;
+ }
+ _objSize += 4;
+ _objData = new byte[_objSize];
+ memcpy(_objData, header, 4);
+ source.read(_objData + 4, _objSize - 4);
+
+ return _objSize;
+
+}
+
+int ObjectV2::load(byte *source) {
+ // Not implemented/used for version 2 objects
+ return 0;
+}
+
+int ObjectV2::save(Common::WriteStream &dest) {
+ dest.write(_objData, _objSize);
+ return 0;
+}
+
+uint16 ObjectV2::getFlags() {
+ return 1;
+}
+
+uint16 ObjectV2::getClass() {
+ return READ_LE_UINT16(_objData);
+}
+
+uint16 ObjectV2::getSize() {
+ return READ_LE_UINT16(_objData + 2);
+}
+
+byte ObjectV2::getCount1() {
+ return _objData[2];
+}
+
+byte ObjectV2::getCount2() {
+ return _objData[3];
+}
+
+byte *ObjectV2::getData() {
+ return _objData + 4;
+}
+
+int ObjectV3::load(Common::SeekableReadStream &source) {
+
+ _freeData = true;
+ source.readUint16LE(); // skip flags
+ uint16 type = source.readUint16LE();
+ if (type == 0x7FFF) {
+ _objSize = source.readUint16LE();
+ } else if (type == 0x7FFE) {
+ _objSize = source.readUint16LE() * 2;
+ } else if (type < 0x7FFE) {
+ byte count1 = source.readByte();
+ byte count2 = source.readByte();
+ _objSize = (count1 + count2) * 2;
+ }
+ source.seek(-6, SEEK_CUR);
+ _objSize += 6;
+ _objData = new byte[_objSize];
+ source.read(_objData, _objSize);
+ return _objSize;
+
+}
+
+int ObjectV3::load(byte *source) {
+ _objData = source;
+ _freeData = false;
+ if (getClass() < 0x7FFE) {
+ _objSize = (getCount1() + getCount2()) * 2;
+ } else {
+ _objSize = getSize();
+ }
+ _objSize += 6;
+ return _objSize;
+}
+
+int ObjectV3::save(Common::WriteStream &dest) {
+ // Not implemented/used for version 3 objects
+ return 0;
+}
+
+uint16 ObjectV3::getFlags() {
+ return READ_LE_UINT16(_objData);
+}
+
+uint16 ObjectV3::getClass() {
+ return READ_LE_UINT16(_objData + 2);
+}
+
+uint16 ObjectV3::getSize() {
+ return READ_LE_UINT16(_objData + 4);
+}
+
+byte ObjectV3::getCount1() {
+ return _objData[4];
+}
+
+byte ObjectV3::getCount2() {
+ return _objData[5];
+}
+
+byte *ObjectV3::getData() {
+ return _objData + 6;
+}
+
+
+
GameDatabase::GameDatabase(MadeEngine *vm) : _vm(vm) {
- _gameText = NULL;
}
GameDatabase::~GameDatabase() {
if (_gameState)
delete[] _gameState;
- if (_gameText)
- delete[] _gameText;
}
void GameDatabase::open(const char *filename) {
@@ -224,19 +273,85 @@ void GameDatabase::openFromRed(const char *redFilename, const char *filename) {
delete fileS;
}
-void GameDatabase::load(Common::SeekableReadStream &sourceS) {
+int16 GameDatabase::getVar(int16 index) {
+ return (int16)READ_LE_UINT16(_gameState + index * 2);
+}
+
+void GameDatabase::setVar(int16 index, int16 value) {
+ WRITE_LE_UINT16(_gameState + index * 2, value);
+}
+
+const char *GameDatabase::getObjectString(int16 index) {
+ Object *obj = getObject(index);
+ if (obj)
+ return obj->getString();
+ else
+ return "";
+}
- if (_vm->getGameID() == GID_MANHOLE || _vm->getGameID() == GID_LGOP2) {
- debug(2, "loading version 2 dat");
- loadVersion2(sourceS);
- } else if (_vm->getGameID() == GID_RTZ) {
- debug(2, "loading version 3 dat");
- loadVersion3(sourceS);
+void GameDatabase::setObjectString(int16 index, const char *str) {
+ Object *obj = getObject(index);
+ if (obj)
+ obj->setString(str);
+}
+
+int16 GameDatabase::getObjectProperty(int16 objectIndex, int16 propertyId) {
+
+ if (objectIndex == 0)
+ return 0;
+
+ int16 propertyFlag;
+ int16 *property = findObjectProperty(objectIndex, propertyId, propertyFlag);
+
+ if (property) {
+ return (int16)READ_LE_UINT16(property);
+ } else {
+ return 0;
}
}
-void GameDatabase::loadVersion2(Common::SeekableReadStream &sourceS) {
+int16 GameDatabase::setObjectProperty(int16 objectIndex, int16 propertyId, int16 value) {
+
+ if (objectIndex == 0)
+ return 0;
+
+ int16 propertyFlag;
+ int16 *property = findObjectProperty(objectIndex, propertyId, propertyFlag);
+
+ if (property) {
+ if (propertyFlag == 1) {
+ WRITE_LE_UINT16(property, value);
+ } else {
+ warning("GameDatabase::setObjectProperty(%04X, %04X, %04X) Trying to set constant property\n",
+ objectIndex, propertyId, value);
+ }
+ return value;
+ } else {
+ return 0;
+ }
+
+}
+
+void GameDatabase::dumpObject(int16 index) {
+ Object *obj = getObject(index);
+ char fn[512];
+ sprintf(fn, "obj%04X.0", index);
+ obj->dump(fn);
+}
+
+
+/* GameDatabaseV2 */
+
+GameDatabaseV2::GameDatabaseV2(MadeEngine *vm) : GameDatabase(vm), _gameText(NULL) {
+}
+
+GameDatabaseV2::~GameDatabaseV2() {
+ if (_gameText)
+ delete[] _gameText;
+}
+
+void GameDatabaseV2::load(Common::SeekableReadStream &sourceS) {
// TODO: Read/verifiy header
@@ -256,8 +371,9 @@ void GameDatabase::loadVersion2(Common::SeekableReadStream &sourceS) {
debug(2, "textOffs = %08X; textSize = %08X; objectCount = %d; varObjectCount = %d; gameStateSize = %d; objectsOffs = %08X; objectsSize = %d\n", textOffs, textSize, objectCount, varObjectCount, _gameStateSize, objectsOffs, objectsSize);
- _gameState = new byte[_gameStateSize];
+ _gameState = new byte[_gameStateSize + 2];
memset(_gameState, 0, _gameStateSize);
+ setVar(1, objectCount);
sourceS.seek(textOffs);
_gameText = new char[textSize];
@@ -269,145 +385,52 @@ void GameDatabase::loadVersion2(Common::SeekableReadStream &sourceS) {
sourceS.seek(objectsOffs);
for (uint32 i = 0; i < objectCount; i++) {
- Object *obj = new Object();
- int objSize = obj->loadVersion2(sourceS);
- objSize = objSize % 2;
+ Object *obj = new ObjectV2();
+ int objSize = obj->load(sourceS);
// objects are aligned on 2-byte-boundaries, skip unused bytes
- sourceS.skip(objSize);
+ sourceS.skip(objSize % 2);
_objects.push_back(obj);
}
}
-void GameDatabase::loadVersion3(Common::SeekableReadStream &sourceS) {
-
- // TODO: Read/verifiy header
-
- sourceS.seek(0x1E);
-
- uint32 objectIndexOffs = sourceS.readUint32LE();
- uint16 objectCount = sourceS.readUint16LE();
- uint32 gameStateOffs = sourceS.readUint32LE();
- _gameStateSize = sourceS.readUint32LE();
- uint32 objectsOffs = sourceS.readUint32LE();
- uint32 objectsSize = sourceS.readUint32LE();
- _mainCodeObjectIndex = sourceS.readUint16LE();
-
- debug(2, "objectIndexOffs = %08X; objectCount = %d; gameStateOffs = %08X; gameStateSize = %d; objectsOffs = %08X; objectsSize = %d\n", objectIndexOffs, objectCount, gameStateOffs, _gameStateSize, objectsOffs, objectsSize);
-
- _gameState = new byte[_gameStateSize];
- sourceS.seek(gameStateOffs);
- sourceS.read(_gameState, _gameStateSize);
-
- Common::Array<uint32> objectOffsets;
- sourceS.seek(objectIndexOffs);
- for (uint32 i = 0; i < objectCount; i++)
- objectOffsets.push_back(sourceS.readUint32LE());
-
- for (uint32 i = 0; i < objectCount; i++) {
- Object *obj = new Object();
-
- // The LSB indicates if it's a constant or variable object.
- // Constant objects are loaded from disk, while variable objects exist
- // in the _gameState buffer.
-
- debug(2, "obj(%04X) ofs = %08X\n", i, objectOffsets[i]);
-
- if (objectOffsets[i] & 1) {
- debug(2, "-> const %08X\n", objectsOffs + objectOffsets[i] - 1);
- sourceS.seek(objectsOffs + objectOffsets[i] - 1);
- obj->loadVersion3(sourceS);
- } else {
- debug(2, "-> var\n");
- obj->loadVersion3(_gameState + objectOffsets[i]);
- }
- _objects.push_back(obj);
- }
-
-}
-
-bool GameDatabase::getSavegameDescription(const char *filename, Common::String &description) {
-
- Common::InSaveFile *in;
-
- if (!(in = g_system->getSavefileManager()->openForLoading(filename))) {
- return false;
- }
-
- char desc[64];
-
- in->skip(4); // TODO: Verify marker 'SGAM'
- in->skip(4); // TODO: Verify size
- in->skip(2); // TODO: Verify version
- in->read(desc, 64);
- description = desc;
-
- printf("description = %s\n", description.c_str()); fflush(stdout);
-
- delete in;
-
- return true;
-
+bool GameDatabaseV2::getSavegameDescription(const char *filename, Common::String &description) {
+ // Not used in version 2 games
+ return false;
}
-int16 GameDatabase::savegame(const char *filename, const char *description, int16 version) {
-
+int16 GameDatabaseV2::savegame(const char *filename, const char *description, int16 version) {
Common::OutSaveFile *out;
-
+ int16 result = 0;
if (!(out = g_system->getSavefileManager()->openForSaving(filename))) {
warning("Can't create file '%s', game not saved", filename);
return 6;
}
-
- uint32 size = 4 + 4 + 2 + _gameStateSize;
- char desc[64];
-
- strncpy(desc, description, 64);
-
- out->writeUint32BE(MKID_BE('SGAM'));
- out->writeUint32LE(size);
- out->writeUint16LE(version);
- out->write(desc, 64);
- out->write(_gameState, _gameStateSize);
-
+ // Variable 0 is not saved
+ out->write(_gameState + 2, _gameStateSize - 2);
+ for (uint i = 0; i < _objects.size(); i++)
+ _objects[i]->save(*out);
delete out;
-
- return 0;
-
+ return result;
}
-int16 GameDatabase::loadgame(const char *filename, int16 version) {
-
+int16 GameDatabaseV2::loadgame(const char *filename, int16 version) {
Common::InSaveFile *in;
-
+ int16 result = 0;
if (!(in = g_system->getSavefileManager()->openForLoading(filename))) {
warning("Can't open file '%s', game not loaded", filename);
return 1;
}
-
- //uint32 expectedSize = 4 + 4 + 2 + _gameStateSize;
-
- in->skip(4); // TODO: Verify marker 'SGAM'
- in->skip(4); // TODO: Verify size
- in->skip(2); // TODO: Verify version
- in->skip(64); // skip savegame description
- in->read(_gameState, _gameStateSize);
-
+ // Variable 0 is not loaded
+ in->read(_gameState + 2, _gameStateSize - 2);
+ for (uint i = 0; i < _objects.size(); i++) {
+ _objects[i]->load(*in);
+ }
delete in;
-
- return 0;
-
+ return result;
}
-int16 GameDatabase::getVar(int16 index) {
- return (int16)READ_LE_UINT16(_gameState + index * 2);
-}
-
-void GameDatabase::setVar(int16 index, int16 value) {
- WRITE_LE_UINT16(_gameState + index * 2, value);
-}
-
-int16 *GameDatabase::getObjectPropertyPtrV2(int16 objectIndex, int16 propertyId, int16 &propertyFlag) {
+int16 *GameDatabaseV2::findObjectProperty(int16 objectIndex, int16 propertyId, int16 &propertyFlag) {
Object *obj = getObject(objectIndex);
int16 *prop = (int16*)obj->getData();
@@ -430,14 +453,11 @@ int16 *GameDatabase::getObjectPropertyPtrV2(int16 objectIndex, int16 propertyId,
// Now check in the object hierarchy of the given object
int16 parentObjectIndex = obj->getClass();
if (parentObjectIndex == 0) {
- //debug(2, "! NULL(np)\n");
return NULL;
}
while (parentObjectIndex != 0) {
- //debug(2, "parentObjectIndex = %04X\n", parentObjectIndex);
-
obj = getObject(parentObjectIndex);
prop = (int16*)obj->getData();
@@ -469,12 +489,116 @@ int16 *GameDatabase::getObjectPropertyPtrV2(int16 objectIndex, int16 propertyId,
}
- //debug(2, "! NULL(nf)\n");
+ debug(1, "findObjectProperty(%04X, %04X) Property not found", objectIndex, propertyId);
return NULL;
}
-int16 *GameDatabase::getObjectPropertyPtrV3(int16 objectIndex, int16 propertyId, int16 &propertyFlag) {
+const char *GameDatabaseV2::getString(uint16 offset) {
+ return (const char*)&_gameText[offset * 4];
+}
+
+
+/* GameDatabaseV3 */
+
+GameDatabaseV3::GameDatabaseV3(MadeEngine *vm) : GameDatabase(vm) {
+}
+
+void GameDatabaseV3::load(Common::SeekableReadStream &sourceS) {
+
+ // TODO: Read/verifiy header
+
+ sourceS.seek(0x1E);
+
+ uint32 objectIndexOffs = sourceS.readUint32LE();
+ uint16 objectCount = sourceS.readUint16LE();
+ uint32 gameStateOffs = sourceS.readUint32LE();
+ _gameStateSize = sourceS.readUint32LE();
+ uint32 objectsOffs = sourceS.readUint32LE();
+ uint32 objectsSize = sourceS.readUint32LE();
+ _mainCodeObjectIndex = sourceS.readUint16LE();
+
+ debug(2, "objectIndexOffs = %08X; objectCount = %d; gameStateOffs = %08X; gameStateSize = %d; objectsOffs = %08X; objectsSize = %d\n", objectIndexOffs, objectCount, gameStateOffs, _gameStateSize, objectsOffs, objectsSize);
+
+ _gameState = new byte[_gameStateSize];
+ sourceS.seek(gameStateOffs);
+ sourceS.read(_gameState, _gameStateSize);
+
+ Common::Array<uint32> objectOffsets;
+ sourceS.seek(objectIndexOffs);
+ for (uint32 i = 0; i < objectCount; i++)
+ objectOffsets.push_back(sourceS.readUint32LE());
+
+ for (uint32 i = 0; i < objectCount; i++) {
+ Object *obj = new ObjectV3();
+
+ // The LSB indicates if it's a constant or variable object.
+ // Constant objects are loaded from disk, while variable objects exist
+ // in the _gameState buffer.
+
+ if (objectOffsets[i] & 1) {
+ sourceS.seek(objectsOffs + objectOffsets[i] - 1);
+ obj->load(sourceS);
+ } else {
+ obj->load(_gameState + objectOffsets[i]);
+ }
+ _objects.push_back(obj);
+ }
+
+}
+
+bool GameDatabaseV3::getSavegameDescription(const char *filename, Common::String &description) {
+ Common::InSaveFile *in;
+ char desc[64];
+ if (!(in = g_system->getSavefileManager()->openForLoading(filename))) {
+ return false;
+ }
+ in->skip(4); // TODO: Verify marker 'SGAM'
+ in->skip(4); // TODO: Verify size
+ in->skip(2); // TODO: Verify version
+ in->read(desc, 64);
+ description = desc;
+ delete in;
+ return true;
+}
+
+int16 GameDatabaseV3::savegame(const char *filename, const char *description, int16 version) {
+ Common::OutSaveFile *out;
+ char desc[64];
+ int16 result = 0;
+ uint32 size = 4 + 4 + 2 + _gameStateSize;
+ if (!(out = g_system->getSavefileManager()->openForSaving(filename))) {
+ warning("Can't create file '%s', game not saved", filename);
+ return 6;
+ }
+ strncpy(desc, description, 64);
+ out->writeUint32BE(MKID_BE('SGAM'));
+ out->writeUint32LE(size);
+ out->writeUint16LE(version);
+ out->write(desc, 64);
+ out->write(_gameState, _gameStateSize);
+ delete out;
+ return result;
+}
+
+int16 GameDatabaseV3::loadgame(const char *filename, int16 version) {
+ Common::InSaveFile *in;
+ int16 result = 0;
+ //uint32 expectedSize = 4 + 4 + 2 + _gameStateSize;
+ if (!(in = g_system->getSavefileManager()->openForLoading(filename))) {
+ warning("Can't open file '%s', game not loaded", filename);
+ return 1;
+ }
+ in->skip(4); // TODO: Verify marker 'SGAM'
+ in->skip(4); // TODO: Verify size
+ in->skip(2); // TODO: Verify version
+ in->skip(64); // skip savegame description
+ in->read(_gameState, _gameStateSize);
+ delete in;
+ return result;
+}
+
+int16 *GameDatabaseV3::findObjectProperty(int16 objectIndex, int16 propertyId, int16 &propertyFlag) {
Object *obj = getObject(objectIndex);
int16 *prop = (int16*)obj->getData();
@@ -502,14 +626,11 @@ int16 *GameDatabase::getObjectPropertyPtrV3(int16 objectIndex, int16 propertyId,
// Now check in the object hierarchy of the given object
int16 parentObjectIndex = obj->getClass();
if (parentObjectIndex == 0) {
- //debug(2, "! NULL(np)\n");
return NULL;
}
while (parentObjectIndex != 0) {
- //debug(2, "parentObjectIndex = %04X\n", parentObjectIndex);
-
obj = getObject(parentObjectIndex);
prop = (int16*)obj->getData();
@@ -551,70 +672,13 @@ int16 *GameDatabase::getObjectPropertyPtrV3(int16 objectIndex, int16 propertyId,
}
- //debug(2, "! NULL(nf)\n");
return NULL;
-
-}
-
-int16 *GameDatabase::getObjectPropertyPtr(int16 objectIndex, int16 propertyId, int16 &propertyFlag) {
- switch (_vm->_engineVersion) {
- case 2:
- return getObjectPropertyPtrV2(objectIndex, propertyId, propertyFlag);
- case 3:
- return getObjectPropertyPtrV3(objectIndex, propertyId, propertyFlag);
- default:
- error("GameDatabase::getObjectPropertyPtr() Unknown engine version");
- return NULL;
- }
-}
-
-int16 GameDatabase::getObjectProperty(int16 objectIndex, int16 propertyId) {
-
- if (objectIndex == 0)
- return 0;
-
- int16 propertyFlag;
- int16 *property = getObjectPropertyPtr(objectIndex, propertyId, propertyFlag);
- if (property) {
- return (int16)READ_LE_UINT16(property);
- } else {
- return 0;
- }
-
}
-int16 GameDatabase::setObjectProperty(int16 objectIndex, int16 propertyId, int16 value) {
-
- if (objectIndex == 0)
- return 0;
-
- int16 propertyFlag;
- int16 *property = getObjectPropertyPtr(objectIndex, propertyId, propertyFlag);
-
- if (property) {
- if (propertyFlag == 1) {
- WRITE_LE_UINT16(property, value);
- } else {
- debug(2, "GameDatabase::setObjectProperty(%04X, %04X, %04X) Trying to set constant property\n",
- objectIndex, propertyId, value);
- }
- return value;
- } else {
- return 0;
- }
-
-}
-
-const char *GameDatabase::getString(uint16 offset) {
- return (const char*)&_gameText[offset * 4];
-}
-
-void GameDatabase::dumpObject(int16 index) {
- Object *obj = getObject(index);
- char fn[512];
- sprintf(fn, "obj%04X.0", index);
- obj->dump(fn);
+const char *GameDatabaseV3::getString(uint16 offset) {
+ // Not used in version 3 games
+ return NULL;
}
} // End of namespace Made
diff --git a/engines/made/database.h b/engines/made/database.h
index b92bd8f2dd..466d1a8f69 100644
--- a/engines/made/database.h
+++ b/engines/made/database.h
@@ -40,26 +40,25 @@ namespace Made {
class Object {
public:
Object();
- ~Object();
- int loadVersion2(Common::SeekableReadStream &source);
- int loadVersion3(Common::SeekableReadStream &source);
- int loadVersion3(byte *source);
+ virtual ~Object();
+
+ virtual int load(Common::SeekableReadStream &source) = 0;
+ virtual int load(byte *source) = 0;
+ virtual int save(Common::WriteStream &dest) = 0;
+ virtual uint16 getFlags() = 0;
+ virtual uint16 getClass() = 0;
+ virtual uint16 getSize() = 0;
+ virtual byte getCount1() = 0;
+ virtual byte getCount2() = 0;
+ virtual byte *getData() = 0;
+ virtual bool isConstant() = 0;
- uint16 getFlags() const;
- uint16 getClass() const;
- uint16 getSize() const;
-
- byte getCount1() const;
- byte getCount2() const;
-
- byte *getData();
const char *getString();
void setString(const char *str);
bool isObject();
bool isVector();
- bool isConstant() const { return !(getFlags() & 1); }
-
+
int16 getVectorSize();
int16 getVectorItem(int16 index);
void setVectorItem(int16 index, int16 value);
@@ -72,52 +71,113 @@ protected:
byte *_objData;
};
+class ObjectV2 : public Object {
+public:
+ int load(Common::SeekableReadStream &source);
+ int load(byte *source);
+ int save(Common::WriteStream &dest);
+ uint16 getFlags();
+ uint16 getClass();
+ uint16 getSize();
+ byte getCount1();
+ byte getCount2();
+ byte *getData();
+
+ bool isConstant() {
+ return false;
+ }
+
+};
+
+class ObjectV3 : public Object {
+public:
+ int load(Common::SeekableReadStream &source);
+ int load(byte *source);
+ int save(Common::WriteStream &dest);
+ uint16 getFlags();
+ uint16 getClass();
+ uint16 getSize();
+ byte getCount1();
+ byte getCount2();
+ byte *getData();
+
+ bool isConstant() {
+ return !(getFlags() & 1);
+ }
+
+};
+
class GameDatabase {
public:
GameDatabase(MadeEngine *vm);
- ~GameDatabase();
+ virtual ~GameDatabase();
void open(const char *filename);
void openFromRed(const char *redFilename, const char *filename);
- bool getSavegameDescription(const char *filename, Common::String &description);
- int16 savegame(const char *filename, const char *description, int16 version);
- int16 loadgame(const char *filename, int16 version);
-
- Object *getObject(int16 index) const {
+ Object *getObject(int16 index) const {
if (index >= 1)
return _objects[index - 1];
else
return NULL;
}
+ uint getObjectCount() const { return _objects.size(); }
+
int16 getMainCodeObjectIndex() const { return _mainCodeObjectIndex; }
int16 getVar(int16 index);
void setVar(int16 index, int16 value);
-
- int16 *getObjectPropertyPtrV2(int16 objectIndex, int16 propertyId, int16 &propertyFlag);
- int16 *getObjectPropertyPtrV3(int16 objectIndex, int16 propertyId, int16 &propertyFlag);
- int16 *getObjectPropertyPtr(int16 objectIndex, int16 propertyId, int16 &propertyFlag);
-
+
+ const char *getObjectString(int16 index);
+ void setObjectString(int16 index, const char *str);
+
+ virtual int16 *findObjectProperty(int16 objectIndex, int16 propertyId, int16 &propertyFlag) = 0;
+ virtual const char *getString(uint16 offset) = 0;
+ virtual bool getSavegameDescription(const char *filename, Common::String &description) = 0;
+ virtual int16 savegame(const char *filename, const char *description, int16 version) = 0;
+ virtual int16 loadgame(const char *filename, int16 version) = 0;
+
int16 getObjectProperty(int16 objectIndex, int16 propertyId);
int16 setObjectProperty(int16 objectIndex, int16 propertyId, int16 value);
-
- const char *getString(uint16 offset);
void dumpObject(int16 index);
-
+
protected:
MadeEngine *_vm;
Common::Array<Object*> _objects;
byte *_gameState;
uint32 _gameStateSize;
- char *_gameText;
int16 _mainCodeObjectIndex;
+ virtual void load(Common::SeekableReadStream &sourceS) = 0;
+};
+
+class GameDatabaseV2 : public GameDatabase {
+public:
+ GameDatabaseV2(MadeEngine *vm);
+ ~GameDatabaseV2();
+ int16 *findObjectProperty(int16 objectIndex, int16 propertyId, int16 &propertyFlag);
+ const char *getString(uint16 offset);
+ bool getSavegameDescription(const char *filename, Common::String &description);
+ int16 savegame(const char *filename, const char *description, int16 version);
+ int16 loadgame(const char *filename, int16 version);
+protected:
+ char *_gameText;
+ void load(Common::SeekableReadStream &sourceS);
+};
+
+class GameDatabaseV3 : public GameDatabase {
+public:
+ GameDatabaseV3(MadeEngine *vm);
+ int16 *findObjectProperty(int16 objectIndex, int16 propertyId, int16 &propertyFlag);
+ const char *getString(uint16 offset);
+ bool getSavegameDescription(const char *filename, Common::String &description);
+ int16 savegame(const char *filename, const char *description, int16 version);
+ int16 loadgame(const char *filename, int16 version);
+protected:
+ char *_gameText;
void load(Common::SeekableReadStream &sourceS);
- void loadVersion2(Common::SeekableReadStream &sourceS);
- void loadVersion3(Common::SeekableReadStream &sourceS);
};
} // End of namespace Made
diff --git a/engines/made/detection.cpp b/engines/made/detection.cpp
index 6da3189163..dc7dbdee87 100644
--- a/engines/made/detection.cpp
+++ b/engines/made/detection.cpp
@@ -65,6 +65,7 @@ static const PlainGameDescriptor madeGames[] = {
{"manhole", "The Manhole"},
{"rtz", "Return to Zork"},
{"lgop2", "Leather Goddesses of Phobos 2"},
+ {"rodney", "Rodney's Fun Screen"},
{0, 0}
};
@@ -74,9 +75,45 @@ namespace Made {
static const MadeGameDescription gameDescriptions[] = {
{
- // Return to Zork - English CD version
- // NOTE: This detects the game via the rtzcd.dat which is inside rtzcd.red.
- // The entry below detects via rtzcd.red directly, which is the "official" way.
+ // NOTE: Return to Zork entries with *.dat are used to detect the game via rtzcd.dat,
+ // which is packed inside rtzcd.red. Entries with *.red refer to the packed file
+ // directly, which is the "official" way.
+
+ // Return to Zork - English CD version 1.0 9/15/93
+ // Patch #1953654 submitted by spookypeanut
+ {
+ "rtz",
+ "CD",
+ AD_ENTRY1("rtzcd.dat", "e95c38ded389e39cfbf87a8cb250b12e"),
+ Common::EN_ANY,
+ Common::kPlatformPC,
+ Common::ADGF_NO_FLAGS
+ },
+ GID_RTZ,
+ 0,
+ GF_CD,
+ 0,
+ },
+
+ {
+ // Return to Zork - English CD version 1.0 9/15/93
+ // Patch #1953654 submitted by spookypeanut
+ {
+ "rtz",
+ "CD",
+ AD_ENTRY1("rtzcd.red", "cd8b62ece4677c438688c1de3f5379b9"),
+ Common::EN_ANY,
+ Common::kPlatformPC,
+ Common::ADGF_NO_FLAGS
+ },
+ GID_RTZ,
+ 0,
+ GF_CD_COMPRESSED,
+ 0,
+ },
+
+ {
+ // Return to Zork - English CD version 1.1 12/7/93
{
"rtz",
"CD",
@@ -109,6 +146,23 @@ static const MadeGameDescription gameDescriptions[] = {
{
// Return to Zork - English CD version 1.2 9/29/94
+ // Supplied by Dark-Star in the ScummVM forums
+ {
+ "rtz",
+ "CD",
+ AD_ENTRY1("rtzcd.dat", "9d740378da2d16e83d0d0efff01bf83a"),
+ Common::EN_ANY,
+ Common::kPlatformPC,
+ Common::ADGF_NO_FLAGS
+ },
+ GID_RTZ,
+ 0,
+ GF_CD,
+ 0,
+ },
+
+ {
+ // Return to Zork - English CD version 1.2 9/29/94
{
"rtz",
"CD",
@@ -123,6 +177,41 @@ static const MadeGameDescription gameDescriptions[] = {
0,
},
+ {
+ // Return to Zork - German CD version 1.2 9/29/94
+ // (same as the English 1.2 version)
+ // Supplied by Dark-Star in the ScummVM forums
+ {
+ "rtz",
+ "CD",
+ AD_ENTRY1("rtzcd.dat", "9d740378da2d16e83d0d0efff01bf83a"),
+ Common::DE_DEU,
+ Common::kPlatformPC,
+ Common::ADGF_NO_FLAGS
+ },
+ GID_RTZ,
+ 0,
+ GF_CD,
+ 0,
+ },
+
+ {
+ // Return to Zork - German CD version 1.2 4/18/95
+ // (same as the English 1.2 version)
+ // Supplied by Dark-Star in the ScummVM forums
+ {
+ "rtz",
+ "CD",
+ AD_ENTRY1("rtzcd.red", "946997d8b0aa6cb4e848bad02a1fc3d2"),
+ Common::DE_DEU,
+ Common::kPlatformPC,
+ Common::ADGF_NO_FLAGS
+ },
+ GID_RTZ,
+ 0,
+ GF_CD_COMPRESSED,
+ 0,
+ },
{
// Return to Zork - English floppy version
@@ -188,6 +277,22 @@ static const MadeGameDescription gameDescriptions[] = {
0,
},
+ {
+ // Rodney's Fun Screen
+ {
+ "rodney",
+ "",
+ AD_ENTRY1("rodneys.dat", "a79887dbaa47689facd7c6f09258ba5a"),
+ Common::EN_ANY,
+ Common::kPlatformPC,
+ Common::ADGF_NO_FLAGS
+ },
+ GID_RODNEY,
+ 0,
+ GF_FLOPPY,
+ 0,
+ },
+
{ AD_TABLE_END_MARKER, 0, 0, 0, 0 }
};
@@ -240,7 +345,7 @@ public:
}
virtual const char *getCopyright() const {
- return "MADE Engine";
+ return "MADE Engine (C) Activision";
}
virtual bool createInstance(OSystem *syst, Engine **engine, const Common::ADGameDescription *desc) const;
@@ -268,7 +373,8 @@ const Common::ADGameDescription *MadeMetaEngine::fallbackDetect(const FSList *fs
Made::g_fallbackDesc.features = 0;
Made::g_fallbackDesc.version = 0;
- return (const Common::ADGameDescription *)&Made::g_fallbackDesc;
+ //return (const Common::ADGameDescription *)&Made::g_fallbackDesc;
+ return NULL;
}
#if PLUGIN_ENABLED_DYNAMIC(MADE)
diff --git a/engines/made/graphics.cpp b/engines/made/graphics.cpp
index 081621ef18..ee702893a0 100644
--- a/engines/made/graphics.cpp
+++ b/engines/made/graphics.cpp
@@ -29,7 +29,24 @@
namespace Made {
-void decompressImage(byte *source, Graphics::Surface &surface, uint16 cmdOffs, uint16 pixelOffs, uint16 maskOffs, uint16 lineSize, bool deltaFrame) {
+byte ValueReader::readPixel() {
+ byte value;
+ if (_nibbleMode) {
+ if (_nibbleSwitch) {
+ value = (_buffer[0] >> 4) & 0x0F;
+ _buffer++;
+ } else {
+ value = _buffer[0] & 0x0F;
+ }
+ _nibbleSwitch = !_nibbleSwitch;
+ } else {
+ value = _buffer[0];
+ _buffer++;
+ }
+ return value;
+}
+
+void decompressImage(byte *source, Graphics::Surface &surface, uint16 cmdOffs, uint16 pixelOffs, uint16 maskOffs, uint16 lineSize, byte cmdFlags, byte pixelFlags, byte maskFlags, bool deltaFrame) {
const int offsets[] = {
0, 1, 2, 3,
@@ -43,11 +60,10 @@ void decompressImage(byte *source, Graphics::Surface &surface, uint16 cmdOffs, u
byte *cmdBuffer = source + cmdOffs;
byte *maskBuffer = source + maskOffs;
- byte *pixelBuffer = source + pixelOffs;
+ ValueReader pixelReader(source + pixelOffs, (pixelFlags & 2) != 0);
byte *destPtr = (byte*)surface.getBasePtr(0, 0);
- //byte lineBuf[320 * 4];
byte lineBuf[640 * 4];
byte bitBuf[40];
@@ -85,14 +101,14 @@ void decompressImage(byte *source, Graphics::Surface &surface, uint16 cmdOffs, u
switch (cmd) {
case 0:
- pixels[0] = *pixelBuffer++;
+ pixels[0] = pixelReader.readPixel();
for (int i = 0; i < 16; i++)
lineBuf[drawDestOfs + offsets[i]] = pixels[0];
break;
case 1:
- pixels[0] = *pixelBuffer++;
- pixels[1] = *pixelBuffer++;
+ pixels[0] = pixelReader.readPixel();
+ pixels[1] = pixelReader.readPixel();
mask = READ_LE_UINT16(maskBuffer);
maskBuffer += 2;
for (int i = 0; i < 16; i++) {
@@ -102,10 +118,10 @@ void decompressImage(byte *source, Graphics::Surface &surface, uint16 cmdOffs, u
break;
case 2:
- pixels[0] = *pixelBuffer++;
- pixels[1] = *pixelBuffer++;
- pixels[2] = *pixelBuffer++;
- pixels[3] = *pixelBuffer++;
+ pixels[0] = pixelReader.readPixel();
+ pixels[1] = pixelReader.readPixel();
+ pixels[2] = pixelReader.readPixel();
+ pixels[3] = pixelReader.readPixel();
mask = READ_LE_UINT32(maskBuffer);
maskBuffer += 4;
for (int i = 0; i < 16; i++) {
@@ -149,4 +165,112 @@ void decompressImage(byte *source, Graphics::Surface &surface, uint16 cmdOffs, u
}
+void decompressMovieImage(byte *source, Graphics::Surface &surface, uint16 cmdOffs, uint16 pixelOffs, uint16 maskOffs, uint16 lineSize) {
+
+ uint16 width = surface.w;
+ uint16 height = surface.h;
+ uint16 bx = 0, by = 0, bw = ((width + 3) / 4) * 4;
+
+ byte *cmdBuffer = source + cmdOffs;
+ byte *maskBuffer = source + maskOffs;
+ byte *pixelBuffer = source + pixelOffs;
+
+ byte *destPtr = (byte*)surface.getBasePtr(0, 0);
+
+ byte bitBuf[40];
+
+ int bitBufLastOfs = (((lineSize + 1) >> 1) << 1) - 2;
+ int bitBufLastCount = ((width + 3) >> 2) & 7;
+ if (bitBufLastCount == 0)
+ bitBufLastCount = 8;
+
+ debug(1, "width = %d; bw = %d", width, bw);
+
+ while (height > 0) {
+
+ memcpy(bitBuf, cmdBuffer, lineSize);
+ cmdBuffer += lineSize;
+
+ for (uint16 bitBufOfs = 0; bitBufOfs < lineSize; bitBufOfs += 2) {
+
+ uint16 bits = READ_LE_UINT16(&bitBuf[bitBufOfs]);
+
+ int bitCount;
+ if (bitBufOfs == bitBufLastOfs)
+ bitCount = bitBufLastCount;
+ else
+ bitCount = 8;
+
+ for (int curCmd = 0; curCmd < bitCount; curCmd++) {
+ uint cmd = bits & 3;
+ bits >>= 2;
+
+ byte pixels[4], block[16];
+ uint32 mask;
+
+ switch (cmd) {
+
+ case 0:
+ pixels[0] = *pixelBuffer++;
+ for (int i = 0; i < 16; i++)
+ block[i] = pixels[0];
+ break;
+
+ case 1:
+ pixels[0] = *pixelBuffer++;
+ pixels[1] = *pixelBuffer++;
+ mask = READ_LE_UINT16(maskBuffer);
+ maskBuffer += 2;
+ for (int i = 0; i < 16; i++) {
+ block[i] = pixels[mask & 1];
+ mask >>= 1;
+ }
+ break;
+
+ case 2:
+ pixels[0] = *pixelBuffer++;
+ pixels[1] = *pixelBuffer++;
+ pixels[2] = *pixelBuffer++;
+ pixels[3] = *pixelBuffer++;
+ mask = READ_LE_UINT32(maskBuffer);
+ maskBuffer += 4;
+ for (int i = 0; i < 16; i++) {
+ block[i] = pixels[mask & 3];
+ mask >>= 2;
+ }
+ break;
+
+ case 3:
+ break;
+
+ }
+
+ if (cmd != 3) {
+ uint16 blockPos = 0;
+ uint32 maxW = MIN(4, surface.w - bx);
+ uint32 maxH = (MIN(4, surface.h - by) + by) * width;
+ for (uint32 yc = by * width; yc < maxH; yc += width) {
+ for (uint32 xc = 0; xc < maxW; xc++) {
+ destPtr[(bx + xc) + yc] = block[xc + blockPos];
+ }
+ blockPos += 4;
+ }
+ }
+
+ bx += 4;
+ if (bx >= bw) {
+ bx = 0;
+ by += 4;
+ }
+
+ }
+
+ }
+
+ height -= 4;
+
+ }
+
+}
+
} // End of namespace Made
diff --git a/engines/made/graphics.h b/engines/made/graphics.h
index 3c56bb4231..1a5cf72677 100644
--- a/engines/made/graphics.h
+++ b/engines/made/graphics.h
@@ -33,7 +33,18 @@
namespace Made {
-void decompressImage(byte *source, Graphics::Surface &surface, uint16 cmdOffs, uint16 pixelOffs, uint16 maskOffs, uint16 lineSize, bool deltaFrame = false);
+class ValueReader {
+public:
+ ValueReader(byte *source, bool nibbleMode) : _buffer(source), _nibbleBuf(0), _nibbleMode(nibbleMode), _nibbleSwitch(false) {}
+ byte readPixel();
+protected:
+ byte _nibbleBuf;
+ bool _nibbleMode, _nibbleSwitch;
+ byte *_buffer;
+};
+
+void decompressImage(byte *source, Graphics::Surface &surface, uint16 cmdOffs, uint16 pixelOffs, uint16 maskOffs, uint16 lineSize, byte cmdFlags, byte pixelFlags, byte maskFlags, bool deltaFrame = false);
+void decompressMovieImage(byte *source, Graphics::Surface &surface, uint16 cmdOffs, uint16 pixelOffs, uint16 maskOffs, uint16 lineSize);
} // End of namespace Made
diff --git a/engines/made/made.cpp b/engines/made/made.cpp
index 932f5ddcc4..59ec487c37 100644
--- a/engines/made/made.cpp
+++ b/engines/made/made.cpp
@@ -35,6 +35,7 @@
#include "base/plugins.h"
#include "base/version.h"
+#include "sound/audiocd.h"
#include "sound/mixer.h"
#include "made/made.h"
@@ -86,7 +87,15 @@ MadeEngine::MadeEngine(OSystem *syst, const MadeGameDescription *gameDesc) : Eng
_pmvPlayer = new PmvPlayer(this, _mixer);
_res = new ProjectReader();
_screen = new Screen(this);
- _dat = new GameDatabase(this);
+
+ if (getGameID() == GID_LGOP2 || getGameID() == GID_MANHOLE || getGameID() == GID_RODNEY) {
+ _dat = new GameDatabaseV2(this);
+ } else if (getGameID() == GID_RTZ) {
+ _dat = new GameDatabaseV3(this);
+ } else {
+ error("Unknown GameID");
+ }
+
_script = new ScriptInterpreter(this);
int midiDriver = MidiDriver::detectMusicDriver(MDT_MIDI | MDT_ADLIB | MDT_PREFER_MIDI);
@@ -107,7 +116,15 @@ MadeEngine::MadeEngine(OSystem *syst, const MadeGameDescription *gameDesc) : Eng
debug(1, "Music disabled.");
}
- _soundRate = 8000;
+ _quit = false;
+
+ // Set default sound frequency
+ // Return to Zork sets it itself via a script funtion
+ if (getGameID() == GID_MANHOLE || getGameID() == GID_RODNEY) {
+ _soundRate = 11025;
+ } else {
+ _soundRate = 8000;
+ }
}
@@ -132,21 +149,26 @@ int MadeEngine::init() {
}
int16 MadeEngine::getTimer(int16 timerNum) {
- return (_system->getMillis() - _timers[timerNum]) / 60;
+ if (timerNum > 0 && timerNum <= ARRAYSIZE(_timers) && _timers[timerNum - 1] != -1)
+ return (_system->getMillis() - _timers[timerNum - 1]) / kTimerResolution;
+ else
+ return 32000;
}
void MadeEngine::setTimer(int16 timerNum, int16 value) {
- _timers[timerNum] = value * 60;
+ if (timerNum > 0 && timerNum <= ARRAYSIZE(_timers))
+ _timers[timerNum - 1] = value * kTimerResolution;
}
void MadeEngine::resetTimer(int16 timerNum) {
- _timers[timerNum] = _system->getMillis();
+ if (timerNum > 0 && timerNum <= ARRAYSIZE(_timers))
+ _timers[timerNum - 1] = _system->getMillis();
}
int16 MadeEngine::allocTimer() {
for (int i = 0; i < ARRAYSIZE(_timers); i++) {
if (_timers[i] == -1) {
- resetTimer(i);
+ _timers[i] = _system->getMillis();
return i + 1;
}
}
@@ -154,14 +176,79 @@ int16 MadeEngine::allocTimer() {
}
void MadeEngine::freeTimer(int16 timerNum) {
- _timers[timerNum] = -1;
+ if (timerNum > 0 && timerNum <= ARRAYSIZE(_timers))
+ _timers[timerNum - 1] = -1;
+}
+
+Common::String MadeEngine::getSavegameFilename(int16 saveNum) {
+ char filename[256];
+ snprintf(filename, 256, "%s.%03d", getTargetName().c_str(), saveNum);
+ return filename;
+}
+
+void MadeEngine::handleEvents() {
+
+ Common::Event event;
+ Common::EventManager *eventMan = _system->getEventManager();
+
+ // NOTE: Don't reset _eventNum to 0 here or no events will get through to the scripts.
+
+ while (eventMan->pollEvent(event)) {
+ switch (event.type) {
+
+ case Common::EVENT_MOUSEMOVE:
+ _eventMouseX = event.mouse.x;
+ _eventMouseY = event.mouse.y;
+ break;
+
+ case Common::EVENT_LBUTTONDOWN:
+ _eventNum = 1;
+ break;
+
+ /*
+ case Common::EVENT_LBUTTONUP:
+ _eventNum = 2; // TODO: Is this correct?
+ break;
+ */
+
+ case Common::EVENT_RBUTTONDOWN:
+ _eventNum = 3;
+ break;
+
+ /*
+ case Common::EVENT_RBUTTONUP:
+ eventNum = 4; // TODO: Is this correct?
+ break;
+ */
+
+ case Common::EVENT_KEYDOWN:
+ _eventKey = event.kbd.ascii;
+ // For unknown reasons, the game accepts ASCII code
+ // 9 as backspace
+ if (_eventKey == Common::KEYCODE_BACKSPACE)
+ _eventKey = 9;
+ _eventNum = 5;
+ break;
+
+ case Common::EVENT_QUIT:
+ _quit = true;
+ break;
+
+ default:
+ break;
+
+ }
+ }
+
+ AudioCD.updateCD();
+
}
int MadeEngine::go() {
for (int i = 0; i < ARRAYSIZE(_timers); i++)
_timers[i] = -1;
-
+
if (getGameID() == GID_RTZ) {
_engineVersion = 3;
if (getFeatures() & GF_DEMO) {
@@ -187,12 +274,28 @@ int MadeEngine::go() {
_engineVersion = 2;
_dat->open("lgop2.dat");
_res->open("lgop2.prj");
+ } else if (getGameID() == GID_RODNEY) {
+ _engineVersion = 2;
+ _dat->open("rodneys.dat");
+ _res->open("rodneys.prj");
} else {
error ("Unknown MADE game");
}
- _eventMouseX = _eventMouseY = 0;
+ // FIXME: This should make things a little faster until proper dirty rectangles
+ // are implemented.
+ // NOTE: Disabled again since it causes major graphics errors.
+ //_system->setFeatureState(OSystem::kFeatureAutoComputeDirtyRects, true);
+
+ _autoStopSound = false;
+ _eventNum = _eventKey = _eventMouseX = _eventMouseY = 0;
+
+#ifdef DUMP_SCRIPTS
+ _script->dumpAllScripts();
+#else
+ _screen->setDefaultMouseCursor();
_script->runScript(_dat->getMainCodeObjectIndex());
+#endif
return 0;
}
diff --git a/engines/made/made.h b/engines/made/made.h
index b3a25b4e02..461941e5cf 100644
--- a/engines/made/made.h
+++ b/engines/made/made.h
@@ -48,18 +48,21 @@
namespace Made {
enum MadeGameID {
- GID_RTZ = 0,
- GID_MANHOLE = 1,
- GID_LGOP2 = 2
+ GID_RTZ = 0,
+ GID_MANHOLE = 1,
+ GID_LGOP2 = 2,
+ GID_RODNEY = 3
};
enum MadeGameFeatures {
- GF_DEMO = 1 << 0,
- GF_CD = 1 << 1,
- GF_CD_COMPRESSED = 1 << 2,
- GF_FLOPPY = 1 << 3
+ GF_DEMO = 1 << 0,
+ GF_CD = 1 << 1,
+ GF_CD_COMPRESSED = 1 << 2,
+ GF_FLOPPY = 1 << 3
};
+const uint32 kTimerResolution = 40;
+
struct MadeGameDescription;
class ProjectReader;
@@ -91,7 +94,6 @@ public:
uint32 getFeatures() const;
uint16 getVersion() const;
Common::Platform getPlatform() const;
- void update_events();
private:
public:
@@ -102,9 +104,15 @@ public:
ScriptInterpreter *_script;
MusicPlayer *_music;
+ bool _quit;
+
+ uint16 _eventNum;
int _eventMouseX, _eventMouseY;
uint16 _eventKey;
+
int _soundRate;
+ bool _autoStopSound;
+
int _musicVolume;
// 2 = LGOP2, Manhole N&E
@@ -118,6 +126,11 @@ public:
int16 allocTimer();
void freeTimer(int16 timerNum);
+ const Common::String getTargetName() { return _targetName; }
+ Common::String getSavegameFilename(int16 saveNum);
+
+ void handleEvents();
+
};
} // End of namespace Made
diff --git a/engines/made/module.mk b/engines/made/module.mk
index 164e1bfba4..b3d004aa4c 100644
--- a/engines/made/module.mk
+++ b/engines/made/module.mk
@@ -10,10 +10,9 @@ MODULE_OBJS = \
redreader.o \
resource.o \
screen.o \
+ screenfx.o \
script.o \
- scriptfuncs_lgop2.o \
- scriptfuncs_mhne.o \
- scriptfuncs_rtz.o \
+ scriptfuncs.o \
sound.o
diff --git a/engines/made/pmvplayer.cpp b/engines/made/pmvplayer.cpp
index 06dc4e5aed..1a8ca9c50a 100644
--- a/engines/made/pmvplayer.cpp
+++ b/engines/made/pmvplayer.cpp
@@ -48,14 +48,17 @@ void PmvPlayer::play(const char *filename) {
readChunk(chunkType, chunkSize); // "MHED"
// TODO: Evaluate header
- //_fd->skip(0x3A);
uint frameDelay = _fd->readUint16LE();
_fd->skip(10);
uint soundFreq = _fd->readUint16LE();
- // FIXME: weird frequencies... (11127 or 22254)
- //if (soundFreq == 11127) soundFreq = 11025;
- //if (soundFreq == 22254) soundFreq = 22050;
+ // Note: There seem to be weird sound frequencies in PMV videos.
+ // Not sure why, but leaving those original frequencies intact
+ // results to sound being choppy. Therefore, we set them to more
+ // "common" values here (11025 instead of 11127 and 22050 instead
+ // of 22254)
+ if (soundFreq == 11127) soundFreq = 11025;
+ if (soundFreq == 22254) soundFreq = 22050;
int unk;
@@ -74,10 +77,12 @@ void PmvPlayer::play(const char *filename) {
uint32 frameCount = 0;
uint16 chunkCount = 0;
uint32 soundSize = 0;
- uint32 palChunkOfs = 0;
+ uint32 soundChunkOfs = 0, palChunkOfs = 0;
uint32 palSize = 0;
byte *frameData, *audioData, *soundData, *palData, *imageData;
bool firstTime = true;
+
+ uint32 soundStartTime = 0, skipFrames = 0;
uint32 frameNum;
uint16 width, height, cmdOffs, pixelOffs, maskOffs, lineSize;
@@ -89,6 +94,8 @@ void PmvPlayer::play(const char *filename) {
while (!_abort && !_fd->eof()) {
+ int32 frameTime = _vm->_system->getMillis();
+
readChunk(chunkType, chunkSize);
if (_fd->eof())
@@ -96,27 +103,34 @@ void PmvPlayer::play(const char *filename) {
frameData = new byte[chunkSize];
_fd->read(frameData, chunkSize);
+
+ soundChunkOfs = READ_LE_UINT32(frameData + 8);
+ palChunkOfs = READ_LE_UINT32(frameData + 16);
// Handle audio
- audioData = frameData + READ_LE_UINT32(frameData + 8) - 8;
- chunkSize = READ_LE_UINT16(audioData + 4);
- chunkCount = READ_LE_UINT16(audioData + 6);
+ if (soundChunkOfs) {
+
+ audioData = frameData + soundChunkOfs - 8;
+ chunkSize = READ_LE_UINT16(audioData + 4);
+ chunkCount = READ_LE_UINT16(audioData + 6);
- if (chunkCount > 50) break; // FIXME: this is a hack
+ debug(1, "chunkCount = %d; chunkSize = %d; total = %d\n", chunkCount, chunkSize, chunkCount * chunkSize);
- debug(2, "chunkCount = %d; chunkSize = %d\n", chunkCount, chunkSize);
+ if (chunkCount > 50) break; // FIXME: this is a hack
- soundSize = chunkCount * chunkSize;
- soundData = new byte[soundSize];
- decompressSound(audioData + 8, soundData, chunkSize, chunkCount);
- _audioStream->queueBuffer(soundData, soundSize);
+ soundSize = chunkCount * chunkSize;
+ soundData = new byte[soundSize];
+ decompressSound(audioData + 8, soundData, chunkSize, chunkCount);
+ _audioStream->queueBuffer(soundData, soundSize);
+
+ }
// Handle palette
- palChunkOfs = READ_LE_UINT32(frameData + 16);
if (palChunkOfs) {
palData = frameData + palChunkOfs - 8;
palSize = READ_LE_UINT32(palData + 4);
decompressPalette(palData + 8, _paletteRGB, palSize);
+ _vm->_screen->setRGBPalette(_paletteRGB);
}
// Handle video
@@ -138,24 +152,34 @@ void PmvPlayer::play(const char *filename) {
_surface->create(width, height, 1);
}
- decompressImage(imageData, *_surface, cmdOffs, pixelOffs, maskOffs, lineSize, frameNum > 0);
+ decompressMovieImage(imageData, *_surface, cmdOffs, pixelOffs, maskOffs, lineSize);
if (firstTime) {
_mixer->playInputStream(Audio::Mixer::kPlainSoundType, &_audioStreamHandle, _audioStream);
+ soundStartTime = g_system->getMillis();
+ skipFrames = 0;
firstTime = false;
}
- _vm->_screen->setRGBPalette(_paletteRGB);
handleEvents();
updateScreen();
- frameCount++;
-
delete[] frameData;
- while (_mixer->getSoundElapsedTime(_audioStreamHandle) < frameCount * frameDelay) {
- _vm->_system->delayMillis(10);
- }
+ if (skipFrames == 0) {
+ int32 waitTime = (frameCount * frameDelay) -
+ (g_system->getMillis() - soundStartTime) - (_vm->_system->getMillis() - frameTime);
+
+ if (waitTime < 0) {
+ skipFrames = -waitTime / frameDelay;
+ warning("Video A/V sync broken, skipping %d frame(s)", skipFrames + 1);
+ } else if (waitTime > 0)
+ g_system->delayMillis(waitTime);
+
+ } else
+ skipFrames--;
+
+ frameCount++;
}
@@ -188,8 +212,8 @@ void PmvPlayer::handleEvents() {
_abort = true;
break;
case Common::EVENT_QUIT:
- // TODO: Exit more gracefully
- g_system->quit();
+ _vm->_quit = true;
+ _abort = true;
break;
default:
break;
diff --git a/engines/made/resource.cpp b/engines/made/resource.cpp
index 7151f2424a..2cae8b276c 100644
--- a/engines/made/resource.cpp
+++ b/engines/made/resource.cpp
@@ -59,9 +59,9 @@ void PictureResource::load(byte *source, int size) {
Common::MemoryReadStream *sourceS = new Common::MemoryReadStream(source, size);
_hasPalette = (sourceS->readByte() != 0);
- sourceS->readByte();
- sourceS->readByte();
- sourceS->readByte();
+ byte cmdFlags = sourceS->readByte();
+ byte pixelFlags = sourceS->readByte();
+ byte maskFlags = sourceS->readByte();
uint16 cmdOffs = sourceS->readUint16LE();
uint16 pixelOffs = sourceS->readUint16LE();
uint16 maskOffs = sourceS->readUint16LE();
@@ -69,7 +69,11 @@ void PictureResource::load(byte *source, int size) {
/*uint16 u = */sourceS->readUint16LE();
uint16 width = sourceS->readUint16LE();
uint16 height = sourceS->readUint16LE();
-
+
+ if (cmdFlags || pixelFlags || maskFlags) {
+ warning("PictureResource::load() Graphic has flags set");
+ }
+
_paletteColorCount = (cmdOffs - 18) / 3; // 18 = sizeof header
debug(2, "width = %d; height = %d\n", width, height);
@@ -82,7 +86,7 @@ void PictureResource::load(byte *source, int size) {
_picture = new Graphics::Surface();
_picture->create(width, height, 1);
- decompressImage(source, *_picture, cmdOffs, pixelOffs, maskOffs, lineSize);
+ decompressImage(source, *_picture, cmdOffs, pixelOffs, maskOffs, lineSize, cmdFlags, pixelFlags, maskFlags);
delete sourceS;
@@ -94,7 +98,8 @@ AnimationResource::AnimationResource() {
}
AnimationResource::~AnimationResource() {
- // TODO: Free anim frames
+ for (uint i = 0; i < _frames.size(); i++)
+ delete _frames[i];
}
void AnimationResource::load(byte *source, int size) {
@@ -136,7 +141,7 @@ void AnimationResource::load(byte *source, int size) {
Graphics::Surface *frame = new Graphics::Surface();
frame->create(frameWidth, frameHeight, 1);
- decompressImage(source + frameOffs, *frame, cmdOffs, pixelOffs, maskOffs, lineSize, _flags & 1);
+ decompressImage(source + frameOffs, *frame, cmdOffs, pixelOffs, maskOffs, lineSize, 0, 0, 0, _flags & 1);
_frames.push_back(frame);
@@ -372,7 +377,7 @@ bool ProjectReader::loadResource(ResourceSlot *slot, byte *&buffer, uint32 &size
if (slot && slot->size > 0) {
size = slot->size - 62;
buffer = new byte[size];
- debug(2, "ProjectReader::loadResource() %08X\n", slot->offs + 62); fflush(stdout);
+ debug(2, "ProjectReader::loadResource() %08X", slot->offs + 62);
_fd->seek(slot->offs + 62);
_fd->read(buffer, size);
return true;
@@ -384,8 +389,7 @@ bool ProjectReader::loadResource(ResourceSlot *slot, byte *&buffer, uint32 &size
ResourceSlot *ProjectReader::getResourceSlot(uint32 resType, uint index) {
ResourceSlots *slots = _resSlots[resType];
if (index >= 1 && index < slots->size()) {
- ResourceSlot *slot = &slots->operator[](index);
- return slot;
+ return &slots->operator[](index);
} else {
return NULL;
}
@@ -398,22 +402,20 @@ Resource *ProjectReader::getResourceFromCache(ResourceSlot *slot) {
}
void ProjectReader::addResourceToCache(ResourceSlot *slot, Resource *res) {
- if (_cacheCount >= kMaxResourceCacheCount) {
+ if (_cacheCount >= kMaxResourceCacheCount)
purgeCache();
- }
slot->res = res;
- slot->refCount = 0;
+ slot->refCount = 1;
_cacheCount++;
}
void ProjectReader::tossResourceFromCache(ResourceSlot *slot) {
- if (slot->res) {
+ if (slot->res)
slot->refCount--;
- }
}
void ProjectReader::purgeCache() {
- printf("ProjectReader::purgeCache()\n");
+ debug(2, "ProjectReader::purgeCache()");
for (ResMap::const_iterator resTypeIter = _resSlots.begin(); resTypeIter != _resSlots.end(); ++resTypeIter) {
ResourceSlots *slots = (*resTypeIter)._value;
for (ResourceSlots::iterator slotIter = slots->begin(); slotIter != slots->end(); ++slotIter) {
diff --git a/engines/made/resource.h b/engines/made/resource.h
index be85561318..cb6e0b65f4 100644
--- a/engines/made/resource.h
+++ b/engines/made/resource.h
@@ -35,7 +35,7 @@
namespace Made {
-const int kMaxResourceCacheCount = 200;
+const int kMaxResourceCacheCount = 100;
enum ResourceType {
kResARCH = MKID_BE('ARCH'),
@@ -81,7 +81,14 @@ public:
~AnimationResource();
void load(byte *source, int size);
int getCount() const { return _frames.size(); }
- Graphics::Surface *getFrame(int index) const { return _frames[index]; }
+ Graphics::Surface *getFrame(int index) const {
+ if ((uint)index < _frames.size()) {
+ return _frames[index];
+ } else {
+ warning("getFrame: Tried to obtain invalid frame %i, array has %i frames", index, _frames.size());
+ return _frames[_frames.size() - 1];
+ }
+ }
uint16 getFlags() const { return _flags; }
int16 getWidth() const { return _width; }
int16 getHeight() const { return _height; }
diff --git a/engines/made/screen.cpp b/engines/made/screen.cpp
index 74053e70a2..cecd0c8968 100644
--- a/engines/made/screen.cpp
+++ b/engines/made/screen.cpp
@@ -32,20 +32,27 @@ namespace Made {
Screen::Screen(MadeEngine *vm) : _vm(vm) {
- _screen1 = new Graphics::Surface();
- _screen1->create(320, 200, 1);
- _screen2 = new Graphics::Surface();
- _screen2->create(320, 200, 1);
-
- _clipInfo1.x = _clipInfo2.x = 0;
- _clipInfo1.y = _clipInfo2.y = 0;
- _clipInfo1.w = _clipInfo2.w = 320;
- _clipInfo1.h = _clipInfo2.h = 200;
-
- _clipInfo1.destSurface = _screen1;
- _clipInfo2.destSurface = _screen2;
- _clipArea.destSurface = _screen2;
-
+ _backgroundScreen = new Graphics::Surface();
+ _backgroundScreen->create(320, 200, 1);
+
+ _workScreen = new Graphics::Surface();
+ _workScreen->create(320, 200, 1);
+
+ _backgroundScreenDrawCtx.clipRect = Common::Rect(320, 200);
+ _workScreenDrawCtx.clipRect = Common::Rect(320, 200);
+
+ _backgroundScreenDrawCtx.destSurface = _backgroundScreen;
+ _workScreenDrawCtx.destSurface = _workScreen;
+ _clipArea.destSurface = _workScreen;
+
+ // Screen mask is only needed in v2 games
+ if (_vm->getGameID() != GID_RTZ) {
+ _screenMask = new Graphics::Surface();
+ _screenMask->create(320, 200, 1);
+ _maskDrawCtx.clipRect = Common::Rect(320, 200);
+ _maskDrawCtx.destSurface = _screenMask;
+ }
+
for (int i = 0; i <= 3; i++)
_excludeClipAreaEnabled[i] = false;
@@ -62,8 +69,10 @@ Screen::Screen(MadeEngine *vm) : _vm(vm) {
_ground = 1;
_clip = 0;
_exclude = 0;
+ _mask = 0;
_visualEffectNum = 0;
+ _fx = new ScreenEffects(this);
_textX = 0;
_textY = 0;
@@ -74,64 +83,130 @@ Screen::Screen(MadeEngine *vm) : _vm(vm) {
_textRect.bottom = 200;
_font = NULL;
_currentFontNum = 0;
- _fontDrawCtx.x = 0;
- _fontDrawCtx.y = 0;
- _fontDrawCtx.w = 320;
- _fontDrawCtx.h = 200;
- _fontDrawCtx.destSurface = _screen1;
+ _fontDrawCtx.clipRect = Common::Rect(320, 200);
+ _fontDrawCtx.destSurface = _backgroundScreen;
clearChannels();
}
Screen::~Screen() {
- delete _screen1;
- delete _screen2;
+ delete _backgroundScreen;
+ delete _workScreen;
+ if (_vm->getGameID() != GID_RTZ)
+ delete _screenMask;
+ delete _fx;
}
void Screen::clearScreen() {
- _screen1->fillRect(Common::Rect(0, 0, 320, 200), 0);
- _screen2->fillRect(Common::Rect(0, 0, 320, 200), 0);
+ _backgroundScreen->fillRect(Common::Rect(0, 0, 320, 200), 0);
+ _workScreen->fillRect(Common::Rect(0, 0, 320, 200), 0);
+ if (_vm->getGameID() != GID_RTZ)
+ _screenMask->fillRect(Common::Rect(0, 0, 320, 200), 0);
+ _mask = 0;
_needPalette = true;
}
-void Screen::drawSurface(Graphics::Surface *sourceSurface, int x, int y, const ClipInfo &clipInfo) {
+void Screen::setExcludeArea(uint16 x1, uint16 y1, uint16 x2, uint16 y2) {
+
+ _excludeClipAreaEnabled[0] = false;
+ _excludeClipAreaEnabled[1] = false;
+ _excludeClipAreaEnabled[2] = false;
+ _excludeClipAreaEnabled[3] = false;
+
+ if (x1 == 0 && y1 == 0 && x2 == 0 && y2 == 0) {
+ _excludeClipArea[0].clipRect = Common::Rect(320, 200);
+ _excludeClipAreaEnabled[0] = true;
+ return;
+ }
+
+ if (y1 > 0 && y2 > 0) {
+ _excludeClipArea[0].clipRect = Common::Rect(320, y1);
+ _excludeClipAreaEnabled[0] = true;
+ }
+
+ if (y1 < 200 && y2 < 200) {
+ _excludeClipArea[1].clipRect = Common::Rect(0, y2, 320, 200);
+ _excludeClipAreaEnabled[1] = true;
+ }
+
+ if (x1 > 0 && x2 > 0) {
+ _excludeClipArea[2].clipRect = Common::Rect(0, y1, x1, y2);
+ _excludeClipAreaEnabled[2] = true;
+ }
+
+ if (x1 < 320 && x2 < 320) {
+ _excludeClipArea[3].clipRect = Common::Rect(x2, y1, 320, y2);
+ _excludeClipAreaEnabled[3] = true;
+ }
+
+}
+
+void Screen::drawSurface(Graphics::Surface *sourceSurface, int x, int y, int16 flipX, int16 flipY, int16 mask, const ClipInfo &clipInfo) {
- byte *source, *dest;
+ byte *source, *dest, *maskp = 0;
int startX = 0;
int startY = 0;
int clipWidth = sourceSurface->w;
int clipHeight = sourceSurface->h;
- if (x < 0) {
- startX = -x;
+ if (x < clipInfo.clipRect.left) {
+ startX = clipInfo.clipRect.left - x;
clipWidth -= startX;
- x = 0;
+ x = clipInfo.clipRect.left;
}
- if (y < 0) {
- startY = -y;
+ if (y < clipInfo.clipRect.top) {
+ startY = clipInfo.clipRect.top - y;
clipHeight -= startY;
- y = 0;
+ y = clipInfo.clipRect.top;
}
- if (x + clipWidth > clipInfo.x + clipInfo.w) {
- clipWidth = clipInfo.x + clipInfo.w - x;
+ if (x + clipWidth > clipInfo.clipRect.right) {
+ clipWidth = clipInfo.clipRect.right - x;
}
- if (y + clipHeight > clipInfo.y + clipInfo.h) {
- clipHeight = clipInfo.y + clipInfo.h - y;
+ if (y + clipHeight > clipInfo.clipRect.bottom) {
+ clipHeight = clipInfo.clipRect.bottom - y;
}
source = (byte*)sourceSurface->getBasePtr(startX, startY);
dest = (byte*)clipInfo.destSurface->getBasePtr(x, y);
+ if (_vm->getGameID() != GID_RTZ)
+ maskp = (byte*)_maskDrawCtx.destSurface->getBasePtr(x, y);
+
+ int32 sourcePitch, linePtrAdd;
+ byte *linePtr;
+
+ if (flipX) {
+ linePtrAdd = -1;
+ } else {
+ linePtrAdd = 1;
+ }
+
+ if (flipY) {
+ sourcePitch = -sourceSurface->pitch;
+ source += (clipHeight - 1) * sourceSurface->pitch;
+ } else {
+ sourcePitch = sourceSurface->pitch;
+ }
for (int16 yc = 0; yc < clipHeight; yc++) {
+ if (flipX) {
+ linePtr = source + sourceSurface->w;
+ } else {
+ linePtr = source;
+ }
for (int16 xc = 0; xc < clipWidth; xc++) {
- if (source[xc])
- dest[xc] = source[xc];
+ if (*linePtr && (_vm->getGameID() == GID_RTZ || (mask == 0 || maskp[xc] == 0))) {
+ if (*linePtr)
+ dest[xc] = *linePtr;
+ }
+ linePtr += linePtrAdd;
}
- source += sourceSurface->pitch;
+ source += sourcePitch;
dest += clipInfo.destSurface->pitch;
+ if (_vm->getGameID() != GID_RTZ)
+ maskp += _maskDrawCtx.destSurface->pitch;
}
}
@@ -191,11 +266,16 @@ uint16 Screen::setChannelLocation(uint16 channelIndex, int16 x, int16 y) {
uint16 Screen::setChannelContent(uint16 channelIndex, uint16 index) {
if (channelIndex < 1 || channelIndex >= 100 || _channels[channelIndex - 1].type == 0)
return 0;
- //debug(2, "setChannelContent(%d, %04X)\n", channelIndex, index); fflush(stdout); g_system->delayMillis(5000);
_channels[channelIndex - 1].index = index;
return updateChannel(channelIndex - 1) + 1;
}
+void Screen::setChannelUseMask(uint16 channelIndex) {
+ if (channelIndex < 1 || channelIndex >= 100)
+ return;
+ _channels[channelIndex - 1].mask = _mask;
+}
+
void Screen::drawSpriteChannels(const ClipInfo &clipInfo, int16 includeStateMask, int16 excludeStateMask) {
for (int i = 0; i <= 3; i++)
@@ -208,8 +288,8 @@ void Screen::drawSpriteChannels(const ClipInfo &clipInfo, int16 includeStateMask
debug(2, "drawSpriteChannels() i = %d\n", i);
if (((_channels[i].state & includeStateMask) == includeStateMask) && (_channels[i].state & excludeStateMask) == 0) {
- uint16 flag1 = _channels[i].state & 0x10;
- uint16 flag2 = _channels[i].state & 0x20;
+ int16 flipX = _channels[i].state & 0x10;
+ int16 flipY = _channels[i].state & 0x20;
debug(2, "drawSpriteChannels() type = %d; index = %04X\n", _channels[i].type, _channels[i].index);
@@ -217,38 +297,38 @@ void Screen::drawSpriteChannels(const ClipInfo &clipInfo, int16 includeStateMask
case 1: // drawFlex
if (_channels[i].state & 4) {
- drawFlex(_channels[i].index, _channels[i].x, _channels[i].y, flag1, flag2, _clipArea);
+ drawFlex(_channels[i].index, _channels[i].x, _channels[i].y, flipX, flipY, _channels[i].mask, _clipArea);
} else if (_channels[i].state & 8) {
for (int excludeIndex = 0; excludeIndex < 4; excludeIndex++) {
if (_excludeClipAreaEnabled[excludeIndex]) {
- drawFlex(_channels[i].index, _channels[i].x, _channels[i].y, flag1, flag2, _excludeClipArea[excludeIndex]);
+ drawFlex(_channels[i].index, _channels[i].x, _channels[i].y, flipX, flipY, _channels[i].mask, _excludeClipArea[excludeIndex]);
}
}
} else {
- drawFlex(_channels[i].index, _channels[i].x, _channels[i].y, flag1, flag2, clipInfo);
+ drawFlex(_channels[i].index, _channels[i].x, _channels[i].y, flipX, flipY, _channels[i].mask, clipInfo);
}
break;
-
+
case 2: // drawObjectText
printObjectText(_channels[i].index, _channels[i].x, _channels[i].y, _channels[i].fontNum, _channels[i].textColor, _channels[i].outlineColor, clipInfo);
break;
case 3: // drawAnimFrame
if (_channels[i].state & 4) {
- drawAnimFrame(_channels[i].index, _channels[i].x, _channels[i].y, _channels[i].frameNum, flag1, flag2, _clipArea);
+ drawAnimFrame(_channels[i].index, _channels[i].x, _channels[i].y, _channels[i].frameNum, flipX, flipY, _clipArea);
} else if (_channels[i].state & 8) {
for (int excludeIndex = 0; excludeIndex < 4; excludeIndex++) {
if (_excludeClipAreaEnabled[excludeIndex]) {
- drawAnimFrame(_channels[i].index, _channels[i].x, _channels[i].y, _channels[i].frameNum, flag1, flag2, _excludeClipArea[excludeIndex]);
+ drawAnimFrame(_channels[i].index, _channels[i].x, _channels[i].y, _channels[i].frameNum, flipX, flipY, _excludeClipArea[excludeIndex]);
}
}
} else {
- drawAnimFrame(_channels[i].index, _channels[i].x, _channels[i].y, _channels[i].frameNum, flag1, flag2, clipInfo);
+ drawAnimFrame(_channels[i].index, _channels[i].x, _channels[i].y, _channels[i].frameNum, flipX, flipY, clipInfo);
}
break;
case 4: // drawMenuText
- // TODO
+ // Never used in any game
break;
default:
@@ -265,12 +345,14 @@ void Screen::drawSpriteChannels(const ClipInfo &clipInfo, int16 includeStateMask
void Screen::updateSprites() {
// TODO: This needs some more work, dirty rectangles are currently not used
- memcpy(_screen2->pixels, _screen1->pixels, 64000);
+ memcpy(_workScreen->pixels, _backgroundScreen->pixels, 64000);
- drawSpriteChannels(_clipInfo1, 3, 0);
- drawSpriteChannels(_clipInfo2, 1, 2);
+ drawSpriteChannels(_backgroundScreenDrawCtx, 3, 0);
+ drawSpriteChannels(_workScreenDrawCtx, 1, 2);
- _vm->_system->copyRectToScreen((const byte*)_screen2->pixels, _screen2->pitch, 0, 0, _screen2->w, _screen2->h);
+ _vm->_system->copyRectToScreen((const byte*)_workScreen->pixels, _workScreen->pitch, 0, 0, _workScreen->w, _workScreen->h);
+
+ _vm->_system->updateScreen();
}
@@ -278,11 +360,12 @@ void Screen::clearChannels() {
for (uint16 i = 0; i < ARRAYSIZE(_channels); i++) {
_channels[i].type = 0;
_channels[i].index = 0;
+ _channels[i].mask = 0;
}
_channelsUsedCount = 0;
}
-uint16 Screen::drawFlex(uint16 flexIndex, int16 x, int16 y, uint16 flag1, uint16 flag2, const ClipInfo &clipInfo) {
+uint16 Screen::drawFlex(uint16 flexIndex, int16 x, int16 y, int16 flipX, int16 flipY, int16 mask, const ClipInfo &clipInfo) {
if (flexIndex == 0)
return 0;
@@ -290,7 +373,7 @@ uint16 Screen::drawFlex(uint16 flexIndex, int16 x, int16 y, uint16 flag1, uint16
PictureResource *flex = _vm->_res->getPicture(flexIndex);
Graphics::Surface *sourceSurface = flex->getPicture();
- drawSurface(sourceSurface, x, y, clipInfo);
+ drawSurface(sourceSurface, x, y, flipX, flipY, mask, clipInfo);
// Palette is set in showPage
if (flex->hasPalette() && !_paletteLock && _needPalette) {
@@ -307,7 +390,7 @@ uint16 Screen::drawFlex(uint16 flexIndex, int16 x, int16 y, uint16 flag1, uint16
return 0;
}
-void Screen::drawAnimFrame(uint16 animIndex, int16 x, int16 y, int16 frameNum, uint16 flag1, uint16 flag2, const ClipInfo &clipInfo) {
+void Screen::drawAnimFrame(uint16 animIndex, int16 x, int16 y, int16 frameNum, int16 flipX, int16 flipY, const ClipInfo &clipInfo) {
if (frameNum < 0)
return;
@@ -315,24 +398,29 @@ void Screen::drawAnimFrame(uint16 animIndex, int16 x, int16 y, int16 frameNum, u
AnimationResource *anim = _vm->_res->getAnimation(animIndex);
Graphics::Surface *sourceSurface = anim->getFrame(frameNum);
- drawSurface(sourceSurface, x, y, clipInfo);
+ drawSurface(sourceSurface, x, y, flipX, flipY, 0, clipInfo);
_vm->_res->freeResource(anim);
}
-uint16 Screen::drawPic(uint16 index, int16 x, int16 y, uint16 flag1, uint16 flag2) {
- drawFlex(index, x, y, flag1, flag2, _clipInfo1);
+uint16 Screen::drawPic(uint16 index, int16 x, int16 y, int16 flipX, int16 flipY) {
+ drawFlex(index, x, y, flipX, flipY, 0, _backgroundScreenDrawCtx);
return 0;
}
-uint16 Screen::drawAnimPic(uint16 animIndex, int16 x, int16 y, int16 frameNum, uint16 flag1, uint16 flag2) {
- drawAnimFrame(animIndex, x, y, frameNum, flag1, flag2, _clipInfo1);
+uint16 Screen::drawMask(uint16 index, int16 x, int16 y) {
+ drawFlex(index, x, y, 0, 0, 0, _maskDrawCtx);
+ return 0;
+}
+
+uint16 Screen::drawAnimPic(uint16 animIndex, int16 x, int16 y, int16 frameNum, int16 flipX, int16 flipY) {
+ drawAnimFrame(animIndex, x, y, frameNum, flipX, flipY, _backgroundScreenDrawCtx);
return 0;
}
void Screen::addSprite(uint16 spriteIndex) {
bool oldScreenLock = _screenLock;
- drawFlex(spriteIndex, 0, 0, 0, 0, _clipInfo1);
+ drawFlex(spriteIndex, 0, 0, 0, 0, 0, _backgroundScreenDrawCtx);
_screenLock = oldScreenLock;
}
@@ -342,7 +430,7 @@ uint16 Screen::drawSprite(uint16 flexIndex, int16 x, int16 y) {
uint16 Screen::placeSprite(uint16 channelIndex, uint16 flexIndex, int16 x, int16 y) {
- debug(2, "placeSprite(%d, %04X, %d, %d)\n", channelIndex, flexIndex, x, y); fflush(stdout);
+ debug(2, "placeSprite(%d, %04X, %d, %d)\n", channelIndex, flexIndex, x, y);
if (channelIndex < 1 || channelIndex >= 100)
return 0;
@@ -379,8 +467,8 @@ uint16 Screen::placeSprite(uint16 channelIndex, uint16 flexIndex, int16 x, int16
_channels[channelIndex].y1 = y1;
_channels[channelIndex].x2 = x2;
_channels[channelIndex].y2 = y2;
- _channels[channelIndex].area = (x2 - x2) * (y2 - y1);
-
+ _channels[channelIndex].area = (x2 - x1) * (y2 - y1);
+
if (_channelsUsedCount <= channelIndex)
_channelsUsedCount = channelIndex + 1;
@@ -432,7 +520,7 @@ uint16 Screen::placeAnim(uint16 channelIndex, uint16 animIndex, int16 x, int16 y
_channels[channelIndex].y1 = y1;
_channels[channelIndex].x2 = x2;
_channels[channelIndex].y2 = y2;
- _channels[channelIndex].area = (x2 - x2) * (y2 - y1);
+ _channels[channelIndex].area = (x2 - x1) * (y2 - y1);
if (_channelsUsedCount <= channelIndex)
_channelsUsedCount = channelIndex + 1;
@@ -462,17 +550,6 @@ int16 Screen::getAnimFrame(uint16 channelIndex) {
return _channels[channelIndex - 1].frameNum;
}
-int16 Screen::getAnimFrameCount(uint16 animIndex) {
- int16 frameCount = 0;
- AnimationResource *anim = _vm->_res->getAnimation(animIndex);
- if (anim) {
- frameCount = anim->getCount();
- _vm->_res->freeResource(anim);
- }
- return frameCount;
-}
-
-
uint16 Screen::placeText(uint16 channelIndex, uint16 textObjectIndex, int16 x, int16 y, uint16 fontNum, int16 textColor, int16 outlineColor) {
if (channelIndex < 1 || channelIndex >= 100 || textObjectIndex == 0 || fontNum == 0)
@@ -525,7 +602,7 @@ uint16 Screen::placeText(uint16 channelIndex, uint16 textObjectIndex, int16 x, i
_channels[channelIndex].y1 = y1;
_channels[channelIndex].x2 = x2;
_channels[channelIndex].y2 = y2;
- _channels[channelIndex].area = (x2 - x2) * (y2 - y1);
+ _channels[channelIndex].area = (x2 - x1) * (y2 - y1);
if (_channelsUsedCount <= channelIndex)
_channelsUsedCount = channelIndex + 1;
@@ -536,18 +613,17 @@ uint16 Screen::placeText(uint16 channelIndex, uint16 textObjectIndex, int16 x, i
void Screen::show() {
// TODO
-
+
if (_screenLock)
return;
- drawSpriteChannels(_clipInfo1, 3, 0);
- memcpy(_screen2->pixels, _screen1->pixels, 64000);
- drawSpriteChannels(_clipInfo2, 1, 2);
+ drawSpriteChannels(_backgroundScreenDrawCtx, 3, 0);
+ memcpy(_workScreen->pixels, _backgroundScreen->pixels, 64000);
+ drawSpriteChannels(_workScreenDrawCtx, 1, 2);
+
+ _fx->run(_visualEffectNum, _workScreen, _palette, _newPalette, _paletteColorCount);
+ _visualEffectNum = 0;
- // TODO: Implement visual effects (palette fading etc.)
- if (!_paletteLock)
- setRGBPalette(_palette, 0, _paletteColorCount);
- _vm->_system->copyRectToScreen((const byte*)_screen2->pixels, _screen2->pitch, 0, 0, _screen2->w, _screen2->h);
_vm->_system->updateScreen();
if (!_paletteInitialized) {
@@ -559,19 +635,7 @@ void Screen::show() {
}
void Screen::flash(int flashCount) {
- int palSize = _paletteColorCount * 3;
- if (flashCount < 1)
- flashCount = 1;
- for (int i = 0; i < palSize; i++)
- _fxPalette[i] = CLIP<byte>(255 - _palette[i], 0, 255);
- while (flashCount--) {
- setRGBPalette(_fxPalette, 0, _paletteColorCount);
- _vm->_system->updateScreen();
- _vm->_system->delayMillis(30);
- setRGBPalette(_palette, 0, _paletteColorCount);
- _vm->_system->updateScreen();
- _vm->_system->delayMillis(30);
- }
+ _fx->flash(flashCount, _palette, _paletteColorCount);
}
void Screen::setFont(int16 fontNum) {
@@ -588,7 +652,7 @@ void Screen::printChar(uint c, int16 x, int16 y, byte color) {
if (!_font)
return;
- int height = _font->getHeight();
+ uint width = 8, height = _font->getHeight();
byte *charData = _font->getChar(c);
if (!charData)
@@ -596,10 +660,10 @@ void Screen::printChar(uint c, int16 x, int16 y, byte color) {
byte p;
byte *dest = (byte*)_fontDrawCtx.destSurface->getBasePtr(x, y);
-
- for (int16 yc = 0; yc < height; yc++) {
+
+ for (uint yc = 0; yc < height; yc++) {
p = charData[yc];
- for (int16 xc = 0; xc < 8; xc++) {
+ for (uint xc = 0; xc < width; xc++) {
if (p & 0x80)
dest[xc] = color;
p <<= 1;
@@ -690,7 +754,7 @@ void Screen::printText(const char *text) {
}
void Screen::printTextEx(const char *text, int16 x, int16 y, int16 fontNum, int16 textColor, int16 outlineColor, const ClipInfo &clipInfo) {
- if (*text == 0 || x == 0 || y == 0)
+ if (*text == 0 || x < 0 || y < 0)
return;
int16 oldFontNum = _currentFontNum;
@@ -728,5 +792,48 @@ int16 Screen::getTextWidth(int16 fontNum, const char *text) {
return _font->getTextWidth(text);
}
+Graphics::Surface *Screen::lockScreen() {
+ return _vm->_system->lockScreen();
+}
+
+void Screen::unlockScreen() {
+ _vm->_system->unlockScreen();
+}
+
+void Screen::showWorkScreen() {
+ _vm->_system->copyRectToScreen((const byte*)_workScreen->pixels, _workScreen->pitch, 0, 0, _workScreen->w, _workScreen->h);
+}
+
+void Screen::updateScreenAndWait(int delay) {
+ _vm->_system->updateScreen();
+ _vm->_system->delayMillis(delay);
+}
+
+int16 Screen::addToSpriteList(int16 index, int16 xofs, int16 yofs) {
+ SpriteListItem item;
+ item.index = index;
+ item.xofs = xofs;
+ item.yofs = yofs;
+ _spriteList.push_back(item);
+ return _spriteList.size();
+}
+
+SpriteListItem Screen::getFromSpriteList(int16 index) {
+ if (((uint) index) > _spriteList.size()) {
+ SpriteListItem emptyItem;
+ emptyItem.index = 0;
+ return emptyItem;
+ } else {
+ return _spriteList[index - 1];
+ }
+}
+
+void Screen::clearSpriteList() {
+ _spriteList.clear();
+}
+
+void Screen::setDefaultMouseCursor() {
+ CursorMan.replaceCursor(defaultMouseCursor, 16, 16, 9, 2, 0);
+}
} // End of namespace Made
diff --git a/engines/made/screen.h b/engines/made/screen.h
index 0ca28086f9..5d55085e5c 100644
--- a/engines/made/screen.h
+++ b/engines/made/screen.h
@@ -28,10 +28,13 @@
#include "common/endian.h"
#include "common/util.h"
+#include "common/rect.h"
#include "graphics/surface.h"
+#include "graphics/cursorman.h"
#include "made/resource.h"
+#include "made/screenfx.h"
namespace Made {
@@ -46,15 +49,39 @@ struct SpriteChannel {
uint16 fontNum;
int16 textColor, outlineColor;
int16 frameNum;
+ int16 mask;
};
struct ClipInfo {
- uint16 x, y, w, h;
+ Common::Rect clipRect;
Graphics::Surface *destSurface;
};
+struct SpriteListItem {
+ int16 index, xofs, yofs;
+};
+
class MadeEngine;
+static const byte defaultMouseCursor[256] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 1, 15, 15, 1, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 1, 15, 15, 1, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 1, 15, 15, 1, 0, 0, 0, 0, 0,
+ 0, 1, 1, 1, 1, 1, 1, 1, 15, 15, 1, 0, 0, 0, 0, 0,
+ 1, 1, 15, 1, 15, 1, 15, 1, 15, 15, 1, 0, 0, 0, 0, 0,
+ 1, 15, 15, 1, 15, 1, 15, 1, 15, 15, 1, 0, 0, 0, 0, 0,
+ 1, 15, 15, 15, 15, 15, 15, 15, 15, 15, 1, 0, 1, 1, 1, 0,
+ 1, 15, 15, 15, 15, 15, 15, 15, 15, 15, 1, 1, 15, 15, 15, 1,
+ 1, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 1, 1, 1,
+ 1, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 1, 1, 0, 0,
+ 1, 1, 15, 15, 15, 15, 15, 15, 15, 15, 15, 1, 1, 0, 0, 0,
+ 0, 1, 1, 15, 15, 15, 15, 15, 15, 15, 1, 1, 0, 0, 0, 0,
+ 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+};
+
class Screen {
public:
Screen(MadeEngine *vm);
@@ -62,16 +89,27 @@ public:
void clearScreen();
- void drawSurface(Graphics::Surface *sourceSurface, int x, int y, const ClipInfo &clipInfo);
+ void drawSurface(Graphics::Surface *sourceSurface, int x, int y, int16 flipX, int16 flipY, int16 mask, const ClipInfo &clipInfo);
+
void loadRGBPalette(byte *palRGB, int count = 256);
void setRGBPalette(byte *palRGB, int start = 0, int count = 256);
bool isPaletteLocked() { return _paletteLock; }
- void setScreenLock(bool lock) { _screenLock = lock; }
void setPaletteLock(bool lock) { _paletteLock = lock; }
+ bool isScreenLocked() { return _screenLock; }
+ void setScreenLock(bool lock) { _screenLock = lock; }
void setVisualEffectNum(int visualEffectNum) { _visualEffectNum = visualEffectNum; }
- void setClip(uint16 clip) { _clip = clip; }
- void setExclude(uint16 exclude) { _exclude = exclude; }
- void setGround(uint16 ground) { _ground = ground; }
+
+ void setClipArea(uint16 x1, uint16 y1, uint16 x2, uint16 y2) {
+ _clipArea.clipRect = Common::Rect(x1, y1, x2, y2);
+ }
+
+ void setExcludeArea(uint16 x1, uint16 y1, uint16 x2, uint16 y2);
+
+ void setClip(int16 clip) { _clip = clip; }
+ void setExclude(int16 exclude) { _exclude = exclude; }
+ void setGround(int16 ground) { _ground = ground; }
+ void setMask(int16 mask) { _mask = mask; }
+
void setTextColor(int16 color) { _textColor = color; }
void setTextRect(const Common::Rect &textRect) {
@@ -99,6 +137,11 @@ public:
_textY = y;
}
+ void homeText() {
+ _textX = _textRect.left;
+ _textY = _textRect.top;
+ }
+
uint16 updateChannel(uint16 channelIndex);
void deleteChannel(uint16 channelIndex);
int16 getChannelType(uint16 channelIndex);
@@ -106,15 +149,19 @@ public:
void setChannelState(uint16 channelIndex, int16 state);
uint16 setChannelLocation(uint16 channelIndex, int16 x, int16 y);
uint16 setChannelContent(uint16 channelIndex, uint16 index);
+ void setChannelUseMask(uint16 channelIndex);
void drawSpriteChannels(const ClipInfo &clipInfo, int16 includeStateMask, int16 excludeStateMask);
void updateSprites();
void clearChannels();
- uint16 drawFlex(uint16 flexIndex, int16 x, int16 y, uint16 flag1, uint16 flag2, const ClipInfo &clipInfo);
- void drawAnimFrame(uint16 animIndex, int16 x, int16 y, int16 frameNum, uint16 flag1, uint16 flag2, const ClipInfo &clipInfo);
+ uint16 drawFlex(uint16 flexIndex, int16 x, int16 y, int16 flipX, int16 flipY, int16 mask, const ClipInfo &clipInfo);
+
+ void drawAnimFrame(uint16 animIndex, int16 x, int16 y, int16 frameNum, int16 flipX, int16 flipY, const ClipInfo &clipInfo);
- uint16 drawPic(uint16 index, int16 x, int16 y, uint16 flag1, uint16 flag2);
- uint16 drawAnimPic(uint16 animIndex, int16 x, int16 y, int16 frameNum, uint16 flag1, uint16 flag2);
+ uint16 drawPic(uint16 index, int16 x, int16 y, int16 flipX, int16 flipY);
+ uint16 drawMask(uint16 index, int16 x, int16 y);
+
+ uint16 drawAnimPic(uint16 animIndex, int16 x, int16 y, int16 frameNum, int16 flipX, int16 flipY);
void addSprite(uint16 spriteIndex);
@@ -124,14 +171,12 @@ public:
uint16 placeAnim(uint16 channelIndex, uint16 animIndex, int16 x, int16 y, int16 frameNum);
int16 setAnimFrame(uint16 channelIndex, int16 frameNum);
int16 getAnimFrame(uint16 channelIndex);
- // TODO: Move to script function
- int16 getAnimFrameCount(uint16 animIndex);
uint16 placeText(uint16 channelIndex, uint16 textObjectIndex, int16 x, int16 y, uint16 fontNum, int16 textColor, int16 outlineColor);
void show();
void flash(int count);
-
+
void setFont(int16 fontNum);
void printChar(uint c, int16 x, int16 y, byte color);
void printText(const char *text);
@@ -139,15 +184,27 @@ public:
void printObjectText(int16 objectIndex, int16 x, int16 y, int16 fontNum, int16 textColor, int16 outlineColor, const ClipInfo &clipInfo);
int16 getTextWidth(int16 fontNum, const char *text);
+ // Interface functions for the screen effects class
+ Graphics::Surface *lockScreen();
+ void unlockScreen();
+ void showWorkScreen();
+ void updateScreenAndWait(int delay);
+
+ int16 addToSpriteList(int16 index, int16 xofs, int16 yofs);
+ SpriteListItem getFromSpriteList(int16 index);
+ void clearSpriteList();
+
+ void setDefaultMouseCursor();
protected:
MadeEngine *_vm;
+ ScreenEffects *_fx;
bool _screenLock;
bool _paletteLock;
byte _screenPalette[256 * 4];
- byte _palette[768], _newPalette[768], _fxPalette[768];
+ byte _palette[768], _newPalette[768];
int _paletteColorCount, _oldPaletteColorCount;
bool _paletteInitialized, _needPalette;
int16 _textColor;
@@ -160,17 +217,20 @@ protected:
FontResource *_font;
ClipInfo _fontDrawCtx;
- uint16 _clip, _exclude, _ground;
+ int16 _clip, _exclude, _ground, _mask;
int _visualEffectNum;
- Graphics::Surface *_screen1, *_screen2;
- ClipInfo _clipArea, _clipInfo1, _clipInfo2;
+ Graphics::Surface *_backgroundScreen, *_workScreen, *_screenMask;
+ ClipInfo _clipArea, _backgroundScreenDrawCtx, _workScreenDrawCtx, _maskDrawCtx;
ClipInfo _excludeClipArea[4];
bool _excludeClipAreaEnabled[4];
uint16 _channelsUsedCount;
SpriteChannel _channels[100];
+
+ Common::Array<SpriteListItem> _spriteList;
+
};
} // End of namespace Made
diff --git a/engines/made/screenfx.cpp b/engines/made/screenfx.cpp
new file mode 100644
index 0000000000..ee96af601a
--- /dev/null
+++ b/engines/made/screenfx.cpp
@@ -0,0 +1,356 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "made/made.h"
+#include "made/screen.h"
+#include "made/screenfx.h"
+
+namespace Made {
+
+const byte ScreenEffects::vfxOffsTable[64] = {
+ 5, 2, 6, 1, 4, 7, 3, 0,
+ 7, 4, 0, 3, 6, 1, 5, 2,
+ 2, 5, 1, 6, 3, 0, 4, 7,
+ 0, 3, 7, 4, 1, 6, 2, 5,
+ 4, 0, 2, 5, 7, 3, 1, 6,
+ 1, 6, 4, 0, 2, 5, 7, 3,
+ 6, 1, 3, 7, 5, 2, 0, 4,
+ 3, 7, 5, 2, 0, 4, 6, 1
+};
+
+const byte ScreenEffects::vfxOffsIndexTable[8] = {
+ 6, 7, 2, 3, 4, 5, 0, 1
+};
+
+
+ScreenEffects::ScreenEffects(Screen *screen) : _screen(screen) {
+ vfxOffsTablePtr = &vfxOffsTable[6 * 8];
+ vfxX1 = 0;
+ vfxY1 = 0;
+ vfxWidth = 0;
+ vfxHeight = 0;
+}
+
+void ScreenEffects::run(int16 effectNum, Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount) {
+
+ // TODO: Put effect functions into an array
+ // TODO: Implement more visual effects
+
+ switch (effectNum) {
+
+ case 0: // No effect
+ vfx00(surface, palette, newPalette, colorCount);
+ break;
+
+ case 2:
+ vfx02(surface, palette, newPalette, colorCount);
+ break;
+
+ case 9: // "Checkerboard" effect
+ vfx09(surface, palette, newPalette, colorCount);
+ break;
+
+ case 10: // "Screen wipe in", left to right
+ vfx10(surface, palette, newPalette, colorCount);
+ break;
+
+ case 11: // "Screen wipe in", right to left
+ vfx11(surface, palette, newPalette, colorCount);
+ break;
+
+ case 12: // "Screen wipe in", top to bottom
+ vfx12(surface, palette, newPalette, colorCount);
+ break;
+
+ case 13: // "Screen wipe in", bottom to top
+ vfx13(surface, palette, newPalette, colorCount);
+ break;
+
+ case 14: // "Screen open" effect
+ vfx14(surface, palette, newPalette, colorCount);
+ break;
+
+ case 15:
+ vfx15(surface, palette, newPalette, colorCount);
+ break;
+
+ case 17: // Palette fadeout/fadein
+ vfx17(surface, palette, newPalette, colorCount);
+ break;
+
+ default:
+ vfx00(surface, palette, newPalette, colorCount);
+ warning("Unimplemented visual effect %d", effectNum);
+
+ }
+
+}
+
+void ScreenEffects::flash(int flashCount, byte *palette, int colorCount) {
+ int palSize = colorCount * 3;
+ if (flashCount < 1)
+ flashCount = 1;
+ for (int i = 0; i < palSize; i++)
+ _fxPalette[i] = CLIP<byte>(255 - palette[i], 0, 255);
+ while (flashCount--) {
+ _screen->setRGBPalette(_fxPalette, 0, colorCount);
+ _screen->updateScreenAndWait(20);
+ _screen->setRGBPalette(palette, 0, colorCount);
+ _screen->updateScreenAndWait(20);
+ }
+}
+
+void ScreenEffects::setPalette(byte *palette) {
+ if (!_screen->isPaletteLocked()) {
+ _screen->setRGBPalette(palette, 0, 256);
+ }
+}
+
+void ScreenEffects::setBlendedPalette(byte *palette, byte *newPalette, int colorCount, int16 value, int16 maxValue) {
+ if (!_screen->isPaletteLocked()) {
+ int32 mulValue = (value * 64) / maxValue;
+ for (int i = 0; i < colorCount * 3; i++)
+ _fxPalette[i] = CLIP(newPalette[i] - (newPalette[i] - palette[i]) * mulValue / 64, 0, 255);
+ _screen->setRGBPalette(_fxPalette, 0, 256);
+ }
+}
+
+void ScreenEffects::copyFxRect(Graphics::Surface *surface, int16 x1, int16 y1, int16 x2, int16 y2) {
+
+ // TODO: Clean up
+
+ byte *src, *dst;
+
+ x1 = CLIP<int16>(x1, 0, 320);
+ y1 = CLIP<int16>(y1, 0, 200);
+ x2 = CLIP<int16>(x2, 0, 320);
+ y2 = CLIP<int16>(y2, 0, 200);
+
+ x2 -= x1;
+ y2 -= y1;
+ vfxX1 = x1 & 0x0E;
+ x1 += 16;
+ x1 = x1 & 0xFFF0;
+ x2 += vfxX1;
+ x2 -= 15;
+ if (x2 < 0)
+ x2 = 0;
+ vfxWidth = x2 & 0x0E;
+ x2 = x2 & 0xFFF0;
+
+ vfxY1 = y1 & 7;
+
+ byte *source = (byte*)surface->getBasePtr(x1, y1);
+
+ Graphics::Surface *vgaScreen = _screen->lockScreen();
+ byte *dest = (byte*)vgaScreen->getBasePtr(x1, y1);
+
+ int16 addX = x2 / 16;
+
+ while (y2-- > 0) {
+
+ int16 addVal = vfxOffsTablePtr[vfxY1] * 2;
+ int16 w = 0;
+ vfxY1 = (vfxY1 + 1) & 7;
+
+ src = source + addVal;
+ dst = dest + addVal;
+
+ if (addVal < vfxX1) {
+ if (addVal < vfxWidth)
+ w = 1;
+ else
+ w = 0;
+ } else {
+ src -= 16;
+ dst -= 16;
+ if (addVal < vfxWidth)
+ w = 2;
+ else
+ w = 1;
+ }
+
+ w += addX;
+
+ while (w-- > 0) {
+ *dst++ = *src++;
+ *dst++ = *src++;
+ src += 14;
+ dst += 14;
+ }
+
+ source += 320;
+ dest += 320;
+
+ }
+
+ vfxHeight = (vfxHeight + 1) & 7;
+ vfxOffsTablePtr = &vfxOffsTable[vfxOffsIndexTable[vfxHeight] * 8];
+
+ _screen->unlockScreen();
+
+}
+
+void ScreenEffects::copyRect(Graphics::Surface *surface, int16 x1, int16 y1, int16 x2, int16 y2) {
+ Graphics::Surface *vgaScreen = _screen->lockScreen();
+ byte *source = (byte*)surface->getBasePtr(x1, y1);
+ byte *dest = (byte*)vgaScreen->getBasePtr(x1, y1);
+ for (int y = 0; y < y2 - y1; y++) {
+ memcpy(dest, source, x2 - x1);
+ dest += 320;
+ source += 320;
+ }
+ _screen->unlockScreen();
+}
+
+// No effect
+void ScreenEffects::vfx00(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount) {
+ setPalette(palette);
+ _screen->showWorkScreen();
+ // FIXME: For Manhole; causes sluggish mouse
+ _screen->updateScreenAndWait(100);
+}
+
+void ScreenEffects::vfx02(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount) {
+ for (int x = 312; x >= 0; x -= 8) {
+ copyRect(surface, x, 0, x + 8, 200);
+ setBlendedPalette(palette, newPalette, colorCount, 312 - x, 312);
+ _screen->updateScreenAndWait(25);
+ }
+ setPalette(palette);
+}
+
+// "Checkerboard" effect
+void ScreenEffects::vfx09(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount) {
+ for (int i = 0; i < 8; i++) {
+ copyFxRect(surface, 0, 0, 320, 200);
+ for (int j = 0; j < 4; j++) {
+ setBlendedPalette(palette, newPalette, colorCount, i * 4 + j, 36/*FIX?*/);
+ _screen->updateScreenAndWait(25);
+ }
+ }
+ setPalette(palette);
+}
+
+// "Screen wipe in", left to right
+void ScreenEffects::vfx10(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount) {
+ for (int x = -56; x < 312; x += 8) {
+ copyFxRect(surface, x, 0, x + 64, 200);
+ setBlendedPalette(palette, newPalette, colorCount, x + 56, 368);
+ _screen->updateScreenAndWait(25);
+ }
+ setPalette(palette);
+}
+
+// "Screen wipe in", right to left
+void ScreenEffects::vfx11(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount) {
+ for (int x = 312; x > -56; x -= 8) {
+ copyFxRect(surface, x, 0, x + 64, 200);
+ setBlendedPalette(palette, newPalette, colorCount, x + 56, 368);
+ _screen->updateScreenAndWait(25);
+ }
+ setPalette(palette);
+}
+
+// "Screen wipe in", top to bottom
+void ScreenEffects::vfx12(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount) {
+ for (int y = -70; y < 312; y += 10) {
+ copyFxRect(surface, 0, y, 320, y + 80);
+ setBlendedPalette(palette, newPalette, colorCount, y + 70, 260);
+ _screen->updateScreenAndWait(25);
+ }
+ setPalette(palette);
+}
+
+// "Screen wipe in", bottom to top
+void ScreenEffects::vfx13(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount) {
+ for (int y = 312; y > -70; y -= 10) {
+ copyFxRect(surface, 0, y, 320, y + 80);
+ setBlendedPalette(palette, newPalette, colorCount, y + 70, 260);
+ _screen->updateScreenAndWait(25);
+ }
+ setPalette(palette);
+}
+
+// "Screen open" effect
+void ScreenEffects::vfx14(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount) {
+ int16 x = 8, y = 5;
+ for (int i = 0; i < 27; i++) {
+ copyFxRect(surface, 160 - x, 100 - y, 160 + x, 100 + y);
+ x += 8;
+ y += 5;
+ setBlendedPalette(palette, newPalette, colorCount, i, 27);
+ _screen->updateScreenAndWait(25);
+ }
+ setPalette(palette);
+}
+
+void ScreenEffects::vfx15(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount) {
+ int16 x = 8;
+ for (int i = 0; i < 27; i++) {
+ copyFxRect(surface, 160 - x, 0, 160 + x, 200);
+ x += 8;
+ setBlendedPalette(palette, newPalette, colorCount, i, 27);
+ _screen->updateScreenAndWait(25);
+ }
+ setPalette(palette);
+}
+
+// Palette fadeout/fadein
+void ScreenEffects::vfx17(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount) {
+
+ byte tempPalette[768];
+
+ bool savedPaletteLock = _screen->isPaletteLocked();
+ _screen->setPaletteLock(false);
+
+ memcpy(tempPalette, palette, 768);
+
+ // Fade out to black
+ memset(palette, 0, 768);
+ for (int i = 0; i < 50; i++) {
+ setBlendedPalette(palette, newPalette, colorCount, i, 50);
+ _screen->updateScreenAndWait(25);
+ }
+ _screen->setRGBPalette(palette, 0, colorCount);
+
+ memcpy(palette, tempPalette, 768);
+
+ _screen->showWorkScreen();
+
+ // Fade from black to palette
+ memset(newPalette, 0, 768);
+ for (int i = 0; i < 50; i++) {
+ setBlendedPalette(palette, newPalette, colorCount, i, 50);
+ _screen->updateScreenAndWait(25);
+ }
+ _screen->setRGBPalette(palette, 0, colorCount);
+
+ _screen->setPaletteLock(savedPaletteLock);
+
+}
+
+
+} // End of namespace Made
diff --git a/engines/made/screenfx.h b/engines/made/screenfx.h
new file mode 100644
index 0000000000..e5023621ae
--- /dev/null
+++ b/engines/made/screenfx.h
@@ -0,0 +1,70 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#ifndef MADE_SCREENFX_H
+#define MADE_SCREENFX_H
+
+#include "common/endian.h"
+#include "common/util.h"
+#include "common/rect.h"
+
+#include "graphics/surface.h"
+
+#include "made/made.h"
+#include "made/screen.h"
+
+namespace Made {
+
+class ScreenEffects {
+public:
+ ScreenEffects(Screen *screen);
+ void run(int16 effectNum, Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount);
+ void flash(int count, byte *palette, int colorCount);
+private:
+ Screen *_screen;
+ byte _fxPalette[768];
+ static const byte vfxOffsTable[64];
+ static const byte vfxOffsIndexTable[8];
+ const byte *vfxOffsTablePtr;
+ int16 vfxX1, vfxY1, vfxWidth, vfxHeight;
+ void setPalette(byte *palette);
+ void setBlendedPalette(byte *palette, byte *newPalette, int colorCount, int16 value, int16 maxValue);
+ void copyFxRect(Graphics::Surface *surface, int16 x1, int16 y1, int16 x2, int16 y2);
+ void copyRect(Graphics::Surface *surface, int16 x1, int16 y1, int16 x2, int16 y2);
+ void vfx00(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount);
+ void vfx02(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount);
+ void vfx09(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount);
+ void vfx10(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount);
+ void vfx11(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount);
+ void vfx12(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount);
+ void vfx13(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount);
+ void vfx14(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount);
+ void vfx15(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount);
+ void vfx17(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount);
+};
+
+} // End of namespace Made
+
+#endif /* MADE_H */
diff --git a/engines/made/script.cpp b/engines/made/script.cpp
index 74dc9e0d9f..6f4ff7ace3 100644
--- a/engines/made/script.cpp
+++ b/engines/made/script.cpp
@@ -91,96 +91,92 @@ int16 *ScriptStack::getStackPtr() {
/* ScriptInterpreter */
ScriptInterpreter::ScriptInterpreter(MadeEngine *vm) : _vm(vm) {
-#define COMMAND(x) { &ScriptInterpreter::x, #x }
+#ifdef DUMP_SCRIPTS
+#define COMMAND(x, sig) { &ScriptInterpreter::x, #x, sig }
+#else
+#define COMMAND(x, sig) { &ScriptInterpreter::x, #x}
+#endif
static CommandEntry commandProcs[] = {
/* 01 */
- COMMAND(cmd_branchTrue),
- COMMAND(cmd_branchFalse),
- COMMAND(cmd_branch),
- COMMAND(cmd_true),
+ COMMAND(cmd_branchTrue, "W"),
+ COMMAND(cmd_branchFalse, "W"),
+ COMMAND(cmd_branch, "W"),
+ COMMAND(cmd_true, ""),
/* 05 */
- COMMAND(cmd_false),
- COMMAND(cmd_push),
- COMMAND(cmd_not),
- COMMAND(cmd_add),
+ COMMAND(cmd_false, ""),
+ COMMAND(cmd_push, ""),
+ COMMAND(cmd_not, ""),
+ COMMAND(cmd_add, ""),
/* 09 */
- COMMAND(cmd_sub),
- COMMAND(cmd_mul),
- COMMAND(cmd_div),
- COMMAND(cmd_mod),
+ COMMAND(cmd_sub, ""),
+ COMMAND(cmd_mul, ""),
+ COMMAND(cmd_div, ""),
+ COMMAND(cmd_mod, ""),
/* 13 */
- COMMAND(cmd_band),
- COMMAND(cmd_bor),
- COMMAND(cmd_bnot),
- COMMAND(cmd_lt),
+ COMMAND(cmd_band, ""),
+ COMMAND(cmd_bor, ""),
+ COMMAND(cmd_bnot, ""),
+ COMMAND(cmd_lt, ""),
/* 17 */
- COMMAND(cmd_eq),
- COMMAND(cmd_gt),
- COMMAND(cmd_loadConstant),
- COMMAND(cmd_loadVariable),
+ COMMAND(cmd_eq, ""),
+ COMMAND(cmd_gt, ""),
+ COMMAND(cmd_loadConstant, "w"),
+ COMMAND(cmd_loadVariable, "w"),
/* 21 */
- COMMAND(cmd_getObjectProperty),
- COMMAND(cmd_setObjectProperty),
- COMMAND(cmd_set),
- COMMAND(cmd_print),
+ COMMAND(cmd_getObjectProperty, ""),
+ COMMAND(cmd_setObjectProperty, ""),
+ COMMAND(cmd_set, "w"),
+ COMMAND(cmd_print, ""),
/* 25 */
- COMMAND(cmd_terpri),
- COMMAND(cmd_printNumber),
- COMMAND(cmd_vref),
- COMMAND(cmd_vset),
+ COMMAND(cmd_terpri, ""),
+ COMMAND(cmd_printNumber, ""),
+ COMMAND(cmd_vref, ""),
+ COMMAND(cmd_vset, ""),
/* 29 */
- COMMAND(cmd_vsize),
- COMMAND(cmd_exit),
- COMMAND(cmd_return),
- COMMAND(cmd_call),
+ COMMAND(cmd_vsize, ""),
+ COMMAND(cmd_exit, ""),
+ COMMAND(cmd_return, ""),
+ COMMAND(cmd_call, "b"),
/* 33 */
- COMMAND(cmd_svar),
- COMMAND(cmd_sset),
- COMMAND(cmd_split),
- COMMAND(cmd_snlit),
+ COMMAND(cmd_svar, ""),
+ COMMAND(cmd_sset, ""),
+ COMMAND(cmd_split, ""),
+ COMMAND(cmd_snlit, ""),
/* 37 */
- COMMAND(cmd_yorn),
- COMMAND(cmd_save),
- COMMAND(cmd_restore),
- COMMAND(cmd_arg),
+ COMMAND(cmd_yorn, ""),
+ COMMAND(cmd_save, ""),
+ COMMAND(cmd_restore, ""),
+ COMMAND(cmd_arg, "b"),
/* 41 */
- COMMAND(cmd_aset),
- COMMAND(cmd_tmp),
- COMMAND(cmd_tset),
- COMMAND(cmd_tspace),
+ COMMAND(cmd_aset, "b"),
+ COMMAND(cmd_tmp, "b"),
+ COMMAND(cmd_tset, "b"),
+ COMMAND(cmd_tspace, "b"),
/* 45 */
- COMMAND(cmd_class),
- COMMAND(cmd_objectp),
- COMMAND(cmd_vectorp),
- COMMAND(cmd_restart),
+ COMMAND(cmd_class, ""),
+ COMMAND(cmd_objectp, ""),
+ COMMAND(cmd_vectorp, ""),
+ COMMAND(cmd_restart, ""),
/* 49 */
- COMMAND(cmd_rand),
- COMMAND(cmd_randomize),
- COMMAND(cmd_send),
- COMMAND(cmd_extend),
+ COMMAND(cmd_rand, ""),
+ COMMAND(cmd_randomize, ""),
+ COMMAND(cmd_send, "b"),
+ COMMAND(cmd_extend, "Eb"),
/* 53 */
- COMMAND(cmd_catch),
- COMMAND(cmd_cdone),
- COMMAND(cmd_throw),
- COMMAND(cmd_functionp),
+ COMMAND(cmd_catch, ""),
+ COMMAND(cmd_cdone, ""),
+ COMMAND(cmd_throw, ""),
+ COMMAND(cmd_functionp, ""),
/* 57 */
- COMMAND(cmd_le),
- COMMAND(cmd_ge),
- COMMAND(cmd_varx),
- COMMAND(cmd_setx)
+ COMMAND(cmd_le, ""),
+ COMMAND(cmd_ge, ""),
+ COMMAND(cmd_varx, ""),
+ COMMAND(cmd_setx, "")
};
_commands = commandProcs;
_commandsMax = ARRAYSIZE(commandProcs) + 1;
- if (_vm->getGameID() == GID_RTZ)
- _functions = new ScriptFunctionsRtz(_vm);
- else if (_vm->getGameID() == GID_LGOP2)
- _functions = new ScriptFunctionsLgop2(_vm);
- else if (_vm->getGameID() == GID_MANHOLE)
- _functions = new ScriptFunctionsMhne(_vm);
- else
- error("Unsupported GameID");
-
+ _functions = new ScriptFunctions(_vm);
_functions->setupExternalsTable();
#undef COMMAND
@@ -191,8 +187,7 @@ ScriptInterpreter::~ScriptInterpreter() {
}
void ScriptInterpreter::runScript(int16 scriptObjectIndex) {
-
- _terminated = false;
+ _vm->_quit = false;
_runningScriptObjectIndex = scriptObjectIndex;
_localStackPos = _stack.getStackPos();
@@ -200,16 +195,19 @@ void ScriptInterpreter::runScript(int16 scriptObjectIndex) {
_codeBase = _vm->_dat->getObject(_runningScriptObjectIndex)->getData();
_codeIp = _codeBase;
- while (!_terminated) {
+ while (!_vm->_quit) {
+
+ _vm->handleEvents();
+
byte opcode = readByte();
if (opcode >= 1 && opcode <= _commandsMax) {
- debug(4, "opcode = %s\n", _commands[opcode - 1].desc);
+ debug(4, "[%04X:%04X] %s", _runningScriptObjectIndex, (uint) (_codeIp - _codeBase), _commands[opcode - 1].desc);
(this->*_commands[opcode - 1].proc)();
} else {
- warning("ScriptInterpreter::runScript(%d) Unknown opcode %02X\n", _runningScriptObjectIndex, opcode);
+ warning("ScriptInterpreter::runScript(%d) Unknown opcode %02X", _runningScriptObjectIndex, opcode);
}
+
}
-
}
byte ScriptInterpreter::readByte() {
@@ -219,7 +217,7 @@ byte ScriptInterpreter::readByte() {
int16 ScriptInterpreter::readInt16() {
int16 temp = (int16)READ_LE_UINT16(_codeIp);
_codeIp += 2;
- debug(4, "readInt16() value = %04X\n", temp);
+ debug(4, "readInt16() value = %04X", temp);
return temp;
}
@@ -330,14 +328,14 @@ void ScriptInterpreter::cmd_gt() {
void ScriptInterpreter::cmd_loadConstant() {
int16 value = readInt16();
- debug(4, "value = %04X (%d)\n", value, value);
+ debug(4, "value = %04X (%d)", value, value);
_stack.setTop(value);
}
void ScriptInterpreter::cmd_loadVariable() {
int16 variable = readInt16();
int16 value = _vm->_dat->getVar(variable);
- debug(4, "variable = %d; value = %d (%04X)\n", variable, value, value); fflush(stdout);
+ debug(4, "variable = %d; value = %d (%04X)", variable, value, value);
_stack.setTop(value);
}
@@ -345,7 +343,7 @@ void ScriptInterpreter::cmd_getObjectProperty() {
int16 propertyId = _stack.pop();
int16 objectIndex = _stack.top();
int16 value = _vm->_dat->getObjectProperty(objectIndex, propertyId);
- debug(4, "value = %04X(%d)\n", value, value);
+ debug(4, "value = %04X(%d)", value, value);
_stack.setTop(value);
}
@@ -359,15 +357,14 @@ void ScriptInterpreter::cmd_setObjectProperty() {
void ScriptInterpreter::cmd_set() {
int16 variable = readInt16();
- debug(4, "var(%d) = %04d (%d)\n", variable, _stack.top(), _stack.top());
+ debug(4, "var(%d) = %04d (%d)", variable, _stack.top(), _stack.top());
_vm->_dat->setVar(variable, _stack.top());
}
void ScriptInterpreter::cmd_print() {
// TODO: This opcode was used for printing debug messages
- Object *obj = _vm->_dat->getObject(_stack.top());
- const char *text = obj->getString();
- debug(4, "%s", text); fflush(stdout);
+ const char *text = _vm->_dat->getObjectString(_stack.top());
+ debug(4, "%s", text);
_stack.setTop(0);
}
@@ -386,20 +383,20 @@ void ScriptInterpreter::cmd_vref() {
int16 value = 0;
int16 index = _stack.pop();
int16 objectIndex = _stack.top();
- debug(4, "index = %d; objectIndex = %d\n", index, objectIndex); fflush(stdout);
+ debug(4, "index = %d; objectIndex = %d", index, objectIndex);
if (objectIndex > 0) {
Object *obj = _vm->_dat->getObject(objectIndex);
value = obj->getVectorItem(index);
}
_stack.setTop(value);
- debug(4, "--> value = %d\n", value); fflush(stdout);
+ debug(4, "--> value = %d", value);
}
void ScriptInterpreter::cmd_vset() {
int16 value = _stack.pop();
int16 index = _stack.pop();
int16 objectIndex = _stack.top();
- debug(4, "index = %d; objectIndex = %d; value = %d\n", index, objectIndex, value); fflush(stdout);
+ debug(4, "index = %d; objectIndex = %d; value = %d", index, objectIndex, value);
if (objectIndex > 0) {
Object *obj = _vm->_dat->getObject(objectIndex);
obj->setVectorItem(index, value);
@@ -418,11 +415,17 @@ void ScriptInterpreter::cmd_vsize() {
}
void ScriptInterpreter::cmd_exit() {
- warning("Unimplemented command: cmd_exit");
+ _vm->_quit = true;
}
void ScriptInterpreter::cmd_return() {
- // TODO: Check if returning from main function
+
+ // Check if returning from main function
+ if (_localStackPos == kScriptStackSize) {
+ _vm->_quit = true;
+ return;
+ }
+
int16 funcResult = _stack.top();
_stack.setStackPos(_localStackPos);
_localStackPos = kScriptStackLimit - _stack.pop();
@@ -432,95 +435,115 @@ void ScriptInterpreter::cmd_return() {
byte argc = _stack.pop();
_stack.free(argc);
_stack.setTop(funcResult);
- debug(4, "LEAVE: stackPtr = %d; _localStackPos = %d\n\n\n", _stack.getStackPos(), _localStackPos);
+ debug(4, "LEAVE: stackPtr = %d; _localStackPos = %d\n", _stack.getStackPos(), _localStackPos);
}
void ScriptInterpreter::cmd_call() {
- debug(4, "\n\n\nENTER: stackPtr = %d; _localStackPos = %d\n", _stack.getStackPos(), _localStackPos);
+ debug(4, "\nENTER: stackPtr = %d; _localStackPos = %d", _stack.getStackPos(), _localStackPos);
byte argc = readByte();
+
_stack.push(argc);
_stack.push(_codeIp - _codeBase);
_stack.push(_runningScriptObjectIndex);
_stack.push(kScriptStackLimit - _localStackPos);
_localStackPos = _stack.getStackPos();
_runningScriptObjectIndex = _stack.peek(_localStackPos + argc + 4);
- debug(4, "argc = %d; _runningScriptObjectIndex = %04X\n", argc, _runningScriptObjectIndex); fflush(stdout);
+ debug(4, "argc = %d; _runningScriptObjectIndex = %04X", argc, _runningScriptObjectIndex);
_codeBase = _vm->_dat->getObject(_runningScriptObjectIndex)->getData();
_codeIp = _codeBase;
}
void ScriptInterpreter::cmd_svar() {
+ // Never used in LGOP2, RTZ, Manhole:NE
warning("Unimplemented command: cmd_svar");
}
void ScriptInterpreter::cmd_sset() {
+ // Never used in LGOP2, RTZ, Manhole:NE
warning("Unimplemented command: cmd_sset");
}
void ScriptInterpreter::cmd_split() {
+ // Never used in LGOP2, RTZ, Manhole:NE
warning("Unimplemented command: cmd_split");
}
void ScriptInterpreter::cmd_snlit() {
+ // Never used in LGOP2, RTZ, Manhole:NE
warning("Unimplemented command: cmd_snlit");
}
void ScriptInterpreter::cmd_yorn() {
+ // Never used in LGOP2, RTZ, Manhole:NE
warning("Unimplemented command: cmd_yorn");
}
void ScriptInterpreter::cmd_save() {
- warning("Unimplemented command: cmd_save");
- _stack.setTop(0);
+ int16 result = 0;
+ int16 stringOfs = _stack.top();
+ const char *filename = _vm->_dat->getString(stringOfs);
+ result = _vm->_dat->savegame(filename, "", 0);
+ _stack.setTop(result);
}
void ScriptInterpreter::cmd_restore() {
- warning("Unimplemented command: cmd_restore");
+ int16 result = 0;
+ int16 stringOfs = _stack.top();
+ const char *filename = _vm->_dat->getString(stringOfs);
+ result = _vm->_dat->loadgame(filename, 0);
+ _stack.setTop(result);
}
void ScriptInterpreter::cmd_arg() {
int16 argIndex = readByte();
- debug(4, "argIndex = %d; value = %04X (%d)\n", argIndex, _stack.peek(_localStackPos + 4 + argIndex), _stack.peek(_localStackPos + 4 + argIndex));
+ debug(4, "argIndex = %d; value = %04X (%d)", argIndex, _stack.peek(_localStackPos + 4 + argIndex), _stack.peek(_localStackPos + 4 + argIndex));
_stack.setTop(_stack.peek(_localStackPos + 4 + argIndex));
}
void ScriptInterpreter::cmd_aset() {
int16 argIndex = readByte();
- debug(4, "argIndex = %d; value = %d\n", argIndex, _stack.peek(_localStackPos + 4 + argIndex));
+ debug(4, "argIndex = %d; value = %d", argIndex, _stack.peek(_localStackPos + 4 + argIndex));
_stack.poke(_localStackPos + 4 + argIndex, _stack.top());
}
void ScriptInterpreter::cmd_tmp() {
int16 tempIndex = readByte();
- debug(4, "tempIndex = %d; value = %d\n", tempIndex, _stack.peek(_localStackPos - tempIndex - 1));
+ debug(4, "tempIndex = %d; value = %d", tempIndex, _stack.peek(_localStackPos - tempIndex - 1));
_stack.setTop(_stack.peek(_localStackPos - tempIndex - 1));
}
void ScriptInterpreter::cmd_tset() {
int16 tempIndex = readByte();
- debug(4, "tempIndex = %d; value = %d\n", tempIndex, _stack.top());
+ debug(4, "tempIndex = %d; value = %d", tempIndex, _stack.top());
_stack.poke(_localStackPos - tempIndex - 1, _stack.top());
}
void ScriptInterpreter::cmd_tspace() {
int16 tempCount = readByte();
- debug(4, "tempCount = %d\n", tempCount);
+ debug(4, "tempCount = %d", tempCount);
_stack.alloc(tempCount);
}
void ScriptInterpreter::cmd_class() {
+ // Never used in LGOP2, RTZ, Manhole:NE
warning("Unimplemented command: cmd_class");
}
void ScriptInterpreter::cmd_objectp() {
- warning("Unimplemented command: cmd_objectp");
+ Object *obj = _vm->_dat->getObject(_stack.top());
+ if (obj->isObject())
+ _stack.setTop(-1);
+ else
+ _stack.setTop(0);
}
void ScriptInterpreter::cmd_vectorp() {
+ // Never used in LGOP2, RTZ, Manhole:NE
warning("Unimplemented command: cmd_vectorp");
}
void ScriptInterpreter::cmd_restart() {
+ // TODO: Used in RTZ
warning("Unimplemented command: cmd_restart");
}
@@ -535,11 +558,11 @@ void ScriptInterpreter::cmd_randomize() {
void ScriptInterpreter::cmd_send() {
- debug(4, "\n\n\nENTER: stackPtr = %d; _localStackPos = %d\n", _stack.getStackPos(), _localStackPos);
+ debug(4, "\nENTER: stackPtr = %d; _localStackPos = %d", _stack.getStackPos(), _localStackPos);
byte argc = readByte();
- debug(4, "argc = %d\n", argc);
+ debug(4, "argc = %d", argc);
_stack.push(argc);
_stack.push(_codeIp - _codeBase);
@@ -550,7 +573,7 @@ void ScriptInterpreter::cmd_send() {
int16 propertyId = _stack.peek(_localStackPos + argc + 2);
int16 objectIndex = _stack.peek(_localStackPos + argc + 4);
- debug(4, "objectIndex = %d (%04X); propertyId = %d(%04X)\n", objectIndex, objectIndex, propertyId, propertyId); fflush(stdout);
+ debug(4, "objectIndex = %d (%04X); propertyId = %d(%04X)", objectIndex, objectIndex, propertyId, propertyId);
if (objectIndex != 0) {
objectIndex = _vm->_dat->getObject(objectIndex)->getClass();
@@ -558,7 +581,7 @@ void ScriptInterpreter::cmd_send() {
objectIndex = _stack.peek(_localStackPos + argc + 3);
}
- debug(4, "--> objectIndex = %d(%04X)\n", objectIndex, objectIndex); fflush(stdout);
+ debug(4, "--> objectIndex = %d(%04X)", objectIndex, objectIndex);
if (objectIndex != 0) {
_runningScriptObjectIndex = _vm->_dat->getObjectProperty(objectIndex, propertyId);
@@ -583,13 +606,12 @@ void ScriptInterpreter::cmd_extend() {
byte argc = readByte();
int16 *argv = _stack.getStackPtr();
- //debug(4, "func = %d (%s); argc = %d\n", func, extendFuncNames[func], argc);
- debug(4, "func = %d; argc = %d\n", func, argc);
+ debug(4, "func = %d (%s); argc = %d", func, _functions->getFuncName(func), argc);
for (int i = 0; i < argc; i++)
- debug(4, "argv[%02d] = %04X (%d)\n", i, argv[i], argv[i]);
+ debug(2, "argv[%02d] = %04X (%d)", i, argv[i], argv[i]);
int16 result = _functions->callFunction(func, argc, argv);
- debug(4, "result = %04X (%d)\n", result, result);
+ debug(2, "result = %04X (%d)", result, result);
_stack.free(argc);
@@ -598,18 +620,22 @@ void ScriptInterpreter::cmd_extend() {
}
void ScriptInterpreter::cmd_catch() {
+ // Never used in LGOP2, RTZ, Manhole:NE
warning("Unimplemented command: cmd_catch");
}
void ScriptInterpreter::cmd_cdone() {
+ // Never used in LGOP2, RTZ, Manhole:NE
warning("Unimplemented command: cmd_cdone");
}
void ScriptInterpreter::cmd_throw() {
+ // Never used in LGOP2, RTZ, Manhole:NE
warning("Unimplemented command: cmd_throw");
}
void ScriptInterpreter::cmd_functionp() {
+ // Never used in LGOP2, RTZ, Manhole:NE
warning("Unimplemented command: cmd_functionp");
}
@@ -630,11 +656,133 @@ void ScriptInterpreter::cmd_ge() {
}
void ScriptInterpreter::cmd_varx() {
+ // Never used in LGOP2, RTZ, Manhole:NE
warning("Unimplemented command: cmd_varx");
}
void ScriptInterpreter::cmd_setx() {
+ // Never used in LGOP2, RTZ, Manhole:NE
warning("Unimplemented command: cmd_setx");
}
+#ifdef DUMP_SCRIPTS
+void ScriptInterpreter::dumpScript(int16 objectIndex, int *opcodeStats, int *externStats) {
+
+ debug(1, "Dumping code for object %04X", objectIndex);
+
+ Object *obj = _vm->_dat->getObject(objectIndex);
+ byte *code = obj->getData(), *codeStart = code, *codeEnd = code + obj->getSize();
+
+ while (code < codeEnd) {
+ byte opcode = *code++;
+ if (opcode >= 1 && opcode <= _commandsMax) {
+ Common::String codeLine;
+ const char *desc = _commands[opcode - 1].desc;
+ const char *sig = _commands[opcode - 1].sig;
+ int valueType; /* 0: dec; 1: hex; 2: extended function */
+ int16 value;
+ char tempStr[32];
+ opcodeStats[opcode - 1]++;
+ snprintf(tempStr, 32, "[%04X] ", (uint16)(code - codeStart - 1));
+ codeLine += tempStr;
+ codeLine += desc;
+ for (; *sig != '\0'; sig++) {
+ codeLine += " ";
+ switch (*sig) {
+ case 'b':
+ valueType = 0;
+ value = *code++;
+ break;
+ case 'B':
+ valueType = 1;
+ value = *code++;
+ break;
+ case 'w':
+ valueType = 0;
+ value = READ_LE_UINT16(code);
+ code += 2;
+ break;
+ case 'W':
+ valueType = 1;
+ value = READ_LE_UINT16(code);
+ code += 2;
+ break;
+ case 'E':
+ valueType = 2;
+ value = *code++;
+ break;
+ }
+ switch (valueType) {
+ case 0:
+ snprintf(tempStr, 32, "%d", value);
+ break;
+ case 1:
+ snprintf(tempStr, 32, "0x%X", value);
+ break;
+ case 2:
+ if (value < _functions->getCount()) {
+ snprintf(tempStr, 32, "%s", _functions->getFuncName(value));
+ externStats[value]++;
+ } else {
+ snprintf(tempStr, 32, "invalid: %d", value);
+ }
+ break;
+ }
+ codeLine += tempStr;
+ }
+ debug(1, "%s", codeLine.c_str());
+ } else {
+ error("ScriptInterpreter::dumpScript(%d) Unknown opcode %02X", objectIndex, opcode);
+ }
+ }
+ debug(1, "-------------------------------------------");
+}
+
+void ScriptInterpreter::dumpAllScripts() {
+ int *opcodeStats = new int[_commandsMax - 1];
+ int *externStats = new int[_functions->getCount()];
+
+ for (int i = 0; i < _commandsMax; i++)
+ opcodeStats[i] = 0;
+ for (int i = 0; i < _functions->getCount(); i++)
+ externStats[i] = 0;
+
+ for (uint objectIndex = 1; objectIndex <= _vm->_dat->getObjectCount(); objectIndex++) {
+ Object *obj = _vm->_dat->getObject(objectIndex);
+ // Check if it's a byte array which might contain code
+ if (obj->getClass() != 0x7FFF)
+ continue;
+ // Code objects aren't excplicitly marked as such, we need to check if
+ // the last byte is a cmd_return opcode.
+ byte *retByte = obj->getData() + obj->getSize() - 1;
+ if (*retByte == 0x1F) {
+ dumpScript(objectIndex, opcodeStats, externStats);
+ }
+ }
+
+ debug(1, "OPCODE statistics:");
+ for (int i = 0; i < _commandsMax - 1; i++)
+ if (opcodeStats[i] > 0)
+ debug(1, "%-30s: %d", _commands[i].desc, opcodeStats[i]);
+ debug(1, "UNUSED OPCODE statistics:");
+ for (int i = 0; i < _commandsMax - 1; i++)
+ if (opcodeStats[i] == 0)
+ debug(1, "%-30s: %d", _commands[i].desc, opcodeStats[i]);
+ debug(1, ".");
+
+ debug(1, "EXTERN statistics (%d):", _functions->getCount());
+ for (int i = 0; i < _functions->getCount(); i++)
+ if (externStats[i] > 0)
+ debug(1, "%-30s: %d", _functions->getFuncName(i), externStats[i]);
+ debug(1, "UNUSED EXTERN statistics (%d):", _functions->getCount());
+ for (int i = 0; i < _functions->getCount(); i++)
+ if (externStats[i] == 0)
+ debug(1, "%-30s: %d", _functions->getFuncName(i), externStats[i]);
+ debug(1, ".");
+
+ delete[] opcodeStats;
+ delete[] externStats;
+}
+#endif
+
} // End of namespace Made
diff --git a/engines/made/script.h b/engines/made/script.h
index 6c031f8708..459a088cb8 100644
--- a/engines/made/script.h
+++ b/engines/made/script.h
@@ -32,6 +32,11 @@
namespace Made {
+// Define this to dump all game scripts and a usage statistic of all
+// opcodes/extended functions instead of running the actual game.
+// Then run ScummVM with debuglevel 1.
+//#define DUMP_SCRIPTS
+
class MadeEngine;
class ScriptFunctions;
@@ -63,6 +68,8 @@ public:
ScriptInterpreter(MadeEngine *vm);
~ScriptInterpreter();
void runScript(int16 scriptObjectIndex);
+ void dumpScript(int16 objectIndex, int *opcodeStats, int *externStats);
+ void dumpAllScripts();
protected:
MadeEngine *_vm;
@@ -81,6 +88,9 @@ protected:
struct CommandEntry {
CommandProc proc;
const char *desc;
+#ifdef DUMP_SCRIPTS
+ const char *sig;
+#endif
};
const CommandEntry *_commands;
diff --git a/engines/made/scriptfuncs.cpp b/engines/made/scriptfuncs.cpp
index 7fc61ee410..932447a1eb 100644
--- a/engines/made/scriptfuncs.cpp
+++ b/engines/made/scriptfuncs.cpp
@@ -26,8 +26,8 @@
#include "common/endian.h"
#include "common/util.h"
#include "common/events.h"
-
#include "graphics/cursorman.h"
+#include "sound/audiocd.h"
#include "made/made.h"
#include "made/resource.h"
@@ -40,386 +40,414 @@
namespace Made {
-int16 ScriptFunctions::callFunction(uint16 index, int16 argc, int16 *argv) {
- if (index >= _externalFuncs.size()) {
- // TODO: ERROR!
- return 0;
- }
+typedef Common::Functor2Mem<int16, int16*, int16, ScriptFunctions> ExternalScriptFunc;
+#define External(x) \
+ _externalFuncs.push_back(new ExternalScriptFunc(this, &ScriptFunctions::x)); \
+ _externalFuncNames.push_back(#x);
+void ScriptFunctions::setupExternalsTable() {
+
+ External(sfSystemCall);
+ External(sfInitGraf);
+ External(sfRestoreGraf);
+ External(sfDrawPicture);
+ External(sfClearScreen);
+ External(sfShowPage);
+ External(sfPollEvent);
+ External(sfGetMouseX);
+ External(sfGetMouseY);
+ External(sfGetKey);
+ External(sfSetVisualEffect);
+ External(sfPlaySound);
+ External(sfPlayMusic);
+ External(sfStopMusic);
+ External(sfIsMusicPlaying);
+ External(sfSetTextPos);
+ External(sfFlashScreen);
+ External(sfPlayNote);
+ External(sfStopNote);
+ External(sfPlayTele);
+ External(sfStopTele);
+ External(sfHideMouseCursor);
+ External(sfShowMouseCursor);
+ External(sfGetMusicBeat);
+ External(sfSetScreenLock);
+ External(sfAddSprite);
+ External(sfFreeAnim);
+ External(sfDrawSprite);
+ External(sfEraseSprites);
+ External(sfUpdateSprites);
+ External(sfGetTimer);
+ External(sfSetTimer);
+ External(sfResetTimer);
+ External(sfAllocTimer);
+ External(sfFreeTimer);
+ External(sfSetPaletteLock);
+ External(sfSetFont);
+ External(sfDrawText);
+ External(sfHomeText);
+ External(sfSetTextRect);
+ External(sfSetTextXY);
+ External(sfSetFontDropShadow);
+ External(sfSetFontColor);
+ External(sfSetFontOutline);
+ External(sfLoadMouseCursor);
+ External(sfSetSpriteGround);
+ External(sfLoadResText);
- fflush(stdout);
- //g_system->delayMillis(2000);
+ if (_vm->getGameID() == GID_MANHOLE || _vm->getGameID() == GID_LGOP2 || _vm->getGameID() == GID_RODNEY) {
+ External(sfAddScreenMask);
+ External(sfSetSpriteMask);
+ } else if (_vm->getGameID() == GID_RTZ) {
+ External(sfSetClipArea);
+ External(sfSetSpriteClip);
+ }
+
+ External(sfSoundPlaying);
+ External(sfStopSound);
+ External(sfPlayVoice);
+
+ if (_vm->getGameID() == GID_MANHOLE || _vm->getGameID() == GID_RTZ) {
+ External(sfPlayCd);
+ External(sfStopCd);
+ External(sfGetCdStatus);
+ External(sfGetCdTime);
+ External(sfPlayCdSegment);
+ }
- return (*_externalFuncs[index])(argc, argv);
-}
-
-typedef Common::Functor2Mem<int16, int16*, int16, ScriptFunctionsRtz> ExternalFuncRtz;
-#define External(x) ExternalFuncRtz(this, &ScriptFunctionsRtz::x)
-void ScriptFunctionsRtz::setupExternalsTable() {
- static const ExternalFuncRtz externalsTable[] = {
- External(o1_SYSTEM),
- External(o1_INITGRAF),
- External(o1_RESTOREGRAF),
- External(o1_DRAWPIC),
- External(o1_CLS),
- External(o1_SHOWPAGE),
- External(o1_EVENT),
- External(o1_EVENTX),
- External(o1_EVENTY),
- External(o1_EVENTKEY),
- External(o1_VISUALFX),
- External(o1_PLAYSND),
- External(o1_PLAYMUS),
- External(o1_STOPMUS),
- External(o1_ISMUS),
- External(o1_TEXTPOS),
- External(o1_FLASH),
- External(o1_PLAYNOTE),
- External(o1_STOPNOTE),
- External(o1_PLAYTELE),
- External(o1_STOPTELE),
- External(o1_HIDECURS),
- External(o1_SHOWCURS),
- External(o1_MUSICBEAT),
- External(o1_SCREENLOCK),
- External(o1_ADDSPRITE),
- External(o1_FREEANIM),
- External(o1_DRAWSPRITE),
- External(o1_ERASESPRITES),
- External(o1_UPDATESPRITES),
- External(o1_GETTIMER),
- External(o1_SETTIMER),
- External(o1_RESETTIMER),
- External(o1_ALLOCTIMER),
- External(o1_FREETIMER),
- External(o1_PALETTELOCK),
- External(o1_FONT),
- External(o1_DRAWTEXT),
- External(o1_HOMETEXT),
- External(o1_TEXTRECT),
- External(o1_TEXTXY),
- External(o1_DROPSHADOW),
- External(o1_TEXTCOLOR),
- External(o1_OUTLINE),
- External(o1_LOADCURSOR),
- External(o1_SETGROUND),
- External(o1_RESTEXT),
- External(o1_CLIPAREA),
- External(o1_SETCLIP),
- External(o1_ISSND),
- External(o1_STOPSND),
- External(o1_PLAYVOICE),
- External(o1_CDPLAY),
- External(o1_STOPCD),
- External(o1_CDSTATUS),
- External(o1_CDTIME),
- External(o1_CDPLAYSEG),
- External(o1_PRINTF),
- External(o1_MONOCLS),
- External(o1_SNDENERGY),
- External(o1_CLEARTEXT),
- External(o1_ANIMTEXT),
- External(o1_TEXTWIDTH),
- External(o1_PLAYMOVIE),
- External(o1_LOADSND),
- External(o1_LOADMUS),
- External(o1_LOADPIC),
- External(o1_MUSICVOL),
- External(o1_RESTARTEVENTS),
- External(o1_PLACESPRITE),
- External(o1_PLACETEXT),
- External(o1_DELETECHANNEL),
- External(o1_CHANNELTYPE),
- External(o1_SETSTATE),
- External(o1_SETLOCATION),
- External(o1_SETCONTENT),
- External(o1_EXCLUDEAREA),
- External(o1_SETEXCLUDE),
- External(o1_GETSTATE),
- External(o1_PLACEANIM),
- External(o1_SETFRAME),
- External(o1_GETFRAME),
- External(o1_GETFRAMECOUNT),
- External(o1_PICWIDTH),
- External(o1_PICHEIGHT),
- External(o1_SOUNDRATE),
- External(o1_DRAWANIMPIC),
- External(o1_LOADANIM),
- External(o1_READTEXT),
- External(o1_READMENU),
- External(o1_DRAWMENU),
- External(o1_MENUCOUNT),
- External(o1_SAVEGAME),
- External(o1_LOADGAME),
- External(o1_GAMENAME),
- External(o1_SHAKESCREEN),
- External(o1_PLACEMENU),
- External(o1_SETVOLUME),
- External(o1_WHATSYNTH),
- External(o1_SLOWSYSTEM)
- };
-
- for (int i = 0; i < ARRAYSIZE(externalsTable); ++i)
- _externalFuncs.push_back(&externalsTable[i]);
+ if (_vm->getGameID() == GID_RTZ) {
+ External(sfPrintf);
+ External(sfClearMono);
+ External(sfGetSoundEnergy);
+ External(sfClearText);
+ External(sfAnimText);
+ External(sfGetTextWidth);
+ External(sfPlayMovie);
+ External(sfLoadSound);
+ External(sfLoadMusic);
+ External(sfLoadPicture);
+ External(sfSetMusicVolume);
+ External(sfRestartEvents);
+ External(sfPlaceSprite);
+ External(sfPlaceText);
+ External(sfDeleteChannel);
+ External(sfGetChannelType);
+ External(sfSetChannelState);
+ External(sfSetChannelLocation);
+ External(sfSetChannelContent);
+ External(sfSetExcludeArea);
+ External(sfSetSpriteExclude);
+ External(sfGetChannelState);
+ External(sfPlaceAnim);
+ External(sfSetAnimFrame);
+ External(sfGetAnimFrame);
+ External(sfGetAnimFrameCount);
+ External(sfGetPictureWidth);
+ External(sfGetPictureHeight);
+ External(sfSetSoundRate);
+ External(sfDrawAnimPic);
+ External(sfLoadAnim);
+ External(sfReadText);
+ External(sfReadMenu);
+ External(sfDrawMenu);
+ External(sfGetMenuCount);
+ External(sfSaveGame);
+ External(sfLoadGame);
+ External(sfGetGameDescription);
+ External(sfShakeScreen);
+ External(sfPlaceMenu);
+ External(sfSetSoundVolume);
+ External(sfGetSynthType);
+ External(sfIsSlowSystem);
+ }
}
#undef External
-int16 ScriptFunctionsRtz::o1_SYSTEM(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfSystemCall(int16 argc, int16 *argv) {
// This opcode is empty.
return 0;
}
-int16 ScriptFunctionsRtz::o1_INITGRAF(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfInitGraf(int16 argc, int16 *argv) {
// This opcode is empty.
return 0;
}
-int16 ScriptFunctionsRtz::o1_RESTOREGRAF(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfRestoreGraf(int16 argc, int16 *argv) {
// This opcode is empty.
return 0;
}
-int16 ScriptFunctionsRtz::o1_DRAWPIC(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfDrawPicture(int16 argc, int16 *argv) {
return _vm->_screen->drawPic(argv[4], argv[3], argv[2], argv[1], argv[0]);
}
-int16 ScriptFunctionsRtz::o1_CLS(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfClearScreen(int16 argc, int16 *argv) {
+ if (_vm->_screen->isScreenLocked())
+ return 0;
+ if (_vm->_autoStopSound) {
+ _vm->_mixer->stopHandle(_audioStreamHandle);
+ _vm->_autoStopSound = false;
+ }
_vm->_screen->clearScreen();
return 0;
}
-int16 ScriptFunctionsRtz::o1_SHOWPAGE(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfShowPage(int16 argc, int16 *argv) {
_vm->_screen->show();
return 0;
}
-int16 ScriptFunctionsRtz::o1_EVENT(int16 argc, int16 *argv) {
-
- Common::Event event;
- Common::EventManager *eventMan = g_system->getEventManager();
-
- int16 eventNum = 0;
-
- if (eventMan->pollEvent(event)) {
- switch (event.type) {
-
- case Common::EVENT_MOUSEMOVE:
- _vm->_eventMouseX = event.mouse.x;
- _vm->_eventMouseY = event.mouse.y;
- break;
-
- case Common::EVENT_LBUTTONDOWN:
- eventNum = 1;
- break;
-
- case Common::EVENT_RBUTTONDOWN:
- eventNum = 3;
- break;
-
- case Common::EVENT_KEYDOWN:
- _vm->_eventKey = event.kbd.ascii;
- eventNum = 5;
- break;
-
- case Common::EVENT_QUIT:
- // TODO: Exit more gracefully.
- g_system->quit();
- break;
-
- default:
- break;
-
- }
- }
+int16 ScriptFunctions::sfPollEvent(int16 argc, int16 *argv) {
_vm->_system->updateScreen();
+ int16 eventNum = _vm->_eventNum;
+ _vm->_eventNum = 0;
return eventNum;
}
-int16 ScriptFunctionsRtz::o1_EVENTX(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfGetMouseX(int16 argc, int16 *argv) {
return _vm->_eventMouseX;
}
-int16 ScriptFunctionsRtz::o1_EVENTY(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfGetMouseY(int16 argc, int16 *argv) {
return _vm->_eventMouseY;
}
-int16 ScriptFunctionsRtz::o1_EVENTKEY(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfGetKey(int16 argc, int16 *argv) {
return _vm->_eventKey;
}
-int16 ScriptFunctionsRtz::o1_VISUALFX(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfSetVisualEffect(int16 argc, int16 *argv) {
_vm->_screen->setVisualEffectNum(argv[0]);
return 0;
}
-int16 ScriptFunctionsRtz::o1_PLAYSND(int16 argc, int16 *argv) {
- int soundNum = argv[0];
- bool loop = false;
-
+int16 ScriptFunctions::sfPlaySound(int16 argc, int16 *argv) {
+ int16 soundNum = argv[0];
+ _vm->_autoStopSound = false;
+ _vm->_mixer->stopHandle(_audioStreamHandle);
if (argc > 1) {
soundNum = argv[1];
- loop = (argv[0] == 1);
+ _vm->_autoStopSound = (argv[0] == 1);
}
-
if (soundNum > 0) {
- if (!_vm->_mixer->isSoundHandleActive(_audioStreamHandle)) {
- _vm->_mixer->playInputStream(Audio::Mixer::kPlainSoundType, &_audioStreamHandle,
- _vm->_res->getSound(soundNum)->getAudioStream(_vm->_soundRate, loop));
- }
+ _vm->_mixer->playInputStream(Audio::Mixer::kPlainSoundType, &_audioStreamHandle,
+ _vm->_res->getSound(soundNum)->getAudioStream(_vm->_soundRate, false));
}
-
return 0;
}
-int16 ScriptFunctionsRtz::o1_PLAYMUS(int16 argc, int16 *argv) {
- int16 musicNum = argv[0];
- if (musicNum > 0) {
- XmidiResource *xmidi = _vm->_res->getXmidi(musicNum);
- _vm->_music->play(xmidi);
- _vm->_res->freeResource(xmidi);
+int16 ScriptFunctions::sfPlayMusic(int16 argc, int16 *argv) {
+ // TODO: Music in LGOP2 and Manhole isn't supported yet
+ if (_vm->getGameID() == GID_RTZ) {
+ int16 musicNum = argv[0];
+ if (musicNum > 0) {
+ _musicRes = _vm->_res->getXmidi(musicNum);
+ if (_musicRes)
+ _vm->_music->playXMIDI(_musicRes);
+ }
}
return 0;
}
-int16 ScriptFunctionsRtz::o1_STOPMUS(int16 argc, int16 *argv) {
- _vm->_music->stop();
+int16 ScriptFunctions::sfStopMusic(int16 argc, int16 *argv) {
+ if (_vm->_music->isPlaying() && _musicRes) {
+ _vm->_music->stop();
+ _vm->_res->freeResource(_musicRes);
+ _musicRes = NULL;
+ }
return 0;
}
-int16 ScriptFunctionsRtz::o1_ISMUS(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfIsMusicPlaying(int16 argc, int16 *argv) {
if (_vm->_music->isPlaying())
return 1;
else
return 0;
}
-int16 ScriptFunctionsRtz::o1_TEXTPOS(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_TEXTPOS");
+int16 ScriptFunctions::sfSetTextPos(int16 argc, int16 *argv) {
+ // Used in Manhole:NE
+ //warning("Unimplemented opcode: sfSetTextPos");
// This seems to be some kind of low-level opcode.
// The original engine calls int 10h to set the VGA cursor position.
+ // Since this seems to be used for debugging purposes only it's left out.
return 0;
}
-int16 ScriptFunctionsRtz::o1_FLASH(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfFlashScreen(int16 argc, int16 *argv) {
_vm->_screen->flash(argv[0]);
return 0;
}
-int16 ScriptFunctionsRtz::o1_PLAYNOTE(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_PLAYNOTE");
+int16 ScriptFunctions::sfPlayNote(int16 argc, int16 *argv) {
+ // TODO: Used in Manhole:NE
+ warning("Unimplemented opcode: sfPlayNote");
return 0;
}
-int16 ScriptFunctionsRtz::o1_STOPNOTE(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_STOPNOTE");
+int16 ScriptFunctions::sfStopNote(int16 argc, int16 *argv) {
+ // TODO: Used in Manhole:NE
+ warning("Unimplemented opcode: sfStopNote");
return 0;
}
-int16 ScriptFunctionsRtz::o1_PLAYTELE(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_PLAYTELE");
+int16 ScriptFunctions::sfPlayTele(int16 argc, int16 *argv) {
+ // TODO: Used in Manhole:NE
+ warning("Unimplemented opcode: sfPlayTele");
return 0;
}
-int16 ScriptFunctionsRtz::o1_STOPTELE(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_STOPTELE");
+int16 ScriptFunctions::sfStopTele(int16 argc, int16 *argv) {
+ // TODO: Used in Manhole:NE
+ warning("Unimplemented opcode: sfStopTele");
return 0;
}
-int16 ScriptFunctionsRtz::o1_HIDECURS(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfHideMouseCursor(int16 argc, int16 *argv) {
_vm->_system->showMouse(false);
return 0;
}
-int16 ScriptFunctionsRtz::o1_SHOWCURS(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfShowMouseCursor(int16 argc, int16 *argv) {
_vm->_system->showMouse(true);
return 0;
}
-int16 ScriptFunctionsRtz::o1_MUSICBEAT(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_MUSICBEAT");
+int16 ScriptFunctions::sfGetMusicBeat(int16 argc, int16 *argv) {
+ // This is called loads of times in the intro of the floppy version
+ // of RtZ. Not sure what it does. Commented out to reduce spam
+ //warning("Unimplemented opcode: sfGetMusicBeat");
return 0;
}
-int16 ScriptFunctionsRtz::o1_SCREENLOCK(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfSetScreenLock(int16 argc, int16 *argv) {
_vm->_screen->setScreenLock(argv[0] != 0);
return 0;
}
-int16 ScriptFunctionsRtz::o1_ADDSPRITE(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_ADDSPRITE");
- //_vm->_screen->addSprite(argv[0]);
- return 0;
+int16 ScriptFunctions::sfAddSprite(int16 argc, int16 *argv) {
+ if (_vm->getGameID() == GID_RTZ) {
+ // Unused in RTZ
+ return 0;
+ } if (_vm->getGameID() == GID_LGOP2 || _vm->getGameID() == GID_MANHOLE) {
+ return _vm->_screen->addToSpriteList(argv[2], argv[1], argv[0]);
+ } else {
+ return 0;
+ }
}
-int16 ScriptFunctionsRtz::o1_FREEANIM(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfFreeAnim(int16 argc, int16 *argv) {
_vm->_screen->clearChannels();
+ if (_vm->getGameID() == GID_LGOP2 || _vm->getGameID() == GID_MANHOLE) {
+ _vm->_screen->clearSpriteList();
+ }
return 0;
}
-int16 ScriptFunctionsRtz::o1_DRAWSPRITE(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_DRAWSPRITE");
- return 0;
+int16 ScriptFunctions::sfDrawSprite(int16 argc, int16 *argv) {
+ if (_vm->getGameID() == GID_RTZ) {
+ return _vm->_screen->drawSprite(argv[2], argv[1], argv[0]);
+ } if (_vm->getGameID() == GID_LGOP2 || _vm->getGameID() == GID_MANHOLE) {
+ SpriteListItem item = _vm->_screen->getFromSpriteList(argv[2]);
+ int16 channelIndex = _vm->_screen->drawSprite(item.index, argv[1] - item.xofs, argv[0] - item.yofs);
+ _vm->_screen->setChannelUseMask(channelIndex);
+ return 0;
+ } else {
+ return 0;
+ }
}
-int16 ScriptFunctionsRtz::o1_ERASESPRITES(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfEraseSprites(int16 argc, int16 *argv) {
_vm->_screen->clearChannels();
return 0;
}
-int16 ScriptFunctionsRtz::o1_UPDATESPRITES(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfUpdateSprites(int16 argc, int16 *argv) {
_vm->_screen->updateSprites();
return 0;
}
-int16 ScriptFunctionsRtz::o1_GETTIMER(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfGetTimer(int16 argc, int16 *argv) {
return _vm->getTimer(argv[0]);
}
-int16 ScriptFunctionsRtz::o1_SETTIMER(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfSetTimer(int16 argc, int16 *argv) {
_vm->setTimer(argv[1], argv[0]);
return 0;
}
-int16 ScriptFunctionsRtz::o1_RESETTIMER(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfResetTimer(int16 argc, int16 *argv) {
_vm->resetTimer(argv[0]);
return 0;
}
-int16 ScriptFunctionsRtz::o1_ALLOCTIMER(int16 argc, int16 *argv) {
- int16 timerNum = _vm->allocTimer();
- return timerNum;
+int16 ScriptFunctions::sfAllocTimer(int16 argc, int16 *argv) {
+ return _vm->allocTimer();
}
-int16 ScriptFunctionsRtz::o1_FREETIMER(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfFreeTimer(int16 argc, int16 *argv) {
_vm->freeTimer(argv[0]);
return 0;
}
-int16 ScriptFunctionsRtz::o1_PALETTELOCK(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfSetPaletteLock(int16 argc, int16 *argv) {
_vm->_screen->setPaletteLock(argv[0] != 0);
return 0;
}
-int16 ScriptFunctionsRtz::o1_FONT(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfSetFont(int16 argc, int16 *argv) {
_vm->_screen->setFont(argv[0]);
return 0;
}
-int16 ScriptFunctionsRtz::o1_DRAWTEXT(int16 argc, int16 *argv) {
- Object *obj = _vm->_dat->getObject(argv[argc - 1]);
- const char *text = obj->getString();
- _vm->_screen->printText(text);
+int16 ScriptFunctions::sfDrawText(int16 argc, int16 *argv) {
+
+ const char *text = NULL;
+
+ if (_vm->getGameID() == GID_RTZ) {
+ text = _vm->_dat->getObjectString(argv[argc - 1]);
+ } if (_vm->getGameID() == GID_LGOP2 || _vm->getGameID() == GID_MANHOLE) {
+ text = _vm->_dat->getString(argv[argc - 1]);
+ }
+
+ if (text) {
+ char finalText[1024];
+ switch (argc) {
+ case 1:
+ snprintf(finalText, 1024, "%s", text);
+ break;
+ case 2:
+ snprintf(finalText, 1024, text, argv[0]);
+ break;
+ case 3:
+ snprintf(finalText, 1024, text, argv[1], argv[0]);
+ break;
+ case 4:
+ snprintf(finalText, 1024, text, argv[2], argv[1], argv[0]);
+ break;
+ case 5:
+ snprintf(finalText, 1024, text, argv[3], argv[2], argv[1], argv[0]);
+ break;
+ default:
+ finalText[0] = '\0';
+ break;
+ }
+ _vm->_screen->printText(finalText);
+ }
+
return 0;
}
-int16 ScriptFunctionsRtz::o1_HOMETEXT(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_HOMETEXT");
+int16 ScriptFunctions::sfHomeText(int16 argc, int16 *argv) {
+ _vm->_screen->homeText();
return 0;
}
-int16 ScriptFunctionsRtz::o1_TEXTRECT(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfSetTextRect(int16 argc, int16 *argv) {
+ // Used in the save/load screens of RtZ, and perhaps other places as well
int16 x1 = CLIP<int16>(argv[4], 1, 318);
int16 y1 = CLIP<int16>(argv[3], 1, 198);
int16 x2 = CLIP<int16>(argv[2], 1, 318);
@@ -430,158 +458,179 @@ int16 ScriptFunctionsRtz::o1_TEXTRECT(int16 argc, int16 *argv) {
return 0;
}
-int16 ScriptFunctionsRtz::o1_TEXTXY(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfSetTextXY(int16 argc, int16 *argv) {
int16 x = CLIP<int16>(argv[1], 1, 318);
int16 y = CLIP<int16>(argv[0], 1, 198);
_vm->_screen->setTextXY(x, y);
return 0;
}
-int16 ScriptFunctionsRtz::o1_DROPSHADOW(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfSetFontDropShadow(int16 argc, int16 *argv) {
// if the drop shadow color is -1, then text drop shadow is disabled
// when font drop shadow is enabled, outline is disabled
_vm->_screen->setDropShadowColor(argv[0]);
return 0;
}
-int16 ScriptFunctionsRtz::o1_TEXTCOLOR(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfSetFontColor(int16 argc, int16 *argv) {
_vm->_screen->setTextColor(argv[0]);
return 0;
}
-int16 ScriptFunctionsRtz::o1_OUTLINE(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfSetFontOutline(int16 argc, int16 *argv) {
// if the outline color is -1, then text outline is disabled
// when font outline is enabled, drop shadow is disabled
_vm->_screen->setOutlineColor(argv[0]);
return 0;
}
-int16 ScriptFunctionsRtz::o1_LOADCURSOR(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfLoadMouseCursor(int16 argc, int16 *argv) {
PictureResource *flex = _vm->_res->getPicture(argv[2]);
- Graphics::Surface *surf = flex->getPicture();
- CursorMan.replaceCursor((const byte *)surf->pixels, surf->w, surf->h, argv[1], argv[0], 0);
- CursorMan.showMouse(true);
- _vm->_res->freeResource(flex);
+ if (flex) {
+ Graphics::Surface *surf = flex->getPicture();
+ CursorMan.replaceCursor((const byte *)surf->pixels, surf->w, surf->h, argv[1], argv[0], 0);
+ _vm->_res->freeResource(flex);
+ }
return 0;
}
-int16 ScriptFunctionsRtz::o1_SETGROUND(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfSetSpriteGround(int16 argc, int16 *argv) {
_vm->_screen->setGround(argv[0]);
return 0;
}
-int16 ScriptFunctionsRtz::o1_RESTEXT(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_RESTEXT");
+int16 ScriptFunctions::sfLoadResText(int16 argc, int16 *argv) {
+ // Never used in LGOP2, RTZ, Manhole:NE
+ warning("Unimplemented opcode: sfLoadResText");
return 0;
}
-int16 ScriptFunctionsRtz::o1_CLIPAREA(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_CLIPAREA");
+int16 ScriptFunctions::sfSetClipArea(int16 argc, int16 *argv) {
+ _vm->_screen->setClipArea(argv[3], argv[2], argv[1], argv[0]);
return 0;
}
-int16 ScriptFunctionsRtz::o1_SETCLIP(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfSetSpriteClip(int16 argc, int16 *argv) {
_vm->_screen->setClip(argv[0]);
return 0;
}
-int16 ScriptFunctionsRtz::o1_ISSND(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfAddScreenMask(int16 argc, int16 *argv) {
+ _vm->_screen->drawMask(argv[2], argv[1], argv[0]);
+ return 0;
+}
+
+int16 ScriptFunctions::sfSetSpriteMask(int16 argc, int16 *argv) {
+ _vm->_screen->setMask(argv[0]);
+ return 0;
+}
+
+int16 ScriptFunctions::sfSoundPlaying(int16 argc, int16 *argv) {
if (_vm->_mixer->isSoundHandleActive(_audioStreamHandle))
return 1;
else
return 0;
}
-int16 ScriptFunctionsRtz::o1_STOPSND(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfStopSound(int16 argc, int16 *argv) {
_vm->_mixer->stopHandle(_audioStreamHandle);
+ _vm->_autoStopSound = false;
return 0;
}
-int16 ScriptFunctionsRtz::o1_PLAYVOICE(int16 argc, int16 *argv) {
- if (argv[0] > 0) {
- if (!_vm->_mixer->isSoundHandleActive(_voiceStreamHandle)) {
- _vm->_mixer->playInputStream(Audio::Mixer::kPlainSoundType, &_voiceStreamHandle,
- _vm->_res->getSound(argv[0])->getAudioStream(_vm->_soundRate, false));
- }
+int16 ScriptFunctions::sfPlayVoice(int16 argc, int16 *argv) {
+ int16 soundNum = argv[0];
+ _vm->_mixer->stopHandle(_audioStreamHandle);
+ if (soundNum > 0) {
+ _vm->_mixer->playInputStream(Audio::Mixer::kPlainSoundType, &_audioStreamHandle,
+ _vm->_res->getSound(soundNum)->getAudioStream(_vm->_soundRate, false));
+ _vm->_autoStopSound = true;
}
return 0;
}
-int16 ScriptFunctionsRtz::o1_CDPLAY(int16 argc, int16 *argv) {
- // This one is called loads of times, so it has been commented out to reduce spam
- //warning("Unimplemented opcode: o1_CDPLAY");
+int16 ScriptFunctions::sfPlayCd(int16 argc, int16 *argv) {
+ AudioCD.play(argv[0], -1, 0, 0);
return 0;
}
-int16 ScriptFunctionsRtz::o1_STOPCD(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_STOPCD");
- return 0;
+int16 ScriptFunctions::sfStopCd(int16 argc, int16 *argv) {
+ if (AudioCD.isPlaying()) {
+ AudioCD.stop();
+ return 1;
+ } else {
+ return 0;
+ }
}
-int16 ScriptFunctionsRtz::o1_CDSTATUS(int16 argc, int16 *argv) {
- // This one is called loads of times, so it has been commented out to reduce spam
- //warning("Unimplemented opcode: o1_CDSTATUS");
- return 0;
+int16 ScriptFunctions::sfGetCdStatus(int16 argc, int16 *argv) {
+ return AudioCD.isPlaying() ? 1 : 0;
}
-int16 ScriptFunctionsRtz::o1_CDTIME(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_CDTIME");
+int16 ScriptFunctions::sfGetCdTime(int16 argc, int16 *argv) {
+ // This one is called loads of times, so it has been commented out to reduce spam
+ //warning("Unimplemented opcode: sfGetCdTime");
+ // TODO
return 0;
}
-int16 ScriptFunctionsRtz::o1_CDPLAYSEG(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_CDPLAYSEG");
+int16 ScriptFunctions::sfPlayCdSegment(int16 argc, int16 *argv) {
+ // Never used in LGOP2, RTZ, Manhole:NE
+ warning("Unimplemented opcode: sfPlayCdSegment");
return 0;
}
-int16 ScriptFunctionsRtz::o1_PRINTF(int16 argc, int16 *argv) {
- Object *obj = _vm->_dat->getObject(argv[argc - 1]);
- const char *text = obj->getString();
+int16 ScriptFunctions::sfPrintf(int16 argc, int16 *argv) {
+ const char *text = _vm->_dat->getObjectString(argv[argc - 1]);
debug(4, "--> text = %s", text);
return 0;
}
-int16 ScriptFunctionsRtz::o1_MONOCLS(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_MONOCLS");
+int16 ScriptFunctions::sfClearMono(int16 argc, int16 *argv) {
+ // Never used in LGOP2, RTZ, Manhole:NE
+ warning("Unimplemented opcode: sfClearMono");
return 0;
}
-int16 ScriptFunctionsRtz::o1_SNDENERGY(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfGetSoundEnergy(int16 argc, int16 *argv) {
// This is called while in-game voices are played
// Not sure what it's used for
// -> It's used to animate mouths when NPCs are talking
- // Commented out to reduce spam
- //warning("Unimplemented opcode: o1_SNDENERGY");
- return 0;
+ // FIXME: This is a workaround for the "sound energy" problem
+ // At least the characters move their lips when talking now
+ return _vm->_rnd->getRandomNumber(5);
}
-int16 ScriptFunctionsRtz::o1_CLEARTEXT(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_CLEARTEXT");
+int16 ScriptFunctions::sfClearText(int16 argc, int16 *argv) {
+ // Never used in LGOP2, RTZ, Manhole:NE
+ warning("Unimplemented opcode: sfClearText");
return 1;
}
-int16 ScriptFunctionsRtz::o1_ANIMTEXT(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_ANIMTEXT");
+int16 ScriptFunctions::sfAnimText(int16 argc, int16 *argv) {
+ // Never used in LGOP2, RTZ, Manhole:NE
+ warning("Unimplemented opcode: sfAnimText");
return 0;
}
-int16 ScriptFunctionsRtz::o1_TEXTWIDTH(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfGetTextWidth(int16 argc, int16 *argv) {
int16 width = 0;
if (argv[1] > 0) {
- Object *obj = _vm->_dat->getObject(argv[1]);
- const char *text = obj->getString();
+ const char *text = _vm->_dat->getObjectString(argv[1]);
width = _vm->_screen->getTextWidth(argv[0], text);
}
return width;
}
-int16 ScriptFunctionsRtz::o1_PLAYMOVIE(int16 argc, int16 *argv) {
- const char *movieName = _vm->_dat->getObject(argv[1])->getString();
+int16 ScriptFunctions::sfPlayMovie(int16 argc, int16 *argv) {
+ const char *movieName = _vm->_dat->getObjectString(argv[1]);
+ _vm->_system->showMouse(false);
_vm->_pmvPlayer->play(movieName);
+ _vm->_system->showMouse(true);
return 0;
}
-int16 ScriptFunctionsRtz::o1_LOADSND(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfLoadSound(int16 argc, int16 *argv) {
SoundResource *sound = _vm->_res->getSound(argv[0]);
if (sound) {
_vm->_res->freeResource(sound);
@@ -590,8 +639,8 @@ int16 ScriptFunctionsRtz::o1_LOADSND(int16 argc, int16 *argv) {
return 0;
}
-int16 ScriptFunctionsRtz::o1_LOADMUS(int16 argc, int16 *argv) {
- XmidiResource *xmidi = _vm->_res->getXmidi(argv[0]);
+int16 ScriptFunctions::sfLoadMusic(int16 argc, int16 *argv) {
+ GenericResource *xmidi = _vm->_res->getXmidi(argv[0]);
if (xmidi) {
_vm->_res->freeResource(xmidi);
return 1;
@@ -599,7 +648,7 @@ int16 ScriptFunctionsRtz::o1_LOADMUS(int16 argc, int16 *argv) {
return 0;
}
-int16 ScriptFunctionsRtz::o1_LOADPIC(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfLoadPicture(int16 argc, int16 *argv) {
PictureResource *flex = _vm->_res->getPicture(argv[0]);
if (flex) {
_vm->_res->freeResource(flex);
@@ -608,83 +657,92 @@ int16 ScriptFunctionsRtz::o1_LOADPIC(int16 argc, int16 *argv) {
return 0;
}
-int16 ScriptFunctionsRtz::o1_MUSICVOL(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_MUSICVOL");
+int16 ScriptFunctions::sfSetMusicVolume(int16 argc, int16 *argv) {
+ // Never used in LGOP2, RTZ, Manhole:NE
+ warning("Unimplemented opcode: sfSetMusicVolume");
return 0;
}
-int16 ScriptFunctionsRtz::o1_RESTARTEVENTS(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_RESTARTEVENTS");
+int16 ScriptFunctions::sfRestartEvents(int16 argc, int16 *argv) {
+ // Used in RTZ
+ //warning("Unimplemented opcode: sfRestartEvents");
+ // This is used to reset the event recording/queue.
+ // Since we don't use either it's left out.
return 0;
}
-int16 ScriptFunctionsRtz::o1_PLACESPRITE(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfPlaceSprite(int16 argc, int16 *argv) {
return _vm->_screen->placeSprite(argv[3], argv[2], argv[1], argv[0]);
}
-int16 ScriptFunctionsRtz::o1_PLACETEXT(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfPlaceText(int16 argc, int16 *argv) {
return _vm->_screen->placeText(argv[6], argv[5], argv[4], argv[3], argv[2], argv[1], argv[0]);
}
-int16 ScriptFunctionsRtz::o1_DELETECHANNEL(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfDeleteChannel(int16 argc, int16 *argv) {
_vm->_screen->deleteChannel(argv[0]);
return 0;
}
-int16 ScriptFunctionsRtz::o1_CHANNELTYPE(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfGetChannelType(int16 argc, int16 *argv) {
return _vm->_screen->getChannelType(argv[0]);
}
-int16 ScriptFunctionsRtz::o1_SETSTATE(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfSetChannelState(int16 argc, int16 *argv) {
_vm->_screen->setChannelState(argv[1], argv[0]);
return 0;
}
-int16 ScriptFunctionsRtz::o1_SETLOCATION(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_SETLOCATION");
+int16 ScriptFunctions::sfSetChannelLocation(int16 argc, int16 *argv) {
+ // Never used in LGOP2, RTZ, Manhole:NE
+ warning("Unimplemented opcode: sfSetChannelLocation");
return 0;
}
-int16 ScriptFunctionsRtz::o1_SETCONTENT(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_SETCONTENT");
+int16 ScriptFunctions::sfSetChannelContent(int16 argc, int16 *argv) {
+ // Never used in LGOP2, RTZ, Manhole:NE
+ warning("Unimplemented opcode: sfSetChannelContent");
return 0;
}
-int16 ScriptFunctionsRtz::o1_EXCLUDEAREA(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_EXCLUDEAREA");
+int16 ScriptFunctions::sfSetExcludeArea(int16 argc, int16 *argv) {
+ _vm->_screen->setExcludeArea(argv[3], argv[2], argv[1], argv[0]);
return 0;
}
-int16 ScriptFunctionsRtz::o1_SETEXCLUDE(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfSetSpriteExclude(int16 argc, int16 *argv) {
_vm->_screen->setExclude(argv[0]);
return 0;
}
-int16 ScriptFunctionsRtz::o1_GETSTATE(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfGetChannelState(int16 argc, int16 *argv) {
return _vm->_screen->getChannelState(argv[0]);
}
-int16 ScriptFunctionsRtz::o1_PLACEANIM(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfPlaceAnim(int16 argc, int16 *argv) {
return _vm->_screen->placeAnim(argv[4], argv[3], argv[2], argv[1], argv[0]);
}
-int16 ScriptFunctionsRtz::o1_SETFRAME(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfSetAnimFrame(int16 argc, int16 *argv) {
_vm->_screen->setAnimFrame(argv[1], argv[0]);
return 0;
}
-int16 ScriptFunctionsRtz::o1_GETFRAME(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfGetAnimFrame(int16 argc, int16 *argv) {
return _vm->_screen->getAnimFrame(argv[0]);
}
-int16 ScriptFunctionsRtz::o1_GETFRAMECOUNT(int16 argc, int16 *argv) {
- debug(4, "anim = %04X\n", argv[0]);
- int16 frameCount = _vm->_screen->getAnimFrameCount(argv[0]);
- debug(4, "frameCount = %04X\n", frameCount);
+int16 ScriptFunctions::sfGetAnimFrameCount(int16 argc, int16 *argv) {
+ int16 frameCount = 0;
+ AnimationResource *anim = _vm->_res->getAnimation(argv[0]);
+ if (anim) {
+ frameCount = anim->getCount();
+ _vm->_res->freeResource(anim);
+ }
return frameCount;
}
-int16 ScriptFunctionsRtz::o1_PICWIDTH(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfGetPictureWidth(int16 argc, int16 *argv) {
int16 width = 0;
PictureResource *flex = _vm->_res->getPicture(argv[0]);
if (flex) {
@@ -694,7 +752,7 @@ int16 ScriptFunctionsRtz::o1_PICWIDTH(int16 argc, int16 *argv) {
return width;
}
-int16 ScriptFunctionsRtz::o1_PICHEIGHT(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfGetPictureHeight(int16 argc, int16 *argv) {
int16 height = 0;
PictureResource *flex = _vm->_res->getPicture(argv[0]);
if (flex) {
@@ -704,17 +762,16 @@ int16 ScriptFunctionsRtz::o1_PICHEIGHT(int16 argc, int16 *argv) {
return height;
}
-int16 ScriptFunctionsRtz::o1_SOUNDRATE(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfSetSoundRate(int16 argc, int16 *argv) {
_vm->_soundRate = argv[0];
return 1;
}
-int16 ScriptFunctionsRtz::o1_DRAWANIMPIC(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_DRAWANIMPIC");
- return 0;
+int16 ScriptFunctions::sfDrawAnimPic(int16 argc, int16 *argv) {
+ return _vm->_screen->drawAnimPic(argv[5], argv[4], argv[3], argv[2], argv[1], argv[0]);
}
-int16 ScriptFunctionsRtz::o1_LOADANIM(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfLoadAnim(int16 argc, int16 *argv) {
AnimationResource *anim = _vm->_res->getAnimation(argv[0]);
if (anim) {
_vm->_res->freeResource(anim);
@@ -723,12 +780,13 @@ int16 ScriptFunctionsRtz::o1_LOADANIM(int16 argc, int16 *argv) {
return 0;
}
-int16 ScriptFunctionsRtz::o1_READTEXT(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_READTEXT");
+int16 ScriptFunctions::sfReadText(int16 argc, int16 *argv) {
+ // Never used in LGOP2, RTZ, Manhole:NE
+ warning("Unimplemented opcode: sfReadText");
return 0;
}
-int16 ScriptFunctionsRtz::o1_READMENU(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfReadMenu(int16 argc, int16 *argv) {
int16 objectIndex = argv[2];
int16 menuIndex = argv[1];
int16 textIndex = argv[0];
@@ -737,16 +795,17 @@ int16 ScriptFunctionsRtz::o1_READMENU(int16 argc, int16 *argv) {
if (menu) {
const char *text = menu->getString(textIndex);
debug(4, "objectIndex = %04X; text = %s\n", objectIndex, text);
- Object *obj = _vm->_dat->getObject(objectIndex);
- obj->setString(text);
+ _vm->_dat->setObjectString(objectIndex, text);
_vm->_res->freeResource(menu);
if (text)
length = strlen(text);
+ } else {
+ _vm->_dat->setObjectString(objectIndex, "");
}
return length;
}
-int16 ScriptFunctionsRtz::o1_DRAWMENU(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfDrawMenu(int16 argc, int16 *argv) {
int16 menuIndex = argv[1];
int16 textIndex = argv[0];
MenuResource *menu = _vm->_res->getMenu(menuIndex);
@@ -759,7 +818,7 @@ int16 ScriptFunctionsRtz::o1_DRAWMENU(int16 argc, int16 *argv) {
return 0;
}
-int16 ScriptFunctionsRtz::o1_MENUCOUNT(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfGetMenuCount(int16 argc, int16 *argv) {
int16 menuIndex = argv[0];
int16 count = 0;
MenuResource *menu = _vm->_res->getMenu(menuIndex);
@@ -770,7 +829,7 @@ int16 ScriptFunctionsRtz::o1_MENUCOUNT(int16 argc, int16 *argv) {
return count;
}
-int16 ScriptFunctionsRtz::o1_SAVEGAME(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfSaveGame(int16 argc, int16 *argv) {
int16 saveNum = argv[2];
int16 descObjectIndex = argv[1];
@@ -779,18 +838,13 @@ int16 ScriptFunctionsRtz::o1_SAVEGAME(int16 argc, int16 *argv) {
if (saveNum > 999)
return 6;
- Object *obj = _vm->_dat->getObject(descObjectIndex);
- const char *description = obj->getString();
-
- // TODO: Use better filename
- char filename[256];
- snprintf(filename, 256, "rtz.%03d", saveNum);
-
- return _vm->_dat->savegame(filename, description, version);
+ const char *description = _vm->_dat->getObjectString(descObjectIndex);
+ Common::String filename = _vm->getSavegameFilename(saveNum);
+ return _vm->_dat->savegame(filename.c_str(), description, version);
}
-int16 ScriptFunctionsRtz::o1_LOADGAME(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfLoadGame(int16 argc, int16 *argv) {
int16 saveNum = argv[1];
int16 version = argv[0];
@@ -798,15 +852,12 @@ int16 ScriptFunctionsRtz::o1_LOADGAME(int16 argc, int16 *argv) {
if (saveNum > 999)
return 1;
- // TODO: Use better filename
- char filename[256];
- snprintf(filename, 256, "rtz.%03d", saveNum);
-
- return _vm->_dat->loadgame(filename, version);
+ Common::String filename = _vm->getSavegameFilename(saveNum);
+ return _vm->_dat->loadgame(filename.c_str(), version);
}
-int16 ScriptFunctionsRtz::o1_GAMENAME(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfGetGameDescription(int16 argc, int16 *argv) {
int16 descObjectIndex = argv[2];
int16 saveNum = argv[1];
@@ -816,50 +867,51 @@ int16 ScriptFunctionsRtz::o1_GAMENAME(int16 argc, int16 *argv) {
if (saveNum > 999)
return 1;
- // TODO: Use better filename
- char filename[256];
- snprintf(filename, 256, "rtz.%03d", saveNum);
-
- Object *obj = _vm->_dat->getObject(descObjectIndex);
+ Common::String filename = _vm->getSavegameFilename(saveNum);
- if (_vm->_dat->getSavegameDescription(filename, description)) {
- obj->setString(description.c_str());
+ if (_vm->_dat->getSavegameDescription(filename.c_str(), description)) {
+ _vm->_dat->setObjectString(descObjectIndex, description.c_str());
return 0;
} else {
- obj->setString("");
+ _vm->_dat->setObjectString(descObjectIndex, "");
return 1;
}
}
-int16 ScriptFunctionsRtz::o1_SHAKESCREEN(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_SHAKESCREEN");
+int16 ScriptFunctions::sfShakeScreen(int16 argc, int16 *argv) {
+ // TODO: Used in RTZ
+ warning("Unimplemented opcode: sfShakeScreen");
return 0;
}
-int16 ScriptFunctionsRtz::o1_PLACEMENU(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_PLACEMENU");
+int16 ScriptFunctions::sfPlaceMenu(int16 argc, int16 *argv) {
+ // Never used in LGOP2, RTZ, Manhole:NE
+ warning("Unimplemented opcode: sfPlaceMenu");
return 0;
}
-int16 ScriptFunctionsRtz::o1_SETVOLUME(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfSetSoundVolume(int16 argc, int16 *argv) {
_vm->_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, argv[0] * 25);
_vm->_mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, argv[0] * 25);
return 0;
}
-int16 ScriptFunctionsRtz::o1_WHATSYNTH(int16 argc, int16 *argv) {
+int16 ScriptFunctions::sfGetSynthType(int16 argc, int16 *argv) {
// 0 = Default
// 1 = PCSPKR
// 2 = SBFM/ADLIB
// 3 = ADLIBG
// 4 = MT32MPU
- warning("Unimplemented opcode: o1_WHATSYNTH");
+ warning("Unimplemented opcode: sfGetSynthType");
return 0;
}
-int16 ScriptFunctionsRtz::o1_SLOWSYSTEM(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_SLOWSYSTEM");
+int16 ScriptFunctions::sfIsSlowSystem(int16 argc, int16 *argv) {
+ //warning("Unimplemented opcode: sfIsSlowSystem");
+ // NOTE: In the original engine this value is set via a command-line parameter
+ // I don't think it's needed here
+ // One could maybe think about returning 1 here on actually slower systems.
return 0;
}
diff --git a/engines/made/scriptfuncs.h b/engines/made/scriptfuncs.h
index 7e826a9f5e..9879556c3f 100644
--- a/engines/made/scriptfuncs.h
+++ b/engines/made/scriptfuncs.h
@@ -31,6 +31,8 @@
#include "common/func.h"
#include "common/stream.h"
+#include "made/resource.h"
+
namespace Made {
class MadeEngine;
@@ -40,260 +42,133 @@ typedef Common::Functor2<int16, int16*, int16> ExternalFunc;
class ScriptFunctions {
public:
ScriptFunctions(MadeEngine *vm) : _vm(vm) {}
- virtual ~ScriptFunctions() {}
+ virtual ~ScriptFunctions() {
+ for (uint i = 0; i < _externalFuncs.size(); ++i)
+ delete _externalFuncs[i];
+ }
int16 callFunction(uint16 index, int16 argc, int16 *argv) {
- if (index >= _externalFuncs.size()) {
- // TODO: ERROR!
- return 0;
- }
+ if (index >= _externalFuncs.size())
+ error("ScriptFunctions::callFunction() Invalid function index %d", index);
+ debug(4, "%s", _externalFuncNames[index]);
return (*_externalFuncs[index])(argc, argv);
}
- virtual void setupExternalsTable() = 0;
+ void setupExternalsTable();
+ const char* getFuncName(int index) { return _externalFuncNames[index]; }
+ int getCount() const { return _externalFuncs.size(); }
protected:
MadeEngine *_vm;
Audio::SoundHandle _audioStreamHandle;
Audio::SoundHandle _voiceStreamHandle;
Common::Array<const ExternalFunc*> _externalFuncs;
+ Common::Array<const char *> _externalFuncNames;
+ GenericResource *_musicRes;
+
+ int16 sfSystemCall(int16 argc, int16 *argv);
+ int16 sfInitGraf(int16 argc, int16 *argv);
+ int16 sfRestoreGraf(int16 argc, int16 *argv);
+ int16 sfDrawPicture(int16 argc, int16 *argv);
+ int16 sfClearScreen(int16 argc, int16 *argv);
+ int16 sfShowPage(int16 argc, int16 *argv);
+ int16 sfPollEvent(int16 argc, int16 *argv);
+ int16 sfGetMouseX(int16 argc, int16 *argv);
+ int16 sfGetMouseY(int16 argc, int16 *argv);
+ int16 sfGetKey(int16 argc, int16 *argv);
+ int16 sfSetVisualEffect(int16 argc, int16 *argv);
+ int16 sfPlaySound(int16 argc, int16 *argv);
+ int16 sfPlayMusic(int16 argc, int16 *argv);
+ int16 sfStopMusic(int16 argc, int16 *argv);
+ int16 sfIsMusicPlaying(int16 argc, int16 *argv);
+ int16 sfSetTextPos(int16 argc, int16 *argv);
+ int16 sfFlashScreen(int16 argc, int16 *argv);
+ int16 sfPlayNote(int16 argc, int16 *argv);
+ int16 sfStopNote(int16 argc, int16 *argv);
+ int16 sfPlayTele(int16 argc, int16 *argv);
+ int16 sfStopTele(int16 argc, int16 *argv);
+ int16 sfHideMouseCursor(int16 argc, int16 *argv);
+ int16 sfShowMouseCursor(int16 argc, int16 *argv);
+ int16 sfGetMusicBeat(int16 argc, int16 *argv);
+ int16 sfSetScreenLock(int16 argc, int16 *argv);
+ int16 sfAddSprite(int16 argc, int16 *argv);
+ int16 sfFreeAnim(int16 argc, int16 *argv);
+ int16 sfDrawSprite(int16 argc, int16 *argv);
+ int16 sfEraseSprites(int16 argc, int16 *argv);
+ int16 sfUpdateSprites(int16 argc, int16 *argv);
+ int16 sfGetTimer(int16 argc, int16 *argv);
+ int16 sfSetTimer(int16 argc, int16 *argv);
+ int16 sfResetTimer(int16 argc, int16 *argv);
+ int16 sfAllocTimer(int16 argc, int16 *argv);
+ int16 sfFreeTimer(int16 argc, int16 *argv);
+ int16 sfSetPaletteLock(int16 argc, int16 *argv);
+ int16 sfSetFont(int16 argc, int16 *argv);
+ int16 sfDrawText(int16 argc, int16 *argv);
+ int16 sfHomeText(int16 argc, int16 *argv);
+ int16 sfSetTextRect(int16 argc, int16 *argv);
+ int16 sfSetTextXY(int16 argc, int16 *argv);
+ int16 sfSetFontDropShadow(int16 argc, int16 *argv);
+ int16 sfSetFontColor(int16 argc, int16 *argv);
+ int16 sfSetFontOutline(int16 argc, int16 *argv);
+ int16 sfLoadMouseCursor(int16 argc, int16 *argv);
+ int16 sfSetSpriteGround(int16 argc, int16 *argv);
+ int16 sfLoadResText(int16 argc, int16 *argv);
+ int16 sfSetClipArea(int16 argc, int16 *argv);
+ int16 sfSetSpriteClip(int16 argc, int16 *argv);
+ int16 sfAddScreenMask(int16 argc, int16 *argv);
+ int16 sfSetSpriteMask(int16 argc, int16 *argv);
+ int16 sfSoundPlaying(int16 argc, int16 *argv);
+ int16 sfStopSound(int16 argc, int16 *argv);
+ int16 sfPlayVoice(int16 argc, int16 *argv);
+ int16 sfPlayCd(int16 argc, int16 *argv);
+ int16 sfStopCd(int16 argc, int16 *argv);
+ int16 sfGetCdStatus(int16 argc, int16 *argv);
+ int16 sfGetCdTime(int16 argc, int16 *argv);
+ int16 sfPlayCdSegment(int16 argc, int16 *argv);
+ int16 sfPrintf(int16 argc, int16 *argv);
+ int16 sfClearMono(int16 argc, int16 *argv);
+ int16 sfGetSoundEnergy(int16 argc, int16 *argv);
+ int16 sfClearText(int16 argc, int16 *argv);
+ int16 sfAnimText(int16 argc, int16 *argv);
+ int16 sfGetTextWidth(int16 argc, int16 *argv);
+ int16 sfPlayMovie(int16 argc, int16 *argv);
+ int16 sfLoadSound(int16 argc, int16 *argv);
+ int16 sfLoadMusic(int16 argc, int16 *argv);
+ int16 sfLoadPicture(int16 argc, int16 *argv);
+ int16 sfSetMusicVolume(int16 argc, int16 *argv);
+ int16 sfRestartEvents(int16 argc, int16 *argv);
+ int16 sfPlaceSprite(int16 argc, int16 *argv);
+ int16 sfPlaceText(int16 argc, int16 *argv);
+ int16 sfDeleteChannel(int16 argc, int16 *argv);
+ int16 sfGetChannelType(int16 argc, int16 *argv);
+ int16 sfSetChannelState(int16 argc, int16 *argv);
+ int16 sfSetChannelLocation(int16 argc, int16 *argv);
+ int16 sfSetChannelContent(int16 argc, int16 *argv);
+ int16 sfSetExcludeArea(int16 argc, int16 *argv);
+ int16 sfSetSpriteExclude(int16 argc, int16 *argv);
+ int16 sfGetChannelState(int16 argc, int16 *argv);
+ int16 sfPlaceAnim(int16 argc, int16 *argv);
+ int16 sfSetAnimFrame(int16 argc, int16 *argv);
+ int16 sfGetAnimFrame(int16 argc, int16 *argv);
+ int16 sfGetAnimFrameCount(int16 argc, int16 *argv);
+ int16 sfGetPictureWidth(int16 argc, int16 *argv);
+ int16 sfGetPictureHeight(int16 argc, int16 *argv);
+ int16 sfSetSoundRate(int16 argc, int16 *argv);
+ int16 sfDrawAnimPic(int16 argc, int16 *argv);
+ int16 sfLoadAnim(int16 argc, int16 *argv);
+ int16 sfReadText(int16 argc, int16 *argv);
+ int16 sfReadMenu(int16 argc, int16 *argv);
+ int16 sfDrawMenu(int16 argc, int16 *argv);
+ int16 sfGetMenuCount(int16 argc, int16 *argv);
+ int16 sfSaveGame(int16 argc, int16 *argv);
+ int16 sfLoadGame(int16 argc, int16 *argv);
+ int16 sfGetGameDescription(int16 argc, int16 *argv);
+ int16 sfShakeScreen(int16 argc, int16 *argv);
+ int16 sfPlaceMenu(int16 argc, int16 *argv);
+ int16 sfSetSoundVolume(int16 argc, int16 *argv);
+ int16 sfGetSynthType(int16 argc, int16 *argv);
+ int16 sfIsSlowSystem(int16 argc, int16 *argv);
};
-class ScriptFunctionsLgop2 : public ScriptFunctions {
-public:
- ScriptFunctionsLgop2(MadeEngine *vm) : ScriptFunctions(vm) {}
- ~ScriptFunctionsLgop2() {}
- void setupExternalsTable();
-protected:
-
- int16 o1_SYSTEM(int16 argc, int16 *argv);
- int16 o1_INITGRAF(int16 argc, int16 *argv);
- int16 o1_RESTOREGRAF(int16 argc, int16 *argv);
- int16 o1_DRAWPIC(int16 argc, int16 *argv);
- int16 o1_CLS(int16 argc, int16 *argv);
- int16 o1_SHOWPAGE(int16 argc, int16 *argv);
- int16 o1_EVENT(int16 argc, int16 *argv);
- int16 o1_EVENTX(int16 argc, int16 *argv);
- int16 o1_EVENTY(int16 argc, int16 *argv);
- int16 o1_EVENTKEY(int16 argc, int16 *argv);
- int16 o1_VISUALFX(int16 argc, int16 *argv);
- int16 o1_PLAYSND(int16 argc, int16 *argv);
- int16 o1_PLAYMUS(int16 argc, int16 *argv);
- int16 o1_STOPMUS(int16 argc, int16 *argv);
- int16 o1_ISMUS(int16 argc, int16 *argv);
- int16 o1_TEXTPOS(int16 argc, int16 *argv);
- int16 o1_FLASH(int16 argc, int16 *argv);
- int16 o1_PLAYNOTE(int16 argc, int16 *argv);
- int16 o1_STOPNOTE(int16 argc, int16 *argv);
- int16 o1_PLAYTELE(int16 argc, int16 *argv);
- int16 o1_STOPTELE(int16 argc, int16 *argv);
- int16 o1_HIDECURS(int16 argc, int16 *argv);
- int16 o1_SHOWCURS(int16 argc, int16 *argv);
- int16 o1_MUSICBEAT(int16 argc, int16 *argv);
- int16 o1_SCREENLOCK(int16 argc, int16 *argv);
- int16 o1_ADDSPRITE(int16 argc, int16 *argv);
- int16 o1_FREEANIM(int16 argc, int16 *argv);
- int16 o1_DRAWSPRITE(int16 argc, int16 *argv);
- int16 o1_ERASESPRITES(int16 argc, int16 *argv);
- int16 o1_UPDATESPRITES(int16 argc, int16 *argv);
- int16 o1_GETTIMER(int16 argc, int16 *argv);
- int16 o1_SETTIMER(int16 argc, int16 *argv);
- int16 o1_RESETTIMER(int16 argc, int16 *argv);
- int16 o1_ALLOCTIMER(int16 argc, int16 *argv);
- int16 o1_FREETIMER(int16 argc, int16 *argv);
- int16 o1_PALETTELOCK(int16 argc, int16 *argv);
- int16 o1_FONT(int16 argc, int16 *argv);
- int16 o1_DRAWTEXT(int16 argc, int16 *argv);
- int16 o1_HOMETEXT(int16 argc, int16 *argv);
- int16 o1_TEXTRECT(int16 argc, int16 *argv);
- int16 o1_TEXTXY(int16 argc, int16 *argv);
- int16 o1_DROPSHADOW(int16 argc, int16 *argv);
- int16 o1_TEXTCOLOR(int16 argc, int16 *argv);
- int16 o1_OUTLINE(int16 argc, int16 *argv);
- int16 o1_LOADCURSOR(int16 argc, int16 *argv);
- int16 o1_SETGROUND(int16 argc, int16 *argv);
- int16 o1_RESTEXT(int16 argc, int16 *argv);
- int16 o1_ADDMASK(int16 argc, int16 *argv);
- int16 o1_SETMASK(int16 argc, int16 *argv);
- int16 o1_ISSND(int16 argc, int16 *argv);
- int16 o1_STOPSND(int16 argc, int16 *argv);
- int16 o1_PLAYVOICE(int16 argc, int16 *argv);
-};
-
-class ScriptFunctionsRtz : public ScriptFunctions {
-public:
- ScriptFunctionsRtz(MadeEngine *vm) : ScriptFunctions(vm) {}
- ~ScriptFunctionsRtz() {}
- void setupExternalsTable();
-protected:
-
- int16 o1_SYSTEM(int16 argc, int16 *argv);
- int16 o1_INITGRAF(int16 argc, int16 *argv);
- int16 o1_RESTOREGRAF(int16 argc, int16 *argv);
- int16 o1_DRAWPIC(int16 argc, int16 *argv);
- int16 o1_CLS(int16 argc, int16 *argv);
- int16 o1_SHOWPAGE(int16 argc, int16 *argv);
- int16 o1_EVENT(int16 argc, int16 *argv);
- int16 o1_EVENTX(int16 argc, int16 *argv);
- int16 o1_EVENTY(int16 argc, int16 *argv);
- int16 o1_EVENTKEY(int16 argc, int16 *argv);
- int16 o1_VISUALFX(int16 argc, int16 *argv);
- int16 o1_PLAYSND(int16 argc, int16 *argv);
- int16 o1_PLAYMUS(int16 argc, int16 *argv);
- int16 o1_STOPMUS(int16 argc, int16 *argv);
- int16 o1_ISMUS(int16 argc, int16 *argv);
- int16 o1_TEXTPOS(int16 argc, int16 *argv);
- int16 o1_FLASH(int16 argc, int16 *argv);
- int16 o1_PLAYNOTE(int16 argc, int16 *argv);
- int16 o1_STOPNOTE(int16 argc, int16 *argv);
- int16 o1_PLAYTELE(int16 argc, int16 *argv);
- int16 o1_STOPTELE(int16 argc, int16 *argv);
- int16 o1_HIDECURS(int16 argc, int16 *argv);
- int16 o1_SHOWCURS(int16 argc, int16 *argv);
- int16 o1_MUSICBEAT(int16 argc, int16 *argv);
- int16 o1_SCREENLOCK(int16 argc, int16 *argv);
- int16 o1_ADDSPRITE(int16 argc, int16 *argv);
- int16 o1_FREEANIM(int16 argc, int16 *argv);
- int16 o1_DRAWSPRITE(int16 argc, int16 *argv);
- int16 o1_ERASESPRITES(int16 argc, int16 *argv);
- int16 o1_UPDATESPRITES(int16 argc, int16 *argv);
- int16 o1_GETTIMER(int16 argc, int16 *argv);
- int16 o1_SETTIMER(int16 argc, int16 *argv);
- int16 o1_RESETTIMER(int16 argc, int16 *argv);
- int16 o1_ALLOCTIMER(int16 argc, int16 *argv);
- int16 o1_FREETIMER(int16 argc, int16 *argv);
- int16 o1_PALETTELOCK(int16 argc, int16 *argv);
- int16 o1_FONT(int16 argc, int16 *argv);
- int16 o1_DRAWTEXT(int16 argc, int16 *argv);
- int16 o1_HOMETEXT(int16 argc, int16 *argv);
- int16 o1_TEXTRECT(int16 argc, int16 *argv);
- int16 o1_TEXTXY(int16 argc, int16 *argv);
- int16 o1_DROPSHADOW(int16 argc, int16 *argv);
- int16 o1_TEXTCOLOR(int16 argc, int16 *argv);
- int16 o1_OUTLINE(int16 argc, int16 *argv);
- int16 o1_LOADCURSOR(int16 argc, int16 *argv);
- int16 o1_SETGROUND(int16 argc, int16 *argv);
- int16 o1_RESTEXT(int16 argc, int16 *argv);
- int16 o1_CLIPAREA(int16 argc, int16 *argv);
- int16 o1_SETCLIP(int16 argc, int16 *argv);
- int16 o1_ISSND(int16 argc, int16 *argv);
- int16 o1_STOPSND(int16 argc, int16 *argv);
- int16 o1_PLAYVOICE(int16 argc, int16 *argv);
- int16 o1_CDPLAY(int16 argc, int16 *argv);
- int16 o1_STOPCD(int16 argc, int16 *argv);
- int16 o1_CDSTATUS(int16 argc, int16 *argv);
- int16 o1_CDTIME(int16 argc, int16 *argv);
- int16 o1_CDPLAYSEG(int16 argc, int16 *argv);
- int16 o1_PRINTF(int16 argc, int16 *argv);
- int16 o1_MONOCLS(int16 argc, int16 *argv);
- int16 o1_SNDENERGY(int16 argc, int16 *argv);
- int16 o1_CLEARTEXT(int16 argc, int16 *argv);
- int16 o1_ANIMTEXT(int16 argc, int16 *argv);
- int16 o1_TEXTWIDTH(int16 argc, int16 *argv);
- int16 o1_PLAYMOVIE(int16 argc, int16 *argv);
- int16 o1_LOADSND(int16 argc, int16 *argv);
- int16 o1_LOADMUS(int16 argc, int16 *argv);
- int16 o1_LOADPIC(int16 argc, int16 *argv);
- int16 o1_MUSICVOL(int16 argc, int16 *argv);
- int16 o1_RESTARTEVENTS(int16 argc, int16 *argv);
- int16 o1_PLACESPRITE(int16 argc, int16 *argv);
- int16 o1_PLACETEXT(int16 argc, int16 *argv);
- int16 o1_DELETECHANNEL(int16 argc, int16 *argv);
- int16 o1_CHANNELTYPE(int16 argc, int16 *argv);
- int16 o1_SETSTATE(int16 argc, int16 *argv);
- int16 o1_SETLOCATION(int16 argc, int16 *argv);
- int16 o1_SETCONTENT(int16 argc, int16 *argv);
- int16 o1_EXCLUDEAREA(int16 argc, int16 *argv);
- int16 o1_SETEXCLUDE(int16 argc, int16 *argv);
- int16 o1_GETSTATE(int16 argc, int16 *argv);
- int16 o1_PLACEANIM(int16 argc, int16 *argv);
- int16 o1_SETFRAME(int16 argc, int16 *argv);
- int16 o1_GETFRAME(int16 argc, int16 *argv);
- int16 o1_GETFRAMECOUNT(int16 argc, int16 *argv);
- int16 o1_PICWIDTH(int16 argc, int16 *argv);
- int16 o1_PICHEIGHT(int16 argc, int16 *argv);
- int16 o1_SOUNDRATE(int16 argc, int16 *argv);
- int16 o1_DRAWANIMPIC(int16 argc, int16 *argv);
- int16 o1_LOADANIM(int16 argc, int16 *argv);
- int16 o1_READTEXT(int16 argc, int16 *argv);
- int16 o1_READMENU(int16 argc, int16 *argv);
- int16 o1_DRAWMENU(int16 argc, int16 *argv);
- int16 o1_MENUCOUNT(int16 argc, int16 *argv);
- int16 o1_SAVEGAME(int16 argc, int16 *argv);
- int16 o1_LOADGAME(int16 argc, int16 *argv);
- int16 o1_GAMENAME(int16 argc, int16 *argv);
- int16 o1_SHAKESCREEN(int16 argc, int16 *argv);
- int16 o1_PLACEMENU(int16 argc, int16 *argv);
- int16 o1_SETVOLUME(int16 argc, int16 *argv);
- int16 o1_WHATSYNTH(int16 argc, int16 *argv);
- int16 o1_SLOWSYSTEM(int16 argc, int16 *argv);
-};
-
-class ScriptFunctionsMhne : public ScriptFunctions {
-public:
- ScriptFunctionsMhne(MadeEngine *vm) : ScriptFunctions(vm) {}
- ~ScriptFunctionsMhne() {}
- void setupExternalsTable();
-protected:
-
- int16 o1_SYSTEM(int16 argc, int16 *argv);
- int16 o1_INITGRAF(int16 argc, int16 *argv);
- int16 o1_RESTOREGRAF(int16 argc, int16 *argv);
- int16 o1_DRAWPIC(int16 argc, int16 *argv);
- int16 o1_CLS(int16 argc, int16 *argv);
- int16 o1_SHOWPAGE(int16 argc, int16 *argv);
- int16 o1_EVENT(int16 argc, int16 *argv);
- int16 o1_EVENTX(int16 argc, int16 *argv);
- int16 o1_EVENTY(int16 argc, int16 *argv);
- int16 o1_EVENTKEY(int16 argc, int16 *argv);
- int16 o1_VISUALFX(int16 argc, int16 *argv);
- int16 o1_PLAYSND(int16 argc, int16 *argv);
- int16 o1_PLAYMUS(int16 argc, int16 *argv);
- int16 o1_STOPMUS(int16 argc, int16 *argv);
- int16 o1_ISMUS(int16 argc, int16 *argv);
- int16 o1_TEXTPOS(int16 argc, int16 *argv);
- int16 o1_FLASH(int16 argc, int16 *argv);
- int16 o1_PLAYNOTE(int16 argc, int16 *argv);
- int16 o1_STOPNOTE(int16 argc, int16 *argv);
- int16 o1_PLAYTELE(int16 argc, int16 *argv);
- int16 o1_STOPTELE(int16 argc, int16 *argv);
- int16 o1_HIDECURS(int16 argc, int16 *argv);
- int16 o1_SHOWCURS(int16 argc, int16 *argv);
- int16 o1_MUSICBEAT(int16 argc, int16 *argv);
- int16 o1_SCREENLOCK(int16 argc, int16 *argv);
- int16 o1_ADDSPRITE(int16 argc, int16 *argv);
- int16 o1_FREEANIM(int16 argc, int16 *argv);
- int16 o1_DRAWSPRITE(int16 argc, int16 *argv);
- int16 o1_ERASESPRITES(int16 argc, int16 *argv);
- int16 o1_UPDATESPRITES(int16 argc, int16 *argv);
- int16 o1_GETTIMER(int16 argc, int16 *argv);
- int16 o1_SETTIMER(int16 argc, int16 *argv);
- int16 o1_RESETTIMER(int16 argc, int16 *argv);
- int16 o1_ALLOCTIMER(int16 argc, int16 *argv);
- int16 o1_FREETIMER(int16 argc, int16 *argv);
- int16 o1_PALETTELOCK(int16 argc, int16 *argv);
- int16 o1_FONT(int16 argc, int16 *argv);
- int16 o1_DRAWTEXT(int16 argc, int16 *argv);
- int16 o1_HOMETEXT(int16 argc, int16 *argv);
- int16 o1_TEXTRECT(int16 argc, int16 *argv);
- int16 o1_TEXTXY(int16 argc, int16 *argv);
- int16 o1_DROPSHADOW(int16 argc, int16 *argv);
- int16 o1_TEXTCOLOR(int16 argc, int16 *argv);
- int16 o1_OUTLINE(int16 argc, int16 *argv);
- int16 o1_LOADCURSOR(int16 argc, int16 *argv);
- int16 o1_SETGROUND(int16 argc, int16 *argv);
- int16 o1_RESTEXT(int16 argc, int16 *argv);
- int16 o1_ADDMASK(int16 argc, int16 *argv);
- int16 o1_SETMASK(int16 argc, int16 *argv);
- int16 o1_ISSND(int16 argc, int16 *argv);
- int16 o1_STOPSND(int16 argc, int16 *argv);
- int16 o1_PLAYVOICE(int16 argc, int16 *argv);
- int16 o1_CDPLAY(int16 argc, int16 *argv);
- int16 o1_STOPCD(int16 argc, int16 *argv);
- int16 o1_CDSTATUS(int16 argc, int16 *argv);
- int16 o1_CDTIME(int16 argc, int16 *argv);
- int16 o1_CDPLAYSEG(int16 argc, int16 *argv);
-};
-
} // End of namespace Made
#endif /* MADE_H */
diff --git a/engines/made/scriptfuncs_lgop2.cpp b/engines/made/scriptfuncs_lgop2.cpp
deleted file mode 100644
index 579492a39e..0000000000
--- a/engines/made/scriptfuncs_lgop2.cpp
+++ /dev/null
@@ -1,467 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- *
- */
-
-#include "common/endian.h"
-#include "common/util.h"
-#include "common/events.h"
-
-#include "graphics/cursorman.h"
-
-#include "made/made.h"
-#include "made/resource.h"
-#include "made/database.h"
-#include "made/screen.h"
-#include "made/script.h"
-#include "made/pmvplayer.h"
-#include "made/scriptfuncs.h"
-#include "made/music.h"
-
-namespace Made {
-
-/* ScriptFunctionsLgop2 */
-
-typedef Common::Functor2Mem<int16, int16*, int16, ScriptFunctionsLgop2> ExternalFuncLgop2;
-#define External(x) ExternalFuncLgop2(this, &ScriptFunctionsLgop2::x)
-void ScriptFunctionsLgop2::setupExternalsTable() {
- static const ExternalFuncLgop2 externalsTable[] = {
- External(o1_SYSTEM),
- External(o1_INITGRAF),
- External(o1_RESTOREGRAF),
- External(o1_DRAWPIC),
- External(o1_CLS),
- External(o1_SHOWPAGE),
- External(o1_EVENT),
- External(o1_EVENTX),
- External(o1_EVENTY),
- External(o1_EVENTKEY),
- External(o1_VISUALFX),
- External(o1_PLAYSND),
- External(o1_PLAYMUS),
- External(o1_STOPMUS),
- External(o1_ISMUS),
- External(o1_TEXTPOS),
- External(o1_FLASH),
- External(o1_PLAYNOTE),
- External(o1_STOPNOTE),
- External(o1_PLAYTELE),
- External(o1_STOPTELE),
- External(o1_HIDECURS),
- External(o1_SHOWCURS),
- External(o1_MUSICBEAT),
- External(o1_SCREENLOCK),
- External(o1_ADDSPRITE),
- External(o1_FREEANIM),
- External(o1_DRAWSPRITE),
- External(o1_ERASESPRITES),
- External(o1_UPDATESPRITES),
- External(o1_GETTIMER),
- External(o1_SETTIMER),
- External(o1_RESETTIMER),
- External(o1_ALLOCTIMER),
- External(o1_FREETIMER),
- External(o1_PALETTELOCK),
- External(o1_FONT),
- External(o1_DRAWTEXT),
- External(o1_HOMETEXT),
- External(o1_TEXTRECT),
- External(o1_TEXTXY),
- External(o1_DROPSHADOW),
- External(o1_TEXTCOLOR),
- External(o1_OUTLINE),
- External(o1_LOADCURSOR),
- External(o1_SETGROUND),
- External(o1_RESTEXT),
- External(o1_ADDMASK),
- External(o1_SETMASK),
- External(o1_ISSND),
- External(o1_STOPSND),
- External(o1_PLAYVOICE)
- };
-
- for (int i = 0; i < ARRAYSIZE(externalsTable); ++i)
- _externalFuncs.push_back(&externalsTable[i]);
-
-}
-#undef External
-
-int16 ScriptFunctionsLgop2::o1_SYSTEM(int16 argc, int16 *argv) {
- // This opcode is empty.
- return 0;
-}
-
-int16 ScriptFunctionsLgop2::o1_INITGRAF(int16 argc, int16 *argv) {
- // This opcode is empty.
- return 0;
-}
-
-int16 ScriptFunctionsLgop2::o1_RESTOREGRAF(int16 argc, int16 *argv) {
- // This opcode is empty.
- return 0;
-}
-
-int16 ScriptFunctionsLgop2::o1_DRAWPIC(int16 argc, int16 *argv) {
- return _vm->_screen->drawPic(argv[4], argv[3], argv[2], argv[1], argv[0]);
-}
-
-int16 ScriptFunctionsLgop2::o1_CLS(int16 argc, int16 *argv) {
- _vm->_screen->clearScreen();
- return 0;
-}
-
-int16 ScriptFunctionsLgop2::o1_SHOWPAGE(int16 argc, int16 *argv) {
- _vm->_screen->show();
- return 0;
-}
-
-int16 ScriptFunctionsLgop2::o1_EVENT(int16 argc, int16 *argv) {
-
- Common::Event event;
- Common::EventManager *eventMan = g_system->getEventManager();
-
- int16 eventNum = 0;
-
- if (eventMan->pollEvent(event)) {
- switch (event.type) {
-
- case Common::EVENT_MOUSEMOVE:
- _vm->_eventMouseX = event.mouse.x;
- _vm->_eventMouseY = event.mouse.y;
- break;
-
- case Common::EVENT_LBUTTONDOWN:
- eventNum = 1;
- break;
-
- /*
- case Common::EVENT_LBUTTONUP:
- eventNum = 2; // TODO: Is this correct?
- break;
- */
-
- case Common::EVENT_RBUTTONDOWN:
- eventNum = 3;
- break;
-
- /*
- case Common::EVENT_RBUTTONUP:
- eventNum = 4; // TODO: Is this correct?
- break;
- */
-
- case Common::EVENT_KEYDOWN:
- _vm->_eventKey = event.kbd.ascii;
- eventNum = 5;
- break;
-
- case Common::EVENT_QUIT:
- // TODO: Exit more gracefully.
- g_system->quit();
- break;
-
- default:
- break;
-
- }
- }
-
- _vm->_system->updateScreen();
-
- return eventNum;
-}
-
-int16 ScriptFunctionsLgop2::o1_EVENTX(int16 argc, int16 *argv) {
- return _vm->_eventMouseX;
-}
-
-int16 ScriptFunctionsLgop2::o1_EVENTY(int16 argc, int16 *argv) {
- return _vm->_eventMouseY;
-}
-
-int16 ScriptFunctionsLgop2::o1_EVENTKEY(int16 argc, int16 *argv) {
- return _vm->_eventKey;
-}
-
-int16 ScriptFunctionsLgop2::o1_VISUALFX(int16 argc, int16 *argv) {
- _vm->_screen->setVisualEffectNum(argv[0]);
- return 0;
-}
-
-int16 ScriptFunctionsLgop2::o1_PLAYSND(int16 argc, int16 *argv) {
- int soundNum = argv[0];
- bool loop = false;
-
- if (argc > 1) {
- soundNum = argv[1];
- loop = (argv[0] == 1);
- }
-
- if (soundNum > 0) {
- if (!_vm->_mixer->isSoundHandleActive(_audioStreamHandle)) {
- _vm->_mixer->playInputStream(Audio::Mixer::kPlainSoundType, &_audioStreamHandle,
- _vm->_res->getSound(soundNum)->getAudioStream(_vm->_soundRate, loop));
- }
- }
-
- return 0;
-}
-
-int16 ScriptFunctionsLgop2::o1_PLAYMUS(int16 argc, int16 *argv) {
- /*
-
- Disabled for now since MIDI player doesn't support all commands
- which results in strange behavior.
-
- int16 musicNum = argv[0];
- if (musicNum > 0) {
- GenericResource *midi = _vm->_res->getMidi(musicNum);
- _vm->_music->playSMF(midi);
- _vm->_res->freeResource(midi);
- }
- */
- return 0;
-}
-
-int16 ScriptFunctionsLgop2::o1_STOPMUS(int16 argc, int16 *argv) {
- _vm->_music->stop();
- return 0;
-}
-
-int16 ScriptFunctionsLgop2::o1_ISMUS(int16 argc, int16 *argv) {
- if (_vm->_music->isPlaying())
- return 1;
- else
- return 0;
-}
-
-int16 ScriptFunctionsLgop2::o1_TEXTPOS(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_TEXTPOS");
- // This seems to be some kind of low-level opcode.
- // The original engine calls int 10h to set the VGA cursor position.
- return 0;
-}
-
-int16 ScriptFunctionsLgop2::o1_FLASH(int16 argc, int16 *argv) {
- _vm->_screen->flash(argv[0]);
- return 0;
-}
-
-int16 ScriptFunctionsLgop2::o1_PLAYNOTE(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_PLAYNOTE");
- return 0;
-}
-
-int16 ScriptFunctionsLgop2::o1_STOPNOTE(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_STOPNOTE");
- return 0;
-}
-
-int16 ScriptFunctionsLgop2::o1_PLAYTELE(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_PLAYTELE");
- return 0;
-}
-
-int16 ScriptFunctionsLgop2::o1_STOPTELE(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_STOPTELE");
- return 0;
-}
-
-int16 ScriptFunctionsLgop2::o1_HIDECURS(int16 argc, int16 *argv) {
- _vm->_system->showMouse(false);
- return 0;
-}
-
-int16 ScriptFunctionsLgop2::o1_SHOWCURS(int16 argc, int16 *argv) {
- _vm->_system->showMouse(true);
- return 0;
-}
-
-int16 ScriptFunctionsLgop2::o1_MUSICBEAT(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_MUSICBEAT");
- return 0;
-}
-
-int16 ScriptFunctionsLgop2::o1_SCREENLOCK(int16 argc, int16 *argv) {
- _vm->_screen->setScreenLock(argv[0] != 0);
- return 0;
-}
-
-int16 ScriptFunctionsLgop2::o1_ADDSPRITE(int16 argc, int16 *argv) {
- //_vm->_screen->drawSprite(argv[2], argv[1], argv[0]);
- return argv[2];
-}
-
-int16 ScriptFunctionsLgop2::o1_FREEANIM(int16 argc, int16 *argv) {
- _vm->_screen->clearChannels();
- return 0;
-}
-
-int16 ScriptFunctionsLgop2::o1_DRAWSPRITE(int16 argc, int16 *argv) {
- return _vm->_screen->drawSprite(argv[2], argv[1], argv[0]);
-}
-
-int16 ScriptFunctionsLgop2::o1_ERASESPRITES(int16 argc, int16 *argv) {
- _vm->_screen->clearChannels();
- return 0;
-}
-
-int16 ScriptFunctionsLgop2::o1_UPDATESPRITES(int16 argc, int16 *argv) {
- _vm->_screen->updateSprites();
- return 0;
-}
-
-int16 ScriptFunctionsLgop2::o1_GETTIMER(int16 argc, int16 *argv) {
- return _vm->getTimer(argv[0]);
-}
-
-int16 ScriptFunctionsLgop2::o1_SETTIMER(int16 argc, int16 *argv) {
- _vm->setTimer(argv[1], argv[0]);
- return 0;
-}
-
-int16 ScriptFunctionsLgop2::o1_RESETTIMER(int16 argc, int16 *argv) {
- _vm->resetTimer(argv[0]);
- return 0;
-}
-
-int16 ScriptFunctionsLgop2::o1_ALLOCTIMER(int16 argc, int16 *argv) {
- int16 timerNum = _vm->allocTimer();
- return timerNum;
-}
-
-int16 ScriptFunctionsLgop2::o1_FREETIMER(int16 argc, int16 *argv) {
- _vm->freeTimer(argv[0]);
- return 0;
-}
-
-int16 ScriptFunctionsLgop2::o1_PALETTELOCK(int16 argc, int16 *argv) {
- _vm->_screen->setPaletteLock(argv[0] != 0);
- return 0;
-}
-
-int16 ScriptFunctionsLgop2::o1_FONT(int16 argc, int16 *argv) {
- _vm->_screen->setFont(argv[0]);
- return 0;
-}
-
-int16 ScriptFunctionsLgop2::o1_DRAWTEXT(int16 argc, int16 *argv) {
- // TODO: Needs vsprintf to get the correct text
- const char *text = _vm->_dat->getString(argv[argc - 1]);
- _vm->_screen->printText(text);
- return 0;
-}
-
-int16 ScriptFunctionsLgop2::o1_HOMETEXT(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_HOMETEXT");
- return 0;
-}
-
-int16 ScriptFunctionsLgop2::o1_TEXTRECT(int16 argc, int16 *argv) {
- int16 x1 = CLIP<int16>(argv[4], 1, 318);
- int16 y1 = CLIP<int16>(argv[3], 1, 198);
- int16 x2 = CLIP<int16>(argv[2], 1, 318);
- int16 y2 = CLIP<int16>(argv[1], 1, 198);
- //int16 textValue = argv[0];
- // TODO: textValue
- _vm->_screen->setTextRect(Common::Rect(x1, y1, x2, y2));
- return 0;
-}
-
-int16 ScriptFunctionsLgop2::o1_TEXTXY(int16 argc, int16 *argv) {
- int16 x = CLIP<int16>(argv[1], 1, 318);
- int16 y = CLIP<int16>(argv[0], 1, 198);
- _vm->_screen->setTextXY(x, y);
- return 0;
-}
-
-int16 ScriptFunctionsLgop2::o1_DROPSHADOW(int16 argc, int16 *argv) {
- // if the drop shadow color is -1, then text drop shadow is disabled
- // when font drop shadow is enabled, outline is disabled
- _vm->_screen->setDropShadowColor(argv[0]);
- return 0;
-}
-
-int16 ScriptFunctionsLgop2::o1_TEXTCOLOR(int16 argc, int16 *argv) {
- _vm->_screen->setTextColor(argv[0]);
- return 0;
-}
-
-int16 ScriptFunctionsLgop2::o1_OUTLINE(int16 argc, int16 *argv) {
- // if the outline color is -1, then text outline is disabled
- // when font outline is enabled, drop shadow is disabled
- _vm->_screen->setOutlineColor(argv[0]);
- return 0;
-}
-
-int16 ScriptFunctionsLgop2::o1_LOADCURSOR(int16 argc, int16 *argv) {
- PictureResource *flex = _vm->_res->getPicture(argv[2]);
- Graphics::Surface *surf = flex->getPicture();
- CursorMan.replaceCursor((const byte *)surf->pixels, surf->w, surf->h, argv[1], argv[0], 0);
- CursorMan.showMouse(true);
- _vm->_res->freeResource(flex);
- return 0;
-}
-
-int16 ScriptFunctionsLgop2::o1_SETGROUND(int16 argc, int16 *argv) {
- _vm->_screen->setGround(argv[0]);
- return 0;
-}
-
-int16 ScriptFunctionsLgop2::o1_RESTEXT(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_RESTEXT");
- return 0;
-}
-
-int16 ScriptFunctionsLgop2::o1_ADDMASK(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_ADDMASK");
- return 0;
-}
-
-int16 ScriptFunctionsLgop2::o1_SETMASK(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_SETMASK");
- return 0;
-}
-
-int16 ScriptFunctionsLgop2::o1_ISSND(int16 argc, int16 *argv) {
- if (_vm->_mixer->isSoundHandleActive(_audioStreamHandle))
- return 1;
- else
- return 0;
-}
-
-int16 ScriptFunctionsLgop2::o1_STOPSND(int16 argc, int16 *argv) {
- _vm->_mixer->stopHandle(_audioStreamHandle);
- return 0;
-}
-
-int16 ScriptFunctionsLgop2::o1_PLAYVOICE(int16 argc, int16 *argv) {
- if (argv[0] > 0) {
- _vm->_mixer->stopHandle(_audioStreamHandle);
- _vm->_mixer->playInputStream(Audio::Mixer::kPlainSoundType, &_audioStreamHandle,
- _vm->_res->getSound(argv[0])->getAudioStream(_vm->_soundRate, false));
- }
- return 0;
-}
-
-} // End of namespace Made
diff --git a/engines/made/scriptfuncs_mhne.cpp b/engines/made/scriptfuncs_mhne.cpp
deleted file mode 100644
index 65e9c6e070..0000000000
--- a/engines/made/scriptfuncs_mhne.cpp
+++ /dev/null
@@ -1,494 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- *
- */
-
-#include "common/endian.h"
-#include "common/util.h"
-#include "common/events.h"
-
-#include "graphics/cursorman.h"
-
-#include "made/made.h"
-#include "made/resource.h"
-#include "made/database.h"
-#include "made/screen.h"
-#include "made/script.h"
-#include "made/pmvplayer.h"
-#include "made/scriptfuncs.h"
-#include "made/music.h"
-
-namespace Made {
-
-/* ScriptFunctionsMhne */
-
-typedef Common::Functor2Mem<int16, int16*, int16, ScriptFunctionsMhne> ExternalFuncMhne;
-#define External(x) ExternalFuncMhne(this, &ScriptFunctionsMhne::x)
-void ScriptFunctionsMhne::setupExternalsTable() {
- static const ExternalFuncMhne externalsTable[] = {
- External(o1_SYSTEM),
- External(o1_INITGRAF),
- External(o1_RESTOREGRAF),
- External(o1_DRAWPIC),
- External(o1_CLS),
- External(o1_SHOWPAGE),
- External(o1_EVENT),
- External(o1_EVENTX),
- External(o1_EVENTY),
- External(o1_EVENTKEY),
- External(o1_VISUALFX),
- External(o1_PLAYSND),
- External(o1_PLAYMUS),
- External(o1_STOPMUS),
- External(o1_ISMUS),
- External(o1_TEXTPOS),
- External(o1_FLASH),
- External(o1_PLAYNOTE),
- External(o1_STOPNOTE),
- External(o1_PLAYTELE),
- External(o1_STOPTELE),
- External(o1_HIDECURS),
- External(o1_SHOWCURS),
- External(o1_MUSICBEAT),
- External(o1_SCREENLOCK),
- External(o1_ADDSPRITE),
- External(o1_FREEANIM),
- External(o1_DRAWSPRITE),
- External(o1_ERASESPRITES),
- External(o1_UPDATESPRITES),
- External(o1_GETTIMER),
- External(o1_SETTIMER),
- External(o1_RESETTIMER),
- External(o1_ALLOCTIMER),
- External(o1_FREETIMER),
- External(o1_PALETTELOCK),
- External(o1_FONT),
- External(o1_DRAWTEXT),
- External(o1_HOMETEXT),
- External(o1_TEXTRECT),
- External(o1_TEXTXY),
- External(o1_DROPSHADOW),
- External(o1_TEXTCOLOR),
- External(o1_OUTLINE),
- External(o1_LOADCURSOR),
- External(o1_SETGROUND),
- External(o1_RESTEXT),
- External(o1_ADDMASK),
- External(o1_SETMASK),
- External(o1_ISSND),
- External(o1_STOPSND),
- External(o1_PLAYVOICE),
- External(o1_CDPLAY),
- External(o1_STOPCD),
- External(o1_CDSTATUS),
- External(o1_CDTIME),
- External(o1_CDPLAYSEG),
- };
-
- for (int i = 0; i < ARRAYSIZE(externalsTable); ++i)
- _externalFuncs.push_back(&externalsTable[i]);
-
-}
-#undef External
-
-int16 ScriptFunctionsMhne::o1_SYSTEM(int16 argc, int16 *argv) {
- // This opcode is empty.
- return 0;
-}
-
-int16 ScriptFunctionsMhne::o1_INITGRAF(int16 argc, int16 *argv) {
- // This opcode is empty.
- return 0;
-}
-
-int16 ScriptFunctionsMhne::o1_RESTOREGRAF(int16 argc, int16 *argv) {
- // This opcode is empty.
- return 0;
-}
-
-int16 ScriptFunctionsMhne::o1_DRAWPIC(int16 argc, int16 *argv) {
- return _vm->_screen->drawPic(argv[4], argv[3], argv[2], argv[1], argv[0]);
-}
-
-int16 ScriptFunctionsMhne::o1_CLS(int16 argc, int16 *argv) {
- _vm->_screen->clearScreen();
- return 0;
-}
-
-int16 ScriptFunctionsMhne::o1_SHOWPAGE(int16 argc, int16 *argv) {
- _vm->_screen->show();
- return 0;
-}
-
-int16 ScriptFunctionsMhne::o1_EVENT(int16 argc, int16 *argv) {
-
- Common::Event event;
- Common::EventManager *eventMan = g_system->getEventManager();
-
- int16 eventNum = 0;
-
- if (eventMan->pollEvent(event)) {
- switch (event.type) {
-
- case Common::EVENT_MOUSEMOVE:
- _vm->_eventMouseX = event.mouse.x;
- _vm->_eventMouseY = event.mouse.y;
- break;
-
- case Common::EVENT_LBUTTONDOWN:
- eventNum = 1;
- break;
-
- /*
- case Common::EVENT_LBUTTONUP:
- eventNum = 2; // TODO: Is this correct?
- break;
- */
-
- case Common::EVENT_RBUTTONDOWN:
- eventNum = 3;
- break;
-
- /*
- case Common::EVENT_RBUTTONUP:
- eventNum = 4; // TODO: Is this correct?
- break;
- */
-
- case Common::EVENT_KEYDOWN:
- _vm->_eventKey = event.kbd.ascii;
- eventNum = 5;
- break;
-
- case Common::EVENT_QUIT:
- // TODO: Exit more gracefully.
- g_system->quit();
- break;
-
- default:
- break;
-
- }
- }
-
- _vm->_system->updateScreen();
-
- return eventNum;
-}
-
-int16 ScriptFunctionsMhne::o1_EVENTX(int16 argc, int16 *argv) {
- return _vm->_eventMouseX;
-}
-
-int16 ScriptFunctionsMhne::o1_EVENTY(int16 argc, int16 *argv) {
- return _vm->_eventMouseY;
-}
-
-int16 ScriptFunctionsMhne::o1_EVENTKEY(int16 argc, int16 *argv) {
- return _vm->_eventKey;
-}
-
-int16 ScriptFunctionsMhne::o1_VISUALFX(int16 argc, int16 *argv) {
- _vm->_screen->setVisualEffectNum(argv[0]);
- return 0;
-}
-
-int16 ScriptFunctionsMhne::o1_PLAYSND(int16 argc, int16 *argv) {
- int soundNum = argv[0];
- bool loop = false;
-
- if (argc > 1) {
- soundNum = argv[1];
- loop = (argv[0] == 1);
- }
-
- if (soundNum > 0) {
- if (!_vm->_mixer->isSoundHandleActive(_audioStreamHandle)) {
- _vm->_mixer->playInputStream(Audio::Mixer::kPlainSoundType, &_audioStreamHandle,
- _vm->_res->getSound(soundNum)->getAudioStream(_vm->_soundRate, loop));
- }
- }
-
- return 0;
-}
-
-int16 ScriptFunctionsMhne::o1_PLAYMUS(int16 argc, int16 *argv) {
- int16 musicNum = argv[0];
- if (musicNum > 0) {
- GenericResource *xmidi = _vm->_res->getXmidi(musicNum);
- _vm->_music->playXMIDI(xmidi);
- _vm->_res->freeResource(xmidi);
- }
- return 0;
-}
-
-int16 ScriptFunctionsMhne::o1_STOPMUS(int16 argc, int16 *argv) {
- _vm->_music->stop();
- return 0;
-}
-
-int16 ScriptFunctionsMhne::o1_ISMUS(int16 argc, int16 *argv) {
- if (_vm->_music->isPlaying())
- return 1;
- else
- return 0;
-}
-
-int16 ScriptFunctionsMhne::o1_TEXTPOS(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_TEXTPOS");
- // This seems to be some kind of low-level opcode.
- // The original engine calls int 10h to set the VGA cursor position.
- return 0;
-}
-
-int16 ScriptFunctionsMhne::o1_FLASH(int16 argc, int16 *argv) {
- _vm->_screen->flash(argv[0]);
- return 0;
-}
-
-int16 ScriptFunctionsMhne::o1_PLAYNOTE(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_PLAYNOTE");
- return 0;
-}
-
-int16 ScriptFunctionsMhne::o1_STOPNOTE(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_STOPNOTE");
- return 0;
-}
-
-int16 ScriptFunctionsMhne::o1_PLAYTELE(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_PLAYTELE");
- return 0;
-}
-
-int16 ScriptFunctionsMhne::o1_STOPTELE(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_STOPTELE");
- return 0;
-}
-
-int16 ScriptFunctionsMhne::o1_HIDECURS(int16 argc, int16 *argv) {
- _vm->_system->showMouse(false);
- return 0;
-}
-
-int16 ScriptFunctionsMhne::o1_SHOWCURS(int16 argc, int16 *argv) {
- _vm->_system->showMouse(true);
- return 0;
-}
-
-int16 ScriptFunctionsMhne::o1_MUSICBEAT(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_MUSICBEAT");
- return 0;
-}
-
-int16 ScriptFunctionsMhne::o1_SCREENLOCK(int16 argc, int16 *argv) {
- _vm->_screen->setScreenLock(argv[0] != 0);
- return 0;
-}
-
-int16 ScriptFunctionsMhne::o1_ADDSPRITE(int16 argc, int16 *argv) {
- //_vm->_screen->drawSprite(argv[2], argv[1], argv[0]);
- return argv[2];
-}
-
-int16 ScriptFunctionsMhne::o1_FREEANIM(int16 argc, int16 *argv) {
- _vm->_screen->clearChannels();
- return 0;
-}
-
-int16 ScriptFunctionsMhne::o1_DRAWSPRITE(int16 argc, int16 *argv) {
- return _vm->_screen->drawSprite(argv[2], argv[1], argv[0]);
-}
-
-int16 ScriptFunctionsMhne::o1_ERASESPRITES(int16 argc, int16 *argv) {
- _vm->_screen->clearChannels();
- return 0;
-}
-
-int16 ScriptFunctionsMhne::o1_UPDATESPRITES(int16 argc, int16 *argv) {
- _vm->_screen->updateSprites();
- return 0;
-}
-
-int16 ScriptFunctionsMhne::o1_GETTIMER(int16 argc, int16 *argv) {
- return _vm->getTimer(argv[0]);
-}
-
-int16 ScriptFunctionsMhne::o1_SETTIMER(int16 argc, int16 *argv) {
- _vm->setTimer(argv[1], argv[0]);
- return 0;
-}
-
-int16 ScriptFunctionsMhne::o1_RESETTIMER(int16 argc, int16 *argv) {
- _vm->resetTimer(argv[0]);
- return 0;
-}
-
-int16 ScriptFunctionsMhne::o1_ALLOCTIMER(int16 argc, int16 *argv) {
- int16 timerNum = _vm->allocTimer();
- return timerNum;
-}
-
-int16 ScriptFunctionsMhne::o1_FREETIMER(int16 argc, int16 *argv) {
- _vm->freeTimer(argv[0]);
- return 0;
-}
-
-int16 ScriptFunctionsMhne::o1_PALETTELOCK(int16 argc, int16 *argv) {
- _vm->_screen->setPaletteLock(argv[0] != 0);
- return 0;
-}
-
-int16 ScriptFunctionsMhne::o1_FONT(int16 argc, int16 *argv) {
- _vm->_screen->setFont(argv[0]);
- return 0;
-}
-
-int16 ScriptFunctionsMhne::o1_DRAWTEXT(int16 argc, int16 *argv) {
- Object *obj = _vm->_dat->getObject(argv[argc - 1]);
- const char *text = obj->getString();
- _vm->_screen->printText(text);
- return 0;
-}
-
-int16 ScriptFunctionsMhne::o1_HOMETEXT(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_HOMETEXT");
- return 0;
-}
-
-int16 ScriptFunctionsMhne::o1_TEXTRECT(int16 argc, int16 *argv) {
- int16 x1 = CLIP<int16>(argv[4], 1, 318);
- int16 y1 = CLIP<int16>(argv[3], 1, 198);
- int16 x2 = CLIP<int16>(argv[2], 1, 318);
- int16 y2 = CLIP<int16>(argv[1], 1, 198);
- //int16 textValue = argv[0];
- // TODO: textValue
- _vm->_screen->setTextRect(Common::Rect(x1, y1, x2, y2));
- return 0;
-}
-
-int16 ScriptFunctionsMhne::o1_TEXTXY(int16 argc, int16 *argv) {
- int16 x = CLIP<int16>(argv[1], 1, 318);
- int16 y = CLIP<int16>(argv[0], 1, 198);
- _vm->_screen->setTextXY(x, y);
- return 0;
-}
-
-int16 ScriptFunctionsMhne::o1_DROPSHADOW(int16 argc, int16 *argv) {
- // if the drop shadow color is -1, then text drop shadow is disabled
- // when font drop shadow is enabled, outline is disabled
- _vm->_screen->setDropShadowColor(argv[0]);
- return 0;
-}
-
-int16 ScriptFunctionsMhne::o1_TEXTCOLOR(int16 argc, int16 *argv) {
- _vm->_screen->setTextColor(argv[0]);
- return 0;
-}
-
-int16 ScriptFunctionsMhne::o1_OUTLINE(int16 argc, int16 *argv) {
- // if the outline color is -1, then text outline is disabled
- // when font outline is enabled, drop shadow is disabled
- _vm->_screen->setOutlineColor(argv[0]);
- return 0;
-}
-
-int16 ScriptFunctionsMhne::o1_LOADCURSOR(int16 argc, int16 *argv) {
- PictureResource *flex = _vm->_res->getPicture(argv[2]);
- Graphics::Surface *surf = flex->getPicture();
- CursorMan.replaceCursor((const byte *)surf->pixels, surf->w, surf->h, argv[1], argv[0], 0);
- CursorMan.showMouse(true);
- _vm->_res->freeResource(flex);
- return 0;
-}
-
-int16 ScriptFunctionsMhne::o1_SETGROUND(int16 argc, int16 *argv) {
- _vm->_screen->setGround(argv[0]);
- return 0;
-}
-
-int16 ScriptFunctionsMhne::o1_RESTEXT(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_RESTEXT");
- return 0;
-}
-
-int16 ScriptFunctionsMhne::o1_ADDMASK(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_ADDMASK");
- return 0;
-}
-
-int16 ScriptFunctionsMhne::o1_SETMASK(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_SETMASK");
- return 0;
-}
-
-int16 ScriptFunctionsMhne::o1_ISSND(int16 argc, int16 *argv) {
- if (_vm->_mixer->isSoundHandleActive(_audioStreamHandle))
- return 1;
- else
- return 0;
-}
-
-int16 ScriptFunctionsMhne::o1_STOPSND(int16 argc, int16 *argv) {
- _vm->_mixer->stopHandle(_audioStreamHandle);
- return 0;
-}
-
-int16 ScriptFunctionsMhne::o1_PLAYVOICE(int16 argc, int16 *argv) {
- if (argv[0] > 0) {
- _vm->_mixer->stopHandle(_audioStreamHandle);
- _vm->_mixer->playInputStream(Audio::Mixer::kPlainSoundType, &_audioStreamHandle,
- _vm->_res->getSound(argv[0])->getAudioStream(_vm->_soundRate, false));
- }
- return 0;
-}
-
-int16 ScriptFunctionsMhne::o1_CDPLAY(int16 argc, int16 *argv) {
- // This one is called loads of times, so it has been commented out to reduce spam
- //warning("Unimplemented opcode: o1_CDPLAY");
- return 0;
-}
-
-int16 ScriptFunctionsMhne::o1_STOPCD(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_STOPCD");
- return 0;
-}
-
-int16 ScriptFunctionsMhne::o1_CDSTATUS(int16 argc, int16 *argv) {
- // This one is called loads of times, so it has been commented out to reduce spam
- //warning("Unimplemented opcode: o1_CDSTATUS");
- return 0;
-}
-
-int16 ScriptFunctionsMhne::o1_CDTIME(int16 argc, int16 *argv) {
- // This one is called loads of times, so it has been commented out to reduce spam
- //warning("Unimplemented opcode: o1_CDTIME");
- return 0;
-}
-
-int16 ScriptFunctionsMhne::o1_CDPLAYSEG(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_CDPLAYSEG");
- return 0;
-}
-
-} // End of namespace Made
diff --git a/engines/made/scriptfuncs_rtz.cpp b/engines/made/scriptfuncs_rtz.cpp
deleted file mode 100644
index 1186a88de8..0000000000
--- a/engines/made/scriptfuncs_rtz.cpp
+++ /dev/null
@@ -1,864 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- *
- */
-
-#include "common/endian.h"
-#include "common/util.h"
-#include "common/events.h"
-
-#include "graphics/cursorman.h"
-
-#include "made/made.h"
-#include "made/resource.h"
-#include "made/database.h"
-#include "made/screen.h"
-#include "made/script.h"
-#include "made/pmvplayer.h"
-#include "made/scriptfuncs.h"
-#include "made/music.h"
-
-namespace Made {
-
-/* ScriptFunctionsRtz */
-
-typedef Common::Functor2Mem<int16, int16*, int16, ScriptFunctionsRtz> ExternalFuncRtz;
-#define External(x) ExternalFuncRtz(this, &ScriptFunctionsRtz::x)
-void ScriptFunctionsRtz::setupExternalsTable() {
- static const ExternalFuncRtz externalsTable[] = {
- External(o1_SYSTEM),
- External(o1_INITGRAF),
- External(o1_RESTOREGRAF),
- External(o1_DRAWPIC),
- External(o1_CLS),
- External(o1_SHOWPAGE),
- External(o1_EVENT),
- External(o1_EVENTX),
- External(o1_EVENTY),
- External(o1_EVENTKEY),
- External(o1_VISUALFX),
- External(o1_PLAYSND),
- External(o1_PLAYMUS),
- External(o1_STOPMUS),
- External(o1_ISMUS),
- External(o1_TEXTPOS),
- External(o1_FLASH),
- External(o1_PLAYNOTE),
- External(o1_STOPNOTE),
- External(o1_PLAYTELE),
- External(o1_STOPTELE),
- External(o1_HIDECURS),
- External(o1_SHOWCURS),
- External(o1_MUSICBEAT),
- External(o1_SCREENLOCK),
- External(o1_ADDSPRITE),
- External(o1_FREEANIM),
- External(o1_DRAWSPRITE),
- External(o1_ERASESPRITES),
- External(o1_UPDATESPRITES),
- External(o1_GETTIMER),
- External(o1_SETTIMER),
- External(o1_RESETTIMER),
- External(o1_ALLOCTIMER),
- External(o1_FREETIMER),
- External(o1_PALETTELOCK),
- External(o1_FONT),
- External(o1_DRAWTEXT),
- External(o1_HOMETEXT),
- External(o1_TEXTRECT),
- External(o1_TEXTXY),
- External(o1_DROPSHADOW),
- External(o1_TEXTCOLOR),
- External(o1_OUTLINE),
- External(o1_LOADCURSOR),
- External(o1_SETGROUND),
- External(o1_RESTEXT),
- External(o1_CLIPAREA),
- External(o1_SETCLIP),
- External(o1_ISSND),
- External(o1_STOPSND),
- External(o1_PLAYVOICE),
- External(o1_CDPLAY),
- External(o1_STOPCD),
- External(o1_CDSTATUS),
- External(o1_CDTIME),
- External(o1_CDPLAYSEG),
- External(o1_PRINTF),
- External(o1_MONOCLS),
- External(o1_SNDENERGY),
- External(o1_CLEARTEXT),
- External(o1_ANIMTEXT),
- External(o1_TEXTWIDTH),
- External(o1_PLAYMOVIE),
- External(o1_LOADSND),
- External(o1_LOADMUS),
- External(o1_LOADPIC),
- External(o1_MUSICVOL),
- External(o1_RESTARTEVENTS),
- External(o1_PLACESPRITE),
- External(o1_PLACETEXT),
- External(o1_DELETECHANNEL),
- External(o1_CHANNELTYPE),
- External(o1_SETSTATE),
- External(o1_SETLOCATION),
- External(o1_SETCONTENT),
- External(o1_EXCLUDEAREA),
- External(o1_SETEXCLUDE),
- External(o1_GETSTATE),
- External(o1_PLACEANIM),
- External(o1_SETFRAME),
- External(o1_GETFRAME),
- External(o1_GETFRAMECOUNT),
- External(o1_PICWIDTH),
- External(o1_PICHEIGHT),
- External(o1_SOUNDRATE),
- External(o1_DRAWANIMPIC),
- External(o1_LOADANIM),
- External(o1_READTEXT),
- External(o1_READMENU),
- External(o1_DRAWMENU),
- External(o1_MENUCOUNT),
- External(o1_SAVEGAME),
- External(o1_LOADGAME),
- External(o1_GAMENAME),
- External(o1_SHAKESCREEN),
- External(o1_PLACEMENU),
- External(o1_SETVOLUME),
- External(o1_WHATSYNTH),
- External(o1_SLOWSYSTEM)
- };
-
- for (int i = 0; i < ARRAYSIZE(externalsTable); ++i)
- _externalFuncs.push_back(&externalsTable[i]);
-
-}
-#undef External
-
-int16 ScriptFunctionsRtz::o1_SYSTEM(int16 argc, int16 *argv) {
- // This opcode is empty.
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_INITGRAF(int16 argc, int16 *argv) {
- // This opcode is empty.
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_RESTOREGRAF(int16 argc, int16 *argv) {
- // This opcode is empty.
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_DRAWPIC(int16 argc, int16 *argv) {
- return _vm->_screen->drawPic(argv[4], argv[3], argv[2], argv[1], argv[0]);
-}
-
-int16 ScriptFunctionsRtz::o1_CLS(int16 argc, int16 *argv) {
- _vm->_screen->clearScreen();
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_SHOWPAGE(int16 argc, int16 *argv) {
- _vm->_screen->show();
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_EVENT(int16 argc, int16 *argv) {
-
- Common::Event event;
- Common::EventManager *eventMan = g_system->getEventManager();
-
- int16 eventNum = 0;
-
- if (eventMan->pollEvent(event)) {
- switch (event.type) {
-
- case Common::EVENT_MOUSEMOVE:
- _vm->_eventMouseX = event.mouse.x;
- _vm->_eventMouseY = event.mouse.y;
- break;
-
- case Common::EVENT_LBUTTONDOWN:
- eventNum = 1;
- break;
-
- /*
- case Common::EVENT_LBUTTONUP:
- eventNum = 2; // TODO: Is this correct?
- break;
- */
-
- case Common::EVENT_RBUTTONDOWN:
- eventNum = 3;
- break;
-
- /*
- case Common::EVENT_RBUTTONUP:
- eventNum = 4; // TODO: Is this correct?
- break;
- */
-
- case Common::EVENT_KEYDOWN:
- _vm->_eventKey = event.kbd.ascii;
- eventNum = 5;
- break;
-
- case Common::EVENT_QUIT:
- // TODO: Exit more gracefully.
- g_system->quit();
- break;
-
- default:
- break;
-
- }
- }
-
- _vm->_system->updateScreen();
-
- return eventNum;
-}
-
-int16 ScriptFunctionsRtz::o1_EVENTX(int16 argc, int16 *argv) {
- return _vm->_eventMouseX;
-}
-
-int16 ScriptFunctionsRtz::o1_EVENTY(int16 argc, int16 *argv) {
- return _vm->_eventMouseY;
-}
-
-int16 ScriptFunctionsRtz::o1_EVENTKEY(int16 argc, int16 *argv) {
- return _vm->_eventKey;
-}
-
-int16 ScriptFunctionsRtz::o1_VISUALFX(int16 argc, int16 *argv) {
- _vm->_screen->setVisualEffectNum(argv[0]);
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_PLAYSND(int16 argc, int16 *argv) {
- int soundNum = argv[0];
- bool loop = false;
-
- if (argc > 1) {
- soundNum = argv[1];
- loop = (argv[0] == 1);
- }
-
- if (soundNum > 0) {
- if (!_vm->_mixer->isSoundHandleActive(_audioStreamHandle)) {
- _vm->_mixer->playInputStream(Audio::Mixer::kPlainSoundType, &_audioStreamHandle,
- _vm->_res->getSound(soundNum)->getAudioStream(_vm->_soundRate, loop));
- }
- }
-
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_PLAYMUS(int16 argc, int16 *argv) {
- int16 musicNum = argv[0];
- if (musicNum > 0) {
- GenericResource *xmidi = _vm->_res->getXmidi(musicNum);
- _vm->_music->playXMIDI(xmidi);
- _vm->_res->freeResource(xmidi);
- }
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_STOPMUS(int16 argc, int16 *argv) {
- _vm->_music->stop();
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_ISMUS(int16 argc, int16 *argv) {
- if (_vm->_music->isPlaying())
- return 1;
- else
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_TEXTPOS(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_TEXTPOS");
- // This seems to be some kind of low-level opcode.
- // The original engine calls int 10h to set the VGA cursor position.
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_FLASH(int16 argc, int16 *argv) {
- _vm->_screen->flash(argv[0]);
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_PLAYNOTE(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_PLAYNOTE");
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_STOPNOTE(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_STOPNOTE");
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_PLAYTELE(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_PLAYTELE");
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_STOPTELE(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_STOPTELE");
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_HIDECURS(int16 argc, int16 *argv) {
- _vm->_system->showMouse(false);
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_SHOWCURS(int16 argc, int16 *argv) {
- _vm->_system->showMouse(true);
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_MUSICBEAT(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_MUSICBEAT");
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_SCREENLOCK(int16 argc, int16 *argv) {
- _vm->_screen->setScreenLock(argv[0] != 0);
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_ADDSPRITE(int16 argc, int16 *argv) {
- //_vm->_screen->drawSprite(argv[2], argv[1], argv[0]);
- return 0;//argv[2];
-}
-
-int16 ScriptFunctionsRtz::o1_FREEANIM(int16 argc, int16 *argv) {
- _vm->_screen->clearChannels();
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_DRAWSPRITE(int16 argc, int16 *argv) {
- return _vm->_screen->drawSprite(argv[2], argv[1], argv[0]);
-}
-
-int16 ScriptFunctionsRtz::o1_ERASESPRITES(int16 argc, int16 *argv) {
- _vm->_screen->clearChannels();
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_UPDATESPRITES(int16 argc, int16 *argv) {
- _vm->_screen->updateSprites();
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_GETTIMER(int16 argc, int16 *argv) {
- return _vm->getTimer(argv[0]);
-}
-
-int16 ScriptFunctionsRtz::o1_SETTIMER(int16 argc, int16 *argv) {
- _vm->setTimer(argv[1], argv[0]);
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_RESETTIMER(int16 argc, int16 *argv) {
- _vm->resetTimer(argv[0]);
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_ALLOCTIMER(int16 argc, int16 *argv) {
- int16 timerNum = _vm->allocTimer();
- return timerNum;
-}
-
-int16 ScriptFunctionsRtz::o1_FREETIMER(int16 argc, int16 *argv) {
- _vm->freeTimer(argv[0]);
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_PALETTELOCK(int16 argc, int16 *argv) {
- _vm->_screen->setPaletteLock(argv[0] != 0);
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_FONT(int16 argc, int16 *argv) {
- _vm->_screen->setFont(argv[0]);
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_DRAWTEXT(int16 argc, int16 *argv) {
- // TODO: Needs vsprintf to get the correct text
- Object *obj = _vm->_dat->getObject(argv[argc - 1]);
- const char *text = obj->getString();
- _vm->_screen->printText(text);
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_HOMETEXT(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_HOMETEXT");
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_TEXTRECT(int16 argc, int16 *argv) {
- int16 x1 = CLIP<int16>(argv[4], 1, 318);
- int16 y1 = CLIP<int16>(argv[3], 1, 198);
- int16 x2 = CLIP<int16>(argv[2], 1, 318);
- int16 y2 = CLIP<int16>(argv[1], 1, 198);
- //int16 textValue = argv[0];
- // TODO: textValue
- _vm->_screen->setTextRect(Common::Rect(x1, y1, x2, y2));
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_TEXTXY(int16 argc, int16 *argv) {
- int16 x = CLIP<int16>(argv[1], 1, 318);
- int16 y = CLIP<int16>(argv[0], 1, 198);
- _vm->_screen->setTextXY(x, y);
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_DROPSHADOW(int16 argc, int16 *argv) {
- // if the drop shadow color is -1, then text drop shadow is disabled
- // when font drop shadow is enabled, outline is disabled
- _vm->_screen->setDropShadowColor(argv[0]);
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_TEXTCOLOR(int16 argc, int16 *argv) {
- _vm->_screen->setTextColor(argv[0]);
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_OUTLINE(int16 argc, int16 *argv) {
- // if the outline color is -1, then text outline is disabled
- // when font outline is enabled, drop shadow is disabled
- _vm->_screen->setOutlineColor(argv[0]);
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_LOADCURSOR(int16 argc, int16 *argv) {
- PictureResource *flex = _vm->_res->getPicture(argv[2]);
- Graphics::Surface *surf = flex->getPicture();
- CursorMan.replaceCursor((const byte *)surf->pixels, surf->w, surf->h, argv[1], argv[0], 0);
- CursorMan.showMouse(true);
- _vm->_res->freeResource(flex);
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_SETGROUND(int16 argc, int16 *argv) {
- _vm->_screen->setGround(argv[0]);
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_RESTEXT(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_RESTEXT");
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_CLIPAREA(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_CLIPAREA");
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_SETCLIP(int16 argc, int16 *argv) {
- _vm->_screen->setClip(argv[0]);
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_ISSND(int16 argc, int16 *argv) {
- if (_vm->_mixer->isSoundHandleActive(_audioStreamHandle))
- return 1;
- else
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_STOPSND(int16 argc, int16 *argv) {
- _vm->_mixer->stopHandle(_audioStreamHandle);
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_PLAYVOICE(int16 argc, int16 *argv) {
- if (argv[0] > 0) {
- _vm->_mixer->stopHandle(_audioStreamHandle);
- _vm->_mixer->playInputStream(Audio::Mixer::kPlainSoundType, &_audioStreamHandle,
- _vm->_res->getSound(argv[0])->getAudioStream(_vm->_soundRate, false));
- }
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_CDPLAY(int16 argc, int16 *argv) {
- // This one is called loads of times, so it has been commented out to reduce spam
- //warning("Unimplemented opcode: o1_CDPLAY");
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_STOPCD(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_STOPCD");
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_CDSTATUS(int16 argc, int16 *argv) {
- // This one is called loads of times, so it has been commented out to reduce spam
- //warning("Unimplemented opcode: o1_CDSTATUS");
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_CDTIME(int16 argc, int16 *argv) {
- // This one is called loads of times, so it has been commented out to reduce spam
- //warning("Unimplemented opcode: o1_CDTIME");
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_CDPLAYSEG(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_CDPLAYSEG");
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_PRINTF(int16 argc, int16 *argv) {
- Object *obj = _vm->_dat->getObject(argv[argc - 1]);
- const char *text = obj->getString();
- debug(4, "--> text = %s", text);
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_MONOCLS(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_MONOCLS");
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_SNDENERGY(int16 argc, int16 *argv) {
- // This is called while in-game voices are played
- // Not sure what it's used for
- // -> It's used to animate mouths when NPCs are talking
- // Commented out to reduce spam
- //warning("Unimplemented opcode: o1_SNDENERGY");
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_CLEARTEXT(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_CLEARTEXT");
- return 1;
-}
-
-int16 ScriptFunctionsRtz::o1_ANIMTEXT(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_ANIMTEXT");
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_TEXTWIDTH(int16 argc, int16 *argv) {
- int16 width = 0;
- if (argv[1] > 0) {
- Object *obj = _vm->_dat->getObject(argv[1]);
- const char *text = obj->getString();
- width = _vm->_screen->getTextWidth(argv[0], text);
- }
- return width;
-}
-
-int16 ScriptFunctionsRtz::o1_PLAYMOVIE(int16 argc, int16 *argv) {
- const char *movieName = _vm->_dat->getObject(argv[1])->getString();
- _vm->_pmvPlayer->play(movieName);
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_LOADSND(int16 argc, int16 *argv) {
- SoundResource *sound = _vm->_res->getSound(argv[0]);
- if (sound) {
- _vm->_res->freeResource(sound);
- return 1;
- }
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_LOADMUS(int16 argc, int16 *argv) {
- GenericResource *xmidi = _vm->_res->getXmidi(argv[0]);
- if (xmidi) {
- _vm->_res->freeResource(xmidi);
- return 1;
- }
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_LOADPIC(int16 argc, int16 *argv) {
- PictureResource *flex = _vm->_res->getPicture(argv[0]);
- if (flex) {
- _vm->_res->freeResource(flex);
- return 1;
- }
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_MUSICVOL(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_MUSICVOL");
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_RESTARTEVENTS(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_RESTARTEVENTS");
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_PLACESPRITE(int16 argc, int16 *argv) {
- return _vm->_screen->placeSprite(argv[3], argv[2], argv[1], argv[0]);
-}
-
-int16 ScriptFunctionsRtz::o1_PLACETEXT(int16 argc, int16 *argv) {
- return _vm->_screen->placeText(argv[6], argv[5], argv[4], argv[3], argv[2], argv[1], argv[0]);
-}
-
-int16 ScriptFunctionsRtz::o1_DELETECHANNEL(int16 argc, int16 *argv) {
- _vm->_screen->deleteChannel(argv[0]);
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_CHANNELTYPE(int16 argc, int16 *argv) {
- return _vm->_screen->getChannelType(argv[0]);
-}
-
-int16 ScriptFunctionsRtz::o1_SETSTATE(int16 argc, int16 *argv) {
- _vm->_screen->setChannelState(argv[1], argv[0]);
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_SETLOCATION(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_SETLOCATION");
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_SETCONTENT(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_SETCONTENT");
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_EXCLUDEAREA(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_EXCLUDEAREA");
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_SETEXCLUDE(int16 argc, int16 *argv) {
- _vm->_screen->setExclude(argv[0]);
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_GETSTATE(int16 argc, int16 *argv) {
- return _vm->_screen->getChannelState(argv[0]);
-}
-
-int16 ScriptFunctionsRtz::o1_PLACEANIM(int16 argc, int16 *argv) {
- return _vm->_screen->placeAnim(argv[4], argv[3], argv[2], argv[1], argv[0]);
-}
-
-int16 ScriptFunctionsRtz::o1_SETFRAME(int16 argc, int16 *argv) {
- _vm->_screen->setAnimFrame(argv[1], argv[0]);
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_GETFRAME(int16 argc, int16 *argv) {
- return _vm->_screen->getAnimFrame(argv[0]);
-}
-
-int16 ScriptFunctionsRtz::o1_GETFRAMECOUNT(int16 argc, int16 *argv) {
- return _vm->_screen->getAnimFrameCount(argv[0]);
-}
-
-int16 ScriptFunctionsRtz::o1_PICWIDTH(int16 argc, int16 *argv) {
- int16 width = 0;
- PictureResource *flex = _vm->_res->getPicture(argv[0]);
- if (flex) {
- width = flex->getPicture()->w;
- _vm->_res->freeResource(flex);
- }
- return width;
-}
-
-int16 ScriptFunctionsRtz::o1_PICHEIGHT(int16 argc, int16 *argv) {
- int16 height = 0;
- PictureResource *flex = _vm->_res->getPicture(argv[0]);
- if (flex) {
- height = flex->getPicture()->h;
- _vm->_res->freeResource(flex);
- }
- return height;
-}
-
-int16 ScriptFunctionsRtz::o1_SOUNDRATE(int16 argc, int16 *argv) {
- _vm->_soundRate = argv[0];
- return 1;
-}
-
-int16 ScriptFunctionsRtz::o1_DRAWANIMPIC(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_DRAWANIMPIC");
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_LOADANIM(int16 argc, int16 *argv) {
- AnimationResource *anim = _vm->_res->getAnimation(argv[0]);
- if (anim) {
- _vm->_res->freeResource(anim);
- return 1;
- }
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_READTEXT(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_READTEXT");
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_READMENU(int16 argc, int16 *argv) {
- int16 objectIndex = argv[2];
- int16 menuIndex = argv[1];
- int16 textIndex = argv[0];
- int16 length = 0;
- MenuResource *menu = _vm->_res->getMenu(menuIndex);
- if (menu) {
- const char *text = menu->getString(textIndex);
- debug(4, "objectIndex = %04X; text = %s\n", objectIndex, text);
- Object *obj = _vm->_dat->getObject(objectIndex);
- obj->setString(text);
- _vm->_res->freeResource(menu);
- if (text)
- length = strlen(text);
- }
- return length;
-}
-
-int16 ScriptFunctionsRtz::o1_DRAWMENU(int16 argc, int16 *argv) {
- int16 menuIndex = argv[1];
- int16 textIndex = argv[0];
- MenuResource *menu = _vm->_res->getMenu(menuIndex);
- if (menu) {
- const char *text = menu->getString(textIndex);
- if (text)
- _vm->_screen->printText(text);
- _vm->_res->freeResource(menu);
- }
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_MENUCOUNT(int16 argc, int16 *argv) {
- int16 menuIndex = argv[0];
- int16 count = 0;
- MenuResource *menu = _vm->_res->getMenu(menuIndex);
- if (menu) {
- count = menu->getCount();
- _vm->_res->freeResource(menu);
- }
- return count;
-}
-
-int16 ScriptFunctionsRtz::o1_SAVEGAME(int16 argc, int16 *argv) {
-
- int16 saveNum = argv[2];
- int16 descObjectIndex = argv[1];
- int16 version = argv[0];
-
- if (saveNum > 999)
- return 6;
-
- Object *obj = _vm->_dat->getObject(descObjectIndex);
- const char *description = obj->getString();
-
- // TODO: Use better filename
- char filename[256];
- snprintf(filename, 256, "rtz.%03d", saveNum);
-
- return _vm->_dat->savegame(filename, description, version);
-
-}
-
-int16 ScriptFunctionsRtz::o1_LOADGAME(int16 argc, int16 *argv) {
-
- int16 saveNum = argv[1];
- int16 version = argv[0];
-
- if (saveNum > 999)
- return 1;
-
- // TODO: Use better filename
- char filename[256];
- snprintf(filename, 256, "rtz.%03d", saveNum);
-
- return _vm->_dat->loadgame(filename, version);
-
-}
-
-int16 ScriptFunctionsRtz::o1_GAMENAME(int16 argc, int16 *argv) {
-
- int16 descObjectIndex = argv[2];
- int16 saveNum = argv[1];
- /*int16 version = argv[0];*/
- Common::String description;
-
- if (saveNum > 999)
- return 1;
-
- // TODO: Use better filename
- char filename[256];
- snprintf(filename, 256, "rtz.%03d", saveNum);
-
- Object *obj = _vm->_dat->getObject(descObjectIndex);
-
- if (_vm->_dat->getSavegameDescription(filename, description)) {
- obj->setString(description.c_str());
- return 0;
- } else {
- obj->setString("");
- return 1;
- }
-
-}
-
-int16 ScriptFunctionsRtz::o1_SHAKESCREEN(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_SHAKESCREEN");
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_PLACEMENU(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_PLACEMENU");
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_SETVOLUME(int16 argc, int16 *argv) {
- _vm->_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, argv[0] * 25);
- _vm->_mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, argv[0] * 25);
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_WHATSYNTH(int16 argc, int16 *argv) {
- // 0 = Default
- // 1 = PCSPKR
- // 2 = SBFM/ADLIB
- // 3 = ADLIBG
- // 4 = MT32MPU
- warning("Unimplemented opcode: o1_WHATSYNTH");
- return 0;
-}
-
-int16 ScriptFunctionsRtz::o1_SLOWSYSTEM(int16 argc, int16 *argv) {
- warning("Unimplemented opcode: o1_SLOWSYSTEM");
- return 0;
-}
-
-} // End of namespace Made
diff --git a/engines/metaengine.h b/engines/metaengine.h
index 5db791a1b7..aef860e0f9 100644
--- a/engines/metaengine.h
+++ b/engines/metaengine.h
@@ -93,4 +93,25 @@ public:
}
};
+
+// Engine plugins
+
+typedef PluginSubclass<MetaEngine> EnginePlugin;
+
+/**
+ * Singleton class which manages all Engine plugins.
+ */
+class EngineManager : public Common::Singleton<EngineManager> {
+private:
+ friend class Common::Singleton<SingletonBaseType>;
+
+public:
+ GameDescriptor findGame(const Common::String &gameName, const EnginePlugin **plugin = NULL) const;
+ GameList detectGames(const FSList &fslist) const;
+ const EnginePlugin::List &getPlugins() const;
+};
+
+/** Convenience shortcut for accessing the engine manager. */
+#define EngineMan EngineManager::instance()
+
#endif
diff --git a/engines/parallaction/callables_ns.cpp b/engines/parallaction/callables_ns.cpp
index c9a547d75b..68e6a70ffb 100644
--- a/engines/parallaction/callables_ns.cpp
+++ b/engines/parallaction/callables_ns.cpp
@@ -30,6 +30,7 @@
#include "graphics/primitives.h" // for Graphics::drawLine
+#include "parallaction/input.h"
#include "parallaction/parallaction.h"
#include "parallaction/sound.h"
@@ -303,14 +304,14 @@ void Parallaction_ns::_c_trasformata(void *parm) {
}
void Parallaction_ns::_c_offMouse(void *parm) {
- showCursor(false);
+ _input->showCursor(false);
_engineFlags |= kEngineBlockInput;
return;
}
void Parallaction_ns::_c_onMouse(void *parm) {
_engineFlags &= ~kEngineBlockInput;
- showCursor(true);
+ _input->showCursor(true);
return;
}
@@ -339,7 +340,7 @@ void Parallaction_ns::_c_endComment(void *param) {
g_system->delayMillis(20);
}
- waitUntilLeftClick();
+ _input->waitUntilLeftClick();
_gfx->freeBalloons();
return;
@@ -395,7 +396,7 @@ void Parallaction_ns::_c_finito(void *parm) {
_gfx->showLabel(id[1], CENTER_LABEL_HORIZONTAL, 100);
_gfx->showLabel(id[2], CENTER_LABEL_HORIZONTAL, 130);
_gfx->showLabel(id[3], CENTER_LABEL_HORIZONTAL, 160);
- waitUntilLeftClick();
+ _input->waitUntilLeftClick();
_gfx->freeLabels();
@@ -422,8 +423,8 @@ void Parallaction_ns::_c_testResult(void *parm) {
parseLocation("common");
uint id[2];
- id[0] = _gfx->createLabel(_menuFont, _slideText[0], 1);
- id[1] = _gfx->createLabel(_menuFont, _slideText[1], 1);
+ id[0] = _gfx->createLabel(_menuFont, _location._slideText[0], 1);
+ id[1] = _gfx->createLabel(_menuFont, _location._slideText[1], 1);
_gfx->showLabel(id[0], CENTER_LABEL_HORIZONTAL, 38);
_gfx->showLabel(id[1], CENTER_LABEL_HORIZONTAL, 58);
@@ -477,14 +478,7 @@ void Parallaction_ns::_c_endIntro(void *parm) {
_gfx->updateScreen();
- for (uint16 v2 = 0; v2 < 100; v2++) {
- _mouseButtons = kMouseNone;
- readInput();
- if (_mouseButtons == kMouseLeftUp)
- break;
-
- waitTime( 1 );
- }
+ _input->waitForButtonEvent(kMouseLeftUp, 5500);
_gfx->freeLabels();
}
@@ -497,7 +491,7 @@ void Parallaction_ns::_c_endIntro(void *parm) {
id[0] = _gfx->createLabel(_menuFont, "CLICK MOUSE BUTTON TO START", 1);
_gfx->showLabel(id[0], CENTER_LABEL_HORIZONTAL, 80);
- waitUntilLeftClick();
+ _input->waitUntilLeftClick();
_gfx->freeLabels();
@@ -507,7 +501,7 @@ void Parallaction_ns::_c_endIntro(void *parm) {
cleanupGame();
} else {
- waitUntilLeftClick();
+ _input->waitUntilLeftClick();
}
return;
diff --git a/engines/parallaction/debug.cpp b/engines/parallaction/debug.cpp
index 4f281998e2..3c90a76f61 100644
--- a/engines/parallaction/debug.cpp
+++ b/engines/parallaction/debug.cpp
@@ -226,14 +226,14 @@ bool Debugger::Cmd_Programs(int argc, const char** argv) {
int i = 1;
- DebugPrintf("+---+--------------------+----------+\n"
- "| # | bound animation | status |\n"
- "+---+--------------------+----------+\n");
+ DebugPrintf("+---+--------------------+--------+----------+\n"
+ "| # | bound animation | size | status |\n"
+ "+---+--------------------+--------+----------+\n");
for ( ; b != e; b++, i++) {
ProgramPtr p = *b;
- DebugPrintf("|%3i|%-20s|%-10s|\n", i, p->_anim->_name, status[p->_status] );
+ DebugPrintf("|%3i|%-20s|%8i|%-10s|\n", i, p->_anim->_name, p->_instructions.size(), status[p->_status] );
}
- DebugPrintf("+---+--------------------+---------+\n");
+ DebugPrintf("+---+--------------------+--------+----------+\n");
return true;
}
diff --git a/engines/parallaction/dialogue.cpp b/engines/parallaction/dialogue.cpp
index 2e3ecb590f..70db637699 100644
--- a/engines/parallaction/dialogue.cpp
+++ b/engines/parallaction/dialogue.cpp
@@ -24,6 +24,8 @@
*/
#include "common/events.h"
+
+#include "parallaction/input.h"
#include "parallaction/parallaction.h"
@@ -195,7 +197,7 @@ void DialogueManager::displayQuestion() {
_vm->_gfx->setItemFrame(id, _q->_mood & 0xF);
_vm->_gfx->updateScreen();
- waitUntilLeftClick();
+ _vm->_input->waitUntilLeftClick();
_vm->_gfx->hideDialogueStuff();
return;
@@ -254,7 +256,7 @@ int16 DialogueManager::selectAnswer() {
if (numAvailableAnswers == 1) {
_vm->_gfx->setBalloonText(0, _q->_answers[0]->_text, 0);
- waitUntilLeftClick();
+ _vm->_input->waitUntilLeftClick();
_vm->_gfx->hideDialogueStuff();
return 0;
}
@@ -262,10 +264,14 @@ int16 DialogueManager::selectAnswer() {
int oldSelection = -1;
int selection;
+ uint32 event;
+ Common::Point p;
while (true) {
- _vm->readInput();
- selection = _vm->_gfx->hitTestDialogueBalloon(_vm->_mousePos.x, _vm->_mousePos.y);
+ _vm->_input->readInput();
+ _vm->_input->getCursorPos(p);
+ event = _vm->_input->getLastButtonEvent();
+ selection = _vm->_gfx->hitTestDialogueBalloon(p.x, p.y);
if (selection != oldSelection) {
if (oldSelection != -1) {
@@ -278,7 +284,7 @@ int16 DialogueManager::selectAnswer() {
}
}
- if ((selection != -1) && (_mouseButtons == kMouseLeftUp)) {
+ if ((selection != -1) && (event == kMouseLeftUp)) {
break;
}
diff --git a/engines/parallaction/disk.h b/engines/parallaction/disk.h
index 21ff4aba76..b76c66aead 100644
--- a/engines/parallaction/disk.h
+++ b/engines/parallaction/disk.h
@@ -209,7 +209,7 @@ protected:
protected:
void errorFileNotFound(const char *s);
Font *createFont(const char *name, Common::ReadStream &stream);
- Sprites* createSprites(const char *name);
+ Sprites* createSprites(Common::ReadStream &stream);
void loadBitmap(Common::SeekableReadStream &stream, Graphics::Surface &surf, byte *palette);
public:
diff --git a/engines/parallaction/disk_br.cpp b/engines/parallaction/disk_br.cpp
index e4c4ce7492..5e88327879 100644
--- a/engines/parallaction/disk_br.cpp
+++ b/engines/parallaction/disk_br.cpp
@@ -139,12 +139,19 @@ DosDisk_br::~DosDisk_br() {
}
Frames* DosDisk_br::loadTalk(const char *name) {
- debugC(5, kDebugDisk, "DosDisk_br::loadTalk");
+ debugC(5, kDebugDisk, "DosDisk_br::loadTalk(%s)", name);
+
+ Common::File stream;
char path[PATH_LEN];
- sprintf(path, "%s/tal/%s.tal", _partPath, name);
+ sprintf(path, "%s/tal/%s", _partPath, name);
+ if (!stream.open(path)) {
+ sprintf(path, "%s/tal/%s.tal", _partPath, name);
+ if (!stream.open(path))
+ errorFileNotFound(path);
+ }
- return createSprites(path);
+ return createSprites(stream);
}
Script* DosDisk_br::loadLocation(const char *name) {
@@ -252,12 +259,7 @@ Frames* DosDisk_br::loadStatic(const char* name) {
return new SurfaceToFrames(surf);
}
-Sprites* DosDisk_br::createSprites(const char *path) {
-
- Common::File stream;
- if (!stream.open(path)) {
- errorFileNotFound(path);
- }
+Sprites* DosDisk_br::createSprites(Common::ReadStream &stream) {
uint16 num = stream.readUint16LE();
@@ -284,7 +286,12 @@ Frames* DosDisk_br::loadFrames(const char* name) {
char path[PATH_LEN];
sprintf(path, "%s/ani/%s", _partPath, name);
- return createSprites(path);
+ Common::File stream;
+ if (!stream.open(path))
+ errorFileNotFound(path);
+
+
+ return createSprites(stream);
}
// Slides in Nippon Safes are basically screen-sized pictures with valid
diff --git a/engines/parallaction/exec_br.cpp b/engines/parallaction/exec_br.cpp
index e4859a8851..3b67b4c370 100644
--- a/engines/parallaction/exec_br.cpp
+++ b/engines/parallaction/exec_br.cpp
@@ -23,7 +23,7 @@
*
*/
-
+#include "parallaction/input.h"
#include "parallaction/parallaction.h"
namespace Parallaction {
@@ -62,11 +62,13 @@ namespace Parallaction {
-typedef OpcodeImpl<Parallaction_br> OpcodeV2;
-#define COMMAND_OPCODE(op) OpcodeV2(this, &Parallaction_br::cmdOp_##op)
+#define SetOpcodeTable(x) table = &x;
+
+typedef Common::Functor0Mem<void, Parallaction_br> OpcodeV2;
+#define COMMAND_OPCODE(op) table->push_back(new OpcodeV2(this, &Parallaction_br::cmdOp_##op))
#define DECLARE_COMMAND_OPCODE(op) void Parallaction_br::cmdOp_##op()
-#define INSTRUCTION_OPCODE(op) OpcodeV2(this, &Parallaction_br::instOp_##op)
+#define INSTRUCTION_OPCODE(op) table->push_back(new OpcodeV2(this, &Parallaction_br::instOp_##op))
#define DECLARE_INSTRUCTION_OPCODE(op) void Parallaction_br::instOp_##op()
void Parallaction_br::setupSubtitles(char *s, char *s2, int y) {
@@ -174,7 +176,8 @@ DECLARE_COMMAND_OPCODE(stop) {
DECLARE_COMMAND_OPCODE(character) {
- warning("Parallaction_br::cmdOp_character not yet implemented");
+ debugC(9, kDebugExec, "Parallaction_br::cmdOp_character(%s)", _cmdRunCtxt.cmd->u._string);
+ changeCharacter(_cmdRunCtxt.cmd->u._string);
}
@@ -184,12 +187,12 @@ DECLARE_COMMAND_OPCODE(followme) {
DECLARE_COMMAND_OPCODE(onmouse) {
- showCursor(true);
+ _input->showCursor(true);
}
DECLARE_COMMAND_OPCODE(offmouse) {
- showCursor(false);
+ _input->showCursor(false);
}
@@ -399,7 +402,7 @@ DECLARE_INSTRUCTION_OPCODE(inc) {
}
if (inst->_opA._flags & kParaLocal) {
- wrapLocalVar(inst->_opA._local);
+ inst->_opA._local->wrap();
}
}
@@ -498,95 +501,85 @@ DECLARE_INSTRUCTION_OPCODE(endscript) {
void Parallaction_br::initOpcodes() {
- static const OpcodeV2 op1[] = {
- COMMAND_OPCODE(invalid),
- COMMAND_OPCODE(set),
- COMMAND_OPCODE(clear),
- COMMAND_OPCODE(start),
- COMMAND_OPCODE(speak),
- COMMAND_OPCODE(get),
- COMMAND_OPCODE(location),
- COMMAND_OPCODE(open),
- COMMAND_OPCODE(close),
- COMMAND_OPCODE(on),
- COMMAND_OPCODE(off),
- COMMAND_OPCODE(call),
- COMMAND_OPCODE(toggle),
- COMMAND_OPCODE(drop),
- COMMAND_OPCODE(quit),
- COMMAND_OPCODE(move),
- COMMAND_OPCODE(stop),
- COMMAND_OPCODE(character),
- COMMAND_OPCODE(followme),
- COMMAND_OPCODE(onmouse),
- COMMAND_OPCODE(offmouse),
- COMMAND_OPCODE(add),
- COMMAND_OPCODE(leave),
- COMMAND_OPCODE(inc),
- COMMAND_OPCODE(dec),
- COMMAND_OPCODE(ifeq),
- COMMAND_OPCODE(iflt),
- COMMAND_OPCODE(ifgt),
- COMMAND_OPCODE(let),
- COMMAND_OPCODE(music),
- COMMAND_OPCODE(fix),
- COMMAND_OPCODE(unfix),
- COMMAND_OPCODE(zeta),
- COMMAND_OPCODE(scroll),
- COMMAND_OPCODE(swap),
- COMMAND_OPCODE(give),
- COMMAND_OPCODE(text),
- COMMAND_OPCODE(part),
- COMMAND_OPCODE(testsfx),
- COMMAND_OPCODE(ret),
- COMMAND_OPCODE(onsave),
- COMMAND_OPCODE(offsave)
- };
-
- uint i;
- for (i = 0; i < ARRAYSIZE(op1); i++)
- _commandOpcodes.push_back(&op1[i]);
-
-
- static const OpcodeV2 op2[] = {
- INSTRUCTION_OPCODE(invalid),
- INSTRUCTION_OPCODE(on),
- INSTRUCTION_OPCODE(off),
- INSTRUCTION_OPCODE(set), // x
- INSTRUCTION_OPCODE(set), // y
- INSTRUCTION_OPCODE(set), // z
- INSTRUCTION_OPCODE(set), // f
- INSTRUCTION_OPCODE(loop),
- INSTRUCTION_OPCODE(endloop),
- INSTRUCTION_OPCODE(null), // show
- INSTRUCTION_OPCODE(inc),
- INSTRUCTION_OPCODE(inc), // dec
- INSTRUCTION_OPCODE(set),
- INSTRUCTION_OPCODE(put),
- INSTRUCTION_OPCODE(call),
- INSTRUCTION_OPCODE(wait),
- INSTRUCTION_OPCODE(start),
- INSTRUCTION_OPCODE(process),
- INSTRUCTION_OPCODE(move),
- INSTRUCTION_OPCODE(color),
- INSTRUCTION_OPCODE(process), // sound
- INSTRUCTION_OPCODE(mask),
- INSTRUCTION_OPCODE(print),
- INSTRUCTION_OPCODE(text),
- INSTRUCTION_OPCODE(inc), // mul
- INSTRUCTION_OPCODE(inc), // div
- INSTRUCTION_OPCODE(ifeq),
- INSTRUCTION_OPCODE(iflt),
- INSTRUCTION_OPCODE(ifgt),
- INSTRUCTION_OPCODE(endif),
- INSTRUCTION_OPCODE(stop),
- INSTRUCTION_OPCODE(endscript)
- };
-
- for (i = 0; i < ARRAYSIZE(op2); i++)
- _instructionOpcodes.push_back(&op2[i]);
-
-
+ Common::Array<const Opcode*> *table = 0;
+
+ SetOpcodeTable(_commandOpcodes);
+ COMMAND_OPCODE(invalid);
+ COMMAND_OPCODE(set);
+ COMMAND_OPCODE(clear);
+ COMMAND_OPCODE(start);
+ COMMAND_OPCODE(speak);
+ COMMAND_OPCODE(get);
+ COMMAND_OPCODE(location);
+ COMMAND_OPCODE(open);
+ COMMAND_OPCODE(close);
+ COMMAND_OPCODE(on);
+ COMMAND_OPCODE(off);
+ COMMAND_OPCODE(call);
+ COMMAND_OPCODE(toggle);
+ COMMAND_OPCODE(drop);
+ COMMAND_OPCODE(quit);
+ COMMAND_OPCODE(move);
+ COMMAND_OPCODE(stop);
+ COMMAND_OPCODE(character);
+ COMMAND_OPCODE(followme);
+ COMMAND_OPCODE(onmouse);
+ COMMAND_OPCODE(offmouse);
+ COMMAND_OPCODE(add);
+ COMMAND_OPCODE(leave);
+ COMMAND_OPCODE(inc);
+ COMMAND_OPCODE(dec);
+ COMMAND_OPCODE(ifeq);
+ COMMAND_OPCODE(iflt);
+ COMMAND_OPCODE(ifgt);
+ COMMAND_OPCODE(let);
+ COMMAND_OPCODE(music);
+ COMMAND_OPCODE(fix);
+ COMMAND_OPCODE(unfix);
+ COMMAND_OPCODE(zeta);
+ COMMAND_OPCODE(scroll);
+ COMMAND_OPCODE(swap);
+ COMMAND_OPCODE(give);
+ COMMAND_OPCODE(text);
+ COMMAND_OPCODE(part);
+ COMMAND_OPCODE(testsfx);
+ COMMAND_OPCODE(ret);
+ COMMAND_OPCODE(onsave);
+ COMMAND_OPCODE(offsave);
+
+ SetOpcodeTable(_instructionOpcodes);
+ INSTRUCTION_OPCODE(invalid);
+ INSTRUCTION_OPCODE(on);
+ INSTRUCTION_OPCODE(off);
+ INSTRUCTION_OPCODE(set); // x
+ INSTRUCTION_OPCODE(set); // y
+ INSTRUCTION_OPCODE(set); // z
+ INSTRUCTION_OPCODE(set); // f
+ INSTRUCTION_OPCODE(loop);
+ INSTRUCTION_OPCODE(endloop);
+ INSTRUCTION_OPCODE(null); // show
+ INSTRUCTION_OPCODE(inc);
+ INSTRUCTION_OPCODE(inc); // dec
+ INSTRUCTION_OPCODE(set);
+ INSTRUCTION_OPCODE(put);
+ INSTRUCTION_OPCODE(call);
+ INSTRUCTION_OPCODE(wait);
+ INSTRUCTION_OPCODE(start);
+ INSTRUCTION_OPCODE(process);
+ INSTRUCTION_OPCODE(move);
+ INSTRUCTION_OPCODE(color);
+ INSTRUCTION_OPCODE(process); // sound
+ INSTRUCTION_OPCODE(mask);
+ INSTRUCTION_OPCODE(print);
+ INSTRUCTION_OPCODE(text);
+ INSTRUCTION_OPCODE(inc); // mul
+ INSTRUCTION_OPCODE(inc); // div
+ INSTRUCTION_OPCODE(ifeq);
+ INSTRUCTION_OPCODE(iflt);
+ INSTRUCTION_OPCODE(ifgt);
+ INSTRUCTION_OPCODE(endif);
+ INSTRUCTION_OPCODE(stop);
+ INSTRUCTION_OPCODE(endscript);
}
#if 0
diff --git a/engines/parallaction/exec_ns.cpp b/engines/parallaction/exec_ns.cpp
index 385e49b78d..a4b372f42a 100644
--- a/engines/parallaction/exec_ns.cpp
+++ b/engines/parallaction/exec_ns.cpp
@@ -23,6 +23,7 @@
*
*/
+#include "parallaction/input.h"
#include "parallaction/parallaction.h"
#include "parallaction/sound.h"
@@ -49,12 +50,13 @@ namespace Parallaction {
#define INST_MOVE 18
#define INST_ENDSCRIPT 19
+#define SetOpcodeTable(x) table = &x;
-typedef OpcodeImpl<Parallaction_ns> OpcodeV1;
-#define COMMAND_OPCODE(op) OpcodeV1(this, &Parallaction_ns::cmdOp_##op)
+typedef Common::Functor0Mem<void, Parallaction_ns> OpcodeV2;
+#define COMMAND_OPCODE(op) table->push_back(new OpcodeV2(this, &Parallaction_ns::cmdOp_##op))
#define DECLARE_COMMAND_OPCODE(op) void Parallaction_ns::cmdOp_##op()
-#define INSTRUCTION_OPCODE(op) OpcodeV1(this, &Parallaction_ns::instOp_##op)
+#define INSTRUCTION_OPCODE(op) table->push_back(new OpcodeV2(this, &Parallaction_ns::instOp_##op))
#define DECLARE_INSTRUCTION_OPCODE(op) void Parallaction_ns::instOp_##op()
@@ -107,7 +109,7 @@ DECLARE_INSTRUCTION_OPCODE(inc) {
}
if (inst->_opA._flags & kParaLocal) {
- wrapLocalVar(inst->_opA._local);
+ inst->_opA._local->wrap();
}
}
@@ -189,16 +191,6 @@ DECLARE_INSTRUCTION_OPCODE(endscript) {
-void Parallaction_ns::wrapLocalVar(LocalVariable *local) {
-
- if (local->_value >= local->_max)
- local->_value = local->_min;
- if (local->_value < local->_min)
- local->_value = local->_max - 1;
-
- return;
-}
-
DECLARE_COMMAND_OPCODE(invalid) {
error("Can't execute invalid command '%i'", _cmdRunCtxt.cmd->_id);
@@ -371,7 +363,6 @@ void Parallaction_ns::runScripts() {
debugC(9, kDebugExec, "runScripts");
-
static uint16 modCounter = 0;
for (ProgramList::iterator it = _location._programs.begin(); it != _location._programs.end(); it++) {
@@ -389,7 +380,7 @@ void Parallaction_ns::runScripts() {
(*it)->_status = kProgramRunning;
- debugC(9, kDebugExec, "Animation: %s, instruction: %s", a->_name, _instructionNamesRes[(*inst)->_index - 1]);
+ debugC(9, kDebugExec, "Animation: %s, instruction: %i", a->_name, (*inst)->_index); //_instructionNamesRes[(*inst)->_index - 1]);
_instRunCtxt.inst = inst;
_instRunCtxt.anim = AnimationPtr(a);
@@ -446,7 +437,7 @@ void Parallaction::runCommands(CommandList& list, ZonePtr z) {
if ((cmd->_flagsOn & v8) != cmd->_flagsOn) continue;
if ((cmd->_flagsOff & ~v8) != cmd->_flagsOff) continue;
- debugC(3, kDebugExec, "runCommands[%i]: %s (on: %x, off: %x)", cmd->_id, _commandsNamesRes[cmd->_id-1], cmd->_flagsOn, cmd->_flagsOff);
+// debugC(3, kDebugExec, "runCommands[%i]: %s (on: %x, off: %x)", cmd->_id, _commandsNamesRes[cmd->_id-1], cmd->_flagsOn, cmd->_flagsOff);
_cmdRunCtxt.z = z;
_cmdRunCtxt.cmd = cmd;
@@ -491,7 +482,7 @@ void Parallaction::displayComment(ExamineData *data) {
_gfx->setItemFrame(id, 0);
}
- _inputMode = kInputModeComment;
+ _input->_inputMode = Input::kInputModeComment;
}
@@ -663,56 +654,48 @@ ZonePtr Parallaction::hitZone(uint32 type, uint16 x, uint16 y) {
void Parallaction_ns::initOpcodes() {
- static const OpcodeV1 op1[] = {
- INSTRUCTION_OPCODE(invalid),
- INSTRUCTION_OPCODE(on),
- INSTRUCTION_OPCODE(off),
- INSTRUCTION_OPCODE(set), // x
- INSTRUCTION_OPCODE(set), // y
- INSTRUCTION_OPCODE(set), // z
- INSTRUCTION_OPCODE(set), // f
- INSTRUCTION_OPCODE(loop),
- INSTRUCTION_OPCODE(endloop),
- INSTRUCTION_OPCODE(null),
- INSTRUCTION_OPCODE(inc),
- INSTRUCTION_OPCODE(inc), // dec
- INSTRUCTION_OPCODE(set),
- INSTRUCTION_OPCODE(put),
- INSTRUCTION_OPCODE(call),
- INSTRUCTION_OPCODE(wait),
- INSTRUCTION_OPCODE(start),
- INSTRUCTION_OPCODE(sound),
- INSTRUCTION_OPCODE(move),
- INSTRUCTION_OPCODE(endscript)
- };
-
- uint i;
- for (i = 0; i < ARRAYSIZE(op1); i++)
- _instructionOpcodes.push_back(&op1[i]);
-
- static const OpcodeV1 op3[] = {
- COMMAND_OPCODE(invalid),
- COMMAND_OPCODE(set),
- COMMAND_OPCODE(clear),
- COMMAND_OPCODE(start),
- COMMAND_OPCODE(speak),
- COMMAND_OPCODE(get),
- COMMAND_OPCODE(location),
- COMMAND_OPCODE(open),
- COMMAND_OPCODE(close),
- COMMAND_OPCODE(on),
- COMMAND_OPCODE(off),
- COMMAND_OPCODE(call),
- COMMAND_OPCODE(toggle),
- COMMAND_OPCODE(drop),
- COMMAND_OPCODE(quit),
- COMMAND_OPCODE(move),
- COMMAND_OPCODE(stop)
- };
-
- for (i = 0; i < ARRAYSIZE(op3); i++)
- _commandOpcodes.push_back(&op3[i]);
-
+ Common::Array<const Opcode*> *table = 0;
+
+ SetOpcodeTable(_instructionOpcodes);
+ INSTRUCTION_OPCODE(invalid);
+ INSTRUCTION_OPCODE(on);
+ INSTRUCTION_OPCODE(off);
+ INSTRUCTION_OPCODE(set); // x
+ INSTRUCTION_OPCODE(set); // y
+ INSTRUCTION_OPCODE(set); // z
+ INSTRUCTION_OPCODE(set); // f
+ INSTRUCTION_OPCODE(loop);
+ INSTRUCTION_OPCODE(endloop);
+ INSTRUCTION_OPCODE(null);
+ INSTRUCTION_OPCODE(inc);
+ INSTRUCTION_OPCODE(inc); // dec
+ INSTRUCTION_OPCODE(set);
+ INSTRUCTION_OPCODE(put);
+ INSTRUCTION_OPCODE(call);
+ INSTRUCTION_OPCODE(wait);
+ INSTRUCTION_OPCODE(start);
+ INSTRUCTION_OPCODE(sound);
+ INSTRUCTION_OPCODE(move);
+ INSTRUCTION_OPCODE(endscript);
+
+ SetOpcodeTable(_commandOpcodes);
+ COMMAND_OPCODE(invalid);
+ COMMAND_OPCODE(set);
+ COMMAND_OPCODE(clear);
+ COMMAND_OPCODE(start);
+ COMMAND_OPCODE(speak);
+ COMMAND_OPCODE(get);
+ COMMAND_OPCODE(location);
+ COMMAND_OPCODE(open);
+ COMMAND_OPCODE(close);
+ COMMAND_OPCODE(on);
+ COMMAND_OPCODE(off);
+ COMMAND_OPCODE(call);
+ COMMAND_OPCODE(toggle);
+ COMMAND_OPCODE(drop);
+ COMMAND_OPCODE(quit);
+ COMMAND_OPCODE(move);
+ COMMAND_OPCODE(stop);
}
diff --git a/engines/parallaction/font.cpp b/engines/parallaction/font.cpp
index bc67acf644..91848b30a4 100644
--- a/engines/parallaction/font.cpp
+++ b/engines/parallaction/font.cpp
@@ -96,7 +96,7 @@ public:
return (uint16)_height;
}
- uint16 drawChar(char c) {
+ uint16 drawChar(unsigned char c) {
assert(c < _numGlyphs);
byte *src = _data + _offsets[c];
diff --git a/engines/parallaction/graphics.cpp b/engines/parallaction/graphics.cpp
index f92a58cdb0..58fb02a750 100644
--- a/engines/parallaction/graphics.cpp
+++ b/engines/parallaction/graphics.cpp
@@ -27,15 +27,12 @@
#include "common/file.h"
#include "graphics/primitives.h"
+#include "parallaction/input.h"
#include "parallaction/parallaction.h"
namespace Parallaction {
-
-typedef Common::HashMap<Common::String, int32, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> VarMap;
-VarMap _vars;
-
void Gfx::registerVar(const Common::String &name, int32 initialValue) {
if (_vars.contains(name)) {
warning("Variable '%s' already registered, ignoring initial value.\n", name.c_str());
@@ -781,9 +778,9 @@ void Gfx::updateFloatingLabel() {
int16 _si, _di;
Common::Point cursor;
- _vm->getCursorPos(cursor);
+ _vm->_input->getCursorPos(cursor);
- if (_vm->_activeItem._id != 0) {
+ if (_vm->_input->_activeItem._id != 0) {
_si = cursor.x + 16 - _floatingLabel->_cnv.w/2;
_di = cursor.y + 34;
} else {
diff --git a/engines/parallaction/graphics.h b/engines/parallaction/graphics.h
index 8f1c14aef0..894e0fd678 100644
--- a/engines/parallaction/graphics.h
+++ b/engines/parallaction/graphics.h
@@ -452,10 +452,13 @@ enum {
kBackgroundSlide = 2
};
+typedef Common::HashMap<Common::String, int32, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> VarMap;
+
class Gfx {
public:
Disk *_disk;
+ VarMap _vars;
GfxObjList _gfxobjList[3];
GfxObj* loadAnim(const char *name);
diff --git a/engines/parallaction/gui_br.cpp b/engines/parallaction/gui_br.cpp
index 8ce559e644..c515299a34 100644
--- a/engines/parallaction/gui_br.cpp
+++ b/engines/parallaction/gui_br.cpp
@@ -25,6 +25,8 @@
#include "common/system.h"
+
+#include "parallaction/input.h"
#include "parallaction/parallaction.h"
namespace Parallaction {
@@ -164,15 +166,20 @@ int Parallaction_br::guiShowMenu() {
setMousePointer(0);
+ uint32 event;
+ Common::Point p;
while (true) {
- if ((_mouseButtons == kMouseLeftUp) && selectedItem >= 0)
+ _input->readInput();
+
+ event = _input->getLastButtonEvent();
+ if ((event == kMouseLeftUp) && selectedItem >= 0)
break;
- readInput();
+ _input->getCursorPos(p);
- if ((_mousePos.x > MENUITEMS_X) && (_mousePos.x < (MENUITEMS_X+MENUITEM_WIDTH)) && (_mousePos.y > MENUITEMS_Y)) {
- selectedItem = (_mousePos.y - MENUITEMS_Y) / MENUITEM_HEIGHT;
+ if ((p.x > MENUITEMS_X) && (p.x < (MENUITEMS_X+MENUITEM_WIDTH)) && (p.y > MENUITEMS_Y)) {
+ selectedItem = (p.y - MENUITEMS_Y) / MENUITEM_HEIGHT;
if (!(selectedItem < availItems))
selectedItem = -1;
diff --git a/engines/parallaction/gui_ns.cpp b/engines/parallaction/gui_ns.cpp
index fec5695413..1d4d44fa46 100644
--- a/engines/parallaction/gui_ns.cpp
+++ b/engines/parallaction/gui_ns.cpp
@@ -25,6 +25,7 @@
#include "common/system.h"
+#include "parallaction/input.h"
#include "parallaction/parallaction.h"
#include "parallaction/sound.h"
@@ -206,20 +207,18 @@ int Parallaction_ns::guiNewGame() {
_gfx->showLabel(id[2], CENTER_LABEL_HORIZONTAL, 100);
_gfx->showLabel(id[3], CENTER_LABEL_HORIZONTAL, 120);
- showCursor(false);
+ _input->showCursor(false);
_gfx->updateScreen();
- _mouseButtons = kMouseNone;
- do {
- readInput();
- } while (_mouseButtons != kMouseLeftUp && _mouseButtons != kMouseRightUp);
+ _input->waitForButtonEvent(kMouseLeftUp | kMouseRightUp);
+ uint32 event = _input->getLastButtonEvent();
- showCursor(true);
+ _input->showCursor(true);
_gfx->freeLabels();
- if (_mouseButtons != kMouseRightUp) {
+ if (event != kMouseRightUp) {
return START_INTRO;
}
@@ -267,11 +266,14 @@ uint16 Parallaction_ns::guiChooseLanguage() {
setArrowCursor();
+ Common::Point p;
+
int selection = -1;
while (selection == -1) {
- waitUntilLeftClick();
+ _input->waitUntilLeftClick();
+ _input->getCursorPos(p);
for (uint16 i = 0; i < 4; i++) {
- if (blocks[i].contains(_mousePos)) {
+ if (blocks[i].contains(p)) {
selection = i;
break;
}
@@ -299,12 +301,18 @@ uint16 Parallaction_ns::guiSelectGame() {
id0 = _gfx->createLabel(_introFont, loadGameMsg[_language], 1);
id1 = _gfx->createLabel(_introFont, newGameMsg[_language], 1);
- _mouseButtons = kMouseNone;
- while (_mouseButtons != kMouseLeftUp) {
+ Common::Point p;
+
+ _input->readInput();
+ uint32 event = _input->getLastButtonEvent();
+
+ while (event != kMouseLeftUp) {
- readInput();
+ _input->readInput();
+ _input->getCursorPos(p);
+ event = _input->getLastButtonEvent();
- _si = (_mousePos.x > 160) ? 1 : 0;
+ _si = (p.x > 160) ? 1 : 0;
if (_si != _di) {
if (_si != 0) {
@@ -409,6 +417,8 @@ int Parallaction_ns::guiSelectCharacter() {
Graphics::Surface block;
block.create(BLOCK_WIDTH, BLOCK_HEIGHT, 1);
+ Common::Point p;
+
while (true) {
points[0] = 0;
@@ -422,8 +432,10 @@ int Parallaction_ns::guiSelectCharacter() {
_di = 0;
while (_di < PASSWORD_LEN) {
- waitUntilLeftClick();
- int _si = guiGetSelectedBlock(_mousePos);
+ _input->waitUntilLeftClick();
+ _input->getCursorPos(p);
+
+ int _si = guiGetSelectedBlock(p);
if (_si != -1) {
_gfx->grabBackground(codeTrueBlocks[_si], block);
diff --git a/engines/parallaction/input.cpp b/engines/parallaction/input.cpp
new file mode 100644
index 0000000000..28d0ad888d
--- /dev/null
+++ b/engines/parallaction/input.cpp
@@ -0,0 +1,332 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "common/events.h"
+
+#include "parallaction/input.h"
+#include "parallaction/parallaction.h"
+#include "parallaction/debug.h"
+
+namespace Parallaction {
+
+// FIXME: the engine has 3 event loops. The following routine hosts the main one,
+// and it's called from 8 different places in the code. There exist 2 more specialised
+// loops which could possibly be merged into this one with some effort in changing
+// caller code, i.e. adding condition checks.
+//
+uint16 Input::readInput() {
+
+ Common::Event e;
+ uint16 KeyDown = 0;
+
+ _mouseButtons = kMouseNone;
+
+ Common::EventManager *eventMan = _vm->_system->getEventManager();
+ while (eventMan->pollEvent(e)) {
+
+ switch (e.type) {
+ case Common::EVENT_KEYDOWN:
+ if (e.kbd.flags == Common::KBD_CTRL && e.kbd.keycode == 'd')
+ _vm->_debugger->attach();
+ if (_vm->getFeatures() & GF_DEMO) break;
+ if (e.kbd.keycode == Common::KEYCODE_l) KeyDown = kEvLoadGame;
+ if (e.kbd.keycode == Common::KEYCODE_s) KeyDown = kEvSaveGame;
+ break;
+
+ case Common::EVENT_LBUTTONDOWN:
+ _mouseButtons = kMouseLeftDown;
+ _mousePos = e.mouse;
+ break;
+
+ case Common::EVENT_LBUTTONUP:
+ _mouseButtons = kMouseLeftUp;
+ _mousePos = e.mouse;
+ break;
+
+ case Common::EVENT_RBUTTONDOWN:
+ _mouseButtons = kMouseRightDown;
+ _mousePos = e.mouse;
+ break;
+
+ case Common::EVENT_RBUTTONUP:
+ _mouseButtons = kMouseRightUp;
+ _mousePos = e.mouse;
+ break;
+
+ case Common::EVENT_MOUSEMOVE:
+ _mousePos = e.mouse;
+ break;
+
+ case Common::EVENT_QUIT:
+ // TODO: don't quit() here, just have caller routines to check
+ // on kEngineQuit and exit gracefully to allow the engine to shut down
+ _engineFlags |= kEngineQuit;
+ _vm->_system->quit();
+ break;
+
+ default:
+ break;
+
+ }
+
+ }
+
+ if (_vm->_debugger->isAttached())
+ _vm->_debugger->onFrame();
+
+ return KeyDown;
+
+}
+
+// FIXME: see comment for readInput()
+void Input::waitForButtonEvent(uint32 buttonEventMask, int32 timeout) {
+
+ if (buttonEventMask == kMouseNone) {
+ _mouseButtons = kMouseNone; // don't wait on nothing
+ return;
+ }
+
+ const int32 LOOP_RESOLUTION = 30;
+ if (timeout <= 0) {
+ do {
+ readInput();
+ _vm->_system->delayMillis(LOOP_RESOLUTION);
+ } while ((_mouseButtons & buttonEventMask) == 0);
+ } else {
+ do {
+ readInput();
+ _vm->_system->delayMillis(LOOP_RESOLUTION);
+ timeout -= LOOP_RESOLUTION;
+ } while ((timeout > 0) && (_mouseButtons & buttonEventMask) == 0);
+ }
+
+}
+
+// FIXME: see comment for readInput()
+void Input::waitUntilLeftClick() {
+
+ do {
+ readInput();
+ _vm->_gfx->updateScreen();
+ _vm->_system->delayMillis(30);
+ } while (_mouseButtons != kMouseLeftUp);
+
+ return;
+}
+
+
+void Input::updateGameInput() {
+
+ int16 keyDown = readInput();
+
+ debugC(3, kDebugInput, "translateInput: input flags (%i, %i, %i, %i)",
+ !_mouseHidden,
+ (_engineFlags & kEngineBlockInput) == 0,
+ (_engineFlags & kEngineWalking) == 0,
+ (_engineFlags & kEngineChangeLocation) == 0
+ );
+
+ if ((_mouseHidden) ||
+ (_engineFlags & kEngineBlockInput) ||
+ (_engineFlags & kEngineWalking) ||
+ (_engineFlags & kEngineChangeLocation)) {
+
+ return;
+ }
+
+ if (keyDown == kEvQuitGame) {
+ _inputData._event = kEvQuitGame;
+ } else
+ if (keyDown == kEvSaveGame) {
+ _inputData._event = kEvSaveGame;
+ } else
+ if (keyDown == kEvLoadGame) {
+ _inputData._event = kEvLoadGame;
+ } else {
+ _inputData._mousePos = _mousePos;
+ _inputData._event = kEvNone;
+ if (!translateGameInput()) {
+ translateInventoryInput();
+ }
+ }
+
+}
+
+void Input::updateCommentInput() {
+ waitUntilLeftClick();
+
+ _vm->_gfx->hideDialogueStuff();
+ _vm->_gfx->setHalfbriteMode(false);
+
+ _inputMode = kInputModeGame;
+}
+
+InputData* Input::updateInput() {
+
+ _inputData._event = kEvNone;
+
+ switch (_inputMode) {
+ case kInputModeComment:
+ updateCommentInput();
+ break;
+
+ case kInputModeGame:
+ updateGameInput();
+ break;
+ }
+
+ return &_inputData;
+}
+
+bool Input::translateGameInput() {
+
+ if ((_engineFlags & kEnginePauseJobs) || (_engineFlags & kEngineInventory)) {
+ return false;
+ }
+
+ if (_actionAfterWalk) {
+ // if walking is over, then take programmed action
+ _inputData._event = kEvAction;
+ _actionAfterWalk = false;
+ return true;
+ }
+
+ if (_mouseButtons == kMouseRightDown) {
+ // right button down shows inventory
+
+ if (_vm->hitZone(kZoneYou, _mousePos.x, _mousePos.y) && (_activeItem._id != 0)) {
+ _activeItem._index = (_activeItem._id >> 16) & 0xFFFF;
+ _engineFlags |= kEngineDragging;
+ }
+
+ _inputData._event = kEvOpenInventory;
+ _transCurrentHoverItem = -1;
+ return true;
+ }
+
+ // test if mouse is hovering on an interactive zone for the currently selected inventory item
+ ZonePtr z = _vm->hitZone(_activeItem._id, _mousePos.x, _mousePos.y);
+
+ if (((_mouseButtons == kMouseLeftUp) && (_activeItem._id == 0) && ((_engineFlags & kEngineWalking) == 0)) && ((!z) || ((z->_type & 0xFFFF) != kZoneCommand))) {
+ _inputData._event = kEvWalk;
+ return true;
+ }
+
+ if ((z != _hoverZone) && (_hoverZone)) {
+ _hoverZone = nullZonePtr;
+ _inputData._event = kEvExitZone;
+ return true;
+ }
+
+ if (!z) {
+ _inputData._event = kEvNone;
+ return true;
+ }
+
+ if ((!_hoverZone) && ((z->_flags & kFlagsNoName) == 0)) {
+ _hoverZone = z;
+ _inputData._event = kEvEnterZone;
+ _inputData._label = z->_label;
+ return true;
+ }
+
+ if ((_mouseButtons == kMouseLeftUp) && ((_activeItem._id != 0) || ((z->_type & 0xFFFF) == kZoneCommand))) {
+
+ _inputData._zone = z;
+ if (z->_flags & kFlagsNoWalk) {
+ // character doesn't need to walk to take specified action
+ _inputData._event = kEvAction;
+
+ } else {
+ // action delayed: if Zone defined a moveto position the character is programmed to move there,
+ // else it will move to the mouse position
+ _inputData._event = kEvWalk;
+ _actionAfterWalk = true;
+ if (z->_moveTo.y != 0) {
+ _inputData._mousePos = z->_moveTo;
+ }
+ }
+
+ _vm->beep();
+ _vm->setArrowCursor();
+ return true;
+ }
+
+ return true;
+
+}
+
+bool Input::translateInventoryInput() {
+
+ if ((_engineFlags & kEngineInventory) == 0) {
+ return false;
+ }
+
+ // in inventory
+ int16 _si = _vm->getHoverInventoryItem(_mousePos.x, _mousePos.y);
+
+ if (_mouseButtons == kMouseRightUp) {
+ // right up hides inventory
+
+ _inputData._event = kEvCloseInventory;
+ _inputData._inventoryIndex = _vm->getHoverInventoryItem(_mousePos.x, _mousePos.y);
+ _vm->highlightInventoryItem(-1); // disable
+
+ if ((_engineFlags & kEngineDragging) == 0) {
+ return true;
+ }
+
+ _engineFlags &= ~kEngineDragging;
+ ZonePtr z = _vm->hitZone(kZoneMerge, _activeItem._index, _vm->getInventoryItemIndex(_inputData._inventoryIndex));
+
+ if (z) {
+ _vm->dropItem(z->u.merge->_obj1);
+ _vm->dropItem(z->u.merge->_obj2);
+ _vm->addInventoryItem(z->u.merge->_obj3);
+ _vm->runCommands(z->_commands);
+ }
+
+ return true;
+ }
+
+ if (_si == _transCurrentHoverItem) {
+ _inputData._event = kEvNone;
+ return true;
+ }
+
+ _transCurrentHoverItem = _si;
+ _inputData._event = kEvHoverInventory;
+ _inputData._inventoryIndex = _si;
+ return true;
+
+}
+
+void Input::showCursor(bool visible) {
+ _mouseHidden = !visible;
+ _vm->_system->showMouse(visible);
+}
+
+
+} // namespace Parallaction
diff --git a/engines/parallaction/input.h b/engines/parallaction/input.h
new file mode 100644
index 0000000000..46dbb08c4e
--- /dev/null
+++ b/engines/parallaction/input.h
@@ -0,0 +1,114 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#ifndef PARALLACTION_INPUT_H
+#define PARALLACTION_INPUT_H
+
+#include "parallaction/objects.h"
+#include "parallaction/inventory.h"
+
+namespace Parallaction {
+
+enum {
+ kMouseNone = 0,
+ kMouseLeftUp = 1,
+ kMouseLeftDown = 2,
+ kMouseRightUp = 4,
+ kMouseRightDown = 8
+};
+
+struct InputData {
+ uint16 _event;
+ Common::Point _mousePos;
+ int16 _inventoryIndex;
+ ZonePtr _zone;
+ Label* _label;
+};
+
+class Input {
+ void updateGameInput();
+ void updateCommentInput();
+
+ // input-only
+ InputData _inputData;
+ bool _actionAfterWalk; // actived when the character needs to move before taking an action
+ // these two could/should be merged as they carry on the same duty in two member functions,
+ // respectively processInput and translateInput
+ int16 _transCurrentHoverItem;
+
+ InputData *translateInput();
+ bool translateGameInput();
+ bool translateInventoryInput();
+
+ Parallaction *_vm;
+
+ Common::Point _mousePos;
+ uint16 _mouseButtons;
+
+ bool _mouseHidden;
+ ZonePtr _hoverZone;
+
+public:
+ enum {
+ kInputModeGame = 0,
+ kInputModeComment = 1
+ };
+
+
+ Input(Parallaction *vm) : _vm(vm) {
+ _transCurrentHoverItem = 0;
+ _actionAfterWalk = false; // actived when the character needs to move before taking an action
+ _mouseHidden = false;
+ _activeItem._index = 0;
+ _activeItem._id = 0;
+ _mouseButtons = 0;
+ }
+
+ virtual ~Input() { }
+
+
+ void showCursor(bool visible);
+ void getCursorPos(Common::Point& p) {
+ p = _mousePos;
+ }
+
+ int _inputMode;
+ InventoryItem _activeItem;
+
+ uint16 readInput();
+ InputData* updateInput();
+ void waitUntilLeftClick();
+ void waitForButtonEvent(uint32 buttonEventMask, int32 timeout = -1);
+ uint32 getLastButtonEvent() { return _mouseButtons; }
+
+ void stopHovering() {
+ _hoverZone = nullZonePtr;
+ }
+
+};
+
+} // namespace Parallaction
+
+#endif
diff --git a/engines/parallaction/inventory.cpp b/engines/parallaction/inventory.cpp
index 05202809a9..58848196d7 100644
--- a/engines/parallaction/inventory.cpp
+++ b/engines/parallaction/inventory.cpp
@@ -23,7 +23,7 @@
*
*/
-
+#include "parallaction/input.h"
#include "parallaction/parallaction.h"
@@ -52,8 +52,18 @@ int16 Parallaction::getHoverInventoryItem(int16 x, int16 y) {
return _inventoryRenderer->hitTest(Common::Point(x,y));
}
-void Parallaction::highlightInventoryItem(ItemPosition pos, byte color) {
- _inventoryRenderer->highlightItem(pos, color);
+void Parallaction::highlightInventoryItem(ItemPosition pos) {
+ static ItemPosition lastHighlightedPos = -1;
+
+ if (lastHighlightedPos != -1) {
+ _inventoryRenderer->highlightItem(lastHighlightedPos, 12);
+ }
+
+ if (pos != -1) {
+ _inventoryRenderer->highlightItem(pos, 19);
+ }
+
+ lastHighlightedPos = pos;
}
int Parallaction::addInventoryItem(ItemName item) {
@@ -125,8 +135,11 @@ void InventoryRenderer::showInventory() {
uint16 lines = getNumLines();
- _pos.x = CLIP(_vm->_mousePos.x - (INVENTORY_WIDTH / 2), 0, (int)(_vm->_screenWidth - INVENTORY_WIDTH));
- _pos.y = CLIP(_vm->_mousePos.y - 2 - (lines * INVENTORYITEM_HEIGHT), 0, (int)(_vm->_screenHeight - lines * INVENTORYITEM_HEIGHT));
+ Common::Point p;
+ _vm->_input->getCursorPos(p);
+
+ _pos.x = CLIP(p.x - (INVENTORY_WIDTH / 2), 0, (int)(_vm->_screenWidth - INVENTORY_WIDTH));
+ _pos.y = CLIP(p.y - 2 - (lines * INVENTORYITEM_HEIGHT), 0, (int)(_vm->_screenHeight - lines * INVENTORYITEM_HEIGHT));
refresh();
}
diff --git a/engines/parallaction/module.mk b/engines/parallaction/module.mk
index c7e7af14bf..2478b4b2e1 100644
--- a/engines/parallaction/module.mk
+++ b/engines/parallaction/module.mk
@@ -15,6 +15,7 @@ MODULE_OBJS := \
graphics.o \
gui_br.o \
gui_ns.o \
+ input.o \
inventory.o \
objects.o \
parallaction.o \
diff --git a/engines/parallaction/objects.cpp b/engines/parallaction/objects.cpp
index 0491c5c3c7..cac31911f4 100644
--- a/engines/parallaction/objects.cpp
+++ b/engines/parallaction/objects.cpp
@@ -116,6 +116,16 @@ int16 Program::addLocal(const char *name, int16 value, int16 min, int16 max) {
return _numLocals++;
}
+void LocalVariable::wrap() {
+
+ if (_value >= _max)
+ _value = _min;
+ if (_value < _min)
+ _value = _max - 1;
+
+ return;
+}
+
Zone::Zone() {
diff --git a/engines/parallaction/objects.h b/engines/parallaction/objects.h
index cfb78f941b..afa6cc5ed5 100644
--- a/engines/parallaction/objects.h
+++ b/engines/parallaction/objects.h
@@ -94,7 +94,7 @@ enum ZoneFlags {
enum CommandFlags {
- kFlagsAll = 0xFFFFFFFF,
+ kFlagsAll = 0xFFFFFFFFU,
kFlagsVisited = 1,
kFlagsExit = 0x10000000,
@@ -106,7 +106,6 @@ enum CommandFlags {
};
-
struct CommandData {
uint32 _flags;
ZonePtr _zone;
@@ -317,6 +316,8 @@ struct LocalVariable {
_min = -10000;
_max = 10000;
}
+
+ void wrap();
};
enum ParaFlags {
diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp
index 649f21ae96..d66b1af1f1 100644
--- a/engines/parallaction/parallaction.cpp
+++ b/engines/parallaction/parallaction.cpp
@@ -31,6 +31,8 @@
#include "sound/mididrv.h"
#include "sound/mixer.h"
+
+#include "parallaction/input.h"
#include "parallaction/parallaction.h"
#include "parallaction/debug.h"
#include "parallaction/sound.h"
@@ -44,9 +46,6 @@ Parallaction *_vm = NULL;
// public stuff
-uint16 _mouseButtons = 0;
-
-
char _saveData1[30] = { '\0' };
uint16 _language = 0;
uint32 _engineFlags = 0;
@@ -67,8 +66,6 @@ Parallaction::Parallaction(OSystem *syst, const PARALLACTIONGameDescription *gam
// FIXME
_vm = this;
- _mouseHidden = false;
-
Common::File::addDefaultDirectory( _gameDataPath );
Common::addSpecialDebugLevel(kDebugDialogue, "dialogue", "Dialogues debug level");
@@ -89,13 +86,10 @@ Parallaction::Parallaction(OSystem *syst, const PARALLACTIONGameDescription *gam
Parallaction::~Parallaction() {
delete _debugger;
- delete _locationParser;
delete _globalTable;
delete _callableNames;
delete _localFlagNames;
- delete _zoneTypeNames;
- delete _zoneFlagNames;
freeLocation();
@@ -114,11 +108,6 @@ int Parallaction::init() {
_objectsNames = NULL;
_globalTable = NULL;
_location._hasSound = false;
- _transCurrentHoverItem = 0;
- _actionAfterWalk = false; // actived when the character needs to move before taking an action
- _activeItem._index = 0;
- _activeItem._id = 0;
- _procCurrentHoverItem = -1;
_baseTime = 0;
_numLocations = 0;
_location._startPosition.x = -1000;
@@ -137,6 +126,8 @@ int Parallaction::init() {
initInventory(); // needs to be pushed into subclass
+ _input = new Input(this);
+
_gfx = new Gfx(this);
_debugger = new Debugger(this);
@@ -150,111 +141,6 @@ int Parallaction::init() {
-// FIXME: the engine has 3 event loops. The following routine hosts the main one,
-// and it's called from 8 different places in the code. There exist 2 more specialised
-// loops which could possibly be merged into this one with some effort in changing
-// caller code, i.e. adding condition checks.
-//
-uint16 Parallaction::readInput() {
-
- Common::Event e;
- uint16 KeyDown = 0;
-
- _mouseButtons = kMouseNone;
-
- Common::EventManager *eventMan = _system->getEventManager();
- while (eventMan->pollEvent(e)) {
-
- switch (e.type) {
- case Common::EVENT_KEYDOWN:
- if (e.kbd.flags == Common::KBD_CTRL && e.kbd.keycode == 'd')
- _debugger->attach();
- if (getFeatures() & GF_DEMO) break;
- if (e.kbd.keycode == Common::KEYCODE_l) KeyDown = kEvLoadGame;
- if (e.kbd.keycode == Common::KEYCODE_s) KeyDown = kEvSaveGame;
- break;
-
- case Common::EVENT_LBUTTONDOWN:
- _mouseButtons = kMouseLeftDown;
- _mousePos = e.mouse;
- break;
-
- case Common::EVENT_LBUTTONUP:
- _mouseButtons = kMouseLeftUp;
- _mousePos = e.mouse;
- break;
-
- case Common::EVENT_RBUTTONDOWN:
- _mouseButtons = kMouseRightDown;
- _mousePos = e.mouse;
- break;
-
- case Common::EVENT_RBUTTONUP:
- _mouseButtons = kMouseRightUp;
- _mousePos = e.mouse;
- break;
-
- case Common::EVENT_MOUSEMOVE:
- _mousePos = e.mouse;
- break;
-
- case Common::EVENT_QUIT:
- // TODO: don't quit() here, just have caller routines to check
- // on kEngineQuit and exit gracefully to allow the engine to shut down
- _engineFlags |= kEngineQuit;
- g_system->quit();
- break;
-
- default:
- break;
-
- }
-
- }
-
- if (_debugger->isAttached())
- _debugger->onFrame();
-
- return KeyDown;
-
-}
-
-// FIXME: see comment for readInput()
-void waitUntilLeftClick() {
-
- do {
- _vm->readInput();
- _vm->_gfx->updateScreen();
- g_system->delayMillis(30);
- } while (_mouseButtons != kMouseLeftUp);
-
- return;
-}
-
-void Parallaction::runGame() {
-
- updateInput();
-
- runPendingZones();
-
- if (_engineFlags & kEngineChangeLocation) {
- changeLocation(_location._name);
- }
-
-
- _gfx->beginFrame();
-
- if (_inputMode == kInputModeGame) {
- runScripts();
- walk();
- drawAnimations();
- }
-
- // change this to endFrame?
- updateView();
-
-}
-
void Parallaction::updateView() {
if ((_engineFlags & kEnginePauseJobs) && (_engineFlags & kEngineInventory) == 0) {
@@ -267,301 +153,6 @@ void Parallaction::updateView() {
}
-void Parallaction::processInput(InputData *data) {
-
- switch (data->_event) {
- case kEvEnterZone:
- debugC(2, kDebugInput, "processInput: kEvEnterZone");
- _gfx->setFloatingLabel(data->_label);
- break;
-
- case kEvExitZone:
- debugC(2, kDebugInput, "processInput: kEvExitZone");
- _gfx->setFloatingLabel(0);
- break;
-
- case kEvAction:
- debugC(2, kDebugInput, "processInput: kEvAction");
- _procCurrentHoverItem = -1;
- _hoverZone = nullZonePtr;
- pauseJobs();
- runZone(data->_zone);
- resumeJobs();
- break;
-
- case kEvOpenInventory:
- _procCurrentHoverItem = -1;
- _hoverZone = nullZonePtr;
- _gfx->setFloatingLabel(0);
- if (hitZone(kZoneYou, _mousePos.x, _mousePos.y) == 0) {
- setArrowCursor();
- }
- pauseJobs();
- openInventory();
- break;
-
- case kEvCloseInventory: // closes inventory and possibly select item
- closeInventory();
- setInventoryCursor(data->_inventoryIndex);
- resumeJobs();
- break;
-
- case kEvHoverInventory:
- highlightInventoryItem(_procCurrentHoverItem, 12); // disable
- highlightInventoryItem(data->_inventoryIndex, 19); // enable
- _procCurrentHoverItem = data->_inventoryIndex;
- break;
-
- case kEvWalk:
- debugC(2, kDebugInput, "processInput: kEvWalk");
- _hoverZone = nullZonePtr;
- setArrowCursor();
- _char.scheduleWalk(data->_mousePos.x, data->_mousePos.y);
- break;
-
- case kEvQuitGame:
- _engineFlags |= kEngineQuit;
- break;
-
- case kEvSaveGame:
- _hoverZone = nullZonePtr;
- saveGame();
- setArrowCursor();
- break;
-
- case kEvLoadGame:
- _hoverZone = nullZonePtr;
- loadGame();
- setArrowCursor();
- break;
-
- }
-
- return;
-}
-
-
-
-
-
-void Parallaction::updateGameInput() {
-
- int16 keyDown = readInput();
-
- debugC(3, kDebugInput, "translateInput: input flags (%i, %i, %i, %i)",
- !_mouseHidden,
- (_engineFlags & kEngineBlockInput) == 0,
- (_engineFlags & kEngineWalking) == 0,
- (_engineFlags & kEngineChangeLocation) == 0
- );
-
- if ((_mouseHidden) ||
- (_engineFlags & kEngineBlockInput) ||
- (_engineFlags & kEngineWalking) ||
- (_engineFlags & kEngineChangeLocation)) {
-
- return;
- }
-
- if (keyDown == kEvQuitGame) {
- _input._event = kEvQuitGame;
- } else
- if (keyDown == kEvSaveGame) {
- _input._event = kEvSaveGame;
- } else
- if (keyDown == kEvLoadGame) {
- _input._event = kEvLoadGame;
- } else {
- _input._mousePos = _mousePos;
- _input._event = kEvNone;
- if (!translateGameInput()) {
- translateInventoryInput();
- }
- }
-
- if (_input._event != kEvNone)
- processInput(&_input);
-
-}
-
-void Parallaction::updateCommentInput() {
- waitUntilLeftClick();
-
- _gfx->hideDialogueStuff();
- _gfx->setHalfbriteMode(false);
-
- _inputMode = kInputModeGame;
-}
-
-void Parallaction::updateInput() {
-
- switch (_inputMode) {
- case kInputModeComment:
- updateCommentInput();
- break;
-
- case kInputModeGame:
- updateGameInput();
- break;
- }
-
- return;
-}
-
-bool Parallaction::translateGameInput() {
-
- if ((_engineFlags & kEnginePauseJobs) || (_engineFlags & kEngineInventory)) {
- return false;
- }
-
- if (_actionAfterWalk) {
- // if walking is over, then take programmed action
- _input._event = kEvAction;
- _actionAfterWalk = false;
- return true;
- }
-
- if (_mouseButtons == kMouseRightDown) {
- // right button down shows inventory
-
- if (hitZone(kZoneYou, _mousePos.x, _mousePos.y) && (_activeItem._id != 0)) {
- _activeItem._index = (_activeItem._id >> 16) & 0xFFFF;
- _engineFlags |= kEngineDragging;
- }
-
- _input._event = kEvOpenInventory;
- _transCurrentHoverItem = -1;
- return true;
- }
-
- // test if mouse is hovering on an interactive zone for the currently selected inventory item
- ZonePtr z = hitZone(_activeItem._id, _mousePos.x, _mousePos.y);
-
- if (((_mouseButtons == kMouseLeftUp) && (_activeItem._id == 0) && ((_engineFlags & kEngineWalking) == 0)) && ((!z) || ((z->_type & 0xFFFF) != kZoneCommand))) {
- _input._event = kEvWalk;
- return true;
- }
-
- if ((z != _hoverZone) && (_hoverZone)) {
- _hoverZone = nullZonePtr;
- _input._event = kEvExitZone;
- return true;
- }
-
- if (!z) {
- _input._event = kEvNone;
- return true;
- }
-
- if ((!_hoverZone) && ((z->_flags & kFlagsNoName) == 0)) {
- _hoverZone = z;
- _input._event = kEvEnterZone;
- _input._label = z->_label;
- return true;
- }
-
- if ((_mouseButtons == kMouseLeftUp) && ((_activeItem._id != 0) || ((z->_type & 0xFFFF) == kZoneCommand))) {
-
- _input._zone = z;
- if (z->_flags & kFlagsNoWalk) {
- // character doesn't need to walk to take specified action
- _input._event = kEvAction;
-
- } else {
- // action delayed: if Zone defined a moveto position the character is programmed to move there,
- // else it will move to the mouse position
- _input._event = kEvWalk;
- _actionAfterWalk = true;
- if (z->_moveTo.y != 0) {
- _input._mousePos = z->_moveTo;
- }
- }
-
- beep();
- setArrowCursor();
- return true;
- }
-
- return true;
-
-}
-
-bool Parallaction::translateInventoryInput() {
-
- if ((_engineFlags & kEngineInventory) == 0) {
- return false;
- }
-
- // in inventory
- int16 _si = getHoverInventoryItem(_mousePos.x, _mousePos.y);
-
- if (_mouseButtons == kMouseRightUp) {
- // right up hides inventory
-
- _input._event = kEvCloseInventory;
- _input._inventoryIndex = getHoverInventoryItem(_mousePos.x, _mousePos.y);
- highlightInventoryItem(_transCurrentHoverItem, 12); // disable
-
- if ((_engineFlags & kEngineDragging) == 0) {
- return true;
- }
-
- _engineFlags &= ~kEngineDragging;
- ZonePtr z = hitZone(kZoneMerge, _activeItem._index, getInventoryItemIndex(_input._inventoryIndex));
-
- if (z) {
- dropItem(z->u.merge->_obj1);
- dropItem(z->u.merge->_obj2);
- addInventoryItem(z->u.merge->_obj3);
- runCommands(z->_commands);
- }
-
- return true;
- }
-
- if (_si == _transCurrentHoverItem) {
- _input._event = kEvNone;
- return true;
- }
-
- _transCurrentHoverItem = _si;
- _input._event = kEvHoverInventory;
- _input._inventoryIndex = _si;
- return true;
-
-}
-
-
-uint32 Parallaction::getElapsedTime() {
- return g_system->getMillis() - _baseTime;
-}
-
-void Parallaction::resetTimer() {
- _baseTime = g_system->getMillis();
- return;
-}
-
-
-void Parallaction::waitTime(uint32 t) {
-
- uint32 v4 = 0;
-
- while (v4 < t * (1000 / 18.2)) {
- v4 = getElapsedTime();
- }
-
- resetTimer();
-
- return;
-}
-
-
-void Parallaction::showCursor(bool visible) {
- _mouseHidden = !visible;
- g_system->showMouse(visible);
-}
-
-
void Parallaction::freeCharacter() {
debugC(1, kDebugExec, "freeCharacter()");
@@ -687,6 +278,102 @@ void Parallaction::showLocationComment(const char *text, bool end) {
}
+void Parallaction::processInput(InputData *data) {
+
+ switch (data->_event) {
+ case kEvEnterZone:
+ debugC(2, kDebugInput, "processInput: kEvEnterZone");
+ _gfx->setFloatingLabel(data->_label);
+ break;
+
+ case kEvExitZone:
+ debugC(2, kDebugInput, "processInput: kEvExitZone");
+ _gfx->setFloatingLabel(0);
+ break;
+
+ case kEvAction:
+ debugC(2, kDebugInput, "processInput: kEvAction");
+ _input->stopHovering();
+ pauseJobs();
+ runZone(data->_zone);
+ resumeJobs();
+ break;
+
+ case kEvOpenInventory:
+ _input->stopHovering();
+ _gfx->setFloatingLabel(0);
+ if (hitZone(kZoneYou, data->_mousePos.x, data->_mousePos.y) == 0) {
+ setArrowCursor();
+ }
+ pauseJobs();
+ openInventory();
+ break;
+
+ case kEvCloseInventory: // closes inventory and possibly select item
+ closeInventory();
+ setInventoryCursor(data->_inventoryIndex);
+ resumeJobs();
+ break;
+
+ case kEvHoverInventory:
+ highlightInventoryItem(data->_inventoryIndex); // enable
+ break;
+
+ case kEvWalk:
+ debugC(2, kDebugInput, "processInput: kEvWalk");
+ _input->stopHovering();
+ setArrowCursor();
+ _char.scheduleWalk(data->_mousePos.x, data->_mousePos.y);
+ break;
+
+ case kEvQuitGame:
+ _engineFlags |= kEngineQuit;
+ break;
+
+ case kEvSaveGame:
+ _input->stopHovering();
+ saveGame();
+ setArrowCursor();
+ break;
+
+ case kEvLoadGame:
+ _input->stopHovering();
+ loadGame();
+ setArrowCursor();
+ break;
+
+ }
+
+ return;
+}
+
+void Parallaction::runGame() {
+
+ InputData *data = _input->updateInput();
+ if (data->_event != kEvNone) {
+ processInput(data);
+ }
+
+ runPendingZones();
+
+ if (_engineFlags & kEngineChangeLocation) {
+ changeLocation(_location._name);
+ }
+
+
+ _gfx->beginFrame();
+
+ if (_input->_inputMode == Input::kInputModeGame) {
+ runScripts();
+ walk();
+ drawAnimations();
+ }
+
+ // change this to endFrame?
+ updateView();
+
+}
+
@@ -719,15 +406,15 @@ void Parallaction::doLocationEnterTransition() {
_gfx->updateScreen();
showLocationComment(_location._comment, false);
- waitUntilLeftClick();
+ _input->waitUntilLeftClick();
_gfx->freeBalloons();
// fades maximum intensity palette towards approximation of main palette
for (uint16 _si = 0; _si<6; _si++) {
pal.fadeTo(_gfx->_palette, 4);
_gfx->setPalette(pal);
- waitTime( 1 );
_gfx->updateScreen();
+ g_system->delayMillis(20);
}
_gfx->setPalette(_gfx->_palette);
diff --git a/engines/parallaction/parallaction.h b/engines/parallaction/parallaction.h
index 19ce437410..6e5957d3cd 100644
--- a/engines/parallaction/parallaction.h
+++ b/engines/parallaction/parallaction.h
@@ -33,6 +33,7 @@
#include "engines/engine.h"
+#include "parallaction/input.h"
#include "parallaction/inventory.h"
#include "parallaction/parser.h"
#include "parallaction/objects.h"
@@ -96,14 +97,6 @@ enum {
kPriority21 = 21
};
-enum {
- kMouseNone = 0,
- kMouseLeftUp = 1,
- kMouseLeftDown = 2,
- kMouseRightUp = 3,
- kMouseRightDown = 4
-};
-
enum EngineFlags {
kEngineQuit = (1 << 0),
kEnginePauseJobs = (1 << 1),
@@ -151,7 +144,6 @@ extern char _password[8];
extern uint16 _score;
extern uint16 _language;
extern uint32 _engineFlags;
-#define MAX_FORWARDS 50
extern char _saveData1[];
extern uint32 _commandFlags;
extern const char *_dinoName;
@@ -164,7 +156,6 @@ extern const char *_minidoughName;
extern const char *_minidrkiName;
-void waitUntilLeftClick();
@@ -172,7 +163,7 @@ void waitUntilLeftClick();
class Debugger;
class Gfx;
class SoundMan;
-
+class Input;
struct Location {
@@ -194,6 +185,7 @@ struct Location {
// NS specific
WalkNodeList _walkNodes;
+ char _slideText[2][MAX_TOKEN_LEN];
// BRA specific
int _zeta0;
@@ -246,13 +238,6 @@ public:
-
-#define DECLARE_UNQUALIFIED_ZONE_PARSER(sig) void locZoneParse_##sig()
-#define DECLARE_UNQUALIFIED_ANIM_PARSER(sig) void locAnimParse_##sig()
-#define DECLARE_UNQUALIFIED_COMMAND_PARSER(sig) void cmdParse_##sig()
-#define DECLARE_UNQUALIFIED_LOCATION_PARSER(sig) void locParse_##sig()
-#define DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(sig) void instParse_##sig()
-
#define DECLARE_UNQUALIFIED_COMMAND_OPCODE(op) void cmdOp_##op()
#define DECLARE_UNQUALIFIED_INSTRUCTION_OPCODE(op) void instOp_##op()
@@ -272,20 +257,7 @@ public:
virtual bool loadGame() = 0;
virtual bool saveGame() = 0;
- uint16 readInput();
- void updateInput();
-
- void waitTime(uint32 t);
-
- enum {
- kInputModeGame = 0,
- kInputModeComment = 1
- };
-
- int _inputMode;
-
- void updateGameInput();
- void updateCommentInput();
+ Input *_input;
OpcodeSet _commandOpcodes;
@@ -304,8 +276,7 @@ public:
bool suspend;
} _instRunCtxt;
-
- void showCursor(bool visible);
+ void processInput(InputData* data);
void pauseJobs();
void resumeJobs();
@@ -331,13 +302,9 @@ public:
Table *_globalTable;
Table *_objectsNames;
- Table *_zoneTypeNames;
- Table *_zoneFlagNames;
Table *_callableNames;
Table *_localFlagNames;
- Parser *_locationParser;
-
public:
int getGameType() const;
uint32 getFeatures() const;
@@ -373,13 +340,6 @@ public:
uint16 _numLocations;
Location _location;
- InventoryItem _activeItem;
-
- Common::Point _mousePos;
- void getCursorPos(Common::Point& p) {
- p = _mousePos;
- }
-
ZonePtr _activeZone;
@@ -390,52 +350,22 @@ public:
Common::RandomSource _rnd;
-protected: // data
-
Debugger *_debugger;
- struct InputData {
- uint16 _event;
- Common::Point _mousePos;
- int16 _inventoryIndex;
- ZonePtr _zone;
- Label* _label;
- };
-
- bool _mouseHidden;
-
- // input-only
- InputData _input;
- bool _actionAfterWalk; // actived when the character needs to move before taking an action
-
- // these two could/should be merged as they carry on the same duty in two member functions,
- // respectively processInput and translateInput
- int16 _procCurrentHoverItem;
- int16 _transCurrentHoverItem;
+protected: // data
uint32 _baseTime;
char _characterName1[50]; // only used in changeCharacter
Common::String _saveFileName;
- ZonePtr _hoverZone;
-
-
protected: // members
bool detectGame(void);
void initGlobals();
void runGame();
void updateView();
- uint32 getElapsedTime();
- void resetTimer();
-
- InputData *translateInput();
- bool translateGameInput();
- bool translateInventoryInput();
- void processInput(InputData*);
-
void scheduleLocationSwitch(const char *location);
void doLocationEnterTransition();
@@ -472,13 +402,13 @@ public:
void beep();
public:
- const char **_zoneFlagNamesRes;
- const char **_zoneTypeNamesRes;
- const char **_commandsNamesRes;
+// const char **_zoneFlagNamesRes;
+// const char **_zoneTypeNamesRes;
+// const char **_commandsNamesRes;
const char **_callableNamesRes;
const char **_instructionNamesRes;
- void highlightInventoryItem(ItemPosition pos, byte color);
+ void highlightInventoryItem(ItemPosition pos);
int16 getHoverInventoryItem(int16 x, int16 y);
int addInventoryItem(ItemName item);
int addInventoryItem(ItemName item, uint32 value);
@@ -558,8 +488,12 @@ public:
bool loadGame();
bool saveGame();
+ void switchBackground(const char* background, const char* mask);
private:
+ LocationParser_ns *_locationParser;
+ ProgramParser_ns *_programParser;
+
void initFonts();
void freeFonts();
void renameOldSavefiles();
@@ -586,9 +520,11 @@ private:
void initResources();
void initCursors();
+ void initParsers();
- static byte _mouseArrow[256];
- Frames *_mouseComposedArrow;
+ static byte _resMouseArrow[256];
+ byte *_mouseArrow;
+ Frames *_mouseComposedArrow;
static const Callable _dosCallables[25];
static const Callable _amigaCallables[25];
@@ -600,7 +536,6 @@ private:
ZonePtr _moveSarcZone0;
ZonePtr _moveSarcZone1;
uint16 num_foglie;
- char _slideText[2][MAX_TOKEN_LEN];
int16 _introSarcData1;
uint16 _introSarcData2; // sarcophagus stuff to be saved
uint16 _introSarcData3; // sarcophagus stuff to be saved
@@ -649,149 +584,10 @@ protected:
void walk();
void drawAnimations();
-
- // location parser
- OpcodeSet _locationParsers;
- OpcodeSet _locationZoneParsers;
- OpcodeSet _locationAnimParsers;
- OpcodeSet _commandParsers;
- Table *_commandsNames;
- Table *_locationStmt;
- Table *_locationZoneStmt;
- Table *_locationAnimStmt;
-
- struct LocationParserContext {
- bool end;
-
- const char *filename;
- Script *script;
- ZonePtr z;
- AnimationPtr a;
- int nextToken;
- CommandList *list;
- bool endcommands;
- CommandPtr cmd;
-
- // BRA specific
- int numZones;
- char *bgName;
- char *maskName;
- char *pathName;
- } _locParseCtxt;
-
- void warning_unexpected();
-
- DECLARE_UNQUALIFIED_LOCATION_PARSER(endlocation);
- DECLARE_UNQUALIFIED_LOCATION_PARSER(location);
- DECLARE_UNQUALIFIED_LOCATION_PARSER(disk);
- DECLARE_UNQUALIFIED_LOCATION_PARSER(nodes);
- DECLARE_UNQUALIFIED_LOCATION_PARSER(zone);
- DECLARE_UNQUALIFIED_LOCATION_PARSER(animation);
- DECLARE_UNQUALIFIED_LOCATION_PARSER(localflags);
- DECLARE_UNQUALIFIED_LOCATION_PARSER(commands);
- DECLARE_UNQUALIFIED_LOCATION_PARSER(acommands);
- DECLARE_UNQUALIFIED_LOCATION_PARSER(flags);
- DECLARE_UNQUALIFIED_LOCATION_PARSER(comment);
- DECLARE_UNQUALIFIED_LOCATION_PARSER(endcomment);
- DECLARE_UNQUALIFIED_LOCATION_PARSER(sound);
- DECLARE_UNQUALIFIED_LOCATION_PARSER(music);
- DECLARE_UNQUALIFIED_ZONE_PARSER(limits);
- DECLARE_UNQUALIFIED_ZONE_PARSER(moveto);
- DECLARE_UNQUALIFIED_ZONE_PARSER(type);
- DECLARE_UNQUALIFIED_ZONE_PARSER(commands);
- DECLARE_UNQUALIFIED_ZONE_PARSER(label);
- DECLARE_UNQUALIFIED_ZONE_PARSER(flags);
- DECLARE_UNQUALIFIED_ZONE_PARSER(endzone);
- DECLARE_UNQUALIFIED_ZONE_PARSER(null);
- DECLARE_UNQUALIFIED_ANIM_PARSER(script);
- DECLARE_UNQUALIFIED_ANIM_PARSER(commands);
- DECLARE_UNQUALIFIED_ANIM_PARSER(type);
- DECLARE_UNQUALIFIED_ANIM_PARSER(label);
- DECLARE_UNQUALIFIED_ANIM_PARSER(flags);
- DECLARE_UNQUALIFIED_ANIM_PARSER(file);
- DECLARE_UNQUALIFIED_ANIM_PARSER(position);
- DECLARE_UNQUALIFIED_ANIM_PARSER(moveto);
- DECLARE_UNQUALIFIED_ANIM_PARSER(endanimation);
- DECLARE_UNQUALIFIED_COMMAND_PARSER(flags);
- DECLARE_UNQUALIFIED_COMMAND_PARSER(animation);
- DECLARE_UNQUALIFIED_COMMAND_PARSER(zone);
- DECLARE_UNQUALIFIED_COMMAND_PARSER(location);
- DECLARE_UNQUALIFIED_COMMAND_PARSER(drop);
- DECLARE_UNQUALIFIED_COMMAND_PARSER(call);
- DECLARE_UNQUALIFIED_COMMAND_PARSER(simple);
- DECLARE_UNQUALIFIED_COMMAND_PARSER(move);
- DECLARE_UNQUALIFIED_COMMAND_PARSER(endcommands);
-
- virtual void parseGetData(Script &script, ZonePtr z);
- virtual void parseExamineData(Script &script, ZonePtr z);
- virtual void parseDoorData(Script &script, ZonePtr z);
- virtual void parseMergeData(Script &script, ZonePtr z);
- virtual void parseHearData(Script &script, ZonePtr z);
- virtual void parseSpeakData(Script &script, ZonePtr z);
-
void parseLocation(const char *filename);
- char *parseComment(Script &script);
- char *parseDialogueString(Script &script);
- Dialogue *parseDialogue(Script &script);
- void resolveDialogueForwards(Dialogue *dialogue, uint numQuestions, Table &forwards);
- Answer *parseAnswer(Script &script);
- Question *parseQuestion(Script &script);
-
- void parseZone(Script &script, ZoneList &list, char *name);
- void parseZoneTypeBlock(Script &script, ZonePtr z);
- void parseWalkNodes(Script& script, WalkNodeList &list);
- void parseAnimation(Script &script, AnimationList &list, char *name);
- void parseCommands(Script &script, CommandList&);
- void parseCommandFlags();
- void saveCommandForward(const char *name, CommandPtr cmd);
- void resolveCommandForwards();
- void createCommand(uint id);
- void addCommand();
- void initOpcodes();
- void initParsers();
-
- struct CommandForwardReference {
- char name[20];
- CommandPtr cmd;
- } _forwardedCommands[MAX_FORWARDS];
- uint _numForwardedCommands;
-
- // program parser
- OpcodeSet _instructionParsers;
- Table *_instructionNames;
-
- struct {
- bool end;
- AnimationPtr a;
- InstructionPtr inst;
- LocalVariable *locals;
- ProgramPtr program;
-
- // BRA specific
- InstructionPtr openIf;
- } _instParseCtxt;
-
- DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(defLocal);
- DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(animation);
- DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(loop);
- DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(x);
- DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(y);
- DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(z);
- DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(f);
- DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(inc);
- DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(set);
- DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(move);
- DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(put);
- DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(call);
- DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(sound);
- DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(null);
- DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(endscript);
-
- void parseInstruction(ProgramPtr program);
void loadProgram(AnimationPtr a, const char *filename);
- void parseLValue(ScriptVar &var, const char *str);
- virtual void parseRValue(ScriptVar &var, const char *str);
- void wrapLocalVar(LocalVariable *local);
+
+ void initOpcodes();
DECLARE_UNQUALIFIED_COMMAND_OPCODE(invalid);
DECLARE_UNQUALIFIED_COMMAND_OPCODE(set);
@@ -837,7 +633,6 @@ protected:
uint16 guiSelectGame();
int guiGetSelectedBlock(const Common::Point &p);
- void switchBackground(const char* background, const char* mask);
void showSlide(const char *name);
};
@@ -859,11 +654,11 @@ public:
public:
typedef void (Parallaction_br::*Callable)(void*);
virtual void callFunction(uint index, void* parm);
+ void changeCharacter(const char *name);
public:
Table *_countersNames;
- Table *_audioCommandsNames;
const char **_audioCommandsNamesRes;
int _part;
@@ -881,6 +676,9 @@ public:
uint32 _zoneFlags[NUM_LOCATIONS][NUM_ZONES];
private:
+ LocationParser_br *_locationParser;
+ ProgramParser_br *_programParser;
+
void initResources();
void initFonts();
void freeFonts();
@@ -891,7 +689,6 @@ private:
void setInventoryCursor(int pos);
void changeLocation(char *location);
- void changeCharacter(const char *name);
void runPendingZones();
void initPart();
@@ -925,48 +722,8 @@ private:
const Callable *_callables;
- DECLARE_UNQUALIFIED_LOCATION_PARSER(location);
- DECLARE_UNQUALIFIED_LOCATION_PARSER(zone);
- DECLARE_UNQUALIFIED_LOCATION_PARSER(animation);
- DECLARE_UNQUALIFIED_LOCATION_PARSER(localflags);
- DECLARE_UNQUALIFIED_LOCATION_PARSER(flags);
- DECLARE_UNQUALIFIED_LOCATION_PARSER(comment);
- DECLARE_UNQUALIFIED_LOCATION_PARSER(endcomment);
- DECLARE_UNQUALIFIED_LOCATION_PARSER(sound);
- DECLARE_UNQUALIFIED_LOCATION_PARSER(music);
- DECLARE_UNQUALIFIED_LOCATION_PARSER(redundant);
- DECLARE_UNQUALIFIED_LOCATION_PARSER(ifchar);
- DECLARE_UNQUALIFIED_LOCATION_PARSER(character);
- DECLARE_UNQUALIFIED_LOCATION_PARSER(mask);
- DECLARE_UNQUALIFIED_LOCATION_PARSER(path);
- DECLARE_UNQUALIFIED_LOCATION_PARSER(escape);
- DECLARE_UNQUALIFIED_LOCATION_PARSER(zeta);
- DECLARE_UNQUALIFIED_LOCATION_PARSER(null);
- DECLARE_UNQUALIFIED_COMMAND_PARSER(ifchar);
- DECLARE_UNQUALIFIED_COMMAND_PARSER(endif);
- DECLARE_UNQUALIFIED_COMMAND_PARSER(location);
- DECLARE_UNQUALIFIED_COMMAND_PARSER(toggle);
- DECLARE_UNQUALIFIED_COMMAND_PARSER(string);
- DECLARE_UNQUALIFIED_COMMAND_PARSER(math);
- DECLARE_UNQUALIFIED_COMMAND_PARSER(test);
- DECLARE_UNQUALIFIED_COMMAND_PARSER(music);
- DECLARE_UNQUALIFIED_COMMAND_PARSER(zeta);
- DECLARE_UNQUALIFIED_COMMAND_PARSER(swap);
- DECLARE_UNQUALIFIED_COMMAND_PARSER(give);
- DECLARE_UNQUALIFIED_COMMAND_PARSER(text);
- DECLARE_UNQUALIFIED_COMMAND_PARSER(unary);
-
void parseLocation(const char* name);
-
- DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(zone);
- DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(color);
- DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(mask);
- DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(print);
- DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(text);
- DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(if_op);
- DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(endif);
-
- virtual void parseRValue(ScriptVar &var, const char *str);
+ void loadProgram(AnimationPtr a, const char *filename);
DECLARE_UNQUALIFIED_COMMAND_OPCODE(location);
DECLARE_UNQUALIFIED_COMMAND_OPCODE(open);
@@ -1003,13 +760,6 @@ private:
DECLARE_UNQUALIFIED_COMMAND_OPCODE(ret);
DECLARE_UNQUALIFIED_COMMAND_OPCODE(onsave);
DECLARE_UNQUALIFIED_COMMAND_OPCODE(offsave);
- DECLARE_UNQUALIFIED_ZONE_PARSER(limits);
- DECLARE_UNQUALIFIED_ZONE_PARSER(moveto);
- DECLARE_UNQUALIFIED_ZONE_PARSER(type);
- DECLARE_UNQUALIFIED_ANIM_PARSER(file);
- DECLARE_UNQUALIFIED_ANIM_PARSER(position);
- DECLARE_UNQUALIFIED_ANIM_PARSER(moveto);
- DECLARE_UNQUALIFIED_ANIM_PARSER(endanimation);
DECLARE_UNQUALIFIED_INSTRUCTION_OPCODE(on);
DECLARE_UNQUALIFIED_INSTRUCTION_OPCODE(off);
diff --git a/engines/parallaction/parallaction_br.cpp b/engines/parallaction/parallaction_br.cpp
index 29e9fe6d70..0f5cc2a0c4 100644
--- a/engines/parallaction/parallaction_br.cpp
+++ b/engines/parallaction/parallaction_br.cpp
@@ -27,6 +27,7 @@
#include "common/util.h"
#include "parallaction/parallaction.h"
+#include "parallaction/input.h"
#include "parallaction/sound.h"
namespace Parallaction {
@@ -72,7 +73,10 @@ int Parallaction_br::init() {
initFonts();
initCursors();
initOpcodes();
- initParsers();
+ _locationParser = new LocationParser_br(this);
+ _locationParser->init();
+ _programParser = new ProgramParser_br(this);
+ _programParser->init();
_part = -1;
@@ -107,7 +111,7 @@ int Parallaction_br::go() {
// initCharacter();
- _inputMode = kInputModeGame;
+ _input->_inputMode = Input::kInputModeGame;
while ((_engineFlags & (kEngineReturn | kEngineQuit)) == 0) {
runGame();
}
@@ -198,7 +202,7 @@ void Parallaction_br::runPendingZones() {
if (_activeZone) {
z = _activeZone; // speak Zone or sound
_activeZone = nullZonePtr;
-// runZone(z); // FIXME: BRA doesn't handle sound yet
+ runZone(z); // FIXME: BRA doesn't handle sound yet
}
if (_activeZone2) {
@@ -233,8 +237,57 @@ void Parallaction_br::changeLocation(char *location) {
_engineFlags &= ~kEngineChangeLocation;
}
+
+// FIXME: Parallaction_br::parseLocation() is now a verbatim copy of the same routine from Parallaction_ns.
+void Parallaction_br::parseLocation(const char *filename) {
+ debugC(1, kDebugParser, "parseLocation('%s')", filename);
+
+ allocateLocationSlot(filename);
+ Script *script = _disk->loadLocation(filename);
+
+ _locationParser->parse(script);
+ delete script;
+
+ // this loads animation scripts
+ AnimationList::iterator it = _vm->_location._animations.begin();
+ for ( ; it != _vm->_location._animations.end(); it++) {
+ if ((*it)->_scriptName) {
+ loadProgram(*it, (*it)->_scriptName);
+ }
+ }
+
+ debugC(1, kDebugParser, "parseLocation('%s') done", filename);
+ return;
+}
+
+void Parallaction_br::loadProgram(AnimationPtr a, const char *filename) {
+ debugC(1, kDebugParser, "loadProgram(Animation: %s, script: %s)", a->_name, filename);
+
+ Script *script = _disk->loadScript(filename);
+ ProgramPtr program(new Program);
+ program->_anim = a;
+
+ _programParser->parse(script, program);
+
+ delete script;
+
+ _vm->_location._programs.push_back(program);
+
+ debugC(1, kDebugParser, "loadProgram() done");
+
+ return;
+}
+
+
+
void Parallaction_br::changeCharacter(const char *name) {
+ const char *charName = _char.getName();
+ if (!scumm_stricmp(charName, name)) {
+ return;
+ }
+ _char.setName(name);
+ _char._talk = _disk->loadTalk(name);
}
diff --git a/engines/parallaction/parallaction_ns.cpp b/engines/parallaction/parallaction_ns.cpp
index 7a476f7d24..2cca3a6a4a 100644
--- a/engines/parallaction/parallaction_ns.cpp
+++ b/engines/parallaction/parallaction_ns.cpp
@@ -28,6 +28,7 @@
#include "common/config-manager.h"
#include "parallaction/parallaction.h"
+#include "parallaction/input.h"
#include "parallaction/sound.h"
@@ -135,7 +136,10 @@ int Parallaction_ns::init() {
initFonts();
initCursors();
initOpcodes();
- initParsers();
+ _locationParser = new LocationParser_ns(this);
+ _locationParser->init();
+ _programParser = new ProgramParser_ns(this);
+ _programParser->init();
_introSarcData1 = 0;
_introSarcData2 = 1;
@@ -155,10 +159,6 @@ Parallaction_ns::~Parallaction_ns() {
delete _mouseComposedArrow;
- delete _commandsNames;
- delete _instructionNames;
- delete _locationStmt;
-
_location._animations.remove(_char._ani);
}
@@ -174,18 +174,8 @@ void Parallaction_ns::freeFonts() {
}
void Parallaction_ns::initCursors() {
-
_mouseComposedArrow = _disk->loadPointer("pointer");
-
- byte temp[MOUSEARROW_WIDTH*MOUSEARROW_HEIGHT];
- memcpy(temp, _mouseArrow, MOUSEARROW_WIDTH*MOUSEARROW_HEIGHT);
-
- uint16 k = 0;
- for (uint16 i = 0; i < 4; i++) {
- for (uint16 j = 0; j < 64; j++) _mouseArrow[k++] = temp[i + j * 4];
- }
-
- return;
+ _mouseArrow = _resMouseArrow;
}
void Parallaction_ns::setArrowCursor() {
@@ -194,7 +184,7 @@ void Parallaction_ns::setArrowCursor() {
// this stuff is needed to avoid artifacts with labels and selected items when switching cursors
_gfx->setFloatingLabel(0);
- _activeItem._id = 0;
+ _input->_activeItem._id = 0;
_system->setMouseCursor(_mouseArrow, MOUSEARROW_WIDTH, MOUSEARROW_HEIGHT, 0, 0, 0);
_system->showMouse(true);
@@ -210,7 +200,7 @@ void Parallaction_ns::setInventoryCursor(int pos) {
if (item->_index == 0)
return;
- _activeItem._id = item->_id;
+ _input->_activeItem._id = item->_id;
byte *v8 = _mouseComposedArrow->getData(0);
@@ -246,7 +236,7 @@ int Parallaction_ns::go() {
changeLocation(_location._name);
- _inputMode = kInputModeGame;
+ _input->_inputMode = Input::kInputModeGame;
while ((_engineFlags & kEngineQuit) == 0) {
runGame();
}
@@ -301,7 +291,7 @@ void Parallaction_ns::changeLocation(char *location) {
_gfx->setFloatingLabel(0);
_gfx->freeLabels();
- _hoverZone = nullZonePtr;
+ _input->stopHovering();
if (_engineFlags & kEngineBlockInput) {
setArrowCursor();
}
@@ -315,9 +305,9 @@ void Parallaction_ns::changeLocation(char *location) {
if (locname.hasSlide()) {
showSlide(locname.slide());
- uint id = _gfx->createLabel(_menuFont, _slideText[0], 1);
+ uint id = _gfx->createLabel(_menuFont, _location._slideText[0], 1);
_gfx->showLabel(id, CENTER_LABEL_HORIZONTAL, 14);
- waitUntilLeftClick();
+ _input->waitUntilLeftClick();
_gfx->freeLabels();
freeBackground();
}
@@ -367,6 +357,34 @@ void Parallaction_ns::changeLocation(char *location) {
}
+void Parallaction_ns::parseLocation(const char *filename) {
+ debugC(1, kDebugParser, "parseLocation('%s')", filename);
+
+ allocateLocationSlot(filename);
+ Script *script = _disk->loadLocation(filename);
+
+ // TODO: the following two lines are specific to Nippon Safes
+ // and should be moved into something like 'initializeParsing()'
+ _vm->_location._hasSound = false;
+
+ _locationParser->parse(script);
+
+ delete script;
+
+ // this loads animation scripts
+ AnimationList::iterator it = _vm->_location._animations.begin();
+ for ( ; it != _vm->_location._animations.end(); it++) {
+ if ((*it)->_scriptName) {
+ loadProgram(*it, (*it)->_scriptName);
+ }
+ }
+
+ debugC(1, kDebugParser, "parseLocation('%s') done", filename);
+ return;
+}
+
+
+
void Parallaction_ns::changeCharacter(const char *name) {
debugC(1, kDebugExec, "changeCharacter(%s)", name);
diff --git a/engines/parallaction/parser.cpp b/engines/parallaction/parser.cpp
index 665da16636..f9de6eb4af 100644
--- a/engines/parallaction/parser.cpp
+++ b/engines/parallaction/parser.cpp
@@ -213,7 +213,9 @@ uint16 Script::readLineToken(bool errorOnEOF) {
void Parser::reset() {
_currentOpcodes = 0;
_currentStatements = 0;
- _script = 0;
+
+ _statements.clear();
+ _opcodes.clear();
}
void Parser::pushTables(OpcodeSet *opcodes, Table *statements) {
@@ -234,7 +236,6 @@ void Parser::popTables() {
void Parser::parseStatement() {
assert(_currentOpcodes != 0);
- _script->readLineToken(true);
_lookup = _currentStatements->lookup(_tokens[0]);
debugC(9, kDebugParser, "parseStatement: %s (lookup = %i)", _tokens[0], _lookup);
@@ -242,14 +243,5 @@ void Parser::parseStatement() {
(*(*_currentOpcodes)[_lookup])();
}
-void Parser::bind(Script *script) {
- reset();
- _script = script;
-}
-
-void Parser::unbind() {
- reset();
-}
-
} // namespace Parallaction
diff --git a/engines/parallaction/parser.h b/engines/parallaction/parser.h
index d29a6c7e73..d488cf9b58 100644
--- a/engines/parallaction/parser.h
+++ b/engines/parallaction/parser.h
@@ -28,6 +28,7 @@
#include "common/stream.h"
#include "parallaction/objects.h"
+#include "parallaction/walk.h"
namespace Parallaction {
@@ -58,66 +59,347 @@ public:
};
+typedef Common::Functor0<void> Opcode;
+typedef Common::Array<const Opcode*> OpcodeSet;
+
-class Opcode {
+class Parser {
public:
- virtual void operator()() const = 0;
- virtual ~Opcode() { }
+ Parser() { reset(); }
+ ~Parser() {}
+
+ uint _lookup;
+
+ Common::Stack<OpcodeSet*> _opcodes;
+ Common::Stack<Table*> _statements;
+
+ OpcodeSet *_currentOpcodes;
+ Table *_currentStatements;
+
+ void reset();
+ void pushTables(OpcodeSet *opcodes, Table* statements);
+ void popTables();
+ void parseStatement();
+
};
-template <class T>
-class OpcodeImpl : public Opcode {
+#define DECLARE_UNQUALIFIED_ZONE_PARSER(sig) void locZoneParse_##sig()
+#define DECLARE_UNQUALIFIED_ANIM_PARSER(sig) void locAnimParse_##sig()
+#define DECLARE_UNQUALIFIED_COMMAND_PARSER(sig) void cmdParse_##sig()
+#define DECLARE_UNQUALIFIED_LOCATION_PARSER(sig) void locParse_##sig()
+#define DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(sig) void instParse_##sig()
- typedef void (T::*Fn)();
+#define MAX_FORWARDS 50
- T* _instance;
- Fn _fn;
+class Parallaction_ns;
+class Parallaction_br;
+
+class LocationParser_ns {
+
+protected:
+ Parallaction_ns* _vm;
+ Script *_script;
+ Parser *_parser;
+
+ Table *_zoneTypeNames;
+ Table *_zoneFlagNames;
+
+ // location parser
+ OpcodeSet _locationParsers;
+ OpcodeSet _locationZoneParsers;
+ OpcodeSet _locationAnimParsers;
+ OpcodeSet _commandParsers;
+ Table *_commandsNames;
+ Table *_locationStmt;
+ Table *_locationZoneStmt;
+ Table *_locationAnimStmt;
+
+ struct ParserContext {
+ bool end;
+
+ const char *filename;
+ ZonePtr z;
+ AnimationPtr a;
+ int nextToken;
+ CommandList *list;
+ bool endcommands;
+ CommandPtr cmd;
+
+ // BRA specific
+ int numZones;
+ char *bgName;
+ char *maskName;
+ char *pathName;
+ char *characterName;
+ } ctxt;
+
+ void warning_unexpected();
+
+ DECLARE_UNQUALIFIED_LOCATION_PARSER(endlocation);
+ DECLARE_UNQUALIFIED_LOCATION_PARSER(location);
+ DECLARE_UNQUALIFIED_LOCATION_PARSER(disk);
+ DECLARE_UNQUALIFIED_LOCATION_PARSER(nodes);
+ DECLARE_UNQUALIFIED_LOCATION_PARSER(zone);
+ DECLARE_UNQUALIFIED_LOCATION_PARSER(animation);
+ DECLARE_UNQUALIFIED_LOCATION_PARSER(localflags);
+ DECLARE_UNQUALIFIED_LOCATION_PARSER(commands);
+ DECLARE_UNQUALIFIED_LOCATION_PARSER(acommands);
+ DECLARE_UNQUALIFIED_LOCATION_PARSER(flags);
+ DECLARE_UNQUALIFIED_LOCATION_PARSER(comment);
+ DECLARE_UNQUALIFIED_LOCATION_PARSER(endcomment);
+ DECLARE_UNQUALIFIED_LOCATION_PARSER(sound);
+ DECLARE_UNQUALIFIED_LOCATION_PARSER(music);
+ DECLARE_UNQUALIFIED_ZONE_PARSER(limits);
+ DECLARE_UNQUALIFIED_ZONE_PARSER(moveto);
+ DECLARE_UNQUALIFIED_ZONE_PARSER(type);
+ DECLARE_UNQUALIFIED_ZONE_PARSER(commands);
+ DECLARE_UNQUALIFIED_ZONE_PARSER(label);
+ DECLARE_UNQUALIFIED_ZONE_PARSER(flags);
+ DECLARE_UNQUALIFIED_ZONE_PARSER(endzone);
+ DECLARE_UNQUALIFIED_ZONE_PARSER(null);
+ DECLARE_UNQUALIFIED_ANIM_PARSER(script);
+ DECLARE_UNQUALIFIED_ANIM_PARSER(commands);
+ DECLARE_UNQUALIFIED_ANIM_PARSER(type);
+ DECLARE_UNQUALIFIED_ANIM_PARSER(label);
+ DECLARE_UNQUALIFIED_ANIM_PARSER(flags);
+ DECLARE_UNQUALIFIED_ANIM_PARSER(file);
+ DECLARE_UNQUALIFIED_ANIM_PARSER(position);
+ DECLARE_UNQUALIFIED_ANIM_PARSER(moveto);
+ DECLARE_UNQUALIFIED_ANIM_PARSER(endanimation);
+ DECLARE_UNQUALIFIED_COMMAND_PARSER(flags);
+ DECLARE_UNQUALIFIED_COMMAND_PARSER(animation);
+ DECLARE_UNQUALIFIED_COMMAND_PARSER(zone);
+ DECLARE_UNQUALIFIED_COMMAND_PARSER(location);
+ DECLARE_UNQUALIFIED_COMMAND_PARSER(drop);
+ DECLARE_UNQUALIFIED_COMMAND_PARSER(call);
+ DECLARE_UNQUALIFIED_COMMAND_PARSER(simple);
+ DECLARE_UNQUALIFIED_COMMAND_PARSER(move);
+ DECLARE_UNQUALIFIED_COMMAND_PARSER(endcommands);
+
+ virtual void parseGetData(ZonePtr z);
+ virtual void parseExamineData(ZonePtr z);
+ virtual void parseDoorData(ZonePtr z);
+ virtual void parseMergeData(ZonePtr z);
+ virtual void parseHearData(ZonePtr z);
+ virtual void parseSpeakData(ZonePtr z);
+
+ char *parseComment();
+ char *parseDialogueString();
+ Dialogue *parseDialogue();
+ void resolveDialogueForwards(Dialogue *dialogue, uint numQuestions, Table &forwards);
+ Answer *parseAnswer();
+ Question *parseQuestion();
+
+ void parseZone(ZoneList &list, char *name);
+ void parseZoneTypeBlock(ZonePtr z);
+ void parseWalkNodes(WalkNodeList &list);
+ void parseAnimation(AnimationList &list, char *name);
+ void parseCommands(CommandList&);
+ void parseCommandFlags();
+ void saveCommandForward(const char *name, CommandPtr cmd);
+ void resolveCommandForwards();
+ void createCommand(uint id);
+ void addCommand();
+
+ struct CommandForwardReference {
+ char name[20];
+ CommandPtr cmd;
+ } _forwardedCommands[MAX_FORWARDS];
+ uint _numForwardedCommands;
+
+ void clearSet(OpcodeSet &opcodes) {
+ for (Common::Array<const Opcode*>::iterator i = opcodes.begin(); i != opcodes.end(); ++i)
+ delete *i;
+ opcodes.clear();
+ }
public:
- OpcodeImpl(T* instance, const Fn &fn) : _instance(instance), _fn(fn) { }
+ LocationParser_ns(Parallaction_ns *vm) : _vm(vm) {
+ }
+
+ virtual void init();
+
+ virtual ~LocationParser_ns() {
+ delete _commandsNames;
+ delete _locationStmt;
+ delete _zoneTypeNames;
+ delete _zoneFlagNames;
+
+ delete _parser;
- void operator()() const {
- (_instance->*_fn)();
+ clearSet(_commandParsers);
+ clearSet(_locationAnimParsers);
+ clearSet(_locationZoneParsers);
+ clearSet(_locationParsers);
}
-};
+ void parse(Script *script);
-typedef Common::Array<const Opcode*> OpcodeSet;
+};
+class LocationParser_br : public LocationParser_ns {
-class Parser {
+protected:
+ Table *_audioCommandsNames;
+
+ Parallaction_br* _vm;
+
+ DECLARE_UNQUALIFIED_LOCATION_PARSER(location);
+ DECLARE_UNQUALIFIED_LOCATION_PARSER(zone);
+ DECLARE_UNQUALIFIED_LOCATION_PARSER(animation);
+ DECLARE_UNQUALIFIED_LOCATION_PARSER(localflags);
+ DECLARE_UNQUALIFIED_LOCATION_PARSER(flags);
+ DECLARE_UNQUALIFIED_LOCATION_PARSER(comment);
+ DECLARE_UNQUALIFIED_LOCATION_PARSER(endcomment);
+ DECLARE_UNQUALIFIED_LOCATION_PARSER(sound);
+ DECLARE_UNQUALIFIED_LOCATION_PARSER(music);
+ DECLARE_UNQUALIFIED_LOCATION_PARSER(redundant);
+ DECLARE_UNQUALIFIED_LOCATION_PARSER(ifchar);
+ DECLARE_UNQUALIFIED_LOCATION_PARSER(character);
+ DECLARE_UNQUALIFIED_LOCATION_PARSER(mask);
+ DECLARE_UNQUALIFIED_LOCATION_PARSER(path);
+ DECLARE_UNQUALIFIED_LOCATION_PARSER(escape);
+ DECLARE_UNQUALIFIED_LOCATION_PARSER(zeta);
+ DECLARE_UNQUALIFIED_LOCATION_PARSER(null);
+ DECLARE_UNQUALIFIED_COMMAND_PARSER(ifchar);
+ DECLARE_UNQUALIFIED_COMMAND_PARSER(endif);
+ DECLARE_UNQUALIFIED_COMMAND_PARSER(location);
+ DECLARE_UNQUALIFIED_COMMAND_PARSER(toggle);
+ DECLARE_UNQUALIFIED_COMMAND_PARSER(string);
+ DECLARE_UNQUALIFIED_COMMAND_PARSER(math);
+ DECLARE_UNQUALIFIED_COMMAND_PARSER(test);
+ DECLARE_UNQUALIFIED_COMMAND_PARSER(music);
+ DECLARE_UNQUALIFIED_COMMAND_PARSER(zeta);
+ DECLARE_UNQUALIFIED_COMMAND_PARSER(swap);
+ DECLARE_UNQUALIFIED_COMMAND_PARSER(give);
+ DECLARE_UNQUALIFIED_COMMAND_PARSER(text);
+ DECLARE_UNQUALIFIED_COMMAND_PARSER(unary);
+ DECLARE_UNQUALIFIED_ZONE_PARSER(limits);
+ DECLARE_UNQUALIFIED_ZONE_PARSER(moveto);
+ DECLARE_UNQUALIFIED_ZONE_PARSER(type);
+ DECLARE_UNQUALIFIED_ANIM_PARSER(file);
+ DECLARE_UNQUALIFIED_ANIM_PARSER(position);
+ DECLARE_UNQUALIFIED_ANIM_PARSER(moveto);
+ DECLARE_UNQUALIFIED_ANIM_PARSER(endanimation);
public:
- Parser() { reset(); }
- ~Parser() {}
+ LocationParser_br(Parallaction_br *vm) : LocationParser_ns((Parallaction_ns*)vm), _vm(vm) {
+ }
- uint _lookup;
+ virtual void init();
- Common::Stack<OpcodeSet*> _opcodes;
- Common::Stack<Table*> _statements;
+ virtual ~LocationParser_br() {
+ delete _commandsNames;
+ delete _locationStmt;
+ }
- OpcodeSet *_currentOpcodes;
- Table *_currentStatements;
+ void parse(Script *script);
+
+};
- void bind(Script *script);
- void unbind();
- void pushTables(OpcodeSet *opcodes, Table* statements);
- void popTables();
- void parseStatement();
+
+
+class ProgramParser_ns {
protected:
- void reset();
+ Parser *_parser;
+ Parallaction_ns *_vm;
Script *_script;
+ ProgramPtr _program;
+
+ // program parser
+ OpcodeSet _instructionParsers;
+ Table *_instructionNames;
+
+ struct ParserContext {
+ bool end;
+ AnimationPtr a;
+ InstructionPtr inst;
+ LocalVariable *locals;
+
+ // BRA specific
+ InstructionPtr openIf;
+ } ctxt;
+
+ DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(defLocal);
+ DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(animation);
+ DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(loop);
+ DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(x);
+ DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(y);
+ DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(z);
+ DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(f);
+ DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(inc);
+ DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(set);
+ DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(move);
+ DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(put);
+ DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(call);
+ DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(sound);
+ DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(null);
+ DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(endscript);
+
+ void parseInstruction();
+ void parseLValue(ScriptVar &var, const char *str);
+ virtual void parseRValue(ScriptVar &var, const char *str);
+
+ void clearSet(OpcodeSet &opcodes) {
+ for (Common::Array<const Opcode*>::iterator i = opcodes.begin(); i != opcodes.end(); ++i)
+ delete *i;
+ opcodes.clear();
+ }
+
+public:
+ ProgramParser_ns(Parallaction_ns *vm) : _vm(vm) {
+ }
+
+ virtual void init();
+
+ virtual ~ProgramParser_ns() {
+ delete _instructionNames;
+ clearSet(_instructionParsers);
+ }
+
+ void parse(Script *script, ProgramPtr program);
+
};
+class ProgramParser_br : public ProgramParser_ns {
+
+protected:
+ Parallaction_br *_vm;
+
+ DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(zone);
+ DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(color);
+ DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(mask);
+ DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(print);
+ DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(text);
+ DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(if_op);
+ DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(endif);
+
+ virtual void parseRValue(ScriptVar &var, const char *str);
+
+public:
+ ProgramParser_br(Parallaction_br *vm) : ProgramParser_ns((Parallaction_ns*)vm), _vm(vm) {
+ }
+
+ virtual void init();
+ virtual ~ProgramParser_br() {
+ delete _instructionNames;
+ delete _parser;
+ }
+
+};
} // namespace Parallaction
#endif
+
+
+
+
diff --git a/engines/parallaction/parser_br.cpp b/engines/parallaction/parser_br.cpp
index 2544267382..51da7eb396 100644
--- a/engines/parallaction/parser_br.cpp
+++ b/engines/parallaction/parser_br.cpp
@@ -104,18 +104,217 @@ namespace Parallaction {
#define INST_ENDIF 30
#define INST_STOP 31
-#define DECLARE_ZONE_PARSER(sig) void Parallaction_br::locZoneParse_##sig()
-#define DECLARE_ANIM_PARSER(sig) void Parallaction_br::locAnimParse_##sig()
-#define DECLARE_COMMAND_PARSER(sig) void Parallaction_br::cmdParse_##sig()
-#define DECLARE_INSTRUCTION_PARSER(sig) void Parallaction_br::instParse_##sig()
-#define DECLARE_LOCATION_PARSER(sig) void Parallaction_br::locParse_##sig()
+const char *_zoneTypeNamesRes_br[] = {
+ "examine",
+ "door",
+ "get",
+ "merge",
+ "taste",
+ "hear",
+ "feel",
+ "speak",
+ "none",
+ "trap",
+ "you",
+ "command",
+ "path",
+ "box"
+};
+
+const char *_zoneFlagNamesRes_br[] = {
+ "closed",
+ "active",
+ "remove",
+ "acting",
+ "locked",
+ "fixed",
+ "noname",
+ "nomasked",
+ "looping",
+ "added",
+ "character",
+ "nowalk",
+ "yourself",
+ "scaled",
+ "selfuse"
+};
+
+const char *_commandsNamesRes_br[] = {
+ "set",
+ "clear",
+ "start",
+ "speak",
+ "get",
+ "location",
+ "open",
+ "close",
+ "on",
+ "off",
+ "call",
+ "toggle",
+ "drop",
+ "quit",
+ "move",
+ "stop",
+ "character",
+ "followme",
+ "onmouse",
+ "offmouse",
+ "add",
+ "leave",
+ "inc",
+ "dec",
+ "test",
+ "dummy",
+ "dummy",
+ "let",
+ "music",
+ "fix",
+ "unfix",
+ "zeta",
+ "scroll",
+ "swap",
+ "give",
+ "text",
+ "part",
+ "dummy",
+ "return",
+ "onsave",
+ "offsave",
+ "endcommands",
+ "ifchar",
+ "endif"
+};
+
+
+const char *_audioCommandsNamesRes_br[] = {
+ "play",
+ "stop",
+ "pause",
+ "channel_level",
+ "fadein",
+ "fadeout",
+ "volume",
+ " ",
+ "faderate",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ "loop"
+};
+
+const char *_locationStmtRes_br[] = {
+ "character",
+ "endlocation",
+ "ifchar",
+ "endif",
+ "location",
+ "mask",
+ "path",
+ "disk",
+ "localflags",
+ "commands",
+ "escape",
+ "acommands",
+ "flags",
+ "comment",
+ "endcomment",
+ "zone",
+ "animation",
+ "zeta",
+ "music",
+ "sound"
+};
+
+const char *_locationZoneStmtRes_br[] = {
+ "endzone",
+ "limits",
+ "moveto",
+ "type",
+ "commands",
+ "label",
+ "flags"
+};
+
+const char *_locationAnimStmtRes_br[] = {
+ "endanimation",
+ "endzone",
+ "script",
+ "commands",
+ "type",
+ "label",
+ "flags",
+ "file",
+ "position",
+ "moveto"
+};
+
+const char *_instructionNamesRes_br[] = {
+ "on",
+ "off",
+ "x",
+ "y",
+ "z",
+ "f",
+ "loop",
+ "endloop",
+ "show",
+ "inc",
+ "dec",
+ "set",
+ "put",
+ "call",
+ "wait",
+ "start",
+ "process",
+ "move",
+ "color",
+ "sound",
+ "mask",
+ "print",
+ "text",
+ "mul",
+ "div",
+ "if",
+ "dummy",
+ "dummy",
+ "endif",
+ "stop",
+ "endscript"
+};
+
+
+#define SetOpcodeTable(x) table = &x;
+
+typedef Common::Functor0Mem<void, ProgramParser_br> OpcodeV1;
+#define INSTRUCTION_PARSER(sig) table->push_back(new OpcodeV1(this, &ProgramParser_br::instParse_##sig))
+
+typedef Common::Functor0Mem<void, LocationParser_br> OpcodeV2;
+#define ZONE_PARSER(sig) table->push_back(new OpcodeV2(this, &LocationParser_br::locZoneParse_##sig))
+#define ANIM_PARSER(sig) table->push_back(new OpcodeV2(this, &LocationParser_br::locAnimParse_##sig))
+#define LOCATION_PARSER(sig) table->push_back(new OpcodeV2(this, &LocationParser_br::locParse_##sig))
+#define COMMAND_PARSER(sig) table->push_back(new OpcodeV2(this, &LocationParser_br::cmdParse_##sig))
+
+#define WARNING_PARSER(sig) table->push_back(new OpcodeV2(this, &LocationParser_br::warning_##sig))
+
+
+#define DECLARE_ZONE_PARSER(sig) void LocationParser_br::locZoneParse_##sig()
+#define DECLARE_ANIM_PARSER(sig) void LocationParser_br::locAnimParse_##sig()
+#define DECLARE_COMMAND_PARSER(sig) void LocationParser_br::cmdParse_##sig()
+#define DECLARE_LOCATION_PARSER(sig) void LocationParser_br::locParse_##sig()
+
+#define DECLARE_INSTRUCTION_PARSER(sig) void ProgramParser_br::instParse_##sig()
DECLARE_LOCATION_PARSER(location) {
debugC(7, kDebugParser, "LOCATION_PARSER(location) ");
- strcpy(_location._name, _tokens[1]);
- _locParseCtxt.bgName = strdup(_tokens[1]);
+ strcpy(_vm->_location._name, _tokens[1]);
+ ctxt.bgName = strdup(_tokens[1]);
bool flip = false;
int nextToken;
@@ -130,14 +329,14 @@ DECLARE_LOCATION_PARSER(location) {
// TODO: handle background horizontal flip (via a context parameter)
if (_tokens[nextToken][0] != '\0') {
- _char._ani->_left = atoi(_tokens[nextToken]);
+ _vm->_char._ani->_left = atoi(_tokens[nextToken]);
nextToken++;
- _char._ani->_top = atoi(_tokens[nextToken]);
+ _vm->_char._ani->_top = atoi(_tokens[nextToken]);
nextToken++;
}
if (_tokens[nextToken][0] != '\0') {
- _char._ani->_frame = atoi(_tokens[nextToken]);
+ _vm->_char._ani->_frame = atoi(_tokens[nextToken]);
}
}
@@ -146,14 +345,14 @@ DECLARE_LOCATION_PARSER(location) {
DECLARE_LOCATION_PARSER(zone) {
debugC(7, kDebugParser, "LOCATION_PARSER(zone) ");
- parseZone(*_locParseCtxt.script, _location._zones, _tokens[1]);
+ parseZone(_vm->_location._zones, _tokens[1]);
- _locParseCtxt.z->_index = _locParseCtxt.numZones++;
+ ctxt.z->_index = ctxt.numZones++;
- if (getLocationFlags() & kFlagsVisited) {
- _locParseCtxt.z->_flags = _zoneFlags[_currentLocationIndex][_locParseCtxt.z->_index];
+ if (_vm->getLocationFlags() & kFlagsVisited) {
+ ctxt.z->_flags = _vm->_zoneFlags[_vm->_currentLocationIndex][ctxt.z->_index];
} else {
- _zoneFlags[_currentLocationIndex][_locParseCtxt.z->_index] = _locParseCtxt.z->_flags;
+ _vm->_zoneFlags[_vm->_currentLocationIndex][ctxt.z->_index] = ctxt.z->_flags;
}
}
@@ -162,14 +361,14 @@ DECLARE_LOCATION_PARSER(zone) {
DECLARE_LOCATION_PARSER(animation) {
debugC(7, kDebugParser, "LOCATION_PARSER(animation) ");
- parseAnimation(*_locParseCtxt.script, _location._animations, _tokens[1]);
+ parseAnimation(_vm->_location._animations, _tokens[1]);
- _locParseCtxt.a->_index = _locParseCtxt.numZones++;
+ ctxt.a->_index = ctxt.numZones++;
- if (getLocationFlags() & kFlagsVisited) {
- _locParseCtxt.a->_flags = _zoneFlags[_currentLocationIndex][_locParseCtxt.a->_index];
+ if (_vm->getLocationFlags() & kFlagsVisited) {
+ ctxt.a->_flags = _vm->_zoneFlags[_vm->_currentLocationIndex][ctxt.a->_index];
} else {
- _zoneFlags[_currentLocationIndex][_locParseCtxt.a->_index] = _locParseCtxt.a->_flags;
+ _vm->_zoneFlags[_vm->_currentLocationIndex][ctxt.a->_index] = ctxt.a->_flags;
}
}
@@ -180,7 +379,7 @@ DECLARE_LOCATION_PARSER(localflags) {
int _si = 1;
while (_tokens[_si][0] != '\0') {
- _localFlagNames->addData(_tokens[_si]);
+ _vm->_localFlagNames->addData(_tokens[_si]);
_si++;
}
}
@@ -189,14 +388,14 @@ DECLARE_LOCATION_PARSER(localflags) {
DECLARE_LOCATION_PARSER(flags) {
debugC(7, kDebugParser, "LOCATION_PARSER(flags) ");
- if ((getLocationFlags() & kFlagsVisited) == 0) {
+ if ((_vm->getLocationFlags() & kFlagsVisited) == 0) {
// only for 1st visit
- clearLocationFlags(kFlagsAll);
+ _vm->clearLocationFlags(kFlagsAll);
int _si = 1;
do {
- byte _al = _localFlagNames->lookup(_tokens[_si]);
- setLocationFlags(1 << (_al - 1));
+ byte _al = _vm->_localFlagNames->lookup(_tokens[_si]);
+ _vm->setLocationFlags(1 << (_al - 1));
_si++;
if (scumm_stricmp(_tokens[_si], "|")) break;
@@ -209,14 +408,14 @@ DECLARE_LOCATION_PARSER(flags) {
DECLARE_LOCATION_PARSER(comment) {
debugC(7, kDebugParser, "LOCATION_PARSER(comment) ");
- _location._comment = parseComment(*_locParseCtxt.script);
+ _vm->_location._comment = parseComment();
}
DECLARE_LOCATION_PARSER(endcomment) {
debugC(7, kDebugParser, "LOCATION_PARSER(endcomment) ");
- _location._endComment = parseComment(*_locParseCtxt.script);
+ _vm->_location._endComment = parseComment();
}
@@ -236,21 +435,21 @@ DECLARE_LOCATION_PARSER(music) {
DECLARE_LOCATION_PARSER(redundant) {
debugC(7, kDebugParser, "LOCATION_PARSER(redundant) ");
- warning("redundant '%s' line found in script '%s'", _tokens[0], _locParseCtxt.filename);
+ warning("redundant '%s' line found in script '%s'", _tokens[0], ctxt.filename);
}
DECLARE_LOCATION_PARSER(character) {
debugC(7, kDebugParser, "LOCATION_PARSER(character) ");
-// changeCharacter(character);
+ ctxt.characterName = strdup(_tokens[0]);
}
DECLARE_LOCATION_PARSER(ifchar) {
debugC(7, kDebugParser, "LOCATION_PARSER(ifchar) ");
- _locParseCtxt.script->skip("ENDIF");
+ _script->skip("ENDIF");
}
@@ -264,45 +463,45 @@ DECLARE_LOCATION_PARSER(null) {
DECLARE_LOCATION_PARSER(mask) {
debugC(7, kDebugParser, "LOCATION_PARSER(mask) ");
- _locParseCtxt.maskName = strdup(_tokens[1]);
- _gfx->_backgroundInfo.layers[0] = atoi(_tokens[2]);
- _gfx->_backgroundInfo.layers[1] = atoi(_tokens[3]);
- _gfx->_backgroundInfo.layers[2] = atoi(_tokens[4]);
+ ctxt.maskName = strdup(_tokens[1]);
+ _vm->_gfx->_backgroundInfo.layers[0] = atoi(_tokens[2]);
+ _vm->_gfx->_backgroundInfo.layers[1] = atoi(_tokens[3]);
+ _vm->_gfx->_backgroundInfo.layers[2] = atoi(_tokens[4]);
}
DECLARE_LOCATION_PARSER(path) {
debugC(7, kDebugParser, "LOCATION_PARSER(path) ");
- _locParseCtxt.pathName = strdup(_tokens[1]);
+ ctxt.pathName = strdup(_tokens[1]);
}
DECLARE_LOCATION_PARSER(escape) {
debugC(7, kDebugParser, "LOCATION_PARSER(escape) ");
- parseCommands(*_locParseCtxt.script, _location._escapeCommands);
+ parseCommands(_vm->_location._escapeCommands);
}
DECLARE_LOCATION_PARSER(zeta) {
debugC(7, kDebugParser, "LOCATION_PARSER(zeta) ");
- _location._zeta0 = atoi(_tokens[1]);
- _location._zeta1 = atoi(_tokens[2]);
+ _vm->_location._zeta0 = atoi(_tokens[1]);
+ _vm->_location._zeta1 = atoi(_tokens[2]);
if (_tokens[3][0] != '\0') {
- _location._zeta2 = atoi(_tokens[1]);
+ _vm->_location._zeta2 = atoi(_tokens[1]);
} else {
- _location._zeta2 = 50;
+ _vm->_location._zeta2 = 50;
}
}
DECLARE_COMMAND_PARSER(ifchar) {
debugC(7, kDebugParser, "COMMAND_PARSER(ifchar) ");
- if (!scumm_stricmp(_char.getName(), _tokens[1]))
- _locParseCtxt.script->skip("endif");
+ if (!scumm_stricmp(_vm->_char.getName(), _tokens[1]))
+ _script->skip("endif");
}
@@ -316,24 +515,24 @@ DECLARE_COMMAND_PARSER(endif) {
DECLARE_COMMAND_PARSER(location) {
debugC(7, kDebugParser, "COMMAND_PARSER(location) ");
- createCommand(_locationParser->_lookup);
+ createCommand(_parser->_lookup);
- _locParseCtxt.cmd->u._string = strdup(_tokens[1]);
- _locParseCtxt.nextToken++;
+ ctxt.cmd->u._string = strdup(_tokens[1]);
+ ctxt.nextToken++;
- if (_tokens[_locParseCtxt.nextToken][0] != '\0') {
- if (isdigit(_tokens[_locParseCtxt.nextToken][0]) || _tokens[_locParseCtxt.nextToken][0] == '-') {
- _locParseCtxt.cmd->u._startPos.x = atoi(_tokens[_locParseCtxt.nextToken]);
- _locParseCtxt.nextToken++;
- _locParseCtxt.cmd->u._startPos.y = atoi(_tokens[_locParseCtxt.nextToken]);
- _locParseCtxt.nextToken++;
+ if (_tokens[ctxt.nextToken][0] != '\0') {
+ if (isdigit(_tokens[ctxt.nextToken][0]) || _tokens[ctxt.nextToken][0] == '-') {
+ ctxt.cmd->u._startPos.x = atoi(_tokens[ctxt.nextToken]);
+ ctxt.nextToken++;
+ ctxt.cmd->u._startPos.y = atoi(_tokens[ctxt.nextToken]);
+ ctxt.nextToken++;
}
- if (isdigit(_tokens[_locParseCtxt.nextToken][0]) || _tokens[_locParseCtxt.nextToken][0] == '-') {
- _locParseCtxt.cmd->u._startPos2.x = atoi(_tokens[_locParseCtxt.nextToken]);
- _locParseCtxt.nextToken++;
- _locParseCtxt.cmd->u._startPos2.y = atoi(_tokens[_locParseCtxt.nextToken]);
- _locParseCtxt.nextToken++;
+ if (isdigit(_tokens[ctxt.nextToken][0]) || _tokens[ctxt.nextToken][0] == '-') {
+ ctxt.cmd->u._startPos2.x = atoi(_tokens[ctxt.nextToken]);
+ ctxt.nextToken++;
+ ctxt.cmd->u._startPos2.y = atoi(_tokens[ctxt.nextToken]);
+ ctxt.nextToken++;
}
}
@@ -345,10 +544,10 @@ DECLARE_COMMAND_PARSER(location) {
DECLARE_COMMAND_PARSER(string) {
debugC(7, kDebugParser, "COMMAND_PARSER(string) ");
- createCommand(_locationParser->_lookup);
+ createCommand(_parser->_lookup);
- _locParseCtxt.cmd->u._string = strdup(_tokens[1]);
- _locParseCtxt.nextToken++;
+ ctxt.cmd->u._string = strdup(_tokens[1]);
+ ctxt.nextToken++;
parseCommandFlags();
addCommand();
@@ -357,12 +556,12 @@ DECLARE_COMMAND_PARSER(string) {
DECLARE_COMMAND_PARSER(math) {
debugC(7, kDebugParser, "COMMAND_PARSER(math) ");
- createCommand(_locationParser->_lookup);
+ createCommand(_parser->_lookup);
- _locParseCtxt.cmd->u._lvalue = _countersNames->lookup(_tokens[1]);
- _locParseCtxt.nextToken++;
- _locParseCtxt.cmd->u._rvalue = atoi(_tokens[2]);
- _locParseCtxt.nextToken++;
+ ctxt.cmd->u._lvalue = _vm->_countersNames->lookup(_tokens[1]);
+ ctxt.nextToken++;
+ ctxt.cmd->u._rvalue = atoi(_tokens[2]);
+ ctxt.nextToken++;
parseCommandFlags();
addCommand();
@@ -372,29 +571,29 @@ DECLARE_COMMAND_PARSER(math) {
DECLARE_COMMAND_PARSER(test) {
debugC(7, kDebugParser, "COMMAND_PARSER(test) ");
- createCommand(_locationParser->_lookup);
+ createCommand(_parser->_lookup);
- uint counter = _countersNames->lookup(_tokens[1]);
- _locParseCtxt.nextToken++;
+ uint counter = _vm->_countersNames->lookup(_tokens[1]);
+ ctxt.nextToken++;
if (counter == Table::notFound) {
if (!scumm_stricmp("SFX", _tokens[1])) {
- _locParseCtxt.cmd->_id = CMD_TEST_SFX;
+ ctxt.cmd->_id = CMD_TEST_SFX;
} else {
error("unknown counter '%s' in test opcode", _tokens[1]);
}
} else {
- _locParseCtxt.cmd->u._lvalue = counter;
- _locParseCtxt.cmd->u._rvalue = atoi(_tokens[3]);
- _locParseCtxt.nextToken++;
+ ctxt.cmd->u._lvalue = counter;
+ ctxt.cmd->u._rvalue = atoi(_tokens[3]);
+ ctxt.nextToken++;
if (_tokens[2][0] == '>') {
- _locParseCtxt.cmd->_id = CMD_TEST_GT;
+ ctxt.cmd->_id = CMD_TEST_GT;
} else
if (_tokens[2][0] == '<') {
- _locParseCtxt.cmd->_id = CMD_TEST_LT;
+ ctxt.cmd->_id = CMD_TEST_LT;
}
- _locParseCtxt.nextToken++;
+ ctxt.nextToken++;
}
parseCommandFlags();
@@ -405,14 +604,14 @@ DECLARE_COMMAND_PARSER(test) {
DECLARE_COMMAND_PARSER(music) {
debugC(7, kDebugParser, "COMMAND_PARSER(music) ");
- createCommand(_locationParser->_lookup);
+ createCommand(_parser->_lookup);
- _locParseCtxt.cmd->u._musicCommand = _audioCommandsNames->lookup(_tokens[1]);
- _locParseCtxt.nextToken++;
+ ctxt.cmd->u._musicCommand = _audioCommandsNames->lookup(_tokens[1]);
+ ctxt.nextToken++;
if (_tokens[2][0] != '\0' && scumm_stricmp("flags", _tokens[2]) && scumm_stricmp("gflags", _tokens[2])) {
- _locParseCtxt.cmd->u._musicParm = atoi(_tokens[2]);
- _locParseCtxt.nextToken++;
+ ctxt.cmd->u._musicParm = atoi(_tokens[2]);
+ ctxt.nextToken++;
}
parseCommandFlags();
@@ -423,18 +622,18 @@ DECLARE_COMMAND_PARSER(music) {
DECLARE_COMMAND_PARSER(zeta) {
debugC(7, kDebugParser, "COMMAND_PARSER(zeta) ");
- createCommand(_locationParser->_lookup);
+ createCommand(_parser->_lookup);
- _locParseCtxt.cmd->u._zeta0 = atoi(_tokens[1]);
- _locParseCtxt.nextToken++;
- _locParseCtxt.cmd->u._zeta1 = atoi(_tokens[2]);
- _locParseCtxt.nextToken++;
+ ctxt.cmd->u._zeta0 = atoi(_tokens[1]);
+ ctxt.nextToken++;
+ ctxt.cmd->u._zeta1 = atoi(_tokens[2]);
+ ctxt.nextToken++;
if (_tokens[3][0] != '\0') {
- _locParseCtxt.cmd->u._zeta2 = atoi(_tokens[3]);
- _locParseCtxt.nextToken++;
+ ctxt.cmd->u._zeta2 = atoi(_tokens[3]);
+ ctxt.nextToken++;
} else {
- _locParseCtxt.cmd->u._zeta2 = 50;
+ ctxt.cmd->u._zeta2 = 50;
}
parseCommandFlags();
@@ -445,23 +644,23 @@ DECLARE_COMMAND_PARSER(zeta) {
DECLARE_COMMAND_PARSER(give) {
debugC(7, kDebugParser, "COMMAND_PARSER(give) ");
- createCommand(_locationParser->_lookup);
+ createCommand(_parser->_lookup);
- _locParseCtxt.cmd->u._object = 4 + atoi(_tokens[1]);
- _locParseCtxt.nextToken++;
+ ctxt.cmd->u._object = 4 + atoi(_tokens[1]);
+ ctxt.nextToken++;
if (!scumm_stricmp("dino", _tokens[2])) {
- _locParseCtxt.cmd->u._characterId = 1;
+ ctxt.cmd->u._characterId = 1;
} else
if (!scumm_stricmp("doug", _tokens[2])) {
- _locParseCtxt.cmd->u._characterId = 2;
+ ctxt.cmd->u._characterId = 2;
} else
if (!scumm_stricmp("donna", _tokens[2])) {
- _locParseCtxt.cmd->u._characterId = 3;
+ ctxt.cmd->u._characterId = 3;
} else
error("unknown recipient '%s' in give command", _tokens[2]);
- _locParseCtxt.nextToken++;
+ ctxt.nextToken++;
parseCommandFlags();
addCommand();
@@ -471,21 +670,21 @@ DECLARE_COMMAND_PARSER(give) {
DECLARE_COMMAND_PARSER(text) {
debugC(7, kDebugParser, "COMMAND_PARSER(text) ");
- createCommand(_locationParser->_lookup);
+ createCommand(_parser->_lookup);
if (isdigit(_tokens[1][1])) {
- _locParseCtxt.cmd->u._zeta0 = atoi(_tokens[1]);
- _locParseCtxt.nextToken++;
+ ctxt.cmd->u._zeta0 = atoi(_tokens[1]);
+ ctxt.nextToken++;
} else {
- _locParseCtxt.cmd->u._zeta0 = -1;
+ ctxt.cmd->u._zeta0 = -1;
}
- _locParseCtxt.cmd->u._string = strdup(_tokens[_locParseCtxt.nextToken]);
- _locParseCtxt.nextToken++;
+ ctxt.cmd->u._string = strdup(_tokens[ctxt.nextToken]);
+ ctxt.nextToken++;
- if (_tokens[_locParseCtxt.nextToken][0] != '\0' && scumm_stricmp("flags", _tokens[_locParseCtxt.nextToken])) {
- _locParseCtxt.cmd->u._string2 = strdup(_tokens[_locParseCtxt.nextToken]);
- _locParseCtxt.nextToken++;
+ if (_tokens[ctxt.nextToken][0] != '\0' && scumm_stricmp("flags", _tokens[ctxt.nextToken])) {
+ ctxt.cmd->u._string2 = strdup(_tokens[ctxt.nextToken]);
+ ctxt.nextToken++;
}
@@ -497,10 +696,10 @@ DECLARE_COMMAND_PARSER(text) {
DECLARE_COMMAND_PARSER(unary) {
debugC(7, kDebugParser, "COMMAND_PARSER(unary) ");
- createCommand(_locationParser->_lookup);
+ createCommand(_parser->_lookup);
- _locParseCtxt.cmd->u._rvalue = atoi(_tokens[1]);
- _locParseCtxt.nextToken++;
+ ctxt.cmd->u._rvalue = atoi(_tokens[1]);
+ ctxt.nextToken++;
parseCommandFlags();
addCommand();
@@ -511,14 +710,14 @@ DECLARE_ZONE_PARSER(limits) {
debugC(7, kDebugParser, "ZONE_PARSER(limits) ");
if (isalpha(_tokens[1][1])) {
- _locParseCtxt.z->_flags |= kFlagsAnimLinked;
- _locParseCtxt.z->_linkedAnim = findAnimation(_tokens[1]);
- _locParseCtxt.z->_linkedName = strdup(_tokens[1]);
+ ctxt.z->_flags |= kFlagsAnimLinked;
+ ctxt.z->_linkedAnim = _vm->findAnimation(_tokens[1]);
+ ctxt.z->_linkedName = strdup(_tokens[1]);
} else {
- _locParseCtxt.z->_left = atoi(_tokens[1]);
- _locParseCtxt.z->_top = atoi(_tokens[2]);
- _locParseCtxt.z->_right = atoi(_tokens[3]);
- _locParseCtxt.z->_bottom = atoi(_tokens[4]);
+ ctxt.z->_left = atoi(_tokens[1]);
+ ctxt.z->_top = atoi(_tokens[2]);
+ ctxt.z->_right = atoi(_tokens[3]);
+ ctxt.z->_bottom = atoi(_tokens[4]);
}
}
@@ -526,9 +725,9 @@ DECLARE_ZONE_PARSER(limits) {
DECLARE_ZONE_PARSER(moveto) {
debugC(7, kDebugParser, "ZONE_PARSER(moveto) ");
- _locParseCtxt.z->_moveTo.x = atoi(_tokens[1]);
- _locParseCtxt.z->_moveTo.y = atoi(_tokens[2]);
-// _locParseCtxt.z->_moveTo.z = atoi(_tokens[3]);
+ ctxt.z->_moveTo.x = atoi(_tokens[1]);
+ ctxt.z->_moveTo.y = atoi(_tokens[2]);
+// ctxt.z->_moveTo.z = atoi(_tokens[3]);
}
@@ -536,45 +735,45 @@ DECLARE_ZONE_PARSER(type) {
debugC(7, kDebugParser, "ZONE_PARSER(type) ");
if (_tokens[2][0] != '\0') {
- _locParseCtxt.z->_type = (4 + _objectsNames->lookup(_tokens[2])) << 16;
+ ctxt.z->_type = (4 + _vm->_objectsNames->lookup(_tokens[2])) << 16;
}
int16 _si = _zoneTypeNames->lookup(_tokens[1]);
if (_si != Table::notFound) {
- _locParseCtxt.z->_type |= 1 << (_si - 1);
- parseZoneTypeBlock(*_locParseCtxt.script, _locParseCtxt.z);
+ ctxt.z->_type |= 1 << (_si - 1);
+ parseZoneTypeBlock(ctxt.z);
-// if (_locParseCtxt.z->_type & kZoneHear) {
+// if (ctxt.z->_type & kZoneHear) {
// _soundMan->sfxCommand(START...);
// }
}
- _locationParser->popTables();
+ _parser->popTables();
}
DECLARE_ANIM_PARSER(file) {
debugC(7, kDebugParser, "ANIM_PARSER(file) ");
- _locParseCtxt.a->gfxobj = _gfx->loadAnim(_tokens[1]);
+ ctxt.a->gfxobj = _vm->_gfx->loadAnim(_tokens[1]);
}
DECLARE_ANIM_PARSER(position) {
debugC(7, kDebugParser, "ANIM_PARSER(position) ");
- _locParseCtxt.a->_left = atoi(_tokens[1]);
- _locParseCtxt.a->_top = atoi(_tokens[2]);
- _locParseCtxt.a->_z = atoi(_tokens[3]);
- _locParseCtxt.a->_frame = atoi(_tokens[4]);
+ ctxt.a->_left = atoi(_tokens[1]);
+ ctxt.a->_top = atoi(_tokens[2]);
+ ctxt.a->_z = atoi(_tokens[3]);
+ ctxt.a->_frame = atoi(_tokens[4]);
}
DECLARE_ANIM_PARSER(moveto) {
debugC(7, kDebugParser, "ANIM_PARSER(moveto) ");
- _locParseCtxt.a->_moveTo.x = atoi(_tokens[1]);
- _locParseCtxt.a->_moveTo.y = atoi(_tokens[2]);
-// _locParseCtxt.a->_moveTo.z = atoi(_tokens[3]);
+ ctxt.a->_moveTo.x = atoi(_tokens[1]);
+ ctxt.a->_moveTo.y = atoi(_tokens[2]);
+// ctxt.a->_moveTo.z = atoi(_tokens[3]);
}
@@ -582,17 +781,17 @@ DECLARE_ANIM_PARSER(endanimation) {
debugC(7, kDebugParser, "ANIM_PARSER(endanimation) ");
- if (_locParseCtxt.a->gfxobj) {
- _locParseCtxt.a->_right = _locParseCtxt.a->width();
- _locParseCtxt.a->_bottom = _locParseCtxt.a->height();
+ if (ctxt.a->gfxobj) {
+ ctxt.a->_right = ctxt.a->width();
+ ctxt.a->_bottom = ctxt.a->height();
}
- _locParseCtxt.a->_oldPos.x = -1000;
- _locParseCtxt.a->_oldPos.y = -1000;
+ ctxt.a->_oldPos.x = -1000;
+ ctxt.a->_oldPos.y = -1000;
- _locParseCtxt.a->_flags |= 0x1000000;
+ ctxt.a->_flags |= 0x1000000;
- _locationParser->popTables();
+ _parser->popTables();
}
@@ -607,7 +806,8 @@ DECLARE_ANIM_PARSER(endanimation) {
DECLARE_INSTRUCTION_PARSER(zone) {
debugC(7, kDebugParser, "INSTRUCTION_PARSER(zone) ");
- _instParseCtxt.inst->_z = findZone(_tokens[1]);
+ ctxt.inst->_z = _vm->findZone(_tokens[1]);
+ ctxt.inst->_index = _parser->_lookup;
}
@@ -616,11 +816,12 @@ DECLARE_INSTRUCTION_PARSER(color) {
debugC(7, kDebugParser, "INSTRUCTION_PARSER(color) ");
- parseRValue(_instParseCtxt.inst->_opB, _tokens[1]);
+ parseRValue(ctxt.inst->_opB, _tokens[1]);
- _instParseCtxt.inst->_colors[0] = atoi(_tokens[2]);
- _instParseCtxt.inst->_colors[1] = atoi(_tokens[3]);
- _instParseCtxt.inst->_colors[2] = atoi(_tokens[4]);
+ ctxt.inst->_colors[0] = atoi(_tokens[2]);
+ ctxt.inst->_colors[1] = atoi(_tokens[3]);
+ ctxt.inst->_colors[2] = atoi(_tokens[4]);
+ ctxt.inst->_index = _parser->_lookup;
}
@@ -629,9 +830,10 @@ DECLARE_INSTRUCTION_PARSER(mask) {
debugC(7, kDebugParser, "INSTRUCTION_PARSER(mask) ");
- parseRValue(_instParseCtxt.inst->_opA, _tokens[1]);
- parseRValue(_instParseCtxt.inst->_opB, _tokens[2]);
- parseRValue(_instParseCtxt.inst->_opC, _tokens[3]);
+ parseRValue(ctxt.inst->_opA, _tokens[1]);
+ parseRValue(ctxt.inst->_opB, _tokens[2]);
+ parseRValue(ctxt.inst->_opC, _tokens[3]);
+ ctxt.inst->_index = _parser->_lookup;
}
@@ -639,7 +841,8 @@ DECLARE_INSTRUCTION_PARSER(mask) {
DECLARE_INSTRUCTION_PARSER(print) {
debugC(7, kDebugParser, "INSTRUCTION_PARSER(print) ");
- parseRValue(_instParseCtxt.inst->_opB, _tokens[1]);
+ parseRValue(ctxt.inst->_opB, _tokens[1]);
+ ctxt.inst->_index = _parser->_lookup;
}
@@ -650,18 +853,19 @@ DECLARE_INSTRUCTION_PARSER(text) {
int _si = 1;
if (isdigit(_tokens[1][1])) {
- _instParseCtxt.inst->_y = atoi(_tokens[1]);
+ ctxt.inst->_y = atoi(_tokens[1]);
_si = 2;
} else {
- _instParseCtxt.inst->_y = -1;
+ ctxt.inst->_y = -1;
}
- _instParseCtxt.inst->_text = strdup(_tokens[_si]);
+ ctxt.inst->_text = strdup(_tokens[_si]);
_si++;
if (_tokens[_si][0] != '\0' && scumm_stricmp("flags", _tokens[_si])) {
- _instParseCtxt.inst->_text2 = strdup(_tokens[_si]);
+ ctxt.inst->_text2 = strdup(_tokens[_si]);
}
+ ctxt.inst->_index = _parser->_lookup;
}
@@ -670,24 +874,24 @@ DECLARE_INSTRUCTION_PARSER(if_op) {
debugC(7, kDebugParser, "INSTRUCTION_PARSER(if_op) ");
- if (_instParseCtxt.openIf)
+ if (ctxt.openIf)
error("cannot nest 'if' blocks");
- parseLValue(_instParseCtxt.inst->_opA, _tokens[1]);
- parseRValue(_instParseCtxt.inst->_opB, _tokens[3]);
+ parseLValue(ctxt.inst->_opA, _tokens[1]);
+ parseRValue(ctxt.inst->_opB, _tokens[3]);
if (_tokens[2][0] == '=') {
- _instParseCtxt.inst->_index = INST_IFEQ;
+ ctxt.inst->_index = INST_IFEQ;
} else
if (_tokens[2][0] == '>') {
- _instParseCtxt.inst->_index = INST_IFGT;
+ ctxt.inst->_index = INST_IFGT;
} else
if (_tokens[2][0] == '<') {
- _instParseCtxt.inst->_index = INST_IFLT;
+ ctxt.inst->_index = INST_IFLT;
} else
error("unknown test operator '%s' in if-clause", _tokens[2]);
- _instParseCtxt.openIf = _instParseCtxt.inst;
+ ctxt.openIf = ctxt.inst;
}
@@ -695,35 +899,36 @@ DECLARE_INSTRUCTION_PARSER(if_op) {
DECLARE_INSTRUCTION_PARSER(endif) {
debugC(7, kDebugParser, "INSTRUCTION_PARSER(endif) ");
- if (!_instParseCtxt.openIf)
+ if (!ctxt.openIf)
error("unexpected 'endif'");
-// _instParseCtxt.openIf->_endif = _instParseCtxt.inst;
- _instParseCtxt.openIf = nullInstructionPtr;
+// ctxt.openIf->_endif = ctxt.inst;
+ ctxt.openIf = nullInstructionPtr;
+ ctxt.inst->_index = _parser->_lookup;
}
-void Parallaction_br::parseRValue(ScriptVar &v, const char *str) {
+void ProgramParser_br::parseRValue(ScriptVar &v, const char *str) {
if (isdigit(str[0]) || str[0] == '-') {
v.setImmediate(atoi(str));
return;
}
- int index = _instParseCtxt.program->findLocal(str);
+ int index = _program->findLocal(str);
if (index != -1) {
- v.setLocal(&_instParseCtxt.locals[index]);
+ v.setLocal(&ctxt.locals[index]);
return;
}
AnimationPtr a;
if (str[1] == '.') {
- a = findAnimation(&str[2]);
+ a = _vm->findAnimation(&str[2]);
if (!a) {
error("unknown animation '%s' in script", &str[2]);
}
} else
- a = AnimationPtr(_instParseCtxt.a);
+ a = AnimationPtr(ctxt.a);
if (str[0] == 'X') {
v.setField(&a->_left);
@@ -744,197 +949,186 @@ void Parallaction_br::parseRValue(ScriptVar &v, const char *str) {
v.setRandom(atoi(&str[1]));
} else
if (str[0] == 'L') {
- v.setField(&_lipSyncVal);
+ v.setField(&_vm->_lipSyncVal);
}
}
-typedef OpcodeImpl<Parallaction_br> OpcodeV2;
-#define INSTRUCTION_PARSER(sig) OpcodeV2(this, &Parallaction_br::instParse_##sig)
-#define ZONE_PARSER(sig) OpcodeV2(this, &Parallaction_br::locZoneParse_##sig)
-#define ANIM_PARSER(sig) OpcodeV2(this, &Parallaction_br::locAnimParse_##sig)
-#define LOCATION_PARSER(sig) OpcodeV2(this, &Parallaction_br::locParse_##sig)
-#define COMMAND_PARSER(sig) OpcodeV2(this, &Parallaction_br::cmdParse_##sig)
-
-#define WARNING_PARSER(sig) OpcodeV2(this, &Parallaction_br::warning_##sig)
-
-void Parallaction_br::initParsers() {
-
- _locationParser = new Parser;
-
- static const OpcodeV2 op0[] = {
- INSTRUCTION_PARSER(defLocal), // invalid opcode -> local definition
- INSTRUCTION_PARSER(zone), // on
- INSTRUCTION_PARSER(zone), // off
- INSTRUCTION_PARSER(x),
- INSTRUCTION_PARSER(y),
- INSTRUCTION_PARSER(z),
- INSTRUCTION_PARSER(f),
- INSTRUCTION_PARSER(loop),
- INSTRUCTION_PARSER(null), // endloop
- INSTRUCTION_PARSER(null), // show
- INSTRUCTION_PARSER(inc),
- INSTRUCTION_PARSER(inc), // dec
- INSTRUCTION_PARSER(set),
- INSTRUCTION_PARSER(put),
- INSTRUCTION_PARSER(call),
- INSTRUCTION_PARSER(null), // wait
- INSTRUCTION_PARSER(zone), // start
- INSTRUCTION_PARSER(zone), // process
- INSTRUCTION_PARSER(move),
- INSTRUCTION_PARSER(color),
- INSTRUCTION_PARSER(zone), // sound
- INSTRUCTION_PARSER(mask),
- INSTRUCTION_PARSER(print),
- INSTRUCTION_PARSER(text),
- INSTRUCTION_PARSER(inc), // mul
- INSTRUCTION_PARSER(inc), // div
- INSTRUCTION_PARSER(if_op),
- INSTRUCTION_PARSER(null),
- INSTRUCTION_PARSER(null),
- INSTRUCTION_PARSER(endif),
- INSTRUCTION_PARSER(zone), // stop
- INSTRUCTION_PARSER(endscript)
- };
-
- uint i;
- for (i = 0; i < ARRAYSIZE(op0); i++)
- _instructionParsers.push_back(&op0[i]);
-
-
- static const OpcodeV2 op2[] = {
- WARNING_PARSER(unexpected),
- COMMAND_PARSER(flags), // set
- COMMAND_PARSER(flags), // clear
- COMMAND_PARSER(zone), // start
- COMMAND_PARSER(zone), // speak
- COMMAND_PARSER(zone), // get
- COMMAND_PARSER(location),
- COMMAND_PARSER(zone), // open
- COMMAND_PARSER(zone), // close
- COMMAND_PARSER(zone), // on
- COMMAND_PARSER(zone), // off
- COMMAND_PARSER(call),
- COMMAND_PARSER(flags), // toggle
- COMMAND_PARSER(drop),
- COMMAND_PARSER(simple), // quit
- COMMAND_PARSER(move),
- COMMAND_PARSER(zone), // stop
- COMMAND_PARSER(string), // character
- COMMAND_PARSER(string), // followme
- COMMAND_PARSER(simple), // onmouse
- COMMAND_PARSER(simple), // offmouse
- COMMAND_PARSER(drop), // add
- COMMAND_PARSER(zone), // leave
- COMMAND_PARSER(math), // inc
- COMMAND_PARSER(math), // dec
- COMMAND_PARSER(test), // test
- WARNING_PARSER(unexpected),
- WARNING_PARSER(unexpected),
- COMMAND_PARSER(math), // let
- COMMAND_PARSER(music),
- COMMAND_PARSER(zone), // fix
- COMMAND_PARSER(zone), // unfix
- COMMAND_PARSER(zeta),
- COMMAND_PARSER(unary), // scroll
- COMMAND_PARSER(string), // swap
- COMMAND_PARSER(give),
- COMMAND_PARSER(text),
- COMMAND_PARSER(unary), // part
- WARNING_PARSER(unexpected),
- COMMAND_PARSER(simple), // return
- COMMAND_PARSER(simple), // onsave
- COMMAND_PARSER(simple), // offsave
- COMMAND_PARSER(endcommands), // endcommands
- COMMAND_PARSER(ifchar),
- COMMAND_PARSER(endif)
- };
-
- for (i = 0; i < ARRAYSIZE(op2); i++)
- _commandParsers.push_back(&op2[i]);
-
- static const OpcodeV2 op4[] = {
- WARNING_PARSER(unexpected),
- LOCATION_PARSER(character),
- LOCATION_PARSER(endlocation),
- LOCATION_PARSER(ifchar),
- LOCATION_PARSER(null), // endif
- LOCATION_PARSER(location),
- LOCATION_PARSER(mask),
- LOCATION_PARSER(path),
- LOCATION_PARSER(null), // disk
- LOCATION_PARSER(localflags),
- LOCATION_PARSER(commands),
- LOCATION_PARSER(escape),
- LOCATION_PARSER(acommands),
- LOCATION_PARSER(flags),
- LOCATION_PARSER(comment),
- LOCATION_PARSER(endcomment),
- LOCATION_PARSER(zone),
- LOCATION_PARSER(animation),
- LOCATION_PARSER(zeta),
- LOCATION_PARSER(music),
- LOCATION_PARSER(sound)
- };
-
- for (i = 0; i < ARRAYSIZE(op4); i++)
- _locationParsers.push_back(&op4[i]);
-
- static const OpcodeV2 op5[] = {
- WARNING_PARSER(unexpected),
- ZONE_PARSER(endzone),
- ZONE_PARSER(limits),
- ZONE_PARSER(moveto),
- ZONE_PARSER(type),
- ZONE_PARSER(commands),
- ZONE_PARSER(label),
- ZONE_PARSER(flags)
- };
-
- for (i = 0; i < ARRAYSIZE(op5); i++)
- _locationZoneParsers.push_back(&op5[i]);
-
- static const OpcodeV2 op6[] = {
- WARNING_PARSER(unexpected),
- ANIM_PARSER(endanimation),
- ANIM_PARSER(endanimation), // endzone
- ANIM_PARSER(script),
- ANIM_PARSER(commands),
- ANIM_PARSER(type),
- ANIM_PARSER(label),
- ANIM_PARSER(flags),
- ANIM_PARSER(file),
- ANIM_PARSER(position),
- ANIM_PARSER(moveto)
- };
-
- for (i = 0; i < ARRAYSIZE(op6); i++)
- _locationAnimParsers.push_back(&op6[i]);
-}
-
-void Parallaction_br::parseLocation(const char* filename) {
-
- _locParseCtxt.numZones = 0;
- _locParseCtxt.bgName = 0;
- _locParseCtxt.maskName = 0;
- _locParseCtxt.pathName = 0;
-
- Super::parseLocation(filename);
-
- _gfx->setBackground(kBackgroundLocation, _locParseCtxt.bgName, _locParseCtxt.maskName, _locParseCtxt.pathName);
- _pathBuffer = &_gfx->_backgroundInfo.path;
-
- free(_locParseCtxt.bgName);
- free(_locParseCtxt.maskName);
- free(_locParseCtxt.pathName);
-
-// drawZones();
-
- return;
+
+void LocationParser_br::init() {
+
+ _parser = new Parser;
+
+ _zoneFlagNames = new Table(ARRAYSIZE(_zoneFlagNamesRes_br), _zoneFlagNamesRes_br);
+ _zoneTypeNames = new Table(ARRAYSIZE(_zoneTypeNamesRes_br), _zoneTypeNamesRes_br);
+ _commandsNames = new Table(ARRAYSIZE(_commandsNamesRes_br), _commandsNamesRes_br);
+ _audioCommandsNames = new Table(ARRAYSIZE(_audioCommandsNamesRes_br), _audioCommandsNamesRes_br);
+ _locationStmt = new Table(ARRAYSIZE(_locationStmtRes_br), _locationStmtRes_br);
+ _locationZoneStmt = new Table(ARRAYSIZE(_locationZoneStmtRes_br), _locationZoneStmtRes_br);
+ _locationAnimStmt = new Table(ARRAYSIZE(_locationAnimStmtRes_br), _locationAnimStmtRes_br);
+
+ Common::Array<const Opcode*> *table = 0;
+
+ SetOpcodeTable(_commandParsers);
+ WARNING_PARSER(unexpected);
+ COMMAND_PARSER(flags); // set
+ COMMAND_PARSER(flags); // clear
+ COMMAND_PARSER(zone); // start
+ COMMAND_PARSER(zone); // speak
+ COMMAND_PARSER(zone); // get
+ COMMAND_PARSER(location);
+ COMMAND_PARSER(zone); // open
+ COMMAND_PARSER(zone); // close
+ COMMAND_PARSER(zone); // on
+ COMMAND_PARSER(zone); // off
+ COMMAND_PARSER(call);
+ COMMAND_PARSER(flags); // toggle
+ COMMAND_PARSER(drop);
+ COMMAND_PARSER(simple); // quit
+ COMMAND_PARSER(move);
+ COMMAND_PARSER(zone); // stop
+ COMMAND_PARSER(string); // character
+ COMMAND_PARSER(string); // followme
+ COMMAND_PARSER(simple); // onmouse
+ COMMAND_PARSER(simple); // offmouse
+ COMMAND_PARSER(drop); // add
+ COMMAND_PARSER(zone); // leave
+ COMMAND_PARSER(math); // inc
+ COMMAND_PARSER(math); // dec
+ COMMAND_PARSER(test); // test
+ WARNING_PARSER(unexpected);
+ WARNING_PARSER(unexpected);
+ COMMAND_PARSER(math); // let
+ COMMAND_PARSER(music);
+ COMMAND_PARSER(zone); // fix
+ COMMAND_PARSER(zone); // unfix
+ COMMAND_PARSER(zeta);
+ COMMAND_PARSER(unary); // scroll
+ COMMAND_PARSER(string); // swap
+ COMMAND_PARSER(give);
+ COMMAND_PARSER(text);
+ COMMAND_PARSER(unary); // part
+ WARNING_PARSER(unexpected);
+ COMMAND_PARSER(simple); // return
+ COMMAND_PARSER(simple); // onsave
+ COMMAND_PARSER(simple); // offsave
+ COMMAND_PARSER(endcommands); // endcommands
+ COMMAND_PARSER(ifchar);
+ COMMAND_PARSER(endif);
+
+ SetOpcodeTable(_locationParsers);
+ WARNING_PARSER(unexpected);
+ LOCATION_PARSER(character);
+ LOCATION_PARSER(endlocation);
+ LOCATION_PARSER(ifchar);
+ LOCATION_PARSER(null); // endif
+ LOCATION_PARSER(location);
+ LOCATION_PARSER(mask);
+ LOCATION_PARSER(path);
+ LOCATION_PARSER(null); // disk
+ LOCATION_PARSER(localflags);
+ LOCATION_PARSER(commands);
+ LOCATION_PARSER(escape);
+ LOCATION_PARSER(acommands);
+ LOCATION_PARSER(flags);
+ LOCATION_PARSER(comment);
+ LOCATION_PARSER(endcomment);
+ LOCATION_PARSER(zone);
+ LOCATION_PARSER(animation);
+ LOCATION_PARSER(zeta);
+ LOCATION_PARSER(music);
+ LOCATION_PARSER(sound);
+
+ SetOpcodeTable(_locationZoneParsers);
+ WARNING_PARSER(unexpected);
+ ZONE_PARSER(endzone);
+ ZONE_PARSER(limits);
+ ZONE_PARSER(moveto);
+ ZONE_PARSER(type);
+ ZONE_PARSER(commands);
+ ZONE_PARSER(label);
+ ZONE_PARSER(flags);
+
+
+ SetOpcodeTable(_locationAnimParsers);
+ WARNING_PARSER(unexpected);
+ ANIM_PARSER(endanimation);
+ ANIM_PARSER(endanimation); // endzone
+ ANIM_PARSER(script);
+ ANIM_PARSER(commands);
+ ANIM_PARSER(type);
+ ANIM_PARSER(label);
+ ANIM_PARSER(flags);
+ ANIM_PARSER(file);
+ ANIM_PARSER(position);
+ ANIM_PARSER(moveto);
+}
+
+void ProgramParser_br::init() {
+
+ _parser = new Parser;
+
+ _instructionNames = new Table(ARRAYSIZE(_instructionNamesRes_br), _instructionNamesRes_br);
+
+ Common::Array<const Opcode*> *table = 0;
+
+ SetOpcodeTable(_instructionParsers);
+ INSTRUCTION_PARSER(defLocal); // invalid opcode -> local definition
+ INSTRUCTION_PARSER(zone); // on
+ INSTRUCTION_PARSER(zone); // off
+ INSTRUCTION_PARSER(x);
+ INSTRUCTION_PARSER(y);
+ INSTRUCTION_PARSER(z);
+ INSTRUCTION_PARSER(f);
+ INSTRUCTION_PARSER(loop);
+ INSTRUCTION_PARSER(null); // endloop
+ INSTRUCTION_PARSER(null); // show
+ INSTRUCTION_PARSER(inc);
+ INSTRUCTION_PARSER(inc); // dec
+ INSTRUCTION_PARSER(set);
+ INSTRUCTION_PARSER(put);
+ INSTRUCTION_PARSER(call);
+ INSTRUCTION_PARSER(null); // wait
+ INSTRUCTION_PARSER(zone); // start
+ INSTRUCTION_PARSER(zone); // process
+ INSTRUCTION_PARSER(move);
+ INSTRUCTION_PARSER(color);
+ INSTRUCTION_PARSER(zone); // sound
+ INSTRUCTION_PARSER(mask);
+ INSTRUCTION_PARSER(print);
+ INSTRUCTION_PARSER(text);
+ INSTRUCTION_PARSER(inc); // mul
+ INSTRUCTION_PARSER(inc); // div
+ INSTRUCTION_PARSER(if_op);
+ INSTRUCTION_PARSER(null);
+ INSTRUCTION_PARSER(null);
+ INSTRUCTION_PARSER(endif);
+ INSTRUCTION_PARSER(zone); // stop
+ INSTRUCTION_PARSER(endscript);
}
+void LocationParser_br::parse(Script *script) {
+
+ ctxt.numZones = 0;
+ ctxt.bgName = 0;
+ ctxt.maskName = 0;
+ ctxt.pathName = 0;
+ ctxt.characterName = 0;
+ LocationParser_ns::parse(script);
+ _vm->_gfx->setBackground(kBackgroundLocation, ctxt.bgName, ctxt.maskName, ctxt.pathName);
+ _vm->_pathBuffer = &_vm->_gfx->_backgroundInfo.path;
+ if (ctxt.characterName) {
+ _vm->changeCharacter(ctxt.characterName);
+ }
+
+ free(ctxt.bgName);
+ free(ctxt.maskName);
+ free(ctxt.pathName);
+ free(ctxt.characterName);
+
+}
} // namespace Parallaction
diff --git a/engines/parallaction/parser_ns.cpp b/engines/parallaction/parser_ns.cpp
index b8b36a0885..2c4601c938 100644
--- a/engines/parallaction/parser_ns.cpp
+++ b/engines/parallaction/parser_ns.cpp
@@ -67,29 +67,143 @@ namespace Parallaction {
#define INST_END 19
-#define DECLARE_ZONE_PARSER(sig) void Parallaction_ns::locZoneParse_##sig()
-#define DECLARE_ANIM_PARSER(sig) void Parallaction_ns::locAnimParse_##sig()
-#define DECLARE_COMMAND_PARSER(sig) void Parallaction_ns::cmdParse_##sig()
-#define DECLARE_INSTRUCTION_PARSER(sig) void Parallaction_ns::instParse_##sig()
-#define DECLARE_LOCATION_PARSER(sig) void Parallaction_ns::locParse_##sig()
-
-
-void Parallaction_ns::warning_unexpected() {
- debugC(1, kDebugParser, "unexpected keyword '%s' in line %i", _tokens[0], _locParseCtxt.script->getLine());
+const char *_zoneFlagNamesRes_ns[] = {
+ "closed",
+ "active",
+ "remove",
+ "acting",
+ "locked",
+ "fixed",
+ "noname",
+ "nomasked",
+ "looping",
+ "added",
+ "character",
+ "nowalk"
+};
+
+const char *_zoneTypeNamesRes_ns[] = {
+ "examine",
+ "door",
+ "get",
+ "merge",
+ "taste",
+ "hear",
+ "feel",
+ "speak",
+ "none",
+ "trap",
+ "yourself",
+ "Command"
+};
+
+const char *_commandsNamesRes_ns[] = {
+ "set",
+ "clear",
+ "start",
+ "speak",
+ "get",
+ "location",
+ "open",
+ "close",
+ "on",
+ "off",
+ "call",
+ "toggle",
+ "drop",
+ "quit",
+ "move",
+ "stop",
+ "endcommands",
+ "endzone"
+};
+
+const char *_locationStmtRes_ns[] = {
+ "endlocation",
+ "location",
+ "disk",
+ "nodes",
+ "zone",
+ "animation",
+ "localflags",
+ "commands",
+ "acommands",
+ "flags",
+ "comment",
+ "endcomment",
+ "sound",
+ "music"
+};
+
+const char *_locationZoneStmtRes_ns[] = {
+ "limits",
+ "moveto",
+ "type",
+ "commands",
+ "label",
+ "flags",
+ "endzone"
+};
+
+const char *_locationAnimStmtRes_ns[] = {
+ "script",
+ "commands",
+ "type",
+ "label",
+ "flags",
+ "file",
+ "position",
+ "moveto",
+ "endanimation"
+};
+
+const char *_instructionNamesRes_ns[] = {
+ "on",
+ "off",
+ "x",
+ "y",
+ "z",
+ "f",
+ "loop",
+ "endloop",
+ "show",
+ "inc",
+ "dec",
+ "set",
+ "put",
+ "call",
+ "wait",
+ "start",
+ "sound",
+ "move",
+ "endscript"
+};
+
+
+#define DECLARE_ZONE_PARSER(sig) void LocationParser_ns::locZoneParse_##sig()
+#define DECLARE_ANIM_PARSER(sig) void LocationParser_ns::locAnimParse_##sig()
+#define DECLARE_COMMAND_PARSER(sig) void LocationParser_ns::cmdParse_##sig()
+#define DECLARE_LOCATION_PARSER(sig) void LocationParser_ns::locParse_##sig()
+
+#define DECLARE_INSTRUCTION_PARSER(sig) void ProgramParser_ns::instParse_##sig()
+
+
+void LocationParser_ns::warning_unexpected() {
+ debugC(1, kDebugParser, "unexpected keyword '%s' in line %i", _tokens[0], _script->getLine());
}
DECLARE_ANIM_PARSER(script) {
debugC(7, kDebugParser, "ANIM_PARSER(script) ");
- _locParseCtxt.a->_scriptName = strdup(_tokens[1]);
+ ctxt.a->_scriptName = strdup(_tokens[1]);
}
DECLARE_ANIM_PARSER(commands) {
debugC(7, kDebugParser, "ANIM_PARSER(commands) ");
- parseCommands(*_locParseCtxt.script, _locParseCtxt.a->_commands);
+ parseCommands(ctxt.a->_commands);
}
@@ -97,29 +211,29 @@ DECLARE_ANIM_PARSER(type) {
debugC(7, kDebugParser, "ANIM_PARSER(type) ");
if (_tokens[2][0] != '\0') {
- _locParseCtxt.a->_type = ((4 + _objectsNames->lookup(_tokens[2])) << 16) & 0xFFFF0000;
+ ctxt.a->_type = ((4 + _vm->_objectsNames->lookup(_tokens[2])) << 16) & 0xFFFF0000;
}
int16 _si = _zoneTypeNames->lookup(_tokens[1]);
if (_si != Table::notFound) {
- _locParseCtxt.a->_type |= 1 << (_si-1);
- if (((_locParseCtxt.a->_type & 0xFFFF) != kZoneNone) && ((_locParseCtxt.a->_type & 0xFFFF) != kZoneCommand)) {
- parseZoneTypeBlock(*_locParseCtxt.script, _locParseCtxt.a);
+ ctxt.a->_type |= 1 << (_si-1);
+ if (((ctxt.a->_type & 0xFFFF) != kZoneNone) && ((ctxt.a->_type & 0xFFFF) != kZoneCommand)) {
+ parseZoneTypeBlock(ctxt.a);
}
}
- _locParseCtxt.a->_oldPos.x = -1000;
- _locParseCtxt.a->_oldPos.y = -1000;
+ ctxt.a->_oldPos.x = -1000;
+ ctxt.a->_oldPos.y = -1000;
- _locParseCtxt.a->_flags |= 0x1000000;
+ ctxt.a->_flags |= 0x1000000;
- _locationParser->popTables();
+ _parser->popTables();
}
DECLARE_ANIM_PARSER(label) {
debugC(7, kDebugParser, "ANIM_PARSER(label) ");
- _locParseCtxt.a->_label = _gfx->renderFloatingLabel(_labelFont, _tokens[1]);
+ ctxt.a->_label = _vm->_gfx->renderFloatingLabel(_vm->_labelFont, _tokens[1]);
}
@@ -131,7 +245,7 @@ DECLARE_ANIM_PARSER(flags) {
do {
byte _al = _zoneFlagNames->lookup(_tokens[_si]);
_si++;
- _locParseCtxt.a->_flags |= 1 << (_al - 1);
+ ctxt.a->_flags |= 1 << (_al - 1);
} while (!scumm_stricmp(_tokens[_si++], "|"));
}
@@ -146,24 +260,24 @@ DECLARE_ANIM_PARSER(file) {
strcat(vC8, "tras");
}
}
- _locParseCtxt.a->gfxobj = _gfx->loadAnim(vC8);
+ ctxt.a->gfxobj = _vm->_gfx->loadAnim(vC8);
}
DECLARE_ANIM_PARSER(position) {
debugC(7, kDebugParser, "ANIM_PARSER(position) ");
- _locParseCtxt.a->_left = atoi(_tokens[1]);
- _locParseCtxt.a->_top = atoi(_tokens[2]);
- _locParseCtxt.a->_z = atoi(_tokens[3]);
+ ctxt.a->_left = atoi(_tokens[1]);
+ ctxt.a->_top = atoi(_tokens[2]);
+ ctxt.a->_z = atoi(_tokens[3]);
}
DECLARE_ANIM_PARSER(moveto) {
debugC(7, kDebugParser, "ANIM_PARSER(moveto) ");
- _locParseCtxt.a->_moveTo.x = atoi(_tokens[1]);
- _locParseCtxt.a->_moveTo.y = atoi(_tokens[2]);
+ ctxt.a->_moveTo.x = atoi(_tokens[1]);
+ ctxt.a->_moveTo.y = atoi(_tokens[2]);
}
@@ -171,15 +285,15 @@ DECLARE_ANIM_PARSER(endanimation) {
debugC(7, kDebugParser, "ANIM_PARSER(endanimation) ");
- _locParseCtxt.a->_oldPos.x = -1000;
- _locParseCtxt.a->_oldPos.y = -1000;
+ ctxt.a->_oldPos.x = -1000;
+ ctxt.a->_oldPos.y = -1000;
- _locParseCtxt.a->_flags |= 0x1000000;
+ ctxt.a->_flags |= 0x1000000;
- _locationParser->popTables();
+ _parser->popTables();
}
-void Parallaction_ns::parseAnimation(Script& script, AnimationList &list, char *name) {
+void LocationParser_ns::parseAnimation(AnimationList &list, char *name) {
debugC(5, kDebugParser, "parseAnimation(name: %s)", name);
AnimationPtr a(new Animation);
@@ -188,37 +302,55 @@ void Parallaction_ns::parseAnimation(Script& script, AnimationList &list, char *
list.push_front(AnimationPtr(a));
- _locParseCtxt.a = a;
- _locParseCtxt.script = &script;
-
- _locationParser->pushTables(&_locationAnimParsers, _locationAnimStmt);
+ ctxt.a = a;
+ _parser->pushTables(&_locationAnimParsers, _locationAnimStmt);
}
-void Parallaction_ns::parseInstruction(ProgramPtr program) {
+void ProgramParser_ns::parseInstruction() {
- InstructionPtr inst(new Instruction);
+ _script->readLineToken(true);
if (_tokens[0][1] == '.') {
_tokens[0][1] = '\0';
- _instParseCtxt.a = findAnimation(&_tokens[0][2]);
+ ctxt.a = _vm->findAnimation(&_tokens[0][2]);
} else
if (_tokens[1][1] == '.') {
_tokens[1][1] = '\0';
- _instParseCtxt.a = findAnimation(&_tokens[1][2]);
+ ctxt.a = _vm->findAnimation(&_tokens[1][2]);
} else
- _instParseCtxt.a = program->_anim;
-
- inst->_index = _instructionNames->lookup(_tokens[0]);
- _instParseCtxt.inst = inst;
- _instParseCtxt.locals = program->_locals;
+ ctxt.a = _program->_anim;
- (*(_instructionParsers[inst->_index]))();
+ if (!ctxt.a) {
+ return;
+ }
- program->_instructions.push_back(inst);
+ InstructionPtr inst(new Instruction);
+ ctxt.inst = inst;
+ _parser->parseStatement();
+ _program->_instructions.push_back(inst);
return;
}
+void ProgramParser_ns::parse(Script *script, ProgramPtr program) {
+
+ _script = script;
+ _program = program;
+
+ ctxt.openIf = nullInstructionPtr;
+ ctxt.end = false;
+ ctxt.locals = program->_locals;
+
+ _parser->reset();
+ _parser->pushTables(&_instructionParsers, _instructionNames);
+ do {
+ parseInstruction();
+ } while (!ctxt.end);
+ _parser->popTables();
+
+ program->_ip = program->_instructions.begin();
+}
+
void Parallaction_ns::loadProgram(AnimationPtr a, const char *filename) {
debugC(1, kDebugParser, "loadProgram(Animation: %s, script: %s)", a->_name, filename);
@@ -226,20 +358,11 @@ void Parallaction_ns::loadProgram(AnimationPtr a, const char *filename) {
ProgramPtr program(new Program);
program->_anim = a;
- _instParseCtxt.openIf = nullInstructionPtr;
- _instParseCtxt.end = false;
- _instParseCtxt.program = program;
-
- do {
- script->readLineToken();
- parseInstruction(program);
- } while (!_instParseCtxt.end);
-
- program->_ip = program->_instructions.begin();
+ _programParser->parse(script, program);
delete script;
- _location._programs.push_back(program);
+ _vm->_location._programs.push_back(program);
debugC(1, kDebugParser, "loadProgram() done");
@@ -249,62 +372,70 @@ void Parallaction_ns::loadProgram(AnimationPtr a, const char *filename) {
DECLARE_INSTRUCTION_PARSER(animation) {
debugC(7, kDebugParser, "INSTRUCTION_PARSER(animation) ");
- if (!scumm_stricmp(_tokens[1], _instParseCtxt.a->_name)) {
- _instParseCtxt.inst->_a = _instParseCtxt.a;
+ if (!scumm_stricmp(_tokens[1], ctxt.a->_name)) {
+ ctxt.inst->_a = ctxt.a;
} else {
- _instParseCtxt.inst->_a = findAnimation(_tokens[1]);
+ ctxt.inst->_a = _vm->findAnimation(_tokens[1]);
}
+
+ ctxt.inst->_index = _parser->_lookup;
}
DECLARE_INSTRUCTION_PARSER(loop) {
debugC(7, kDebugParser, "INSTRUCTION_PARSER(loop) ");
- parseRValue(_instParseCtxt.inst->_opB, _tokens[1]);
+ parseRValue(ctxt.inst->_opB, _tokens[1]);
+ ctxt.inst->_index = _parser->_lookup;
}
DECLARE_INSTRUCTION_PARSER(x) {
debugC(7, kDebugParser, "INSTRUCTION_PARSER(x) ");
- parseLValue(_instParseCtxt.inst->_opA, "X");
- parseRValue(_instParseCtxt.inst->_opB, _tokens[1]);
+ parseLValue(ctxt.inst->_opA, "X");
+ parseRValue(ctxt.inst->_opB, _tokens[1]);
+ ctxt.inst->_index = _parser->_lookup;
}
DECLARE_INSTRUCTION_PARSER(y) {
debugC(7, kDebugParser, "INSTRUCTION_PARSER(y) ");
- parseLValue(_instParseCtxt.inst->_opA, "Y");
- parseRValue(_instParseCtxt.inst->_opB, _tokens[1]);
+ parseLValue(ctxt.inst->_opA, "Y");
+ parseRValue(ctxt.inst->_opB, _tokens[1]);
+ ctxt.inst->_index = _parser->_lookup;
}
DECLARE_INSTRUCTION_PARSER(z) {
debugC(7, kDebugParser, "INSTRUCTION_PARSER(z) ");
- parseLValue(_instParseCtxt.inst->_opA, "Z");
- parseRValue(_instParseCtxt.inst->_opB, _tokens[1]);
+ parseLValue(ctxt.inst->_opA, "Z");
+ parseRValue(ctxt.inst->_opB, _tokens[1]);
+ ctxt.inst->_index = _parser->_lookup;
}
DECLARE_INSTRUCTION_PARSER(f) {
debugC(7, kDebugParser, "INSTRUCTION_PARSER(f) ");
- parseLValue(_instParseCtxt.inst->_opA, "F");
- parseRValue(_instParseCtxt.inst->_opB, _tokens[1]);
+ parseLValue(ctxt.inst->_opA, "F");
+ parseRValue(ctxt.inst->_opB, _tokens[1]);
+ ctxt.inst->_index = _parser->_lookup;
}
DECLARE_INSTRUCTION_PARSER(inc) {
debugC(7, kDebugParser, "INSTRUCTION_PARSER(inc) ");
- parseLValue(_instParseCtxt.inst->_opA, _tokens[1]);
- parseRValue(_instParseCtxt.inst->_opB, _tokens[2]);
+ parseLValue(ctxt.inst->_opA, _tokens[1]);
+ parseRValue(ctxt.inst->_opB, _tokens[2]);
if (!scumm_stricmp(_tokens[3], "mod")) {
- _instParseCtxt.inst->_flags |= kInstMod;
+ ctxt.inst->_flags |= kInstMod;
}
+ ctxt.inst->_index = _parser->_lookup;
}
@@ -316,61 +447,65 @@ DECLARE_INSTRUCTION_PARSER(set) {
// script was commented out on Dos version. This workaround enables the engine
// to dynamically add a local variable when it is encountered the first time in
// the script, so should fix any other occurrence as well.
- if (_instParseCtxt.program->findLocal(_tokens[1]) == -1) {
- _instParseCtxt.program->addLocal(_tokens[1]);
+ if (_program->findLocal(_tokens[1]) == -1) {
+ _program->addLocal(_tokens[1]);
}
- parseLValue(_instParseCtxt.inst->_opA, _tokens[1]);
- parseRValue(_instParseCtxt.inst->_opB, _tokens[2]);
+ parseLValue(ctxt.inst->_opA, _tokens[1]);
+ parseRValue(ctxt.inst->_opB, _tokens[2]);
+ ctxt.inst->_index = _parser->_lookup;
}
DECLARE_INSTRUCTION_PARSER(move) {
debugC(7, kDebugParser, "INSTRUCTION_PARSER(move) ");
- parseRValue(_instParseCtxt.inst->_opA, _tokens[1]);
- parseRValue(_instParseCtxt.inst->_opB, _tokens[2]);
+ parseRValue(ctxt.inst->_opA, _tokens[1]);
+ parseRValue(ctxt.inst->_opB, _tokens[2]);
+ ctxt.inst->_index = _parser->_lookup;
}
DECLARE_INSTRUCTION_PARSER(put) {
debugC(7, kDebugParser, "INSTRUCTION_PARSER(put) ");
- if (!scumm_stricmp(_tokens[1], _instParseCtxt.a->_name)) {
- _instParseCtxt.inst->_a = _instParseCtxt.a;
+ if (!scumm_stricmp(_tokens[1], ctxt.a->_name)) {
+ ctxt.inst->_a = ctxt.a;
} else {
- _instParseCtxt.inst->_a = findAnimation(_tokens[1]);
+ ctxt.inst->_a = _vm->findAnimation(_tokens[1]);
}
- parseRValue(_instParseCtxt.inst->_opA, _tokens[2]);
- parseRValue(_instParseCtxt.inst->_opB, _tokens[3]);
+ parseRValue(ctxt.inst->_opA, _tokens[2]);
+ parseRValue(ctxt.inst->_opB, _tokens[3]);
if (!scumm_stricmp(_tokens[4], "masked")) {
- _instParseCtxt.inst->_flags |= kInstMaskedPut;
+ ctxt.inst->_flags |= kInstMaskedPut;
}
+ ctxt.inst->_index = _parser->_lookup;
}
DECLARE_INSTRUCTION_PARSER(call) {
debugC(7, kDebugParser, "INSTRUCTION_PARSER(call) ");
- int index = _callableNames->lookup(_tokens[1]);
+ int index = _vm->_callableNames->lookup(_tokens[1]);
if (index == Table::notFound)
error("unknown callable '%s'", _tokens[1]);
- _instParseCtxt.inst->_immediate = index - 1;
+ ctxt.inst->_immediate = index - 1;
+ ctxt.inst->_index = _parser->_lookup;
}
DECLARE_INSTRUCTION_PARSER(sound) {
debugC(7, kDebugParser, "INSTRUCTION_PARSER(sound) ");
- _instParseCtxt.inst->_z = findZone(_tokens[1]);
+ ctxt.inst->_z = _vm->findZone(_tokens[1]);
+ ctxt.inst->_index = _parser->_lookup;
}
DECLARE_INSTRUCTION_PARSER(null) {
debugC(7, kDebugParser, "INSTRUCTION_PARSER(null) ");
-
-
+ ctxt.inst->_index = _parser->_lookup;
}
@@ -381,43 +516,44 @@ DECLARE_INSTRUCTION_PARSER(defLocal) {
int16 index;
if (_tokens[3][0] != '\0') {
- index = _instParseCtxt.program->addLocal(_tokens[0], val, atoi(_tokens[3]), atoi(_tokens[4]));
+ index = _program->addLocal(_tokens[0], val, atoi(_tokens[3]), atoi(_tokens[4]));
} else {
- index = _instParseCtxt.program->addLocal(_tokens[0], val);
+ index = _program->addLocal(_tokens[0], val);
}
- _instParseCtxt.inst->_opA.setLocal(&_instParseCtxt.locals[index]);
- _instParseCtxt.inst->_opB.setImmediate(_instParseCtxt.locals[index]._value);
+ ctxt.inst->_opA.setLocal(&ctxt.locals[index]);
+ ctxt.inst->_opB.setImmediate(ctxt.locals[index]._value);
- _instParseCtxt.inst->_index = INST_SET;
+ ctxt.inst->_index = INST_SET;
}
DECLARE_INSTRUCTION_PARSER(endscript) {
debugC(7, kDebugParser, "INSTRUCTION_PARSER(endscript) ");
- _instParseCtxt.end = true;
+ ctxt.end = true;
+ ctxt.inst->_index = _parser->_lookup;
}
-void Parallaction_ns::parseRValue(ScriptVar &v, const char *str) {
+void ProgramParser_ns::parseRValue(ScriptVar &v, const char *str) {
if (isdigit(str[0]) || str[0] == '-') {
v.setImmediate(atoi(str));
return;
}
- int index = _instParseCtxt.program->findLocal(str);
+ int index = _program->findLocal(str);
if (index != -1) {
- v.setLocal(&_instParseCtxt.locals[index]);
+ v.setLocal(&ctxt.locals[index]);
return;
}
AnimationPtr a;
if (str[1] == '.') {
- a = findAnimation(&str[2]);
+ a = _vm->findAnimation(&str[2]);
} else {
- a = _instParseCtxt.a;
+ a = ctxt.a;
}
if (str[0] == 'X') {
@@ -435,19 +571,19 @@ void Parallaction_ns::parseRValue(ScriptVar &v, const char *str) {
}
-void Parallaction_ns::parseLValue(ScriptVar &v, const char *str) {
+void ProgramParser_ns::parseLValue(ScriptVar &v, const char *str) {
- int index = _instParseCtxt.program->findLocal(str);
+ int index = _program->findLocal(str);
if (index != -1) {
- v.setLocal(&_instParseCtxt.locals[index]);
+ v.setLocal(&ctxt.locals[index]);
return;
}
AnimationPtr a;
if (str[1] == '.') {
- a = findAnimation(&str[2]);
+ a = _vm->findAnimation(&str[2]);
} else {
- a = _instParseCtxt.a;
+ a = ctxt.a;
}
if (str[0] == 'X') {
@@ -469,23 +605,23 @@ void Parallaction_ns::parseLValue(ScriptVar &v, const char *str) {
DECLARE_COMMAND_PARSER(flags) {
debugC(7, kDebugParser, "COMMAND_PARSER(flags) ");
- createCommand(_locationParser->_lookup);
+ createCommand(_parser->_lookup);
- if (_globalTable->lookup(_tokens[1]) == Table::notFound) {
+ if (_vm->_globalTable->lookup(_tokens[1]) == Table::notFound) {
do {
- char _al = _localFlagNames->lookup(_tokens[_locParseCtxt.nextToken]);
- _locParseCtxt.nextToken++;
- _locParseCtxt.cmd->u._flags |= 1 << (_al - 1);
- } while (!scumm_stricmp(_tokens[_locParseCtxt.nextToken++], "|"));
- _locParseCtxt.nextToken--;
+ char _al = _vm->_localFlagNames->lookup(_tokens[ctxt.nextToken]);
+ ctxt.nextToken++;
+ ctxt.cmd->u._flags |= 1 << (_al - 1);
+ } while (!scumm_stricmp(_tokens[ctxt.nextToken++], "|"));
+ ctxt.nextToken--;
} else {
- _locParseCtxt.cmd->u._flags |= kFlagsGlobal;
+ ctxt.cmd->u._flags |= kFlagsGlobal;
do {
- char _al = _globalTable->lookup(_tokens[1]);
- _locParseCtxt.nextToken++;
- _locParseCtxt.cmd->u._flags |= 1 << (_al - 1);
- } while (!scumm_stricmp(_tokens[_locParseCtxt.nextToken++], "|"));
- _locParseCtxt.nextToken--;
+ char _al = _vm->_globalTable->lookup(_tokens[1]);
+ ctxt.nextToken++;
+ ctxt.cmd->u._flags |= 1 << (_al - 1);
+ } while (!scumm_stricmp(_tokens[ctxt.nextToken++], "|"));
+ ctxt.nextToken--;
}
parseCommandFlags();
@@ -496,13 +632,13 @@ DECLARE_COMMAND_PARSER(flags) {
DECLARE_COMMAND_PARSER(zone) {
debugC(7, kDebugParser, "COMMAND_PARSER(zone) ");
- createCommand(_locationParser->_lookup);
+ createCommand(_parser->_lookup);
- _locParseCtxt.cmd->u._zone = findZone(_tokens[_locParseCtxt.nextToken]);
- if (!_locParseCtxt.cmd->u._zone) {
- saveCommandForward(_tokens[_locParseCtxt.nextToken], _locParseCtxt.cmd);
+ ctxt.cmd->u._zone = _vm->findZone(_tokens[ctxt.nextToken]);
+ if (!ctxt.cmd->u._zone) {
+ saveCommandForward(_tokens[ctxt.nextToken], ctxt.cmd);
}
- _locParseCtxt.nextToken++;
+ ctxt.nextToken++;
parseCommandFlags();
addCommand();
@@ -512,10 +648,10 @@ DECLARE_COMMAND_PARSER(zone) {
DECLARE_COMMAND_PARSER(location) {
debugC(7, kDebugParser, "COMMAND_PARSER(location) ");
- createCommand(_locationParser->_lookup);
+ createCommand(_parser->_lookup);
- _locParseCtxt.cmd->u._string = strdup(_tokens[_locParseCtxt.nextToken]);
- _locParseCtxt.nextToken++;
+ ctxt.cmd->u._string = strdup(_tokens[ctxt.nextToken]);
+ ctxt.nextToken++;
parseCommandFlags();
addCommand();
@@ -525,10 +661,10 @@ DECLARE_COMMAND_PARSER(location) {
DECLARE_COMMAND_PARSER(drop) {
debugC(7, kDebugParser, "COMMAND_PARSER(drop) ");
- createCommand(_locationParser->_lookup);
+ createCommand(_parser->_lookup);
- _locParseCtxt.cmd->u._object = 4 + _objectsNames->lookup(_tokens[_locParseCtxt.nextToken]);
- _locParseCtxt.nextToken++;
+ ctxt.cmd->u._object = 4 + _vm->_objectsNames->lookup(_tokens[ctxt.nextToken]);
+ ctxt.nextToken++;
parseCommandFlags();
addCommand();
@@ -538,10 +674,10 @@ DECLARE_COMMAND_PARSER(drop) {
DECLARE_COMMAND_PARSER(call) {
debugC(7, kDebugParser, "COMMAND_PARSER(call) ");
- createCommand(_locationParser->_lookup);
+ createCommand(_parser->_lookup);
- _locParseCtxt.cmd->u._callable = _callableNames->lookup(_tokens[_locParseCtxt.nextToken]) - 1;
- _locParseCtxt.nextToken++;
+ ctxt.cmd->u._callable = _vm->_callableNames->lookup(_tokens[ctxt.nextToken]) - 1;
+ ctxt.nextToken++;
parseCommandFlags();
addCommand();
@@ -551,7 +687,7 @@ DECLARE_COMMAND_PARSER(call) {
DECLARE_COMMAND_PARSER(simple) {
debugC(7, kDebugParser, "COMMAND_PARSER(simple) ");
- createCommand(_locationParser->_lookup);
+ createCommand(_parser->_lookup);
addCommand();
}
@@ -559,12 +695,12 @@ DECLARE_COMMAND_PARSER(simple) {
DECLARE_COMMAND_PARSER(move) {
debugC(7, kDebugParser, "COMMAND_PARSER(move) ");
- createCommand(_locationParser->_lookup);
+ createCommand(_parser->_lookup);
- _locParseCtxt.cmd->u._move.x = atoi(_tokens[_locParseCtxt.nextToken]);
- _locParseCtxt.nextToken++;
- _locParseCtxt.cmd->u._move.y = atoi(_tokens[_locParseCtxt.nextToken]);
- _locParseCtxt.nextToken++;
+ ctxt.cmd->u._move.x = atoi(_tokens[ctxt.nextToken]);
+ ctxt.nextToken++;
+ ctxt.cmd->u._move.y = atoi(_tokens[ctxt.nextToken]);
+ ctxt.nextToken++;
parseCommandFlags();
addCommand();
@@ -573,16 +709,16 @@ DECLARE_COMMAND_PARSER(move) {
DECLARE_COMMAND_PARSER(endcommands) {
debugC(7, kDebugParser, "COMMAND_PARSER(endcommands) ");
- _locationParser->popTables();
+ _parser->popTables();
// temporary trick to handle dialogue commands
- _locParseCtxt.endcommands = true;
+ ctxt.endcommands = true;
}
-void Parallaction_ns::parseCommandFlags() {
+void LocationParser_ns::parseCommandFlags() {
- int _si = _locParseCtxt.nextToken;
- CommandPtr cmd = _locParseCtxt.cmd;
+ int _si = ctxt.nextToken;
+ CommandPtr cmd = ctxt.cmd;
if (!scumm_stricmp(_tokens[_si], "flags")) {
_si++;
@@ -595,11 +731,11 @@ void Parallaction_ns::parseCommandFlags() {
cmd->_flagsOn |= kFlagsEnter;
} else
if (!scumm_strnicmp(_tokens[_si], "no", 2)) {
- byte _al = _localFlagNames->lookup(&_tokens[_si][2]);
+ byte _al = _vm->_localFlagNames->lookup(&_tokens[_si][2]);
assert(_al != Table::notFound);
cmd->_flagsOff |= 1 << (_al - 1);
} else {
- byte _al = _localFlagNames->lookup(_tokens[_si]);
+ byte _al = _vm->_localFlagNames->lookup(_tokens[_si]);
assert(_al != Table::notFound);
cmd->_flagsOn |= 1 << (_al - 1);
}
@@ -622,11 +758,11 @@ void Parallaction_ns::parseCommandFlags() {
cmd->_flagsOn |= kFlagsEnter;
} else
if (!scumm_strnicmp(_tokens[_si], "no", 2)) {
- byte _al = _globalTable->lookup(&_tokens[_si][2]);
+ byte _al = _vm->_globalTable->lookup(&_tokens[_si][2]);
assert(_al != Table::notFound);
cmd->_flagsOff |= 1 << (_al - 1);
} else {
- byte _al = _globalTable->lookup(_tokens[_si]);
+ byte _al = _vm->_globalTable->lookup(_tokens[_si]);
assert(_al != Table::notFound);
cmd->_flagsOn |= 1 << (_al - 1);
}
@@ -637,23 +773,23 @@ void Parallaction_ns::parseCommandFlags() {
}
- _si = _locParseCtxt.nextToken;
+ _si = ctxt.nextToken;
}
-void Parallaction_ns::addCommand() {
- _locParseCtxt.list->push_front(_locParseCtxt.cmd); // NOTE: command lists are written backwards in scripts
+void LocationParser_ns::addCommand() {
+ ctxt.list->push_front(ctxt.cmd); // NOTE: command lists are written backwards in scripts
}
-void Parallaction_ns::createCommand(uint id) {
+void LocationParser_ns::createCommand(uint id) {
- _locParseCtxt.nextToken = 1;
- _locParseCtxt.cmd = CommandPtr(new Command);
- _locParseCtxt.cmd->_id = id;
+ ctxt.nextToken = 1;
+ ctxt.cmd = CommandPtr(new Command);
+ ctxt.cmd->_id = id;
}
-void Parallaction_ns::saveCommandForward(const char *name, CommandPtr cmd) {
+void LocationParser_ns::saveCommandForward(const char *name, CommandPtr cmd) {
assert(_numForwardedCommands < MAX_FORWARDS);
strcpy(_forwardedCommands[_numForwardedCommands].name, name);
@@ -662,9 +798,9 @@ void Parallaction_ns::saveCommandForward(const char *name, CommandPtr cmd) {
_numForwardedCommands++;
}
-void Parallaction_ns::resolveCommandForwards() {
+void LocationParser_ns::resolveCommandForwards() {
for (uint i = 0; i < _numForwardedCommands; i++) {
- _forwardedCommands[i].cmd->u._zone = findZone(_forwardedCommands[i].name);
+ _forwardedCommands[i].cmd->u._zone = _vm->findZone(_forwardedCommands[i].name);
if (_forwardedCommands[i].cmd->u._zone == 0) {
warning("Cannot find zone '%s' into current location script. This may be a bug in the original scripts.\n", _forwardedCommands[i].name);
}
@@ -672,17 +808,16 @@ void Parallaction_ns::resolveCommandForwards() {
_numForwardedCommands = 0;
}
-void Parallaction_ns::parseCommands(Script &script, CommandList& list) {
+void LocationParser_ns::parseCommands(CommandList& list) {
debugC(5, kDebugParser, "parseCommands()");
- _locParseCtxt.list = &list;
- _locParseCtxt.endcommands = false;
- _locParseCtxt.script = &script;
+ ctxt.list = &list;
+ ctxt.endcommands = false;
- _locationParser->pushTables(&_commandParsers, _commandsNames);
+ _parser->pushTables(&_commandParsers, _commandsNames);
}
-Dialogue *Parallaction_ns::parseDialogue(Script &script) {
+Dialogue *LocationParser_ns::parseDialogue() {
debugC(7, kDebugParser, "parseDialogue()");
uint16 numQuestions = 0;
@@ -692,16 +827,16 @@ Dialogue *Parallaction_ns::parseDialogue(Script &script) {
Table forwards(20);
- script.readLineToken(true);
+ _script->readLineToken(true);
while (scumm_stricmp(_tokens[0], "enddialogue")) {
if (scumm_stricmp(_tokens[0], "Question")) continue;
forwards.addData(_tokens[1]);
- dialogue->_questions[numQuestions++] = parseQuestion(script);
+ dialogue->_questions[numQuestions++] = parseQuestion();
- script.readLineToken(true);
+ _script->readLineToken(true);
}
resolveDialogueForwards(dialogue, numQuestions, forwards);
@@ -711,28 +846,28 @@ Dialogue *Parallaction_ns::parseDialogue(Script &script) {
return dialogue;
}
-Question *Parallaction_ns::parseQuestion(Script &script) {
+Question *LocationParser_ns::parseQuestion() {
Question *question = new Question;
assert(question);
- question->_text = parseDialogueString(script);
+ question->_text = parseDialogueString();
- script.readLineToken(true);
+ _script->readLineToken(true);
question->_mood = atoi(_tokens[0]);
uint16 numAnswers = 0;
- script.readLineToken(true);
+ _script->readLineToken(true);
while (scumm_stricmp(_tokens[0], "endquestion")) { // parse answers
- question->_answers[numAnswers] = parseAnswer(script);
+ question->_answers[numAnswers] = parseAnswer();
numAnswers++;
}
return question;
}
-Answer *Parallaction_ns::parseAnswer(Script &script) {
+Answer *LocationParser_ns::parseAnswer() {
Answer *answer = new Answer;
assert(answer);
@@ -744,11 +879,11 @@ Answer *Parallaction_ns::parseAnswer(Script &script) {
if (!scumm_stricmp(_tokens[1], "global")) {
token = 2;
- flagNames = _globalTable;
+ flagNames = _vm->_globalTable;
answer->_yesFlags |= kFlagsGlobal;
} else {
token = 1;
- flagNames = _localFlagNames;
+ flagNames = _vm->_localFlagNames;
}
do {
@@ -767,28 +902,29 @@ Answer *Parallaction_ns::parseAnswer(Script &script) {
}
- answer->_text = parseDialogueString(script);
+ answer->_text = parseDialogueString();
- script.readLineToken(true);
+ _script->readLineToken(true);
answer->_mood = atoi(_tokens[0]);
- answer->_following._name = parseDialogueString(script);
+ answer->_following._name = parseDialogueString();
- script.readLineToken(true);
+ _script->readLineToken(true);
if (!scumm_stricmp(_tokens[0], "commands")) {
- parseCommands(script, answer->_commands);
- _locParseCtxt.endcommands = false;
+ parseCommands(answer->_commands);
+ ctxt.endcommands = false;
do {
- _locationParser->parseStatement();
- } while (!_locParseCtxt.endcommands);
+ _script->readLineToken(true);
+ _parser->parseStatement();
+ } while (!ctxt.endcommands);
- script.readLineToken(true);
+ _script->readLineToken(true);
}
return answer;
}
-void Parallaction_ns::resolveDialogueForwards(Dialogue *dialogue, uint numQuestions, Table &forwards) {
+void LocationParser_ns::resolveDialogueForwards(Dialogue *dialogue, uint numQuestions, Table &forwards) {
for (uint16 i = 0; i < numQuestions; i++) {
Question *question = dialogue->_questions[i];
@@ -811,13 +947,13 @@ void Parallaction_ns::resolveDialogueForwards(Dialogue *dialogue, uint numQuesti
}
-char *Parallaction_ns::parseDialogueString(Script &script) {
+char *LocationParser_ns::parseDialogueString() {
char vC8[200];
char *vD0 = NULL;
do {
- vD0 = script.readLine(vC8, 200);
+ vD0 = _script->readLine(vC8, 200);
if (vD0 == 0) return NULL;
vD0 = Common::ltrim(vD0);
@@ -833,7 +969,7 @@ char *Parallaction_ns::parseDialogueString(Script &script) {
DECLARE_LOCATION_PARSER(endlocation) {
debugC(7, kDebugParser, "LOCATION_PARSER(endlocation) ");
- _locParseCtxt.end = true;
+ ctxt.end = true;
}
@@ -851,16 +987,16 @@ DECLARE_LOCATION_PARSER(location) {
mask++;
}
- strcpy(_location._name, _tokens[1]);
- switchBackground(_location._name, mask);
+ strcpy(_vm->_location._name, _tokens[1]);
+ _vm->switchBackground(_vm->_location._name, mask);
if (_tokens[2][0] != '\0') {
- _char._ani->_left = atoi(_tokens[2]);
- _char._ani->_top = atoi(_tokens[3]);
+ _vm->_char._ani->_left = atoi(_tokens[2]);
+ _vm->_char._ani->_top = atoi(_tokens[3]);
}
if (_tokens[4][0] != '\0') {
- _char._ani->_frame = atoi(_tokens[4]);
+ _vm->_char._ani->_frame = atoi(_tokens[4]);
}
}
@@ -868,28 +1004,28 @@ DECLARE_LOCATION_PARSER(location) {
DECLARE_LOCATION_PARSER(disk) {
debugC(7, kDebugParser, "LOCATION_PARSER(disk) ");
- _disk->selectArchive(_tokens[1]);
+ _vm->_disk->selectArchive(_tokens[1]);
}
DECLARE_LOCATION_PARSER(nodes) {
debugC(7, kDebugParser, "LOCATION_PARSER(nodes) ");
- parseWalkNodes(*_locParseCtxt.script, _location._walkNodes);
+ parseWalkNodes(_vm->_location._walkNodes);
}
DECLARE_LOCATION_PARSER(zone) {
debugC(7, kDebugParser, "LOCATION_PARSER(zone) ");
- parseZone(*_locParseCtxt.script, _location._zones, _tokens[1]);
+ parseZone(_vm->_location._zones, _tokens[1]);
}
DECLARE_LOCATION_PARSER(animation) {
debugC(7, kDebugParser, "LOCATION_PARSER(animation) ");
- parseAnimation(*_locParseCtxt.script, _location._animations, _tokens[1]);
+ parseAnimation(_vm->_location._animations, _tokens[1]);
}
@@ -898,7 +1034,7 @@ DECLARE_LOCATION_PARSER(localflags) {
int _si = 1;
while (_tokens[_si][0] != '\0') {
- _localFlagNames->addData(_tokens[_si]);
+ _vm->_localFlagNames->addData(_tokens[_si]);
_si++;
}
}
@@ -907,28 +1043,28 @@ DECLARE_LOCATION_PARSER(localflags) {
DECLARE_LOCATION_PARSER(commands) {
debugC(7, kDebugParser, "LOCATION_PARSER(commands) ");
- parseCommands(*_locParseCtxt.script, _location._commands);
+ parseCommands(_vm->_location._commands);
}
DECLARE_LOCATION_PARSER(acommands) {
debugC(7, kDebugParser, "LOCATION_PARSER(acommands) ");
- parseCommands(*_locParseCtxt.script, _location._aCommands);
+ parseCommands(_vm->_location._aCommands);
}
DECLARE_LOCATION_PARSER(flags) {
debugC(7, kDebugParser, "LOCATION_PARSER(flags) ");
- if ((getLocationFlags() & kFlagsVisited) == 0) {
+ if ((_vm->getLocationFlags() & kFlagsVisited) == 0) {
// only for 1st visit
- clearLocationFlags(kFlagsAll);
+ _vm->clearLocationFlags(kFlagsAll);
int _si = 1;
do {
- byte _al = _localFlagNames->lookup(_tokens[_si]);
- setLocationFlags(1 << (_al - 1));
+ byte _al = _vm->_localFlagNames->lookup(_tokens[_si]);
+ _vm->setLocationFlags(1 << (_al - 1));
_si++;
if (scumm_stricmp(_tokens[_si], "|")) break;
@@ -941,23 +1077,23 @@ DECLARE_LOCATION_PARSER(flags) {
DECLARE_LOCATION_PARSER(comment) {
debugC(7, kDebugParser, "LOCATION_PARSER(comment) ");
- _location._comment = parseComment(*_locParseCtxt.script);
+ _vm->_location._comment = parseComment();
}
DECLARE_LOCATION_PARSER(endcomment) {
debugC(7, kDebugParser, "LOCATION_PARSER(endcomment) ");
- _location._endComment = parseComment(*_locParseCtxt.script);
+ _vm->_location._endComment = parseComment();
}
DECLARE_LOCATION_PARSER(sound) {
debugC(7, kDebugParser, "LOCATION_PARSER(sound) ");
- if (getPlatform() == Common::kPlatformAmiga) {
- strcpy(_location._soundFile, _tokens[1]);
- _location._hasSound = true;
+ if (_vm->getPlatform() == Common::kPlatformAmiga) {
+ strcpy(_vm->_location._soundFile, _tokens[1]);
+ _vm->_location._hasSound = true;
}
}
@@ -965,58 +1101,33 @@ DECLARE_LOCATION_PARSER(sound) {
DECLARE_LOCATION_PARSER(music) {
debugC(7, kDebugParser, "LOCATION_PARSER(music) ");
- if (getPlatform() == Common::kPlatformAmiga)
- _soundMan->setMusicFile(_tokens[1]);
+ if (_vm->getPlatform() == Common::kPlatformAmiga)
+ _vm->_soundMan->setMusicFile(_tokens[1]);
}
-
-void Parallaction_ns::parseLocation(const char *filename) {
- debugC(1, kDebugParser, "parseLocation('%s')", filename);
-
- allocateLocationSlot(filename);
-// printf("got location slot #%i for %s\n", _currentLocationIndex, filename);
+void LocationParser_ns::parse(Script *script) {
_numForwardedCommands = 0;
- Script *script = _disk->loadLocation(filename);
- _locationParser->bind(script);
-
- // TODO: the following two lines are specific to Nippon Safes
- // and should be moved into something like 'initializeParsing()'
- _location._hasSound = false;
+ ctxt.end = false;
+ _script = script;
+ ctxt.filename = 0;//filename;
- _locParseCtxt.end = false;
- _locParseCtxt.script = script;
- _locParseCtxt.filename = filename;
-
- _locationParser->pushTables(&_locationParsers, _locationStmt);
+ _parser->reset();
+ _parser->pushTables(&_locationParsers, _locationStmt);
do {
- _locationParser->parseStatement();
- } while (!_locParseCtxt.end);
- _locationParser->popTables();
- _locationParser->unbind();
-
- delete script;
+ _script->readLineToken(true);
+ _parser->parseStatement();
+ } while (!ctxt.end);
+ _parser->popTables();
resolveCommandForwards();
-
- // this loads animation scripts
- AnimationList::iterator it = _location._animations.begin();
- for ( ; it != _location._animations.end(); it++) {
- if ((*it)->_scriptName) {
- loadProgram(*it, (*it)->_scriptName);
- }
- }
-
- debugC(1, kDebugParser, "parseLocation('%s') done", filename);
- return;
}
-
-void Parallaction_ns::parseWalkNodes(Script& script, WalkNodeList &list) {
+void LocationParser_ns::parseWalkNodes(WalkNodeList &list) {
debugC(5, kDebugParser, "parseWalkNodes()");
- script.readLineToken(true);
+ _script->readLineToken(true);
while (scumm_stricmp(_tokens[0], "ENDNODES")) {
if (!scumm_stricmp(_tokens[0], "COORD")) {
@@ -1029,146 +1140,159 @@ void Parallaction_ns::parseWalkNodes(Script& script, WalkNodeList &list) {
list.push_front(v4);
}
- script.readLineToken(true);
+ _script->readLineToken(true);
}
debugC(5, kDebugParser, "parseWalkNodes() done");
return;
}
-
-typedef OpcodeImpl<Parallaction_ns> OpcodeV1;
-#define INSTRUCTION_PARSER(sig) OpcodeV1(this, &Parallaction_ns::instParse_##sig)
-#define ZONE_PARSER(sig) OpcodeV1(this, &Parallaction_ns::locZoneParse_##sig)
-#define ANIM_PARSER(sig) OpcodeV1(this, &Parallaction_ns::locAnimParse_##sig)
-#define LOCATION_PARSER(sig) OpcodeV1(this, &Parallaction_ns::locParse_##sig)
-#define COMMAND_PARSER(sig) OpcodeV1(this, &Parallaction_ns::cmdParse_##sig)
-
-#define WARNING_PARSER(sig) OpcodeV1(this, &Parallaction_br::warning_##sig)
-
-void Parallaction_ns::initParsers() {
-
- _locationParser = new Parser;
-
- static const OpcodeV1 op0[] = {
- INSTRUCTION_PARSER(defLocal), // invalid opcode -> local definition
- INSTRUCTION_PARSER(animation), // on
- INSTRUCTION_PARSER(animation), // off
- INSTRUCTION_PARSER(x),
- INSTRUCTION_PARSER(y),
- INSTRUCTION_PARSER(z),
- INSTRUCTION_PARSER(f),
- INSTRUCTION_PARSER(loop),
- INSTRUCTION_PARSER(null), // endloop
- INSTRUCTION_PARSER(null), // show
- INSTRUCTION_PARSER(inc),
- INSTRUCTION_PARSER(inc), // dec
- INSTRUCTION_PARSER(set),
- INSTRUCTION_PARSER(put),
- INSTRUCTION_PARSER(call),
- INSTRUCTION_PARSER(null), // wait
- INSTRUCTION_PARSER(animation), // start
- INSTRUCTION_PARSER(sound),
- INSTRUCTION_PARSER(move),
- INSTRUCTION_PARSER(endscript)
- };
-
- uint i;
- for (i = 0; i < ARRAYSIZE(op0); i++)
- _instructionParsers.push_back(&op0[i]);
-
-
- static const OpcodeV1 op2[] = {
- WARNING_PARSER(unexpected),
- COMMAND_PARSER(flags), // set
- COMMAND_PARSER(flags), // clear
- COMMAND_PARSER(zone), // start
- COMMAND_PARSER(zone), // speak
- COMMAND_PARSER(zone), // get
- COMMAND_PARSER(location), // location
- COMMAND_PARSER(zone), // open
- COMMAND_PARSER(zone), // close
- COMMAND_PARSER(zone), // on
- COMMAND_PARSER(zone), // off
- COMMAND_PARSER(call), // call
- COMMAND_PARSER(flags), // toggle
- COMMAND_PARSER(drop), // drop
- COMMAND_PARSER(simple), // quit
- COMMAND_PARSER(move), // move
- COMMAND_PARSER(zone), // stop
- COMMAND_PARSER(endcommands), // endcommands
- COMMAND_PARSER(endcommands) // endzone
- };
-
- for (i = 0; i < ARRAYSIZE(op2); i++)
- _commandParsers.push_back(&op2[i]);
-
-
- static const OpcodeV1 op4[] = {
- WARNING_PARSER(unexpected),
- LOCATION_PARSER(endlocation),
- LOCATION_PARSER(location),
- LOCATION_PARSER(disk),
- LOCATION_PARSER(nodes),
- LOCATION_PARSER(zone),
- LOCATION_PARSER(animation),
- LOCATION_PARSER(localflags),
- LOCATION_PARSER(commands),
- LOCATION_PARSER(acommands),
- LOCATION_PARSER(flags),
- LOCATION_PARSER(comment),
- LOCATION_PARSER(endcomment),
- LOCATION_PARSER(sound),
- LOCATION_PARSER(music)
- };
-
- for (i = 0; i < ARRAYSIZE(op4); i++)
- _locationParsers.push_back(&op4[i]);
-
- static const OpcodeV1 op5[] = {
- WARNING_PARSER(unexpected),
- ZONE_PARSER(limits),
- ZONE_PARSER(moveto),
- ZONE_PARSER(type),
- ZONE_PARSER(commands),
- ZONE_PARSER(label),
- ZONE_PARSER(flags),
- ZONE_PARSER(endzone)
- };
-
- for (i = 0; i < ARRAYSIZE(op5); i++)
- _locationZoneParsers.push_back(&op5[i]);
-
- static const OpcodeV1 op6[] = {
- WARNING_PARSER(unexpected),
- ANIM_PARSER(script),
- ANIM_PARSER(commands),
- ANIM_PARSER(type),
- ANIM_PARSER(label),
- ANIM_PARSER(flags),
- ANIM_PARSER(file),
- ANIM_PARSER(position),
- ANIM_PARSER(moveto),
- ANIM_PARSER(endanimation)
- };
-
- for (i = 0; i < ARRAYSIZE(op6); i++)
- _locationAnimParsers.push_back(&op6[i]);
-
+/*
+typedef OpcodeImpl<ProgramParser_ns> OpcodeV1;
+#define INSTRUCTION_PARSER(sig) OpcodeV1(this, &ProgramParser_ns::instParse_##sig)
+
+typedef OpcodeImpl<LocationParser_ns> OpcodeV2;
+#define ZONE_PARSER(sig) OpcodeV2(this, &LocationParser_ns::locZoneParse_##sig)
+#define ANIM_PARSER(sig) OpcodeV2(this, &LocationParser_ns::locAnimParse_##sig)
+#define LOCATION_PARSER(sig) OpcodeV2(this, &LocationParser_ns::locParse_##sig)
+#define COMMAND_PARSER(sig) OpcodeV2(this, &LocationParser_ns::cmdParse_##sig)
+
+#define WARNING_PARSER(sig) OpcodeV2(this, &LocationParser_br::warning_##sig)
+*/
+
+#define SetOpcodeTable(x) table = &x;
+
+
+typedef Common::Functor0Mem<void, ProgramParser_ns> OpcodeV1;
+#define SetOpcodeTable(x) table = &x;
+#define INSTRUCTION_PARSER(sig) table->push_back(new OpcodeV1(this, &ProgramParser_ns::instParse_##sig))
+
+typedef Common::Functor0Mem<void, LocationParser_ns> OpcodeV2;
+#define ZONE_PARSER(sig) table->push_back(new OpcodeV2(this, &LocationParser_ns::locZoneParse_##sig))
+#define ANIM_PARSER(sig) table->push_back(new OpcodeV2(this, &LocationParser_ns::locAnimParse_##sig))
+#define LOCATION_PARSER(sig) table->push_back(new OpcodeV2(this, &LocationParser_ns::locParse_##sig))
+#define COMMAND_PARSER(sig) table->push_back(new OpcodeV2(this, &LocationParser_ns::cmdParse_##sig))
+
+#define WARNING_PARSER(sig) table->push_back(new OpcodeV2(this, &LocationParser_br::warning_##sig))
+
+
+void LocationParser_ns::init() {
+
+ _parser = new Parser;
+
+ _zoneFlagNames = new Table(ARRAYSIZE(_zoneFlagNamesRes_ns), _zoneFlagNamesRes_ns);
+ _zoneTypeNames = new Table(ARRAYSIZE(_zoneTypeNamesRes_ns), _zoneTypeNamesRes_ns);
+ _commandsNames = new Table(ARRAYSIZE(_commandsNamesRes_ns), _commandsNamesRes_ns);
+ _locationStmt = new Table(ARRAYSIZE(_locationStmtRes_ns), _locationStmtRes_ns);
+ _locationZoneStmt = new Table(ARRAYSIZE(_locationZoneStmtRes_ns), _locationZoneStmtRes_ns);
+ _locationAnimStmt = new Table(ARRAYSIZE(_locationAnimStmtRes_ns), _locationAnimStmtRes_ns);
+
+ Common::Array<const Opcode*> *table = 0;
+
+ SetOpcodeTable(_commandParsers);
+ WARNING_PARSER(unexpected);
+ COMMAND_PARSER(flags); // set
+ COMMAND_PARSER(flags); // clear
+ COMMAND_PARSER(zone); // start
+ COMMAND_PARSER(zone); // speak
+ COMMAND_PARSER(zone); // get
+ COMMAND_PARSER(location); // location
+ COMMAND_PARSER(zone); // open
+ COMMAND_PARSER(zone); // close
+ COMMAND_PARSER(zone); // on
+ COMMAND_PARSER(zone); // off
+ COMMAND_PARSER(call); // call
+ COMMAND_PARSER(flags); // toggle
+ COMMAND_PARSER(drop); // drop
+ COMMAND_PARSER(simple); // quit
+ COMMAND_PARSER(move); // move
+ COMMAND_PARSER(zone); // stop
+ COMMAND_PARSER(endcommands); // endcommands
+ COMMAND_PARSER(endcommands); // endzone
+
+ SetOpcodeTable(_locationParsers);
+ WARNING_PARSER(unexpected);
+ LOCATION_PARSER(endlocation);
+ LOCATION_PARSER(location);
+ LOCATION_PARSER(disk);
+ LOCATION_PARSER(nodes);
+ LOCATION_PARSER(zone);
+ LOCATION_PARSER(animation);
+ LOCATION_PARSER(localflags);
+ LOCATION_PARSER(commands);
+ LOCATION_PARSER(acommands);
+ LOCATION_PARSER(flags);
+ LOCATION_PARSER(comment);
+ LOCATION_PARSER(endcomment);
+ LOCATION_PARSER(sound);
+ LOCATION_PARSER(music);
+
+ SetOpcodeTable(_locationZoneParsers);
+ WARNING_PARSER(unexpected);
+ ZONE_PARSER(limits);
+ ZONE_PARSER(moveto);
+ ZONE_PARSER(type);
+ ZONE_PARSER(commands);
+ ZONE_PARSER(label);
+ ZONE_PARSER(flags);
+ ZONE_PARSER(endzone);
+
+ SetOpcodeTable(_locationAnimParsers);
+ WARNING_PARSER(unexpected);
+ ANIM_PARSER(script);
+ ANIM_PARSER(commands);
+ ANIM_PARSER(type);
+ ANIM_PARSER(label);
+ ANIM_PARSER(flags);
+ ANIM_PARSER(file);
+ ANIM_PARSER(position);
+ ANIM_PARSER(moveto);
+ ANIM_PARSER(endanimation);
+
+}
+
+void ProgramParser_ns::init() {
+
+ _parser = new Parser;
+
+ _instructionNames = new Table(ARRAYSIZE(_instructionNamesRes_ns), _instructionNamesRes_ns);
+
+ Common::Array<const Opcode*> *table = 0;
+ SetOpcodeTable(_instructionParsers);
+ INSTRUCTION_PARSER(defLocal); // invalid opcode -> local definition
+ INSTRUCTION_PARSER(animation); // on
+ INSTRUCTION_PARSER(animation); // off
+ INSTRUCTION_PARSER(x);
+ INSTRUCTION_PARSER(y);
+ INSTRUCTION_PARSER(z);
+ INSTRUCTION_PARSER(f);
+ INSTRUCTION_PARSER(loop);
+ INSTRUCTION_PARSER(null); // endloop
+ INSTRUCTION_PARSER(null); // show
+ INSTRUCTION_PARSER(inc);
+ INSTRUCTION_PARSER(inc); // dec
+ INSTRUCTION_PARSER(set);
+ INSTRUCTION_PARSER(put);
+ INSTRUCTION_PARSER(call);
+ INSTRUCTION_PARSER(null); // wait
+ INSTRUCTION_PARSER(animation); // start
+ INSTRUCTION_PARSER(sound);
+ INSTRUCTION_PARSER(move);
+ INSTRUCTION_PARSER(endscript);
}
//
// a comment can appear both at location and Zone levels
// comments are displayed into rectangles on the screen
//
-char *Parallaction_ns::parseComment(Script &script) {
+char *LocationParser_ns::parseComment() {
char _tmp_comment[1000] = "\0";
char *v194;
do {
char v190[400];
- v194 = script.readLine(v190, 400);
+ v194 = _script->readLine(v190, 400);
v194[strlen(v194)-1] = '\0';
if (!scumm_stricmp(v194, "endtext"))
@@ -1192,24 +1316,24 @@ DECLARE_ZONE_PARSER(null) {
DECLARE_ZONE_PARSER(endzone) {
debugC(7, kDebugParser, "ZONE_PARSER(endzone) ");
- _locationParser->popTables();
+ _parser->popTables();
}
DECLARE_ZONE_PARSER(limits) {
debugC(7, kDebugParser, "ZONE_PARSER(limits) ");
- _locParseCtxt.z->_left = atoi(_tokens[1]);
- _locParseCtxt.z->_top = atoi(_tokens[2]);
- _locParseCtxt.z->_right = atoi(_tokens[3]);
- _locParseCtxt.z->_bottom = atoi(_tokens[4]);
+ ctxt.z->_left = atoi(_tokens[1]);
+ ctxt.z->_top = atoi(_tokens[2]);
+ ctxt.z->_right = atoi(_tokens[3]);
+ ctxt.z->_bottom = atoi(_tokens[4]);
}
DECLARE_ZONE_PARSER(moveto) {
debugC(7, kDebugParser, "ZONE_PARSER(moveto) ");
- _locParseCtxt.z->_moveTo.x = atoi(_tokens[1]);
- _locParseCtxt.z->_moveTo.y = atoi(_tokens[2]);
+ ctxt.z->_moveTo.x = atoi(_tokens[1]);
+ ctxt.z->_moveTo.y = atoi(_tokens[2]);
}
@@ -1217,22 +1341,22 @@ DECLARE_ZONE_PARSER(type) {
debugC(7, kDebugParser, "ZONE_PARSER(type) ");
if (_tokens[2][0] != '\0') {
- _locParseCtxt.z->_type = (4 + _objectsNames->lookup(_tokens[2])) << 16;
+ ctxt.z->_type = (4 + _vm->_objectsNames->lookup(_tokens[2])) << 16;
}
int16 _si = _zoneTypeNames->lookup(_tokens[1]);
if (_si != Table::notFound) {
- _locParseCtxt.z->_type |= 1 << (_si - 1);
- parseZoneTypeBlock(*_locParseCtxt.script, _locParseCtxt.z);
+ ctxt.z->_type |= 1 << (_si - 1);
+ parseZoneTypeBlock(ctxt.z);
}
- _locationParser->popTables();
+ _parser->popTables();
}
DECLARE_ZONE_PARSER(commands) {
debugC(7, kDebugParser, "ZONE_PARSER(commands) ");
- parseCommands(*_locParseCtxt.script, _locParseCtxt.z->_commands);
+ parseCommands(ctxt.z->_commands);
}
@@ -1240,7 +1364,7 @@ DECLARE_ZONE_PARSER(label) {
debugC(7, kDebugParser, "ZONE_PARSER(label) ");
// printf("label: %s", _tokens[1]);
- _locParseCtxt.z->_label = _gfx->renderFloatingLabel(_labelFont, _tokens[1]);
+ ctxt.z->_label = _vm->_gfx->renderFloatingLabel(_vm->_labelFont, _tokens[1]);
}
@@ -1252,15 +1376,15 @@ DECLARE_ZONE_PARSER(flags) {
do {
char _al = _zoneFlagNames->lookup(_tokens[_si]);
_si++;
- _locParseCtxt.z->_flags |= 1 << (_al - 1);
+ ctxt.z->_flags |= 1 << (_al - 1);
} while (!scumm_stricmp(_tokens[_si++], "|"));
}
-void Parallaction_ns::parseZone(Script &script, ZoneList &list, char *name) {
+void LocationParser_ns::parseZone(ZoneList &list, char *name) {
debugC(5, kDebugParser, "parseZone(name: %s)", name);
- if (findZone(name)) {
- script.skip("endzone");
+ if (_vm->findZone(name)) {
+ _script->skip("endzone");
return;
}
@@ -1268,12 +1392,11 @@ void Parallaction_ns::parseZone(Script &script, ZoneList &list, char *name) {
strncpy(z->_name, name, ZONENAME_LENGTH);
- _locParseCtxt.z = z;
- _locParseCtxt.script = &script;
+ ctxt.z = z;
list.push_front(z);
- _locationParser->pushTables(&_locationZoneParsers, _locationZoneStmt);
+ _parser->pushTables(&_locationZoneParsers, _locationZoneStmt);
return;
}
@@ -1281,7 +1404,7 @@ void Parallaction_ns::parseZone(Script &script, ZoneList &list, char *name) {
-void Parallaction_ns::parseGetData(Script &script, ZonePtr z) {
+void LocationParser_ns::parseGetData(ZonePtr z) {
GetData *data = new GetData;
@@ -1291,20 +1414,20 @@ void Parallaction_ns::parseGetData(Script &script, ZonePtr z) {
bool visible = (z->_flags & kFlagsRemove) == 0;
- GfxObj *obj = _gfx->loadGet(_tokens[1]);
+ GfxObj *obj = _vm->_gfx->loadGet(_tokens[1]);
obj->frame = 0;
obj->x = z->_left;
obj->y = z->_top;
- _gfx->showGfxObj(obj, visible);
+ _vm->_gfx->showGfxObj(obj, visible);
data->gfxobj = obj;
}
if (!scumm_stricmp(_tokens[0], "icon")) {
- data->_icon = 4 + _objectsNames->lookup(_tokens[1]);
+ data->_icon = 4 + _vm->_objectsNames->lookup(_tokens[1]);
}
- script.readLineToken(true);
+ _script->readLineToken(true);
} while (scumm_stricmp(_tokens[0], "endzone"));
z->u.get = data;
@@ -1312,7 +1435,7 @@ void Parallaction_ns::parseGetData(Script &script, ZonePtr z) {
}
-void Parallaction_ns::parseExamineData(Script &script, ZonePtr z) {
+void LocationParser_ns::parseExamineData(ZonePtr z) {
ExamineData *data = new ExamineData;
@@ -1322,10 +1445,10 @@ void Parallaction_ns::parseExamineData(Script &script, ZonePtr z) {
data->_filename = strdup(_tokens[1]);
}
if (!scumm_stricmp(_tokens[0], "desc")) {
- data->_description = parseComment(script);
+ data->_description = parseComment();
}
- script.readLineToken(true);
+ _script->readLineToken(true);
} while (scumm_stricmp(_tokens[0], "endzone"));
z->u.examine = data;
@@ -1333,16 +1456,16 @@ void Parallaction_ns::parseExamineData(Script &script, ZonePtr z) {
}
-void Parallaction_ns::parseDoorData(Script &script, ZonePtr z) {
+void LocationParser_ns::parseDoorData(ZonePtr z) {
DoorData *data = new DoorData;
do {
if (!scumm_stricmp(_tokens[0], "slidetext")) {
- strcpy(_slideText[0], _tokens[1]);
+ strcpy(_vm->_location._slideText[0], _tokens[1]);
// printf("%s\t", _slideText[0]);
- strcpy(_slideText[1], _tokens[2]);
+ strcpy(_vm->_location._slideText[1], _tokens[2]);
}
if (!scumm_stricmp(_tokens[0], "location")) {
@@ -1354,11 +1477,11 @@ void Parallaction_ns::parseDoorData(Script &script, ZonePtr z) {
uint16 frame = (z->_flags & kFlagsClosed ? 0 : 1);
- GfxObj *obj = _gfx->loadDoor(_tokens[1]);
+ GfxObj *obj = _vm->_gfx->loadDoor(_tokens[1]);
obj->frame = frame;
obj->x = z->_left;
obj->y = z->_top;
- _gfx->showGfxObj(obj, true);
+ _vm->_gfx->showGfxObj(obj, true);
data->gfxobj = obj;
}
@@ -1369,7 +1492,7 @@ void Parallaction_ns::parseDoorData(Script &script, ZonePtr z) {
data->_startFrame = atoi(_tokens[3]);
}
- script.readLineToken(true);
+ _script->readLineToken(true);
} while (scumm_stricmp(_tokens[0], "endzone"));
z->u.door = data;
@@ -1377,30 +1500,30 @@ void Parallaction_ns::parseDoorData(Script &script, ZonePtr z) {
}
-void Parallaction_ns::parseMergeData(Script &script, ZonePtr z) {
+void LocationParser_ns::parseMergeData(ZonePtr z) {
MergeData *data = new MergeData;
do {
if (!scumm_stricmp(_tokens[0], "obj1")) {
- data->_obj1 = 4 + _objectsNames->lookup(_tokens[1]);
+ data->_obj1 = 4 + _vm->_objectsNames->lookup(_tokens[1]);
}
if (!scumm_stricmp(_tokens[0], "obj2")) {
- data->_obj2 = 4 + _objectsNames->lookup(_tokens[1]);
+ data->_obj2 = 4 + _vm->_objectsNames->lookup(_tokens[1]);
}
if (!scumm_stricmp(_tokens[0], "newobj")) {
- data->_obj3 = 4 + _objectsNames->lookup(_tokens[1]);
+ data->_obj3 = 4 + _vm->_objectsNames->lookup(_tokens[1]);
}
- script.readLineToken(true);
+ _script->readLineToken(true);
} while (scumm_stricmp(_tokens[0], "endzone"));
z->u.merge = data;
}
-void Parallaction_ns::parseHearData(Script &script, ZonePtr z) {
+void LocationParser_ns::parseHearData(ZonePtr z) {
HearData *data = new HearData;
@@ -1414,14 +1537,14 @@ void Parallaction_ns::parseHearData(Script &script, ZonePtr z) {
data->_freq = atoi(_tokens[1]);
}
- script.readLineToken(true);
+ _script->readLineToken(true);
} while (scumm_stricmp(_tokens[0], "endzone"));
z->u.hear = data;
}
-void Parallaction_ns::parseSpeakData(Script &script, ZonePtr z) {
+void LocationParser_ns::parseSpeakData(ZonePtr z) {
SpeakData *data = new SpeakData;
@@ -1431,10 +1554,10 @@ void Parallaction_ns::parseSpeakData(Script &script, ZonePtr z) {
strcpy(data->_name, _tokens[1]);
}
if (!scumm_stricmp(_tokens[0], "Dialogue")) {
- data->_dialogue = parseDialogue(script);
+ data->_dialogue = parseDialogue();
}
- script.readLineToken(true);
+ _script->readLineToken(true);
} while (scumm_stricmp(_tokens[0], "endzone"));
z->u.speak = data;
@@ -1442,37 +1565,37 @@ void Parallaction_ns::parseSpeakData(Script &script, ZonePtr z) {
}
-void Parallaction_ns::parseZoneTypeBlock(Script &script, ZonePtr z) {
+void LocationParser_ns::parseZoneTypeBlock(ZonePtr z) {
debugC(7, kDebugParser, "parseZoneTypeBlock(name: %s, type: %x)", z->_name, z->_type);
switch (z->_type & 0xFFFF) {
case kZoneExamine: // examine Zone alloc
- parseExamineData(script, z);
+ parseExamineData(z);
break;
case kZoneDoor: // door Zone alloc
- parseDoorData(script, z);
+ parseDoorData(z);
break;
case kZoneGet: // get Zone alloc
- parseGetData(script, z);
+ parseGetData(z);
break;
case kZoneMerge: // merge Zone alloc
- parseMergeData(script, z);
+ parseMergeData(z);
break;
case kZoneHear: // hear Zone alloc
- parseHearData(script, z);
+ parseHearData(z);
break;
case kZoneSpeak: // speak Zone alloc
- parseSpeakData(script, z);
+ parseSpeakData(z);
break;
default:
// eats up 'ENDZONE' line for unprocessed zone types
- script.readLineToken(true);
+ _script->readLineToken(true);
break;
}
diff --git a/engines/parallaction/staticres.cpp b/engines/parallaction/staticres.cpp
index 53d370a0a8..2c5cf281dd 100644
--- a/engines/parallaction/staticres.cpp
+++ b/engines/parallaction/staticres.cpp
@@ -29,23 +29,23 @@
namespace Parallaction {
-byte Parallaction_ns::_mouseArrow[256] = {
- 0x12, 0x11, 0x11, 0x11, 0x13, 0x12, 0x12, 0x12, 0x13, 0x12, 0x12, 0x11, 0x13, 0x12, 0x12, 0x00,
- 0x13, 0x12, 0x12, 0x11, 0x13, 0x12, 0x12, 0x12, 0x13, 0x12, 0x12, 0x12, 0x13, 0x12, 0x12, 0x12,
- 0x13, 0x12, 0x12, 0x12, 0x13, 0x12, 0x12, 0x12, 0x13, 0x12, 0x12, 0x13, 0x13, 0x13, 0x12, 0x00,
- 0x13, 0x00, 0x12, 0x00, 0x13, 0x00, 0x12, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x11, 0x11, 0x11, 0x11, 0x12, 0x12, 0x12, 0x11, 0x12, 0x12, 0x12, 0x00, 0x12, 0x12, 0x12, 0x00,
- 0x12, 0x12, 0x12, 0x00, 0x12, 0x12, 0x12, 0x11, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12,
- 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x13, 0x12, 0x12, 0x12, 0x00, 0x12, 0x12, 0x12, 0x00,
- 0x13, 0x13, 0x12, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x11, 0x11, 0x11, 0x11, 0x12, 0x12, 0x12, 0x00, 0x12, 0x12, 0x12, 0x00, 0x12, 0x12, 0x12, 0x00,
- 0x12, 0x12, 0x12, 0x00, 0x12, 0x12, 0x12, 0x00, 0x12, 0x12, 0x12, 0x11, 0x12, 0x12, 0x12, 0x12,
- 0x12, 0x12, 0x12, 0x13, 0x12, 0x12, 0x12, 0x00, 0x12, 0x12, 0x12, 0x00, 0x13, 0x12, 0x12, 0x00,
- 0x00, 0x12, 0x13, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x11, 0x11, 0x11, 0x00, 0x12, 0x12, 0x12, 0x00, 0x12, 0x12, 0x12, 0x00, 0x12, 0x12, 0x11, 0x00,
- 0x12, 0x12, 0x12, 0x00, 0x12, 0x12, 0x12, 0x00, 0x12, 0x12, 0x12, 0x00, 0x12, 0x12, 0x12, 0x11,
- 0x12, 0x12, 0x12, 0x00, 0x12, 0x12, 0x12, 0x00, 0x13, 0x12, 0x12, 0x00, 0x00, 0x12, 0x13, 0x00,
- 0x00, 0x12, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+byte Parallaction_ns::_resMouseArrow[256] = {
+ 0x12, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x13, 0x00, 0x00,
+ 0x11, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x13, 0x00, 0x00, 0x00,
+ 0x11, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x13, 0x00, 0x00, 0x00, 0x00,
+ 0x11, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x11, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x13, 0x00, 0x00, 0x00, 0x00,
+ 0x11, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x13, 0x00, 0x00, 0x00,
+ 0x11, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x13, 0x00, 0x00,
+ 0x11, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x13, 0x00,
+ 0x11, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x13, 0x00,
+ 0x11, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x13, 0x00, 0x00,
+ 0x11, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x13, 0x00, 0x00, 0x00,
+ 0x11, 0x12, 0x12, 0x11, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x13, 0x00, 0x00, 0x00, 0x00,
+ 0x11, 0x12, 0x11, 0x00, 0x11, 0x12, 0x12, 0x12, 0x12, 0x12, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x11, 0x11, 0x00, 0x00, 0x00, 0x11, 0x12, 0x12, 0x12, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x12, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
@@ -216,80 +216,6 @@ byte _amigaTopazFont[2600] = {
};
-
-const char *_zoneFlagNamesRes_ns[] = {
- "closed",
- "active",
- "remove",
- "acting",
- "locked",
- "fixed",
- "noname",
- "nomasked",
- "looping",
- "added",
- "character",
- "nowalk"
-};
-
-const char *_zoneTypeNamesRes_ns[] = {
- "examine",
- "door",
- "get",
- "merge",
- "taste",
- "hear",
- "feel",
- "speak",
- "none",
- "trap",
- "yourself",
- "Command"
-};
-
-const char *_commandsNamesRes_ns[] = {
- "set",
- "clear",
- "start",
- "speak",
- "get",
- "location",
- "open",
- "close",
- "on",
- "off",
- "call",
- "toggle",
- "drop",
- "quit",
- "move",
- "stop",
- "endcommands",
- "endzone"
-};
-
-const char *_instructionNamesRes_ns[] = {
- "on",
- "off",
- "x",
- "y",
- "z",
- "f",
- "loop",
- "endloop",
- "show",
- "inc",
- "dec",
- "set",
- "put",
- "call",
- "wait",
- "start",
- "sound",
- "move",
- "endscript"
-};
-
const char *_callableNamesRes_ns[] = {
"Projector",
"HBOff",
@@ -318,160 +244,6 @@ const char *_callableNamesRes_ns[] = {
"TestResult"
};
-const char *_locationStmtRes_ns[] = {
- "endlocation",
- "location",
- "disk",
- "nodes",
- "zone",
- "animation",
- "localflags",
- "commands",
- "acommands",
- "flags",
- "comment",
- "endcomment",
- "sound",
- "music"
-};
-
-const char *_locationZoneStmtRes_ns[] = {
- "limits",
- "moveto",
- "type",
- "commands",
- "label",
- "flags",
- "endzone"
-};
-
-const char *_locationAnimStmtRes_ns[] = {
- "script",
- "commands",
- "type",
- "label",
- "flags",
- "file",
- "position",
- "moveto",
- "endanimation"
-};
-
-const char *_zoneTypeNamesRes_br[] = {
- "examine",
- "door",
- "get",
- "merge",
- "taste",
- "hear",
- "feel",
- "speak",
- "none",
- "trap",
- "you",
- "command",
- "path",
- "box"
-};
-
-const char *_zoneFlagNamesRes_br[] = {
- "closed",
- "active",
- "remove",
- "acting",
- "locked",
- "fixed",
- "noname",
- "nomasked",
- "looping",
- "added",
- "character",
- "nowalk",
- "yourself",
- "scaled",
- "selfuse"
-};
-
-const char *_instructionNamesRes_br[] = {
- "on",
- "off",
- "x",
- "y",
- "z",
- "f",
- "loop",
- "endloop",
- "show",
- "inc",
- "dec",
- "set",
- "put",
- "call",
- "wait",
- "start",
- "process",
- "move",
- "color",
- "sound",
- "mask",
- "print",
- "text",
- "mul",
- "div",
- "if",
- "dummy",
- "dummy",
- "endif",
- "stop",
- "endscript"
-};
-
-const char *_commandsNamesRes_br[] = {
- "set",
- "clear",
- "start",
- "speak",
- "get",
- "location",
- "open",
- "close",
- "on",
- "off",
- "call",
- "toggle",
- "drop",
- "quit",
- "move",
- "stop",
- "character",
- "followme",
- "onmouse",
- "offmouse",
- "add",
- "leave",
- "inc",
- "dec",
- "test",
- "dummy",
- "dummy",
- "let",
- "music",
- "fix",
- "unfix",
- "zeta",
- "scroll",
- "swap",
- "give",
- "text",
- "part",
- "dummy",
- "return",
- "onsave",
- "offsave",
- "endcommands",
- "ifchar",
- "endif"
-};
const char *_callableNamesRes_br[] = {
"blufade",
@@ -482,72 +254,6 @@ const char *_callableNamesRes_br[] = {
"password"
};
-const char *_audioCommandsNamesRes_br[] = {
- "play",
- "stop",
- "pause",
- "channel_level",
- "fadein",
- "fadeout",
- "volume",
- " ",
- "faderate",
- " ",
- " ",
- " ",
- " ",
- " ",
- " ",
- " ",
- "loop"
-};
-
-const char *_locationStmtRes_br[] = {
- "character",
- "endlocation",
- "ifchar",
- "endif",
- "location",
- "mask",
- "path",
- "disk",
- "localflags",
- "commands",
- "escape",
- "acommands",
- "flags",
- "comment",
- "endcomment",
- "zone",
- "animation",
- "zeta",
- "music",
- "sound"
-};
-
-const char *_locationZoneStmtRes_br[] = {
- "endzone",
- "limits",
- "moveto",
- "type",
- "commands",
- "label",
- "flags"
-};
-
-const char *_locationAnimStmtRes_br[] = {
- "endanimation",
- "endzone",
- "script",
- "commands",
- "type",
- "label",
- "flags",
- "file",
- "position",
- "moveto"
-};
-
const char *_dinoName = "dino";
const char *_donnaName = "donna";
const char *_doughName = "dough";
@@ -629,20 +335,13 @@ const Parallaction_br::Callable Parallaction_br::_dosCallables[] = {
void Parallaction_ns::initResources() {
- _zoneFlagNamesRes = _zoneFlagNamesRes_ns;
- _zoneTypeNamesRes = _zoneTypeNamesRes_ns;
- _commandsNamesRes = _commandsNamesRes_ns;
+// _zoneFlagNamesRes = _zoneFlagNamesRes_ns;
+// _zoneTypeNamesRes = _zoneTypeNamesRes_ns;
+// _commandsNamesRes = _commandsNamesRes_ns;
_callableNamesRes = _callableNamesRes_ns;
- _instructionNamesRes = _instructionNamesRes_ns;
+// _instructionNamesRes = _instructionNamesRes_ns;
_callableNames = new Table(ARRAYSIZE(_callableNamesRes_ns), _callableNamesRes_ns);
- _instructionNames = new Table(ARRAYSIZE(_instructionNamesRes_ns), _instructionNamesRes_ns);
- _zoneFlagNames = new Table(ARRAYSIZE(_zoneFlagNamesRes_ns), _zoneFlagNamesRes_ns);
- _zoneTypeNames = new Table(ARRAYSIZE(_zoneTypeNamesRes_ns), _zoneTypeNamesRes_ns);
- _commandsNames = new Table(ARRAYSIZE(_commandsNamesRes_ns), _commandsNamesRes_ns);
- _locationStmt = new Table(ARRAYSIZE(_locationStmtRes_ns), _locationStmtRes_ns);
- _locationZoneStmt = new Table(ARRAYSIZE(_locationZoneStmtRes_ns), _locationZoneStmtRes_ns);
- _locationAnimStmt = new Table(ARRAYSIZE(_locationAnimStmtRes_ns), _locationAnimStmtRes_ns);
_localFlagNames = new FixedTable(NUM_LOCATIONS, 1);
_localFlagNames->addData("visited");
@@ -657,22 +356,14 @@ void Parallaction_ns::initResources() {
void Parallaction_br::initResources() {
- _zoneFlagNamesRes = _zoneFlagNamesRes_br;
- _zoneTypeNamesRes = _zoneTypeNamesRes_br;
- _commandsNamesRes = _commandsNamesRes_br;
+// _zoneFlagNamesRes = _zoneFlagNamesRes_br;
+// _zoneTypeNamesRes = _zoneTypeNamesRes_br;
+// _commandsNamesRes = _commandsNamesRes_br;
_callableNamesRes = _callableNamesRes_br;
- _instructionNamesRes = _instructionNamesRes_br;
- _audioCommandsNamesRes = _audioCommandsNamesRes_br;
+// _instructionNamesRes = _instructionNamesRes_br;
+// _audioCommandsNamesRes = _audioCommandsNamesRes_br;
_callableNames = new Table(ARRAYSIZE(_callableNamesRes_br), _callableNamesRes_br);
- _instructionNames = new Table(ARRAYSIZE(_instructionNamesRes_br), _instructionNamesRes_br);
- _zoneFlagNames = new Table(ARRAYSIZE(_zoneFlagNamesRes_br), _zoneFlagNamesRes_br);
- _zoneTypeNames = new Table(ARRAYSIZE(_zoneTypeNamesRes_br), _zoneTypeNamesRes_br);
- _commandsNames = new Table(ARRAYSIZE(_commandsNamesRes_br), _commandsNamesRes_br);
- _audioCommandsNames = new Table(ARRAYSIZE(_audioCommandsNamesRes_br), _audioCommandsNamesRes_br);
- _locationStmt = new Table(ARRAYSIZE(_locationStmtRes_br), _locationStmtRes_br);
- _locationZoneStmt = new Table(ARRAYSIZE(_locationZoneStmtRes_br), _locationZoneStmtRes_br);
- _locationAnimStmt = new Table(ARRAYSIZE(_locationAnimStmtRes_br), _locationAnimStmtRes_br);
_localFlagNames = new FixedTable(NUM_LOCATIONS, 2);
_localFlagNames->addData("visited");
diff --git a/engines/saga/actor.cpp b/engines/saga/actor.cpp
index 52b921d000..96d901fbba 100644
--- a/engines/saga/actor.cpp
+++ b/engines/saga/actor.cpp
@@ -31,7 +31,6 @@
#include "saga/events.h"
#include "saga/isomap.h"
#include "saga/objectmap.h"
-#include "saga/sagaresnames.h"
#include "saga/rscfile.h"
#include "saga/script.h"
#include "saga/sndres.h"
@@ -997,7 +996,7 @@ void Actor::createDrawOrderList() {
}
bool Actor::getSpriteParams(CommonObjectData *commonObjectData, int &frameNumber, SpriteList *&spriteList) {
- if (_vm->_scene->currentSceneResourceId() == RID_ITE_OVERMAP_SCENE) {
+ if (_vm->_scene->currentSceneResourceId() == ITE_SCENE_OVERMAP) {
if (!(commonObjectData->_flags & kProtagonist)){
// warning("not protagonist");
return false;
diff --git a/engines/saga/actor_walk.cpp b/engines/saga/actor_walk.cpp
index 0c573c0c40..d62c1c61d7 100644
--- a/engines/saga/actor_walk.cpp
+++ b/engines/saga/actor_walk.cpp
@@ -30,7 +30,6 @@
#include "saga/events.h"
#include "saga/isomap.h"
#include "saga/objectmap.h"
-#include "saga/sagaresnames.h"
#include "saga/script.h"
#include "saga/sound.h"
#include "saga/scene.h"
@@ -209,7 +208,7 @@ void Actor::updateActorsScene(int actorsEntrance) {
actor->_finalTarget = actor->_location;
_centerActor = _protagonist = actor;
} else if (_vm->getGameType() == GType_ITE &&
- _vm->_scene->currentSceneResourceId() == RID_ITE_OVERMAP_SCENE) {
+ _vm->_scene->currentSceneResourceId() == ITE_SCENE_OVERMAP) {
continue;
}
@@ -416,7 +415,7 @@ void Actor::handleActions(int msec, bool setup) {
speed = 4;
}
- if (_vm->_scene->currentSceneResourceId() == RID_ITE_OVERMAP_SCENE) {
+ if (_vm->_scene->currentSceneResourceId() == ITE_SCENE_OVERMAP) {
speed = 2;
}
diff --git a/engines/saga/detection.cpp b/engines/saga/detection.cpp
index b7d2a3aa39..9c897d8ebc 100644
--- a/engines/saga/detection.cpp
+++ b/engines/saga/detection.cpp
@@ -36,7 +36,6 @@
#include "saga/rscfile.h"
#include "saga/interface.h"
#include "saga/scene.h"
-#include "saga/sagaresnames.h"
namespace Saga {
struct SAGAGameDescription {
@@ -55,18 +54,15 @@ struct SAGAGameDescription {
const GamePatchDescription *patchDescriptions;
};
-const bool SagaEngine::isBigEndian() const { return (_gameDescription->features & GF_BIG_ENDIAN_DATA) != 0; }
-const bool SagaEngine::isMacResources() const { return (getPlatform() == Common::kPlatformMacintosh); }
+bool SagaEngine::isBigEndian() const { return (_gameDescription->features & GF_BIG_ENDIAN_DATA) != 0; }
+bool SagaEngine::isMacResources() const { return (getPlatform() == Common::kPlatformMacintosh); }
const GameResourceDescription *SagaEngine::getResourceDescription() { return _gameDescription->resourceDescription; }
const GameSoundInfo *SagaEngine::getVoiceInfo() const { return _gameDescription->voiceInfo; }
const GameSoundInfo *SagaEngine::getSfxInfo() const { return _gameDescription->sfxInfo; }
const GameSoundInfo *SagaEngine::getMusicInfo() const {
static GameSoundInfo musicInfo;
musicInfo.resourceType = kSoundPCM;
- musicInfo.frequency = 11025;
musicInfo.sampleBits = 16;
- // The digital music in the ITE Mac demo version is not stereo
- musicInfo.stereo = _gameDescription->gameType == GID_ITE_MACDEMO2 ? false : true;
musicInfo.isBigEndian = false;
musicInfo.isSigned = true;
diff --git a/engines/saga/detection_tables.h b/engines/saga/detection_tables.h
index 0017f34957..cbc3152f70 100644
--- a/engines/saga/detection_tables.h
+++ b/engines/saga/detection_tables.h
@@ -28,71 +28,81 @@
namespace Saga {
static const GameResourceDescription ITE_Resources = {
- RID_ITE_SCENE_LUT, // Scene lookup table RN
- RID_ITE_SCRIPT_LUT, // Script lookup table RN
- RID_ITE_MAIN_PANEL,
- RID_ITE_CONVERSE_PANEL,
- RID_ITE_OPTION_PANEL,
- 0, // Warning panel (IHNM only)
- 0, // Warning panel sprites (IHNM only)
- RID_ITE_MAIN_SPRITES,
- RID_ITE_MAIN_PANEL_SPRITES,
- 0, // Option panel sprites (IHNM only)
- RID_ITE_DEFAULT_PORTRAITS,
- 0, // Psychic profile background (IHNM only)
- RID_ITE_MAIN_STRINGS,
- RID_ITE_ACTOR_NAMES
+ 1806, // Scene lookup table RN
+ 216, // Script lookup table RN
+ 3, // Main panel
+ 4, // Converse panel
+ 5, // Option panel
+ 6, // Main sprites
+ 7, // Main panel sprites
+ 35, // Main strings
+ // ITE specific resources
+ 36, // Actor names
+ 125, // Default portraits
+ // IHNM specific resources
+ 0, // Option panel sprites
+ 0, // Warning panel
+ 0, // Warning panel sprites
+ 0 // Psychic profile background
};
+// FIXME: Option panel should be 4 but it is an empty resource.
+// Proper fix would be to not load the options panel when the demo is running
static const GameResourceDescription ITEDemo_Resources = {
- RID_ITEDEMO_SCENE_LUT, // Scene lookup table RN
- RID_ITEDEMO_SCRIPT_LUT, // Script lookup table RN
- RID_ITEDEMO_MAIN_PANEL,
- RID_ITEDEMO_CONVERSE_PANEL,
- RID_ITEDEMO_OPTION_PANEL,
- 0, // Warning panel (IHNM only)
- 0, // Warning panel sprites (IHNM only)
- RID_ITEDEMO_MAIN_SPRITES,
- RID_ITEDEMO_MAIN_PANEL_SPRITES,
- 0, // Option panel sprites (IHNM only)
- RID_ITEDEMO_DEFAULT_PORTRAITS,
- 0, // Psychic profile background (IHNM only)
- RID_ITEDEMO_MAIN_STRINGS,
- RID_ITEDEMO_ACTOR_NAMES
+ 318, // Scene lookup table RN
+ 146, // Script lookup table RN
+ 2, // Main panel
+ 3, // Converse panel
+ 3, // Option panel
+ 5, // Main sprites
+ 6, // Main panel sprites
+ 8, // Main strings
+ // ITE specific resources
+ 9, // Actor names
+ 80, // Default portraits
+ // IHNM specific resources
+ 0, // Option panel sprites
+ 0, // Warning panel
+ 0, // Warning panel sprites
+ 0 // Psychic profile background
};
static const GameResourceDescription IHNM_Resources = {
- RID_IHNM_SCENE_LUT, // Scene lookup table RN
- RID_IHNM_SCRIPT_LUT, // Script lookup table RN
- RID_IHNM_MAIN_PANEL,
- RID_IHNM_CONVERSE_PANEL,
- RID_IHNM_OPTION_PANEL,
- RID_IHNM_WARNING_PANEL,
- RID_IHNM_WARNING_PANEL_SPRITES,
- RID_IHNM_MAIN_SPRITES,
- RID_IHNM_MAIN_PANEL_SPRITES,
- RID_IHNM_OPTION_PANEL_SPRITES,
- 0, // Default portraits (ITE only)
- RID_IHNM_PROFILE_BG,
- RID_IHNM_MAIN_STRINGS,
- 0 // Actors strings (ITE only)
+ 1272, // Scene lookup table RN
+ 29, // Script lookup table RN
+ 9, // Main panel
+ 10, // Converse panel
+ 15, // Option panel
+ 12, // Main sprites
+ 12, // Main panel sprites
+ 21, // Main strings
+ // ITE specific resources
+ 0, // Actor names
+ 0, // Default portraits
+ // IHNM specific resources
+ 16, // Option panel sprites
+ 17, // Warning panel
+ 18, // Warning panel sprites
+ 20 // Psychic profile background
};
static const GameResourceDescription IHNMDEMO_Resources = {
- RID_IHNMDEMO_SCENE_LUT, // Scene lookup table RN
- RID_IHNMDEMO_SCRIPT_LUT, // Script lookup table RN
- RID_IHNMDEMO_MAIN_PANEL,
- RID_IHNMDEMO_CONVERSE_PANEL,
- RID_IHNMDEMO_OPTION_PANEL,
- RID_IHNMDEMO_WARNING_PANEL,
- RID_IHNMDEMO_WARNING_PANEL_SPRITES,
- RID_IHNMDEMO_MAIN_SPRITES,
- RID_IHNMDEMO_MAIN_PANEL_SPRITES,
- RID_IHNMDEMO_OPTION_PANEL_SPRITES,
- 0, // Default portraits (ITE only)
- RID_IHNMDEMO_PROFILE_BG,
- RID_IHNMDEMO_MAIN_STRINGS,
- 0 // Actors strings (ITE only)
+ 286, // Scene lookup table RN
+ 18, // Script lookup table RN
+ 5, // Main panel
+ 6, // Converse panel
+ 10, // Option panel
+ 7, // Main sprites
+ 7, // Main panel sprites
+ 16, // Main strings
+ // ITE specific resources
+ 0, // Actor names
+ 0, // Default portraits
+ // IHNM specific resources
+ 11, // Option panel sprites
+ 12, // Warning panel
+ 13, // Warning panel sprites
+ 15 // Psychic profile background
};
static const GameFontDescription ITEDEMO_GameFonts[] = { {0}, {1} };
@@ -102,14 +112,14 @@ static const GameFontDescription IHNMDEMO_GameFonts[] = { {2}, {3}, {4} };
// Font 6 is kIHNMFont8, font 8 is kIHNMMainFont
static const GameFontDescription IHNMCD_GameFonts[] = { {2}, {3}, {4}, {5}, {6}, {7}, {8} };
-// frequency, sampleBits, stereo, isBigEndian, isSigned
-static const GameSoundInfo ITEPC_GameSound = { kSoundPCM, 22050, 16, false, false, true };
-static const GameSoundInfo ITEWINDEMO1_GameSound = { kSoundPCM, 22050, 8, false, false, false };
-static const GameSoundInfo ITEMACCD_G_GameSound = { kSoundMacPCM, 22050, 8, false, false, false };
-static const GameSoundInfo ITEDISK_GameSound = { kSoundVOC, -1, -1, false, false, true };
-static const GameSoundInfo ITEDEMO_GameVoice = { kSoundVOX, 22050, 16, false, false, true };
-static const GameSoundInfo IHNM_GameSound = { kSoundWAV, -1, -1, false, false, true };
-static const GameSoundInfo MAC_GameSound = { kSoundPCM, 22050, 16, false, true, true };
+// sampleBits, isBigEndian, isSigned
+static const GameSoundInfo ITEPC_GameSound = { kSoundPCM, 16, false, true };
+static const GameSoundInfo ITEWINDEMO1_GameSound = { kSoundPCM, 8, false, false };
+static const GameSoundInfo ITEMACCD_G_GameSound = { kSoundMacPCM, 8, false, false };
+static const GameSoundInfo ITEDISK_GameSound = { kSoundVOC, -1, false, true };
+static const GameSoundInfo ITEDEMO_GameVoice = { kSoundVOX, 16, false, true };
+static const GameSoundInfo IHNM_GameSound = { kSoundWAV, -1, false, true };
+static const GameSoundInfo MAC_GameSound = { kSoundPCM, 16, true, true };
// Patch files. Files not found will be ignored
static const GamePatchDescription ITEPatch_Files[] = {
diff --git a/engines/saga/gfx.cpp b/engines/saga/gfx.cpp
index d1f592e38b..85416991db 100644
--- a/engines/saga/gfx.cpp
+++ b/engines/saga/gfx.cpp
@@ -28,7 +28,6 @@
#include "saga/saga.h"
#include "saga/gfx.h"
#include "saga/interface.h"
-#include "saga/sagaresnames.h"
#include "saga/rscfile.h"
#include "saga/scene.h"
@@ -37,6 +36,9 @@
namespace Saga {
+#define RID_IHNM_DEFAULT_PALETTE 1
+#define RID_IHNM_HOURGLASS_CURSOR 11 // not in demo
+
Gfx::Gfx(SagaEngine *vm, OSystem *system, int width, int height) : _vm(vm), _system(system) {
_system->beginGFXTransaction();
_vm->initCommonGFX(width > 320);
diff --git a/engines/saga/interface.cpp b/engines/saga/interface.cpp
index ef31b85156..7380570a99 100644
--- a/engines/saga/interface.cpp
+++ b/engines/saga/interface.cpp
@@ -43,7 +43,6 @@
#include "saga/sound.h"
#include "saga/sprite.h"
#include "saga/rscfile.h"
-#include "saga/sagaresnames.h"
#include "saga/interface.h"
@@ -327,6 +326,9 @@ Interface::Interface(SagaEngine *vm) : _vm(vm) {
_statusTextInputState = kStatusTextInputFirstRun;
_disableAbortSpeeches = false;
+
+ // set save game reminder alarm
+ _vm->_timer->installTimerProc(&saveReminderCallback, TIMETOSAVE, this);
}
Interface::~Interface(void) {
@@ -337,6 +339,22 @@ Interface::~Interface(void) {
_scenePortraits.freeMem();
}
+void Interface::saveReminderCallback(void *refCon) {
+ ((Interface *)refCon)->updateSaveReminder();
+}
+
+void Interface::updateSaveReminder() {
+ // TODO: finish this
+ /*
+ if (_active && _panelMode == kPanelMain) {
+ _vm->_timer->removeTimerProc(&saveReminderCallback);
+ _saveReminderState = (_saveReminderState == 0) ? 1 : 0;
+ drawStatusBar();
+ _vm->_timer->installTimerProc(&saveReminderCallback, TIMETOSAVE, this);
+ }
+ */
+}
+
int Interface::activate() {
if (!_active) {
_active = true;
@@ -477,9 +495,9 @@ void Interface::setMode(int mode) {
bool Interface::processAscii(Common::KeyState keystate) {
// TODO: Checking for Esc and Enter below is a bit hackish, and
- // and probably only works with the English version. Maybe we should
- // add a flag to the button so it can indicate if it's the default or
- // cancel button?
+ // probably only works with the English version. Maybe we should
+ // add a flag to the button so it can indicate if it's the default
+ // or cancel button?
uint16 ascii = keystate.ascii;
int i;
PanelButton *panelButton;
@@ -2755,7 +2773,7 @@ void Interface::mapPanelDrawCrossHair() {
if (screen.contains(mapPosition)) {
_vm->_sprite->draw(backBuffer, _vm->getDisplayClip(), _vm->_sprite->_mainSprites,
- _mapPanelCrossHairState? RID_ITE_SPR_XHAIR1 : RID_ITE_SPR_XHAIR2,
+ _mapPanelCrossHairState? RID_ITE_SPR_CROSSHAIR : RID_ITE_SPR_CROSSHAIR + 1,
mapPosition, 256);
}
}
diff --git a/engines/saga/interface.h b/engines/saga/interface.h
index af59fe64d2..2091c9f071 100644
--- a/engines/saga/interface.h
+++ b/engines/saga/interface.h
@@ -56,6 +56,12 @@ enum InterfaceUpdateFlags {
#define STATUS_TEXT_LEN 128
#define STATUS_TEXT_INPUT_MAX 256
+#define RID_IHNM_BOSS_SCREEN 19 // not in demo
+#define RID_ITE_TYCHO_MAP 1686
+#define RID_ITE_SPR_CROSSHAIR (73 + 9)
+#define TIMETOSAVE (kScriptTimeTicksPerSecond * 1000 * 60 * 30)
+#define TIMETOBLINK (kScriptTimeTicksPerSecond * 1000 * 1)
+
// Converse-specific stuff
enum PanelModes {
@@ -233,6 +239,9 @@ public:
void disableAbortSpeeches(bool d) { _disableAbortSpeeches = d; }
+ static void saveReminderCallback(void *refCon);
+ void updateSaveReminder();
+
bool _textInput;
bool _statusTextInput;
diff --git a/engines/saga/ihnm_introproc.cpp b/engines/saga/introproc_ihnm.cpp
index 5f1d0157d5..5f1d0157d5 100644
--- a/engines/saga/ihnm_introproc.cpp
+++ b/engines/saga/introproc_ihnm.cpp
diff --git a/engines/saga/ite_introproc.cpp b/engines/saga/introproc_ite.cpp
index 2aa263b097..a33a55c375 100644
--- a/engines/saga/ite_introproc.cpp
+++ b/engines/saga/introproc_ite.cpp
@@ -36,7 +36,6 @@
#include "saga/music.h"
#include "saga/scene.h"
-#include "saga/sagaresnames.h"
#include "saga/rscfile.h"
namespace Saga {
@@ -46,6 +45,21 @@ using Common::EN_ANY;
using Common::DE_DEU;
using Common::IT_ITA;
+// Intro scenes
+#define RID_ITE_INTRO_ANIM_SCENE 1538
+#define RID_ITE_CAVE_SCENE_1 1542
+#define RID_ITE_CAVE_SCENE_2 1545
+#define RID_ITE_CAVE_SCENE_3 1548
+#define RID_ITE_CAVE_SCENE_4 1551
+#define RID_ITE_VALLEY_SCENE 1556
+#define RID_ITE_TREEHOUSE_SCENE 1560
+#define RID_ITE_FAIREPATH_SCENE 1564
+#define RID_ITE_FAIRETENT_SCENE 1567
+
+// ITE intro music
+#define MUSIC_1 9
+#define MUSIC_2 10
+
LoadSceneParams ITE_IntroList[] = {
{RID_ITE_INTRO_ANIM_SCENE, kLoadByResourceId, NULL, Scene::SC_ITEIntroAnimProc, false, kTransitionNoFade, 0, NO_CHAPTER_CHANGE},
{RID_ITE_CAVE_SCENE_1, kLoadByResourceId, NULL, Scene::SC_ITEIntroCave1Proc, false, kTransitionFade, 0, NO_CHAPTER_CHANGE},
@@ -380,63 +394,65 @@ int Scene::ITEIntroCave1Proc(int param) {
static const IntroDialogue dialogue[][4] = {
{ { // English
- RID_CAVE_VOICE_0,
+ 0, // cave voice 0
"We see the sky, we see the land, we see the water, "
"and we wonder: Are we the only ones?"
},
{
- RID_CAVE_VOICE_1,
+ 1, // cave voice 1
"Long before we came to exist, the humans ruled the "
"Earth."
},
{
- RID_CAVE_VOICE_2,
+ 2, // cave voice 2
"They made marvelous things, and moved whole "
"mountains."
},
{
- RID_CAVE_VOICE_3,
+ 3, // cave voice 3
"They knew the Secret of Flight, the Secret of "
"Happiness, and other secrets beyond our imagining."
} },
+ // -----------------------------------------------------
{ { // German
- RID_CAVE_VOICE_0,
+ 0, // cave voice 0
"Um uns sind der Himmel, das Land und die Seen; und "
"wir fragen uns - sind wir die einzigen?"
},
{
- RID_CAVE_VOICE_1,
+ 1, // cave voice 1
"Lange vor unserer Zeit herrschten die Menschen "
"\201ber die Erde."
},
{
- RID_CAVE_VOICE_2,
+ 2, // cave voice 2
"Sie taten wundersame Dinge und versetzten ganze "
"Berge."
},
{
- RID_CAVE_VOICE_3,
+ 3, // cave voice 3
"Sie kannten das Geheimnis des Fluges, das Geheimnis "
"der Fr\224hlichkeit und andere Geheimnisse, die "
"unsere Vorstellungskraft \201bersteigen."
} },
+ // -----------------------------------------------------
{ { // Italian fan translation
- RID_CAVE_VOICE_0,
+ 0, // cave voice 0
"Guardiamo il cielo, guardiamo la terra, guardiamo "
"l'acqua, e ci chiediamo: Siamo forse soli?"
},
{
- RID_CAVE_VOICE_1,
+ 1, // cave voice 1
"Molto tempo prima che noi esistessimo, gli Umani "
"dominavano la terra."
},
{
- RID_CAVE_VOICE_2,
+ 2, // cave voice 2
"Fecero cose meravigliose, e mossero intere "
"montagne."
},
{
- RID_CAVE_VOICE_3,
+ 3, // cave voice 3
"Conoscevano il Segreto del Volo, il Segreto della "
"Felicit\224, ed altri segreti oltre ogni nostra "
"immaginazione."
@@ -493,47 +509,49 @@ int Scene::ITEIntroCave2Proc(int param) {
static const IntroDialogue dialogue[][3] = {
{ { // English
- RID_CAVE_VOICE_4,
+ 4, // cave voice 4
"The humans also knew the Secret of Life, and they "
"used it to give us the Four Great Gifts:"
},
{
- RID_CAVE_VOICE_5,
+ 5, // cave voice 5
"Thinking minds, feeling hearts, speaking mouths, and "
"reaching hands."
},
{
- RID_CAVE_VOICE_6,
+ 6, // cave voice 6
"We are their children."
} },
+ // -----------------------------------------------------
{ { // German
- RID_CAVE_VOICE_4,
+ 4, // cave voice 4
"Au$erdem kannten die Menschen das Geheimnis des "
"Lebens. Und sie nutzten es, um uns die vier gro$en "
"Geschenke zu geben -"
},
{
- RID_CAVE_VOICE_5,
+ 5, // cave voice 5
"den denkenden Geist, das f\201hlende Herz, den "
"sprechenden Mund und die greifende Hand."
},
{
- RID_CAVE_VOICE_6,
+ 6, // cave voice 6
"Wir sind ihre Kinder."
} },
+ // -----------------------------------------------------
{ { // Italian fan translation
- RID_CAVE_VOICE_4,
+ 4, // cave voice 4
"Gli Umani conoscevano anche il Segreto della Vita, "
"e lo usarono per darci i Quattro Grandi Doni:"
},
{
- RID_CAVE_VOICE_5,
+ 5, // cave voice 5
"Il pensiero, le emozioni, la parola e la manualit\224."
},
{
- RID_CAVE_VOICE_6,
+ 6, // cave voice 6
"Siamo i loro figli."
} }
};
@@ -595,46 +613,48 @@ int Scene::ITEIntroCave3Proc(int param) {
static const IntroDialogue dialogue[][3] = {
{ { // English
- RID_CAVE_VOICE_7,
+ 7, // cave voice 7
"They taught us how to use our hands, and how to "
"speak."
},
{
- RID_CAVE_VOICE_8,
+ 8, // cave voice 8
"They showed us the joy of using our minds."
},
{
- RID_CAVE_VOICE_9,
+ 9, // cave voice 9
"They loved us, and when we were ready, they surely "
"would have given us the Secret of Happiness."
} },
+ // -----------------------------------------------------
{ { // German
- RID_CAVE_VOICE_7,
+ 7, // cave voice 7
"Sie lehrten uns zu sprechen und unsere H\204nde zu "
"benutzen."
},
{
- RID_CAVE_VOICE_8,
+ 8, // cave voice 8
"Sie zeigten uns die Freude am Denken."
},
{
- RID_CAVE_VOICE_9,
+ 9, // cave voice 9
"Sie liebten uns, und w\204ren wir bereit gewesen, "
"h\204tten sie uns sicherlich das Geheimnis der "
"Fr\224hlichkeit offenbart."
} },
+ // -----------------------------------------------------
{ { // Italian fan translation
- RID_CAVE_VOICE_7,
+ 7, // cave voice 7
"Ci insegnarono come usare le mani e come parlare. "
},
{
- RID_CAVE_VOICE_8,
+ 8, // cave voice 8
"Ci mostrarono le gioie che l'uso della mente "
"pu\242 dare. "
},
{
- RID_CAVE_VOICE_9,
+ 9, // cave voice 9
"Ci amarono, ed una volta pronti, ci avrebbero "
"sicuramente svelato il Segreto della Felicit\224."
@@ -698,60 +718,62 @@ int Scene::ITEIntroCave4Proc(int param) {
static const IntroDialogue dialogue[][4] = {
{ { // English
- RID_CAVE_VOICE_10,
+ 10, // cave voice 10
"And now we see the sky, the land, and the water that "
"we are heirs to, and we wonder: why did they leave?"
},
{
- RID_CAVE_VOICE_11,
+ 11, // cave voice 11
"Do they live still, in the stars? In the oceans "
"depths? In the wind?"
},
{
- RID_CAVE_VOICE_12,
+ 12, // cave voice 12
"We wonder, was their fate good or evil?"
},
{
- RID_CAVE_VOICE_13,
+ 13, // cave voice 13
"And will we also share the same fate one day?"
} },
+ // -----------------------------------------------------
{ { // German
- RID_CAVE_VOICE_10,
+ 10, // cave voice 10
"Und nun sehen wir den Himmel, das Land und die "
"Seen - unser Erbe. Und wir fragen uns - warum "
"verschwanden sie?"
},
{
- RID_CAVE_VOICE_11,
+ 11, // cave voice 11
"Leben sie noch in den Sternen? In den Tiefen des "
"Ozeans? Im Wind?"
},
{
- RID_CAVE_VOICE_12,
+ 12, // cave voice 12
"Wir fragen uns - war ihr Schicksal gut oder b\224se?"
},
{
- RID_CAVE_VOICE_13,
+ 13, // cave voice 13
"Und wird uns eines Tages das gleiche Schicksal "
"ereilen?"
} },
+ // -----------------------------------------------------
{ { // Italian fan translation
- RID_CAVE_VOICE_10,
+ 10, // cave voice 10
"Ed ora che guardiamo il cielo, la terra e l'acqua "
"che abbiamo ereditato, pensiamo: Perch\233 partirono?"
},
{
- RID_CAVE_VOICE_11,
+ 11, // cave voice 11
"Vivono ancora, nelle stelle? Nelle profondit\224 "
"dell'oceano? Nel vento?"
},
{
- RID_CAVE_VOICE_12,
+ 12, // cave voice 12
"Ci domandiamo, il loro destino fu felice o nefasto?"
},
{
- RID_CAVE_VOICE_13,
+ 13, // cave voice 13
"E un giorno, condivideremo anche noi lo stesso "
"destino?"
} }
diff --git a/engines/saga/isomap.cpp b/engines/saga/isomap.cpp
index 7a6d6a4398..e607adb4cb 100644
--- a/engines/saga/isomap.cpp
+++ b/engines/saga/isomap.cpp
@@ -27,7 +27,6 @@
#include "saga/saga.h"
#include "saga/gfx.h"
-#include "saga/sagaresnames.h"
#include "saga/scene.h"
#include "saga/isomap.h"
@@ -285,7 +284,7 @@ void IsoMap::adjustScroll(bool jump) {
tileCoordsToScreenPoint(_vm->_actor->_centerActor->_location, playerPoint);
- if (_vm->_scene->currentSceneResourceId() == RID_ITE_OVERMAP_SCENE) {
+ if (_vm->_scene->currentSceneResourceId() == ITE_SCENE_OVERMAP) {
_mapPosition.x = (playerPoint.x + _viewScroll.x) * 30 / 100 - (381);
_mapPosition.y = (playerPoint.y + _viewScroll.y) * 30 / 100 - (342);
}
@@ -322,7 +321,7 @@ void IsoMap::adjustScroll(bool jump) {
_viewScroll.x = smoothSlide( _viewScroll.x, minScrollPos.x, maxScrollPos.x );
}
- if (_vm->_scene->currentSceneResourceId() == RID_ITE_OVERMAP_SCENE) {
+ if (_vm->_scene->currentSceneResourceId() == ITE_SCENE_OVERMAP) {
ObjectData *obj;
uint16 objectId;
objectId = _vm->_actor->objIndexToId(ITE_OBJ_MAP);
@@ -1510,7 +1509,7 @@ void IsoMap::findTilePath(ActorData* actor, const Location &start, const Locatio
memset( &_searchArray, 0, sizeof(_searchArray));
if (!(actor->_actorFlags & kActorNoCollide) &&
- (_vm->_scene->currentSceneResourceId() != RID_ITE_OVERMAP_SCENE)) {
+ (_vm->_scene->currentSceneResourceId() != ITE_SCENE_OVERMAP)) {
for (i = 0; i < _vm->_actor->_actorsCount; i++) {
other = _vm->_actor->_actors[i];
if (!other->_inScene) continue;
@@ -1664,7 +1663,7 @@ void IsoMap::screenPointToTileCoords(const Point &position, Location &location)
Point mPos(position);
int x,y;
- if (_vm->_scene->currentSceneResourceId() == RID_ITE_OVERMAP_SCENE){
+ if (_vm->_scene->currentSceneResourceId() == ITE_SCENE_OVERMAP){
if (mPos.y < 16) {
mPos.y = 16;
}
diff --git a/engines/saga/isomap.h b/engines/saga/isomap.h
index c79ae7cd0a..eb548ce5dc 100644
--- a/engines/saga/isomap.h
+++ b/engines/saga/isomap.h
@@ -32,6 +32,8 @@
namespace Saga {
+#define ITE_OBJ_MAP 14
+
#define SAGA_ISOTILEDATA_LEN 8
#define SAGA_ISOTILE_WIDTH 32
#define SAGA_ISOTILE_BASEHEIGHT 15
diff --git a/engines/saga/itedata.cpp b/engines/saga/itedata.cpp
index 1274f72b45..43c3d21012 100644
--- a/engines/saga/itedata.cpp
+++ b/engines/saga/itedata.cpp
@@ -26,7 +26,6 @@
// Actor and Object data tables
#include "saga/saga.h"
#include "saga/itedata.h"
-#include "saga/sagaresnames.h"
#include "saga/sndres.h"
namespace Saga {
@@ -245,7 +244,7 @@ ObjectTableData ITE_ObjectTable[ITE_OBJECTCOUNT] = {
{ 23, 0, 480, 480, 0, 24, 23, 0 }, // Silver Medallion
{ 24, 0, 480, 480, 0, 25, 24, 0 }, // Mud in Fur
{ 25, 0, 480, 480, 0, 26, 25, 0 }, // Gold Ring
- { 27, 13, 1036, 572, 40, 47, 14, kObjUseWith }, // Screwdriver
+ { 27, 13, 1036, 572, 40, 47, 14, kObjUseWith }, // Screwdriver
{ 28, 0, 480, 480, 0, 29, 26, 0 }, // Apple Token
{ 29, 0, 480, 480, 0, 30, 22, kObjUseWith }, // Letter from Elara
{ 30, 0, 164, 440, 0, 31, 16, kObjUseWith }, // Spoon
@@ -258,82 +257,86 @@ ObjectTableData ITE_ObjectTable[ITE_OBJECTCOUNT] = {
{ 40, 269, 644, 416, 0, 41, 39, kObjNotFlat }, // Electrical Cable
{ 41, 12, 280, 516, 0, 43, 17, kObjUseWith }, // Piece of flint
{ 42, 5, 876, 332, 32, 65, 18, 0 }, // Rat Cloak
- { 43, 52, 556, 1612, 0, 49, 28, kObjUseWith | kObjNotFlat }, // Bucket
+ { 43, 52, 556, 1612, 0, 49, 28, kObjUseWith |
+ kObjNotFlat }, // Bucket
{ 48, 52, 732, 948, 0, 50, 27, kObjUseWith }, // Cup
{ 49, 52, 520, 1872, 0, 53, 29, 0 }, // Fertilizer
{ 50, 52, 1012, 1268, 0, 52, 30, 0 }, // Feeder
- { 51, 252, -20, -20, 0, 71, 32, kObjUseWith | kObjNotFlat }, // Bowl in jail cell
+ { 51, 252, -20, -20, 0, 71, 32, kObjUseWith |
+ kObjNotFlat }, // Bowl in jail cell
{ 53, 252, 1148, 388, 0, 70, 33, 0 }, // Loose stone block in jail cell
{ 26, 12, 496, 368, 0, 76, 31, 0 }, // Coil of Rope from Quarry
{ 54, 281, 620, 352, 0, 80, 46, 0 } // Orb of Storms in Dam Lab
};
FxTable ITE_SfxTable[ITE_SFXCOUNT] = {
- { FX_DOOR_OPEN, 127 },
- { FX_DOOR_CLOSE, 127 },
- { FX_RUSH_WATER, 63 }, // Floppy volume: 127
- { FX_RUSH_WATER, 26 }, // Floppy volume: 40
- { FX_CRICKET, 64 },
- { FX_PORTICULLIS, 84 }, // Floppy volume: 127
- { FX_CLOCK_1, 64 },
- { FX_CLOCK_2, 64 },
- { FX_DAM_MACHINE, 64 },
- { FX_DAM_MACHINE, 40 },
- { FX_HUM1, 64 },
- { FX_HUM2, 64 },
- { FX_HUM3, 64 },
- { FX_HUM4, 64 },
- { FX_WATER_LOOP_S, 32 }, // Floppy volume: 64
- { FX_SURF, 42 }, // Floppy volume: 127
- { FX_SURF, 32 }, // Floppy volume: 64
- { FX_FIRELOOP, 64 }, // Floppy volume: 96
- { FX_SCRAPING, 84 }, // Floppy volume: 127
- { FX_BEE_SWARM, 64 }, // Floppy volume: 96
- { FX_BEE_SWARM, 26 }, // Floppy volume: 40
- { FX_SQUEAKBOARD, 64 },
- { FX_KNOCK, 127 },
- { FX_COINS, 32 }, // Floppy volume: 48
- { FX_STORM, 84 }, // Floppy volume: 127
- { FX_DOOR_CLOSE_2, 84 }, // Floppy volume: 127
- { FX_ARCWELD, 84 }, // Floppy volume: 127
- { FX_RETRACT_ORB, 127 },
- { FX_DRAGON, 127 },
- { FX_SNORES, 127 },
- { FX_SPLASH, 127 },
- { FX_LOBBY_DOOR, 127 },
- { FX_CHIRP_LOOP, 26 }, // Floppy volume: 40
- { FX_DOOR_CREAK, 96 },
- { FX_SPOON_DIG, 64 },
- { FX_CROW, 96 },
- { FX_COLDWIND, 42 }, // Floppy volume: 64
- { FX_TOOL_SND_1, 96 },
- { FX_TOOL_SND_2, 127 },
- { FX_TOOL_SND_3, 64 },
- { FX_DOOR_METAL, 96 },
- { FX_WATER_LOOP_S, 32 },
- { FX_WATER_LOOP_L, 32 }, // Floppy volume: 64
- { FX_DOOR_OPEN_2, 127 },
- { FX_JAIL_DOOR, 64 },
- { FX_KILN_FIRE, 53 }, // Floppy volume: 80
-
- // Only in the CD version
- { FX_CROWD_01, 64 },
- { FX_CROWD_02, 64 },
- { FX_CROWD_03, 64 },
- { FX_CROWD_04, 64 },
- { FX_CROWD_05, 64 },
- { FX_CROWD_06, 64 },
- { FX_CROWD_07, 64 },
- { FX_CROWD_08, 64 },
- { FX_CROWD_09, 64 },
- { FX_CROWD_10, 64 },
- { FX_CROWD_11, 64 },
- { FX_CROWD_12, 64 },
- { FX_CROWD_13, 64 },
- { FX_CROWD_14, 64 },
- { FX_CROWD_15, 64 },
- { FX_CROWD_16, 64 },
- { FX_CROWD_17, 64 }
+ { 14, 127 }, // Door open
+ { 15, 127 }, // Door close
+ { 16, 63 }, // Rush water (floppy volume: 127)
+ { 16, 26 }, // Rush water (floppy volume: 40)
+ { 17, 64 }, // Cricket
+ { 18, 84 }, // Porticullis (floppy volume: 127)
+ { 19, 64 }, // Clock 1
+ { 20, 64 }, // Clock 2
+ { 21, 64 }, // Dam machine
+ { 21, 40 }, // Dam machine
+ { 22, 64 }, // Hum 1
+ { 23, 64 }, // Hum 2
+ { 24, 64 }, // Hum 3
+ { 25, 64 }, // Hum 4
+ // Note: the following effect was set to 51 for
+ // some unknown reason
+ { 26, 32 }, // Stream
+ { 27, 42 }, // Surf (floppy volume: 127)
+ { 27, 32 }, // Surf (floppy volume: 64)
+ { 28, 64 }, // Fire loop (floppy volume: 96)
+ { 29, 84 }, // Scraping (floppy volume: 127)
+ { 30, 64 }, // Bee swarm (floppy volume: 96)
+ { 30, 26 }, // Bee swarm (floppy volume: 40)
+ { 31, 64 }, // Squeaky board
+ { 32, 127 }, // Knock
+ { 33, 32 }, // Coins (floppy volume: 48)
+ { 34, 84 }, // Storm (floppy volume: 127)
+ { 35, 84 }, // Door close 2 (floppy volume: 127)
+ { 36, 84 }, // Arcweld (floppy volume: 127)
+ { 37, 127 }, // Retract orb
+ { 38, 127 }, // Dragon
+ { 39, 127 }, // Snores
+ { 40, 127 }, // Splash
+ { 41, 127 }, // Lobby door
+ { 42, 26 }, // Chirp loop (floppy volume: 40)
+ { 43, 96 }, // Door creak
+ { 44, 64 }, // Spoon dig
+ { 45, 96 }, // Crow
+ { 46, 42 }, // Cold wind (floppy volume: 64)
+ { 47, 96 }, // Tool sound 1
+ { 48, 127 }, // Tool sound 2
+ { 49, 64 }, // Tool sound 3
+ { 50, 96 }, // Metal door
+ { 51, 32 }, // Water loop S
+ { 52, 32 }, // Water loop L (floppy volume: 64)
+ { 53, 127 }, // Door open 2
+ { 54, 64 }, // Jail door
+ { 55, 53 }, // Killing fire (floppy volume: 80)
+ //{ 56, 0 }, // Dummy FX
+ // Crowd effects, which exist only in the CD version
+ { 57, 64 },
+ { 58, 64 },
+ { 59, 64 },
+ { 60, 64 },
+ { 61, 64 },
+ { 62, 64 },
+ { 63, 64 },
+ { 64, 64 },
+ { 65, 64 },
+ { 66, 64 },
+ { 67, 64 },
+ { 68, 64 },
+ { 69, 64 },
+ { 70, 64 },
+ { 71, 64 },
+ { 72, 64 },
+ { 73, 64 }
};
const char *ITEinterfaceTextStrings[][52] = {
@@ -493,14 +496,6 @@ const char *solicitStr[][NUM_SOLICIT_REPLIES] = {
}
};
-const char portraitList[] = {
- RID_ITE_JFERRET_SERIOUS,
- RID_ITE_JFERRET_GOOFY,
- RID_ITE_JFERRET_SERIOUS,
- RID_ITE_JFERRET_GOOFY,
- RID_ITE_JFERRET_ALOOF
-};
-
const char *sakkaStr[][NUM_SAKKA] = {
{ "Hey, you're not supposed to help the applicants!",
"Guys! This is supposed to be a test!",
diff --git a/engines/saga/module.mk b/engines/saga/module.mk
index 76783a17ae..b1929361a2 100644
--- a/engines/saga/module.mk
+++ b/engines/saga/module.mk
@@ -11,11 +11,11 @@ MODULE_OBJS := \
font.o \
font_map.o \
gfx.o \
- ihnm_introproc.o \
image.o \
interface.o \
+ introproc_ihnm.o \
+ introproc_ite.o \
isomap.o \
- ite_introproc.o \
itedata.o \
objectmap.o \
puzzle.o \
diff --git a/engines/saga/music.cpp b/engines/saga/music.cpp
index 1cbc38dfb5..732bd0b50c 100644
--- a/engines/saga/music.cpp
+++ b/engines/saga/music.cpp
@@ -28,7 +28,6 @@
#include "saga/saga.h"
#include "saga/rscfile.h"
-#include "saga/sagaresnames.h"
#include "saga/music.h"
#include "sound/audiostream.h"
@@ -40,6 +39,7 @@
namespace Saga {
#define BUFFER_SIZE 4096
+#define MUSIC_SUNSPOT 26
class DigitalMusicInputStream : public Audio::AudioStream {
private:
@@ -58,6 +58,7 @@ private:
const int16 *_pos;
const GameSoundInfo *_musicInfo;
MemoryReadStream *_memoryStream;
+ SagaEngine *_vm;
void refill();
bool eosIntern() const {
@@ -73,18 +74,21 @@ public:
int readBuffer(int16 *buffer, const int numSamples);
bool endOfData() const { return eosIntern(); }
- bool isStereo() const { return _musicInfo->stereo; }
- int getRate() const { return _musicInfo->frequency; }
+ bool isStereo() const {
+ // The digital music in the ITE Mac demo version is not stereo
+ return _vm->getGameId() == GID_ITE_MACDEMO2 ? false : true;
+ }
+ int getRate() const { return 11025; }
};
DigitalMusicInputStream::DigitalMusicInputStream(SagaEngine *vm, ResourceContext *context, uint32 resourceId, bool looping, uint32 loopStart)
- : _context(context), _finished(false), _looping(looping), _bufferEnd(_buf + BUFFER_SIZE) {
+ : _vm(vm), _context(context), _finished(false), _looping(looping), _bufferEnd(_buf + BUFFER_SIZE) {
byte compressedHeader[10];
- resourceData = vm->_resource->getResourceData(context, resourceId);
+ resourceData = _vm->_resource->getResourceData(context, resourceId);
_file = context->getFile(resourceData);
- _musicInfo = vm->getMusicInfo();
+ _musicInfo = _vm->getMusicInfo();
if (_musicInfo == NULL) {
error("DigitalMusicInputStream() wrong musicInfo");
@@ -480,7 +484,7 @@ void Music::play(uint32 resourceId, MusicFlags flags) {
if (_digitalMusicContext != NULL) {
//TODO: check resource size
loopStart = 0;
- // fix ITE sunstatm score
+ // fix ITE sunstatm/sunspot score
if ((_vm->getGameType() == GType_ITE) && (resourceId == MUSIC_SUNSPOT)) {
loopStart = 4 * 18727;
}
@@ -557,7 +561,7 @@ void Music::play(uint32 resourceId, MusicFlags flags) {
musicFile.read(resourceData, resourceSize);
musicFile.close();
- // TODO: The Mac music format is unknown (probably TFMX?)
+ // TODO: The Mac music format is unsupported (QuickTime MIDI)
// so stop here
return;
} else {
diff --git a/engines/saga/palanim.cpp b/engines/saga/palanim.cpp
index c5129fcf06..319946f2d5 100644
--- a/engines/saga/palanim.cpp
+++ b/engines/saga/palanim.cpp
@@ -66,12 +66,7 @@ int PalAnim::loadPalAnim(const byte *resdata, size_t resdata_len) {
debug(3, "PalAnim::loadPalAnim(): Loading %d PALANIM entries.", _entryCount);
- test_p = calloc(_entryCount, sizeof(PalanimEntry));
- if (test_p == NULL) {
- warning("PalAnim::loadPalAnim(): Allocation failure");
- return MEM;
- }
-
+ test_p = malloc(_entryCount * sizeof(PalanimEntry));
_entries = (PalanimEntry *)test_p;
for (i = 0; i < _entryCount; i++) {
@@ -87,22 +82,12 @@ int PalAnim::loadPalAnim(const byte *resdata, size_t resdata_len) {
debug(2, "PalAnim::loadPalAnim(): Entry %d: Loading %d palette indices.\n", i, pal_count);
- test_p = calloc(1, sizeof(char) * pal_count);
- if (test_p == NULL) {
- warning("PalAnim::loadPalAnim(): Allocation failure");
- return MEM;
- }
-
+ test_p = malloc(sizeof(char) * pal_count);
_entries[i].pal_index = (byte *)test_p;
debug(2, "PalAnim::loadPalAnim(): Entry %d: Loading %d SAGA_COLOR structures.", i, color_count);
- test_p = calloc(1, sizeof(Color) * color_count);
- if (test_p == NULL) {
- warning("PalAnim::loadPalAnim(): Allocation failure");
- return MEM;
- }
-
+ test_p = malloc(sizeof(Color) * color_count);
_entries[i].colors = (Color *)test_p;
for (p = 0; p < pal_count; p++) {
diff --git a/engines/saga/puzzle.cpp b/engines/saga/puzzle.cpp
index 23eaa42531..2835775320 100644
--- a/engines/saga/puzzle.cpp
+++ b/engines/saga/puzzle.cpp
@@ -31,13 +31,14 @@
#include "saga/sprite.h"
#include "saga/puzzle.h"
#include "saga/render.h"
-#include "saga/sagaresnames.h"
#include "common/system.h"
#include "common/timer.h"
namespace Saga {
+#define ITE_ACTOR_PUZZLE 176
+
#define PUZZLE_X_OFFSET 72
#define PUZZLE_Y_OFFSET 46
@@ -45,6 +46,21 @@ namespace Saga {
#define PUZZLE_MOVED 0x04 // 1 when somewhere in the box
#define PUZZLE_ALL_SET PUZZLE_FIT | PUZZLE_MOVED
+// Puzzle portraits
+#define RID_ITE_SAKKA_APPRAISING 6
+#define RID_ITE_SAKKA_DENIAL 7
+#define RID_ITE_SAKKA_EXCITED 8
+#define RID_ITE_JFERRET_SERIOUS 9
+#define RID_ITE_JFERRET_GOOFY 10
+#define RID_ITE_JFERRET_ALOOF 11
+
+const char portraitList[] = {
+ RID_ITE_JFERRET_SERIOUS,
+ RID_ITE_JFERRET_GOOFY,
+ RID_ITE_JFERRET_SERIOUS,
+ RID_ITE_JFERRET_GOOFY,
+ RID_ITE_JFERRET_ALOOF
+};
enum rifOptions {
kROLater = 0,
@@ -54,7 +70,12 @@ enum rifOptions {
};
Puzzle::Puzzle(SagaEngine *vm) : _vm(vm), _solved(false), _active(false) {
- _lang = (_vm->getLanguage() == Common::DE_DEU) ? 1 : 0;
+ _lang = 0;
+
+ if (_vm->getLanguage() == Common::DE_DEU)
+ _lang = 1;
+ else if (_vm->getLanguage() == Common::IT_ITA)
+ _lang = 2;
_hintRqState = kRQNoHint;
_hintOffer = 0;
diff --git a/engines/saga/rscfile.cpp b/engines/saga/rscfile.cpp
index bd5bfdfa1d..b7d4f4f1bd 100644
--- a/engines/saga/rscfile.cpp
+++ b/engines/saga/rscfile.cpp
@@ -658,12 +658,8 @@ static int metaResourceTable[] = { 0, 326, 517, 677, 805, 968, 1165, 0, 1271 };
static int metaResourceTableDemo[] = { 0, 0, 0, 0, 0, 0, 0, 285, 0 };
void Resource::loadGlobalResources(int chapter, int actorsEntrance) {
- if (chapter < 0) {
- if (_vm->getGameId() != GID_IHNM_DEMO)
- chapter = 8;
- else
- chapter = 7;
- }
+ if (chapter < 0)
+ chapter = (_vm->getGameId() != GID_IHNM_DEMO) ? 8 : 7;
// TODO
//if (module.voiceLUT)
diff --git a/engines/saga/saga.cpp b/engines/saga/saga.cpp
index 8200526ecf..40eb32b276 100644
--- a/engines/saga/saga.cpp
+++ b/engines/saga/saga.cpp
@@ -53,7 +53,6 @@
#include "saga/music.h"
#include "saga/palanim.h"
#include "saga/objectmap.h"
-#include "saga/sagaresnames.h"
namespace Saga {
@@ -251,7 +250,7 @@ int SagaEngine::go() {
_scene->changeScene(ConfMan.getInt("start_scene"), 0, kTransitionNoFade);
} else if (ConfMan.hasKey("boot_param")) {
if (getGameType() == GType_ITE)
- _interface->addToInventory(_actor->objIndexToId(ITE_OBJ_MAGIC_HAT));
+ _interface->addToInventory(_actor->objIndexToId(0)); // Magic hat
_scene->changeScene(ConfMan.getInt("boot_param"), 0, kTransitionNoFade);
} else if (ConfMan.hasKey("save_slot")) {
// First scene sets up palette
@@ -421,25 +420,25 @@ const char *SagaEngine::getTextString(int textStringId) {
void SagaEngine::getExcuseInfo(int verb, const char *&textString, int &soundResourceId) {
textString = NULL;
- if (verb == _script->getVerbType(kVerbPickUp)) {
- textString = getTextString(kTextICantPickup);
- soundResourceId = RID_BOAR_VOICE_007;
- } else
- if (verb == _script->getVerbType(kVerbLookAt)) {
- textString = getTextString(kTextNothingSpecial);
- soundResourceId = RID_BOAR_VOICE_006;
- }
- if (verb == _script->getVerbType(kVerbOpen)) {
+ if (verb == _script->getVerbType(kVerbOpen)) {
textString = getTextString(kTextNoPlaceToOpen);
- soundResourceId = RID_BOAR_VOICE_000;
- }
- if (verb == _script->getVerbType(kVerbClose)) {
+ soundResourceId = 239; // Boar voice 0
+ }
+ if (verb == _script->getVerbType(kVerbClose)) {
textString = getTextString(kTextNoOpening);
- soundResourceId = RID_BOAR_VOICE_002;
- }
- if (verb == _script->getVerbType(kVerbUse)) {
+ soundResourceId = 241; // Boar voice 2
+ }
+ if (verb == _script->getVerbType(kVerbUse)) {
textString = getTextString(kTextDontKnow);
- soundResourceId = RID_BOAR_VOICE_005;
+ soundResourceId = 244; // Boar voice 5
+ }
+ if (verb == _script->getVerbType(kVerbLookAt)) {
+ textString = getTextString(kTextNothingSpecial);
+ soundResourceId = 245; // Boar voice 6
+ }
+ if (verb == _script->getVerbType(kVerbPickUp)) {
+ textString = getTextString(kTextICantPickup);
+ soundResourceId = 246; // Boar voice 7
}
}
diff --git a/engines/saga/saga.h b/engines/saga/saga.h
index 35c3736b31..4a5fae7ddb 100644
--- a/engines/saga/saga.h
+++ b/engines/saga/saga.h
@@ -82,11 +82,11 @@ using Common::MemoryReadStreamEndian;
#define OBJECT_TYPE_MASK ((1 << OBJECT_TYPE_SHIFT) - 1)
#define OBJ_SPRITE_BASE 9
+#define IHNM_OBJ_PROFILE 0x4000
#define memoryError(Place) error("%s Memory allocation error.", Place)
enum ERRORCODE {
- MEM = -2,//todo: remove
FAILURE = -1,
SUCCESS = 0
};
@@ -303,15 +303,17 @@ struct GameResourceDescription {
uint32 mainPanelResourceId;
uint32 conversePanelResourceId;
uint32 optionPanelResourceId;
- uint32 warningPanelResourceId;
- uint32 warningPanelSpritesResourceId;
uint32 mainSpritesResourceId;
uint32 mainPanelSpritesResourceId;
- uint32 optionPanelSpritesResourceId;
- uint32 defaultPortraitsResourceId;
- uint32 psychicProfileResourceId;
uint32 mainStringsResourceId;
+ // ITE specific resources
uint32 actorsStringsResourceId;
+ uint32 defaultPortraitsResourceId;
+ // IHNM specific resources
+ uint32 optionPanelSpritesResourceId;
+ uint32 warningPanelResourceId;
+ uint32 warningPanelSpritesResourceId;
+ uint32 psychicProfileResourceId;
};
struct GameFontDescription {
@@ -322,9 +324,7 @@ struct GameDisplayInfo;
struct GameSoundInfo {
GameSoundTypes resourceType;
- long frequency;
int sampleBits;
- bool stereo;
bool isBigEndian;
bool isSigned;
};
@@ -580,15 +580,15 @@ public:
_mouseClickCount = 0;
}
- const bool leftMouseButtonPressed() const {
+ bool leftMouseButtonPressed() const {
return _leftMouseButtonPressed;
}
- const bool rightMouseButtonPressed() const {
+ bool rightMouseButtonPressed() const {
return _rightMouseButtonPressed;
}
- const bool mouseButtonPressed() const {
+ bool mouseButtonPressed() const {
return _leftMouseButtonPressed || _rightMouseButtonPressed;
}
@@ -622,8 +622,8 @@ public:
public:
bool initGame(void);
- const bool isBigEndian() const;
- const bool isMacResources() const;
+ bool isBigEndian() const;
+ bool isMacResources() const;
const GameResourceDescription *getResourceDescription();
const GameSoundInfo *getVoiceInfo() const;
const GameSoundInfo *getSfxInfo() const;
diff --git a/engines/saga/sagaresnames.h b/engines/saga/sagaresnames.h
deleted file mode 100644
index 5bce483c3e..0000000000
--- a/engines/saga/sagaresnames.h
+++ /dev/null
@@ -1,274 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- *
- */
-
-// Descriptive names for game resource numbers
-
-#ifndef SAGA_RESOURCENAMES_H
-#define SAGA_RESOURCENAMES_H
-
-namespace Saga {
-
-// Prefix RID_ means Resource Id
-
-// Lookup tables
-#define RID_ITE_SCENE_LUT 1806
-#define RID_ITE_SCRIPT_LUT 216
-
-#define RID_ITEDEMO_SCENE_LUT 318
-#define RID_ITEDEMO_SCRIPT_LUT 146
-
-#define RID_IHNM_SCENE_LUT 1272
-#define RID_IHNM_SCRIPT_LUT 29
-#define RID_IHNM_SFX_LUT 265
-
-#define RID_IHNMDEMO_SCENE_LUT 286
-#define RID_IHNMDEMO_SCRIPT_LUT 18
-#define RID_IHNMDEMO_SFX_LUT 222
-
-// Object names
-#define ITE_OBJ_MAP 14
-#define ITE_OBJ_MAGIC_HAT 0
-
-#define IHNM_OBJ_PROFILE 0x4000
-
-#define RID_IHNM_DEFAULT_PALETTE 1
-
-// Actor names
-#define ITE_ACTOR_PUZZLE 176
-
-// Scenes
-#define ITE_SCENE_INV -1
-#define ITE_SCENE_PUZZLE 26
-#define ITE_SCENE_LODGE 21
-#define ITE_SCENE_ENDCREDIT1 295
-
-#define ITE_DEFAULT_SCENE 32
-#define IHNM_DEFAULT_SCENE 151
-
-#define ITEDEMO_DEFAULT_SCENE 68
-#define IHNMDEMO_DEFAULT_SCENE 144
-
-// Fonts
-#define RID_MEDIUM_FONT 0
-#define RID_BIG_FONT 1
-#define RID_SMALL_FONT 2
-
-// Interface images
-#define RID_ITE_MAIN_PANEL 3
-#define RID_ITE_CONVERSE_PANEL 4
-#define RID_ITE_OPTION_PANEL 5
-#define RID_ITE_MAIN_SPRITES 6
-#define RID_ITE_MAIN_PANEL_SPRITES 7
-#define RID_ITE_MAIN_STRINGS 35 //main strings
-#define RID_ITE_ACTOR_NAMES 36 //actors names
-#define RID_ITE_DEFAULT_PORTRAITS 125
-
-#define RID_ITEDEMO_MAIN_PANEL 2
-#define RID_ITEDEMO_CONVERSE_PANEL 3
-#define RID_ITEDEMO_OPTION_PANEL 3 // FIXME: should be 4 but it is an empty resource.
-#define RID_ITEDEMO_MAIN_SPRITES 5 // Proper fix would be not load options panel when demo is running
-#define RID_ITEDEMO_MAIN_PANEL_SPRITES 6
-#define RID_ITEDEMO_MAIN_STRINGS 8 //main strings
-#define RID_ITEDEMO_ACTOR_NAMES 9 //actors names
-#define RID_ITEDEMO_DEFAULT_PORTRAITS 80
-
-#define RID_ITE_TYCHO_MAP 1686
-#define RID_ITE_SPR_XHAIR1 (73 + 9)
-#define RID_ITE_SPR_XHAIR2 (74 + 9)
-
-#define RID_IHNM_MAIN_PANEL 9
-#define RID_IHNM_CONVERSE_PANEL 10
-#define RID_IHNM_HOURGLASS_CURSOR 11
-#define RID_IHNM_MAIN_SPRITES 12
-#define RID_IHNM_MAIN_PANEL_SPRITES 12
-#define RID_IHNM_ARROW_SPRITES 13
-#define RID_IHNM_SAVEREMINDER_SPRITES 14
-#define RID_IHNM_OPTION_PANEL 15
-#define RID_IHNM_OPTION_PANEL_SPRITES 16
-#define RID_IHNM_WARNING_PANEL 17
-#define RID_IHNM_WARNING_PANEL_SPRITES 18
-#define RID_IHNM_BOSS_SCREEN 19
-#define RID_IHNM_PROFILE_BG 20
-#define RID_IHNM_MAIN_STRINGS 21
-
-#define RID_IHNMDEMO_MAIN_PANEL 5
-#define RID_IHNMDEMO_CONVERSE_PANEL 6
-#define RID_IHNMDEMO_HOURGLASS_CURSOR 6 // Does not exist in the demo
-#define RID_IHNMDEMO_MAIN_SPRITES 7
-#define RID_IHNMDEMO_MAIN_PANEL_SPRITES 7
-#define RID_IHNMDEMO_ARROW_SPRITES 8
-#define RID_IHNMDEMO_SAVEREMINDER_SPRITES 9
-#define RID_IHNMDEMO_OPTION_PANEL 10
-#define RID_IHNMDEMO_OPTION_PANEL_SPRITES 11
-#define RID_IHNMDEMO_WARNING_PANEL 12
-#define RID_IHNMDEMO_WARNING_PANEL_SPRITES 13
-#define RID_IHNMDEMO_BOSS_SCREEN 14 // Does not exist in the demo
-#define RID_IHNMDEMO_PROFILE_BG 15
-#define RID_IHNMDEMO_MAIN_STRINGS 16
-
-// Puzzle portraits
-#define RID_ITE_SAKKA_APPRAISING 6
-#define RID_ITE_SAKKA_DENIAL 7
-#define RID_ITE_SAKKA_EXCITED 8
-#define RID_ITE_JFERRET_SERIOUS 9
-#define RID_ITE_JFERRET_GOOFY 10
-#define RID_ITE_JFERRET_ALOOF 11
-
-// ITE Scene resource numbers
-#define RID_ITE_OVERMAP_SCENE 226
-#define RID_ITE_INTRO_ANIM_SCENE 1538
-#define RID_ITE_CAVE_SCENE_1 1542
-#define RID_ITE_CAVE_SCENE_2 1545
-#define RID_ITE_CAVE_SCENE_3 1548
-#define RID_ITE_CAVE_SCENE_4 1551
-
-#define RID_ITE_VALLEY_SCENE 1556
-#define RID_ITE_TREEHOUSE_SCENE 1560
-#define RID_ITE_FAIREPATH_SCENE 1564
-#define RID_ITE_FAIRETENT_SCENE 1567
-
-#define RID_ITE_INTRO_ANIM_STARTFRAME 1529
-
-#define RID_ITE_INTRO_ANIM_1 1530
-#define RID_ITE_INTRO_ANIM_2 1531
-#define RID_ITE_INTRO_ANIM_3 1532
-#define RID_ITE_INTRO_ANIM_4 1533
-#define RID_ITE_INTRO_ANIM_5 1534
-#define RID_ITE_INTRO_ANIM_6 1535
-#define RID_ITE_INTRO_ANIM_7 1536
-
-#define RID_ITE_CAVE_IMG_1 1540
-#define RID_ITE_CAVE_IMG_2 1543
-#define RID_ITE_CAVE_IMG_3 1546
-#define RID_ITE_CAVE_IMG_4 1549
-
-#define RID_ITE_INTRO_IMG_1 1552
-#define RID_ITE_INTRO_IMG_2 1557
-#define RID_ITE_INTRO_IMG_3 1561
-#define RID_ITE_INTRO_IMG_4 1565
-
-// ITE voices
-#define RID_CAVE_VOICE_0 0
-#define RID_CAVE_VOICE_1 1
-#define RID_CAVE_VOICE_2 2
-#define RID_CAVE_VOICE_3 3
-#define RID_CAVE_VOICE_4 4
-#define RID_CAVE_VOICE_5 5
-#define RID_CAVE_VOICE_6 6
-#define RID_CAVE_VOICE_7 7
-#define RID_CAVE_VOICE_8 8
-#define RID_CAVE_VOICE_9 9
-#define RID_CAVE_VOICE_10 10
-#define RID_CAVE_VOICE_11 11
-#define RID_CAVE_VOICE_12 12
-#define RID_CAVE_VOICE_13 13
-
-#define RID_SCENE1_VOICE_009 57
-//TODO: fill it
-#define RID_SCENE1_VOICE_138 186
-
-#define RID_BOAR_VOICE_000 239
-#define RID_BOAR_VOICE_002 241
-#define RID_BOAR_VOICE_005 244
-#define RID_BOAR_VOICE_006 245
-#define RID_BOAR_VOICE_007 246
-
-// Music
-#define MUSIC_1 9
-#define MUSIC_2 10
-#define MUSIC_SUNSPOT 26
-
-// TODO: If the sound effects are numbered sequentially, we don't really need
-// these constants. But for now they might be useful for debugging.
-
-// Sound effects
-
-#define FX_DOOR_OPEN 14
-#define FX_DOOR_CLOSE 15
-#define FX_RUSH_WATER 16
-#define FX_CRICKET 17
-#define FX_PORTICULLIS 18
-#define FX_CLOCK_1 19
-#define FX_CLOCK_2 20
-#define FX_DAM_MACHINE 21
-#define FX_HUM1 22
-#define FX_HUM2 23
-#define FX_HUM3 24
-#define FX_HUM4 25
-#define FX_STREAM 26
-#define FX_SURF 27
-#define FX_FIRELOOP 28
-#define FX_SCRAPING 29
-#define FX_BEE_SWARM 30
-#define FX_SQUEAKBOARD 31
-#define FX_KNOCK 32
-#define FX_COINS 33
-#define FX_STORM 34
-#define FX_DOOR_CLOSE_2 35
-#define FX_ARCWELD 36
-#define FX_RETRACT_ORB 37
-#define FX_DRAGON 38
-#define FX_SNORES 39
-#define FX_SPLASH 40
-#define FX_LOBBY_DOOR 41
-#define FX_CHIRP_LOOP 42
-#define FX_DOOR_CREAK 43
-#define FX_SPOON_DIG 44
-#define FX_CROW 45
-#define FX_COLDWIND 46
-#define FX_TOOL_SND_1 47
-#define FX_TOOL_SND_2 48
-#define FX_TOOL_SND_3 49
-#define FX_DOOR_METAL 50
-#define FX_WATER_LOOP_S 51
-#define FX_WATER_LOOP_L 52
-#define FX_DOOR_OPEN_2 53
-#define FX_JAIL_DOOR 54
-#define FX_KILN_FIRE 55
-#define FX_DUMMY 56
-
-// These are only in the CD version
-
-#define FX_CROWD_01 57
-#define FX_CROWD_02 58
-#define FX_CROWD_03 59
-#define FX_CROWD_04 60
-#define FX_CROWD_05 61
-#define FX_CROWD_06 62
-#define FX_CROWD_07 63
-#define FX_CROWD_08 64
-#define FX_CROWD_09 65
-#define FX_CROWD_10 66
-#define FX_CROWD_11 67
-#define FX_CROWD_12 68
-#define FX_CROWD_13 69
-#define FX_CROWD_14 70
-#define FX_CROWD_15 71
-#define FX_CROWD_16 72
-#define FX_CROWD_17 73
-
-} // End of namespace Saga
-
-#endif
diff --git a/engines/saga/saveload.cpp b/engines/saga/saveload.cpp
index 53290cbc5d..8d00f9d2d0 100644
--- a/engines/saga/saveload.cpp
+++ b/engines/saga/saveload.cpp
@@ -37,7 +37,6 @@
#include "saga/isomap.h"
#include "saga/music.h"
#include "saga/render.h"
-#include "saga/sagaresnames.h"
#include "saga/scene.h"
#include "saga/script.h"
diff --git a/engines/saga/scene.cpp b/engines/saga/scene.cpp
index 4520c3f406..c3c1587822 100644
--- a/engines/saga/scene.cpp
+++ b/engines/saga/scene.cpp
@@ -43,7 +43,6 @@
#include "saga/scene.h"
#include "saga/actor.h"
#include "saga/rscfile.h"
-#include "saga/sagaresnames.h"
#include "graphics/iff.h"
#include "common/util.h"
diff --git a/engines/saga/scene.h b/engines/saga/scene.h
index 0e4c0ed66a..723792f050 100644
--- a/engines/saga/scene.h
+++ b/engines/saga/scene.h
@@ -38,9 +38,21 @@ namespace Saga {
//#define SCENE_DEBUG // for scene debugging
#define SCENE_DOORS_MAX 16
-
#define NO_CHAPTER_CHANGE -2
+// Scenes
+#define ITE_SCENE_INV -1
+#define ITE_SCENE_PUZZLE 26
+#define ITE_SCENE_LODGE 21
+#define ITE_SCENE_ENDCREDIT1 295
+#define ITE_SCENE_OVERMAP 226
+
+// Default scenes
+#define ITE_DEFAULT_SCENE 32
+#define IHNM_DEFAULT_SCENE 151
+#define ITEDEMO_DEFAULT_SCENE 68
+#define IHNMDEMO_DEFAULT_SCENE 144
+
class ObjectMap;
struct Event;
diff --git a/engines/saga/sfuncs.cpp b/engines/saga/sfuncs.cpp
index 4862ce3be0..ea61f5ce04 100644
--- a/engines/saga/sfuncs.cpp
+++ b/engines/saga/sfuncs.cpp
@@ -47,7 +47,6 @@
#include "saga/scene.h"
#include "saga/isomap.h"
-#include "saga/sagaresnames.h"
#include "common/config-manager.h"
diff --git a/engines/saga/sndres.cpp b/engines/saga/sndres.cpp
index 9d3d4a9afa..8d269fb3e8 100644
--- a/engines/saga/sndres.cpp
+++ b/engines/saga/sndres.cpp
@@ -28,7 +28,6 @@
#include "saga/saga.h"
#include "saga/itedata.h"
-#include "saga/sagaresnames.h"
#include "saga/rscfile.h"
#include "saga/sndres.h"
#include "saga/sound.h"
@@ -43,6 +42,9 @@
namespace Saga {
+#define RID_IHNM_SFX_LUT 265
+#define RID_IHNMDEMO_SFX_LUT 222
+
SndRes::SndRes(SagaEngine *vm) : _vm(vm) {
// Load sound module resource file contexts
_sfxContext = _vm->_resource->getContext(GAME_SOUNDFILE);
@@ -259,11 +261,11 @@ bool SndRes::load(ResourceContext *context, uint32 resourceId, SoundBuffer &buff
switch (resourceType) {
case kSoundPCM:
- buffer.frequency = soundInfo->frequency;
+ buffer.frequency = 22050;
buffer.isSigned = soundInfo->isSigned;
buffer.sampleBits = soundInfo->sampleBits;
buffer.size = soundResourceLength;
- buffer.stereo = soundInfo->stereo;
+ buffer.stereo = false;
if (onlyHeader) {
buffer.buffer = NULL;
free(soundResource);
@@ -273,11 +275,11 @@ bool SndRes::load(ResourceContext *context, uint32 resourceId, SoundBuffer &buff
result = true;
break;
case kSoundMacPCM:
- buffer.frequency = soundInfo->frequency;
+ buffer.frequency = 22050;
buffer.isSigned = soundInfo->isSigned;
buffer.sampleBits = soundInfo->sampleBits;
buffer.size = soundResourceLength - 36;
- buffer.stereo = soundInfo->stereo;
+ buffer.stereo = false;
if (onlyHeader) {
buffer.buffer = NULL;
} else {
@@ -288,10 +290,10 @@ bool SndRes::load(ResourceContext *context, uint32 resourceId, SoundBuffer &buff
result = true;
break;
case kSoundVOX:
- buffer.frequency = soundInfo->frequency;
+ buffer.frequency = 22050;
buffer.isSigned = soundInfo->isSigned;
buffer.sampleBits = soundInfo->sampleBits;
- buffer.stereo = soundInfo->stereo;
+ buffer.stereo = false;
buffer.size = soundResourceLength * 4;
if (onlyHeader) {
buffer.buffer = NULL;
diff --git a/engines/saga/sprite.cpp b/engines/saga/sprite.cpp
index b5c675a403..e9d002819c 100644
--- a/engines/saga/sprite.cpp
+++ b/engines/saga/sprite.cpp
@@ -29,7 +29,6 @@
#include "saga/gfx.h"
#include "saga/scene.h"
-#include "saga/sagaresnames.h"
#include "saga/rscfile.h"
#include "saga/font.h"
@@ -37,6 +36,11 @@
namespace Saga {
+#define RID_IHNM_ARROW_SPRITES 13
+#define RID_IHNM_SAVEREMINDER_SPRITES 14
+#define RID_IHNMDEMO_ARROW_SPRITES 8
+#define RID_IHNMDEMO_SAVEREMINDER_SPRITES 9
+
Sprite::Sprite(SagaEngine *vm) : _vm(vm) {
debug(8, "Initializing sprite subsystem...");
diff --git a/engines/saga/sthread.cpp b/engines/saga/sthread.cpp
index bc18632659..c1b289a060 100644
--- a/engines/saga/sthread.cpp
+++ b/engines/saga/sthread.cpp
@@ -34,10 +34,12 @@
#include "saga/script.h"
#include "saga/scene.h"
-#include "saga/sagaresnames.h"
namespace Saga {
+#define RID_SCENE1_VOICE_START 57
+#define RID_SCENE1_VOICE_END 186
+
ScriptThread *Script::createThread(uint16 scriptModuleNumber, uint16 scriptEntryPointNumber) {
ScriptThread *newThread;
@@ -653,8 +655,8 @@ bool Script::runThread(ScriptThread *thread, uint instructionLimit) {
if (_vm->getGameId() == GID_ITE_DISK_G) { // special ITE dos
if ((_vm->_scene->currentSceneNumber() == ITE_DEFAULT_SCENE) &&
- (iparam1 >= 288) && (iparam1 <= (RID_SCENE1_VOICE_138 - RID_SCENE1_VOICE_009 + 288))) {
- sampleResourceId = RID_SCENE1_VOICE_009 + iparam1 - 288;
+ (iparam1 >= 288) && (iparam1 <= (RID_SCENE1_VOICE_END - RID_SCENE1_VOICE_START + 288))) {
+ sampleResourceId = RID_SCENE1_VOICE_START + iparam1 - 288;
}
} else {
if (thread->_voiceLUT->voicesCount > first) {
diff --git a/engines/scumm/charset.cpp b/engines/scumm/charset.cpp
index 46d034d880..8f3175f098 100644
--- a/engines/scumm/charset.cpp
+++ b/engines/scumm/charset.cpp
@@ -371,7 +371,7 @@ int CharsetRenderer::getStringWidth(int arg, const byte *text) {
break;
}
} else {
- if (chr == '@' && _vm->_language != Common::ZH_TWN)
+ if (chr == '@' && !(_vm->_game.id == GID_CMI && _vm->_language == Common::ZH_TWN))
continue;
if (chr == 255 || (_vm->_game.version <= 6 && chr == 254)) {
chr = text[pos++];
@@ -400,7 +400,8 @@ int CharsetRenderer::getStringWidth(int arg, const byte *text) {
// Some localizations may override colors
// See credits in Chinese COMI
- if (chr == '^' && pos == 1) {
+ if (_vm->_game.id == GID_CMI && _vm->_language == Common::ZH_TWN &&
+ chr == '^' && pos == 1) {
if (text[pos] == 'c') {
pos += 4;
chr = text[pos++];
diff --git a/engines/scumm/debugger.cpp b/engines/scumm/debugger.cpp
index 954e400c2c..9f9115e207 100644
--- a/engines/scumm/debugger.cpp
+++ b/engines/scumm/debugger.cpp
@@ -498,25 +498,24 @@ bool ScummDebugger::Cmd_Object(int argc, const char **argv) {
}
bool ScummDebugger::Cmd_Debug(int argc, const char **argv) {
- Common::Array<Common::EngineDebugLevel> lvls = Common::listSpecialDebugLevels();
+ const Common::DebugLevelContainer &lvls = Common::listSpecialDebugLevels();
bool setFlag = false; // Remove or add debug channel?
if ((argc == 1) && (Common::getEnabledSpecialDebugLevels() == 0)) {
DebugPrintf("No debug flags are enabled\n");
DebugPrintf("Available Channels: ");
- for (uint i = 0; i < lvls.size(); i++) {
- DebugPrintf("%s, ", lvls[i].option.c_str());
+ for (Common::DebugLevelContainer::iterator i = lvls.begin(); i != lvls.end(); ++i) {
+ DebugPrintf("%s, ", i->option.c_str());
}
DebugPrintf("\n");
return true;
}
if ((argc == 1) && (Common::getEnabledSpecialDebugLevels() > 0)) {
- for (uint i = 0; i < lvls.size(); i++) {
- if (lvls[i].enabled)
- DebugPrintf("%s - %s\n", lvls[i].option.c_str(),
- lvls[i].description.c_str());
+ for (Common::DebugLevelContainer::iterator i = lvls.begin(); i != lvls.end(); ++i) {
+ if (i->enabled)
+ DebugPrintf("%s - %s\n", i->option.c_str(), i->description.c_str());
}
return true;
}
@@ -529,25 +528,24 @@ bool ScummDebugger::Cmd_Debug(int argc, const char **argv) {
} else {
DebugPrintf("Syntax: Debug +CHANNEL, or Debug -CHANNEL\n");
DebugPrintf("Available Channels: ");
- for (uint i = 0; i < lvls.size(); i++) {
- DebugPrintf("%s, ", lvls[i].option.c_str());
- DebugPrintf("\n");
+ for (Common::DebugLevelContainer::iterator i = lvls.begin(); i != lvls.end(); ++i) {
+ DebugPrintf("%s\n", i->option.c_str());
}
}
// Identify flag
const char *realFlag = argv[1] + 1;
- for (uint i = 0; i < lvls.size(); i++) {
- if ((scumm_stricmp(lvls[i].option.c_str(), realFlag)) == 0) {
+ for (Common::DebugLevelContainer::iterator i = lvls.begin(); i != lvls.end(); ++i) {
+ if (i->option.equalsIgnoreCase(realFlag)) {
if (setFlag) {
- enableSpecialDebugLevel(lvls[i].option);
+ enableSpecialDebugLevel(i->option);
DebugPrintf("Enable ");
} else {
- disableSpecialDebugLevel(lvls[i].option);
+ disableSpecialDebugLevel(i->option);
DebugPrintf("Disable ");
}
- DebugPrintf("%s\n", lvls[i].description.c_str());
+ DebugPrintf("%s\n", i->description.c_str());
return true;
}
}
diff --git a/engines/scumm/detection_tables.h b/engines/scumm/detection_tables.h
index 18d51e133d..324cc91e78 100644
--- a/engines/scumm/detection_tables.h
+++ b/engines/scumm/detection_tables.h
@@ -89,7 +89,8 @@ static const PlainGameDescriptor gameDescriptions[] = {
{ "baseball2001", "Backyard Baseball 2001" },
{ "Baseball2003", "Backyard Baseball 2003" },
{ "basketball", "Backyard Basketball" },
- { "BluesABCTime", "Blue's ABC Time" },
+ { "Blues123Time", "Blue's 123 Time Activities" },
+ { "BluesABCTime", "Blue's ABC Time Activities" },
{ "BluesBirthday", "Blue's Birthday Adventure" },
{ "catalog", "Humongous Interactive Catalog" },
{ "chase", "SPY Fox in Cheese Chase" },
@@ -116,7 +117,7 @@ static const PlainGameDescriptor gameDescriptions[] = {
{ "PuttsFunShop", "Putt-Putt's One-Stop Fun Shop" },
{ "putttime", "Putt-Putt Travels Through Time" },
{ "puttzoo", "Putt-Putt Saves the Zoo" },
- { "readdemo", "Blue's Reading Time Activities (Demo)" },
+ { "readtime", "Blue's Reading Time Activities" },
{ "SamsFunShop", "Pajama Sam's One-Stop Fun Shop" },
{ "soccer", "Backyard Soccer" },
{ "Soccer2004", "Backyard Soccer 2004" },
@@ -285,8 +286,7 @@ static const GameSettings gameVariantsTable[] = {
{"dog", "", 0, GID_HEGAME, 6, 80, MDT_NONE, GF_USE_KEY, UNK},
{"maze", "", 0, GID_HEGAME, 6, 80, MDT_NONE, GF_USE_KEY, UNK},
- {"water", "", 0, GID_WATER, 6, 80, MDT_NONE, GF_USE_KEY, UNK},
- {"water", "HE 99", 0, GID_WATER, 6, 99, MDT_NONE, GF_USE_KEY, UNK},
+ {"water", "", 0, GID_HEGAME, 6, 80, MDT_NONE, GF_USE_KEY, UNK},
// condMaskCode value changed in setUserCondition & setTalkCondition
{"putttime", "", 0, GID_HEGAME, 6, 85, MDT_NONE, GF_USE_KEY, UNK},
@@ -319,6 +319,7 @@ static const GameSettings gameVariantsTable[] = {
{"soccer", "", 0, GID_SOCCER, 6, 98, MDT_NONE, GF_USE_KEY, UNK},
// Global scripts increased to 2048
+ {"blues123time", "", 0, GID_HEGAME, 6, 98, MDT_NONE, GF_USE_KEY | GF_HE_985, UNK},
{"freddi4", "", 0, GID_HEGAME, 6, 98, MDT_NONE, GF_USE_KEY | GF_HE_985, UNK},
{"freddi4", "unenc", 0, GID_HEGAME, 6, 98, MDT_NONE, GF_HE_985, UNK},
@@ -353,7 +354,7 @@ static const GameSettings gameVariantsTable[] = {
// Uses smacker in external files, for testing only
{"arttime", 0, 0, GID_HEGAME, 6, 99, MDT_NONE, GF_USE_KEY | GF_16BIT_COLOR, UNK},
- {"readdemo", 0, 0, GID_HEGAME, 6, 99, MDT_NONE, GF_USE_KEY | GF_16BIT_COLOR, UNK},
+ {"readtime", 0, 0, GID_HEGAME, 6, 99, MDT_NONE, GF_USE_KEY | GF_16BIT_COLOR, UNK},
{"football2002", 0, 0, GID_FOOTBALL, 6, 100, MDT_NONE, GF_USE_KEY | GF_16BIT_COLOR, UNK},
@@ -511,6 +512,9 @@ static const GameFilenamePattern gameFilenamesTable[] = {
{ "basketball", "basketball", kGenHEPC, UNK_LANG, UNK, 0 },
{ "basketball", "Basketball", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
+ { "blues123time", "Blues123time", kGenHEPC, UNK_LANG, UNK, 0 },
+ { "blues123time", "Blue's 123 Time", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
+
{ "bluesabctime", "bluesabctime", kGenHEPC, UNK_LANG, UNK, 0 },
{ "bluesabctime", "BluesABCTimeDemo", kGenHEPC, UNK_LANG, UNK, 0 },
{ "bluesabctime", "BluesABCTimeDemo", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
@@ -550,6 +554,7 @@ static const GameFilenamePattern gameFilenamesTable[] = {
{ "freddi", "freddi", kGenHEPC, UNK_LANG, UNK, 0 },
{ "freddi", "Freddi", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
+ { "freddi", "Freddi1", kGenHEPC, UNK_LANG, UNK, 0 },
{ "freddi", "freddemo", kGenHEPC, UNK_LANG, UNK, 0 },
{ "freddi", "Freddi Demo", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
{ "freddi", "Freddi Fish", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
@@ -641,6 +646,7 @@ static const GameFilenamePattern gameFilenamesTable[] = {
{ "pajama", "Pajama Sam", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
{ "pajama", "PajamaNHD", kGenHEPC, UNK_LANG, UNK, 0 },
{ "pajama", "PJS-DEMO", kGenHEPC, UNK_LANG, UNK, 0 },
+ { "pajama", "pjsam", kGenHEPC, UNK_LANG, UNK, 0 },
{ "pajama", "PjSamDemo", kGenHEPC, UNK_LANG, UNK, 0 },
{ "pajama", "PYJAMA", kGenHEPC, Common::DE_DEU, UNK, 0 },
{ "pajama", "SAMDEMO", kGenHEPC, Common::FR_FRA, UNK, 0 },
@@ -750,8 +756,9 @@ static const GameFilenamePattern gameFilenamesTable[] = {
{ "puttzoo", "zoodemo", kGenHEPC, UNK_LANG, UNK, 0 },
{ "puttzoo", "Zoo Demo", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
- { "readdemo", "readDemo", kGenHEPC, UNK_LANG, UNK, 0 },
- { "readdemo", "Blues-ReadingTime Demo", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
+ { "readtime", "Blue's Reading Time", kGenHEPC, UNK_LANG, UNK, 0 },
+ { "readtime", "readDemo", kGenHEPC, UNK_LANG, UNK, 0 },
+ { "readtime", "Blues-ReadingTime Demo", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
{ "SamsFunShop", "SamsFunShop", kGenHEPC, UNK_LANG, UNK, 0 },
{ "SamsFunShop", "Sam's FunShop", kGenHEMac, UNK_LANG, Common::kPlatformMacintosh, 0 },
diff --git a/engines/scumm/dialogs.cpp b/engines/scumm/dialogs.cpp
index 5b6c2bcf35..6d1cf1bbd8 100644
--- a/engines/scumm/dialogs.cpp
+++ b/engines/scumm/dialogs.cpp
@@ -692,8 +692,8 @@ void HelpDialog::displayKeyBindings() {
_dsc[i]->setLabel(dscStr[i]);
}
- delete [] keyStr;
- delete [] dscStr;
+ delete[] keyStr;
+ delete[] dscStr;
}
void HelpDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {
diff --git a/engines/scumm/nut_renderer.cpp b/engines/scumm/nut_renderer.cpp
index 71182ca7a0..d56017c6f5 100644
--- a/engines/scumm/nut_renderer.cpp
+++ b/engines/scumm/nut_renderer.cpp
@@ -41,8 +41,8 @@ NutRenderer::NutRenderer(ScummEngine *vm, const char *filename) :
}
NutRenderer::~NutRenderer() {
- delete [] _charBuffer;
- delete [] _decodedData;
+ delete[] _charBuffer;
+ delete[] _decodedData;
}
void smush_decode_codec1(byte *dst, const byte *src, int left, int top, int width, int height, int pitch);
@@ -254,14 +254,14 @@ void NutRenderer::loadFont(const char *filename) {
offset += (dstPitch * _chars[l].height);
}
- delete [] _decodedData;
+ delete[] _decodedData;
_decodedData = compressedData;
_charBuffer = new byte[_maxCharSize];
}
- delete [] dataSrc;
- delete [] _paletteMap;
+ delete[] dataSrc;
+ delete[] _paletteMap;
}
int NutRenderer::getCharWidth(byte c) const {
diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp
index a8ef26c484..36b82519e9 100644
--- a/engines/scumm/saveload.cpp
+++ b/engines/scumm/saveload.cpp
@@ -23,6 +23,8 @@
*
*/
+#include <time.h> // for ScummEngine::saveInfos / ScummEngine::loadInfos
+
#include "common/config-manager.h"
#include "common/savefile.h"
#include "common/system.h"
@@ -44,8 +46,6 @@
#include "sound/audiocd.h"
#include "sound/mixer.h"
-#include <time.h> // for ScummEngine::saveInfos / ScummEngine::loadInfos
-
namespace Scumm {
struct SaveGameHeader {
diff --git a/engines/scumm/script_v6.cpp b/engines/scumm/script_v6.cpp
index faae72b6dd..04ea53137b 100644
--- a/engines/scumm/script_v6.cpp
+++ b/engines/scumm/script_v6.cpp
@@ -23,6 +23,8 @@
*
*/
+#include <time.h> // for ScummEngine_v6::o6_getDateTime()
+
#include "common/config-manager.h"
#include "common/system.h"
@@ -44,8 +46,6 @@
#include "sound/mididrv.h"
#include "sound/mixer.h"
-#include <time.h> // for ScummEngine_v6::o6_getDateTime()
-
namespace Scumm {
#define OPCODE(x) _OPCODE(ScummEngine_v6, x)
diff --git a/engines/scumm/scumm-md5.h b/engines/scumm/scumm-md5.h
index ce78e0507a..62d777aa33 100644
--- a/engines/scumm/scumm-md5.h
+++ b/engines/scumm/scumm-md5.h
@@ -1,5 +1,5 @@
/*
- This file was generated by the md5table tool on Wed Apr 16 02:07:50 2008
+ This file was generated by the md5table tool on Mon Jun 02 08:37:50 2008
DO NOT EDIT MANUALLY!
*/
@@ -107,6 +107,7 @@ static const MD5Table md5table[] = {
{ "22c9eb04455440131ffc157aeb8d40a8", "fbear", "HE 70", "Demo", -1, Common::EN_ANY, Common::kPlatformWindows },
{ "22d07d6c386c9c25aca5dac2a0c0d94b", "maniac", "NES", "", 262144, Common::SE_SWE, Common::kPlatformNES },
{ "22f4ea88a09da12df9308ba30bcb7d0f", "loom", "EGA", "EGA", -1, Common::EN_ANY, Common::kPlatformPC },
+ { "23394c8d29cc63c61313959431a12476", "spyfox", "HE 100", "Updated", -1, Common::EN_ANY, Common::kPlatformWindows },
{ "257f8c14d8c584f7ddd601bcb00920c7", "maniac", "NES", "", 262144, Common::DE_DEU, Common::kPlatformNES },
{ "2723fea3dae0cb47768c424b145ae0e7", "tentacle", "", "Floppy", 7932, Common::EN_ANY, Common::kPlatformPC },
{ "27b3a4224ad63d5b04627595c1c1a025", "zak", "V2", "V2", -1, Common::IT_ITA, Common::kPlatformAmiga },
@@ -156,6 +157,7 @@ static const MD5Table md5table[] = {
{ "39fd6db10d0222d817025c4d3346e3b4", "farm", "", "Demo", -1, Common::EN_ANY, Common::kPlatformMacintosh },
{ "3a03dab514e4038df192d8a8de469788", "atlantis", "", "Floppy", -1, Common::EN_ANY, Common::kPlatformAmiga },
{ "3a0c35f3c147b98a2bdf8d400cfc4ab5", "indy3", "FM-TOWNS", "", -1, Common::JA_JPN, Common::kPlatformFMTowns },
+ { "3a3e592b074f595489f7f11e150c398d", "puttzoo", "HE 99", "Updated", -1, Common::EN_USA, Common::kPlatformWindows },
{ "3a5d13675e9a23aedac0bac7730f0ac1", "samnmax", "", "CD", -1, Common::FR_FRA, Common::kPlatformMacintosh },
{ "3a5ec90d556d4920976c5578bfbfaf79", "maniac", "NES", "extracted", -1, Common::DE_DEU, Common::kPlatformNES },
{ "3af61c5edf8e15b43dbafd285b2e9777", "puttcircus", "", "Demo", -1, Common::HB_ISR, Common::kPlatformWindows },
@@ -285,6 +287,7 @@ static const MD5Table md5table[] = {
{ "7020931d5a2be0a49d68e7a1882363e4", "zak", "V1", "V1", 1896, Common::EN_ANY, Common::kPlatformPC },
{ "70b0719ac3a5b47ae233c561823d5b96", "puttzoo", "", "", -1, Common::NL_NLD, Common::kPlatformMacintosh },
{ "71523b539491527d9860f4407faf0411", "monkey", "Demo", "EGA Demo", 7607, Common::EN_ANY, Common::kPlatformPC },
+ { "71d384e7676c53d513ddd333eae1d82c", "Blues123time", "", "", -1, Common::EN_ANY, Common::kPlatformUnknown },
{ "71fe97c3108678cf604f14abe342341b", "spyfox2", "", "", -1, Common::NL_NLD, Common::kPlatformWindows },
{ "7222f260253f325c21fcfa68b5bfab67", "spyfox2", "", "Demo", -1, Common::EN_USA, Common::kPlatformUnknown },
{ "72ac6bc980d5101c2142189d746bd62f", "spyfox", "HE 99", "", -1, Common::RU_RUS, Common::kPlatformWindows },
@@ -300,6 +303,7 @@ static const MD5Table md5table[] = {
{ "771bc18ec6f93837b839c992b211904b", "monkey", "Demo", "EGA Demo", -1, Common::DE_DEU, Common::kPlatformPC },
{ "77f5c9cc0986eb729c1a6b4c8823bbae", "zak", "FM-TOWNS", "Demo", 7520, Common::EN_ANY, Common::kPlatformFMTowns },
{ "780e4a0ae2ff17dc296f4a79543b44f8", "puttmoon", "", "", -1, Common::UNK_LANG, Common::kPlatformPC },
+ { "782393c5934ecd0b536eaf5fd541bd26", "pajama", "HE 100", "Updated", -1, Common::EN_ANY, Common::kPlatformWindows },
{ "78bd5f036ea35a878b74e4f47941f784", "freddi4", "HE 99", "", -1, Common::RU_RUS, Common::kPlatformWindows },
{ "78c07ca088526d8d4446a4c2cb501203", "freddi3", "HE 99", "", -1, Common::FR_FRA, Common::kPlatformUnknown },
{ "7974365d3dc0f43a2748c975f91ff042", "monkey2", "", "", -1, Common::ES_ESP, Common::kPlatformPC },
@@ -360,6 +364,7 @@ static const MD5Table md5table[] = {
{ "92fc0073a4cf259ff36070ecb8628ba8", "thinkerk", "", "", -1, Common::EN_USA, Common::kPlatformUnknown },
{ "94aaedbb8f26d71ed3ad6dd34490e29e", "tentacle", "", "Floppy", -1, Common::FR_FRA, Common::kPlatformPC },
{ "94db6519da85b8d08c976d8e9a858ea7", "baseball", "HE CUP", "Preview", 10044774, Common::UNK_LANG, Common::kPlatformUnknown },
+ { "95818b178d473c989ac753574e8892aa", "readtime", "", "Demo", -1, Common::EN_ANY, Common::kPlatformUnknown },
{ "95b3806e043be08668c54c3ffe98650f", "BluesABCTime", "", "", -1, Common::EN_ANY, Common::kPlatformUnknown },
{ "96a3069a3c63caa7329588ce1fef41ee", "spyozon", "", "", -1, Common::RU_RUS, Common::kPlatformUnknown },
{ "9708cf716ed8bcc9ff3fcfc69413b746", "puttputt", "HE 61", "", -1, Common::EN_ANY, Common::kPlatformPC },
@@ -388,6 +393,7 @@ static const MD5Table md5table[] = {
{ "a095e33061606d231ff37dca4c64c8ac", "pajama", "HE 99", "", -1, Common::DE_DEU, Common::kPlatformUnknown },
{ "a0a7dea72003933b8b3f8b99b9f7ddeb", "loom", "No Adlib", "EGA", -1, Common::EN_ANY, Common::kPlatformAtariST },
{ "a194f15f51ee62badab74b9e7da97693", "baseball2001", "", "Demo", 20507, Common::EN_ANY, Common::kPlatformUnknown },
+ { "a197a87ae77f3b3333f09a7a2c448fe2", "freddi", "HE 99", "Updated", -1, Common::EN_ANY, Common::kPlatformWindows },
{ "a28135a7ade38cc0208b04507c46efd1", "spyfox", "HE 99", "", -1, Common::DE_DEU, Common::kPlatformUnknown },
{ "a2bb6aa0537402c1b3c2ea899ccef64b", "lost", "HE 99", "Demo", 15540, Common::EN_ANY, Common::kPlatformWindows },
{ "a3036878840720fbefa41e6965fa4a0a", "samnmax", "", "Floppy", -1, Common::EN_ANY, Common::kPlatformPC },
@@ -427,6 +433,7 @@ static const MD5Table md5table[] = {
{ "bbadf7309c4a2c2763e4bbba3c3be634", "freddi3", "", "Demo", -1, Common::FR_FRA, Common::kPlatformUnknown },
{ "bc4700bc0e12879f6d25d14d6be6cfdd", "spyfox2", "", "", -1, Common::DE_DEU, Common::kPlatformUnknown },
{ "bd126753de619a495f9f22adc951c8d5", "monkey2", "", "", -1, Common::IT_ITA, Common::kPlatformPC },
+ { "be2abe172f58db170de3a037daa1dd27", "puttputt", "HE 61", "", -1, Common::JA_JPN, Common::kPlatform3DO },
{ "be39a5d4db60e8aa736b9086778cb45c", "spyozon", "", "", -1, Common::EN_GRB, Common::kPlatformWindows },
{ "be83e882b44f2767bc08d4f766ebc347", "maniac", "V2", "V2", -1, Common::DE_DEU, Common::kPlatformAtariST },
{ "bf8b52fdd9a69c67f34e8e9fec72661c", "farm", "HE 71", "Demo", -1, Common::EN_ANY, Common::kPlatformWindows },
@@ -471,6 +478,7 @@ static const MD5Table md5table[] = {
{ "cf8d13446ec6cb6222287a925fd47c1d", "baseball", "", "", -1, Common::EN_ANY, Common::kPlatformUnknown },
{ "cf8ef3a1fb483c5c4b1c584d1167b2c4", "freddi", "HE 73", "", -1, Common::DE_DEU, Common::kPlatformWindows },
{ "cf90b4db5486ef798db78fe6fbf897e5", "pajama3", "", "Demo", -1, Common::EN_USA, Common::kPlatformWindows },
+ { "d00ffc8c32d17e575fd985d435d2eb88", "arttime", "", "Demo", -1, Common::EN_ANY, Common::kPlatformUnknown },
{ "d0549508a06bbb9f99ed19c9e97891f3", "football2002", "", "", -1, Common::EN_ANY, Common::kPlatformUnknown },
{ "d06fbe28818fef7bfc45c2cdf0c0849d", "zak", "V2", "V2", -1, Common::DE_DEU, Common::kPlatformPC },
{ "d0ad929def3e9cfe39dea55bd12098d4", "puttcircus", "", "", -1, Common::FR_FRA, Common::kPlatformWindows },
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index c99856b3a3..2f0593dca8 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -555,8 +555,8 @@ ScummEngine::~ScummEngine() {
for (int i = 0; i < _numActors; ++i)
delete _actors[i];
- delete [] _actors;
- delete [] _sortedActors;
+ delete[] _actors;
+ delete[] _sortedActors;
delete _2byteFontPtr;
delete _charset;
@@ -903,7 +903,7 @@ ScummEngine_v8::ScummEngine_v8(OSystem *syst, const DetectorResult &dr)
}
ScummEngine_v8::~ScummEngine_v8() {
- delete [] _objectIDMap;
+ delete[] _objectIDMap;
}
#endif
diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h
index 26b6aa6e2f..20824ffe74 100644
--- a/engines/scumm/scumm.h
+++ b/engines/scumm/scumm.h
@@ -221,7 +221,6 @@ enum ScummGameId {
GID_FBEAR,
GID_FUNPACK,
GID_FREDDI3,
- GID_WATER,
GID_PUTTRACE,
GID_FUNSHOP, // Used for all three funshops
GID_FOOTBALL,
diff --git a/engines/scumm/smush/channel.cpp b/engines/scumm/smush/channel.cpp
index 5b8cd3a853..ccf67764e3 100644
--- a/engines/scumm/smush/channel.cpp
+++ b/engines/scumm/smush/channel.cpp
@@ -70,7 +70,7 @@ void SmushChannel::processBuffer() {
_tbufferSize = 0;
}
if (_sbufferSize == 0) {
- delete []_sbuffer;
+ delete[] _sbuffer;
_sbuffer = 0;
}
} else {
@@ -90,7 +90,7 @@ void SmushChannel::processBuffer() {
if (!_sbuffer)
error("smush channel failed to allocate memory");
memcpy(_sbuffer, _tbuffer + offset, _sbufferSize);
- delete []_tbuffer;
+ delete[] _tbuffer;
_tbuffer = 0;
_tbufferSize = 0;
} else {
@@ -102,7 +102,7 @@ void SmushChannel::processBuffer() {
error("smush channel failed to allocate memory");
memcpy(_tbuffer, old + offset, new_size);
_tbufferSize = new_size;
- delete []old;
+ delete[] old;
}
}
}
diff --git a/engines/scumm/smush/codec37.cpp b/engines/scumm/smush/codec37.cpp
index 0c1db13a26..658d67c1b4 100644
--- a/engines/scumm/smush/codec37.cpp
+++ b/engines/scumm/smush/codec37.cpp
@@ -52,7 +52,7 @@ Codec37Decoder::Codec37Decoder(int width, int height) {
Codec37Decoder::~Codec37Decoder() {
if (_offsetTable) {
- delete []_offsetTable;
+ delete[] _offsetTable;
_offsetTable = 0;
_tableLastPitch = -1;
_tableLastIndex = -1;
diff --git a/engines/scumm/smush/imuse_channel.cpp b/engines/scumm/smush/imuse_channel.cpp
index 3a0efbc6b7..822f32a896 100644
--- a/engines/scumm/smush/imuse_channel.cpp
+++ b/engines/scumm/smush/imuse_channel.cpp
@@ -83,7 +83,7 @@ bool ImuseChannel::appendData(Chunk &b, int32 size) {
if (!_tbuffer)
error("imuse_channel failed to allocate memory");
memcpy(_tbuffer, old, _tbufferSize);
- delete []old;
+ delete[] old;
b.read(_tbuffer + _tbufferSize, size);
_tbufferSize += size;
} else {
@@ -155,7 +155,7 @@ void ImuseChannel::decode() {
_tbuffer = new byte[new_size];
if (!_tbuffer) error("imuse_channel failed to allocate memory");
memcpy(_tbuffer, old, _tbufferSize);
- delete []old;
+ delete[] old;
memcpy(_tbuffer + _tbufferSize, _sbuffer + _sbufferSize - remaining_size, remaining_size);
_tbufferSize += remaining_size;
}
@@ -180,7 +180,7 @@ void ImuseChannel::decode() {
value = ((((v2 & 0xf0) << 4) | v3) << 4) - 0x8000;
WRITE_BE_UINT16(decoded, value); decoded += 2;
}
- delete []_sbuffer;
+ delete[] _sbuffer;
_sbuffer = (byte *)keep;
_sbufferSize = new_size;
}
diff --git a/engines/scumm/smush/saud_channel.cpp b/engines/scumm/smush/saud_channel.cpp
index 17296704ea..2fe34efe29 100644
--- a/engines/scumm/smush/saud_channel.cpp
+++ b/engines/scumm/smush/saud_channel.cpp
@@ -135,7 +135,7 @@ bool SaudChannel::appendData(Chunk &b, int32 size) {
if (!_tbuffer)
error("saud_channel failed to allocate memory");
memcpy(_tbuffer, old, _tbufferSize);
- delete []old;
+ delete[] old;
b.read(_tbuffer + _tbufferSize, size);
_tbufferSize += size;
} else {
diff --git a/engines/scumm/smush/smush_player.cpp b/engines/scumm/smush/smush_player.cpp
index 906395c0ca..494357a90c 100644
--- a/engines/scumm/smush/smush_player.cpp
+++ b/engines/scumm/smush/smush_player.cpp
@@ -86,7 +86,7 @@ public:
}
~StringResource() {
for (int32 i = 0; i < _nbStrings; i++) {
- delete []_strings[i].string;
+ delete[] _strings[i].string;
}
}
@@ -206,7 +206,7 @@ static StringResource *getStrings(ScummEngine *vm, const char *file, bool is_enc
StringResource *sr = new StringResource;
assert(sr);
sr->init(filebuffer, length);
- delete []filebuffer;
+ delete[] filebuffer;
return sr;
}
diff --git a/engines/scumm/string.cpp b/engines/scumm/string.cpp
index f42a803a3d..f039e2ca23 100644
--- a/engines/scumm/string.cpp
+++ b/engines/scumm/string.cpp
@@ -174,11 +174,10 @@ void ScummEngine_v6::drawBlastTexts() {
// Some localizations may override colors
// See credits in Chinese COMI
- if (c == '^' && (buf == _blastTextQueue[i].text + 1)) {
- int color;
- switch (*buf) {
- case 'c':
- color = buf[3] - '0' + 10 *(buf[2] - '0');
+ if (_game.id == GID_CMI && _language == Common::ZH_TWN &&
+ c == '^' && (buf == _blastTextQueue[i].text + 1)) {
+ if (*buf == 'c') {
+ int color = buf[3] - '0' + 10 *(buf[2] - '0');
_charset->setColor(color);
buf += 4;
@@ -1114,7 +1113,8 @@ int ScummEngine::convertMessageToString(const byte *msg, byte *dst, int dstSize)
num += (_game.version == 8) ? 4 : 2;
}
} else {
- if (!(chr == '@' && _game.heversion <= 71) || _language == Common::ZH_TWN) {
+ if (!(chr == '@' && _game.heversion <= 71) ||
+ (_game.id == GID_CMI && _language == Common::ZH_TWN)) {
*dst++ = chr;
}
}
@@ -1462,8 +1462,17 @@ void ScummEngine_v7::translateText(const byte *text, byte *trans_buff) {
trans_buff[0] = 0;
_lastStringTag[0] = 0;
+ if (_game.version >= 7 && text[0] == '/') {
+ // Extract the string tag from the text: /..../
+ for (i = 0; (i < 12) && (text[i + 1] != '/'); i++)
+ _lastStringTag[i] = toupper(text[i + 1]);
+ _lastStringTag[i] = 0;
+ }
+
// WORKAROUND for bug #1172655.
if (_game.id == GID_DIG) {
+ // Based on the second release of The Dig
+ // Only applies to the subtitles and not speech
if (!strcmp((const char *)text, "faint light"))
text = (const byte *)"/NEW.007/faint light";
else if (!strcmp((const char *)text, "glowing crystal"))
@@ -1488,12 +1497,6 @@ void ScummEngine_v7::translateText(const byte *text, byte *trans_buff) {
text = (const byte *)"/NEW.013/unattached lens";
else if (!strcmp((const char *)text, "lens slot"))
text = (const byte *)"/NEW.014/lens slot";
-
- // Added in second release of The Dig
- else if (!strcmp((const char *)text, "/NEWTON.032/"))
- text = (const byte *)"/NEW.11/You wish.";
- else if (!strcmp((const char *)text, "/NEWTON.034/"))
- text = (const byte *)"/NEW.12/In your dreams";
else if (!strcmp((const char *)text, "Jonathon Jackson"))
text = (const byte *)"Aram Gutowski";
else if (!strcmp((const char *)text, "Brink"))
@@ -1506,8 +1509,8 @@ void ScummEngine_v7::translateText(const byte *text, byte *trans_buff) {
if (_game.version >= 7 && text[0] == '/') {
// Extract the string tag from the text: /..../
for (i = 0; (i < 12) && (text[i + 1] != '/'); i++)
- _lastStringTag[i] = target.tag[i] = toupper(text[i + 1]);
- _lastStringTag[i] = target.tag[i] = 0;
+ target.tag[i] = toupper(text[i + 1]);
+ target.tag[i] = 0;
text += i + 2;
// If a language file was loaded, try to find a translated version
diff --git a/engines/scumm/verbs.cpp b/engines/scumm/verbs.cpp
index cf4711f6a2..0a61d10166 100644
--- a/engines/scumm/verbs.cpp
+++ b/engines/scumm/verbs.cpp
@@ -567,8 +567,8 @@ void ScummEngine::checkExecVerbs() {
_mouseAndKeyboardStat = numpad[_mouseAndKeyboardStat - '0'];
}
- if (_game.platform == Common::kPlatformFMTowns && (_game.id == GID_ZAK || _game.id == GID_INDY3)) {
- // HACK: In the FM-Towns games Indy3 and Zak the most significant bit is set for special keys
+ if (_game.platform == Common::kPlatformFMTowns && _game.version == 3) {
+ // HACK: In the FM-Towns games Indy3, Loom and Zak the most significant bit is set for special keys
// like F5 (=0x8005) or joystick buttons (mask 0xFE00, e.g. SELECT=0xFE40 for the save/load menu).
// Hence the distinction with (_mouseAndKeyboardStat < MBS_MAX_KEY) between mouse- and key-events is not applicable
// to this games, so we have to remap the special keys here.
diff --git a/engines/sky/sky.cpp b/engines/sky/sky.cpp
index e53458e33a..d87ed06fef 100644
--- a/engines/sky/sky.cpp
+++ b/engines/sky/sky.cpp
@@ -435,6 +435,7 @@ int SkyEngine::init() {
SkyEngine::_systemVars.systemFlags |= SF_MUS_OFF;
}
_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume"));
+ _mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, ConfMan.getInt("speech_volume"));
_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume"));
_floppyIntro = ConfMan.getBool("alt_intro");
diff --git a/engines/sword1/control.cpp b/engines/sword1/control.cpp
index 71e25fc56f..980e0b4f9f 100644
--- a/engines/sword1/control.cpp
+++ b/engines/sword1/control.cpp
@@ -1225,7 +1225,7 @@ const uint8 Control::_languageStrings[8 * 20][43] = {
"Testo",
"Fatto",
"OK",
- "Annula",
+ "Annulla",
"Musica",
"Parlato",
"Fx",
diff --git a/engines/sword2/header.h b/engines/sword2/header.h
index 5100e43de1..8cd8c900f8 100644
--- a/engines/sword2/header.h
+++ b/engines/sword2/header.h
@@ -56,7 +56,7 @@ struct ResHeader {
// compressed)
byte name[NAME_LEN]; // Name of object
- static const int size() {
+ static int size() {
return 44;
}
@@ -152,7 +152,7 @@ struct AnimHeader {
uint8 feetEndDir; // Direction to start in after running anim
uint16 blend;
- static const int size() {
+ static int size() {
return 15;
}
@@ -209,7 +209,7 @@ struct CdtEntry {
uint8 frameType; // 0 = print sprite normally with top-left
// corner at (x,y), otherwise see below...
- static const int size() {
+ static int size() {
return 9;
}
@@ -250,7 +250,7 @@ struct FrameHeader {
uint16 width; // Dimensions of frame
uint16 height;
- static const int size() {
+ static int size() {
return 8;
}
@@ -299,7 +299,7 @@ struct MultiScreenHeader {
uint32 paletteTable;
uint32 maskOffset;
- static const int size() {
+ static int size() {
return 36;
}
@@ -339,7 +339,7 @@ struct ScreenHeader {
uint16 height;
uint16 noLayers; // number of layer areas
- static const int size() {
+ static int size() {
return 6;
}
@@ -374,7 +374,7 @@ struct LayerHeader {
uint32 offset; // where to find mask data (from start of
// standard file header)
- static const int size() {
+ static int size() {
return 16;
}
@@ -436,7 +436,7 @@ public:
_addr = NULL;
}
- static const int size() {
+ static int size() {
return 44;
}
@@ -479,7 +479,7 @@ struct TextHeader {
uint32 noOfLines; // how many lines of text are there in this
// module
- static const int size() {
+ static int size() {
return 4;
}
diff --git a/engines/sword2/mouse.cpp b/engines/sword2/mouse.cpp
index 44d2383f78..af4f121e96 100644
--- a/engines/sword2/mouse.cpp
+++ b/engines/sword2/mouse.cpp
@@ -1462,19 +1462,19 @@ void Mouse::checkPlayerActivity(uint32 seconds) {
_vm->_logic->writeVar(RESULT, 0);
}
-void Mouse::pauseGame() {
- // Make the mouse cursor normal. This is the only place where we are
- // allowed to clear the luggage this way.
+void Mouse::pauseEngine(bool pause) {
+ if (pause) {
+ // Make the mouse cursor normal. This is the only place where
+ // we are allowed to clear the luggage this way.
- clearPointerText();
- setLuggageAnim(NULL, 0);
- setMouse(0);
- setMouseTouching(1);
-}
-
-void Mouse::unpauseGame() {
- if (_vm->_logic->readVar(OBJECT_HELD) && _realLuggageItem)
- setLuggage(_realLuggageItem);
+ clearPointerText();
+ setLuggageAnim(NULL, 0);
+ setMouse(0);
+ setMouseTouching(1);
+ } else {
+ if (_vm->_logic->readVar(OBJECT_HELD) && _realLuggageItem)
+ setLuggage(_realLuggageItem);
+ }
}
#define MOUSEFLASHFRAME 6
diff --git a/engines/sword2/mouse.h b/engines/sword2/mouse.h
index 09ac9ced20..b87129ac7f 100644
--- a/engines/sword2/mouse.h
+++ b/engines/sword2/mouse.h
@@ -211,8 +211,7 @@ public:
uint32 getMouseTouching() { return _mouseTouching; }
void setMouseTouching(uint32 touching) { _mouseTouching = touching; }
- void pauseGame();
- void unpauseGame();
+ void pauseEngine(bool pause);
void setMouse(uint32 res);
void setLuggage(uint32 res);
diff --git a/engines/sword2/object.h b/engines/sword2/object.h
index 57f020eb63..b6b6ca5174 100644
--- a/engines/sword2/object.h
+++ b/engines/sword2/object.h
@@ -48,7 +48,7 @@ struct ObjectMouse {
int32 priority;
int32 pointer; // type (or resource id?) of pointer used over this area
- static const int size() {
+ static int size() {
return 24;
}
@@ -91,7 +91,7 @@ public:
_addr = addr;
}
- static const int size() {
+ static int size() {
return 8;
}
@@ -139,7 +139,7 @@ public:
_addr = addr;
}
- static const int size() {
+ static int size() {
return 12;
}
@@ -178,7 +178,7 @@ public:
_addr = addr;
}
- static const int size() {
+ static int size() {
return 36;
}
@@ -240,7 +240,7 @@ public:
_addr = addr;
}
- static const int size() {
+ static int size() {
return 56;
}
@@ -291,7 +291,7 @@ struct ObjectWalkdata {
int32 dx[8 * (12 + 1)]; // walk step distances in x direction
int32 dy[8 * (12 + 1)]; // walk step distances in y direction
- static const int size() {
+ static int size() {
return 916;
}
diff --git a/engines/sword2/palette.cpp b/engines/sword2/palette.cpp
index 1b9cd28d25..81f93c77ae 100644
--- a/engines/sword2/palette.cpp
+++ b/engines/sword2/palette.cpp
@@ -156,22 +156,17 @@ void Screen::setPalette(int16 startEntry, int16 noEntries, byte *colourTable, ui
memcpy(&_palette[4 * startEntry], colourTable, noEntries * 4);
if (fadeNow == RDPAL_INSTANT) {
- _vm->_system->setPalette(_palette, startEntry, noEntries);
+ setSystemPalette(_palette, startEntry, noEntries);
setNeedFullRedraw();
}
}
-void Screen::dimPalette() {
- byte *p = _palette;
-
- for (int i = 0; i < 256; i++) {
- p[i * 4 + 0] /= 2;
- p[i * 4 + 1] /= 2;
- p[i * 4 + 2] /= 2;
+void Screen::dimPalette(bool dim) {
+ if (dim != _dimPalette) {
+ _dimPalette = dim;
+ setSystemPalette(_palette, 0, 256);
+ setNeedFullRedraw();
}
-
- _vm->_system->setPalette(p, 0, 256);
- setNeedFullRedraw();
}
/**
@@ -269,8 +264,24 @@ void Screen::fadeServer() {
}
}
- _vm->_system->setPalette(newPalette, 0, 256);
+ setSystemPalette(newPalette, 0, 256);
setNeedFullRedraw();
}
+void Screen::setSystemPalette(const byte *colors, uint start, uint num) {
+ const byte *palette;
+
+ if (_dimPalette) {
+ byte pal[256 * 4];
+
+ for (uint i = start * 4; i < 4 * (start + num); i++)
+ pal[i] = colors[i] / 2;
+
+ palette = pal;
+ } else
+ palette = colors;
+
+ _vm->_system->setPalette(palette, start, num);
+}
+
} // End of namespace Sword2
diff --git a/engines/sword2/resman.cpp b/engines/sword2/resman.cpp
index 88a1f6251a..d6b8025cda 100644
--- a/engines/sword2/resman.cpp
+++ b/engines/sword2/resman.cpp
@@ -191,7 +191,7 @@ bool ResourceManager::init() {
if (cdInf[i].cd == 0 && !Common::File::exists((char *)cdInf[i].clusterName)) {
_vm->GUIErrorMessage("Broken Sword 2: Cannot find " + Common::String((char *)cdInf[i].clusterName));
- delete [] cdInf;
+ delete[] cdInf;
return false;
}
}
@@ -205,7 +205,7 @@ bool ResourceManager::init() {
}
if (j == _totalClusters) {
- delete [] cdInf;
+ delete[] cdInf;
_vm->GUIErrorMessage(Common::String(_resFiles[i].fileName) + " is not in cd.inf");
return false;
}
@@ -213,7 +213,7 @@ bool ResourceManager::init() {
_resFiles[i].cd = cdInf[j].cd;
}
- delete [] cdInf;
+ delete[] cdInf;
debug(1, "%d resources in %d cluster files", _totalResFiles, _totalClusters);
for (i = 0; i < _totalClusters; i++)
diff --git a/engines/sword2/screen.cpp b/engines/sword2/screen.cpp
index 1f6eb1b22d..fdabb3ee6f 100644
--- a/engines/sword2/screen.cpp
+++ b/engines/sword2/screen.cpp
@@ -97,6 +97,8 @@ Screen::Screen(Sword2Engine *vm, int16 width, int16 height) {
_renderAverageTime = 60;
_layer = 0;
+
+ _dimPalette = false;
}
Screen::~Screen() {
diff --git a/engines/sword2/screen.h b/engines/sword2/screen.h
index d59a6ef3df..6defe51fdc 100644
--- a/engines/sword2/screen.h
+++ b/engines/sword2/screen.h
@@ -187,7 +187,7 @@ struct Parallax {
// The dimensions are followed by an offset table, but we don't know in
// advance how big it is. See initializeBackgroundLayer().
- static const int size() {
+ static int size() {
return 4;
}
@@ -350,6 +350,8 @@ private:
uint16 _layer;
+ bool _dimPalette;
+
public:
Screen(Sword2Engine *vm, int16 width, int16 height);
~Screen();
@@ -400,11 +402,12 @@ public:
void setFullPalette(int32 palRes);
void setPalette(int16 startEntry, int16 noEntries, byte *palette, uint8 setNow);
+ void setSystemPalette(const byte *colors, uint start, uint num);
uint8 quickMatch(uint8 r, uint8 g, uint8 b);
int32 fadeUp(float time = 0.75);
int32 fadeDown(float time = 0.75);
uint8 getFadeStatus();
- void dimPalette();
+ void dimPalette(bool dim);
void waitForFade();
void fadeServer();
diff --git a/engines/sword2/sword2.cpp b/engines/sword2/sword2.cpp
index 0601d11791..7331d1f761 100644
--- a/engines/sword2/sword2.cpp
+++ b/engines/sword2/sword2.cpp
@@ -225,7 +225,6 @@ Sword2Engine::Sword2Engine(OSystem *syst) : Engine(syst) {
#endif
_gamePaused = false;
- _graphicsLevelFudged = false;
_gameCycle = 0;
_gameSpeed = 1;
@@ -392,7 +391,7 @@ int Sword2Engine::go() {
#ifdef SWORD2_DEBUG
if (_stepOneCycle) {
- pauseGame();
+ pauseEngineIntern(true);
_stepOneCycle = false;
}
#endif
@@ -406,9 +405,9 @@ int Sword2Engine::go() {
switch (ke->kbd.keycode) {
case Common::KEYCODE_p:
if (_gamePaused)
- unpauseGame();
+ pauseEngineIntern(false);
else
- pauseGame();
+ pauseEngineIntern(true);
break;
case Common::KEYCODE_c:
if (!_logic->readVar(DEMO) && !_mouse->isChoosing()) {
@@ -421,7 +420,7 @@ int Sword2Engine::go() {
case Common::KEYCODE_SPACE:
if (_gamePaused) {
_stepOneCycle = true;
- unpauseGame();
+ pauseEngineIntern(false);
}
break;
case Common::KEYCODE_s:
@@ -689,53 +688,41 @@ void Sword2Engine::sleepUntil(uint32 time) {
}
}
-void Sword2Engine::pauseGame() {
- // Don't allow Pause while screen fading or while black
- if (_screen->getFadeStatus() != RDFADE_NONE)
- return;
+void Sword2Engine::pauseEngineIntern(bool pause) {
+ if (pause) {
+ // FIXME: We should never disallow pausing, and we need to do
+ // something about pausing during cutscene moves, credits, etc.
- _sound->pauseAllSound();
- _mouse->pauseGame();
+ // Don't allow Pause while screen fading or while black
+ if (_screen->getFadeStatus() != RDFADE_NONE)
+ return;
- // If render level is at max, turn it down because palette-matching
- // won't work when the palette is dimmed.
-
- if (_screen->getRenderLevel() == 3) {
- _screen->setRenderLevel(2);
- _graphicsLevelFudged = true;
- }
+ _sound->pauseAllSound();
+ _mouse->pauseEngine(true);
#ifdef SWORD2_DEBUG
- // Don't dim it if we're single-stepping through frames
- // dim the palette during the pause
+ // Don't dim it if we're single-stepping through frames
+ // dim the palette during the pause
- if (!_stepOneCycle)
- _screen->dimPalette();
+ if (!_stepOneCycle)
+ _screen->dimPalette(true);
#else
- _screen->dimPalette();
+ _screen->dimPalette(true);
#endif
- _gamePaused = true;
-}
+ _gamePaused = true;
+ } else {
+ _mouse->pauseEngine(false);
+ _sound->unpauseAllSound();
-void Sword2Engine::unpauseGame() {
- _mouse->unpauseGame();
- _sound->unpauseAllSound();
+ _screen->dimPalette(false);
- // Put back game screen palette; see screen.cpp
- _screen->setFullPalette(-1);
+ _gamePaused = false;
- // If graphics level at max, turn up again
- if (_graphicsLevelFudged) {
- _screen->setRenderLevel(3);
- _graphicsLevelFudged = false;
+ // If mouse is about or we're in a chooser menu
+ if (!_mouse->getMouseStatus() || _mouse->isChoosing())
+ _mouse->setMouse(NORMAL_MOUSE_ID);
}
-
- _gamePaused = false;
-
- // If mouse is about or we're in a chooser menu
- if (!_mouse->getMouseStatus() || _mouse->isChoosing())
- _mouse->setMouse(NORMAL_MOUSE_ID);
}
uint32 Sword2Engine::getMillis() {
diff --git a/engines/sword2/sword2.h b/engines/sword2/sword2.h
index a9a1e21875..05c5d7fa47 100644
--- a/engines/sword2/sword2.h
+++ b/engines/sword2/sword2.h
@@ -113,8 +113,7 @@ private:
uint32 calcChecksum(byte *buffer, uint32 size);
- void pauseGame();
- void unpauseGame();
+ virtual void pauseEngineIntern(bool pause);
uint32 _totalStartups;
uint32 _totalScreenManagers;
@@ -208,7 +207,6 @@ public:
uint32 findBufferSize();
bool _gamePaused;
- bool _graphicsLevelFudged;
void startGame();
void gameCycle();
diff --git a/graphics/cursorman.h b/graphics/cursorman.h
index c15c65cb94..151038e118 100644
--- a/graphics/cursorman.h
+++ b/graphics/cursorman.h
@@ -152,7 +152,7 @@ private:
}
~Cursor() {
- delete [] _data;
+ delete[] _data;
}
};
@@ -180,7 +180,7 @@ private:
}
~Palette() {
- delete [] _data;
+ delete[] _data;
}
};
diff --git a/graphics/fontman.h b/graphics/fontman.h
index eeefab77ec..7121c314cd 100644
--- a/graphics/fontman.h
+++ b/graphics/fontman.h
@@ -84,7 +84,7 @@ private:
friend class Common::Singleton<SingletonBaseType>;
FontManager();
- Common::HashMap<Common::String, const Font *, Common::CaseSensitiveString_Hash, Common::CaseSensitiveString_EqualTo> _fontMap;
+ Common::HashMap<Common::String, const Font *> _fontMap;
};
diff --git a/graphics/imageman.cpp b/graphics/imageman.cpp
index 6ab64e8bca..83ffc40c99 100644
--- a/graphics/imageman.cpp
+++ b/graphics/imageman.cpp
@@ -110,7 +110,7 @@ bool ImageManager::registerSurface(const Common::String &name, Surface *surf) {
unzCloseCurrentFile(file->file);
Common::MemoryReadStream stream(buffer, fileInfo.uncompressed_size);
surf = ImageDecoder::loadFile(stream);
- delete [] buffer;
+ delete[] buffer;
if (!surf)
return false;
diff --git a/gui/ListWidget.cpp b/gui/ListWidget.cpp
index c43a0f64d7..80898d06c8 100644
--- a/gui/ListWidget.cpp
+++ b/gui/ListWidget.cpp
@@ -495,7 +495,7 @@ void ListWidget::reflowLayout() {
_entriesPerPage = (_h - _topPadding - _bottomPadding) / kLineHeight;
- delete [] _textWidth;
+ delete[] _textWidth;
_textWidth = new int[_entriesPerPage];
for (int i = 0; i < _entriesPerPage; i++)
diff --git a/gui/ThemeModern.cpp b/gui/ThemeModern.cpp
index 69595eb219..177171b40c 100644
--- a/gui/ThemeModern.cpp
+++ b/gui/ThemeModern.cpp
@@ -114,8 +114,8 @@ _forceRedraw(false), _lastUsedBitMask(0), _fonts(), _cursor(0), _imageHandles(),
ThemeModern::~ThemeModern() {
deleteFonts();
deinit();
- delete [] _images;
- delete [] _cursor;
+ delete[] _images;
+ delete[] _cursor;
_images = 0;
for (int i = 0; i < kImageHandlesMax; ++i) {
ImageMan.unregisterSurface(_imageHandles[i]);
@@ -1470,7 +1470,7 @@ void ThemeModern::createCursor() {
_system->colorToRGB(_colors[kColorTransparency], r, g, b);
uint16 transparency = RGBToColor<ColorMasks<565> >(r, g, b);
- delete [] _cursor;
+ delete[] _cursor;
_cursor = new byte[_cursorWidth * _cursorHeight];
assert(_cursor);
@@ -1502,7 +1502,7 @@ void ThemeModern::createCursor() {
}
_useCursor = true;
- delete [] table;
+ delete[] table;
}
#pragma mark -
diff --git a/gui/about.cpp b/gui/about.cpp
index c346d5ad87..758f3ee6a7 100644
--- a/gui/about.cpp
+++ b/gui/about.cpp
@@ -22,7 +22,7 @@
* $Id$
*/
-#include "engines/engine.h"
+#include "engines/metaengine.h"
#include "base/plugins.h"
#include "base/version.h"
#include "common/events.h"
@@ -128,8 +128,8 @@ AboutDialog::AboutDialog()
_lines.push_back("");
addLine("\\C\\c1""Available engines:");
- const PluginList &plugins = PluginManager::instance().getPlugins();
- PluginList::const_iterator iter = plugins.begin();
+ const EnginePlugin::List &plugins = EngineMan.getPlugins();
+ EnginePlugin::List::const_iterator iter = plugins.begin();
for (; iter != plugins.end(); ++iter) {
Common::String str;
str = "\\C";
@@ -137,7 +137,7 @@ AboutDialog::AboutDialog()
addLine(str.c_str());
str = "\\C\\c2";
- str += (**iter).getCopyright();
+ str += (**iter)->getCopyright();
addLine(str.c_str());
//addLine("");
diff --git a/gui/console.cpp b/gui/console.cpp
index b57ccbdaa6..728724d76f 100644
--- a/gui/console.cpp
+++ b/gui/console.cpp
@@ -295,7 +295,7 @@ void ConsoleDialog::handleKeyDown(Common::KeyState state) {
keepRunning = (*_callbackProc)(this, str, _callbackRefCon);
// Get rid of the string buffer
- delete [] str;
+ delete[] str;
}
print(PROMPT);
diff --git a/gui/credits.h b/gui/credits.h
index a84cc53d98..41544a2248 100644
--- a/gui/credits.h
+++ b/gui/credits.h
@@ -144,6 +144,9 @@ static const char *credits[] = {
"\\C\\c0""Jurgen Braam",
"\\C\\c0""Lars Persson",
"\\C\\c0""",
+"\\C\\c1""Wii",
+"\\C\\c0""Andre Heider",
+"\\C\\c0""",
"\\C\\c0""",
"\\C\\c1""Other subsystems",
"\\C\\c1""Infrastructure",
diff --git a/gui/debugger.cpp b/gui/debugger.cpp
index 99aebe9b62..87abe854be 100644
--- a/gui/debugger.cpp
+++ b/gui/debugger.cpp
@@ -406,7 +406,7 @@ bool Debugger::Cmd_Help(int argc, const char **argv) {
}
bool Debugger::Cmd_DebugFlagsList(int argc, const char **argv) {
- const Common::Array<Common::EngineDebugLevel> &debugLevels = Common::listSpecialDebugLevels();
+ const Common::DebugLevelContainer &debugLevels = Common::listSpecialDebugLevels();
DebugPrintf("Engine debug levels:\n");
DebugPrintf("--------------------\n");
@@ -414,8 +414,8 @@ bool Debugger::Cmd_DebugFlagsList(int argc, const char **argv) {
DebugPrintf("No engine debug levels\n");
return true;
}
- for (uint i = 0; i < debugLevels.size(); ++i) {
- DebugPrintf("'%s' - Description: %s\n", debugLevels[i].option.c_str(), debugLevels[i].description.c_str());
+ for (Common::DebugLevelContainer::const_iterator i = debugLevels.begin(); i != debugLevels.end(); ++i) {
+ DebugPrintf("'%s' - Description: %s\n", i->option.c_str(), i->description.c_str());
}
DebugPrintf("\n");
return true;
diff --git a/gui/eval.cpp b/gui/eval.cpp
index a2aec6d0d3..716006c108 100644
--- a/gui/eval.cpp
+++ b/gui/eval.cpp
@@ -102,7 +102,7 @@ void Eval::level4(int *result) {
char op;
op = 0;
- if ((_tokenType == tDelimiter) && *_token == '+' || *_token == '-') {
+ if ((_tokenType == tDelimiter) && (*_token == '+' || *_token == '-')) {
op = *_token;
getToken();
}
diff --git a/gui/eval.h b/gui/eval.h
index 245ab1230b..47c8313903 100644
--- a/gui/eval.h
+++ b/gui/eval.h
@@ -68,9 +68,9 @@ public:
char *lastToken() { return _token; }
- typedef HashMap<String, int, Common::CaseSensitiveString_Hash, Common::CaseSensitiveString_EqualTo> VariablesMap;
- typedef HashMap<String, String, Common::CaseSensitiveString_Hash, Common::CaseSensitiveString_EqualTo> AliasesMap;
- typedef HashMap<String, String, Common::CaseSensitiveString_Hash, Common::CaseSensitiveString_EqualTo> StringsMap;
+ typedef HashMap<String, int> VariablesMap;
+ typedef HashMap<String, String> AliasesMap;
+ typedef HashMap<String, String> StringsMap;
private:
enum TokenTypes {
diff --git a/gui/launcher.cpp b/gui/launcher.cpp
index 2be703a405..2c1212b84a 100644
--- a/gui/launcher.cpp
+++ b/gui/launcher.cpp
@@ -22,9 +22,7 @@
* $Id$
*/
-#include "engines/engine.h"
-#include "base/game.h"
-#include "base/plugins.h"
+#include "engines/metaengine.h"
#include "base/version.h"
#include "common/config-manager.h"
@@ -574,27 +572,27 @@ void LauncherDialog::updateListing() {
// Retrieve a list of all games defined in the config file
_domains.clear();
const ConfigManager::DomainMap &domains = ConfMan.getGameDomains();
- ConfigManager::DomainMap::const_iterator iter = domains.begin();
+ ConfigManager::DomainMap::const_iterator iter;
for (iter = domains.begin(); iter != domains.end(); ++iter) {
+#ifdef __DS__
+ // DS port uses an extra section called 'ds'. This prevents the section from being
+ // detected as a game.
+ if (iter->_key == "ds") {
+ continue;
+ }
+#endif
+
String gameid(iter->_value.get("gameid"));
String description(iter->_value.get("description"));
if (gameid.empty())
gameid = iter->_key;
if (description.empty()) {
- GameDescriptor g = Base::findGame(gameid);
+ GameDescriptor g = EngineMan.findGame(gameid);
if (g.contains("description"))
description = g.description();
}
-#ifdef __DS__
- // DS port uses an extra section called 'ds'. This prevents the section from being
- // detected as a game.
- if (gameid == "ds") {
- continue;
- }
-#endif
-
if (description.empty())
description = "Unknown (target " + iter->_key + ", gameid " + gameid + ")";
@@ -659,7 +657,7 @@ void LauncherDialog::addGame() {
// ...so let's determine a list of candidates, games that
// could be contained in the specified directory.
- GameList candidates(PluginManager::instance().detectGames(files));
+ GameList candidates(EngineMan.detectGames(files));
int idx;
if (candidates.empty()) {
@@ -783,7 +781,7 @@ void LauncherDialog::editGame(int item) {
String gameId(ConfMan.get("gameid", _domains[item]));
if (gameId.empty())
gameId = _domains[item];
- EditGameDialog editDialog(_domains[item], Base::findGame(gameId).description());
+ EditGameDialog editDialog(_domains[item], EngineMan.findGame(gameId).description());
if (editDialog.runModal() > 0) {
// User pressed OK, so make changes permanent
diff --git a/gui/launcher.h b/gui/launcher.h
index 164a7e0707..a9d09bf109 100644
--- a/gui/launcher.h
+++ b/gui/launcher.h
@@ -26,6 +26,7 @@
#define LAUNCHER_DIALOG_H
#include "gui/dialog.h"
+#include "base/game.h"
#include "common/str.h"
namespace GUI {
diff --git a/gui/massadd.cpp b/gui/massadd.cpp
index 934957e80b..687d367516 100644
--- a/gui/massadd.cpp
+++ b/gui/massadd.cpp
@@ -22,10 +22,9 @@
* $Id$
*/
-#include "engines/engine.h"
-#include "base/game.h"
-#include "base/plugins.h"
+#include "engines/metaengine.h"
#include "common/events.h"
+#include "common/config-manager.h"
#include "gui/launcher.h" // For addGameToConf()
#include "gui/massadd.h"
@@ -89,6 +88,29 @@ MassAddDialog::MassAddDialog(const FilesystemNode &startDir)
new ButtonWidget(this, "massadddialog_cancel", "Cancel", kCancelCmd, Common::ASCII_ESCAPE);
+ // Build a map from all configured game paths to the targets using them
+ const Common::ConfigManager::DomainMap &domains = ConfMan.getGameDomains();
+ Common::ConfigManager::DomainMap::const_iterator iter;
+ for (iter = domains.begin(); iter != domains.end(); ++iter) {
+
+#ifdef __DS__
+ // DS port uses an extra section called 'ds'. This prevents the section from being
+ // detected as a game.
+ if (iter->_key == "ds") {
+ continue;
+ }
+#endif
+
+ Common::String path(iter->_value.get("path"));
+ // Remove trailing slash, so that "/foo" and "/foo/" match.
+ // This works around a bug in the POSIX FS code (and others?)
+ // where paths are not normalized (so FSNodes refering to identical
+ // FS objects may return different values in path()).
+ while (path != "/" && path.lastChar() == '/')
+ path.deleteLastChar();
+ if (!path.empty())
+ _pathToTargets[path].push_back(iter->_key);
+ }
}
@@ -132,15 +154,42 @@ void MassAddDialog::handleTickle() {
}
// Run the detector on the dir
- GameList candidates(PluginManager::instance().detectGames(files));
+ GameList candidates(EngineMan.detectGames(files));
// Just add all detected games / game variants. If we get more than one,
// that either means the directory contains multiple games, or the detector
// could not fully determine which game variant it was seeing. In either
// case, let the user choose which entries he wants to keep.
+ //
+ // However, we only add games which are not already in the config file.
for (GameList::const_iterator cand = candidates.begin(); cand != candidates.end(); ++cand) {
GameDescriptor result = *cand;
- result["path"] = dir.getPath();
+ Common::String path = dir.getPath();
+
+ // Remove trailing slashes
+ while (path != "/" && path.lastChar() == '/')
+ path.deleteLastChar();
+
+ // Check for existing config entries for this path/gameid/lang/platform combination
+ if (_pathToTargets.contains(path)) {
+ bool duplicate = false;
+ const Common::StringList &targets = _pathToTargets[path];
+ for (Common::StringList::const_iterator iter = targets.begin(); iter != targets.end(); ++iter) {
+ // If the gameid, platform and language match -> skip it
+ Common::ConfigManager::Domain *dom = ConfMan.getDomain(*iter);
+ assert(dom);
+
+ if ((*dom)["gameid"] == result["gameid"] &&
+ (*dom)["platform"] == result["platform"] &&
+ (*dom)["language"] == result["language"]) {
+ duplicate = true;
+ break;
+ }
+ }
+ if (duplicate)
+ break; // Skip duplicates
+ }
+ result["path"] = path;
_games.push_back(result);
}
@@ -166,14 +215,14 @@ void MassAddDialog::handleTickle() {
snprintf(buf, sizeof(buf), "Scan complete!");
_dirProgressText->setLabel(buf);
- snprintf(buf, sizeof(buf), "Discovered %d games.", _games.size());
+ snprintf(buf, sizeof(buf), "Discovered %d new games.", _games.size());
_gameProgressText->setLabel(buf);
} else {
snprintf(buf, sizeof(buf), "Scanned %d directories ...", _dirsScanned);
_dirProgressText->setLabel(buf);
- snprintf(buf, sizeof(buf), "Discovered %d games ...", _games.size());
+ snprintf(buf, sizeof(buf), "Discovered %d new games ...", _games.size());
_gameProgressText->setLabel(buf);
}
diff --git a/gui/massadd.h b/gui/massadd.h
index 29d24ca9a5..e0eff75c64 100644
--- a/gui/massadd.h
+++ b/gui/massadd.h
@@ -27,7 +27,10 @@
#include "gui/dialog.h"
#include "common/fs.h"
+#include "common/hashmap.h"
#include "common/stack.h"
+#include "common/str.h"
+#include "common/hash-str.h"
namespace GUI {
@@ -45,6 +48,13 @@ private:
Common::Stack<FilesystemNode> _scanStack;
GameList _games;
+ /**
+ * Map each path occuring in the config file to the target(s) using that path.
+ * Used to detect whether a potential new target is already present in the
+ * config manager.
+ */
+ Common::HashMap<Common::String, Common::StringList> _pathToTargets;
+
int _dirsScanned;
Widget *_okButton;
diff --git a/gui/newgui.cpp b/gui/newgui.cpp
index 5e034b726c..0bf61d084f 100644
--- a/gui/newgui.cpp
+++ b/gui/newgui.cpp
@@ -219,6 +219,7 @@ void NewGui::runLoop() {
Dialog *activeDialog = getTopDialog();
bool didSaveState = false;
int button;
+ uint32 time;
if (activeDialog == 0)
return;
@@ -252,7 +253,6 @@ void NewGui::runLoop() {
_system->updateScreen();
Common::Event event;
- uint32 time = _system->getMillis();
while (eventMan->pollEvent(event)) {
if (activeDialog != getTopDialog() && event.type != Common::EVENT_QUIT && event.type != Common::EVENT_SCREEN_CHANGED)
@@ -288,6 +288,7 @@ void NewGui::runLoop() {
case Common::EVENT_LBUTTONDOWN:
case Common::EVENT_RBUTTONDOWN:
button = (event.type == Common::EVENT_LBUTTONDOWN ? 1 : 2);
+ time = _system->getMillis();
if (_lastClick.count && (time < _lastClick.time + kDoubleClickDelay)
&& ABS(_lastClick.x - event.mouse.x) < 3
&& ABS(_lastClick.y - event.mouse.y) < 3) {
diff --git a/gui/options.cpp b/gui/options.cpp
index 7972ceebb2..d6f5306ce2 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -55,6 +55,7 @@ enum {
kChooseSaveDirCmd = 'chos',
kChooseThemeDirCmd = 'chth',
kChooseExtraDirCmd = 'chex',
+ kChoosePluginsDirCmd = 'chpl',
kChooseThemeCmd = 'chtf'
};
@@ -706,6 +707,11 @@ GlobalOptionsDialog::GlobalOptionsDialog()
new ButtonWidget(tab, "globaloptions_extrabutton", "Extra Path:", kChooseExtraDirCmd, 0);
_extraPath = new StaticTextWidget(tab, "globaloptions_extrapath", "None");
+
+#ifdef DYNAMIC_MODULES
+ new ButtonWidget(tab, "globaloptions_pluginsbutton", "Plugins Path:", kChoosePluginsDirCmd, 0);
+ _pluginsPath = new StaticTextWidget(tab, "globaloptions_pluginspath", "None");
+#endif
#endif
#ifdef SMALL_SCREEN_DEVICE
@@ -772,6 +778,15 @@ void GlobalOptionsDialog::open() {
} else {
_extraPath->setLabel(extraPath);
}
+
+#ifdef DYNAMIC_MODULES
+ Common::String pluginsPath(ConfMan.get("pluginspath", _domain));
+ if (pluginsPath.empty() || !ConfMan.hasKey("pluginspath", _domain)) {
+ _pluginsPath->setLabel("None");
+ } else {
+ _pluginsPath->setLabel(pluginsPath);
+ }
+#endif
#endif
// Misc Tab
@@ -801,6 +816,14 @@ void GlobalOptionsDialog::close() {
else
ConfMan.removeKey("extrapath", _domain);
+#ifdef DYNAMIC_MODULES
+ String pluginsPath(_pluginsPath->getLabel());
+ if (!pluginsPath.empty() && (pluginsPath != "None"))
+ ConfMan.set("pluginspath", pluginsPath, _domain);
+ else
+ ConfMan.removeKey("pluginspath", _domain);
+#endif
+
ConfMan.setInt("autosave_period", _autosavePeriodPopUp->getSelectedTag(), _domain);
}
OptionsDialog::close();
@@ -844,6 +867,18 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3
}
break;
}
+#ifdef DYNAMIC_MODULES
+ case kChoosePluginsDirCmd: {
+ BrowserDialog browser("Select directory for plugins", true);
+ if (browser.runModal() > 0) {
+ // User made his choice...
+ FilesystemNode dir(browser.getResult());
+ _pluginsPath->setLabel(dir.getPath());
+ draw();
+ }
+ break;
+ }
+#endif
case kChooseSoundFontCmd: {
BrowserDialog browser("Select SoundFont", false);
if (browser.runModal() > 0) {
diff --git a/gui/options.h b/gui/options.h
index 6f0fccf3cb..8f4496c753 100644
--- a/gui/options.h
+++ b/gui/options.h
@@ -158,6 +158,9 @@ protected:
StaticTextWidget *_savePath;
StaticTextWidget *_themePath;
StaticTextWidget *_extraPath;
+#ifdef DYNAMIC_MODULES
+ StaticTextWidget *_pluginsPath;
+#endif
//
// Misc controls
diff --git a/gui/theme-config.cpp b/gui/theme-config.cpp
index e6d8026edb..47f60d3d7b 100644
--- a/gui/theme-config.cpp
+++ b/gui/theme-config.cpp
@@ -215,6 +215,9 @@ const char *Theme::_defaultConfigINI =
"globaloptions_themebutton=10 yoffset (buttonWidth + 5) buttonHeight\n"
"globaloptions_themepath=(prev.x2 + 20) (yoffset + glOff) (parent.w - (prev.w + 20) - 15) kLineHeight\n"
"yoffset=(yoffset + buttonHeight + 4)\n"
+"globaloptions_pluginsbutton=10 yoffset (buttonWidth + 5) buttonHeight\n"
+"globaloptions_pluginspath=(prev.x2 + 20) (yoffset + glOff) (parent.w - (prev.w + 20) - 15) kLineHeight\n"
+"yoffset=(yoffset + buttonHeight + 4)\n"
"globaloptions_keysbutton=10 yoffset (buttonWidth + 5) buttonHeight\n"
"\n"
"# Misc options\n"
diff --git a/gui/theme.cpp b/gui/theme.cpp
index a044769bfd..c8501c4f91 100644
--- a/gui/theme.cpp
+++ b/gui/theme.cpp
@@ -82,7 +82,7 @@ const Graphics::Font *Theme::loadFont(const char *filename) {
font = Graphics::NewFont::loadFromCache(stream);
- delete [] buffer;
+ delete[] buffer;
buffer = 0;
}
unzClose(zipFile);
@@ -112,7 +112,7 @@ const Graphics::Font *Theme::loadFont(const char *filename) {
font = Graphics::NewFont::loadFont(stream);
- delete [] buffer;
+ delete[] buffer;
buffer = 0;
}
unzClose(zipFile);
@@ -175,7 +175,7 @@ bool Theme::loadConfigFile(const Common::String &stylefile) {
unzClose(zipFile);
return false;
}
- delete [] buffer;
+ delete[] buffer;
buffer = 0;
} else {
unzClose(zipFile);
@@ -225,7 +225,7 @@ bool Theme::themeConfigUseable(const Common::String &stylefile, const Common::St
unzClose(zipFile);
return false;
}
- delete [] buffer;
+ delete[] buffer;
buffer = 0;
}
} else {
diff --git a/gui/themes/classic080.ini b/gui/themes/classic080.ini
index 23d91b701e..b5c911bada 100644
--- a/gui/themes/classic080.ini
+++ b/gui/themes/classic080.ini
@@ -134,6 +134,9 @@ yoffset=(yoffset + buttonHeight + 4)
globaloptions_themebutton=10 yoffset (buttonWidth + 5) buttonHeight
globaloptions_themepath=(prev.x2 + 20) (yoffset + glOff) (parent.w - (prev.w + 20) - 15) kLineHeight
yoffset=(yoffset + buttonHeight + 4)
+globaloptions_pluginsbutton=10 yoffset (buttonWidth + 5) buttonHeight
+globaloptions_pluginspath=(prev.x2 + 20) (yoffset + glOff) (parent.w - (prev.w + 20) - 15) kLineHeight
+yoffset=(yoffset + buttonHeight + 4)
globaloptions_keysbutton=10 yoffset (buttonWidth + 5) buttonHeight
# Misc options
diff --git a/gui/themes/modern.ini b/gui/themes/modern.ini
index b5929511b0..87ef0bcbb9 100644
--- a/gui/themes/modern.ini
+++ b/gui/themes/modern.ini
@@ -295,6 +295,9 @@ yoffset=(yoffset + buttonHeight + ySeparation)
globaloptions_themebutton=xBorder yoffset buttonWidth buttonHeight
globaloptions_themepath=(prev.x2 + xSeparation) (yoffset + glOff) (parent.w - self.x - xBorder) kLineHeight
yoffset=(yoffset + buttonHeight + ySeparation)
+globaloptions_pluginsbutton=xBorder yoffset buttonWidth buttonHeight
+globaloptions_pluginspath=(prev.x2 + xSeparation) (yoffset + glOff) (parent.w - self.x - xBorder) kLineHeight
+yoffset=(yoffset + buttonHeight + ySeparation)
globaloptions_keysbutton=xBorder yoffset buttonWidth buttonHeight
# Misc options
diff --git a/sound/audiostream.cpp b/sound/audiostream.cpp
index 771baf351a..588c49ebec 100644
--- a/sound/audiostream.cpp
+++ b/sound/audiostream.cpp
@@ -102,6 +102,11 @@ AudioStream* AudioStream::openStreamFile(const Common::String &basename, uint32
#pragma mark --- LinearMemoryStream ---
#pragma mark -
+inline int32 calculatePlayTime(int rate, int samples) {
+ int32 seconds = samples / rate;
+ int32 milliseconds = (1000 * (samples % rate)) / rate;
+ return seconds * 1000 + milliseconds;
+}
/**
* A simple raw audio stream, purely memory based. It operates on a single
@@ -122,23 +127,26 @@ protected:
const byte *_loopEnd;
const int _rate;
const byte *_origPtr;
+ const int32 _playtime;
public:
LinearMemoryStream(int rate, const byte *ptr, uint len, uint loopOffset, uint loopLen, bool autoFreeMemory)
- : _ptr(ptr), _end(ptr+len), _loopPtr(0), _loopEnd(0), _rate(rate) {
+ : _ptr(ptr), _end(ptr+len), _loopPtr(0), _loopEnd(0), _rate(rate), _playtime(calculatePlayTime(rate, len / (is16Bit ? 2 : 1) / (stereo ? 2 : 1))) {
// Verify the buffer sizes are sane
- if (is16Bit && stereo)
+ if (is16Bit && stereo) {
assert((len & 3) == 0 && (loopLen & 3) == 0);
- else if (is16Bit || stereo)
+ } else if (is16Bit || stereo) {
assert((len & 1) == 0 && (loopLen & 1) == 0);
+ }
if (loopLen) {
_loopPtr = _ptr + loopOffset;
_loopEnd = _loopPtr + loopLen;
}
- if (stereo) // Stereo requires even sized data
+ if (stereo) { // Stereo requires even sized data
assert(len % 2 == 0);
+ }
_origPtr = autoFreeMemory ? ptr : 0;
}
@@ -147,10 +155,11 @@ public:
}
int readBuffer(int16 *buffer, const int numSamples);
- bool isStereo() const { return stereo; }
- bool endOfData() const { return _ptr >= _end; }
+ bool isStereo() const { return stereo; }
+ bool endOfData() const { return _ptr >= _end; }
- int getRate() const { return _rate; }
+ int getRate() const { return _rate; }
+ int32 getTotalPlayTime() const { return _playtime; }
};
template<bool stereo, bool is16Bit, bool isUnsigned, bool isLE>
@@ -300,7 +309,7 @@ int AppendableMemoryStream<stereo, is16Bit, isUnsigned, isLE>::readBuffer(int16
assert(buf.start <= _pos && _pos <= buf.end);
const int samplesLeftInCurBuffer = buf.end - _pos;
if (samplesLeftInCurBuffer == 0) {
- delete [] buf.start;
+ delete[] buf.start;
_bufferQueue.erase(_bufferQueue.begin());
_pos = 0;
continue;
@@ -322,10 +331,11 @@ void AppendableMemoryStream<stereo, is16Bit, isUnsigned, isLE>::queueBuffer(byte
Common::StackLock lock(_mutex);
// Verify the buffer size is sane
- if (is16Bit && stereo)
+ if (is16Bit && stereo) {
assert((size & 3) == 0);
- else if (is16Bit || stereo)
+ } else if (is16Bit || stereo) {
assert((size & 1) == 0);
+ }
// Verify that the stream has not yet been finalized (by a call to finish())
assert(!_finalized);
diff --git a/sound/audiostream.h b/sound/audiostream.h
index ed6b37e51c..04133936ee 100644
--- a/sound/audiostream.h
+++ b/sound/audiostream.h
@@ -93,6 +93,20 @@ public:
* NULL in case of an error (e.g. invalid/nonexisting file)
*/
static AudioStream* openStreamFile(const Common::String &basename, uint32 startTime = 0, uint32 duration = 0, uint numLoops = 1);
+
+ enum {
+ kUnknownPlayTime = -1
+ };
+
+ /**
+ * Returns total playtime of the AudioStream object.
+ * Note that this does not require to return an playtime, if the
+ * playtime of the AudioStream is unknown it returns 'kUnknownPlayTime'.
+ * @see kUnknownPlayTime
+ *
+ * @return playtime in milliseconds
+ */
+ virtual int32 getTotalPlayTime() const { return kUnknownPlayTime; }
};
/**
diff --git a/sound/flac.cpp b/sound/flac.cpp
index 8dc3586142..f058d2dc6f 100644
--- a/sound/flac.cpp
+++ b/sound/flac.cpp
@@ -102,6 +102,9 @@ protected:
/** index + 1(!) of the last sample to be played - 0 is end of stream */
FLAC__uint64 _lastSample;
+ /** total play time */
+ int32 _totalPlayTime;
+
/** true if the last sample was decoded from the FLAC-API - there might still be data in the buffer */
bool _lastSampleWritten;
@@ -141,6 +144,8 @@ public:
return _streaminfo.channels == 0 || (_lastSampleWritten && _sampleCache.bufFill == 0);
}
+ int32 getTotalPlayTime() const { return _totalPlayTime; }
+
bool isStreamDecoderReady() const { return getStreamDecoderState() == FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC ; }
protected:
@@ -235,7 +240,28 @@ FlacInputStream::FlacInputStream(Common::SeekableReadStream *inStream, bool disp
// avoid overflows).
_firstSample = (FLAC__uint64)(startTime * (_streaminfo.sample_rate / 1000.0));
_lastSample = (FLAC__uint64)(endTime * (_streaminfo.sample_rate / 1000.0));
+
if (_firstSample == 0 || seekAbsolute(_firstSample)) {
+ int32 samples = kUnknownPlayTime;
+
+ if (!_lastSample) {
+ if (_streaminfo.total_samples)
+ samples = _streaminfo.total_samples - _firstSample;
+ } else {
+ samples = _lastSample - _firstSample - 1;
+ }
+
+ if (samples != kUnknownPlayTime && samples >= 0 && numLoops) {
+ const int32 rate = _streaminfo.sample_rate;
+
+ int32 seconds = samples / rate;
+ int32 milliseconds = (1000 * (samples % rate)) / rate;
+
+ _totalPlayTime = (seconds * 1000 + milliseconds) * numLoops;
+ } else {
+ _totalPlayTime = kUnknownPlayTime;
+ }
+
return; // no error occured
}
}
diff --git a/sound/fmopl.h b/sound/fmopl.h
index cc2f967f25..890a2d1a56 100644
--- a/sound/fmopl.h
+++ b/sound/fmopl.h
@@ -167,7 +167,7 @@ int OPLTimerOver(FM_OPL *OPL, int c);
void OPLWriteReg(FM_OPL *OPL, int r, int v);
void YM3812UpdateOne(FM_OPL *OPL, int16 *buffer, int length);
-#endif
-
// Factory method
FM_OPL *makeAdlibOPL(int rate);
+
+#endif
diff --git a/sound/mididrv.cpp b/sound/mididrv.cpp
index 53bc224180..358d42d751 100644
--- a/sound/mididrv.cpp
+++ b/sound/mididrv.cpp
@@ -216,7 +216,7 @@ int MidiDriver::detectMusicDriver(int flags) {
MidiDriver *MidiDriver::createMidi(int midiDriver) {
switch (midiDriver) {
- case MD_NULL: return MidiDriver_NULL_create();
+ case MD_NULL: return MidiDriver_NULL_create(g_system->getMixer());
case MD_ADLIB: return MidiDriver_ADLIB_create(g_system->getMixer());
@@ -238,34 +238,34 @@ MidiDriver *MidiDriver::createMidi(int midiDriver) {
#if defined(PALMOS_MODE)
#if defined(COMPILE_CLIE)
- case MD_YPA1: return MidiDriver_YamahaPa1_create();
+ case MD_YPA1: return MidiDriver_YamahaPa1_create(g_system->getMixer());
#elif defined(COMPILE_ZODIAC) && (!defined(ENABLE_SCUMM) || !defined(PALMOS_ARM))
- case MD_ZODIAC: return MidiDriver_Zodiac_create();
+ case MD_ZODIAC: return MidiDriver_Zodiac_create(g_system->getMixer());
#endif
#endif
#if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__SYMBIAN32__)
- case MD_WINDOWS: return MidiDriver_WIN_create();
+ case MD_WINDOWS: return MidiDriver_WIN_create(g_system->getMixer());
#endif
#if defined(UNIX) && !defined(__BEOS__) && !defined(MACOSX) && !defined(__MAEMO__)
- case MD_SEQ: return MidiDriver_SEQ_create();
+ case MD_SEQ: return MidiDriver_SEQ_create(g_system->getMixer());
#endif
#if defined(UNIX)
- case MD_TIMIDITY: return MidiDriver_TIMIDITY_create();
+ case MD_TIMIDITY: return MidiDriver_TIMIDITY_create(g_system->getMixer());
#endif
#if defined(IRIX)
- case MD_DMEDIA: return MidiDriver_DMEDIA_create();
+ case MD_DMEDIA: return MidiDriver_DMEDIA_create(g_system->getMixer());
#endif
#if defined(MACOSX)
- case MD_QTMUSIC: return MidiDriver_QT_create();
- case MD_COREAUDIO: return MidiDriver_CORE_create();
- case MD_COREMIDI: return MidiDriver_CoreMIDI_create();
+ case MD_QTMUSIC: return MidiDriver_QT_create(g_system->getMixer());
+ case MD_COREAUDIO: return MidiDriver_CORE_create(g_system->getMixer());
+ case MD_COREMIDI: return MidiDriver_CoreMIDI_create(g_system->getMixer());
#endif
#if defined(UNIX) && defined(USE_ALSA)
- case MD_ALSA: return MidiDriver_ALSA_create();
+ case MD_ALSA: return MidiDriver_ALSA_create(g_system->getMixer());
#endif
#if defined(__amigaos4__)
- case MD_CAMD: return MidiDriver_CAMD_create();
+ case MD_CAMD: return MidiDriver_CAMD_create(g_system->getMixer());
#endif
}
diff --git a/sound/mididrv.h b/sound/mididrv.h
index 38621530a4..12513268a8 100644
--- a/sound/mididrv.h
+++ b/sound/mididrv.h
@@ -64,9 +64,6 @@ enum MidiDriverType {
MD_YPA1,
MD_ZODIAC,
- // MorphOS
- MD_ETUDE,
-
// IRIX
MD_DMEDIA,
@@ -271,18 +268,17 @@ public:
// Factory functions, for faster compile
-extern MidiDriver *MidiDriver_NULL_create();
+extern MidiDriver *MidiDriver_NULL_create(Audio::Mixer *mixer);
extern MidiDriver *MidiDriver_ADLIB_create(Audio::Mixer *mixer);
-extern MidiDriver *MidiDriver_WIN_create();
-extern MidiDriver *MidiDriver_SEQ_create();
-extern MidiDriver *MidiDriver_TIMIDITY_create();
-extern MidiDriver *MidiDriver_QT_create();
-extern MidiDriver *MidiDriver_CORE_create();
-extern MidiDriver *MidiDriver_CoreMIDI_create();
-extern MidiDriver *MidiDriver_ETUDE_create();
-extern MidiDriver *MidiDriver_ALSA_create();
-extern MidiDriver *MidiDriver_DMEDIA_create();
-extern MidiDriver *MidiDriver_CAMD_create();
+extern MidiDriver *MidiDriver_WIN_create(Audio::Mixer *mixer);
+extern MidiDriver *MidiDriver_SEQ_create(Audio::Mixer *mixer);
+extern MidiDriver *MidiDriver_TIMIDITY_create(Audio::Mixer *mixer);
+extern MidiDriver *MidiDriver_QT_create(Audio::Mixer *mixer);
+extern MidiDriver *MidiDriver_CORE_create(Audio::Mixer *mixer);
+extern MidiDriver *MidiDriver_CoreMIDI_create(Audio::Mixer *mixer);
+extern MidiDriver *MidiDriver_ALSA_create(Audio::Mixer *mixer);
+extern MidiDriver *MidiDriver_DMEDIA_create(Audio::Mixer *mixer);
+extern MidiDriver *MidiDriver_CAMD_create(Audio::Mixer *mixer);
extern MidiDriver *MidiDriver_YM2612_create(Audio::Mixer *mixer);
#ifdef USE_FLUIDSYNTH
extern MidiDriver *MidiDriver_FluidSynth_create(Audio::Mixer *mixer);
@@ -290,7 +286,7 @@ extern MidiDriver *MidiDriver_FluidSynth_create(Audio::Mixer *mixer);
#ifdef USE_MT32EMU
extern MidiDriver *MidiDriver_MT32_create(Audio::Mixer *mixer);
#endif
-extern MidiDriver *MidiDriver_YamahaPa1_create();
-extern MidiDriver *MidiDriver_Zodiac_create();
+extern MidiDriver *MidiDriver_YamahaPa1_create(Audio::Mixer *mixer);
+extern MidiDriver *MidiDriver_Zodiac_create(Audio::Mixer *mixer);
#endif
diff --git a/sound/mixer.h b/sound/mixer.h
index d46a933d97..26ae0898fd 100644
--- a/sound/mixer.h
+++ b/sound/mixer.h
@@ -147,7 +147,7 @@ public:
SoundType type,
SoundHandle *handle,
void *sound, uint32 size, uint rate, byte flags,
- int id = -1, byte volume = 255, int8 balance = 0,
+ int id = -1, byte volume = kMaxChannelVolume, int8 balance = 0,
uint32 loopStart = 0, uint32 loopEnd = 0);
/**
@@ -174,7 +174,7 @@ public:
SoundType type,
SoundHandle *handle,
AudioStream *input,
- int id = -1, byte volume = 255, int8 balance = 0,
+ int id = -1, byte volume = kMaxChannelVolume, int8 balance = 0,
bool autofreeStream = true,
bool permanent = false,
bool reverseStereo = false);
@@ -258,7 +258,7 @@ public:
* Set the channel volume for the given handle.
*
* @param handle the sound to affect
- * @param volume the new channel volume (0 - 255)
+ * @param volume the new channel volume (0 - kMaxChannelVolume)
*/
void setChannelVolume(SoundHandle handle, byte volume);
@@ -290,7 +290,7 @@ public:
* Set the volume for the given sound type.
*
* @param type the sound type
- * @param volume the new global volume, 0-kMaxMixerVolume
+ * @param volume the new global volume, 0 - kMaxMixerVolume
*/
void setVolumeForSoundType(SoundType type, int volume);
@@ -298,7 +298,7 @@ public:
* Query the global volume.
*
* @param type the sound type
- * @return the global music volume, 0-kMaxMixerVolume
+ * @return the global music volume, 0 - kMaxMixerVolume
*/
int getVolumeForSoundType(SoundType type) const;
diff --git a/sound/module.mk b/sound/module.mk
index 2f3dc1f987..d99013e7d0 100644
--- a/sound/module.mk
+++ b/sound/module.mk
@@ -15,6 +15,7 @@ MODULE_OBJS := \
mixer.o \
mp3.o \
mpu401.o \
+ musicplugin.o \
null.o \
voc.o \
vorbis.o \
diff --git a/sound/mp3.cpp b/sound/mp3.cpp
index 72ed361926..eea725ce3a 100644
--- a/sound/mp3.cpp
+++ b/sound/mp3.cpp
@@ -63,6 +63,8 @@ protected:
const mad_timer_t _endTime;
mad_timer_t _totalTime;
+ int32 _totalPlayTime;
+
mad_stream _stream;
mad_frame _frame;
mad_synth _synth;
@@ -87,6 +89,7 @@ public:
bool endOfData() const { return _state == MP3_STATE_EOS; }
bool isStereo() const { return MAD_NCHANNELS(&_frame.header) == 2; }
int getRate() const { return _frame.header.samplerate; }
+ int32 getTotalPlayTime() const { return _totalPlayTime; }
protected:
void decodeMP3Data();
@@ -111,6 +114,73 @@ MP3InputStream::MP3InputStream(Common::SeekableReadStream *inStream, bool dispos
// may read a few bytes beyond the end of the input buffer).
memset(_buf + BUFFER_SIZE, 0, MAD_BUFFER_GUARD);
+ // Calculate play time
+ mad_timer_t length;
+
+ mad_timer_set(&length, 0, 0, 1000);
+ mad_timer_add(&length, start);
+ mad_timer_negate(&length);
+
+ if (mad_timer_sign(end) == 0) {
+ mad_timer_add(&length, end);
+ } else {
+ mad_stream_init(&_stream);
+ mad_frame_init(&_frame);
+
+ // Reset the stream data
+ _inStream->seek(0, SEEK_SET);
+
+ // Update state
+ _state = MP3_STATE_READY;
+
+ // Read the first few sample bytes
+ readMP3Data();
+
+ do {
+ // If necessary, load more data into the stream decoder
+ if (_stream.error == MAD_ERROR_BUFLEN)
+ readMP3Data();
+
+ while (_state == MP3_STATE_READY) {
+ _stream.error = MAD_ERROR_NONE;
+
+ // Decode the next header. Note: mad_frame_decode would do this for us, too.
+ // However, for seeking we don't want to decode the full frame (else it would
+ // be far too slow).
+ if (mad_header_decode(&_frame.header, &_stream) == -1) {
+ if (_stream.error == MAD_ERROR_BUFLEN) {
+ break; // Read more data
+ } else if (MAD_RECOVERABLE(_stream.error)) {
+ debug(6, "MP3InputStream: Recoverable error in mad_header_decode (%s)", mad_stream_errorstr(&_stream));
+ continue;
+ } else {
+ warning("MP3InputStream: Unrecoverable error in mad_header_decode (%s)", mad_stream_errorstr(&_stream));
+ break;
+ }
+ }
+
+ // Sum up the total playback time so far
+ mad_timer_add(&length, _frame.header.duration);
+ }
+ } while (_state != MP3_STATE_EOS);
+
+ mad_synth_finish(&_synth);
+ mad_frame_finish(&_frame);
+
+ // Reinit stream
+ _state = MP3_STATE_INIT;
+
+ // Reset the stream data
+ _inStream->seek(0, SEEK_SET);
+ }
+
+ _totalPlayTime = mad_timer_count(length, MAD_UNITS_MILLISECONDS);
+
+ if (numLoops && mad_timer_sign(length) >= 0)
+ _totalPlayTime *= numLoops;
+ else
+ _totalPlayTime = kUnknownPlayTime;
+
// Decode the first chunk of data. This is necessary so that _frame
// is setup and isStereo() and getRate() return correct results.
decodeMP3Data();
diff --git a/backends/fs/gp32/gp32-fs-factory.cpp b/sound/musicplugin.cpp
index 150c4f3236..b4754230da 100644
--- a/backends/fs/gp32/gp32-fs-factory.cpp
+++ b/sound/musicplugin.cpp
@@ -8,35 +8,41 @@
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* $URL$
* $Id$
+ *
*/
-#if defined(__GP32__)
-#include "backends/fs/gp32/gp32-fs-factory.h"
-#include "backends/fs/gp32/gp32-fs.cpp"
-
-DECLARE_SINGLETON(GP32FilesystemFactory);
+#include "sound/musicplugin.h"
-AbstractFilesystemNode *GP32FilesystemFactory::makeRootFileNode() const {
- return new GP32FilesystemNode();
+MusicDevice::MusicDevice(MusicPluginObject const *musicPlugin, Common::String name, MusicType mt) :
+ _musicDriverName(musicPlugin->getName()), _musicDriverId(musicPlugin->getId()),
+ _name(name), _type(mt) {
}
-AbstractFilesystemNode *GP32FilesystemFactory::makeCurrentDirectoryFileNode() const {
- return new GP32FilesystemNode();
-}
+Common::String MusicDevice::getCompleteName() {
+ Common::String name;
+
+ if (_name.empty()) {
+ // Default device, just show the driver name
+ name = _musicDriverName;
+ } else {
+ // Show both device and driver names
+ name = _name;
+ name += " [";
+ name += _musicDriverName;
+ name += "]";
+ }
-AbstractFilesystemNode *GP32FilesystemFactory::makeFileNodePath(const String &path) const {
- return new GP32FilesystemNode(path);
+ return name;
}
-#endif
diff --git a/sound/musicplugin.h b/sound/musicplugin.h
new file mode 100644
index 0000000000..bdbd07ad31
--- /dev/null
+++ b/sound/musicplugin.h
@@ -0,0 +1,127 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ */
+
+#ifndef SOUND_MUSICPLUGIN_H
+#define SOUND_MUSICPLUGIN_H
+
+#include "base/plugins.h"
+#include "sound/mididrv.h"
+
+/**
+ * Music types that music drivers can implement and engines can rely on.
+ */
+enum MusicType {
+ MT_PCSPK = 1, // PC Speaker
+ MT_PCJR = 2, // PCjr
+ MT_ADLIB = 3, // AdLib
+ MT_TOWNS = 4, // FM-TOWNS
+ MT_GM = 5, // General MIDI
+ MT_MT32 = 6, // MT-32
+ MT_GS = 7 // Roland GS
+};
+
+class MusicPluginObject;
+
+/**
+ * Description of a Music device. Used to list the devices a Music driver
+ * can manage and their capabilities.
+ * A device with an empty name means the default device.
+ */
+class MusicDevice {
+public:
+ MusicDevice(MusicPluginObject const *musicPlugin, Common::String name, MusicType mt);
+
+ Common::String &getName() { return _name; }
+ Common::String &getMusicDriverName() { return _musicDriverName; }
+ Common::String &getMusicDriverId() { return _musicDriverId; }
+ MusicType getMusicType() { return _type; }
+
+ /**
+ * Returns a user readable string that contains the name of the current
+ * device name (if it isn't the default one) and the name of the driver.
+ */
+ Common::String getCompleteName();
+
+private:
+ Common::String _name;
+ Common::String _musicDriverName;
+ Common::String _musicDriverId;
+ MusicType _type;
+};
+
+/** List of music devices. */
+typedef Common::List<MusicDevice> MusicDevices;
+
+/**
+ * A MusicPluginObject is essentially a factory for MidiDriver instances with
+ * the added ability of listing the available devices and their capabilities.
+ */
+class MusicPluginObject : public PluginObject {
+public:
+ virtual ~MusicPluginObject() {}
+
+ /**
+ * Returns a unique string identifier which will be used to save the
+ * selected MIDI driver to the config file.
+ */
+ virtual const char *getId() const = 0;
+
+ /**
+ * Returns a list of the available devices.
+ */
+ virtual MusicDevices getDevices() const = 0;
+
+ /**
+ * Tries to instantiate a MIDI Driver instance based on the settings of
+ * the currently active ConfMan target. That is, the MusicPluginObject
+ * should query the ConfMan singleton for the device name, port, etc.
+ *
+ * @param mixer Pointer to the global Mixer object
+ * @param mididriver Pointer to a pointer which the MusicPluginObject sets
+ * to the newly create MidiDriver, or 0 in case of an error
+ * @return a PluginError describing the error which occurred, or kNoError
+ */
+ virtual PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const = 0;
+};
+
+
+// Music plugins
+
+typedef PluginSubclass<MusicPluginObject> MusicPlugin;
+
+/**
+ * Singleton class which manages all Music plugins.
+ */
+class MusicManager : public Common::Singleton<MusicManager> {
+private:
+ friend class Common::Singleton<SingletonBaseType>;
+
+public:
+ const MusicPlugin::List &getPlugins() const;
+};
+
+/** Convenience shortcut for accessing the Music manager. */
+#define MusicMan MusicManager::instance()
+
+#endif
diff --git a/sound/null.cpp b/sound/null.cpp
index 49c57052f9..7559a6d816 100644
--- a/sound/null.cpp
+++ b/sound/null.cpp
@@ -22,6 +22,7 @@
* $Id$
*/
+#include "sound/musicplugin.h"
#include "sound/mpu401.h"
/* NULL driver */
@@ -31,12 +32,53 @@ public:
void send(uint32 b) { }
};
-MidiDriver *MidiDriver_NULL_create() {
- return new MidiDriver_NULL();
+
+// Plugin interface
+
+class NullMusicPlugin : public MusicPluginObject {
+public:
+ const char *getName() const {
+ return "No music";
+ }
+
+ const char *getId() const {
+ return "null";
+ }
+
+ MusicDevices getDevices() const;
+ PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const;
+};
+
+PluginError NullMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const {
+ *mididriver = new MidiDriver_NULL();
+
+ return kNoError;
+}
+
+MusicDevices NullMusicPlugin::getDevices() const {
+ MusicDevices devices;
+ // TODO: return a different music type?
+ devices.push_back(MusicDevice(this, "", MT_GM));
+ return devices;
+}
+
+MidiDriver *MidiDriver_NULL_create(Audio::Mixer *mixer) {
+ MidiDriver *mididriver;
+
+ NullMusicPlugin p;
+ p.createInstance(mixer, &mididriver);
+
+ return mididriver;
}
#ifdef DISABLE_ADLIB
MidiDriver *MidiDriver_ADLIB_create(Audio::Mixer *mixer) {
- return new MidiDriver_NULL();
+ return MidiDriver_NULL_create(mixer);
}
#endif
+
+//#if PLUGIN_ENABLED_DYNAMIC(NULL)
+ //REGISTER_PLUGIN_DYNAMIC(NULL, PLUGIN_TYPE_MUSIC, NullMusicPlugin);
+//#else
+ REGISTER_PLUGIN_STATIC(NULL, PLUGIN_TYPE_MUSIC, NullMusicPlugin);
+//#endif
diff --git a/sound/softsynth/adlib.cpp b/sound/softsynth/adlib.cpp
index 1cf4c2b179..3898956e15 100644
--- a/sound/softsynth/adlib.cpp
+++ b/sound/softsynth/adlib.cpp
@@ -25,6 +25,7 @@
#include "sound/softsynth/emumidi.h"
#include "common/util.h"
#include "sound/fmopl.h"
+#include "sound/musicplugin.h"
#ifdef DEBUG_ADLIB
static int tick;
@@ -970,10 +971,6 @@ MidiChannel *MidiDriver_ADLIB::allocateChannel() {
return NULL;
}
-MidiDriver *MidiDriver_ADLIB_create(Audio::Mixer *mixer) {
- return new MidiDriver_ADLIB(mixer);
-}
-
// All the code brought over from IMuseAdlib
void MidiDriver_ADLIB::adlib_write(byte port, byte value) {
@@ -1517,3 +1514,47 @@ void MidiDriver_ADLIB::adlib_note_on(int chan, byte note, int mod) {
curnote_table[chan] = code;
adlib_playnote(chan, (int16) channel_table_2[chan] + code);
}
+
+
+// Plugin interface
+
+class AdlibEmuMusicPlugin : public MusicPluginObject {
+public:
+ const char *getName() const {
+ return "AdLib Emulator";
+ }
+
+ const char *getId() const {
+ return "adlib";
+ }
+
+ MusicDevices getDevices() const;
+ PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const;
+};
+
+MusicDevices AdlibEmuMusicPlugin::getDevices() const {
+ MusicDevices devices;
+ devices.push_back(MusicDevice(this, "", MT_ADLIB));
+ return devices;
+}
+
+PluginError AdlibEmuMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const {
+ *mididriver = new MidiDriver_ADLIB(mixer);
+
+ return kNoError;
+}
+
+MidiDriver *MidiDriver_ADLIB_create(Audio::Mixer *mixer) {
+ MidiDriver *mididriver;
+
+ AdlibEmuMusicPlugin p;
+ p.createInstance(mixer, &mididriver);
+
+ return mididriver;
+}
+
+//#if PLUGIN_ENABLED_DYNAMIC(ADLIB)
+ //REGISTER_PLUGIN_DYNAMIC(ADLIB, PLUGIN_TYPE_MUSIC, AdlibEmuMusicPlugin);
+//#else
+ REGISTER_PLUGIN_STATIC(ADLIB, PLUGIN_TYPE_MUSIC, AdlibEmuMusicPlugin);
+//#endif
diff --git a/sound/softsynth/fluidsynth.cpp b/sound/softsynth/fluidsynth.cpp
index 4a61cd023b..eff9f4123c 100644
--- a/sound/softsynth/fluidsynth.cpp
+++ b/sound/softsynth/fluidsynth.cpp
@@ -27,6 +27,7 @@
#ifdef USE_FLUIDSYNTH
#include "common/config-manager.h"
+#include "sound/musicplugin.h"
#include "sound/mpu401.h"
#include "sound/softsynth/emumidi.h"
@@ -211,12 +212,52 @@ MidiChannel *MidiDriver_FluidSynth::getPercussionChannel() {
return &_midiChannels[9];
}
-MidiDriver *MidiDriver_FluidSynth_create(Audio::Mixer *mixer) {
- return new MidiDriver_FluidSynth(mixer);
-}
-
void MidiDriver_FluidSynth::generateSamples(int16 *data, int len) {
fluid_synth_write_s16(_synth, len, data, 0, 2, data, 1, 2);
}
+
+// Plugin interface
+
+class FluidSynthMusicPlugin : public MusicPluginObject {
+public:
+ const char *getName() const {
+ return "FluidSynth";
+ }
+
+ const char *getId() const {
+ return "fluidsynth";
+ }
+
+ MusicDevices getDevices() const;
+ PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const;
+};
+
+MusicDevices FluidSynthMusicPlugin::getDevices() const {
+ MusicDevices devices;
+ devices.push_back(MusicDevice(this, "", MT_GM));
+ return devices;
+}
+
+PluginError FluidSynthMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const {
+ *mididriver = new MidiDriver_FluidSynth(mixer);
+
+ return kNoError;
+}
+
+MidiDriver *MidiDriver_FluidSynth_create(Audio::Mixer *mixer) {
+ MidiDriver *mididriver;
+
+ FluidSynthMusicPlugin p;
+ p.createInstance(mixer, &mididriver);
+
+ return mididriver;
+}
+
+//#if PLUGIN_ENABLED_DYNAMIC(FLUIDSYNTH)
+ //REGISTER_PLUGIN_DYNAMIC(FLUIDSYNTH, PLUGIN_TYPE_MUSIC, FluidSynthMusicPlugin);
+//#else
+ REGISTER_PLUGIN_STATIC(FLUIDSYNTH, PLUGIN_TYPE_MUSIC, FluidSynthMusicPlugin);
+//#endif
+
#endif
diff --git a/sound/softsynth/mt32.cpp b/sound/softsynth/mt32.cpp
index 706db826af..053df544b1 100644
--- a/sound/softsynth/mt32.cpp
+++ b/sound/softsynth/mt32.cpp
@@ -29,6 +29,7 @@
#include "sound/softsynth/mt32/mt32emu.h"
#include "sound/softsynth/emumidi.h"
+#include "sound/musicplugin.h"
#include "sound/mpu401.h"
#include "common/config-manager.h"
@@ -479,17 +480,52 @@ void MidiDriver_ThreadedMT32::onTimer() {
}
#endif
-////////////////////////////////////////
-//
-// MidiDriver_MT32 factory
-//
-////////////////////////////////////////
+
+// Plugin interface
+
+class MT32EmuMusicPlugin : public MusicPluginObject {
+public:
+ const char *getName() const {
+ return "MT-32 Emulator";
+ }
+
+ const char *getId() const {
+ return "mt32";
+ }
+
+ MusicDevices getDevices() const;
+ PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const;
+};
+
+MusicDevices MT32EmuMusicPlugin::getDevices() const {
+ MusicDevices devices;
+ devices.push_back(MusicDevice(this, "", MT_MT32));
+ return devices;
+}
+
+PluginError MT32EmuMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const {
+ *mididriver = new MidiDriver_MT32(mixer);
+
+ return kNoError;
+}
MidiDriver *MidiDriver_MT32_create(Audio::Mixer *mixer) {
// HACK: It will stay here until engine plugin loader overhaul
if (ConfMan.hasKey("extrapath"))
Common::File::addDefaultDirectory(ConfMan.get("extrapath"));
- return new MidiDriver_MT32(mixer);
+
+ MidiDriver *mididriver;
+
+ MT32EmuMusicPlugin p;
+ p.createInstance(mixer, &mididriver);
+
+ return mididriver;
}
+//#if PLUGIN_ENABLED_DYNAMIC(MT32)
+ //REGISTER_PLUGIN_DYNAMIC(MT32, PLUGIN_TYPE_MUSIC, MT32EmuMusicPlugin);
+//#else
+ REGISTER_PLUGIN_STATIC(MT32, PLUGIN_TYPE_MUSIC, MT32EmuMusicPlugin);
+//#endif
+
#endif
diff --git a/sound/softsynth/mt32/mt32emu.h b/sound/softsynth/mt32/mt32emu.h
index 0aa4df7488..6eedf04bc0 100644
--- a/sound/softsynth/mt32/mt32emu.h
+++ b/sound/softsynth/mt32/mt32emu.h
@@ -29,7 +29,7 @@
#define MT32EMU_MONITOR_PARTIALS 0
// Determines how the waveform cache file is handled (must be regenerated after sampling rate change)
#define MT32EMU_WAVECACHEMODE 0 // Load existing cache if possible, otherwise generate and save cache
-//#define MT32EMU_WAVECACHEMODE 1 // Load existing cache if possible, otherwise generage but don't save cache
+//#define MT32EMU_WAVECACHEMODE 1 // Load existing cache if possible, otherwise generate but don't save cache
//#define MT32EMU_WAVECACHEMODE 2 // Ignore existing cache, generate and save cache
//#define MT32EMU_WAVECACHEMODE 3 // Ignore existing cache, generate but don't save cache
diff --git a/sound/softsynth/ym2612.cpp b/sound/softsynth/ym2612.cpp
index 57ad0f1c62..2a08bf631e 100644
--- a/sound/softsynth/ym2612.cpp
+++ b/sound/softsynth/ym2612.cpp
@@ -26,6 +26,7 @@
#include "sound/softsynth/ym2612.h"
#include "common/util.h"
+#include "sound/musicplugin.h"
////////////////////////////////////////
//
@@ -742,22 +743,55 @@ void MidiDriver_YM2612::createLookupTables() {
}
void MidiDriver_YM2612::removeLookupTables() {
- delete [] sintbl;
- delete [] powtbl;
- delete [] frequencyTable;
- delete [] keycodeTable;
- delete [] keyscaleTable;
- delete [] attackOut;
+ delete[] sintbl;
+ delete[] powtbl;
+ delete[] frequencyTable;
+ delete[] keycodeTable;
+ delete[] keyscaleTable;
+ delete[] attackOut;
sintbl = powtbl = frequencyTable = keycodeTable = keyscaleTable = attackOut = 0;
}
-////////////////////////////////////////
-//
-// MidiDriver_YM2612 factory
-//
-////////////////////////////////////////
+
+// Plugin interface
+
+class TownsEmuMusicPlugin : public MusicPluginObject {
+public:
+ const char *getName() const {
+ return "FM Towns Emulator";
+ }
+
+ const char *getId() const {
+ return "towns";
+ }
+
+ MusicDevices getDevices() const;
+ PluginError createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const;
+};
+
+MusicDevices TownsEmuMusicPlugin::getDevices() const {
+ MusicDevices devices;
+ devices.push_back(MusicDevice(this, "", MT_TOWNS));
+ return devices;
+}
+
+PluginError TownsEmuMusicPlugin::createInstance(Audio::Mixer *mixer, MidiDriver **mididriver) const {
+ *mididriver = new MidiDriver_YM2612(mixer);
+
+ return kNoError;
+}
MidiDriver *MidiDriver_YM2612_create(Audio::Mixer *mixer) {
- return new MidiDriver_YM2612(mixer);
+ MidiDriver *mididriver;
+
+ TownsEmuMusicPlugin p;
+ p.createInstance(mixer, &mididriver);
+
+ return mididriver;
}
+//#if PLUGIN_ENABLED_DYNAMIC(TOWNS)
+ //REGISTER_PLUGIN_DYNAMIC(TOWNS, PLUGIN_TYPE_MUSIC, TownsEmuMusicPlugin);
+//#else
+ REGISTER_PLUGIN_STATIC(TOWNS, PLUGIN_TYPE_MUSIC, TownsEmuMusicPlugin);
+//#endif
diff --git a/sound/vorbis.cpp b/sound/vorbis.cpp
index a4b0f854e9..64f67d2a13 100644
--- a/sound/vorbis.cpp
+++ b/sound/vorbis.cpp
@@ -92,6 +92,7 @@ protected:
bool _isStereo;
int _rate;
uint _numLoops;
+ const uint _totalNumLoops;
#ifdef USE_TREMOR
ogg_int64_t _startTime;
@@ -118,6 +119,17 @@ public:
bool isStereo() const { return _isStereo; }
int getRate() const { return _rate; }
+ int32 getTotalPlayTime() const {
+ if (!_totalNumLoops)
+ return AudioStream::kUnknownPlayTime;
+
+#ifdef USE_TREMOR
+ return (_endTime - _startTime) * _totalNumLoops;
+#else
+ return (int32)((_endTime - _startTime) * 1000.0) * _totalNumLoops;
+#endif
+ }
+
protected:
void refill();
};
@@ -126,6 +138,7 @@ VorbisInputStream::VorbisInputStream(Common::SeekableReadStream *inStream, bool
_inStream(inStream),
_disposeAfterUse(dispose),
_numLoops(numLoops),
+ _totalNumLoops(numLoops),
_bufferEnd(_buffer + ARRAYSIZE(_buffer)) {
bool err = (ov_open_callbacks(inStream, &_ovFile, NULL, 0, g_stream_wrap) < 0);
diff --git a/test/common/hashmap.h b/test/common/hashmap.h
index 883e965065..5aa609bc00 100644
--- a/test/common/hashmap.h
+++ b/test/common/hashmap.h
@@ -37,6 +37,9 @@ class HashMapTestSuite : public CxxTest::TestSuite
TS_ASSERT( !container.contains(1) );
container[1] = 42;
TS_ASSERT( container.contains(1) );
+ container.erase(0);
+ container.erase(1);
+ TS_ASSERT( container.empty() );
}
void test_lookup( void )
diff --git a/test/cxxtest/sample/CreatedTest.h b/test/cxxtest/sample/CreatedTest.h
index 84e8ae8a4b..53a6821a21 100644
--- a/test/cxxtest/sample/CreatedTest.h
+++ b/test/cxxtest/sample/CreatedTest.h
@@ -16,7 +16,7 @@ class CreatedTest : public CxxTest::TestSuite
char *_buffer;
public:
CreatedTest( unsigned size ) : _buffer( new char[size] ) {}
- virtual ~CreatedTest() { delete [] _buffer; }
+ virtual ~CreatedTest() { delete[] _buffer; }
static CreatedTest *createSuite() { return new CreatedTest( 16 ); }
static void destroySuite( CreatedTest *suite ) { delete suite; }
diff --git a/test/cxxtest/sample/FixtureTest.h b/test/cxxtest/sample/FixtureTest.h
index 653c7a14ae..33a119f2bd 100644
--- a/test/cxxtest/sample/FixtureTest.h
+++ b/test/cxxtest/sample/FixtureTest.h
@@ -22,7 +22,7 @@ public:
void tearDown()
{
- delete [] _buffer;
+ delete[] _buffer;
}
void test_strcpy()
diff --git a/tools/create_drascula/Makefile b/tools/create_drascula/Makefile
new file mode 100644
index 0000000000..3052436b55
--- /dev/null
+++ b/tools/create_drascula/Makefile
@@ -0,0 +1,4 @@
+# $Id$
+
+all:
+ g++ -I../.. create_drascula.cpp -o create_drascula
diff --git a/tools/create_drascula/create_drascula.cpp b/tools/create_drascula/create_drascula.cpp
new file mode 100644
index 0000000000..2676376e42
--- /dev/null
+++ b/tools/create_drascula/create_drascula.cpp
@@ -0,0 +1,527 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ * This is a utility for storing all the hardcoded data of Drascula in a separate
+ * data file, used by the game engine
+ */
+
+ // HACK to allow building with the SDL backend on MinGW
+// see bug #1800764 "TOOLS: MinGW tools building broken"
+#ifdef main
+#undef main
+#endif // main
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "create_drascula.h"
+#include "staticdata.h"
+
+#define DRASCULA_DAT_VER 2 // 1 byte
+
+static void writeByte(FILE *fp, uint8 b) {
+ fwrite(&b, 1, 1, fp);
+}
+
+static void writeUint16BE(FILE *fp, uint16 value) {
+ writeByte(fp, (uint8)(value >> 8));
+ writeByte(fp, (uint8)(value & 0xFF));
+}
+
+void writeSint16BE(FILE *fp, int16 value) {
+ writeUint16BE(fp, (uint16)value);
+}
+
+int main(int argc, char *argv[]) {
+ FILE* outFile;
+ int i, lang;
+ int len, len1, pad;
+ uint8 padBuf[DATAALIGNMENT];
+
+ for (i = 0; i < DATAALIGNMENT; i++)
+ padBuf[i] = 0;
+
+ outFile = fopen("drascula.dat", "wb");
+
+ // Write header
+ fwrite("DRASCULA", 8, 1, outFile);
+
+ writeByte(outFile, DRASCULA_DAT_VER);
+
+ // Write charmap
+ writeUint16BE(outFile, ARRAYSIZE(charMap));
+ for (i = 0; i < ARRAYSIZE(charMap); i++) {
+ writeByte(outFile, charMap[i].inChar);
+ writeSint16BE(outFile, charMap[i].mappedChar);
+ writeByte(outFile, charMap[i].charType);
+ }
+
+ // Write item locations
+ writeUint16BE(outFile, ARRAYSIZE(itemLocations));
+ for (i = 0; i < ARRAYSIZE(itemLocations); i++) {
+ writeSint16BE(outFile, itemLocations[i].x);
+ writeSint16BE(outFile, itemLocations[i].y);
+ }
+
+ // Write x_pol and y_pol
+ writeUint16BE(outFile, ARRAYSIZE(x_pol));
+ for (i = 0; i < ARRAYSIZE(x_pol); i++) {
+ writeSint16BE(outFile, x_pol[i]);
+ writeSint16BE(outFile, y_pol[i]);
+ }
+
+ // Write verbBarX
+ writeUint16BE(outFile, ARRAYSIZE(verbBarX));
+ for (i = 0; i < ARRAYSIZE(verbBarX); i++) {
+ writeSint16BE(outFile, verbBarX[i]);
+ }
+
+ // Write x1d_menu and y1d_menu
+ writeUint16BE(outFile, ARRAYSIZE(x1d_menu));
+ for (i = 0; i < ARRAYSIZE(x1d_menu); i++) {
+ writeSint16BE(outFile, x1d_menu[i]);
+ writeSint16BE(outFile, y1d_menu[i]);
+ }
+
+ // Write frameX
+ writeUint16BE(outFile, ARRAYSIZE(frameX));
+ for (i = 0; i < ARRAYSIZE(frameX); i++) {
+ writeSint16BE(outFile, frameX[i]);
+ }
+
+ // Write candleX and candleY
+ writeUint16BE(outFile, ARRAYSIZE(candleX));
+ for (i = 0; i < ARRAYSIZE(candleX); i++) {
+ writeSint16BE(outFile, candleX[i]);
+ writeSint16BE(outFile, candleY[i]);
+ }
+
+ // Write pianistX
+ writeUint16BE(outFile, ARRAYSIZE(pianistX));
+ for (i = 0; i < ARRAYSIZE(pianistX); i++) {
+ writeSint16BE(outFile, pianistX[i]);
+ }
+
+ // Write drunkX
+ writeUint16BE(outFile, ARRAYSIZE(drunkX));
+ for (i = 0; i < ARRAYSIZE(drunkX); i++) {
+ writeSint16BE(outFile, drunkX[i]);
+ }
+
+ // Write preupdates
+ writeUint16BE(outFile, ARRAYSIZE(roomPreUpdates));
+
+ for (i = 0; i < ARRAYSIZE(roomPreUpdates); i++) {
+ writeSint16BE(outFile, roomPreUpdates[i].roomNum);
+ writeSint16BE(outFile, roomPreUpdates[i].flag);
+ writeSint16BE(outFile, roomPreUpdates[i].flagValue);
+ writeSint16BE(outFile, roomPreUpdates[i].sourceX);
+ writeSint16BE(outFile, roomPreUpdates[i].sourceY);
+ writeSint16BE(outFile, roomPreUpdates[i].destX);
+ writeSint16BE(outFile, roomPreUpdates[i].destY);
+ writeSint16BE(outFile, roomPreUpdates[i].width);
+ writeSint16BE(outFile, roomPreUpdates[i].height);
+ writeSint16BE(outFile, roomPreUpdates[i].type);
+ }
+
+ // Write updates
+ writeUint16BE(outFile, ARRAYSIZE(roomUpdates));
+
+ for (i = 0; i < ARRAYSIZE(roomUpdates); i++) {
+ writeSint16BE(outFile, roomUpdates[i].roomNum);
+ writeSint16BE(outFile, roomUpdates[i].flag);
+ writeSint16BE(outFile, roomUpdates[i].flagValue);
+ writeSint16BE(outFile, roomUpdates[i].sourceX);
+ writeSint16BE(outFile, roomUpdates[i].sourceY);
+ writeSint16BE(outFile, roomUpdates[i].destX);
+ writeSint16BE(outFile, roomUpdates[i].destY);
+ writeSint16BE(outFile, roomUpdates[i].width);
+ writeSint16BE(outFile, roomUpdates[i].height);
+ writeSint16BE(outFile, roomUpdates[i].type);
+ }
+
+ // Write room actions
+ writeUint16BE(outFile, ARRAYSIZE(roomActions));
+
+ for (i = 0; i < ARRAYSIZE(roomActions); i++) {
+ writeSint16BE(outFile, roomActions[i].room);
+ writeSint16BE(outFile, roomActions[i].chapter);
+ writeSint16BE(outFile, roomActions[i].action);
+ writeSint16BE(outFile, roomActions[i].objectID);
+ writeSint16BE(outFile, roomActions[i].speechID);
+ }
+
+ // langs
+ writeUint16BE(outFile, NUM_LANGS);
+
+ // Write _text
+ writeUint16BE(outFile, NUM_TEXT);
+
+ for (lang = 0; lang < NUM_LANGS; lang++) {
+ len = DATAALIGNMENT - 2;
+ for (i = 0; i < NUM_TEXT; i++) {
+ len1 = strlen(_text[lang][i]) + 1;
+ pad = DATAALIGNMENT - (len1 + 2) % DATAALIGNMENT;
+
+ len += 2 + len1 + pad;
+ }
+ writeUint16BE(outFile, len);
+
+ fwrite(padBuf, DATAALIGNMENT - 2, 1, outFile); // padding
+ for (i = 0; i < NUM_TEXT; i++) {
+ len = strlen(_text[lang][i]) + 1;
+ pad = DATAALIGNMENT - (len + 2) % DATAALIGNMENT;
+
+ writeUint16BE(outFile, len + pad + 2);
+ fwrite(_text[lang][i], len, 1, outFile);
+ fwrite(padBuf, pad, 1, outFile);
+ }
+ }
+
+ // Write _textd
+ writeUint16BE(outFile, NUM_TEXTD);
+ for (lang = 0; lang < NUM_LANGS; lang++) {
+ len = DATAALIGNMENT - 2;
+ for (i = 0; i < NUM_TEXTD; i++) {
+ len1 = strlen(_textd[lang][i]) + 1;
+ pad = DATAALIGNMENT - (len1 + 2) % DATAALIGNMENT;
+ len += 2 + len1 + pad;
+ }
+ writeUint16BE(outFile, len);
+
+ fwrite(padBuf, DATAALIGNMENT - 2, 1, outFile); // padding
+ for (i = 0; i < NUM_TEXTD; i++) {
+ len = strlen(_textd[lang][i]) + 1;
+ pad = DATAALIGNMENT - (len + 2) % DATAALIGNMENT;
+
+ writeUint16BE(outFile, len + pad + 2);
+ fwrite(_textd[lang][i], len, 1, outFile);
+
+ fwrite(padBuf, pad, 1, outFile);
+ }
+ }
+
+ // Write _textb
+ writeUint16BE(outFile, NUM_TEXTB);
+ for (lang = 0; lang < NUM_LANGS; lang++) {
+ len = DATAALIGNMENT - 2;
+ for (i = 0; i < NUM_TEXTB; i++) {
+ len1 = strlen(_textb[lang][i]) + 1;
+ pad = DATAALIGNMENT - (len1 + 2) % DATAALIGNMENT;
+ len += 2 + len1 + pad;
+ }
+ writeUint16BE(outFile, len);
+
+ fwrite(padBuf, DATAALIGNMENT - 2, 1, outFile); // padding
+ for (i = 0; i < NUM_TEXTB; i++) {
+ len = strlen(_textb[lang][i]) + 1;
+ pad = DATAALIGNMENT - (len + 2) % DATAALIGNMENT;
+
+ writeUint16BE(outFile, len + pad + 2);
+ fwrite(_textb[lang][i], len, 1, outFile);
+
+ fwrite(padBuf, pad, 1, outFile);
+ }
+ }
+
+ // Write _textbj
+ writeUint16BE(outFile, NUM_TEXTBJ);
+ for (lang = 0; lang < NUM_LANGS; lang++) {
+ len = DATAALIGNMENT - 2;
+ for (i = 0; i < NUM_TEXTBJ; i++) {
+ len1 = strlen(_textbj[lang][i]) + 1;
+ pad = DATAALIGNMENT - (len1 + 2) % DATAALIGNMENT;
+ len += 2 + len1 + pad;
+ }
+ writeUint16BE(outFile, len);
+
+ fwrite(padBuf, DATAALIGNMENT - 2, 1, outFile); // padding
+ for (i = 0; i < NUM_TEXTBJ; i++) {
+ len = strlen(_textbj[lang][i]) + 1;
+ pad = DATAALIGNMENT - (len + 2) % DATAALIGNMENT;
+
+ writeUint16BE(outFile, len + pad + 2);
+ fwrite(_textbj[lang][i], len, 1, outFile);
+
+ fwrite(padBuf, pad, 1, outFile);
+ }
+ }
+
+ // Write _texte
+ writeUint16BE(outFile, NUM_TEXTE);
+ for (lang = 0; lang < NUM_LANGS; lang++) {
+ len = DATAALIGNMENT - 2;
+ for (i = 0; i < NUM_TEXTE; i++) {
+ len1 = strlen(_texte[lang][i]) + 1;
+ pad = DATAALIGNMENT - (len1 + 2) % DATAALIGNMENT;
+ len += 2 + len1 + pad;
+ }
+ writeUint16BE(outFile, len);
+
+ fwrite(padBuf, DATAALIGNMENT - 2, 1, outFile); // padding
+ for (i = 0; i < NUM_TEXTE; i++) {
+ len = strlen(_texte[lang][i]) + 1;
+ pad = DATAALIGNMENT - (len + 2) % DATAALIGNMENT;
+
+ writeUint16BE(outFile, len + pad + 2);
+ fwrite(_texte[lang][i], len, 1, outFile);
+
+ fwrite(padBuf, pad, 1, outFile);
+ }
+ }
+
+ // Write _texti
+ writeUint16BE(outFile, NUM_TEXTI);
+ for (lang = 0; lang < NUM_LANGS; lang++) {
+ len = DATAALIGNMENT - 2;
+ for (i = 0; i < NUM_TEXTI; i++) {
+ len1 = strlen(_texti[lang][i]) + 1;
+ pad = DATAALIGNMENT - (len1 + 2) % DATAALIGNMENT;
+ len += 2 + len1 + pad;
+ }
+ writeUint16BE(outFile, len);
+
+ fwrite(padBuf, DATAALIGNMENT - 2, 1, outFile); // padding
+ for (i = 0; i < NUM_TEXTI; i++) {
+ len = strlen(_texti[lang][i]) + 1;
+ pad = DATAALIGNMENT - (len + 2) % DATAALIGNMENT;
+
+ writeUint16BE(outFile, len + pad + 2);
+ fwrite(_texti[lang][i], len, 1, outFile);
+
+ fwrite(padBuf, pad, 1, outFile);
+ }
+ }
+
+ // Write _textl
+ writeUint16BE(outFile, NUM_TEXTL);
+ for (lang = 0; lang < NUM_LANGS; lang++) {
+ len = DATAALIGNMENT - 2;
+ for (i = 0; i < NUM_TEXTL; i++) {
+ len1 = strlen(_textl[lang][i]) + 1;
+ pad = DATAALIGNMENT - (len1 + 2) % DATAALIGNMENT;
+ len += 2 + len1 + pad;
+ }
+ writeUint16BE(outFile, len);
+
+ fwrite(padBuf, DATAALIGNMENT - 2, 1, outFile); // padding
+ for (i = 0; i < NUM_TEXTL; i++) {
+ len = strlen(_textl[lang][i]) + 1;
+ pad = DATAALIGNMENT - (len + 2) % DATAALIGNMENT;
+
+ writeUint16BE(outFile, len + pad + 2);
+ fwrite(_textl[lang][i], len, 1, outFile);
+
+ fwrite(padBuf, pad, 1, outFile);
+ }
+ }
+
+ // Write _textp
+ writeUint16BE(outFile, NUM_TEXTP);
+ for (lang = 0; lang < NUM_LANGS; lang++) {
+ len = DATAALIGNMENT - 2;
+ for (i = 0; i < NUM_TEXTP; i++) {
+ len1 = strlen(_textp[lang][i]) + 1;
+ pad = DATAALIGNMENT - (len1 + 2) % DATAALIGNMENT;
+ len += 2 + len1 + pad;
+ }
+ writeUint16BE(outFile, len);
+
+ fwrite(padBuf, DATAALIGNMENT - 2, 1, outFile); // padding
+ for (i = 0; i < NUM_TEXTP; i++) {
+ len = strlen(_textp[lang][i]) + 1;
+ pad = DATAALIGNMENT - (len + 2) % DATAALIGNMENT;
+
+ writeUint16BE(outFile, len + pad + 2);
+ fwrite(_textp[lang][i], len, 1, outFile);
+
+ fwrite(padBuf, pad, 1, outFile);
+ }
+ }
+
+ // Write _textt
+ writeUint16BE(outFile, NUM_TEXTT);
+ for (lang = 0; lang < NUM_LANGS; lang++) {
+ len = DATAALIGNMENT - 2;
+ for (i = 0; i < NUM_TEXTT; i++) {
+ len1 = strlen(_textt[lang][i]) + 1;
+ pad = DATAALIGNMENT - (len1 + 2) % DATAALIGNMENT;
+ len += 2 + len1 + pad;
+ }
+ writeUint16BE(outFile, len);
+
+ fwrite(padBuf, DATAALIGNMENT - 2, 1, outFile); // padding
+ for (i = 0; i < NUM_TEXTT; i++) {
+ len = strlen(_textt[lang][i]) + 1;
+ pad = DATAALIGNMENT - (len + 2) % DATAALIGNMENT;
+
+ writeUint16BE(outFile, len + pad + 2);
+ fwrite(_textt[lang][i], len, 1, outFile);
+
+ fwrite(padBuf, pad, 1, outFile);
+ }
+ }
+
+ // Write _textvb
+ writeUint16BE(outFile, NUM_TEXTVB);
+ for (lang = 0; lang < NUM_LANGS; lang++) {
+ len = DATAALIGNMENT - 2;
+ for (i = 0; i < NUM_TEXTVB; i++) {
+ len1 = strlen(_textvb[lang][i]) + 1;
+ pad = DATAALIGNMENT - (len1 + 2) % DATAALIGNMENT;
+ len += 2 + len1 + pad;
+ }
+ writeUint16BE(outFile, len);
+
+ fwrite(padBuf, DATAALIGNMENT - 2, 1, outFile); // padding
+ for (i = 0; i < NUM_TEXTVB; i++) {
+ len = strlen(_textvb[lang][i]) + 1;
+ pad = DATAALIGNMENT - (len + 2) % DATAALIGNMENT;
+
+ writeUint16BE(outFile, len + pad + 2);
+ fwrite(_textvb[lang][i], len, 1, outFile);
+
+ fwrite(padBuf, pad, 1, outFile);
+ }
+ }
+
+ // Write _textsys
+ writeUint16BE(outFile, NUM_TEXTSYS);
+ for (lang = 0; lang < NUM_LANGS; lang++) {
+ len = DATAALIGNMENT - 2;
+ for (i = 0; i < NUM_TEXTSYS; i++) {
+ len1 = strlen(_textsys[lang][i]) + 1;
+ pad = DATAALIGNMENT - (len1 + 2) % DATAALIGNMENT;
+ len += 2 + len1 + pad;
+ }
+ writeUint16BE(outFile, len);
+
+ fwrite(padBuf, DATAALIGNMENT - 2, 1, outFile); // padding
+ for (i = 0; i < NUM_TEXTSYS; i++) {
+ len = strlen(_textsys[lang][i]) + 1;
+ pad = DATAALIGNMENT - (len + 2) % DATAALIGNMENT;
+
+ writeUint16BE(outFile, len + pad + 2);
+ fwrite(_textsys[lang][i], len, 1, outFile);
+
+ fwrite(padBuf, pad, 1, outFile);
+ }
+ }
+
+ // Write _texthis
+ writeUint16BE(outFile, NUM_TEXTHIS);
+ for (lang = 0; lang < NUM_LANGS; lang++) {
+ len = DATAALIGNMENT - 2;
+ for (i = 0; i < NUM_TEXTHIS; i++) {
+ len1 = strlen(_texthis[lang][i]) + 1;
+ pad = DATAALIGNMENT - (len1 + 2) % DATAALIGNMENT;
+ len += 2 + len1 + pad;
+ }
+ writeUint16BE(outFile, len);
+
+ fwrite(padBuf, DATAALIGNMENT - 2, 1, outFile); // padding
+ for (i = 0; i < NUM_TEXTHIS; i++) {
+ len = strlen(_texthis[lang][i]) + 1;
+ pad = DATAALIGNMENT - (len + 2) % DATAALIGNMENT;
+
+ writeUint16BE(outFile, len + pad + 2);
+ fwrite(_texthis[lang][i], len, 1, outFile);
+
+ fwrite(padBuf, pad, 1, outFile);
+ }
+ }
+
+ // Write _textverbs
+ writeUint16BE(outFile, NUM_TEXTVERBS);
+ for (lang = 0; lang < NUM_LANGS; lang++) {
+ len = DATAALIGNMENT - 2;
+ for (i = 0; i < NUM_TEXTVERBS; i++) {
+ len1 = strlen(_textverbs[lang][i]) + 1;
+ pad = DATAALIGNMENT - (len1 + 2) % DATAALIGNMENT;
+ len += 2 + len1 + pad;
+ }
+ writeUint16BE(outFile, len);
+
+ fwrite(padBuf, DATAALIGNMENT - 2, 1, outFile); // padding
+ for (i = 0; i < NUM_TEXTVERBS; i++) {
+ len = strlen(_textverbs[lang][i]) + 1;
+ pad = DATAALIGNMENT - (len + 2) % DATAALIGNMENT;
+
+ writeUint16BE(outFile, len + pad + 2);
+ fwrite(_textverbs[lang][i], len, 1, outFile);
+
+ fwrite(padBuf, pad, 1, outFile);
+ }
+ }
+
+ // Write _textmisc
+ writeUint16BE(outFile, NUM_TEXTMISC);
+ for (lang = 0; lang < NUM_LANGS; lang++) {
+ len = DATAALIGNMENT - 2;
+ for (i = 0; i < NUM_TEXTMISC; i++) {
+ len1 = strlen(_textmisc[lang][i]) + 1;
+ pad = DATAALIGNMENT - (len1 + 2) % DATAALIGNMENT;
+ len += 2 + len1 + pad;
+ }
+ writeUint16BE(outFile, len);
+
+ fwrite(padBuf, DATAALIGNMENT - 2, 1, outFile); // padding
+ for (i = 0; i < NUM_TEXTMISC; i++) {
+ len = strlen(_textmisc[lang][i]) + 1;
+ pad = DATAALIGNMENT - (len + 2) % DATAALIGNMENT;
+
+ writeUint16BE(outFile, len + pad + 2);
+ fwrite(_textmisc[lang][i], len, 1, outFile);
+
+ fwrite(padBuf, pad, 1, outFile);
+ }
+ }
+
+ // Write _textd1
+ writeUint16BE(outFile, NUM_TEXTD1);
+ for (lang = 0; lang < NUM_LANGS; lang++) {
+ len = DATAALIGNMENT - 2;
+ for (i = 0; i < NUM_TEXTD1; i++) {
+ len1 = strlen(_textd1[lang][i]) + 1;
+ pad = DATAALIGNMENT - (len1 + 2) % DATAALIGNMENT;
+ len += 2 + len1 + pad;
+ }
+ writeUint16BE(outFile, len);
+
+ fwrite(padBuf, DATAALIGNMENT - 2, 1, outFile); // padding
+ for (i = 0; i < NUM_TEXTD1; i++) {
+ len = strlen(_textd1[lang][i]) + 1;
+ pad = DATAALIGNMENT - (len + 2) % DATAALIGNMENT;
+
+ writeUint16BE(outFile, len + pad + 2);
+ fwrite(_textd1[lang][i], len, 1, outFile);
+
+ fwrite(padBuf, pad, 1, outFile);
+ }
+ }
+
+ fclose(outFile);
+
+ return 0;
+}
diff --git a/tools/create_drascula/create_drascula.h b/tools/create_drascula/create_drascula.h
new file mode 100644
index 0000000000..ed81651e86
--- /dev/null
+++ b/tools/create_drascula/create_drascula.h
@@ -0,0 +1,97 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#ifndef CREATE_DRASCULA_H
+#define CREATE_DRASCULA_H
+
+#define ARRAYSIZE(x) ((int)(sizeof(x) / sizeof(x[0])))
+
+#define DATAALIGNMENT 4
+
+#define NUM_LANGS 5
+#define NUM_TEXT 501
+#define NUM_TEXTD 84
+#define NUM_TEXTB 15
+#define NUM_TEXTBJ 29
+#define NUM_TEXTE 24
+#define NUM_TEXTI 33
+#define NUM_TEXTL 32
+#define NUM_TEXTP 20
+#define NUM_TEXTT 25
+#define NUM_TEXTVB 63
+#define NUM_TEXTSYS 4
+#define NUM_TEXTHIS 5
+#define NUM_TEXTVERBS 6
+#define NUM_TEXTMISC 3
+#define NUM_TEXTD1 11
+
+typedef unsigned char uint8;
+typedef unsigned short uint16;
+typedef signed short int16;
+
+enum Verbs {
+ kVerbDefault = -1,
+ kVerbLook = 1,
+ kVerbPick = 2,
+ kVerbOpen = 3,
+ kVerbClose = 4,
+ kVerbTalk = 5,
+ kVerbMove = 6
+};
+
+struct RoomTalkAction {
+ int room;
+ int chapter;
+ int action;
+ int objectID;
+ int speechID;
+};
+
+struct ItemLocation {
+ int x;
+ int y;
+};
+
+struct CharInfo {
+ char inChar;
+ uint16 mappedChar;
+ char charType; // 0 - letters, 1 - signs, 2 - accented
+};
+
+struct RoomUpdate {
+ int roomNum;
+ int flag;
+ int flagValue;
+ int sourceX;
+ int sourceY;
+ int destX;
+ int destY;
+ int width;
+ int height;
+ int type; // 0 - background, 1 - rect
+};
+
+
+#endif /* CREATE_DRASCULA_H */
diff --git a/tools/create_drascula/dists/msvc8/create_drascula.sln b/tools/create_drascula/dists/msvc8/create_drascula.sln
new file mode 100644
index 0000000000..dc7428bb80
--- /dev/null
+++ b/tools/create_drascula/dists/msvc8/create_drascula.sln
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual Studio 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "create_drascula", "create_drascula.vcproj", "{5F280130-349D-11DD-AE16-0800200C9A66}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {5F280130-349D-11DD-AE16-0800200C9A66}.Debug|Win32.ActiveCfg = Debug|Win32
+ {5F280130-349D-11DD-AE16-0800200C9A66}.Debug|Win32.Build.0 = Debug|Win32
+ {5F280130-349D-11DD-AE16-0800200C9A66}.Release|Win32.ActiveCfg = Release|Win32
+ {5F280130-349D-11DD-AE16-0800200C9A66}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/tools/create_drascula/dists/msvc8/create_drascula.vcproj b/tools/create_drascula/dists/msvc8/create_drascula.vcproj
new file mode 100644
index 0000000000..3b26261a76
--- /dev/null
+++ b/tools/create_drascula/dists/msvc8/create_drascula.vcproj
@@ -0,0 +1,191 @@
+<?xml version="1.0" encoding="windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8,00"
+ Name="create_drascula"
+ ProjectGUID="{5F280130-349D-11DD-AE16-0800200C9A66}"
+ RootNamespace="create_drascula"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="1"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalOptions="/wd4996"
+ Optimization="0"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/create_drascula.exe"
+ LinkIncremental="2"
+ IgnoreDefaultLibraryNames="libc.lib;libcmt.lib"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/create_drascula.pdb"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="1"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalOptions="/wd4996"
+ Optimization="3"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/create_drascula.exe"
+ LinkIncremental="1"
+ IgnoreDefaultLibraryNames="libc.lib;libcmt.lib"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath="..\..\create_drascula.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\create_drascula.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\staticdata.h"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/tools/create_drascula/dists/msvc8_to_msvc9.bat b/tools/create_drascula/dists/msvc8_to_msvc9.bat
new file mode 100644
index 0000000000..54820b34d0
--- /dev/null
+++ b/tools/create_drascula/dists/msvc8_to_msvc9.bat
@@ -0,0 +1,32 @@
+@echo off
+rem This batch file is used to convert MSVC8 (Visual Studio 2005) project files to MSVC9 (Visual Studio 2008) ones
+rem You need the Windows version of GNU rpl
+rem Get it here:
+rem http://gnuwin32.sourceforge.net/packages/rpl.htm
+rem Place rpl.exe from the bin folder inside the archive in the folder where
+rem this batch file resides
+
+if not exist rpl.exe goto no_rpl
+
+echo Creating MSVC9 project files from the MSVC8 ones
+copy /y msvc8\*.vcproj msvc9\
+copy /y msvc8\*.sln msvc9\
+rpl -e -q "Version=\"8.00\"" "Version=\"9.00\"" msvc9\*.vcproj
+rpl -e -q "Version=\"8,00\"" "Version=\"9,00\"" msvc9\*.vcproj
+rpl -e -q "Keyword=\"Win32Proj\"" "Keyword=\"Win32Proj\"\n\tTargetFrameworkVersion=\"131072\"" msvc9\*.vcproj
+rpl -e -q "EntryPointSymbol=\"WinMainCRTStartup\"" "EntryPointSymbol=\"WinMainCRTStartup\"\n\t\t\t\tRandomizedBaseAddress=\"1\"\n\t\t\t\tDataExecutionPrevention=\"0\"" msvc9\*.vcproj
+rpl -e -q "Format Version 9.00" "Format Version 10.00" msvc9\*.sln
+rpl -e -q "Format Version 9,00" "Format Version 10,00" msvc9\*.sln
+rpl -e -q "# Visual C++ Express 2005" "# Visual C++ Express 2008" msvc9\*.sln
+rpl -e -q "# Visual Studio 2005" "# Visual Studio 2008" msvc9\*.sln
+goto the_end
+
+:no_rpl
+echo You need the Windows version of GNU rpl
+echo Get it here:
+echo http://gnuwin32.sourceforge.net/packages/rpl.htm
+echo Place rpl.exe from the bin folder inside the archive in the folder where
+echo this batch file resides
+
+:the_end
+pause
diff --git a/tools/create_drascula/dists/msvc9/create_drascula.sln b/tools/create_drascula/dists/msvc9/create_drascula.sln
new file mode 100644
index 0000000000..4a39bdbe42
--- /dev/null
+++ b/tools/create_drascula/dists/msvc9/create_drascula.sln
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual Studio 2008
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "create_drascula", "create_drascula.vcproj", "{5F280130-349D-11DD-AE16-0800200C9A66}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {5F280130-349D-11DD-AE16-0800200C9A66}.Debug|Win32.ActiveCfg = Debug|Win32
+ {5F280130-349D-11DD-AE16-0800200C9A66}.Debug|Win32.Build.0 = Debug|Win32
+ {5F280130-349D-11DD-AE16-0800200C9A66}.Release|Win32.ActiveCfg = Release|Win32
+ {5F280130-349D-11DD-AE16-0800200C9A66}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/tools/create_drascula/dists/msvc9/create_drascula.vcproj b/tools/create_drascula/dists/msvc9/create_drascula.vcproj
new file mode 100644
index 0000000000..f30d6a114b
--- /dev/null
+++ b/tools/create_drascula/dists/msvc9/create_drascula.vcproj
@@ -0,0 +1,192 @@
+<?xml version="1.0" encoding="windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9,00"
+ Name="create_drascula"
+ ProjectGUID="{5F280130-349D-11DD-AE16-0800200C9A66}"
+ RootNamespace="create_drascula"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="131072"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="1"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalOptions="/wd4996"
+ Optimization="0"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/create_drascula.exe"
+ LinkIncremental="2"
+ IgnoreDefaultLibraryNames="libc.lib;libcmt.lib"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/create_drascula.pdb"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="1"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalOptions="/wd4996"
+ Optimization="3"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/create_drascula.exe"
+ LinkIncremental="1"
+ IgnoreDefaultLibraryNames="libc.lib;libcmt.lib"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath="..\..\create_drascula.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\create_drascula.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\staticdata.h"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/tools/create_drascula/dists/msvc9_to_msvc8.bat b/tools/create_drascula/dists/msvc9_to_msvc8.bat
new file mode 100644
index 0000000000..c87a524f77
--- /dev/null
+++ b/tools/create_drascula/dists/msvc9_to_msvc8.bat
@@ -0,0 +1,33 @@
+@echo off
+rem This batch file is used to convert MSVC9 (Visual Studio 2008) project files to MSVC8 (Visual Studio 2005) ones
+rem You need the Windows version of GNU rpl
+rem Get it here:
+rem http://gnuwin32.sourceforge.net/packages/rpl.htm
+rem Place rpl.exe from the bin folder inside the archive in the folder where
+rem this batch file resides
+
+if not exist rpl.exe goto no_rpl
+
+echo Creating MSVC8 project files from the MSVC9 ones
+copy /y msvc9\*.vcproj msvc8\
+copy /y msvc9\*.sln msvc8\
+rpl -e -q "Version=\"9.00\"" "Version=\"8.00\"" msvc8\*.vcproj
+rpl -e -q "Version=\"9,00\"" "Version=\"8,00\"" msvc8\*.vcproj
+rpl -e -q "\tTargetFrameworkVersion=\"131072\"\n" "" msvc8\*.vcproj
+rpl -e -q "\t\t\t\tRandomizedBaseAddress=\"1\"\n" "" msvc8\*.vcproj
+rpl -e -q "\t\t\t\tDataExecutionPrevention=\"0\"\n" "" msvc8\*.vcproj
+rpl -e -q "Format Version 10.00" "Format Version 9.00" msvc8\*.sln
+rpl -e -q "Format Version 10,00" "Format Version 9,00" msvc8\*.sln
+rpl -e -q "# Visual C++ Express 2008" "# Visual C++ Express 2005" msvc8\*.sln
+rpl -e -q "# Visual Studio 2008" "# Visual Studio 2005" msvc8\*.sln
+goto the_end
+
+:no_rpl
+echo You need the Windows version of GNU rpl
+echo Get it here:
+echo http://gnuwin32.sourceforge.net/packages/rpl.htm
+echo Place rpl.exe from the bin folder inside the archive in the folder where
+echo this batch file resides
+
+:the_end
+pause
diff --git a/tools/create_drascula/module.mk b/tools/create_drascula/module.mk
new file mode 100644
index 0000000000..3d64871960
--- /dev/null
+++ b/tools/create_drascula/module.mk
@@ -0,0 +1,13 @@
+# $URL$
+# $Id$
+
+MODULE := tools/create_drascula
+
+MODULE_OBJS := \
+ create_drascula.o
+
+# Set the name of the executable
+TOOL_EXECUTABLE := create_drascula
+
+# Include common rules
+include $(srcdir)/rules.mk
diff --git a/engines/drascula/texts.cpp b/tools/create_drascula/staticdata.h
index d4cde5b5fa..4778c530e4 100644
--- a/engines/drascula/texts.cpp
+++ b/tools/create_drascula/staticdata.h
@@ -23,2965 +23,4195 @@
*
*/
-#include "drascula/drascula.h"
+#ifndef STATICDATA_H
+#define STATICDATA_H
-namespace Drascula {
+const CharInfo charMap[] = {
+ // Letters
+ // ---------------------------------------
+ { 'A', 6, 0 }, { 'B', 15, 0 },
+ { 'C', 24, 0 }, { 'D', 33, 0 },
+ { 'E', 42, 0 }, { 'F', 51, 0 },
+ { 'G', 60, 0 }, { 'H', 69, 0 },
+ { 'I', 78, 0 }, { 'J', 87, 0 },
+ { 'K', 96, 0 }, { 'L', 105, 0 },
+ { 'M', 114, 0 }, { 'N', 123, 0 },
+ { '\244', 132, 0 }, { '\245', 132, 0 }, // special Spanish char
+ { 'O', 141, 0 }, { 'P', 150, 0 },
+ { 'Q', 159, 0 }, { 'R', 168, 0 },
+ { 'S', 177, 0 }, { 'T', 186, 0 },
+ { 'U', 195, 0 }, { 'V', 204, 0 },
+ { 'W', 213, 0 }, { 'X', 222, 0 },
+ { 'Y', 231, 0 }, { 'Z', 240, 0 },
+ // ---------------------------------------
+ { '\247', 250, 0 }, { ' ', 250, 0 },
+ // Signs
+ // ---------------------------------------
+ { '.', 6, 1 }, { ',', 15, 1 },
+ { '-', 24, 1 }, { '?', 33, 1 },
+ { '\250', 42, 1 }, { '"', 51, 1 },
+ { '!', 60, 1 }, { '\255', 69, 1 },
+ { ';', 78, 1 }, { '>', 87, 1 },
+ { '<', 96, 1 }, { '$', 105, 1 },
+ { '%', 114, 1 }, { ':', 123, 1 },
+ { '&', 132, 1 }, { '/', 141, 1 },
+ { '(', 150, 1 }, { ')', 159, 1 },
+ { '*', 168, 1 }, { '+', 177, 1 },
+ { '1', 186, 1 }, { '2', 195, 1 },
+ { '3', 204, 1 }, { '4', 213, 1 },
+ { '5', 222, 1 }, { '6', 231, 1 },
+ { '7', 240, 1 }, { '8', 249, 1 },
+ { '9', 258, 1 }, { '0', 267, 1 },
+ // Accented
+ // ---------------------------------------
+ { '\240', 6, 2 }, { '\202', 15, 2 }, // A, B
+ { '\241', 24, 2 }, { '\242', 33, 2 }, // C, D
+ { '\243', 42, 2 }, { '\205', 51, 2 }, // E, F
+ { '\212', 60, 2 }, { '\215', 69, 2 }, // G, H
+ { '\225', 78, 2 }, { '\227', 87, 2 }, // I, J
+ { '\203', 96, 2 }, { '\210', 105, 2 }, // K, L
+ { '\214', 114, 2 }, { '\223', 123, 2 }, // M, N
+ { '\226', 132, 2 }, { '\'', 141, 2 }, // special Spanish char, O
+ { '\200', 150, 2 }, { '\207', 150, 2 }, // P, P
+ { '\265', 6, 2 }, { '\220', 15, 2 }, // A, B
+ { '\326', 24, 2 }, { '\340', 33, 2 }, // C, D
+ { '\351', 42, 2 }, { '\267', 51, 2 }, // E, F
+ { '\324', 60, 2 }, { '\336', 69, 2 }, // G, H
+ { '\343', 78, 2 }, { '\353', 87, 2 }, // I, J
+ { '\266', 96, 2 }, { '\322', 105, 2 }, // K, L
+ { '\327', 114, 2 }, { '\342', 123, 2 }, // M, N
+ { '\352', 132, 2 } // special Spanish char
+};
+
+const ItemLocation itemLocations[] = {
+ { 0, 0 }, // empty
+ { 5, 10 }, { 50, 10 }, { 95, 10 }, // 1-3
+ { 140, 10 }, { 185, 10 }, { 230, 10 }, // 4-6
+ { 275, 10 }, { 5, 40 }, { 50, 40 }, // 7-9
+ { 95, 40 }, { 140, 40 }, { 185, 40 }, // 10-12
+ { 230, 40 }, { 275, 40 }, { 5, 70 }, // 13-15
+ { 50, 70 }, { 95, 70 }, { 140, 70 }, // 16-18
+ { 185, 70 }, { 230, 70 }, { 275, 70 }, // 19-21
+ { 5, 100 }, { 50, 100 }, { 95, 100 }, // 22-24
+ { 140, 100 }, { 185, 100 }, { 230, 100 }, // 25-27
+ { 275, 100 }, { 5, 130 }, { 50, 130 }, // 28-30
+ { 95, 130 }, { 140, 130 }, { 185, 130 }, // 31-33
+ { 230, 130 }, { 275, 130 }, { 5, 160 }, // 34-36
+ { 50, 160 }, { 95, 160 }, { 140, 160 }, // 37-39
+ { 185, 160 }, { 230, 160 }, { 275, 160 }, // 40-42
+ { 275, 160 } // 43
+};
+
+const int x_pol[44] = {0, 1, 42, 83, 124, 165, 206, 247, 83, 1, 206,
+ 1, 42, 83, 124, 165, 206, 247, 83, 1, 206,
+ 247, 83, 165, 1, 206, 42, 124, 83, 1, 247,
+ 83, 165, 1, 206, 42, 124, 83, 1, 247, 42,
+ 1, 165, 206};
+const int y_pol[44] = {0, 1, 1, 1, 1, 1, 1, 1, 27, 27, 1,
+ 27, 27, 27, 27, 27, 27, 27, 1, 1, 27,
+ 1, 1, 1, 1, 1, 27, 27, 27, 27, 27,
+ 1, 1, 1, 1, 1, 27, 27, 27, 27, 27,
+ 27, 1, 1};
+const int verbBarX[] = {6, 51, 96, 141, 186, 232, 276, 321};
+const int x1d_menu[] = {280, 40, 80, 120, 160, 200, 240, 0, 40, 80, 120,
+ 160, 200, 240, 0, 40, 80, 120, 160, 200, 240, 0,
+ 40, 80, 120, 160, 200, 240, 0};
+const int y1d_menu[] = {0, 0, 0, 0, 0, 0, 0, 25, 25, 25, 25, 25, 25, 25,
+ 50, 50, 50, 50, 50, 50, 50, 75, 75, 75, 75, 75, 75, 75, 100};
+int frameX[20] = {43, 87, 130, 173, 216, 259};
+int candleX[] = {14, 19, 24};
+int candleY[] = {158, 172, 186};
+int pianistX[] = {1, 91, 61, 31, 91, 31, 1, 61, 31};
+int drunkX[] = {1, 42, 83, 124, 165, 206, 247, 1};
+
+const RoomUpdate roomPreUpdates[] = {
+ // room flag val x1 y1 x2 y2 width height type
+ { 3, 3, 1, 258, 110, 85, 44, 23, 53, 0 },
+ //-------------------------------------------------------------------------------
+ { 5, 8, 0, 256, 152, 208, 67, 27, 40, 0 },
+ //-------------------------------------------------------------------------------
+ { 6, 0, 0, 3, 103, 185, 69, 23, 76, 0 },
+ { 6, 1, 0, 97, 117, 34, 148, 36, 31, 0 },
+ { 6, 2, 0, 28, 100, 219, 72, 64, 97, 0 },
+ //-------------------------------------------------------------------------------
+ { 7, 35, 0, 1, 72, 158, 162, 19, 12, 0 },
+ //-------------------------------------------------------------------------------
+ { 12, 16, 0, 1, 131, 106, 117, 55, 68, 0 },
+ //-------------------------------------------------------------------------------
+ { 17, 15, 1, 1, 135, 108, 65, 44, 63, 0 },
+ //-------------------------------------------------------------------------------
+ { 21, 0, 1, 2, 171, 84, 126, 17, 26, 0 },
+ { 21, 10, 1, 20, 163, 257, 149, 14, 34, 0 },
+ //-------------------------------------------------------------------------------
+ { 22, 24, 1, 2, 187, 107, 106, 62, 12, 0 },
+ { 22, 27, 0, 32, 181, 203, 88, 13, 5, 0 },
+ { 22, 26, 0, 2, 133, 137, 83, 29, 53, 0 },
+ { 22, 26, 1, 65, 174, 109, 145, 55, 25, 0 },
+ //-------------------------------------------------------------------------------
+ { 24, 1, 1, 1, 163, 225, 124, 12, 36, 0 },
+ { 24, 2, 1, 14, 153, 30, 107, 23, 46, 0 },
+ //-------------------------------------------------------------------------------
+ { 26, 2, 1, 1, 130, 87, 44, 50, 69, 0 },
+ { 26, 12, 1, 52, 177, 272, 103, 27, 22, 0 },
+ { 26, 18, 0, 80, 133, 199, 95, 50, 66, 0 },
+ //-------------------------------------------------------------------------------
+ { 27, 5, 1, 1, 175, 59, 109, 17, 24, 1 },
+ { 27, 6, 1, 19, 177, 161, 103, 18, 22, 1 },
+ //-------------------------------------------------------------------------------
+ { 29, 4, 1, 12, 113, 247, 49, 41, 84, 0 },
+ //-------------------------------------------------------------------------------
+ { 30, 4, 1, 1, 148, 148, 66, 35, 51, 0 },
+ { 30, 16, 1, 37, 173, 109, 84, 20, 26, 0 },
+ //-------------------------------------------------------------------------------
+ { 31, 13, 1, 1, 163, 116, 41, 61, 36, 0 },
+ { 31, 5, 1, 1, 78, 245, 63, 30, 84, 0 },
+ //-------------------------------------------------------------------------------
+ { 34, 7, 1, 99, 127, 73, 41, 79, 72, 0 },
+ { 34, 8, 1, 36, 129, 153, 41, 62, 65, 0 },
+ //-------------------------------------------------------------------------------
+ { 35, 14, 1, 1, 86, 246, 65, 68, 87, 0 },
+ { 35, 17, 1, 70, 150, 118, 52, 40, 23, 0 },
+ //-------------------------------------------------------------------------------
+ { 49, 6, 0, 2, 136, 176, 81, 49, 62, 0 },
+ //-------------------------------------------------------------------------------
+ { 53, 1, 0, 2, 113, 205, 50, 38, 86, 1 },
+ { 53, 2, 0, 41, 159, 27, 117, 25, 40, 0 },
+ { 53, 9, 1, 67, 184, 56, 93, 32, 15, 0 },
+ //-------------------------------------------------------------------------------
+ { 54, 5, 1, 168, 156, 187, 111, 7, 11, 0 },
+ { 54, 12, 1, 16, 156, 190, 64, 18, 24, 0 },
+ //-------------------------------------------------------------------------------
+ { 56, 10, 0, 2, 126, 42, 67, 57, 67, 0 },
+ { 56, 11, 1, 60, 160, 128, 97, 103, 38, 0 },
+ //-------------------------------------------------------------------------------
+ { 58, 0, 0, 1, 156, 143, 120, 120, 43, 0 },
+ { 58, 1, 2, 252, 171, 173, 116, 25, 28, 1 },
+ //-------------------------------------------------------------------------------
+ { 59, 4, 0, 1, 146, 65, 106, 83, 40, 1 }
+};
+
+const RoomUpdate roomUpdates[] = {
+ // room flag val x1 y1 x2 y2 width height type
+ { 5, -1, -1, 114, 130, 211, 87, 109, 69, 1 },
+ { 15, -1, -1, 1, 154, 83, 122, 131, 44, 1 },
+ { 17, -1, -1, 48, 135, 78, 139, 80, 30, 1 },
+ { 18, 24, 1, 177, 1, 69, 29, 142, 130, 1 },
+ { 18, -1, -1, 105, 132, 109, 108, 196, 65, 1 },
+ { 20, -1, -1, 1, 137, 106, 121, 213, 61, 1 },
+ { 27, -1, -1, 38, 177, 103, 171, 21, 22, 1 },
+ { 27, -1, -1, 60, 162, 228, 156, 18, 37, 1 },
+ { 29, -1, -1, 1, 180, 150, 126, 10, 17, 1 },
+ { 31, -1, -1, 63, 190, 223, 157, 17, 9, 1 },
+ { 34, -1, -1, 5, 171, 234, 126, 29, 23, 1 },
+ { 35, -1, -1, 1, 174, 54, 152, 195, 25, 1 },
+ { 50, -1, -1, 4, 153, 118, 95, 67, 44, 1 },
+ { 57, -1, -1, 7, 113, 166, 61, 62, 82, 1 },
+ { 61, -1, -1, 1, 154, 83, 122, 131, 44, 1 },
+ { 63, -1, -1, 1, 154, 83, 122, 131, 44, 1 },
+};
+
+// Note: default action needs to be LAST for each group
+// of actions with the same number
+RoomTalkAction roomActions[] = {
+ //room num action object speech
+ { 0, 1, kVerbLook, -1, 54 },
+ { 0, 1, kVerbMove, -1, 19 },
+ { 0, 1, kVerbPick, -1, 11 },
+ { 0, 1, kVerbOpen, -1, 9 },
+ { 0, 1, kVerbClose, -1, 9 },
+ { 0, 1, kVerbTalk, -1, 16 },
+ { 0, 1, kVerbDefault, -1, 11 },
+ // ----------------------------------
+ { 0, 2, kVerbMove, -1, 19 },
+ { 0, 2, kVerbOpen, -1, 9 },
+ { 0, 2, kVerbClose, -1, 9 },
+ { 0, 2, kVerbTalk, -1, 16 },
+ // ----------------------------------
+ { 0, 3, kVerbLook, -1, 316 },
+ { 0, 3, kVerbMove, -1, 317 },
+ { 0, 3, kVerbPick, -1, 318 },
+ { 0, 3, kVerbOpen, -1, 319 },
+ { 0, 3, kVerbClose, -1, 319 },
+ { 0, 3, kVerbTalk, -1, 320 },
+ { 0, 3, kVerbDefault, -1, 318 },
+ // ----------------------------------
+ { 0, 4, kVerbMove, -1, 19 },
+ { 0, 4, kVerbOpen, -1, 9 },
+ { 0, 4, kVerbClose, -1, 9 },
+ { 0, 4, kVerbTalk, -1, 16 },
+ // ----------------------------------
+ { 0, 5, kVerbOpen, -1, 9 },
+ { 0, 5, kVerbClose, -1, 9 },
+ { 0, 5, kVerbTalk, -1, 16 },
+ // ----------------------------------
+ { 0, 6, kVerbMove, -1, 19 },
+ { 0, 6, kVerbOpen, -1, 9 },
+ { 0, 6, kVerbClose, -1, 9 },
+ { 0, 6, kVerbTalk, -1, 16 },
+ // ==================================
+ { 1, -1, kVerbPick, 118, 5 },
+ { 1, -1, kVerbOpen, 118, 3 },
+ { 1, -1, kVerbClose, 118, 4 },
+ { 1, -1, kVerbTalk, 118, 6 },
+ // ----------------------------------
+ { 1, -1, kVerbLook, 119, 8 },
+ { 1, -1, kVerbMove, 119, 13 },
+ { 1, -1, kVerbClose, 119, 10 },
+ { 1, -1, kVerbTalk, 119, 12 },
+ // ----------------------------------
+ { 1, -1, kVerbMove, 120, 13 },
+ { 1, -1, kVerbOpen, 120, 18 },
+ { 1, -1, kVerbTalk, 120, 15 },
+ // ==================================
+ { 3, -1, kVerbLook, 129, 21 },
+ { 3, -1, kVerbPick, 129, 5 },
+ { 3, -1, kVerbMove, 129, 24 },
+ { 3, -1, kVerbOpen, 129, 22 },
+ { 3, -1, kVerbClose, 129, 10 },
+ // ----------------------------------
+ { 3, -1, kVerbLook, 131, 27 },
+ { 3, -1, kVerbPick, 131, 5 },
+ { 3, -1, kVerbMove, 131, 24 },
+ { 3, -1, kVerbOpen, 131, 22 },
+ { 3, -1, kVerbClose, 131, 10 },
+ { 3, -1, kVerbTalk, 131, 23 },
+ // ----------------------------------
+ { 3, -1, kVerbLook, 132, 28 },
+ { 3, -1, kVerbPick, 132, 5 },
+ { 3, -1, kVerbMove, 132, 24 },
+ { 3, -1, kVerbOpen, 132, 22 },
+ { 3, -1, kVerbClose, 132, 10 },
+ { 3, -1, kVerbTalk, 132, 23 },
+ // ----------------------------------
+ { 3, -1, kVerbLook, 133, 321 },
+ { 3, -1, kVerbPick, 133, 31 },
+ { 3, -1, kVerbMove, 133, 34 },
+ { 3, -1, kVerbOpen, 133, 30 },
+ { 3, -1, kVerbClose, 133, 10 },
+ // ----------------------------------
+ { 3, -1, kVerbLook, 166, 55 },
+ { 3, -1, kVerbPick, 166, 7 },
+ // ----------------------------------
+ { 3, -1, kVerbLook, 211, 184 },
+ // ==================================
+ { 4, -1, kVerbLook, 189, 182 },
+ // ----------------------------------
+ { 4, -1, kVerbLook, 207, 175 },
+ { 4, -1, kVerbTalk, 207, 176 },
+ // ----------------------------------
+ { 4, -1, kVerbLook, 208, 177 },
+ // ----------------------------------
+ { 4, -1, kVerbLook, 209, 179 },
+ // ----------------------------------
+ { 4, -1, kVerbLook, 210, 180 },
+ { 4, -1, kVerbOpen, 210, 181 },
+ // ==================================
+ { 5, -1, kVerbMove, 136, 13 },
+ { 5, -1, kVerbOpen, 136, 18 },
+ { 5, -1, kVerbTalk, 136, 15 },
+ // ----------------------------------
+ { 5, -1, kVerbLook, 212, 187 },
+ { 5, -1, kVerbTalk, 212, 188 },
+ // ----------------------------------
+ { 5, -1, kVerbLook, 213, 189 },
+ { 5, -1, kVerbOpen, 213, 190 },
+ // ==================================
+ { 6, -1, kVerbPick, 144, 43 },
+ // ----------------------------------
+ { 6, -1, kVerbLook, 138, 35 },
+ { 6, -1, kVerbTalk, 138, 6 },
+ // ----------------------------------
+ { 6, -1, kVerbLook, 143, 37 },
+ { 6, -1, kVerbPick, 143, 7 },
+ { 6, -1, kVerbMove, 143, 7 },
+ { 6, -1, kVerbTalk, 143, 38 },
+ // ----------------------------------
+ { 6, -1, kVerbLook, 139, 36 },
+ // ----------------------------------
+ { 6, -1, kVerbLook, 140, 147 },
+ // ==================================
+ { 7, -1, kVerbLook, 164, 35 },
+ // ----------------------------------
+ { 7, -1, kVerbLook, 169, 44 },
+ // ==================================
+ { 9, -1, kVerbLook, 150, 35 },
+ { 9, -1, kVerbTalk, 150, 6 },
+ // ----------------------------------
+ { 9, -1, kVerbLook, 51, 60 },
+ // ==================================
+ { 12, -1, kVerbLook, 154, 329 },
+ { 12, -1, kVerbTalk, 154, 330 },
+ // ----------------------------------
+ { 12, -1, kVerbMove, 155, 48 },
+ { 12, -1, kVerbTalk, 155, 331 },
+ // ----------------------------------
+ { 12, -1, kVerbLook, 156, 35 },
+ { 12, -1, kVerbMove, 156, 48 },
+ { 12, -1, kVerbTalk, 156, 50 },
+ // ==================================
+ { 14, -1, kVerbLook, 200, 165 },
+ // ----------------------------------
+ { 14, -1, kVerbLook, 201, 166 },
+ // ----------------------------------
+ { 14, -1, kVerbLook, 202, 167 },
+ // ----------------------------------
+ { 14, -1, kVerbLook, 203, 168 },
+ { 14, -1, kVerbPick, 203, 170 },
+ { 14, -1, kVerbMove, 203, 170 },
+ { 14, -1, kVerbTalk, 203, 169 },
+ // ----------------------------------
+ { 14, -1, kVerbLook, 204, 171 },
+ // ==================================
+ { 15, -1, kVerbTalk, 188, 333 },
+ { 15, -1, kVerbLook, 188, 334 },
+ // ----------------------------------
+ { 15, -1, kVerbLook, 205, 172 },
+ // ----------------------------------
+ { 15, -1, kVerbLook, 206, 173 },
+ { 15, -1, kVerbMove, 206, 174 },
+ { 15, -1, kVerbOpen, 206, 174 },
+ // ==================================
+ { 16, -1, kVerbTalk, 163, 6 },
+ // ----------------------------------
+ { 16, -1, kVerbLook, 183, 340 },
+ // ----------------------------------
+ { 16, -1, kVerbLook, 185, 37 },
+ { 16, -1, kVerbPick, 185, 7 },
+ { 16, -1, kVerbMove, 185, 7 },
+ { 16, -1, kVerbTalk, 185, 38 },
+ // ----------------------------------
+ { 16, -1, kVerbTalk, 187, 345 },
+ // ==================================
+ { 18, -1, kVerbLook, 181, 348 },
+ // ----------------------------------
+ { 18, -1, kVerbLook, 182, 154 },
+ // ==================================
+ { 19, -1, kVerbLook, 214, 191 },
+ // ==================================
+ { 22, -1, kVerbPick, 140, 7 },
+ // ----------------------------------
+ { 22, -1, kVerbLook, 52, 497 },
+ { 22, -1, kVerbTalk, 52, 498 },
+ // ==================================
+ { 24, -1, kVerbLook, 151, 461 },
+ // ==================================
+ { 26, -1, kVerbOpen, 167, 467 },
+ // ----------------------------------
+ { 26, -1, kVerbLook, 164, 470 },
+ { 26, -1, kVerbOpen, 164, 471 },
+ // ----------------------------------
+ { 26, -1, kVerbLook, 163, 472 },
+ { 26, -1, kVerbPick, 163, 473 },
+ // ----------------------------------
+ { 26, -1, kVerbLook, 165, 474 },
+ // ----------------------------------
+ { 26, -1, kVerbLook, 168, 476 },
+ { 26, -1, kVerbPick, 168, 477 },
+ // ==================================
+ { 27, -1, kVerbLook, 175, 429 },
+ // ==================================
+ { 29, -1, kVerbLook, 152, 463 },
+ { 29, -1, kVerbOpen, 152, 464 },
+ // ----------------------------------
+ { 29, -1, kVerbLook, 153, 465 },
+ // ----------------------------------
+ { 29, -1, kVerbPick, 154, 466 },
+ // ----------------------------------
+ { 29, -1, kVerbOpen, 156, 467 },
+ // ==================================
+ { 30, -1, kVerbOpen, 157, 468 },
+ // ----------------------------------
+ { 30, -1, kVerbLook, 158, 469 },
+ // ==================================
+ { 31, -1, kVerbLook, 161, 470 },
+ { 31, -1, kVerbOpen, 161, 471 },
+ // ==================================
+ { 34, -1, kVerbLook, 146, 458 },
+ { 34, -1, kVerbPick, 146, 459 },
+ // ==================================
+ { 44, -1, kVerbLook, 172, 428 },
+ // ==================================
+ { 49, -1, kVerbLook, 51, 132 },
+ // ----------------------------------
+ { 49, -1, kVerbLook, 200, 133 },
+ { 49, -1, kVerbTalk, 200, 134 },
+ // ----------------------------------
+ { 49, -1, kVerbLook, 201, 135 },
+ // ----------------------------------
+ { 49, -1, kVerbLook, 203, 137 },
+ // ==================================
+ { 53, -1, kVerbLook, 121, 128 },
+ // ----------------------------------
+ { 53, -1, kVerbLook, 209, 129 },
+ // ----------------------------------
+ { 53, -1, kVerbLook, 52, 447 },
+ { 53, -1, kVerbTalk, 52, 131 },
+ // ==================================
+ { 54, -1, kVerbLook, 53, 127 },
+ // ----------------------------------
+ { 54, -1, kVerbOpen, 119, 125 },
+ { 54, -1, kVerbLook, 119, 126 },
+ // ==================================
+ { 55, -1, kVerbLook, 122, 138 },
+ // ----------------------------------
+ { 55, -1, kVerbLook, 204, 139 },
+ // ----------------------------------
+ { 55, -1, kVerbLook, 205, 140 },
+ // ==================================
+ { 56, -1, kVerbLook, 124, 450 },
+ // ----------------------------------
+ { 56, -1, kVerbOpen, 207, 141 },
+ // ----------------------------------
+ { 56, -1, kVerbLook, 208, 142 },
+ // ==================================
+ { 58, -1, kVerbLook, 104, 454 },
+ // ==================================
+ { 60, -1, kVerbLook, 112, 440 },
+ // ----------------------------------
+ { 60, -1, kVerbTalk, 115, 455 },
+ // ----------------------------------
+ { 60, -1, kVerbTalk, 56, 455 },
+ // ----------------------------------
+ { 60, -1, kVerbLook, 114, 167 },
+ // ----------------------------------
+ { 60, -1, kVerbLook, 113, 168 },
+ { 60, -1, kVerbPick, 113, 170 },
+ { 60, -1, kVerbMove, 113, 170 },
+ { 60, -1, kVerbTalk, 113, 169 },
+ // ==================================
+ { 61, -1, kVerbLook, 116, 172 },
+ // ----------------------------------
+ { 61, -1, kVerbLook, 117, 173 },
+ // ----------------------------------
+ { 61, -1, kVerbMove, 117, 174 },
+ { 61, -1, kVerbOpen, 117, 174 },
+ { 62, -1, kVerbLook, 100, 168 },
+ { 62, -1, kVerbTalk, 100, 169 },
+ { 62, -1, kVerbPick, 100, 170 },
+ // ----------------------------------
+ { 62, -1, kVerbLook, 101, 171 },
+ // ----------------------------------
+ { 62, -1, kVerbLook, 102, 167 },
+ // ----------------------------------
+ { 62, -1, kVerbLook, 103, 166 },
+ // ==================================
+ { 63, -1, kVerbLook, 110, 172 },
+ // ----------------------------------
+ { 63, -1, kVerbLook, 109, 173 },
+ { 63, -1, kVerbMove, 109, 174 },
+ // ----------------------------------
+ { 63, -1, kVerbLook, 108, 334 },
+ { 63, -1, kVerbTalk, 108, 333 },
+ // ==================================
+ { 102, -1, kVerbLook, 100, 452 },
+ { 102, -1, kVerbLook, 101, 123 },
+ // ==================================
+ // Pseudoroom. checkAction() menuScreen == 1
+ { 200, 1, kVerbLook, 28, 328 },
+ // ----------------------------------
+ { 200, 2, kVerbLook, 28, 328 },
+ { 200, 2, kVerbLook, 7, 143 },
+ { 200, 2, kVerbLook, 8, 145 },
+ { 200, 2, kVerbLook, 9, 147 },
+ { 200, 2, kVerbLook, 10, 151 },
+ { 200, 2, kVerbLook, 11, 152 },
+ { 200, 2, kVerbLook, 12, 154 },
+ { 200, 2, kVerbLook, 13, 155 },
+ { 200, 2, kVerbLook, 14, 157 },
+ { 200, 2, kVerbLook, 15, 58 },
+ { 200, 2, kVerbLook, 16, 158 },
+ { 200, 2, kVerbLook, 17, 159 },
+ { 200, 2, kVerbLook, 18, 160 },
+ { 200, 2, kVerbLook, 19, 161 },
+ { 200, 2, kVerbLook, 23, 152 },
+ { 200, 2, kVerbTalk, 7, 144 },
+ { 200, 2, kVerbTalk, 8, 146 },
+ { 200, 2, kVerbTalk, 9, 148 },
+ { 200, 2, kVerbTalk, 11, 153 },
+ // ----------------------------------
+ { 200, 3, kVerbLook, 22, 307 },
+ { 200, 3, kVerbLook, 28, 328 },
+ { 200, 3, kVerbLook, 7, 143 },
+ { 200, 3, kVerbLook, 8, 145 },
+ { 200, 3, kVerbLook, 9, 147 },
+ { 200, 3, kVerbLook, 10, 151 },
+ { 200, 3, kVerbLook, 11, 152 },
+ { 200, 3, kVerbLook, 12, 154 },
+ { 200, 3, kVerbLook, 13, 155 },
+ { 200, 3, kVerbLook, 14, 157 },
+ { 200, 3, kVerbLook, 15, 58 },
+ { 200, 3, kVerbLook, 16, 158 },
+ { 200, 3, kVerbLook, 17, 159 },
+ { 200, 3, kVerbLook, 18, 160 },
+ { 200, 3, kVerbLook, 19, 161 },
+ { 200, 3, kVerbLook, 20, 162 },
+ { 200, 3, kVerbLook, 23, 152 },
+ { 200, 3, kVerbTalk, 7, 144 },
+ { 200, 3, kVerbTalk, 8, 146 },
+ { 200, 3, kVerbTalk, 9, 148 },
+ { 200, 3, kVerbTalk, 11, 153 },
+ // ----------------------------------
+ { 200, 4, kVerbLook, 7, 478 },
+ { 200, 4, kVerbLook, 8, 480 },
+ { 200, 4, kVerbLook, 10, 485 },
+ { 200, 4, kVerbLook, 11, 488 },
+ { 200, 4, kVerbLook, 12, 486 },
+ { 200, 4, kVerbLook, 13, 490 },
+ { 200, 4, kVerbLook, 14, 122 },
+ { 200, 4, kVerbLook, 15, 117 },
+ { 200, 4, kVerbLook, 16, 491 },
+ { 200, 4, kVerbLook, 17, 478 },
+ { 200, 4, kVerbLook, 18, 493 },
+ { 200, 4, kVerbLook, 20, 162 },
+ { 200, 4, kVerbLook, 21, 496 },
+ { 200, 4, kVerbLook, 22, 161 },
+ { 200, 4, kVerbLook, 28, 328 },
+ { 200, 4, kVerbTalk, 15, 118 },
+ { 200, 4, kVerbOpen, 15, 119 },
+ { 200, 4, 14, 19, 484 },
+ { 200, 4, 19, 14, 484 },
+ // ----------------------------------
+ { 200, 5, kVerbLook, 7, 478 },
+ { 200, 5, kVerbLook, 8, 120 },
+ { 200, 5, kVerbLook, 11, 488 },
+ { 200, 5, kVerbLook, 13, 490 },
+ { 200, 5, kVerbLook, 14, 121 },
+ { 200, 5, kVerbLook, 15, 117 },
+ { 200, 5, kVerbLook, 17, 478 },
+ { 200, 5, kVerbLook, 20, 162 },
+ { 200, 5, kVerbLook, 28, 328 },
+ { 200, 5, kVerbTalk, 15, 118 },
+ { 200, 5, kVerbOpen, 15, 119 },
+ // ----------------------------------
+ { 200, 6, kVerbLook, 20, 123 },
+ { 200, 6, kVerbLook, 21, 441 },
+ { 200, 6, kVerbLook, 28, 328 },
+ // ==================================
+ // Pseudoroom. checkAction() menuScreen != 1
+ { 201, 1, kVerbLook, 50, 308 },
+ { 201, 1, kVerbOpen, 50, 310 },
+ { 201, 1, kVerbClose, 50, 311 },
+ { 201, 1, kVerbMove, 50, 312 },
+ { 201, 1, kVerbPick, 50, 313 },
+ { 201, 1, kVerbTalk, 50, 314 },
+ // ----------------------------------
+ { 201, 2, kVerbLook, 50, 308 },
+ { 201, 2, kVerbOpen, 50, 310 },
+ { 201, 2, kVerbClose, 50, 311 },
+ { 201, 2, kVerbMove, 50, 312 },
+ { 201, 2, kVerbPick, 50, 313 },
+ { 201, 2, kVerbTalk, 50, 314 },
+ { 201, 2, 13, 50, 156 },
+ { 201, 2, 20, 50, 163 },
+ // ----------------------------------
+ { 201, 3, kVerbLook, 50, 309 },
+ { 201, 3, kVerbOpen, 50, 310 },
+ { 201, 3, kVerbClose, 50, 311 },
+ { 201, 3, kVerbMove, 50, 312 },
+ { 201, 3, kVerbPick, 50, 313 },
+ { 201, 3, kVerbTalk, 50, 314 },
+ // ----------------------------------
+ { 201, 4, kVerbLook, 50, 309 },
+ { 201, 4, kVerbOpen, 50, 310 },
+ { 201, 4, kVerbClose, 50, 311 },
+ { 201, 4, kVerbMove, 50, 312 },
+ { 201, 4, kVerbPick, 50, 313 },
+ { 201, 4, kVerbTalk, 50, 314 },
+ { 201, 4, 9, 50, 484 },
+ { 201, 4, 20, 50, 487 },
+ // ----------------------------------
+ { 201, 5, kVerbLook, 50, 309 }, // Originally these are with
+ { 201, 5, kVerbOpen, 50, 310 }, // completely wrong voices
+ { 201, 5, kVerbClose, 50, 311 },
+ { 201, 5, kVerbMove, 50, 312 },
+ { 201, 5, kVerbPick, 50, 313 },
+ { 201, 5, kVerbTalk, 50, 314 },
+ { 201, 5, 20, 50, 487 },
+ // ----------------------------------
+ { 201, 6, kVerbOpen, 50, 310 },
+ { 201, 6, kVerbClose, 50, 311 },
+ { 201, 6, kVerbMove, 50, 312 },
+ { 201, 6, kVerbPick, 50, 313 },
+ { 201, 6, kVerbTalk, 50, 314 },
-const char *_text[][501] = {
+};
+
+const char *_text[NUM_LANGS][NUM_TEXT] = {
{
+ // 0
"",
- "ITS THE SECOND BIGGEST DOOR I'VE SEEN IN MY LIFE",
+ "THAT'S THE SECOND BIGGEST DOOR I'VE SEEN IN MY LIFE",
"NOT REALLY",
"THE CHURCH IS ALL BOARDED UP, IT MUST HAVE BEEN ABANDONED SEVERAL YEARS AGO",
"I HAVEN'T OPENED IT",
+ // 5
"WHAT SHOULD I DO, SHOULD I PULL IT OFF?",
"HI THERE DOOR, I'M GOING TO MAKE YOU A DOOR-FRAME",
- "IT'S TOO MUCH FOR ME",
- "THERE'S A WINDOW STOPPING THE GAME FROM WORKING PROPERLY",
+ "IT'S TOO TOUGH FOR ME",
+ "THE WINDOW IS BOARDED UP",
"I CAN'T",
+ // 10
"YES, THAT'S DONE",
"WHY?",
"HI WINDOW, ARE YOU DOING ANYTHING TONIGHT?",
"NOT WITHOUT PERMISSION FROM THE TOWN HALL",
"IF ONLY THIS WINDOW WASN'T BOARDED UP...",
+ // 15
"YOO-HOO WINDOW!",
"HI THERE",
"LIKE MICROCHOF'S",
"I CAN'T REACH",
"IT'S ALRIGHT WHERE IT IS",
+ // 20
"",
- "ITS A COFFIN IN THE SHAPE OF A CROSS",
+ "IT'S A COFFIN IN THE SHAPE OF A CROSS",
"NO THANKS",
"HI DEAD MAN. NO, DON'T GET UP FOR MY SAKE",
"YES, JUST LIKE IN POLTERGEIST",
+ // 25
"",
"",
"I'LL BE BACK IN FIFTEEN MINUTES",
- "FORBIDDEN TO PUT UP POSTERS",
+ "IT'S FORBIDDEN TO PUT UP POSTERS",
"IT'S UNCLE EVARISTO'S TOMB",
- "ITS LOCKED",
+ // 30
+ "IT'S LOCKED",
"I'VE GOT ONE",
- "YOO HOO, UNCLE EVERISTO!",
- "THERE'S NO REPLY",
+ "YOO HOO, UNCLE EVARISTO!",
+ "THERE'S NO POWER",
"IT'S NOT WELL PARKED",
+ // 35
"IT'S A DOOR",
"A DRAWER IN THE TABLE",
"A SUSPICIOUS WARDROBE",
"HI WARDROBE, HOW ARE YOU?",
"",
+ // 40
"",
"IT'S AN ANCIENT CANDELABRUM",
- "IT MUST HAVE BEEN HERE EVER SINCE YULE BRINNER HAD HAIR ON HIS HEAD",
- "NO, ITS A RELIC",
- "ITS A NICE ALTARPIECE",
+ "IT MUST HAVE BEEN HERE SINCE YULE BRINNER HAD HAIR ON HIS HEAD",
+ "NO, IT'S A RELIC",
+ "IT'S A NICE ALTARPIECE",
+ // 45
"",
"HA, HA, HA",
"",
"NO",
"",
+ // 50
"HA, HE, HI, HO, HU, GREAT!",
"",
"",
"",
"I CAN'T SEE ANYTHING IN PARTICULAR",
+ // 55
"IT'S FERNAN, THE PLANT",
- "IT'S ONE OF THE FENCES SPIKES",
+ "IT'S ONE OF THE FENCE SPIKES",
"HEY! THERE'S A PACKET OF MATCHES UNDER HERE",
"LOOK! A PACKET OF KLEENEX, AND ONE'S STILL UNUSED",
"THERE ISN'T ANYTHING ELSE IN THE BUCKET",
+ // 60
"IT'S A BLIND MAN WHO CAN'T SEE",
"",
"",
"",
"",
+ // 65
"THAT'S A GREAT DEAL OF MONEY",
"",
"",
"",
"",
+ // 70
"",
"",
"",
"",
"",
+ // 75
"",
"",
"",
"",
"",
+ // 80
"",
"",
"",
"",
"",
+ // 85
"",
"",
"",
"",
"",
+ // 90
"",
"",
"",
"",
"",
+ // 95
"",
"",
"",
"",
"",
+ // 100
"THERE IS NOTHING SPECIAL ABOUT IT",
"IT'S NOT UNUSUAL",
"HEY, WHAT'S UP MAN?",
"HI",
"NOTHING NEW?",
+ // 105
"HOW IS THE FAMILY?",
"THAT IS JUST LIKE YOU!",
"BUT HOW DO I GET THAT?",
- "MY RELIGION DOES NOT ALLOW ME",
+ "MY RELIGION DOES NOT ALLOW ME TO",
"IT'D BE BETTER NOT",
+ // 110
"YEAH, SURE MAN!",
"NO WAY",
"IMPOSSIBLE",
"THIS WILL NOT OPEN",
"I CAN'T DO IT BY MYSELF",
+ // 115
"I COULD DO IT, BUT I JUST FEEL A LITTLE LAZY",
"I DO NOT SEE THE REASON",
- "IT'S A QUITE NICE BRAIN",
+ "IT'S QUITE A NICE BRAIN",
"AND SO BRAIN, WHAT ARE YOU UP TONIGHT?",
"NO, IT MUST BE KEPT SOMEWHERE AWAY FROM THE MUTANT ACTION OF THE ATMOSPHERE",
- "HE IS VERY STIFF, JUST LIKE MY BOSS",
- "A VERY SHARP STICK",
- "YOU FAITHFUL SHARP-PAINTED STICK, NOBLE TRANSILVAAANIAN OAK TREE",
+ // 120
+ "IT IS VERY STIFF, JUST LIKE MY BOSS",
+ "A VERY SHARP STAKE",
+ "YOU FAITHFUL SHARP-POINTED STAKE, FROM THE MOST NOBLE TRANSILVANIAN OAK TREE",
"DAMN, I HAVE TO CUT MY NAILS!",
"B.J. IS IN THERE... SHE IS A REALLY HOT CHICK!",
+ // 125
"IT IS FIRMLY LOCKED",
- "\"SAVE AWAY LOCKS LTD.\"",
+ "\"SAFE AWAY LOCKS LTD.\"",
"IT IS THE TYPICAL SKELETON YOU FIND IN THE DUNGEONS OF ALL THE GAMES",
- "IT IS COMMONLY USED TO COMMUNICATE ELECTRICITY TO THE MACHINES CONNECTED TO IT",
- "IT IS ABSOLUTELY HAND MADE BECAUSE THE JAPANESE MAKE THEM POCKET SIZE",
- "I HAVE ONLY SEEN IN MY LIFE ANOTHER THING AS UGLY AS THIS ONE",
+ "IT IS COMMONLY USED TO TRANSFER ELECTRICITY TO THE MACHINES CONNECTED TO IT",
+ "IT IS HAND MADE BECAUSE THE JAPANESE MAKE THEM POCKET SIZE",
+ // 130
+ "I HAVE ONLY ONCE SEEN IN MY LIFE ANOTHER THING AS UGLY AS THIS",
"FORGET IT. I AM NOT GOING TO TELL HIM ANYTHING IN CASE HE GETS MAD",
- "IT SEEMS QUITE RATIONAL",
+ "HE SEEMS QUITE RATIONAL",
"IT IS A PICTURE OF PLATO WRITING HIS LOST DIALOGUE",
- "I AM NOT ONE OF THOSE WHO TALKS TO POSTERS",
+ "I AM NOT ONE OF THOSE PEOPLE WHO TALKS TO POSTERS",
+ // 135
"THAT'S A VERY CUTE DESK",
"IT IS A VAMPIRES HUNTER'S DIPLOMA OFFICIALLY APPROVED BY OXFORD UNIVERSITY",
- "IT'S A DARK NIGHT WITH FULL MOON",
- "IT SEEMS LIKE THESE SCREWS ARE NOT MUCH TWISTED",
+ "IT'S A DARK NIGHT WITH A FULL MOON",
+ "IT SEEMS LIKE THESE SCREWS ARE NOT TIGHTENED PROPERLY",
"DON'T LOOK NOW, BUT I THINK THAT A HIDDEN CAMERA IS FOCUSING ON ME",
- "THAT'S A VERY MODERN STICK DETECTOR",
+ // 140
+ "THAT'S A VERY MODERN STAKE DETECTOR",
"NO. THE LABORATORY IS ON THE SECOND FLOOR",
"A NICE BEDSIDE TABLE",
"IT'S A LOT OF MONEY THAT CAN'T BE MISSING IN ANY VALUABLE ADVENTURE",
"IF I WERE A RICH MAN, DUBIDUBIDUBIDUBIDUBIDUBIDUBIDU",
+ // 145
"THOSE ARE STRANGE LEAVES. THEY MUST HAVE BROUGHT THEM FROM SOUTH AMERICA OR AROUND THERE",
"I DON'T THINK THEY WOULD ANSWER ME",
- "THAT'S A BEAUTIFUL WOODEN CRUCIFIX. THE ICON DOESN'T REALLY GET ALL THE BEAUTY WITHIN IT",
+ "THAT'S A BEAUTIFUL WOODEN CRUCIFIX. THE ICON DOESN'T REALLY SHOW THE FULL EXTENT OF IT'S BEAUTY",
"I ONLY PRAY BEFORE I GO TO BED",
- "HEY, THIS PIKE SEEMS A LITTLE BIT LOOSE!",
- "I HOPE YOU WON'T COMPLAIN ABOUT GETTING NO CLUES FROM ME",
- "IT'S A QUITE CONVENTIONAL PIKE",
- "THEY ARE CUTE, THOUGH THEY ARE COVERED WITH A LITTLE BIT OF SHIT",
+ "HEY, THIS SPIKE SEEMS A LITTLE BIT LOOSE!",
+ // 150
+ "I HOPE YOU WON'T COMPLAIN ABOUT NOT GETTING ANY CLUES FROM ME",
+ "IT'S A QUITE CONVENTIONAL SPIKE",
+ "THEY ARE CUTE, THOUGH THEY ARE COVERED WITH A LITTLE BIT OF WAX",
"NO, THEY WON'T HEAR ME. HA,HA,HA THIS IS GREAT!",
- "\"SLEEPING BEAUTY\" FROM CHAIKOSKY, OR CHOIFRUSKY, OR WHATEVER IT IS",
+ "\"SLEEPING BEAUTY\" FROM TCHAIKOVSKY, OR CHOIFRUSKY, OR WHATEVER IT IS",
+ // 155
"VERY TEMPTING",
- "NO, I'M NOT ONE OF THOSE WHO PUT USED BUBBLE GUMS IN THEIR MOUTH",
- "THAT'S A VERY NICE SICKLE. I WONDER WHERE THE HAMMER MAY BE",
+ "NO, I DO NOT PUT USED BUBBLE GUM IN MY MOUTH",
+ "THAT'S A VERY NICE SICKLE. I WONDER WHERE THE HAMMER IS",
"TOBACCO MANUFACTURERS WARN ABOUT HEALTH BEING SERIOUSLY DAMAGED BY SANITARY AUTHORITIES",
"AN ABSOLUTELY NORMAL CANDLE, INCLUDING WAX AND EVERYTHING",
- "THESE TWO SHINY COINS DO REALLY GLITTER!",
- "THIS SHINY COIN DOES REALLY GLITTER!",
- "WITH THIS I WILL BE IMMUNE AGAINST VAMPIRE'S BITES",
+ // 160
+ "THESE TWO SHINY COINS REALLY GLITTER!",
+ "THIS SHINY COIN REALLY GLITTERS!",
+ "WITH THIS I WILL BE IMMUNE AGAINST VAMPIRE BITES",
"NO, IT'S IS NOT THE RIGHT MOMENT YET",
- "THERE IS A ONE THOUSAND BILL AND A COUPLE COINS",
+ "THERE IS A ONE THOUSAND BILL AND A COUPLE OF COINS",
+ // 165
"IT SAYS \"PLEASE, DO NOT THROW FOOD TO THE PIANIST\"",
- "OMELET, 200. FRIED FISH, 150, MAYONNAISE POTATOES, 225",
- "BEST BURGERS ON THIS SIDE OF THE DANUBE, ONLY FOR 325!",
- "THAT'S A NICE SKULL WITH A VERY PENETRATING LOOK, HA, HA, HA, HA, THAT WAS GOOD!",
+ "OMELETTE, 1.00. FRIED FISH, 0.80, MAYONNAISE POTATOES, 1.10",
+ "BEST BURGERS ON THIS SIDE OF THE DANUBE, ONLY 325!",
+ "THAT'S A NICE SKULL WITH A VERY PENETRATING LOOK, HA, HA, HA, HA, THAT WAS GOOD!",
"HI SKULL, YOU REMIND ME OF UNCLE HAMLET",
+ // 170
"I HAVE THE HABIT OF NOT TOUCHING THINGS THAT HAVE BEEN ALIVE",
"IT'S A BIN",
"IT'S A BET FOR TONIGHT'S GAME",
- "I WONDER WHAT THERE IS BEHIND THAT",
- "HEY, THAT CURTAIN IS NOT MOVING!",
+ "I WONDER WHAT IS BEHIND THAT",
+ "HEY, THE CURTAIN WILL NOT MOVE!",
+ // 175
"MAN, THIS CASTLE IS REALLY GLOOMY",
"I CAN'T, HE IS TOO FAR AWAY TO HEAR ME",
- "IT'S THE TYPICAL TRANSILVANIAN FOREST, WITH TREES",
- "MAN YOU REALLY SAY STUPID THINGS, AND THIS IS TOO DARK!",
+ "IT'S A TYPICAL TRANSILVANIAN FOREST, WITH TREES",
+ "MAN YOU SAY REALLY STUPID THINGS, THIS ROOM IS TOO DARK!",
"GARCIA, CANDY STORE. SWEETS AND BUBBLE GUM",
+ // 180
"A VERY NICE DOOR",
"IT'S CLOSED",
- "A COMPLETELY LOCKED BARREL",
+ "A COMPLETELY SEALED BARREL",
"",
"AREN'T THESE BUGS REALLY CUTE?",
- "BSSST, PUSSYCAT... LITTLE CAT",
+ // 185
+ "PSSST, PUSSYCAT... LITTLE CAT",
"THERE IS NO ANSWER",
"THE MOON IS A SATELLITE THAT TURNS AROUND THE EARTH WITH A REVOLUTION PERIOD OF 28 DAYS",
"HI, LOONY MOON",
- "IT'S TOTALLY BLOCKED UP WITH PLANKS",
+ "IT'S TOTALLY BOARDED UP WITH PLANKS",
+ // 190
"IT'S IMPOSSIBLE. NOT EVEN THAT TOUGH GUY FROM TV COULD OPEN THIS",
"HEY! THE SHADOW OF THAT CYPRESS LOOKS PROLONGED TO ME!",
"YOU, BARTENDER...!!",
"I WOULD LIKE TO HAVE A ROOM PLEASE",
- "DO YOU KNOW WHERE I CAN FIND THE SO CALLED DRASCULA?",
+ "DO YOU KNOW WHERE I CAN FIND THE MAN CALLED DRASCULA?",
+ // 195
"YES, SO WHAT?",
"SO?",
"IS...THAT RIGHT?",
- "GOOD QUESTION. NOW, LET ME TELL YOU MY STORY. LOOK...",
- "IT'S JUST FIVE MINUTES",
+ "GOOD QUESTION. LET ME TELL YOU MY STORY. LOOK...",
+ "IT WILL TAKE JUST FIVE MINUTES",
+ // 200
"I'M JOHN HACKER AND I REPRESENT A BRITISH PROPERTY COMPANY",
- "AS FAR AS I KNOW, COUNT DRASCULA WANTS TO BUY SOME PIECES OF LAND IN GIBRALTAR AND MY COMPANY SENT ME HERE TO NEGOTIATE THE SELLING",
- "I THINK I'M GOING BACK TO MY MUM'S TOMORROW FIRST THING IN THE MORNING",
+ "AS FAR AS I KNOW, COUNT DRASCULA WANTS TO BUY SOME PIECES OF LAND IN GIBRALTAR AND MY COMPANY SENT ME HERE TO NEGOTIATE THE SALE",
+ "I THINK I'M GOING BACK TO MY MUM'S TOMORROW, FIRST THING IN THE MORNING",
"BEAUTIFUL NIGHT, HUH?",
"NO, NOTHING",
+ // 205
"YOU...PIANIST...!!!!",
"BEAUTIFUL NIGHT",
- "AND IT'S NOT EVEN COLD OR ANYTHING",
+ "AND IT'S NOT EVEN COLD OR ANYTHING, BY THE WAY, CANT YOU PLAY A DIFFERENT SONG?",
"ALL RIGHT, I'LL JUST LET YOU GO ON PLAYING",
"WELL THEN",
+ // 210
"HI BOSS, HOW ARE YOU?",
"AND HOW IS THE FAMILY?",
"THIS IS QUITE GROOVY, HUH?",
"I'D BETTER NOT SAY ANYTHING",
- "THERE IS NO PLACE LIKE HOME. THERE IS NO...WHAT?, BUT YOU ARE NOT AUNT EMMA. AS A MATTER OF FACT, I DON'T HAVE ANY AUNT EMMA!",
- "YES, SO DOES MINE. YOU CAN CALL ME ANYTHING YOU WANT, BUT IF YOU CALL ME JHONNY, I'LL COME TO YOU LIKE A DOG",
+ "THERE IS NO PLACE LIKE HOME. THERE IS NO...WHAT?, BUT YOU ARE NOT AUNTIE EMMA. AS A MATTER OF FACT, I DON'T HAVE AN AUNTIE EMMA!",
+ // 215
+ "YOU CAN CALL ME ANYTHING YOU WANT, BUT IF YOU CALL ME JOHNNY, I'LL COME TO YOU LIKE A DOG",
"AREN'T I JUST A FUNNY GUY, HUH?. BY THE WAY, WHERE AM I?",
"YES",
"SHOOT...!",
"OH, SURE...OF COURSE!",
+ // 220
"WELL, THANKS VERY MUCH FOR YOUR HELP. I WON'T BOTHER YOU ANYMORE IF YOU PLEASE TELL ME WHERE THE DOOR IS...",
- "IT'S BECAUSE THE KNOCK MUST HAVE AFFECTED MY BRAIN...I CAN'T SEE A THING...",
- "WELL...THAT DOESN'T MATTER. I ALWAYS CARRY AN SPARE ONE",
+ "THE KNOCK MUST HAVE AFFECTED MY BRAIN...I CAN'T SEE A THING...",
+ "WELL...THAT DOESN'T MATTER. I ALWAYS CARRY A SPARE PAIR",
"WOW, WHAT A HOT CHICK!! I DIDN'T NOTICE!, BUT OF COURSE, I WASN'T WEARING MY GLASSES",
"HEY...",
+ // 225
"AND ALL THIIIISSS???",
"DON'T WORRY B.J. HONEY, I'LL SAVE YOU FROM FALLING INTO HIS CLUTCHES...",
"YOU REALLY GOT ME MAD MAN...",
"AHHH A WEREWOLF!! DIE YOU DAMNED EVIL!",
"YES, WELL...",
- "YES, WELL...I THINK I'LL JUST GO ON MY WAY. EXCUSE ME",
+ // 230
+ "YES, WELL... I THINK I'LL JUST GO ON MY WAY. EXCUSE ME",
"WHAT?",
"TO TELL YOU THE TRUTH...ON SECOND THOUGHTS...I DON'T REALLY THINK SO",
"AND SO TELL ME YOU ERUDITE PHILOSOPHER, IS THERE ANY RELATIONSHIP CAUSE-AND-EFFECT BETWEEN SILLY AND BILLY?",
- "OK, OK, FORGET IT. I DON'T EVEN KNOW WHU I SAID ANYTHING ABOUT IT",
- "WHAT ARE YOU DONIG HERE PHILOSPOZING INSTEAD OF BEING EATING SOME PEOPLE",
+ "OK, OK, FORGET IT. I DON'T EVEN KNOW WHY I SAID ANYTHING ABOUT IT",
+ // 235
+ "WHY ARE YOU PHILOSOPHIZING INSTEAD OF EATING PEOPLE?",
"HOW COME?",
- "HEY, COULD YOU SAY AGAIN ALL THAT ABOUT PRE-EVOLUTIONARY RELATIONSHIPS?",
- "YES, MAN. ALL THAT STUFF YOU TOLD ME ABOUT NEFORE. I DIDN'D GET IT VERY WELL, YOU KNOW",
+ "HEY, COULD YOU SAY ALL THAT STUFF ABOUT PRE-EVOLUTIONARY RELATIONSHIPS AGAIN?",
+ "YES, MAN. ALL THAT STUFF YOU TOLD ME ABOUT BEFORE. I DIDN'T UNDERSTAND IT, YOU KNOW",
"NO, I'D RATHER NOT SAY ANYTHING, IN CASE HE GETS ANGRY OR SOMETHING...",
+ // 240
"HELLO?",
"YES, WHAT'S UP?",
"WELL, NOW THAT YOU MENTION IT, I'LL TELL YOU THAT...",
"",
- "WELL, THANKS FOR CALLING. BY THE WAY, THIS IS NOT THE CASE, OF COURSE, BUT WHAT COULD HAPPEN IF A VAMPIRE GOT THE RECIPE BY ANY CHANCE?",
- "WELL ANYWAY. LISTEN, DOESN'T THIS LOOK TO YOU LIKE A LOT OF CRAP TO END UP SOON WITH THE GAME?. WELL, MAYBE NOT",
+ "BY THE WAY, THIS IS NOT THE CASE, OF COURSE, BUT WHAT COULD HAPPEN IF A VAMPIRE GOT THE RECIPE BY ANY CHANCE?",
+ // 245
+ "WELL ANYWAY. LISTEN, DOESN'T THIS LOOK LIKE A LOT OF CRAP TO END THE GAME WITH?. WELL, MAYBE NOT",
"IT'S EMPTY!",
- "WHY DID YOU TAKE MY ONLY LOVE, B.J., AWAY FROM ME?. LIFE HAS NO MEANING FOR WITHOUT HER",
+ "WHY DID YOU TAKE MY ONLY LOVE, B.J., AWAY FROM ME?. LIFE HAS NO MEANING FOR ME WITHOUT HER",
"HER BRAIN?\?!!",
- "TO TELL YOU THE TRUTH, I THINK I HAD JUST ENOUGH WITH YOUR OF YOUR LITTLE MONSTER",
- "OH PLEASE, HOLLY VIRGIN, DON'T LET ANYTHING WORSE HAPPEN TO ME!!",
- "YOU ARE NOT GOING TO GET YOUR WAY. I'M SURE SUPERMAN WILL CAME AND RESCUE ME!",
- "WHAT A SHIT OF GAME IS THIS IN WHICH THE PROTAGONIST DIES!",
+ "TO TELL YOU THE TRUTH, I THINK I HAVE HAD ENOUGH FUN WITH YOUR LITTLE MONSTER ALREADY",
+ // 250
+ "OH PLEASE, HOLY VIRGIN, DON'T LET ANYTHING WORSE HAPPEN TO ME!!",
+ "YOU ARE NOT GOING TO GET YOUR WAY. I'M SURE SUPERMAN WILL COME AND RESCUE ME!",
+ "WHAT SORT OF A SHIT GAME IS THIS IN WHICH THE PROTAGONIST DIES!",
"HEY, WAIT A SECOND!, WHAT ABOUT MY LAST WISH?",
"HA. HA, I'M NOW IMMUNIZED AGAINST YOU DAMNED EVIL!. THIS CIGARETTE IS AN ANTI-VAMPIRE BREW THAT VON BRAUN GAVE TO ME",
+ // 255
"YES SURE, BUT YOU'LL NEVER GET ME TO GIVE YOU THE RECIPE",
- "APART FROM CREATING TORTURE, I CAN ALSO STAND IT.",
+ "APART FROM CREATING TORTURE, I CAN ALSO WITHSTAND IT.",
"OH, NO PLEASE! I'LL TALK, BUT PLEASE, DON'T DO THAT TO ME!",
- "ALL RIGHT THEN. I TOLD YOU WHAT YOU WANTED TO KNOW. NOW SET B.J. AND ME FREE AND LEAVE US ALONE!",
+ "ALL RIGHT THEN. I TOLD YOU WHAT YOU WANTED TO KNOW. NOW SET B.J. AND ME FREE THEN LEAVE US ALONE!",
"WHAT ARE YOU DOING HERE B.J.?. WHERE IS DRASCULA?",
- "WHAT A MEAN GUY!. JUST BECAUSE HE BELONGS TO THE NOBILITY HE THINKS HE IS ENTITLED TO SLEEP WITH ANYBODY HE FEELS LIKE",
+ // 260
+ "WHAT A MEAN GUY!. JUST BECAUSE HE BELONGS TO NOBILITY HE THINKS HE IS ENTITLED TO SLEEP WITH ANYBODY HE FEELS LIKE",
"DOWN WITH ARISTOCRATIC DESPOTISM!!",
"POOR PEOPLE OF THE WORLD FOR EVER..!!",
- "AND AS I CAN SEE HE HAS CHAINED YOU UP WITH LOCKS AND ALL THAT STUFF, HUH?",
- "WELL, ALL RIGHT. DO YOU HAVE A HAIRPIN OVER THERE?",
- "ALL RIGHT, OK, DON'T GET MAD. I'LL THINK ABOUT SOMETHING",
+ "AND I CAN SEE HE HAS CHAINED YOU UP WITH LOCKS AND ALL THAT STUFF, HUH?",
+ "WELL, ALL RIGHT. DO YOU HAVE A HAIR PIN OVER THERE?",
+ // 265
+ "ALL RIGHT, OK, DON'T GET MAD. I'LL THINK OF SOMETHING",
"YOU...BARTENDER!!",
"HOW IS THE GAME GOING?",
"WHO?",
"CAN'T YOU SEE DRASCULA IS HERE?",
- "THEN, LET'S END UP WITH HIM, RIGHT?",
+ // 270
+ "THEN, LET'S FINISH HIM OFF, RIGHT?",
"GIVE ME A SCOTCH ON THE ROCKS",
"NOTHING, I JUST FORGOT WHAT I WAS GOING TO SAY...",
"EITHER YOU GET ME A SCOTCH ON THE ROCKS OR I'LL PLAY THE PIANO UNTIL THE GAME IS OVER",
"WHEN IS THE MATCH GOING TO BE OVER?",
+ // 275
"GOOD EVENING",
"AND SO IGOR, HOW ARE YOU FEELING...A LITTLE HUMPED...?. HA, HA, HA, THAT WAS FUNNY!",
"WHAT ARE YOU SUPPOSED TO BE DOING?",
- "WELL, NO",
+ "WELL, NO, I DONT UNDERSTAND TAXES",
"THEN WEAR GLASSES",
+ // 280
"WHAT IS ALL THAT ABOUT THE SUPERNATURAL ORGY?",
- "OK, OK, STOP IT. I THINK I CAN GET THE PICTURE",
+ "OK, OK, STOP IT. I THINK I GET THE PICTURE",
"COULDN'T YOU TELL ME WHERE DRASCULA IS?",
"OH...PLEASE...COME ON...!",
"WHY NOT?",
- "OH...BUT DIES HE SLEEP AT NIGHT?",
+ // 285
+ "OH...DOES HE SLEEP AT NIGHT?",
"WELL, I HOPE YOU GET LUCKY",
"I HAVE TO TALK TO HIM...",
- "YOOUUU...SKELETOOOONN..!!!",
+ "YOUUU...SKELETONNNN..!!!",
"GOOD HEAVENS!, IT'S A DEAD MAN TALKING!",
- "TELL HOW DID YOU GET TO END UP HERE",
+ // 290
+ "HOW DID YOU END UP HERE",
"AND WHY WOULD DRASCULA WANT TO CREATE A MONSTER?",
"WHAT'S YOUR NAME, MY SKELETON FRIEND?",
"HEY, DON'T YOU WANT ANYTHING TO EAT?",
- "I BET YOUR STOMACH IS PRETTY EMPTY...HA, HA,HA!",
- "THE THING IS THAT I DON'T FEEL LIKE TALKING RIGHT NOW",
+ "I BET YOUR STOMACH IS PRETTY EMPTY...HA,HA,HA!",
+ // 295
+ "I DON'T FEEL LIKE TALKING RIGHT NOW",
"I HOPE SOMEONE F...(WHISTLE) YOU...,AND YOUR F...(WHISTLE) SON OF (WHISTLE TWICE)",
"I REALLY LOVED HER. I KNOW SHE WASN'T MUCH OF A WONDER, BUT NOBODY'S PERFECT, RIGHT?",
- "BESIDES. SHE REALLY HAD ONE OF THOSE GREAT BODIES THAT YOU NEVER FORGET...",
+ "BESIDES. SHE HAD ONE OF THOSE GREAT BODIES THAT YOU NEVER FORGET...",
"I'LL NEVER BE THE SAME AGAIN. I WILL SHUT MYSELF AWAY IN A MONASTERY, AND WILL LET MY LIFE JUST FLOW...",
+ // 300
"NOTHING WILL GET ME OUT OF THIS MYSTERY BECAUSE...",
"WHOSE?. WHOSE?",
"I WANT TO BECOME A PIRATE",
"I WANT TO BECOME A PROGRAMMER",
"TELL ME SOMETHING ABOUT PELAYO",
- "I'LL JUST GO ON PLAYING, AND I'LL FORGET I SAW YOU",
+ // 305
+ "I'LL JUST GO ON PLAYING, AND FORGET I SAW YOU",
"WHOSE STUPID IDEA COULD THIS BE?",
- "IT'S LIKE MY GRANDMOTHER'S HANDBAG ",
+ "IT LOOKS LIKE MY GRANDMOTHER'S HANDBAG ",
"JESUS, AREN'T I JUST REALLY COOL MAN...!",
- "THE MORE I SEE MYSELF, THE MORE I LOVE ME",
+ "THE MORE I SEE MYSELF, THE MORE I LOVE MYSELF",
+ // 310
"HOW DO I LOCK MYSELF THEN?",
"I'LL HAVE TO OPEN ME FIRST, RIGHT?",
"I'M ALL RIGHT WHERE I AM",
"I GOT ME",
"HI, MYSELF!",
+ // 315
"I'LL WEAR THEM WHEN THE RIGHT TIME COMES",
- "I CAN'T SEE ANYTHING SPECIAL ABOUT IT",
+ "I DON'T SEE ANYTHING SPECIAL ABOUT IT",
"IT'S ALL RIGHT WHERE IT IS",
"AND WHAT FOR?",
"I CAN'T",
+ // 320
"HI, YOU!",
"IT'S UNCLE DESIDERIO'S PANTHEON!",
- "YOOUU...UNCLE DESIDERIOOOO!!",
+ "YOUUU...UNCLE DESIDERIOOOO!!",
"NO, I DON'T WANT TO CUT MYSELF AGAIN",
"AHHH,,,EXCUS....",
+ // 325
"JAMM. AHH...",
"YES...WOF, WOF",
"LOOK, THERE'S A PIECE OF BUBBLE GUM STUCK HERE",
- "THIS IS THE PORTABLILINE I GOT LAST CHRISTMAS",
+ "THIS IS THE MOBILE PHONE I GOT LAST CHRISTMAS",
"IT'S VERY HIGH!",
+ // 330
"COME OUT TO THE BALCONY MY JULIET!!",
"YOU ARE THE LIGHT THAT ILLUMINATES MY WAY!",
"HEY, DOOR!, WHAT'S THE MATTER?",
- "YOOOUU, CIGARETTE SPENDING MACHINEEE!",
- "IT'S A CIGARETTE SPENDING MACHINE",
+ "YOUUU, CIGARETTE VENDING MACHINE!",
+ "IT'S A CIGARETTE VENDING MACHINE",
+ // 335
"I HAVE ANOTHER COIN INSIDE",
- "NO, I JUST DECIDED TO QUIT SMOKING AND DRINKING ALCOHOL",
- "I WILL DEVOTE MYSELF TO WOMEN FROM NO ON",
+ "NO, I JUST QUIT SMOKING AND DRINKING ALCOHOL",
+ "I WILL DEVOTE MYSELF TO WOMEN FROM NOW ON",
"THIS IS A TRICK! NOTHING CAME OUT!",
"AT LAST!",
- "JUST A TRUNK",
+ // 340
+ "IT'S JUST A TRUNK",
"HELLO TRUNK, YOUR NAME IS JUST LIKE MY COUSIN FRANK...",
"I'VE FOUND B.J.'S HANDBAG!",
- "OH MY GOD! DON'T GET MY IMAGE REFLECTED! I'M A VAMPIRE!",
+ "OH MY GOD! I HAVE NO REFLECTION! I'M A VAMPIRE!",
"OH...JESUS, IT'S JUST A DRAWING!",
+ // 345
"LITTLE MIRROR, TELL ME, WHO IS THE MOST BEAUTIFUL IN THE WHOLE KINGDOM?",
"HE WON'T OPEN",
- "ALL RIGHT. I GOT THE EAR-PLUGS ON",
+ "ALL RIGHT. I GOT THE EAR-PLUGS IN",
"IT'S A VAMPIRE'S HUNTER DIPLOMA, OFFICIALLY APPROVED BY OXFORD UNIVERSITY",
"NOT YET. THERE ARE STILL SOME INGREDIENTS MISSING. IT'S NOT WORTH WAKING HIM UP",
+ // 350
"BUT I DON'T HAVE MONEY",
"IT'S A BRITISH LAMP",
"HELP ME OUT HERE BARTENDER!!",
"A VAMPIRE CAME IN AND TOOK MY GIRLFRIEND AWAY!!",
"BUT, AREN'T YOU GOING TO HELP ME!!??",
+ // 355
"DEAD?, WHAT DO YOU MEAN DEAD?",
"AAHH....",
"A VAMPIRE HAS KIDNAPPED THE GIRL IN ROOM 501",
"BUT YOU HAVE TO HELP ME OUT!",
"CAN'T YOU PLAY ONE FROM BLUR?",
+ // 360
"HOW CAN YOU STAY HERE ALL DAY PLAYING THE SAME SONG ALL THE TIME?",
- "AND THEN, HOW CAN YOU HEAR ME?",
- "PLEASE, LEND ME THE ERA-PLUGS",
+ "AND HOW CAN YOU HEAR ME?",
+ "PLEASE, LEND ME THE EAR-PLUGS",
"COME ON, I'LL GIVE THEM BACK TO YOU RIGHT AWAY",
- "COOOMEE OONNN...",
+ "COME ONNN...",
+ // 365
"WELL GOODBYE, I HAVE TO KILL A VAMPIRE",
"",
- "WHAT'S YOUR LANGUAGE, TRASILVANIAN?",
- "WHO IS UNCLE DESIDERIO?",
- "BUT, WHAT'S THE MATTER WITH THAT DRASCULA?",
- "WHO IS THAT GUY NAMED VON BRAUN?",
+ "WHAT LANGUAGE ARE YOU SPEAKING?, TRANSILVANIAN?",
+ "WHAT ARE YOU TALKING ABOUT? WHO IS UNCLE DESIDERIO?",
+ "BUT, WHAT'S THE PROBLEM WITH DRASCULA?",
+ // 370
+ "WHO IS THIS GUY NAMED VON BRAUN?",
"AND WHY DOESN'T HE DO IT?",
- "AND WHERE CAN I FIND VON BRAUN?",
+ "WHERE CAN I FIND VON BRAUN?",
"WELL, THANKS AND GOODBYE. HOPE YOU SLEEP IT OFF JUST FINE",
- "WE'D BETTER CALL FIRST",
+ "WE HAD BETTER CALL FIRST",
+ // 375
"ARE YOU PROFESSOR BRAUN?",
"AND COULD YOU TELL ME WHERE I CA...?",
"I DON'T BELIEVE HE IS GANIMEDES THE DWARF",
"PROFESSOR!!",
- "PLEASE HELP ME!. THE LIFE OF MY GIRLFRIEND DEPENDS ON YOU!!",
+ "PLEASE HELP ME!. MY GIRLFRIEND'S LIFE DEPENDS ON YOU!!",
+ // 380
"WELL, ALL RIGHT. I DON'T NEED YOUR HELP",
"ALL RIGHT. I'M LEAVING",
"DON'T DE AFRAID. WE WILL BEAT DRASCULA TOGETHER",
"THEN WHY DON'T YOU HELP ME?",
"I GOT THEM",
+ // 385
"YES, I GOT THEM!!",
"ALL RIGHT",
"AHH....YES",
"I HAVE COME TO GET INTO THAT CABIN AGAIN",
"I AM READY TO FACE YOUR TEST",
+ // 390
"ALL RIGHT OLD MAN. I CAME FOR MY MONEY",
"NO, NOTHING. I WAS JUST LEAVING",
"SORRY...",
- "DO YOU LIKE THIS BOOK?. IT HAS SOME SCORES FROM TCHAIKOWSKY",
+ "WOULD YOU LIKE THIS BOOK?. IT HAS SOME SCORES FROM TCHAIKOVSKY",
"HOW CAN I KILL A VAMPIRE?",
+ // 395
"HAS ANYBODY TOLD YOU THAT SLEEPING IN A BAD POSITION IS NOT GOOD FOR YOU?",
"THAT'S WHAT MY MUM ALWAYS TELL ME",
- "WHY WOULDN'T DRASCULA KILL YOU?",
+ "WHY DIDN'T DRASCULA KILL YOU?",
"AND WHAT WAS IT?",
"GREAT! YOU HAVE AN IMMUNIZING BREW",
+ // 400
"SO?",
"ALL RIGHT",
"CAN YOU REPEAT WHAT I NEED FOR THAT BREW",
"WELL, I'LL RUSH OUT TO GET IT",
"HEY, WHAT HAPPENED WITH THE PIANIST?",
+ // 405
"I HAVE ALL THE INGREDIENTS OF THAT BREW",
"JUST A QUESTION. WHAT IS ALL THAT ABOUT THE ALUCSARD ETEREUM?",
- "HELLO, HELLO...",
+ "YES, YES?...",
"AND WHERE IS THAT CAVERN?",
- "WHAT HAPPENS? DIDN'T YOU HAVE TO GO TO THE COURT?",
+ "WHAT HAPPENED? DIDN'T THEY HAVE TO GO TO COURT?",
+ // 410
"...BUT... IF I MEET MORE VAMPIRES?",
- "IT'S A VAMPIRE THAT DOESN'T LET ME COME THROUGH",
+ "IT'S A VAMPIRE THAT WON'T LET ME COME THROUGH",
"HE LOOKS LIKE YODA, BUT A LITTLE TALLER",
"HEY YODA, IF YOU JUST LET ME GO ON MY WAY, I'LL GIVE YOU A PENNY",
"OK, OK, YOU GET MAD ABOUT NOTHING MAN",
+ // 415
"HAS ANYBODY TOLD YOU THAT YOU LOOK LIKE YODA?",
"HI VAMPIRE, IT'S A BEAUTIFUL NIGHT, HUH?",
"ARE YOU A VAMPIRE OR AN OIL PAINTING?",
"I'D BETTER NOT SAY ANYTHING, IN CASE YOU GET MAD",
"IT'S LOCKED",
- "THE MAGPIE WOULD STICK OUT MY EYES IF I TRIED!",
+ // 420
+ "THE MAGPIE WOULD PECK OUT MY EYES IF I TRIED!",
"OH MY GOD. IT'S LOCKED...THAT'S SCARY, HUH?",
"THE HINGES ARE RUSTY",
- "THERE IS ONLY ONE CAN OF FLOUR IN THERE",
+ "THERE IS ONLY ONE BAG OF FLOUR IN THERE",
"THAT TOOK AWAY THE RUST",
- "I HAVE FOUND A PINE STICK",
- "I'LL TAKE THIS THICKER ONE",
+ // 425
+ "I FOUND A PINE STAKE",
+ "I'LL TAKE THIS LARGER ONE",
"WELL, I THINK I CAN GET RID OF THIS STUPID DISGUISE",
- "\"PASSAGE TO TOWERS CLOSED FOR REPAIRS. PLEASE USE MAIN ENTRANCE. SORRY FOR THE INCONVENIENCE\"",
- "...HE IS PALE, HE HAS FANGS AND WEARS A TOUPE\220 AND HE SURE IS DRASCULA!",
+ "\"PASSAGE TO TOWERS CLOSED FOR REPAIRS. PLEASE USE THE MAIN ENTRANCE. SORRY FOR THE INCONVENIENCE\"",
+ "...HE IS PALE, HE HAS FANGS AND WEARS A TOUPE\220 HE SURE IS DRASCULA!",
+ // 430
"IT'S B.J.! ARE YOU ALL RIGHT B.J.?",
"YES, I KNOW SHE IS STUPID, BUT I'M SO LONELY",
"YOU DON'T HAVE A KEY AROUND THERE, DO YOU?",
- "I BET YOU DON'T HAVE A PICKLOCK AROUND!",
- "GIVE ME A HAIRPIN, I'M GOING TO PLAY MCGYVER HERE!",
+ "I BET YOU DON'T HAVE A LOCK PICK AROUND!",
+ "GIVE ME A HAIR PIN, I'M GOING TO PLAY MCGYVER HERE!",
+ // 435
"DON'T GO ANYWHERE. I'LL BE RIGHT BACK",
"SHOOT! IT'S BROKEN!",
"OLEEEE! I EVEN SHAVED DUDE!",
"YES, DARLING?",
- "HE'S NOT ARRIVED YET",
+ "HE HAS NOT ARRIVED YET",
+ // 440
"THE PIANIST IS NOT HERE",
- "A TRANSYLVANIAN SCOTCH ON THE ROCKS",
+ "A TRANSILVANIAN SCOTCH ON THE ROCKS",
"I DON'T HAVE A ROOM YET",
"IT LOOKS LIKE HE GOT STUCK IN THE BATH AND DECIDED TO RUN A BAR",
- "HE WAS DRUNK AS A SAILOR",
- "THAT HAIR...REMINDS ME OF SOMEBODY",
+ "HE WAS AS DRUNK AS A SAILOR",
+ // 445
+ "THAT HAIR...IT REMINDS ME OF SOMEBODY",
"IT'S A RAW-BONED SKELETON",
"LOOK! THERE'S MIGUEL BOSE!",
- "HE'S ASLEEP. IT'D BE A SHAME WAKING HIM UP",
+ "HE'S ASLEEP. IT'D BE A SHAME TO WAKE HIM UP",
"HE'S UGLIER THAN EMILIO DE PAZ",
- "A PINE-WOODEN COFFIN",
+ // 450
+ "A PINE WOOD COFFIN",
"HE IS GOING TO CUT ME IN LITTLE SLICES. JUST LIKE A SAUSAGE",
- "I DON'T LIKE PENDULAE. I'D RATHER PREFER ARTICHOKES",
+ "I DON'T LIKE PENDULAE. I'D PREFER ARTICHOKES",
"I CAN'T MAKE IT. I'M HANDCUFFED",
"IT'S OBVIOUSLY A SECRET DOOR",
+ // 455
"THEY IGNORE ME",
"COME ON..!",
- "WHEN I READ THE SCRIPT IT WAS SUPPOSED TO MOVE, BUT THE BUDGET GOT CRAZY AND THEY COULDN'T AFFORD TO PAY THE GYM, SO THAT I NEVER GOT TOUGH. END OF STORY",
- "IT SEEMS A LITTLE LOOSE FROM THE WALL",
- "I DON'T THINK IS GOING TO HELP ME ANYWAY. IT'S TOO WET TO LIGHT IT",
- "TO WEST WING? NO WAY! NOBODY KNOWS WHAT YOU CAN FIND THERE!!",
- "SHE'S GOT NICE TRANSILVANIAN REASONS",
+ "WHEN I READ THE SCRIPT IT WAS SUPPOSED TO MOVE, BUT THE BUDGET GOT CRAZY AND THEY COULDN'T AFFORD TO PAY THE GYM, SO I NEVER GOT STRONGER. END OF STORY",
+ "IT SEEMS A LITTLE LOOSE ON THE WALL",
+ "I DON'T THINK IT IS GOING TO HELP ME ANYWAY. IT'S TOO WET TO LIGHT",
+ // 460
+ "TO THE WEST WING? NO WAY! NOBODY KNOWS WHAT YOU WILL FIND THERE!!",
+ "SHE'S GOT NICE TRANSILVANIAN FEATURES",
"",
"IT'S A SHAME THERE ISN'T A ROASTED LAMB IN THERE",
"LAST TIME I OPENED AN OVEN I BLEW UP THE HOUSE",
- "THAT'S THE TRANSILVANIAN FOOTBALL BADGE",
- "WHAT FOR? TO PUT IT ON MY HEAD",
+ // 465
+ "THAT'S THE TRANSILVANIAN FOOTBALL TEAMS BADGE",
+ "WHAT FOR? TO PUT IT ON MY HEAD??",
"I DON'T THINK THESE TOWERS ARE THE OPENING KIND",
"I DON'T WANT TO KNOW WHAT KIND OF FOOD IS IN THERE!",
"IT LOOKS IMPRESSIONIST TO ME...",
+ // 470
"THE NIGHT IS FALLING OVER ALL OF US...THAT'S SCARY, ISN'T IT?",
"IT'S STUCK!",
- "IT'S THE KING. YOU DIDN'T IMAGINE THAT, DID YOU!",
+ "IT'S ELVIS THE KING. YOU DIDN'T IMAGINE THAT WOULD BE HERE, DID YOU!",
"NO, I ALREADY HAVE ONE AT HOME TO FEED",
"A SHELF WITH BOOKS AND SOME OTHER THINGS",
+ // 475
"BUT WHO CAN I CALL AT THIS TIME?",
- "\"HOW TO MAKE THE TAX RETURN FORMS\". HOW INTERESTING!",
+ "\"HOW TO FILL IN TAX RETURN FORMS\". HOW INTERESTING!",
"I ALREADY HAVE ONE AT HOME. I THINK IT'S A WORLDWIDE BEST SELLER",
"A COMPLETELY NORMAL KEY",
"I THINK SHE IS NOT FROM AROUND HERE",
+ // 480
"HEY, THEY'RE FANG-LIKE FRENCH FRIES! I LOVE IT!",
"I DON'T THINK THIS IS THE RIGHT TIME TO EAT THAT CRAP KNOWING THAT MY GIRLFRIEND HAS BEEN KIDNAPPED BY THE MOST EVIL PERSON EVER ON EARTH",
"I'M HAVING A GREAT TIME KILLING VAMPIRES WITH THIS THING!",
"LET'S SEE IF ANOTHER ONE COMES SOON!",
"NO, IT HAS TO BE WITH A DIRTY AND STINKY VAMPIRE, JUST LIKE THE ONE I KILLED BEFORE",
- "THIS IS THE ONE AND ONLY WIG ELVIS USED WHEN HE GOT BALD",
+ // 485
+ "THIS IS THE ONE AND ONLY WIG THAT ELVIS USED WHEN HE WENT BALD",
"IT'S FLOUR, BUT DON'T ASK ME ANY COMMERCIAL NAMES",
"MAYBE ANOTHER TIME, OK?",
"THAT'S A GREAT AXE, IT'S A SHAME THERE IS NO VAMPIRE'S HEAD AROUND HERE, HUH?",
- "NO. I'M REALLY A GOOD PERSON",
- "IT'S MARGARET'S THATCHER DEODORANT...HA, HA, HA...!!",
+ "NO. I REALLY AM A GOOD PERSON",
+ // 490
+ "IT'S MARGARET'S THATCHERS DEODORANT...HA, HA, HA...!!",
"THAT'S A PRETTY CUTE CLOAK",
"",
- "JUST LIKE ALL BRANCHES FROM ANY TREE IN THE WORLD, THERE IS NOTHING SPECIAL.",
- "HEY, THAT'S AMAZING! A ROPE WITHIN THIS TYPE OF ADVENTURE!",
+ "JUST LIKE ALL THE BRANCHES FROM ANY TREE IN THE WORLD, THERE IS NOTHING SPECIAL.",
+ "HEY, THAT'S AMAZING! A ROPE IN THIS TYPE OF ADVENTURE GAME!",
+ // 495
"I WONDER WHAT WE COULD USE IT FOR...",
"A ROPE TIED TO A BRANCH OR THE OTHER WAY AROUND, HOWEVER YOU WANT TO PUT IT...",
"IT LOOKS LIKE THIS MAGPIE IS EVIL-MINDED",
"FORGET IT, I'M NOT SAYING ANYTHING IN CASE HE GETS MAD",
"SHE LOOKS DEAD, BUT SHE REALLY ISN'T, HUH?",
+ // 500
"NO ANIMAL WAS HARMED DURING THE PRODUCTION OF THIS GAME",
},
{
+ // 0
"",
"Es la segunda puerta mas grande que he visto en mi vida",
"Bueno, no",
"Esta sellada con tablones. La iglesia debe llevar abandonada varios a\244os",
"Si no la he abierto",
+ // 5
"\250Que hago? \250La arranco?",
"Hola puerta. Te voy a hacer un marco.",
"Demasiado para mi.",
"una ventana sellada con tablones.",
"No puedo.",
+ // 10
"Ya lo esta.",
"\250Y pa que?",
"Hola ventana. \250Tienes algo que hacer esta noche?",
"No sin el permiso de obras publicas",
"\255eh! esa ventana tiene solo un tablon...",
+ // 15
"\255Eoooooo! \255Ventana!",
"Hola tu.",
"",
"No alcanzo.",
"Esta bien donde esta.",
+ // 20
"",
"Es una tumba en forma de cruz.",
"No gracias.",
"Hola muerto. \250quieres gusanitos?",
"Si hombre. Como en Poltergueist.",
+ // 25
"",
"",
"Vuelvo en quince minutos.",
"Prohibido pegar carteles.",
"",
+ // 30
"Esta cerrado con llave.",
"Ya tengo uno.",
"",
"No contesta.",
"No, esta bien aparcado.",
+ // 35
"Es una puerta.",
"Un cajon de la mesa.",
"Un sospechoso armario.",
"Hola armario. \250Que tal?",
"",
+ // 40
"",
"Es un candelabro muy viejo.",
"Debe de llevar aqui desde que Mazinguer-z era un tornillo.",
"No. Es una reliquia.",
"Es un bonito retablo.",
+ // 45
"",
"Ji, ji, ji.",
"",
"No.",
"",
+ // 50
"Ja, ja, ja. \255que bueno!",
"",
"",
"",
"No veo nada en especial.",
+ // 55
"Es Fernan, la planta.",
"Es una de las picas de la verja.",
"\255Eh! Aqui debajo hay una caja de cerillas.",
"\255Mira! un paquete de clinex. \255Y hay uno sin usar!",
"No hay nada mas en el cubo.",
+ // 60
"Es un ciego que no ve.",
"",
"",
"",
"",
+ // 65
"Es una cuantiosa cantidad de dinero.",
"",
"",
"",
"",
+ // 70
"",
"",
"",
"",
"",
+ // 75
"",
"",
"",
"",
"",
+ // 80
"",
"",
"",
"",
"",
+ // 85
"",
"",
"",
"",
"",
+ // 90
"",
"",
"",
"",
"",
+ // 95
"",
"",
"",
"",
"",
+ // 100
"NO TIENE NADA DE ESPECIAL",
"NO ES NADA FUERA DE LO NORMAL",
"\250QUE PASA TU?",
"HOLA",
"\250NADA NUEVO?",
+ // 105
"\250QUE TAL LA FAMILIA?",
"\255QUE COSAS TIENES!",
"\255PERO COMO VOY A COGER ESO!",
"MI RELIGION ME LO PROHIBE",
"MEJOR NO",
+ // 110
"\255SI HOMBRE!",
"NI HABLAR DE ESO",
"IMPOSIBLE",
"ESTO NO SE ABRE",
"YO SOLO NO PUEDO",
+ // 115
"SI QUISIERA PODRIA, PERO ES QUE ME DA PEREZA",
"NO LE VEO MOTIVO APARENTE",
"ES UN CEREBRO BASTANTE MAJO",
"Y BIEN, CEREBRO \250QUE PIENSAS HACER ESTA NOCHE?",
"NO, DEBE CONSERVARSE EN LUGAR CERRADO A LA ACCION MUTANTE DE LA ATMOSFERA",
+ // 120
"ES UN HUESO, COMO MI JEFE",
"UNA ESTACA MUY AFILADA",
"FIEL ESTACA PUNTIAGUDAAA, NOBLE ROBLE TRANSILVAAANOO",
"\255VAYA, ME TENGO QUE CORTAR LAS U\245AS!",
"\255AHI DENTRO ESTA B.J., Y HAY QUE VER COMO ESTA LA TIA!",
+ // 125
"ESTA CERRADA A CAL Y CANTO",
"\"CANDADOS CAL Y CANTO S.A.\"",
"ES EL TIPICO ESQUELETO QUE ESTA EN TODAS LAS MAZMORRAS DE TODOS LOS JUEGOS",
"SE SUELE USAR PARA COMUNICAR CORRIENTE ELECTRICA A LOS APARATOS A EL ENCHUFADOS",
"ES TOTALMENTE ARTESANAL, PORQUE LOS JAPONESES LOS HACEN DE BOLSILLO",
+ // 130
"SOLO HE VISTO EN MI VIDA OTRA COSA TAN FEA",
"QUITA. NO LE DIGO NADA A VER SI SE VA A ENFADAR",
"PARECE BASTANTE RACIONAL",
"ES UNA FOTO DE PLATON ESCRIBIENDO SU DIALOGO PERDIDO",
"NO SOY DE LOS QUE HABLAN CON POSTERS",
+ // 135
"UN ESCRITORIO MUY MONO",
"ES UN DIPLOMA DE CAZA-CAZA-VAMPIROS HOMOLOGADO POR LA UNIVERSIDAD DE OXFORD",
"ES NOCHE CERRADA CON LUNA LLENA",
"PARECE QUE ESTOS TORNILLOS NO ESTAN MUY ENROSCADOS",
"NO MIRES, PERO CREO QUE UNA CAMARA OCULTA ME ESTA ENFOCANDO",
+ // 140
"UN DETECTOR DE ESTACAS MUY MODERNO",
"NO, EL LABORATORIO ESTA EN EL SEGUNDO PISO",
"UNA BONITA MESILLA DE NOCHE",
"ES UN MONTON DE DINERO QUE NO PUEDE FALTAR EN UNA AVENTURA QUE SE PRECIE",
"SI YO FUERA RICO, DUBIDUBIDUBIDUBIDUBIDUBIDUBIDU",
+ // 145
"SON UNAS EXTRA\245AS HOJAS. DEBEN DE HABERLAS TRAIDO DE SUDAMERICA, O POR AHI",
"NO CREO QUE ME CONTESTARAN",
"ES UN BONITO CRUCIFIJO DE MADERA. EL ICONO NO CAPTA TODA LA EXTENSION DE SU BELLEZA",
"YO SOLO REZO ANTES DE ACOSTARME",
"\255EH, PARECE QUE ESTA PICA ESTA UN POQUITO SUELTA!",
+ // 150
"PARA QUE LUEGO TE QUEJES DE QUE NO DOY PISTAS",
"ES UNA PICA BASTANTE CONVENCIONAL",
"SON MONOS, AUNQUE TIENEN UN POCO DE MIERDECILLA",
"NO, NO ME OIRIAN. JI,JI,JI \255QUE BUENO!",
"\"LA BELLA DURMIENTE DEL BOSQUE\" DE CHAIKOSKY, O CHOIFRUSKY, O COMO SE DIGA",
+ // 155
"MUY APETITOSO",
"NO, YO NO SOY DE ESOS QUE SE METEN EN LA BOCA CHICLES USADOS",
"UNA HOZ MUY MONA. ME PREGUNTO DONDE ESTARA EL MARTILLO",
"\"LOS FABRICANTES DE TABACO ADVIERTEN QUE LAS AUTORIDADES SANITARIAS PERJUDICAN SERIAMENTE LA SALUD\"",
"UNA VELA NORMAL Y CORRIENTE, CON CERA Y TODO",
+ // 160
"\255HAY QUE VER COMO BRILLAN ESTAS DOS BRILLANTES MONEDAS!",
"\255HAY QUE VER COMO BRILLA ESTA BRILLANTE MONEDA!",
"CON ESTO SERE INMUNE A LAS MORDEDURAS DE LOS VAMPIROS",
"NO, TODAVIA NO ES EL MOMENTO",
"HAY UN BILLETE DE MIL Y UN PAR DE MONEDAS",
+ // 165
"DICE \"SE RUEGA NO ECHAR COMIDA AL PIANISTA\"",
"TORTILLA, 200. PESCAITOS FRITOS, 150, PATATAS ALIOLI, 225",
"LAS MEJORES HAMBUERGUESAS A ESTE LADO DEL DANUBIO, POR SOLO 325",
"ES UNA BONITA CALAVERA, CON UNA MIRADA MUY PENETRANTE. \255JI, JI, JI, QUE BUENO!",
"HOLA CALAVERA, ME RECUERDAS AL TIO DE HAMLET",
+ // 170
"TENGO POR COSTUMBRE NO TOCAR COSAS QUE HAYAN ESTADO VIVAS",
"ES UNA PAPELERA",
"ES UNA PORRA PARA EL PARTIDO DE ESTA NOCHE",
"ME PREGUNTO QUE HABRA DETRAS",
"\255EH, ESTA CORTINA NO SE MUEVE!",
+ // 175
"HAY QUE VER, QUE TETRICO ES ESE CASTILLO, \250EH? ",
"NO PUEDO, ESTA DEMASIADO LEJOS PARA OIRME",
"ES UN TIPICO BOSQUE TRANSILVANO, CON ARBOLES ",
"\255PERO QUE TONTERIAS DICES, CON LO OSCURO QUE ESTA!",
"CONFITERIA GARCIA. PASTELES Y CHICLES.",
+ // 180
"UNA PUERTA MUY BONITA",
"ESTA CERRADA",
"UN BARRIL COMPLETAMENTE CERRADO",
"",
"\255QUE BICHOS MAS MONOS!",
+ // 185
"BSSST, BSSST, GATITO...",
"NO CONTESTA",
"LA LUNA ES UN SATELITE QUE GIRA ALREDEDOR DE LA TIERRA CON UN PERIODO DE REVOLUCION DE 28 DIAS",
"HOLA, LUNA LUNERA CASCABELERA ",
"ESTA TOTALMENTE TAPIADA CON TABLONES",
+ // 190
"IMPOSIBLE. ESTO NO LO ABRE NI EL MAYORDOMO DE LA TELE",
"\255EH, PARECE QUE LA SOMBRA DE ESE CIPRES ES ALARGADA!",
"\255EOOO, TABERNEROOO!",
"QUISIERA UNA HABITACION ",
"\250SABE DONDE PUEDO ENCONTRAR A UN TAL CONDE DRASCULA?",
+ // 195
"SI, \250QUE PASA? ",
"\250Y ESO?",
"\250DE... DE VERDAD?",
"BUENA PREGUNTA, LE VOY A CONTAR MI HISTORIA, MIRE...",
"SON SOLO CINCO MINUTOS",
+ // 200
"ME LLAMO JOHN HACKER, Y SOY REPRESENTANTE DE UNA INMOBILIARIA BRITANICA",
"AL PARECER, EL CONDE DRASCULA QUIERE COMPRAR UNOS TERRENOS EN GIBRALTAR, Y ME HAN MANDADO A MI PARA NEGOCIAR LA VENTA",
"PERO ME PARECE A MI QUE MA\245ANA TEMPRANITO ME VUELVO CON MI MAMA",
"BONITA NOCHE \250VERDAD?",
"NO, NADA",
+ // 205
"EOOOO, PIANISTA",
"BONITA NOCHE",
"Y ADEMAS NO HACE FRIO",
"PUES NADA, TE DEJO QUE SIGAS TOCANDO",
"PUES ESO",
+ // 210
"HOLA JEFE, \250QUE TAL?",
"\250Y LA FAMILIA?",
"HAY AMBIENTE AQUI \250EH?",
"MEJOR NO DIGO NADA",
"SE ESTA MEJOR EN CASA QUE EN NINGUN SITIO... SE ESTA MEJOR EN... \250EH? PERO SI USTED NO ES LA TIA ENMA. ES MAS. \255SI YO NO TENGO NINGUNA TIA ENMA!",
+ // 215
"SI, EL MIO TAMBIEN. USTED PUEDE LLAMARME COMO LE APETEZCA, AUNQUE SI ME LLAMA JOHNY, ACUDO COMO LOS PERROS",
"SI, QUE GOLPES TENGO \250VERDAD? POR CIERTO, \250DONDE ESTOY?",
"SI.",
"CACHIS... ",
"OH, SI. POR SUPUESTO",
+ // 220
"PUES MUCHAS GRACIAS POR PRESTARME TU AYUDA. NO TE MOLESTO MAS. SI ME DICES DONDE ESTA LA PUERTA, POR FAVOR... ",
"PORQUE EL GOLPE ME HA DEBIDO AFECTAR AL CEREBRO Y NO VEO TRES EN UN BURRO ",
"BAH, NO IMPORTA. SIEMPRE LLEVO DE REPUESTO",
"\255GUAU, QUE TIA MAS BUENA! \255NO ME HABIA DADO CUENTA YO! CLARO, SIN LAS GAFAS",
"OYE... ",
+ // 225
"\255\250 Y ESTOOOOOO?!",
"\255NO TE PREOCUPES B.J., AMOR MIO! TE SALVARE DE LAS GARRAS DE ESE ",
"ME HA TOCADO LAS NARICES, VAMOS.",
"\255AHHH, UN HOMBRE LOBO! \255MUERE MALDITO!",
"SI, ESTO...",
+ // 230
"SI, ESTO... CREO QUE SEGUIRE MI CAMINO. CON PERMISO... ",
"\250QUE?",
"PUES LA VERDAD, PENSANDOLO BIEN... CREO QUE NO",
"DIME, OH ERUDITO FILOSOFO, \250EXISTE ALGUNA RELACION CAUSA-EFECTO ENTRE LA VELOCIDAD Y EL TOCINO?",
"VALE, VALE, DEJALO. DE TODAS FORMAS, NO SE POR QUE HE DICHO ESO.",
+ // 235
"\250QUE HACES AQUI FILOSOFANDO, QUE NO TE ESTAS COMIENDO GENTE?",
"\250Y ESO?",
"OYE, PUEDES REPETIR ESO DE \"INCLINACIONES PRE-EVOLUTIVAS\"?",
"SI HOMBRE. ESE ROLLO QUE ME HAS SOLTADO ANTES. ES QUE NO ME HE ENTERADO MUY BIEN...",
"NO, MEJOR NO DIGO NADA, QUE COMO LE TOQUE LA VENA...",
+ // 240
"\250SI, DIGA?",
"SI, \250QUE PASA? ",
"AH, PUES AHORA QUE SACA EL TEMA LE DIRE QUE...",
"",
"POR CIERTO, \250QUE PASARIA SI UN VAMPIRO SE HICIERA CIRCUNSTANCIALMENTE CON LA RECETA... ",
+ // 245
"PUES NADA. OYE, \250A QUE ESTO PARECE UN PEGOTE PUESTO EN EL GUION PARA ACABAR PRONTO EL JUEGO? BUENO, A LO MEJOR NO",
"\255ESTA VACIO!",
"PORQUE ME ROBASTE MI AMOR, B.J. SIN ELLA LA VIDA PARA MI NO TIENE SENTIDO",
"\255\250SU CEREBRO?!",
"PUES NO ES POR NADA, PERO ME PARECE QUE ME HA CARGADO TU MONSTRUITO",
+ // 250
"\255VIRGENCITA, QUE ME QUEDE COMO ESTOY!",
"\255NO TE SALDRAS CON LA TUYA. SEGURO QUE APARECE SUPERLOPEZ Y ME RESCATA!",
"VAYA UNA MIERDA DE JUEGO EN EL QUE MUERE EL PROTAGONISTA ",
"UN MOMENTO, \250QUE HAY DE MI ULTIMO DESEO?",
"\255JA, JA! AHORA ESTOY INMUNIZADO CONTRA TI MALDITO DEMONIO. ESTE CIGARRILLO ES UNA POCION ANTIVAMPIRICA QUE ME DIO VON BRAUN ",
+ // 255
"SI, CLARO. PERO NUNCA CONSEGUIRAS QUE TE DIGA LA RECETA",
"PUEDO SOPORTAR LA TORTURA, ADEMAS DE CREARLA ",
"\255NO, POR FAVOR! \255HABLARE, PERO NO ME HAGA ESO!",
"BUENO. YA TE HE DICHO LO QUE QUERIAS SABER. AHORA LIBERANOS A B.J. Y A MI Y DEJANOS EN PAZ",
"\255B.J.! \250QUE HACES AQUI? \250DONDE ESTA DRASCULA?",
+ // 260
"\255QUE DESALMADO! SOLO PORQUE PERTENECE A LA NOBLEZA SE CREE QUE TIENE EL DERECHO DE PERNADA CON CUALQUIERA QUE SE LE ANTOJE ",
"\255ABAJO LA ARISTOCRACIA CACIQUIL!",
"\255ARRIBA LOS POBRES DEL MUUNDOOO....",
"Y POR LO QUE VEO TE HA ENCADENADO CON CANDADO Y TODO",
"BUENO, VALE. \250NO TENDRAS UNA HORQUILLA?",
+ // 265
"BUENO, BUENO. NO TE PONGAS ASI, YA SE ME OCURRIRA ALGO.",
"EH, TABERNERO",
"\250COMO VA EL PARTIDO?",
"\250QUIEN?",
"\250ES QUE NO VES QUE ESTA AQUI DRASCULA?",
+ // 270
"PUES VAMOS A ACABAR CON EL \250NO?",
"PONME UN CUBATA...",
"NADA. SE ME HA OLVIDADO LO QUE TE IBA A DECIR",
"O\247ME\247PONES\247UN\247CUBATA\247O\247ME\247PONGO\247A\247TOCAR\247EL\247PIANO",
"\250CUANTO QUEDA PARA QUE ACABE EL PARTIDO?",
+ // 275
"BUENAS NOCHES",
"\250Y QUE TAL ANDAS IGOR? \250JOROBAO? \255JI,JI,JI, QUE BUENO! ",
"\250QUE SE SUPONE QUE HACES?",
"PUES NO",
"PUES PONTE GAFAS",
+ // 280
"\250QUE ES ESO DE LA ORGIA SOBRENATURAL?",
"VALE, VALE, NO SIGAS. YA ME HAGO UNA IDEA",
"\250NO PODRIAS DECIRME DONDE ESTA DRASCULA? ",
"ANDA, PORFAAA",
"\250POR QUE NO?",
+ // 285
"AH, PERO \250DUERME POR LA NOCHE?",
"BUENO, PUES QUE SE DE BIEN LA RENTA",
"ES QUE TENGO QUE HABLAR CON EL",
"\255EOOO, ESQUELETOOO! ",
"\255CANASTOS! \255UN MUERTO QUE HABLA!",
+ // 290
"CUENTAME, \250COMO HAS VENIDO A PARAR AQUI?",
"\250Y PARA QUE VA A QUERER DRASCULA CREAR UN MONSTRUO? ",
"\250CUAL ES TU NOMBRE, AMIGO ESQUELETO?",
"OYE, \250NO QUIERES QUE TE TRAIGA NADA DE COMER?",
"DEBES TENER EL ESTOMAGO VACIO. \255JI, JI, JI!",
+ // 295
"LA VERDAD ES QUE NO ME APETECE HABLAR AHORA",
"\255LA MADRE QUE...(PITIDO) ESPERO QUE TE...(PITIDO) Y QUE TE...(PITIDO) DOS VECES!",
"YO LA QUERIA, DE VERDAD. VALE, DE ACUERDO QUE NO ERA UNA LUMBRERA, PERO NADIE ES PERFECTO \250NO? ",
"ADEMAS, TENIA UN CUERPAZO QUE PARA QUE QUEREMOS MAS",
"YA NO VOLVERE A SER EL MISMO. ME RECLUIRE EN UN MONASTERIO A DEJAR QUE MI VIDA SE ME ESCAPE POCO A POCO",
+ // 300
"NADA PODRA YA SACARME DE ESTA MISERIA PORQUE...",
"\250DE QUIEN? \250DE QUIEN?",
"QUIERO SER PIRATA",
"QUIERO SER PROGRAMADOR ",
"CONTADME ALGO SOBRE PELAYO",
+ // 305
"SEGUIRE JUGANDO Y OLVIDARE QUE OS HE VISTO ",
"\255A QUIEN SE LE HABRA OCURRIDO ESTA IDIOTEZ!",
"ES UN BOLSO COMO EL DE MI ABUELITA ",
"\255PERO QUE BUENO QUE ESTOY!",
"CUANTO MAS ME MIRO MAS ME GUSTO",
+ // 310
"\250Y LUEGO COMO ME CIERRO?",
"TENDRE QUE ABRIRME PRIMERO \250NO?",
"ESTOY BIEN DONDE ESTOY",
"YA ME TENGO",
"HOLA YO",
+ // 315
"ME LOS PONDRE CUANDO LA OCASION SEA OPORTUNA",
"NO VEO NADA EN ESPECIAL",
"ESTA BIEN DONDE ESTA",
"\250Y PA QUE?",
"NO PUEDO",
+ // 320
"HOLA TU",
"ES EL PANTEON DEL TIO DESIDERIO",
"\255EOOOO, TIO DESIDERIOOOO!",
"NO. NO QUIERO CORTARME OTRA VEZ",
"\255EJEM,JEM...!",
+ // 325
"\255YAMM, EMMM, JH!",
"\255SI, COF,COF!",
"ANDA, SI HAY UN CHICLE AQUI PEGADO",
"ES EL MOVILANI QUE ME REGALARON EN NAVIDAD",
"\255QUE ALTO ESTA!",
+ // 330
"\255SAL AL BALCON JULIETA!",
"\255TU ERES LA LUZ QUE ILUMINA MI CAMINO!",
"EH,PUERTA \250QUE PASSA?",
"EOOO, MAQUINA DE TABACO DE TRANSILVANIAAA",
"ES UNA MAQUINA EXPENDEDORA DE TABACO",
+ // 335
"TENGO OTRA MONEDA DENTRO",
"NO. HE DECIDIDO DEJAR EL TABACO Y EL ALCOHOL ",
"A PARTIR DE AHORA ME DEDICARE SOLO A LAS MUJERES ",
"\255ESTO ES UN TIMO! NO HA SALIDO NADA",
"\255POR FIN! ",
+ // 340
"PUES ESO, UN BAUL",
"HOLA BAUL, TE LLAMAS COMO MI PRIMO QUE SE LLAMA RAUL.",
"HE ENCONTRADO EL BOLSO DE B.J.",
"DIOS MIO, NO ME REFLEJO \255SOY UN VAMPIRO!",
"...AH, NO. ES QUE ES UN DIBUJO",
+ // 345
"ESPEJITO: \250QUIEN ES EL MAS BELLO DEL REINO?",
"NO ME QUIERE ABRIR",
"MUY BIEN. ME HE PUESTO LOS TAPONES",
"ES UN DIPLOMA DE CAZA-VAMPIROS HOMOLOGADO POR LA UNIVERSIDAD DE CAMBRIDGE",
"NO, AUN ME FALTAN INGREDIENTES, NO VALE LA PENA DESPERTARLE",
+ // 350
"ES QUE NO TENGO DINERO",
"ES UNA LAMPARA BRITANICA",
"\255TABERNERO! \255AYUDEME!",
"HA APARECIDO UN VAMPIRO Y SE HA LLEVADO A MI NOVIA",
"\255\250PERO NO VA USTED A AYUDARME?!",
+ // 355
"\250MUERTA? \250QUE ES LO QUE QUIERE DECIR?",
"\255EJEM!",
"\255UN VAMPIRO HA SECUESTRADO A LA CHICA DE LA 506!",
"\255TIENES QUE AYUDARME!",
"\250NO SABES TOCAR NINGUNA DE LOS INHUMANOS?",
+ // 360
"\250COMO TE AGUANTAS, TODO EL DIA TOCANDO LO MISMO?",
"\250Y ENTONCES COMO ME OYES?",
"DEJAME LOS TAPONES",
"ANDA. SI TE LOS DEVUELVO ENSEGUIDA",
"VENGAAAA...",
+ // 365
"ADIOS. TENGO QUE MATAR A UN VAMPIRO",
"",
"\250QUE HABLAS? \250EN TRANSILVANO?",
"\250QUIEN ES EL TIO DESIDERIO?",
"\250PERO QUE PASA CON ESE TAL DRASCULA?",
+ // 370
"\250QUIEN ES ESE TAL VON BRAUN?",
"\250Y POR QUE NO LO HACE?",
"\250Y DONDE PUEDO ENCONTRAR A VON BRAUN?",
"PUES GRACIAS Y ADIOS, QUE LA DUERMAS BIEN",
"SERA MEJOR LLAMAR PRIMERO",
+ // 375
"\250ES USTED EL PROFESOR VON BRAUN?",
"\250Y NO ME PODRIA DECIR DONDE PUEDO...?",
"NO ME CREO QUE SEA EL ENANO GANIMEDES",
"\255PROFESOR!",
"\255AYUDEME! \255LA VIDA DE MI AMADA DEPENDE DE USTED!",
+ // 380
"ESTA BIEN, NO NECESITO SU AYUDA",
"DE ACUERDO. ME VOY",
"NO TENGA MIEDO. JUNTOS VENCEREMOS A DRASCULA",
"ENTONCES \250POR QUE NO ME AYUDA?",
"YO LAS TENGO",
+ // 385
"\255SI LAS TENGO!",
"DE ACUERDO",
"...ER ...SI",
"VENGO A METERME EN ESA CABINA DE NUEVO",
"ESTOY PREPARADO PARA ENFRENTARME A SU PRUEBA",
+ // 390
"ESTA BIEN, VEJETE. HE VENIDO A POR MI DINERO",
"NO, NADA. YA ME IBA",
"PERDONA",
"\250TE INTERESA ESTE LIBRO? TIENE PARTITURAS DE TCHAIKOWSKY",
"\250COMO PUEDO MATAR A UN VAMPIRO?",
+ // 395
"\250NO TE HAN DICHO QUE ES MALO DORMIR EN MALA POSTURA?",
"PUES ES LO QUE SIEMPRE ME DICE A MI MI MADRE",
"\250POR QUE NO TE PUDO MATAR DRASCULA?",
"\250Y QUE FUE?",
"\255ESTUPENDO! \255TIENE USTED UNA POCION DE INMUNID...!",
+ // 400
"\250ENTONCES?",
"MUY BIEN",
"\250ME PUEDE REPETIR LO QUE NECESITO PARA ESA POCION?",
"PUES PARTO RAUDO A BUSCARLO",
"OIGA, \250QUE HA PASADO CON EL PIANISTA?",
+ // 405
"YA\247TENGO\247TODOS\247LOS\247INGREDIENTES\247DE\247ESA\247POCION",
"UNA PREGUNTA: \250QUE ES ESO DE ALUCSARD ETEREUM?",
"DIGA, DIGA... ",
"\250Y DONDE ESTA ESA GRUTA?",
"\250QUE PASA? \250NO TENIAIS JUZGADO?",
+ // 410
"...PERO ...\250Y SI ME ENCUENTRO A MAS VAMPIROS?",
"ES UN VAMPIRO QUE NO ME DEJA PASAR",
"SE PARECE A YODA, PERO MAS ALTO ",
"EH, YODA. SI ME DEJAS PASAR TE DOY UN DURO",
"BUENO VALE, QUE NO SE TE PUEDE DECIR NADA",
+ // 415
"HOLA VAMPIRO, BONITA NOCHE \250VERDAD?",
"\250TE HAN DICHO ALGUNA VEZ QUE TE PARECES A YODA?",
"\250ERES UN VAMPIRO O UNA PINTURA AL OLEO?",
"MEJOR NO TE DIGO NADA, NO TE VAYAS A ENFADAR",
"ESTA CERRADA CON LLAVE",
+ // 420
"\255LA URRACA ME PODRIA SACAR UN OJO SI LO INTENTO!",
"\255ESTA CERRADA! \255DIOS MIO, QUE MIEDO!",
"LAS BISAGRAS ESTAN OXIDADAS",
"AQUI DENTRO SOLO HAY UN BOTE CON HARINA",
"ESO HA QUITADO EL OXIDO",
+ // 425
"HE ENCONTRADO UNA ESTACA DE PINO",
"COGERE ESTE QUE ES MAS GORDO",
"BUENO, CREO QUE YA PUEDO DESHACERME DE ESTE ESTUPIDO DISFRAZ",
"\"PASADIZO A LOS TORREONES CERRADO POR OBRAS. POR FAVOR, UTILICEN ENTRADA PRINCIPAL. DISCULPEN LAS MOLESTIAS\"",
"...ES PALIDO, TIENE COLMILLOS, TIENE TUPE Y USA CAPA... \255SEGURO QUE ES DRASCULA!",
+ // 430
"\255ES B.J.! B.J. \250ESTAS BIEN?",
"SI, YA LO SE QUE ES TONTA, PERO ES QUE ESTOY DE SOLO",
"NO TENDRAS UNA LLAVE POR AHI, \250VERDAD? ",
"\250A QUE NO TIENES UNA GANZUA?",
"DAME UNA HORQUILLA. VOY A HACER COMO MCGYVER",
+ // 435
"NO TE MUEVAS QUE AHORA VUELVO",
"\255CACHIS! \255SE ME HA ROTO!",
"\255OLEEEE! \255Y ADEMAS ME HE AFEITADO, COLEGA!",
"\250SI, CARI\245O?",
"NO LLEGA",
+ // 440
"EL PIANISTA NO ESTA",
"UN CUBATA TRANSILVANO",
"AUN NO TENGO HABITACION",
"PARECE QUE SE QUEDO ATASCADO EN LA BA\245ERA Y DECIDIO PONER UN BAR",
"ESTA COMO UNA CUBA DE CUBA",
+ // 445
"ESE PELO... EL CASO ES QUE ME RECUERDA A ALGUIEN",
"ES UN ESQUELETO HUESUDO",
"\255MIRA! \255MIGUEL BOSE!",
"ESTA DURMIENDO. SERIA UNA PENA DESPERTARLE",
"ES MAS FEO QUE EMILIO DE PAZ ",
+ // 450
"UN ATAUD DE MADERA DE PINO",
"ME VA A CORTAR EN RODAJITAS, COMO A UN SALCHICHON",
"NO ME GUSTAN LOS PENDULOS. PREFIERO LAS ALCACHOFAS",
"MIS MANOS ESTAN ESPOSADAS. NO VOY A PODER",
"SALTA A LA VISTA QUE ES UNA PUERTA SECRETA",
+ // 455
"ME IGNORAN",
"\255ANDA YA!",
"EN EL GUION SE MOVIA, PERO EL JUEGO SE SALIO DE PRESUPUESTO Y NO PUDIERON PAGARME UN GIMNASIO PARA PONERME CACHAS, ASI QUE NADA",
"PARECE QUE ESTA UN POCO SUELTA DE LA PARED",
"NO CREO QUE ME VAYA A SERVIR DE NADA. ESTA DEMASIADO HUMEDA PARA ENCENDERLA",
+ // 460
"\250AL ALA OESTE? \255NI LOCO! \255A SABER QUE HABRA ALLI!",
"TIENE BONITOS MOTIVOS TRANSILVANOS ",
"",
"QUE PENA QUE AHI DENTRO NO HAYA UN CORDERITO ASANDOSE ",
"LA ULTIMA VEZ QUE ABRI UN HORNO LA CASA SALTO POR LOS AIRES",
+ // 465
"ES EL ESCUDO DEL EQUIPO DE FUTBOL DE TRANSILVANIA",
"\250Y PARA QUE? \250PARA PONERMELA EN LA CABEZA?",
"NO CREO QUE ESTOS CAJONES SEAN DE LOS QUE SE ABREN",
"\255NO QUIERO SABER LA COMIDA QUE HABRA AHI DENTRO!",
"ME DA LA IMPRESION DE QUE ES IMPRESIONISTA",
+ // 470
"LA NOCHE SE APODERA DE TODOS... QUE MIEDO \250NO?",
"ESTA ATRANCADA",
"ES EL REY \250ES QUE NO TE LO HABIAS IMAGINADO?",
"NO, YA TENGO UNO EN MI CASA, AL QUE LE DOY DE COMER Y TODO",
"UNA ESTANTERIA CON LIBROS Y OTRAS COSAS ",
+ // 475
"\250Y A QUIEN LLAMO A ESTAS HORAS?",
"\"COMO HACER LA DECLARACION DE LA RENTA\" \255QUE INTERESANTE!",
"YA TENGO UNO EN MI CASA. CREO QUE ES UN BEST-SELLER MUNDIAL ",
"UNA LLAVE COMPLETAMENTE NORMAL",
"ME PARECE A MI QUE ESTA NO ES DE AQUI",
+ // 480
"\255EH, SON PATATAS FRITAS CON FORMA DE COLMILLO! ME ENCANTA",
"NO CREO QUE SEA EL MEJOR MOMENTO DE PONERSE A COMER CHUCHERIAS, CON MI NOVIA EN MANOS DEL SER MAS MALVADO QUE HA PARIDO MADRE",
"\255QUE BIEN ME LO ESTOY PASANDO CARGANDOME VAMPIROS CON ESTO!",
"A VER SI APARECE OTRO PRONTO",
"NO, TIENE QUE SER CON UN VAMPIRO SUCIO Y MALOLIENTE COMO EL QUE ME CARGUE ANTES",
+ // 485
"ES LA AUTENTICA PELUCA QUE USO ELVIS CUANDO SE QUEDO CALVO",
"ES HARINA, PERO NO PUEDO DECIR MARCAS",
"QUIZA EN OTRO MOMENTO \250VALE?",
"ES UN HACHA MAGNIFICA, QUE PENA QUE NO HAYA POR AQUI CERCA NINGUNA CABEZA DE VAMPIRO",
"NO. EN EL FONDO SOY BUENA PERSONA",
+ // 490
"ES EL DESODORANTE DE LA TACHER \255JI,JI,JI!",
"ES UNA CAPA BASTANTE MONA",
"",
"COMO TODAS LAS RAMAS DE TODOS LOS ARBOLES DE TODO EL MUNDO, O SEA, SIN NADA DE PARTICULAR",
"\255OH, INCREIBLE! \255UNA CUERDA EN UNA AVENTURA GRAFICA!",
+ // 495
"ME PREGUNTO PARA QUE SERVIRA...",
"UNA CUERDA ATADA A UNA RAMA O UNA RAMA ATADA A UNA CUERDA, SEGUN SE MIRE",
"PARECE QUE ESTA URRACA TIENE MUY MALAS INTENCIONES",
"QUITA, YO NO LA DIGO NADA, A VER SI SE VA A ENFADAR",
"PARECE QUE ESTA MUERTA, PERO ES MENTIRA \250EH?",
+ // 500
"NINGUN ANIMAL DA\245ADO EN LA PRODUCCION DE ESTE JUEGO",
},
{
+ // 0
"",
"Das ist die zweitgroesste Tuer, die ich je gesehen habe !",
"Ok, stimmt nicht ganz....",
"Sie haben Bretter davorgenagelt. Die Kirche scheint seit Jahren leer zu stehen",
"Aber ich habe sie doch nicht aufgemacht!",
+ // 5
"Soll ich sie aufbrechen ?",
"Hallo Tuer! Ich verpasse Dir jetzt mal einen Rahmen!",
"Zuviel fuer mich !",
"ein zugenageltes Fenster",
"Ich schaff\357es nicht!",
+ // 10
"Schon geschafft!",
"Und wozu?",
"Hallo Fenster. Hast Du heute abend schon was vor?",
"Nicht ohne Genehmigung der Staedtischen Baubehoerde",
"hey! Das Fenster da hat nur EIN Brett...",
+ // 15
"Heyhooo! Fenster!",
"Hallo Du",
"",
"Ich komme nicht dran!",
"Gut so ! ",
+ // 20
"",
"Es ist ein Grabstein in Form eines Kreuzes.",
"Nein, danke",
"Hallo Toter. Willst Du ein paar Wuermchen?",
"Klar Mann ! Wie in Poltergeist.",
+ // 25
"",
"",
"Bin in einer Viertelstunde zurueck!",
"Plakate ankleben verboten",
"",
+ // 30
"Sie ist abgeschlossen.",
"Ich habe schon eins.",
"",
"Keine Reaktion !",
"Nein, da steht es gut !",
+ // 35
"Es ist eine Tuer",
"Eine Schublade vom Tisch",
"Ein verdaechtiger Schrank",
"Hallo Schrank. Alles klar?",
"",
+ // 40
"",
"Ein uralter Kerzenstaender",
"Der stammt wohl noch aus der Zeit als meine Ururururoma in den Kindergarten ging ",
"Nein, eine Reliquie aus vergangenen Zeiten",
"Es ist ein huebsches Altarbild",
+ // 45
"",
"Hi,hi,hi",
"",
"Nein.",
"",
+ // 50
"Ha,ha,ha! klasse!",
"",
"",
"",
"Ich sehe nichts besonderes",
+ // 55
"Freddy, die Topfblume",
"Eine Spitze aus dem Jaegerzaun",
"Ej! Hier unten liegt eine Streichholzschachtel!",
"Guck mal! Eine Packung Tempos! Und eins sogar ungebraucht!",
"Sonst ist nichts mehr im Eimer",
+ // 60
"Ein Blinder der nichts sieht",
"",
"",
"",
"",
+ // 65
"Ein Wahnsinnsbatzen Geld.",
"",
"",
"",
"",
+ // 70
"",
"",
"",
"",
"",
+ // 75
"",
"",
"",
"",
"",
+ // 80
"",
"",
"",
"",
"",
+ // 85
"",
"",
"",
"",
"",
+ // 90
"",
"",
"",
"",
"",
+ // 95
"",
"",
"",
"",
"",
+ // 100
"SIEHT NICHT UNGEWoeHNLICH AUS",
"SIEHT NICHT AUSSERGEWoeHNLICH AUS",
"EJ DU, WAS IST LOS?",
"HALLO",
"NICHTS NEUES?",
+ // 105
"WIE GEHTS DER FAMILIE?",
"WAS DU FueR SACHEN HAST !",
"ABER WIE SOLLTE ICH DAS AUFHEBEN ?",
"MEINE RELIGION VERBIETET MIR DAS",
"BESSER NICHT",
+ // 110
"KLAR MANN!",
"DU SPINNST WOHL !",
"UNMoeGLICH",
"GEHT NICHT AUF !",
"ALLEINE SCHAFFE ICH DAS NICHT",
+ // 115
"WENN ICH WOLLTE, KoeNNTE ICH, ABER ICH HABE KEINE LUST",
"ICH WueSSTE NICHT WARUM",
"EIN SCHaeDEL, DER GUT DRAUF IST",
"UND? SCHON WAS VOR HEUTE ABEND, SCHaeDEL?",
"NEIN, ER MUSS AN EINEM KueHLEN ORT GELAGERT WERDEN, FERN DER ZERSToeRERISCHEN KRAFT DER ATMOSPHaeRE",
+ // 120
"KNOCHENTROCKEN, WIE MEIN CHEF!",
"EIN SEHR SPITZER PFLOCK",
- "GUTER SPITZER PFLOHOCK, HOLZ SO EDEL, TRANSILVAAANISCH!!!",
+ "GUTER SPITZER PFLOHOCK, HOLZ SO EDEL, TRANSSYLVAAANISCH!!!",
"OH VERDAMMT, ICH MUSS MIR DIE NaeGEL SCHNEIDEN !",
"DA DRINNEN LIEGT B.J., UND GUCK MAL WIE DIE TANTE AUSSIEHT !",
+ // 125
"NIET UND NAGELFEST",
" \"NIET & NAGEL GmbH & Co. KG\"",
"DAS TYPISCHE SKELETT IM TYPISCHEN VERLIESS EINES TYPISCHEN SPIELS",
"WIRD NORMALERWEISE ZUR STROMVERSORGUNG ALLER EINGESToePSELTEN GERaeTE VERWENDET",
"TOTALES KUNSTHANDWERK, WEIL SIE DANK DEN JAPANERN KLEINE MINIATUREN SIND",
+ // 130
"ES GIBT NUR EINS, WAS GENAUSO HaeSSLICH IST",
"HAU AB. ICH SAG IHM GAR NICHTS. MAL GUCKEN OB ER AUSFLIPPT",
"SCHEINT ZIEMLICH VERNueNFTIG ZU SEIN",
"EIN FOTO VON PLATON WIE ER SEINEN VERLORENEN DIALOG SCHREIBT",
"SEH ICH SO AUS ALS OB ICH MIT POSTERN REDE ? !",
+ // 135
"EIN HueBSCHER SCHREIBTISCH",
"EIN VON DER UNIVERSITaeT ZU OXFORD AUSGESTELLTES VAMPIR-JaeGER-JaeGER-DIPLOM",
"VOLLMOND IN FINSTERSTER NACHT",
"DIESE SCHRAUBEN SCHEINEN ZIEMLICH FEST ZU SITZEN",
"GUCK JETZT NICHT HIN, ABER ICH GLAUBE HIER GIBT ES EINE VERSTECKTE KAMERA",
+ // 140
"EIN ULTRAMODERNER PFLOCK-DETEKTOR",
"NEIN, DAS LABOR IST IM ZWEITEN STOCK",
"EIN HueBSCHES NACHTTISCHCHEN ",
"EIN BATZEN GELD DER BEI EINEM WIRKLICH GUTEN ABENTEUER NICHT FEHLEN DARF",
"WENN ICH REICH WaeRE, SCHUBIDUBISCHUBIDUBUDU ",
+ // 145
"KOMISCHE BLaeTTER, DIE WERDEN SIE WOHL AUS SueDAMERIKA ODER SO MITGEBRACHT HABEN .",
"ICH GLAUBE NICHT, DASS SIE ANTWORTEN WERDEN",
"EIN SCHoeNES HOLZKRUZIFIX. DEM HELDEN SIND DIE AUSMASSE SEI-NER SCHoeNHEIT NICHT GANZ KLAR.",
"ICH BETE NUR VOR DEM ZU-BETT-GEHEN",
"EJ, ICH GLAUBE, DIE SPITZE HIER IST EIN BISSCHEN LOSE !",
+ // 150
"UND NACHHER BESCHWERST DU DICH, ICH HaeTTE DIR KEINEN WINK GEGEBEN !",
"EINE STINKNORMALE ZAUNSPITZE",
"NIEDLICH, OBWOHL SIE EIN BISSCHEN VERDRECKT SIND",
"SIE WERDEN MICH NICHT HoeREN, HI,HI,HI, SUPERGUT !",
"DIE SCHoeNE SCHLAFENDE AUS DEM WALDE VON TSCHAIKOWSKY ODER TSCHESLOFSKY ODER WIE DER HEISST.",
+ // 155
"SEHR APPETITLICH",
"NEIN, SEHE ICH SO AUS, ALS WueRDE ICH BENUTZTE KAUGUMMIS KAUEN ?",
"EINE NIEDLICHE SICHEL. ICH WueSSTE NUR GERNE WO DER HAMMER IST.",
"DER GESUNDHEITSMINISTER WARNT : RAUCHEN GEFaeHRDET IHRE GESUNDHEIT",
"EINE GANZ NORMALE KERZE, MIT WACHS UND ALLEM DRUM UND DRAN",
+ // 160
"MAN MUSS ECHT MAL GESEHEN HABEN WIE DIESE 2 GLaeNZENDEN MueNZEN GLaeNZEN",
"MAN MUSS ECHT GESEHEN HABEN WIE DIESE GLaeNZENDE MueNZE GLaeNZT !",
"DAMIT WERDE ICH GEGEN VAMPIRBISSE IMMUN SEIN.",
"NEIN,ES IST NOCH NICHT SO WEIT",
"EIN TAUSENDER UND EIN BISSCHEN KLEINGELD",
+ // 165
"DA STEHT\"DEN KLAVIERSPIELER BITTE NICHT MIT LEBENSMITTELN BEWERFEN",
"CURRYWURST 3.80. POMMES FRITES 2.30., FRIKADELLEN 1.50",
"DIE BESTEN HAMBURGER DIESSEITS DER DONAU FueR NUR 3.80 DM",
"EIN SCHoeNER TOTENKOPF MIT EINEM ZIEMLICH DURCHDRINGENDEN BLICK, HI, HI, SUPERGUT !",
"HALLO TOTENKOPF, DU ERINNERST MICH AN HAMLETS ONKEL !",
+ // 170
"ICH HABE DIE ANGEWOHNHEIT, NICHTS ANZUFASSEN, WAS MAL LEBENDIG GEWESEN IST",
"EIN PAPIERKORB",
"SIE WETTEN, WIE DAS SPIEL HEUTE ABEND AUSGEHT",
"WAS SICH WOHL DAHINTER VERBERGEN MAG",
"EJ, DIESER VORHANG BEWEGT SICH NICHT !",
+ // 175
"GANZ SCHoeN GRUSELIG, DAS SCHLOSS DA, WAS ?",
"ICH SCHAFFS NICHT, ER IST ZU WEIT WEG, UM MICH ZU HoeREN",
"EIN TYPISCH TRANSSYLVANISCHER WALD, MIT BaeUMEN UND SO",
"RED KEINEN BLoeDSINN, ES IST DOCH STOCKDUNKEL!",
"KONDITOREI MueLLER. GEBaeCK UND KAUGUMMIS",
+ // 180
"EINE SEHR SCHoeNE TueR",
"GESCHLOSSEN",
"EINE TOTAL GESCHLOSSENE TONNE",
"",
"WAS FueR SueSSE VIECHER !",
+ // 185
"PSSS,PSSS,PSSS,MIETZCHEN...",
"KEINE REAKTION",
"DER MOND IST EIN SATELLIT DER DIE ERDE IN EINER UMLAUFGESCHWINDIGKEIT VON 28 TAGEN UMKREIST.",
"HALLO MOND DU KREISRUNDES MONDGESICHT",
"TOTAL MIT BRETTERN ZUGENAGELT",
+ // 190
"NICHTS ZU MACHEN. HIER KOMMT NOCH NICHT MAL ARNOLD S. MIT DER KREISSaeGE DURCH",
"SCHEINT SO, ALS HaeTTE DIE TANNE DA EINEN ueBERDIMENSIONALEN SCHATTEN !",
"HEHOO, WIRT !",
"SIND NOCH ZIMMER FREI ?",
"KoeNNEN SIE MIR SAGEN WO ICH EINEN GEWISSEN GRAF DRASCULA FINDE ?",
+ // 195
"JA, WAS GIBTS ?",
"UND WIESO ?",
"WW...WIRKLICH ?",
"GUTE FRAGE, ICH WERDE IHNEN MAL MEINE STORY ERZaeHLEN, ALSO...",
"NUR FueNF MINUTEN !",
+ // 200
"ICH HEISSE HEINZ HACKER UND BIN VERTRETER EINER NORDDEUTSCHEN IMMOBILIENFIRMA",
"SO WIES AUSSIEHT WILL GRAF DRASCULA EINIGE HEKTAR LAND AUF HELGOLAND KAUFEN UND ICH BIN HIER UM ueBER DIE PREISE ZU VERHANDELN",
"MMMMH, ICH GLAUBE DASS ICH MORGEN FRueH MIT MEINER MAMI ZURueCKKOMME",
"WAS FueR EINE NACHT, NICHT WAHR ?",
"NICHTS, SCHON GUT",
+ // 205
"HEEHOOO, KLAVIERSPIELER",
"WAS FueR EINE NACHT",
"UND ES IST AUCH GAR NICHT SO KALT",
"NUN GUT, ICH LASS DICH JETZT MAL IN RUHE WEITERSPIELEN",
"GENAU",
+ // 210
"HALLO CHEF, ALLES KLAR ?",
"UND DIE FAMILIE ?",
"HIER IST MaeCHTIG WAS LOS, WAS ?",
"ICH HALTE BESSER MEINEN MUND",
"ZU HAUSE IST ES IMMER NOCH AM SCHoeNSTEN...ZU HAUSE IST ES IMMER....Hae ? ABER SIE SIND DOCH NICHT TANTA ENMA. WO ICH DOCH GAR KEINE TANTE EMMA HABE !",
+ // 215
"JA, MEINER AUCH. SIE KoeNNEN MICH NENNEN WIE SIE WOLLEN, ICH HoeRE SELBST AUF HEINZCHEN WIE AUF KOMMANDO.",
"JA, ICH HAB GANZ SCHoeNE BEULEN, WAS ? ueBRIGENS, WO BIN ICH ?",
"JA",
"VERDAMMT.....",
"JA, KLAR, SELBSTVERSTaeNDLICH !",
+ // 220
"DANN ALSO VIELEN DANk FueR DEINE HILFE. ICH WERDE DICH NICHT WEITER BELaeSTIGEN. WENN DU MIR BITTE NOCH SAGEN WueRDEST, WO DIE TueR IST.... ",
"WEIL DIE BEULE WOHL MEIN GEHIRN ANGEGRIFFEN HAT UND ICH EINFACH ueBERHAUPT NICHTS SEHE",
"PAH, MACHT NICHTS. ICH HABE IMMER ERSATZ DABEI",
"WOW, WAS FueR EIN SCHARFES WEIB ! OHNE BRILLE HABE ICH DAS GAR NICHT BEMERKT !",
"EJ, DU....",
+ // 225
"UND WAS IST DAAAAAS ? !",
"MACH DIR KEINE SORGEN, BJ, MEINE GELIEBTE !ICH WERDE DICH AUS SEINEN KLAUEN BEFREIEN",
"ACH KOMM, ER HAT MICH AUF DIE PALME GEBRACHT",
"UUAAA, EIN WERWOLF ! KREPIER, DU MONSTER !",
"JA, DAS.... ",
+ // 230
"JA, DAS.... ICH GLAUB, ICH GEH DANN MAL WEITER, MIT VERLAUB...",
"WAS?",
"WENN ICHS MIR RECHT ueBERLEGE, UM EHRLICH ZU SEIN, ICH GLAUBE NEIN ",
"SAG MIR OH GEBILDETER PHILOSOPH, GIBT ES IRGENDEINEN KAUSALZUSAMMENHANG ZWISCHEN DER LICHTGESCHWINDIGKEIT und SCHINKENSPECK",
"OKAY,OKAY,VERGISS ES. ICH WEISS JEDENFALLS NICHT, WARUM ICH DAS GESAGT HABE",
+ // 235
"WAS PHILOSOPHIERST DU HIER HERUM, WO DU DOCH MENSCHEN FRESSEN MueSSTEST!",
"HaeH",
"EJ, KANNST DU DAS MIT DEN PRaeHISTORISCHEN NEIGUNGEN NOCHMAL ERKLaeREN ?",
"JA, MANN. DER KRAM MIT DEM DU MIR EBEN GEKOMMEN BIST. ICH HAB DAS NaeMLICH NICHT GANZ KAPIERT....",
"ICH HALTE BESSER MEINEN MUND, WEIL SOBALD ER BLUT RIECHT...",
+ // 240
"JA, BITTE ?",
"JA, WAS GIBTS ?",
"ACH, WO SIES GERADE ERWaeHNEN,....",
"",
"ueBRIGENS, WAS WueRDE EIGENTLICH PASSIEREN, WENN DAS REZEPT ZUFaeLLIG IN DIE HaeNDE EINES VAMPIRS GERATEN WueRDE...",
+ // 245
"NA WAS SOLLS. HoeR MAL, KOMMT DIR DAS NICHT AUCH WIE EIN DaeMLICHER KLEINER TRICK VOR, UM DAS SPIEL SCHNELL ZU BEENDEN ? NAJA, VIELLEICHT AUCH NICHT",
"LEER !",
"WEIL DU MIR B.J., MEINE GELIEBTE, GERAUBT HAST. OHNE SIE HAT MEIN LEBEN KEINEN SINN.",
"SEIN GEHIRN ?",
"OCH, NUR SO! ICH GLAUBE DASS ICH GENUG VON DEM KLEINEN MONSTERCHEN HABE",
+ // 250
"SueSSE KLEINE JUNGFRAU, ICH BLEIB SO WIE ICH BIN !",
"DAMIT KOMMST DU NICHT DURCH.. GLEICH KOMMT POPEYE UND HOLT MICH HIER RAUS !",
"WAS FueR EIN SCHEISS-SPIEL, BEI DEM DEM DER HELD STERBEN MUSS",
"HALT ! WAS IST MIT MEINEM LETZTEN WUNSCH ?",
"HAR,HAR ! JETZT BIN ICH IMMUN GEGEN DEIN VERFLUCHTES UNGEHEUER. DAS HIER IST EINE ANTI-VAMPIR-ZIGARETTE,DIE MIR VON BRAUN GEGEBEN HAT.",
+ // 255
"JA, KLAR. ABER ICH WERDE DIR BESTIMMT NICHT DAS REZEPT VERRATEN",
"MIT FOLTER KOMM ICH GUT KLAR, ICH DENK MIR SOGAR WELCHE AUS",
"NEIN, BITTE NICHT ! ICH SAG ALLES, ABER TUN SIE MIR DAS NICHT AN !",
"O.K. ICH HAB DIR ALLES ERZaeHLT. JETZT HOL B.J. UND MICH ENDLICH HIER RAUS UND LASS UNS IN RUHE",
"B.J. !WAS MACHST DU HIER ?WO IST DRASCULA ?",
+ // 260
"WAS FueR EIN MIESER TYP ! NUR WEIL ER BLAUES BLUT HAT, MueSSEN IHM NOCH LANGE NICHT ALLE JUNGFRAUEN DIESER ERDE ZU FueSSEN LIEGEN",
"NIEDER MIT DEM BONZEN-ADEL !",
"SOLIDARITaeT MIT ALLEN ARMEN DIESER WELT... !",
"UND WIES AUSSIEHT HAT ER DICH NACH ALLEN REGELN DER KUNST ANGEKETTET",
"O.K. DU HAST NICHT ZUFaeLLIG EINE HAARSPANGE ?",
+ // 265
"NANANA. STELL DICH NICHT SO AN . MIR FaeLLT SCHON WAS EIN.",
"HE, WIRT",
"WER GEWINNT ?",
"WER ?",
"SIEHST DU DENN NICHT, DASS HIER DRASCULA IST ?",
+ // 270
"NA, DANN LASS IHN UNS ALLE MACHEN, ODER ?",
"GIB MIR EINEN GIN-TONIC",
"SCHON GUT. ICH HAB VERGESSEN, WAS ICH DIR SAGEN WOLLTE",
"GIB\247MIR\247SOFORT\247EINEN\247GIN\247TONIC\247ODER\247ICH\247SPIEL\247KLAVIER",
"WIELANGE DAUERT DAS SPIEL NOCH ?",
+ // 275
"GUTE NACHT",
"UND WIE KOMMST DU VORAN, IGOR ? SCHLEPPEND ? HI,HI,HI, KLASSE !",
"WAS SOLL DAS SEIN, WAS DU DA MACHST?",
"NEIN",
"DANN ZIEH DIE BRILLE AUF",
+ // 280
"WAS SOLL DAS MIT DER ueBERNATueRLICHEN ORGIE ?",
"O.K. ES REICHT. ICH KANN ES MIR SCHON VORSTELLEN",
"KoeNNTEST DU MIR NICHT ZUFaeLLIG SAGEN, WO DRASCULA IST ?",
"ACH KOMM, BITTE, BITTE!",
"WARUM NICHT ?",
+ // 285
"ACH :NACHTS SCHLaeFT ER ?",
"NA, HOFFENTLICH KLAPPT DAS MIT DER EINKOMMENSERKLaeRUNG",
"ICH MUSS NaeMLICH MIT IHM REDEN",
"HEYHOO, GERIPPE !",
"VERDAMMT ! EIN SPRECHENDER TOTER !",
+ // 290
"ERaeHL MAL WIESO HAST DU HIER ANGEHALTEN ?",
"UND WOZU SOLLTE DRASCULA EIN MONSTER SCHAFFEN WOLLEN ?",
"WIE HEISST DU, LIEBES GERIPPE ?",
"EJ, SOLL ICH DIR NICHT VIELLEICHT WAS ZU ESSEN BRINGEN ?",
"DU HAST DOCH BESTIMMT EINEN LEEREN MAGEN, HI,HI,HI !",
+ // 295
"ICH HABE GERADE EINFACH KEINEN BOCK, ZU REDEN",
"FI........(BIEP) DICH DOCH IN DEIN BEFI.......(BIEP) KNIE, DU ALTER WI......(BIEP) !",
"ICH HABE SIE WIRKLICH GELIEBT, NAJA, GUT, SIe WAR WIRKLICH NICHT DIE HELLSTE VON OSRAM, ABER NOBODY IS PERFECT, STIMMTS ?",
"HEY SIE HATTE EINE WAHNSINNSFIGUR, UND WAS WILLST DU MEHR",
"NICHTS WIRD MEHR WIE VORHER SEIN. ICH WERDE INS KLOSTER GEHEN UND ELENDIGLICH DAHINSIECHEN.",
+ // 300
"HIER KANN MICH NICHTS UND NIEMAND MEHR RAUSHOLEN, WEIL...",
"VON WEM ? VON WEM ?",
"ICH MoeCHTE PIRAT WERDEN !",
"ICH MoeCHTE PROGRAMMIERER WERDEN !",
"ERZaeHL MIR ETWAS ueBER SIEGFRIED UND DIE NIBELUNGEN",
+ // 305
"ICH HAB EUCH NIE GESEHEN UND SPIEL JETZT EINFACH WEITER",
"WER HAT SICH DENN DIESEN SCHWACHSINN EINFALLEN LASSEN ?",
"EINE HANDTASCHE, WIE SIE MEINE OMI HAT",
"OH MANN, WIE GUT ICH AUSSEHE ! ",
"ICH KoeNNTE MICH GLATT IN MICH VERLIEBEN !",
+ // 310
"UND WIE SOLL ICH MICH ABSCHLIESSEN ?",
"ICH WERDE MICH WOHL ERSTMAL AUFSCHLIESSEN MueSSEN, WAS ?",
"HIER STEH ICH GUT",
"HAB MICH SCHON",
"HALLO ICH",
+ // 315
"BEI PASSENDER GELEGENHEIT WERDE ICH SIE MIR MAL REINTUN",
"ICH SEHE NICHTS BESONDERES",
"GUT SO",
"UND WIESOOO ?",
"ICH KANN NICHT",
+ // 320
"HALLO DU DA",
"DIE GRUFT VON ONKEL DESIDERIUS",
"HAAALLO, ONKEL DESIDEERIUUS !",
"NEIN, ICH WILL MICH NICHT SCHON WIEDER SCHNEIDEN",
"aeHEM,MMM... !",
+ // 325
"MMMM, LECKER,UaeaeHH !",
"JA, HUST,HUST !",
"HEY, GUCK MAL, HIER KLEBT EIN KAUGUMMI",
"DAS SUPERHANDILY DAS ICH ZU WEIHNACHTEN BEKOMMEN HABE",
"GANZ SCHoeN HOCH",
+ // 330
"TRITT AUF DEN BALKON, JULIA !",
"DU BIST DER STERN AN MEINEM FIRMAMENT !",
"EJ, TueR, WAS ISS LOSS ?",
"HEYHOO, TRANSSYLVANISCHES ZIGARRETTENAUTOMaeTCHEN !",
"EIN ZIGARRETTENSPENDERMASCHINCHEN",
+ // 335
"ICH HAB DA NOCHNE MueNZE DRIN",
"NEIN, ICH RAUCHE UND TRINKE NICHT MEHR",
"VON JETZT AN WERDE ICH MICH NUR NOCH DEN FRAUEN WIDMEN",
"BETRUG ! ES IST GAR NICHTS RAUSGEKOMMEN !",
"ENDLICH !",
+ // 340
"EINE TRUHE, WEITER NICHTS",
"HALLO TRUHE, DU HEISST WIE MEINE TANTE TRUDE",
"ICH HABE DIE TASCHE VON B.J. GEFUNDEN",
"MEIN GOTT, ICH SEH MICH NICHT IM SPIEGEL, ICH BIN EIN VAMPIR !",
"....ACH, NEE. ES IST NUR EIN GEMaeLDE",
+ // 345
"SPIEGLEIN, SPIEGLEIN AN DER WAND, WER IST DER SCHoeNSTE Im GANZEN LAND ?",
"ER MACHT MIR NICHT AUF",
"GUT. ICH HABE DIE OHRENSToePSEL DRIN",
"EIN VON DER UNIVERSITaeT ZU CAMBRIDGE AUSGESTELLTES VAMPIR-JaeGER DIPLOM.",
"NEIN, MIR FEHLEN NOCH EINIGE ZUTATEN, ES LOHNT SICH NICHT, IHN ZU WECKEN !",
+ // 350
"ICH HABE NaeMLICH KEIN GELD",
"EINE NORDDEUTSCHE LAMPE",
"WIRT! HELFEN SIE MIR !",
"DA STAND PLoeTZLICH EIN VAMPIR UND HAT MEINE FREUNDIN MITGENOMMEN.",
"ABER WOLLEN SIE MIR DENN NICHT HELFEN ?",
+ // 355
"TOT? WAS WOLLEN SIE DAMIT SAGEN ?",
"aeHEM !",
"EIN VAMPIR HAT DAS MaeDEL VON 506 ENTFueHRT !",
"DU MUSST MIR HELFEN !",
"KANNST DU KEIN BEERDIGUNGSLIED SPIELEN ?",
+ // 360
"WIE HaeLST DU DAS BLOSS AUS : JEDEN TAG DIE GLEICHEN LIEDER",
"AHA, UND WIE HoeRST DU MICH DANN ?",
"GIB MIR DIE OHRENSToePSEL",
"ACH KOMM, ICH GEB SIE DIR AUCH SOFORT WIEDER",
"ACH KOOOOMMM !",
+ // 365
"AUF WIEDERSEHEN. ICH MUSS EINEN VAMPIR ToeTEN",
"",
"REDEST DU AUF TRANSSYLVANISCH ODER WAS ?",
"WER IST ONKEL DESIDERIUS ?",
"WAS SOLL LOS SEIN MIT DIESEM GRAF DRASCULA ?",
+ // 370
"WER IST DIESER VON BRAUN ?",
"UND WARUM MACHT ER ES NICHT ?",
" UND WO KANN ICH VON BRAUN FINDEN ?",
"ALSO DANKE UND AUF WIEDERSEHEN, SCHLAF SCHoeN",
"WIR SOLLTeN BESSER VORHER KLINGELN",
+ // 375
"SIND SIE PROFESSOR VON BRAUN ?",
"UND SIE KoeNNTEN MIR NICHT VERRATEN, WO..... ?",
"ICH NEHM IHM NICHT AB, DASS ER HELGE SCHNEIDER IST",
"PROFESSOR!",
"HELFEN SIE MIR !ES GEHT UM DAS LEBEN MEINER GELIEBTEN !",
+ // 380
"SCHON GUT, ICH BRAUCHE IHRE HILFE NICHT",
"OK. ICH GEHE !",
"KEINE ANGST. GEMEINSAM BESIEGEN WIR DRASCULA",
"UND WARUM HELFEN SIE MIR DANN NICHT ?",
"ICH HABE SIE",
+ // 385
"ABER ICH HABE SIE DOCH !",
"EINVERSTANDEN",
"...aeHM,...JA",
"ICH GEHE DIREKT NOCHMAL INS AQUARIUM",
"ICH BIN SO WEIT, MICH IHREM TEST ZU STELLEN",
+ // 390
"SCHON GUT, ALTERCHEN. ZAHLTAG !",
"SCHON GUT. ICH WOLLTE SOWIESO GERADE GEHEN",
"TSCHULDIGE",
"WIE FINDEST DU DIESES BUCH? KLAVIERSTueCKE VON TSCHAIKOWSKY",
"WIE BRINGT MAN EINEN VAMPIR UM ?",
+ // 395
"HAT MAN DIR NICHT GESAGT WIE MAN SICH BETTET SO LIEGT MAN ?",
"GENAU DAS SAGT MEINE MUTTER IMMER ZU MIR",
"WARUM KONNTE DICH DRASCULA NICHT ERLEDIGEN ?",
"UND WAS DANN ?",
"SUPER ! DA HABEN SIE EIN IMMUNITaeTSMISCH.... !",
+ // 400
"ALSO ?",
"SEHR GUT",
"KoeNNEN SIE NOCHMAL WIEDERHOLEN WAS ICH FueR DIESE MISCHUNG BRAUCHE ?",
"DANN SATTEL ICH MAL DIE HueHNER UND BESORG ES",
"ENTSCHULDIGUNG, WO IST DER KLAVIERSPIELER ?",
+ // 405
"ICH\247HAB\247SCHON\247ALLE\247ZUTATEN\247FueR\247DIE\247MISCHUNG",
"EINE FRAGE : WAS SOLL DAS HEISSEN : REIPERK ALUCSARD?",
"SAGEN SIE SCHON...",
"UND WO SOLL DIESE GROTTE SEIN ?",
"WAS IST ? GABS BEI EUCH KEINE HEXENPROZESSE ?",
+ // 410
"...ABER WENN ICH NOCH MEHR VAMPIREN BEGEGNE ?",
"EIN VAMPIR, DER MICH NICHT DURCHLaeSST",
"ER SIEHT WIE AUS WIE JODA, NUR VIEL GRoeSSER",
"EJ, JODA. WENN DU MICH DURCHLaeSST, GEB ICH DIR ne mark",
"NA GUT, DIR KANN MAL WOHL NICHTS ERZaeHLEN",
+ // 415
"HALLO, VAMPIR, WAS FueR EINE NACHT, WAS ?",
"HAT MAN DIR SCHON MAL GESAGT, DASS DU AUSSIEHST WIE JODA ?",
"BIST DU EIN VAMPIR ODER EIN oeLGEMaeLDE ?",
"ICH HALT BESSER MEINEN MUND, SONST REGST DU DICH NOCH AUF",
"ABGESCHLOSSEN",
+ // 420
"DIE ELSTER KoeNNTE MIR EIN AUGE RAUSREISSEN, WENN ICHS VERSUCHE !",
"ZU !MEIN GOTT, WIE UNHEIMLICH !",
"DIE SCHARNIERE SIND ZUGEROSTET",
"HIER IST NUR EIN PaeCKCHEN MEHL",
"DAS HAT DEN ROST ENTFERNT",
+ // 425
"ICH HABE EINEN PFLOCK AUS FICHTENHOLZ GEFUNDEN",
"ICH NEHM DAS HIER, DAS IST SCHoeN DICK !",
"NA, ICH GLAUBE ICH KANN MICH JETZT MAL AUS DIESER DaeMLICHEN VERKLEIDUNG SCHaeLEN",
"EINGaeNGE ZU DEN SEITENFLueGELN WEGEN BAUARBEITEN GESPERRT. BENUTZEN SIE BITTE DEN HAUPTEINGANG",
"...ER IST BLASS, HAT KOMISCHE ZaeHNE, TRaeGT EIN TOUPET UND EINEN UMHANG...DAS MUSS DRASCULA SEIN !",
+ // 430
" ES IST B.J. ! B.J. ALLES O.K ?",
"ICH WEISS SCHON DASS SIE DUMM IST, ABER ICH BIN SO EINSAM",
"DU HAST BESTIMMT KEINEN SCHLueSSEL, STIMMTS ?",
"ICH WETTE, DU HAST KEINEN DIETRICH",
"GIB MIR DIE HAARSPANGE. ICH MACHS WIE MCGYVER",
+ // 435
"BEWEG DICH NICHT, ICH BIN SOFORT ZURueCK",
"VERDAMMT! ER IST MIR ABGEBROCHEN !",
"HEYJEYJEY !UND ICH HAB MICH AUCH RASIERT, ALTER !",
"JA, SCHATZ ?",
"ES REICHT NICHT",
+ // 440
"DER KLAVIERSPIELER IST NICHT DA",
"EIN TRANSSYLVANISCHER GIN-TONIC",
"ICH HABE IMMER NOCH KEIN ZIMMER",
"ES SCHEINT DASS ER IN DER BADEWANNE HaeNGENGEBLIEBEN IST UND DANN EINE KNEIPE AUFGEMACHT HAT",
"ER IST VOLL WIE EIN RUSSE",
+ // 445
"DIESES HAAR.... TJA,ES ERINNERT MICH AN JEMANDEN",
"ES IST EIN KNoeCHRIGES GERIPPE",
"GUCK MAL ! BRAD PITT!",
"ER SCHLaeFT. ES WaeRE WIRKLICH SCHADE, IHN ZU WECKEN",
"ER IST HaeSSLICHER ALS DIDI HALLERVORDEN",
+ // 450
"EIN SARG AUS FICHTENHOLZ",
"ER WIRD MICH IN LECKERE KLEINE SCHEIBCHEN SCHNEIDEN",
"ICH STEH NICHT SO AUF PENDEL. ICH FIND OHRFEIGEN BESSER",
"ICH KANN NICHT. ICH HAB HANDSCHELLEN AN",
"DAS SIEHT DOCH JEDER, DASS DAS EINE GEHEIMTueR IST",
+ // 455
"SIE IGNORIEREN MICH",
"ACH KOMM !",
"LAUT DREHBUCH BEWEGE ich mich, ABER das Spiel war so teuer, dass nichts mehr FueR EIN FITNESS-STUDIO ueBRIG war, also habe ich auch keinen strammen arsch.",
"SCHEINT SO, ALS OB ER EIN BISSCHEN LOSE AN DER WAND HaeNGT",
"ICH GLAUBE KAUM, DASS SIE MIR NueTZEN WIRD. SIE IST VIEL ZU FEUCHT, UM SIE ANZUZueNDEN",
+ // 460
"ZUM WESTFLueGEL ?ICH BIN DOCH NICHT BLoeD !WER WEISS WAS MICH DA ERWARTET !",
"MIT HueBSCHEN TRANSSYLVANISCHEN MOTIVEN",
"",
"WIE SCHADE, DASS DAS DA KEIN LECKERER LAMMBRATEN DRIN IST.",
"ALS ICH BEIM LETZTEN MAL IN EINEN OFEN GEGUCKT HABE, IST DAS HAUS IN DIE LUFT GEFLOGEN",
+ // 465
"DAS IST DAS WAPPEN DER TRANSSYLVANISCHEN FUSSBALLMANNSCHAFT",
"UND WOZU? SOLL ICH MIR DAS ANS KNIE BINDEN ?",
"DIESE SORTE SCHUBLADE LaeSST SICH NICHT oeFFNEN",
"ICH MoeCHTE ECHT NICHT WISSEN, WAS ES DA DRIN ZU ESSEN GIBT!",
"DAS WIRKT ZIEMLICH IMPRESSIONISTISCH AUF MICH",
+ // 470
"DIE NACHT VERSCHLUCKT ALLES... WIE UNHEIMLICH, WAS?",
"SIE KLEMMT",
"DER KoeNIG HAST DU DIR DAS NICHT DENKEN KoeNNEN?",
"NEIN, ICH HAB SCHON EINEN ZU HAUSE, DEN ICH FueTTERE UND SO",
"EIN REGAL MIT BueCHERN UND ANDEREN SACHEN",
+ // 475
"UND WEN SOLL ICH UM DIESE UHRZEIT NOCH ANRUFEN?",
"\"EINKOMMENSERKLaeRUNG LEICHT GEMACHT\" WIE INTERESSANT!",
"ICH HAB SCHON EINS ZU HAUSE.ICH GLAUBE DAS IST WELTWEIT EIN BESTSELLER",
"EIN TOTAL NORMALER SCHLueSSEL",
"ICH GLAUBE, DER GEHoeRT HIER NICHT HIN",
+ // 480
"HEY, DIE FRITTEN SEHEN AUS WIE ECKZaeHNE! ICH BIN HIN UND WEG",
"das ist wohl echt nicht DER moment, RUMZUNASCHEN, WENN MEINE FREUNDIN IN DEN KLAUEN DER fiesesten ausgeburt der Welt ist.",
"WAS FueR EINE RIESENGAUDI DAS MACHT, DAMIT VAMPIRE FERTIGZUMACHEN!",
"MAL GUCKEN, OB NOCH EINER AUFTAUCHT",
"NEIN, ES MUSS MIT NOCH SO EINEM DRECKIGEN, STINKENDEN UND NERVIGEN VAMPIR WIE VORHIN SEIN",
+ // 485
"DAS IST DIE ORIGINALPERueCKE VON ELIVS ALS ER SCHON EINE GLATZE HATTE",
"MEHL, ABER ICH KANN JETZT KEINE MARKEN NENNEN",
"VIELLEICHT EIN ANDERES MAL, OK?",
"EINE WUNDERSCHoeNE AXT. ZU SCHADE, DASS GERADE KEIN VAMPIRKOPF IN DER NaeHE IST",
"NEIN, IM GRUNDE BIN ICH EIN NETTER MENSCH",
+ // 490
"DAS IST DAS DEO VON MAGGIE THATCHER, HIHIHI!",
"EIN ZIEMLICH HueBSCHER UMHANG",
"",
"WIE JEDER BELIEBIGE AST EINES BELIEBIGEN BAUMES AN JEDEM BELIEBIGEN ORT IN DER WELT, NICHTS BESONDERES ALSO",
"\"UNGLAUBLICH\" EIN SEIL IN EINEM VIDEOSPIEL!",
+ // 495
"WOZU DAS WOHL NOCH GUT SEIN WIRD...",
"EIN SEIL AN EINEM AST ODER EIN AST AN EINEM SEIL, JE NACHDEM WIE MAN DAS SO BETRACHTET",
"ES SCHEINT, DAS DIESE ELSTER WAS ueBLES IM SCHILDE FueHRT",
"ZISCH AB, ICH SAG IHR NICHTS, MAL SEHEN OB SIE AUSFLIPPT",
"SIEHT SO AUS ALS WaeRE SIE TOT, ABER STIMMT NICHT,NE?",
+ // 500
"FueR DIESES SPIEL WURDEN KEINE TIERE MISSHANDELT ODER GEToeTET",
},
{
+ // 0
"",
"C'EST LA DEUXI\212ME PORTE PLUS GRANDE QUE J'AI VUE DANS MA VIE.",
"ENFIN, PAS AUTANT QUE \207A.",
"ELLE EST BOUCH\202E AVEC DES GROSSES PLANCHES. L'\202GLISE EST PEUT-\210TRE ABANDONN\202E DEPUIS QUELQUES ANN\202ES.",
"MAIS JE NE L'AI PAS OUVERTE.",
+ // 5
"QU'EST-CE QUE JE FAIS? JE L'ARRACHE?",
"BONJOUR, PORTE. JE VAIS T'ENCADRER.",
"C'EST TROP POUR MOI.",
"UNE FEN\210TRE BOUCH\202E AUX GROSSES PLANCHES.",
"JE N'ARRIVE PAS.",
+ // 10
"\200A Y EST.",
"ET POURQUOI?",
"SALUT, FEN\210TRE! AS-TU QUELQUE CHOSE \205 FAIRE CE SOIR?",
"PAS SANS LE PERMIS DE TRAVAUX PUBLIQUES.",
"H\202! CETTE FEN\210TRE A SEULEMENT UNE GROSSE PLANCHE...",
+ // 15
"OH\202! OH\202!-FEN\210TRE!",
"BONJOUR, TOI.",
"",
"JE N'ARRIVE PAS.",
"C'EST BIEN O\227 ELLE EST.",
+ // 20
"",
"C'EST UNE TOMBE EN FORME DE CROIX.",
"NON, MERCI.",
"BONJOUR, LE D\202FUNT: VEUX-TU DES VERMISSEAUX?",
"MAIS OUI. COMME EN POLTERGUEIST.",
+ // 25
"",
"",
"JE REVIENS EN QUINZE MINUTES.",
"D\202FENSE D'AFFICHER.",
"",
+ // 30
"C'EST FERM\202 \205 CL\202.",
"J'EN AI D\202J\205 UN.",
"",
"IL NE R\202POND PAS.",
"MAIS NON, C'EST BIEN GAR\202.",
+ // 35
"C'EST UNE PORTE.",
"UN TIROIR DE LA TABLE.",
"UNE ARMOIRE SUSPECTE.",
"BONJOUR, L'ARMOIRE. \200A VA?",
"",
+ // 40
"",
"C'EST UN CAND\202LABRE TR\212S VIEUX.",
"IL DOIT \210TRE L\205 D\212S QUE MAZINGUER-Z \202TAIT UNE VIS.",
"NON, C'EST UNE RELIQUE.",
"C'EST UN JOLI R\202TABLE.",
+ // 45
"",
"HI! HI! HI!",
"",
"NON.",
"",
+ // 50
"HA! HA! HA! -QUE C'EST BON!",
"",
"",
"",
"JE NE VOIS RIEN DE SP\202CIAL.",
+ // 55
"C'EST FERNAN, LA PLANTE.",
"C'EST UNE DES PIQUES DE LA GRILLE.",
"H\202! L\205-DESSOUS IL Y A UNE BO\214TE D'ALLUMETTES.",
"REGARDE! UN PAQUET DE CLINEX. -ET IL Y A UN TOUT NEUF!",
"IL N'Y A RIEN DE PLUS DANS LE SEAU.",
+ // 60
"C'EST UN AVEUGLE QUI VE VOIT PAS.",
"",
"",
"",
"",
+ // 65
"C'EST UNE GROSSE SOMME D'ARGENT.",
"",
"",
"",
"",
+ // 70
"",
"",
"",
"",
"",
+ // 75
"",
"",
"",
"",
"",
+ // 80
"",
"",
"",
"",
"",
+ // 85
"",
"",
"",
"",
"",
+ // 90
"",
"",
"",
"",
"",
+ // 95
"",
"",
"",
"",
"",
+ // 100
"ELLE N'A RIEN DE SP\220CIAL",
"CELA N'A RIEN D'EXTRAORDINAIRE",
"QU'EST-CE QU'IL Y A?",
"BONJOUR!",
"RIEN DE NOUVEAU?",
+ // 105
"LA FAMILLE, \200A VA?",
"-QUELLES CHOSES TU AS!",
"MAIS, COMME JE VAIS PRENDRE CELA!",
"MA RELIGION ME L'INTERDIT",
"CE N'EST PAS MIEUX",
+ // 110
"BIEN S\352R, MON VIEUX!",
"ON NE PARLE PLUS DE CELA",
"IMPOSSIBLE",
"CELA NE S'OUVRE PAS",
"JE NE PEUX PAS TOUT SEUL",
+ // 115
"SI JE VOULAIS, J' ARRIVERAIS, MAIS \200A ME DONNE DE LA PARESSE",
"JE N'Y VOIT PAS UNE RAISON APPARENTE",
"C'EST UN CERVEAU ASSEZ BIEN",
"ET BIEN CERVEAU, QUE PENSES-TU FAIRE CE SOIR?",
"NON, ON DOIT LE GARDER DANS UN ENDROIT \267 L'ABRI DES MUTATIONS DE L'ATMOSPH\324RE",
+ // 120
"C'EST UN DUR, COMME MON CHEF",
"C'EST UN PIEU TR\324S AIGUIS\220",
"FID\324LE PIEU POINTUUU, NOBLE CH\322NE TRANSYLVAAAN",
"TIENS! JE DOIS COUPER MES ONGLES!",
"B.J. EST L\267-DEDANS. ET QUELLE EST MIGNONE CETTE NANA!",
+ // 125
"ELLE EST FERM\220E TR\324S SOLIDEMENT",
"\"CADENAS SOLIDES S.A.\"",
"C'EST LE TYPIQUE SQUELETTE QU'ON TROUVE DANS LES GE\342LES DE TOUS LES JEUX",
"ON L' EMPLOIE NORMALEMENT POUR INDUIR DU COURANT \220LECTRIQUE AUX APPAREILS QU'Y SONT RACCORD\220S",
"C'EST ABSOLUMENT ARTISANAL, CAR LES JAPONAIS LES FONT MAINTENANT DE POCHE",
+ // 130
"J'AI SEULEMENT VU DANS MA VIE UNE CHOSE SI MOCHE",
"LAISSE. JE NE LUI DIS RIEN POUR S'IL SE F\266CHE",
"IL SEMBLE ASSEZ RATIONNEL",
"C'EST UNE PHOTO DE PLATON EN TRAIN D'\220CRIRE SON DIALOGUE PERDU",
"JE NE SUIS PAS DE CEUX QUI PARLENT AUX POSTERS",
+ // 135
"UN BUREAU ASSEZ MIGNON",
"C'EST UN DIPL\342ME DE CHASSE-CHASSE-VAMPIRES HOMOLOGU\220 PAR L'UNIVERSIT\220 D'OXFORD",
"C'EST UNE NUIT NOIRE AU PLEINE LUNE",
"IL PARA\327T QUE CES VIS NE SONT PAS TR\324S ENFONC\220ES",
"N'Y REGARDES PAS, MAIS JE CROIS QU'UNE CAM\220RA OCCULTE ME VISE",
+ // 140
"UN D\220TECTEUR DE PIEUX ASSEZ MODERNE",
"NON, LE LABORATOIRE EST AU DEUXI\324ME \220TAGE",
"UNE JOLIE TABLE DE NUIT",
"C'EST UN TAS D'ARGENT QUI NE PEUT PAS MANQUER DANS UNE AVENTURE DIGNE DE TEL NOM",
"SI J'\220TAIS RICHE. DUBIDOUDUBIDOUDUBIDOUDUBIDOU",
+ // 145
"CE SONT DES FEUILLES BIZARRES. ON A D\352 LES AMENER DE L'AM\220RIQUE DU SUD OU PAR L\267",
"JE NE PENSE PAS QU'ILS VONT ME R\220PONDRE",
"C'EST UN JOLI CRUCIFIX EN BOIS. L'IC\342NE N'ARRIVE PAS \267 SAISIR TOUT LA SPLENDEUR DE SA BEAUT\220",
"JE PRIE SEULEMENT AVANT DE ME COUCHER",
"H\220!, IL PARA\327T QUE CETTE PIQUE S'EST UN PETIT PEU D\220CROCH\220E",
+ // 150
"TU NE POURRAS TE PLAIGNER APR\324S DU PEU DE PISTES QUE JE TE DONNE",
"C'EST UNE PIQUE ASSEZ CONVENTIONNELLE",
"ILS SONT MIGNONS, MAIS UN PEU SALES",
"NON, NON, ILS NE ME \220COUTERAIENT PAS. HI, HI, HI -QUE C'EST BON!",
"\"LA BELLE DORMANTE DU BOIS\" DE TCHA\330KOVSKI, OU TCHA\330FROSKI, OU N'IMPORTE COMMENT DIT-ON ",
+ // 155
"TR\324S APP\220TISSANT",
"JE NE SUIS PAS DE CEUX QUI SUCCENT DES CHEWING-GUMS D\220J\267 M\266CH\220S",
"UNE FAUCILLE TR\324S MIGNONE. jE ME DEMANDE O\353 SERA LE MARTEAU?",
"\"LES FABRICANTS DE TABAC AVERTISSENT QUE LES AUTORIT\220S SANITAIRES SONT S\220RIEUSEMENT NUISIBLES POUR LA SANT\220 \"",
"UNE BOUGIE COURANTE ET NORMALE ET AVEC DE LA CIRE M\322ME",
+ // 160
"IL FAUT VOIR COMME ELLES LUISENT CES DEUX RUTILANTES MONNAIES!",
"IL FAUT VOIR COMME ELLE LUIT CETTE RUTILANTE MONNAIE!",
"AVEC \200A JE SERAI IMMUNIS\220 CONTRE LES MORSURES DES VAMPIRES",
"NON, CE N'EST PAS ENCORE LE MOMENT",
"IL Y A UN BILLET DE MILLE ET DEUX SOUS",
+ // 165
"ON DIT\"VOUS \322TES PRI\220S DE NE PAS DONNER \267 MANGER AU PIANISTE\"",
"L'OMELETTE, 200. DES PETITS POISSONS FRITS, 150, DES POMMES A\330OLI, 225",
"LES MEILLEURES HAMBURGERS DE CE C\342T\220 DU DANUBE, SEULEMENT 325",
"C'EST UNE JOLIE T\322TE DE MORT AU REGARD TR\324S PER\200ANT -HI, HI, HI, QUE C'EST BON!",
"BONJOUR T\322TE DE MORT, TU ME RAPPELLES L'ONCLE HAMLET",
+ // 170
"J'AI LA HABITUDE DE NE PAS TOUCHER AUX CHOSES QUI ONT V\220CU AUTREFOIS",
"C'EST UNE POUBELLE",
"C'EST UNE MASSUE POUR LE MATCH DE CE SOIR",
"JE ME DEMANDE CE QU'IL AURA DERRI\324RE",
"H\220, CE RIDEAU NE BOUGE PAS!",
+ // 175
"TIENS, QUEL CH\266TEAU SI SOMBRE, H\220? ",
"JE NE PEUX PAS, IL EST TROP LOIN POUR M'ENTENDRE",
"C'EST UNE TYPIQUE FOR\322T TRANSYLVANE, AVEC DES ARBRES",
"MAIS TU NE DIS QUE DES B\322TISES, C'EST UN LIEU OBSCUR!",
"CONFISERIE GARCIA, G\266TEAUX ET CHEWING-GUMS.",
+ // 180
"UNE PORTE TR\324S JOLIE",
"ELLE EST FERM\220E",
"UN TONNEAU COMPL\324TEMENT FERM\220",
"",
"QUELLES BESTIOLES SI MIGNONES!",
+ // 185
"BSSST, BSSST, PETIT CHAT...",
"IL NE R\220POND PAS",
"LA LUNE EST UN SATELLITE TOURNANT AUTOUR DE LA TERRE AVEC UNE P\220RIODE DE ROTATION DE 28 JOURS",
"SALUT, LUNE!, LUN\220E ET \220TOURDIE ",
"ELLE EST COMPL\324TEMENT BOUCH\220E AVEC DES GROSSES PLANCHES",
+ // 190
"C'EST IMPOSSIBLE, CECI NE L'OUVRE PAS NI LE MAJORDOME DE LA T\220L\220",
"H\220, IL PARA\327T QUE L'OMBRE DE CE CYPR\324S-LA EST ALLONG\220E",
"OH\220! H\342TELIEEER!",
"JE VOUDRAIS UNE CHAMBRE",
"SAVEZ-VOUS O\353 EST QUE JE PEUX TROUVER UN TEL COMTE DRASCULA?",
+ // 195
"OUI, QU'EST-CE QU'IL Y A? ",
"ET \200A?",
"EN... EN V\220RIT\220?",
"UNE BONNE QUESTION, JE VAIS VOUS RACONTER MON HISTOIRE, TIENS...",
"JE N'AI QUE POUR CINQ MINUTES",
+ // 200
"JE M'APPELLE JOHN HACKER ET SUIS LE REPR\220SENTANT D'UNE INMOBILI\324RE BRITANNIQUE",
"IL PARA\327T QUE LE COMTE DRASCULA VEUT ACHETER DES TERRAINS \267 GIBRALTAR ET ON M'A ENVOY\220 POUR N\220GOCIER L'AFFAIRE",
"MAIS JE PENSE QUE DEMAIN DE BONNE HEURE JE RETOURNE AVEC MA MAMAN",
"UNE BELLE NUIT, N'EST-CE PAS?",
"NON, RIEN",
+ // 205
"OH\220! PIANISTE!",
"UNE BELLE NUIT",
"ET EN PLUS, IL NE FAIT PAS FROID",
"EH BIEN, RIEN. CONTINUE \267 JOUER",
"C'EST \200A",
+ // 210
"BONJOUR CHEF, \200A VA?",
"ET LA FAMILLE?",
"IL Y A DE L'AMBIANCE ICI, H\220?",
"TANT MIEUX SI JE NE DIS RIEN",
"ON EST MIEUX CHEZ-SOI QU'AILLEURS... ON EST MIEUX DANS... H\220? MAIS VOUS N'\322TES PAS TANTE EMMA. MIEUX ENCORE. -SI JE N'AI PAS AUCUNE TANTE EMMA!",
+ // 215
"OUI, LE MIEN AUSSI. VOUS POUVEZ M'APPELLER COMME VOUS VOULEZ, MAIS SI VOUS M'APPELLEZ JOHNY, JE VIENS COMME LES CHIENS",
"OUI, QUELS COUPS QUE J'AI, N'EST-CE PAS? EN FAIT, O\353 SUIS-JE?",
"OUI",
"A\330E!, A\330E!...",
"OH, OUI! BIEN S\352R",
+ // 220
"EH BIEN! MERCI BEAUCOUP POUR TON AIDE. JE NE TE D\220RANGE PLUS SI TU ME DIS O\353 SE TROUVE LA PORTE, S'IL TE PLA\327T...",
"CAR LE COUP A D\352 ME TOUCHER LA CERVELLE ET JE N'Y VOIS GOUTTE",
"BAH!, \200A FAIT RIEN. J'AI TOUJOURS UNE DE R\220CHANGE",
"OUAH, QUELLE BELLE FEMME! -JE NE M'AVAIS PAS RENDU COMPTE! BIEN S\352R, SANS LES LUNETTES...",
"\220COUTE...",
+ // 225
"ET \200AAAAAA?!",
"NE T'EN FAIS PAS B. J., MON AMOUR! JE VAIS TE SAUVER DES GRIFFES DE CELUI-L\267 ",
"IL ME CASSE LE NEZ, TIENS!",
"AHHH, UN HOMME-LOUP! MEURS MAUDIT!",
"OUI, C'EST CELA...",
+ // 230
"OUI, C'EST CELA... JE CROIS QUE JE VAIS SUIVRE MON CHEMIN. PARDON.. ",
"QUOI?",
"EH BIEN, EN V\220RIT\220, BIEN PENS\220... JE NE CROIS PAS",
"DIS -MOI, OH! \220RUDITE PHILOSOPHE! Y A-T-IL UNE R\220LATION CAUSE-EFFET ENTRE LA VITESSE ET LE LARD?",
"\200A VA, \200A VA, ABANDONNE. EN TOUT CAS, JE NE SAIS PAS POURQUOI JE L'AI DIT.",
+ // 235
"QU'EST-CE QUE TU FAIS ICI EN TRAIN DE PHILOSOPHER AU LIEU DE MANGER DU MONDE?",
"QU'EST-CE QUE C'EST QUE \200A?",
"\220COUTE, PEX-TU R\220P\220TER CETTE PHRASE DES \"INCLINATIONS PR\220-\220VOLUTIVES\"?",
"BIEN S\352R, MON VIEUX. CETTE HISTOITE QUE TU M'AS LACH\220E AVANT. CE QUE JE N'AI PAS BIEN COMPRIS...",
"NON, LE MIEUX SERA DE NE RIEN DIRE. CAR SI JE LE TOUCHE LA VEINE.....",
+ // 240
"OUI, QUE SE PASSE-T-IL?",
"OUI, QU'EST-CE QU'IL Y A? ",
"EH BIEN, MAINTENANT QU'IL ABORDE LE SUJET JE LUI DIRAI QUE...",
"",
"EN FAIT, QU'ARRIVERAIT-IL SI UN VAMPIRE SE POURVOYAIT DE LA FORMULE PAR HASARD... ",
+ // 245
"EH BIEN, RIEN. \220COUTE, CECI NE TE SEMBLE PAS UN RAVAUDAGE QU'ON A MIS EN SC\324NE POUR EN FINIR T\342T AVEC LE JEU? BON, PEUT-\322TRE PAS",
"C'EST VIDE!",
"POURQUOI TU M'AS VOL\220 MON AMOUR. B.J. SI ELLE N'EST PAS L\267, LA VIE N'AS PAS DE SENS POUR MOI",
"SON CERVEAU?!",
"CE N'EST POUR RIEN, MAIS JE CROIS QUE TON PETIT MONSTRE M'A F\266CH\220",
+ // 250
"MA VIERGE, QUE JE RESTE TEL QUE JE SUIS!",
"TU N'AURAS PAS LE DERNIER MOT. C'EST S\352R QUE MAINTENANT APPARA\327T SUPER-LOPEZ ET ME LIB\324RE!",
"QUELLE MERDE DE JEU DONT MEURT LE PROTAGONISTE!",
"UN INSTANT, QU'Y A-T-IL DE MON DERNIER D\220SIR?",
"HA! HA! MAINTENANT JE SUIS IMMUNIS\220 CONTRE TOI, D\220MON MAUDIT. CETTE CIGARETTE EST UNE POTION ANTI-VAMPIRES QUI M'A DONN\220 VON BRAUN ",
+ // 255
"OUI, C'EST S\352R, MAIS TU N'OBTIENDRAS JAMAIS DE MOI LA FORMULE",
"JE PEUX SUPPORTER LA TORTURE, ET ENCORE LA CR\220ER ",
"NON, S'IL VOUS PLA\327T, JE PARLERAI, MAIS NE ME FAITES PAS \200A!",
"EH BIEN. JE T'AI D\220J\267 DIT CE QUE TU VOULAIS SAVOIR. MAINTENANT D\220LIVRE-NOUS, B.J. ET MOI, ET FICHEZ-NOUS LA PAIX",
"B.J.! QU'EST-CE QUE TU FAIS L\267? DRASCULA, O\353 EST-IL?",
+ // 260
"QU'IL EST M\220CHANT! C'EST SEULEMENT PAR-CE QU'IL APPARTIENT \267 LA NOBLESSE QU'IL CROIT POUVOIR EXERCER LE DROIT DE GAMBADE AVEC N'IMPORTE QUI",
"\267 BAS L'ARISTOCRATIE ARBITRAIRE!",
"DEBOUT LES PAUVRES DU MOOONDE....!",
"ET D'APR\324S CE QUE JE VOIS ON T'A ENCHA\327N\220 AVEC CADENAS ET TOUT",
"BON, \200A VA. N'AURAS-TU PAS UNE \220PINGLE?",
+ // 265
"BON, BON, NE T'EN FAIS PAS COMME \200A. JE PENSERAI \267 QUELQUE CHOSE.",
"H\220! TAVERNIER!",
"COMMENT VA LE MATCH?",
"QUI EST-CE?",
"NE VOIS-TU PAS QUE DRASCULA EST ICI?",
+ // 270
"ALORS, ON VA FINIR AVEC LUI, NON?",
"SERS -MOI UN COUP...",
"RIEN. J'AI OUBLI\220 CE QUE J'ALLAIS TE DIRE",
"OU\207BIEN\207TU\207ME\207SERS\207UN\207COUP\207OU\207JE\207ME\207METS\207\267\207JOUER\207DU\207PIANO",
"COMBIEN IL RESTE POUR QUE LE MATCH FINISSE?",
+ // 275
"BON SOIR",
"COMME VAS-TU, IGOR? BOSSU? -HI! HI! HI! QUE C'EST BON! ",
"QU'EST-CE QU'ON SUPPOSE QUE TU FAIS?",
"EH BIEN, NON!",
"ALORS, METS-TOI DES LUNETTES",
+ // 280
"QU'EST QUE C'EST QU'UNE ORGIE SURNATURELLE?",
"\200A VA, \200A VA, ARR\322TE-TOI. JE ME FAIS D\220J\267 UNE ID\220E",
"NE POURRAIS-TU PAS ME DIRE O\353 SE TROUVE DRASCULA? ",
"ALLONS, S'IL TE PLA\327T",
"POURQUOI PAS?",
+ // 285
"AH! MAIS IL DORME PENDANT LA NUIT?",
"EH BIEN! QUE LA RENTE SE DONNE BIEN",
"CE QUE JE DOIS LUI PARLER",
"OH\220! SQUELEEETTE! ",
"SAPRISTI! -UN SQUELETTE QUI PARLE!",
+ // 290
"RACONTE-MOI, COMMENT EST-TU VENU JUSQU'ICI?",
"ET POUR QUELLE RAISON VOUDRAIT DRASCULA CR\220ER UN MONSTRE? ",
"COMMENT T'APPELLES-TU, AMI SQUELETTE?",
"\220COUTE, VEUX-TU QUE JE T'APPORTE QUELQUE CHOSE \267 MANGER?",
"TU DOIS AVOIR L'ESTOMAC VIDE. -HI! HI! HI!",
+ // 295
"VRAIMENT JE N'AI PAS ENVIE DE PARLER MAINTENANT",
"MON DIEU! (SIFFLEMENT) J'ESP\324RE QUE...(SIFFLEMENT) ET QUE...(SIFFLEMENT) DEUX FOIS!",
"J'AI L'AIM\220E VRAIMENT. \200A VA, JE SUIS D'ACCORD, IL N'\220TAIT PAS UN G\220NIE, MAIS PERSONNE EST PARFAIT, N'EST-CE PAS? ",
"DE PLUS, ELLE AVAIT UNE FIGURE \220POUSTOUFLANTE ",
"JE NE SERAI PLUS LE M\322ME. JE VAIS M'ENFERMER DANS UN MONAST\324RE POUR VOIR FUIR MA VIE LENTEMENT",
+ // 300
"RIEN NE POURRA M'EN SORTIR D\220J\267 DE CETTE MIS\324RE PARCE QUE...",
"DE QUI? DE QUI?",
"JE VEUX \322TRE UN PIRATE",
"JE VEUX \322TRE PROGRAMMEUR",
"RACONTEZ-MOI QUELQUE CHOSE SUR PELAYO",
+ // 305
"JE CONTINUERAI \267 JOUER ET J'OUBLIERAI QUE VOUS AI VU ",
"QUI AURA PENS\220 \267 CETTE B\322TISE?",
"C'EST UN SAC COMME CELUI DE MA GRANDE-M\324RE",
"MAIS QUE JE SUIS BEAU!",
"PLUS JE ME REGARDE PLUS JE ME PLAIS",
+ // 310
"ET APR\324S COMMENT JE ME FERME?",
"IL FAUDRA QUE M'OUVRE D'ABORD, NON?",
"JE SUIS BIEN O\353 JE SUIS",
"JE M'AI D\220J\267",
"SALUT, MOI!",
+ // 315
"JE VAIS ME LES METTRE \267 TEMPS",
"JE NE VOIS RIEN DE SP\220CIAL",
"C'EST BIEN O\353 IL EST",
"ET POURQUOI FAIRE?",
"JE NE PEUX PAS",
+ // 320
"SALUT, TOI!",
"C'EST LE PANTH\220ON DE L'ONCLE D\220SIR\220",
"OH\220! ONCLE D\220SIR\220\220\220\220!",
"NON, JE NE VEUX PAS ME COUPER ENCORE UNE FOIS",
"HEM! HEM!...!",
+ // 325
"YAMM, HEMMM, JH!",
"OUI, COF,COF!",
"TIENS, IL Y A ICI UN CHEWING-GUM COLL\220",
"C'EST LE MOVILANI, LE CADEAU QUI M'ONT DONN\220 POUR NO\323L",
"QUE C'EST HAUT!",
+ // 330
"SORS DANS LE BALCON JULIETTE!",
"TU EST LA LUMI\324RE QUI \220CLAIRE MON CHEMIN!",
"H\220, PORTE! QU'EST-CE QU'IL Y A?",
"OH\220! MACHINE \267 TABAC DE TRANSYLVANIIIE",
"C'EST UNE MACHINE \267 D\220BIT DE TABAC",
+ // 335
"J'AI UNE AUTRE MONNAIE L\267 -DEDANS",
"NON, J'AI D\220CID\220 ABANDONNER LE TABAC ET L'ALCOOL",
"D\324S MAINTENANT JE VAIS ME CONSACRER SEULEMENT AUX FEMMES",
"C'EST UN VOL! RIEN EST SORTI!",
"ENFIN! ",
+ // 340
"C'EST \200A, UN BAHUT",
"SALUT, BAHUT! TU T'APPELLES COMME MON COUSIN, QUI S'APPELLE RAUL",
"J'AI TROUV\220 LE SAC DE B.J..",
"MON DIEU! JE N'Y ME VOIS PAS -SUIS UN VAMPIRE!",
"...AH, NON! CE N'EST QU'UN DESSIN!",
+ // 345
"PETIT MIROIR: \"C'EST QUI LE PLUS BEAU DU ROYAUME?\"",
"IL NE VEUT PAS M'OUVRIR",
"TR\324S BIEN. J'AI MIS LES TAMPONS",
"C'EST UN DIPL\342ME DE CHASSE-VAMPIRES HOMOLOGU\220 PAR L'UNIVERSIT\220 DE CAMBRIDGE",
"NON, IL ME FAUT ENCORE D'INGR\220DIENTS, PAS LA PEINE DE LUI REVEILLER",
+ // 350
"C'EST QUE JE SUIS FAUCH\220",
"C'EST UNE LAMPE BRITANNIQUE",
"TAVERNIER! -AIDEZ-MOI!",
"UN VAMPIRE EST APPARU ET IL A ENLEV\220 MA FIANC\220E",
"MAIS, N'ALLEZ VOUS PAS M'AIDER?!",
+ // 355
"MORTE? QUE VOULEZ-VOUS DIRE?",
"HEM!",
"UN VAMPIRE A S\220QUESTR\220E LA FILLE DE LA 506!",
"IL FAUT QUE TU M'AIDES!",
"TU NE SAIS PAS JOUER AUCUNE PI\324CE DES INHUMAINS?",
+ // 360
"COMMENT TU TE SUPPORTES TOUT LE JOUR EN JOUANT LA M\322ME CHOSE?",
"ET ALORS, POURQUOI TU M'\220COUTES?",
"PR\322TE-MOI LES TAMPONS",
"ALLONS! JE VAIS TE LES REDONNER TOUT DE SUITE",
- "ALLOOONSSS..."
+ "ALLOOONSSS...",
+ // 365
"AU REVOIR. JE DOIS TUER UN VAMPIRE",
"",
"EN QUOI TU PARLES! EN TRANSYLVAN?",
"C'EST QUI L'ONCLE D\220SIR\220?",
"MAIS QU'EST-CE QU'IL Y A AVEC CE DRASCULA-L\267?",
+ // 370
"QUI EST-CE CE VON BRAUN-L\267?",
"ET POURQUOI IL NE LE FAIT PAS?",
"ET O\353 PEUX-JE TROUVER VON BRAUN?",
"EH BIEN, MERCI ET AU REVOIR. QUE TU LA DORMES BIEN",
"IL VAUDRA MIEUX SONNER D'ABORD",
+ // 375
"LE PROFESSEUR VON BRAUN, C'EST VOUS?",
"ET NE POUVEZ-VOUS PAS M'INDIQUER O\353 JE PEUX...?",
"JE NE CROIS PAS QU'IL SOIT LE NAIN GANYM\324DE",
"PROFESSEUR!",
"AIDEZ-MOI! -LA VIE DE MA BIEN AIM\220E DEPENDE DE VOUS!",
+ // 380
"\200A VA, JE N'AI PAS BESOIN DE VOTRE AIDE",
"D'ACCORD. JE M'EN VAIS",
"N'AIES PAS PEUR. NOUS ALLONS VAINCRE DRASCULA ENSEMBLE",
"ALORS, POURQUOI NE M'AIDEZ VOUS PAS?",
"JE LES AI",
+ // 385
"OUI, JE LES AI!",
"D'ACCORD",
"...ER ...OUI",
"JE VIENS POUR RENTRER DANS CETTE CABINE",
"SUIS PR\322T \267 CONFRONTER VOTRE \220PREUVE",
+ // 390
"\200A VA, VIEUX RIDICULE. JE SUIS VENU CHERCHER MON ARGENT",
"NON, RIEN. JE M'EN ALLAIS D\220J\267",
"PARDONNE-MOI",
"CE LIVRE T'INT\220RESSE? AVEZ-VOUS DES PARTITIONS DE TCHA\330KOVSKY?",
"COMMENT PEUX-JE TUER UN VAMPIRE?",
+ // 395
"ON NE T'A JAMAIS DIT QUE C'EST MAUVAIS DORMIR DANS UNE MAUVAISE POSTURE?",
"EH BIEN, C'EST \200A QUE MA M\324RE ME DIT TOUJOURS",
"POURQUOI DRASCULA N'A PU JAMAIS TE TUER?",
"ET QU'EST-CE QUE S'EST PASS\220?",
"C'EST SUPER! -AVEZ-VOUS UNE POTION D'IMMUNIT...!",
+ // 400
"ALORS?",
"TR\324S BIEN",
"POUVEZ-VOUS ME R\220P\220TER CE DONT J'AI BESOIN POUR CETTE POTION?",
"EH BIEN! JE PARS RAPIDE LE CHERCHER",
"\220COUTEZ, QU'EST-CE QUE C'EST PASSE\220 AVEC LE PIANISTE?",
+ // 405
"J'AI\207D\220J\267\207TOUS\207LES\207INGR\220DIENTS\207DE\207CETTE\207POTION",
"UNE QUESTION: QU'EST.CE QUE C'EST CELA D' ALUCSARD ETEREUM?",
"PARLEZ, PARLEZ... ",
"ET C'EST O\353 CETTE GROTTE?",
"QU'EST-CE QU'IL Y A? N'AVIEZ VOUS PAS UN TRIBUNAL?",
+ // 410
"...MAIS ...ET SI JE TROUVE ENCORE DES VAMPIRES?",
"C'EST UN VAMPIRE QUI M'EMP\322CHE L'ENTR\220E",
"IL RESSEMBLE \267 YODA, MAIS C'EST UN PEU PLUS GRAND",
"H\220, YODA! SI TU ME LAISSES PASSER JE TE DONNE UNE MONNAIE",
"BON, \200A VA. ON NE PEUT RIEN TE DIRE",
+ // 415
"H\220, VAMPIRE! BELLE NUIT, N'EST-CE PAS?",
"ON T'A D\220J\267 DIT QUE TU RESSEMBLES \267 YODA?",
"ES-TU UN VAMPIRE OU UNE PEINTURE \267 L'HUILE?",
"IL VAUX MIEUX NE RIEN TE DIRE, POUR SI TU TE F\266CHES",
"C'EST FERM\220E \267 CL\220",
+ // 420
"LA PIE POURRAIT M'ARRACHER UN OEIL SI J'EN ESSAIE!",
"C'EST FERM\220E! -MON DIEU, QUELLE PEUR!",
"LES GONDS SONT OXYD\220S",
"L\267-DEDANS IL Y A SEULEMENT UN POT AVEC DE LA FARINE",
"CECI A ENLEV\220 L'OXYDE",
+ // 425
"J'AI TROUV\220 UN PIEU DE PIN",
"JE PRENDRAI CELUI-CI QUI EST PLUS GROS",
"BON, JE CROIS QUE JE PEUX ME D\220BARRASSER MAINTENANT DE CE STUPIDE D\220GUISSEMENT",
"LE PASSAGE AUX DONJONS EST FERM\220 \267 CAUSE DES TRAVAUX. VOUS \322TES PRI\220S D'UTILISER L'ENTR\220E PRINCIPALE. EXCUSEZ LES ENNUIES",
"...IL EST P\266LE. AVEC DE GROSSES DENTS. IL A UN TOUPET ET UTILISE UNE CAPE... -C'EST S\352REMENT DRASCULA!",
+ // 430
"C'EST B.J.! B.J. TU EST BIEN?",
"OUI, JE SAIS QU'ELLE EST B\322TE, MAIS JE SUIS SEUL",
"N'AURAS-TU PAS UNE CL\220 PAR L\267, N'EST-CE PAS?",
"N'AURAS-TU PAS UN ROSSIGNOL, PAR HASARD?",
"DONNE-MOI UNE \220PINGLE. JE VAIS FAIRE COMME MCGYVER",
+ // 435
"NE BOUGES PAS, JE REVIENS TOUT DE SUITE",
"ZUT! -S'EST CASS\220E!",
"OL\220\220\220! ET EN PLUS JE ME SUIS RAS\220, COLL\324GUE!",
"OUI, MON AMOUR?",
"IL N'ARRIVE PAS",
+ // 440
"LE PIANISTE N'EST PAS L\267",
"UN COKTAIL TRANSYLVAN",
"JE N'AI PAS UNE CHAMBRE",
"SELON PARA\327T, IL EST REST\220 COINC\220 DANS LA BAIGNOIRE ET D\220CIDA ALORS D'OUVRIR UN BAR ",
"IL EST SO\352L COME UNE CUVE DE CUBA",
+ // 445
"CE CHEVEU... LE CAS CE QU'IL ME RAPPELLE QUELQU'UN",
"C'EST UN SQUELETTE OSSEUX",
"REGARDE! MIGUEL BOS\220!",
"IL DORME. CE SERAIT DOMMAGE LE R\220VEILLER",
"IL EST PLUS MOCHE QU'\220MILE DE PAZ",
+ // 450
"UN CERCUEIL EN BOIS DE PIN",
"IL VA ME COUPER EN PETITES TRANCHES, COMME UN SAUCISSON",
"JE N'AIME PAS LES PENDULES. JE PR\220F\324RE LES ARTICHAUTS",
"MES MAINS SONT EMMENOTT\220ES. JE N'ARRIVERAI PAS",
"IL SAUTE AUX YEUX QUE C'EST UNE PORTE SECR\324TE",
+ // 455
"ILS M'IGNORENT",
"C'EST BIEN!",
"DANS LE SCRIPT IL BOUGEAIT, MAIS LE JEU A SURPASS\220 LE BUDGET ET ON N'A PAS PU ME PAYER UN GYMNASE POUR ME METTRE EN FORME. DONC, POINT DU TOUT",
"ELLE PARA\327T UN PEU D\220TACH\220E DU MUR",
"JE NE CROIS PAS POUVOIR M'EN SERVIR. ELLE TROP HUMIDE POUR L'ALLUMER",
+ // 460
"\267 L'AILE OUEST? -M\322ME PAS EN FOU ACHEV\220! -VA SAVOIR QU'AURAIT-IL L\267-BASI!",
"IL Y A DE JOLIS MOTIFS TRANSYLVANS",
"",
"QUEL DOMMAGE NE PAS AVOIR TROUV\220 L\267-DEDANS UN PETIT AGNEAU EN TRAIN DE SE R\342TIR!",
"LA DERNI\324RE FOIS QUE J'AI OUVERT UN FOURNEAU LA MAISON A VOL\220 EN \220CLATS",
+ // 465
"C'EST L'ENSEIGNE DE L'\220QUIPE DE FOOT-BALL DE LA TRANSYLVANIE",
"ET POURQUOI FAIRE? POUR ME LA METTRE \267 LA T\322TE?",
"JE NE CROIS PAS QUE CES TIROIRS SOIENT DE CEUX QUI S'OUVRENT",
"JE NE VEUX PAS SAVOIR LA NOURRITURE QU'IL Y AURA L\267-DEDANS!",
"J'AI L'IMPRESSION QUE C'EST DE L'IMPRESSIONNISME",
+ // 470
"LA NUIT S'EMPARE DE NOUS TOUS... QUELLE PEUR, N'EST-CE PAS?",
"ELLE EST BOUCH\220E",
"C'EST LE ROI. NE L'AVAIT-TU PAS IMAGIN\220?",
"NON, J'EN AI D\220J\267 UN CHEZ MOI ET JE LUI DONNE \267 MANGER EN PLUS",
"UN PLACARD AVEC DES LIVRES ET D'AUTRES CHOSES",
+ // 475
"ET QUI J'APPELLE \267 CES HEURES-L\267?",
"\"COMMENT FAIRE LA D\220CLARATION D'IMP\342TS\" COMME C'EST INT\220RESSANT!",
"J'AI D\324J\267 UN CHEZ MOI. JE CROIS QUE C'EST UN BEST-SELLER MONDIAL",
"UNE CL\220 COMPL\324TEMENT NORMALE",
"IL ME SEMBLE QUE CELLE-CI N'EST PAS D'ICI",
+ // 480
"H\220! CE SONT DES FRITES SOUS FORME DE DENT CANINE! \200A ME PLA\327T",
"JE NE CROIS PAS QU'IL SOIT LE MEILLEUR MOMENT POUR MANGER DES GOURMANDISES, AVEC MA FIANC\220E AUX MAINS DE L'\322TRE LE PLUS MAUVAIS QU'UNE M\324RE A PU ACCOUCH\220",
"COMME JE SUIS BIEN EN TUANT DES VAMPIRES AVEC CELA!",
"VOYONS SI APPARA\327T T\342T UN AUTRE",
"NON, IL FAUT QU'IL SOIT AVEC UN SALE ET PUANT VAMPIRE, COMME CELUI QUI J'AI TU\220 AVANT",
+ // 485
"C'EST L'AUTHENTIQUE PERRUQUE QU'ELVIS AVAIT UTILIS\220E QUAND IL EST DEVENU CHAUVE",
"C'EST DE LA FARINE, MAIS JE NE PEUX PAS DIRE DES MARQUES",
"PEUT-\322TRE DANS UN AUTRE MOMENT, D'ACCORD?",
"C'EST UNE HACHE MAGNIFIQUE, DOMMAGE DE NE PAS POUVOIR SE PAYER AUCUNE T\322TE DE VAMPIRE PAR L\267",
"NON. JE SUIS UNE BONNE PERSONNE AU FOND",
+ // 490
"C'EST LE D\220ODORANT DE LA THACHER-HI!HI!HI!",
"C'EST UNE CAPE ASSEZ MIGNONE",
"",
"TOUT COMME LES BRANCHES DE TOUS LES ARBRES DU MONDE, C'EST-\267-DIRE SANS RIEN DE PARTICULIER",
"OH! C'EST INCROYABLE! -UNE CORDE DANS UNE AVENTURE DESSIN\220E!",
+ // 495
"JE ME DEMANDE \267 QUOI SERVIRA-T-ELLE...?",
"UNE CORDE ATTACH\220E \267 UNE BRANCE OU UNE BRANCHE ACROCH\220E \267 UNE CORDE, \200A D\220PEND DU POINT DE VUE",
"IL PARA\327T QUE CETTE PIE \267 DE TR\324S MAUVAISES INTENTIONS",
"TAIS-TOI! JE NE LA DIS RIEN, POUR SI ELLE SE F\266CHE",
"ELLE SEMBLE MORTE, MAIS C'EST UNE MENSONGE",
+ // 500
"IL N'Y A AUCUN ANIMAL ABiM\220 DANS LA PRODUCTION DE CE JEU",
},
{
+ // 0
"",
"\220 la seconda porta pi\243 grande che ho vista nella mia vita",
"Forse.., no",
"\202 chiusa con tabelle. La chiesa deve essere abbandonata da tanti anni fa.",
"Ma se non la ho aperta",
+ // 5
"Che faccio? La tolgo?",
"Ciao porta. Vado a farti una cornice",
"Troppo per me",
"una finestra chiusa con tabelle",
"Non ce la faccio",
+ // 10
"Eccolo",
"E per che?",
"Ciao finestra. Hai qualcosa da fare stasera?",
"No senza il permesso del Ministero dei Lavori Pubblici",
"-eh! quella finestra ha soltanto una tabella..",
+ // 15
"-Eooooo! -Finestra!",
"Tu, ciao",
"",
"Non ce la faccio",
"Va bene dov'\202 ",
+ // 20
"",
"\220 una tomba in forma di croce",
"Non grazie",
"Ciao morto. Vuoi delle patatine a forma di vermi?",
"Si. Come in Poltergueist.",
+ // 25
"",
"",
"Torno in quindici minuti",
"Vietato affigere manifesti",
"",
+ // 30
"\220 chiuso con la chiave",
"Ne ho gi\240 uno.",
"",
"Non risponde.",
"No, \202 ben parcheggiato.",
+ // 35
"\220 una porta.",
"Un casseto del tavolino.",
"Un sospettoso armadio.",
"Ciao armadio. Come va?.",
"",
+ // 40
"",
"\220 un candelabro molto vecchio.",
"Deve essere qu\241 da che Mazinguer-Z era una vite.",
"No.\220 una reliquia.",
"\220 una bella pala.",
+ // 45
"",
"Hi, hi, hi",
"",
"No.",
"",
+ // 50
"Ha,ha,ha . - che buono!",
"",
"",
"",
"Non vedo niente di speciale.",
+ // 55
"Ferdinan, la pianta.",
"\220 una degli spunzoni della cancellata.",
"-Eh! Qu\241 sotto c'\202 una scatola di cerini",
"-Guarda! un pacco di fazzoletti. -E c'\202 ne uno senza utilizzare!.",
"Non c'\202 niente di pi\243 nel secchio.",
+ // 60
"\220 un cieco che non vede",
"",
"",
"",
"",
+ // 65
"\220 una abbondante quantit\240 di soldi",
"",
"",
"",
"",
+ // 70
"",
"",
"",
"",
"",
+ // 75
"",
"",
"",
"",
"",
+ // 80
"",
"",
"",
"",
"",
+ // 85
"",
"",
"",
"",
"",
+ // 90
"",
"",
"",
"",
"",
+ // 95
"",
"",
"",
"",
"",
+ // 100
"NON HA NULLA DI SPECIALE",
"NON \324 MICA SPECIALE",
"TU! CHE C'\324 ?",
"CIAO",
"NIENTE NUOVO?",
+ // 105
"-COME VA LA FAMIGLIA?",
"- MA CHE STAI A DIRE?",
"-MA COME VADO A PRENDERE QUELLA COSA!",
"\324 VIETATO DALLA MIA RELIGIONE",
"MEGLIO DI NO",
+ // 110
"-COME NO!",
"NEANCHE PARLARNE",
"IMPOSSIBILE",
"QUESTO NON SI APRE",
"IO SOLO NON CE LA FACCIO",
+ // 115
"SE VORREI POTREI, MA MI FA PIGRIZIA",
"NON TROVO UNA BUONA RAGIONE",
"\324 UN CERVELLO ABBASTANZA CARINO",
"ALLORA, CERVELLO, CHE NE PENSI DI FARE STASERA?",
"NO, DEVE CONSERVARSI IN UN POSTO CHIUSO ALLA AZIONE MUTANTE DELLA ATMOSFERA",
+ // 120
"\324 COS\336 DURO, COME IL MIO CAPO",
"UNA TALEA MOLTO AFFILATA",
"FEDELE TALEA AFFILATAAA, NOBILE ROVERE TRANSILVANOOO",
"-INSOMMA, DEVO TAGLIARMI LE UNGHIE!",
"-LA, DENTRO, C'\324 B.J,E MAMMA MIA, CHE FIGA!",
+ // 125
"\324 CHIUSA SOTTO LUCCHETTO E CATENACCIO",
"\"LUCCHETTO E CATENACCIO S.A\"",
"\324 IL TIPICO SCHELETRO CHE C'\324 IN TUTTE LE CARCERE DI TUTTI I VIDEO-GIOCHI",
"SI UTILIZA PER DARE ELETRICIT\267 AGLI APARATTI COLLEGATI A LUI",
"\324 TOTALMEN11TE ARTIGIANO, PERCHE I GIAPONESSI LI FANNO TASCABILI",
+ // 130
"NELLA MIA VITA, HO VISTO SOLTANTO UNA VOLTA UNA COSA COS\336 BRUTTA",
"SMETILLA. NON DICO NULLA PER SE SI ARRABBIA",
"SEMBRA ABBASTANZA RAZIONALE",
"\324 UNA FOTO DI PLATONE SCRIVENDO IL SUO DISCORSO PERSO",
"NON SONO DI QUELLI CHE PARLANO CON POSTERS",
+ // 135
"UNA SCRIVANIA MOLTO CARINA",
"\324 UN DIPLOMA DI CACCIA-CACCIA-VAMPIRI OMOLOGATO DALLA UNIVERSIT\267 DI OXFORD",
"\324 NOTTE BUIA CON LUNA PIENA",
"SEMBRA CHE QUESTE VITI NON SONO MOLTO AVVITATE",
"NON GUARDARE, MA CREDO CHE UNA TELECAMERA NASCOSTA MI ST\267 REGISTRANDO",
+ // 140
"UN DETETTORE DI TALEE MOLTO MODERNO",
"NO, IL LABORATORIO SI TROVA NEL SECONDO PIANO",
"UN BEL TAVOLINO",
"\324 UN SACCO DI SOLDI CHE NON PUO MANCARE IN UNA AVVENTURA CHE SIA COS\336 IMPORTANTE",
"IF I WERE A RICHMAN, DUBIDUBIDUBIDUBIDUBIDUBIDUBIDU",
+ // 145
"SONO DELLE STRANE FOGLIE. DEVONO AVERLE PORTATE DALLA SUDAMERICA",
"NON CREDO CHE SIA RISPOSTO",
"\324 UN BEL CROCIFISSO DI LEGNO. LA ICONA NON RIFLESSA TUTTA LA SUA BELLEZA",
"IO SOLO PREGO PRIMA DI ANDARMENE AL LETTO",
"-EH, SEMBRA CHE QUESTO SPUNZONE \324 UN PO ALLENTATO!",
+ // 150
"E POI TI LAMENTI PERCHE NON TI DO SUGGERIMENTI",
"\324 UNO SPUNZONI ABBASTANZA CONVENZIONALE",
"SONO CARINI, SEBBENE HANNO PARECHIO POLVERE",
"NO, NON MI SENTIRANO; HI,HI,HI -CHE BUONO!",
"\"LA BELLA ADDORMENTATA DEL BOSCO\" DI CIAIKOSKY, O CIOIFRUSKY, O COME SI DICA",
+ // 155
"MOLTO APPETITOSA",
"NO, IO NON SONO DI QUELLI CHE SI METTONO IN BOCCA GOMME USATE",
"UNA FALCE MOLTO CARINA. MI DOMANDO DOVE CI SAR\265 IL MARTELLO",
"\"I FABBRICANTI DI TABACCO AVVERTONO CHE IL TABACCO NUOCE GRAVEMENTE LA SALUTE\"",
"UNA CANDELA NORMALE, ANZI CON CERA",
+ // 160
"MAMMA MIA COME BRILLANO QUESTE DUE BRILLANTI MONETE",
"MAMMA MIA COME BRILLA QUESTA BRILLANTE MONETA",
"CON QUESTO SAR\220 IMMUNE AI MORSI DEI VAMPIRI",
"NO, ANCORA NON \220 IL MOMENTO",
"C'E UN BIGLIETTO DI DIECIMILA E UN PAIO DI MONETE",
+ // 165
"DICE \"SI PREGA DI NON BUTTARE CIBO AL PIANISTA\"",
"OMELETTA, 3.000 .PESCI FRITI, 2.000,PATATINE, 2.500",
"LE MIGLIORI HAMBURGUER A QUESTA PARTE DEL DANUBIO, SOLTANTO PER 4.000",
"UN BEL TESCHIO, CON UNO SGUARDO MOLTO PENETRANTE. HI,HI,HI, CHE BUONO!",
"CIAO TESCHIO, MI RICORDI AL ZIO DI HAMLET",
+ // 170
"HO L'ABITUDINE DI NON TOCCARE COSE CHE SIANO STATE VIVE",
"UN CESTINO",
"UN TOTOCALCIO PER LA PARTITA DI STASERA",
"MI DOMANDO CHE CI SAR\265 DIETRO",
"-EH, QUESTA TENDE NON SI MUOVE!",
+ // 175
"MADONNA, CHE TETRO \220 QUESTO CASTELLO.",
"NON CE LA FACCIO, \220 TROPPO LONTANO PER SENTIRMI",
"UN TIPICO BOSCO TRANSILVANO, CON GLI ALBERI",
"-MA CHE SCIOCHEZZE DICI, \220 MOLTO BUIO",
"PASTICCERIA ROSSI. DOLCI E GOMME",
+ // 180
"UNA PORTA MOLTO BELLA",
"\220 CHIUSA",
"UN FUSTO COMPLETAMENTE CHIUSO",
"",
"CHE ANIMALETTI COS\326 BELLI!",
+ // 185
"BSSSSSS,BSSSS, GATINO..",
"NON RISPONDE",
"LA LUNA \220 UN SATELLITE CHE GIRA INTORNO LA TERRA CON UN PERIODO DI RIVOLUZIONE DI 28 GIORNI",
"CIAO, LUNA LUNETTA",
"\220 TOTALMENTE CHIUSA CON TABELLE",
+ // 190
"IMPOSSIBILE. QUESTO, NON LO APRE N\220 HOUDINI",
".EH, SEMBRA CHE L'OMBRA DEL CIPRESSE \220 ALUNGATA",
"-EOOO, BARISTA",
"VORREI UNA CAMERA",
"SA DOVE POSSO TROVARE A UNO CHE SI FA CHIAMARE CONDE DRASCULA",
+ // 195
"SI, PER CHE?",
"COME MAI?",
"DA.....DAVVERO?",
"BUONA DOMANDA, GLI RACONTER\220 LA MIA STORIA, SENTA..",
"SONO SOLTANTO CINQUE MINUTI",
+ // 200
"MI CHIAMO JOHN HACKER, E SONO RAPPRESENTANTE DI UNA IMMOBILIARIE BRITANICA",
"MI HANNO DETTO CHE IL CONDE DRASCULA VUOLE COMPRARE DEI TERRENI A GIBRALTAR, E SONO QU\326 PER NEGOZIARE LA VENDITA",
"MA CREDO IO CHE DOMANI PRESTO TORNO CON LA MAMMA",
"BELLA NOTTE, VERO?",
"NO, NIENTE",
+ // 205
"EOOOO, PIANISTA",
"BELLA NOTTE",
"ANZI, NON FA FREDDO",
"ALLORA... TI LASCIO CONTINUARE A SUONARE",
"VA BENE",
+ // 210
"CIAO CAPO, COME VA?",
"E LA FAMIGLIA?",
"C'\220 GENTE QU\326, EH?",
"MEGLIO NON DICO NULLA",
"SI ST\265 MEGLIO A CASA CHE A NESSUN POSTO... -EH? MA SE LEI NON \220 LA ZIA EMMA. ANZI. SE IO NON HO NESSUNA ZIA EMMA.",
+ // 215
"SI, IL MIO ANCHE. LEI PUO CHIAMARMI COME GLI PARA, MA SE MI CHIAMA JOHNY, VENGO SUBITO COME I CANI",
"SI, CHE SPIRITOSO SONO, VERO? MAA.. DOVE MI TROVO?",
"SI.",
"MANAGIA..",
"OH, SI. COME NO",
+ // 220
"ALLORA GRAZIE MILE PER DARMI IL TUO AIUTO. NON TI DISTURBO PI\351 . SE MI DICI DOV'\220 LA PORTA, PER FAVORE...",
"PERCHE LA BOTTA HA DOVUTO DAGNARMI IL CERVELLO E NON VEDO UNA MADONNA",
"NON FA NIENTE. SEMPRE NE PORTO ALTRI IN PI\351 ",
"-UFFA, CHE FIGA!- NON MI ERA ACCORTO, CERTO, SENZA GLI OCCHIALI",
"SENTI..",
+ // 225
"COME MAI...?!",
"NON TI PREOCUPARE B.J., AMORE MIO! TI LIBERER\220 DA QUEL TIZIO",
"MI HA FATTO ARRABBIARE",
".AHHH, IL LUPO- MANNARO! -MUORE MALDITO!",
"BENE, CREDO...",
+ // 230
"BENE, CREDO CHE PROSSIGUER\220 LA MIA STRADA. PERMESSOO..",
"-COME?",
"LA VERIT\267, PENSANDOCI MEGLIO, CREDO DI NO",
"DIMI, OH ERUDITO FILOSOFO, C'\324 QUALCUNA RELAZIONE CAUSA-EFETTO TRA LA VELOCIT\267 E LA PANCETA?",
"VA BENE, SMETTILA. COMUNQUE NON SO PERCHE HO DETTO QUESTO",
+ // 235
"COSA FAI QU\336 FILOSOFANDO, CHE NON STAI MANGIANDO GENTE?",
"COME MAI?",
"SENTI, PUOI RIPETERE QUELLO DI \"INCLINAZIONI PRE-EVOLUTIVE\"?",
"SI SI, QUELLA STORIA CHE MI HAI RACCONTATO PRIMA. PERCHE NON HO CAPITO MOLTO BENE.",
"NO, MEGLIO NON DICO NULLA, NON VOGLIO METTERE IL COLTELLO NELLA PIAGA...",
+ // 240
"SI, MI DICA?",
"SI, CHE SUCCEDE?",
"AH, ADESSO CHE CITA IL SOGGETTO GLI DIR\343 CHE...",
"",
"AH.., COSA SUCCEDEREBBE SE UN VAMPIRO PRENDEREBBE LA RICETA..",
+ // 245
"NIENTE. SENTI, QUESTO SEMBRA UN POSTICCIO MESSO SUL COPIONE PER FINIRE PRESTO IL VIDEO-GIOCO?. BENE, FORSE, NO",
"\324 VUOTO!",
"PERCHE HAI RUBATO IL MIO AMORE, B.J., SENZA LEI LA MIA VITA NON HA SENSO",
"-IL SUO CERVELLO?!",
"NO NIENTE, MA CREDO CHE ALLA FINE IL TUO PICCOLINO MOSTRO MI HA FATTO ARRABBIARE",
+ // 250
"SANTA MADONNA AIUTAMI!",
"NON TE LA CAVEREI. SICURO CHE APPARISCE SUPERMAN E MI LIBERA!",
"CHE SCHIFFO DI VIDEO-GIOCO NEL CUI MUORE IL PROTAGONISTA",
"UN ATTIMO, COSA SUCCEDE COL MIO ULTIMO DESIDERIO?",
"-HA,HA! ORA SONO IMMUNIZZATO CONTRO TE, MALEDETTO DEMONIO. QUESTA SIGARETTA \324 UNA POZIONE ANTI-VAMPIRI CHE MI HA DATTO VON BRAUN",
+ // 255
"SI CERTO. MA NON RIUSCIRAI MAI A FARMI DIRTI LA RICETA",
"POSSO SOPPORTARE LA TORTURA, ANZI CREARLA",
"-NO, PER FAVORE!- PARLER\220, MA NON FARMI QUESTO!",
"BENE, TI HO GI\267 DETTO QUELLO CHE VOLEVI SAPERE. ORA LIBERA B.J. E ME, E LASCIACI PERDERE",
"-B.J-.! COSA FAI QU\336? DOV'\324 DRASCULA?",
+ // 260
"CHE PERVERSO! SOLTANTO PERCH'\324 NOBILE PENSA CHE HA IL DIRITTO SU TUTTI QUANTI",
"ABASSO LA ARISTOCRAZIA!",
"FORZA I POVERI DEL MONDOOO...",
"E QUELLO CHE VEDO \324 CHE TI HA INCATENATO ANZI CON LUCCHETTO",
"O.K., NON AVRAI UNA FONCINA?",
+ // 265
"BENE BENE, NON PRENDERTELA COS\336, CI PENSER\220 IO",
"EH, BARISTA",
"COME VA LA PARTITA?",
"CHI?",
"MA NON VEDI CHE DRASCULA \324 QU\336?",
+ // 270
"ANDIAMO A UCCIDERLO",
"SERVIMI UN DRINK..",
"NIENTE. HO DIMENTICATO COSA VOLEVO DIRTI",
"O\247MI\247SERVI\247UN\247DRINK\247O\247MI\247METTO\247A\247SUONARE\247IL\247PIANOFORTE",
"QUANTO MANCA PER LA FINE DELLA PARTITA?",
+ // 275
"BUONA SERA",
"COME VA IGOR? VAI CON LA GOBBA? -HI,HI,HI,CHE BUONO!",
"CHE STAI FACENDO?",
"NO",
"ALLORA METTITI GLI OCCHIALI",
+ // 280
"COSA \324 QUELLA DELLA ORGIA SOPRANNATURALE?",
"VA BENE, NON COTINUARE, MI FACCIO IDEA",
"NON POTREI DIRMI DOV'\324 DRASCULA?",
"DAIII, PER FAVORE",
"PER CHE NO?",
+ // 285
"AH, MA DORME DI NOTTE?",
"BENE, ALLORA IN BOCCA IL LUPO CON I REDDITI",
"DEVO PROPRIO PARLARE CON LUI",
"EOOOO, SCHELETROOO!",
"OH DIO! UN MORTO CHE PARLA!",
+ // 290
"RACCONTAMI. COME MAI SEI VENUTO QU\336?",
"E PER CHE DRASCULA VUOLE CREARE UN MOSTRO?",
"COME TI CHIAMI, AMICO SCHELETRO?",
"SENTI, NON VUOI QUALCOSA DA MANGIARE?",
"DEVI AVERE LO STOMACO VUOTO .- HI,HI,HI!",
+ // 295
"LA VERIT\267 \324 CHE NON MI VA DI PARLARE ADESSO",
"VANFFAN ( BIP ) FIGLIO DI .......( BIIP ).. VAI A FARE....( BIIIP )",
"IO LA AMAVO DAVVERO. O.K., SONO D'ACCCORDO CHE NON ERA MOLTO INTELLIGENTE, MA NESSUNO \324 PERFETTO, NO?",
"ANZI, AVEVA UN CORPO DA PAURA",
"ORMAI NON SAR\343 PI\353 QUELLO DI PRIMA .MI RICHIUDER\343 IN UN MONASTERO, E LASCIER\343 LA MIA VITA PERDERE",
+ // 300
"NIENTE POTR\267 FARMI USCIRE DI QUESTA MISERIA PERCHE...",
"DI CHI? DI CHI?",
"VOGLIO ESSERE PIRATA",
"VOGLIO ESSERE PROGRAMMATORE",
"RACCONTAMI QUALCOSA SU GARIBALDI",
+ // 305
"CONTINUER\343 A GIOCARE E DIMENTICHER\343 CHE VI HO VISTI",
"MA CHI AVR\267 PENSATO QUESTA SCIOCHEZZA!",
"\324 UNA BORSA COME QUELLA DI MIA NONNA",
"MA CHE FIGO SONO!",
"PI\353 MI VEDO PI\353 MI PIACCIO",
+ // 310
"E POI COME MI CHIUDO?",
"PRIMA DEVO APRIRMI, VERO?",
"ST\343 BENE DOVE SONO",
"MI HO GI\267 PRESSO",
"CIAO IO",
+ // 315
"ME GLI INDOSSER\343 QUANDO SIA LA OCCASIONE OPORTUNA",
"NON VEDO NIENTE DI SPECIALE",
"\324 BENE DOV'\324",
"E PER CHE?",
"NON CE LA FACCIO",
+ // 320
"CIAO TU",
"\324 IL SEPOLCRO DELLO ZIO PEPPINO",
"EOOOO, ZIO PEPPINOOOO!",
"NO.NON VOGLIO TAGLIARMI UN' ALTRA VOLTA",
"-EHEM,EHEM..!",
+ // 325
"GNAMM, EMMM,!",
"-SI, COF, COF!",
"GUARDA, C'\324 UNA GOMMA QU\336 ATTACATA",
"\324 IL TELEFONINO CHE MI HANNO REGALATO A NATALE",
"COM'\324 ALTO",
+ // 330
"ESCI AL BALCONE GIULIETTA!",
"TU SEI LA LUCE CHE ILLUMINA LA MIA VITA!",
"EH, PORTA, CHE C'\324?",
"EOOOO, SPENDITRICE DI TABACCO DI TRANSILVANIAAA",
"\324 UNA SPENDITRICE DI TABACCO",
+ // 335
"HO UN'ALTRA MONETA DENTRO",
"NO. HO DECISSO SMETTERE DI FUMARE E DI BERE",
"DA OGGI SAR\343 SOLTANTO PER LE DONNE",
"QUESTO \324 UNA TRUFFA! NON \324 USCITO NULLA",
"ALLA FINE!",
+ // 340
"CHE TI HO DETTO?, UN BAULE",
"CIAO BAULE, TI CHIAMI COME MIO CUGINO CHE SI CHIAMA RAUL..E",
"HO TROVATO LA BORSA DI B.J.",
"MIO DIO, NON MI RIFLETTO, SONO UN VAMPIRO!",
"...AH, NO, \324 UN DISEGNO",
+ // 345
"SPECCHIO DELLE MIE BRAME: CHI \220 ILPI\351 BELLO DEL REAME?",
"NON VUOLE APRIRMI",
"MOLTO BENE. MI HO MESSO I TAPPI",
"\324 UN DIPLOMA DI CACCIA-VAMPIRI OMOLOGATO DALLA UNVERSIT\267 DI CAMBRIDGE",
"NO. MANCANO ANCORA GLI INGREDIENTI, NON MERITA LA PENA CHE SIA SVEGLIATO",
+ // 350
"NON HO SOLDI",
"\324 UNA LAMPADA BRITANICA",
"BARISTA! AIUTAMI!",
"HA COMPARITO UN VAMPIRO ED HA PRESSO LA MIA FIDANZATA",
"MA NON MI AIUTER\267",
+ // 355
"MORTA? CHE VUOLE DIRE?",
"- EHEM!",
"UN VAMPIRO HA SEQUESTRATO LA RAGAZZA DELLA 506!",
"DEVI AIUTARMI!",
"NON SAI SUONARE NESSUNA DI \"ELIO E LE STORIE TESSE\"",
+ // 360
"COME TI SOPPORTI, SUONANDO SEMPRE LO STESSO?",
"ALLORA COME MI SENTI?",
"PRESTAMI I TAPPI",
"DAI, TE LI RESTITUISCO SUBITO",
"DAIIII...",
+ // 365
"CIAO. DEVO UCCIDERE UN VAMPIRO",
"",
"COSA DICI? IN TRANSILVANO?",
"CHI \324 LO ZIO PEPPINO?",
"MA CHE SUCCEDE CON DRASCULA?",
+ // 370
"CHI \324 VON BRAUN?",
"E PER CHE NON LO FA?",
"E DOVE POSSO TROVARE VON BRAUN?",
"GRAZIE E CIAO, SOGNI D'ORO",
"SAR\267 MEGLIO BUSSARE PRIMA",
+ // 375
"\324 LEI IL PROFESSORE VON BRAUN?",
"E MI POTREBBE DIRE DOVE POSSO ...?",
"NON CREDO SIA IL NANNO GANIMEDI",
"-PROFESSORE!",
"AIUTAMI! LA VITA DEL MIO AMORE DIPENDE DI LEI!",
+ // 380
"VA BENE, NON HO BISOGNO DEL SUO AIUTO",
"O.K. ME NE VADO",
"NON AVERE PAURA. INSIEME VINCEREMO DRASCULA",
"ALLORA PER CHE NON MI AIUTA?",
"IO CE LE HO",
+ // 385
"SI CE LE HO",
"D'ACCORDO",
"...EHH...SI",
"VENGO A RIENTRARE A QUESTA CABINA",
"SONO PRONTO PER FARE LA PROVA",
+ // 390
"VA BENE, VECCHIETO. SONO VENUTO PER IL MIO SOLDI",
"NO, NIENTE. ME NE GI\267 ANDAVO",
"SCUSA",
"TI \324 INTERESANTE QUESTO LIBRO? HA PARTITURE DI TCIAKOWSKY",
"COME POSSO UCCIDERE UN VAMPIRO?",
+ // 395
"NON TI HANNO DETTO CHE NON \324 BUONO DORMIRE IN CATTIVA POSIZIONE?",
"\324 QUELLO CHE SEMPRE DICE MIA MADRE",
"PER CHE DRASCULA NON FU RIUSCITO A UCCIDERTI?",
"E COSA FU?",
"BENISSIMO! HA LEI LA POZIONE DI IMMUNIT\267...!",
+ // 400
"ALLORA",
"MOLTO BENE",
"MI PUO RIPETERE COSA BISOGNO PER QUELLA POZIONE?",
"VADO VIA VELOCE A TROVARLO",
"SENTA, COSA \324 SUCCESO CON IL PIANISTA?",
+ // 405
"HO GI\267 TUTTI GLI INGREDIENTI DI QUESTA POZIONE",
"UNA DOMANDA: COSA \324 QUELLA DI ALUCSARD ETEREUM?",
"DICA, DICA..",
"E DOV'\324 QUELLA GROTTA?",
"CHE C'\324? NON AVETE TRIBUNALE?",
+ // 410
"...MA ...E SE TROVO PI\353 VAMPIRI?",
"\324 UN VAMPIRO CHE NON MI FA PASSARE",
"SI ASSOMIGLIA A YODA, MA PI\353 ALTO",
"EH, YODA. SE MI FAI PASSARE TI DAR\343 CENTO LIRE",
"BENE, O.K., NON POSSO DIRTI NULLA",
+ // 415
"CIAO VAMPIRO, BELLA NOTTE, VERO?",
"TI HANNO DETTO QUALCHE VOLTA CHE TI ASSOMIGLII A YODA?",
"SEI UN VAMPIRO O UN DIPINTO ALL'OLEO?",
"MEGLIO NON DIRTI NIENTE, PERCHE POI TI ARRABBII",
"\324 CHIUSA CON LA CHIAVE",
+ // 420
"SE PROVO, LA GAZZA MI POTREI CAVARE UN OCCHIO",
"\324 CHIUSA! DIO MIO, CHE PAURA!",
"LE CERNIERE SONO OSSIDATE",
"LA DENTRO C'\324 SOLTANTO UN BARATOLO DI FARINA",
"QUESTO HA TOLTO L'OSSIDO",
+ // 425
"HO TROVATO UNA TALEA DI LEGNO DI PINO",
"PRENDER\343 QUESTO CH'\220 PI\353 GROSSO",
"BENE, CREDO DI POTERE TOGLIERMI QUESTO STUPIDO COSTUME",
"\"CORRIDOIO AI TORRIONI CHIUSO PER LAVORI IN CORSO. PER FAVORE, PER LA PORTA PRINCIPALE. SCUSATE PER IL DISTURBO\"",
"..\324 PALLIDO, HA DENTI CANINI, HA CIUFFO E UTILIZA MANTELLO...- SICURO CH'\324 DRASCULA!",
+ // 430
"B.J., B.J., STAI BENE?",
"SI, SO CH'\324 SCEMA MA MI SENTO SOLISSIMO",
"NON AVRAI UNA CHIAVE PER CASO, VERO?",
"- E SICURO CHE NON HAI UN GRIMALDELLO?",
"DAMI UNA FONCINA. VADO A FARE COME MCGYVER",
+ // 435
"NON MUOVERTI, TORNO SUBITO",
"- MANAGIA!- SI \324 ROTTA!",
"OLE, ANCHE MI HO FATTO LA BARBA!",
"SI, CARO?",
"NON ARRIVA",
+ // 440
"IL PIANISTA NON C'\324",
"UN DRINK TRANSILVANO",
"ANCORA NON HO CAMERA",
"SEMBRA CHE FU RISUCCHIATO NELLO SCARICO DELLA VASCA E HA DECISO APRIRE UN BAR",
"\324 UBRIACO PERSO",
+ // 445
"QUESTI CAPELLI.... CREDO CHE MI FANNO RICORDARE A QUALCUNO",
"\324 UNO SCHELETRO OSSUTO",
"GUARDA! MIGUEL BOSE!",
"\324 ADDORMENTATO. SAREBBE UN PECCATO SVEGLIARGLI",
"\324 PI\353 BRUTTO CHE BEGNINI",
+ // 450
"UN FERETRO DI LEGNO DI PINO",
"MI TAGLIER\267 A FETTINI, COME UN SALSICCIOTTO",
"NON MI PIACCIONO I PENDOLI. PREFERISCO LE CARCIOFE",
"LE MIE MANI SONO LEGATE. NON CE LA FAR\343",
"\324 OVVIO CH'\324 UNA PORTA SEGRETA",
+ // 455
"MI IGNORANO",
"-DAIII!",
"NEL PRIMO COPIONE SI MUOVEVA, MA IL VIDEO-GIOCO \220 USCITO DAL BUDGET E NON HANNO POTUTO PAGARMI UNA PALESTRA E NON SONO GONFFIATO",
"SEMBRA CH'\324 UN P\343 ALLENTATA DAL MURO",
"NON CREDO CHE MI SIA UTILE. \324 TROPPO UMIDA PER ACCENDERLA.",
+ // 460
"AL LATO OVEST? -N\324 PAZZO, CHI SA CHE CI SAR\267 LI!",
"HA DEI BELLI DISEGNI TRANSILVANI",
"",
"CHE PENA CHE NON CI SIA DENTRO UN AGNELLINO ARRROSTANDOSI",
"LA ULTIMA VOLTA CHE APRII UN FORNO, LA CASA SALT\220 PER ARIA",
+ // 465
"LO SCUDO DELLA SCUADRA DI CALCIO DI TRANSILVANIA",
"E PER CHE? PER INDOSARLA SULLA TESTA?",
"NON CREDO CHE I CASSETI SIANO DI QUELLI CHE SI APPRONO",
"NON VOGLIO SAPERE IL CIBO CHE CI SAR\267 LA DENTRO!",
"HO L'IMPRESSIONE CH'\324 IMPRESSIONISTA",
+ // 470
"LA NOTTE SI IMPADRONA DI TUTTI QUANTI... CHE PAURA?",
"\324 OSTACOLATA",
"\324 IL RE, NON LO AVEVI IMAGINATO?",
"NO, NE UNO A CASA, ANZI GLI DO DA MANGIARE",
"UNA SCAFFALATURA CON LIBRI ED ALTRE COSE",
+ // 475
"E A CHI CHIAMO A QUESTE ORE?",
"\"COME FARE LA DECLARAZIONE DI REDDITI\"- CHE INTERESSANTE!",
"NE HO UNO A CASA, CREDO CH'\324 UN BEST-SELLER MONDIALE",
"UNA CHIAVE COMPLETAMENTE NORMALE",
"MI SA QHE QUESTA NON \220 DI QU\336",
+ // 480
"EH, SONO PATATINE FRITE A FORMA DI DENTI CANINI ! MI AFASCINA",
"NON CREDO CHE SIA IL MOMENTO MIGLIORE PER METTERSI A MANGIARE DOLCI, L'ESSERE PI\353 CATTIVO DEL MONDO ha nelle sue mani la mia fidanzzata",
"COME MI ST\343 DIVERTENDO UCCIDENDO VAMPIRI CON QUESTO!",
"VEDIAMO SE APPARISCE UN ALTRO PRESTO",
"NO, DEVE ESSERE CON UN VAMPIRO SPORCO E SCHIFFOSO COME QUELLO DI PRIMA",
+ // 485
"\324 L'AUTENTICA PARRUCA CHE UTILIZZ\343 ELVIS QUANDO DIVENT\343 PELATO",
"\220 FARINA MA NON POSSO DIRE MARCHE",
"FORSE IN UN ALTRO MOMENTO. OK?",
"\220 UNA ASCIA BUONISSIMA, CHE PENA CHE NON CI SIA QU\336 VICINO NESSUNA TESTA DI VAMPIRO",
"NO. NEL FONDO SONO UNA BRAVISSIMA PERSONA",
+ // 490
"\324 IL DEODORANTE DELLA TACHER -HI,HI,HI!",
"\324 UN MANTELLO ABBASTANZA CARINO",
"",
"COME TUTTI I RAMI DI TUTTI GLI ALBERI DEL MONDO, CIO\324 MICA SPEZIALE",
"OH, INCREDIBILE!- UNA CORDA IN UNA AVVENTURA GRAFICA!",
+ // 495
"MI DOMANDO A CHE SERVE...",
"UNA CORDA LEGATA A UNA BRANCA, O UNA BRANCA LEGATA A UNA CORDA, DIPENDE COME SI GUARDI",
"SEMBRA CHE QUESTA GAZZA HA CATIVE INTENZIONI",
"DAI.., NON LA DICO NULLA CHE POI SI ARRABBIA",
"SEMBRA ESSERE MORTA, MA NON \220 VERO - EH?",
+ // 500
"NESSUN ANIMALE \220 STATO MALTRATO DURANTE LE RIPRESE DI QUESTO VIDEO-GIOCO",
},
};
-const char *_textd[][79] = {
+const char *_textd[NUM_LANGS][NUM_TEXTD] = {
{
+ // 0
"",
"HEY IGOR, HOW IS EVERYTHING GOING?",
"IT'S ALWAYS THE SAME STORY EVERYTIME THERE'S A GOOD GAME ON THE SATELLITE! ANYWAY, WE'LL GO WATCH IT IN THE BAR, AS USUAL",
"IGOR LISTEN CAREFULLY MAN, WE ARE GOING TO START WITH PHASE NUMBER ONE OF MY PLAN TO CONQUER THE WORLD",
- "FIRST WE'LL CAPTURE ONE OF THE LIGHTNINGS AND WE'LL DEMAGNETIZE IT WITH OUR INDIFIBULATOR. THE ELECTRICITY WILL COME THROUGH TO MY MONSTER AND HE'LL GET ALIVE!",
+ "FIRST WE'LL CAPTURE SOME LIGHTNING THEN WE'LL DEMAGNETIZE IT WITH OUR INDIFIBULATOR. THE ELECTRICITY WILL FLOW THROUGH TO MY MONSTER AND HE WILL LIVE!",
+ // 5
"IF EVERYTHING WORKS OUT ALL RIGHT, THIS WILL BE THE BEGINNING OF A GREAT ARMY THAT WILL CONQUER THE WORLD FOR ME. HA, HA",
- "THE MONSTERS WILL DESTROY ALL THE ARMY'S WEAPONS IN THE WORLD, MEANWHILE, WE'LL BE SAFE IN THE PIECES OF LAND I BOUGHT IN GIBRALTAR",
+ "THE MONSTERS WILL DESTROY ALL THE ARMY'S WEAPONS IN THE WORLD, MEANWHILE, WE'LL BE SAFE IN THE PIECES OF LAND I PLAN TO BUY IN GIBRALTAR",
"WE'LL SET UP A COUP. GOVERNMENTS ALL OVER THE WORLD WILL BE UNCOVERED AND THEIR COUNTRIES WILL SURRENDER TO ME!",
"I'LL BECOME THE FIRST BAD GUY IN HISTORY TO MAKE IT ! HA, HA!",
"I'M NOT TALKING TO YOU, IDIOT! I'M JUST GIVING YOU THE PLOT. ALL RIGHT, EVERYTHING READY?",
+ // 10
"THE TIME HAS COME! TURN ON THE ALKALINE BATTERIES' SWITCH",
- "DAMNED IT! WHAT WENT WRONG?",
- "ARE YOU SURE YOU CHECKED IT ALL AND THERE WAS NOTHING MISSING? YOU'VE BEEN LATELY MESSING AROUND WITH THAT STUFF ABOUT TAXES AND I DON'T KNOW MAN...",
- "YOU STUPID THING! YOU FORGOT TO CONNECT THE INDIFIBULATOR. THE SCREWS HAVE PROBABLY MAGNETIZED AND HIS BRAIN BURNT",
+ "DAMN IT! WHAT WENT WRONG?",
+ "ARE YOU SURE YOU CHECKED IT ALL AND THERE WAS NOTHING MISSING? LATELY YOU'VE BEEN MESSING AROUND WITH THAT STUFF ABOUT TAXES AND I DON'T KNOW MAN...",
+ "YOU STUPID THING! YOU FORGOT TO CONNECT THE INDIFIBULATOR. THE SCREWS HAVE MAGNETIZED AND HIS BRAIN HAS PROBABLY BURNT",
"YOU ARE DEAD, YOU ARE DEAD...WAIT TILL I GET YOU!",
+ // 15
"SHUT UP! I'LL GET ANOTHER BRAIN TOMORROW AND THEN WE WILL REPEAT THE EXPERIMENT",
- "THIS TIME I'LL GET A WOMAN'S BRAIN. SHINY AND NOT USED YET...HA, HA, HA, GOODIE ONE!",
- "SO WHAT? I'M THE BAD GUY, RIGHT? SO I CAN BE AS FULL OF MACHISMO AS I WANT, ALL RIGHT? AND IF YOU SAY SOMETHING AGAIN I'LL TURN YOUR HUMP BACK TO FRONT!",
- "HA, HA, HA. YOU FELL TOOO!! NOW YOU ARE GOING TO PAY FOR DARING TO FIGHT AGAINST ME! IGOR, TAKE HIM TO THE PENDULUM OF DEATH!",
+ "THIS TIME I'LL GET A WOMAN'S BRAIN. SHINY AND NOT USED YET...HA, HA, HA, GOOD ONE!",
+ "SO WHAT? I'M THE BAD GUY, RIGHT? SO I CAN BE AS FULL OF MACHISMO AS I WANT, ALL RIGHT? AND IF YOU SAY ANOTHER THING I'LL TURN YOUR HUMP BACK TO FRONT!",
+ "HA, HA, HA. YOU FELL FOR IT!! NOW YOU ARE GOING TO PAY FOR DARING TO FIGHT ME! IGOR, TAKE HIM TO THE PENDULUM OF DEATH!",
"AND SO, TELL ME, YOU STUPID HUMAN. HOW COME YOU WANT TO DESTROY ME?",
+ // 20
"THAT'S BEAUTIFUL!. IF IT WASN'T BECAUSE IT MAKES ME LAUGH, I WOULD CRY",
- "OUR GIRLFRIEND'S BRAIN TO HELP ME CONQUERING THE WORLD",
+ "I PLAN TO USE YOUR GIRLFRIEND'S BRAIN, TO HELP ME CONQUER THE WORLD",
"YES, SURE! I'LL TAKE IT FROM HER AND GIVE IT TO MY FRUSKYNSTEIN. THE WORLD WILL BE MINE WITH IT, HA, HA",
"WHAT!? YOU'RE DEAD, MAN! I'M GOING TO...YOU REALLY GOT ME ANGRY MAN...COME ON, PREPARE TO DIE!",
"HA, HA, HA. NOT EVEN IN YOUR WILDEST DREAMS!",
+ // 25
"YES, ISN'T IT? HA, HA",
"ALL RIGHT, ALL RIGHT. BUT DO IT QUICKLY, OK?",
"PUT THAT CIGARETTE OUT NOW! I CAN'T STAND YOU ANYMORE!",
- "AND SO, DOES THAT BREW HAVE THE OPPOSITE EFFECT?",
- "WELL, WE'LL SEE THAT",
- "OK, LET'S SEE IT. IGOR, BRING ME THE CD \"SCRATCHING YOUR NAILS ALL OVER THE BLACKBOARD\"",
- "NO WAY. THE GIRL STAYS WITH ME. YOU RE STAYING THERE UNTIL THE PENDULUM CUTS YOU INTO THIN SLICES. HA, HA, HA",
- "MAN I'M I JUST BAD... COME ON IGOR, LET'S MAKE THE BREW AND CONQUER THE WORLD",
- "WHAT HAPPENS NOW?",
+ "SO, DOES THAT BREW HAVE IMMUNISATING EFFECTS FOR VAMPIRES??",
+ "WELL, WE'LL SEE ABOUT THAT",
+ // 30
+ "OK, LET'S SEE. IGOR, BRING ME THE CD \"SCRATCHING YOUR NAILS ALL OVER THE BLACKBOARD\"",
+ "NO WAY. THE GIRL STAYS WITH ME. YOU'RE STAYING THERE UNTIL THE PENDULUM CUTS YOU INTO THIN SLICES. HA, HA, HA",
+ "MAN I'M SO BAD... COME ON IGOR, LET'S MAKE THE BREW AND CONQUER THE WORLD",
+ "WHATS HAPPENED NOW?",
"YES, WHAT?...OH, DAMNED, THE GAME!",
+ // 35
"I FORGOT ABOUT THAT. GET THE GIRL AND LET'S GO AND WATCH IT. WE CAN CONQUER THE WORLD LATER",
"THANKS MAN, I WAS THIRSTY",
"OH, THE CRUCIFIX!!...THE CRUCIFIX...!",
- "I DIDN'T NOTICE ABOUT THAT BEAUTIFUL CRUCIFIX!",
+ "I DIDN'T NOTICE THAT BEAUTIFUL CRUCIFIX!",
"LEAVE ME ALONE!, I'M WATCHING THE GAME",
+ // 40
"",
"",
"",
"",
"",
+ // 45
"",
"",
"",
"",
"",
+ // 50
"",
"",
"",
"",
"",
+ // 55
"",
"HI BLIND MAN. HOW IT'S GOING?",
"HOW DO YOU KNOW I'M A FOREIGNER?",
- "YOU LOOK BLIND. YOU'RE WEARING DARK GLASSES LIKE STEVIE WONDER",
+ "YOU LOOK BLIND. BECAUSE YOU'RE WEARING DARK GLASSES LIKE STEVIE WONDER",
"LOOK, I'M SORRY, I DIDN'T KNOW YOU COULD SEE",
- "BUT HAVEN'T YOU JUST TOLD ME YOU WEREN'T BLIND",
+ // 60
+ "BUT YOU JUST TOLD ME YOU WEREN'T BLIND",
"BUT IF YOU CAN'T SEE",
"OOOOKAY. SORRY. IN THAT CASE, HI THERE SIGHTLESS PERSON",
"I'M JOHN HACKER. YOU MUST BE ONE OF THOSE CHARACTERS WHO WILL HELP ME OUT IN EXCHANGE FOR AN OBJECT. AREN'T YOU? EH? AREN'T YOU?",
"UUUUM, EXCUSE ME FOR ASKING BLIN... SIGHTLESS PERSON! BUT WHAT SORT OF JOB IS THAT, TO GIVE SICKLES IN EXCHANGE FOR MONEY WHILE YOU PLAY THE ACCORDION?",
+ // 65
"AH YES, I SUPPOSE THAT'S TRUE. GOODBYE SIGHTLESS PERSON... BLIND MAN",
"HERE IS THE LARGE AMOUNT OF MONEY YOU ASKED ME FOR",
- "YOU BETTER HAVE HAD",
+ "I HOPE SO",
"HI THERE FOREIGNER",
"AND HOW DO YOU KNOW I'M BLIND?",
- "AND I'M NOT KIDDING YOU BUT YOUR'S ARE LIKE WOODY ALLEN'S",
+ // 70
+ "AND I'M NOT KIDDING YOU BUT YOURS LOOK LIKE WOODY ALLEN'S",
"NO, I CAN'T SEE",
"AND I'M NOT",
- "OH OF COURSE. JUST COS I CAN'T SEE, YOU ACCUSE ME OF BEING BLIND",
- "HI THERE FOREIGNER! WHAT ARE YOU DOING IN TRANSYLVANIA?",
- "THAT'S RIGHT, FOREIGNER. IN EXCHANGE FOR A LARGE SUM OF MONEY I'LL GIVE YOU A SICKLE FOR WHEN YOU MIGHT NEED IT",
+ "OH OF COURSE. JUST BECAUSE I CAN'T SEE, YOU ACCUSE ME OF BEING BLIND",
+ "HI THERE FOREIGNER! WHAT ARE YOU DOING IN TRANSILVANIA?",
+ // 75
+ "THAT'S RIGHT, FOREIGNER. IN EXCHANGE FOR A LARGE SUM OF MONEY I'LL GIVE YOU A SICKLE YOU NEVER KNOW WHEN YOU MIGHT NEED IT",
"SHHHH, I'M A SICKLES TRADER, THAT'S WHY I HAVE TO HIDE",
"BECAUSE YOU TOLD ME BEFORE, DIDN'T YOU?",
- "THANKS FOREIGNER. HERE'S THE SICKLE IN EXCHANGE. YOU'LL FIND IT REALLY USEFUL LATER ON, HONESTLY",
+ "THANKS FOREIGNER. HERE'S THE SICKLE IN EXCHANGE. YOU'LL FIND IT REALLY USEFUL LATER ON, HONESTLY.",
+ "",
+ // 80
+ "",
+ "",
+ "NOTHING, NOTHING AT ALL",
+ "BLA, BLA, BLA."
},
{
+ // 0
"",
"\250COMO VA TODO, IGOR?",
"\255SIEMPRE QUE HAY UN BUEN PARTIDO EN LA PARABOLICA PASA LO MISMO! EN FIN, IREMOS A VERLO AL BAR COMO DE COSTUMBRE",
"AHORA IGOR, ATIENDE. VAMOS A REALIZAR LA FASE 1 DE MI PLAN PARA CONQUISTAR EL MUNDO",
"PRIMERO CAPTAREMOS UNO DE LOS RAYOS DE LA TORMENTA Y LO DESMAGNETIZAREMOS CON NUESTRO INDIFIBULADOR. LA ELECTRICIDAD PASARA A MI MONSTRUO \255Y LE DARA VIDA! ",
+ // 5
"SI TODO SALE BIEN ESTE NO SERA MAS QUE EL PRIMERO DE UN INMENSO EJERCITO QUE CONQUISTARA EL MUNDO PARA MI, JA, JA, JA",
"LOS MONSTRUOS DESTRUIRAN TODAS LAS ARMAS DE TODOS LOS EJERCITOS DEL MUNDO, MIENTRAS NOSOTROS NOS REFUGIAMOS EN UNOS TERRENOS QUE HE COMPRADO EN GIBRALTAR",
"ENTONCES, DAREMOS UN GOLPE DE ESTADO, LOS GOBIERNOS DEL MUNDO NO TENDRAN CON QUE PROTEGERSE, Y PONDRAN SUS PAISES A MIS PIES",
"\255SERE EL PRIMER MALO EN LA HISTORIA QUE LO CONSIGA! \255JUA, JUA, JUA!",
"\255A TI NADA, IDIOTA! ESTOY EXPONIENDO LA TRAMA. BIEN \250ESTA TODO LISTO?",
+ // 10
"\255LLEGO EL MOMENTO, ENTONCES! \255DALE AL INTERRUPTOR DE LAS PILAS ALCALINAS! ",
"\255MALDITA SEA! \250QUE ES LO QUE HA PODIDO FALLAR?",
"\250SEGURO QUE LO REVISASTE BIEN Y NO FALTABA NADA? ULTIMAMENTE ESTAS CON ESO DE LA RENTA QUE NO VES UN PIJO A DOS METROS",
"\255IDIOTA, NO HABIAS CONECTADO EL INDIFIBULADOR! LOS TORNILLOS SE HABRAN MAGNETIZADO Y SE LE HABRA QUEMADO EL CEREBRO",
"ESTAS MUERTO, ESTAS MUERTO, COMO TE COJA...",
+ // 15
"\255A CALLAR! MA\245ANA IRE A POR OTRO CEREBRO Y REPETIREMOS EL EXPERIMENTO ",
"NO. ESTA VEZ TRAERE UNO DE MUJER, PARA QUE ESTE NUEVECITO Y SIN ESTRENAR. JA, JA, JA, QUE MALISIMA DE CHISTA",
"\250Y QUE? YO SOY EL MALO Y SOY TODO LO MACHISTA QUE QUIERA \250ENTENDIDO? Y COMO ME VUELVAS A RECHISTAR TE TRAGAS LA CHEPA ",
"JA, JA, JA. OTRO QUE HA CAIDO. AHORA VAS A PAGAR TU OSADIA DE QUERER ACABAR CONMIGO. \255IGOR, AL PENDULO DE LA MUERTE!",
"DIME, HUMANO ESTUPIDO, \250COMO ES QUE TE HA DADO POR QUERER DESTRUIRME? ",
+ // 20
"\255QUE BONITO!, ME PONDRIA A LLORAR SI NO FUERA PORQUE ME HACE GRACIA",
"A TU NOVIA LA NECESITO PARA QUE ME AYUDE CON SU CEREBRO A CONQUISTAR EL MUNDO",
"\255SI, JA! SE LO QUITARE Y SE LO PONDRE A MI FRUSKYNSTEIN, Y CON EL DOMINARE EL MUNDO, JA, JA, JA",
"\255\250QUE?! \255ESTAS MUERTO, ESTAS MUERTO! TE VOY A... ME HAS TOCADO LAS NARICES, VAMOS. \255PREPARATE A SER MATADO!",
"JA, JA, JA. QUE TE CREES TU ESO",
+ // 25
"SI, \250VERDAD? JA, JA, JA ",
"AH, ESTA BIEN, PUEDES FUMARTE EL ULTIMO CIGARRILLO, PERO DEPRISITA",
"APAGA YA ESE CIGARRILLO, ME TIENES HARTO YA",
"Y DIME, \250ESA POCION TIENE EL EFECTO CONTRARIO?",
"ESO YA LO VEREMOS...",
+ // 30
"BUENO, A VER SI ES VERDAD. IGOR, TRAE EL COMPACT DISC DE U\245AS ARRASCANDO UNA PIZARRA",
"ESO NI SO\245ARLO. LA CHICA SE QUEDA CONMIGO, Y TU TE QUEDAS AHI HASTA QUE EL PENDULO TE CORTE EL RODAJITAS. JA, JA, JA",
"PERO QUE MALO QUE SOY, VAMOS IGOR, VAMOS A PREPARAR LA POCION Y CONQUISTAR EL MUNDO",
"\250QUE PASA AHORA?",
"SI, \250QUE PASA?... \255ANDA, EL PARTIDO!",
+ // 35
"SE ME HABIA OLVIDADO. COGE A LA CHICA Y VAMONOS A VERLE. YA CONQUISTARE EL MUNDO DESPUES",
"GRACIAS MACHO, TENIA SED",
"\255ArgH! \255ESE CRUCIFIJO! \255ESE CRUCIFIJO!...",
"QUE BONITO ES ESE CRUCIFIJO, NO ME HABIA YO FIJADO",
"DEJAME, QUE ESTOY VIENDO EL FUTBOL",
+ // 40
"",
"",
"",
"",
"",
+ // 45
"",
"",
"",
"",
"",
+ // 50
"",
"",
"",
"",
"",
+ // 55
"",
"Hola ciego. \250Que tal?",
"\250Como sabes que soy extranjero?",
"Pareces un ciego. Tienes gafas como serafin zubiri, hablas mirando al frente como Stevie Wonder...",
"Bueno, perdona. No sabia que vieses.",
+ // 60
"\250Pero no me acabas de decir que no eres ciego?",
"\255Pero si no ves!",
"Vaaaale. Perdona. En ese caso: Hola invidente.",
"Soy John Hacker, y estoy jugando al Drascula. Tu debes ser el tipico personaje que me ayudara a cambio de un objeto. \250A que si? \250Eh? \250A que si?",
"Em... Perdona que te pregunte cieg..\255Invidente!. Pero... \250Que clase de profesion es la tuya, de dar hoces a cambio de dinero, mientras tocas el acordeon?",
+ // 65
"Ah, si. Es verdad. Adios invidente...(ciego)",
"Ahi tienes la cuantiosa cantidad de dinero que me pediste.",
"Mas te vale.",
"Hola extranjero.",
"Y tu... \250Como sabes que soy ciego?",
+ // 70
"Y tu hablas como el hijo de Bill Cosby y no me meto contigo.",
"No, si no veo.",
"Y no lo soy.",
"\255Oh, claro! Como no veo se me tacha de ciego \250no?",
"\255Hola Extranjero! y \250que haces en Transilvania?",
+ // 75
"Correcto extranjero. A cambio de una cuantiosa suma de dinero, te dare una hoz, para cuando te haga falta.",
"Shhhhhh. Soy traficante de hoces, tengo que disimular.",
"Porque me lo has dicho antes \250no?",
"Gracias extranjero. Aqui tienes tu hoz a cambio. Un objeto que te sera muy util algo mas adelante... de verdad.",
+ "",
+ // 80
+ "",
+ "",
+ "No, nada",
+ "\244a, \244a, \244a. que bueno, que bueno."
},
{
+ // 0
"",
"WIE GEHTS, WIE STEHTS, IGOR ?",
"IMMER WENN auf kabel EIN GUTES SPIEL KOMMT, PASSIERT DAS GLEICHE. NAJA, DANN GUCKEN WIR ES UNS EBEN WIE IMMER IN DER KNEIPE AN",
"JETZT PASS AUF, IGOR. WIR WERDEN JETZT PHASE 1 MEINES WELTEROBERUNGSPLANS STARTEN.",
"Pah, einige GEWITTERBLITZE, die wir MIT dem VIBROXATOR ENTMAGNETISIEREN. und der strom wird meinem MONSTERCHEN leben einhauchen.",
+ // 5
"WENN ALLES KLAPPT WIRD ER DER ERSTE SOLDAT EINER RIESIGEN ARMEE SEIN, DIE DIE WELT FueR MICH EROBERN WIRD, HARHARHAR",
"DIE MONSTER WERDEN ALLE WAFFEN IN DER GANZEN WELT VERNICHTEN WaeHREND WIR UNS AUF UNSERE LaeNDEREIEN ZURueCKZIEHEN, DIE ICH UNS AUF HELGOLAND GEKAUFT HABE.",
"DANN WERDEN WIR EINEN STAATSSTREICH MACHEN UND DIE REGIERUNGEN DIESER WELT WERDEN AUFGEBEN UND SICH MIR ZU FueSSEN WERFEN",
"ICH WERDE DER ERSTE BoeSE IN DER GESCHICHTE SEIN, DER DAS SCHAFFT, HUAHUAHUA !",
"GAR NICHTS, IDIOT ! ICH ERZaeHLE DIE HANDLUNG .O.K . IST ALLES FERTIG ?",
+ // 10
"ES IST ALSO SOWEIT !DRueCK AUF DEN SCHALTER MIT DEN ALKALI-BATTERIEN !",
"VERFLIXT NOCHMAL ! WAS IST DA SCHIEFGELAUFEN ?",
"BIST DU SICHER, DASS DU ALLES GECHECKT HAST ? SEIT NEUESTEM DENKST DU NUR NOCH AN DEINE EINKOMMENSERKLaeRUNG UND KRIEGST NICHTS MEHR MIT",
"DU IDIOT !DU HAST DEN VIBROXITOR NICHT EINGESCHALTET !JETZT SIND DIE SCHRAUBEN MAGNETISIERT UND IHM WIRD WOHL DAS GEHIRN VERBRANNT SEIN",
"DU BIST EIN TOTER MANN, NA WARTE, WENN ICH DICH KRIEGE...",
+ // 15
"HALT DIE KLAPPE !MORGEN HOLE ICH EIN NEUES HIRN UND WIR WIEDERHOLEN DAS EXPERIMENT",
"NEIN, DIESMAL BESORG ICH EIN FRAUENHIRN, DASS NOCH GANZ FRISCH UND UNBENUTZT IST, HAR,HAR,HAR, SUPERJOKE !",
"NA UND ? ICH BIN DER BoeSE UND DER SUPER-MACHO ODER WAS ? UND WENN DU MIR NOCHMAL WIDERSPRICHST KANNST DU DEINEN BUCKEL SCHLUCKEN",
"HARHARHAR,SCHON WIEDER EINER. DU WARST SO DREIST, MICH UMBRINGEN ZU WOLLEN. DAS WIRST DU JETZT BueSSEN. IGOR! ZUM TODESPENDEL MIT IHM !",
"SAG MAL DU DUMMES MENSCHLEIN, WIESO WOLLTEST DU MICH ZERSToeREN ?",
+ // 20
"ACH WIE SueSS !ICH KoeNNTE GLATT ANFANGEN ZU HEULEN, WENN ES NICHT SO LUSTIG WaeRE",
"DEINE FREUNDIN BRAUCHE ICH NOCH, DAMIT SIE MIR MIT IHREM HIRN DABEI HILFT, DIE WELT ZU EROBERN",
"JA, HA !ICH WERDE ES RAUSREISSEN UND ES FRUNKSFENSTEIN GEBEN UND DANN WERDE ICH DIE WELT EROBERN,HARHARHAR",
"WAS ? !DU BIST EIN TOTER MANN! ICH WERDE DICH... DU HAST MICH VERaePPELT,GANZ KLAR . MACH DEIN TESTAMENT!",
"HARHARHAR, GLAUB DU DAS MAL ",
+ // 25
"JA, WIRKLICH ? HARHARHAR",
"JA, SCHON GUT, RAUCH DIR NOCH EINE LETZTE ZIGARETTE, ABER RUCKZUCK",
"MACH MAL DIE ZIGARETTE AUS. MIR IST SCHON SCHLECHT",
"UND SAG MAL, DIESE MISCHUNG HAT DIE GEGENWIRKUNG ?",
"DAS WERDEN WIR JA MAL SEHEN...",
+ // 30
"NA, MAL GUCKEN OB DAS STIMMT, IGOR., BRING MAL DIE CD MIT DEN DEM SOUND VON kratzenden FINGERNaeGELN AUF EINER SCHULTAFEL",
"NICHT IM TRAUM. DAS MaeDCHEN BLEIBT BEI MIR UND DU BLEIBST WO DU BIST, BIS DICH DAS PENDEL IN LECKERE SCHEIBCHEN SCHNEIDET, HARHAR",
"WIE BoeSE ICH DOCH BIN. KOMM IGOR, WIR BEREITEN DIE MISCHUNG ZU UND EROBERN DANN DIE WELT",
"WAS IST DENN JETZT WIEDER LOS ?",
"JA, WAS IST LOS ?...VERDAMMT, DAS SPIEL !",
+ // 35
"DAS HAB ICH GLATT VERGESSEN. NIMM DAS MaeDCHEN UND LASS UNS DAS SPIEL ANGUCKEN GEHEN . DIE WELT EROBERN WIR DANACH.",
"DANKE, ALTER, ICH HATTE DURST",
"ARGHH! DAS KRUZIFIX DA ! DAS KRUZIFIX !",
"WIE SCHoeN DAS KRUZIFIX DA IST, HAB ICH GAR NICHT BEMERKT",
"LASS MICH, ICH GUCK DOCH GERADE FUSSBALL",
+ // 40
"",
"",
"",
"",
"",
+ // 45
"",
"",
"",
"",
"",
+ // 50
"",
"",
"",
"",
"",
+ // 55
"",
"Hallo Blinder. Wie gehts?",
"Woher weisst Du, dass ich nicht von hier bin ?",
"Du siehst wie ein Blinder aus . Du guckst beim Sprechen immer gerade aus, und dann diese Stevie-Wonder-Brille....",
"O.k,entschuldige. Ich dachte, du kannst nichts sehen",
+ // 60
"Aber hast Du mir nicht gerade gesagt, dass Du NICHT blind bist?",
"Ich denke, Du siehst nichts ?",
"Okaaay,okaay! Tut mir leid. Also wenn das so ist: Sehkranker ",
"Ich bin Heinz Hacker und spiele Drascula . Du bist bestimmt derjenige, der mir hilft und dafuer irgendwas haben will. Stimmts? Hae? Hab ich recht!?",
"aeh....Entschuldige die Frage, Blind-Sehkranker!Aber...Was hast Du fuer einen komischen Beruf, dass Du Sicheln verkaufst und dabei Akkordeon spielst!",
+ // 65
"Ach, klar, stimmt. Auf Wiedersehen Sehkranker...(Blinder)",
"Hier hast Du den Wahnsinnsbatzen Geld, um den Du mich gebeten hast",
"Das ist auch besser so!",
"Hallo Fremder!",
"Und Du...Woher willst Du wissen, dass ich blind bin?",
+ // 70
"Und Du bist der Sohn von Bill Cosby und ich werde mich nicht mit Dir anlegen",
"Nein, ich seh doch nichts!",
"Und ich bin es nicht",
"Na super! Nur weil ich nichts sehe bin ich direkt ein Blinder, oder was?",
"Hallo Fremder! Und was machst Du in Transylvanien?",
+ // 75
"Richtig, Fremder. Gegen einen Wahnsinnsbatzen Geld bekommst Du von mir eine Sichel damit Du eine hast, wenn Du eine brauchst.",
"Psssssst. Ich bin Sichel-Dealer, ich muss unentdeckt bleiben ",
"Warum hast Du mir das nicht vorher gesagt ?",
"Danke, Fremder. Hier hast du dafuer Deine Sichel. Sie wird Dir nachher noch nuetzlich sein...glaub mir !",
+ "",
+ // 80
+ "",
+ "",
+ "No, nada",
+ "bla, bla, bla."
},
{
+ // 0
"",
"COMMENT VA TOUT, IGOR?",
"C'EST TOUJOURS LA M\322ME CHOSE QUAND IL Y A UN BON MATCH \267 LA PARABOLIQUE! ENFIN, ALLONS LE VOIR AU BAR, COMME D'HABITUDE",
"MAINTENANT, COUTE IGOR. NOUS ALLONS RALISER LA PHASE 1 DE MON PLAN POUR CONQURIR LE MONDE",
"D'ABORD, ON SAISIRA L'UNE DES FOUDRES DE L'ORAGE ET ON LA DMAGNTISERAIT AVEC l'INDIFUBULATEUR. LA COURANTE PASSERA DANS MON MONSTRE ET LUI DONNERA LA VIE!",
+ // 5
"SI TOUT VA BIEN CELUI-L\267 NE SERA QUE LE PREMIER D'UNE IMMENSE ARME QUE CONQURRA LE MONDE POUR MOI, HA! HA! HA! ",
"LES MONSTRES VONT ANANTIR TOUTES LES ARMES DE TOUTES LES ARMES DU MONDE, TANDIS QUE NOUS NOUS RFUGIONS DANS LES TERRAINS QUE J'AI ACHET \267 GIBRALTAR",
"ALORS, ON DONNERA UN COUP D'TAT. LES GOUVERNEMENTS DU MONDE N'AURONT PAS DE PROTECTION ET SES PAYS SERONT \267 MES PIEDS",
"JE SERAI LE PREMIER MALIN DE L'HISTOIRE \267 Y AVOIR RUSSI! -HOUA! HOUA! HOUA!",
"POUR TOI RIEN, IDIOT! JE PRSENTE LA TRAME. BIEN, TOUT EST PR\322T? ",
+ // 10
"LE MOMENT EST ARRIV\220, ALORS! -APPUIE DONC SUR L'INTERRUPTEUR DES BATTERIES ALCALINES! ",
"H\220LAS! QU'EST-CE QUE N'A PAS MARCH\220?",
"C'EST S\352R QUE TU L'AS BIEN R\220VIS\220 ET IL NE MANQUAIT RIEN? DERNI\324REMENT AVEC CETTE HISTOIRE DE LA RENTE TU N'Y VOIS GOUTTE",
"IDIOT! TU N'AVAIS PAS CONNECT\220 L'INFIBULATEUR! LES VIS SE SERONT MAGN\220TIS\220ES ET SA CERVELLE AURA BR\352L\220E",
"TU ES MORT, TU ES MORT, SI JE T'ATTRAPE...",
+ // 15
"TAIS-TOI! DEMAIN J'AURAI UNE AUTRE CERVELLE ET ON FERA L'ESSAI \267 NOUVEAU",
"NON, CETTE FOIS J'APPORTERAI UNE DE FEMME POUR QU'ELLE SOIT TOUTE NEUVE ET DE PREMI\324RE MAIN. HA! HA! HA! QUE MALIN DE XISTE",
"ET QUOI? JE SUIS LE MALIN ET TOUT LE SEXISTE QUE JE D\220SIRE, C'EST ENTENDU? SI TU ME R\220PLIQUES ENCORE JE TE FAIS ENGLOUTIR TA BOSSE",
"HA! HA! HA!. UN AUTRE QUI S'EST LAISS\220 PRENDRE. MAINTENANT TU PAIERAS CHER TON AUDACE DE VOULOIR EN FINIR AVEC MOI. -IGOR, AU PENDULE DE LA MORT!",
"DIS-MOI, HUMAIN STUPIDE, POURQUOI TU AS PENS\220 ME D\220TRUIRE? ",
+ // 20
"QUE C'EST BEAU! JE SANGLOTERAIS SI CE N'ETAIT PAS DR\342LE",
"J'AI BESOIN DE TA FIANC\220E POUR QU'ELLE M'AIDE \267 CONQU\220RIR LE MONDE AVEC SA CERVELLE",
"OUI, HA! JE LA LUI ARRACHERAI ET L'INSTALLERAI SUR MON FRUSKYNSTEIN, ET AVEC LUI JE VAIS MA\327TRISER LE MONDE, HA! HA! HA!",
"QUOI?! -TU ES MORT, TU ES MORT! JE VAIS TE... TU M'AS CASS\220 LE NEZ, ALLONS, -APPR\322TE-TOI \267 \322TRE TU\220!",
"HA! HA! HA! C'EST-CE QUE TU CROIS",
+ // 25
"OUI, N'EST-CE PAS? HA! HA! HA!",
"AH, C'EST BIEN! TU PEUX FUMER LA DERNI\324RE CIGARETTE, MAIS D\220P\322CHE-TOI!",
"\220TEINS D\220J\267 CETTE CIGARETTE, J'EN A RAS LE BOL!",
"ET DIS-MOIS, CETTE POTION, A-T-ELLE L'EFFET CONTRAIRE?",
"ON VERRA \200A...",
+ // 30
"EH BIEN, ON VERRA SI C'EST VRAI. IGOR, APPORTE LE COMPACT DISC D'ONGLES GRATTANT UN TABLEAU",
"N'Y PENSES PAS. LA FILLE RESTE AVEC MOI, ET TOI TU RESTERAS L\267 JUSQU'\267 QUE LA PENDULE TE COUPE EN PETITES TRANCHES. HA! HA! HA!",
"MAIS QUE JE SUIS MALIN. ON Y VA, IGOR, ALLONS PR\220PARER LA POTION ET CONQU\220RIR LE MONDE",
"QU'Y A-T-IL MAINTENANT?",
"OUI, QU'Y A-T-IL?... -TIENS, LE MATCH!",
+ // 35
"JE L'AVAIS OUBLI\220. PRENDS LA FILLE ET ALLONS LE VOIR. J'IRAI CONQU\220RIR LE MONDE PLUS TARD",
"MERCI MON VIEUX, J'AVAIS SOIF",
"ArgH! CE CRUCIFIX! -CE CRUCIFIX!...",
"C'EST BEAU CE CRUCIFIX, JE NE M'AVAIS PAS RENDU COMPTE",
"FICHE-MOI LA PAIX! JE REGARDE LE FOOT-BALL",
+ // 40
"",
"",
"",
"",
"",
+ // 45
"",
"",
"",
"",
"",
+ // 50
"",
"",
"",
"",
"",
+ // 55
"",
"BONJOUR, L'AVEUGLE. A VA?",
"POURQUOI TU SAIS QUE JE SUIS UN TRANGER?",
"TU PARAT UN AVEUGLE. TU AS DES LUNETTES COMME SERAFIN ZUBIRI ET TU PARLES EN REGARDANT DEVANT TOI, COMME STEVIE WONDER...",
"BON, EXCUSE-MOI. JE NE SAVAIS PAS QUE TU PUISSES VOIR.",
+ // 60
"MAIS, TU NE VIENS PAS DE ME DIRE QUE TU N'EST PAS AVEUGLE?",
"MAIS TU NE VOIS PAS!",
"A VA, A VA.... PARDONNE-MOI. DANS CE CAS-L: BONJOUR AVEUGLE.",
"JE SUIS JOHN HACQUER ET JE JOUE AU DRASCULA. TU ES SREMENT LE TYPIQUE PERSONNAGE QUI VA M'AIDER EN TROC D'UN OBJET. D'ACCORD? H? D'ACCORD?",
"EUH... AVEUGLE, UNE QUESTION! MAIS... QUEL GENRE DE MTIER C'EST LE TIEN? CELUI D'CHANGER DE FAUCILLES CONTRE DE L'ARGENT EN JOUANT DE L'ACCORDON?",
+ // 65
"AH, OUI! C'EST VRAI. AU REVOIR AVEUGLE...",
"VOIL LA GROSSE SOMME D'ARGENT QUE TU M'AS DEMANDE.",
"IL TE VAUX MIEUX.",
"BONJOUR, TRANGER!",
"ET TOI... COMMENT TU SAIS QUE JE SUIS UN AVEUGLE?",
+ // 70
"ET TOI TU PARLES COMME LE FILS DE BILL COSBY ET MOI, JE NE T'EMBTE PAS.",
"NON, SI JE NE VOIS PAS.",
"ET MOI, JE NE LE SUIS PAS.",
"OH, BIEN SR! COMME JE NE VOIS PAS ON ME TCHE D'AVEUGLE, N'EST-CE PAS",
"BONJOUR, TRANGER! ET QU'EST-CE QUE TU FAIS EN TRANSYLVANIE?",
+ // 75
"C'EST CORRECT, TRANGER. POUR UNE GROSSE SOMME D'ARGENT, JE TE DONNERAI UNE FAUCILLE, POUR QUAND TU EN AURAS BESOIN.",
"CHUT! JE SUIS UN TRAFICANT DE FAUCILLES, JE DOIS ME CACHER.",
"PARCE QUE TU ME L'AS DIT AVANT, N'EST-CE PAS?",
"MERCI TRANGER. VOIL TA FAUCILLE EN CHANGE. UNE CHOSE QUI SERA TRS PRATIQUE POUR TOI, PLUS TARD... VRAIMENT.",
+ "",
+ // 80
+ "",
+ "",
+ "No, nada",
+ "bla, bla, bla."
},
{
+ // 0
"",
"COME VA, IGOR?",
"-SEMPRE CHE C' UNA BUONA PARTITA SUCCEDE LO STESSO! BENE, ANDREMO A GUARDARLA AL BAR, COME SEMPRE",
"ADESSO IGOR, ASCOLTA. ANDIAMO A REALIZZARE LA FASE 1 DEL MIO PROGETTO PER CONQUISTARE IL MONDO",
"ATTRARREMO UN FULMINo DELLA TEMPESTA E LO DISMAGNETIZZAREMO CON L'INDIFIBULATORE. LA ELETTRICIT\265 ANDR\265 AL MIO MOSTRO E, GLI DAR\265 VITA!",
+ // 5
"SE TUTTO VA BENE QUESTO SAR\265 SOLTANTO IL PRIMO DI UN'IMMENSO ESERCITO CHE CONQUISTAR\265 IL MONDO PER ME, HA,HA,HA",
"I MOSTRI DISTRUGGERANNO TUTTE LE ARME DI TUTTI GLI ESERCITI DEL MONDO, MENTRE NOI CI RIFURGIAREMO nei miei terreni A GIBRALTAR",
"POI, FAREMO UN GOLPE, E I GOVERNI DEL MONDO NON AVRANNO PER DIFENDERSI, E AVR\220 LE LORO NAZIONI SOTTO I MIEI PIEDI",
"SAR\220 IL PRIMO CATTIVO DELLA STORIA CHE RIESCA!",
"A TE NIENTE, SCIOCCO! ST\220 SPORRENDO LA TRAMA. BENE, TUTTO A POSTO?",
+ // 10
"-\220 IL MOMENTO! -PREMI L'INTERRUTTORE DELLE BATTERIE ALCALINE!",
"- PORCA MISERIA! -CHE COSA NON \220 ANDATA BENE?",
"SEI SICURO DI AVERLO CONTROLLATO BENE? E NO MANCABA NIENTE? ULTIMAMENTE PER I REDDITI NON VEDI UNA MADONNA",
"IMBECILE!, NON HAI CONETTATO L'INDIFIBULATORE! LE VITI SARANO MAGNETIZZATE E ADESSO AVR\265 IL CERVELLO BRUCIATO",
"SEI MORTO, SEI MORTO, COME TI PRENDA..",
+ // 15
"STAI ZITTO! DOMANI CERCHER\220 UN ALTRO CERVELLO E RIPETEREMO L'ESPERIMENTO",
"NO. QUESTA VOLTA NE PORTER\220 UNO DI DONNA, COS\326 SAR\265 NUOVISSIMO, MAI UTILIZZATO. HA, HA HA, CHE BARZELLETA FALLITA",
"E? SONO IL CATTIVO DELLA STORIA, E SONO MASCHILISTA SE VOGLIO, CAPITO? E NON LAMENTARTI UNA ALTRA VOLTA PERCHE MANGERAI LA TUA GOBBA",
"HA,HA,HA. UN ALTRO PRESSO. ADESSO PAGHERAI MOLTO CARO QUESTA OFFESA, LA TUA INTENZIONE DI FINIRE CON ME. -IGOR, AL PENDOLO DELLA MORTE!",
"DIMI, STUPIDO UMANO, COME MAI HAI PENSATO A DISTRUGGERMI?",
+ // 20
"-CHE BELLO!, MI METTEREI A PIANGERE SE NON FOSSE PERCHE MI FA RIDERE",
"HO BISOGNO DELLA TUA RAGAZZA, IL SUO CERVELLO MI AIUTER\265 A CONQUISTARE IL MONDO",
"-SI, HA ! VADO A TOGLIARSILO PER METTEGLIELO AL MIO FRUSKYNSTEIN, E CON LUI DOMINER\220 IL MONDO, HA,HA,HA",
"CHE?! - SEI MORTO, SEI MORTO! TI VADO A...MI HAI FATTO ARRABBIARE. SEI PRONTO PER MORIRE?",
"HA,HA,HA. TU CREDI?",
+ // 25
"SI, VERO? HA,HA,HA",
"VA BENE, PUOI FUMARE LA ULTIMA SIGARETTA, MA SBRIGATI",
"SONO STUFFO, BUTTA GI\265 LA SIGARETTA!",
"E DIMI, QUELLA POZIONE HA L'EFFETTO INVERSO?",
"QUELLO SI VEDR\265 ..",
+ // 30
"BENE, SAR\265 VERO?. IGOR, DAMI IL COMPACT DISC DI UNGHIE GRAFFIANDO UNA LAVAGNA",
"NEANCHE SOGNARLO. LA RAGAZZA RIMANE CON ME, E TU RIMANI LI FINO CHE IL PENDOLO TI TAGLII IN FETTE. HA,HA,HA",
"MA COME SONO CATTIVO, ANDIAMO IGOR, ANDIAMO A FARE LA POZIONE, ANDIAMO A CONQUISTARE IL MONDO",
"ADESSO CHE SUCCEDE?",
"SI, CHE C'E?....LA PARTITA!",
+ // 35
"L'AVEVO DIMENTICATA. PRENDI LA RAGAZZA E ANDIAMO A GUARDARE IL CALCIO. CONQUISTER\220 IL MONDO DOPO",
"GRAZIE AMICO, AVEVO SETE",
"-ARGH! -QUEL CROCIFISSO! -QUEL CROCIFISSO!...",
"QUE BELLO \220 QUEL CROCIFISSO, NON MI ERO ACCORTO",
"LASCIAMI, ST\220 GUARDANDO LA PARTITA",
+ // 40
"",
"",
"",
"",
"",
+ // 45
"",
"",
"",
"",
"",
+ // 50
"",
"",
"",
"",
"",
+ // 55
"",
"Ciao cieco. Come va?.",
"Come sai che sono straniero.",
"Sembri un cieco. Hai gli occhiali come il cieco di Sorrento, parli guardando all'infinito come Stevie Wonder..",
"Bene, scusa. Non sapevo che non vedessi",
+ // 60
"Ma non mi hai appena detto che non sei cieco?.",
"- Ma se non vedi!.",
"Beeeene. Scusa. Allora: Ciao : non vedente",
"Sono John Hacker, st giocando al Drascula. Tu devi proprio essere il tipico personaggio che mi aiuter in cambio di un oggeto. Vero...?",
"Ma... Scusa ciec..- non vedente! .Ma.. . che tipo di mestiere il tuo, di dare falci per soldi, mentre suoni la fisarmonica?.",
+ // 65
"Ah, si. \324 vero. Ciao non vedente....(cieco)",
"Ecco la abbondante quantit di soldi che mi avevi chiesto.",
"Mi raccomando",
"Ciao straniero.",
"E tu... Come sai che sono cieco?",
+ // 70
"E tu parli come il figlio di Bill Cosby e non ti offendo.",
"No, se non vedo.",
"E non lo sono.",
"-Oh, certo!. Come non vedo mi chiamano cieco, no?.",
"-Ciao Straniero! e cosa fai in Transilvania?",
+ // 75
"Corretto straniero. Per una abbondante quantit di soldi, ti dar in cambio una falce, per quando ne avrai bisogno.",
"Shhhhhh. Sono trafficante di falci, devo proprio dissimulare.",
"Perche mi lo hai detto prima, no?",
"Grazie straniero. Ecco la tua falce. Un oggeto che ti sar molto utile pi avanti...... davvero.",
+ "",
+ // 80
+ "",
+ "",
+ "No, nada",
+ "bla, bla, bla."
},
};
-const char *_textb[][15] = {
+const char *_textb[NUM_LANGS][NUM_TEXTB] = {
{
+ // 0
"",
"I'M HERE, DRINKING",
- "THEY ARE ALL DEAD, THANKS. BURPP...",
+ "THEY ARE ALL DEAD, THANKS. HIC...!",
"YES, SURE...",
- "SHE FEELS ATTRACTED TO UNCLE DESIDERIO",
+ "SHE IS ATTRACTED TO UNCLE DESIDERIO",
+ // 5
"EVEN BETTER, UNCLE DESIDERIO'S DEAD BODY",
- "MY UNCLE. HE WENT TO CASTLE AND NEVER CAME BACK",
+ "MY UNCLE. HE WENT TO THE CASTLE AND NEVER CAME BACK",
"WELL, HE CAME BACK JUST A LITTLE. IF ONLY VON BRAUN HADN'T SCREWED THINGS UP MY UNCLE WOULD BE DRINKING WITH US NOW",
"NOTHING...",
- "WELL, YES !. THAT MEAN MAN HAS TERRIFIED US ALL",
+ "WELL, YES! THAT MEAN MAN HAS TERRIFIED US ALL",
+ // 10
"FROM TIME TO TIME HE COMES DOWN TO THE VILLAGE AND TAKES SOMEONE WITH HIM.",
- "A LITTLE WHILE AFTER WE JUST A FEW FOUND BODY PARTS. I THINK HE IS DEALING WITH ORGANS OR SOMETHING LIKE THAT",
- "THE ONLY PERSON IN THE VILLAGE WHO KNOWS HOW TO END UP WITH DRASCULA IS A CULTIVATED PERSON",
+ "A LITTLE WHILE AFTER WE FOUND A FEW BODY PARTS. I THINK HE IS DEALING IN ORGANS OR SOMETHING LIKE THAT",
+ "THE ONLY PERSON IN THE VILLAGE WHO KNOWS HOW TO GET TO DRASCULA IS A CULTIVATED PERSON",
"HE LIVES IN A LOG-CABIN OUT OF TOWN, EVER SINCE DRASCULA BEAT HIM UP",
- "HE IS THE ONLY ONE WHO COULD HELP US WITH DRASCULA, AND HE DOESN'T WANT TO HEAR ABOUT US. HOW DO YOU LIKE THAT?",
+ "HE IS THE ONLY ONE WHO COULD HELP US WITH DRASCULA, AND HE DOESN'T WANT TO HEAR ABOUT IT. HOW DO YOU LIKE THAT?",
},
{
+ // 0
"",
"AQUI, BEBIENDO",
"MUERTOS TODOS. GRACIAS. BURRP ",
"SI, NO VEAS... ",
"ESTA POR EL TIO DESIDERIO",
+ // 5
"Y ESTA OTRA, POR EL CADAVER DEL TIO DESIDERIO",
"MI TIO. FUE AL CASTILLO Y NO VOLVIO",
"BUENO, VOLVIO PERO POCO. SI EL VON BRAUN NO HUBIESE METIDO LA PATA MI TIO ESTARIA AQUI BEBIENDO",
"NADA... ",
"\255BUENO, SI! ESE DESALMADO NOS TIENE ATEMORIZADOS A TODOS",
+ // 10
"DE VEZ EN CUANDO BAJA AL PUEBLO Y SE LLEVA A ALGUIEN",
"POCO DESPUES SOLO ENCONTRAMOS UNOS POCOS RESTOS. CREO QUE ESTA TRAFICANDO CON ORGANOS, O ALGO ASI",
"EL UNICO DEL PUEBLO QUE SSABE COMO ACABAR CON DRASCULA TIENE ESTUDIOS",
@@ -2989,16 +4219,19 @@ const char *_textb[][15] = {
"ES EL UNICO QUE PODRIA AYUDARNOS A ACABAR CON DRASCULA, Y NO QUIERE SABER NADA DE NOSOTROS. \250QUE TE PARECE A TI?",
},
{
+ // 0
"",
"HIER, BEI EINEM GUTEN TROPFEN",
"ALLE TOT. VIELEN DANK. RueLPS !",
"YO, STIMMT...",
"DIE HIER IST FueR ONKEL DESIDERIUS",
+ // 5
"UND DIESE HIER FueR DIE LEICHE VON ONKEL DESIDERIUS",
"MEIN ONKEL. ER GING ZUM SCHLOSS UND KAM NICHT ZURueCK",
"NAJA, ER KAM NUR IN RESTEN ZURueCK. WENN VON BRAUN SICH NICHT VERTAN HaeTTE, WueRDE ER JETZT MIT UNS EINEN HEBEN",
"NICHTS...",
"JA STIMMT! DIESER SCHURKE JAGT UNS ALLEN EINE RIESENANGST EIN",
+ // 10
"AB UND ZU GEHT ER RUNTER INS DORF UND HOLT SICH JEMANDEN",
"KURZ DANACH HABEN WIR NUR NOCH RESTE GEFUNDEN, ICH GLAUBE ER HANDELT MIT ORGANEN ODER SO",
"DER EINZIGE, DER MIT DRASCULA FERTIGWERDEN KANN, WAR AN DER UNI ",
@@ -3006,16 +4239,19 @@ const char *_textb[][15] = {
" ER IST DER EINZIGE, DER DRASCULA ERLEDIGEN KoeNNTE UND WILL NICHTS VON UNS WISSEN. WAS HaeLST DU DAVON ?",
},
{
+ // 0
"",
"ICI, EN BUVANT",
"TOUS MORTS. MERCI. BOURRP",
"OUI, VRAIMENT...",
"CELLE-CI POUR L'ONCLE DSIR",
+ // 5
"ET CELLE-L\267 POUR LE CADAVRE D'ONCLE DSIR",
"MON ONCLE EST ALL AU CH\266TEAU ET N'EST PAS ENCORE REVENU",
"BON, IL EST REVENU MAIS POUR PEU DE TEMPS. SI VON BRAUN N'AURAIT FAIT UN IMPAIR, MON ONCLE DSIR SERAIT ICI EN BUVANT",
"RIEN... ",
"EH OUI! CE MALIN NOUS A INTIMIDS \267 TOUS",
+ // 10
"DE FOIS IL DESCEND SUR LE VILLAGE ET ENLEVE QUELQU'UN",
"UN PEU PLUS TARD ON NE TROUVE QUE QUELQUES RESTES. JE PENSE QU'IL FAIT DU TRAFIQUE D'ORGANES, OU QUELQUE CHOSE PAREILLE",
"LE SEUL DU VILLAGE QUI SAIT COMMENT FINIR AVEC DRASCULA IL A DES \220TUDES",
@@ -3023,16 +4259,19 @@ const char *_textb[][15] = {
"C'EST LE SEUL QUI POURRAIT NOUS AIDER \267 FINIR AVEC DRASCULA ET LUI NE VEUX RIEN SAVOIR DE NOUS. QU'EN PENSES-TUI?",
},
{
+ // 0
"",
"QU\326, BEVENDO",
"MORTI TUTTI. GRAZIE. BURRP",
"SII, CERTO, SICURO..",
"QUESTA PER IL ZIO PEPPINO",
+ // 5
"E QUEST'ALTRA, PER IL CADAVERE DEL ZIO PEPPINO",
"MIO ZIO. FU ANDATO AL CASTELLO, E NON MAI TORNATO",
"EEEHH, TORN\220, MA PER POCO TEMPO. SE IL VON BRAUN NON AVESSE SBAGLIATO, MIO ZIO SAREBBE QU\326 BEVENDO",
"NIENTE..",
"EEH,SI! QUEL MALVAGIO CI HA INTIMORATI",
+ // 10
"A VOLTE SCENDE AL PAESE E QUANDO SE NE VA SI PORTA QUALCUNO",
"UN P\220 DOPO SOLTANTO TROVIAMO QUALQUE RESTO. CREDO CHE TRAFFICA ORGANI O QUALCOSA DEL GENERE",
"L'UNICO DEL PAESE CHE SA COME FINIRE CON DRASCULA \220 UNO CHE HA STUDIATO",
@@ -3041,157 +4280,187 @@ const char *_textb[][15] = {
},
};
-const char *_textbj[][29] = {
+const char *_textbj[NUM_LANGS][NUM_TEXTBJ] = {
{
+ // 0
"",
"ARE YOU ALL RIGHT? HEY, COME ON, WAKE UP! CAN YOU HEAR ME? ARE YOU DEAD?",
"NO, MY NAME IS BILLIE JEAN, BUT YOU CAN CALL ME B.J. IT'S SHORTER",
"HA, HA...! THAT WAS A GOOD ONE!",
- "WELL, JHONNY. YOU SEE, I WAS HERE JUST READY TO GO TO BED WHEN I HEARD THIS STRONG NOISE DOWN THE CORRIDOR",
+ "WELL, JOHNNY. YOU SEE, I WAS HERE JUST READY TO GO TO BED WHEN I HEARD THIS LOUD NOISE DOWN THE CORRIDOR",
+ // 5
"I DIDN'T PAY ATTENTION AT FIRST, BUT AFTER ABOUT TWO HOURS OR SO I COULDN'T SLEEP AND WENT OUT FOR A WALK",
"AS I OPENED THE DOOR I WAS SHOCKED TO FIND YOU THERE, LYING ON THE FLOOR. I THOUGHT YOU WERE DEAD, I SWEAR... HA, HA, SILLY BILLY",
"I WAS GOING TO GIVE YOU THE KISS OF LIFE BUT IT WASN'T NECESSARY BECAUSE YOU STARTED TO TALK",
- "YOU SAID SOMETHING ABOUT A SCARECROW. I WAS VERY SCARED, YOU KNOW. IT'S A REAL SHOCK WHEN A DEAD PERSON STARTS TALKING RIGHT?",
- "ISN'T THAT RIGHT? WELL, THEN I MANAGED TO BRING YOU TO MY ROOM THE BEST WAY I COULD. I PUT YOU IN BED... AND THAT'S ALL... HA, HA, HA...",
- "OH, NO...! IT WASN'T THE HIT, HA, HA. I JUST STEEPED ON YOUR GLASSES BY ACCIDENT",
+ "YOU SAID SOMETHING ABOUT A SCARECROW. I WAS VERY SCARED, YOU KNOW. IT'S A REAL SHOCK WHEN A DEAD PERSON STARTS TALKING?",
+ "ISN'T THAT RIGHT? WELL, THEN I MANAGED TO BRING YOU TO MY ROOM THE BEST WAY I COULD. I PUT YOU IN MY BED... AND THAT'S ALL... HA, HA, HA...",
+ // 10
+ "OH, NO...! IT WASN'T THE HIT, HA, HA. I JUST STEPPED ON YOUR GLASSES BY ACCIDENT",
"YOU REALLY LOOK GOOD WITH THOSE GLASSES. I KNOW HE'S NOT FERNANDO LANCHA, BUT I FIND HIM ATTRACTIVE...",
"YES, YES, I DO... COME ON, HOLD ME AND KISS ME TIGHT",
- "OH JHONNY, HONEY, THANKS GOD YOU'RE HERE... THAT DAMNED DRASCULA TIED ME UP TO THE BED AND THEN HE'S GONE DOWNSTAIRS TO SEE THE FOOTBALL GAME",
+ "OH JOHNNY, HONEY, THANK GOD YOU'RE HERE... THAT DAMNED DRASCULA TIED ME UP TO THE BED AND HE'S GONE DOWNSTAIRS TO WATCH THE FOOTBALL GAME",
"YES, IT'S TRUE. PLEASE, SET ME FREE",
- "NO, I'M SORRY. I USED THEM ALL IN THE TOWER WHEN I WAS TRYING TO LIBERATE WHILE YOU LET ME DOWN",
+ // 15
+ "NO, I'M SORRY. I USED THEM ALL IN THE TOWER WHEN I WAS TRYING TO ESCAPE WHILE YOU LET ME DOWN",
"JOHNNY, IS THAT YOU? OH, GOD, GREAT! I KNEW YOU'D COME!",
- "YOU DON'T EVEN KNOW HOW MUCH THAT EVIL DRASCULA HAS MADE ME SUFFER",
- "FIRSTLY HE BROUGHT ME FLYING OVER HER AND THEN PUT ME IN THIS DISGUSTING ROOM WITHOUT EVEN A MIRROR OR ANYTHING",
- "I'M TELLING YOU! AND THE WORSE PART IS THAT HE DIDN'T EVEN APOLOGIZE, NOT EVEN ONCE",
- "JHONNY HONEY, WHERE ARE YOU?",
+ "YOU DON'T KNOW HOW MUCH THAT EVIL DRASCULA HAS MADE ME SUFFER",
+ "FIRSTLY HE BROUGHT ME FLYING OVER HERE AND THEN PUT ME IN THIS DISGUSTING ROOM WITHOUT A MIRROR OR ANYTHING",
+ "I'M TELLING YOU! AND THE WORST PART IS THAT HE DIDN'T EVEN APOLOGIZE, NOT EVEN ONCE",
+ // 20
+ "JOHNNY HONEY, WHERE ARE YOU?",
"I'M READY TO LEAVE DEAR",
"WAIT, I'M GOING TO TAKE A LOOK... NO DARLING, I'M SORRY",
"THERE YOU GO...",
"\"DEAR JOHNNY\"",
+ // 25
"I'LL NEVER FORGET YOU BUT I'VE REALIZED THAT THIS JUST COULDN'T WORK OUT RIGHT. TO BE HONEST, I'LL TELL YOU THAT THERE IS ANOTHER MAN. HE'S TALLER, STRONGER",
"AND HE HAS ALSO RESCUED ME FROM DRASCULA. HE HAS ASKED ME TO MARRY HIM, AND I HAVE ACCEPTED",
- "BYE JHONNY. PLEASE DON'T TRY TO FIND SOME KIND OF EXPLANATION. YOU KNOW LOVE IS BLIND AND HAS ITS OWN WAYS",
+ "BYE JOHNNY. PLEASE DON'T TRY TO FIND SOME KIND OF EXPLANATION. YOU KNOW LOVE IS BLIND AND HAS IT'S OWN WAYS",
"I HOPE THERE WON'T BE HARD FEELINGS BETWEEN US. REMEMBER THAT I STILL LOVE YOU, BUT ONLY AS A FRIEND",
},
{
+ // 0
"",
"\250ESTA USTED BIEN? OIGA, DESPIERTE. \250ME OYE? \250ESTA USTED MUERTO?",
"NO, MI NOMBRE ES BILLIE JEAN, PERO PUEDES LLAMARME B.J. ES MAS CORTO",
"\255JI, JI! \255QUE BUENO!",
"PUES VERAS JOHNY, YO ESTABA AQUI, DISPUESTA A ACOSTARME, CUANDO OI UN FUERTE GOLPE EN EL PASILLO",
+ // 5
"AL PRINCIPIO NO LE DI MUCHA IMPORTANCIA, PERO A LAS DOS HORAS MAS O MENOS DESCUBRI QUE NO PODIA DORMIR Y DECIDI SALIR A DAR UN PASEO",
"Y CUAL NO SERIA MI SORPRESA CUANDO ABRI LA PUERTA Y TE ENCONTRE AHI, EN EL SUELO TIRADO. TE LO JURO QUE PENSE QUE HABIAS MUERTO, JE, JE, TONTA DE MI",
"TE FUI A HACER EL BOCA A BOCA, PERO NO FUE NECESARIO PORQUE EMPEZASTE A HABLAR",
"DECIAS NO SE QUE DE UN ESPANTAPAJAROS. YO ME LLEVE UN SUSTO MUY GORDO, PORQUE CUANDO UN MUERTO SE PONE A HABLAR ES UNA IMPRESION MUY FUERTE, \250NO CREES?",
"\250VERDAD QUE SI? BUENO, PUES COMO PUDE, CARGUE CONTIGO Y TE TRAJE A MI HABITACION. TE PUSE SOBRE LA CAMA... Y ESO ES TODO. JI, JI,JI",
+ // 10
"OH, NO HA SIDO EL GOLPE, JI, JI. ES QUE SIN QUERER PISE TUS GAFAS",
"\255HAY QUE VER QUE BIEN LE SIENTAN LAS GAFAS! YA SE QUE NO ES FERNANDO LANCHA, PERO TIENE UN NO SE QUE QUE QUE SE YO",
"SI, SI, QUIERO... VAMOS, ABRAZAME FUERTE, BESAME MUCHO...",
"OH JOHNY, CARI\245O, MENOS MAL QUE HAS VENIDO. ESE DESALMADO DE DRASCULA ME HA ATADO A LA CAMA Y LUEGO SE HA IDO ABAJO A VER EL PARTIDO",
"SI, ES VERDAD. LIBERAME ",
+ // 15
"NO, LO SIENTO. GASTE TODAS EN LA MAZMORRA INTENTANDO LIBERARME MIENTRAS TU ME DEJABAS TIRADA",
"JOHNY \250ERES TU? \255QUE ALEGRIA! \255SABIA QUE VENDRIAS!",
"NO SABES CUANTO ME HA HECHO SUFRIR ESE DESALMADO DE DRASCULA",
"PRIMERO ME TRAJO VOLANDO HASTA AQUI Y LUEGO ME ENCERRO EN ESTE CUARTUCHO, SIN ESPEJO NI NADA",
"COMO LO OYES. Y LO PEOR ES QUE NO PIDIO PERDON NI UNA SOLA VEZ",
+ // 20
"JOHNY, QUERIDO. \250DONDE ESTAS?",
"ESTOY LISTA PARA QUE ME SAQUES DE AQUI",
"ESPERA QUE VOY A MIRAR... NO CARI\245O, LO SIENTO",
"TOMA...",
"\"QUERIDO JOHNY:",
+ // 25
"NUNCA PODRE OLVIDARTE, PERO ME HE DADO CUENTA DE QUE LO NUESTRO NO FUNCIONARIA. VOY A SER SINCERA CONTIGO: HAY OTRO HOMBRE; MAS ALTO, MAS FUERTE...",
"Y ADEMAS ME HA RESCATADO DE LAS MANOS DE DRASCULA. ME HA PEDIDO EN MATRIMONIO, Y YO HE ACEPTADO",
"ADIOS, JOHNY. NO INTENTES DARLE UNA EXPLICACION, PORQUE EL AMOR ES CIEGO Y NO ATIENDE A RAZONES",
"ESPERO QUE NO ME GUARDES RENCOR, Y RECUERDA QUE TE SIGO QUERIENDO, AUNQUE SOLO COMO AMIGO\"",
},
{
+ // 0
"",
"HALLO, ALLES KLAR ?HEY, WACHEN SIE AUF. HoeREN SIE MICH ? SIND SIE TOT ?",
"NEIN, ICH HEISSE BILLIE JEAN., ABER DU KANNST MICH B.J. NENNEN, DAS IST KueRZER",
"HI,HI! SUPERGUT !",
"JA STELL DIR VOR, HEINZ, ICH WOLLTE MICH HIER GERADE HINLEGEN, ALS ICH EINEN LAUTEN KNALL IM FLUR HoeRTE",
+ // 5
"ANFANGS HAB ICH NICHT SO DRAUF GEACHTET, ABER NACHDEM ICH 2 STUNDEN LANG NICHT SCHLAFEN KONNTE, GING ICH RUNTER, UM SPAZIERENZUGEHEN",
- "ICH WAR NATueRLICH BAFF, ALS ICH DICH VOR der tuer LIEGEN SAH. ICH HABE ECHT GEDACHT,DASS DU TOT BIST, HEHE, WIE bloed"
+ "ICH WAR NATueRLICH BAFF, ALS ICH DICH VOR der tuer LIEGEN SAH. ICH HABE ECHT GEDACHT,DASS DU TOT BIST, HEHE, WIE bloed",
"ICH WOLLTE GERADE MUND-ZU-MUND BEATMUNG MACHEN, ABER DANN FINGST DU JA AN ZU REDEN",
"DU FASELTEST WAS VON NER VOGELSCHEUCHE UND ICH Hatte ganz schoen schiss,WEIL sprechende tote schon echt UNHEIMLICH sind?",
"NICHT WAHR ?NAJA,ICH HABE DICH DANN AUFGEHOBEN UND IN MEIN ZIMMER GETRAGEN UND AUF MEIN BETT GELEGT.... WEITER NICHTS. HI,HI,HI",
+ // 10
"ACH NEIN, ES WAR NICHT DIE BEULE, HIHI, ICH BIN VERSEHENTLICH AUF DEINE BRILLE GETRETEN ",
"MAN MUSS SICH ECHT MAL ANGUCKEN, WIE GUT IHM DIE BRILLE STEHT. ER IST ZWAR NICHT DER MARTINI-MANN, ABER ER HAT WAS WEISS ICH WAS",
"JA, JA, ICH WILL. KOMM NIMM MICH UND KueSS MICH...",
"OH HEINZ, LIEBLING, GUT DASS DU DA BIST. DIESER WueSTLING VON DRASCULA HAT MICH ANS BETT GEFESSELT UND IST DANN RUNTER UM SICH DAS SPIEL ANZUSEHEN",
"JA, WIRKLICH. BEFREIE MICH",
+ // 15
"NEIN, TUT MIR LEID. ICH HAB ALLE BEIM VERSUCH, AUS DEM VERLIES AUSZUBRECHEN, AUFGEBRAUCHT",
"HEINZ, BIST DU ES ? WIE TOLL ! ICH WUSSTE, DASS DU KOMMEN WueRDEST !",
"DU AHNST JA NICHT, WIE SEHR ICH WEGEN DIESEM UNGEHEUER VON DRASCULA GELITTEN HABE",
"ZUERST IST ER MIT MIR HIERHER GEFLOGEN UND DANN HAT ER MICH IN DIESES LOCH GESPERRT, OHNE SPIEGEL UND GAR NICHTS",
"WIE ICHS GESAGT HABE. DAS SCHLIMMSTE IST,DASS ER SICH KEIN EINZIGES MAL ENTSCHULDIGT HAT.",
+ // 20
"HEINZ, GELIEBTER, WO BIST DU ?",
"ICH BIN BEREIT, VON DIR GERETTET ZU WERDEN",
"WARTE, ICH GUCK MAL...NEIN, SCHATZ, TUT MIR LEID",
"HIER NIMM...",
"LIEBER HEINZ !",
+ // 25
"ICH WERDE DICH NIE VERGESSEN, aber das mit uns funktioniert nicht.ICH gebs zu : ES GIBT EINEN ANDERN. GRoeSSER,STaeRKER...",
"UND AUSSERDEM HAT ER MICH AUS DRASCULAS KLAUEN BEFREIT UND UM MEINE HAND ANGEHALTEN,UND ICH HABE JA GESAGT",
"LEB WOHL,HEINZ. VERSUCH NICHT EINE ERKLaeRUNG ZU FINDEN, DENN DIE LIEBE IST BLIND UND KENNT KEINE VERNUNFT",
"DU BIST MIR HOFFENTLICH NICHT BoeSE. DENK IMMER DARAN DASS ICH DICH IMMER NOCH LIEBE, WENN AUCH NUR ALS FREUND",
},
{
+ // 0
"",
"VOUS ALLEZ BIEN? ALLEZ, REVEILLEZ-VOUS! VOUS M'ENTENDEZ? VOUS \322TES MORT?",
"NON, MON NOM EST BILLIE JEAN, MAIS TU PEUX M'APPELLER B.J., C'EST PLUS COURT",
"HI! HI! -C'EST BON!",
"EN VRIT JOHNY, J'TAIS L\267, PR\322TE \267 ME COUCHER, ET J'AI ENTENDU UN FORT COUP DANS LE COULOIR",
+ // 5
"AU DBUT JE N'Y AI PAS DONN D'IMPORTANCE, MAIS APR\324S JE ME SUIS RENDUE COMPTE QUE NE POUVAIS PAS M'ENDORMIR ET SUIS SORTIE FAIRE UNE PROMENADE",
"ET \267 MON GRAN TONNEMENT, QUAND J'AI OUVERT LA PORTE, JE T'AI TROUV L\267, PAR TERRE. J'TAIS SUR LE POINT DE PENSER QUE TU AVAIS MORT, HE!, QUE JE SUIS B\322TE!",
"J'ALLAIS TE FAIRE LE BOUCHE-\267-BOUCHE MAIS IL N'A T PAS NCESSAIRE PUISQUE TU AS COMMENC \267 PARLER",
"TU DISAIS \267 SAVOIR QUOI D'UN POUVANTAIL. CELA M'A FAIT UNE GRANDE PEUR, PARCE QUE QUAND UN MORT SE MET \267 PARLER L'IMPRESSION EST TR\324S FORTE, NE CROIS-TU PAS?",
"C'EST VRAI, NON? ENFIN. JE ME SUIS DBROUILLE POUR TE PRENDRE SUR MOI, T'EMMENER DANS MA CHAMBRE ET T'INSTALLER SUR LE LIT... ET VOIL\267 TOUT. HI! HI! HI!",
+ // 10
"HO! CE N'EST PAS \267 CAUSE DU COUP, HI! HI! CE QUE J'AI MARCHE SUR TES LUNETTES PAR ACCIDENT",
"\220VIDEMMENT LES LUNETTES LUI FONT DU BIEN! JE SAIS BIEN QUIL N'EST PAS FERNANDO LANCHA, MAIS IL A UN AIR QU'ALLEZ DONC SAVOIR",
"OUI, OUI, JE VEUX... VAS-Y, EMBRASSE-MOI FORT, EMBRASSE-MOI BEAUCOUP...",
"OH,JOHNY!, MON AMOUR! HEUREUSEMENT QUE TU ES VENU. CE M\220CHANT DRASCULA M'A ATTACH\220 AU LIT ET APR\324S IL EST PARTI EN BAS VOIR LE MATCH",
"OUI, C'EST VRAI, LIB\324RE-MOI",
+ // 15
"NON, SUIS D\220SOL\220E. JE LES AI TOUTES UTILIS\220ES, DANS LE CACHOT, EN T\266CHANT DE ME LIB\220RER ALORS QUE TOI TU M'ABANDONNAIS",
"JOHNY, C'EST TOI? -QUELLE JOIE! -JE SAVAIS QUE TU VIENDRAIS!",
"TU NE PEUX PAS SAVOIR COMBIEN M'A FAIT SOUFFRIR CE M\220CHANT DRASCULA",
"D'ABORD IL M'EMMEN\220 EN VOLANT JUSQU'ICI ET APR\324S IL M'ENFERM\220E DANS CE TAUDIS, SANS MIROIR NI RIEN D'AUTRE",
"COMME TU L'ENTENDS. ET LE PIRE C'EST QUIL NE M'A PAS DEMAND\220 PARDON N'UNE SEULE FOIS ",
+ // 20
"JOHNY, MON CH\220RI, O\353 EST-CE QUE TU ES?",
"JE SUIS PR\322TE POUR QUE TU M'EN SORTES D'ICI",
"ATTEND, JE VAIS REGARDER... NON CH\220RI, JE REGRETTE",
"TIENS...",
"\"CHER JOHNY",
+ // 25
"JAMAIS JE T'OUBLIERAI, MAIS JE ME SUIS APER\200UE QUE NOTRE AFFAIRE NE POUVAIT PAS MARCHER. JE VAIS \322TRE SINC\324RE AVEC TOI: IL Y A UN AUTRE HOMME, PLUS GRAND...",
"ET ENCORE IL M'A LIB\220R\220 DES MAINS DE DRASCULA. IL M'A DEMAND\220 EN MARIAGE, ET MOI J'AI ACCEPT\220",
"AU REVOIR, JOHNY. N'Y CHERCHES PAS UNE EXPLICATION, L'AMOUR EST AVEUGLE ET N'\220COUTE PAS DES RAISONS",
"J'ESP\324RE QUE TU SERAS SANS RANCUNE, ET N'OUBLIES PAS QUE JE T'AIME ENCORE, MAIS EN AMI SEULEMENT\"",
},
{
+ // 0
"",
"ST\265 BENE? SENTA, PUO SENTIRMI? SI \220 MORTO?",
"NO, IL MIO NOME BILLIE JEAN, MA PUOI CHIAMARMI B.J. PI \351 BREVE",
"HI,HI!- CHE BUONO!",
"NON SO JOHNY, ERO QU\326, STAVO PER ADDORMENTARMI, QUANDO HO SENTITO UN FORTE RUMORE NEL CORRIDOIO",
+ // 5
"PRIMA NON GLI HO DATTO IMPORTANZA, MA DUE ORE DOPO HO SCOPERTO CHE NON RIUSCIVO A ADDORMENTARMI E SONO uscita A FARE QUATTRO PASSI",
"E FIGURATI LA SORPRESA QUANDO HO APERTO LA PORTA E TI HO TROVATO PER TERRA. TI GIURO, HO PENSATO CH'ERI MORTO..., MA COME SONO SCIOCCA",
"VOLEVO FARTI IL BOCCA A BOCCA, MA NON C'ERA BISOGNO PERCHE SUBITO HAI COMINCIATO A PARLARE",
"HAI DETTO NON SO CHE DI UN SPAVENTAPASSERI. CHE COLPO.....!, PERCHE QUANDO UN MORTO SI METTE A PARLARE FA UN COLPO GRANDISSIMO!",
"VERO DI SI? NON SO COME SONO RIUSCITA, TI HO TRASPORTATO ALLA MIA CAMERA, TI HO MESSO SUL MIO LETTO E.... NIENTE PI\351 .",
+ // 10
"NO, NON \220 STATA LA BOTTA, HI, HI. \220 PERCHE ... HO PESTATO I TUOI OCCHIALI",
"MAMMA MIA MA COM'\220 BELLO CON GLI OCCHIALI! SO CHE NON \220 FERNANDO LANCHA, MA HA QUALCOSA CHE MI PIACE MOLTISSIMO",
"SI,SI, VOGLIO... ABBRACIAMI FORTE, BACIAMI MOLTO..",
"OH JOHNY, CARO, MENO MALE CHE SEI VENUTO. QUEL MALVAGIO, DRASCULA, MI HA LEGATO AL LETTO E POI SE NE \220 ANDATO A GUARDARE LA PARTITA",
"SI, \220 VERO, LIBERAMI",
+ // 15
"NO, MI DISPIACE. HO UTILIZZATO TUTTE IN CARCERE PROBANDO LIBERARMI QUANDO TU MI AVEVI LASCIATA",
"JOHNY, SEI TU? - BENISSIMO. LO SAPEVO ",
"NON TI FIGURI QUANTO MI HA FATTO SOFFRIRE DRASCULA",
"PRIMA MI HA PORTATO VOLANDO FINO QUA E POI MI HA RICHIUSA IN QUESTA CAMERACCIA CHE NON HA N\220 UNO SPECCHIO",
"COME HAI SENTITO. E LO PEGLIORE: N\220 UNA VOLTA SI \220 SCUSATO",
+ // 20
"JOHNY, CARO. DOVE SEI?",
"SONO PRONTA, FAMI USCIRE DA QU\326 ",
"ASPETTA, VADO A GUARDARE... NO CARO, MI DISPIACE",
"PRENDI..",
"\"CARO JOHNY:",
+ // 25
"MAI POTR\220 DIMENTICARTI, MA NON SAREMO MAI FELICI INSIEME. SAR\220 SINCERA CON TE : C'\220 NE UN ALTRO; PI\351 ALTO, PI\351 FORTE..",
"ANZI MI HA LIBERATO DA DRASCULA. MI HA CHIESTO LA MANO E HO DETTO DI SI",
"ADIO JOHNY. NON CERCARE UNA SPIEGAZIONE, PERCHE L'AMORE \220 CIECO.",
@@ -3200,132 +4469,157 @@ const char *_textbj[][29] = {
};
-const char *_texte[][24] = {
+const char *_texte[NUM_LANGS][NUM_TEXTE] = {
{
+ // 0
"",
"YOU... HEY YOU!",
"DON'T GIVE ME THAT CRAP ABOUT A DEAD BODY OK?",
"I'M ALIVE. IT'S JUST THAT I'M STARVING",
"WELL, YOU SEE. I WAS THE DRUNKARD OF THE VILLAGE, JUST KEEPING UP WITH THE FAMILY TRADITION, YOU KNOW? ONE NIGHT DRASCULA KIDNAPPED ME TO TAKE MY ORGANS AWAY",
+ // 5
"SINCE ALCOHOL STILL KEEPS ME QUITE YOUNG, I'M HERE LIKE A SCRAP YARD. EVERYTIME HE NEEDS SOMETHING FOR THE MONSTER HE IS MAKING, HE COMES AND TAKES IT FROM ME",
"IT HURT AT FIRST, BUT I DON'T CARE ANYMORE",
"I DON'T KNOW. I GUESS IT'S HIS GRADUATE PROJECT",
- "I'M DESIDERIO, AND I CAN HELP YOU IN ANYTHING YOU NEED",
+ "I'M DESIDERIO, AND I CAN HELP YOU WITH ANYTHING YOU NEED",
"THE TRUTH IS THAT I DON'T REALLY FEEL LIKE IT, BUT THANKS VERY MUCH ANYWAY SIR",
- "YEAH, IT'S YOU",
- "WHY DO ALL ADVENTURE GAMES END UP WITH A SUNRISE OR A SUNSET?",
+ // 10
+ "TAKE IT, IT'S YOURS",
+ "WHY DO ALL ADVENTURE GAMES END WITH A SUNRISE OR A SUNSET?",
"DO ALL THESE NAMES BELONG TO THE CREATORS OF THE GAME?",
"AREN'T THEY ASHAMED TO BE SEEN BY EVERYBODY?",
"JESUS, THAT EMILIO DE PAZ IS EVERYWHERE!!",
+ // 15
"REALLY?",
"YES",
"WELL, DON'T MAKE A FUSS ABOUT IT",
"HEY WEREWOLF, BY THE WAY...",
- "DIDN'T YOU FALL OFF A WINDOW AND GOT BADLY HURT",
- "IF AT LEAST IT WASN'T ALWAYS THE SAME ONES...",
+ "DIDN'T YOU FALL OFF A WINDOW AND GET BADLY HURT",
+ // 20
+ "AT LEAST IT WASN'T ALWAYS THE SAME ONES...",
"HE'S BEEN OUT FOUR TIMES ALREADY",
"I'D LIKE TO BE A MODEL",
"ALL RIGHT, AND WHAT ARE YOU GOING TO DO?",
},
{
+ // 0
"",
"EO, USTED",
"\255QUE MUERTO NI OCHO CUARTOS!",
"ESTOY VIVO, LO QUE PASA ES QUE YO PASO HAMBRE, \250SABE USTED? ",
"PUES VERA, SE\245OR. YO ERA EL BORRACHO DEL PUEBLO, DIGNO SUCESOR DE UNA FAMILIA DE ILUSTRES BORRACHUZOS, Y UNA NOCHE DRASCULA ME SECUESTRO PARA ROBARME LOS ORGANOS",
+ // 5
"RESULTA QUE COMO ME CONSERVO EN ALCOHOL, ME TIENE AQUI EN PLAN DESSGUACE. CADA VEZ QUE NECESITA ALGO PARA EL MONSTRUO QUE ESTA CREANDO VIENE Y ME LO COGE",
"AL PRINCIPIO ME DOLIA, NO CREA, PERO YA ME DA IGUAL",
"NO SE, SERA SU PROYECTO DE FIN DE CARRERA",
"MI NOMBRE ES DESIDERIO, PARA SERVIRLE A USTED",
"PUES LA VERDAD ES QUE NO TENGO MUCHA GANA, PERO MUCHAS GRACIAS DE TODAS MANERAS, SE\245OR",
+ // 10
"SI, TU MISMO",
"\250POR QUE TODOS LOS JUEGOS DE AVENTURAS TERMINAN CON UN AMANECER O UNA PUESTA DE SOL? ",
"\250Y TODOS ESTOS NOMBRES SON DE LOS QUE HAN HECHO EL JUEGO?",
"\250Y NO LES DA VERG\232ENZA SALIR Y QUE LOS VEA TODO EL MUNDO?",
"JOLIN, NO HACE MAS QUE SALIR \"EMILIO DE PAZ\" ",
+ // 15
"\250DE VERDAD?",
"SI",
"PUES NO ES PARA TANTO",
"POR CIERTO HOMBRE LOBO...",
"... \250NO CAISTE POR UNA VENTANA Y TE HICISTE POLVO?",
+ // 20
"SI AL MENOS NO FUESEN SIEMPRE LOS MISMOS",
"ESE YA HA SALIDO CUATRO VECES",
"ME GUSTARIA SER MODELO",
"YA, \250Y TU QUE VAS A HACER?",
},
{
+ // 0
"",
"EJ, SIE DAA",
"DU BIST WOHL BESOFFEN ODER WAS ? !",
"ICH BIN LEBENDIG, ABER ICH HABE HUNGER, WISSEN SIE ?",
"TJA,ICH WAR DER DORFSaeUFER, STOLZER abkomme EINER DORFSaeUFERsippe UND EINES NACHTS holte mich DRASCULA, UM MIR DIE ORGANE ZU KLAUEN",
+ // 5
"WEIL ICH MICH IN ALKOHOL gut HALTE BIN ICH SEIN ERSATZTEILLAGER. IMMER WENN ER WAS FueR SEIN MONSTERCHEN BRAUCHT, BEDIENT ER SICH BEI MIR",
"AM ANFANG TAT DAS HoeLLISCH WEH, ABER JETZT MERK ICH SCHON NICHTS MEHR",
"KEINE AHNUNG, ES WIRD WOHL SEINE DIPLOMARBEIT SEIN",
"ICH HEISSE DESIDERIUS UND STEHE ZU IHREN DIENSTEN",
"NAJA, EIGENTLICH HABE ICH KEINE GROSSE LUST ABER VIELEN DANK JEDENFALLS, MEIN HERR",
+ // 10
"JA,NUR ZU",
"WARUM HoeREN ALLE SPIELE MIT SONNENAUFGANG ODER SONNENUNTERGANG AUF ?",
"UND SIE HABEN DIE NAMEN VON DEN MACHERN DIESES SPIELS BENUTZT ?",
"UND SIE SCHaeMEN SICH NICHT SICH ALLER WELT ZU OFFENBAREN ?",
"SCHEIBENKLEISTER. SCHON WIEDER DER PROGRAMMIERER",
+ // 15
"WIRKLICH ?",
"JA",
"SO SCHLIMM IST ES AUCH WIEDER NICHT",
"APROPOS WERWOLF....",
"....BIST DU NICHT AUS EINEM FENSTER GEFALLEN UND ZU STAUB GEWORDEN ?",
+ // 20
"WENN ES WENIGSTENS NICHT IMMER DIESELBEN WaeREN",
"DER IST SCHON 4 MAL AUFGETAUCHT",
"ICH WaeRE GERN FOTOMODELL",
"KLAR, UND WAS WILLST DU SPaeTER MAL MACHEN ?",
},
{
+ // 0
"",
"OH\220! VOUS!",
"QUEL MORT NI QUELLE HISTOIRE!",
"JE SUIS VIVANT. C'EST QUE J'AI FAIM, VOUS SAVEZ? ",
"J'TAIS L'IVROGNE DU VILLAGE, LE DIGNE REPRSENTANT D'UN FAMILLE D'ILLUSTRES SO\352LARDS, ET DRASCULA M'A SQUESTR UNE NUIT POUR ME VOLER LES ORGANES",
+ // 5
"COMME JE ME CONSERVE EN ALCOOL, IL ME TIENS ICI EN PLAN DBALLAGE. \267 CHAQUE FOIS QU'IL A BESOIN DE QUELQUE CHOSE POUR SON MONSTRE, IL LE PRENDRE",
"AU DBUT A ME FAISAIT MAL, MAIS JE M'EN FICHE DJ\267",
"JE NE SAIS PAS, MAIS CE SERA SON PROJET FIN D'TUDES",
"MON NOM EST DSIR, POUR VOUS SERVIR",
"VRAIMENT JE N'AI PAS UNE ENVIE FOLLE, MAIS MERCI QUAND M\322ME, MONSIEUR",
+ // 10
"OUI, TOI M\322ME",
"POURQUOI TOUS LES JEUX D'AVENTURES FINISSENT AVEC UNE AUBE OU UN COUCHER DU SOLEIL? ",
"ET VOIL\267 LES NOMS DE TOUS QUI ON FAIT LE JEU?",
"ET N'ONT-ILS PAS LA HONTE DE SE MONTRER ET QUE TOUT LE MONDE LES VOIT?",
"AH ZUT! IL NE FAIT QUE SORTIR \"EMILIO DE PAZ\" ",
+ // 15
"C'EST VRAI",
"OUI",
"EH BIEN, IL NE FAUT PAS EXAG\220RER",
"EN FAIT HOMME-LOUP...",
"...N'EST-TU PAS TOMB\220 D'UNE FEN\322TRE EN TE BR\220SILLANT?",
+ // 20
"SI DU MOINS N'\220TAIENT PAS TOUJOURS LES M\322MES...",
"CELUI-L\267 EST D\220J\267 SORTI QUATRE FOIS",
"J'AIMERAIS \322TRE MANNEQUIN",
"PARFAITEMENT. ET TOI, QUE VAS-TU FAIRE?",
},
{
+ // 0
"",
"EO, LEI",
"MA CHE DICI!",
"SONO VIVO, MA HO SEMPRE MOLTA FAME, SA LEI?",
"IO ERO IL BEONE DEL PAESE, DEGNO SUCCESSORE DI UNA FAMIGLIA DI ILLUSTRI BEONI, E UNA NOTTE DRASCULA MI SEQUESTR\220 PER RUBARMI GLI ORGANI",
+ // 5
"mi utilizza COME UNO SCASSO, OGNI VOLTA CHE HA BISOGNO DI QUALCOSA PER IL MOSTRO CHE ST\265 CREANDO VIENE QUA E MI LO toglia",
"AL INIZIO MI FACEVA MALE, MA ORA NON FA NIENTE",
"NON SO, SAR\265 LA SUA TESINA DI FINE DI LAUREA",
"IL MIO NOME PEPPINO, PER SERVIRGLI",
"LA VERIT\265 CHE NON HO MOLTA VOGLIA, COMUNQUE GRAZIE MILE, SIGNORE",
+ // 10
"SI, PROPRIO TU",
"PER CHE TUTTI I VIDEO-GIOCHI D' AVVENTURE FINISCONO CON UN'ALBEGGIARE O UN TRAMONTO?",
"E TUTTI QUESTI NOMI SONO DI CHI HANNO FATTO IL GIOCO?",
"E NON SI VERGOGNANO DI USCIRE ED ESSERE VISTI DA TUTTI QUANTI?",
"UFFA, SOLTANTO ESCI \"EMILIO DE PAZ\"",
+ // 15
"DAVVERO?",
"SI",
"NON \220 PER METTERSI COS\326 ",
"CERTO LUPO-MANNARO..",
"... MA NON SEI CADUTO DA UNA FINESTRA E TI HAI FATTO MALE?",
+ // 20
"SE PER UNA VOLTA NON FOSSENO SEMPRE GLI STESSI",
"QUELLO \220 GIA USCITO QUATRO VOLTE",
"MI PIACEREBBE ESSERE TOP MODEL",
@@ -3334,178 +4628,213 @@ const char *_texte[][24] = {
};
-const char *_texti[][33] = {
+const char *_texti[NUM_LANGS][NUM_TEXTI] = {
{
+ // 0
"",
- "MASTER, I THINK THIS IS NOT WORKING",
+ "MASTER, THIS IS NOT WORKING",
"I AM POSITIVE, MASTER",
"I'M SORRY MASTER",
- "ARE YOU GOING TO BRING HERE ANOTHER CRAZY SCIENTIST? I'LL TELL YOU THAT THE LABORATORY IS ALREADY PACKED UP, AND BESIDES, THEY'RE ALL OUT OF DATE",
- "HUSH MASTER, THE FEMINIST COULD HEAR YOU",
- "DAMNED IT!",
+ "ARE YOU GOING TO BRING ANOTHER CRAZY SCIENTIST HERE? THE LABORATORY IS ALREADY FULL UP, AND BESIDES, THEY'RE ALL OUT OF DATE",
+ // 5
+ "HUSH MASTER, THE FEMINISTS MIGHT HEAR YOU",
+ "DAMN IT!",
"I DIDN'T EXPECT YOU SO SOON, MASTER",
- "QUITE BAD MASTER. THERE MUST BE SOME PROBLEMS WITH THE SATELLITE AND I JUST CAN'T RECEIVE ANYTHING. BESIDES THERE ARE SOME INTERFERENCES BECAUSE OF THE STORM",
+ "QUITE BAD MASTER. THERE ARE SOME PROBLEMS WITH THE SATELLITE, I JUST CAN'T RECEIVE ANYTHING. THERE MUST BE SOME INTERFERENCE FROM THE STORM",
"WHAT DO I KNOW, MASTER?",
+ // 10
"YES, MY MASTER",
"MASTER",
"DO YOU KNOW WHAT TIME IS IT?",
"WHAT? OH, THAT SCARED ME!. YOU ARE THE \"NIGHT-CLEANING GUY\", RIGHT?",
- "I'M IGOR, THE VALET. YOU CAN START WITH THE BALL ROOM. THERE'S BEEN A SUPER NATURAL ORGY YESTERDAY AND IT LOOKS LIKE SHIT",
+ "I'M IGOR, THE VALET. YOU CAN START WITH THE BALL ROOM. THERE'S BEEN A SUPER NATURAL ORGY IN THERE YESTERDAY AND IT LOOKS LIKE SHIT",
+ // 15
"IF YOU NEED ANYTHING, JUST BUY IT",
- "IT'S THE TAX RETURN APPLICATION FORM, CAN'T YOU SEE IT?",
- "NEITHER DO I. FIRST OF ALL THE NUMBERS ARE VERY SMALL AND ALSO I CAN'T SEE MUCH AT THIS DISTANCE.",
+ "IT'S THE TAX RETURN APPLICATION FORM, CAN'T YOU SEE?",
+ "NEITHER DO I. THE NUMBERS ARE VERY SMALL AND I CAN'T SEE MUCH AT THIS DISTANCE.",
"NO WAY! THEY MAKE ME LOOK UGLY",
"OH, WELL. IT'S JUST LIKE A CRAZY PARTY THAT THE MASTER ORGANIZES WITH HIS FRIENDS EACH TIME SOME IDIOT COMES ALONG TRYING TO KILL HIM",
- "THEY TAKE HIS EYES OUT. THEN, POUR SOME LEMON JUICE SO THAT IT ITCHES TO DEATH, AND THEN...",
+ // 20
+ "THEY TAKE HIS EYES OUT. THEN, POUR IN SOME LEMON JUICE SO THAT IT ITCHES TO DEATH, AND THEN...",
"NO",
"WHAT DO YOU MEAN WHY NOT? DO YOU KNOW WHAT TIME IT IS?",
"YES, IT'S WINTER",
"SEE YOU LATER",
+ // 25
"DON'T EVEN THINK ABOUT IT!",
"WELL, THAT'S ENOUGH FOR TODAY. I'M GOING TO HAVE SUPPER",
"MAN, I ALWAYS FORGET TO LOCK IT, RIGHT?",
"THE HELL WITH IT!",
"WHAT? OH, YOU SCARED ME MASTER, I THOUGHT YOU WERE ASLEEP",
+ // 30
"OH, BY THE WAY, I TOOK THE LIVING-ROOM KEYS SO THAT YOU CAN WATCH THE EARLY MORNING CARTOONS WITHOUT WAKING ME UP",
"YOU'VE GOT ANOTHER COLD MASTER? DAMN IT! I TOLD YOU TO GET SOME HEATING IN HERE...",
"ALL RIGHT, JUST TAKE YOUR ASPIRIN AND GO TO BED TO SWEAT FOR A WHILE. GOOD NIGHT",
},
{
+ // 0
"",
"MAESTRO, CREO QUE ESTO NO RULA",
"ESTOY SEGURISIMO, MAESTRO...",
"LO SIENTO, MAESTRO",
"\250VA A TRAER OTRO DE CIENTIFICO LOCO? LE ADVIERTO QUE TENEMOS EL LABORATORIO LLENO Y ESTAN TODOS CADUCADOS",
+ // 5
"CALLE, MAESTRO, QUE COMO LE OIGAN LAS FEMINISTAS",
"HAY QUE JOROBARSE",
"\255MAESTRO! \255NO LE ESPERABA TAN PRONTO!",
"MAL MAESTRO, DEBE HABER PROBLEMAS CON EL SATELITE Y NO CONSIGO SINTONIZAR LA IMAGEN. ADEMAS LA TORMENTA PRODUCE INTERFERENCIAS",
"\250Y A MI QUE ME CUENTA, MAESTRO?",
+ // 10
"SI, MAESTRO",
"MAESTRO",
"\250SABE LA HORA QUE ES?",
"\250EH? \255AH, QUE SUSTO ME HAS DADO! TU ERES EL DE \"LIMPIEZA NOCTURNA\"\250NO?",
"YO SOY IGOR, EL MAYORDOMO. PUEDES EMPEZAR POR EL SALON DE BAILE. AYER HUBO ORGIA SOBRENATURAL Y ESTA HECHO UNA MIERDA",
+ // 15
"SI NECESITAS ALGO, LO COMPRAS",
"LA DECLARACION DE LA RENTA \250ES QUE NO LO VES?",
"PUES YO TAMPOCO, PORQUE ENTRE QUE LOS NUMEROS SON MUY CHICOS, Y YO QUE NO VEO BIEN DE LEJOS...",
"\255NI HABLAR! ME HACEN PARECER FEO",
"BAH, ES UN FESTORRO QUE SE MONTA EL MAESTRO CON SUS COLEGAS CADA VEZ QUE LLEGA ALGUN IMBECIL QUERIENDO ACABAR CON EL",
+ // 20
"PRIMERO LE SACAN LOS OJOS; LUEGO LE ECHAN ZUMO DE LIMON PARA QUE LE ESCUEZA; DESPUES...",
"NO",
"\250COMO QUE POR QUE NO? \250TU HAS VISTO LA HORA QUE ES?",
"EN INVIERNO, SI",
"HASTA LUEGO",
+ // 25
"\255NI SE TE OCURRA!",
"BUENO, POR HOY YA VALE. ME VOY A CENAR",
"\255Y QUE SIEMPRE SE ME OLVIDA CERRAR CON LLAVE!",
"\255HAY QUE JOROBARSE!",
"\250EH? \255AH! QUE SUSTO ME HA DADO, MAESTRO. CREIA QUE ESTABA DURMIENDO",
+ // 30
"AH, POR CIERTO, TOME LAS LLAVES DE LA SALA DE ESTAR Y ASI NO ME MOLESTA MA\245ANA TEMPRANO SI QUIERE VER LOS DIBUJOS",
"\250QUE, YA SE HA RESFRIADO OTRA VEZ, MAESTRO? HAY QUE JOROBARSE. SI SE LO TENGO DICHO, QUE PONGA CALEFACCION... ",
"BUENO, TOMESE UNA PASTILLA DE ACIDOACETIL SALICILICO Y HALA, A SUDAR. BUENAS NOCHES",
},
{
+ // 0
"",
"MEISTER, ICH GLAUBE, DAS KLAPPT NICHT",
"ICH BIN ABSOLUT SICHER, MEISTER....",
"TUT MIR LEID, MEISTER",
"NOCH SO EINEN VERRueCKTEN WISSENSCHAFTLER ? ABER DAS LABOR IST DOCH VOLL MIT IHNEN UND ALLE SIND ueBER DEM VERFALLSDATUM",
+ // 5
"SEIEN SIE STILL MEISTER. WENN DAS DIE FEMINISTINNEN HoeREN",
"GRueNSPAN UND ENTENDRECK",
"MEISTER! ICH HABE SIE NOCH GAR NICHT ERWARTET !",
"SCHLECHT, MEISTER. ES GIBT WOHL PROBLEME MIT DER SCHueSSEL UND ICH BEKOMME DAS BILD EINFACH NICHT KLAR. UND DANN DAS GEWITTER !",
"UND WIESO ERZaeHLEN SIE MIR DAS, MEISTER ?",
+ // 10
"JA, MEISTER",
"MEISTER",
"WISSEN SIE, WIEVIEL UHR ES IST ?",
"Hae ?OH, DU HAST MICH GANZ SCHoeN ERSCHRECKT. BIST DU VON \"BLITZ UND BLANK BEI MONDESSCHEIN\"",
"ICH BIN IGOR, DER HAUSVERWALTER.DU KANNST MIT DEM WOHNZIMMER ANFANGEN. GESTERN HATTEN WIR EINE ueBERNATueRLICHE ORGIE UND ES SIEHT AUS WIE im SAUSTALL",
+ // 15
"KAUF ALLES WAS DU BRAUCHST !",
"DIE STEUERERKLaeRUNG.SIEHST DU DAS NICHT ?",
"ICH AUCH NICHT, WEIL DIE ZAHLEN SCHON MAL SEHR KLEIN SIND UND ICH DOCH kurzsichtig bin....",
"VON WEGEN ! SIE MACHEN MICH HaeSSLICH",
"PAH, DAS IST EINE RIESENFETE DIE DER MEISTER JEDESMAL DANN ABZIEHT, WENN IRGENDSOEIN IDIOT KOMMT, DER IHN ERLEDIGEN WILL",
+ // 20
" ZUERST REISSEN SIE IHM DIE AUGEN AUS DANACH GIESSEN SIE ZITRONENSAFT DRueBER DAMIT ES SCHoeN BRENNT UND DANN...",
"NEIN",
"WIE WARUM NICHT ? WEISST DU WIEVIEL UHR ES IST ?",
"im WINTER JA",
"TSCHueSS",
+ // 25
"WAG ES BLOOOSS NICHT !",
"GUT, FueR HEUTE REICHTS, DAS ABENDESSEN RUFT",
"IMMER VERGESSE ICH ZUZUSCHLIESSEN !",
"VERDAMMTER MIST NOCHMAL !",
"HaeH ?AH !SIE HABEN MICH GANZ SCHoeN ERSCHRECKT, MEISTER. ICH DACHTE SIE SCHLAFEN",
+ // 30
"ACH,ueBRIGENS, ICH HABE DIE WOHNZIMMERSCHLueSSEL GENOMMEN. SO NERVEN SIE MICH MORGEN FRueH NICHT MIT IHREN ZEICHENTRICKSERIEN",
"ACH, SIE HABEN SICH SCHON WIEDER ERKaeLTET, MEISTER ? ICH HAB JA IMMER SCHON GESAGT, SIE SOLLEN DIE HEIZUNG ANMACHEN...",
"NAJA, SCHLUCKEN SIE EINE SALICILACETYLSaeURE-TABLETTE UND AB INS BETT ZUM SCHWITZEN. GUTE NACHT",
},
{
+ // 0
"",
"MA\327TRE, JE CROIS QUE \200A NE ROULE PAS",
"J'EN SUIS TR\324S S\352R, MA\327TRE...",
"JE LE REGRETTE, MA\327TRE",
"IL APPORTERA UN AUTRE DE SCIENTIFIQUE FOU? JE VOUS PRVIENS QUE LE LABORATOIRE EN EST PLEIN ET TOUS SONT PRIMS",
+ // 5
"TAISEZ-VOUS, MA\327TRE, SI LES FMINISTES VOUS COUTENT...",
"CE QU'IL FAUT SUPPORTER!",
"MA\327TRE! -JE NE VOUS ATTENDAIT PAS SI T\342T!",
"A VA MAL MA\327TRE. IL DOIT AVOIR DES PROBL\324MES AVEC LE SATELLITE ET JE NE RUSSIT PAS \267 SINTONISER L'IMAGE. ET ENCORE L'ORAGE PRODUIT DES INTERFRENCES.",
"CANCANS QUE TOUT CELA, MA\327TRE!",
+ // 10
"OUI, MA\327TRE",
"MA\327TRE",
"QUELLE HEURE IL EST?",
"H\220? -AH! TU M'AS FAIT PEUR! TU EST CELUI DU \"NETTOYAGE DE NUIT\", NON?",
"JE SUIS IGOR, LE MAJORDOME. TU PEUX COMMENCER PAR LE SALON DE BAL. HIER IL Y A EU UNE ORGIE SURNATURELLE ET C'EST UNE SALOPERIE",
+ // 15
"SI TU AS BESOIN DE QUELQUE CHOSE, ACHETE-EN!",
"LA D\220CLARATION D'IMP\342TS, NE LE VOIS-TU PAS?",
"EH BIEN, MOI NON PLUS, CAR \267 CAUSE DE SI PETITS NUM\220ROS ET MA DIFFICULT\220 POUR BIEN VOIR DE LOIN...",
"ON N'EN PARLE PLUS! ILS ME FONT PARA\327TRE LAID",
"BAH! C'EST UNE BELLE F\322TE QUE LE MA\327TRE ORGANISE AVEC SES COLL\324GUES \267 CHAQUE FOIS QU'UN IMB\220CILE ARRIVE ET VEUT FINIR AVEC LUI",
+ // 20
"D'ABORD ON LUI ARRACHE LES YEUX; APR\324S, ON LUI VERSE DE JUS DE CITRON POUR QUE \200A LUI CUISE; APR\324S...",
"NON",
"POURQUOI PAS? TU AS VU L'HEURE QU'IL EST?",
"EN HIVER, OUI",
"AU REVOIR",
+ // 25
"N'Y PENSES M\322ME PAS!",
"BON, \200A VA POUR AUJOURD'HUI. JE VAIS D\327NER",
"J'OUBLIE TOUJOURS FERMER \267 CL\220, H\220LAS!",
"QUEL ENNUI!",
"H\220? -VOUS M'AVEZ FAIT PEUR, MA\327TRE. JE PENSAIS QUE VOUS DORMIEZ",
+ // 30
"H\220, MA\327TRE! PRENEZ LES CL\220S DE LA SALLE DE S\220JOUR, AINSI DONC SI VOUS VOULEZ VOIR LES DESSINS ANIM\220S DEMAIN DE BONNE HEURE NE ME D\220RANGEREZ PAS",
"QUOI? VOUS VOUS \322TES ENRHUM\220 ENCORE UNE FOIS, MA\327TRE? QUELLE CONTRARI\220T\220! JE VOUS AI D\220J\267 DIT D'Y METTRE LE CHAUFFAGE... ",
"BON, AVALEZ UN COMPRIM\220 D'ACIDEAC\220TYL SALICYLIQUE ET ALLEZ TRANSPIRER! BONNE NUIT!",
},
{
+ // 0
"",
"MAESTRO, CREDO CHE QUESTO NON VA",
"SICURISSIMO, MAESTRO",
"SCUSI, MAESTRO",
"VA A PORTARE UN ALTRO SCIENTIFICO PAZZO? GLI AVVERTO CHE IL LABORATORIO PIENO E NE ABBIAMO TUTTI SCADUTI",
+ // 5
"ZITTO, MAESTRO, FIGURASI SE LE SENTONO LE FEMMINISTE",
"ACCIDENTI!",
"-MAESTRO! NON LE ASPETTAVO COS\326 PRESTO!",
"MALE MAESTRO, DEVONO CI ESSERE PROBLEMI CON IL SATELLITE E NON RIESCO A SINTONIZZARE L'IMMAGINE. ANZI LA TEMPESTA CAUSA INTERFERENZE",
"CHE NE SO, MAESTRO",
+ // 10
"SI, MAESTROl",
"MAESTRO",
"SA CHE ORE SONO?",
"EH? -AH, CHE COLPO! TU SEI QUELLO DI \"PULIZIA NOTTURNA\" NO?",
"IO SONO IGOR, IL MAGGIORDOMO. PUOI COMINCIARE NEL SALOTTO DI BALLO, IERI C'ERA ORGIA SOPRANATURALE ED \220 PIENO DI MERDA",
+ // 15
"SE HAI BISOGNO DI QUALCOSA, COMPRALA",
"LA DECLARAZIONE DI REDDITI, NON VEDI?",
"NEANCH'IO, I NUMERI SONO PICCOLISSIMI E ANZI, IO NON VEDO BENE DA LONTANO",
"NEANCHE PARLARNE, MI FANNO SEMBRARE BRUTTO",
"\220 UNA FESTA CHE FA IL MAESTRO PER I SUOI AMICI OGNI VOLTA CHE ARRIVA QUALCHE IMBECILE CHE VUOLE FINIRE CON LUI",
+ // 20
"PRIMA, GLI TOGLIANO GLI OCCHI; POI GLI VERSANO SUCCO DI LIMONE, DOPO IL BRUCIORE.......",
"NO",
"COME CHE PER CHE NO? MA TU HAI VISTO CHE ORE SONO?",
"IN INVERNO, SI",
"ARRIVEDERCI",
+ // 25
"N\324 PENSARCI",
"BENE, BASTA PER OGGI. VADO A CENARE",
"E CHE SEMPRE DIMENTICO CHIUDERE CON LA CHIAVE",
"ACCIDENTI!",
"EH? -AH! CHE COLPO, MAESTRO, PENSAVO STAVA DURMENDO",
+ // 30
"ORA MI RICORDO, PRENDA LE CHIAVI DEL SOGGIORNO, COS\326 DOMANI MATTINA NON MI DISTURBA SE VUOLE GUARDARE I CARTONI ANIMATI",
"HA PRESSO FREDDO UN'ALTRA VOLTA, MAESTRO? SEMPRE GLI DICO CHE METTA IL RISCALDAMENTO",
"PRENDA UNA ASPIRINA ED A SUDARE. BUONA NOTTE",
@@ -3513,217 +4842,261 @@ const char *_texti[][33] = {
};
-const char *_textl[][32] = {
+const char *_textl[NUM_LANGS][NUM_TEXTL] = {
{
+ // 0
"",
- "ARE YOU GOING TO LET OURSELVES BE GUIDED BY PRIMITIVE INSTINCTS JUST BECAUSE WE BELONG TO DIFFERENT RACES AND THE SOCIAL SITUATION IS TELLING US TO DO SO?",
- "AREN'T WE TIED BY SENSE WHICH IS THE MOST POWERFUL WEAPON AS WELL AS THE MOST PRECIOUS GIFT?",
+ "ARE YOU GOING TO LET YOURSELF BE GUIDED BY PRIMITIVE INSTINCTS JUST BECAUSE WE BELONG TO DIFFERENT RACES AND THE SOCIAL SITUATION IS TELLING US TO DO SO?",
+ "AREN'T WE TIED BY SENSE? WHICH IS OUR MOST POWERFUL WEAPON AS WELL AS OUR MOST PRECIOUS GIFT?",
"OH, IF WE ALL LET OUR THOUGHTS GUIDE OUR WAY IN LIFE WITHOUT LEAVING SOME ROOM FOR FEELINGS WHICH LET OUR PRE-EVOLUTIVE INSTINCTS COME OUT!",
- "ANSWER ME, EPHEMERAL CREATURE. WOULDN'T WE ALL BE HAPPIER WITH THOSE EMOTIONAL BOUNDINGS?",
+ "ANSWER ME, EPHEMERAL CREATURE. WOULDN'T WE ALL BE HAPPIER WITHOUT THOSE EMOTIONAL BINDINGS?",
+ // 5
"YOU ARE NOT GETTING THROUGH",
"THIS IS A VERY CLEAR EXAMPLE, YOU SEE?: YOU WANT TO GET THROUGH AND GO AHEAD WITH YOUR ADVENTURE, AND I WON'T LET YOU DO THAT",
- "WILL THAT BE A CONTROVERSIAL POINT BETWEEN US THAT HAVE JUST MET?",
+ "WILL THIS BE A CONTROVERSIAL POINT BETWEEN US AFTER WE HAVE ONLY JUST MET?",
"WELL THEN",
- "WELL, THAT DEPENDS ON WHAT WE TAKE A RELATIONSHIP FOR. SOME AUTHORS DEFEND...",
- "PUKE! HUNTING AS A WAY TO SURVIVE IS AN INCOMPATIBLE ARCHAIC THING FOR A SUPERIOR BEING LIKE ME. BESIDES, I'VE BECOME A VEGETARIAN",
- "IT JUST HAPPENS THAT I WAS ACTUALLY EATING A GUY AND I STARTED TO BETHINK AND GET TO THE ABOVE MENTIONED THOUGHT",
- "IT TOOK ME A LONG TIME TO QUIT OLD HABITS BUT AT LEAST MY IRASCIBLE SOUL BIT UP THE CONCUPISCIBLE ONE, AND EVER SINCE, I'VE NEVER EATEN MEAT AGAIN",
- "NOT EVEN THE PLEASURE OF SUCKING UP THE BONE, FEELING THE TASTE OF THE SKIN AND THAT SWEET TASTE OF MARROW...THAT JUST TAKES YOU TO HEAVENLY PLACES",
+ "WELL, THAT DEPENDS ON WHAT WE HAVE A RELATIONSHIP FOR. SOME AUTHORS DEFEND...",
+ // 10
+ "YUCK! HUNTING AS A WAY TO SURVIVE IS AN INCOMPREHENSIBLE ARCHAIC THING FOR A SUPERIOR BEING LIKE ME. BESIDES, I'VE BECOME A VEGETARIAN",
+ "IT JUST SO HAPPENS THAT I WAS ACTUALLY EATING A GUY AND I STARTED TO THINK ABOUT THE ABOVE MENTIONED THOUGHT",
+ "IT TOOK ME A LONG TIME TO QUIT OLD HABITS BUT AT LEAST MY IRASCIBLE SOUL SWALLOWED UP THE CONCUPISCIBLE ONE, AND EVER SINCE, I'VE NEVER EATEN MEAT AGAIN",
+ "NOT EVEN THE PLEASURE OF SUCKING ON THE BONE, THE TASTE OF THE SKIN AND THAT SWEET TASTE OF MARROW...THAT JUST TAKES YOU TO HEAVENLY PLACES",
"IT DOESN'T REALLY GET TO ME AT ALL",
+ // 15
"WHAT?",
"I DON'T KNOW WHAT YOU'RE TALKING ABOUT, YOU EPHEMERAL CREATURE",
"I'M NOT INTERESTED",
"I DON'T KNOW ABOUT THE OTHER GAMES, BUT WE COULD USE THIS BEAUTIFUL SCREEN",
"",
+ // 20
"I'D CARE...",
"NO. IT'S JUST THE SON, THE FATHER, THE GRANDFATHER AND A FRIEND, WHO ARE CALLED LIKE THAT",
"BUT, IT IS GOING TO LOOK LIKE THE GAME WAS MADE BY FIVE PEOPLE",
"THESE ARE PROMISING GUYS",
"THAT'S A GOOD ONE! A GOOD ONE!",
+ // 25
"PLEASE, CALL ME CONSTANTINO",
"IT WASN'T ME MAN. IT WAS \"EL COYOTE\", MY TWIN",
"JESUS, THESE ARE REALLY LONG CREDIT TITLES",
"I STOPPED COUNTING A LONG TIME AGO",
"WHAT WILL BECOME OF YOU NOW, DESIDERIO?",
+ // 30
"BUT, YOU SHOULD LOSE SOME WEIGHT",
"I'LL JUST RETIRE TO THE TIBET AND THINK ABOUT THE MEANING OF LIFE",
},
{
+ // 0
"",
"UN MOMENTO. \250SOLO PORQUE PERTENECEMOS A RAZAS DISTINTAS Y LA SOCIEDAD DICE QUE SEREMOS ENEMIGOS VAMOS A DEJARNOS LLEVAR POR NUESTROS MAS PRIMITIVOS INSTINTOS?",
"\250ACASO NO NOS UNE LA RAZON, ELARMA MAS PODEROSA Y, A LA VEZ, EL DON MAS PRECIADO QUE TENEMOS?",
"\255AH, SI EL ENTENDIMIENTO GUIARA NUESTROS PASOS POR LA VIDA SIN DEJAR SITIO A LOS SENTIMIENTOS, QUE AFLORAN NUESTRAS INCLINACIONES PRE-EVOLUTIVAS!",
"\250NO CREES QUE SERIAMOS MAS DICHOSOS SIN ESAS ATADURAS EMOCIONALES? CONTESTA EFIMERA CRIATURA",
+ // 5
"NO PASAS",
"\250VES? ESTE ES UN CLARO EJEMPLO: TU QUIERES PASAR Y CONTINUAR TU AVENTURA Y YO NO PUEDO PERMITIRLO",
"\250HA DE SER ESE MOTIVO SUFICIENTE DE CONFLICTO ENTRE NOSOTROS, QUE NO NOS CONOCEMOS DE NADA?",
"PUES ESO",
"BUENO, ESO DEPENDE DE LO QUE ENTENDAMOS POR RELACION. ALGUNOS AUTORES DEFIENDEN...",
+ // 10
"AGGG. LA CAZA COMO MEDIO DE SUBSISTENCIA ES UNA ACTIVIDAD ARCAICA INCOMPATIBLE CON UNA NATURALEZA SUPERIOR COMO LA MIA. Y ADEMAS ME HE VUELTO VEGETARIANO",
"RESULTA QUE ESTABA COMIENDOME A UN TIO Y ME PUSE A REFLEXIONAR. LLEGUE A LA CONCLUSION ANTES MECIONADA",
"ME COSTO MUCHO DEJAR LOS HABITOS DESDE TANTO TIEMPO ADQUIRIDOS, PERO POR FIN MI ALMA IRASCIBLE VENCIO A LA CONCUPISCIBLE Y NO HE VUELTO A PROBAR LA CARNE",
"NI SIQUIERA EL PLACER QUE SUPONE UN HUESO, CON EL JUGO DE LA PIEL ENTRE SUS POROS Y ESE SABOR QUE TE TRANSPORTA A LUGARES REMOTOS PARADISIACOS...",
"NI SIQUIERA ME AFECTA. PARA NADA, DE VERDAD",
+ // 15
"\250EL QUE?",
"NO SE DE QUE ME HABLAS, EFIMERA CRIATURA",
"NO ME INTERESA",
"LOS DEMAS JUEGOS, NO SE, PERO ESTE PARA APROVECHAR ESTA PANTALLA TAN BONITA",
"",
+ // 20
"A MI SI ME DARIA",
"NO, ES QUE SON EL ABUELO, EL PADRE, EL HIJO, Y UN AMIGO QUE SE LLAMA ASI",
"NO, PERO ES QUE SI NO VA A PARECER QUE HAN HECHO EL JUEGO ENTRE CINCO",
"ESTOS CHICOS PROMETEN",
"\255ESE ES BUENO, ESE ES BUENO!",
+ // 25
"LLAMAME CONSTANTINO",
"NO ERA YO, HOMBRE. ERA MI DOBLE, EL COYOTE",
"VAYA, QUE CREDITOS MAS LARGOS",
"YO YA PERDI LA CUENTA",
"BUENO DESIDERIO, \250Y QUE VA A SER DE TI AHORA?",
+ // 30
"PERO TENDRIAS QUE ADELGAZAR",
"ME RETIRARE AL TIBEL A REFLEXIONAR SOBRE EL SENTIDO DE LA VIDA",
},
{
+ // 0
"",
"MOMENT mal. NUR WEIL WIR UNTERSCHIEDLICHER HERKUNFT SIND UNd eigentlich feinde sein muessten mueSSEN WIR UNS DOCH Nicht wie die primaten auffuehren!",
"VERBINDET UNS ETWA NICHT DIE VERNUNFT, GEFaeHRLICHSTE WAFFE UND ZUGLEICH GRoeSSTE GABE, DIE WIR HABEN ?",
"AH, WENN NUR DAS GEGENSEITIGE VERSTaeNDNIS die gefuehle besiegen koennte,DIE DIE WURZEL UNSERER PRaeHISTORISCHEN NEIGUNGEN SIND!",
"GLAUBST DU NICHT, DASS WIR OHNE DIESE GEFueHLSFESSELN GLueCKLICHER WaeREN ? ANTWORTE, DU EINTAGSFLIEGE",
+ // 5
"DU KOMMST NICHT DURCH",
"SIEHST DU ? DU WILLST HIER DURCH UND MIT DEM ABENTEUER WEITERMACHEN UND ICH KANN DAS NICHT ZULASSEN",
"MUSS DENN DIE TATSACHE, DASS WIR UNS NICHT KENNEN, ANLASS ZUM STREIT SEIN?",
"GENAU",
"NAJA. KOMMT DARAUF AN, WAS WIR UNTER BEZIEHUNG VERSTEHEN. EINIGE VERTRETEN JA DEN STANDPUNKT, DASS....",
+ // 10
"ARRGH.nur zu jagen, um zu ueberleben ist mir zu primitiv.UND AUSSERDEM BIN ICH SEIT KURZEM VEGETARIER",
"ES GING LOS,ALS ICH MIR GERADE EINEN TYPEN EINVERLEIBTE UND ANFING NACHZUDENKEN UND ZUM EBENERWaeHNTEN SCHLUSS KAM",
"ES war hart, DIE ALTEN laster ABZULEGEN, ABER seit MEINE FLEISCHESLUST MEINEn JaeHZORN besiegt hat HABE ICH KEIN FLEISCH MEHR GEGESSEN:",
"NICHT MAL DIE GAUMENFREUDE EINES KNOCHENS, MIT DEM SAFT DER HAUT IN DEN POREN UND DIESEm GESCHMACK DER DICH INS REICH DER SINNE ENTFueHRT...",
"ES MACHT MIR ueBERHAUPT NICHTS AUS, WIRKLICH",
+ // 15
"WAS JETZT ?",
"ICH WEISS NICHT, WOVON DU REDEST, DU EINTAGSFLIEGE",
"DAS INTERESSIERT MICH NICHT",
"ANDERE SPIELE, ACH ICH WEISS NICHT, ABER DAS HIER HAT SO EINE NETTE GRAFIK",
+ "",
+ // 20
"ICH HaeTTE SCHON LUST..",
"NEIN, SO HEISSEN DER OPA, DER VATER, DER SOHN UND EIN FREUND.",
"NEIN, ABER WENN NICHT, SIEHT ES SO AUS ALS WaeRE DAS SPIEL VON FueNF LEUTEN GEMACHT WORDEN",
"DIESE JUNGS SIND VIELVERSPRECHEND !",
"DER IST GUT, SUPERKLASSE !",
+ // 25
"NENN MICH KONSTANTIN",
"MANN, DAS WAR NICHT ICH, SONDERN MEIN DOUBLE, DER KOYOTE",
"WOW, WAS FueR EINE LANGE DANKESLISTE",
"ICH HAB SCHON DEN ueBERBLICK VERLOREN",
"O.K. DESIDERIO, UND WAS WIRD JETZT AUS DIR WERDEN ?",
+ // 30
"ABER DANN MueSSTEST DU ABNEHMEN",
"ICH WERDE NACH TIBET AUSWANDERN UND ueBER DEN SINN DES LEBENS NACHDENKEN",
},
{
+ // 0
"",
"c'est parce qu'on APPARTIENT \267 DES RACES DIFF\220RENTES ET QUE LA SOCI\220T\220 NOUS CONFRONTE, QUE NOUS ALLONS AGIR PAR NOS PLUS M\220PRISABLES INSTINCTS?",
"NE SOMMES-NOUS PAR HASARD ACCROCHS PAR LA RAISON, L'ARME LA PLUS PUISSANTE, ET AUSSI LE DON LE PLUS PRCIEUX QUE NOUS AVONS?",
"AH!, SI LA RAISON GUIDAIT NOS PAS DANS LA VIE SANS Y ENTRA\327NER LES SENTIMENTS, QUI FONT JAILLIR NOS INCLINAISONS PR-VOLUTIVES!",
"NE CROIS-TU PAS QUE NOUS SERIONS PLUS HEREUX SANS CES ATTACHEMENTS-L\267? RPONDS-MOI, CRATURE PHM\324RE ",
+ // 5
"TU NE PASSES PAS",
"TU VOIS? C'EST UN EXEMPLE CLAIR: TOI, TU VEUX PASSER ET POURSUIVRE TON AVENTURE ET MOI, JE NE PEUX PAS LE TOLRER",
"CELA DOIT \322TRE UNE RAISON SUFFISANTE DE CONFLIT ENTRE NOUS DEUX, QUI NE NOUS CONNAISSONS DE RIEN?",
"C'EST CELA",
"EH BIEN, CELA DPEND DE CE QU'ON ENTEND PAR RLATION. D'APR\324S QUELQUES AUTEURS...",
+ // 10
"LA CHASSE COMME MOYEN DE SUBSISTANCE EST UNE ACTIVIT\220 ARCHA\330QUE, INCOMPATIBLE AVEC ma NATURE SUP\220RIEURE . ET DE PLUS JE SUIS DEVENU V\220G\220TARIEN",
"IL S'EN SUIT QU'EN TRAIN DE D\220VORER UN TYPE, JE ME SUIS MIS \267 R\220FL\220CHIR. ALORS, SUIS ARRIV\220 \267 LA CONCLUSION MENTIONN\220 CI-DESSUS",
"ABANDONNER CES HABITUDES M'EST REVENU CHER, MAIS \267 LA FIN MON \266ME IRASCIBLE a vancue MON \266ME CONCUPISCIBLE, ET D\324S LORS JE N'AI GO\352T\220 \267 LA VIANDE",
"M\322ME PAS LE PLAISIR DE CROQUER UN OS, AVEC LE SUC DE LA PEAU ENTRE SES PORES ET sa SAVEUR QUI TE TRANSPORTE VERS DES LIEUX TR\324S LONTAINS, PARADISIAQUES...",
"CECI NE M'AFFECTE PAS M\322ME, ABSOLUMENT PAS, C'EST VRAI",
+ // 15
"QUOI?",
"JE NE SAIS PAS DE QUOI TU M'EN PARLES, CR\220ATURE \220PH\220M\324RE",
"CELA NE ME REGARDE PAS",
"LES AUTRES JEUX, JE NE SAIS PAS; MAIS CELUI-CI OUI, POUR EN PROFITER DE CET \220CRAN SI JOLI",
"",
+ // 20
"MOI, JE NE M'EN FICHERAI PAS",
"NON, C'EST QU'ILS SONT LE GRAND-P\324RE, LE P\324RE, LE FILS, ET UN AMI QUI S'APPELLE COMME \200A",
"NON, MAIS SI NON, IL VA PARA\327TRE QU'ON A FAIT LE JEU ENTRE CINQ",
"CES GAR\200ONS ONT DU FUTUR",
"CELUI-L\267 EST BON! CELUI-L\267 EST BON!",
+ // 25
"APPELLE-MOI CONSTANTIN",
"CE N'\220TAIT PAS MOI, MON VIEUX. C'\220TAIT MON DOUBLE, LE COYOTE",
"TIENS! QUELS CR\220DITS SI LONGS",
"J'AI D\220J\267 PERDU LES COMPTES",
"EH BIEN, D\220SID\324RE, QUE T'ARRIVERA-T-IL MAINTENANT?",
+ // 30
"MAIS TU DEVRAIS MAIGRIR",
"JE VAIS ME RETIRER AU TIBEL POUR Y R\220FL\220CHIR SUR LE SENS DE LA VIE",
},
{
+ // 0
"",
"UN ATTIMO. PERCHE SIAMO DI DIVERSE RAZZE E LA SOCIET\265 DICA CHE SIAMO NEMICI, ANDIAMO A LASCIARCI DOMINARE PER I PI\351 PRIMITIVI ISTINTI?",
"MA NON SIAMO UNITI DALLA RAGIONE, DALLA ARMA PI\351 PODEROSA E ANCHE PER IL DONO PI\351 PREZIOSO CHE ABBIAMO?",
"SE IL GIUDIZIO GUIDASSE I NOSTRI PASSI NELLA VITA SENZA LASCIARE POSTO AI SENTIMENTI, CHE MOSTRANO LE NOSTRE INCLINAZIONI PRE-EVOLUTIVI!",
"NON CREDI CHE SAREMMO PI\351 BEATI SENZA QUESTO LEGAME EMOZIONALE? RISPONDE EFFIMERA CREATURA",
+ // 5
"NON PASSI",
"VEDI? QUESTO UN CHIARO ESEMPIO: TU VUOI PASSARE E PROSEGUIRE LA TUA AVVENTURA ED IO NON POSSO PERMETTERLO",
"MA DEVE ESSERE CAUSA DI CONFRONTO QUANDO ANCORA NON CI CONOSCIAMO?",
"CHE TI HO DETTO?",
"BOH, DIPENDE DI CHE CAPIAMO COME RELAZIONE. CI SONO AUTORI CHE DIFENDONO...",
+ // 10
"LA CACCIA COME FORMA DI SUSSISTENZA \220 UNA ATTIVIT\265 ARCAICA, INCOMPATIBILE CON UNA NATURA SUPERIORE COM'\220 LA MIA: ADESSO SONO VEGETARIANO",
"TEMPO FA, STAVO MANGIANDO UN TIZIO QUANDO MI SONO MESSO A RIFLETTERE. FU QUANDO LA CONCLUSIONE DI PRIMA ARRIV\220 ",
"FU DIFFICILE LASCIARE LE MIE VECCHIE ABITUDINI, MA LA MIA ANIMA IRASCIBILE HA VINTO LA CONCUPISCIBILE E NON MANGIO PI\351 DELLA CARNE",
"NEPPURE IL PIACERE CHE FA UN OSSO, COL SUCCO DELLA PELLE E QUEL SAPORE CHE TI PORTA A POSTI LONTANI E PARADISIACI...",
"NEMMENO MI TOCCA DA VICINO, DAVVERO",
+ // 15
"CHE COSA?",
"NON SO SU CHE MI PARLI, EFFIMERA CREATURA",
"NON MI INTERESA",
"GLI ALTRI VIDEO-GIOCHI, NON SO, MA QUESTO \220 PER APPROFITTARE QUESTO BELLO SCHERMO",
"",
+ // 20
"IO SI ME VERGOGNAREI",
"NO, SONO IL NONNO, IL PADRE, IL FIGLIO, E UN AMICO CHE SI CHIAMA COS\326 ",
"NO, MA SE NON \220 COS\326, SEMBRAR\265 CHE HANNO FATTO IL VIDEO-GIOCO IN CINQUE",
"BRAVI RAGAZZI",
"-QUELLO \220 BUONO, QUELLO \220 BUONO!",
+ // 25
"CHIAMAMI COSTANTINO",
"NON ERO IO, DAI,. ERA IL MIO CONTROFIGURA, IL COYOTE",
"INSOMMA, MOLTI TITOLI DI CODA",
"IO NON SO GI\265 QUANTI",
"ALLORA PEPPINO, CHE VAI FARE ADESSO?",
+ // 30
"MA DOVRESTI DIMAGRIRE",
"MI APPARTER\220 AL TIBET A RIFLETTERE SUL SENSO DELLA VITA",
},
};
-const char *_textp[][20] = {
+const char *_textp[NUM_LANGS][NUM_TEXTP] = {
{
+ // 0
"",
"HI",
"YES SIR. IT'S BEAUTIFUL",
"NO, NO. HE WON'T DO IT",
"ALL RIGHT THEN",
+ // 5
"REALLY?",
"SO?",
- "I'M SORRY. THE PIANIST UNION TRADE DOESN'T ALLOW ME TO SAVE GIRLS FROM VAMPIRES' CLUTCHES",
+ "I'M SORRY. THE PIANIST TRADE UNION DOESN'T ALLOW ME TO SAVE GIRLS FROM VAMPIRES' CLUTCHES",
"IF SHE HAD BEEN KIDNAPPED BY THE WEREWOLF...",
"I CAN ONLY PLAY THIS SONG",
+ // 10
"I'M A CONSERVATOIRE PIANIST AND THE BARTENDER WON'T BUY MORE SCORES FOR ME",
- "OH GOD, I REALLY LOVE CLASSIC MUSIC!",
+ "OH GOD, I REALLY LOVE CLASSICAL MUSIC!",
"IT'S BECAUSE I'M WEARING EAR-PLUGS",
"IT'S BECAUSE I CAN LIP-READ",
"NOOO",
+ // 15
"NO! I'M NOT TAKING THIS ANY LONGER!",
"NO WAYYYYY!",
"WHAT? OF COURSE I'M INTERESTED",
- "THANKS GOD! I CAN PLAY A DIFFERENT SONG NOW!",
+ "THANK GOD! I CAN PLAY A DIFFERENT SONG NOW!",
"I GUESS YOU CAN KEEP MY EAR-PLUGS",
},
{
+ // 0
"",
"HOLA",
"BONITA. SI SE\245OR",
"NO QUE NO LO HACE",
"PUES VALE",
+ // 5
"\250SI?",
"\250Y?",
"LO SIENTO. EL SINDICATO DE PIANISTAS NO ME PERMITE RESCATAR CHICAS DE LAS GARRAS DE LOS VAMPIROS",
"SI LA HUBIERA RAPTADO UN HOMBRE LOBO...",
"NO PUEDO TOCAR MAS QUE ESTA CANCION",
+ // 10
"ES QUE SOY PIANISTA DE CONSERVATORIO Y EL TABERNERO NO COMPRA MAS PARTITURAS",
"\255CON LO QUE A MI ME GUSTA LA MUSICA CLASICA!",
"PORQUE LLEVO TAPONES EN LOS OIDOS",
"PORQUE LEO LOS LABIOS",
"NOOO",
+ // 15
"\255QUE NO! \255QUE NO ME AGUANTO!",
"\255QUE NOOOOOO!",
"\250QUE? CLARO QUE ME INTERESA",
@@ -3731,21 +5104,25 @@ const char *_textp[][20] = {
"SUPONGO QUE TE PUEDES QUEDAR CON MIS TAPONES",
},
{
+ // 0
"",
"HALLO",
"JAWOLL, SEHR SCHoeN",
"NEIN, ER TUT ES EINFACH NICHT",
"NA GUT, OK.",
+ // 5
"JA ?",
"UND ?",
"TUT MIR LEID. DIE KLAVIERSPIELERGEWERKSCHAFT ERLAUBT ES MIR NICHT, MaeDCHEN AUS DEN KLAUEN VON VAMPIREN ZU BEFREIEN",
"WENN SIE WERWOLF ENTFueHRT HaeTTE.....",
"ICH KANN NUR DIESES EINE LIED",
+ // 10
"ICH HABE AM KONSERVATORIUM KLAVIER GESPIELT UND DER WIRT WILL MEINE PARTITueDEN NICHT KAUFEN",
"WO MIR DOCH KLASSISCHE MUSIK SO GUT GEFaeLLT !",
"WEIL ICH OHRENSToePSEL IN DEN OHREN HABE",
"WEIL ICH VON DEN LIPPEN LESEN KANN",
"NEEEIN",
+ // 15
"NEEIEN! ICH KANN MICH NICHT BEHERRSCHEN !",
"NEIN,NEIN,UND NOCHMAL NEIN !",
"WIE BITTE ? KLAR BIN ICH INTERESSIERT",
@@ -3753,21 +5130,25 @@ const char *_textp[][20] = {
"ICH GLAUBE, DU KANNST MEINE OHRENSToePSEL BEHALTEN",
},
{
+ // 0
"",
"BONJOUR!",
"JOLIE, OUI M'SIEUR",
"NON, QU'ELLE NE LE FAIT PAS",
"D'ACCORD, A VA",
+ // 5
"OUI?",
"ET QUOI?",
"SUIS DSOL. LE SYNDICAT DE PIANISTES NE ME PERMET PAS DE LIBRER LES FILLES DES GRIFFES DE VAMPIRES",
"SI ELLE AVAIT T RAPTE PAR UN HOMME-LOUP...",
"JE NE PEUX PAS JOUER DAVANTAGE CETTE CHANSON",
+ // 10
"JE SUIS LE PIANISTE DU CONSERVATOIRE ET LE TAVERNIER N'ACH\324TE PAS MES PARTITIONS",
"ET MOI QUI AIME BEAUCOUP LA MUSIQUE CLASSIQUE!",
"PARCE QUE J'AI DES TAMPONS \267 L'OU\330E",
"PARCE QUE JE LIS LES LEVRES",
"NOOON!",
+ // 15
"QUE NON! QUE JE NE PEUX PAS ME RETENIR DAVANTAGE!",
"QUE NOOOOOON!",
"QUOI? BIEN S\352R QUE \200A M'INT\220RESSE",
@@ -3775,21 +5156,25 @@ const char *_textp[][20] = {
"TU PEUX GARDER MES TAMPONS, JE SUPPOSE",
},
{
+ // 0
"",
"CIAO",
"BELLA, MOLTO BELLA",
"NO, CHE NON LO FA",
"VA BENE",
+ // 5
"-SI?",
"E?",
"MI DISPIACE. IL SINDACATODI PIANISTI NON MI DA PERMESSO PER LIBERARE RAGAZZE DALLE MANI DI VAMPIRI",
"SE LA AVESSE SEQUESTRATA IL LUPO-MANNARO...",
"SOLTANTO POSSO SUONARE QUESTA CANZONE",
+ // 10
"\324 PERCHE SONO PIANISTA DI CONSERVATORIO E IL TABERNERO NON COMPRA PI\353 PARTITURE",
"PECCATO.....MI PIACE MOLTISSIMO LA MUSICA CLASSICA!",
"PERCHE MI HO MESSO TAPPI NEGLI ORECCHII",
"PERCHE SO LEGGERE LE LABRA",
"NOOO",
+ // 15
"NO!, NON MI SOPPOROTO!",
"HO DETTO DI NOOO!",
"COSA? SI, SI MI INTERESA, COME NO",
@@ -3799,28 +5184,33 @@ const char *_textp[][20] = {
};
-const char *_textt[][25] = {
+const char *_textt[NUM_LANGS][NUM_TEXTT] = {
{
+ // 0
"",
- "WHAT HAPPENS, WHAT'S THE MATTER?",
- "OK. ROOM 512. UPSTAIRS. THE KEY IS ON THE DOOR",
+ "WHAT HAPPENED? WHAT'S THE MATTER?",
+ "OK. ROOM 512. UPSTAIRS. THE KEY IS UNDER THE DOOR",
"COUNT DRASCULA!!?",
- "NO, NOTHING. THAT GUY HAS A BAD REPUTATION OVER HERE",
- "WELL, THERE ARE ALL KINDS OF STORIES GOING AROUND ABOUT HIM, SOME SAY HE IS A VAMPIRE WHO KIDNAPS PEOPLE TO SUCK UP THEIR BLOOD",
+ "NO, NOTHING. THAT GUY JUST HAS A BAD REPUTATION AROUND HERE",
+ // 5
+ "WELL, THERE ARE ALL KINDS OF STORIES GOING AROUND ABOUT HIM, SOME SAY HE IS A VAMPIRE WHO KIDNAPS PEOPLE TO SUCK THEIR BLOOD",
"HOWEVER, SOME OTHERS SAY THAT HE IS JUST AN ORGAN-DEALER AND THAT IS THE REASON WHY THERE ARE BODY PARTS ALL OVER THE PLACE",
"BUT OF COURSE, THOSE ARE JUST RUMORS. HE'S PROBABLY BOTH THINGS. BY THE WAY, WHY DO YOU WANT TO MEET HIM?",
- "NO, FORGET IT. I'M REALLY BUSY...",
- "WELL, OK. BUT JUST BECAUSE I WANT TO DO IT, NOT BECAUSE YOU TELL ME TO",
+ "FORGET IT. I'M REALLY BUSY...",
+ "WELL, OK. BUT JUST BECAUSE I WANT TO DO IT, NOT BECAUSE YOU TOLD ME TO",
+ // 10
"THEY'RE WINNING",
"LEAVE ME ALONE, ALL RIGHT?",
"OF COURSE. I'M NOT BLIND",
- "THE TRADITION IN THIS VILLAGE IS TO FORGET ALL HARD FEELINGS WHENEVER THERE IS A GAME, SO AS TO CHEER UP THE LOCAL TEAM",
+ "THE TRADITION IN THIS VILLAGE IS TO FORGET ALL HARD FEELINGS WHENEVER THERE IS A GAME, TO CHEER UP THE LOCAL TEAM",
"AND PLEASE, SHUT UP FOR GOD'S SAKE. I CAN'T HEAR ANYTHING!",
+ // 15
"COME ON, LEAVE ME ALONE AND DON'T BOTHER ME ANYMORE",
- "IT HAS JUST STARTED! AND SHUT UP!",
+ "IT HAS JUST STARTED! SHUT UP!",
"OK, OK, I THOUGHT SOMETHING WAS GOING ON",
- "IT DOESN'T MATTER, ANYWAY. SHE'LL PROBABLY BE DEAD BY NOW",
- "HE JUST STARTED PLAYING CLASSIC MUSIC, AND I COULDN'T STAND IT",
+ "IT DOESN'T MATTER, ANYWAY. SHE IS PROBABLY DEAD BY NOW",
+ "HE JUST STARTED PLAYING CLASSICAL MUSIC, AND I COULDN'T STAND IT",
+ // 20
"SINCE I'M PAYING HIM FOR PLAYING WHATEVER I WISH, I JUST FIRED HIM",
"AND THEN, HE GOT FRESH WITH ME. JESUS!, HE LOOKED SO NICE AND INNOCENT...WHAT A HYPOCRITE!",
"BY THE WAY, BE CAREFUL BECAUSE I JUST WAXED THE FLOOR",
@@ -3828,26 +5218,31 @@ const char *_textt[][25] = {
"OH, COME ON! TAKE IT!",
},
{
+ // 0
"",
"\250QUE PASA, QUE PASA?",
"DE ACUERDO. HABITACION 512. SUBIENDO POR LAS ESCALERAS. LA LLAVE ESTA EN LA PUERTA",
"\255\250 EL CONDE DRASCULA ?!",
"NO, NADA. ESE TIPO TIENE MALA FAMA POR AQUI",
+ // 5
"BUENO, CORREN VARIOS RUMORES SOBRE EL. ALGUNOS DICEN QUE ES UN VAMPIRO Y VA SECUESTRANDO GENTE PARA CHUPARLES LA SANGRE",
"CLARO, QUE OTROS OPINAN QUE SOLO ES UN TRAFICANTE DE ORGANOS, Y POR ESO APARECE GENTE DESCUARTIZADA POR LOS ALREDEDORES",
"POR SUPUESTO SON SOLO RUMORES. LO MAS PROBABLE ES QUE SEA LAS DOS COSAS. POR CIERTO, \250PARA QUE QUIERE USTED VER A ESE TIPO?",
"NO DEJELO, QUE ES QUE TENGO MUCHO QUE HACER...",
"BUENO VALE, PERO PORQUE QUIERO YO, NO PORQUE LO DIGAS TU",
+ // 10
"VAN GANANDO",
"DEJAME EN PAZ, \250VALE?",
"PUES CLARO, NO SOY CIEGO",
"ES TRADICION EN EL PUEBLO QUE CUANDO HAY PARTIDO SE OLVIDAN RENCORES PARA ANIMAR A LA SELECCION",
"Y CALLATE YA DE UNA VEZ, QUE NO ME DEJAS OIR",
+ // 15
"ANDA, DEJAME EN PAZ Y NO MOLESTES",
"\255ACABA DE EMPEZAR! \255Y CALLATE!",
"AH, BUENO. CREIA QUE PASABA ALGO",
"NO, SI ES IGUAL. A ESTAS HORAS YA ESTARA MUERTA",
"ES QUE SE PUSO A TOCAR MUSICA CLASICA Y YO NO LA AGUANTO",
+ // 20
"Y COMO YO LE PAGO PARA QUE TOQUE LO QUE YO QUIERO, PUES LE HE ECHADO",
"Y ENCIMA SE ME PUSO CHULO... \255Y PARECIA UNA MOSQUITA MUERTA!",
"...POR CIERTO, TENGA CUIDADO. EL SUELO ESTA RECIEN ENCERADO",
@@ -3855,26 +5250,31 @@ const char *_textt[][25] = {
"\255VENGA, ANDA! TOMA.",
},
{
+ // 0
"",
"WAS ZUM TEUFEL IST LOS ?",
"O.K. ZIMMER 512. DIE TREPPE HOCH. DIE SCHLueSSEL STECKEN SCHON",
" GRAF DRASCULA ? !",
"NEIN, DER TYP HAT HIER EINEN SCHLECHTEN RUF",
+ // 5
"NAJA, ES GIBT MEHRERE GERueCHTE ueBER IHN. EINIGE BEHAUPTEN, DASS ER LEUTE ENTFueHRT UND IHNEN DAS BLUT AUSSAUGT",
"KLAR, ANDERE GLAUBEN, DASS ER EIN ORGANHaeNDLER IST UND DESHALB TAUCHEN ueBERALL AM WALDRAND ZERSTueCKELTE LEICHEN AUF",
"NATueRLICH SIND DAS ALLES NUR GERueCHTE. HoeCHSTWAHRSCHEINLICH STIMMEN SIE ABER. ACH, UND WAS WOLLEN SIE VON IHM ?",
"NEIN, VERGESSEN SIES. ICH HABE NaeMLICH ZU TUN...",
"O.K. ABER WEIL ICH DAS WILL UND NICHT WEIL DU DAS SAGST",
+ // 10
"SIE GEWINNEN",
"LASS MICH IN RUHE, OK ?",
"KLAR, ICH BIN DOCH NICHT BLIND",
"ES IST EIN ALTER BRAUCH IM DORF, DASS MAN BEI EINEM SPIEL ALTE ZWISTE VERGISST, UM DIE MANNSCHAFT ANZUFEUERN",
"UND HALT ENDLICH DEINEN MUND, ICH WILL ZUHoeREN",
+ // 15
"MANN, LASS MICH IN RUHE UND NERV MICH NICHT",
"ES FaeNGT GERADE AN ! STILL JETZT !",
"ACH SO, ICH DACHTE ES IST IRGENDWAS LOS",
"NEIN, IST DOCH EGAL. JETZT WIRD SIE EH SCHON TOT SEIN",
"ER HAT KLASSIK GESPIELT UND ICH HALTE DAS NICHT AUS",
+ // 20
"UND WEIL ICH ES BIN, DER IHN DAFueR BEZAHLT, DASS ER SPIELT, WAS ICH WILL, HABE ICH IHN ENTLASSEN",
"UND DANN KAM ER MIR AUCH NOCH SCHRaeG... UND WAS FueR EINE PAPPNASE ER DOCH IST !",
"...ACH JA, UND PASSEN SIE AUF. DER BODEN IST FRISCH GEBOHNERT",
@@ -3882,26 +5282,31 @@ const char *_textt[][25] = {
"LOS, HAU REIN, GIBS IHM",
},
{
+ // 0
"",
"QU'EST-CE QU'IL Y A, QU'Y A-T-IL?",
"D'ACCORD. CHAMBRE 512. PAR LES ESCALIERS. LA CL EST SUR LA PORTE",
"LE COMTE DRASCULA?!",
- "NON, RIEN, CE TYPE A UNE MAUVAISE RPUTATION PAR ICI",
+ "NON, RIEN, CE TYPE A UNE MAUVAISE R\220PUTATION PAR ICI",
+ // 5
"EH BIEN, IL Y A DES RUMEURS QUI COURENT SUR LUI. CERTAINS DISENT QUE C'EST UN VAMPIRE ET QU'IL ENLEVE DU MONDE POUR SUCER LEUR SANG ",
"MAIS D'AUTRES PENSENT QU'IL EST SEULEMENT UN TRAFICANT D'ORGANES, ET C'EST POUR CELA QUE DES PERSONNES DPECES SONT APPARUES DANS LES ALENTOURS",
"CERTAINEMENT IL NE S'AGIT QUE DES BRUITS QUI COURENT. S\352REMENT IL AURA LES DEUX MTIERS. MAIS, POURQUOI VOULEZ-VOUS VOIR CE TYPE?",
"OH, NON! OUBLIEZ CELA, J'AI BEAUCOUP \267 FAIRE.",
"BON, A VA. MAIS PARCE QUE JE VEUX ET NON PARCE QUE TU LE DIS",
+ // 10
"ILS GAGNENT",
"FICHE-MOI LA PAIX, D'ACCORD?",
"C'EST S\352R, JE NE SUIS PAS UN AVUGLE",
"SELON LA TRADITION DU VILLAGE, QUAND IL Y A UN MATCH ON OUBLIE LES RANCUNES, POUR ALLER ENCOURAGER LA S\220LECTION",
"ET FERME-LA D'UNE FOIS!, JE NE PEUX PAS ENTENDRE",
+ // 15
"ALLEZ, VA-T'-EN ET NE D\220RANGES PAS!",
"\200A VIENT DE COMMENCER! -ET TAIS-TOI!",
"AH, BON! JE PENSAIS QU'IL SE PASSAIT QUELQUE CHOSE",
"NON, C'EST \220GAL. \267 CES HEURES-CI ELLE SERA D\220J\267 MORTE",
"LE FAIT EST QU'ELLE A COMMENC\220 JOUER DE LA MUSIQUE CLASSIQUE ET QUE JE NE SUPPORTE PAS CELA",
+ // 20
"ET MAINTENANT QUE JE LUI AI MIS DEHORS, COMMENT JE LUI PAIE POUR QU'IL JOUE CE QUE JE VEUX",
"ET ENCORE IL S'EST MONTR\220 ARROGANT... -ET DIRE QU'IL PARAISSAIT UNE SAINTE-NITOUCHE!",
"...FAITES ATTENTION, ON VIENT DE CIRER LE PARQUET",
@@ -3909,26 +5314,31 @@ const char *_textt[][25] = {
"OH L\267 L\267! TIENS!",
},
{
+ // 0
"",
"CHE SUCCEDE, CHE SUCCEDE?",
"D'ACCORDO. CAMERA 512. DEVE SALIRE LE SCALE. LA CHIAVE \324 NELLA PORTA",
"IL CONDE DRASCULA?",
"NO, NIENTE. QUEL TIZIO HA MALA REPUTAZIONE QU\336",
+ // 5
"SE DICONO MOLTE COSE SU LUI. COME CH'\324 UN VAMPIRO E SEQUESTRA GENTE PER BERE LA SUA SANGUE",
"ALTRI DICONO CHE SOLO \324 UN TRAFFICANTE DI ORGANI, PER QUELLO TROVIAMO GENTE SQUARTATA FUORI LE MURA",
"SONO SOLTANTO CHIACCHIERE. FORSE SIA LE DUE COSE. MA, PERCHE VUOLE TROVARE QUEL TIZIO?",
"NO, HO MOLTO DA FARE..",
"VA BENE, MA PERCHE VOGLIO IO, NON PERCHE L'ABBIA DETTO TU",
+ // 10
"ADESSO VINCONO",
"LASCIAMI IN PACE, O.K.?",
"CERTO, NON SONO CIECO",
"C'\324 LA TRADIZIONE NEL PAESE DI DIMENTICARE I RANCORI QUANDO C'\324 PARTITA DI CALCIO; PER ANIMARE LA SELEZIONE",
"TI HO DETTO DI STARE ZITTO, NON RIESCO A SENTIRE",
+ // 15
"LASCIAMI IN PACE E NON MI DISTURBARE",
"\324 APPENA COMINCIATO, ZITTO!",
"AH, BENE. HO PENSATO CHE SUCCEDEVA QUALCOSA",
"NO, NON FA NIENTE. ADESSO SICURO CH'\324 GI\267 MORTA",
"SI \324 MESSO A SUONARE MUSICA CLASSICA ED IO LA ODIO",
+ // 20
"\324 COME FACCIO PER SENTIRE QUELLO CHE VOGLIO SE L'HO LICENZIATO",
"E ORA SI METTE BULLO...-E SEMBRAVA PROPRIO SCEMO!",
"...SENTA! FACCIA ATTENZIONE. IL PAVIMENTO \324 APPENA INCERATO",
@@ -3938,327 +5348,393 @@ const char *_textt[][25] = {
};
-const char *_textvb[][63] = {
+const char *_textvb[NUM_LANGS][NUM_TEXTVB] = {
{
+ // 0
"",
"WHO THE HELL IS CALLING AT THIS TIME?",
"OH, ..OH, NO, NO....I'M...GANIMEDES THE DWARF. PROFESSOR VON BRAUN DOESN'T LIVE HERE ANYMORE",
- "NO, I DON'T KNOW WHERE IT IS !!",
+ "NO, I DON'T KNOW WHERE HE LIVES !!",
"GET OUT!!",
+ // 5
"IT'S TOO LATE NOW, YOU IDIOT!! IT ALWAYS IS",
"I COULDN'T AGREE MORE",
"ME, SCARED?",
- "LISTEN HERE, DUDE. YOU'RE RIGHT NOW TALKING TO THE ONLY PERSON WHO KNOWS THE SECRET TO FIGHT AGAINST THE VAMPIRE",
+ "LISTEN HERE, DUDE. YOU'RE TALKING TO THE ONLY PERSON WHO KNOWS THE SECRET OF HOW TO FIGHT AGAINST THE VAMPIRES",
"YOU NEED TO HAVE SPECIAL SKILLS TO FIGHT AGAINST A VAMPIRE. NOT EVERYBODY CAN DO IT",
+ // 10
"YOU DON'T HAVE THEM",
"I'M SURE YOU WOULDN'T BET ALL YOUR MONEY ON IT, HUH?",
"WELL, ALL RIGHT, COME ON IN",
- "IF YOU REALLY MEAN TO FACE DRASCULA, YOU'VE GOT TO BE ABLE TO TAKE ALL TYPES OF CREAKING AND VAMPIRE-LIKE NOISES",
+ "IF YOU REALLY MEAN TO FACE DRASCULA, YOU'VE GOT TO BE ABLE TO STAND ALL TYPES OF CREAKING AND VAMPIRE-LIKE NOISES",
"IS THAT CLEAR?",
+ // 15
"OK, WAIT A MINUTE",
"STAND IN THE CENTER OF THE ROOM, PLEASE",
- "WHERE DID I PUT THAT RECORD CALLED \"NAILS SCRATCHING THE BLACKBOARD\"?",
+ "NOW WHERE DID I PUT THE RECORD CALLED \"NAILS SCRATCHING THE BLACKBOARD\"?",
"ALL RIGHT. LET'S GET TO IT",
"YOU ARE USELESS. YOU SEE...?, JUST LIKE THE REST!!",
- "JUST GIVE ME NOW THE MONEY YOU LOST AND GET OUT OF HERE",
+ // 20
+ "JUST GIVE ME THE MONEY, YOU LOST SO GET OUT OF HERE",
"AND DON'T COME BACK UNTIL YOU ARE ABSOLUTELY READY",
"WHAT DO YOU WANT NOW?",
- "I HAVE TO ADMIT IT. YOU REALLY GOT WHAT IT TAKES TO FIGHT AGAINST THE VAMPIRES",
- "HEY, TAKE YOUR MONEY. I ADMIT IT WHEN I MAKE A MISTAKE...",
+ "I HAVE TO ADMIT IT. YOU REALLY HAVE WHAT IT TAKES TO FIGHT AGAINST THE VAMPIRES",
+ "HEY, TAKE YOUR MONEY. I'LL ADMIT IT. I MAKE A MISTAKE...",
+ // 25
"LEAVE ME ALONE NOW, I WANT TO GET SOME SLEEP",
"WHENEVER YOU ARE READY TO FIGHT AGAINST THE VAMPIRES, JUST COME BACK AND I'LL HELP YOU OUT",
- "OH, THAT'S EASY. JUST USING THE LIGHT OF ONE CRUCIFIX IS ENOUGH TO DESTROY HIM",
- "YOU HAVE TO BE EXTRA CAREFUL WITH DRASCULA, HIS FRISISNOTICS POWERS HAVE MADE OF HIM THE MOST POWERFUL VAMPIRE",
- "YOU'D BE LOST IF IT WASN'T FOR THEY...",
+ "OH, THAT'S EASY. TAKE THIS CRUCIFIX JUST USING IT'S LIGHT IS ENOUGH TO DESTROY A VAMPIRE",
+ "YOU HAVE TO BE EXTRA CAREFUL WITH DRASCULA, HIS FRISISNOTIC POWERS HAVE MADE OF HIM THE MOST POWERFUL VAMPIRE",
+ "YOU'D BE LOST IF IT WASN'T FOR THIS...",
+ // 30
"...BREW!",
"YEAH, YOU'RE RIGHT! I MIGHT HAVE SOME PROBLEMS WITH MY BACK IN THE FUTURE IF I KEEP ON SLEEPING THIS WAY",
"I UNDERSTAND HE WAS A BETTER OPPONENT THAN ME, BUT YOU HAVE TO ADMIT THAT THE DISCOVERY I MADE ABOUT ANTI-VAMPIRE TECHNIQUES WAS WHAT ACTUALLY PROTECTED ME",
- "I'VE FOUND THIS IMMUNIZING BREW THAT KEEPS YOU SAFE FROM ANY VAMPIRES' BITE OR AGAINST HIS FRISISNOTICS POWERS",
+ "I'VE FOUND THIS IMMUNIZING BREW THAT KEEPS YOU SAFE FROM ANY VAMPIRES' BITE OR AGAINST HIS FRISISNOTIC POWERS",
"NO, NO, EXCUSE ME. I HAD IT ONCE BUT IT'S VERY DANGEROUS TO HAVE A BREW OF THAT TYPE. CAN YOU IMAGINE WHAT COULD HAPPEN IF A VAMPIRE GOT IT?",
- "HE'D BE IMMUNIZED AGAINST GARLIC, THE SUNSHINE LIGHT... SO I HAD TO GET RID OF WHAT I DIN'T USE BY THE SCIENTIFIC METHOD OF THROWING IT IN THE LAVATORY",
+ // 35
+ "HE'D BE IMMUNIZED AGAINST GARLIC, AND THE SUNSLIGHT... SO I HAD TO GET RID OF WHAT I DIDN'T USE BY THE SCIENTIFIC METHOD OF THROWING IT IN THE LAVATORY",
"DON'T WORRY, I REMEMBER EXACTLY HOW TO MAKE THAT BREW",
- "I NEED GARLIC, BUT I ALREADY HAVE THEM. HOWEVER YOU'LL HAVE TO GET ME SOME WAX, BUBBLE GUM AND CIGARETTE PAPER OR PERHAPS A NAPKING OR SOMETHING ALIKE",
+ "I NEED GARLIC, BUT I ALREADY HAVE THAT. HOWEVER YOU'LL HAVE TO GET ME SOME WAX, BUBBLE GUM AND CIGARETTE PAPER OR PERHAPS A NAPKIN OR SOMETHING ALIKE",
"OH...AND OF COURSE THE MOST IMPORTANT INGREDIENT. LEAVES FROM A VERY STRANGE PLANT CALLED FERNAN",
- "IT'S A CLIMBING PLANT WHICH LEAVES HAVE MAGIC POWERS IF THEY'RE CUT WITH A GOLDEN SICKLE",
- "SO THAT AS SOON AS YOU HAVE THESE FIVE THINGS, JUST COME HERE AND I'LL MAKE THE BREW",
+ "IT'S A CLIMBING PLANT WHOSE LEAVES HAVE MAGIC POWERS IF THEY'RE CUT WITH A GOLDEN SICKLE",
+ // 40
+ "SO AS SOON AS YOU HAVE THESE FIVE THINGS, JUST COME HERE AND I'LL MAKE THE BREW",
"YOU'LL BE READY THEN TO FIGHT AGAINST DRASCULA",
- "REMEMBER: WAX, NICOTINE, A PIECE OF BUBBLE GUM, A PAPER AND SOME FERNAN'S LEAVES CUT WITH A GOLDEN SICKLE",
- "I TOLD YOU! IT WAS JUST BECAUSE OF THE BREW!",
- "OH, ALL RIGHT. I'M GOING TO MAKE MYSELF A...THE BREW. JUST A MOMENT, OK?",
+ "REMEMBER: WAX, NICOTINE, A PIECE OF BUBBLE GUM, PAPER AND SOME FERNAN'S LEAVES CUT WITH A GOLDEN SICKLE",
+ "I TOLD YOU! IT WAS BECAUSE OF THE BREW!",
+ "OH, ALL RIGHT. I'M GOING TO MAKE MYSELF ...THE BREW. JUST A MOMENT, OK?",
+ // 45
"IT'S A PROTECTING SPELL AGAINST VAMPIRES",
- "I PUT IT THERE IN ORDER TO PRETEND THAT THE SKETCHER DIDN'T FORGET TO DRAW THE WINDOW YOU CAN SEE FROM OUTSIDE",
+ "I PUT IT THERE IN ORDER TO PRETEND THE ARTIST DIDN'T FORGET TO DRAW THE WINDOW YOU CAN SEE FROM OUTSIDE",
"ALL RIGHT, THE FIRST THING YOU MUST KNOW IS THE WAY TO DRASCULA'S CASTLE",
- "THERE IS A CAVERN THAT GETS YOU STRAIGHT FROM THE CASTLE. IGOR, THE CRAZY ELVIS' FUN, TAKES IT TO GET TO THE VILLAGE EACH MORNING",
+ "THERE IS A CAVERN THAT GETS YOU STRAIGHT FROM THE CASTLE. IGOR, THE CRAZY SERVANT', TAKES IT TO GET TO THE VILLAGE EACH MORNING",
"BE CAREFUL THOUGH, THERE IS A VAMPIRE ALWAYS WATCHING OVER IT. YOU'LL HAVE TO GET RID OF HIM",
+ // 50
"THERE IS AN OLD WELL RIGHT BY THE CEMETERY CHURCH",
"IT WAS USED A LONG TIME AGO FOR WITCHCRAFT TRIALS",
"THEY THREW THE WITCHES IN THE WELL. IF THEY DROWNED THEY WERE REAL WITCHES. IF THEY DIDN'T, THEY WEREN'T",
"WE THREW ONE ONCE AND SHE DIDN'T DROWN, I GUESS SHE WASN'T A WITCH",
- "ANYWAY. THERE IS YOUR BREW. HOWEVER, I ONLY GOT TO MAKE ENOUGH JUST FOR ONE PERSON",
+ "ANYWAY. THERE IS YOUR BREW. HOWEVER, I ONLY GOT TO MAKE ENOUGH FOR ONE PERSON",
+ // 55
"YOU'D BETTER SMOKE IT RIGHT BEFORE YOU FIGHT AGAINST DRASCULA",
"COME ON, RUN!",
"OH, JUST EXCUSES...!",
"ARE YOU JOHN HACKER? I'M DOCTOR VON BRAUN",
"LISTEN TO ME, THIS IS VERY IMPORTANT. IT'S ABOUT THE BREW",
- "SHUT UP AND LET ME TALK. I JUST FOUND THIS BOOK ABOUT ANTI-VAMPIRE BREWS WARNING AGAINST MIXING THE JOINT WITH ANY ALCOHOLIC DRINK BEFORE YOU",
- "ALCOHOL REACTS WHEN MIXED WITH BREW, SO THAT IT CANCELS OUT ITS EFFECTS JUST IN A FEW SECONDS",
- "I'M SORRY, BUT I HAVE TO HANG UP RIGHT NOW. THE POLICE IS LOOKING FOR ME, THEY THINK I'M A PUSHER. STUPIDS!. ANYWAY, BYE AND GOOD LUCK SAVING THE WORLD!",
+ // 60
+ "SHUT UP AND LET ME TALK. I JUST FOUND THIS BOOK ABOUT ANTI-VAMPIRE BREWS WARNING AGAINST MIXING THE CIGARETTE WITH ANY ALCOHOLIC DRINK",
+ "ALCOHOL REACTS WHEN MIXED WITH BREW, SO THAT IT CANCELS OUT IT'S EFFECTS IN A FEW SECONDS",
+ "I'M SORRY, BUT I HAVE TO HANG UP RIGHT NOW. THE POLICE ARE LOOKING FOR ME, THEY THINK I'M A DRUG PUSHER. IDIOTS!. ANYWAY, BYE AND GOOD LUCK SAVING THE WORLD!",
},
{
+ // 0
"",
"\250QUIEN DIABLOS LLAMA A ESTAS HORAS?",
"EH... NO, NO. YO SOY EL ENANO GANIMEDES... EL PROFESOR VON BRAUN YA... YA NO VIVE AQUI",
"\255NO, NO SE DONDE ESTA!",
"\255QUE TE VAYAS! ",
+ // 5
"IMBECIL. YA ES DEMASIADO TARDE, SIEMPRE LO ES",
"ESTOY TOTALMENTE DE ACUERDO",
"\250YO MIEDO?",
"ENTERATE CHAVAL: ESTAS HABLANDO CON EL UNICO QUE CONOCE EL SECRETO PARA ENFRENTARSE A LOS VAMPIROS",
"NO TODO EL MUNDO ES CAPAZ DE LUCHAR CON UN VAMPIRO. HAY QUE TENER UNAS CUALIDADES ESPECIALES",
+ // 10
"NO LAS TIENES",
"\250TE APUESTAS TODO TU DINERO A QUE NO?",
"ESTA BIEN. PASA",
"SI DE VERDAD ERES CAPAZ DE ENFRENTARTE A DRASCULA, DEBER PODER SOPORTAR TODOS LOS RUIDOS CHIRRIANTES Y VAMPIRICOS",
"\250QUEDA CLARO?",
+ // 15
"DE ACUERDO. ESPERA UN MOMENTO",
"POR FAVOR, PONTE EN EL CENTRO DE LA HABITACION",
"VEAMOS. \250DONDE HE PUESTO EL DISCO ESTE DE \"U\245AS ARRASCANDO UNA PIZARRA\"?",
"MUY BIEN. VAMOS ALLA",
"\250VES? ERES UN INUTIL, COMO TODOS LOS DEMAS",
+ // 20
"AHORA DAME EL DINERO QUE HAS PERDIDO Y VETE DE AQUI",
"Y NO VUELVAS HASTA QUE NO ESTES PREPARADO DEL TODO",
"\250Y QUE ES LO QUE QUIERES TU AHORA?",
"HE DE RECONOCERLO... TIENES APTITUDES PARA LUCHAR CON LOS VAMPIROS",
"POR CIERTO, TOMA TU DINERO. SE CUANDO ME HE EQUIVOCADO",
+ // 25
"AHORA VETE, QUE QUIERO DORMIR UN POCO",
"CUANDO ESTES DISPUESTO A ENFRENTARTE A ALGUN VAMPIRO, VUELVE Y TE AYUDARE EN LO QUE PUEDA",
"OH, ESO ES FACIL. LA LUZ DEL SOL O UN CRUCIFIJO Y LE HACES POLVO",
"CON EL QUE DEBES PONER ESPECIAL CUIDADO ES CON DRASCULA. SUS PODERES FRISISHNOSTICOS LE HACEN EL MAS PODEROSO DE LOS VAMPIROS",
"ESTARIAS PERDIDO A NO SER POR LA...",
+ // 30
"...\255POCION!",
"OH, CLARO. TIENES RAZON, SI SIGO DURMIENDO ASI A LO MEJOR TENGO PROBLEMAS DE COLUMNA CUANDO SEA VIEJO",
"BUENO, ADMITO QUE RESULTO MEJOR ADVERSARIO QUE YO, PERO MI PRINCIPAL HALLAZGO EN EL ESTUDIO DE TECNICAS ANTI-VAMPIROS FUE LO QUE ME CUBRIO LAS ESPALDAS",
"DESCUBRI UNA POCION DE INMUNIDAD. TE HACE INVULNERABLE ANTE CUALQUIER MORDEDURA DE VAMPIRO, O A SUS PODERES FRSISSHNOTICOS",
"NO, PERDONA LA TUVE EN SU DIA, PERO UNA POCION DE ESAS CARACTERISTICAS ES PELIGROSA. IMAGINATE SI CAYERA EN MANOS DE UN VAMPIRO",
+ // 35
"LE HARIA INMUNE A LOS AJOS, A LA LUZ DEL SOL... ASI QUE TUVE QUE DESHACERME DE LO QUE NO USE POR EL CIENTIFICO METODO DE TIRARLO A LA TAZA DEL WATER",
"TRANQUILO, ME ACUERDO PERFECTAMENTE DE COMO PREPARAR ESA POCION ",
"NECESITO AJOS, QUE DE ESO YA TENGO, PERO ME TENDRAS QUE CONSEGUIR ALGO DE CERA, NICOTINA, UN CHICLE, Y UN PAPEL DE FUMAR, O UNA SERVILLETA, O ALGO PARECIDO",
"\255AH! Y POR SUPUESTO, EL INGREDIENTE PRINCIPAL: UNAS HOJAS DE UNA EXTRA\245A PLANTA LLAMADA FERNAN",
"SE TRATA DE UNA PLANTA ENREDADERA CUYAS HOJAS PROPORCIONAN PODERES MAGICOS SI SE CORTAN CON UNA HOZ DE ORO",
+ // 40
"PUES YA SABES, EN CUANTO TENGAS ESAS CINCO COSAS ME LAS TRAES Y TE PREPARARE LA POCION",
"DESPUES ESTARAS LISTO PARA LUCHAR CON DRASCULA",
"RECUERDA: CERA, NICOTINA, UN CHICLE, UN PAPEL Y UNAS HOJAS DE FERNAN, LA PLANTA, CORTADAS CON UNA HOZ DE ORO",
"\255YA TE LO HE DICHO! FUE TODO GRACIAS A LA POCION",
"AH, MUY BIEN. VOY ENTONCES A PREPARARME EL PO... LA POCION. SOLO TARDO UN MOMENTO",
+ // 45
"ES UN SORTILEGIO DE PROTECCION CONTRA VAMPIROS",
"LO PUSE PARA DISIMULAR QUE EL DIBUJANTE SE OLVIDO DE PONER LA VENTANA QUE SE VE DESDE FUERA",
"BUENO, LO PRIMERO QUE DEBES SABER ES COMO SE VA AL CASTILLO DRASCULA",
"HAY UNA GRUTA QUE LLEVA DIRECTAMENTE AL CASTILLO Y QUE ESE LOCO FAN DE ELVIS, IGOR, USA PARA BAJAR AL PUEBLO POR LAS MA\245ANAS",
"PERO TEN CUIDADO, SIEMPRE ESTA PROTEGIDA POR UN VAMPIRO. TENDRAS QUE LIBRARTE DE EL",
+ // 50
"HAY UN VIEJO POZO AL LADO DE LA CAPILLA DEL CEMENTERIO",
"SE USABA ANTIGUAMENTE PARA JUZGAR CASOS DE BRUJERIA",
"SE TIRABA A LAS BRUJAS AL POZO. SI SE HUNDIAN ERAN BRUJAS. SI NO, NO",
"UNA VEZ TIRAMOS A UNA Y NO SE HUNDIO, ASI QUE NO SERIA BRUJA",
"A LO QUE VAMOS: TOMA TU POCION, PERO SOLO ME HA DADO PARA UNO",
+ // 55
"LO MEJOR ES QUE TE LO FUMES JUSTO ANTES DE ENFRENTARTE A DRASCULA",
"CORRE",
"\255EXCUSAS!",
"\250JOHN HACKER? SOY EL DOCTOR VON BRAUN",
"ESCUCHEME, ES MUY IMPORTANTE. ES SOBRE LA POCION",
+ // 60
"ME HE ENCONTRADO UN LIBRO SOBRE POCIONES Y DICE QUE NO DEBE USTED BEBER ALCOHOL UNA VEZ SE HAYA FUMADO LA POCION",
"EL ALCOHOL INGERIDO REACCIONA CON LAS SUSTANCIAS DE LA POCION Y ANULA SUS EFECTOS EN DECIMAS DE SEGUNDO",
"TENGO QUE COLGAR. LA POLICIA ME BUSCA. DICEN QUE TRAFICO CON DROGAS \255IGNORANTES! BUENO, ADIOS Y SUERTE SALVANDO AL MUNDO",
},
{
+ // 0
+ "",
"WER ZUM TEUFEL KLINGELT UM DIESE UHRZEIT ?",
"aeH......NEIN, NEIN. ICH BIN HELGE SCHNEIDER...HERR PROFESSOR VON BRAUN ...aeH...WOHNT HIER NICHT MEHR",
"NEIN, ICH WEISS NICHT WO ER IST !",
"NUN GEH SCHON !",
+ // 5
"TROTTEL. ES IST SCHON ZU SPaeT, WIE IMMER",
"ICH BIN ABSOLUT EINVERSTANDEN",
"ICH UND DIE HOSEN VOLL ?",
"DAMIT DAS KLAR IST, KURZER : DU SPRICHST GERADE MIT DEM EINZIGEN DER DAS GEHEIMREZEPT GEGEN VAMPIRE HAT",
"NICHT JEDER KANN GEGEN EINEN VAMPIR ANTRETEN.MAN MUSS EIN PAAR GANZ BESONDERE EIGENSCHAFTEN BESITZEN",
+ // 10
"DU HAST SIE NICHT",
"WETTEN NICHT ? 100.000 MARK, DASS NICHT !",
"SCHON GUT, KOMM REIN",
"WENN DU DICH DRACULA WIRKLICH STELLEN WILLST WIRST DU ALLE DIESE VAMPIRTYPISCHEN SAUG-UND QUIETSCHGERaeUSCHE ERTRAGEN MueSSEN",
"IST DAS KLAR ?",
+ // 15
"O.K. WARTE MAL EINEN MOMENT",
"STELL DICH BITTE MAL IN DIE MITTE DES ZIMMERS",
"GUCKEN WIR MAL. WO IST DIESE PLATTE MIT\"FINGERNaeGEL KRATZEN AN DER TAFEL ENTLANG\" ?",
"SEHR GUT, GEHEN WIR DA HIN",
"SIEHST DU, DU BIST GENAUSO UNFaeHIG WIE ALLE ANDEREN !",
+ // 20
"JETZT GIB MIR DAS GELD,UM DAS WIR GEWETTET HABEN UND KOMM HER",
"UND KOMM ERST DANN WIEDER, WENN DU 100%IG VORBEREITET BIST",
"UND WAS WILLST DU JETZT ?",
"ICH MUSS ZUGEBEN, DASS DU DAS NoeTIGE TALENT ZUR VAMPIRJAGD HAST",
"ueBRIGENS, HIER IST DEIN GELD. ICH HABE MICH GEIRRT",
+ // 25
"UND JETZT GEH, ICH MoeCHTE MICH HINLEGEN",
"KOMM ZURueCK,WENN DU SO WEIT BIST, DICH EINEM VAMPIR GEGENueBERZUSTELLEN UND ICH WERDE DIR HELFEN",
"ACH, DAS IST GANZ EINFACH. EIN SONNENSTRAHL ODER EIN KRUZIFIX UND ER WIRD ZU STAUB",
"AM MEISTEN AUFPASSEN MUSST DU BEI DRASCULA..WEGEN SEINEN TRANSHYPNITISCHEN FaeHIGKEITEN IST ER DER GEFaeHRLICHSTE UNTER DEN VAMPIREN",
"DU WaeRST VERLOREN, ES SEI DENN DU HaeTTEST...",
+ // 30
"....DIE MISCHUNG! ",
"JA, STIMMT, DU HAST RECHT. WENN ICH WEITERHIN SO LIEGE WERDE ICH IM HOHEN ALTER WOHL RueCKENPROBLEME HABEN",
"NAJA, ICH GEBE ZU DASS ER der bessere von uns war, ABER DIE WICHTIGSTE ERKENNTNIS IN MEINEM ANTI-VAMPIR-STUDIUM WAR, MIR EINEN BODYGUARD ZUZULEGEN",
"ICH HABE EINE IMMUNITaeTSMISCHUNG GEFUNDEN. MIT DER KANN DIR KEIN EINZIGER VAMPIRBISS ETWAS ANHABEN, UND AUCH NICHT SEINE TRANSHYPNISIE.",
"NEIN, TUT MIR LEID, ICH HATTE SIE damals, ABER EINE MISCHUNG DIESER KONSISTENZ IST SEHR GEFaeHRLICH, UND STELL DIR MAL VOR, ES GERaeT IN VAMPIRHaeNDE",
+ // 35
"DAS WueRDE IHN IMMUN GEGEN KNOBLAUCH UND SONNENLICHT GEMACHT HABEN, DIE RESTE, DIE ICH NICHT MEHR FueR WISSENSCHAFTLICHE ZWECKE BRAUCHTE, landeten im klo",
"NUR DIE RUHE, ICH HABE DAS REZEPT KOMPLETT IM KOPF ",
"ICH BRAUCHE KNOBLAUCH,AH, HAB ICH SCHON, ABER DANN MUSST DU NOCH WACHS BESORGEN, NIKOTIN, KAUGUMMI UND EIN BLaeTTCHEN ODER EINE SERVIETTE ODER SO WAS",
"ACH KLAR ! UND DIE WICHTIGSTE ZUTAT : EIN PAAR BLaeTTER EINER SELTSAMEN PFLANZE DIE FREDDY HEISST",
"ES HANDELT SICH UM EINE TOPFBLUME DEREN BLaeTTER ZAUBERKRaeFTE HABEN, WENN MAN SIE MIT EINER GOLDSICHEL ABSCHNEIDET",
+ // 40
"ALSO, DU WEISST SCHON, SOBALD DU MIR DIESE FueNF ZUTATEN GEBRACHT HAST, BEREITE ICH DIR DIE MISCHUNG ZU",
"DANACH BIST DU FueR DEN KAMPF GEGEN DRASCULA GERueSTET",
"DENK DRAN : WACHS, NIKOTIN, EIN KAUGUMMI, EIN BLaeTTCHEN UND EIN PAAR BLaeTTER VON FREDDY, MIT EINER GOLDSICHEL ABGESCHNITTEN",
"HAB ICH DIR DOCH SCHON GESAGT ! NUR DANK DER MISCHUNG",
"OK. ALLES KLAR. ICH FANG DANN MAL AN EINEN ZU BAUEN...aeH VORZUBEREITEN. DAUERT AUCH NICHT LANGE",
+ // 45
"DAS IST EINE ZAUBERFORMEL, DIE VOR VAMPIREN SCHueTZT",
"DAS WAR ICH, DAMIT MAN NICHT MERKT, DASS DER ZEICHNER VERGESSEN HAT DAS FENSTER VON VORHIN ZU ZEICHNEN",
"ALSO, ZUERST MUSST DU WISSEN WIE MAN ZUM SCHLOSS VON DRASCULA KOMMT.",
"ES GIBT EINE GROTTE, DIE DIREKT ZUM SCHLOSS FueHRT, UND DURCH DIE IGOR, DIESER BEKLOPPTE ELVIS-FAN MORGENS IMMER ZUM DORF RUNTER GEHT",
"ABER PASS AUF, SIE WIRD PERMANENT VON EINEM VAMPIR BEWACHT, DEN DU ERSTMAL LOSWERDEN MUSST",
+ // 50
"ES GIBT DA EINEN ALTEN BRUNNEN BEI DER FRIEDHOFSKAPELLE",
"FRueHER WURDE ER FueR HEXENPROZESSE BENUTZT",
"MAN WARF DIE HEXEN IN DEN BRUNNEN. WENN SIE UNTERGINGEN WAREN SIE HEXEN, WENN NICHT, DANN NICHT",
"EINMAL WARFEN WIR EINE RUNTER, DIE NICHT UNTERGING, ALSO WAR SIE KEINE HEXE",
"WENN WIR LOSGEHEN, NIMMST DU DEINE MISCHUNG, ABER WIR HABEN NUR FueR EINE PERSON",
+ // 55
"AM BESTEN RAUCHST DU IHN DIR KURZ BEVOR DU DRACULA GEGENueBERSTEHST",
"LAUF !",
"BILLIGE AUSREDEN !",
"HEINZ HACKER ? ICH BIN DOKTOR VON BRAUN",
"HoeREN SIE ZU, ES IST SEHR WICHTIG. ES GEHT UM DIE MISCHUNG",
+ // 60
"ICH HABE EIN BUCH ueBER MISCHUNGEN GEFUNDEN UND DA STEHT DASS MAN KEINEN ALKOHOL TRINKEN DARF, SOBALD MAN DIE MISCHUNG GERAUCHT HAT",
"DER ALKOHOL REAGIERT IM MAGEN MIT DEN SUBSTANZEN DER MISCHUNG UND VERNICHTET IHRE WIRKUNG BINNEN WENIGER MILLISEKUNDEN",
"ICH MUSS AUFLEGEN. DIE POLIZEI IST HINTER MIR HER. DIE IDIOTEN HALTEN MICH FueR EINEN DROGEN-DEALER !ALSO, TSCHueSS UND VIEL GLueCK !",
},
{
+ // 0
"",
"QUI DIABLE APPELLE \267 CETTE HEURE-CI?",
"H... NON, NON. JE SUIS LE NAIN GANYM\324DE... LE PROFESSEUR VON BRAUN... N'HABITE DJ\267 L\267",
"NON, JE NE SAIS PAS O\353 IL EST!",
"VA-T'-EN!",
+ // 5
"IMBCIL! C'EST DJ\267 TROP TARD! C'EST TOUJOURS TROP TARD!",
"JE SUIS TOUT-\267-FAIT CONFORME",
"MOI PEUR?",
"RENSEIGNE-TOI, MON GARS: TU PARLES AVEC LE SEUL QUI CONNA\327T LE SECRET POUR CONFRONTER LES VAMPIRES",
"TOUT LE MONDE N'EST PAS CAPABLE DE LUTTER AVEC UN VAMPIRE. IL FAUT DES QUALITS SPCIALES",
+ // 10
"TU NE LES A PAS",
"EST-CE QUE TU PARIE TOUT L'ARGENT QUE TU AS \267 QUE C'EST NON?",
"\200A VA, ENTRE",
"SI EN V\220RIT\220 TU TE SENS CAPABLE DE CONFRONTER DRASCULA, IL FAUDRA QUE TU SUPPORTES TOUS LES BRUITS GRIN\200ANTS ET SU\200ANTS",
"C'EST CLAIR?",
+ // 15
"D'ACCORD. ATTENDS UN INSTANT",
"METS-TOI AU MILIEU DE LA CHAMBRE, S'IL TE PLA\327T",
"VOYONS! O\353 EST-CE QUE J'AI MIS LE DISQUE \"ONGLES GRATTANT UN TABLEAU\"?",
"TR\324S BIEN. ON Y VA",
"TU VOIS? TU ES UN INCAPABLE, COMME TOUS LES AUTRES",
+ // 20
"MAINTENANT DONNE-MOI L'ARGENT QUE TU AS PERDU ET VA-T'-EN",
"ET N'Y REVIENS \267 MOINS QUE TU SOIS COMPL\324TEMENT EN FORME",
"ET QUE VEUX-TU MAINTENANT?",
"JE DOIS LE RECONNA\327TRE... TU AS DES APTITUDES POUR LUTTER CONTRE LES VAMPIRES",
"EN FAIT, TIENS TON ARGENT. JE SAIS RECONNA\327TRE MES ERREURS",
+ // 25
"MAINTENANT VA-T'-EN, JE VEUX DORMIR UN PEU ",
"QUAND TU SOIS PR\322T \267 TE CONFRONTER AVEC UN VAMPIRE, REVIENS ET TU POURRAS COMPTER SUR MOI",
"OH! C'EST FACIL. AVEC LA LUMI\324RE DU SOLEIL OU UN CRUCIFIX TU LE R\220DUIT EN CENDRES",
"MAIS TU DOIS FAIRE SP\220CIALE ATTENTION AVEC DRASCULA. GR\266CE \267 SES POUVOIRS FRISYSHNOSTIQUES C'EST LE PLUS PUISSANT DES VAMPIRES",
"JE SERAIS PERDU SI CE N'EST PAS POUR LA...",
+ // 30
"...POTION!",
"OH, BIEN S\352R. TU AS RAISON, SI JE CONTINUE \267 DORMIR COMME \200\265, J'AURAI DES PROBL\324MES DE COLONNE DANS MA VIEILLESSE",
"bon, J'ACCEPTE QU'IL A \220T\220 MEILLEURE ADVERSAIRE QUE MOI, MAIS JE ME SUIS GARD\220 LE DOS GR\266CE \267 MA BONNE TROUVAILLE DANS L'\220TUDE DE TECHNIQUES ANTI-VAMPIRES",
"J'AI D\220COUVERT UNE POTION IMMUNOLOGIQUE QUI TE FAIT INVULN\220RABLE CONTRE N'IMPORTE QUELLE MORSURE DE VAMPIRE OU SES POUVOIRS FRSYSSHNOTIQUES",
"NON, EXCUSES-MOI. JE L'AI EUE, MAIS UNE POTION DE CES CARACT\220RISTIQUES EST DANGEREUSE. IMAGINE TOI SI ELLE TOMBAIT DANS LES MAINS D'UN VAMPIRE",
+ // 35
"IL DEVIENDRAIT IMMUNIS\220 AUX AILS, \267 LA LUMI\324RE DU SOLEIL. DONC, J'AI D\352 M'EN D\220BARRASSER DES EXC\220DENTS PAR LA SCIENTIFIQUE M\220THODE DE LES JETER AUX \220GOUTS",
"RESTE TRANQUILLE, JE ME SOUVIENS PARFAITEMENT DE LA PR\220PARATION DE CETTE POTION",
"il me faut D'AIL, MAIS J'EN AI D\220J\267. IL FAUDRA UN PEU DE CIRE, DE LA NICOTINE, UN CHEWING-GUM ET UN PAPIER \267 CIGARETTES, OU QUELQUE CHOSE PAREILLE",
"AH! ET CERTAINEMENT, L'INGR\220DIANT PRINCIPAL: LES FEUILLES D'UNE \220TRANGE PLANTE APPEL\220E FERNAN",
"IL S'AGIT D'UNE PLANTE GRIMPANTE DONT LES FEUILLES FOURNISSENT DES POUVOIRS MAGIQUES SI ON LES COUPE AVEC UNE FAUCILLE EN OR",
+ // 40
"TU LE SAIS D\220J\267. D\324S QUE TU AURAS CES CINQ TRUCS APPORTE-LES-MOI ET JE TE PR\220PARERAI LA POTION",
"APR\324S TU SERAS PR\322T POUR LUTTER CONTRE DRASCULA",
"RAPPELLE-TOI: DE LA CIRE, DE LA NICOTINE, UN CHEWING-GUM, UN PAPIER ET LES FEUILLES DE FERNAN, LA PLANTE, COUP\220ES AVEC UNE FAUCILLE EN OR",
"JE TE L'AI D\220J\267 DIT! TOUT A \220T\220 GR\266CE \267 LA POTION",
"AH! TR\324S BIEN! ALORS, JE VAIS ME PR\220PARER LE PO... LA POTION. JE N'AI QUE POUR UN MOMENT",
+ // 45
"C'EST UN SORTIL\324GE DE PROTECTION CONTRE-VAMPIRES",
"JE L'AI MIS POUR DISSIMULER, LE DESSINATEUR AYANT OUBLI\220 D'Y METTRE LA FEN\322TRE QU'ON VOIT DU DEHORS",
"EH BIEN, CE QUE TU DOIS SAVOIR D'ABORD C'EST LA FA\200ON D'ALLER AU CH\266TEAU DE DRASCULA",
"IL Y A UNE GROTTE QUI M\324NE DIRECTEMENT AU CH\266TEAU ET QU'IGOR, CE FOU FAN D'ELVIS, EN UTILISE POUR SE RENDRE AU VILLAGE LE MATIN",
"MAIS FAIT ATTENTION, ELLE TOUJOURS GARD\220E PAR UN VAMPIRE. TU DEVRAS T'EN D\220BARRASSER",
+ // 50
"IL Y A UN VIEUX PUITS \267 C\342T\220 DE LA CHAPELLE DU CIMETI\324RE",
"ON L'UTILISAIT JADIS POUR JUGER DES AFFAIRES DE SORCELLERIE",
"ON JETAIT LES SORCI\324RES AU PUITS. SI ELLES COULAIENT, ON \220TAIT S\352R; AUTREMENT, PAS",
"UNE FOIS ON A JET\220 UNE ET ELLE N'AS PAS COUL\220, DONC ELLE NE SERAIT PAS UNE SORCI\324RE",
"MAINTENANT GARDE \267 LA QUESTION QUI NOUS INT\220RESSE: TIENS TA POTION, MAIS ON NE M'A PAS DONN\220 QUE POUR UN SEULEMENT.",
+ // 55
"IL VAUDRA MIEUX QUE TU LA FUMES JUSTE AVANT DE CONFRONTER DRASCULA",
"COURS!",
"DES EXCUSES!",
"JHON HACKER? SUIS LE DOCTEUR VON BRAUN",
"\220COUTEZ-MOI. C'EST TR\324S IMPORTANT. C'EST SUR LA POTION",
+ // 60
"DANS UN LIVRE QUE J'AI TROUV\220 SUR LES POTIONS, IL DIT QUE VOUS NE DEVEZ PAS BOIR DE L'ALCOOL APR\324S AVOIR FUM\220 LA POTION ",
"L'ALCOOL AVAL\220 R\220AGIT AVEC LES INGR\220DIENTS DE LA POTION ET ANNULE SES EFFETS EN DIXI\324MES DE SECONDE",
"JE DOIS RACCROCHER. SUIS CHERCH\220 PAR LA POLICE. ILS DISENT QUE JE TRAFIQUE EN DROGUES -IGNORANTS! AU REVOIR ET BONNE CHANCE EN SAUVANT LE MONDE",
},
{
+ // 0
"",
"MA CHI BUSSA A QUESTE ORE?",
"EH...NO,NO. IO SONO IL NANNO GANIMEDI....IL PROFESSORE VON BRAUN NON ABITA QU\336 PI\353",
"NO, NON SO DOV'\324!",
"HO DETTO VIA!",
+ // 5
"IMBECILE. ORMAI TROPPO TARDE, SEMRE TARDE",
"SONO COMPLETAMENTE D'ACCORDO",
"IO, PAURA?",
"ASCOLTA BENE RAGAZZO: STAI PARLANDO CON L'UNICA PERSONA CHE CONOSCE IL SEGRETO PER VINCERE AI VAMPIRI",
"NON TUTTI QUANTI POSSONO LOTTARE CON UN VAMPIRO. SI DEVONO AVERE DELLE CARATTERISTICHE SPEZIALI",
+ // 10
"NO CE LE HAI",
"SICURO CHE NON SCOMMETI TUTTO IL TUO SOLDI!",
"VA BENE . AVANTI",
"SE DAVVERO SEI PRONTO PER LOTTARE CONTRO DRASCULA, DEVI POTERE SOPPORTARE TUTTI I RUMORI STRIDENTI E VAMPIRICI",
"TUTTO CHIARO?",
+ // 15
"D'ACCORDO. ASPETTA UN ATTIMO",
"PER FAVORE, METTETI NEL CENTRO DELLA CAMERA",
"DOV'\324 HO MESSO IL COMPACT DISC DI \"UNGHIE GRAFFIANDO UNA LAVAGNA\"",
"MOLTO BENE, ANDIAMO",
"VEDI? SEI UN INUTILE, COME TUTTI GLI ALTRI",
+ // 20
"ORA DAMI IL SOLDI CHE HAI PERSO, E VIA",
"E NON TORNARE FINO CHE NON SIA COMPLETAMENTE PRONTO",
"E COSA VUOI TU ADESSO?",
"DEVO AMMETTERLO... HAI LA STOFFA DI LOTTATORE PER VINCERE DRASCULA",
"EH..! PRENDI IL TUO SOLDI. SO QUANDO HO SBAGLIATO",
+ // 25
"ADESSO VATENE, VOGLIO DORMIRE UN P\343",
"QUANDO SIA DISPOSTO A UCCIDERE QUALCHE VAMPIRO, TORNA E TI AIUTER\343 ",
"QUELLO \324 FACILE. LA LUCE DEL SOLE O UN CROCIFISSO, E L'HAI SCHISCCIATO",
"CON CHI DEVI FARE MOLTA ATTENZIONE \324 CON DRASCULA. I SUOI POTERI FRISISHNOSTICI GLI FANNO IL PI\353 FORTE DEI VAMPIRI",
"NON POTREI FARE NULLA SE NON FOSSE PER LA .....",
+ // 30
"...POZIONE!",
"CERTO. HAI RAGIONE, SE CONTINUO DORMENDO COS\336 FORSE AVR\343 PROBLEMI DI SCHIENA QUANDO SIA VECCHIO",
"BENE, \324 VERO CHE FU MEGLIO LOTTATORE DI ME, MA IL MIO STUDIO SU TECNICHE ANTI-VAMPIRI GLI AIUT\343 MOLTISSIMO",
"HO SCOPERTO UNA POZIONE DI IMMUNUT\267 . TI FA INVULNERABILE AI MORSI DI VAMPIRI, O AI SUOI POTERI FRISISHNOTICI",
"NO, SCUSA, CE L'EBBI MOLTO TEMPO FA, MA UNA POZIONE COM'ERA LA MIA \324 PERICOLOSA. FIGURATI SE LA AVESSE UN VAMPIRO",
+ // 35
"GLI FAREBBE IMMUNE AGLI AGLII, ALLA LUCE DEL SOLE.... PER QUELLO L'HO SCARICATA NEL CESO",
"TRANQUILLO, MI RICORDO BENISSIMO DI COME RIFARLA",
"BISOGNO AGLII, CHE NE HO QU\326, DOVRAI PORTARMI UN P\220 DI CERA, NICOTINA, UNA GOMMA, E UNA CARTINA O UN TOVAGLIOLO, O QUALCOSA DEL GENERE",
"-AH! E COME NO, L'INGREDIENTE PRINCIPALE: DELLE FOGLIE DI UNA STRANA PIANTA CHIAMATA FERDINAN",
"\324 UNA PIANTA CONVOLVOLO, LE SUE FOGLIE PROPORZIONANO POTERI MAGICI SE SONO TAGLIATE DA UNA FALCE D'ORO",
+ // 40
"ALLORA, PORTAMI QUESTE CINQUE COSE E FAR\343 PER TE LA POZIONE",
"DOPO SAREI PRONTO PER UCCIDERE DRASCULA",
"RICORDA: CERA, NICOTINA, UNA GOMMA, UNA CARTINA E FOGLIE DI FERDINAN, LA PIANTA, TAGLIATE DA UNA FALCE D'ORO",
"TI L'HO GI\267 DETTO! FU TUTTO GRAZIE ALLA POZIONE",
"AH, MOLTO BENE. DUNQUE VADO A FARE LA CAN......LA POZIONE. SAR\267 UN ATTIMINO",
+ // 45
"\324 SOLTANTO UN SORTILEGIO DI PROTEZIONE CONTRO VAMPIRI",
"L'HO MESSO PER DISSIMULARE CHE IL DISEGNATORE HA DIMENTICATO METTERE LA FINESTRA CHE SI VEDE DA FUORI",
"BENE, PRIMA DEVI SAPERE COME ARRIVARE AL CASTELLO DRASCULA",
"C'\324 UNAGROTTA CHE VA AL CASTELLO E CHE UTILIZZA QUEL MATTO FAN DI ELVIS, IGOR, PER SCENDERE AL PAESE TUTTE LA MATTINE",
"MA FA ATTENZIONE, SEMPRE \220 PROTETTA DA UN VAMPIRO. DOVRAI LIBERARTI DI LUI",
+ // 50
"C'\220 UN VECCHIO POZZO ACCANTO ALLA CAPELLA DEL CIMITERO",
"SI UTILIZZAVA MOLTO TEMPO FA PER GIUDICARE CASI DI STREGONERIA",
"SI BUTTAVANO DENTRO ALLE STREGE. SE SI AFFONDAVANO ERANO STREGHE. SE NO, NO",
"UNA VOLTA BUTTAMMO UNA E GALLEGGI\220, DUNQUE NON SAREBBE UNA STREGA",
"ORA BEVE LA POZIONE. PECCATO CI SIA SOLTANTO PER UNO",
+ // 55
"SAR\265 MEGLIO FUMARLO PROPRIO PRIMA DELLA LOTTA CONTRO DRASCULA",
"CORRI1",
"SCUSE!",
"JOHN HACKER? SONO IL DOTTORE VON BRAUN",
"SENTA, \220 MOLTO IMPORTANTE, \220 SULLA POZIONE",
+ // 60
"HO TROVATO UN LIBRO SU POZIONI E DICE CHE NON SI DEVE BERE ALCOL DOPO AVERE FUMATO LA POZIONE",
"L'ALCOL BEVUTO FA REAZIONE CON LE SOSTANZE DELLA POZIONE E ANNULLA I SUOI EFFETTI IN DECIME DI SECONDO",
"DEVO RIATTACARE. LA POLIZIA MI CERCA. DICONO CHE TRAFFICO DROGHE -IGNORANTI! BENE, ALLORA ADIO E IN BOCA IL LUPO",
@@ -4266,7 +5742,7 @@ const char *_textvb[][63] = {
};
-const char *_textsys[][4] = {
+const char *_textsys[NUM_LANGS][NUM_TEXTSYS] = {
{
"PRESS 'DEL' AGAIN TO RESTART",
"PRESS 'ESC' AGAIN TO EXIT",
@@ -4300,13 +5776,13 @@ const char *_textsys[][4] = {
};
-const char *_texthis[][5] = {
+const char *_texthis[NUM_LANGS][NUM_TEXTHIS] = {
{
"",
- "A long time ago, it seems that Drascula killed Von Braun's wife, and then, as he intended to face the count, Von Braun started to investigate all he found vampires.",
- "When he thought he was ready, he came up to the castle and had a very violent encounter with Drascula.",
+ "A long time ago, it seems that Drascula killed Von Braun's wife, and then, as he intended to face the count, Von Braun started to research all he could find on vampires.",
+ "When he thought he was ready, he went up to the castle and had a very violent encounter with Drascula.",
"Nobody knows exactly what happened there. Although Von Braun lost, Drascula could not kill him.",
- "Von Braun felt humiliated by his defect, run away from the castle and has never dared to face Drascula ever again.",
+ "Von Braun felt humiliated by his defeat, he run away from the castle and has never dared to face Drascula again.",
},
{
"",
@@ -4339,4 +5815,161 @@ const char *_texthis[][5] = {
};
-} // End of namespace Drascula
+const char *_textd1[NUM_LANGS][NUM_TEXTD1] = {
+{
+ // 68
+ "44472225500022227555544444664447222550002222755554444466",
+ "444722255000222275555444446655033336666664464402256555005504450005446",
+ // 70
+ "4447222550002222755554444466550333226220044644550044755665500440006655556666655044744656550446470046",
+ "550330227556444744446660004446655544444722255000222275555444446644444",
+ "55033022755644455550444744400044504447222550002222755554444466000",
+ "55033022755644444447227444466644444722255000222275555444446664404446554440055655022227500544446044444446",
+ "55033022755644444472244472225500022227555544444662550002222755444446666055522275550005550022200222000222666",
+ // 75
+ "44447774444555500222205550444444466666225266444755444722255000222275555444446633223220044022203336227555770550444660557220553302224477777550550550222635533000662220002275572227025555",
+ "5555500004445550330244472225500022227555544444662755644446666005204402266222003332222774440446665555005550335544444",
+ "56665004444447222550002222755554444466555033022755555000444444444444444444444444444444",
+ "004447222550002222755554444466222000220555002220550444446666662220000557550033344477222522665444466663337446055504446550550550222633003330000666622044422755722270255566667555655007222777"
+},
+{
+ // 68
+ "4447222550002222755554444466",
+ "55033336666664464402256555005504450005446",
+ // 70
+ "550333226220044644550044755665500440006655556666655044744656550446470046",
+ "74444666000444665554444444",
+ "5555044474440004450000",
+ "4444722744446664464404446554440055655022227500544446044444446",
+ "4447222550002222755444446666055522275550005550022200222000222666",
+ // 75
+ "4444777444455550022220555044444446666622526644475533223220044022203336227555770550444660557220553302224477777550550550222635533000662220002275572227025555",
+ "5555000444555033022755644446666005204402266222003332222774440446665555005550335544444",
+ "5666500444555033022755555000444444444444444444444444444444",
+ "00222000220555002220550444446666662220000557550033344477222522665444466663337446055504446550550550222633003330000666622044422755722270255566667555655007222777"
+},
+{
+ // 68
+ "44472225500022227555544444664447222550002222755554444466",
+ "444722255000222275555444446655033336666664464402256555005504450005446",
+ // 70
+ "4447222550002222755554444466550333226220044644550044755665500440006655556666655044744656550446470046",
+ "550330227556444744446660004446655544444722255000222275555444446644444",
+ "55033022755644455550444744400044504447222550002222755554444466000",
+ "55033022755644444447227444466644444722255000222275555444446664404446554440055655022227500544446044444446",
+ "55033022755644444472244472225500022227555544444662550002222755444446666055522275550005550022200222000222666",
+ // 75
+ "44447774444555500222205550444444466666225266444755444722255000222275555444446633223220044022203336227555770550444660557220553302224477777550550550222635533000662220002275572227025555",
+ "5555500004445550330244472225500022227555544444662755644446666005204402266222003332222774440446665555005550335544444",
+ "56665004444447222550002222755554444466555033022755555000444444444444444444444444444444",
+ "004447222550002222755554444466222000220555002220550444446666662220000557550033344477222522665444466663337446055504446550550550222633003330000666622044422755722270255566667555655007222777"
+},
+{
+ // 68
+ "44472225500022227555544444664447222550002222755554444466",
+ "444722255000222275555444446655033336666664464402256555005504450005446",
+ // 70
+ "4447222550002222755554444466550333226220044644550044755665500440006655556666655044744656550446470046",
+ "550330227556444744446660004446655544444722255000222275555444446644444",
+ "55033022755644455550444744400044504447222550002222755554444466000",
+ "55033022755644444447227444466644444722255000222275555444446664404446554440055655022227500544446044444446",
+ "55033022755644444472244472225500022227555544444662550002222755444446666055522275550005550022200222000222666",
+ // 75
+ "44447774444555500222205550444444466666225266444755444722255000222275555444446633223220044022203336227555770550444660557220553302224477777550550550222635533000662220002275572227025555",
+ "5555500004445550330244472225500022227555544444662755644446666005204402266222003332222774440446665555005550335544444",
+ "56665004444447222550002222755554444466555033022755555000444444444444444444444444444444",
+ "004447222550002222755554444466222000220555002220550444446666662220000557550033344477222522665444466663337446055504446550550550222633003330000666622044422755722270255566667555655007222777"
+},
+{
+ // 68
+ "44472225500022227555544444664447222550002222755554444466",
+ "444722255000222275555444446655033336666664464402256555005504450005446",
+ // 70
+ "4447222550002222755554444466550333226220044644550044755665500440006655556666655044744656550446470046",
+ "550330227556444744446660004446655544444722255000222275555444446644444",
+ "55033022755644455550444744400044504447222550002222755554444466000",
+ "55033022755644444447227444466644444722255000222275555444446664404446554440055655022227500544446044444446",
+ "55033022755644444472244472225500022227555544444662550002222755444446666055522275550005550022200222000222666",
+ // 75
+ "44447774444555500222205550444444466666225266444755444722255000222275555444446633223220044022203336227555770550444660557220553302224477777550550550222635533000662220002275572227025555",
+ "5555500004445550330244472225500022227555544444662755644446666005204402266222003332222774440446665555005550335544444",
+ "56665004444447222550002222755554444466555033022755555000444444444444444444444444444444",
+ "004447222550002222755554444466222000220555002220550444446666662220000557550033344477222522665444466663337446055504446550550550222633003330000666622044422755722270255566667555655007222777"
+},
+
+};
+
+
+const char *_textverbs[NUM_LANGS][NUM_TEXTVERBS] = {
+{
+ "look",
+ "take",
+ "open",
+ "close",
+ "talk",
+ "push",
+},
+{
+ "mirar",
+ "coger",
+ "abrir",
+ "cerrar",
+ "hablar",
+ "mover",
+},
+{
+ "Schau",
+ "Nimm",
+ "oeFFNE",
+ "Schliesse",
+ "Rede",
+ "Druecke",
+},
+{
+ "regardez",
+ "ramassez",
+ "ouvrez",
+ "fermez",
+ "parlez",
+ "poussez",
+},
+{
+ "esamina",
+ "prendi",
+ "apri",
+ "chiudi",
+ "parla",
+ "premi",
+},
+};
+
+
+const char *_textmisc[NUM_LANGS][NUM_TEXTMISC] = {
+{
+ "HUNCHBACKED",
+ "Transilvania, 1993 d.c.",
+ "GOOOOOOOAAAAAAAL!",
+},
+{
+ "jorobado",
+ "Transilvania, 1993 d.c. (despues de cenar)",
+ "GOOOOOOOOOOOOOOOL",
+},
+{
+ "HUNCHBACKED",
+ "Transilvania, 1993 d.c.",
+ "GOOOOOOOAAAAAAAL!",
+},
+{
+ "HUNCHBACKED",
+ "Transilvania, 1993 d.c.",
+ "GOOOOOOOAAAAAAAL!",
+},
+{
+ "HUNCHBACKED",
+ "Transilvania, 1993 d.c.",
+ "GOOOOOOOAAAAAAAL!",
+},
+};
+
+#endif /* STATICDATA_H */
diff --git a/tools/create_kyradat/create_kyradat.cpp b/tools/create_kyradat/create_kyradat.cpp
index 1e6b779c7d..173ba0f993 100644
--- a/tools/create_kyradat/create_kyradat.cpp
+++ b/tools/create_kyradat/create_kyradat.cpp
@@ -31,7 +31,7 @@
#include "md5.h"
enum {
- kKyraDatVersion = 24,
+ kKyraDatVersion = 28,
kIndexSize = 12
};
@@ -42,6 +42,7 @@ enum {
#include "esp.h"
#include "fre.h"
#include "ger.h"
+#include "ita.h"
#include "towns.h"
#include "amiga.h"
@@ -50,6 +51,8 @@ enum {
#include "hof_cd.h"
#include "hof_demo.h"
+#include "malcolm.h"
+
const Game kyra1FanTranslations[] = {
{ kKyra1, IT_ITA, kTalkieVersion, "d0f1752098236083d81b9497bd2b6989", kyra1FreCD },
GAME_DUMMY_ENTRY
@@ -63,6 +66,11 @@ bool extractHofSeqData(PAKFile &out, const Game *g, const byte *data, const uint
bool extractHofShapeAnimDataV1(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch = 0);
bool extractHofShapeAnimDataV2(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch = 0);
+bool extractStringsWoSuffix(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch = 0);
+bool extractPaddedStrings(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch = 0);
+bool extractRaw16to8(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch = 0);
+bool extractMrShapeAnimData(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch = 0);
+
int extractHofSeqData_checkString(const void *ptr, uint8 checkSize);
int extractHofSeqData_isSequence(const void *ptr, const Game *g, uint32 maxCheckSize);
int extractHofSeqData_isControl(const void *ptr, uint32 size);
@@ -80,6 +88,11 @@ const ExtractType extractTypeTable[] = {
{ k2TypeSeqData, extractHofSeqData, createFilename },
{ k2TypeShpDataV1, extractHofShapeAnimDataV1, createFilename },
{ k2TypeShpDataV2, extractHofShapeAnimDataV2, createFilename },
+ { k2TypeSoundList, extractStringsWoSuffix, createFilename },
+ { k2TypeLangSoundList, extractStringsWoSuffix, createLangFilename },
+ { k2TypeSfxList, extractPaddedStrings, createFilename },
+ { k3TypeRaw16to8, extractRaw16to8, createFilename },
+ { k3TypeShpData, extractMrShapeAnimData, createFilename },
{ -1, 0, 0}
};
@@ -206,8 +219,8 @@ const ExtractFilename extractFilenames[] = {
{ k2SeqplayCredits, kTypeRawData, "S_CREDITS.TXT" },
{ k2SeqplayCreditsSpecial, kTypeStringList, "S_CREDITS2.TXT" },
{ k2SeqplayStrings, kTypeLanguageList, "S_STRINGS" },
- { k2SeqplaySfxFiles, kTypeStringList, "S_SFXFILES.TXT" },
- { k2SeqplayTlkFiles, kTypeLanguageList, "S_TLKFILES" },
+ { k2SeqplaySfxFiles, k2TypeSoundList, "S_SFXFILES.TXT" },
+ { k2SeqplayTlkFiles, k2TypeLangSoundList, "S_TLKFILES" },
{ k2SeqplaySeqData, k2TypeSeqData, "S_DATA.SEQ" },
{ k2SeqplayIntroTracks, kTypeStringList, "S_INTRO.TRA" },
{ k2SeqplayFinaleTracks, kTypeStringList, "S_FINALE.TRA" },
@@ -218,14 +231,26 @@ const ExtractFilename extractFilenames[] = {
// Ingame
{ k2IngamePakFiles, kTypeStringList, "I_PAKFILES.TXT" },
{ k2IngameSfxFiles, kTypeStringList, "I_SFXFILES.TRA" },
+ { k2IngameSfxFilesTns, k2TypeSoundList, "I_SFXFILES.TRA" },
{ k2IngameSfxIndex, kTypeRawData, "I_SFXINDEX.MAP" },
{ k2IngameTracks, kTypeStringList, "I_TRACKS.TRA" },
{ k2IngameCDA, kTypeRawData, "I_TRACKS.CDA" },
{ k2IngameTalkObjIndex, kTypeRawData, "I_TALKOBJECTS.MAP" },
{ k2IngameTimJpStrings, kTypeStringList, "I_TIMJPSTR.TXT" },
{ k2IngameItemAnimData, k2TypeShpDataV2, "I_INVANIM.SHP" },
- { k2IngameTlkDemoStrings, kTypeLanguageList, "I_TLKDEMO.TXT" },
-
+ { k2IngameTlkDemoStrings, kTypeLanguageList, "I_TLKDEMO.TXT" },
+
+
+ // MALCOLM'S REVENGE
+ { k3MainMenuStrings, kTypeStringList, "MAINMENU.TXT" },
+ { k3MusicFiles, k2TypeSoundList, "SCORE.TRA" },
+ { k3ScoreTable, kTypeRawData, "SCORE.MAP" },
+ { k3SfxFiles, k2TypeSfxList, "SFXFILES.TRA" },
+ { k3SfxMap, k3TypeRaw16to8, "SFXINDEX.MAP" },
+ { k3ItemAnimData, k3TypeShpData, "INVANIM.SHP" },
+ { k3ItemMagicTable, k3TypeRaw16to8, "ITEMMAGIC.MAP" },
+ { k3ItemStringMap, kTypeRawData, "ITEMSTRINGS.MAP" },
+
{ -1, 0, 0 }
};
@@ -401,12 +426,9 @@ bool extractStrings(PAKFile &out, const Game *g, const byte *data, const uint32
continue;
uint32 len = strlen((const char*) data + i);
i += len;
-#if 1
- // FIXME: Not sure whether this correct; the original code was ambiguious, see below
+
targetsize = targetsize - 1 - len;
-#else
- targetsize = --targetsize - len; // FIXME: This operation is undefined
-#endif
+
while (!data[++i]) {
if (i == len)
break;
@@ -586,7 +608,7 @@ bool extractHofSeqData(PAKFile &out, const Game *g, const byte *data, const uint
while (ptr < endOffs) {
if (ptr[1]) {
error("invalid sequence data encountered");
- delete [] buffer;
+ delete[] buffer;
return false;
}
@@ -637,6 +659,7 @@ bool extractHofSeqData(PAKFile &out, const Game *g, const byte *data, const uint
} else if (cycle == 1 && v != 1 && v != -2) {
uint16 controlOffs = 0;
+ uint16 ctrSize = 0;
if (v) {
const byte *ctrStart = ptr;
while (v && v != -2) {
@@ -647,7 +670,7 @@ bool extractHofSeqData(PAKFile &out, const Game *g, const byte *data, const uint
if (v == -2)
break;
- uint16 ctrSize = (uint16)(ptr - ctrStart);
+ ctrSize = (uint16)(ptr - ctrStart);
if (g->special != k2DemoVersion &&
extractHofSeqData_isControl(ctrStart, ctrSize)) {
@@ -673,11 +696,20 @@ bool extractHofSeqData(PAKFile &out, const Game *g, const byte *data, const uint
ptr += 14;
output += 14;
- for (int w = 0; w < 3; w++) { //startframe, endFrame, frameDelay
- WRITE_BE_UINT16(output, READ_LE_UINT16(ptr));
- ptr += 2;
- output += 2;
- }
+ // startframe
+ WRITE_BE_UINT16(output, READ_LE_UINT16(ptr));
+ ptr += 2;
+ output += 2;
+
+ // endFrame
+ WRITE_BE_UINT16(output, (ctrSize && ((ctrSize >> 2) < READ_LE_UINT16(ptr))) ? (ctrSize >> 2) : READ_LE_UINT16(ptr));
+ ptr += 2;
+ output += 2;
+
+ // frameDelay
+ WRITE_BE_UINT16(output, READ_LE_UINT16(ptr));
+ ptr += 2;
+ output += 2;
ptr += 4;
@@ -743,7 +775,7 @@ bool extractHofSeqData(PAKFile &out, const Game *g, const byte *data, const uint
WRITE_BE_UINT16(finHeader, numSequences);
WRITE_BE_UINT16(&finHeader[numSequences + 1], numNestedSequences);
memcpy (finBuffer + finHeaderSize, buffer + headerSize, finBufferSize - finHeaderSize);
- delete [] buffer;
+ delete[] buffer;
finHeader = (uint16*) (finBuffer + ((numSequences + 2) * sizeof(uint16)));
for (int i = 0; i < numNestedSequences; i++) {
@@ -839,8 +871,8 @@ int extractHofSeqData_isControl(const void *ptr, uint32 size) {
}
bool extractHofShapeAnimDataV1(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch) {
- int outsize = size + 1;
- uint8 *buffer = new uint8[outsize];
+ int outsize = 1;
+ uint8 *buffer = new uint8[size + 1];
const uint8 *src = data;
uint8 *dst = buffer + 1;
@@ -851,12 +883,13 @@ bool extractHofShapeAnimDataV1(PAKFile &out, const Game *g, const byte *data, co
WRITE_BE_UINT16(dst, READ_LE_UINT16(src));
src += 4;
dst += 2;
- outsize -= 2;
+ outsize += 4;
for (int j = 0; j < 20; j++) {
WRITE_BE_UINT16(dst, READ_LE_UINT16(src));
src += 2;
dst += 2;
+ outsize += 2;
}
};
@@ -867,11 +900,11 @@ bool extractHofShapeAnimDataV1(PAKFile &out, const Game *g, const byte *data, co
}
bool extractHofShapeAnimDataV2(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch) {
- int outsize = size + 1;
- uint8 *buffer = new uint8[outsize];
+ int outsize = 1;
+ uint8 *buffer = new uint8[size + 1];
const uint8 *src = data;
uint8 *dst = buffer + 1;
- uint8 *fin = buffer + outsize;
+ const uint8 *fin = data + size;
int count = 0;
do {
@@ -887,17 +920,122 @@ bool extractHofShapeAnimDataV2(PAKFile &out, const Game *g, const byte *data, co
uint8 numFrames = *src;
*dst++ = numFrames;
src += 6;
- outsize -= 5;
+ outsize += 3;
for (int i = 0; i < (numFrames << 1); i++) {
WRITE_BE_UINT16(dst, READ_LE_UINT16(src));
src += 2;
dst += 2;
+ outsize += 2;
}
src += (48 - (numFrames << 2));
- } while (dst < fin);
+ } while (src < fin);
+
+ *buffer = count; // number of items
+
+ return out.addFile(filename, buffer, outsize);
+}
+
+bool extractStringsWoSuffix(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch) {
+ int outsize = size + 4;
+ uint8 *buffer = new uint8[outsize];
+ const uint8 *src = data;
+ uint8 *dst = buffer + 4;
+ const uint8 *fin = src + size;
+ int entries = 0;
+
+ while (src < fin) {
+ while (!*src && src < fin)
+ src++;
+ while (*src && *src != '.' && src < fin)
+ *dst++ = *src++;
+
+ *dst++ = '\0';
+ entries++;
+
+ if (*src == '.') {
+ while (*src && src < fin)
+ src++;
+ }
+ }
+
+ WRITE_BE_UINT32(buffer, entries);
+ outsize = dst - buffer;
+
+ return out.addFile(filename, buffer, outsize);
+}
+
+bool extractPaddedStrings(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch) {
+ int outsize = size + 4;
+ uint8 *buffer = new uint8[outsize];
+ const uint8 *src = data;
+ uint8 *dst = buffer + 4;
+ const uint8 *fin = src + size;
+ int entries = 0;
+
+ while (src < fin) {
+ while (!*src && src < fin)
+ src++;
+ while (*src && src < fin)
+ *dst++ = *src++;
+
+ *dst++ = '\0';
+ entries++;
+ }
+
+ WRITE_BE_UINT32(buffer, entries);
+ outsize = dst - buffer;
+
+ return out.addFile(filename, buffer, outsize);
+}
+
+bool extractRaw16to8(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch) {
+ int outsize = size >> 1;
+ uint8 *buffer = new uint8[outsize];
+ const uint8 *src = data;
+ uint8 *dst = buffer;
+
+ for (int i = 0; i < outsize; i++) {
+ *dst++ = *src++;
+ *src++;
+ }
+
+ return out.addFile(filename, buffer, outsize);
+}
+
+bool extractMrShapeAnimData(PAKFile &out, const Game *g, const byte *data, const uint32 size, const char *filename, int fmtPatch) {
+ int outsize = 1;
+ uint8 *buffer = new uint8[size + 1];
+ const uint8 *src2 = data;
+ const uint8 *src1 = data + 324;
+ uint8 *dst = buffer + 1;
+ const uint8 *fin = data + size;
+ int count = 0;
+
+ do {
+ if (READ_LE_UINT16(src1) == 0xffff)
+ break;
+
+ count++;
+
+ WRITE_BE_UINT16(dst, READ_LE_UINT16(src1));
+ src1 += 2;
+ dst += 2;
+
+ uint8 numFrames = *src1;
+ *dst++ = numFrames;
+ src1 += 10;
+ outsize += 3;
+
+ for (int i = 0; i < (numFrames << 1); i++) {
+ WRITE_BE_UINT16(dst, READ_LE_UINT16(src2));
+ src2 += 2;
+ dst += 2;
+ outsize += 2;
+ }
+ } while (src1 < fin);
*buffer = count; // number of items
@@ -925,7 +1063,7 @@ enum {
uint32 getFeatures(const Game *g) {
uint32 features = 0;
- if (g->special == kTalkieVersion || g->special == k2CDFile1E || g->special == k2CDFile1F || g->special == k2CDFile1G || g->special == k2CDFile2E || g->special == k2CDFile2F || g->special == k2CDFile2G)
+ if (g->special == kTalkieVersion || g->special == k2CDFile1E || g->special == k2CDFile1F || g->special == k2CDFile1G || g->special == k2CDFile2E || g->special == k2CDFile2F || g->special == k2CDFile2G || g->game == kKyra3)
features |= GF_TALKIE;
else if (g->special == kDemoVersion || g->special == k2DemoVersion)
features |= GF_DEMO;
@@ -988,14 +1126,14 @@ bool updateIndex(PAKFile &out, const Game *g) {
memcpy(index, data, size);
if (!updateIndex(index, kIndexSize, g)) {
- delete [] index;
+ delete[] index;
return false;
}
out.removeFile(filename);
if (!out.addFile(filename, index, kIndexSize)) {
fprintf(stderr, "ERROR: couldn't update %s file", filename);
- delete [] index;
+ delete[] index;
return false;
}
@@ -1049,7 +1187,7 @@ int main(int argc, char *argv[]) {
if (fread(buffer, 1, size, input) != size) {
warning("couldn't read from file '%s', skipping it", argv[i]);
- delete [] buffer;
+ delete[] buffer;
fclose(input);
continue;
}
@@ -1058,13 +1196,13 @@ int main(int argc, char *argv[]) {
const Game *g = findGame(buffer, size);
if (!g) {
warning("skipping unknown file '%s'", argv[i]);
- delete [] buffer;
+ delete[] buffer;
continue;
}
if (!hasNeededEntries(g, &out)) {
warning("file '%s' is missing offset entries and thus can't be processed", argv[i]);
- delete [] buffer;
+ delete[] buffer;
continue;
}
@@ -1078,7 +1216,7 @@ int main(int argc, char *argv[]) {
// We switch to the second language and continue extraction.
if (!hasNeededEntries(++g, &out)) {
warning("file '%s' is missing offset entries and thus can't be processed", argv[i]);
- delete [] buffer;
+ delete[] buffer;
continue;
}
if (!process(out, g, buffer, size))
@@ -1090,14 +1228,14 @@ int main(int argc, char *argv[]) {
// We switch to the third language and continue extraction.
if (!hasNeededEntries(++g, &out)) {
warning("file '%s' is missing offset entries and thus can't be processed", argv[i]);
- delete [] buffer;
+ delete[] buffer;
continue;
}
if (!process(out, g, buffer, size))
fprintf(stderr, "ERROR: couldn't process file '%s'", argv[i]);
}
- delete [] buffer;
+ delete[] buffer;
}
if (!out.saveFile(argv[1]))
@@ -1194,6 +1332,7 @@ const Game *gameDescs[] = {
kyra1EspGames,
kyra1FreGames,
kyra1GerGames,
+ kyra1ItaGames,
kyra1TownsGames,
kyra1AmigaGames,
kyra1FanTranslations,
@@ -1203,6 +1342,8 @@ const Game *gameDescs[] = {
kyra2TownsGames,
kyra2Demos,
+ kyra3Games,
+
0
};
@@ -1229,6 +1370,3 @@ const Game *findGame(const byte *buffer, const uint32 size) {
printf("file is not supported (unknown md5 \"%s\")\n", md5str);
return 0;
}
-
-
-
diff --git a/tools/create_kyradat/create_kyradat.h b/tools/create_kyradat/create_kyradat.h
index 5127f16b5d..c8bcb7d583 100644
--- a/tools/create_kyradat/create_kyradat.h
+++ b/tools/create_kyradat/create_kyradat.h
@@ -156,6 +156,7 @@ enum kExtractID {
k2IngamePakFiles,
k2IngameSfxFiles,
+ k2IngameSfxFilesTns,
k2IngameSfxIndex,
k2IngameTracks,
k2IngameCDA,
@@ -164,6 +165,15 @@ enum kExtractID {
k2IngameItemAnimData,
k2IngameTlkDemoStrings,
+ k3MainMenuStrings,
+ k3MusicFiles,
+ k3ScoreTable,
+ k3SfxFiles,
+ k3SfxMap,
+ k3ItemAnimData,
+ k3ItemMagicTable,
+ k3ItemStringMap,
+
kMaxResIDs
};
@@ -246,7 +256,13 @@ enum kExtractType {
k2TypeSeqData,
k2TypeShpDataV1,
- k2TypeShpDataV2
+ k2TypeShpDataV2,
+ k2TypeSoundList,
+ k2TypeLangSoundList,
+ k2TypeSfxList,
+
+ k3TypeRaw16to8,
+ k3TypeShpData
};
struct ExtractType {
diff --git a/tools/create_kyradat/hof_towns.h b/tools/create_kyradat/hof_towns.h
index bff2b35673..f2dd82d431 100644
--- a/tools/create_kyradat/hof_towns.h
+++ b/tools/create_kyradat/hof_towns.h
@@ -15,7 +15,7 @@ const ExtractEntry kyra2File1FMTownsJ[] = {
const ExtractEntry kyra2File2FMTownsE[] = {
{ k2IngamePakFiles, 0x00000540, 0x0000065C },
- { k2IngameSfxFiles, 0x00003E3C, 0x000047A3 },
+ { k2IngameSfxFilesTns, 0x00003E3C, 0x000047A3 },
{ k2IngameSfxIndex, 0x00013980, 0x00013CD8 },
{ k2IngameCDA, 0x0001808C, 0x000181BC },
{ k2IngameTalkObjIndex, 0x000199B6, 0x00019A30 },
diff --git a/tools/create_kyradat/ita.h b/tools/create_kyradat/ita.h
new file mode 100644
index 0000000000..6099f8f07d
--- /dev/null
+++ b/tools/create_kyradat/ita.h
@@ -0,0 +1,39 @@
+const ExtractEntry kyra1ItaFloppy[] = {
+ { kKallakWritingSeq, 0x000304fa, 0x00030cef },
+ { kMalcolmTreeSeq, 0x00030cef, 0x00030F05 },
+ { kWestwoodLogoSeq, 0x00030F05, 0x00030F50 },
+ { kKyrandiaLogoSeq, 0x00030F50, 0x00030FAC },
+ { kKallakMalcolmSeq, 0x00030FAC, 0x00031217 },
+ { kForestSeq, 0x00031217, 0x000313ac },
+ { kIntroCPSStrings, 0x000313AC, 0x000313C0 },
+ { kIntroWSAStrings, 0x000313C0, 0x00031440 },
+ { kIntroCOLStrings, 0x00031440, 0x0003146B },
+ { kIntroStrings, 0x0003146B, 0x000319E7 },
+ { kItemNames, 0x000346DC, 0x00034C6D },
+ { kTakenStrings, 0x00033F60, 0x00033F74 },
+ { kPlacedStrings, 0x00033F74, 0x00033F81 },
+ { kDroppedStrings, 0x00033FAA, 0x00033FB5 },
+ { kNoDropStrings, 0x00033F1A, 0x00033F5F },
+ { kPutDownString, 0x0002f120, 0x0002f154 },
+ { kWaitAmuletString, 0x0002f154, 0x0002f19e },
+ { kBlackJewelString, 0x0002f19e, 0x0002f1c0 },
+ { kHealingTipString, 0x0002f1c0, 0x0002f1ff },
+ { kPoisonGoneString, 0x0002f290, 0x0002f2c4 },
+ { kThePoisonStrings, 0x0002ff20, 0x0002ff83 },
+ { kFluteStrings, 0x000323ab, 0x000323f7 },
+ { kWispJewelStrings, 0x0002f1ff, 0x0002f273 },
+ { kMagicJewelStrings, 0x0002f273, 0x0002f290 },
+ { kFlaskFullString, 0x00030059, 0x0003007a },
+ { kFullFlaskString, 0x0002ffa4, 0x00030059 },
+ { kOutroHomeString, 0x000320f2, 0x000320f7 },
+ { kVeryCleverString, 0x0003204c, 0x00032084 },
+ { kGUIStrings, 0x0002f434, 0x0002f659 },
+ { kNewGameString, 0x00032ba6, 0x00032bc2 },
+ { kConfigStrings, 0x0002fe9f, 0x0002fef3 },
+ { -1, 0, 0 }
+};
+
+const Game kyra1ItaGames[] = {
+ { kKyra1, IT_ITA, -1, "5d7550306b369a3492f9f3402702477c", kyra1ItaFloppy },
+ GAME_DUMMY_ENTRY
+};
diff --git a/tools/create_kyradat/malcolm.h b/tools/create_kyradat/malcolm.h
new file mode 100644
index 0000000000..253d6e7b1c
--- /dev/null
+++ b/tools/create_kyradat/malcolm.h
@@ -0,0 +1,17 @@
+const ExtractEntry kyra3cd[] = {
+ { k3MainMenuStrings, 0x0002D932, 0x0002D9E2 },
+ { k3MusicFiles, 0x0003062C, 0x00030801 },
+ { k3ScoreTable, 0x0002E4D0, 0x0002E598 },
+ { k3SfxFiles, 0x0002E84E, 0x0002F10D },
+ { k3SfxMap, 0x0002A590, 0x0002AA50 },
+ { k3ItemAnimData, 0x00031614, 0x000317DC },
+ { k3ItemMagicTable, 0x0002FB2A, 0x0002FB72 },
+ { k3ItemStringMap, 0x0002D07A, 0x0002D0C2 },
+ { -1, 0, 0 }
+};
+
+const Game kyra3Games[] = {
+ { kKyra3, EN_ANY, -1, "bf68701eb591d0b72219f314c0d32688", kyra3cd },
+ GAME_DUMMY_ENTRY
+};
+
diff --git a/tools/create_kyradat/misc.h b/tools/create_kyradat/misc.h
index bd2421ebab..1e1cd29cc9 100644
--- a/tools/create_kyradat/misc.h
+++ b/tools/create_kyradat/misc.h
@@ -433,7 +433,7 @@ const int kyra2TownsFile1JapNeed[] = {
const int kyra2TownsFile2EngNeed[] = {
k2IngamePakFiles,
- k2IngameSfxFiles,
+ k2IngameSfxFilesTns,
k2IngameSfxIndex,
k2IngameCDA,
k2IngameTalkObjIndex,
@@ -460,6 +460,18 @@ const int kyra2TlkDemoNeed[] = {
-1
};
+const int kyra3Need[] = {
+ k3MainMenuStrings,
+ k3MusicFiles,
+ k3ScoreTable,
+ k3SfxFiles,
+ k3SfxMap,
+ k3ItemAnimData,
+ k3ItemMagicTable,
+ k3ItemStringMap,
+ -1
+};
+
const GameNeed gameNeedTable[] = {
{ kKyra1, -1, kyra1FloppyNeed },
{ kKyra1, kTalkieVersion, kyra1CDNeed },
@@ -485,6 +497,8 @@ const GameNeed gameNeedTable[] = {
{ kKyra2, k2DemoVersionTlkF, kyra2TlkDemoNeed},
{ kKyra2, k2DemoVersionTlkG, kyra2TlkDemoNeed},
+ { kKyra3, -1, kyra3Need },
+
{ -1, -1, 0 }
};
diff --git a/tools/create_kyradat/pak.cpp b/tools/create_kyradat/pak.cpp
index f3446df291..0187168c0f 100644
--- a/tools/create_kyradat/pak.cpp
+++ b/tools/create_kyradat/pak.cpp
@@ -78,7 +78,7 @@ bool PAKFile::loadFile(const char *file, const bool isAmiga) {
startoffset = endoffset;
}
- delete [] buffer;
+ delete[] buffer;
return true;
}
diff --git a/tools/create_kyradat/pak.h b/tools/create_kyradat/pak.h
index 1634411f4c..a90b930fcc 100644
--- a/tools/create_kyradat/pak.h
+++ b/tools/create_kyradat/pak.h
@@ -53,8 +53,8 @@ public:
struct FileList {
FileList() : filename(0), size(0), data(0), next(0) {}
~FileList() {
- delete [] filename;
- delete [] data;
+ delete[] filename;
+ delete[] data;
delete next;
}
diff --git a/tools/credits.pl b/tools/credits.pl
index f176a6d957..fa806db7de 100755
--- a/tools/credits.pl
+++ b/tools/credits.pl
@@ -626,6 +626,10 @@ begin_credits("Credits");
add_person("Lars Persson", "AnotherGuest", "");
end_section();
+ begin_section("Wii");
+ add_person("Andre Heider", "dhewg", "");
+ end_section();
+
end_section();
begin_section("Other subsystems");
diff --git a/tools/scumm-md5.txt b/tools/scumm-md5.txt
index cc88b335a4..721c43b568 100644
--- a/tools/scumm-md5.txt
+++ b/tools/scumm-md5.txt
@@ -410,7 +410,10 @@ thinkerk Big Thinkers Kindergarten
695fe0b3963333b7e15b37514db3c745 29789 us All - Demo - khalek, sev
-BluesABCTime Blue's ABC Time
+Blues123time Blue's 123 Time Activities
+ 71d384e7676c53d513ddd333eae1d82c -1 en All - - - Vasyl Tsvirkunov
+
+BluesABCTime Blue's ABC Time Activities
95b3806e043be08668c54c3ffe98650f -1 en All - - - sev
7ddeaf52c8b9a50551ce0aa2ac811d07 -1 en All - Demo - khalek, sev
@@ -419,6 +422,7 @@ BluesABCTime Blue's ABC Time
arttime Blue's Art Time Activities
6269b8fbf51a353e5b501e4ad98cdc67 -1 en Windows - - - killiandor
+ d00ffc8c32d17e575fd985d435d2eb88 -1 en All - Demo - Kirben
BluesBirthday Blue's Birthday Adventure
99128b6a5bdd9831d9682fb8b5cbf8d4 -1 en All - - - knifethrower
@@ -428,6 +432,9 @@ BluesBirthday Blue's Birthday Adventure
dbf4d59d70b826733f379f998354d350 -1 en All - Demo - Kirben
fa30c4a7a806629626269b6dcab59a15 7819264 All All HE CUP Preview - sev
+readtime Blue's Reading Time Activities
+ 95818b178d473c989ac753574e8892aa -1 en All - Demo - Kirben
+
fbear Fatty Bear's Birthday Surprise
5b08000a9c47b2887df6506ac767ca68 -1 en 3DO HE 61 - - sev
3824e60cdf639d22f6df92a03dc4b131 7732 en DOS HE 61 - - khalek
@@ -457,6 +464,7 @@ freddi Freddi Fish 1: The Case of the Missing Kelp Seeds
df047cc4792150f601290357566d36a6 -1 us All HE 90 Updated - khalek
e44ea295a3f8fe4f41983080dab1e9ce -1 fr Mac HE 90 Updated - ThierryFR
746e88c172a5b7a1ae89ac0ee3ee681a -1 ru Windows HE 90 Updated - sev
+ a197a87ae77f3b3333f09a7a2c448fe2 -1 en Windows HE 99 Updated - Jonathan
084ed0fa98a6d1e9368d67fe9cfbd417 -1 en Windows HE 71 Demo - khalek
c8aac5e3e701874e2fa4117896f9e1b1 -1 en Mac HE 73 Demo - khalek, sev
@@ -576,6 +584,7 @@ pajama Pajama Sam 1: No Need to Hide When It's Dark Outside
a095e33061606d231ff37dca4c64c8ac -1 de All HE 99 - - Joachim Eberhard
898eaa21f79cf8d4f08db856244689ff 66505 en Windows HE 99 Updated - Joachim Eberhard
37aed3f91c1ef959e0bd265f9b13781f -1 us All HE 100 Updated - Kirben
+ 782393c5934ecd0b536eaf5fd541bd26 -1 en Windows HE 100 Updated - Jonathan
4aa93cb30e485b728504ba3a693f12bf -1 ru Windows HE 100 - - sev
f237bf8a5ef9af78b2a6a4f3901da341 18354 en All - Demo - khalek, sev
@@ -678,6 +687,7 @@ puttcircus Putt-Putt Joins the Circus
puttputt Putt-Putt Joins the Parade
0b3222aaa7efcf283eb621e0cefd26cc -1 ru DOS HE 60 - - sev
7e151c17adf624f1966c8fc5827c95e9 -1 en 3DO HE 61 - - khalek
+ be2abe172f58db170de3a037daa1dd27 -1 jp 3DO HE 61 - - clone2727
9708cf716ed8bcc9ff3fcfc69413b746 -1 en DOS HE 61 - - khalek
e361a7058ed8e8ebb462663c0a3ae8d6 -1 hb DOS HE 61 - - sev
684732efb5799c0f78804c99d8de9aba -1 en Mac HE 61 - - khalek
@@ -694,6 +704,7 @@ puttzoo Putt-Putt Saves the Zoo
c3b22fa4654bb580b20325ebf4174841 -1 nl Windows - - - joostp
9781422e4288dbc090720e4563168ba7 -1 fr Windows - - - gist974
92e7727e67f5cd979d8a1070e4eb8cb3 -1 en All HE 98.5 Updated - cyx
+ 3a3e592b074f595489f7f11e150c398d -1 us Windows HE 99 Updated - Adrian
3486ede0f904789267d4bcc5537a46d4 -1 en Mac - Demo - khalek
d220d154aafbfa12bd6f3ab1b2dae420 -1 de Mac - Demo - Joachim Eberhard
@@ -757,6 +768,7 @@ spyfox SPY Fox 1: Dry Cereal
76b66b43e593ad4d2f1dfb5cc8f19700 -1 nl Windows HE 99 - - sugarcube
72ac6bc980d5101c2142189d746bd62f -1 ru Windows HE 99 - - sev
3de99ef0523f8ca7958faa3afccd035a -1 us All HE 100 Updated - Kirben
+ 23394c8d29cc63c61313959431a12476 -1 en Windows HE 100 Updated - Jonathan
53e94115b55dd51d4b8ff0871aa1df1e 20103 en All - Demo - khalek, sev
fbdd947d21e8f5bac6d6f7a316af1c5a 15693 en All - Demo - sev