aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--AUTHORS17
-rw-r--r--NEWS13
-rw-r--r--audio/decoders/aac.cpp2
-rw-r--r--audio/decoders/adpcm.cpp4
-rw-r--r--audio/decoders/quicktime.cpp4
-rw-r--r--audio/decoders/quicktime.h2
-rw-r--r--audio/mididrv.cpp6
-rw-r--r--audio/softsynth/fmtowns_pc98/towns_audio.cpp26
-rw-r--r--audio/softsynth/fmtowns_pc98/towns_midi.cpp44
-rw-r--r--audio/softsynth/fmtowns_pc98/towns_midi.h6
-rw-r--r--audio/softsynth/fmtowns_pc98/towns_pc98_driver.cpp2
-rw-r--r--audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp4
-rw-r--r--audio/softsynth/mt32.cpp4
-rw-r--r--backends/audiocd/audiocd.h2
-rw-r--r--backends/events/sdl/sdl-events.h10
-rw-r--r--backends/events/webossdl/webossdl-events.cpp2
-rw-r--r--backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp14
-rw-r--r--backends/graphics/dinguxsdl/dinguxsdl-graphics.h10
-rw-r--r--backends/graphics/gph/gph-graphics.cpp16
-rw-r--r--backends/graphics/gph/gph-graphics.h8
-rw-r--r--backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp10
-rw-r--r--backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h4
-rw-r--r--backends/graphics/opengl/gltexture.cpp2
-rw-r--r--backends/graphics/opengl/opengl-graphics.cpp24
-rw-r--r--backends/graphics/opengl/opengl-graphics.h4
-rw-r--r--backends/graphics/openglsdl/openglsdl-graphics.cpp66
-rw-r--r--backends/graphics/openpandora/op-graphics.cpp4
-rw-r--r--backends/graphics/openpandora/op-graphics.h8
-rw-r--r--backends/graphics/samsungtvsdl/samsungtvsdl-graphics.cpp6
-rw-r--r--backends/graphics/samsungtvsdl/samsungtvsdl-graphics.h4
-rw-r--r--backends/graphics/surfacesdl/surfacesdl-graphics.cpp (renamed from backends/graphics/sdl/sdl-graphics.cpp)148
-rw-r--r--backends/graphics/surfacesdl/surfacesdl-graphics.h (renamed from backends/graphics/sdl/sdl-graphics.h)16
-rw-r--r--backends/graphics/symbiansdl/symbiansdl-graphics.cpp6
-rw-r--r--backends/graphics/symbiansdl/symbiansdl-graphics.h4
-rw-r--r--backends/graphics/wincesdl/wincesdl-graphics.cpp14
-rw-r--r--backends/graphics/wincesdl/wincesdl-graphics.h4
-rw-r--r--backends/mixer/doublebuffersdl/doublebuffersdl-mixer.cpp2
-rw-r--r--backends/mixer/sdl/sdl-mixer.cpp6
-rw-r--r--backends/mixer/sdl/sdl-mixer.h2
-rw-r--r--backends/modular-backend.h10
-rw-r--r--backends/module.mk2
-rw-r--r--backends/platform/android/android.cpp2
-rw-r--r--backends/platform/dc/dcmain.cpp12
-rw-r--r--backends/platform/dc/plugins.cpp2
-rw-r--r--backends/platform/dingux/dingux.cpp2
-rw-r--r--backends/platform/ds/arm9/source/gbampsave.cpp4
-rw-r--r--backends/platform/iphone/osys_main.cpp12
-rw-r--r--backends/platform/iphone/osys_main.h2
-rw-r--r--backends/platform/n64/osys_n64.h3
-rw-r--r--backends/platform/n64/osys_n64_base.cpp12
-rw-r--r--backends/platform/n64/osys_n64_events.cpp2
-rw-r--r--backends/platform/null/null.cpp14
-rw-r--r--backends/platform/psp/cursor.cpp10
-rw-r--r--backends/platform/psp/display_client.cpp32
-rw-r--r--backends/platform/psp/display_client.h10
-rw-r--r--backends/platform/psp/display_manager.cpp8
-rw-r--r--backends/platform/psp/display_manager.h6
-rw-r--r--backends/platform/psp/dummy.cpp12
-rw-r--r--backends/platform/psp/image_viewer.cpp90
-rw-r--r--backends/platform/psp/image_viewer.h28
-rw-r--r--backends/platform/psp/input.cpp32
-rw-r--r--backends/platform/psp/input.h20
-rw-r--r--backends/platform/psp/osys_psp.cpp15
-rw-r--r--backends/platform/psp/png_loader.cpp22
-rw-r--r--backends/platform/psp/png_loader.h2
-rw-r--r--backends/platform/psp/trace.cpp36
-rw-r--r--backends/platform/sdl/macosx/macosx.cpp2
-rw-r--r--backends/platform/sdl/sdl-sys.h2
-rw-r--r--backends/platform/sdl/sdl.cpp54
-rw-r--r--backends/platform/sdl/win32/win32.cpp2
-rw-r--r--backends/platform/symbian/src/SymbianOS.cpp4
-rw-r--r--backends/platform/wii/osystem.cpp18
-rw-r--r--backends/platform/wii/osystem.h2
-rw-r--r--backends/platform/wince/wince-sdl.cpp2
-rw-r--r--backends/plugins/elf/elf-loader.cpp26
-rw-r--r--backends/plugins/elf/elf-provider.cpp8
-rw-r--r--backends/plugins/elf/memory-manager.cpp62
-rw-r--r--backends/plugins/elf/memory-manager.h26
-rw-r--r--backends/plugins/elf/mips-loader.cpp6
-rw-r--r--base/commandLine.cpp2
-rw-r--r--base/main.cpp10
-rw-r--r--base/plugins.cpp36
-rw-r--r--base/plugins.h20
-rw-r--r--base/version.cpp5
-rw-r--r--common/archive.h2
-rw-r--r--common/config-manager.cpp8
-rw-r--r--common/config-manager.h2
-rw-r--r--common/debug.cpp13
-rw-r--r--common/error.cpp3
-rw-r--r--common/error.h2
-rw-r--r--common/ptr.h2
-rw-r--r--common/quicktime.cpp4
-rw-r--r--common/scummsys.h13
-rw-r--r--common/str.cpp20
-rw-r--r--common/str.h13
-rw-r--r--common/system.cpp19
-rw-r--r--common/system.h2
-rw-r--r--common/textconsole.cpp9
-rw-r--r--common/util.h5
-rw-r--r--common/winexe_ne.cpp2
-rw-r--r--common/winexe_pe.h2
-rwxr-xr-xconfigure84
-rw-r--r--devtools/create_hugo/create_hugo.cpp2
-rw-r--r--devtools/create_hugo/staticdisplay.h2
-rw-r--r--devtools/create_kyradat/extract.cpp2
-rw-r--r--devtools/create_mads/main.cpp4
-rw-r--r--devtools/create_mads/parser.cpp22
-rwxr-xr-xdevtools/credits.pl17
-rw-r--r--devtools/skycpt/cptcompiler.cpp2
-rw-r--r--devtools/tasmrecover/dreamweb/backdrop.asm1
-rw-r--r--devtools/tasmrecover/dreamweb/debug.asm1
-rw-r--r--devtools/tasmrecover/dreamweb/dreamweb.asm28
-rw-r--r--devtools/tasmrecover/dreamweb/keypad.asm1
-rw-r--r--devtools/tasmrecover/dreamweb/look.asm1
-rw-r--r--devtools/tasmrecover/dreamweb/monitor.asm1
-rw-r--r--devtools/tasmrecover/dreamweb/newplace.asm6
-rw-r--r--devtools/tasmrecover/dreamweb/object.asm5
-rw-r--r--devtools/tasmrecover/dreamweb/print.asm1
-rw-r--r--devtools/tasmrecover/dreamweb/saveload.asm36
-rw-r--r--devtools/tasmrecover/dreamweb/sblaster.asm1
-rw-r--r--devtools/tasmrecover/dreamweb/sprite.asm3
-rw-r--r--devtools/tasmrecover/dreamweb/talk.asm1
-rw-r--r--devtools/tasmrecover/dreamweb/titles.asm4
-rw-r--r--devtools/tasmrecover/dreamweb/use.asm1
-rw-r--r--devtools/tasmrecover/dreamweb/vars.asm1
-rw-r--r--devtools/tasmrecover/dreamweb/vgafades.asm1
-rw-r--r--devtools/tasmrecover/dreamweb/vgagrafx.asm1
-rwxr-xr-xdevtools/tasmrecover/tasm-recover5
-rw-r--r--devtools/tasmrecover/tasm/cpp.py167
-rw-r--r--devtools/tasmrecover/tasm/op.py12
-rw-r--r--devtools/tasmrecover/tasm/proc.py54
-rw-r--r--engines/advancedDetector.cpp23
-rw-r--r--engines/advancedDetector.h3
-rw-r--r--engines/agi/agi.cpp2
-rw-r--r--engines/agi/detection.cpp2
-rw-r--r--engines/agi/sound.cpp2
-rw-r--r--engines/agi/sound_2gs.cpp12
-rw-r--r--engines/agi/sound_2gs.h4
-rw-r--r--engines/agi/sound_midi.cpp10
-rw-r--r--engines/agi/sound_pcjr.h4
-rw-r--r--engines/agi/sound_sarien.cpp4
-rw-r--r--engines/agi/text.cpp5
-rw-r--r--engines/agos/string.cpp9
-rw-r--r--engines/cine/various.cpp2
-rw-r--r--engines/cruise/background.cpp2
-rw-r--r--engines/cruise/cruise_main.cpp2
-rw-r--r--engines/dialogs.cpp2
-rw-r--r--engines/drascula/detection.cpp2
-rw-r--r--engines/drascula/graphics.cpp4
-rw-r--r--engines/drascula/resource.cpp2
-rw-r--r--engines/drascula/rooms.cpp2
-rw-r--r--engines/dreamweb/detection.cpp14
-rw-r--r--engines/dreamweb/detection_tables.h21
-rw-r--r--engines/dreamweb/dreamgen.cpp38189
-rw-r--r--engines/dreamweb/dreamgen.h834
-rw-r--r--engines/dreamweb/dreamweb.cpp83
-rw-r--r--engines/dreamweb/dreamweb.h8
-rw-r--r--engines/dreamweb/runtime.h38
-rw-r--r--engines/dreamweb/stubs.cpp457
-rw-r--r--engines/engine.cpp11
-rw-r--r--engines/engine.h7
-rw-r--r--engines/game.cpp34
-rw-r--r--engines/game.h22
-rw-r--r--engines/gob/inter_fascin.cpp2
-rw-r--r--engines/gob/video_v6.cpp2
-rw-r--r--engines/groovie/detection.cpp14
-rw-r--r--engines/groovie/music.cpp8
-rw-r--r--engines/groovie/player.h4
-rw-r--r--engines/hugo/console.cpp12
-rw-r--r--engines/hugo/dialogs.cpp10
-rw-r--r--engines/hugo/display.cpp2
-rw-r--r--engines/hugo/hugo.cpp4
-rw-r--r--engines/hugo/hugo.h2
-rw-r--r--engines/hugo/inventory.h2
-rw-r--r--engines/hugo/object.cpp4
-rw-r--r--engines/hugo/parser.cpp4
-rw-r--r--engines/hugo/parser.h4
-rw-r--r--engines/hugo/schedule.cpp4
-rw-r--r--engines/hugo/schedule.h2
-rw-r--r--engines/hugo/sound.cpp4
-rw-r--r--engines/kyra/gui.cpp17
-rw-r--r--engines/kyra/lol.h2
-rw-r--r--engines/kyra/script_lol.cpp34
-rw-r--r--engines/kyra/sequences_lol.cpp4
-rw-r--r--engines/kyra/sound_intern.h2
-rw-r--r--engines/kyra/sound_towns.cpp12
-rw-r--r--engines/lastexpress/detection.cpp16
-rw-r--r--engines/lastexpress/game/sound.cpp367
-rw-r--r--engines/lastexpress/game/sound.h18
-rw-r--r--engines/lure/res_struct.h2
-rw-r--r--engines/m4/animation.cpp18
-rw-r--r--engines/m4/assets.cpp8
-rw-r--r--engines/m4/assets.h4
-rw-r--r--engines/m4/detection.cpp38
-rw-r--r--engines/m4/dialogs.cpp4
-rw-r--r--engines/m4/events.cpp2
-rw-r--r--engines/m4/font.h2
-rw-r--r--engines/m4/globals.cpp4
-rw-r--r--engines/m4/graphics.cpp12
-rw-r--r--engines/m4/graphics.h2
-rw-r--r--engines/m4/m4.cpp2
-rw-r--r--engines/m4/m4.h2
-rw-r--r--engines/m4/m4_views.cpp2
-rw-r--r--engines/m4/mads_anim.cpp2
-rw-r--r--engines/m4/mads_logic.cpp32
-rw-r--r--engines/m4/mads_logic.h4
-rw-r--r--engines/m4/mads_menus.cpp10
-rw-r--r--engines/m4/mads_player.cpp18
-rw-r--r--engines/m4/mads_scene.cpp20
-rw-r--r--engines/m4/mads_views.cpp40
-rw-r--r--engines/m4/mads_views.h12
-rw-r--r--engines/m4/resource.cpp2
-rw-r--r--engines/m4/resource.h2
-rw-r--r--engines/m4/scene.cpp6
-rw-r--r--engines/m4/sound.cpp4
-rw-r--r--engines/m4/sprite.cpp2
-rw-r--r--engines/made/database.cpp8
-rw-r--r--engines/mohawk/bitmap.cpp2
-rw-r--r--engines/mohawk/console.cpp2
-rw-r--r--engines/mohawk/detection_tables.h123
-rw-r--r--engines/mohawk/livingbooks.h2
-rw-r--r--engines/mohawk/myst_stacks/demo.cpp2
-rw-r--r--engines/mohawk/myst_stacks/myst.cpp4
-rw-r--r--engines/mohawk/resource.cpp4
-rw-r--r--engines/mohawk/riven.cpp8
-rw-r--r--engines/mohawk/riven_external.cpp8
-rw-r--r--engines/mohawk/riven_scripts.cpp2
-rw-r--r--engines/mohawk/video.cpp8
-rw-r--r--engines/parallaction/dialogue.cpp28
-rw-r--r--engines/parallaction/exec_br.cpp6
-rw-r--r--engines/parallaction/gfxbase.cpp10
-rw-r--r--engines/parallaction/graphics.cpp6
-rw-r--r--engines/parallaction/gui_br.cpp4
-rw-r--r--engines/parallaction/gui_ns.cpp22
-rw-r--r--engines/parallaction/objects.cpp8
-rw-r--r--engines/parallaction/parallaction.cpp10
-rw-r--r--engines/parallaction/parallaction_ns.cpp4
-rw-r--r--engines/parallaction/parser_br.cpp4
-rw-r--r--engines/parallaction/parser_ns.cpp8
-rw-r--r--engines/parallaction/sound.h4
-rw-r--r--engines/parallaction/sound_ns.cpp8
-rw-r--r--engines/parallaction/walk.cpp6
-rw-r--r--engines/saga/actor.cpp2
-rw-r--r--engines/saga/actor.h4
-rw-r--r--engines/saga/animation.cpp4
-rw-r--r--engines/saga/detection_tables.h4
-rw-r--r--engines/saga/events.cpp2
-rw-r--r--engines/saga/introproc_saga2.cpp2
-rw-r--r--engines/saga/isomap.cpp2
-rw-r--r--engines/saga/palanim.cpp4
-rw-r--r--engines/saga/saga.cpp2
-rw-r--r--engines/saga/scene.h2
-rw-r--r--engines/saga/sprite.cpp8
-rw-r--r--engines/sci/console.cpp18
-rw-r--r--engines/sci/detection.cpp125
-rw-r--r--engines/sci/detection_tables.h154
-rw-r--r--engines/sci/engine/features.h2
-rw-r--r--engines/sci/engine/kernel.h2
-rw-r--r--engines/sci/engine/kernel_tables.h6
-rw-r--r--engines/sci/engine/kevent.cpp2
-rw-r--r--engines/sci/engine/kfile.cpp6
-rw-r--r--engines/sci/engine/kgraphics.cpp12
-rw-r--r--engines/sci/engine/kmisc.cpp6
-rw-r--r--engines/sci/engine/kmovement.cpp4
-rw-r--r--engines/sci/engine/kpathing.cpp6
-rw-r--r--engines/sci/engine/kscripts.cpp2
-rw-r--r--engines/sci/engine/kstring.cpp8
-rw-r--r--engines/sci/engine/kvideo.cpp6
-rw-r--r--engines/sci/engine/object.cpp10
-rw-r--r--engines/sci/engine/object.h4
-rw-r--r--engines/sci/engine/savegame.h2
-rw-r--r--engines/sci/engine/script.cpp2
-rw-r--r--engines/sci/engine/script_patches.cpp10
-rw-r--r--engines/sci/engine/scriptdebug.cpp12
-rw-r--r--engines/sci/engine/segment.cpp2
-rw-r--r--engines/sci/engine/selector.cpp2
-rw-r--r--engines/sci/engine/selector.h2
-rw-r--r--engines/sci/engine/state.cpp4
-rw-r--r--engines/sci/engine/static_selectors.cpp8
-rw-r--r--engines/sci/engine/vm.cpp22
-rw-r--r--engines/sci/engine/vm_types.cpp12
-rw-r--r--engines/sci/engine/workarounds.cpp2
-rw-r--r--engines/sci/event.cpp4
-rw-r--r--engines/sci/graphics/animate.cpp4
-rw-r--r--engines/sci/graphics/compare.h2
-rw-r--r--engines/sci/graphics/coordadjuster.h4
-rw-r--r--engines/sci/graphics/menu.cpp4
-rw-r--r--engines/sci/graphics/palette.cpp8
-rw-r--r--engines/sci/graphics/palette.h2
-rw-r--r--engines/sci/graphics/picture.cpp6
-rw-r--r--engines/sci/graphics/ports.cpp2
-rw-r--r--engines/sci/graphics/view.cpp6
-rw-r--r--engines/sci/parser/said.cpp10
-rw-r--r--engines/sci/resource.cpp26
-rw-r--r--engines/sci/resource_audio.cpp4
-rw-r--r--engines/sci/sci.cpp6
-rw-r--r--engines/sci/sci.h4
-rw-r--r--engines/sci/sound/audio.cpp2
-rw-r--r--engines/sci/sound/drivers/amigamac.cpp6
-rw-r--r--engines/sci/sound/music.cpp4
-rw-r--r--engines/sci/video/robot_decoder.cpp24
-rw-r--r--engines/sci/video/seq_decoder.h2
-rw-r--r--engines/scumm/actor.cpp2
-rw-r--r--engines/scumm/charset.cpp11
-rw-r--r--engines/scumm/costume.cpp10
-rw-r--r--engines/scumm/detection.cpp6
-rw-r--r--engines/scumm/gfx.cpp45
-rw-r--r--engines/scumm/gfx.h19
-rw-r--r--engines/scumm/gfx_towns.cpp42
-rw-r--r--engines/scumm/he/logic_he.cpp2
-rw-r--r--engines/scumm/he/resource_he.cpp2
-rw-r--r--engines/scumm/he/resource_he.h2
-rw-r--r--engines/scumm/he/script_v60he.cpp2
-rw-r--r--engines/scumm/he/script_v72he.cpp2
-rw-r--r--engines/scumm/imuse/imuse.cpp8
-rw-r--r--engines/scumm/imuse/imuse_internal.h2
-rw-r--r--engines/scumm/imuse/imuse_player.cpp6
-rw-r--r--engines/scumm/imuse/sysex_scumm.cpp2
-rw-r--r--engines/scumm/input.cpp2
-rw-r--r--engines/scumm/player_towns.cpp56
-rw-r--r--engines/scumm/player_towns.h12
-rw-r--r--engines/scumm/saveload.cpp14
-rw-r--r--engines/scumm/script_v5.cpp4
-rw-r--r--engines/scumm/scumm.cpp66
-rw-r--r--engines/scumm/scumm.h8
-rw-r--r--engines/scumm/sound.cpp2
-rw-r--r--engines/scumm/verbs.cpp18
-rw-r--r--engines/sword1/animation.cpp2
-rw-r--r--engines/sword2/animation.cpp2
-rw-r--r--engines/sword25/detection_tables.h20
-rw-r--r--engines/sword25/gfx/animation.h2
-rw-r--r--engines/sword25/gfx/animationresource.cpp6
-rw-r--r--engines/sword25/gfx/fontresource.cpp2
-rw-r--r--engines/sword25/gfx/graphicengine.cpp2
-rw-r--r--engines/sword25/gfx/image/art.cpp2
-rw-r--r--engines/sword25/gfx/image/renderedimage.cpp24
-rw-r--r--engines/sword25/gfx/screenshot.cpp6
-rw-r--r--engines/sword25/gfx/text.cpp2
-rw-r--r--engines/sword25/kernel/persistenceservice.cpp2
-rw-r--r--engines/sword25/package/packagemanager.cpp2
-rw-r--r--engines/sword25/package/packagemanager.h2
-rw-r--r--engines/sword25/util/lua/lapi.cpp4
-rw-r--r--engines/sword25/util/lua/lauxlib.cpp8
-rw-r--r--engines/sword25/util/lua/ldblib.cpp2
-rw-r--r--engines/sword25/util/lua/ldebug.cpp2
-rw-r--r--engines/sword25/util/lua/ldo.cpp2
-rw-r--r--engines/sword25/util/lua/lgc.cpp4
-rw-r--r--engines/sword25/util/lua/liolib.cpp42
-rw-r--r--engines/sword25/util/lua/llimits.h4
-rw-r--r--engines/sword25/util/lua/loadlib.cpp4
-rw-r--r--engines/sword25/util/lua/lobject.h2
-rw-r--r--engines/sword25/util/lua/lopcodes.h10
-rw-r--r--engines/sword25/util/lua/lstate.cpp2
-rw-r--r--engines/sword25/util/lua/lstrlib.cpp2
-rw-r--r--engines/sword25/util/lua/ltable.cpp14
-rw-r--r--engines/sword25/util/lua/lua.h2
-rw-r--r--engines/sword25/util/lua/lualib.h2
-rw-r--r--engines/sword25/util/lua/lvm.cpp4
-rw-r--r--engines/sword25/util/lua/scummvm_file.cpp48
-rw-r--r--engines/sword25/util/lua/scummvm_file.h1
-rw-r--r--engines/teenagent/animation.cpp4
-rw-r--r--engines/teenagent/inventory.cpp2
-rw-r--r--engines/teenagent/inventory.h4
-rw-r--r--engines/teenagent/resources.h6
-rw-r--r--engines/teenagent/scene.cpp8
-rw-r--r--engines/teenagent/teenagent.cpp6
-rw-r--r--engines/testbed/config-params.h10
-rw-r--r--engines/tinsel/coroutine.h17
-rw-r--r--engines/tinsel/detection_tables.h6
-rw-r--r--engines/tinsel/pcode.cpp8
-rw-r--r--engines/tinsel/saveload.cpp2
-rw-r--r--engines/tinsel/sched.cpp9
-rw-r--r--engines/tinsel/tinlib.cpp42
-rw-r--r--engines/toon/path.cpp4
-rw-r--r--engines/toon/tools.cpp2
-rw-r--r--engines/toon/toon.cpp2
-rw-r--r--engines/toon/toon.h6
-rw-r--r--engines/tsage/blueforce_logic.cpp2
-rw-r--r--engines/tsage/converse.cpp2
-rw-r--r--engines/tsage/converse.h3
-rw-r--r--engines/tsage/core.cpp64
-rw-r--r--engines/tsage/core.h69
-rw-r--r--engines/tsage/debugger.cpp8
-rw-r--r--engines/tsage/detection_tables.h20
-rw-r--r--engines/tsage/dialogs.cpp2
-rw-r--r--engines/tsage/events.cpp5
-rw-r--r--engines/tsage/globals.cpp19
-rw-r--r--engines/tsage/globals.h8
-rw-r--r--engines/tsage/graphics.cpp6
-rw-r--r--engines/tsage/resources.cpp4
-rw-r--r--engines/tsage/ringworld_demo.cpp9
-rw-r--r--engines/tsage/ringworld_demo.h3
-rw-r--r--engines/tsage/ringworld_logic.cpp57
-rw-r--r--engines/tsage/ringworld_scenes1.cpp153
-rw-r--r--engines/tsage/ringworld_scenes1.h25
-rw-r--r--engines/tsage/ringworld_scenes10.cpp43
-rw-r--r--engines/tsage/ringworld_scenes10.h8
-rw-r--r--engines/tsage/ringworld_scenes2.cpp37
-rw-r--r--engines/tsage/ringworld_scenes2.h4
-rw-r--r--engines/tsage/ringworld_scenes3.cpp254
-rw-r--r--engines/tsage/ringworld_scenes3.h20
-rw-r--r--engines/tsage/ringworld_scenes4.cpp8
-rw-r--r--engines/tsage/ringworld_scenes4.h2
-rw-r--r--engines/tsage/ringworld_scenes5.cpp94
-rw-r--r--engines/tsage/ringworld_scenes5.h10
-rw-r--r--engines/tsage/ringworld_scenes6.cpp36
-rw-r--r--engines/tsage/ringworld_scenes6.h8
-rw-r--r--engines/tsage/ringworld_scenes8.cpp49
-rw-r--r--engines/tsage/ringworld_scenes8.h14
-rw-r--r--engines/tsage/scenes.cpp5
-rw-r--r--engines/tsage/scenes.h4
-rw-r--r--engines/tsage/sound.cpp2611
-rw-r--r--engines/tsage/sound.h410
-rw-r--r--engines/tsage/tsage.cpp11
-rw-r--r--engines/tsage/tsage.h5
-rw-r--r--graphics/fonts/winfont.cpp6
-rw-r--r--graphics/fonts/winfont.h2
-rw-r--r--graphics/jpeg.h2
-rw-r--r--graphics/png.cpp91
-rw-r--r--graphics/sjis.cpp4
-rw-r--r--graphics/sjis.h2
-rw-r--r--graphics/surface.cpp2
-rw-r--r--graphics/surface.h2
-rw-r--r--gui/ThemeParser.cpp22
-rw-r--r--gui/credits.h12
-rw-r--r--gui/options.cpp10
-rw-r--r--gui/themes/translations.datbin212190 -> 220518 bytes
-rw-r--r--po/POTFILES2
-rw-r--r--po/ca_ES.po87
-rw-r--r--po/cs_CZ.po102
-rw-r--r--po/da_DA.po87
-rw-r--r--po/de_DE.po316
-rw-r--r--po/es_ES.po87
-rw-r--r--po/fr_FR.po87
-rw-r--r--po/hu_HU.po242
-rw-r--r--po/it_IT.po87
-rw-r--r--po/nb_NO.po87
-rw-r--r--po/nn_NO.po87
-rw-r--r--po/pl_PL.po87
-rw-r--r--po/pt_BR.po87
-rw-r--r--po/ru_RU.po87
-rw-r--r--po/scummvm.pot87
-rw-r--r--po/se_SE.po87
-rw-r--r--po/uk_UA.po87
-rw-r--r--video/codecs/truemotion1.cpp2
-rw-r--r--video/codecs/truemotion1.h4
-rw-r--r--video/qt_decoder.cpp2
447 files changed, 26894 insertions, 23227 deletions
diff --git a/AUTHORS b/AUTHORS
index feaa178e6e..6492b4781d 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -2,13 +2,13 @@ ScummVM Team
************
Project Leaders
---------------
- Max Horn
Eugene Sandulenko
Retired Project Leaders
-----------------------
James Brown
Vincent Hamm - ScummVM co-founder, Original Cruise/CinE author
+ Max Horn
Ludvig Strigeus - Original ScummVM and SimonVM author
Engine Teams
@@ -18,7 +18,7 @@ ScummVM Team
James Brown - (retired)
Jonathan Gray - (retired)
Vincent Hamm - (retired)
- Max Horn
+ Max Horn - (retired)
Travis Howell - (retired)
Pawel Kolodziejski - Codecs, iMUSE, Smush, etc.
Gregory Montoir
@@ -138,7 +138,7 @@ ScummVM Team
SCI:
Greg Frieger
Paul Gilbert
- Max Horn
+ Max Horn - (retired)
Filippos Karapetis
Martin Kiewitz
Walter van Niftrik
@@ -164,7 +164,7 @@ ScummVM Team
Sword25:
Eugene Sandulenko
Filippos Karapetis
- Max Horn
+ Max Horn - (retired)
Paul Gilbert
Torbjorn Andersson
@@ -177,7 +177,7 @@ ScummVM Team
Fabio Battaglia - PSX version support
Paul Gilbert
Sven Hesse
- Max Horn
+ Max Horn - (retired)
Filippos Karapetis
Joost Peters
@@ -238,7 +238,7 @@ ScummVM Team
Yotam Barnoy
SDL (Win/Linux/OS X/etc.):
- Max Horn
+ Max Horn - (retired)
Eugene Sandulenko - Asm routines, GFX layers
SymbianOS:
@@ -255,7 +255,7 @@ ScummVM Team
----------------
Infrastructure:
Max Horn - Backend & Engine APIs, file API, sound mixer,
- audiostreams, data structures, etc.
+ audiostreams, data structures, etc. (retired)
Eugene Sandulenko
Johannes Schickel
@@ -285,7 +285,6 @@ ScummVM Team
James Brown - IRC Logs maintainer
Thierry Crozat - Wiki maintainer
Andre Heider - Buildbot maintainer
- Max Horn - Forum, IRC channel and Mailing list maintainer
Joost Peters - Doxygen Project Documentation maintainer
Jordi Vilalta Prat - Wiki maintainer
Eugene Sandulenko - Forum, IRC channel, Screen Shots and Mailing
@@ -339,7 +338,7 @@ Other contributions
Willem Jan Palenstijn
Mac OS X:
- Max Horn
+ Max Horn - (retired)
Oystein Eftevaag
Mandriva:
diff --git a/NEWS b/NEWS
index 6fda0a8f39..3849d82fae 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,19 @@ For a more comprehensive changelog of the latest experimental code, see:
SDL ports:
- Added support for OpenGL (GSoC Task).
+1.3.1 (????-??-??)
+ General:
+ - Improved audio device detection and fallback.
+ There should be no more silent errors due to invalid audio devices.
+ Instead ScummVM should pick up a suitable alternative device.
+
+ Tinsel:
+ - Fixed a regression that made Discworld uncompletable.
+
+ SCUMM:
+ - Fixed graphics bug in FM-TOWNS versions of games on ARM devices
+ (Android, iPhone, etc.).
+
1.3.0 (2011-05-28)
New Games:
- Added support for Backyard Baseball.
diff --git a/audio/decoders/aac.cpp b/audio/decoders/aac.cpp
index 7949b5b561..874062a702 100644
--- a/audio/decoders/aac.cpp
+++ b/audio/decoders/aac.cpp
@@ -127,7 +127,7 @@ int AACStream::readBuffer(int16 *buffer, const int numSamples) {
// Dip into our remaining samples pool if it's available
if (_remainingSamples) {
samples = MIN<int>(numSamples, _remainingSamplesSize - _remainingSamplesPos);
-
+
memcpy(buffer, _remainingSamples + _remainingSamplesPos, samples * 2);
_remainingSamplesPos += samples;
diff --git a/audio/decoders/adpcm.cpp b/audio/decoders/adpcm.cpp
index d28ed222a5..f75196c882 100644
--- a/audio/decoders/adpcm.cpp
+++ b/audio/decoders/adpcm.cpp
@@ -342,14 +342,14 @@ do { \
_topNibble = true; \
} \
} while (0)
-
+
int DK3_ADPCMStream::readBuffer(int16 *buffer, const int numSamples) {
int samples = 0;
assert((numSamples % 4) == 0);
- while (samples < numSamples && !_stream->eos() && _stream->pos() < _endpos) {
+ while (samples < numSamples && !_stream->eos() && _stream->pos() < _endpos) {
if ((_stream->pos() % _blockAlign) == 0) {
_stream->readUint16LE(); // Unknown
uint16 rate = _stream->readUint16LE(); // Copy of rate
diff --git a/audio/decoders/quicktime.cpp b/audio/decoders/quicktime.cpp
index 0f2e76658b..0ad2821cd5 100644
--- a/audio/decoders/quicktime.cpp
+++ b/audio/decoders/quicktime.cpp
@@ -220,7 +220,7 @@ void QuickTimeAudioDecoder::setAudioStreamPos(const Timestamp &where) {
// First, we need to track down what audio sample we need
Audio::Timestamp curAudioTime = where.convertToFramerate(_tracks[_audioTrackIndex]->timeScale);
uint32 sample = curAudioTime.totalNumberOfFrames();
- uint32 seekSample = sample;
+ uint32 seekSample = sample;
if (!isOldDemuxing()) {
// We shouldn't have audio samples that are a different duration
@@ -246,7 +246,7 @@ void QuickTimeAudioDecoder::setAudioStreamPos(const Timestamp &where) {
totalSamples += chunkSampleCount;
}
-
+
// Reposition the audio stream
queueNextAudioChunk();
if (sample != totalSamples) {
diff --git a/audio/decoders/quicktime.h b/audio/decoders/quicktime.h
index 413f527221..9f6c6c20e0 100644
--- a/audio/decoders/quicktime.h
+++ b/audio/decoders/quicktime.h
@@ -45,7 +45,7 @@ namespace Common {
namespace Audio {
class SeekableAudioStream;
-
+
/**
* Try to load a QuickTime sound file from the given file name and create a SeekableAudioStream
* from that data.
diff --git a/audio/mididrv.cpp b/audio/mididrv.cpp
index 0ca70b24f8..b71c02f991 100644
--- a/audio/mididrv.cpp
+++ b/audio/mididrv.cpp
@@ -229,7 +229,7 @@ MidiDriver::DeviceHandle MidiDriver::detectDevice(int flags) {
if ((flags & MDT_MIDI) && !skipMidi) {
// If a preferred MT32 or GM device has been selected that device gets returned if available.
Common::String devStr;
- if (flags & MDT_PREFER_MT32)
+ if (flags & MDT_PREFER_MT32)
devStr = ConfMan.get("mt32_device");
else if (flags & MDT_PREFER_GM)
devStr = ConfMan.get("gm_device");
@@ -261,7 +261,7 @@ MidiDriver::DeviceHandle MidiDriver::detectDevice(int flags) {
// If the preferred (expressly requested) device cannot be used we display a warning and continue.
// Don't warn about the failing device if we did already (this becomes relevant if the failing
// device is selected as preferred device and also as GM or MT-32 device).
- if (failedDevStr != getDeviceString(hdl, MidiDriver::kDeviceName)) {
+ if (failedDevStr != getDeviceString(hdl, MidiDriver::kDeviceName)) {
Common::String warningMsg = Common::String::format(_("The preferred audio device '%s' cannot be used. See log file for more information. Attempting to fall back to the next available device..."), getDeviceString(hdl, MidiDriver::kDeviceName).c_str());
GUI::MessageDialog dialog(warningMsg);
dialog.runModal();
@@ -285,7 +285,7 @@ MidiDriver::DeviceHandle MidiDriver::detectDevice(int flags) {
}
}
- // Now we default to the first available device with music type 'MT_GM' if not
+ // Now we default to the first available device with music type 'MT_GM' if not
// MT-32 is preferred or if MT-32 is preferred but all other devices have failed.
if (!(flags & MDT_PREFER_MT32) || flags == (MDT_PREFER_MT32 | MDT_MIDI)) {
for (MusicPlugin::List::const_iterator m = p.begin(); m != p.end(); ++m) {
diff --git a/audio/softsynth/fmtowns_pc98/towns_audio.cpp b/audio/softsynth/fmtowns_pc98/towns_audio.cpp
index beee5f1cad..28591117f0 100644
--- a/audio/softsynth/fmtowns_pc98/towns_audio.cpp
+++ b/audio/softsynth/fmtowns_pc98/towns_audio.cpp
@@ -67,7 +67,7 @@ public:
void updateEnvelopeGenerator();
- void setInstrument(uint8 *instr);
+ void setInstrument(uint8 *instr);
void setLevel(uint8 lvl);
void setPitch(uint32 pt);
void setBalance(uint8 blc);
@@ -272,12 +272,12 @@ private:
static const uint8 _fmDefaultInstrument[];
};
-TownsAudioInterfaceInternal::TownsAudioInterfaceInternal(Audio::Mixer *mixer, TownsAudioInterface *owner, TownsAudioInterfacePluginDriver *driver, bool externalMutexHandling) :
+TownsAudioInterfaceInternal::TownsAudioInterfaceInternal(Audio::Mixer *mixer, TownsAudioInterface *owner, TownsAudioInterfacePluginDriver *driver, bool externalMutexHandling) :
TownsPC98_FmSynth(mixer, kTypeTowns, externalMutexHandling),
_fmInstruments(0), _pcmInstruments(0), _pcmChan(0), _waveTables(0), _waveTablesTotalDataSize(0),
_baserate(55125.0f / (float)mixer->getOutputRate()), _tickLength(0), _timer(0), _drv(driver), _drvOwner(owner),
_pcmSfxChanMask(0), _musicVolume(Audio::Mixer::kMaxMixerVolume), _sfxVolume(Audio::Mixer::kMaxMixerVolume),
- _outputVolumeFlags(0), _fmChanPlaying(0),
+ _outputVolumeFlags(0), _fmChanPlaying(0),
_numReservedChannels(0), _numWaveTables(0), _updateOutputVol(false), _ready(false) {
#define INTCB(x) &TownsAudioInterfaceInternal::intf_##x
@@ -431,7 +431,7 @@ void TownsAudioInterfaceInternal::releaseRef(TownsAudioInterface *owner) {
return;
_refCount--;
-
+
if (_refCount) {
if (_refInstance)
_refInstance->removePluginDriver(owner);
@@ -484,7 +484,7 @@ int TownsAudioInterfaceInternal::processCommand(int command, va_list &args) {
if (command < 0 || command > 81)
return 4;
-
+
Common::StackLock lock(_mutex);
int res = (this->*_intfOpcodes[command])(args);
@@ -564,7 +564,7 @@ void TownsAudioInterfaceInternal::nextTickEx(int32 *buffer, uint32 bufferSize) {
}
finOutL += oL;
finOutR += oR;
-
+
if (!(_pcmChan[ii]._activeKey || _pcmChan[ii]._activeEffect))
_pcmChan[ii]._activeOutput = false;
}
@@ -996,7 +996,7 @@ int TownsAudioInterfaceInternal::intf_setOutputMute(va_list &args) {
if (mute & 2)
memset(&_outputMute[12], 1, 4);
if (mute & 1)
- memset(&_outputMute[8], 1, 4);
+ memset(&_outputMute[8], 1, 4);
_outputMute[(f < 0x80) ? 11 : 15] = 0;
f += f;
@@ -1009,8 +1009,8 @@ int TownsAudioInterfaceInternal::intf_setOutputMute(va_list &args) {
_outputMute[(f < 0x80) ? 0 : 4] = 0;
f += f;
_outputMute[(f < 0x80) ? 1 : 5] = 0;
- f += f;
-
+ f += f;
+
updateOutputVolume();
return 0;
}
@@ -1581,7 +1581,7 @@ void TownsAudio_PcmChannel::clear() {
_envTotalLevel = _envAttackRate = _envDecayRate = _envSustainLevel = _envSustainRate = _envReleaseRate = 0;
_envStep = _envCurrentLevel = 0;
- _envState = kEnvReady;
+ _envState = kEnvReady;
_activeKey = _activeEffect = _activeOutput = _keyPressed = _reserved = false;
@@ -1650,7 +1650,7 @@ void TownsAudio_PcmChannel::keyOn(uint8 note, uint8 velo, TownsAudio_WaveTable *
_activeEffect = true;
else
_keyPressed = _activeKey = true;
-
+
_activeOutput = true;
}
@@ -1742,7 +1742,7 @@ void TownsAudio_PcmChannel::setBalance(uint8 blc) {
void TownsAudio_PcmChannel::updateOutput() {
if (_activeKey || _activeEffect) {
_pos += _step;
-
+
if (&_data[_pos >> 11] >= _loopEnd) {
if (_loopLen) {
_pos -= _loopLen;
@@ -1811,7 +1811,7 @@ void TownsAudio_PcmChannel::setVelo(uint8 velo) {
_envTotalLevel = ((_envTotalLevel * lvl) >> 14) & 0xff;
_envSustainLevel = ((_envSustainLevel * lvl) >> 14) & 0xff;
envAttack();
- _tl = (_envCurrentLevel >> 8) << 1;
+ _tl = (_envCurrentLevel >> 8) << 1;
}
}
diff --git a/audio/softsynth/fmtowns_pc98/towns_midi.cpp b/audio/softsynth/fmtowns_pc98/towns_midi.cpp
index 071a697615..e415a0dda5 100644
--- a/audio/softsynth/fmtowns_pc98/towns_midi.cpp
+++ b/audio/softsynth/fmtowns_pc98/towns_midi.cpp
@@ -36,7 +36,7 @@ public:
void setupProgram(const uint8 *data, uint8 mLevelPara, uint8 tLevelPara);
void setupEffects(int index, uint8 flags, const uint8 *effectData);
void setModWheel(uint8 value);
-
+
void connect(TownsMidiInputChannel *chan);
void disconnect();
@@ -100,7 +100,7 @@ private:
uint8 _operator1Tl;
uint8 _sustainNoteOff;
int16 _duration;
-
+
uint16 _freq;
int16 _freqAdjust;
@@ -134,7 +134,7 @@ public:
void controlChange(byte control, byte value);
void pitchBendFactor(byte value);
void priority(byte value);
- void sysEx_customInstrument(uint32 type, const byte *instr);
+ void sysEx_customInstrument(uint32 type, const byte *instr);
private:
void controlModulationWheel(byte value);
@@ -145,7 +145,7 @@ private:
void releasePedal();
TownsMidiOutputChannel *_out;
-
+
uint8 *_instrument;
uint8 _prg;
uint8 _chanIndex;
@@ -175,7 +175,7 @@ private:
class TownsMidiChanState {
public:
TownsMidiChanState();
- ~TownsMidiChanState() {}
+ ~TownsMidiChanState() {}
uint8 get(uint8 type);
uint8 unk1;
@@ -247,7 +247,7 @@ void TownsMidiOutputChannel::setupProgram(const uint8 *data, uint8 mLevelPara, u
// music (unsuitable data is just forced into the wrong audio device).
static const uint8 mul[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 12, 12, 15, 15 };
- uint8 chan = _chanMap[_chan];
+ uint8 chan = _chanMap[_chan];
uint8 mulAmsFms1 = _driver->_chanState[chan].mulAmsFms = data[0];
uint8 tl1 = _driver->_chanState[chan].tl = (data[1] | 0x3f) - mLevelPara;
@@ -296,7 +296,7 @@ void TownsMidiOutputChannel::setupProgram(const uint8 *data, uint8 mLevelPara, u
void TownsMidiOutputChannel::setupEffects(int index, uint8 flags, const uint8 *effectData) {
uint16 effectMaxLevel[] = { 0x2FF, 0x1F, 0x07, 0x3F, 0x0F, 0x0F, 0x0F, 0x03, 0x3F, 0x0F, 0x0F, 0x0F, 0x03, 0x3E, 0x1F };
uint8 effectType[] = { 0x1D, 0x1C, 0x1B, 0x00, 0x03, 0x04, 0x07, 0x08, 0x0D, 0x10, 0x11, 0x14, 0x15, 0x1e, 0x1f, 0x00 };
-
+
EffectEnvelope *s = &_effectEnvelopes[index];
EffectDef *d = &_effectDefs[index];
@@ -354,7 +354,7 @@ void TownsMidiOutputChannel::connect(TownsMidiInputChannel *chan) {
void TownsMidiOutputChannel::disconnect() {
keyOff();
-
+
TownsMidiOutputChannel *p = _prev;
TownsMidiOutputChannel *n = _next;
@@ -448,10 +448,10 @@ int TownsMidiOutputChannel::advanceEffectEnvelope(EffectEnvelope *s, EffectDef *
s->state = kEnvReady;
return 0;
}
- }
+ }
int32 t = s->currentLevel + s->incrPerStep;
-
+
s->incrCountRem += s->incrPerStepRem;
if (s->incrCountRem >= s->numSteps) {
s->incrCountRem -= s->numSteps;
@@ -492,7 +492,7 @@ void TownsMidiOutputChannel::initNextEnvelopeState(EffectEnvelope *s) {
if (v & 0x80)
e = _driver->randomValue(e);
-
+
if (!e)
e = 1;
@@ -525,7 +525,7 @@ void TownsMidiOutputChannel::initNextEnvelopeState(EffectEnvelope *s) {
int16 TownsMidiOutputChannel::getEffectStartLevel(uint8 type) {
uint8 chan = (type < 13) ? _chanMap2[_chan] : ((type < 26) ? _chanMap[_chan] : _chan);
-
+
if (type == 28)
return 15;
else if (type == 29)
@@ -539,8 +539,8 @@ int16 TownsMidiOutputChannel::getEffectStartLevel(uint8 type) {
uint8 res = (_driver->_chanState[chan].get(def[0] >> 5) & def[2]) >> def[1];
if (def[3])
res = def[3] - res;
-
- return res;
+
+ return res;
}
int TownsMidiOutputChannel::getEffectModLevel(int lvl, int mod) {
@@ -554,12 +554,12 @@ int TownsMidiOutputChannel::getEffectModLevel(int lvl, int mod) {
return ((lvl + 1) * mod) >> 5;
if (mod < 0) {
- if (lvl < 0)
+ if (lvl < 0)
return _driver->_operatorLevelTable[((-lvl) << 5) - mod];
else
return -_driver->_operatorLevelTable[(lvl << 5) - mod];
} else {
- if (lvl < 0)
+ if (lvl < 0)
return -_driver->_operatorLevelTable[((-lvl) << 5) + mod];
else
return _driver->_operatorLevelTable[((-lvl) << 5) + mod];
@@ -577,7 +577,7 @@ void TownsMidiOutputChannel::keyOff() {
}
void TownsMidiOutputChannel::keyOnSetFreq(uint16 frq) {
- uint16 note = (frq << 1) >> 8;
+ uint16 note = (frq << 1) >> 8;
frq = (_freqMSB[note] << 11) | _freqLSB[note] ;
out(0xa4, frq >> 8);
out(0xa0, frq & 0xff);
@@ -701,7 +701,7 @@ void TownsMidiInputChannel::noteOff(byte note) {
void TownsMidiInputChannel::noteOn(byte note, byte velocity) {
TownsMidiOutputChannel *oc = _driver->allocateOutputChannel(_priority);
-
+
if (!oc)
return;
@@ -711,7 +711,7 @@ void TownsMidiInputChannel::noteOn(byte note, byte velocity) {
oc->_note = note;
oc->_sustainNoteOff = 0;
oc->_duration = _instrument[29] * 63;
-
+
oc->_operator1Tl = (_instrument[1] & 0x3f) + _driver->_operatorLevelTable[((velocity >> 1) << 5) + (_instrument[4] >> 2)];
if (oc->_operator1Tl > 63)
oc->_operator1Tl = 63;
@@ -840,7 +840,7 @@ MidiDriver_TOWNS::MidiDriver_TOWNS(Audio::Mixer *mixer) : _timerProc(0), _timerP
_channels = new TownsMidiInputChannel*[32];
for (int i = 0; i < 32; i++)
_channels[i] = new TownsMidiInputChannel(this, i > 8 ? (i + 1) : i);
-
+
_out = new TownsMidiOutputChannel*[6];
for (int i = 0; i < 6; i++)
_out[i] = new TownsMidiOutputChannel(this, i);
@@ -964,7 +964,7 @@ MidiChannel *MidiDriver_TOWNS::allocateChannel() {
if (!_isOpen)
return 0;
- for (int i = 0; i < 32; ++i) {
+ for (int i = 0; i < 32; ++i) {
TownsMidiInputChannel *chan = _channels[i];
if (chan->allocate())
return chan;
@@ -1023,7 +1023,7 @@ TownsMidiOutputChannel *MidiDriver_TOWNS::allocateOutputChannel(uint8 pri) {
res = _out[_allocCurPos];
}
}
-
+
if (res)
res->disconnect();
diff --git a/audio/softsynth/fmtowns_pc98/towns_midi.h b/audio/softsynth/fmtowns_pc98/towns_midi.h
index 9aa7c93b35..8c764c55d9 100644
--- a/audio/softsynth/fmtowns_pc98/towns_midi.h
+++ b/audio/softsynth/fmtowns_pc98/towns_midi.h
@@ -57,7 +57,7 @@ private:
void updateOutputChannels();
TownsMidiOutputChannel *allocateOutputChannel(uint8 pri);
-
+
int randomValue(int para);
TownsMidiInputChannel **_channels;
@@ -72,11 +72,11 @@ private:
uint32 _tickCounter;
uint8 _allocCurPos;
uint8 _rand;
-
+
bool _isOpen;
uint8 *_operatorLevelTable;
-
+
const uint16 _baseTempo;
};
diff --git a/audio/softsynth/fmtowns_pc98/towns_pc98_driver.cpp b/audio/softsynth/fmtowns_pc98/towns_pc98_driver.cpp
index 49fe97caf1..001d258873 100644
--- a/audio/softsynth/fmtowns_pc98/towns_pc98_driver.cpp
+++ b/audio/softsynth/fmtowns_pc98/towns_pc98_driver.cpp
@@ -1265,7 +1265,7 @@ void TownsPC98_AudioDriver::fadeStep() {
void TownsPC98_AudioDriver::pause() {
_musicPlaying = false;
}
-
+
void TownsPC98_AudioDriver::cont() {
_musicPlaying = true;
}
diff --git a/audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp b/audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp
index 63007ba93c..b4967a556f 100644
--- a/audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp
+++ b/audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp
@@ -1160,12 +1160,12 @@ int TownsPC98_FmSynth::readBuffer(int16 *buffer, const int numSamples) {
for (int i = 0; i < 2; i++) {
if (_timers[i].enabled && _timers[i].cb) {
if (!_timers[i].smpTillCb) {
-
+
if (locked && _externalMutex) {
_mutex.unlock();
locked = false;
}
-
+
(this->*_timers[i].cb)();
if (!locked && _externalMutex) {
diff --git a/audio/softsynth/mt32.cpp b/audio/softsynth/mt32.cpp
index 6d13ec33b4..6703a6f7b7 100644
--- a/audio/softsynth/mt32.cpp
+++ b/audio/softsynth/mt32.cpp
@@ -564,8 +564,8 @@ bool MT32EmuMusicPlugin::checkDevice(MidiDriver::DeviceHandle) const {
warning("The MT-32 emulator requires one of the two following file sets (not bundled with ScummVM):\n Either 'MT32_CONTROL.ROM' and 'MT32_PCM.ROM' or 'CM32L_CONTROL.ROM' and 'CM32L_PCM.ROM'");
return false;
}
-
- return true;
+
+ return true;
}
Common::Error MT32EmuMusicPlugin::createInstance(MidiDriver **mididriver, MidiDriver::DeviceHandle) const {
diff --git a/backends/audiocd/audiocd.h b/backends/audiocd/audiocd.h
index 92b7598cb5..0afc6af991 100644
--- a/backends/audiocd/audiocd.h
+++ b/backends/audiocd/audiocd.h
@@ -113,7 +113,7 @@ public:
* @return true if the CD drive was inited succesfully
*/
virtual bool openCD(int drive) = 0;
-
+
/**
* Poll CD status.
* @return true if CD audio is playing
diff --git a/backends/events/sdl/sdl-events.h b/backends/events/sdl/sdl-events.h
index 227d6e1607..805b76b108 100644
--- a/backends/events/sdl/sdl-events.h
+++ b/backends/events/sdl/sdl-events.h
@@ -20,19 +20,19 @@
*
*/
-#if !defined(BACKEND_EVENTS_SDL_H) && !defined(DISABLE_DEFAULT_EVENTMANAGER)
+#ifndef BACKEND_EVENTS_SDL_H
#define BACKEND_EVENTS_SDL_H
-#include "backends/events/default/default-events.h"
-
#include "backends/platform/sdl/sdl-sys.h"
+#include "common/events.h"
+
/**
* The SDL event source.
*/
class SdlEventSource : public Common::EventSource {
-public:
+public:
SdlEventSource();
virtual ~SdlEventSource();
@@ -69,7 +69,7 @@ protected:
/** Scroll lock state - since SDL doesn't track it */
bool _scrollLock;
-
+
/** Joystick */
SDL_Joystick *_joystick;
diff --git a/backends/events/webossdl/webossdl-events.cpp b/backends/events/webossdl/webossdl-events.cpp
index 4a17bc2066..102eb5802e 100644
--- a/backends/events/webossdl/webossdl-events.cpp
+++ b/backends/events/webossdl/webossdl-events.cpp
@@ -89,7 +89,7 @@ void WebOSSdlEventSource::SDLModToOSystemKeyFlags(SDLMod mod,
event.kbd.flags |= Common::KBD_SHIFT;
if (mod & KMOD_CTRL)
event.kbd.flags |= Common::KBD_CTRL;
-
+
// Holding down the gesture area emulates the ALT key
if (gestureDown)
event.kbd.flags |= Common::KBD_ALT;
diff --git a/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp b/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp
index 8a141e97a5..8075d0d45b 100644
--- a/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp
+++ b/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp
@@ -36,7 +36,7 @@ static const OSystem::GraphicsMode s_supportedGraphicsModes[] = {
};
DINGUXSdlGraphicsManager::DINGUXSdlGraphicsManager(SdlEventSource *boss)
- : SdlGraphicsManager(boss) {
+ : SurfaceSdlGraphicsManager(boss) {
}
const OSystem::GraphicsMode *DINGUXSdlGraphicsManager::getSupportedGraphicsModes() const {
@@ -415,7 +415,7 @@ void DINGUXSdlGraphicsManager::showOverlay() {
_mouseCurState.x = _mouseCurState.x / 2;
_mouseCurState.y = _mouseCurState.y / 2;
}
- SdlGraphicsManager::showOverlay();
+ SurfaceSdlGraphicsManager::showOverlay();
}
void DINGUXSdlGraphicsManager::hideOverlay() {
@@ -423,7 +423,7 @@ void DINGUXSdlGraphicsManager::hideOverlay() {
_mouseCurState.x = _mouseCurState.x * 2;
_mouseCurState.y = _mouseCurState.y * 2;
}
- SdlGraphicsManager::hideOverlay();
+ SurfaceSdlGraphicsManager::hideOverlay();
}
bool DINGUXSdlGraphicsManager::loadGFXMode() {
@@ -462,7 +462,7 @@ bool DINGUXSdlGraphicsManager::loadGFXMode() {
}
- return SdlGraphicsManager::loadGFXMode();
+ return SurfaceSdlGraphicsManager::loadGFXMode();
}
bool DINGUXSdlGraphicsManager::hasFeature(OSystem::Feature f) {
@@ -492,11 +492,11 @@ bool DINGUXSdlGraphicsManager::getFeatureState(OSystem::Feature f) {
}
}
-SdlGraphicsManager::MousePos* DINGUXSdlGraphicsManager::getMouseCurState() {
+SurfaceSdlGraphicsManager::MousePos *DINGUXSdlGraphicsManager::getMouseCurState() {
return &_mouseCurState;
}
-SdlGraphicsManager::VideoState* DINGUXSdlGraphicsManager::getVideoMode() {
+SurfaceSdlGraphicsManager::VideoState *DINGUXSdlGraphicsManager::getVideoMode() {
return &_videoMode;
}
@@ -507,7 +507,7 @@ void DINGUXSdlGraphicsManager::warpMouse(int x, int y) {
y = y / 2;
}
}
- SdlGraphicsManager::warpMouse(x, y);
+ SurfaceSdlGraphicsManager::warpMouse(x, y);
}
void DINGUXSdlGraphicsManager::adjustMouseEvent(const Common::Event &event) {
diff --git a/backends/graphics/dinguxsdl/dinguxsdl-graphics.h b/backends/graphics/dinguxsdl/dinguxsdl-graphics.h
index 9fb1170503..84a784b771 100644
--- a/backends/graphics/dinguxsdl/dinguxsdl-graphics.h
+++ b/backends/graphics/dinguxsdl/dinguxsdl-graphics.h
@@ -23,16 +23,16 @@
#ifndef BACKENDS_GRAPHICS_SDL_DINGUX_H
#define BACKENDS_GRAPHICS_SDL_DINGUX_H
-#include "backends/graphics/sdl/sdl-graphics.h"
+#include "backends/graphics/surfacesdl/surfacesdl-graphics.h"
-#include "graphics/scaler/aspect.h" // for aspect2Real
+#include "graphics/scaler/aspect.h" // for aspect2Real
#include "graphics/scaler/downscaler.h"
enum {
GFX_HALF = 12
};
-class DINGUXSdlGraphicsManager : public SdlGraphicsManager {
+class DINGUXSdlGraphicsManager : public SurfaceSdlGraphicsManager {
public:
DINGUXSdlGraphicsManager(SdlEventSource *boss);
@@ -54,8 +54,8 @@ public:
void undrawMouse();
virtual void warpMouse(int x, int y);
- SdlGraphicsManager::MousePos *getMouseCurState();
- SdlGraphicsManager::VideoState *getVideoMode();
+ SurfaceSdlGraphicsManager::MousePos *getMouseCurState();
+ SurfaceSdlGraphicsManager::VideoState *getVideoMode();
virtual void adjustMouseEvent(const Common::Event &event);
};
diff --git a/backends/graphics/gph/gph-graphics.cpp b/backends/graphics/gph/gph-graphics.cpp
index eb748f2fc2..82a32203fb 100644
--- a/backends/graphics/gph/gph-graphics.cpp
+++ b/backends/graphics/gph/gph-graphics.cpp
@@ -36,7 +36,7 @@ static const OSystem::GraphicsMode s_supportedGraphicsModes[] = {
};
GPHGraphicsManager::GPHGraphicsManager(SdlEventSource *sdlEventSource)
- : SdlGraphicsManager(sdlEventSource) {
+ : SurfaceSdlGraphicsManager(sdlEventSource) {
}
const OSystem::GraphicsMode *GPHGraphicsManager::getSupportedGraphicsModes() const {
@@ -443,7 +443,7 @@ void GPHGraphicsManager::showOverlay() {
_mouseCurState.x = _mouseCurState.x / 2;
_mouseCurState.y = _mouseCurState.y / 2;
}
- SdlGraphicsManager::showOverlay();
+ SurfaceSdlGraphicsManager::showOverlay();
}
void GPHGraphicsManager::hideOverlay() {
@@ -451,7 +451,7 @@ void GPHGraphicsManager::hideOverlay() {
_mouseCurState.x = _mouseCurState.x * 2;
_mouseCurState.y = _mouseCurState.y * 2;
}
- SdlGraphicsManager::hideOverlay();
+ SurfaceSdlGraphicsManager::hideOverlay();
}
@@ -503,7 +503,7 @@ void GPHGraphicsManager::hideOverlay() {
//
// }
-// return SdlGraphicsManager::loadGFXMode();
+// return SurfaceSdlGraphicsManager::loadGFXMode();
//}
bool GPHGraphicsManager::loadGFXMode() {
@@ -531,7 +531,7 @@ bool GPHGraphicsManager::loadGFXMode() {
_videoMode.hardwareWidth = _videoMode.screenWidth * _videoMode.scaleFactor;
_videoMode.hardwareHeight = effectiveScreenHeight();
}
- return SdlGraphicsManager::loadGFXMode();
+ return SurfaceSdlGraphicsManager::loadGFXMode();
}
bool GPHGraphicsManager::hasFeature(OSystem::Feature f) {
@@ -561,11 +561,11 @@ bool GPHGraphicsManager::getFeatureState(OSystem::Feature f) {
}
}
-SdlGraphicsManager::MousePos* GPHGraphicsManager::getMouseCurState() {
+SurfaceSdlGraphicsManager::MousePos *GPHGraphicsManager::getMouseCurState() {
return &_mouseCurState;
}
-SdlGraphicsManager::VideoState* GPHGraphicsManager::getVideoMode() {
+SurfaceSdlGraphicsManager::VideoState *GPHGraphicsManager::getVideoMode() {
return &_videoMode;
}
@@ -576,7 +576,7 @@ void GPHGraphicsManager::warpMouse(int x, int y) {
y = y / 2;
}
}
- SdlGraphicsManager::warpMouse(x, y);
+ SurfaceSdlGraphicsManager::warpMouse(x, y);
}
void GPHGraphicsManager::adjustMouseEvent(const Common::Event &event) {
diff --git a/backends/graphics/gph/gph-graphics.h b/backends/graphics/gph/gph-graphics.h
index fc3dc5730d..45b8618569 100644
--- a/backends/graphics/gph/gph-graphics.h
+++ b/backends/graphics/gph/gph-graphics.h
@@ -23,7 +23,7 @@
#ifndef BACKENDS_GRAPHICS_GPH_H
#define BACKENDS_GRAPHICS_GPH_H
-#include "backends/graphics/sdl/sdl-graphics.h"
+#include "backends/graphics/surfacesdl/surfacesdl-graphics.h"
#include "graphics/scaler/aspect.h" // for aspect2Real
#include "graphics/scaler/downscaler.h"
@@ -31,7 +31,7 @@ enum {
GFX_HALF = 12
};
-class GPHGraphicsManager : public SdlGraphicsManager {
+class GPHGraphicsManager : public SurfaceSdlGraphicsManager {
public:
GPHGraphicsManager(SdlEventSource *boss);
@@ -53,8 +53,8 @@ public:
void undrawMouse();
virtual void warpMouse(int x, int y);
- SdlGraphicsManager::MousePos *getMouseCurState();
- SdlGraphicsManager::VideoState *getVideoMode();
+ SurfaceSdlGraphicsManager::MousePos *getMouseCurState();
+ SurfaceSdlGraphicsManager::VideoState *getVideoMode();
virtual void adjustMouseEvent(const Common::Event &event);
};
diff --git a/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp b/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp
index 42db89ee33..732074b7e2 100644
--- a/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp
+++ b/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp
@@ -46,7 +46,7 @@ static const OSystem::GraphicsMode s_supportedGraphicsModes[] = {
};
LinuxmotoSdlGraphicsManager::LinuxmotoSdlGraphicsManager(SdlEventSource *sdlEventSource)
- : SdlGraphicsManager(sdlEventSource) {
+ : SurfaceSdlGraphicsManager(sdlEventSource) {
}
const OSystem::GraphicsMode *LinuxmotoSdlGraphicsManager::getSupportedGraphicsModes() const {
@@ -166,7 +166,7 @@ bool LinuxmotoSdlGraphicsManager::loadGFXMode() {
_videoMode.hardwareHeight = effectiveScreenHeight();
}
- return SdlGraphicsManager::loadGFXMode();
+ return SurfaceSdlGraphicsManager::loadGFXMode();
}
void LinuxmotoSdlGraphicsManager::drawMouse() {
@@ -457,7 +457,7 @@ void LinuxmotoSdlGraphicsManager::showOverlay() {
_mouseCurState.x = _mouseCurState.x / 2;
_mouseCurState.y = _mouseCurState.y / 2;
}
- SdlGraphicsManager::showOverlay();
+ SurfaceSdlGraphicsManager::showOverlay();
}
void LinuxmotoSdlGraphicsManager::hideOverlay() {
@@ -465,7 +465,7 @@ void LinuxmotoSdlGraphicsManager::hideOverlay() {
_mouseCurState.x = _mouseCurState.x * 2;
_mouseCurState.y = _mouseCurState.y * 2;
}
- SdlGraphicsManager::hideOverlay();
+ SurfaceSdlGraphicsManager::hideOverlay();
}
void LinuxmotoSdlGraphicsManager::warpMouse(int x, int y) {
@@ -475,7 +475,7 @@ void LinuxmotoSdlGraphicsManager::warpMouse(int x, int y) {
y = y / 2;
}
}
- SdlGraphicsManager::warpMouse(x, y);
+ SurfaceSdlGraphicsManager::warpMouse(x, y);
}
void LinuxmotoSdlGraphicsManager::adjustMouseEvent(const Common::Event &event) {
diff --git a/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h b/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h
index c428f00447..938512f323 100644
--- a/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h
+++ b/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h
@@ -23,9 +23,9 @@
#ifndef BACKENDS_GRAPHICS_SDL_LINUXMOTO_H
#define BACKENDS_GRAPHICS_SDL_LINUXMOTO_H
-#include "backends/graphics/sdl/sdl-graphics.h"
+#include "backends/graphics/surfacesdl/surfacesdl-graphics.h"
-class LinuxmotoSdlGraphicsManager : public SdlGraphicsManager {
+class LinuxmotoSdlGraphicsManager : public SurfaceSdlGraphicsManager {
public:
LinuxmotoSdlGraphicsManager(SdlEventSource *sdlEventSource);
diff --git a/backends/graphics/opengl/gltexture.cpp b/backends/graphics/opengl/gltexture.cpp
index 3d1027b44f..b7f5c90105 100644
--- a/backends/graphics/opengl/gltexture.cpp
+++ b/backends/graphics/opengl/gltexture.cpp
@@ -108,7 +108,7 @@ void GLTexture::refresh() {
void GLTexture::allocBuffer(GLuint w, GLuint h) {
_realWidth = w;
_realHeight = h;
-
+
if (w <= _textureWidth && h <= _textureHeight && !_refresh)
// Already allocated a sufficiently large buffer
return;
diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp
index c0551de386..046be4c669 100644
--- a/backends/graphics/opengl/opengl-graphics.cpp
+++ b/backends/graphics/opengl/opengl-graphics.cpp
@@ -179,7 +179,7 @@ bool OpenGLGraphicsManager::setGraphicsMode(int mode) {
}
int OpenGLGraphicsManager::getGraphicsMode() const {
- assert (_transactionMode == kTransactionNone);
+ assert(_transactionMode == kTransactionNone);
return _videoMode.mode;
}
@@ -420,12 +420,12 @@ void OpenGLGraphicsManager::fillScreen(uint32 col) {
}
void OpenGLGraphicsManager::updateScreen() {
- assert (_transactionMode == kTransactionNone);
+ assert(_transactionMode == kTransactionNone);
internUpdateScreen();
}
void OpenGLGraphicsManager::setShakePos(int shakeOffset) {
- assert (_transactionMode == kTransactionNone);
+ assert(_transactionMode == kTransactionNone);
_shakePos = shakeOffset;
}
@@ -440,7 +440,7 @@ void OpenGLGraphicsManager::clearFocusRectangle() {
//
void OpenGLGraphicsManager::showOverlay() {
- assert (_transactionMode == kTransactionNone);
+ assert(_transactionMode == kTransactionNone);
if (_overlayVisible)
return;
@@ -451,7 +451,7 @@ void OpenGLGraphicsManager::showOverlay() {
}
void OpenGLGraphicsManager::hideOverlay() {
- assert (_transactionMode == kTransactionNone);
+ assert(_transactionMode == kTransactionNone);
if (!_overlayVisible)
return;
@@ -483,7 +483,7 @@ void OpenGLGraphicsManager::grabOverlay(OverlayColor *buf, int pitch) {
}
void OpenGLGraphicsManager::copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h) {
- assert (_transactionMode == kTransactionNone);
+ assert(_transactionMode == kTransactionNone);
if (_overlayTexture == NULL)
return;
@@ -642,7 +642,7 @@ void OpenGLGraphicsManager::setMouseCursor(const byte *buf, uint w, uint h, int
void OpenGLGraphicsManager::setCursorPalette(const byte *colors, uint start, uint num) {
assert(colors);
-
+
// Save the cursor palette
memcpy(_cursorPalette + start * 3, colors, num * 3);
@@ -1315,7 +1315,7 @@ bool OpenGLGraphicsManager::notifyEvent(const Common::Event &event) {
bool OpenGLGraphicsManager::saveScreenshot(const char *filename) {
int width = _videoMode.hardwareWidth;
int height = _videoMode.hardwareHeight;
-
+
// A line of a BMP image must have a size divisible by 4.
// We calculate the padding bytes needed here.
// Since we use a 3 byte per pixel mode, we can use width % 4 here, since
@@ -1358,7 +1358,7 @@ bool OpenGLGraphicsManager::saveScreenshot(const char *filename) {
out.writeUint32LE(0);
out.writeUint32LE(0);
out.writeUint32LE(0);
- out.writeUint32LE(0);
+ out.writeUint32LE(0);
// Write pixel data to BMP
out.write(pixels, lineSize * height);
@@ -1413,7 +1413,7 @@ void OpenGLGraphicsManager::updateOSD() {
int dstX = (_osdSurface.w - width) / 2;
int dstY = (_osdSurface.h - height) / 2;
- // Draw a dark gray rect
+ // Draw a dark gray rect (R = 40, G = 40, B = 40)
const uint16 color = 0x294B;
_osdSurface.fillRect(Common::Rect(dstX, dstY, dstX + width, dstY + height), color);
@@ -1423,9 +1423,9 @@ void OpenGLGraphicsManager::updateOSD() {
dstX, dstY + i * lineHeight + vOffset + lineSpacing, width,
0xFFFF, Graphics::kTextAlignCenter);
}
-
+
// Update the texture
- _osdTexture->updateBuffer(_osdSurface.pixels, _osdSurface.pitch, 0, 0,
+ _osdTexture->updateBuffer(_osdSurface.pixels, _osdSurface.pitch, 0, 0,
_osdSurface.w, _osdSurface.h);
}
#endif
diff --git a/backends/graphics/opengl/opengl-graphics.h b/backends/graphics/opengl/opengl-graphics.h
index 463715aad8..56f7d92a12 100644
--- a/backends/graphics/opengl/opengl-graphics.h
+++ b/backends/graphics/opengl/opengl-graphics.h
@@ -185,7 +185,7 @@ protected:
/**
* Set the scale factor.
- *
+ *
* This can only be used in a GFX transaction.
*
* @param newScale New scale factor.
@@ -332,7 +332,7 @@ protected:
GLTexture *_osdTexture;
Graphics::Surface _osdSurface;
uint8 _osdAlpha;
- uint32 _osdFadeStartTime;
+ uint32 _osdFadeStartTime;
bool _requireOSDUpdate;
enum {
kOSDFadeOutDelay = 2 * 1000,
diff --git a/backends/graphics/openglsdl/openglsdl-graphics.cpp b/backends/graphics/openglsdl/openglsdl-graphics.cpp
index 87457c3c08..bd7dd32e3b 100644
--- a/backends/graphics/openglsdl/openglsdl-graphics.cpp
+++ b/backends/graphics/openglsdl/openglsdl-graphics.cpp
@@ -54,6 +54,10 @@ OpenGLSdlGraphicsManager::OpenGLSdlGraphicsManager()
SDL_ShowCursor(SDL_DISABLE);
// Get desktop resolution
+ // TODO: In case the OpenGL manager is created *after* a plain SDL manager
+ // has been used, this will return the last setup graphics mode rather
+ // than the desktop resolution. We should really look into a way to
+ // properly retrieve the desktop resolution.
const SDL_VideoInfo *videoInfo = SDL_GetVideoInfo();
if (videoInfo->current_w > 0 && videoInfo->current_h > 0) {
_desktopWidth = videoInfo->current_w;
@@ -110,16 +114,16 @@ void OpenGLSdlGraphicsManager::detectSupportedFormats() {
// use.
const Graphics::PixelFormat RGBList[] = {
#if defined(ENABLE_32BIT)
- Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0), // RGBA8888
+ Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0), // RGBA8888
#ifndef USE_GLES
Graphics::PixelFormat(4, 8, 8, 8, 8, 16, 8, 0, 24), // ARGB8888
#endif
- Graphics::PixelFormat(3, 8, 8, 8, 0, 16, 8, 0, 0), // RGB888
+ Graphics::PixelFormat(3, 8, 8, 8, 0, 16, 8, 0, 0), // RGB888
#endif
- Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0), // RGB565
- Graphics::PixelFormat(2, 5, 5, 5, 1, 11, 6, 1, 0), // RGB5551
- Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0), // RGB555
- Graphics::PixelFormat(2, 4, 4, 4, 4, 12, 8, 4, 0), // RGBA4444
+ Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0), // RGB565
+ Graphics::PixelFormat(2, 5, 5, 5, 1, 11, 6, 1, 0), // RGB5551
+ Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0), // RGB555
+ Graphics::PixelFormat(2, 4, 4, 4, 4, 12, 8, 4, 0), // RGBA4444
#ifndef USE_GLES
Graphics::PixelFormat(2, 4, 4, 4, 4, 8, 4, 0, 12) // ARGB4444
#endif
@@ -302,7 +306,7 @@ bool OpenGLSdlGraphicsManager::loadGFXMode() {
int screenAspectRatio = _videoMode.screenWidth * 10000 / _videoMode.screenHeight;
int desiredAspectRatio = getAspectRatio();
-
+
// Do not downscale dimensions, only enlarge them if needed
if (screenAspectRatio > desiredAspectRatio)
_videoMode.hardwareHeight = (_videoMode.overlayWidth * 10000 + 5000) / desiredAspectRatio;
@@ -385,7 +389,7 @@ void OpenGLSdlGraphicsManager::internUpdateScreen() {
OpenGLGraphicsManager::internUpdateScreen();
// Swap OpenGL buffers
- SDL_GL_SwapBuffers();
+ SDL_GL_SwapBuffers();
}
#ifdef USE_OSD
@@ -394,27 +398,27 @@ void OpenGLSdlGraphicsManager::displayModeChangedMsg() {
if (newModeName) {
const int scaleFactor = getScale();
- char buffer[128];
- sprintf(buffer, "%s: %s\n%d x %d -> %d x %d",
+ Common::String osdMessage = Common::String::format(
+ "%s: %s\n%d x %d -> %d x %d",
_("Current display mode"),
newModeName,
_videoMode.screenWidth * scaleFactor,
_videoMode.screenHeight * scaleFactor,
_hwscreen->w, _hwscreen->h
);
- displayMessageOnOSD(buffer);
+ displayMessageOnOSD(osdMessage.c_str());
}
}
void OpenGLSdlGraphicsManager::displayScaleChangedMsg() {
- char buffer[128];
const int scaleFactor = getScale();
- sprintf(buffer, "%s: x%d\n%d x %d -> %d x %d",
+ Common::String osdMessage = Common::String::format(
+ "%s: x%d\n%d x %d -> %d x %d",
_("Current scale"),
scaleFactor,
_videoMode.screenWidth, _videoMode.screenHeight,
_videoMode.overlayWidth, _videoMode.overlayHeight
);
- displayMessageOnOSD(buffer);
+ displayMessageOnOSD(osdMessage.c_str());
}
#endif
@@ -450,18 +454,18 @@ void OpenGLSdlGraphicsManager::toggleFullScreen(int loop) {
_ignoreResizeFrames = 10;
#ifdef USE_OSD
- char buffer[128];
+ Common::String osdMessage;
if (getFullscreenMode())
- sprintf(buffer, "%s\n%d x %d",
+ osdMessage = Common::String::format("%s\n%d x %d",
_("Fullscreen mode"),
_hwscreen->w, _hwscreen->h
);
else
- sprintf(buffer, "%s\n%d x %d",
+ osdMessage = Common::String::format("%s\n%d x %d",
_("Windowed mode"),
_hwscreen->w, _hwscreen->h
);
- displayMessageOnOSD(buffer);
+ displayMessageOnOSD(osdMessage.c_str());
#endif
}
@@ -478,19 +482,19 @@ bool OpenGLSdlGraphicsManager::notifyEvent(const Common::Event &event) {
// Alt-S create a screenshot
if (event.kbd.keycode == 's') {
- char filename[20];
+ Common::String filename;
for (int n = 0;; n++) {
SDL_RWops *file;
- sprintf(filename, "scummvm%05d.bmp", n);
- file = SDL_RWFromFile(filename, "r");
+ filename = Common::String::format("scummvm%05d.bmp", n);
+ file = SDL_RWFromFile(filename.c_str(), "r");
if (!file)
break;
SDL_RWclose(file);
}
- if (saveScreenshot(filename))
- debug("Saved screenshot '%s'", filename);
+ if (saveScreenshot(filename.c_str()))
+ debug("Saved screenshot '%s'", filename.c_str());
else
warning("Could not save screenshot");
return true;
@@ -511,18 +515,18 @@ bool OpenGLSdlGraphicsManager::notifyEvent(const Common::Event &event) {
setFeatureState(OSystem::kFeatureAspectRatioCorrection, !getFeatureState(OSystem::kFeatureAspectRatioCorrection));
endGFXTransaction();
#ifdef USE_OSD
- char buffer[128];
+ Common::String osdMessage;
if (getFeatureState(OSystem::kFeatureAspectRatioCorrection))
- sprintf(buffer, "%s\n%d x %d -> %d x %d",
- _("Enabled aspect ratio correction"),
+ osdMessage = Common::String::format("%s\n%d x %d -> %d x %d",
+ _("Enabled aspect ratio correction"),
_videoMode.screenWidth, _videoMode.screenHeight,
_hwscreen->w, _hwscreen->h);
else
- sprintf(buffer, "%s\n%d x %d -> %d x %d",
- _("Disabled aspect ratio correction"),
+ osdMessage = Common::String::format("%s\n%d x %d -> %d x %d",
+ _("Disabled aspect ratio correction"),
_videoMode.screenWidth, _videoMode.screenHeight,
_hwscreen->w, _hwscreen->h);
- displayMessageOnOSD(buffer);
+ displayMessageOnOSD(osdMessage.c_str());
#endif
internUpdateScreen();
return true;
@@ -557,7 +561,7 @@ bool OpenGLSdlGraphicsManager::notifyEvent(const Common::Event &event) {
// Check if the desktop resolution has been detected
if (_desktopWidth > 0 && _desktopHeight > 0)
// If the new scale factor is too big, do not scale
- if (_videoMode.screenWidth * factor > _desktopWidth ||
+ if (_videoMode.screenWidth * factor > _desktopWidth ||
_videoMode.screenHeight * factor > _desktopHeight)
return false;
@@ -607,7 +611,7 @@ bool OpenGLSdlGraphicsManager::notifyEvent(const Common::Event &event) {
break;
case Common::EVENT_KEYUP:
return isHotkey(event);
- // HACK: Handle special SDL event
+ // HACK: Handle special SDL event
// The new screen size is saved on the mouse event as part of HACK,
// there is no common resize event.
case OSystem_SDL::kSdlEventResize:
diff --git a/backends/graphics/openpandora/op-graphics.cpp b/backends/graphics/openpandora/op-graphics.cpp
index c8617635a5..5f0301a0c8 100644
--- a/backends/graphics/openpandora/op-graphics.cpp
+++ b/backends/graphics/openpandora/op-graphics.cpp
@@ -32,7 +32,7 @@
#include "common/textconsole.h"
OPGraphicsManager::OPGraphicsManager(SdlEventSource *sdlEventSource)
- : SdlGraphicsManager(sdlEventSource) {
+ : SurfaceSdlGraphicsManager(sdlEventSource) {
}
bool OPGraphicsManager::loadGFXMode() {
@@ -47,7 +47,7 @@ bool OPGraphicsManager::loadGFXMode() {
if (_videoMode.screenHeight != 200 && _videoMode.screenHeight != 400)
_videoMode.aspectRatioCorrection = false;
- return SdlGraphicsManager::loadGFXMode();
+ return SurfaceSdlGraphicsManager::loadGFXMode();
}
#endif
diff --git a/backends/graphics/openpandora/op-graphics.h b/backends/graphics/openpandora/op-graphics.h
index 4bb89ca1e6..ed26df7475 100644
--- a/backends/graphics/openpandora/op-graphics.h
+++ b/backends/graphics/openpandora/op-graphics.h
@@ -23,7 +23,7 @@
#ifndef BACKENDS_GRAPHICS_OP_H
#define BACKENDS_GRAPHICS_OP_H
-#include "backends/graphics/sdl/sdl-graphics.h"
+#include "backends/graphics/surfacesdl/surfacesdl-graphics.h"
#include "graphics/scaler/aspect.h" // for aspect2Real
#include "graphics/scaler/downscaler.h"
@@ -31,7 +31,7 @@ enum {
GFX_HALF = 12
};
-class OPGraphicsManager : public SdlGraphicsManager {
+class OPGraphicsManager : public SurfaceSdlGraphicsManager {
public:
OPGraphicsManager(SdlEventSource *sdlEventSource);
@@ -53,8 +53,8 @@ public:
// void undrawMouse();
// virtual void warpMouse(int x, int y);
-// SdlGraphicsManager::MousePos *getMouseCurState();
-// SdlGraphicsManager::VideoState *getVideoMode();
+// SurfaceSdlGraphicsManager::MousePos *getMouseCurState();
+// SurfaceSdlGraphicsManager::VideoState *getVideoMode();
// virtual void adjustMouseEvent(const Common::Event &event);
};
diff --git a/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.cpp b/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.cpp
index f6832978a8..95e0875f55 100644
--- a/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.cpp
+++ b/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.cpp
@@ -29,7 +29,7 @@
#include "backends/graphics/samsungtvsdl/samsungtvsdl-graphics.h"
SamsungTVSdlGraphicsManager::SamsungTVSdlGraphicsManager(SdlEventSource *sdlEventSource)
- : SdlGraphicsManager(sdlEventSource) {
+ : SurfaceSdlGraphicsManager(sdlEventSource) {
}
bool SamsungTVSdlGraphicsManager::hasFeature(OSystem::Feature f) {
@@ -41,7 +41,7 @@ bool SamsungTVSdlGraphicsManager::hasFeature(OSystem::Feature f) {
void SamsungTVSdlGraphicsManager::setFeatureState(OSystem::Feature f, bool enable) {
switch (f) {
case OSystem::kFeatureAspectRatioCorrection:
- SdlGraphicsManager::setFeatureState(f, enable);
+ SurfaceSdlGraphicsManager::setFeatureState(f, enable);
break;
default:
break;
@@ -51,7 +51,7 @@ void SamsungTVSdlGraphicsManager::setFeatureState(OSystem::Feature f, bool enabl
bool SamsungTVSdlGraphicsManager::getFeatureState(OSystem::Feature f) {
switch (f) {
case OSystem::kFeatureAspectRatioCorrection:
- return SdlGraphicsManager::getFeatureState(f);
+ return SurfaceSdlGraphicsManager::getFeatureState(f);
default:
return false;
}
diff --git a/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.h b/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.h
index dc65c3a696..2d0ff636f4 100644
--- a/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.h
+++ b/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.h
@@ -25,9 +25,9 @@
#if defined(SAMSUNGTV)
-#include "backends/graphics/sdl/sdl-graphics.h"
+#include "backends/graphics/surfacesdl/surfacesdl-graphics.h"
-class SamsungTVSdlGraphicsManager : public SdlGraphicsManager {
+class SamsungTVSdlGraphicsManager : public SurfaceSdlGraphicsManager {
public:
SamsungTVSdlGraphicsManager(SdlEventSource *sdlEventSource);
diff --git a/backends/graphics/sdl/sdl-graphics.cpp b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
index 9063f55744..66207b6808 100644
--- a/backends/graphics/sdl/sdl-graphics.cpp
+++ b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
@@ -24,7 +24,7 @@
#if defined(SDL_BACKEND)
-#include "backends/graphics/sdl/sdl-graphics.h"
+#include "backends/graphics/surfacesdl/surfacesdl-graphics.h"
#include "backends/events/sdl/sdl-events.h"
#include "backends/platform/sdl/sdl.h"
#include "common/config-manager.h"
@@ -120,7 +120,7 @@ static AspectRatio getDesiredAspectRatio() {
}
#endif
-SdlGraphicsManager::SdlGraphicsManager(SdlEventSource *sdlEventSource)
+SurfaceSdlGraphicsManager::SurfaceSdlGraphicsManager(SdlEventSource *sdlEventSource)
:
_sdlEventSource(sdlEventSource),
#ifdef USE_OSD
@@ -195,7 +195,7 @@ SdlGraphicsManager::SdlGraphicsManager(SdlEventSource *sdlEventSource)
#endif
}
-SdlGraphicsManager::~SdlGraphicsManager() {
+SurfaceSdlGraphicsManager::~SurfaceSdlGraphicsManager() {
// Unregister the event observer
if (g_system->getEventManager()->getEventDispatcher() != NULL)
g_system->getEventManager()->getEventDispatcher()->unregisterObserver(this);
@@ -214,12 +214,12 @@ SdlGraphicsManager::~SdlGraphicsManager() {
free(_mouseData);
}
-void SdlGraphicsManager::initEventObserver() {
+void SurfaceSdlGraphicsManager::initEventObserver() {
// Register the graphics manager as a event observer
g_system->getEventManager()->getEventDispatcher()->registerObserver(this, 10, false);
}
-bool SdlGraphicsManager::hasFeature(OSystem::Feature f) {
+bool SurfaceSdlGraphicsManager::hasFeature(OSystem::Feature f) {
return
(f == OSystem::kFeatureFullscreenMode) ||
(f == OSystem::kFeatureAspectRatioCorrection) ||
@@ -227,7 +227,7 @@ bool SdlGraphicsManager::hasFeature(OSystem::Feature f) {
(f == OSystem::kFeatureIconifyWindow);
}
-void SdlGraphicsManager::setFeatureState(OSystem::Feature f, bool enable) {
+void SurfaceSdlGraphicsManager::setFeatureState(OSystem::Feature f, bool enable) {
switch (f) {
case OSystem::kFeatureFullscreenMode:
setFullscreenMode(enable);
@@ -248,7 +248,7 @@ void SdlGraphicsManager::setFeatureState(OSystem::Feature f, bool enable) {
}
}
-bool SdlGraphicsManager::getFeatureState(OSystem::Feature f) {
+bool SurfaceSdlGraphicsManager::getFeatureState(OSystem::Feature f) {
assert(_transactionMode == kTransactionNone);
switch (f) {
@@ -263,23 +263,23 @@ bool SdlGraphicsManager::getFeatureState(OSystem::Feature f) {
}
}
-const OSystem::GraphicsMode *SdlGraphicsManager::supportedGraphicsModes() {
+const OSystem::GraphicsMode *SurfaceSdlGraphicsManager::supportedGraphicsModes() {
return s_supportedGraphicsModes;
}
-const OSystem::GraphicsMode *SdlGraphicsManager::getSupportedGraphicsModes() const {
+const OSystem::GraphicsMode *SurfaceSdlGraphicsManager::getSupportedGraphicsModes() const {
return s_supportedGraphicsModes;
}
-int SdlGraphicsManager::getDefaultGraphicsMode() const {
+int SurfaceSdlGraphicsManager::getDefaultGraphicsMode() const {
return GFX_DOUBLESIZE;
}
-void SdlGraphicsManager::resetGraphicsScale() {
+void SurfaceSdlGraphicsManager::resetGraphicsScale() {
setGraphicsMode(s_gfxModeSwitchTable[_scalerType][0]);
}
-void SdlGraphicsManager::beginGFXTransaction() {
+void SurfaceSdlGraphicsManager::beginGFXTransaction() {
assert(_transactionMode == kTransactionNone);
_transactionMode = kTransactionActive;
@@ -297,7 +297,7 @@ void SdlGraphicsManager::beginGFXTransaction() {
_oldVideoMode = _videoMode;
}
-OSystem::TransactionError SdlGraphicsManager::endGFXTransaction() {
+OSystem::TransactionError SurfaceSdlGraphicsManager::endGFXTransaction() {
int errors = OSystem::kTransactionSuccess;
assert(_transactionMode != kTransactionNone);
@@ -398,12 +398,12 @@ OSystem::TransactionError SdlGraphicsManager::endGFXTransaction() {
}
#ifdef USE_RGB_COLOR
-Common::List<Graphics::PixelFormat> SdlGraphicsManager::getSupportedFormats() const {
+Common::List<Graphics::PixelFormat> SurfaceSdlGraphicsManager::getSupportedFormats() const {
assert(!_supportedFormats.empty());
return _supportedFormats;
}
-void SdlGraphicsManager::detectSupportedFormats() {
+void SurfaceSdlGraphicsManager::detectSupportedFormats() {
// Clear old list
_supportedFormats.clear();
@@ -487,7 +487,7 @@ void SdlGraphicsManager::detectSupportedFormats() {
}
#endif
-bool SdlGraphicsManager::setGraphicsMode(int mode) {
+bool SurfaceSdlGraphicsManager::setGraphicsMode(int mode) {
Common::StackLock lock(_graphicsMutex);
assert(_transactionMode == kTransactionActive);
@@ -557,7 +557,7 @@ bool SdlGraphicsManager::setGraphicsMode(int mode) {
return true;
}
-void SdlGraphicsManager::setGraphicsModeIntern() {
+void SurfaceSdlGraphicsManager::setGraphicsModeIntern() {
Common::StackLock lock(_graphicsMutex);
ScalerProc *newScalerProc = 0;
@@ -630,12 +630,12 @@ void SdlGraphicsManager::setGraphicsModeIntern() {
blitCursor();
}
-int SdlGraphicsManager::getGraphicsMode() const {
- assert (_transactionMode == kTransactionNone);
+int SurfaceSdlGraphicsManager::getGraphicsMode() const {
+ assert(_transactionMode == kTransactionNone);
return _videoMode.mode;
}
-void SdlGraphicsManager::initSize(uint w, uint h, const Graphics::PixelFormat *format) {
+void SurfaceSdlGraphicsManager::initSize(uint w, uint h, const Graphics::PixelFormat *format) {
assert(_transactionMode == kTransactionActive);
#ifdef USE_RGB_COLOR
@@ -665,7 +665,7 @@ void SdlGraphicsManager::initSize(uint w, uint h, const Graphics::PixelFormat *f
_transactionDetails.sizeChanged = true;
}
-int SdlGraphicsManager::effectiveScreenHeight() const {
+int SurfaceSdlGraphicsManager::effectiveScreenHeight() const {
return _videoMode.scaleFactor *
(_videoMode.aspectRatioCorrection
? real2Aspect(_videoMode.screenHeight)
@@ -713,7 +713,7 @@ static void fixupResolutionForAspectRatio(AspectRatio desiredAspectRatio, int &w
height = bestMode->h;
}
-bool SdlGraphicsManager::loadGFXMode() {
+bool SurfaceSdlGraphicsManager::loadGFXMode() {
_forceFull = true;
#if !defined(__MAEMO__) && !defined(DINGUX) && !defined(GPH_DEVICE) && !defined(LINUXMOTO) && !defined(OPENPANDORA)
@@ -853,7 +853,7 @@ bool SdlGraphicsManager::loadGFXMode() {
return true;
}
-void SdlGraphicsManager::unloadGFXMode() {
+void SurfaceSdlGraphicsManager::unloadGFXMode() {
if (_screen) {
SDL_FreeSurface(_screen);
_screen = NULL;
@@ -888,7 +888,7 @@ void SdlGraphicsManager::unloadGFXMode() {
DestroyScalers();
}
-bool SdlGraphicsManager::hotswapGFXMode() {
+bool SurfaceSdlGraphicsManager::hotswapGFXMode() {
if (!_screen)
return false;
@@ -940,15 +940,15 @@ bool SdlGraphicsManager::hotswapGFXMode() {
return true;
}
-void SdlGraphicsManager::updateScreen() {
- assert (_transactionMode == kTransactionNone);
+void SurfaceSdlGraphicsManager::updateScreen() {
+ assert(_transactionMode == kTransactionNone);
Common::StackLock lock(_graphicsMutex); // Lock the mutex until this function ends
internUpdateScreen();
}
-void SdlGraphicsManager::internUpdateScreen() {
+void SurfaceSdlGraphicsManager::internUpdateScreen() {
SDL_Surface *srcSurf, *origSurf;
int height, width;
ScalerProc *scalerProc;
@@ -1191,14 +1191,14 @@ void SdlGraphicsManager::internUpdateScreen() {
_mouseNeedsRedraw = false;
}
-bool SdlGraphicsManager::saveScreenshot(const char *filename) {
+bool SurfaceSdlGraphicsManager::saveScreenshot(const char *filename) {
assert(_hwscreen != NULL);
Common::StackLock lock(_graphicsMutex); // Lock the mutex until this function ends
return SDL_SaveBMP(_hwscreen, filename) == 0;
}
-void SdlGraphicsManager::setFullscreenMode(bool enable) {
+void SurfaceSdlGraphicsManager::setFullscreenMode(bool enable) {
Common::StackLock lock(_graphicsMutex);
if (_oldVideoMode.setup && _oldVideoMode.fullscreen == enable)
@@ -1210,7 +1210,7 @@ void SdlGraphicsManager::setFullscreenMode(bool enable) {
}
}
-void SdlGraphicsManager::setAspectRatioCorrection(bool enable) {
+void SurfaceSdlGraphicsManager::setAspectRatioCorrection(bool enable) {
Common::StackLock lock(_graphicsMutex);
if (_oldVideoMode.setup && _oldVideoMode.aspectRatioCorrection == enable)
@@ -1222,12 +1222,12 @@ void SdlGraphicsManager::setAspectRatioCorrection(bool enable) {
}
}
-void SdlGraphicsManager::copyRectToScreen(const byte *src, int pitch, int x, int y, int w, int h) {
- assert (_transactionMode == kTransactionNone);
+void SurfaceSdlGraphicsManager::copyRectToScreen(const byte *src, int pitch, int x, int y, int w, int h) {
+ assert(_transactionMode == kTransactionNone);
assert(src);
if (_screen == NULL) {
- warning("SdlGraphicsManager::copyRectToScreen: _screen == NULL");
+ warning("SurfaceSdlGraphicsManager::copyRectToScreen: _screen == NULL");
return;
}
@@ -1272,8 +1272,8 @@ void SdlGraphicsManager::copyRectToScreen(const byte *src, int pitch, int x, int
SDL_UnlockSurface(_screen);
}
-Graphics::Surface *SdlGraphicsManager::lockScreen() {
- assert (_transactionMode == kTransactionNone);
+Graphics::Surface *SurfaceSdlGraphicsManager::lockScreen() {
+ assert(_transactionMode == kTransactionNone);
// Lock the graphics mutex
g_system->lockMutex(_graphicsMutex);
@@ -1299,8 +1299,8 @@ Graphics::Surface *SdlGraphicsManager::lockScreen() {
return &_framebuffer;
}
-void SdlGraphicsManager::unlockScreen() {
- assert (_transactionMode == kTransactionNone);
+void SurfaceSdlGraphicsManager::unlockScreen() {
+ assert(_transactionMode == kTransactionNone);
// paranoia check
assert(_screenIsLocked);
@@ -1316,14 +1316,14 @@ void SdlGraphicsManager::unlockScreen() {
g_system->unlockMutex(_graphicsMutex);
}
-void SdlGraphicsManager::fillScreen(uint32 col) {
+void SurfaceSdlGraphicsManager::fillScreen(uint32 col) {
Graphics::Surface *screen = lockScreen();
if (screen && screen->pixels)
memset(screen->pixels, col, screen->h * screen->pitch);
unlockScreen();
}
-void SdlGraphicsManager::addDirtyRect(int x, int y, int w, int h, bool realCoordinates) {
+void SurfaceSdlGraphicsManager::addDirtyRect(int x, int y, int w, int h, bool realCoordinates) {
if (_forceFull)
return;
@@ -1391,15 +1391,15 @@ void SdlGraphicsManager::addDirtyRect(int x, int y, int w, int h, bool realCoord
}
}
-int16 SdlGraphicsManager::getHeight() {
+int16 SurfaceSdlGraphicsManager::getHeight() {
return _videoMode.screenHeight;
}
-int16 SdlGraphicsManager::getWidth() {
+int16 SurfaceSdlGraphicsManager::getWidth() {
return _videoMode.screenWidth;
}
-void SdlGraphicsManager::setPalette(const byte *colors, uint start, uint num) {
+void SurfaceSdlGraphicsManager::setPalette(const byte *colors, uint start, uint num) {
assert(colors);
#ifdef USE_RGB_COLOR
@@ -1411,7 +1411,7 @@ void SdlGraphicsManager::setPalette(const byte *colors, uint start, uint num) {
// But it could indicate a programming error, so let's warn about it.
if (!_screen)
- warning("SdlGraphicsManager::setPalette: _screen == NULL");
+ warning("SurfaceSdlGraphicsManager::setPalette: _screen == NULL");
const byte *b = colors;
uint i;
@@ -1433,7 +1433,7 @@ void SdlGraphicsManager::setPalette(const byte *colors, uint start, uint num) {
blitCursor();
}
-void SdlGraphicsManager::grabPalette(byte *colors, uint start, uint num) {
+void SurfaceSdlGraphicsManager::grabPalette(byte *colors, uint start, uint num) {
assert(colors);
#ifdef USE_RGB_COLOR
@@ -1449,7 +1449,7 @@ void SdlGraphicsManager::grabPalette(byte *colors, uint start, uint num) {
}
}
-void SdlGraphicsManager::setCursorPalette(const byte *colors, uint start, uint num) {
+void SurfaceSdlGraphicsManager::setCursorPalette(const byte *colors, uint start, uint num) {
assert(colors);
const byte *b = colors;
uint i;
@@ -1464,13 +1464,13 @@ void SdlGraphicsManager::setCursorPalette(const byte *colors, uint start, uint n
blitCursor();
}
-void SdlGraphicsManager::setShakePos(int shake_pos) {
- assert (_transactionMode == kTransactionNone);
+void SurfaceSdlGraphicsManager::setShakePos(int shake_pos) {
+ assert(_transactionMode == kTransactionNone);
_newShakePos = shake_pos;
}
-void SdlGraphicsManager::setFocusRectangle(const Common::Rect &rect) {
+void SurfaceSdlGraphicsManager::setFocusRectangle(const Common::Rect &rect) {
#ifdef USE_SDL_DEBUG_FOCUSRECT
// Only enable focus rectangle debug code, when the user wants it
if (!_enableFocusRectDebugCode)
@@ -1480,7 +1480,7 @@ void SdlGraphicsManager::setFocusRectangle(const Common::Rect &rect) {
_focusRect = rect;
if (rect.left < 0 || rect.top < 0 || rect.right > _videoMode.screenWidth || rect.bottom > _videoMode.screenHeight)
- warning("SdlGraphicsManager::setFocusRectangle: Got a rect which does not fit inside the screen bounds: %d,%d,%d,%d", rect.left, rect.top, rect.right, rect.bottom);
+ warning("SurfaceSdlGraphicsManager::setFocusRectangle: Got a rect which does not fit inside the screen bounds: %d,%d,%d,%d", rect.left, rect.top, rect.right, rect.bottom);
// It's gross but we actually sometimes get rects, which are not inside the screen bounds,
// thus we need to clip the rect here...
@@ -1492,7 +1492,7 @@ void SdlGraphicsManager::setFocusRectangle(const Common::Rect &rect) {
#endif
}
-void SdlGraphicsManager::clearFocusRectangle() {
+void SurfaceSdlGraphicsManager::clearFocusRectangle() {
#ifdef USE_SDL_DEBUG_FOCUSRECT
// Only enable focus rectangle debug code, when the user wants it
if (!_enableFocusRectDebugCode)
@@ -1510,8 +1510,8 @@ void SdlGraphicsManager::clearFocusRectangle() {
#pragma mark --- Overlays ---
#pragma mark -
-void SdlGraphicsManager::showOverlay() {
- assert (_transactionMode == kTransactionNone);
+void SurfaceSdlGraphicsManager::showOverlay() {
+ assert(_transactionMode == kTransactionNone);
int x, y;
@@ -1533,8 +1533,8 @@ void SdlGraphicsManager::showOverlay() {
clearOverlay();
}
-void SdlGraphicsManager::hideOverlay() {
- assert (_transactionMode == kTransactionNone);
+void SurfaceSdlGraphicsManager::hideOverlay() {
+ assert(_transactionMode == kTransactionNone);
if (!_overlayVisible)
return;
@@ -1557,8 +1557,8 @@ void SdlGraphicsManager::hideOverlay() {
_forceFull = true;
}
-void SdlGraphicsManager::clearOverlay() {
- //assert (_transactionMode == kTransactionNone);
+void SurfaceSdlGraphicsManager::clearOverlay() {
+ //assert(_transactionMode == kTransactionNone);
Common::StackLock lock(_graphicsMutex); // Lock the mutex until this function ends
@@ -1590,8 +1590,8 @@ void SdlGraphicsManager::clearOverlay() {
_forceFull = true;
}
-void SdlGraphicsManager::grabOverlay(OverlayColor *buf, int pitch) {
- assert (_transactionMode == kTransactionNone);
+void SurfaceSdlGraphicsManager::grabOverlay(OverlayColor *buf, int pitch) {
+ assert(_transactionMode == kTransactionNone);
if (_overlayscreen == NULL)
return;
@@ -1610,8 +1610,8 @@ void SdlGraphicsManager::grabOverlay(OverlayColor *buf, int pitch) {
SDL_UnlockSurface(_overlayscreen);
}
-void SdlGraphicsManager::copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h) {
- assert (_transactionMode == kTransactionNone);
+void SurfaceSdlGraphicsManager::copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h) {
+ assert(_transactionMode == kTransactionNone);
if (_overlayscreen == NULL)
return;
@@ -1660,7 +1660,7 @@ void SdlGraphicsManager::copyRectToOverlay(const OverlayColor *buf, int pitch, i
#pragma mark --- Mouse ---
#pragma mark -
-bool SdlGraphicsManager::showMouse(bool visible) {
+bool SurfaceSdlGraphicsManager::showMouse(bool visible) {
if (_mouseVisible == visible)
return visible;
@@ -1671,7 +1671,7 @@ bool SdlGraphicsManager::showMouse(bool visible) {
return last;
}
-void SdlGraphicsManager::setMousePos(int x, int y) {
+void SurfaceSdlGraphicsManager::setMousePos(int x, int y) {
if (x != _mouseCurState.x || y != _mouseCurState.y) {
_mouseNeedsRedraw = true;
_mouseCurState.x = x;
@@ -1679,7 +1679,7 @@ void SdlGraphicsManager::setMousePos(int x, int y) {
}
}
-void SdlGraphicsManager::warpMouse(int x, int y) {
+void SurfaceSdlGraphicsManager::warpMouse(int x, int y) {
int y1 = y;
// Don't change actual mouse position, when mouse is outside of our window (in case of windowed mode)
@@ -1708,7 +1708,7 @@ void SdlGraphicsManager::warpMouse(int x, int y) {
}
}
-void SdlGraphicsManager::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format) {
+void SurfaceSdlGraphicsManager::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format) {
#ifdef USE_RGB_COLOR
if (!format)
_cursorFormat = Graphics::PixelFormat::createFormatCLUT8();
@@ -1765,7 +1765,7 @@ void SdlGraphicsManager::setMouseCursor(const byte *buf, uint w, uint h, int hot
blitCursor();
}
-void SdlGraphicsManager::blitCursor() {
+void SurfaceSdlGraphicsManager::blitCursor() {
byte *dstPtr;
const byte *srcPtr = _mouseData;
#ifdef USE_RGB_COLOR
@@ -1956,7 +1956,7 @@ static int cursorStretch200To240(uint8 *buf, uint32 pitch, int width, int height
}
#endif
-void SdlGraphicsManager::undrawMouse() {
+void SurfaceSdlGraphicsManager::undrawMouse() {
const int x = _mouseBackup.x;
const int y = _mouseBackup.y;
@@ -1969,7 +1969,7 @@ void SdlGraphicsManager::undrawMouse() {
addDirtyRect(x, y - _currentShakePos, _mouseBackup.w, _mouseBackup.h);
}
-void SdlGraphicsManager::drawMouse() {
+void SurfaceSdlGraphicsManager::drawMouse() {
if (!_mouseVisible || !_mouseSurface) {
_mouseBackup.x = _mouseBackup.y = _mouseBackup.w = _mouseBackup.h = 0;
return;
@@ -2036,8 +2036,8 @@ void SdlGraphicsManager::drawMouse() {
#pragma mark -
#ifdef USE_OSD
-void SdlGraphicsManager::displayMessageOnOSD(const char *msg) {
- assert (_transactionMode == kTransactionNone);
+void SurfaceSdlGraphicsManager::displayMessageOnOSD(const char *msg) {
+ assert(_transactionMode == kTransactionNone);
assert(msg);
Common::StackLock lock(_graphicsMutex); // Lock the mutex until this function ends
@@ -2123,7 +2123,7 @@ void SdlGraphicsManager::displayMessageOnOSD(const char *msg) {
}
#endif
-bool SdlGraphicsManager::handleScalerHotkeys(Common::KeyCode key) {
+bool SurfaceSdlGraphicsManager::handleScalerHotkeys(Common::KeyCode key) {
// Ctrl-Alt-a toggles aspect ratio correction
if (key == 'a') {
@@ -2212,7 +2212,7 @@ bool SdlGraphicsManager::handleScalerHotkeys(Common::KeyCode key) {
}
}
-bool SdlGraphicsManager::isScalerHotkey(const Common::Event &event) {
+bool SurfaceSdlGraphicsManager::isScalerHotkey(const Common::Event &event) {
if ((event.kbd.flags & (Common::KBD_CTRL|Common::KBD_ALT)) == (Common::KBD_CTRL|Common::KBD_ALT)) {
const bool isNormalNumber = (Common::KEYCODE_1 <= event.kbd.keycode && event.kbd.keycode <= Common::KEYCODE_9);
const bool isKeypadNumber = (Common::KEYCODE_KP1 <= event.kbd.keycode && event.kbd.keycode <= Common::KEYCODE_KP9);
@@ -2229,7 +2229,7 @@ bool SdlGraphicsManager::isScalerHotkey(const Common::Event &event) {
return false;
}
-void SdlGraphicsManager::adjustMouseEvent(const Common::Event &event) {
+void SurfaceSdlGraphicsManager::adjustMouseEvent(const Common::Event &event) {
if (!event.synthetic) {
Common::Event newEvent(event);
newEvent.synthetic = true;
@@ -2243,7 +2243,7 @@ void SdlGraphicsManager::adjustMouseEvent(const Common::Event &event) {
}
}
-void SdlGraphicsManager::toggleFullScreen() {
+void SurfaceSdlGraphicsManager::toggleFullScreen() {
beginGFXTransaction();
setFullscreenMode(!_videoMode.fullscreen);
endGFXTransaction();
@@ -2255,7 +2255,7 @@ void SdlGraphicsManager::toggleFullScreen() {
#endif
}
-bool SdlGraphicsManager::notifyEvent(const Common::Event &event) {
+bool SurfaceSdlGraphicsManager::notifyEvent(const Common::Event &event) {
switch ((int)event.type) {
case Common::EVENT_KEYDOWN:
// Alt-Return and Alt-Enter toggle full screen mode
diff --git a/backends/graphics/sdl/sdl-graphics.h b/backends/graphics/surfacesdl/surfacesdl-graphics.h
index 9627ab23a3..cd8710d443 100644
--- a/backends/graphics/sdl/sdl-graphics.h
+++ b/backends/graphics/surfacesdl/surfacesdl-graphics.h
@@ -20,8 +20,8 @@
*
*/
-#ifndef BACKENDS_GRAPHICS_SDL_H
-#define BACKENDS_GRAPHICS_SDL_H
+#ifndef BACKENDS_GRAPHICS_SURFACESDL_GRAPHICS_H
+#define BACKENDS_GRAPHICS_SURFACESDL_GRAPHICS_H
#include "backends/graphics/graphics.h"
#include "graphics/pixelformat.h"
@@ -74,10 +74,10 @@ public:
/**
* SDL graphics manager
*/
-class SdlGraphicsManager : public GraphicsManager, public Common::EventObserver {
+class SurfaceSdlGraphicsManager : public GraphicsManager, public Common::EventObserver {
public:
- SdlGraphicsManager(SdlEventSource *sdlEventSource);
- virtual ~SdlGraphicsManager();
+ SurfaceSdlGraphicsManager(SdlEventSource *sdlEventSource);
+ virtual ~SurfaceSdlGraphicsManager();
virtual void initEventObserver();
@@ -100,7 +100,7 @@ public:
virtual void beginGFXTransaction();
virtual OSystem::TransactionError endGFXTransaction();
-
+
virtual int16 getHeight();
virtual int16 getWidth();
@@ -132,7 +132,7 @@ public:
virtual void warpMouse(int x, int y);
virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int cursorTargetScale = 1, const Graphics::PixelFormat *format = NULL);
virtual void setCursorPalette(const byte *colors, uint start, uint num);
-
+
#ifdef USE_OSD
virtual void displayMessageOnOSD(const char *msg);
#endif
@@ -149,7 +149,7 @@ protected:
/** Transparency level of the OSD */
uint8 _osdAlpha;
/** When to start the fade out */
- uint32 _osdFadeStartTime;
+ uint32 _osdFadeStartTime;
/** Enum with OSD options */
enum {
kOSDFadeOutDelay = 2 * 1000, /** < Delay before the OSD is faded out (in milliseconds) */
diff --git a/backends/graphics/symbiansdl/symbiansdl-graphics.cpp b/backends/graphics/symbiansdl/symbiansdl-graphics.cpp
index a88c8a8ffe..4a9a219641 100644
--- a/backends/graphics/symbiansdl/symbiansdl-graphics.cpp
+++ b/backends/graphics/symbiansdl/symbiansdl-graphics.cpp
@@ -28,7 +28,7 @@
#include "backends/platform/symbian/src/SymbianActions.h"
SymbianSdlGraphicsManager::SymbianSdlGraphicsManager(SdlEventSource *sdlEventSource)
- : SdlGraphicsManager(sdlEventSource) {
+ : SurfaceSdlGraphicsManager(sdlEventSource) {
}
int SymbianSdlGraphicsManager::getDefaultGraphicsMode() const {
@@ -47,7 +47,7 @@ const OSystem::GraphicsMode *SymbianSdlGraphicsManager::getSupportedGraphicsMode
// make sure we always go to normal, even if the string might be set wrong!
bool SymbianSdlGraphicsManager::setGraphicsMode(int /*name*/) {
// let parent OSystem_SDL handle it
- return SdlGraphicsManager::setGraphicsMode(getDefaultGraphicsMode());
+ return SurfaceSdlGraphicsManager::setGraphicsMode(getDefaultGraphicsMode());
}
bool SymbianSdlGraphicsManager::hasFeature(OSystem::Feature f) {
@@ -72,7 +72,7 @@ void SymbianSdlGraphicsManager::setFeatureState(OSystem::Feature f, bool enable)
GUI::Actions::Instance()->beginMapping(enable);
break;
default:
- SdlGraphicsManager::setFeatureState(f, enable);
+ SurfaceSdlGraphicsManager::setFeatureState(f, enable);
}
}
diff --git a/backends/graphics/symbiansdl/symbiansdl-graphics.h b/backends/graphics/symbiansdl/symbiansdl-graphics.h
index 1bad32a9b6..404ca87a0a 100644
--- a/backends/graphics/symbiansdl/symbiansdl-graphics.h
+++ b/backends/graphics/symbiansdl/symbiansdl-graphics.h
@@ -23,9 +23,9 @@
#ifndef BACKENDS_GRAPHICS_SYMBIAN_SDL_H
#define BACKENDS_GRAPHICS_SYMBIAN_SDL_H
-#include "backends/graphics/sdl/sdl-graphics.h"
+#include "backends/graphics/surfacesdl/surfacesdl-graphics.h"
-class SymbianSdlGraphicsManager : public SdlGraphicsManager {
+class SymbianSdlGraphicsManager : public SurfaceSdlGraphicsManager {
public:
SymbianSdlGraphicsManager(SdlEventSource *sdlEventSource);
diff --git a/backends/graphics/wincesdl/wincesdl-graphics.cpp b/backends/graphics/wincesdl/wincesdl-graphics.cpp
index 8ba7b5821d..f9f963dc70 100644
--- a/backends/graphics/wincesdl/wincesdl-graphics.cpp
+++ b/backends/graphics/wincesdl/wincesdl-graphics.cpp
@@ -43,7 +43,7 @@
#include "backends/platform/wince/CEgui/ItemAction.h"
WINCESdlGraphicsManager::WINCESdlGraphicsManager(SdlEventSource *sdlEventSource)
- : SdlGraphicsManager(sdlEventSource),
+ : SurfaceSdlGraphicsManager(sdlEventSource),
_panelInitialized(false), _noDoubleTapRMB(false),
_toolbarHighDrawn(false), _newOrientation(0), _orientationLandscape(0),
_panelVisible(true), _saveActiveToolbar(NAME_MAIN_PANEL), _panelStateForced(false),
@@ -149,7 +149,7 @@ void WINCESdlGraphicsManager::setFeatureState(OSystem::Feature f, bool enable) {
return;
default:
- SdlGraphicsManager::setFeatureState(f, enable);
+ SurfaceSdlGraphicsManager::setFeatureState(f, enable);
}
}
@@ -160,7 +160,7 @@ bool WINCESdlGraphicsManager::getFeatureState(OSystem::Feature f) {
case OSystem::kFeatureVirtualKeyboard:
return (_panelStateForced);
default:
- return SdlGraphicsManager::getFeatureState(f);
+ return SurfaceSdlGraphicsManager::getFeatureState(f);
}
}
@@ -204,7 +204,7 @@ void WINCESdlGraphicsManager::initSize(uint w, uint h, const Graphics::PixelForm
_videoMode.overlayWidth = w;
_videoMode.overlayHeight = h;
- SdlGraphicsManager::initSize(w, h, format);
+ SurfaceSdlGraphicsManager::initSize(w, h, format);
if (_scalersChanged) {
unloadGFXMode();
@@ -1185,7 +1185,7 @@ void WINCESdlGraphicsManager::setMousePos(int x, int y) {
Graphics::Surface *WINCESdlGraphicsManager::lockScreen() {
// Make sure mouse pointer is not painted over the playfield at the time of locking
undrawMouse();
- return SdlGraphicsManager::lockScreen();
+ return SurfaceSdlGraphicsManager::lockScreen();
}
void WINCESdlGraphicsManager::showOverlay() {
@@ -1293,7 +1293,7 @@ void WINCESdlGraphicsManager::warpMouse(int x, int y) {
}
void WINCESdlGraphicsManager::unlockScreen() {
- SdlGraphicsManager::unlockScreen();
+ SurfaceSdlGraphicsManager::unlockScreen();
}
void WINCESdlGraphicsManager::internDrawMouse() {
@@ -1468,7 +1468,7 @@ void WINCESdlGraphicsManager::addDirtyRect(int x, int y, int w, int h, bool mous
if (_forceFull || _paletteDirtyEnd)
return;
- SdlGraphicsManager::addDirtyRect(x, y, w, h, false);
+ SurfaceSdlGraphicsManager::addDirtyRect(x, y, w, h, false);
}
void WINCESdlGraphicsManager::swap_panel_visibility() {
diff --git a/backends/graphics/wincesdl/wincesdl-graphics.h b/backends/graphics/wincesdl/wincesdl-graphics.h
index 2727bc0d27..c620082b0c 100644
--- a/backends/graphics/wincesdl/wincesdl-graphics.h
+++ b/backends/graphics/wincesdl/wincesdl-graphics.h
@@ -23,7 +23,7 @@
#ifndef BACKENDS_GRAPHICS_WINCE_SDL_H
#define BACKENDS_GRAPHICS_WINCE_SDL_H
-#include "backends/graphics/sdl/sdl-graphics.h"
+#include "backends/graphics/surfacesdl/surfacesdl-graphics.h"
#include "backends/platform/wince/CEgui/CEGUI.h"
// Internal GUI names
@@ -39,7 +39,7 @@
extern bool _hasSmartphoneResolution;
-class WINCESdlGraphicsManager : public SdlGraphicsManager {
+class WINCESdlGraphicsManager : public SurfaceSdlGraphicsManager {
public:
WINCESdlGraphicsManager(SdlEventSource *sdlEventSource);
diff --git a/backends/mixer/doublebuffersdl/doublebuffersdl-mixer.cpp b/backends/mixer/doublebuffersdl/doublebuffersdl-mixer.cpp
index 001389b1c0..3e5b9940e0 100644
--- a/backends/mixer/doublebuffersdl/doublebuffersdl-mixer.cpp
+++ b/backends/mixer/doublebuffersdl/doublebuffersdl-mixer.cpp
@@ -28,7 +28,7 @@ DoubleBufferSDLMixerManager::DoubleBufferSDLMixerManager()
:
_soundMutex(0), _soundCond(0), _soundThread(0),
_soundThreadIsRunning(false), _soundThreadShouldQuit(false) {
-
+
}
DoubleBufferSDLMixerManager::~DoubleBufferSDLMixerManager() {
diff --git a/backends/mixer/sdl/sdl-mixer.cpp b/backends/mixer/sdl/sdl-mixer.cpp
index f0b0885dd7..001309a777 100644
--- a/backends/mixer/sdl/sdl-mixer.cpp
+++ b/backends/mixer/sdl/sdl-mixer.cpp
@@ -70,7 +70,7 @@ void SdlMixerManager::init() {
warning("Could not open audio device: %s", SDL_GetError());
_mixer = new Audio::MixerImpl(g_system, desired.freq);
- assert(_mixer);
+ assert(_mixer);
_mixer->setReady(false);
} else {
debug(1, "Output sample rate: %d Hz", _obtained.freq);
@@ -84,8 +84,12 @@ void SdlMixerManager::init() {
if (_obtained.format != desired.format)
warning("SDL mixer sound format: %d differs from desired: %d", _obtained.format, desired.format);
+#ifndef __SYMBIAN32__
+ // The SymbianSdlMixerManager does stereo->mono downmixing,
+ // but otherwise we require stereo output.
if (_obtained.channels != 2)
error("SDL mixer output requires stereo output device");
+#endif
_mixer = new Audio::MixerImpl(g_system, _obtained.freq);
assert(_mixer);
diff --git a/backends/mixer/sdl/sdl-mixer.h b/backends/mixer/sdl/sdl-mixer.h
index 82ffa4f901..6fee26bd1f 100644
--- a/backends/mixer/sdl/sdl-mixer.h
+++ b/backends/mixer/sdl/sdl-mixer.h
@@ -73,7 +73,7 @@ protected:
bool _audioSuspended;
/**
- * Returns the desired audio specification
+ * Returns the desired audio specification
*/
virtual SDL_AudioSpec getAudioSpec(uint32 rate);
diff --git a/backends/modular-backend.h b/backends/modular-backend.h
index 3593130bf5..b864da0df5 100644
--- a/backends/modular-backend.h
+++ b/backends/modular-backend.h
@@ -30,17 +30,17 @@ class MutexManager;
/**
* Base class for modular backends.
- *
+ *
* It wraps most functions to their manager equivalent, but not
* all OSystem functions are implemented here.
- *
+ *
* A backend derivated from this class, will need to implement
* these functions on its own:
* OSystem::pollEvent()
* OSystem::getMillis()
* OSystem::delayMillis()
* OSystem::getTimeAndDate()
- *
+ *
* And, it should also initialize all the managers variables
* declared in this class, or override their related functions.
*/
@@ -107,11 +107,11 @@ public:
/** @name Events and Time */
//@{
-
+
virtual Common::HardwareKeySet *getHardwareKeySet() { return 0; }
//@}
-
+
/** @name Mutex handling */
//@{
diff --git a/backends/module.mk b/backends/module.mk
index 9869587a51..e568002d40 100644
--- a/backends/module.mk
+++ b/backends/module.mk
@@ -62,7 +62,7 @@ ifdef SDL_BACKEND
MODULE_OBJS += \
audiocd/sdl/sdl-audiocd.o \
events/sdl/sdl-events.o \
- graphics/sdl/sdl-graphics.o \
+ graphics/surfacesdl/surfacesdl-graphics.o \
mixer/doublebuffersdl/doublebuffersdl-mixer.o \
mixer/sdl/sdl-mixer.o \
mutex/sdl/sdl-mutex.o \
diff --git a/backends/platform/android/android.cpp b/backends/platform/android/android.cpp
index 90660cf82c..17c7d4f9cb 100644
--- a/backends/platform/android/android.cpp
+++ b/backends/platform/android/android.cpp
@@ -423,7 +423,7 @@ void OSystem_Android::setFeatureState(Feature f, bool enable) {
showVirtualKeyboard(enable);
break;
case kFeatureCursorPalette:
- _use_mouse_palette = !enable;
+ _use_mouse_palette = enable;
if (!enable)
disableCursorPalette();
break;
diff --git a/backends/platform/dc/dcmain.cpp b/backends/platform/dc/dcmain.cpp
index 3faf0185ad..06738a687d 100644
--- a/backends/platform/dc/dcmain.cpp
+++ b/backends/platform/dc/dcmain.cpp
@@ -234,7 +234,7 @@ void OSystem_Dreamcast::logMessage(LogMessageType::Type type, const char *messag
namespace DC_Flash {
static int syscall_info_flash(int sect, int *info)
{
- return (*(int (**)(int, void*, int, int))0x8c0000b8)(sect,info,0,0);
+ return (*(int (**)(int, void*, int, int))0x8c0000b8)(sect,info,0,0);
}
static int syscall_read_flash(int offs, void *buf, int cnt)
@@ -255,24 +255,24 @@ namespace DC_Flash {
}
return (unsigned short)~n;
}
-
+
static int flash_read_sector(int partition, int sec, unsigned char *dst)
{
int s, r, n, b, bmb, got=0;
int info[2];
char buf[64];
char bm[64];
-
+
if((r = syscall_info_flash(partition, info))<0)
return r;
-
+
if((r = syscall_read_flash(info[0], buf, 64))<0)
return r;
-
+
if(memcmp(buf, "KATANA_FLASH", 12) ||
buf[16] != partition || buf[17] != 0)
return -2;
-
+
n = (info[1]>>6)-1-((info[1] + 0x7fff)>>15);
bmb = n+1;
for(b = 0; b < n; b++) {
diff --git a/backends/platform/dc/plugins.cpp b/backends/platform/dc/plugins.cpp
index fff3c147ec..2942a4f155 100644
--- a/backends/platform/dc/plugins.cpp
+++ b/backends/platform/dc/plugins.cpp
@@ -51,7 +51,7 @@ static void drawPluginProgress(const Common::String &filename)
ta_begin_frame();
draw_solid_quad(80.0, 270.0, 560.0, 300.0,
0xff808080, 0xff808080, 0xff808080, 0xff808080);
- draw_solid_quad(85.0, 275.0, 555.0, 295.0,
+ draw_solid_quad(85.0, 275.0, 555.0, 295.0,
0xff202020, 0xff202020, 0xff202020, 0xff202020);
draw_solid_quad(85.0, 275.0, 85.0+470.0*ffree, 295.0,
fcol, fcol, fcol, fcol);
diff --git a/backends/platform/dingux/dingux.cpp b/backends/platform/dingux/dingux.cpp
index 1af53aeae1..674c2ea780 100644
--- a/backends/platform/dingux/dingux.cpp
+++ b/backends/platform/dingux/dingux.cpp
@@ -33,7 +33,7 @@ void OSystem_SDL_Dingux::initBackend() {
// Create the graphics manager
if (_graphicsManager == 0) {
- _graphicsManager = new DINGUXSdlGraphicsManager(_eventSource);
+ _graphicsManager = new DINGUXSdlGraphicsManager(_eventSource);
}
// Call parent implementation of this method
diff --git a/backends/platform/ds/arm9/source/gbampsave.cpp b/backends/platform/ds/arm9/source/gbampsave.cpp
index db9b1c2609..03729c5e6e 100644
--- a/backends/platform/ds/arm9/source/gbampsave.cpp
+++ b/backends/platform/ds/arm9/source/gbampsave.cpp
@@ -52,7 +52,7 @@ Common::OutSaveFile *GBAMPSaveFileManager::openForSaving(const Common::String &f
fileSpec += filename;
// consolePrintf("Opening the file: %s\n", fileSpec.c_str());
-
+
Common::WriteStream *stream = DS::DSFileStream::makeFromPath(fileSpec, true);
// Use a write buffer
stream = Common::wrapBufferedWriteStream(stream, SAVE_BUFFER_SIZE);
@@ -66,7 +66,7 @@ Common::InSaveFile *GBAMPSaveFileManager::openForLoading(const Common::String &f
fileSpec += filename;
// consolePrintf("Opening the file: %s\n", fileSpec.c_str());
-
+
return DS::DSFileStream::makeFromPath(fileSpec, false);
}
diff --git a/backends/platform/iphone/osys_main.cpp b/backends/platform/iphone/osys_main.cpp
index 9325ed50bf..4bc567c39d 100644
--- a/backends/platform/iphone/osys_main.cpp
+++ b/backends/platform/iphone/osys_main.cpp
@@ -242,6 +242,18 @@ void OSystem_IPHONE::addSysArchivesToSearchSet(Common::SearchSet &s, int priorit
}
}
+void OSystem_IPHONE::logMessage(LogMessageType::Type type, const char *message) {
+ FILE *output = 0;
+
+ if (type == LogMessageType::kInfo || type == LogMessageType::kDebug)
+ output = stdout;
+ else
+ output = stderr;
+
+ fputs(message, output);
+ fflush(output);
+}
+
void iphone_main(int argc, char *argv[]) {
//OSystem_IPHONE::migrateApp();
diff --git a/backends/platform/iphone/osys_main.h b/backends/platform/iphone/osys_main.h
index 14325f8090..37896cceeb 100644
--- a/backends/platform/iphone/osys_main.h
+++ b/backends/platform/iphone/osys_main.h
@@ -180,6 +180,8 @@ public:
virtual Common::String getDefaultConfigFileName();
+ virtual void logMessage(LogMessageType::Type type, const char *message);
+
protected:
void internUpdateScreen();
void dirtyFullScreen();
diff --git a/backends/platform/n64/osys_n64.h b/backends/platform/n64/osys_n64.h
index dfa8f58cce..354f25a1cf 100644
--- a/backends/platform/n64/osys_n64.h
+++ b/backends/platform/n64/osys_n64.h
@@ -107,7 +107,7 @@ protected:
// FIXME: This must be left as "int" for now, to fix the sign-comparison problem
// there is a little more work involved than an int->uint change
int _cursorWidth, _cursorHeight;
-
+
int _cursorKeycolor;
uint16 _overlayHeight, _overlayWidth;
@@ -199,6 +199,7 @@ public:
virtual Audio::Mixer *getMixer();
virtual void getTimeAndDate(TimeDate &t) const;
virtual void setTimerCallback(TimerProc callback, int interval);
+ virtual void logMessage(LogMessageType::Type type, const char *message);
void rebuildOffscreenGameBuffer(void);
void rebuildOffscreenMouseBuffer(void);
diff --git a/backends/platform/n64/osys_n64_base.cpp b/backends/platform/n64/osys_n64_base.cpp
index 69e8da3526..4bc3780fe2 100644
--- a/backends/platform/n64/osys_n64_base.cpp
+++ b/backends/platform/n64/osys_n64_base.cpp
@@ -870,6 +870,18 @@ void OSystem_N64::getTimeAndDate(TimeDate &t) const {
return;
}
+void OSystem_N64::logMessage(LogMessageType::Type type, const char *message) {
+ FILE *output = 0;
+
+ if (type == LogMessageType::kInfo || type == LogMessageType::kDebug)
+ output = stdout;
+ else
+ output = stderr;
+
+ fputs(message, output);
+ fflush(output);
+}
+
void OSystem_N64::setTimerCallback(TimerProc callback, int interval) {
assert (interval > 0);
diff --git a/backends/platform/n64/osys_n64_events.cpp b/backends/platform/n64/osys_n64_events.cpp
index 2645cfea2a..62f11aef64 100644
--- a/backends/platform/n64/osys_n64_events.cpp
+++ b/backends/platform/n64/osys_n64_events.cpp
@@ -162,7 +162,7 @@ bool OSystem_N64::pollEvent(Common::Event &event) {
uint16 newButtons = 0;
if (_controllerPort >= 0)
newButtons = _ctrlData.c[_controllerPort].buttons; // Read from controller
-
+
uint16 newMouseButtons = 0;
if (_mousePort >= 0)
newMouseButtons = _ctrlData.c[_mousePort].buttons;
diff --git a/backends/platform/null/null.cpp b/backends/platform/null/null.cpp
index 106cde1699..4690a67c55 100644
--- a/backends/platform/null/null.cpp
+++ b/backends/platform/null/null.cpp
@@ -52,6 +52,8 @@ public:
virtual uint32 getMillis();
virtual void delayMillis(uint msecs);
virtual void getTimeAndDate(TimeDate &t) const {}
+
+ virtual void logMessage(LogMessageType::Type type, const char *message);
};
OSystem_NULL::OSystem_NULL() {
@@ -97,6 +99,18 @@ uint32 OSystem_NULL::getMillis() {
void OSystem_NULL::delayMillis(uint msecs) {
}
+void OSystem_NULL::logMessage(LogMessageType::Type type, const char *message) {
+ FILE *output = 0;
+
+ if (type == LogMessageType::kInfo || type == LogMessageType::kDebug)
+ output = stdout;
+ else
+ output = stderr;
+
+ fputs(message, output);
+ fflush(output);
+}
+
OSystem *OSystem_NULL_create() {
return new OSystem_NULL();
}
diff --git a/backends/platform/psp/cursor.cpp b/backends/platform/psp/cursor.cpp
index 18a61f3df4..b295507de1 100644
--- a/backends/platform/psp/cursor.cpp
+++ b/backends/platform/psp/cursor.cpp
@@ -324,18 +324,18 @@ inline void Cursor::setRendererModePalettized(bool palettized) {
_renderer.setAlphaReverse(false);
_renderer.setColorTest(false);
} else { // 16 bits, no palette
- // Color test is an easy way for the hardware to make our keycolor
+ // Color test is an easy way for the hardware to make our keycolor
// transparent.
- _renderer.setColorTest(true);
-
+ _renderer.setColorTest(true);
+
// Alpha blending is not strictly required, but makes the cursor look
// much better
_renderer.setAlphaBlending(true);
-
+
// Pixel formats without alpha (5650) are considered to have their alpha set.
// Since pixel formats with alpha don't have their alpha bits set, we reverse
// the alpha format for them so that 0 alpha is 1.
- if (_buffer.getPixelFormat() != PSPPixelFormat::Type_5650)
+ if (_buffer.getPixelFormat() != PSPPixelFormat::Type_5650)
_renderer.setAlphaReverse(true);
else
_renderer.setAlphaReverse(false);
diff --git a/backends/platform/psp/display_client.cpp b/backends/platform/psp/display_client.cpp
index 14b96d9cae..bc29166895 100644
--- a/backends/platform/psp/display_client.cpp
+++ b/backends/platform/psp/display_client.cpp
@@ -389,31 +389,31 @@ void Buffer::copyToArray(byte *dst, int pitch) {
void Buffer::setSize(uint32 width, uint32 height, HowToSize textureOrSource/*=kSizeByTextureSize*/) {
DEBUG_ENTER_FUNC();
-
+
// We can size the buffer either by texture size (multiple of 2^n) or source size.
// At higher sizes, increasing the texture size to 2^n is a waste of space. At these sizes kSizeBySourceSize should be used.
-
+
_sourceSize.width = width;
_sourceSize.height = height;
_textureSize.width = scaleUpToPowerOfTwo(width); // can only scale up to 512
_textureSize.height = scaleUpToPowerOfTwo(height);
-
+
if (textureOrSource == kSizeByTextureSize) {
_width = _textureSize.width;
_height = _textureSize.height;
} else { // sizeBySourceSize
_width = _sourceSize.width;
_height = _sourceSize.height;
-
- // adjust allocated width to be divisible by 32.
+
+ // adjust allocated width to be divisible by 32.
// The GU can only handle multiples of 16 bytes. A 4 bit image x 32 will give us 16 bytes
// We don't necessarily know the depth of the pixels here. So just make it divisible by 32.
uint32 checkDiv = _width & 31;
if (checkDiv)
_width += 32 - checkDiv;
}
-
+
PSP_DEBUG_PRINT("width[%u], height[%u], texW[%u], texH[%u], sourceW[%d], sourceH[%d] %s\n", _width, _height, _textureSize.width, _textureSize.height, _sourceSize.width, _sourceSize.height, textureOrSource ? "size by source" : "size by texture");
}
@@ -558,10 +558,10 @@ void GuRenderer::render() {
// Loop over patches of 512x512 pixel textures and draw them
for (uint32 j = 0; j < _buffer->getSourceHeight(); j += 512) {
_textureLoadOffset.y = j;
-
+
for (uint32 i = 0; i < _buffer->getSourceWidth(); i += 512) {
_textureLoadOffset.x = i;
-
+
guLoadTexture();
Vertex *vertices = guGetVertices();
fillVertices(vertices);
@@ -573,8 +573,8 @@ void GuRenderer::render() {
inline void GuRenderer::guProgramDrawBehavior() {
DEBUG_ENTER_FUNC();
- PSP_DEBUG_PRINT("blending[%s] colorTest[%s] reverseAlpha[%s] keyColor[%u]\n",
- _blending ? "on" : "off", _colorTest ? "on" : "off",
+ PSP_DEBUG_PRINT("blending[%s] colorTest[%s] reverseAlpha[%s] keyColor[%u]\n",
+ _blending ? "on" : "off", _colorTest ? "on" : "off",
_alphaReverse ? "on" : "off", _keyColor);
if (_blending) {
@@ -591,7 +591,7 @@ inline void GuRenderer::guProgramDrawBehavior() {
if (_colorTest) {
sceGuEnable(GU_COLOR_TEST);
sceGuColorFunc(GU_NOTEQUAL, // show only colors not equal to this color
- _keyColor,
+ _keyColor,
0x00ffffff); // match everything but alpha
} else
sceGuDisable(GU_COLOR_TEST);
@@ -663,10 +663,10 @@ inline void GuRenderer::guLoadTexture() {
byte *startPoint = _buffer->getPixels();
if (_textureLoadOffset.x)
startPoint += _buffer->_pixelFormat.pixelsToBytes(_textureLoadOffset.x);
- if (_textureLoadOffset.y)
+ if (_textureLoadOffset.y)
startPoint += _buffer->getWidthInBytes() * _textureLoadOffset.y;
-
- sceGuTexImage(0,
+
+ sceGuTexImage(0,
_buffer->getTextureWidth(), // texture width (must be power of 2)
_buffer->getTextureHeight(), // texture height (must be power of 2)
_buffer->getWidth(), // width of a line of the image (to get to the next line)
@@ -698,7 +698,7 @@ void GuRenderer::fillVertices(Vertex *vertices) {
// These coordinates describe an area within the texture. ie. we already loaded a square of texture,
// now the coordinates within it are 0 to the edge of the area of the texture we want to draw
float textureStartX = textureFix + _offsetInBuffer.x;
- float textureStartY = textureFix + _offsetInBuffer.y;
+ float textureStartY = textureFix + _offsetInBuffer.y;
int textureLeftX = _drawSize.width - _textureLoadOffset.x;
if (textureLeftX > 512)
@@ -720,7 +720,7 @@ void GuRenderer::fillVertices(Vertex *vertices) {
float imageStartY = gapY + scaledOffsetOnScreenY + (scaleSourceToOutput(false, stretch(false, _textureLoadOffset.y)));
float imageEndX, imageEndY;
-
+
imageEndX = imageStartX + scaleSourceToOutput(true, stretch(true, textureLeftX));
imageEndY = imageStartY + scaleSourceToOutput(false, stretch(false, textureLeftY));
diff --git a/backends/platform/psp/display_client.h b/backends/platform/psp/display_client.h
index f190658a26..e384bfb82b 100644
--- a/backends/platform/psp/display_client.h
+++ b/backends/platform/psp/display_client.h
@@ -171,12 +171,12 @@ protected:
class GuRenderer {
public:
// Constructors
- GuRenderer() : _useGlobalScaler(false), _buffer(0), _palette(0),
- _blending(false), _alphaReverse(false), _colorTest(false),
+ GuRenderer() : _useGlobalScaler(false), _buffer(0), _palette(0),
+ _blending(false), _alphaReverse(false), _colorTest(false),
_keyColor(0), _fullScreen(false), _stretch(false), _stretchX(1.0f), _stretchY(1.0f) {}
- GuRenderer(Buffer *buffer, Palette *palette) :
- _useGlobalScaler(false), _buffer(buffer), _palette(palette),
- _blending(false), _alphaReverse(false), _colorTest(false),
+ GuRenderer(Buffer *buffer, Palette *palette) :
+ _useGlobalScaler(false), _buffer(buffer), _palette(palette),
+ _blending(false), _alphaReverse(false), _colorTest(false),
_keyColor(0), _fullScreen(false), _stretch(false), _stretchX(1.0f), _stretchY(1.0f) {}
static void setDisplayManager(DisplayManager *dm) { _displayManager = dm; } // Called by the Display Manager
diff --git a/backends/platform/psp/display_manager.cpp b/backends/platform/psp/display_manager.cpp
index 899b79727f..e945dca4a8 100644
--- a/backends/platform/psp/display_manager.cpp
+++ b/backends/platform/psp/display_manager.cpp
@@ -299,7 +299,7 @@ void DisplayManager::init() {
#endif
// Init overlay since we never change the size
- _overlay->deallocate();
+ _overlay->deallocate();
_overlay->setBytesPerPixel(sizeof(OverlayColor));
_overlay->setSize(PSP_SCREEN_WIDTH, PSP_SCREEN_HEIGHT);
_overlay->allocate();
@@ -432,13 +432,13 @@ bool DisplayManager::renderAll() {
_screen->render();
_screen->setClean(); // clean out dirty bit
-
+
if (_imageViewer->isVisible())
_imageViewer->render();
_imageViewer->setClean();
if (_overlay->isVisible())
- _overlay->render();
+ _overlay->render();
_overlay->setClean();
if (_cursor->isVisible())
@@ -448,7 +448,7 @@ bool DisplayManager::renderAll() {
if (_keyboard->isVisible())
_keyboard->render();
_keyboard->setClean();
-
+
_masterGuRenderer.guPostRender();
return true; // rendered successfully
diff --git a/backends/platform/psp/display_manager.h b/backends/platform/psp/display_manager.h
index 5176bee3fe..38c43d60a3 100644
--- a/backends/platform/psp/display_manager.h
+++ b/backends/platform/psp/display_manager.h
@@ -72,7 +72,7 @@ private:
*/
class MasterGuRenderer : public PspThreadable {
public:
- MasterGuRenderer() : _lastRenderTime(0), _renderFinished(true),
+ MasterGuRenderer() : _lastRenderTime(0), _renderFinished(true),
_renderSema(1, 1), _callbackId(-1) {}
void guInit();
void guPreRender();
@@ -108,7 +108,7 @@ public:
KEEP_ASPECT_RATIO,
STRETCHED_FULL_SCREEN
};
- DisplayManager() : _screen(0), _cursor(0), _overlay(0), _keyboard(0),
+ DisplayManager() : _screen(0), _cursor(0), _overlay(0), _keyboard(0),
_imageViewer(0), _lastUpdateTime(0), _graphicsMode(0) {}
~DisplayManager();
@@ -127,7 +127,7 @@ public:
void setOverlay(Overlay *overlay) { _overlay = overlay; }
void setKeyboard(PSPKeyboard *keyboard) { _keyboard = keyboard; }
void setImageViewer(ImageViewer *imageViewer) { _imageViewer = imageViewer; }
-
+
void setSizeAndPixelFormat(uint width, uint height, const Graphics::PixelFormat *format);
// Getters
diff --git a/backends/platform/psp/dummy.cpp b/backends/platform/psp/dummy.cpp
index 86ab30b3e2..748ac8cbf3 100644
--- a/backends/platform/psp/dummy.cpp
+++ b/backends/platform/psp/dummy.cpp
@@ -26,31 +26,31 @@
#include <stdio.h>
#include <png.h>
#include <sys/socket.h>
-
+
//void userWriteFn(png_structp png_ptr, png_bytep data, png_size_t length) {
//}
//void userFlushFn(png_structp png_ptr) {
//}
-
+
// Dummy functions are pulled in so that we don't need to build the plugins with certain libs
-
+
int dummyFunc() {
// For Broken Sword 2.5
volatile int i;
i = clock();
rename("dummyA", "dummyB");
-
+
png_structp png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
png_set_write_fn(png_ptr, NULL, NULL, NULL);
png_infop info_ptr;
png_write_png(png_ptr, info_ptr, PNG_TRANSFORM_IDENTITY, NULL);
png_destroy_write_struct(&png_ptr, &info_ptr);
-
+
// For lua's usage of libc: very heavy usage so it pulls in sockets?
setsockopt(0, 0, 0, NULL, 0);
getsockopt(0, 0, 0, NULL, NULL);
-
+
return i;
} \ No newline at end of file
diff --git a/backends/platform/psp/image_viewer.cpp b/backends/platform/psp/image_viewer.cpp
index 97d582b63a..1ed7698bc8 100644
--- a/backends/platform/psp/image_viewer.cpp
+++ b/backends/platform/psp/image_viewer.cpp
@@ -34,45 +34,45 @@
#include "backends/platform/psp/input.h"
#include "backends/platform/psp/display_manager.h"
#include "backends/platform/psp/display_client.h"
-#include "backends/platform/psp/image_viewer.h"
-#include "backends/platform/psp/png_loader.h"
+#include "backends/platform/psp/image_viewer.h"
+#include "backends/platform/psp/png_loader.h"
#include "backends/platform/psp/thread.h"
static const char *imageName = "psp_image";
#define PSP_SCREEN_HEIGHT 272
#define PSP_SCREEN_WIDTH 480
-
+
bool ImageViewer::load(int imageNum) {
if (_init)
unload();
-
+
// build string
char number[8];
sprintf(number, "%d", imageNum);
- Common::String imageNameStr(imageName);
+ Common::String imageNameStr(imageName);
Common::String specificImageName = imageNameStr + Common::String(number) + Common::String(".png");
-
+
// search for image file
if (!SearchMan.hasFile(specificImageName)) {
PSP_ERROR("file %s not found\n", specificImageName.c_str());
return false;
}
-
+
Common::ScopedPtr<Common::SeekableReadStream> file(SearchMan.createReadStreamForMember(specificImageName));
-
+
_buffer = new Buffer();
_palette = new Palette();
_renderer = new GuRenderer();
-
+
assert(_buffer);
assert(_palette);
assert(_renderer);
-
+
// Load a PNG into our buffer and palette. Size it by the actual size of the image
PngLoader image(file, *_buffer, *_palette, Buffer::kSizeBySourceSize);
-
+
PngLoader::Status status = image.allocate(); // allocate the buffers for the file
-
+
char error[100];
if (status == PngLoader::BAD_FILE) {
sprintf(error, "Cannot display %s. Not a proper PNG file", specificImageName.c_str());
@@ -89,29 +89,29 @@ bool ImageViewer::load(int imageNum) {
if (!image.load()) {
sprintf(error, "Cannot display %s. Not a proper PNG file", specificImageName.c_str());
GUI::TimedMessageDialog dialog(error, 4000);
- dialog.runModal();
+ dialog.runModal();
return false;
}
-
+
setConstantRendererOptions();
setFullScreenImageParams(); // prepare renderer for full screen view
-
+
_imageNum = imageNum; // now we can say we displayed this image
_init = true;
-
+
return true;
}
void ImageViewer::setConstantRendererOptions() {
_renderer->setBuffer(_buffer);
_renderer->setPalette(_palette);
-
+
_renderer->setAlphaBlending(false);
_renderer->setColorTest(false);
_renderer->setUseGlobalScaler(false);
_renderer->setStretch(true);
_renderer->setOffsetInBuffer(0, 0);
- _renderer->setDrawWholeBuffer();
+ _renderer->setDrawWholeBuffer();
}
void ImageViewer::unload() {
@@ -130,32 +130,32 @@ void ImageViewer::resetOnEngineDone() {
void ImageViewer::setVisible(bool visible) {
DEBUG_ENTER_FUNC();
-
+
if (_visible == visible)
return;
-
+
// from here on, we're making the loader visible
if (visible && g_engine) { // we can only run the image viewer when there's an engine
g_engine->pauseEngine(true);
-
+
load(_imageNum ? _imageNum : 1); // load the 1st image or the current
}
if (visible && _init) { // we managed to load
_visible = true;
setViewerButtons(true);
-
+
{ // so dialog goes out of scope, destroying all allocations
GUI::TimedMessageDialog dialog("Image Viewer", 1000);
dialog.runModal();
}
-
+
runLoop(); // only listen to viewer events
} else { // we were asked to make invisible or failed to load
_visible = false;
unload();
setViewerButtons(false);
-
+
if (g_engine && g_engine->isPaused())
g_engine->pauseEngine(false);
}
@@ -175,7 +175,7 @@ void ImageViewer::runLoop() {
void ImageViewer::setViewerButtons(bool active) {
_inputHandler->setImageViewerMode(active);
-}
+}
void ImageViewer::loadNextImage() {
if (!load(_imageNum+1)) { // try to load the next image
@@ -190,21 +190,21 @@ void ImageViewer::loadLastImage() {
if (!load(_imageNum-1))
if (!load(_imageNum))
setVisible(false); // we can't even show the old image so hide
- }
+ }
setDirty();
}
void ImageViewer::setFullScreenImageParams() {
// we try to fit the image fullscreen at least in one dimension
uint32 width = _buffer->getSourceWidth();
- uint32 height = _buffer->getSourceHeight();
+ uint32 height = _buffer->getSourceHeight();
_centerX = PSP_SCREEN_WIDTH / 2.0f;
_centerY = PSP_SCREEN_HEIGHT / 2.0f;
-
+
// see if we fit width wise
if (PSP_SCREEN_HEIGHT >= (int)((height * PSP_SCREEN_WIDTH) / (float)width)) {
- setZoom(PSP_SCREEN_WIDTH / (float)width);
+ setZoom(PSP_SCREEN_WIDTH / (float)width);
} else {
setZoom(PSP_SCREEN_HEIGHT / (float)height);
}
@@ -233,32 +233,32 @@ void ImageViewer::render() {
break;
}
_renderer->render();
- }
+ }
}
void ImageViewer::modifyZoom(bool up) {
float factor = _zoomFactor;
- if (up)
+ if (up)
factor += 0.1f;
else // down
factor -= 0.1f;
-
- setZoom(factor);
+
+ setZoom(factor);
}
-void ImageViewer::setZoom(float value) {
+void ImageViewer::setZoom(float value) {
if (value <= 0.0f) // don't want 0 or negative zoom
return;
_zoomFactor = value;
- _renderer->setStretchXY(value, value);
+ _renderer->setStretchXY(value, value);
setOffsetParams();
}
void ImageViewer::moveImageX(float val) {
float newVal = _centerX + val;
-
- if (newVal - (_visibleWidth / 2) > PSP_SCREEN_WIDTH - 4 || newVal + (_visibleWidth / 2) < 4)
+
+ if (newVal - (_visibleWidth / 2) > PSP_SCREEN_WIDTH - 4 || newVal + (_visibleWidth / 2) < 4)
return;
_centerX = newVal;
setOffsetParams();
@@ -266,22 +266,22 @@ void ImageViewer::moveImageX(float val) {
void ImageViewer::moveImageY(float val) {
float newVal = _centerY + val;
-
- if (newVal - (_visibleHeight / 2) > PSP_SCREEN_HEIGHT - 4 || newVal + (_visibleHeight / 2) < 4)
+
+ if (newVal - (_visibleHeight / 2) > PSP_SCREEN_HEIGHT - 4 || newVal + (_visibleHeight / 2) < 4)
return;
_centerY = newVal;
setOffsetParams();
}
-// Set the renderer with the proper offset on the screen
+// Set the renderer with the proper offset on the screen
//
void ImageViewer::setOffsetParams() {
_visibleWidth = _zoomFactor * _buffer->getSourceWidth();
- _visibleHeight = _zoomFactor * _buffer->getSourceHeight();
-
+ _visibleHeight = _zoomFactor * _buffer->getSourceHeight();
+
int offsetX = _centerX - (int)(_visibleWidth * 0.5f);
int offsetY = _centerY - (int)(_visibleHeight * 0.5f);
-
+
_renderer->setOffsetOnScreen(offsetX, offsetY);
setDirty();
}
@@ -290,8 +290,8 @@ void ImageViewer::setOffsetParams() {
//
void ImageViewer::handleEvent(uint32 event) {
DEBUG_ENTER_FUNC();
-
- switch (event) {
+
+ switch (event) {
case EVENT_HIDE:
setVisible(false);
break;
diff --git a/backends/platform/psp/image_viewer.h b/backends/platform/psp/image_viewer.h
index 4c3eaf7b4a..ad188536a3 100644
--- a/backends/platform/psp/image_viewer.h
+++ b/backends/platform/psp/image_viewer.h
@@ -54,10 +54,10 @@ private:
float _visibleHeight, _visibleWidth;
float _centerX, _centerY;
Event _movement;
-
+
InputHandler *_inputHandler;
DisplayManager *_displayManager;
-
+
void setFullScreenImageParams();
void loadNextImage();
void loadLastImage();
@@ -66,19 +66,19 @@ private:
void moveImageX(float val);
void moveImageY(float val);
bool load(int imageNum);
- void unload();
+ void unload();
void runLoop(); // to get total pausing we have to do our own loop
-
+
void setZoom(float value);
void setOffsetParams();
void modifyZoom(bool up); // up or down
void setVisible(bool visible);
-
+
public:
- ImageViewer() : _buffer(0), _palette(0), _visible(false),
- _dirty(false), _init(false), _imageNum(0),
- _zoomFactor(0.0f), _visibleHeight(0.0f), _visibleWidth(0.0f),
+ ImageViewer() : _buffer(0), _palette(0), _visible(false),
+ _dirty(false), _init(false), _imageNum(0),
+ _zoomFactor(0.0f), _visibleHeight(0.0f), _visibleWidth(0.0f),
_centerX(0.0f), _centerY(0.0f), _movement(EVENT_MOVE_STOP),
_inputHandler(0), _displayManager(0) {}
~ImageViewer() { unload(); } // deallocate images
@@ -88,15 +88,15 @@ public:
bool isDirty() { return _dirty; }
void setDirty() { _dirty = true; }
void setClean() { if (!_visible) // otherwise we want to keep rendering
- _dirty = false;
- }
+ _dirty = false;
+ }
void resetOnEngineDone();
-
+
void handleEvent(uint32 event);
-
+
// pointer setters
- void setInputHandler(InputHandler *inputHandler) { _inputHandler = inputHandler; }
+ void setInputHandler(InputHandler *inputHandler) { _inputHandler = inputHandler; }
void setDisplayManager(DisplayManager *displayManager) { _displayManager = displayManager; }
};
-#endif /* PSP_IMAGE_VIEWER_H */ \ No newline at end of file
+#endif /* PSP_IMAGE_VIEWER_H */ \ No newline at end of file
diff --git a/backends/platform/psp/input.cpp b/backends/platform/psp/input.cpp
index 17f8954e3b..a9ad441b4d 100644
--- a/backends/platform/psp/input.cpp
+++ b/backends/platform/psp/input.cpp
@@ -198,7 +198,7 @@ bool ButtonPad::getEvent(Common::Event &event, PspEvent &pspEvent, SceCtrlData &
uint32 curButtonState = PSP_ALL_BUTTONS & pad.Buttons; // we only care about these
if (_combosEnabled)
- modifyButtonsForCombos(pad); // change buttons for combos
+ modifyButtonsForCombos(pad); // change buttons for combos
return getEventFromButtonState(event, pspEvent, curButtonState);
}
@@ -460,7 +460,7 @@ bool InputHandler::handlePspEvent(Common::Event &event, PspEvent &pspEvent) {
/*case PSP_EVENT_CHANGE_SPEED:
handleSpeedChange(pspEvent.data);
break;*/
- case PSP_EVENT_IMAGE_VIEWER:
+ case PSP_EVENT_IMAGE_VIEWER:
_imageViewer->handleEvent(pspEvent.data);
break;
case PSP_EVENT_IMAGE_VIEWER_SET_BUTTONS:
@@ -530,7 +530,7 @@ void InputHandler::setImageViewerMode(bool active) {
_nub.init();
_buttonPad.enableCombos(true); // re-enable combos
_buttonPad.initButtons();
- }
+ }
}
void InputHandler::setButtonsForImageViewer() {
@@ -538,32 +538,32 @@ void InputHandler::setButtonsForImageViewer() {
// Dpad
_buttonPad.clearButtons();
- _buttonPad.getButton(ButtonPad::BTN_UP, UNSHIFTED).setPspEvent(PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_ZOOM_IN,
+ _buttonPad.getButton(ButtonPad::BTN_UP, UNSHIFTED).setPspEvent(PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_ZOOM_IN,
+ PSP_EVENT_NONE, false);
+ _buttonPad.getButton(ButtonPad::BTN_DOWN, UNSHIFTED).setPspEvent(PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_ZOOM_OUT,
PSP_EVENT_NONE, false);
- _buttonPad.getButton(ButtonPad::BTN_DOWN, UNSHIFTED).setPspEvent(PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_ZOOM_OUT,
+ _buttonPad.getButton(ButtonPad::BTN_LEFT, UNSHIFTED).setPspEvent(PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_LAST_IMAGE,
PSP_EVENT_NONE, false);
- _buttonPad.getButton(ButtonPad::BTN_LEFT, UNSHIFTED).setPspEvent(PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_LAST_IMAGE,
+ _buttonPad.getButton(ButtonPad::BTN_RIGHT, UNSHIFTED).setPspEvent(PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_NEXT_IMAGE,
PSP_EVENT_NONE, false);
- _buttonPad.getButton(ButtonPad::BTN_RIGHT, UNSHIFTED).setPspEvent(PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_NEXT_IMAGE,
- PSP_EVENT_NONE, false);
- _buttonPad.getButton(ButtonPad::BTN_LTRIGGER, UNSHIFTED).setPspEvent(PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_HIDE,
+ _buttonPad.getButton(ButtonPad::BTN_LTRIGGER, UNSHIFTED).setPspEvent(PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_HIDE,
PSP_EVENT_NONE, false);
- _buttonPad.getButton(ButtonPad::BTN_RTRIGGER, UNSHIFTED).setPspEvent(PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_HIDE,
+ _buttonPad.getButton(ButtonPad::BTN_RTRIGGER, UNSHIFTED).setPspEvent(PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_HIDE,
PSP_EVENT_NONE, false);
- _buttonPad.getButton(ButtonPad::BTN_START, UNSHIFTED).setPspEvent(PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_HIDE,
+ _buttonPad.getButton(ButtonPad::BTN_START, UNSHIFTED).setPspEvent(PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_HIDE,
PSP_EVENT_NONE, false);
- _buttonPad.getButton(ButtonPad::BTN_SELECT, UNSHIFTED).setPspEvent(PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_HIDE,
+ _buttonPad.getButton(ButtonPad::BTN_SELECT, UNSHIFTED).setPspEvent(PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_HIDE,
PSP_EVENT_NONE, false);
//Nub
_nub.getPad().clearButtons();
- _nub.getPad().getButton(ButtonPad::BTN_UP, UNSHIFTED).setPspEvent(PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_MOVE_UP,
+ _nub.getPad().getButton(ButtonPad::BTN_UP, UNSHIFTED).setPspEvent(PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_MOVE_UP,
PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_MOVE_STOP);
- _nub.getPad().getButton(ButtonPad::BTN_DOWN, UNSHIFTED).setPspEvent(PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_MOVE_DOWN,
+ _nub.getPad().getButton(ButtonPad::BTN_DOWN, UNSHIFTED).setPspEvent(PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_MOVE_DOWN,
PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_MOVE_STOP);
- _nub.getPad().getButton(ButtonPad::BTN_LEFT, UNSHIFTED).setPspEvent(PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_MOVE_LEFT,
+ _nub.getPad().getButton(ButtonPad::BTN_LEFT, UNSHIFTED).setPspEvent(PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_MOVE_LEFT,
PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_MOVE_STOP);
- _nub.getPad().getButton(ButtonPad::BTN_RIGHT, UNSHIFTED).setPspEvent(PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_MOVE_RIGHT,
+ _nub.getPad().getButton(ButtonPad::BTN_RIGHT, UNSHIFTED).setPspEvent(PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_MOVE_RIGHT,
PSP_EVENT_IMAGE_VIEWER, ImageViewer::EVENT_MOVE_STOP);
}
diff --git a/backends/platform/psp/input.h b/backends/platform/psp/input.h
index 8315a3766c..ef2e1b84a4 100644
--- a/backends/platform/psp/input.h
+++ b/backends/platform/psp/input.h
@@ -122,16 +122,16 @@ public:
ButtonPad();
void initButtons(); // set the buttons to the mode that's selected
void clearButtons(); // empty the buttons of all events
-
+
bool getEvent(Common::Event &event, PspEvent &pspEvent, SceCtrlData &pad);
bool getEventFromButtonState(Common::Event &event, PspEvent &pspEvent, uint32 buttonState);
-
+
void setShifted(ShiftMode shifted) { _shifted = shifted; }
void setPadMode(PspPadMode mode) { _padMode = mode; }
bool isButtonDown() { return _prevButtonState; }
-
+
void enableCombos(bool value) { _combosEnabled = value; }
- Button &getButton(ButtonType type, ShiftMode mode) { return _button[type][mode]; }
+ Button &getButton(ButtonType type, ShiftMode mode) { return _button[type][mode]; }
};
class Nub {
@@ -140,17 +140,17 @@ private:
ShiftMode _shifted;
bool _dpadMode;
-
+
ButtonPad _buttonPad; // private buttonpad for dpad mode
-
+
int32 modifyNubAxisMotion(int32 input);
void translateToDpadState(int dpadX, int dpadY, uint32 &buttonState); // convert nub data to dpad data
public:
Nub() : _shifted(UNSHIFTED), _dpadMode(false) { }
- void init() { _buttonPad.initButtons(); }
+ void init() { _buttonPad.initButtons(); }
void setCursor(Cursor *cursor) { _cursor = cursor; }
-
+
// setters
void setDpadMode(bool active) { _dpadMode = active; }
void setShifted(ShiftMode shifted) { _shifted = shifted; }
@@ -163,7 +163,7 @@ public:
class InputHandler {
public:
- InputHandler() : _keyboard(0), _cursor(0), _imageViewer(0), _padMode(PAD_MODE_NORMAL),
+ InputHandler() : _keyboard(0), _cursor(0), _imageViewer(0), _padMode(PAD_MODE_NORMAL),
_lastPadCheckTime(0) {}
// pointer setters
void setKeyboard(PSPKeyboard *keyboard) { _keyboard = keyboard; }
@@ -175,7 +175,7 @@ public:
void setImageViewerMode(bool active);
private:
- Nub _nub;
+ Nub _nub;
ButtonPad _buttonPad;
// Pointers to relevant other classes
diff --git a/backends/platform/psp/osys_psp.cpp b/backends/platform/psp/osys_psp.cpp
index 01124b420e..5fa5110684 100644
--- a/backends/platform/psp/osys_psp.cpp
+++ b/backends/platform/psp/osys_psp.cpp
@@ -20,8 +20,7 @@
*
*/
-// Allow use of stuff in <time.h>
-#define FORBIDDEN_SYMBOL_EXCEPTION_time_h
+#define FORBIDDEN_SYMBOL_ALLOW_ALL
#include <pspuser.h>
#include <pspgu.h>
@@ -84,7 +83,7 @@ void OSystem_PSP::initBackend() {
_inputHandler.setKeyboard(&_keyboard);
_inputHandler.setImageViewer(&_imageViewer);
_inputHandler.init();
-
+
// Set pointers for image viewer
_imageViewer.setInputHandler(&_inputHandler);
_imageViewer.setDisplayManager(&_displayManager);
@@ -422,7 +421,15 @@ void OSystem_PSP::quit() {
}
void OSystem_PSP::logMessage(LogMessageType::Type type, const char *message) {
- EventsBaseBackend::logMessage(type, message);
+ FILE *output = 0;
+
+ if (type == LogMessageType::kInfo || type == LogMessageType::kDebug)
+ output = stdout;
+ else
+ output = stderr;
+
+ fputs(message, output);
+ fflush(output);
if (type == LogMessageType::kError)
PspDebugTrace(false, "%s", message); // write to file
diff --git a/backends/platform/psp/png_loader.cpp b/backends/platform/psp/png_loader.cpp
index 2f4857569e..16377539c8 100644
--- a/backends/platform/psp/png_loader.cpp
+++ b/backends/platform/psp/png_loader.cpp
@@ -36,7 +36,7 @@
PngLoader::Status PngLoader::allocate() {
DEBUG_ENTER_FUNC();
-
+
if (!findImageDimensions()) {
PSP_ERROR("failed to get image dimensions\n");
return BAD_FILE;
@@ -45,7 +45,7 @@ PngLoader::Status PngLoader::allocate() {
_buffer->setSize(_width, _height, _sizeBy);
uint32 bitsPerPixel = _bitDepth * _channels;
-
+
if (_paletteSize) { // 8 or 4-bit image
if (bitsPerPixel == 4) {
_buffer->setPixelFormat(PSPPixelFormat::Type_Palette_4bit);
@@ -130,7 +130,7 @@ bool PngLoader::basicImageLoad() {
png_get_IHDR(_pngPtr, _infoPtr, (png_uint_32 *)&_width, (png_uint_32 *)&_height, &_bitDepth,
&_colorType, &interlaceType, int_p_NULL, int_p_NULL);
_channels = png_get_channels(_pngPtr, _infoPtr);
-
+
if (_colorType & PNG_COLOR_MASK_PALETTE)
_paletteSize = _infoPtr->num_palette;
@@ -141,7 +141,7 @@ bool PngLoader::basicImageLoad() {
bool PngLoader::findImageDimensions() {
DEBUG_ENTER_FUNC();
- bool status = basicImageLoad();
+ bool status = basicImageLoad();
PSP_DEBUG_PRINT("width[%d], height[%d], paletteSize[%d], bitDepth[%d], channels[%d], rowBytes[%d]\n", _width, _height, _paletteSize, _bitDepth, _channels, _infoPtr->rowbytes);
png_destroy_read_struct(&_pngPtr, &_infoPtr, png_infopp_NULL);
@@ -157,7 +157,7 @@ bool PngLoader::loadImageIntoBuffer() {
if (!basicImageLoad()) {
png_destroy_read_struct(&_pngPtr, &_infoPtr, png_infopp_NULL);
return false;
- }
+ }
png_set_strip_16(_pngPtr); // Strip off 16 bit channels in case they occur
if (_paletteSize) {
@@ -178,16 +178,16 @@ bool PngLoader::loadImageIntoBuffer() {
}
uint32 rowBytes = png_get_rowbytes(_pngPtr, _infoPtr);
-
- // there seems to be a bug in libpng where it doesn't increase the rowbytes or the
+
+ // there seems to be a bug in libpng where it doesn't increase the rowbytes or the
// channel even after we add the alpha channel
if (_channels == 3 && (rowBytes / _width) == 3) {
_channels = 4;
- rowBytes = _width * _channels;
- }
-
+ rowBytes = _width * _channels;
+ }
+
PSP_DEBUG_PRINT("rowBytes[%d], channels[%d]\n", rowBytes, _channels);
-
+
unsigned char *line = (unsigned char*) malloc(rowBytes);
if (!line) {
png_destroy_read_struct(&_pngPtr, png_infopp_NULL, png_infopp_NULL);
diff --git a/backends/platform/psp/png_loader.h b/backends/platform/psp/png_loader.h
index 616a79405e..0ff9d8a65d 100644
--- a/backends/platform/psp/png_loader.h
+++ b/backends/platform/psp/png_loader.h
@@ -61,7 +61,7 @@ public:
Buffer::HowToSize sizeBy = Buffer::kSizeByTextureSize) :
_file(file), _buffer(&buffer), _palette(&palette),
_width(0), _height(0), _paletteSize(0),
- _bitDepth(0), _sizeBy(sizeBy), _pngPtr(0),
+ _bitDepth(0), _sizeBy(sizeBy), _pngPtr(0),
_infoPtr(0), _colorType(0), _channels(0) {}
PngLoader::Status allocate();
diff --git a/backends/platform/psp/trace.cpp b/backends/platform/psp/trace.cpp
index 373e00415b..b799b4e870 100644
--- a/backends/platform/psp/trace.cpp
+++ b/backends/platform/psp/trace.cpp
@@ -75,38 +75,38 @@ void PspDebugTrace(bool alsoToScreen, const char *format, ...) {
#define GET_RET(retAddr) \
asm volatile ("move %0,$ra\n\t" \
: "=&r" (retAddr) : )
-
+
#define GET_SP(stackPtr) \
asm volatile ("move %0,$sp\n\t" \
: "=&r" (stackPtr) : )
// Function to retrieve a backtrace for the MIPS processor
-// This is not trivial since the MIPS doesn't use a frame pointer.
+// This is not trivial since the MIPS doesn't use a frame pointer.
// Takes the number of levels wanted above the calling function (included) and an array of void *
-//
+//
void mipsBacktrace(uint32 levels, void **addresses) {
- // get the current return address
+ // get the current return address
register byte *retAddr;
register byte *stackPointer;
- GET_RET(retAddr);
+ GET_RET(retAddr);
GET_SP(stackPointer);
char string[100];
-
+
if (!levels)
return;
-
+
memset(addresses, 0, sizeof(void *) * levels);
-
+
uint32 curLevel = 0;
-
+
const uint32 SP_SUBTRACT = 0x27bd8000; // The instruction to subtract from the SP looks like this
const uint32 SP_SUB_HIGH_MASK = 0xffff8000; // The mask to check for the subtract SP instruction
const uint32 SP_SUB_LOW_MASK = 0x0000ffff; // The mask that gives us how much was subtracted
-
+
// make sure we go out of the stack of this current level
// we already have the return address for this level from the register
if (curLevel < levels) {
- void *thisFunc = (void *)mipsBacktrace;
+ void *thisFunc = (void *)mipsBacktrace;
for (uint32 *seekPtr = (uint32 *)thisFunc; ; seekPtr++) {
if ((*seekPtr & SP_SUB_HIGH_MASK) == SP_SUBTRACT) {
// we found the $sp subtraction at the beginning of the function
@@ -120,10 +120,10 @@ void mipsBacktrace(uint32 levels, void **addresses) {
fputs(string, stderr);
}
break;
- }
- }
+ }
+ }
}
-
+
// keep scanning while more levels are requested
while (curLevel < levels) {
// now scan backwards from the return address to find the size of the stack
@@ -139,13 +139,13 @@ void mipsBacktrace(uint32 levels, void **addresses) {
sprintf(string, "invalid retAddr %p\n", retAddr);
fputs(string, stderr);
return;
- }
+ }
//sprintf(string, "retAddr[%p]\n", retAddr);
//fputs(string, stderr);
addresses[curLevel++] = retAddr;
break;
- }
- }
+ }
+ }
}
-}
+}
diff --git a/backends/platform/sdl/macosx/macosx.cpp b/backends/platform/sdl/macosx/macosx.cpp
index 9b11eb2c09..817f61e864 100644
--- a/backends/platform/sdl/macosx/macosx.cpp
+++ b/backends/platform/sdl/macosx/macosx.cpp
@@ -74,7 +74,7 @@ void OSystem_MacOSX::addSysArchivesToSearchSet(Common::SearchSet &s, int priorit
}
void OSystem_MacOSX::setupIcon() {
- // Don't set icon on OS X, as we use a nicer external icon there.
+ // Don't set icon on OS X, as we use a nicer external icon there.
}
bool OSystem_MacOSX::hasFeature(Feature f) {
diff --git a/backends/platform/sdl/sdl-sys.h b/backends/platform/sdl/sdl-sys.h
index 77515ff4e5..63bfc58617 100644
--- a/backends/platform/sdl/sdl-sys.h
+++ b/backends/platform/sdl/sdl-sys.h
@@ -47,7 +47,7 @@ typedef struct { int FAKE; } FAKE_FILE;
// Finally forbid FILE again (if it was forbidden to start with)
#if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_FILE)
-#undef FILE
+#undef FILE
#define FILE FORBIDDEN_SYMBOL_REPLACEMENT
#endif
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index 85ea177a39..3f85b1a564 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -39,7 +39,7 @@
#include "backends/events/sdl/sdl-events.h"
#include "backends/mutex/sdl/sdl-mutex.h"
#include "backends/timer/sdl/sdl-timer.h"
-#include "backends/graphics/sdl/sdl-graphics.h"
+#include "backends/graphics/surfacesdl/surfacesdl-graphics.h"
#ifdef USE_OPENGL
#include "backends/graphics/openglsdl/openglsdl-graphics.h"
#endif
@@ -173,27 +173,11 @@ void OSystem_SDL::initBackend() {
}
#endif
if (_graphicsManager == 0) {
- _graphicsManager = new SdlGraphicsManager(_eventSource);
+ _graphicsManager = new SurfaceSdlGraphicsManager(_eventSource);
graphicsManagerType = 0;
}
}
- // Creates the backend managers, if they don't exist yet (we check
- // for this to allow subclasses to provide their own).
- if (_eventManager == 0)
- _eventManager = new DefaultEventManager(_eventSource);
-
- // We have to initialize the graphics manager before the event manager
- // so the virtual keyboard can be initialized, but we have to add the
- // graphics manager as an event observer after initializing the event
- // manager.
- if (graphicsManagerType == 0)
- ((SdlGraphicsManager *)_graphicsManager)->initEventObserver();
-#ifdef USE_OPENGL
- else if (graphicsManagerType == 1)
- ((OpenGLSdlGraphicsManager *)_graphicsManager)->initEventObserver();
-#endif
-
if (_savefileManager == 0)
_savefileManager = new DefaultSaveFileManager();
@@ -213,6 +197,18 @@ void OSystem_SDL::initBackend() {
_inited = true;
ModularBackend::initBackend();
+
+ // We have to initialize the graphics manager before the event manager
+ // so the virtual keyboard can be initialized, but we have to add the
+ // graphics manager as an event observer after initializing the event
+ // manager.
+ if (graphicsManagerType == 0)
+ ((SurfaceSdlGraphicsManager *)_graphicsManager)->initEventObserver();
+#ifdef USE_OPENGL
+ else if (graphicsManagerType == 1)
+ ((OpenGLSdlGraphicsManager *)_graphicsManager)->initEventObserver();
+#endif
+
}
#if defined(USE_TASKBAR)
@@ -296,10 +292,22 @@ void OSystem_SDL::fatalError() {
void OSystem_SDL::logMessage(LogMessageType::Type type, const char *message) {
- ModularBackend::logMessage(type, message);
+ // First log to stdout/stderr
+ FILE *output = 0;
+
+ if (type == LogMessageType::kInfo || type == LogMessageType::kDebug)
+ output = stdout;
+ else
+ output = stderr;
+
+ fputs(message, output);
+ fflush(output);
+
+ // Then log into file (via the logger)
if (_logger)
_logger->print(message);
+ // Finally, some Windows / WinCE specific logging code.
#if defined( USE_WINDBG )
#if defined( _WIN32_WCE )
TCHAR buf_unicode[1024];
@@ -493,7 +501,7 @@ bool OSystem_SDL::setGraphicsMode(int mode) {
// Check if mode is from SDL or OpenGL
if (mode < _sdlModesCount) {
- srcMode = SdlGraphicsManager::supportedGraphicsModes();
+ srcMode = SurfaceSdlGraphicsManager::supportedGraphicsModes();
i = 0;
} else {
srcMode = OpenGLSdlGraphicsManager::supportedGraphicsModes();
@@ -508,8 +516,8 @@ bool OSystem_SDL::setGraphicsMode(int mode) {
if (_graphicsMode >= _sdlModesCount && mode < _sdlModesCount) {
debug(1, "switching to plain SDL graphics");
delete _graphicsManager;
- _graphicsManager = new SdlGraphicsManager(_eventSource);
- ((SdlGraphicsManager *)_graphicsManager)->initEventObserver();
+ _graphicsManager = new SurfaceSdlGraphicsManager(_eventSource);
+ ((SurfaceSdlGraphicsManager *)_graphicsManager)->initEventObserver();
_graphicsManager->beginGFXTransaction();
} else if (_graphicsMode < _sdlModesCount && mode >= _sdlModesCount) {
debug(1, "switching to OpenGL graphics");
@@ -535,7 +543,7 @@ int OSystem_SDL::getGraphicsMode() const {
}
void OSystem_SDL::setupGraphicsModes() {
- const OSystem::GraphicsMode *sdlGraphicsModes = SdlGraphicsManager::supportedGraphicsModes();
+ const OSystem::GraphicsMode *sdlGraphicsModes = SurfaceSdlGraphicsManager::supportedGraphicsModes();
const OSystem::GraphicsMode *openglGraphicsModes = OpenGLSdlGraphicsManager::supportedGraphicsModes();
_sdlModesCount = 0;
_glModesCount = 0;
diff --git a/backends/platform/sdl/win32/win32.cpp b/backends/platform/sdl/win32/win32.cpp
index 08139f0dc2..5b02a20abc 100644
--- a/backends/platform/sdl/win32/win32.cpp
+++ b/backends/platform/sdl/win32/win32.cpp
@@ -306,7 +306,7 @@ Common::SeekableReadStream *Win32ResourceArchive::createReadStreamForMember(cons
} // End of anonymous namespace
void OSystem_Win32::addSysArchivesToSearchSet(Common::SearchSet &s, int priority) {
- s.add("Win32Res", new Win32ResourceArchive());
+ s.add("Win32Res", new Win32ResourceArchive(), priority);
OSystem_SDL::addSysArchivesToSearchSet(s, priority);
}
diff --git a/backends/platform/symbian/src/SymbianOS.cpp b/backends/platform/symbian/src/SymbianOS.cpp
index 9cccc81d19..b1bd976f9e 100644
--- a/backends/platform/symbian/src/SymbianOS.cpp
+++ b/backends/platform/symbian/src/SymbianOS.cpp
@@ -57,7 +57,7 @@ char *GetExecutablePath() {
OSystem_SDL_Symbian::OSystem_SDL_Symbian()
:
_RFs(0) {
-
+
}
void OSystem_SDL_Symbian::init() {
@@ -171,7 +171,7 @@ Common::String OSystem_SDL_Symbian::getDefaultConfigFileName() {
}
void OSystem_SDL_Symbian::setupIcon() {
- // Don't for Symbian: it uses the EScummVM.aif file for the icon.
+ // Don't for Symbian: it uses the EScummVM.aif file for the icon.
}
RFs& OSystem_SDL_Symbian::FsSession() {
diff --git a/backends/platform/wii/osystem.cpp b/backends/platform/wii/osystem.cpp
index c6b23783b8..258a782cc4 100644
--- a/backends/platform/wii/osystem.cpp
+++ b/backends/platform/wii/osystem.cpp
@@ -19,11 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-// Allow use of stuff in <time.h>
-#define FORBIDDEN_SYMBOL_EXCEPTION_time_h
-
-#define FORBIDDEN_SYMBOL_EXCEPTION_printf
-#define FORBIDDEN_SYMBOL_EXCEPTION_getcwd
+#define FORBIDDEN_SYMBOL_ALLOW_ALL
#include <unistd.h>
@@ -291,6 +287,18 @@ void OSystem_Wii::showOptionsDialog() {
_padAcceleration = 9 - ConfMan.getInt("wii_pad_acceleration");
}
+void OSystem_Wii::logMessage(LogMessageType::Type type, const char *message) {
+ FILE *output = 0;
+
+ if (type == LogMessageType::kInfo || type == LogMessageType::kDebug)
+ output = stdout;
+ else
+ output = stderr;
+
+ fputs(message, output);
+ fflush(output);
+}
+
#ifndef GAMECUBE
Common::String OSystem_Wii::getSystemLanguage() const {
const char *wiiCountries[] = {
diff --git a/backends/platform/wii/osystem.h b/backends/platform/wii/osystem.h
index 6863a6840e..64197f913a 100644
--- a/backends/platform/wii/osystem.h
+++ b/backends/platform/wii/osystem.h
@@ -211,6 +211,8 @@ public:
virtual FilesystemFactory *getFilesystemFactory();
virtual void getTimeAndDate(TimeDate &t) const;
+ virtual void logMessage(LogMessageType::Type type, const char *message);
+
#ifndef GAMECUBE
virtual Common::String getSystemLanguage() const;
#endif // GAMECUBE
diff --git a/backends/platform/wince/wince-sdl.cpp b/backends/platform/wince/wince-sdl.cpp
index 54fa71cfd2..9b1ffe817c 100644
--- a/backends/platform/wince/wince-sdl.cpp
+++ b/backends/platform/wince/wince-sdl.cpp
@@ -621,7 +621,7 @@ Common::String OSystem_WINCE3::getSystemLanguage() const {
GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SABBREVCTRYNAME, ctryNameW, sizeof(ctryNameW)) != 0) {
WideCharToMultiByte(CP_ACP, 0, langNameW, -1, langName, (wcslen(langNameW) + 1), NULL, NULL);
WideCharToMultiByte(CP_ACP, 0, ctryNameW, -1, ctryName, (wcslen(ctryNameW) + 1), NULL, NULL);
-
+
debug(1, "Trying to find posix locale name for %s_%s", langName, ctryName);
while (posixMappingTable[i][0] && !localeFound) {
if ( (!strcmp(posixMappingTable[i][0], langName) || !strcmp(posixMappingTable[i][0], "*")) &&
diff --git a/backends/plugins/elf/elf-loader.cpp b/backends/plugins/elf/elf-loader.cpp
index b25bcf835b..4335ea6108 100644
--- a/backends/plugins/elf/elf-loader.cpp
+++ b/backends/plugins/elf/elf-loader.cpp
@@ -169,7 +169,7 @@ bool DLObject::loadSegment(Elf32_Phdr *phdr) {
warning("elfloader: Out of memory.");
return false;
}
-
+
debug(2, "elfloader: Allocated segment @ %p", _segment);
// Get offset to load segment into
@@ -222,7 +222,7 @@ Elf32_Shdr * DLObject::loadSectionHeaders(Elf32_Ehdr *ehdr) {
int DLObject::findSymbolTableSection(Elf32_Ehdr *ehdr, Elf32_Shdr *shdr) {
int SymbolTableSection = -1;
-
+
// Loop over sections, looking for symbol table linked to a string table
for (uint32 i = 0; i < ehdr->e_shnum; i++) {
if (shdr[i].sh_type == SHT_SYMTAB &&
@@ -233,7 +233,7 @@ int DLObject::findSymbolTableSection(Elf32_Ehdr *ehdr, Elf32_Shdr *shdr) {
break;
}
}
-
+
return SymbolTableSection;
}
@@ -315,12 +315,12 @@ void DLObject::relocateSymbols(ptrdiff_t offset) {
}
// Track the size of the plugin through memory manager without loading
-// the plugin into memory.
+// the plugin into memory.
//
void DLObject::trackSize(const char *path) {
-
+
_file = Common::FSNode(path).createReadStream();
-
+
if (!_file) {
warning("elfloader: File %s not found.", path);
return;
@@ -334,11 +334,11 @@ void DLObject::trackSize(const char *path) {
_file = 0;
return;
}
-
+
ELFMemMan.trackPlugin(true); // begin tracking the plugin size
-
+
// Load the segments
- for (uint32 i = 0; i < ehdr.e_phnum; i++) {
+ for (uint32 i = 0; i < ehdr.e_phnum; i++) {
debug(2, "elfloader: Loading segment %d", i);
if (!readProgramHeaders(&ehdr, &phdr, i)) {
@@ -351,7 +351,7 @@ void DLObject::trackSize(const char *path) {
ELFMemMan.trackAlloc(phdr.p_align, phdr.p_memsz);
}
}
-
+
ELFMemMan.trackPlugin(false); // we're done tracking the plugin size
delete _file;
@@ -367,7 +367,7 @@ bool DLObject::load() {
return false;
//Load the segments
- for (uint32 i = 0; i < ehdr.e_phnum; i++) {
+ for (uint32 i = 0; i < ehdr.e_phnum; i++) {
debug(2, "elfloader: Loading segment %d", i);
if (readProgramHeaders(&ehdr, &phdr, i) == false)
@@ -386,12 +386,12 @@ bool DLObject::load() {
free(shdr);
return false;
}
-
+
if (!loadStringTable(shdr)) {
free(shdr);
return false;
}
-
+
// Offset by our segment allocated address
// must use _segmentVMA here for multiple segments (MIPS)
_segmentOffset = ptrdiff_t(_segment) - _segmentVMA;
diff --git a/backends/plugins/elf/elf-provider.cpp b/backends/plugins/elf/elf-provider.cpp
index 480f7068c4..84054f44cb 100644
--- a/backends/plugins/elf/elf-provider.cpp
+++ b/backends/plugins/elf/elf-provider.cpp
@@ -100,7 +100,7 @@ DynamicPlugin::VoidFunc ELFPlugin::findSymbol(const char *symbol) {
void ELFPlugin::trackSize() {
// All we need to do is create our object, track its size, then delete it
DLObject *obj = makeDLObject();
-
+
obj->trackSize(_filename.c_str());
delete obj;
}
@@ -180,7 +180,7 @@ void ELFPlugin::unloadPlugin() {
PluginList ELFPluginProvider::getPlugins() {
PluginList pl = FilePluginProvider::getPlugins();
-#if defined(UNCACHED_PLUGINS) && !defined(ELF_NO_MEM_MANAGER)
+#if defined(UNCACHED_PLUGINS) && !defined(ELF_NO_MEM_MANAGER)
// This static downcast is safe because all of the plugins must
// be ELF plugins
for (PluginList::iterator p = pl.begin(); p != pl.end(); ++p) {
@@ -190,8 +190,8 @@ PluginList ELFPluginProvider::getPlugins() {
// The Memory Manager should now allocate space based on the information
// it collected
ELFMemMan.allocateHeap();
-#endif
-
+#endif
+
return pl;
}
diff --git a/backends/plugins/elf/memory-manager.cpp b/backends/plugins/elf/memory-manager.cpp
index 39f5e9071d..02669b3647 100644
--- a/backends/plugins/elf/memory-manager.cpp
+++ b/backends/plugins/elf/memory-manager.cpp
@@ -20,7 +20,7 @@
*
*/
-#include "common/scummsys.h"
+#include "common/scummsys.h"
#if defined(DYNAMIC_MODULES) && defined(USE_ELF_LOADER)
@@ -28,12 +28,12 @@
#include "common/debug.h"
#include "common/util.h"
#include <malloc.h>
-
-DECLARE_SINGLETON(ELFMemoryManager);
-ELFMemoryManager::ELFMemoryManager() :
- _heap(0), _heapSize(0), _heapAlign(0),
- _trackAllocs(false), _measuredSize(0), _measuredAlign(0),
+DECLARE_SINGLETON(ELFMemoryManager);
+
+ELFMemoryManager::ELFMemoryManager() :
+ _heap(0), _heapSize(0), _heapAlign(0),
+ _trackAllocs(false), _measuredSize(0), _measuredAlign(0),
_bytesAllocated(0) {}
ELFMemoryManager::~ELFMemoryManager() {
@@ -46,23 +46,23 @@ void ELFMemoryManager::trackPlugin(bool value) {
if (value == _trackAllocs)
return;
-
+
_trackAllocs = value;
-
+
if (_trackAllocs) { // start measuring
// start tracking allocations
_measuredAlign = 0;
-
+
} else { // we're done measuring
// get the total allocated size
uint32 measuredSize = _allocList.back().end() - _allocList.front().start;
_heapSize = MAX(_heapSize, measuredSize);
_heapAlign = MAX(_heapAlign, _measuredAlign);
-
+
_allocList.clear();
_bytesAllocated = 0; // reset
-
+
debug(2, "measured a plugin of size %d. Max size %d. Max align %d", measuredSize, _heapSize, _heapAlign);
}
}
@@ -70,7 +70,7 @@ void ELFMemoryManager::trackPlugin(bool value) {
void ELFMemoryManager::trackAlloc(uint32 align, uint32 size) {
if (!_measuredAlign)
_measuredAlign = align;
-
+
// use the allocate function to simulate allocation
allocateOnHeap(align, size);
}
@@ -79,20 +79,20 @@ void ELFMemoryManager::allocateHeap() {
// The memory manager should only allocate once
assert (!_heap);
assert (_heapSize);
-
+
// clear the list
_allocList.clear();
_bytesAllocated = 0;
-
+
debug(2, "ELFMemoryManager: allocating %d bytes aligned at %d as the \
plugin heap", _heapSize, _heapAlign);
-
+
// prepare the heap
- if (_heapAlign)
+ if (_heapAlign)
_heap = ::memalign(_heapAlign, _heapSize);
else
_heap = ::malloc(_heapSize);
-
+
assert(_heap);
}
@@ -106,7 +106,7 @@ void *ELFMemoryManager::pluginAllocate(uint32 size) {
void *ELFMemoryManager::pluginAllocate(uint32 align, uint32 size) {
if (_heap) {
return allocateOnHeap(align, size);
- }
+ }
return ::memalign(align, size);
}
@@ -120,16 +120,16 @@ void ELFMemoryManager::pluginDeallocate(void *ptr) {
// Allocate space for the request in our heap
void *ELFMemoryManager::allocateOnHeap(uint32 align, uint32 size) {
byte *lastAddress = (byte *)_heap;
-
+
// We can't allow allocations smaller than sizeof(Allocation). This could
- // only be from non-plugin allocations and would cause infinite recursion
+ // only be from non-plugin allocations and would cause infinite recursion
// when allocating our Allocation in the list.
if (size <= sizeof(Allocation))
return 0;
-
+
Common::List<Allocation>::iterator i;
for (i = _allocList.begin(); i != _allocList.end(); i++) {
- if (i->start - lastAddress > (int)size)
+ if (i->start - lastAddress > (int)size)
break;
lastAddress = i->end();
// align to desired alignment
@@ -137,20 +137,20 @@ void *ELFMemoryManager::allocateOnHeap(uint32 align, uint32 size) {
lastAddress = (byte *)( ((uint32)lastAddress + align - 1) & ~(align - 1) );
}
}
-
+
// Check if we exceeded our heap limit
// We skip this case if we're only tracking allocations
if (!_trackAllocs && ((uint32)lastAddress + size > (uint32)_heap + _heapSize)) {
debug(2, "failed to find space to allocate %d bytes", size);
return 0;
}
-
+
_allocList.insert(i, Allocation(lastAddress, size));
_bytesAllocated += size;
-
- debug(7, "ELFMemoryManager: allocated %d bytes at %p. Total %d bytes",
+
+ debug(7, "ELFMemoryManager: allocated %d bytes at %p. Total %d bytes",
size, lastAddress, _bytesAllocated);
-
+
return lastAddress;
}
@@ -159,14 +159,14 @@ void ELFMemoryManager::deallocateFromHeap(void *ptr) {
for (i = _allocList.begin(); i != _allocList.end(); i++) {
if (i->start == ptr) {
_bytesAllocated -= (*i).size;
-
- debug(7, "ELFMemoryManager: freed %d bytes at %p. Total %d bytes",
+
+ debug(7, "ELFMemoryManager: freed %d bytes at %p. Total %d bytes",
(*i).size, (*i).start, _bytesAllocated);
-
+
_allocList.erase(i);
break;
}
- }
+ }
}
#endif /* defined(DYNAMIC_MODULES) && defined(USE_ELF_LOADER) */
diff --git a/backends/plugins/elf/memory-manager.h b/backends/plugins/elf/memory-manager.h
index ac70e5e3bb..032ecb2be5 100644
--- a/backends/plugins/elf/memory-manager.h
+++ b/backends/plugins/elf/memory-manager.h
@@ -30,17 +30,17 @@
#include "common/singleton.h"
#include "common/list.h"
#include "common/mutex.h"
-
+
/**
- * A 'foolproof' way to prevent memory fragmentation. This class is used to
- * serve as a permanent allocation to prevent the process of loading and
+ * A 'foolproof' way to prevent memory fragmentation. This class is used to
+ * serve as a permanent allocation to prevent the process of loading and
* unloading plugins from causing heavy fragmentation.
**/
-
+
#define ELFMemMan ELFMemoryManager::instance()
-
+
class ELFMemoryManager : public Common::Singleton<ELFMemoryManager> {
-public:
+public:
void trackPlugin(bool value);
void trackAlloc(uint32 align, uint32 size);
@@ -49,7 +49,7 @@ public:
void *pluginAllocate(uint32 size);
void *pluginAllocate(uint32 align, uint32 size);
void pluginDeallocate(void *ptr);
-
+
private:
friend class Common::Singleton<ELFMemoryManager>;
@@ -58,7 +58,7 @@ private:
void *allocateOnHeap(uint32 align, uint32 size);
void deallocateFromHeap(void *ptr);
-
+
struct Allocation {
byte *start;
uint32 size;
@@ -70,17 +70,17 @@ private:
void *_heap;
uint32 _heapAlign; // alignment of the heap
uint32 _heapSize; // size of the heap
-
+
// tracking allocations
bool _trackAllocs; // whether we are currently tracking
- uint32 _measuredSize;
- uint32 _measuredAlign;
-
+ uint32 _measuredSize;
+ uint32 _measuredAlign;
+
// real allocations
Common::List<Allocation> _allocList;
uint32 _bytesAllocated;
};
-
+
#endif /* defined(DYNAMIC_MODULES) && defined(USE_ELF_LOADER) */
#endif /* ELF_MEMORY_MANAGER_H */
diff --git a/backends/plugins/elf/mips-loader.cpp b/backends/plugins/elf/mips-loader.cpp
index 8ce1a69583..e043c9647f 100644
--- a/backends/plugins/elf/mips-loader.cpp
+++ b/backends/plugins/elf/mips-loader.cpp
@@ -53,7 +53,7 @@ bool MIPSDLObject::relocate(Elf32_Off offset, Elf32_Word size, byte *relSegment)
debug(2, "elfloader: Loaded relocation table. %d entries. base address=%p", cnt, relSegment);
Elf32_Addr adjustedMainSegment = Elf32_Addr(_segment) - _segmentVMA; // adjust for VMA offset
-
+
bool seenHi16 = false; // For treating HI/LO16 commands
int32 firstHi16 = -1; // Mark the point of the first hi16 seen
Elf32_Addr ahl = 0; // Calculated addend
@@ -259,7 +259,7 @@ void MIPSDLObject::relocateSymbols(ptrdiff_t offset) {
if (!ShortsMan.inGeneralSegment((char *)s->st_value)) {
if (s->st_value < _segmentVMA)
s->st_value = _segmentVMA; // deal with symbols referring to sections, which start before the VMA
-
+
s->st_value += offset;
if (s->st_value < Elf32_Addr(_segment) || s->st_value > Elf32_Addr(_segment) + _segmentSize)
@@ -287,7 +287,7 @@ bool MIPSDLObject::loadSegment(Elf32_Phdr *phdr) {
}
debug(2, "elfloader: Allocated segment @ %p", _segment);
-
+
// Get offset to load segment into
baseAddress = _segment;
_segmentSize = phdr->p_memsz;
diff --git a/base/commandLine.cpp b/base/commandLine.cpp
index e34cde4779..61853a1ebc 100644
--- a/base/commandLine.cpp
+++ b/base/commandLine.cpp
@@ -186,6 +186,8 @@ void registerDefaults() {
ConfMan.registerDefault("cdrom", 0);
+ ConfMan.registerDefault("enable_unsupported_game_warning", true);
+
// Game specific
ConfMan.registerDefault("path", "");
ConfMan.registerDefault("platform", Common::kPlatformPC);
diff --git a/base/main.cpp b/base/main.cpp
index 906f4c9242..717ccb3344 100644
--- a/base/main.cpp
+++ b/base/main.cpp
@@ -333,7 +333,7 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) {
PluginManager::instance().init();
PluginManager::instance().loadAllPlugins(); // load plugins for cached plugin manager
-
+
// If we received an invalid music parameter via command line we check this here.
// We can't check this before loading the music plugins.
// On the other hand we cannot load the plugins before we know the file paths (in case of external plugins).
@@ -385,7 +385,7 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) {
system.getAudioCDManager();
MusicManager::instance();
Common::DebugManager::instance();
-
+
// Init the event manager. As the virtual keyboard is loaded here, it must
// take place after the backend is initiated and the screen has been setup
system.getEventManager()->init();
@@ -424,10 +424,10 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) {
PluginManager::instance().unloadPluginsExcept(PLUGIN_TYPE_ENGINE, NULL, false);
// reallocate the config manager to get rid of any fragmentation
ConfMan.defragment();
- #endif
-
+ #endif
+
// Did an error occur ?
- if (result.getCode() != Common::kNoError) {
+ if (result.getCode() != Common::kNoError && result.getCode() != Common::kUserCanceled) {
// Shows an informative error dialog if starting the selected game failed.
GUI::displayErrorDialog(result, _("Error running game:"));
}
diff --git a/base/plugins.cpp b/base/plugins.cpp
index 8ce7b53254..4c2fd2cffc 100644
--- a/base/plugins.cpp
+++ b/base/plugins.cpp
@@ -313,7 +313,7 @@ PluginManager &PluginManager::instance() {
if (_instance)
return *_instance;
-#if defined(UNCACHED_PLUGINS) && defined(DYNAMIC_MODULES)
+#if defined(UNCACHED_PLUGINS) && defined(DYNAMIC_MODULES)
_instance = new PluginManagerUncached();
#else
_instance = new PluginManager();
@@ -348,7 +348,7 @@ void PluginManager::addPluginProvider(PluginProvider *pp) {
void PluginManagerUncached::init() {
unloadAllPlugins();
_allEnginePlugins.clear();
-
+
// Resize our pluginsInMem list to prevent fragmentation
_pluginsInMem[PLUGIN_TYPE_ENGINE].resize(2);
unloadPluginsExcept(PLUGIN_TYPE_ENGINE, NULL, false); // empty the engine plugins
@@ -357,7 +357,7 @@ void PluginManagerUncached::init() {
pp != _providers.end();
++pp) {
PluginList pl((*pp)->getPlugins());
-
+
for (PluginList::iterator p = pl.begin(); p != pl.end(); ++p) {
// This is a 'hack' based on the assumption that we have no sound
// file plugins. Currently this is the case. If it changes, we
@@ -365,15 +365,15 @@ void PluginManagerUncached::init() {
// music or an engine plugin.
if ((*pp)->isFilePluginProvider()) {
_allEnginePlugins.push_back(*p);
- } else if ((*p)->loadPlugin()) { // and this is the proper method
+ } else if ((*p)->loadPlugin()) { // and this is the proper method
if ((*p)->getType() == PLUGIN_TYPE_ENGINE) {
(*p)->unloadPlugin();
_allEnginePlugins.push_back(*p);
} else { // add non-engine plugins to the 'in-memory' list
// these won't ever get unloaded
- addToPluginsInMemList(*p);
+ addToPluginsInMemList(*p);
}
- }
+ }
}
}
}
@@ -403,7 +403,7 @@ bool PluginManagerUncached::loadPluginFromGameId(const Common::String &gameId) {
bool PluginManagerUncached::loadPluginByFileName(const Common::String &filename) {
if (filename.empty())
return false;
-
+
unloadPluginsExcept(PLUGIN_TYPE_ENGINE, NULL, false);
PluginList::iterator i;
@@ -417,7 +417,7 @@ bool PluginManagerUncached::loadPluginByFileName(const Common::String &filename)
return false;
}
-/**
+/**
* Update the config manager with a plugin file name that we found can handle
* the game.
**/
@@ -435,7 +435,7 @@ void PluginManagerUncached::updateConfigWithFileName(const Common::String &gameI
}
}
-void PluginManagerUncached::loadFirstPlugin() {
+void PluginManagerUncached::loadFirstPlugin() {
unloadPluginsExcept(PLUGIN_TYPE_ENGINE, NULL, false);
// let's try to find one we can load
@@ -517,7 +517,7 @@ void PluginManager::addToPluginsInMemList(Plugin *plugin) {
bool found = false;
// The plugin is valid, see if it provides the same module as an
// already loaded one and should replace it.
-
+
PluginList::iterator pl = _pluginsInMem[plugin->getType()].begin();
while (!found && pl != _pluginsInMem[plugin->getType()].end()) {
if (!strcmp(plugin->getName(), (*pl)->getName())) {
@@ -542,7 +542,7 @@ void PluginManager::addToPluginsInMemList(Plugin *plugin) {
DECLARE_SINGLETON(EngineManager);
-/**
+/**
* This function works for both cached and uncached PluginManagers.
* For the cached version, most of the logic here will short circuit.
*
@@ -554,24 +554,24 @@ GameDescriptor EngineManager::findGame(const Common::String &gameName, const Eng
// First look for the game using the plugins in memory. This is critical
// for calls coming from inside games
- result = findGameInLoadedPlugins(gameName, plugin);
+ result = findGameInLoadedPlugins(gameName, plugin);
if (!result.gameid().empty()) {
return result;
}
-
+
// Now look for the game using the gameId. This is much faster than scanning plugin
// by plugin
if (PluginMan.loadPluginFromGameId(gameName)) {
- result = findGameInLoadedPlugins(gameName, plugin);
+ result = findGameInLoadedPlugins(gameName, plugin);
if (!result.gameid().empty()) {
return result;
}
}
-
+
// We failed to find it using the gameid. Scan the list of plugins
PluginMan.loadFirstPlugin();
do {
- result = findGameInLoadedPlugins(gameName, plugin);
+ result = findGameInLoadedPlugins(gameName, plugin);
if (!result.gameid().empty()) {
// Update with new plugin file name
PluginMan.updateConfigWithFileName(gameName);
@@ -582,7 +582,7 @@ GameDescriptor EngineManager::findGame(const Common::String &gameName, const Eng
return result;
}
-/**
+/**
* Find the game within the plugins loaded in memory
**/
GameDescriptor EngineManager::findGameInLoadedPlugins(const Common::String &gameName, const EnginePlugin **plugin) const {
@@ -594,7 +594,7 @@ GameDescriptor EngineManager::findGameInLoadedPlugins(const Common::String &game
*plugin = 0;
EnginePlugin::List::const_iterator iter;
-
+
for (iter = plugins.begin(); iter != plugins.end(); ++iter) {
result = (**iter)->findGame(gameName.c_str());
if (!result.gameid().empty()) {
diff --git a/base/plugins.h b/base/plugins.h
index a1ae734159..fffb5fb910 100644
--- a/base/plugins.h
+++ b/base/plugins.h
@@ -143,7 +143,7 @@ extern int pluginTypeVersions[PLUGIN_TYPE_MAX];
// Abstract plugins
/**
- * Abstract base class for the plugin objects which handle 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. An existing PluginObject refers to an executable file
* loaded in memory and ready to run. The plugin, on the other hand, is just
@@ -310,7 +310,7 @@ protected:
bool tryLoadPlugin(Plugin *plugin);
void addToPluginsInMemList(Plugin *plugin);
-
+
static PluginManager *_instance;
PluginManager();
@@ -326,9 +326,9 @@ public:
virtual void init() {}
virtual void loadFirstPlugin() {}
virtual bool loadNextPlugin() { return false; }
- virtual bool loadPluginFromGameId(const Common::String &gameId) { return false; }
- virtual void updateConfigWithFileName(const Common::String &gameId) {}
-
+ virtual bool loadPluginFromGameId(const Common::String &gameId) { return false; }
+ virtual void updateConfigWithFileName(const Common::String &gameId) {}
+
// Functions used only by the cached PluginManager
virtual void loadAllPlugins();
void unloadAllPlugins();
@@ -338,7 +338,7 @@ public:
const PluginList &getPlugins(PluginType t) { return _pluginsInMem[t]; }
};
-/**
+/**
* Uncached version of plugin manager
* Keeps only one dynamic plugin in memory at a time
**/
@@ -349,15 +349,15 @@ protected:
PluginList::iterator _currentPlugin;
PluginManagerUncached() {}
- bool loadPluginByFileName(const Common::String &filename);
+ bool loadPluginByFileName(const Common::String &filename);
public:
virtual void init();
virtual void loadFirstPlugin();
virtual bool loadNextPlugin();
- virtual bool loadPluginFromGameId(const Common::String &gameId);
- virtual void updateConfigWithFileName(const Common::String &gameId);
-
+ virtual bool loadPluginFromGameId(const Common::String &gameId);
+ virtual void updateConfigWithFileName(const Common::String &gameId);
+
virtual void loadAllPlugins() {} // we don't allow this
};
diff --git a/base/version.cpp b/base/version.cpp
index 3083034714..c91698cba9 100644
--- a/base/version.cpp
+++ b/base/version.cpp
@@ -60,6 +60,11 @@ const char *gScummVMBuildDate = __DATE__ " " __TIME__;
const char *gScummVMVersionDate = SCUMMVM_VERSION " (" __DATE__ " " __TIME__ ")";
const char *gScummVMFullVersion = "ScummVM " SCUMMVM_VERSION " (" __DATE__ " " __TIME__ ")";
const char *gScummVMFeatures = ""
+#ifdef TAINTED_BUILD
+ // TAINTED means the build contains engines/subengines not enabled by default
+ "TAINTED "
+#endif
+
#ifdef USE_TREMOR
#ifdef USE_TREMOLO
// libTremolo is used on WinCE for better ogg performance
diff --git a/common/archive.h b/common/archive.h
index 3c75970d60..8400c56d69 100644
--- a/common/archive.h
+++ b/common/archive.h
@@ -143,7 +143,7 @@ class SearchSet : public Archive {
ArchiveNodeList::iterator find(const String &name);
ArchiveNodeList::const_iterator find(const String &name) const;
- // Add an archive keeping the list sorted by ascending priorities.
+ // Add an archive keeping the list sorted by descending priority.
void insert(const Node& node);
public:
diff --git a/common/config-manager.cpp b/common/config-manager.cpp
index 03fcb20abf..3941e27cc1 100644
--- a/common/config-manager.cpp
+++ b/common/config-manager.cpp
@@ -491,11 +491,9 @@ int ConfigManager::getInt(const String &key, const String &domName) const {
bool ConfigManager::getBool(const String &key, const String &domName) const {
String value(get(key, domName));
-
- if ((value == "true") || (value == "yes") || (value == "1"))
- return true;
- if ((value == "false") || (value == "no") || (value == "0"))
- return false;
+ bool val;
+ if (Common::parseBool(value, val))
+ return val;
error("ConfigManager::getBool(%s,%s): '%s' is not a valid bool",
key.c_str(), domName.c_str(), value.c_str());
diff --git a/common/config-manager.h b/common/config-manager.h
index 6f3f554459..78a62b9808 100644
--- a/common/config-manager.h
+++ b/common/config-manager.h
@@ -147,7 +147,7 @@ public:
static void defragment(); // move in memory to reduce fragmentation
void copyFrom(ConfigManager &source);
-
+
private:
friend class Singleton<SingletonBaseType>;
ConfigManager();
diff --git a/common/debug.cpp b/common/debug.cpp
index dbbb204deb..0dae344bb2 100644
--- a/common/debug.cpp
+++ b/common/debug.cpp
@@ -107,18 +107,13 @@ bool DebugManager::isDebugChannelEnabled(uint32 channel) {
#ifndef DISABLE_TEXT_CONSOLE
static void debugHelper(const char *s, va_list va, bool caret = true) {
- char buf[STRINGBUFLEN];
+ Common::String buf = Common::String::vformat(s, va);
- vsnprintf(buf, STRINGBUFLEN, s, va);
- buf[STRINGBUFLEN-1] = '\0';
-
- if (caret) {
- buf[STRINGBUFLEN-2] = '\0';
- strcat(buf, "\n");
- }
+ if (caret)
+ buf += '\n';
if (g_system)
- g_system->logMessage(LogMessageType::kDebug, buf);
+ g_system->logMessage(LogMessageType::kDebug, buf.c_str());
// TODO: Think of a good fallback in case we do not have
// any OSystem yet.
}
diff --git a/common/error.cpp b/common/error.cpp
index a6c52a0ce9..78178f8e27 100644
--- a/common/error.cpp
+++ b/common/error.cpp
@@ -67,6 +67,9 @@ static String errorToString(ErrorCode errorCode) {
case kEnginePluginNotSupportSaves:
return _s("Engine plugin does not support save states");
+ case kUserCanceled:
+ return _s("User canceled");
+
case kUnknownError:
default:
return _s("Unknown error");
diff --git a/common/error.h b/common/error.h
index 23c12b67e4..7043862eea 100644
--- a/common/error.h
+++ b/common/error.h
@@ -62,6 +62,8 @@ enum ErrorCode {
kEnginePluginNotFound, ///< Failed to find plugin to handle target
kEnginePluginNotSupportSaves, ///< Failed if plugin does not support listing save states
+ kUserCanceled, ///< User has canceled the launching of the game
+
kUnknownError ///< Catch-all error, used if no other error code matches
};
diff --git a/common/ptr.h b/common/ptr.h
index e0d026f964..fc272d3d41 100644
--- a/common/ptr.h
+++ b/common/ptr.h
@@ -240,7 +240,7 @@ public:
operator bool() const { return _pointer != 0; }
~ScopedPtr() {
- delete _pointer;
+ delete _pointer;
}
/**
diff --git a/common/quicktime.cpp b/common/quicktime.cpp
index 57534b301a..ee49b092a4 100644
--- a/common/quicktime.cpp
+++ b/common/quicktime.cpp
@@ -728,7 +728,7 @@ int QuickTimeParser::readESDS(Atom atom) {
byte tag;
int length;
-
+
readMP4Desc(_fd, tag, length);
_fd->readUint16BE(); // id
if (tag == kMP4ESDescTag)
@@ -736,7 +736,7 @@ int QuickTimeParser::readESDS(Atom atom) {
// Check if we've got the Config MPEG-4 header
readMP4Desc(_fd, tag, length);
- if (tag != kMP4DecConfigDescTag)
+ if (tag != kMP4DecConfigDescTag)
return 0;
track->objectTypeMP4 = _fd->readByte();
diff --git a/common/scummsys.h b/common/scummsys.h
index a425befecf..9d4b6a9677 100644
--- a/common/scummsys.h
+++ b/common/scummsys.h
@@ -302,6 +302,19 @@
#define MAXPATHLEN 256
#endif
+#ifndef scumm_va_copy
+ #if defined(va_copy)
+ #define scumm_va_copy va_copy
+ #elif defined(__va_copy)
+ #define scumm_va_copy __va_copy
+ #elif defined(_MSC_VER)
+ #define scumm_va_copy(dst, src) ((dst) = (src))
+ #else
+ #error scumm_va_copy undefined for this port
+ #endif
+#endif
+
+
//
// Typedef our system types unless they have already been defined by config.h,
diff --git a/common/str.cpp b/common/str.cpp
index 223188bdd6..a2cd4a0193 100644
--- a/common/str.cpp
+++ b/common/str.cpp
@@ -25,8 +25,6 @@
#include "common/str.h"
#include "common/util.h"
-#include <stdarg.h>
-
namespace Common {
MemoryPool *g_refCountPool = 0; // FIXME: This is never freed right now
@@ -429,10 +427,22 @@ uint String::hash() const {
// static
String String::format(const char *fmt, ...) {
String output;
- assert(output.isStorageIntern());
va_list va;
va_start(va, fmt);
+ output = String::vformat(fmt, va);
+ va_end(va);
+
+ return output;
+}
+
+// static
+String String::vformat(const char *fmt, va_list args) {
+ String output;
+ assert(output.isStorageIntern());
+
+ va_list va;
+ scumm_va_copy(va, args);
int len = vsnprintf(output._str, _builtinCapacity, fmt, va);
va_end(va);
@@ -457,7 +467,7 @@ String String::format(const char *fmt, ...) {
assert(!output.isStorageIntern());
size = output._extern._capacity;
- va_start(va, fmt);
+ scumm_va_copy(va, args);
len = vsnprintf(output._str, size, fmt, va);
va_end(va);
} while (len == -1 || len >= size - 1);
@@ -468,7 +478,7 @@ String String::format(const char *fmt, ...) {
} else {
// vsnprintf didn't have enough space, so grow buffer
output.ensureCapacity(len, false);
- va_start(va, fmt);
+ scumm_va_copy(va, args);
int len2 = vsnprintf(output._str, len+1, fmt, va);
va_end(va);
assert(len == len2);
diff --git a/common/str.h b/common/str.h
index 7b97dfe945..8e07b6233d 100644
--- a/common/str.h
+++ b/common/str.h
@@ -24,6 +24,8 @@
#include "common/scummsys.h"
+#include <stdarg.h>
+
namespace Common {
/**
@@ -213,10 +215,19 @@ public:
uint hash() const;
/**
- * Printf-like function. Returns a formatted String.
+ * Print formatted data into a String object. Similar to sprintf,
+ * except that it stores the result in (variably sized) String
+ * instead of a fixed size buffer.
*/
static Common::String format(const char *fmt, ...) GCC_PRINTF(1,2);
+ /**
+ * Print formatted data into a String object. Similar to vsprintf,
+ * except that it stores the result in (variably sized) String
+ * instead of a fixed size buffer.
+ */
+ static Common::String vformat(const char *fmt, va_list args);
+
public:
typedef char * iterator;
typedef const char * const_iterator;
diff --git a/common/system.cpp b/common/system.cpp
index 2dab687872..8d5bfd39cd 100644
--- a/common/system.cpp
+++ b/common/system.cpp
@@ -21,11 +21,6 @@
*/
#define FORBIDDEN_SYMBOL_EXCEPTION_exit
-#define FORBIDDEN_SYMBOL_EXCEPTION_FILE
-#define FORBIDDEN_SYMBOL_EXCEPTION_fputs
-#define FORBIDDEN_SYMBOL_EXCEPTION_fflush
-#define FORBIDDEN_SYMBOL_EXCEPTION_stdout
-#define FORBIDDEN_SYMBOL_EXCEPTION_stderr
#include "common/system.h"
#include "common/events.h"
@@ -145,20 +140,6 @@ Common::String OSystem::getDefaultConfigFileName() {
return "scummvm.ini";
}
-void OSystem::logMessage(LogMessageType::Type type, const char *message) {
-#if !defined(__PLAYSTATION2__) && !defined(__DS__)
- FILE *output = 0;
-
- if (type == LogMessageType::kInfo || type == LogMessageType::kDebug)
- output = stdout;
- else
- output = stderr;
-
- fputs(message, output);
- fflush(output);
-#endif
-}
-
Common::String OSystem::getSystemLanguage() const {
return "en_US";
}
diff --git a/common/system.h b/common/system.h
index 24728a918c..15fbe386b1 100644
--- a/common/system.h
+++ b/common/system.h
@@ -1125,7 +1125,7 @@ public:
* @param type the type of the message
* @param message the message itself
*/
- virtual void logMessage(LogMessageType::Type type, const char *message);
+ virtual void logMessage(LogMessageType::Type type, const char *message) = 0;
/**
* Open the log file in a way that allows the user to review it,
diff --git a/common/textconsole.cpp b/common/textconsole.cpp
index f2325ac9ad..ffa42e63a0 100644
--- a/common/textconsole.cpp
+++ b/common/textconsole.cpp
@@ -46,14 +46,14 @@ void setErrorHandler(ErrorHandler handler) {
#ifndef DISABLE_TEXT_CONSOLE
void warning(const char *s, ...) {
- char buf[STRINGBUFLEN];
+ Common::String output;
va_list va;
va_start(va, s);
- vsnprintf(buf, STRINGBUFLEN, s, va);
+ output = Common::String::vformat(s, va);
va_end(va);
- Common::String output = Common::String::format("WARNING: %s!\n", buf);
+ output = "WARNING: " + output + "!\n";
if (g_system)
g_system->logMessage(LogMessageType::kWarning, output.c_str());
@@ -64,6 +64,9 @@ void warning(const char *s, ...) {
#endif
void NORETURN_PRE error(const char *s, ...) {
+ // We don't use String::vformat here, as that require
+ // using the heap, and that might be impossible at this
+ // point, e.g. if the error was an "out-of-memory" error.
char buf_input[STRINGBUFLEN];
char buf_output[STRINGBUFLEN];
va_list va;
diff --git a/common/util.h b/common/util.h
index 5837c8beab..cd890c970f 100644
--- a/common/util.h
+++ b/common/util.h
@@ -208,11 +208,6 @@ enum RenderMode {
kRenderAmiga = 5
};
-enum HerculesDimensions {
- kHercW = 720,
- kHercH = 350
-};
-
struct RenderModeDescription {
const char *code;
const char *description;
diff --git a/common/winexe_ne.cpp b/common/winexe_ne.cpp
index 80266ba87e..8690f6795b 100644
--- a/common/winexe_ne.cpp
+++ b/common/winexe_ne.cpp
@@ -136,7 +136,7 @@ bool NEResources::loadFromCompressedEXE(const String &fileName) {
matchPos &= 0xFFF;
}
}
-
+
}
}
diff --git a/common/winexe_pe.h b/common/winexe_pe.h
index cc1d0c9770..b38f2f78f5 100644
--- a/common/winexe_pe.h
+++ b/common/winexe_pe.h
@@ -107,7 +107,7 @@ private:
uint32 offset;
uint32 size;
};
-
+
typedef HashMap<WinResourceID, Resource, WinResourceID_Hash, WinResourceID_EqualTo> LangMap;
typedef HashMap<WinResourceID, LangMap, WinResourceID_Hash, WinResourceID_EqualTo> NameMap;
typedef HashMap<WinResourceID, NameMap, WinResourceID_Hash, WinResourceID_EqualTo> TypeMap;
diff --git a/configure b/configure
index df0c948825..04ca85ffb6 100755
--- a/configure
+++ b/configure
@@ -65,8 +65,12 @@ get_var() {
# Add an engine: id name build subengines
add_engine() {
_engines="${_engines} ${1}"
+ if test "${3}" = "no" ; then
+ set_var _wip_engines "${_wip_engines} ${1}"
+ fi
set_var _engine_${1}_name "${2}"
set_var _engine_${1}_build "${3}"
+ set_var _engine_${1}_build_default "${3}"
set_var _engine_${1}_subengines "${4}"
for sub in ${4}; do
set_var _engine_${sub}_sub "yes"
@@ -178,6 +182,7 @@ _sdlpath="$PATH"
_nasmpath="$PATH"
NASMFLAGS=""
NASM=""
+_tainted_build=no
# The following variables are automatically detected, and should not
# be modified otherwise. Consider them read-only.
_posix=no
@@ -425,6 +430,11 @@ get_engine_build() {
get_var _engine_$1_build
}
+# Was this engine set to be built by default?
+get_engine_build_default() {
+ get_var _engine_$1_build_default
+}
+
# Get the subengines
get_engine_subengines() {
get_var _engine_$1_subengines
@@ -544,12 +554,19 @@ prepare_engine_build_strings() {
if test -n "$string" ; then
_engines_skipped="${_engines_skipped}#$string@"
fi
+
+ string=`get_engine_build_string $1 wip`
+ if test -n "$string" ; then
+ _engines_built_wip="${_engines_built_wip}#$string@"
+ fi
+
}
# Get the string about building an engine
get_engine_build_string() {
engine_string=""
engine_build=`get_engine_build $1`
+ engine_build_default=`get_engine_build_default $1`
show=no
# Check if the current engine should be shown for the current status
@@ -565,6 +582,14 @@ get_engine_build_string() {
fi
done
fi
+ # Test for enabled wip sub-engines
+ if test $2 = wip ; then
+ for subeng in `get_engine_subengines $1` ; do
+ if test `get_engine_build $subeng` != no -a `get_engine_build_default $subeng` = no ; then
+ show=yes
+ fi
+ done
+ fi
fi
# Convert static/dynamic to yes to ease the check of subengines
@@ -572,13 +597,18 @@ get_engine_build_string() {
engine_build=yes
fi
+ # Check if it is a wip engine
+ if test "$2" = "wip" -a "$engine_build" != "no" -a "$engine_build_default" = no; then
+ show=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 $engine_build`
+ engine_string=`$build_string_func $1 $engine_build $2`
else
- engine_string=`get_subengines_build_string $1 $engine_build`
+ engine_string=`get_subengines_build_string $1 $engine_build "" $2`
fi
engine_string="`get_engine_name $1` $engine_string"
@@ -590,14 +620,29 @@ get_engine_build_string() {
# Get the string about building subengines
get_subengines_build_string() {
all=yes
+ parent_engine=$1
subengine_string=$3
- for subeng in `get_engine_subengines $1` ; do
- if test `get_engine_build $subeng` = $2 ; then
+ parent_status=$4
+ parent_engine_build_default=`get_engine_build_default $parent_engine`
+
+ for subeng in `get_engine_subengines $parent_engine` ; do
+ subengine_build=`get_engine_build $subeng`
+ subengine_build_default=`get_engine_build_default $subeng`
+ if test \( $subengine_build = $2 -a "$parent_status" != wip \) -o \( "$parent_status" = wip -a $subengine_build != no -a "$subengine_build_default" = no \) ; then
subengine_string="$subengine_string [`get_engine_name $subeng`]"
else
all=no
fi
+
+ # handle engines that are on by default and have a single subengine that is off by default
+ if test "$parent_status" = wip ; then
+ if test $parent_engine_build_default = yes -a subengine ; then
+ all=no
+ fi
+ fi
+
done
+
if test $2 != no ; then
if test -n "$subengine_string" ; then
if test $all = yes ; then
@@ -612,19 +657,19 @@ get_subengines_build_string() {
# Engine specific build strings
get_scumm_build_string() {
if test `get_engine_build $1` != no ; then
- if test $2 != no ; then
+ if test $2 != no -a "$3" != wip ; then
base="[v0-v6 games]"
fi
- get_subengines_build_string $1 $2 "$base"
+ get_subengines_build_string $1 $2 "$base" $3
fi
}
get_saga_build_string() {
if test `get_engine_build $1` != no ; then
- if test $2 != no ; then
+ if test $2 != no -a "$3" != wip; then
base="[ITE]"
fi
- get_subengines_build_string $1 $2 "$base"
+ get_subengines_build_string $1 $2 "$base" $3
fi
}
@@ -3334,6 +3379,23 @@ for engine in $_engines; do
done
#
+# Detection of WIP/unstable engines
+#
+for engine in $_engines; do
+ engine_build=`get_engine_build $engine`
+ engine_build_default=`get_engine_build_default $engine`
+ engine_wip=false
+ if test $engine_build != no -a $engine_build_default = no ; then
+ engine_wip=true
+ set_var _tainted_build "yes"
+ fi
+ engine_wip_defname="ENGINE_WIP_`echo $engine | tr '[a-z]' '[A-Z]'`"
+ add_line_to_config_h "#define $engine_wip_defname $engine_wip"
+done
+
+add_to_config_h_if_yes `get_var _tainted_build` '#define TAINTED_BUILD'
+
+#
# Show which engines ("frontends") are to be built
#
echo
@@ -3358,6 +3420,12 @@ if test -n "$_engines_skipped" ; then
s/#/ /g'
fi
+if test -n "$_engines_built_wip" ; then
+ echo "WARNING: This ScummVM build contains the following UNSTABLE engines:"
+ echo $_engines_built_wip | sed 's/@/\
+/g
+s/#/ /g'
+fi
echo
echo "Creating config.h"
diff --git a/devtools/create_hugo/create_hugo.cpp b/devtools/create_hugo/create_hugo.cpp
index e54ade2b28..63b57f9c8f 100644
--- a/devtools/create_hugo/create_hugo.cpp
+++ b/devtools/create_hugo/create_hugo.cpp
@@ -743,7 +743,7 @@ int main(int argc, char *argv[]) {
writeUint16BE(outFile, 0);
writeUint16BE(outFile, kALnewscr_2d);
writeUint16BE(outFile, 0);
-
+
writeSByte(outFile, NUM_TUNES_1w);
writeSByte(outFile, SILENCE_1w);
writeSByte(outFile, TEST_SOUND_1w);
diff --git a/devtools/create_hugo/staticdisplay.h b/devtools/create_hugo/staticdisplay.h
index 03800017b5..99d155dc13 100644
--- a/devtools/create_hugo/staticdisplay.h
+++ b/devtools/create_hugo/staticdisplay.h
@@ -60,7 +60,7 @@ byte _palette[SIZE_PAL_ARRAY] = {
V2, V2, V2 // BRIGHTWHITE
};
#else
-// Original paletter found in original exe.
+// Original paletter found in original exe.
// Currently disabled, because the result is quite ugly!
// Color table of nearest standard 16 colors in system static palette
#define C1 191 // Low intensity value
diff --git a/devtools/create_kyradat/extract.cpp b/devtools/create_kyradat/extract.cpp
index 2b6499d3fb..5581dacec0 100644
--- a/devtools/create_kyradat/extract.cpp
+++ b/devtools/create_kyradat/extract.cpp
@@ -415,7 +415,7 @@ bool extractKyraForestSeqData(PAKFile &out, const ExtractInformation *info, cons
const uint8 *src = data;
uint8 *dst = buffer;
const PatchEntry *patchPos = patchData;
-
+
while (dst < (buffer + outsize)) {
if ((dst - buffer) == patchPos->pos) {
*dst++ = patchPos->val;
diff --git a/devtools/create_mads/main.cpp b/devtools/create_mads/main.cpp
index c5cd6d5b2e..aec9e45b8b 100644
--- a/devtools/create_mads/main.cpp
+++ b/devtools/create_mads/main.cpp
@@ -48,7 +48,7 @@ void link(const char *destFilename, char **srcFilenames, int srcCount) {
fwrite(headerStr, 1, 4, destFile);
for (int i = 0; i <= srcCount; ++i)
fwrite(&v, 1, 4, destFile);
-
+
// Set up buffer for copying
void *tempBuffer = malloc(BUFFER_SIZE);
@@ -117,7 +117,7 @@ int main(int argc, char *argv[]) {
// Change the extension
strcpy(p, ".bin");
}
-
+
// Compile the specified source file
bool result = Compile(argv[1], destFilename);
return result ? 0 : 1;
diff --git a/devtools/create_mads/parser.cpp b/devtools/create_mads/parser.cpp
index 0c6df43046..5df505e0df 100644
--- a/devtools/create_mads/parser.cpp
+++ b/devtools/create_mads/parser.cpp
@@ -44,7 +44,7 @@ enum CharCode {
};
enum TokenCode {
- NO_TOKEN, WORD, NUMBER, IDENTIFIER, END_OF_FILE, END_OF_LINE,
+ NO_TOKEN, WORD, NUMBER, IDENTIFIER, END_OF_FILE, END_OF_LINE,
RW_DEFINE, RW_COLON, RW_SUB, RW_END, RW_OPCODE,
ERROR
};
@@ -58,7 +58,7 @@ struct Literal {
union {
int integer;
} value;
-};
+};
struct SymbolEntry {
char symbol[MAX_TOKEN_STRING_LENGTH];
@@ -109,12 +109,12 @@ struct OpcodeEntry {
};
OpcodeEntry OpcodeList[OP_DUP + 1] = {
- {"HALT", OP_NO_PARAM}, {"IMM", OP_IMM_PARAM}, {"ZERO", OP_NO_PARAM}, {"ONE", OP_NO_PARAM},
- {"MINUSONE", OP_NO_PARAM}, {"STR", OP_IMM_PARAM}, {"DLOAD", OP_IMM_PARAM}, {"DSTORE", OP_IMM_PARAM},
+ {"HALT", OP_NO_PARAM}, {"IMM", OP_IMM_PARAM}, {"ZERO", OP_NO_PARAM}, {"ONE", OP_NO_PARAM},
+ {"MINUSONE", OP_NO_PARAM}, {"STR", OP_IMM_PARAM}, {"DLOAD", OP_IMM_PARAM}, {"DSTORE", OP_IMM_PARAM},
{"PAL", OP_IMM_PARAM}, {"LOAD", OP_IMM_PARAM}, {"GLOAD", OP_IMM_PARAM}, {"STORE", OP_IMM_PARAM},
{"GSTORE", OP_IMM_PARAM}, {"CALL", OP_IMM_PARAM}, {"LIBCALL", OP_IMM_PARAM}, {"RET", OP_NO_PARAM},
{"ALLOC", OP_IMM_PARAM}, {"JUMP", OP_TRANSFER_PARAM}, {"JMPFALSE", OP_TRANSFER_PARAM},
- {"JMPTRUE", OP_TRANSFER_PARAM}, {"EQUAL", OP_NO_PARAM}, {"LESS", OP_NO_PARAM},
+ {"JMPTRUE", OP_TRANSFER_PARAM}, {"EQUAL", OP_NO_PARAM}, {"LESS", OP_NO_PARAM},
{"LEQUAL", OP_NO_PARAM}, {"NEQUAL", OP_NO_PARAM}, {"GEQUAL", OP_NO_PARAM},
{"GREAT", OP_NO_PARAM}, {"PLUS", OP_NO_PARAM}, {"MINUS", OP_NO_PARAM},
{"LOR", OP_NO_PARAM}, {"MULT", OP_NO_PARAM}, {"DIV", OP_IMM_PARAM}, {"MOD", OP_NO_PARAM},
@@ -418,7 +418,7 @@ void handle_define() {
printf("Duplicate symbol encountered.\n");
token = ERROR;
return;
- }
+ }
// Store the new symbol name
strcpy(symbolTable[symbolCount].symbol, token_string);
@@ -529,7 +529,7 @@ void handle_instruction() {
printf("Incorrect opcode parameter encountered\n");
token = ERROR;
return;
- }
+ }
// Apply the correct opcode size to the previously stored opcode and save the byte(s)
if (literal.value.integer <= 0xff) {
@@ -559,7 +559,7 @@ void handle_instruction() {
printf("Incorrect opcode parameter encountered\n");
token = ERROR;
return;
- }
+ }
// Check to see if it's a backward jump to an existing label
int idx = jumpIndexOf(token_string);
@@ -641,7 +641,7 @@ void handle_sub() {
token = ERROR;
return;
}
-
+
// If this is the first subroutine, start writing out the data
if (subroutinesCount == 0)
write_header();
@@ -681,7 +681,7 @@ void handle_sub() {
// Save identifier, it's hopefully a jump symbol
strcpy(jumpDests[jumpDestCount].name, token_string);
get_token();
- if (token != RW_COLON)
+ if (token != RW_COLON)
token = ERROR;
else {
// Save the jump point
@@ -863,7 +863,7 @@ void get_special() {
strToUpper(token_string);
if (token_string[0] == '@')
token = IDENTIFIER;
- else if (!is_reserved_word())
+ else if (!is_reserved_word())
token = ERROR;
}
diff --git a/devtools/credits.pl b/devtools/credits.pl
index bf48304af3..48ce5e28e7 100755
--- a/devtools/credits.pl
+++ b/devtools/credits.pl
@@ -447,7 +447,6 @@ begin_credits("Credits");
begin_section("ScummVM Team");
begin_section("Project Leaders");
begin_persons();
- add_person("Max Horn", "Fingolfin", "");
add_person("Eugene Sandulenko", "sev", "");
end_persons();
end_section();
@@ -456,6 +455,7 @@ begin_credits("Credits");
begin_persons();
add_person("James Brown", "ender", "");
add_person("Vincent Hamm", "yaz0r", "ScummVM co-founder, Original Cruise/CinE author");
+ add_person("Max Horn", "Fingolfin", "");
add_person("Ludvig Strigeus", "ludde", "Original ScummVM and SimonVM author");
end_persons();
end_section();
@@ -466,7 +466,7 @@ begin_credits("Credits");
add_person("James Brown", "ender", "(retired)");
add_person("Jonathan Gray", "khalek", "(retired)");
add_person("Vincent Hamm", "yaz0r", "(retired)");
- add_person("Max Horn", "Fingolfin", "");
+ add_person("Max Horn", "Fingolfin", "(retired)");
add_person("Travis Howell", "Kirben", "(retired)");
add_person("Pawe&#322; Ko&#322;odziejski", "aquadran", "Codecs, iMUSE, Smush, etc.");
add_person("Gregory Montoir", "cyx", "");
@@ -606,7 +606,7 @@ begin_credits("Credits");
begin_section("SCI");
add_person("Greg Frieger", "_FRG_", "");
add_person("Paul Gilbert", "dreammaster", "");
- add_person("Max Horn", "Fingolfin", "");
+ add_person("Max Horn", "Fingolfin", "(retired)");
add_person("Filippos Karapetis", "[md5]", "");
add_person("Martin Kiewitz", "m_kiewitz", "");
add_person("Walter van Niftrik", "waltervn", "");
@@ -636,7 +636,7 @@ begin_credits("Credits");
begin_section("Sword25");
add_person("Eugene Sandulenko", "sev", "");
add_person("Filippos Karapetis", "[md5]", "");
- add_person("Max Horn", "Fingolfin", "");
+ add_person("Max Horn", "Fingolfin", "(retired)");
add_person("Paul Gilbert", "dreammaster", "");
add_person("Torbj&ouml;rn Andersson", "eriktorbjorn", "");
end_section();
@@ -652,7 +652,7 @@ begin_credits("Credits");
add_person("Fabio Battaglia", "Hkz", "PSX version support");
add_person("Paul Gilbert", "dreammaster", "");
add_person("Sven Hesse", "DrMcCoy", "");
- add_person("Max Horn", "Fingolfin", "");
+ add_person("Max Horn", "Fingolfin", "(retired)");
add_person("Filippos Karapetis", "[md5]", "");
add_person("Joost Peters", "joostp", "");
end_section();
@@ -732,7 +732,7 @@ begin_credits("Credits");
end_section();
begin_section("SDL (Win/Linux/OS X/etc.)");
- add_person("Max Horn", "Fingolfin", "");
+ add_person("Max Horn", "Fingolfin", "(retired)");
add_person("Eugene Sandulenko", "sev", "Asm routines, GFX layers");
end_section();
@@ -753,7 +753,7 @@ begin_credits("Credits");
begin_section("Other subsystems");
begin_section("Infrastructure");
- add_person("Max Horn", "Fingolfin", "Backend &amp; Engine APIs, file API, sound mixer, audiostreams, data structures, etc.");
+ add_person("Max Horn", "Fingolfin", "Backend &amp; Engine APIs, file API, sound mixer, audiostreams, data structures, etc. (retired)");
add_person("Eugene Sandulenko", "sev", "");
add_person("Johannes Schickel", "LordHoto", "");
end_section();
@@ -785,7 +785,6 @@ begin_credits("Credits");
add_person("James Brown", "Ender", "IRC Logs maintainer");
add_person("Thierry Crozat", "criezy", "Wiki maintainer");
add_person("Andre Heider", "dhewg", "Buildbot maintainer");
- add_person("Max Horn", "Fingolfin", "Forum, IRC channel and Mailing list maintainer");
add_person("Joost Peters", "JoostP", "Doxygen Project Documentation maintainer");
add_person("Jordi Vilalta Prat", "jvprat", "Wiki maintainer");
add_person("Eugene Sandulenko", "sev", "Forum, IRC channel, Screen Shots and Mailing list maintainer");
@@ -849,7 +848,7 @@ begin_credits("Credits");
end_section();
begin_section("Mac OS X");
- add_person("Max Horn", "Fingolfin", "");
+ add_person("Max Horn", "Fingolfin", "(retired)");
add_person("Oystein Eftevaag", "vinterstum", "");
end_section();
diff --git a/devtools/skycpt/cptcompiler.cpp b/devtools/skycpt/cptcompiler.cpp
index 264646816c..f6ee926075 100644
--- a/devtools/skycpt/cptcompiler.cpp
+++ b/devtools/skycpt/cptcompiler.cpp
@@ -503,7 +503,7 @@ void doCompile(FILE *inf, FILE *debOutf, FILE *resOutf, TextFile *cptDef, FILE *
fwrite(&tmp, 2, 1, debOutf);
tmp = 0;
fwrite(&tmp, 2, 1, debOutf);
-
+
printf("DEBUG Output File Position: 0x%08lX\r\n", ftell(debOutf));
printf("reset destination: %ld\n", ftell(debOutf));
for (int cnt = 0; cnt < 6; cnt++) {
diff --git a/devtools/tasmrecover/dreamweb/backdrop.asm b/devtools/tasmrecover/dreamweb/backdrop.asm
index c02d95bbe9..5dfe20bf5d 100644
--- a/devtools/tasmrecover/dreamweb/backdrop.asm
+++ b/devtools/tasmrecover/dreamweb/backdrop.asm
@@ -874,4 +874,3 @@ over147: mov ch,0
- \ No newline at end of file
diff --git a/devtools/tasmrecover/dreamweb/debug.asm b/devtools/tasmrecover/dreamweb/debug.asm
index 991e240fd1..951da4fa3f 100644
--- a/devtools/tasmrecover/dreamweb/debug.asm
+++ b/devtools/tasmrecover/dreamweb/debug.asm
@@ -379,4 +379,3 @@ debugtextr: db "00000",0
endif
- \ No newline at end of file
diff --git a/devtools/tasmrecover/dreamweb/dreamweb.asm b/devtools/tasmrecover/dreamweb/dreamweb.asm
index ea61338ae3..d357c5cd73 100644
--- a/devtools/tasmrecover/dreamweb/dreamweb.asm
+++ b/devtools/tasmrecover/dreamweb/dreamweb.asm
@@ -135,13 +135,24 @@ Dreamweb proc near
dodecisions: call cls
call setmode
call decide
+
+ cmp quitrequested, 0
+ jnz exitgame
+
cmp getback,4
jz mainloop
call titles
+
+ cmp quitrequested, 0
+ jnz exitgame
+
call credits
-playgame: call clearchanges
+playgame:
+ cmp quitrequested, 0
+ jnz exitgame
+ call clearchanges
call setmode
call loadpalfromiff
mov location,255
@@ -194,7 +205,11 @@ alreadyloaded: mov newlocation,255
call startup
mov commandtype,255
-mainloop: call screenupdate
+mainloop:
+ cmp quitrequested, 0
+ jnz exitgame
+
+ call screenupdate
cmp wongame,0
jnz endofgame
cmp mandead,1
@@ -235,7 +250,9 @@ endofgame: call clearbeforeload
call hangon
call endgame
jmp quickquit2
-
+
+exitgame:
+ ret
endp
@@ -6219,6 +6236,8 @@ savefiles db "DREAMWEB.D00",0
Recname db "DREAMWEB.DEM",0
+Quitrequested db 0
+
;-------------------------------------------------------End of code segment----
@@ -6257,6 +6276,3 @@ STACKSPACE ends
-
-
- \ No newline at end of file
diff --git a/devtools/tasmrecover/dreamweb/keypad.asm b/devtools/tasmrecover/dreamweb/keypad.asm
index d75a4fde82..8ac38524aa 100644
--- a/devtools/tasmrecover/dreamweb/keypad.asm
+++ b/devtools/tasmrecover/dreamweb/keypad.asm
@@ -1755,4 +1755,3 @@ Findtext1 proc near
endp
- \ No newline at end of file
diff --git a/devtools/tasmrecover/dreamweb/look.asm b/devtools/tasmrecover/dreamweb/look.asm
index b5bc913a73..399e1f16fd 100644
--- a/devtools/tasmrecover/dreamweb/look.asm
+++ b/devtools/tasmrecover/dreamweb/look.asm
@@ -164,4 +164,3 @@ dogetback: mov getback,1
- \ No newline at end of file
diff --git a/devtools/tasmrecover/dreamweb/monitor.asm b/devtools/tasmrecover/dreamweb/monitor.asm
index 7cc1a5a4dd..247ba10f2b 100644
--- a/devtools/tasmrecover/dreamweb/monitor.asm
+++ b/devtools/tasmrecover/dreamweb/monitor.asm
@@ -1493,4 +1493,3 @@ finishcurdel:
- \ No newline at end of file
diff --git a/devtools/tasmrecover/dreamweb/newplace.asm b/devtools/tasmrecover/dreamweb/newplace.asm
index cac6e100a7..ac703f6b11 100644
--- a/devtools/tasmrecover/dreamweb/newplace.asm
+++ b/devtools/tasmrecover/dreamweb/newplace.asm
@@ -53,7 +53,10 @@ Selectlocation proc near
call playchannel0
mov newlocation,255
-select: call delpointer
+select:
+ cmp quitrequested, 0
+ jnz quittravel
+ call delpointer
call readmouse
call showpointer
call vsync
@@ -578,4 +581,3 @@ Readcitypic proc near
- \ No newline at end of file
diff --git a/devtools/tasmrecover/dreamweb/object.asm b/devtools/tasmrecover/dreamweb/object.asm
index 93710d3c23..bdd043d588 100644
--- a/devtools/tasmrecover/dreamweb/object.asm
+++ b/devtools/tasmrecover/dreamweb/object.asm
@@ -2583,8 +2583,10 @@ findlenextext: mov cl,[es:si]
sub bx,extext
push bx ax
sub cx,bx
+ cmp cx, 0xffff; BIG FIXME! Find out why this is happening
+ jz $1
rep movsb
- pop bx
+$1: pop bx
sub extextpos,bx
pop si
@@ -2605,4 +2607,3 @@ beforethistext: mov [es:di],ax
- \ No newline at end of file
diff --git a/devtools/tasmrecover/dreamweb/print.asm b/devtools/tasmrecover/dreamweb/print.asm
index e1c2d451c9..a2052285f0 100644
--- a/devtools/tasmrecover/dreamweb/print.asm
+++ b/devtools/tasmrecover/dreamweb/print.asm
@@ -588,4 +588,3 @@ nomod: ret
endp
endif
- \ No newline at end of file
diff --git a/devtools/tasmrecover/dreamweb/saveload.asm b/devtools/tasmrecover/dreamweb/saveload.asm
index f10d87149d..369e799d53 100644
--- a/devtools/tasmrecover/dreamweb/saveload.asm
+++ b/devtools/tasmrecover/dreamweb/saveload.asm
@@ -109,7 +109,11 @@ restartops: call showopbox
call showmainops
call worktoscreenm
donefirstops: mov getback,0
-waitops: call readmouse
+waitops:
+ cmp quitrequested, 0
+ jnz justret
+
+ call readmouse
call showpointer
call vsync
call dumppointer
@@ -260,7 +264,11 @@ doload: mov loadingorsave,1
call namestoold
mov getback,0
-loadops: call delpointer
+loadops:
+ cmp quitrequested, 0
+ jnz quitloaded
+
+ call delpointer
call readmouse
call showpointer
call vsync
@@ -354,7 +362,11 @@ dodiscops: call scanfornames
call worktoscreenm
mov getback,0
-discopsloop: call delpointer
+discopsloop:
+ cmp quitrequested, 0
+ jnz quitdiscops
+
+ call delpointer
call readmouse
call showpointer
call vsync
@@ -364,6 +376,7 @@ discopsloop: call delpointer
call checkcoords
cmp getback,0
jz discopsloop
+quitdiscops:
ret
discopslist: dw opsx+59,opsx+114,opsy+30,opsy+76,loadgame
@@ -411,7 +424,11 @@ dosave: mov loadingorsave,2
mov getback,0
-saveops: call delpointer
+saveops:
+ cmp quitrequested, 0
+ jnz quitsavegame
+
+ call delpointer
call checkinput
call readmouse
call showpointer
@@ -423,6 +440,7 @@ saveops: call delpointer
call checkcoords
cmp getback,0
jz saveops
+quitsavegame:
ret
savelist: dw opsx+176,opsx+192,opsy+60,opsy+76,getbacktoops
@@ -1398,7 +1416,12 @@ Decide proc near
call fadescreenup
mov getback,0
-waitdecide: call readmouse
+waitdecide:
+ cmp quitrequested, 0
+ jz $1
+ ret
+$1:
+ call readmouse
call showpointer
call vsync
call dumppointer
@@ -1482,6 +1505,8 @@ alreadyloadold: mov ax,mousebutton
call doload
cmp getback,4
jz noloadold
+ cmp quitrequested, 0
+ jnz noloadold
call showdecisions
call worktoscreenm
mov getback,0
@@ -1492,4 +1517,3 @@ noloadold: ret
- \ No newline at end of file
diff --git a/devtools/tasmrecover/dreamweb/sblaster.asm b/devtools/tasmrecover/dreamweb/sblaster.asm
index 9eb9afc08f..46eb8e2366 100644
--- a/devtools/tasmrecover/dreamweb/sblaster.asm
+++ b/devtools/tasmrecover/dreamweb/sblaster.asm
@@ -1290,4 +1290,3 @@ nopitflip: cli
- \ No newline at end of file
diff --git a/devtools/tasmrecover/dreamweb/sprite.asm b/devtools/tasmrecover/dreamweb/sprite.asm
index bb7ba402f8..fadea3b790 100644
--- a/devtools/tasmrecover/dreamweb/sprite.asm
+++ b/devtools/tasmrecover/dreamweb/sprite.asm
@@ -441,7 +441,7 @@ notinbed: ret
Edeninbath proc near
cmp generaldead,0
- jz notinbed
+ jz notinbath
cmp sartaindead,0
jnz notinbath
call showgamereel
@@ -5031,4 +5031,3 @@ finishevery2: ret
- \ No newline at end of file
diff --git a/devtools/tasmrecover/dreamweb/talk.asm b/devtools/tasmrecover/dreamweb/talk.asm
index d2c27f059b..6bee4409b7 100644
--- a/devtools/tasmrecover/dreamweb/talk.asm
+++ b/devtools/tasmrecover/dreamweb/talk.asm
@@ -577,4 +577,3 @@ doredes: call delpointer
- \ No newline at end of file
diff --git a/devtools/tasmrecover/dreamweb/titles.asm b/devtools/tasmrecover/dreamweb/titles.asm
index a47f31a327..8f2b46e3f4 100644
--- a/devtools/tasmrecover/dreamweb/titles.asm
+++ b/devtools/tasmrecover/dreamweb/titles.asm
@@ -9,7 +9,10 @@ Titles proc near
else
call clearpalette
call biblequote
+ cmp quitrequested, 0
+ jnz titlesearly
call intro
+titlesearly:
ret
endif
@@ -580,4 +583,3 @@ realcreditsearly:
- \ No newline at end of file
diff --git a/devtools/tasmrecover/dreamweb/use.asm b/devtools/tasmrecover/dreamweb/use.asm
index 250aa00240..508e8bd4c1 100644
--- a/devtools/tasmrecover/dreamweb/use.asm
+++ b/devtools/tasmrecover/dreamweb/use.asm
@@ -3807,4 +3807,3 @@ nowinch: call showfirstuse
- \ No newline at end of file
diff --git a/devtools/tasmrecover/dreamweb/vars.asm b/devtools/tasmrecover/dreamweb/vars.asm
index e38470a7de..8646697e52 100644
--- a/devtools/tasmrecover/dreamweb/vars.asm
+++ b/devtools/tasmrecover/dreamweb/vars.asm
@@ -561,4 +561,3 @@ gameerror db 0
howmuchalloc dw 0
- \ No newline at end of file
diff --git a/devtools/tasmrecover/dreamweb/vgafades.asm b/devtools/tasmrecover/dreamweb/vgafades.asm
index 26874a428f..06cc9d6a44 100644
--- a/devtools/tasmrecover/dreamweb/vgafades.asm
+++ b/devtools/tasmrecover/dreamweb/vgafades.asm
@@ -864,4 +864,3 @@ Initialmoncols proc near
endp
- \ No newline at end of file
diff --git a/devtools/tasmrecover/dreamweb/vgagrafx.asm b/devtools/tasmrecover/dreamweb/vgagrafx.asm
index 1d8e5f5dc7..110fc95ee0 100644
--- a/devtools/tasmrecover/dreamweb/vgagrafx.asm
+++ b/devtools/tasmrecover/dreamweb/vgagrafx.asm
@@ -1760,4 +1760,3 @@ Title7graphics db "DREAMWEB.I07",0
Palettescreen db "DREAMWEB.PAL",0
- \ No newline at end of file
diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index 35e20d20ab..96fd6c45fa 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -19,6 +19,9 @@ generator = cpp(context, "DreamGen", blacklist = [
'cls',
'printundermon',
'worktoscreen',
- 'width160'
+ 'width160',
+ 'convertkey',
+ 'readabyte',
+ 'readoneblock'
])
generator.generate('dreamweb') #start routine
diff --git a/devtools/tasmrecover/tasm/cpp.py b/devtools/tasmrecover/tasm/cpp.py
index 3e5ae78438..0196e5b45c 100644
--- a/devtools/tasmrecover/tasm/cpp.py
+++ b/devtools/tasmrecover/tasm/cpp.py
@@ -36,20 +36,19 @@ class cpp:
self.failed = list(blacklist)
self.translated = []
self.proc_addr = []
- self.forwards = []
+ self.methods = []
self.fd.write("""%s
#include \"%s\"
namespace %s {
-
""" %(banner, header, namespace))
def expand_cb(self, match):
name = match.group(0).lower()
if len(name) == 2 and \
((name[0] in ['a', 'b', 'c', 'd'] and name[1] in ['h', 'x', 'l']) or name in ['si', 'di', 'es', 'ds', 'cs']):
- return "context.%s" %name
+ return "%s" %name
if self.indirection == -1:
try:
@@ -74,7 +73,7 @@ namespace %s {
if size == 0:
raise Exception("invalid var '%s' size %u" %(name, size))
if self.indirection == 0:
- value = "context.data.%s(k%s)" %("byte" if size == 1 else "word", name.capitalize())
+ value = "data.%s(k%s)" %("byte" if size == 1 else "word", name.capitalize())
elif self.indirection == -1:
value = "%s" %g.offset
self.indirection = 0
@@ -135,7 +134,7 @@ namespace %s {
m = re.match(r'seg\s+(.*?)$', expr)
if m is not None:
- return "context.data"
+ return "data"
match_id = True
m = re.match(r'offset\s+(.*?)$', expr)
@@ -174,7 +173,7 @@ namespace %s {
plus = ""
match_id = False
#print "COMMON_REG: ", reg, plus
- expr = "context.%s%s" %(reg, plus)
+ expr = "%s%s" %(reg, plus)
expr = re.sub(r'\b([0-9][a-fA-F0-9]*)h', '0x\\1', expr)
expr = re.sub(r'\b([0-1]+)b', parse_bin, expr)
@@ -188,9 +187,9 @@ namespace %s {
if indirection == 1:
if size == 1:
- expr = "context.%s.byte(%s)" %(seg_prefix, expr)
+ expr = "%s.byte(%s)" %(seg_prefix, expr)
elif size == 2:
- expr = "context.%s.word(%s)" %(seg_prefix, expr)
+ expr = "%s.word(%s)" %(seg_prefix, expr)
else:
expr = "@invalid size 0"
elif indirection == 0:
@@ -238,9 +237,11 @@ namespace %s {
jump_proc = True
if jump_proc:
- self.add_forward(name)
- return "{ %s(context); return; }" %name
+ return "{ %s(); return; }" %name
else:
+ # TODO: name or self.resolve_label(name) or self.mangle_label(name)??
+ if name in self.proc.retlabels:
+ return "return /* (%s) */" % (name)
return "goto %s" %self.resolve_label(name)
def _label(self, name):
@@ -253,17 +254,12 @@ namespace %s {
print "+scheduling function %s..." %name
self.proc_queue.append(name)
- def add_forward(self, name):
- if name not in self.forwards and name not in self.failed:
- self.forwards.append(name)
-
def _call(self, name):
name = name.lower()
if name == 'ax':
- self.body += "\t__dispatch_call(context, %s);\n" %self.expand('ax', 2)
+ self.body += "\t__dispatch_call(%s);\n" %self.expand('ax', 2)
return
- self.body += "\t%s(context);\n" %name
- self.add_forward(name);
+ self.body += "\t%s();\n" %name
self.schedule(name)
def _ret(self):
@@ -286,111 +282,111 @@ namespace %s {
self.body += "\t%s = %s;\n" %self.parse2(dst, src)
def _add(self, dst, src):
- self.body += "\tcontext._add(%s, %s);\n" %self.parse2(dst, src)
+ self.body += "\t_add(%s, %s);\n" %self.parse2(dst, src)
def _sub(self, dst, src):
- self.body += "\tcontext._sub(%s, %s);\n" %self.parse2(dst, src)
+ self.body += "\t_sub(%s, %s);\n" %self.parse2(dst, src)
def _and(self, dst, src):
- self.body += "\tcontext._and(%s, %s);\n" %self.parse2(dst, src)
+ self.body += "\t_and(%s, %s);\n" %self.parse2(dst, src)
def _or(self, dst, src):
- self.body += "\tcontext._or(%s, %s);\n" %self.parse2(dst, src)
+ self.body += "\t_or(%s, %s);\n" %self.parse2(dst, src)
def _xor(self, dst, src):
- self.body += "\tcontext._xor(%s, %s);\n" %self.parse2(dst, src)
+ self.body += "\t_xor(%s, %s);\n" %self.parse2(dst, src)
def _neg(self, dst):
dst = self.expand(dst)
- self.body += "\tcontext._neg(%s);\n" %(dst)
+ self.body += "\t_neg(%s);\n" %(dst)
def _cbw(self):
- self.body += "\tcontext.ax.cbw();\n"
+ self.body += "\tax.cbw();\n"
def _shr(self, dst, src):
- self.body += "\tcontext._shr(%s, %s);\n" %self.parse2(dst, src)
+ self.body += "\t_shr(%s, %s);\n" %self.parse2(dst, src)
def _shl(self, dst, src):
- self.body += "\tcontext._shl(%s, %s);\n" %self.parse2(dst, src)
+ self.body += "\t_shl(%s, %s);\n" %self.parse2(dst, src)
#def _sar(self, dst, src):
- # self.body += "\tcontext._sar(%s%s);\n" %self.parse2(dst, src)
+ # self.body += "\t_sar(%s%s);\n" %self.parse2(dst, src)
#def _sal(self, dst, src):
- # self.body += "\tcontext._sal(%s, %s);\n" %self.parse2(dst, src)
+ # self.body += "\t_sal(%s, %s);\n" %self.parse2(dst, src)
#def _rcl(self, dst, src):
- # self.body += "\tcontext._rcl(%s, %s);\n" %self.parse2(dst, src)
+ # self.body += "\t_rcl(%s, %s);\n" %self.parse2(dst, src)
#def _rcr(self, dst, src):
- # self.body += "\tcontext._rcr(%s, %s);\n" %self.parse2(dst, src)
+ # self.body += "\t_rcr(%s, %s);\n" %self.parse2(dst, src)
def _mul(self, src):
src = self.expand(src)
- self.body += "\tcontext._mul(%s);\n" %(src)
+ self.body += "\t_mul(%s);\n" %(src)
def _div(self, src):
src = self.expand(src)
- self.body += "\tcontext._div(%s);\n" %(src)
+ self.body += "\t_div(%s);\n" %(src)
def _inc(self, dst):
dst = self.expand(dst)
- self.body += "\tcontext._inc(%s);\n" %(dst)
+ self.body += "\t_inc(%s);\n" %(dst)
def _dec(self, dst):
dst = self.expand(dst)
- self.body += "\tcontext._dec(%s);\n" %(dst)
+ self.body += "\t_dec(%s);\n" %(dst)
def _cmp(self, a, b):
- self.body += "\tcontext._cmp(%s, %s);\n" %self.parse2(a, b)
+ self.body += "\t_cmp(%s, %s);\n" %self.parse2(a, b)
def _test(self, a, b):
- self.body += "\tcontext._test(%s, %s);\n" %self.parse2(a, b)
+ self.body += "\t_test(%s, %s);\n" %self.parse2(a, b)
def _js(self, label):
- self.body += "\tif (context.flags.s())\n\t\t%s;\n" %(self.jump_to_label(label))
+ self.body += "\tif (flags.s())\n\t\t%s;\n" %(self.jump_to_label(label))
def _jns(self, label):
- self.body += "\tif (!context.flags.s())\n\t\t%s;\n" %(self.jump_to_label(label))
+ self.body += "\tif (!flags.s())\n\t\t%s;\n" %(self.jump_to_label(label))
def _jz(self, label):
- self.body += "\tif (context.flags.z())\n\t\t%s;\n" %(self.jump_to_label(label))
+ self.body += "\tif (flags.z())\n\t\t%s;\n" %(self.jump_to_label(label))
def _jnz(self, label):
- self.body += "\tif (!context.flags.z())\n\t\t%s;\n" %(self.jump_to_label(label))
+ self.body += "\tif (!flags.z())\n\t\t%s;\n" %(self.jump_to_label(label))
def _jl(self, label):
- self.body += "\tif (context.flags.l())\n\t\t%s;\n" %(self.jump_to_label(label))
+ self.body += "\tif (flags.l())\n\t\t%s;\n" %(self.jump_to_label(label))
def _jg(self, label):
- self.body += "\tif (!context.flags.le())\n\t\t%s;\n" %(self.jump_to_label(label))
+ self.body += "\tif (!flags.le())\n\t\t%s;\n" %(self.jump_to_label(label))
def _jle(self, label):
- self.body += "\tif (context.flags.le())\n\t\t%s;\n" %(self.jump_to_label(label))
+ self.body += "\tif (flags.le())\n\t\t%s;\n" %(self.jump_to_label(label))
def _jge(self, label):
- self.body += "\tif (!context.flags.l())\n\t\t%s;\n" %(self.jump_to_label(label))
+ self.body += "\tif (!flags.l())\n\t\t%s;\n" %(self.jump_to_label(label))
def _jc(self, label):
- self.body += "\tif (context.flags.c())\n\t\t%s;\n" %(self.jump_to_label(label))
+ self.body += "\tif (flags.c())\n\t\t%s;\n" %(self.jump_to_label(label))
def _jnc(self, label):
- self.body += "\tif (!context.flags.c())\n\t\t%s;\n" %(self.jump_to_label(label))
+ self.body += "\tif (!flags.c())\n\t\t%s;\n" %(self.jump_to_label(label))
def _xchg(self, dst, src):
- self.body += "\tcontext._xchg(%s, %s);\n" %self.parse2(dst, src)
+ self.body += "\t_xchg(%s, %s);\n" %self.parse2(dst, src)
def _jmp(self, label):
self.body += "\t%s;\n" %(self.jump_to_label(label))
def _loop(self, label):
- self.body += "\tif (--context.cx)\n\t\t%s;\n" %self.jump_to_label(label)
+ self.body += "\tif (--cx)\n\t\t%s;\n" %self.jump_to_label(label)
def _push(self, regs):
p = str();
for r in regs:
r = self.expand(r)
- p += "\tcontext.push(%s);\n" %(r)
+ p += "\tpush(%s);\n" %(r)
self.body += p
def _pop(self, regs):
@@ -399,35 +395,35 @@ namespace %s {
self.temps_count -= 1
i = self.temps_count
r = self.expand(r)
- p += "\t%s = context.pop();\n" %r
+ p += "\t%s = pop();\n" %r
self.body += p
def _rep(self):
- self.body += "\twhile(context.cx--)\n\t"
+ self.body += "\twhile(cx--)\n\t"
def _lodsb(self):
- self.body += "\tcontext._lodsb();\n"
+ self.body += "\t_lodsb();\n"
def _lodsw(self):
- self.body += "\tcontext._lodsw();\n"
+ self.body += "\t_lodsw();\n"
- def _stosb(self, n):
- self.body += "\tcontext._stosb(%s);\n" %("" if n == 1 else n)
+ def _stosb(self, n, clear_cx):
+ self.body += "\t_stosb(%s%s);\n" %("" if n == 1 else n, ", true" if clear_cx else "")
- def _stosw(self, n):
- self.body += "\tcontext._stosw(%s);\n" %("" if n == 1 else n)
+ def _stosw(self, n, clear_cx):
+ self.body += "\t_stosw(%s%s);\n" %("" if n == 1 else n, ", true" if clear_cx else "")
- def _movsb(self, n):
- self.body += "\tcontext._movsb(%s);\n" %("" if n == 1 else n)
+ def _movsb(self, n, clear_cx):
+ self.body += "\t_movsb(%s%s);\n" %("" if n == 1 else n, ", true" if clear_cx else "")
- def _movsw(self, n):
- self.body += "\tcontext._movsw(%s);\n" %("" if n == 1 else n)
+ def _movsw(self, n, clear_cx):
+ self.body += "\t_movsw(%s%s);\n" %("" if n == 1 else n, ", true" if clear_cx else "")
def _stc(self):
- self.body += "\tcontext.flags._c = true;\n "
+ self.body += "\tflags._c = true;\n "
def _clc(self):
- self.body += "\tcontext.flags._c = false;\n "
+ self.body += "\tflags._c = false;\n "
def __proc(self, name, def_skip = 0):
try:
@@ -443,6 +439,7 @@ namespace %s {
self.proc = proc_module.proc(name)
self.proc.stmts = copy(src_proc.stmts)
self.proc.labels = copy(src_proc.labels)
+ self.proc.retlabels = copy(src_proc.retlabels)
#for p in xrange(skip, len(self.proc.stmts)):
# s = self.proc.stmts[p]
# if isinstance(s, op.basejmp):
@@ -453,7 +450,7 @@ namespace %s {
self.proc_addr.append((name, self.proc.offset))
self.body = str()
- self.body += "void %s(Context &context) {\n\tSTACK_CHECK(context);\n" %name;
+ self.body += "void %sContext::%s() {\n\tSTACK_CHECK;\n" %(self.namespace, name);
self.proc.optimize()
self.unbounded = []
self.proc.visit(self, skip)
@@ -479,6 +476,8 @@ namespace %s {
self.proc.stmts.append(s)
self.proc.add("ret")
print "skipping %d instructions, todo: %d" %(start, len(self.proc.stmts) - start)
+ print "re-optimizing..."
+ self.proc.optimize(keep_labels=[label])
self.proc.visit(self, start)
self.body += "}\n";
self.translated.insert(0, self.body)
@@ -499,7 +498,7 @@ namespace %s {
fd = open(fname, "wt")
fd.write("namespace %s {\n" %self.namespace)
for p in procs:
- fd.write("void %s(Context &context) {\n\t::error(\"%s\");\n}\n\n" %(p, p))
+ fd.write("void %sContext::%s() {\n\t::error(\"%s\");\n}\n\n" %(self.namespace, p, p))
fd.write("} /*namespace %s */\n" %self.namespace)
fd.close()
@@ -520,13 +519,11 @@ namespace %s {
print "continuing on %s" %name
self.proc_done.append(name)
self.__proc(name)
+ self.methods.append(name)
self.write_stubs("_stubs.cpp", self.failed)
+ self.methods += self.failed
done, failed = len(self.proc_done), len(self.failed)
- for f in self.forwards:
- if f not in self.failed:
- self.fd.write("void %s(Context &context);\n" %f)
-
self.fd.write("\n")
self.fd.write("\n".join(self.translated))
self.fd.write("\n\n")
@@ -540,20 +537,19 @@ namespace %s {
n += 1
if (n & 0xf) == 0:
data_impl += "\n\t\t"
- data_impl += "};\n\tcontext.ds.assign(src, src + sizeof(src));\n"
+ data_impl += "};\n\tds.assign(src, src + sizeof(src));\n"
self.hd.write(
"""\n#include "dreamweb/runtime.h"
namespace %s {
- void __dispatch_call(Context &context, unsigned addr);
- void __start(Context &context);
+class %sContext : public Context {
+public:
+ void __start();
+ void __dispatch_call(uint16 addr);
-""" %(self.namespace))
- for f in self.failed:
- self.hd.write("\tvoid %s(Context &context);\n" %f)
-
- offsets_decl = "\n"
+"""
+%(self.namespace, self.namespace))
offsets = []
for k, v in self.context.get_globals().items():
if isinstance(v, op.var):
@@ -563,20 +559,21 @@ namespace %s {
offsets = sorted(offsets, key=lambda t: t[1])
for o in offsets:
- offsets_decl += "\tconst static uint16 k%s = %s;\n" %o
- offsets_decl += "\n"
- self.hd.write(offsets_decl);
+ self.hd.write("\tconst static uint16 k%s = %s;\n" %o)
+ self.hd.write("\n")
+ for p in set(self.methods):
+ self.hd.write("\tvoid %s();\n" %p)
- self.hd.write("\n}\n\n#endif\n")
+ self.hd.write("};\n}\n\n#endif\n")
self.hd.close()
- self.fd.write("\nvoid __start(Context &context) { %s%s(context); \n}\n" %(data_impl, start))
+ self.fd.write("\nvoid %sContext::__start() { %s%s(); \n}\n" %(self.namespace, data_impl, start))
- self.fd.write("\nvoid __dispatch_call(Context &context, unsigned addr) {\n\tswitch(addr) {\n")
+ self.fd.write("\nvoid %sContext::__dispatch_call(uint16 addr) {\n\tswitch(addr) {\n" %self.namespace)
self.proc_addr.sort(cmp = lambda x, y: x[1] - y[1])
for name,addr in self.proc_addr:
- self.fd.write("\t\tcase 0x%04x: %s(context); break;\n" %(addr, name))
- self.fd.write("\t\tdefault: ::error(\"invalid call to %04x dispatched\", (uint16)context.ax);")
+ self.fd.write("\t\tcase 0x%04x: %s(); break;\n" %(addr, name))
+ self.fd.write("\t\tdefault: ::error(\"invalid call to %04x dispatched\", (uint16)ax);")
self.fd.write("\n\t}\n}\n\n} /*namespace*/\n")
self.fd.close()
diff --git a/devtools/tasmrecover/tasm/op.py b/devtools/tasmrecover/tasm/op.py
index 9baebccfc3..10fdd8a568 100644
--- a/devtools/tasmrecover/tasm/op.py
+++ b/devtools/tasmrecover/tasm/op.py
@@ -317,26 +317,30 @@ class _lodsw(baseop):
class _stosw(baseop):
def __init__(self, arg):
self.repeat = 1
+ self.clear_cx = False
def visit(self, visitor):
- visitor._stosw(self.repeat)
+ visitor._stosw(self.repeat, self.clear_cx)
class _stosb(baseop):
def __init__(self, arg):
self.repeat = 1
+ self.clear_cx = False
def visit(self, visitor):
- visitor._stosb(self.repeat)
+ visitor._stosb(self.repeat, self.clear_cx)
class _movsw(baseop):
def __init__(self, arg):
self.repeat = 1
+ self.clear_cx = False
def visit(self, visitor):
- visitor._movsw(self.repeat)
+ visitor._movsw(self.repeat, self.clear_cx)
class _movsb(baseop):
def __init__(self, arg):
self.repeat = 1
+ self.clear_cx = False
def visit(self, visitor):
- visitor._movsb(self.repeat)
+ visitor._movsb(self.repeat, self.clear_cx)
class _in(baseop):
def __init__(self, arg):
diff --git a/devtools/tasmrecover/tasm/proc.py b/devtools/tasmrecover/tasm/proc.py
index 1350ea1e0b..ed7053df89 100644
--- a/devtools/tasmrecover/tasm/proc.py
+++ b/devtools/tasmrecover/tasm/proc.py
@@ -9,6 +9,7 @@ class proc:
self.calls = []
self.stmts = []
self.labels = set()
+ self.retlabels = set()
self.__label_re = re.compile(r'^(\S+):(.*)$')
self.offset = proc.last_addr
proc.last_addr += 4
@@ -22,9 +23,9 @@ class proc:
self.labels.remove(label)
except:
pass
- for l in self.stmts:
- if isinstance(l, op.label) and l.name == label:
- self.stmts.remove(l)
+ for i in xrange(len(self.stmts)):
+ if isinstance(self.stmts[i], op.label) and self.stmts[i].name == label:
+ self.stmts[i] = op._nop(None)
return
def optimize_sequence(self, cls):
@@ -47,7 +48,8 @@ class proc:
n = j - i
if n > 1:
print "Eliminate consequtive storage instructions at %u-%u" %(i, j)
- del stmts[i + 1:j]
+ for k in range(i+1,j):
+ stmts[k] = op._nop(None)
stmts[i].repeat = n
else:
i = j
@@ -60,20 +62,28 @@ class proc:
if i + 1 >= len(stmts):
break
if isinstance(stmts[i + 1], cls):
- stmts[i + 1].repeat = 'context.cx'
- del stmts[i]
+ stmts[i + 1].repeat = 'cx'
+ stmts[i + 1].clear_cx = True
+ stmts[i] = op._nop(None)
i += 1
return
- def optimize(self):
+ def optimize(self, keep_labels=[]):
print "optimizing..."
- #trivial simplifications, removing last ret
+ #trivial simplifications
while len(self.stmts) and isinstance(self.stmts[-1], op.label):
print "stripping last label"
self.stmts.pop()
- if isinstance(self.stmts[-1], op._ret) and (len(self.stmts) < 2 or not isinstance(self.stmts[-2], op.label)):
- print "stripping last ret"
- self.stmts.pop()
+ #mark labels that directly precede a ret
+ for i in range(len(self.stmts)):
+ if not isinstance(self.stmts[i], op.label):
+ continue
+ j = i
+ while j < len(self.stmts) and isinstance(self.stmts[j], (op.label, op._nop)):
+ j += 1
+ if j == len(self.stmts) or isinstance(self.stmts[j], op._ret):
+ print "Return label: %s" % (self.stmts[i].name,)
+ self.retlabels.add(self.stmts[i].name)
#merging push ax pop bx constructs
i = 0
while i + 1 < len(self.stmts):
@@ -101,16 +111,26 @@ class proc:
if not isinstance(s, op.label):
continue
print "checking label %s..." %s.name
- used = False
- for j in self.stmts:
- if isinstance(j, op.basejmp) and j.label == s.name:
- print "used"
- used = True
- break
+ used = s.name in keep_labels
+ if s.name not in self.retlabels:
+ for j in self.stmts:
+ if isinstance(j, op.basejmp) and j.label == s.name:
+ print "used"
+ used = True
+ break
if not used:
print self.labels
self.remove_label(s.name)
+ #removing duplicate rets and rets at end
+ for i in xrange(len(self.stmts)):
+ if isinstance(self.stmts[i], op._ret):
+ j = i+1
+ while j < len(self.stmts) and isinstance(self.stmts[j], op._nop):
+ j += 1
+ if j == len(self.stmts) or isinstance(self.stmts[j], op._ret):
+ self.stmts[i] = op._nop(None)
+
self.optimize_sequence(op._stosb);
self.optimize_sequence(op._stosw);
self.optimize_sequence(op._movsb);
diff --git a/engines/advancedDetector.cpp b/engines/advancedDetector.cpp
index 7ae4d7718a..d864fe8b52 100644
--- a/engines/advancedDetector.cpp
+++ b/engines/advancedDetector.cpp
@@ -51,7 +51,13 @@ static GameDescriptor toGameDescriptor(const ADGameDescription &g, const PlainGa
extra = g.extra;
}
- GameDescriptor gd(g.gameid, title, g.language, g.platform);
+ GameSupportLevel gsl = kStableGame;
+ if (g.flags & ADGF_UNSTABLE)
+ gsl = kUnstableGame;
+ else if (g.flags & ADGF_TESTING)
+ gsl = kTestingGame;
+
+ GameDescriptor gd(g.gameid, title, g.language, g.platform, 0, gsl);
gd.updateDesc(extra);
return gd;
}
@@ -253,8 +259,21 @@ Common::Error AdvancedMetaEngine::createInstance(OSystem *syst, Engine **engine)
Common::updateGameGUIOptions(agdDesc->guioptions | _guioptions, lang);
+ GameDescriptor gameDescriptor = toGameDescriptor(*agdDesc, _gameids);
+
+ bool showTestingWarning = false;
+
+#ifdef RELEASE_BUILD
+ showTestingWarning = true;
+#endif
+
+ if (((gameDescriptor.getSupportLevel() == kUnstableGame
+ || (gameDescriptor.getSupportLevel() == kTestingGame
+ && showTestingWarning)))
+ && !Engine::warnUserAboutUnsupportedGame())
+ return Common::kUserCanceled;
- debug(2, "Running %s", toGameDescriptor(*agdDesc, _gameids).description().c_str());
+ debug(2, "Running %s", gameDescriptor.description().c_str());
if (!createInstance(syst, engine, agdDesc))
return Common::kNoGameDataFoundError;
else
diff --git a/engines/advancedDetector.h b/engines/advancedDetector.h
index 5360d23ac1..cbdfdf39d8 100644
--- a/engines/advancedDetector.h
+++ b/engines/advancedDetector.h
@@ -24,6 +24,7 @@
#define ENGINES_ADVANCED_DETECTOR_H
#include "engines/metaengine.h"
+#include "engines/engine.h"
namespace Common {
class Error;
@@ -62,6 +63,8 @@ struct ADGameFileDescription {
enum ADGameFlags {
ADGF_NO_FLAGS = 0,
+ ADGF_UNSTABLE = (1 << 21), // flag to designate not yet officially-supported games that are not fit for public testing
+ ADGF_TESTING = (1 << 22), // flag to designate not yet officially-supported games that are fit for public testing
ADGF_PIRATED = (1 << 23), ///< flag to designate well known pirated versions with cracks
ADGF_ADDENGLISH = (1 << 24), ///< always add English as language option
ADGF_MACRESFORK = (1 << 25), ///< the md5 for this entry will be calculated from the resource fork
diff --git a/engines/agi/agi.cpp b/engines/agi/agi.cpp
index 811a58f45d..0eefbab04d 100644
--- a/engines/agi/agi.cpp
+++ b/engines/agi/agi.cpp
@@ -188,7 +188,7 @@ void AgiEngine::processEvents() {
case Common::KEYCODE_KP5:
if (_predictiveDialogRunning)
key = event.kbd.ascii;
- else
+ else
key = KEY_STATIONARY;
break;
case Common::KEYCODE_PLUS:
diff --git a/engines/agi/detection.cpp b/engines/agi/detection.cpp
index 21ff5deb2c..a0736d0cc3 100644
--- a/engines/agi/detection.cpp
+++ b/engines/agi/detection.cpp
@@ -473,7 +473,7 @@ bool AgiBase::canLoadGameStateCurrently() {
bool AgiBase::canSaveGameStateCurrently() {
if (getGameID() == GID_BC) // Technically in Black Cauldron we may save anytime
return true;
-
+
return (!(getGameType() == GType_PreAGI) && getflag(fMenusWork) && !_noSaveLoadAllowed && _game.inputEnabled);
}
diff --git a/engines/agi/sound.cpp b/engines/agi/sound.cpp
index aa338db0f2..f2d7af32da 100644
--- a/engines/agi/sound.cpp
+++ b/engines/agi/sound.cpp
@@ -144,7 +144,7 @@ void SoundMgr::stopSound() {
// not be any harm doing it, so do it anyway.
if (_endflag != -1)
_vm->setflag(_endflag, true);
-
+
_endflag = -1;
}
diff --git a/engines/agi/sound_2gs.cpp b/engines/agi/sound_2gs.cpp
index 3c8a3dfc8d..38e256aa4b 100644
--- a/engines/agi/sound_2gs.cpp
+++ b/engines/agi/sound_2gs.cpp
@@ -167,12 +167,12 @@ uint SoundGen2GS::generateOutput() {
g->seg++;
}
}
-
+
// TODO: Advance vibrato here. The Apple IIGS uses a LFO with
// triangle wave to modulate the frequency of both oscillators.
// In Apple IIGS the vibrato and the envelope are updated at the
// same time, so the vibrato speed depends on ENVELOPE_COEF.
-
+
// Advance oscillators
int s0 = 0;
int s1 = 0;
@@ -202,12 +202,12 @@ uint SoundGen2GS::generateOutput() {
}
}
}
-
+
// Take envelope and MIDI volume information into account.
// Also amplify.
s0 *= vol * g->vel / 127 * 80 / 256;
s1 *= vol * g->vel / 127 * 80 / 256;
-
+
// Select output channel.
if (g->osc[0].chn)
outl += s0;
@@ -375,7 +375,7 @@ void SoundGen2GS::midiNoteOn(int channel, int note, int velocity) {
IIgsGenerator* g = allocateGenerator();
g->ins = _channels[channel].getInstrument();
const IIgsInstrumentHeader* i = g->ins;
-
+
// Pass information from the MIDI channel to the generator. Take
// velocity into account, although simplistically.
velocity *= 5 / 3;
@@ -385,7 +385,7 @@ void SoundGen2GS::midiNoteOn(int channel, int note, int velocity) {
g->key = note;
g->vel = velocity * _channels[channel].getVolume() / 127;
g->chn = channel;
-
+
// Instruments can define different samples to be used based on
// what the key is. Find the correct samples for our key.
int wa = 0;
diff --git a/engines/agi/sound_2gs.h b/engines/agi/sound_2gs.h
index 1a225300ae..9123e18415 100644
--- a/engines/agi/sound_2gs.h
+++ b/engines/agi/sound_2gs.h
@@ -33,7 +33,7 @@ namespace Agi {
// Apple IIGS to halt the corresponding oscillator immediately. We preprocess
// the sample data by converting it to signed values and the instruments by
// detecting prematurely stopping samples beforehand.
-//
+//
// Note: None of the tested SIERRASTANDARD files have zeroes in them. So in
// practice there is no need to check for them. However, they still do exist
// in the sample resources.
@@ -263,7 +263,7 @@ private:
uint _ticks; ///< MIDI ticks (60Hz)
int16 *_out; ///< Output buffer
uint _outSize; ///< Output buffer size
-
+
static const int kSfxMidiChannel = 15; ///< MIDI channel used for playing sample resources
};
diff --git a/engines/agi/sound_midi.cpp b/engines/agi/sound_midi.cpp
index d2c99171e2..0cbaa4af86 100644
--- a/engines/agi/sound_midi.cpp
+++ b/engines/agi/sound_midi.cpp
@@ -33,7 +33,7 @@
// Timing is not perfect, yet. It plays correct, when I use the
// Gravis-Midiplayer, but the songs are too fast when I use playmidi on
// Linux.
-//
+//
// Original program developed by Jens. Christian Restemeier
//
@@ -114,7 +114,7 @@ void SoundGenMIDI::endOfTrack() {
void SoundGenMIDI::play(int resnum) {
MIDISound *track;
-
+
stop();
_isGM = true;
@@ -153,7 +153,7 @@ unsigned char instr[] = {50, 51, 19};
static void writeDelta(Common::MemoryWriteStreamDynamic *st, int32 delta) {
int32 i;
- i = delta >> 21; if (i > 0) st->writeByte((i & 127) | 128);
+ i = delta >> 21; if (i > 0) st->writeByte((i & 127) | 128);
i = delta >> 14; if (i > 0) st->writeByte((i & 127) | 128);
i = delta >> 7; if (i > 0) st->writeByte((i & 127) | 128);
st->writeByte(delta & 127);
@@ -196,7 +196,7 @@ static uint32 convertSND2MIDI(byte *snddata, byte **data) {
int note;
/* I don't know, what frequency equals midi note 0 ... */
/* This moves the song 4 octaves down: */
- fr = (log10(111860.0 / (double)freq) / ll) - 48;
+ fr = (log10(111860.0 / (double)freq) / ll) - 48;
note = (int)floor(fr + 0.5);
if (note < 0) note = 0;
if (note > 127) note = 127;
@@ -222,7 +222,7 @@ static uint32 convertSND2MIDI(byte *snddata, byte **data) {
st.writeByte(0);
st.writeByte(0);
}
- }
+ }
writeDelta(&st, 0);
st.writeByte(0xff);
st.writeByte(0x2f);
diff --git a/engines/agi/sound_pcjr.h b/engines/agi/sound_pcjr.h
index f50fd0aa82..4317e86516 100644
--- a/engines/agi/sound_pcjr.h
+++ b/engines/agi/sound_pcjr.h
@@ -45,9 +45,9 @@ struct SndGenChan {
uint16 dissolveCount;
byte attenuation;
byte attenuationCopy;
-
+
GenType genType;
-
+
// for the sample mixer
int freqCount;
};
diff --git a/engines/agi/sound_sarien.cpp b/engines/agi/sound_sarien.cpp
index fc9a57791c..9ea8569b81 100644
--- a/engines/agi/sound_sarien.cpp
+++ b/engines/agi/sound_sarien.cpp
@@ -105,7 +105,7 @@ SoundGenSarien::~SoundGenSarien() {
int SoundGenSarien::readBuffer(int16 *buffer, const int numSamples) {
fillAudio(buffer, numSamples / 2);
-
+
return numSamples;
}
@@ -124,7 +124,7 @@ void SoundGenSarien::play(int resnum) {
for (int i = 0; i < NUM_CHANNELS; i++) {
_chn[i].type = type;
_chn[i].flags = AGI_SOUND_LOOP;
-
+
if (_env) {
_chn[i].flags |= AGI_SOUND_ENVELOPE;
_chn[i].adsr = AGI_SOUND_ENV_ATTACK;
diff --git a/engines/agi/text.cpp b/engines/agi/text.cpp
index fedfd29362..82a2340ad6 100644
--- a/engines/agi/text.cpp
+++ b/engines/agi/text.cpp
@@ -504,17 +504,16 @@ int AgiEngine::print(const char *p, int lin, int col, int len) {
*
*/
void AgiEngine::printStatus(const char *message, ...) {
- char x[42];
va_list args;
va_start(args, message);
- vsprintf(x, message, args);
+ Common::String x = Common::String::vformat(message, args);
va_end(args);
debugC(4, kDebugLevelText, "fg=%d, bg=%d", STATUS_FG, STATUS_BG);
- printText(x, 0, 0, _game.lineStatus, 40, STATUS_FG, STATUS_BG);
+ printText(x.c_str(), 0, 0, _game.lineStatus, 40, STATUS_FG, STATUS_BG);
}
static void safeStrcat(Common::String &p, const char *t) {
diff --git a/engines/agos/string.cpp b/engines/agos/string.cpp
index 1cdd7f6d81..f9a06cbecb 100644
--- a/engines/agos/string.cpp
+++ b/engines/agos/string.cpp
@@ -621,7 +621,7 @@ void AGOSEngine_PuzzlePack::printInfoText(const char *itemText) {
itemName = " Gem: ";
}
break;
-
+
case 82:
if (_variableArray[flag]) {
if (_variableArray[flag] == 201 || _variableArray[flag] == 211)
@@ -723,11 +723,9 @@ void AGOSEngine_Feeble::printScreenText(uint vgaSpriteId, uint color, const char
const char *string2 = string;
int16 height, talkDelay;
int stringLength = strlen(string);
- int lettersPerRow;
const int textHeight = 15;
height = textHeight;
- lettersPerRow = width / 6;
talkDelay = (stringLength + 3) / 3;
if (_variableArray[86] == 0)
@@ -840,13 +838,12 @@ void AGOSEngine_Feeble::printInteractText(uint16 num, const char *string) {
void AGOSEngine_Feeble::sendInteractText(uint16 num, const char *fmt, ...) {
va_list arglist;
- char string[256];
va_start(arglist, fmt);
- vsprintf(string, fmt, arglist);
+ Common::String string = Common::String::vformat(fmt, arglist);
va_end(arglist);
- printInteractText(num, string);
+ printInteractText(num, string.c_str());
}
#endif
diff --git a/engines/cine/various.cpp b/engines/cine/various.cpp
index 81e72d6905..cdb5140002 100644
--- a/engines/cine/various.cpp
+++ b/engines/cine/various.cpp
@@ -55,7 +55,7 @@ int16 canUseOnObject = 0;
void waitPlayerInput() {
uint16 button;
-
+
do {
manageEvents();
getMouseData(mouseUpdateStatus, &button, &dummyU16, &dummyU16);
diff --git a/engines/cruise/background.cpp b/engines/cruise/background.cpp
index 1e7e87cf38..4d1284a802 100644
--- a/engines/cruise/background.cpp
+++ b/engines/cruise/background.cpp
@@ -212,7 +212,7 @@ int loadBackground(const char *name, int idx) {
// NOTE: the following is really meant to compare pointers and not the actual
// strings. See r48092 and r48094.
if (name != backgroundTable[idx].name) {
- if (strlen(name) >= sizeof(backgroundTable[idx].name))
+ if (strlen(name) >= sizeof(backgroundTable[idx].name))
warning("background name length exceeded allowable maximum");
Common::strlcpy(backgroundTable[idx].name, name, sizeof(backgroundTable[idx].name));
diff --git a/engines/cruise/cruise_main.cpp b/engines/cruise/cruise_main.cpp
index 3f13c6cbff..a97583c972 100644
--- a/engines/cruise/cruise_main.cpp
+++ b/engines/cruise/cruise_main.cpp
@@ -1882,7 +1882,7 @@ void CruiseEngine::mainLoop() {
while (numIterations-- > 0) {
bgChanged = backgroundChanged[masterScreen];
-
+
manageScripts(&relHead);
manageScripts(&procHead);
diff --git a/engines/dialogs.cpp b/engines/dialogs.cpp
index 531cf32dbc..89c07ad24c 100644
--- a/engines/dialogs.cpp
+++ b/engines/dialogs.cpp
@@ -173,7 +173,7 @@ void MainMenuDialog::reflowLayout() {
_loadButton->setEnabled(_engine->canLoadGameStateCurrently());
if (_engine->hasFeature(Engine::kSupportsSavingDuringRuntime))
_saveButton->setEnabled(_engine->canSaveGameStateCurrently());
-
+
// Overlay size might have changed since the construction of the dialog.
// Update labels when it might be needed
// FIXME: it might be better to declare GUI::StaticTextWidget::setLabel() virtual
diff --git a/engines/drascula/detection.cpp b/engines/drascula/detection.cpp
index 2249a49e4d..6ba5597e8a 100644
--- a/engines/drascula/detection.cpp
+++ b/engines/drascula/detection.cpp
@@ -243,7 +243,7 @@ static const DrasculaGameDescription gameDescriptions[] = {
GUIO_NONE
},
},
-
+
{
// Drascula French version (ScummVM repacked files)
{
diff --git a/engines/drascula/graphics.cpp b/engines/drascula/graphics.cpp
index d133b3609d..9ea20e3e12 100644
--- a/engines/drascula/graphics.cpp
+++ b/engines/drascula/graphics.cpp
@@ -204,7 +204,7 @@ void DrasculaEngine::copyRect(int xorg, int yorg, int xdes, int ydes, int width,
}
ptr += 320 - width;
}
-
+
}
void DrasculaEngine::updateScreen(int xorg, int yorg, int xdes, int ydes, int width, int height, byte *buffer) {
@@ -354,7 +354,7 @@ void DrasculaEngine::centerText(const char *message, int textX, int textY) {
print_abc(msg, x, y);
return;
}
-
+
// Message doesn't fit on screen, split it
// Get a word from the message
diff --git a/engines/drascula/resource.cpp b/engines/drascula/resource.cpp
index bda25113b7..6da43e7cba 100644
--- a/engines/drascula/resource.cpp
+++ b/engines/drascula/resource.cpp
@@ -45,7 +45,7 @@ TextResourceParser::TextResourceParser(Common::SeekableReadStream *stream, Dispo
_stream(stream), _dispose(dispose) {
// NOTE: strangely enough, the code before this refactoring used the size of
- // the stream as a fixed maximum length for the parser. Using an updated
+ // the stream as a fixed maximum length for the parser. Using an updated
// (size-pos) would make more sense to me, but let's see what the experts say.
_maxLen = _stream->size();
}
diff --git a/engines/drascula/rooms.cpp b/engines/drascula/rooms.cpp
index 50d44bab79..9f725b6d76 100644
--- a/engines/drascula/rooms.cpp
+++ b/engines/drascula/rooms.cpp
@@ -1675,7 +1675,7 @@ void DrasculaEngine::enterRoom(int roomIndex) {
if (!stream) {
error("missing data file %s", fileName);
}
-
+
TextResourceParser p(stream, DisposeAfterUse::YES);
p.parseInt(roomNumber);
diff --git a/engines/dreamweb/detection.cpp b/engines/dreamweb/detection.cpp
index a5cb7b585f..18a2f899a8 100644
--- a/engines/dreamweb/detection.cpp
+++ b/engines/dreamweb/detection.cpp
@@ -50,7 +50,7 @@ static const PlainGameDescriptor dreamWebGames[] = {
class DreamWebMetaEngine : public AdvancedMetaEngine {
public:
DreamWebMetaEngine():
- AdvancedMetaEngine(DreamWeb::gameDescriptions,
+ AdvancedMetaEngine(DreamWeb::gameDescriptions,
sizeof(DreamWeb::DreamWebGameDescription), dreamWebGames) {
_singleid = "dreamweb";
_guioptions = Common::GUIO_NOMIDI;
@@ -74,8 +74,8 @@ public:
bool DreamWebMetaEngine::hasFeature(MetaEngineFeature f) const {
switch(f) {
case kSupportsListSaves:
- case kSupportsLoadingDuringStartup:
- case kSupportsDeleteSave:
+ //case kSupportsLoadingDuringStartup:
+ //case kSupportsDeleteSave:
return true;
default:
return false;
@@ -83,6 +83,12 @@ bool DreamWebMetaEngine::hasFeature(MetaEngineFeature f) const {
}
bool DreamWeb::DreamWebEngine::hasFeature(EngineFeature f) const {
+ switch(f) {
+ case kSupportsRTL:
+ return true;
+ default:
+ return false;
+ }
return false;
}
@@ -134,7 +140,7 @@ Common::Error DreamWebEngine::loadGameState(int slot) {
return Common::kNoError;
}
-Common::Error DreamWebEngine::saveGameState(int slot, const char *desc) {
+Common::Error DreamWebEngine::saveGameState(int slot, const Common::String &desc) {
return Common::kNoError;
}
diff --git a/engines/dreamweb/detection_tables.h b/engines/dreamweb/detection_tables.h
index 13184650ba..f32b8de6b6 100644
--- a/engines/dreamweb/detection_tables.h
+++ b/engines/dreamweb/detection_tables.h
@@ -42,7 +42,7 @@ static const DreamWebGameDescription gameDescriptions[] = {
},
Common::EN_ANY,
Common::kPlatformPC,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
GUIO_NONE
},
},
@@ -59,7 +59,7 @@ static const DreamWebGameDescription gameDescriptions[] = {
},
Common::EN_ANY,
Common::kPlatformPC,
- ADGF_CD,
+ ADGF_CD | ADGF_UNSTABLE,
GUIO_NONE
},
},
@@ -81,6 +81,23 @@ static const DreamWebGameDescription gameDescriptions[] = {
},
},
+ // German CD release
+ {
+ {
+ "dreamweb",
+ "CD",
+ {
+ {"dreamweb.r00", 0, "9960dc3baddabc6ad2a6fd75292b149c", 155886},
+ {"dreamweb.r02", 0, "076ca7cd326cb2abfb2091c6cf46ae08", 201038},
+ AD_LISTEND
+ },
+ Common::DE_DEU,
+ Common::kPlatformPC,
+ ADGF_CD | ADGF_UNSTABLE,
+ GUIO_NONE
+ },
+ },
+
{ AD_TABLE_END_MARKER }
};
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index ba1e5ba159..da0d71f7fe 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -4,22247 +4,21423 @@
namespace DreamGen {
-void checkbasemem(Context &context);
-void allocatebuffers(Context &context);
-void clearbuffers(Context &context);
-void clearpalette(Context &context);
-void readsetdata(Context &context);
-void scanfornames(Context &context);
-void loadpalfromiff(Context &context);
-void titles(Context &context);
-void credits(Context &context);
-void decide(Context &context);
-void clearchanges(Context &context);
-void loadroom(Context &context);
-void clearsprites(Context &context);
-void initman(Context &context);
-void entrytexts(Context &context);
-void entryanims(Context &context);
-void initialinv(Context &context);
-void startup1(Context &context);
-void clearbeforeload(Context &context);
-void startup(Context &context);
-void worktoscreenm(Context &context);
-void screenupdate(Context &context);
-void showgun(Context &context);
-void fadescreendown(Context &context);
-void hangon(Context &context);
-void fadescreendowns(Context &context);
-void endgame(Context &context);
-void makename(Context &context);
-void standardload(Context &context);
-void getroomspaths(Context &context);
-void readheader(Context &context);
-void allocateload(Context &context);
-void fillspace(Context &context);
-void sortoutmap(Context &context);
-void findroominloc(Context &context);
-void deletetaken(Context &context);
-void setallchanges(Context &context);
-void autoappear(Context &context);
-void getroomdata(Context &context);
-void autosetwalk(Context &context);
-void findxyfrompath(Context &context);
-void twodigitnum(Context &context);
-void startloading(Context &context);
-void loadroomssample(Context &context);
-void switchryanon(Context &context);
-void drawflags(Context &context);
-void getdimension(Context &context);
-void getflagunderp(Context &context);
-void dumpblink(Context &context);
-void showblink(Context &context);
-void showframe(Context &context);
-void printcurs(Context &context);
-void delcurs(Context &context);
-void delpointer(Context &context);
-void readmouse(Context &context);
-void animpointer(Context &context);
-void showpointer(Context &context);
-void dumppointer(Context &context);
-void commandonly(Context &context);
-void showtime(Context &context);
-void showwatch(Context &context);
-void printmessage(Context &context);
-void printdirect(Context &context);
-void usecharset1(Context &context);
-void showpanel(Context &context);
-void showman(Context &context);
-void roomname(Context &context);
-void panelicons1(Context &context);
-void zoomicon(Context &context);
-void middlepanel(Context &context);
-void findobname(Context &context);
-void workoutframes(Context &context);
-void checkdest(Context &context);
-void bresenhams(Context &context);
-void facerightway(Context &context);
-void checkone(Context &context);
-void commandwithob(Context &context);
-void findnextcolon(Context &context);
-void deltextline(Context &context);
-void copyname(Context &context);
-void finishedwalking(Context &context);
-void examineob(Context &context);
-void talk(Context &context);
-void setwalk(Context &context);
-void examineobtext(Context &context);
-void blocknametext(Context &context);
-void personnametext(Context &context);
-void walktotext(Context &context);
-void clearwork(Context &context);
-void drawfloor(Context &context);
-void reelsonscreen(Context &context);
-void spriteupdate(Context &context);
-void printsprites(Context &context);
-void playchannel0(Context &context);
-void cancelch0(Context &context);
-void createpanel(Context &context);
-void findpathofpoint(Context &context);
-void showicon(Context &context);
-void undertextline(Context &context);
-void mainscreen(Context &context);
-void getunderzoom(Context &context);
-void zoom(Context &context);
-void walkintoroom(Context &context);
-void reminders(Context &context);
-void atmospheres(Context &context);
-void findormake(Context &context);
-void obname(Context &context);
-void pixelcheckset(Context &context);
-void isitdescribed(Context &context);
-void getreelstart(Context &context);
-void getreelframeax(Context &context);
-void blank(Context &context);
-void findfirstpath(Context &context);
-void checkifex(Context &context);
-void checkiffree(Context &context);
-void checkifperson(Context &context);
-void checkifset(Context &context);
-void identifyob(Context &context);
-void checkcoords(Context &context);
-void walkandexamine(Context &context);
-void convnum(Context &context);
-void onedigit(Context &context);
-void plotreel(Context &context);
-void checkforshake(Context &context);
-void newplace(Context &context);
-void readmouse1(Context &context);
-void dumptextline(Context &context);
-void autolook(Context &context);
-void watchcount(Context &context);
-void readmouse2(Context &context);
-void dumpzoom(Context &context);
-void deleverything(Context &context);
-void afternewroom(Context &context);
-void readmouse3(Context &context);
-void dumpmap(Context &context);
-void dumptimedtext(Context &context);
-void readmouse4(Context &context);
-void dumpwatch(Context &context);
-void fadescreenup(Context &context);
-void clearreels(Context &context);
-void clearrest(Context &context);
-void trysoundalloc(Context &context);
-void allocatework(Context &context);
-void checkforemm(Context &context);
-void getanyad(Context &context);
-void transfertoex(Context &context);
-void pickupob(Context &context);
-void switchryanoff(Context &context);
-void resetlocation(Context &context);
-void removefreeobject(Context &context);
-void checkifpathison(Context &context);
-void turnpathon(Context &context);
-void removesetobject(Context &context);
-void placesetobject(Context &context);
-void turnanypathon(Context &context);
-void setuptimeduse(Context &context);
-void volumeadjust(Context &context);
-void loopchannel0(Context &context);
-void cancelch1(Context &context);
-void createname(Context &context);
-void doload(Context &context);
-void showdecisions(Context &context);
-void showopbox(Context &context);
-void showloadops(Context &context);
-void showslots(Context &context);
-void shownames(Context &context);
-void namestoold(Context &context);
-void getridoftemp(Context &context);
-void initrain(Context &context);
-void createpanel2(Context &context);
-void loadsavebox(Context &context);
-void storeit(Context &context);
-void makeheader(Context &context);
-void oldtonames(Context &context);
-void showsaveops(Context &context);
-void readkey(Context &context);
-void getnamepos(Context &context);
-void selectslot(Context &context);
-void loadposition(Context &context);
-void saveposition(Context &context);
-void restoreall(Context &context);
-void redrawmainscrn(Context &context);
-void checkinput(Context &context);
-void showdiscops(Context &context);
-void loadintotemp(Context &context);
-void getback1(Context &context);
-void getridofall(Context &context);
-void showmainops(Context &context);
-void dosaveload(Context &context);
-void findtext1(Context &context);
-void usetempcharset(Context &context);
-void playchannel1(Context &context);
-void getlocation(Context &context);
-void setlocation(Context &context);
-void hangonp(Context &context);
-void showdiary(Context &context);
-void showdiarypage(Context &context);
-void getridofreels(Context &context);
-void loadtemptext(Context &context);
-void loadtempcharset(Context &context);
-void showdiarykeys(Context &context);
-void dumpdiarykeys(Context &context);
-void getridoftemptext(Context &context);
-void getridoftempcharset(Context &context);
-void restorereels(Context &context);
-void nextsymbol(Context &context);
-void showsymbol(Context &context);
-void updatesymboltop(Context &context);
-void updatesymbolbot(Context &context);
-void dumpsymbol(Context &context);
-void turnanypathoff(Context &context);
-void folderexit(Context &context);
-void showleftpage(Context &context);
-void showrightpage(Context &context);
-void loadintotemp2(Context &context);
-void loadintotemp3(Context &context);
-void showfolder(Context &context);
-void folderhints(Context &context);
-void loadfolder(Context &context);
-void getridoftemp2(Context &context);
-void getridoftemp3(Context &context);
-void loadmenu(Context &context);
-void getundermenu(Context &context);
-void putundermenu(Context &context);
-void showmenu(Context &context);
-void dumpmenu(Context &context);
-void singlekey(Context &context);
-void buttonpress(Context &context);
-void loadkeypad(Context &context);
-void showouterpad(Context &context);
-void showkeypad(Context &context);
-void dumpkeypad(Context &context);
-void addtopresslist(Context &context);
-void isitright(Context &context);
-void checkinside(Context &context);
-void compare(Context &context);
-void showfirstuse(Context &context);
-void putbackobstuff(Context &context);
-void withwhat(Context &context);
-void showpuztext(Context &context);
-void placefreeobject(Context &context);
-void issetobonmap(Context &context);
-void showseconduse(Context &context);
-void removeobfrominv(Context &context);
-void turnpathoff(Context &context);
-void getundertimed(Context &context);
-void putundertimed(Context &context);
-void getsetad(Context &context);
-void getfreead(Context &context);
-void dochange(Context &context);
-void findpuztext(Context &context);
-void showexit(Context &context);
-void obicons(Context &context);
-void obpicture(Context &context);
-void describeob(Context &context);
-void getanyaddir(Context &context);
-void findinvpos(Context &context);
-void useroutine(Context &context);
-void printmessage2(Context &context);
-void fillryan(Context &context);
-void findsetobject(Context &context);
-void getobtextstart(Context &context);
-void usetext(Context &context);
-void selectlocation(Context &context);
-void hangonw(Context &context);
-void moneypoke(Context &context);
-void nextcolon(Context &context);
-void getexad(Context &context);
-void entercode(Context &context);
-void findexobject(Context &context);
-void makeworn(Context &context);
-void isryanholding(Context &context);
-void nothelderror(Context &context);
-void triggermessage(Context &context);
-void monprint(Context &context);
-void printchar(Context &context);
-void showcurrentfile(Context &context);
-void printlogo(Context &context);
-void randomaccess(Context &context);
-void locklighton(Context &context);
-void locklightoff(Context &context);
-void makecaps(Context &context);
-void monmessage(Context &context);
-void scrollmonitor(Context &context);
-void searchforstring(Context &context);
-void getkeyandlogo(Context &context);
-void monitorlogo(Context &context);
-void parser(Context &context);
-void neterror(Context &context);
-void processtrigger(Context &context);
-void input(Context &context);
-void dirfile(Context &context);
-void searchforfiles(Context &context);
-void dircom(Context &context);
-void signon(Context &context);
-void read(Context &context);
-void showkeys(Context &context);
-void delchar(Context &context);
-void randomnum1(Context &context);
-void accesslighton(Context &context);
-void accesslightoff(Context &context);
-void powerlighton(Context &context);
-void powerlightoff(Context &context);
-void lookininterface(Context &context);
-void loadpersonal(Context &context);
-void loadnews(Context &context);
-void loadcart(Context &context);
-void printoutermon(Context &context);
-void initialmoncols(Context &context);
-void turnonpower(Context &context);
-void fadeupyellows(Context &context);
-void fadeupmonfirst(Context &context);
-void hangoncurs(Context &context);
-void execcommand(Context &context);
-void purgealocation(Context &context);
-void getdestinfo(Context &context);
-void showarrows(Context &context);
-void locationpic(Context &context);
-void getundercentre(Context &context);
-void putundercentre(Context &context);
-void readcitypic(Context &context);
-void showcity(Context &context);
-void readdesticon(Context &context);
-void loadtraveltext(Context &context);
-void convicons(Context &context);
-void starttalk(Context &context);
-void hangonpq(Context &context);
-void redes(Context &context);
-void dosometalk(Context &context);
-void getpersontext(Context &context);
-void getpersframe(Context &context);
-void findsource(Context &context);
-void printslow(Context &context);
-void dolook(Context &context);
-void getxad(Context &context);
-void getyad(Context &context);
-void getmapad(Context &context);
-void calcfrframe(Context &context);
-void finalframe(Context &context);
-void makesprite(Context &context);
-void makebackob(Context &context);
-void addalong(Context &context);
-void addlength(Context &context);
-void eraseoldobs(Context &context);
-void calcmapad(Context &context);
-void doblocks(Context &context);
-void showallobs(Context &context);
-void showallfree(Context &context);
-void showallex(Context &context);
-void paneltomap(Context &context);
-void deleteexframe(Context &context);
-void deleteextext(Context &context);
-void deleteexobject(Context &context);
-void purgeanitem(Context &context);
-void getexpos(Context &context);
-void transfermap(Context &context);
-void transferinv(Context &context);
-void transfertext(Context &context);
-void transfercontoex(Context &context);
-void emergencypurge(Context &context);
-void pickupconts(Context &context);
-void findopenpos(Context &context);
-void reexfromopen(Context &context);
-void geteitherad(Context &context);
-void fillopen(Context &context);
-void useopened(Context &context);
-void getopenedsize(Context &context);
-void errormessage3(Context &context);
-void errormessage2(Context &context);
-void examicon(Context &context);
-void outofopen(Context &context);
-void swapwithopen(Context &context);
-void isitworn(Context &context);
-void wornerror(Context &context);
-void errormessage1(Context &context);
-void checkobjectsize(Context &context);
-void openinv(Context &context);
-void openob(Context &context);
-void droperror(Context &context);
-void cantdrop(Context &context);
-void reexfrominv(Context &context);
-void intoinv(Context &context);
-void outofinv(Context &context);
-void swapwithinv(Context &context);
-void makemainscreen(Context &context);
-void searchforsame(Context &context);
-void lookatcard(Context &context);
-void obsthatdothings(Context &context);
-void additionaltext(Context &context);
-void findallopen(Context &context);
-void obtoinv(Context &context);
-void findallryan(Context &context);
-void showryanpage(Context &context);
-void kernchars(Context &context);
-void getnextword(Context &context);
-void getnumber(Context &context);
-void lockmon(Context &context);
-void printboth(Context &context);
-void waitframes(Context &context);
-void hangone(Context &context);
-void allpalette(Context &context);
-void fadescreenups(Context &context);
-void afterintroroom(Context &context);
-void usetimedtext(Context &context);
-void loadintroroom(Context &context);
-void runintroseq(Context &context);
-void realcredits(Context &context);
-void runendseq(Context &context);
-void showmonk(Context &context);
-void monkspeaking(Context &context);
-void gettingshot(Context &context);
-void biblequote(Context &context);
-void intro(Context &context);
-void paltostartpal(Context &context);
-void paltoendpal(Context &context);
-void dumpcurrent(Context &context);
-void rollem(Context &context);
-void greyscalesum(Context &context);
-void endpaltostart(Context &context);
-void clearendpal(Context &context);
-void rollendcredits2(Context &context);
-void clearstartpal(Context &context);
-void fadecalculation(Context &context);
-void frameoutfx(Context &context);
-void frameoutbh(Context &context);
-void frameoutv(Context &context);
-void putunderzoom(Context &context);
-void crosshair(Context &context);
-void maptopanel(Context &context);
-void movemap(Context &context);
-void dealwithspecial(Context &context);
-void showreelframe(Context &context);
-void soundonreels(Context &context);
-void reconstruct(Context &context);
-void updatepeople(Context &context);
-void watchreel(Context &context);
-void showrain(Context &context);
-void dodoor(Context &context);
-void liftnoise(Context &context);
-void widedoor(Context &context);
-void random(Context &context);
-void lockeddoorway(Context &context);
-void liftsprite(Context &context);
-void doorway(Context &context);
-void constant(Context &context);
-void steady(Context &context);
-void getblockofpixel(Context &context);
-void splitintolines(Context &context);
-void adjustleft(Context &context);
-void adjustright(Context &context);
-void adjustdown(Context &context);
-void adjustup(Context &context);
-void aboutturn(Context &context);
-void checkforexit(Context &context);
-void walking(Context &context);
-void printasprite(Context &context);
-void showgamereel(Context &context);
-void checkspeed(Context &context);
-void addtopeoplelist(Context &context);
-void setuptimedtemp(Context &context);
-void madmantext(Context &context);
-void madmode(Context &context);
-void priesttext(Context &context);
-void fadescreenuphalf(Context &context);
-void textforend(Context &context);
-void fadescreendownhalf(Context &context);
-void rollendcredits(Context &context);
-void textformonk(Context &context);
-void monks2text(Context &context);
-void intro2text(Context &context);
-void intro3text(Context &context);
-void intro1text(Context &context);
-
-void alleybarksound(Context &context) {
- STACK_CHECK(context);
- context.ax = context.es.word(context.bx+3);
- context._dec(context.ax);
- context._cmp(context.ax, 0);
- if (!context.flags.z())
+void DreamGenContext::alleybarksound() {
+ STACK_CHECK;
+ ax = es.word(bx+3);
+ _dec(ax);
+ _cmp(ax, 0);
+ if (!flags.z())
goto nobark;
- context.push(context.bx);
- context.push(context.es);
- context.al = 14;
- playchannel1(context);
- context.es = context.pop();
- context.bx = context.pop();
- context.ax = 1000;
+ push(bx);
+ push(es);
+ al = 14;
+ playchannel1();
+ es = pop();
+ bx = pop();
+ ax = 1000;
nobark:
- context.es.word(context.bx+3) = context.ax;
+ es.word(bx+3) = ax;
}
-void intromusic(Context &context) {
- STACK_CHECK(context);
+void DreamGenContext::intromusic() {
+ STACK_CHECK;
}
-void foghornsound(Context &context) {
- STACK_CHECK(context);
- randomnumber(context);
- context._cmp(context.al, 198);
- if (!context.flags.z())
- goto nofog;
- context.al = 13;
- playchannel1(context);
-nofog:
- return;
+void DreamGenContext::foghornsound() {
+ STACK_CHECK;
+ randomnumber();
+ _cmp(al, 198);
+ if (!flags.z())
+ return /* (nofog) */;
+ al = 13;
+ playchannel1();
}
-void receptionist(Context &context) {
- STACK_CHECK(context);
- checkspeed(context);
- if (!context.flags.z())
+void DreamGenContext::receptionist() {
+ STACK_CHECK;
+ checkspeed();
+ if (!flags.z())
goto gotrecep;
- context._cmp(context.data.byte(kCardpassflag), 1);
- if (!context.flags.z())
+ _cmp(data.byte(kCardpassflag), 1);
+ if (!flags.z())
goto notsetcard;
- context._inc(context.data.byte(kCardpassflag));
- context.es.byte(context.bx+7) = 1;
- context.es.word(context.bx+3) = 64;
+ _inc(data.byte(kCardpassflag));
+ es.byte(bx+7) = 1;
+ es.word(bx+3) = 64;
notsetcard:
- context._cmp(context.es.word(context.bx+3), 58);
- if (!context.flags.z())
+ _cmp(es.word(bx+3), 58);
+ if (!flags.z())
goto notdes1;
- randomnumber(context);
- context._cmp(context.al, 30);
- if (context.flags.c())
+ randomnumber();
+ _cmp(al, 30);
+ if (flags.c())
goto notdes2;
- context.es.word(context.bx+3) = 55;
+ es.word(bx+3) = 55;
goto gotrecep;
notdes1:
- context._cmp(context.es.word(context.bx+3), 60);
- if (!context.flags.z())
+ _cmp(es.word(bx+3), 60);
+ if (!flags.z())
goto notdes2;
- randomnumber(context);
- context._cmp(context.al, 240);
- if (context.flags.c())
+ randomnumber();
+ _cmp(al, 240);
+ if (flags.c())
goto gotrecep;
- context.es.word(context.bx+3) = 53;
+ es.word(bx+3) = 53;
goto gotrecep;
notdes2:
- context._cmp(context.es.word(context.bx+3), 88);
- if (!context.flags.z())
+ _cmp(es.word(bx+3), 88);
+ if (!flags.z())
goto notendcard;
- context.es.word(context.bx+3) = 53;
+ es.word(bx+3) = 53;
goto gotrecep;
notendcard:
- context._inc(context.es.word(context.bx+3));
+ _inc(es.word(bx+3));
gotrecep:
- showgamereel(context);
- addtopeoplelist(context);
- context.al = context.es.byte(context.bx+7);
- context._and(context.al, 128);
- if (context.flags.z())
- goto nottalkedrecep;
- context.data.byte(kTalkedtorecep) = 1;
-nottalkedrecep:
- return;
-}
-
-void smokebloke(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kRockstardead), 0);
- if (!context.flags.z())
+ showgamereel();
+ addtopeoplelist();
+ al = es.byte(bx+7);
+ _and(al, 128);
+ if (flags.z())
+ return /* (nottalkedrecep) */;
+ data.byte(kTalkedtorecep) = 1;
+}
+
+void DreamGenContext::smokebloke() {
+ STACK_CHECK;
+ _cmp(data.byte(kRockstardead), 0);
+ if (!flags.z())
goto notspokento;
- context.al = context.es.byte(context.bx+7);
- context._and(context.al, 128);
- if (context.flags.z())
+ al = es.byte(bx+7);
+ _and(al, 128);
+ if (flags.z())
goto notspokento;
- context.push(context.es);
- context.push(context.bx);
- context.al = 5;
- setlocation(context);
- context.bx = context.pop();
- context.es = context.pop();
+ push(es);
+ push(bx);
+ al = 5;
+ setlocation();
+ bx = pop();
+ es = pop();
notspokento:
- checkspeed(context);
- if (!context.flags.z())
+ checkspeed();
+ if (!flags.z())
goto gotsmokeb;
- context._cmp(context.es.word(context.bx+3), 100);
- if (!context.flags.z())
+ _cmp(es.word(bx+3), 100);
+ if (!flags.z())
goto notsmokeb1;
- randomnumber(context);
- context._cmp(context.al, 30);
- if (context.flags.c())
+ randomnumber();
+ _cmp(al, 30);
+ if (flags.c())
goto notsmokeb2;
- context.es.word(context.bx+3) = 96;
+ es.word(bx+3) = 96;
goto gotsmokeb;
notsmokeb1:
- context._cmp(context.es.word(context.bx+3), 117);
- if (!context.flags.z())
+ _cmp(es.word(bx+3), 117);
+ if (!flags.z())
goto notsmokeb2;
- context.es.word(context.bx+3) = 96;
+ es.word(bx+3) = 96;
goto gotsmokeb;
notsmokeb2:
- context._inc(context.es.word(context.bx+3));
+ _inc(es.word(bx+3));
gotsmokeb:
- showgamereel(context);
- addtopeoplelist(context);
-}
-
-void attendant(Context &context) {
- STACK_CHECK(context);
- showgamereel(context);
- addtopeoplelist(context);
- context.al = context.es.byte(context.bx+7);
- context._and(context.al, 128);
- if (context.flags.z())
- goto nottalked;
- context.data.byte(kTalkedtoattendant) = 1;
-nottalked:
- return;
-}
-
-void manasleep(Context &context) {
- STACK_CHECK(context);
- context.al = context.es.byte(context.bx+7);
- context._and(context.al, 127);
- context.es.byte(context.bx+7) = context.al;
- showgamereel(context);
- addtopeoplelist(context);
-}
-
-void eden(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kGeneraldead), 0);
- if (!context.flags.z())
- goto notinbed;
- showgamereel(context);
- addtopeoplelist(context);
-notinbed:
- return;
-}
-
-void edeninbath(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kGeneraldead), 0);
- if (context.flags.z())
- goto notinbed;
- context._cmp(context.data.byte(kSartaindead), 0);
- if (!context.flags.z())
- goto notinbath;
- showgamereel(context);
- addtopeoplelist(context);
-notinbath:
- return;
-/*continuing to unbounded code: notinbed from eden:5-6*/
-notinbed:
- return;
- return;
-}
-
-void malefan(Context &context) {
- STACK_CHECK(context);
- showgamereel(context);
- addtopeoplelist(context);
-}
-
-void femalefan(Context &context) {
- STACK_CHECK(context);
- showgamereel(context);
- addtopeoplelist(context);
-}
-
-void louis(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kRockstardead), 0);
- if (!context.flags.z())
- goto notlouis1;
- showgamereel(context);
- addtopeoplelist(context);
-notlouis1:
- return;
-}
-
-void louischair(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kRockstardead), 0);
- if (context.flags.z())
- goto notlouis2;
- checkspeed(context);
- if (!context.flags.z())
+ showgamereel();
+ addtopeoplelist();
+}
+
+void DreamGenContext::attendant() {
+ STACK_CHECK;
+ showgamereel();
+ addtopeoplelist();
+ al = es.byte(bx+7);
+ _and(al, 128);
+ if (flags.z())
+ return /* (nottalked) */;
+ data.byte(kTalkedtoattendant) = 1;
+}
+
+void DreamGenContext::manasleep() {
+ STACK_CHECK;
+ al = es.byte(bx+7);
+ _and(al, 127);
+ es.byte(bx+7) = al;
+ showgamereel();
+ addtopeoplelist();
+}
+
+void DreamGenContext::eden() {
+ STACK_CHECK;
+ _cmp(data.byte(kGeneraldead), 0);
+ if (!flags.z())
+ return /* (notinbed) */;
+ showgamereel();
+ addtopeoplelist();
+}
+
+void DreamGenContext::edeninbath() {
+ STACK_CHECK;
+ _cmp(data.byte(kGeneraldead), 0);
+ if (flags.z())
+ return /* (notinbath) */;
+ _cmp(data.byte(kSartaindead), 0);
+ if (!flags.z())
+ return /* (notinbath) */;
+ showgamereel();
+ addtopeoplelist();
+}
+
+void DreamGenContext::malefan() {
+ STACK_CHECK;
+ showgamereel();
+ addtopeoplelist();
+}
+
+void DreamGenContext::femalefan() {
+ STACK_CHECK;
+ showgamereel();
+ addtopeoplelist();
+}
+
+void DreamGenContext::louis() {
+ STACK_CHECK;
+ _cmp(data.byte(kRockstardead), 0);
+ if (!flags.z())
+ return /* (notlouis1) */;
+ showgamereel();
+ addtopeoplelist();
+}
+
+void DreamGenContext::louischair() {
+ STACK_CHECK;
+ _cmp(data.byte(kRockstardead), 0);
+ if (flags.z())
+ return /* (notlouis2) */;
+ checkspeed();
+ if (!flags.z())
goto notlouisanim;
- context.ax = context.es.word(context.bx+3);
- context._inc(context.ax);
- context._cmp(context.ax, 191);
- if (context.flags.z())
+ ax = es.word(bx+3);
+ _inc(ax);
+ _cmp(ax, 191);
+ if (flags.z())
goto restartlouis;
- context._cmp(context.ax, 185);
- if (context.flags.z())
+ _cmp(ax, 185);
+ if (flags.z())
goto randomlouis;
- context.es.word(context.bx+3) = context.ax;
+ es.word(bx+3) = ax;
goto notlouisanim;
randomlouis:
- context.es.word(context.bx+3) = context.ax;
- randomnumber(context);
- context._cmp(context.al, 245);
- if (!context.flags.c())
+ es.word(bx+3) = ax;
+ randomnumber();
+ _cmp(al, 245);
+ if (!flags.c())
goto notlouisanim;
restartlouis:
- context.ax = 182;
- context.es.word(context.bx+3) = context.ax;
+ ax = 182;
+ es.word(bx+3) = ax;
notlouisanim:
- showgamereel(context);
- addtopeoplelist(context);
-notlouis2:
- return;
+ showgamereel();
+ addtopeoplelist();
}
-void manasleep2(Context &context) {
- STACK_CHECK(context);
- context.al = context.es.byte(context.bx+7);
- context._and(context.al, 127);
- context.es.byte(context.bx+7) = context.al;
- showgamereel(context);
- addtopeoplelist(context);
+void DreamGenContext::manasleep2() {
+ STACK_CHECK;
+ al = es.byte(bx+7);
+ _and(al, 127);
+ es.byte(bx+7) = al;
+ showgamereel();
+ addtopeoplelist();
}
-void mansatstill(Context &context) {
- STACK_CHECK(context);
- showgamereel(context);
- addtopeoplelist(context);
+void DreamGenContext::mansatstill() {
+ STACK_CHECK;
+ showgamereel();
+ addtopeoplelist();
}
-void tattooman(Context &context) {
- STACK_CHECK(context);
- showgamereel(context);
- addtopeoplelist(context);
+void DreamGenContext::tattooman() {
+ STACK_CHECK;
+ showgamereel();
+ addtopeoplelist();
}
-void drinker(Context &context) {
- STACK_CHECK(context);
- checkspeed(context);
- if (!context.flags.z())
+void DreamGenContext::drinker() {
+ STACK_CHECK;
+ checkspeed();
+ if (!flags.z())
goto gotdrinker;
- context._inc(context.es.word(context.bx+3));
- context._cmp(context.es.word(context.bx+3), 115);
- if (!context.flags.z())
+ _inc(es.word(bx+3));
+ _cmp(es.word(bx+3), 115);
+ if (!flags.z())
goto notdrinker1;
- context.es.word(context.bx+3) = 105;
+ es.word(bx+3) = 105;
goto gotdrinker;
notdrinker1:
- context._cmp(context.es.word(context.bx+3), 106);
- if (!context.flags.z())
+ _cmp(es.word(bx+3), 106);
+ if (!flags.z())
goto gotdrinker;
- randomnumber(context);
- context._cmp(context.al, 3);
- if (context.flags.c())
+ randomnumber();
+ _cmp(al, 3);
+ if (flags.c())
goto gotdrinker;
- context.es.word(context.bx+3) = 105;
+ es.word(bx+3) = 105;
gotdrinker:
- showgamereel(context);
- addtopeoplelist(context);
+ showgamereel();
+ addtopeoplelist();
}
-void bartender(Context &context) {
- STACK_CHECK(context);
- checkspeed(context);
- if (!context.flags.z())
+void DreamGenContext::bartender() {
+ STACK_CHECK;
+ checkspeed();
+ if (!flags.z())
goto gotsmoket;
- context._cmp(context.es.word(context.bx+3), 86);
- if (!context.flags.z())
+ _cmp(es.word(bx+3), 86);
+ if (!flags.z())
goto notsmoket1;
- randomnumber(context);
- context._cmp(context.al, 18);
- if (context.flags.c())
+ randomnumber();
+ _cmp(al, 18);
+ if (flags.c())
goto notsmoket2;
- context.es.word(context.bx+3) = 81;
+ es.word(bx+3) = 81;
goto gotsmoket;
notsmoket1:
- context._cmp(context.es.word(context.bx+3), 103);
- if (!context.flags.z())
+ _cmp(es.word(bx+3), 103);
+ if (!flags.z())
goto notsmoket2;
- context.es.word(context.bx+3) = 81;
+ es.word(bx+3) = 81;
goto gotsmoket;
notsmoket2:
- context._inc(context.es.word(context.bx+3));
+ _inc(es.word(bx+3));
gotsmoket:
- showgamereel(context);
- context._cmp(context.data.byte(kGunpassflag), 1);
- if (!context.flags.z())
+ showgamereel();
+ _cmp(data.byte(kGunpassflag), 1);
+ if (!flags.z())
goto notgotgun;
- context.es.byte(context.bx+7) = 9;
+ es.byte(bx+7) = 9;
notgotgun:
- addtopeoplelist(context);
+ addtopeoplelist();
}
-void othersmoker(Context &context) {
- STACK_CHECK(context);
- showgamereel(context);
- addtopeoplelist(context);
+void DreamGenContext::othersmoker() {
+ STACK_CHECK;
+ showgamereel();
+ addtopeoplelist();
}
-void barwoman(Context &context) {
- STACK_CHECK(context);
- showgamereel(context);
- addtopeoplelist(context);
+void DreamGenContext::barwoman() {
+ STACK_CHECK;
+ showgamereel();
+ addtopeoplelist();
}
-void interviewer(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.word(kReeltowatch), 68);
- if (!context.flags.z())
+void DreamGenContext::interviewer() {
+ STACK_CHECK;
+ _cmp(data.word(kReeltowatch), 68);
+ if (!flags.z())
goto notgeneralstart;
- context._inc(context.es.word(context.bx+3));
+ _inc(es.word(bx+3));
notgeneralstart:
- context._cmp(context.es.word(context.bx+3), 250);
- if (context.flags.z())
+ _cmp(es.word(bx+3), 250);
+ if (flags.z())
goto talking;
- checkspeed(context);
- if (!context.flags.z())
+ checkspeed();
+ if (!flags.z())
goto talking;
- context._cmp(context.es.word(context.bx+3), 259);
- if (context.flags.z())
+ _cmp(es.word(bx+3), 259);
+ if (flags.z())
goto talking;
- context._inc(context.es.word(context.bx+3));
+ _inc(es.word(bx+3));
talking:
- showgamereel(context);
+ showgamereel();
}
-void soldier1(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.es.word(context.bx+3), 0);
- if (context.flags.z())
+void DreamGenContext::soldier1() {
+ STACK_CHECK;
+ _cmp(es.word(bx+3), 0);
+ if (flags.z())
goto soldierwait;
- context.data.word(kWatchingtime) = 10;
- context._cmp(context.es.word(context.bx+3), 30);
- if (!context.flags.z())
+ data.word(kWatchingtime) = 10;
+ _cmp(es.word(bx+3), 30);
+ if (!flags.z())
goto notaftersshot;
- context._inc(context.data.byte(kCombatcount));
- context._cmp(context.data.byte(kCombatcount), 40);
- if (!context.flags.z())
+ _inc(data.byte(kCombatcount));
+ _cmp(data.byte(kCombatcount), 40);
+ if (!flags.z())
goto gotsoldframe;
- context.data.byte(kMandead) = 2;
+ data.byte(kMandead) = 2;
goto gotsoldframe;
notaftersshot:
- checkspeed(context);
- if (!context.flags.z())
+ checkspeed();
+ if (!flags.z())
goto gotsoldframe;
- context._inc(context.es.word(context.bx+3));
+ _inc(es.word(bx+3));
goto gotsoldframe;
soldierwait:
- context._cmp(context.data.byte(kLastweapon), 1);
- if (!context.flags.z())
+ _cmp(data.byte(kLastweapon), 1);
+ if (!flags.z())
goto gotsoldframe;
- context.data.word(kWatchingtime) = 10;
- context._cmp(context.data.byte(kManspath), 2);
- if (!context.flags.z())
+ data.word(kWatchingtime) = 10;
+ _cmp(data.byte(kManspath), 2);
+ if (!flags.z())
goto gotsoldframe;
- context._cmp(context.data.byte(kFacing), 4);
- if (!context.flags.z())
+ _cmp(data.byte(kFacing), 4);
+ if (!flags.z())
goto gotsoldframe;
- context._inc(context.es.word(context.bx+3));
- context.data.byte(kLastweapon) = -1;
- context.data.byte(kCombatcount) = 0;
+ _inc(es.word(bx+3));
+ data.byte(kLastweapon) = -1;
+ data.byte(kCombatcount) = 0;
gotsoldframe:
- showgamereel(context);
- addtopeoplelist(context);
+ showgamereel();
+ addtopeoplelist();
}
-void rockstar(Context &context) {
- STACK_CHECK(context);
- context.ax = context.es.word(context.bx+3);
- context._cmp(context.ax, 303);
- if (context.flags.z())
+void DreamGenContext::rockstar() {
+ STACK_CHECK;
+ ax = es.word(bx+3);
+ _cmp(ax, 303);
+ if (flags.z())
goto rockcombatend;
- context._cmp(context.ax, 118);
- if (context.flags.z())
+ _cmp(ax, 118);
+ if (flags.z())
goto rockcombatend;
- checkspeed(context);
- if (!context.flags.z())
+ checkspeed();
+ if (!flags.z())
goto rockspeed;
- context.ax = context.es.word(context.bx+3);
- context._inc(context.ax);
- context._cmp(context.ax, 118);
- if (!context.flags.z())
+ ax = es.word(bx+3);
+ _inc(ax);
+ _cmp(ax, 118);
+ if (!flags.z())
goto notbeforedead;
- context.data.byte(kMandead) = 2;
+ data.byte(kMandead) = 2;
goto gotrockframe;
notbeforedead:
- context._cmp(context.ax, 79);
- if (!context.flags.z())
+ _cmp(ax, 79);
+ if (!flags.z())
goto gotrockframe;
- context._dec(context.ax);
- context._cmp(context.data.byte(kLastweapon), 1);
- if (!context.flags.z())
+ _dec(ax);
+ _cmp(data.byte(kLastweapon), 1);
+ if (!flags.z())
goto notgunonrock;
- context.data.byte(kLastweapon) = -1;
- context.ax = 123;
+ data.byte(kLastweapon) = -1;
+ ax = 123;
goto gotrockframe;
notgunonrock:
- context._inc(context.data.byte(kCombatcount));
- context._cmp(context.data.byte(kCombatcount), 40);
- if (!context.flags.z())
+ _inc(data.byte(kCombatcount));
+ _cmp(data.byte(kCombatcount), 40);
+ if (!flags.z())
goto gotrockframe;
- context.data.byte(kCombatcount) = 0;
- context.ax = 79;
+ data.byte(kCombatcount) = 0;
+ ax = 79;
gotrockframe:
- context.es.word(context.bx+3) = context.ax;
+ es.word(bx+3) = ax;
rockspeed:
- showgamereel(context);
- context._cmp(context.es.word(context.bx+3), 78);
- if (!context.flags.z())
+ showgamereel();
+ _cmp(es.word(bx+3), 78);
+ if (!flags.z())
goto notalkrock;
- addtopeoplelist(context);
- context.data.byte(kPointermode) = 2;
- context.data.word(kWatchingtime) = 0;
+ addtopeoplelist();
+ data.byte(kPointermode) = 2;
+ data.word(kWatchingtime) = 0;
return;
notalkrock:
- context.data.word(kWatchingtime) = 2;
- context.data.byte(kPointermode) = 0;
- context.al = context.data.byte(kMapy);
- context.es.byte(context.bx+2) = context.al;
+ data.word(kWatchingtime) = 2;
+ data.byte(kPointermode) = 0;
+ al = data.byte(kMapy);
+ es.byte(bx+2) = al;
return;
rockcombatend:
- context.data.byte(kNewlocation) = 45;
- showgamereel(context);
+ data.byte(kNewlocation) = 45;
+ showgamereel();
}
-void helicopter(Context &context) {
- STACK_CHECK(context);
- context.ax = context.es.word(context.bx+3);
- context._cmp(context.ax, 203);
- if (context.flags.z())
+void DreamGenContext::helicopter() {
+ STACK_CHECK;
+ ax = es.word(bx+3);
+ _cmp(ax, 203);
+ if (flags.z())
goto heliwon;
- checkspeed(context);
- if (!context.flags.z())
+ checkspeed();
+ if (!flags.z())
goto helispeed;
- context.ax = context.es.word(context.bx+3);
- context._inc(context.ax);
- context._cmp(context.ax, 53);
- if (!context.flags.z())
+ ax = es.word(bx+3);
+ _inc(ax);
+ _cmp(ax, 53);
+ if (!flags.z())
goto notbeforehdead;
- context._inc(context.data.byte(kCombatcount));
- context._cmp(context.data.byte(kCombatcount), 8);
- if (context.flags.c())
+ _inc(data.byte(kCombatcount));
+ _cmp(data.byte(kCombatcount), 8);
+ if (flags.c())
goto waitabit;
- context.data.byte(kMandead) = 2;
+ data.byte(kMandead) = 2;
waitabit:
- context.ax = 49;
+ ax = 49;
goto gotheliframe;
notbeforehdead:
- context._cmp(context.ax, 9);
- if (!context.flags.z())
+ _cmp(ax, 9);
+ if (!flags.z())
goto gotheliframe;
- context._dec(context.ax);
- context._cmp(context.data.byte(kLastweapon), 1);
- if (!context.flags.z())
+ _dec(ax);
+ _cmp(data.byte(kLastweapon), 1);
+ if (!flags.z())
goto notgunonheli;
- context.data.byte(kLastweapon) = -1;
- context.ax = 55;
+ data.byte(kLastweapon) = -1;
+ ax = 55;
goto gotheliframe;
notgunonheli:
- context.ax = 5;
- context._inc(context.data.byte(kCombatcount));
- context._cmp(context.data.byte(kCombatcount), 20);
- if (!context.flags.z())
+ ax = 5;
+ _inc(data.byte(kCombatcount));
+ _cmp(data.byte(kCombatcount), 20);
+ if (!flags.z())
goto gotheliframe;
- context.data.byte(kCombatcount) = 0;
- context.ax = 9;
+ data.byte(kCombatcount) = 0;
+ ax = 9;
gotheliframe:
- context.es.word(context.bx+3) = context.ax;
+ es.word(bx+3) = ax;
helispeed:
- showgamereel(context);
- context.al = context.data.byte(kMapx);
- context.es.byte(context.bx+1) = context.al;
- context.ax = context.es.word(context.bx+3);
- context._cmp(context.ax, 9);
- if (!context.flags.c())
+ showgamereel();
+ al = data.byte(kMapx);
+ es.byte(bx+1) = al;
+ ax = es.word(bx+3);
+ _cmp(ax, 9);
+ if (!flags.c())
goto notwaitingheli;
- context._cmp(context.data.byte(kCombatcount), 7);
- if (context.flags.c())
+ _cmp(data.byte(kCombatcount), 7);
+ if (flags.c())
goto notwaitingheli;
- context.data.byte(kPointermode) = 2;
- context.data.word(kWatchingtime) = 0;
+ data.byte(kPointermode) = 2;
+ data.word(kWatchingtime) = 0;
return;
notwaitingheli:
- context.data.byte(kPointermode) = 0;
- context.data.word(kWatchingtime) = 2;
+ data.byte(kPointermode) = 0;
+ data.word(kWatchingtime) = 2;
return;
heliwon:
- context.data.byte(kPointermode) = 0;
+ data.byte(kPointermode) = 0;
}
-void mugger(Context &context) {
- STACK_CHECK(context);
- context.ax = context.es.word(context.bx+3);
- context._cmp(context.ax, 138);
- if (context.flags.z())
+void DreamGenContext::mugger() {
+ STACK_CHECK;
+ ax = es.word(bx+3);
+ _cmp(ax, 138);
+ if (flags.z())
goto endmugger1;
- context._cmp(context.ax, 176);
- if (context.flags.z())
- goto endmugger2;
- context._cmp(context.ax, 2);
- if (!context.flags.z())
+ _cmp(ax, 176);
+ if (flags.z())
+ return /* (endmugger2) */;
+ _cmp(ax, 2);
+ if (!flags.z())
goto havesetwatch;
- context.data.word(kWatchingtime) = 175*2;
+ data.word(kWatchingtime) = 175*2;
havesetwatch:
- checkspeed(context);
- if (!context.flags.z())
+ checkspeed();
+ if (!flags.z())
goto notmugger;
- context._inc(context.es.word(context.bx+3));
+ _inc(es.word(bx+3));
notmugger:
- showgamereel(context);
- context.al = context.data.byte(kMapx);
- context.es.byte(context.bx+1) = context.al;
+ showgamereel();
+ al = data.byte(kMapx);
+ es.byte(bx+1) = al;
return;
endmugger1:
- context.push(context.es);
- context.push(context.bx);
- createpanel2(context);
- showicon(context);
- context.al = 41;
- findpuztext(context);
- context.di = 33+20;
- context.bx = 104;
- context.dl = 241;
- context.ah = 0;
- printdirect(context);
- worktoscreen(context);
- context.cx = 300;
- hangon(context);
- context.bx = context.pop();
- context.es = context.pop();
- context.push(context.es);
- context.push(context.bx);
- context.es.word(context.bx+3) = 140;
- context.data.byte(kManspath) = 2;
- context.data.byte(kFinaldest) = 2;
- findxyfrompath(context);
- context.data.byte(kResetmanxy) = 1;
- context.al = 'W';
- context.ah = 'E';
- context.cl = 'T';
- context.ch = 'A';
- findexobject(context);
- context.data.byte(kCommand) = context.al;
- context.data.byte(kObjecttype) = 4;
- removeobfrominv(context);
- context.al = 'W';
- context.ah = 'E';
- context.cl = 'T';
- context.ch = 'B';
- findexobject(context);
- context.data.byte(kCommand) = context.al;
- context.data.byte(kObjecttype) = 4;
- removeobfrominv(context);
- makemainscreen(context);
- context.al = 48;
- context.bl = 68-32;
- context.bh = 54+64;
- context.cx = 70;
- context.dx = 10;
- setuptimeduse(context);
- context.data.byte(kBeenmugged) = 1;
- context.bx = context.pop();
- context.es = context.pop();
- return;
-endmugger2:
- return;
-}
-
-void aide(Context &context) {
- STACK_CHECK(context);
- showgamereel(context);
- addtopeoplelist(context);
-}
-
-void businessman(Context &context) {
- STACK_CHECK(context);
- context.data.byte(kPointermode) = 0;
- context.data.word(kWatchingtime) = 2;
- context.ax = context.es.word(context.bx+3);
- context._cmp(context.ax, 2);
- if (!context.flags.z())
+ push(es);
+ push(bx);
+ createpanel2();
+ showicon();
+ al = 41;
+ findpuztext();
+ di = 33+20;
+ bx = 104;
+ dl = 241;
+ ah = 0;
+ printdirect();
+ worktoscreen();
+ cx = 300;
+ hangon();
+ bx = pop();
+ es = pop();
+ push(es);
+ push(bx);
+ es.word(bx+3) = 140;
+ data.byte(kManspath) = 2;
+ data.byte(kFinaldest) = 2;
+ findxyfrompath();
+ data.byte(kResetmanxy) = 1;
+ al = 'W';
+ ah = 'E';
+ cl = 'T';
+ ch = 'A';
+ findexobject();
+ data.byte(kCommand) = al;
+ data.byte(kObjecttype) = 4;
+ removeobfrominv();
+ al = 'W';
+ ah = 'E';
+ cl = 'T';
+ ch = 'B';
+ findexobject();
+ data.byte(kCommand) = al;
+ data.byte(kObjecttype) = 4;
+ removeobfrominv();
+ makemainscreen();
+ al = 48;
+ bl = 68-32;
+ bh = 54+64;
+ cx = 70;
+ dx = 10;
+ setuptimeduse();
+ data.byte(kBeenmugged) = 1;
+ bx = pop();
+ es = pop();
+}
+
+void DreamGenContext::aide() {
+ STACK_CHECK;
+ showgamereel();
+ addtopeoplelist();
+}
+
+void DreamGenContext::businessman() {
+ STACK_CHECK;
+ data.byte(kPointermode) = 0;
+ data.word(kWatchingtime) = 2;
+ ax = es.word(bx+3);
+ _cmp(ax, 2);
+ if (!flags.z())
goto notfirstbiz;
- context.push(context.ax);
- context.push(context.bx);
- context.push(context.es);
- context.al = 49;
- context.cx = 30;
- context.dx = 1;
- context.bl = 68;
- context.bh = 174;
- setuptimeduse(context);
- context.es = context.pop();
- context.bx = context.pop();
- context.ax = context.pop();
+ push(ax);
+ push(bx);
+ push(es);
+ al = 49;
+ cx = 30;
+ dx = 1;
+ bl = 68;
+ bh = 174;
+ setuptimeduse();
+ es = pop();
+ bx = pop();
+ ax = pop();
notfirstbiz:
- context._cmp(context.ax, 95);
- if (context.flags.z())
+ _cmp(ax, 95);
+ if (flags.z())
goto buscombatwonend;
- context._cmp(context.ax, 49);
- if (context.flags.z())
- goto buscombatend;
- checkspeed(context);
- if (!context.flags.z())
+ _cmp(ax, 49);
+ if (flags.z())
+ return /* (buscombatend) */;
+ checkspeed();
+ if (!flags.z())
goto busspeed;
- context.ax = context.es.word(context.bx+3);
- context._inc(context.ax);
- context._cmp(context.ax, 48);
- if (!context.flags.z())
+ ax = es.word(bx+3);
+ _inc(ax);
+ _cmp(ax, 48);
+ if (!flags.z())
goto notbeforedeadb;
- context.data.byte(kMandead) = 2;
+ data.byte(kMandead) = 2;
goto gotbusframe;
notbeforedeadb:
- context._cmp(context.ax, 15);
- if (!context.flags.z())
+ _cmp(ax, 15);
+ if (!flags.z())
goto buscombatwon;
- context._dec(context.ax);
- context._cmp(context.data.byte(kLastweapon), 3);
- if (!context.flags.z())
+ _dec(ax);
+ _cmp(data.byte(kLastweapon), 3);
+ if (!flags.z())
goto notshieldonbus;
- context.data.byte(kLastweapon) = -1;
- context.data.byte(kCombatcount) = 0;
- context.ax = 51;
+ data.byte(kLastweapon) = -1;
+ data.byte(kCombatcount) = 0;
+ ax = 51;
goto gotbusframe;
notshieldonbus:
- context._inc(context.data.byte(kCombatcount));
- context._cmp(context.data.byte(kCombatcount), 20);
- if (!context.flags.z())
+ _inc(data.byte(kCombatcount));
+ _cmp(data.byte(kCombatcount), 20);
+ if (!flags.z())
goto gotbusframe;
- context.data.byte(kCombatcount) = 0;
- context.ax = 15;
+ data.byte(kCombatcount) = 0;
+ ax = 15;
goto gotbusframe;
buscombatwon:
- context._cmp(context.ax, 91);
- if (!context.flags.z())
+ _cmp(ax, 91);
+ if (!flags.z())
goto gotbusframe;
- context.push(context.bx);
- context.push(context.es);
- context.al = 0;
- turnpathon(context);
- context.al = 1;
- turnpathon(context);
- context.al = 2;
- turnpathon(context);
- context.al = 3;
- turnpathoff(context);
- context.data.byte(kManspath) = 5;
- context.data.byte(kFinaldest) = 5;
- findxyfrompath(context);
- context.data.byte(kResetmanxy) = 1;
- context.es = context.pop();
- context.bx = context.pop();
- context.ax = 92;
+ push(bx);
+ push(es);
+ al = 0;
+ turnpathon();
+ al = 1;
+ turnpathon();
+ al = 2;
+ turnpathon();
+ al = 3;
+ turnpathoff();
+ data.byte(kManspath) = 5;
+ data.byte(kFinaldest) = 5;
+ findxyfrompath();
+ data.byte(kResetmanxy) = 1;
+ es = pop();
+ bx = pop();
+ ax = 92;
goto gotbusframe;
gotbusframe:
- context.es.word(context.bx+3) = context.ax;
+ es.word(bx+3) = ax;
busspeed:
- showgamereel(context);
- context.al = context.data.byte(kMapy);
- context.es.byte(context.bx+2) = context.al;
- context.ax = context.es.word(context.bx+3);
- context._cmp(context.ax, 14);
- if (!context.flags.z())
- goto buscombatend;
- context.data.word(kWatchingtime) = 0;
- context.data.byte(kPointermode) = 2;
- return;
-buscombatend:
+ showgamereel();
+ al = data.byte(kMapy);
+ es.byte(bx+2) = al;
+ ax = es.word(bx+3);
+ _cmp(ax, 14);
+ if (!flags.z())
+ return /* (buscombatend) */;
+ data.word(kWatchingtime) = 0;
+ data.byte(kPointermode) = 2;
return;
buscombatwonend:
- context.data.byte(kPointermode) = 0;
- context.data.word(kWatchingtime) = 0;
+ data.byte(kPointermode) = 0;
+ data.word(kWatchingtime) = 0;
}
-void poolguard(Context &context) {
- STACK_CHECK(context);
- context.ax = context.es.word(context.bx+3);
- context._cmp(context.ax, 214);
- if (context.flags.z())
+void DreamGenContext::poolguard() {
+ STACK_CHECK;
+ ax = es.word(bx+3);
+ _cmp(ax, 214);
+ if (flags.z())
goto combatover2;
- context._cmp(context.ax, 258);
- if (context.flags.z())
+ _cmp(ax, 258);
+ if (flags.z())
goto combatover2;
- context._cmp(context.ax, 185);
- if (context.flags.z())
+ _cmp(ax, 185);
+ if (flags.z())
goto combatover1;
- context._cmp(context.ax, 0);
- if (!context.flags.z())
+ _cmp(ax, 0);
+ if (!flags.z())
goto notfirstpool;
- context.al = 0;
- turnpathon(context);
+ al = 0;
+ turnpathon();
notfirstpool:
- checkspeed(context);
- if (!context.flags.z())
+ checkspeed();
+ if (!flags.z())
goto guardspeed;
- context.ax = context.es.word(context.bx+3);
- context._inc(context.ax);
- context._cmp(context.ax, 122);
- if (!context.flags.z())
+ ax = es.word(bx+3);
+ _inc(ax);
+ _cmp(ax, 122);
+ if (!flags.z())
goto notendguard1;
- context._dec(context.ax);
- context._cmp(context.data.byte(kLastweapon), 2);
- if (!context.flags.z())
+ _dec(ax);
+ _cmp(data.byte(kLastweapon), 2);
+ if (!flags.z())
goto notaxeonpool;
- context.data.byte(kLastweapon) = -1;
- context.ax = 122;
+ data.byte(kLastweapon) = -1;
+ ax = 122;
goto gotguardframe;
notaxeonpool:
- context._inc(context.data.byte(kCombatcount));
- context._cmp(context.data.byte(kCombatcount), 40);
- if (!context.flags.z())
+ _inc(data.byte(kCombatcount));
+ _cmp(data.byte(kCombatcount), 40);
+ if (!flags.z())
goto gotguardframe;
- context.data.byte(kCombatcount) = 0;
- context.ax = 195;
+ data.byte(kCombatcount) = 0;
+ ax = 195;
goto gotguardframe;
notendguard1:
- context._cmp(context.ax, 147);
- if (!context.flags.z())
+ _cmp(ax, 147);
+ if (!flags.z())
goto gotguardframe;
- context._dec(context.ax);
- context._cmp(context.data.byte(kLastweapon), 1);
- if (!context.flags.z())
+ _dec(ax);
+ _cmp(data.byte(kLastweapon), 1);
+ if (!flags.z())
goto notgunonpool;
- context.data.byte(kLastweapon) = -1;
- context.ax = 147;
+ data.byte(kLastweapon) = -1;
+ ax = 147;
goto gotguardframe;
notgunonpool:
- context._inc(context.data.byte(kCombatcount));
- context._cmp(context.data.byte(kCombatcount), 40);
- if (!context.flags.z())
+ _inc(data.byte(kCombatcount));
+ _cmp(data.byte(kCombatcount), 40);
+ if (!flags.z())
goto gotguardframe;
- context.data.byte(kCombatcount) = 0;
- context.ax = 220;
+ data.byte(kCombatcount) = 0;
+ ax = 220;
gotguardframe:
- context.es.word(context.bx+3) = context.ax;
+ es.word(bx+3) = ax;
guardspeed:
- showgamereel(context);
- context.ax = context.es.word(context.bx+3);
- context._cmp(context.ax, 121);
- if (context.flags.z())
+ showgamereel();
+ ax = es.word(bx+3);
+ _cmp(ax, 121);
+ if (flags.z())
goto iswaitingpool;
- context._cmp(context.ax, 146);
- if (context.flags.z())
+ _cmp(ax, 146);
+ if (flags.z())
goto iswaitingpool;
- context.data.byte(kPointermode) = 0;
- context.data.word(kWatchingtime) = 2;
+ data.byte(kPointermode) = 0;
+ data.word(kWatchingtime) = 2;
return;
iswaitingpool:
- context.data.byte(kPointermode) = 2;
- context.data.word(kWatchingtime) = 0;
+ data.byte(kPointermode) = 2;
+ data.word(kWatchingtime) = 0;
return;
combatover1:
- context.data.word(kWatchingtime) = 0;
- context.data.byte(kPointermode) = 0;
- context.al = 0;
- turnpathon(context);
- context.al = 1;
- turnpathoff(context);
+ data.word(kWatchingtime) = 0;
+ data.byte(kPointermode) = 0;
+ al = 0;
+ turnpathon();
+ al = 1;
+ turnpathoff();
return;
combatover2:
- showgamereel(context);
- context.data.word(kWatchingtime) = 2;
- context.data.byte(kPointermode) = 0;
- context._inc(context.data.byte(kCombatcount));
- context._cmp(context.data.byte(kCombatcount), 100);
- if (context.flags.c())
- goto doneover2;
- context.data.word(kWatchingtime) = 0;
- context.data.byte(kMandead) = 2;
-doneover2:
- return;
-}
-
-void security(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.es.word(context.bx+3), 32);
- if (context.flags.z())
+ showgamereel();
+ data.word(kWatchingtime) = 2;
+ data.byte(kPointermode) = 0;
+ _inc(data.byte(kCombatcount));
+ _cmp(data.byte(kCombatcount), 100);
+ if (flags.c())
+ return /* (doneover2) */;
+ data.word(kWatchingtime) = 0;
+ data.byte(kMandead) = 2;
+}
+
+void DreamGenContext::security() {
+ STACK_CHECK;
+ _cmp(es.word(bx+3), 32);
+ if (flags.z())
goto securwait;
- context._cmp(context.es.word(context.bx+3), 69);
- if (!context.flags.z())
+ _cmp(es.word(bx+3), 69);
+ if (!flags.z())
goto notaftersec;
return;
notaftersec:
- context.data.word(kWatchingtime) = 10;
- checkspeed(context);
- if (!context.flags.z())
+ data.word(kWatchingtime) = 10;
+ checkspeed();
+ if (!flags.z())
goto gotsecurframe;
- context._inc(context.es.word(context.bx+3));
+ _inc(es.word(bx+3));
goto gotsecurframe;
securwait:
- context._cmp(context.data.byte(kLastweapon), 1);
- if (!context.flags.z())
+ _cmp(data.byte(kLastweapon), 1);
+ if (!flags.z())
goto gotsecurframe;
- context.data.word(kWatchingtime) = 10;
- context._cmp(context.data.byte(kManspath), 9);
- if (!context.flags.z())
+ data.word(kWatchingtime) = 10;
+ _cmp(data.byte(kManspath), 9);
+ if (!flags.z())
goto gotsecurframe;
- context._cmp(context.data.byte(kFacing), 0);
- if (!context.flags.z())
+ _cmp(data.byte(kFacing), 0);
+ if (!flags.z())
goto gotsecurframe;
- context.data.byte(kLastweapon) = -1;
- context._inc(context.es.word(context.bx+3));
+ data.byte(kLastweapon) = -1;
+ _inc(es.word(bx+3));
gotsecurframe:
- showgamereel(context);
- addtopeoplelist(context);
+ showgamereel();
+ addtopeoplelist();
}
-void heavy(Context &context) {
- STACK_CHECK(context);
- context.al = context.es.byte(context.bx+7);
- context._and(context.al, 127);
- context.es.byte(context.bx+7) = context.al;
- context._cmp(context.es.word(context.bx+3), 43);
- if (context.flags.z())
+void DreamGenContext::heavy() {
+ STACK_CHECK;
+ al = es.byte(bx+7);
+ _and(al, 127);
+ es.byte(bx+7) = al;
+ _cmp(es.word(bx+3), 43);
+ if (flags.z())
goto heavywait;
- context.data.word(kWatchingtime) = 10;
- context._cmp(context.es.word(context.bx+3), 70);
- if (!context.flags.z())
+ data.word(kWatchingtime) = 10;
+ _cmp(es.word(bx+3), 70);
+ if (!flags.z())
goto notafterhshot;
- context._inc(context.data.byte(kCombatcount));
- context._cmp(context.data.byte(kCombatcount), 80);
- if (!context.flags.z())
+ _inc(data.byte(kCombatcount));
+ _cmp(data.byte(kCombatcount), 80);
+ if (!flags.z())
goto gotheavyframe;
- context.data.byte(kMandead) = 2;
+ data.byte(kMandead) = 2;
goto gotheavyframe;
notafterhshot:
- checkspeed(context);
- if (!context.flags.z())
+ checkspeed();
+ if (!flags.z())
goto gotheavyframe;
- context._inc(context.es.word(context.bx+3));
+ _inc(es.word(bx+3));
goto gotheavyframe;
heavywait:
- context._cmp(context.data.byte(kLastweapon), 1);
- if (!context.flags.z())
+ _cmp(data.byte(kLastweapon), 1);
+ if (!flags.z())
goto gotheavyframe;
- context._cmp(context.data.byte(kManspath), 5);
- if (!context.flags.z())
+ _cmp(data.byte(kManspath), 5);
+ if (!flags.z())
goto gotheavyframe;
- context._cmp(context.data.byte(kFacing), 4);
- if (!context.flags.z())
+ _cmp(data.byte(kFacing), 4);
+ if (!flags.z())
goto gotheavyframe;
- context.data.byte(kLastweapon) = -1;
- context._inc(context.es.word(context.bx+3));
- context.data.byte(kCombatcount) = 0;
+ data.byte(kLastweapon) = -1;
+ _inc(es.word(bx+3));
+ data.byte(kCombatcount) = 0;
gotheavyframe:
- showgamereel(context);
- addtopeoplelist(context);
+ showgamereel();
+ addtopeoplelist();
}
-void bossman(Context &context) {
- STACK_CHECK(context);
- checkspeed(context);
- if (!context.flags.z())
+void DreamGenContext::bossman() {
+ STACK_CHECK;
+ checkspeed();
+ if (!flags.z())
goto notboss;
- context.ax = context.es.word(context.bx+3);
- context._inc(context.ax);
- context._cmp(context.ax, 4);
- if (context.flags.z())
+ ax = es.word(bx+3);
+ _inc(ax);
+ _cmp(ax, 4);
+ if (flags.z())
goto firstdes;
- context._cmp(context.ax, 20);
- if (context.flags.z())
+ _cmp(ax, 20);
+ if (flags.z())
goto secdes;
- context._cmp(context.ax, 41);
- if (!context.flags.z())
+ _cmp(ax, 41);
+ if (!flags.z())
goto gotallboss;
- context.ax = 0;
- context._inc(context.data.byte(kGunpassflag));
- context.es.byte(context.bx+7) = 10;
+ ax = 0;
+ _inc(data.byte(kGunpassflag));
+ es.byte(bx+7) = 10;
goto gotallboss;
firstdes:
- context._cmp(context.data.byte(kGunpassflag), 1);
- if (context.flags.z())
+ _cmp(data.byte(kGunpassflag), 1);
+ if (flags.z())
goto gotallboss;
- context.push(context.ax);
- randomnumber(context);
- context.cl = context.al;
- context.ax = context.pop();
- context._cmp(context.cl, 10);
- if (context.flags.c())
+ push(ax);
+ randomnumber();
+ cl = al;
+ ax = pop();
+ _cmp(cl, 10);
+ if (flags.c())
goto gotallboss;
- context.ax = 0;
+ ax = 0;
goto gotallboss;
secdes:
- context._cmp(context.data.byte(kGunpassflag), 1);
- if (context.flags.z())
+ _cmp(data.byte(kGunpassflag), 1);
+ if (flags.z())
goto gotallboss;
- context.ax = 0;
+ ax = 0;
gotallboss:
- context.es.word(context.bx+3) = context.ax;
+ es.word(bx+3) = ax;
notboss:
- showgamereel(context);
- addtopeoplelist(context);
- context.al = context.es.byte(context.bx+7);
- context._and(context.al, 128);
- if (context.flags.z())
- goto nottalkedboss;
- context.data.byte(kTalkedtoboss) = 1;
-nottalkedboss:
- return;
-}
-
-void gamer(Context &context) {
- STACK_CHECK(context);
- checkspeed(context);
- if (!context.flags.z())
+ showgamereel();
+ addtopeoplelist();
+ al = es.byte(bx+7);
+ _and(al, 128);
+ if (flags.z())
+ return /* (nottalkedboss) */;
+ data.byte(kTalkedtoboss) = 1;
+}
+
+void DreamGenContext::gamer() {
+ STACK_CHECK;
+ checkspeed();
+ if (!flags.z())
goto gamerfin;
gameragain:
- randomnum1(context);
- context._and(context.al, 7);
- context._cmp(context.al, 5);
- if (!context.flags.c())
+ randomnum1();
+ _and(al, 7);
+ _cmp(al, 5);
+ if (!flags.c())
goto gameragain;
- context._add(context.al, 20);
- context._cmp(context.al, context.es.byte(context.bx+3));
- if (context.flags.z())
+ _add(al, 20);
+ _cmp(al, es.byte(bx+3));
+ if (flags.z())
goto gameragain;
- context.ah = 0;
- context.es.word(context.bx+3) = context.ax;
+ ah = 0;
+ es.word(bx+3) = ax;
gamerfin:
- showgamereel(context);
- addtopeoplelist(context);
+ showgamereel();
+ addtopeoplelist();
}
-void sparkydrip(Context &context) {
- STACK_CHECK(context);
- checkspeed(context);
- if (!context.flags.z())
- goto cantdrip;
- context.al = 14;
- context.ah = 0;
- playchannel0(context);
-cantdrip:
- return;
+void DreamGenContext::sparkydrip() {
+ STACK_CHECK;
+ checkspeed();
+ if (!flags.z())
+ return /* (cantdrip) */;
+ al = 14;
+ ah = 0;
+ playchannel0();
}
-void carparkdrip(Context &context) {
- STACK_CHECK(context);
- checkspeed(context);
- if (!context.flags.z())
- goto cantdrip2;
- context.al = 14;
- playchannel1(context);
-cantdrip2:
- return;
+void DreamGenContext::carparkdrip() {
+ STACK_CHECK;
+ checkspeed();
+ if (!flags.z())
+ return /* (cantdrip2) */;
+ al = 14;
+ playchannel1();
}
-void keeper(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kKeeperflag), 0);
- if (!context.flags.z())
+void DreamGenContext::keeper() {
+ STACK_CHECK;
+ _cmp(data.byte(kKeeperflag), 0);
+ if (!flags.z())
goto notwaiting;
- context._cmp(context.data.word(kReeltowatch), 190);
- if (context.flags.c())
- goto waiting;
- context._inc(context.data.byte(kKeeperflag));
- context.ah = context.es.byte(context.bx+7);
- context._and(context.ah, 127);
- context._cmp(context.ah, context.data.byte(kDreamnumber));
- if (context.flags.z())
- goto notdiff;
- context.al = context.data.byte(kDreamnumber);
- context.es.byte(context.bx+7) = context.al;
-notdiff:
+ _cmp(data.word(kReeltowatch), 190);
+ if (flags.c())
+ return /* (waiting) */;
+ _inc(data.byte(kKeeperflag));
+ ah = es.byte(bx+7);
+ _and(ah, 127);
+ _cmp(ah, data.byte(kDreamnumber));
+ if (flags.z())
+ return /* (notdiff) */;
+ al = data.byte(kDreamnumber);
+ es.byte(bx+7) = al;
return;
notwaiting:
- addtopeoplelist(context);
- showgamereel(context);
-waiting:
- return;
+ addtopeoplelist();
+ showgamereel();
}
-void candles1(Context &context) {
- STACK_CHECK(context);
- checkspeed(context);
- if (!context.flags.z())
+void DreamGenContext::candles1() {
+ STACK_CHECK;
+ checkspeed();
+ if (!flags.z())
goto candle1;
- context.ax = context.es.word(context.bx+3);
- context._inc(context.ax);
- context._cmp(context.ax, 44);
- if (!context.flags.z())
+ ax = es.word(bx+3);
+ _inc(ax);
+ _cmp(ax, 44);
+ if (!flags.z())
goto notendcandle1;
- context.ax = 39;
+ ax = 39;
notendcandle1:
- context.es.word(context.bx+3) = context.ax;
+ es.word(bx+3) = ax;
candle1:
- showgamereel(context);
+ showgamereel();
}
-void smallcandle(Context &context) {
- STACK_CHECK(context);
- checkspeed(context);
- if (!context.flags.z())
+void DreamGenContext::smallcandle() {
+ STACK_CHECK;
+ checkspeed();
+ if (!flags.z())
goto smallcandlef;
- context.ax = context.es.word(context.bx+3);
- context._inc(context.ax);
- context._cmp(context.ax, 37);
- if (!context.flags.z())
+ ax = es.word(bx+3);
+ _inc(ax);
+ _cmp(ax, 37);
+ if (!flags.z())
goto notendsmallcandle;
- context.ax = 25;
+ ax = 25;
notendsmallcandle:
- context.es.word(context.bx+3) = context.ax;
+ es.word(bx+3) = ax;
smallcandlef:
- showgamereel(context);
+ showgamereel();
}
-void intromagic1(Context &context) {
- STACK_CHECK(context);
- checkspeed(context);
- if (!context.flags.z())
+void DreamGenContext::intromagic1() {
+ STACK_CHECK;
+ checkspeed();
+ if (!flags.z())
goto introm1fin;
- context.ax = context.es.word(context.bx+3);
- context._inc(context.ax);
- context._cmp(context.ax, 145);
- if (!context.flags.z())
+ ax = es.word(bx+3);
+ _inc(ax);
+ _cmp(ax, 145);
+ if (!flags.z())
goto gotintrom1;
- context.ax = 121;
+ ax = 121;
gotintrom1:
- context.es.word(context.bx+3) = context.ax;
- context._cmp(context.ax, 121);
- if (!context.flags.z())
+ es.word(bx+3) = ax;
+ _cmp(ax, 121);
+ if (!flags.z())
goto introm1fin;
- context._inc(context.data.byte(kIntrocount));
- context.push(context.es);
- context.push(context.bx);
- intro1text(context);
- context.bx = context.pop();
- context.es = context.pop();
- context._cmp(context.data.byte(kIntrocount), 8);
- if (!context.flags.z())
+ _inc(data.byte(kIntrocount));
+ push(es);
+ push(bx);
+ intro1text();
+ bx = pop();
+ es = pop();
+ _cmp(data.byte(kIntrocount), 8);
+ if (!flags.z())
goto introm1fin;
- context._add(context.data.byte(kMapy), 10);
- context.data.byte(kNowinnewroom) = 1;
+ _add(data.byte(kMapy), 10);
+ data.byte(kNowinnewroom) = 1;
introm1fin:
- showgamereel(context);
+ showgamereel();
}
-void candles(Context &context) {
- STACK_CHECK(context);
- checkspeed(context);
- if (!context.flags.z())
+void DreamGenContext::candles() {
+ STACK_CHECK;
+ checkspeed();
+ if (!flags.z())
goto candlesfin;
- context.ax = context.es.word(context.bx+3);
- context._inc(context.ax);
- context._cmp(context.ax, 167);
- if (!context.flags.z())
+ ax = es.word(bx+3);
+ _inc(ax);
+ _cmp(ax, 167);
+ if (!flags.z())
goto gotcandles;
- context.ax = 162;
+ ax = 162;
gotcandles:
- context.es.word(context.bx+3) = context.ax;
+ es.word(bx+3) = ax;
candlesfin:
- showgamereel(context);
+ showgamereel();
}
-void candles2(Context &context) {
- STACK_CHECK(context);
- checkspeed(context);
- if (!context.flags.z())
+void DreamGenContext::candles2() {
+ STACK_CHECK;
+ checkspeed();
+ if (!flags.z())
goto candles2fin;
- context.ax = context.es.word(context.bx+3);
- context._inc(context.ax);
- context._cmp(context.ax, 238);
- if (!context.flags.z())
+ ax = es.word(bx+3);
+ _inc(ax);
+ _cmp(ax, 238);
+ if (!flags.z())
goto gotcandles2;
- context.ax = 233;
+ ax = 233;
gotcandles2:
- context.es.word(context.bx+3) = context.ax;
+ es.word(bx+3) = ax;
candles2fin:
- showgamereel(context);
+ showgamereel();
}
-void gates(Context &context) {
- STACK_CHECK(context);
- checkspeed(context);
- if (!context.flags.z())
+void DreamGenContext::gates() {
+ STACK_CHECK;
+ checkspeed();
+ if (!flags.z())
goto gatesfin;
- context.ax = context.es.word(context.bx+3);
- context._inc(context.ax);
- context._cmp(context.ax, 116);
- if (!context.flags.z())
+ ax = es.word(bx+3);
+ _inc(ax);
+ _cmp(ax, 116);
+ if (!flags.z())
goto notbang;
- context.push(context.ax);
- context.push(context.bx);
- context.push(context.es);
- context.al = 17;
- playchannel1(context);
- context.es = context.pop();
- context.bx = context.pop();
- context.ax = context.pop();
+ push(ax);
+ push(bx);
+ push(es);
+ al = 17;
+ playchannel1();
+ es = pop();
+ bx = pop();
+ ax = pop();
notbang:
- context._cmp(context.ax, 110);
- if (context.flags.c())
+ _cmp(ax, 110);
+ if (flags.c())
goto slowgates;
- context.es.byte(context.bx+5) = 2;
+ es.byte(bx+5) = 2;
slowgates:
- context._cmp(context.ax, 120);
- if (!context.flags.z())
+ _cmp(ax, 120);
+ if (!flags.z())
goto gotgates;
- context.data.byte(kGetback) = 1;
- context.ax = 119;
+ data.byte(kGetback) = 1;
+ ax = 119;
gotgates:
- context.es.word(context.bx+3) = context.ax;
- context.push(context.es);
- context.push(context.bx);
- intro3text(context);
- context.bx = context.pop();
- context.es = context.pop();
+ es.word(bx+3) = ax;
+ push(es);
+ push(bx);
+ intro3text();
+ bx = pop();
+ es = pop();
gatesfin:
- showgamereel(context);
+ showgamereel();
}
-void intromagic2(Context &context) {
- STACK_CHECK(context);
- checkspeed(context);
- if (!context.flags.z())
+void DreamGenContext::intromagic2() {
+ STACK_CHECK;
+ checkspeed();
+ if (!flags.z())
goto introm2fin;
- context.ax = context.es.word(context.bx+3);
- context._inc(context.ax);
- context._cmp(context.ax, 216);
- if (!context.flags.z())
+ ax = es.word(bx+3);
+ _inc(ax);
+ _cmp(ax, 216);
+ if (!flags.z())
goto gotintrom2;
- context.ax = 192;
+ ax = 192;
gotintrom2:
- context.es.word(context.bx+3) = context.ax;
+ es.word(bx+3) = ax;
introm2fin:
- showgamereel(context);
+ showgamereel();
}
-void intromagic3(Context &context) {
- STACK_CHECK(context);
- checkspeed(context);
- if (!context.flags.z())
+void DreamGenContext::intromagic3() {
+ STACK_CHECK;
+ checkspeed();
+ if (!flags.z())
goto introm3fin;
- context.ax = context.es.word(context.bx+3);
- context._inc(context.ax);
- context._cmp(context.ax, 218);
- if (!context.flags.z())
+ ax = es.word(bx+3);
+ _inc(ax);
+ _cmp(ax, 218);
+ if (!flags.z())
goto gotintrom3;
- context.data.byte(kGetback) = 1;
+ data.byte(kGetback) = 1;
gotintrom3:
- context.es.word(context.bx+3) = context.ax;
+ es.word(bx+3) = ax;
introm3fin:
- showgamereel(context);
- context.al = context.data.byte(kMapx);
- context.es.byte(context.bx+1) = context.al;
+ showgamereel();
+ al = data.byte(kMapx);
+ es.byte(bx+1) = al;
}
-void intromonks1(Context &context) {
- STACK_CHECK(context);
- checkspeed(context);
- if (!context.flags.z())
+void DreamGenContext::intromonks1() {
+ STACK_CHECK;
+ checkspeed();
+ if (!flags.z())
goto intromonk1fin;
- context.ax = context.es.word(context.bx+3);
- context._inc(context.ax);
- context._cmp(context.ax, 80);
- if (!context.flags.z())
+ ax = es.word(bx+3);
+ _inc(ax);
+ _cmp(ax, 80);
+ if (!flags.z())
goto notendmonk1;
- context._add(context.data.byte(kMapy), 10);
- context.data.byte(kNowinnewroom) = 1;
- showgamereel(context);
+ _add(data.byte(kMapy), 10);
+ data.byte(kNowinnewroom) = 1;
+ showgamereel();
return;
notendmonk1:
- context._cmp(context.ax, 30);
- if (!context.flags.z())
+ _cmp(ax, 30);
+ if (!flags.z())
goto gotintromonk1;
- context._sub(context.data.byte(kMapy), 10);
- context.data.byte(kNowinnewroom) = 1;
- context.ax = 51;
+ _sub(data.byte(kMapy), 10);
+ data.byte(kNowinnewroom) = 1;
+ ax = 51;
gotintromonk1:
- context.es.word(context.bx+3) = context.ax;
- context._cmp(context.ax, 5);
- if (context.flags.z())
+ es.word(bx+3) = ax;
+ _cmp(ax, 5);
+ if (flags.z())
goto waitstep;
- context._cmp(context.ax, 15);
- if (context.flags.z())
+ _cmp(ax, 15);
+ if (flags.z())
goto waitstep;
- context._cmp(context.ax, 25);
- if (context.flags.z())
+ _cmp(ax, 25);
+ if (flags.z())
goto waitstep;
- context._cmp(context.ax, 61);
- if (context.flags.z())
+ _cmp(ax, 61);
+ if (flags.z())
goto waitstep;
- context._cmp(context.ax, 71);
- if (context.flags.z())
+ _cmp(ax, 71);
+ if (flags.z())
goto waitstep;
goto intromonk1fin;
waitstep:
- context.push(context.es);
- context.push(context.bx);
- intro2text(context);
- context.bx = context.pop();
- context.es = context.pop();
- context.es.byte(context.bx+6) = -20;
+ push(es);
+ push(bx);
+ intro2text();
+ bx = pop();
+ es = pop();
+ es.byte(bx+6) = -20;
intromonk1fin:
- showgamereel(context);
- context.al = context.data.byte(kMapy);
- context.es.byte(context.bx+2) = context.al;
+ showgamereel();
+ al = data.byte(kMapy);
+ es.byte(bx+2) = al;
}
-void intromonks2(Context &context) {
- STACK_CHECK(context);
- checkspeed(context);
- if (!context.flags.z())
+void DreamGenContext::intromonks2() {
+ STACK_CHECK;
+ checkspeed();
+ if (!flags.z())
goto intromonk2fin;
- context.ax = context.es.word(context.bx+3);
- context._inc(context.ax);
- context._cmp(context.ax, 87);
- if (!context.flags.z())
+ ax = es.word(bx+3);
+ _inc(ax);
+ _cmp(ax, 87);
+ if (!flags.z())
goto nottalk1;
- context._inc(context.data.byte(kIntrocount));
- context.push(context.es);
- context.push(context.bx);
- monks2text(context);
- context.bx = context.pop();
- context.es = context.pop();
- context._cmp(context.data.byte(kIntrocount), 19);
- if (!context.flags.z())
+ _inc(data.byte(kIntrocount));
+ push(es);
+ push(bx);
+ monks2text();
+ bx = pop();
+ es = pop();
+ _cmp(data.byte(kIntrocount), 19);
+ if (!flags.z())
goto notlasttalk1;
- context.ax = 87;
+ ax = 87;
goto gotintromonk2;
notlasttalk1:
- context.ax = 74;
+ ax = 74;
goto gotintromonk2;
nottalk1:
- context._cmp(context.ax, 110);
- if (!context.flags.z())
+ _cmp(ax, 110);
+ if (!flags.z())
goto notraisearm;
- context._inc(context.data.byte(kIntrocount));
- context.push(context.es);
- context.push(context.bx);
- monks2text(context);
- context.bx = context.pop();
- context.es = context.pop();
- context._cmp(context.data.byte(kIntrocount), 35);
- if (!context.flags.z())
+ _inc(data.byte(kIntrocount));
+ push(es);
+ push(bx);
+ monks2text();
+ bx = pop();
+ es = pop();
+ _cmp(data.byte(kIntrocount), 35);
+ if (!flags.z())
goto notlastraise;
- context.ax = 111;
+ ax = 111;
goto gotintromonk2;
notlastraise:
- context.ax = 98;
+ ax = 98;
goto gotintromonk2;
notraisearm:
- context._cmp(context.ax, 176);
- if (!context.flags.z())
+ _cmp(ax, 176);
+ if (!flags.z())
goto notendmonk2;
- context.data.byte(kGetback) = 1;
+ data.byte(kGetback) = 1;
goto gotintromonk2;
notendmonk2:
- context._cmp(context.ax, 125);
- if (!context.flags.z())
+ _cmp(ax, 125);
+ if (!flags.z())
goto gotintromonk2;
- context.ax = 140;
+ ax = 140;
gotintromonk2:
- context.es.word(context.bx+3) = context.ax;
+ es.word(bx+3) = ax;
intromonk2fin:
- showgamereel(context);
+ showgamereel();
}
-void handclap(Context &context) {
- STACK_CHECK(context);
+void DreamGenContext::handclap() {
+ STACK_CHECK;
}
-void monks2text(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kIntrocount), 1);
- if (!context.flags.z())
+void DreamGenContext::monks2text() {
+ STACK_CHECK;
+ _cmp(data.byte(kIntrocount), 1);
+ if (!flags.z())
goto notmonk2text1;
- context.al = 8;
- context.bl = 36;
- context.bh = 160;
- context.cx = 100;
+ al = 8;
+ bl = 36;
+ bh = 160;
+ cx = 100;
goto gotmonks2text;
notmonk2text1:
- context._cmp(context.data.byte(kIntrocount), 4);
- if (!context.flags.z())
+ _cmp(data.byte(kIntrocount), 4);
+ if (!flags.z())
goto notmonk2text2;
- context.al = 9;
- context.bl = 36;
- context.bh = 160;
- context.cx = 100;
+ al = 9;
+ bl = 36;
+ bh = 160;
+ cx = 100;
goto gotmonks2text;
notmonk2text2:
- context._cmp(context.data.byte(kIntrocount), 7);
- if (!context.flags.z())
+ _cmp(data.byte(kIntrocount), 7);
+ if (!flags.z())
goto notmonk2text3;
- context.al = 10;
- context.bl = 36;
- context.bh = 160;
- context.cx = 100;
+ al = 10;
+ bl = 36;
+ bh = 160;
+ cx = 100;
goto gotmonks2text;
notmonk2text3:
- context._cmp(context.data.byte(kIntrocount), 10);
- if (!context.flags.z())
+ _cmp(data.byte(kIntrocount), 10);
+ if (!flags.z())
goto notmonk2text4;
- context.data.byte(kIntrocount) = 12;
- context.al = 11;
- context.bl = 0;
- context.bh = 105;
- context.cx = 100;
+ data.byte(kIntrocount) = 12;
+ al = 11;
+ bl = 0;
+ bh = 105;
+ cx = 100;
goto gotmonks2text;
notmonk2text4:
- context._cmp(context.data.byte(kIntrocount), 13);
- if (!context.flags.z())
+ _cmp(data.byte(kIntrocount), 13);
+ if (!flags.z())
goto notmonk2text5;
- context.data.byte(kIntrocount) = 17;
+ data.byte(kIntrocount) = 17;
return;
- context.al = 12;
- context.bl = 0;
- context.bh = 120;
- context.cx = 100;
+ al = 12;
+ bl = 0;
+ bh = 120;
+ cx = 100;
goto gotmonks2text;
notmonk2text5:
- context._cmp(context.data.byte(kIntrocount), 16);
- if (!context.flags.z())
+ _cmp(data.byte(kIntrocount), 16);
+ if (!flags.z())
goto notmonk2text6;
- context.al = 13;
- context.bl = 0;
- context.bh = 135;
- context.cx = 100;
+ al = 13;
+ bl = 0;
+ bh = 135;
+ cx = 100;
goto gotmonks2text;
notmonk2text6:
- context._cmp(context.data.byte(kIntrocount), 19);
- if (!context.flags.z())
+ _cmp(data.byte(kIntrocount), 19);
+ if (!flags.z())
goto notmonk2text7;
- context.al = 14;
- context.bl = 36;
- context.bh = 160;
- context.cx = 100;
- context.dx = 1;
- context.ah = 82;
- { setuptimedtemp(context); return; };
+ al = 14;
+ bl = 36;
+ bh = 160;
+ cx = 100;
+ dx = 1;
+ ah = 82;
+ { setuptimedtemp(); return; };
notmonk2text7:
- context._cmp(context.data.byte(kIntrocount), 22);
- if (!context.flags.z())
+ _cmp(data.byte(kIntrocount), 22);
+ if (!flags.z())
goto notmonk2text8;
- context.al = 15;
- context.bl = 36;
- context.bh = 160;
- context.cx = 100;
+ al = 15;
+ bl = 36;
+ bh = 160;
+ cx = 100;
goto gotmonks2text;
notmonk2text8:
- context._cmp(context.data.byte(kIntrocount), 25);
- if (!context.flags.z())
+ _cmp(data.byte(kIntrocount), 25);
+ if (!flags.z())
goto notmonk2text9;
- context.al = 16;
- context.bl = 36;
- context.bh = 160;
- context.cx = 100;
+ al = 16;
+ bl = 36;
+ bh = 160;
+ cx = 100;
goto gotmonks2text;
notmonk2text9:
- context._cmp(context.data.byte(kIntrocount), 27);
- if (!context.flags.z())
+ _cmp(data.byte(kIntrocount), 27);
+ if (!flags.z())
goto notmonk2text10;
- context.al = 17;
- context.bl = 36;
- context.bh = 160;
- context.cx = 100;
+ al = 17;
+ bl = 36;
+ bh = 160;
+ cx = 100;
goto gotmonks2text;
notmonk2text10:
- context._cmp(context.data.byte(kIntrocount), 31);
- if (!context.flags.z())
- goto notmonk2text11;
- context.al = 18;
- context.bl = 36;
- context.bh = 160;
- context.cx = 100;
+ _cmp(data.byte(kIntrocount), 31);
+ if (!flags.z())
+ return /* (notmonk2text11) */;
+ al = 18;
+ bl = 36;
+ bh = 160;
+ cx = 100;
goto gotmonks2text;
-notmonk2text11:
return;
gotmonks2text:
- context.dx = 1;
- context.cx = 120;
- context.ah = 82;
- setuptimedtemp(context);
+ dx = 1;
+ cx = 120;
+ ah = 82;
+ setuptimedtemp();
}
-void intro1text(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kIntrocount), 2);
- if (!context.flags.z())
+void DreamGenContext::intro1text() {
+ STACK_CHECK;
+ _cmp(data.byte(kIntrocount), 2);
+ if (!flags.z())
goto notintro1text1;
- context.al = 40;
- context.bl = 34;
- context.bh = 130;
- context.cx = 90;
+ al = 40;
+ bl = 34;
+ bh = 130;
+ cx = 90;
goto gotintro1text;
notintro1text1:
- context._cmp(context.data.byte(kIntrocount), 4);
- if (!context.flags.z())
+ _cmp(data.byte(kIntrocount), 4);
+ if (!flags.z())
goto notintro1text2;
- context.al = 41;
- context.bl = 34;
- context.bh = 130;
- context.cx = 90;
+ al = 41;
+ bl = 34;
+ bh = 130;
+ cx = 90;
goto gotintro1text;
notintro1text2:
- context._cmp(context.data.byte(kIntrocount), 6);
- if (!context.flags.z())
- goto notintro1text3;
- context.al = 42;
- context.bl = 34;
- context.bh = 130;
- context.cx = 90;
+ _cmp(data.byte(kIntrocount), 6);
+ if (!flags.z())
+ return /* (notintro1text3) */;
+ al = 42;
+ bl = 34;
+ bh = 130;
+ cx = 90;
goto gotintro1text;
-notintro1text3:
return;
gotintro1text:
- context.dx = 1;
- context.ah = 82;
- context._cmp(context.data.byte(kCh1playing), 255);
- if (context.flags.z())
+ dx = 1;
+ ah = 82;
+ _cmp(data.byte(kCh1playing), 255);
+ if (flags.z())
goto oktalk2;
- context._dec(context.data.byte(kIntrocount));
+ _dec(data.byte(kIntrocount));
return;
oktalk2:
- setuptimedtemp(context);
+ setuptimedtemp();
}
-void intro2text(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.ax, 5);
- if (!context.flags.z())
+void DreamGenContext::intro2text() {
+ STACK_CHECK;
+ _cmp(ax, 5);
+ if (!flags.z())
goto notintro2text1;
- context.al = 43;
- context.bl = 34;
- context.bh = 40;
- context.cx = 90;
+ al = 43;
+ bl = 34;
+ bh = 40;
+ cx = 90;
goto gotintro2text;
notintro2text1:
- context._cmp(context.ax, 15);
- if (!context.flags.z())
- goto notintro2text2;
- context.al = 44;
- context.bl = 34;
- context.bh = 40;
- context.cx = 90;
+ _cmp(ax, 15);
+ if (!flags.z())
+ return /* (notintro2text2) */;
+ al = 44;
+ bl = 34;
+ bh = 40;
+ cx = 90;
goto gotintro2text;
-notintro2text2:
return;
gotintro2text:
- context.dx = 1;
- context.ah = 82;
- setuptimedtemp(context);
+ dx = 1;
+ ah = 82;
+ setuptimedtemp();
}
-void intro3text(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.ax, 107);
- if (!context.flags.z())
+void DreamGenContext::intro3text() {
+ STACK_CHECK;
+ _cmp(ax, 107);
+ if (!flags.z())
goto notintro3text1;
- context.al = 45;
- context.bl = 36;
- context.bh = 56;
- context.cx = 100;
+ al = 45;
+ bl = 36;
+ bh = 56;
+ cx = 100;
goto gotintro3text;
notintro3text1:
- context._cmp(context.ax, 108);
- if (!context.flags.z())
- goto notintro3text2;
- context.al = 46;
- context.bl = 36;
- context.bh = 56;
- context.cx = 100;
+ _cmp(ax, 108);
+ if (!flags.z())
+ return /* (notintro3text2) */;
+ al = 46;
+ bl = 36;
+ bh = 56;
+ cx = 100;
goto gotintro3text;
-notintro3text2:
return;
gotintro3text:
- context.dx = 1;
- context.ah = 82;
- setuptimedtemp(context);
+ dx = 1;
+ ah = 82;
+ setuptimedtemp();
}
-void monkandryan(Context &context) {
- STACK_CHECK(context);
- checkspeed(context);
- if (!context.flags.z())
+void DreamGenContext::monkandryan() {
+ STACK_CHECK;
+ checkspeed();
+ if (!flags.z())
goto notmonkryan;
- context.ax = context.es.word(context.bx+3);
- context._inc(context.ax);
- context._cmp(context.ax, 83);
- if (!context.flags.z())
+ ax = es.word(bx+3);
+ _inc(ax);
+ _cmp(ax, 83);
+ if (!flags.z())
goto gotmonkryan;
- context._inc(context.data.byte(kIntrocount));
- context.push(context.es);
- context.push(context.bx);
- textformonk(context);
- context.bx = context.pop();
- context.es = context.pop();
- context.ax = 77;
- context._cmp(context.data.byte(kIntrocount), 57);
- if (!context.flags.z())
+ _inc(data.byte(kIntrocount));
+ push(es);
+ push(bx);
+ textformonk();
+ bx = pop();
+ es = pop();
+ ax = 77;
+ _cmp(data.byte(kIntrocount), 57);
+ if (!flags.z())
goto gotmonkryan;
- context.data.byte(kGetback) = 1;
+ data.byte(kGetback) = 1;
return;
gotmonkryan:
- context.es.word(context.bx+3) = context.ax;
+ es.word(bx+3) = ax;
notmonkryan:
- showgamereel(context);
+ showgamereel();
}
-void endgameseq(Context &context) {
- STACK_CHECK(context);
- checkspeed(context);
- if (!context.flags.z())
+void DreamGenContext::endgameseq() {
+ STACK_CHECK;
+ checkspeed();
+ if (!flags.z())
goto notendseq;
- context.ax = context.es.word(context.bx+3);
- context._inc(context.ax);
- context._cmp(context.ax, 51);
- if (!context.flags.z())
+ ax = es.word(bx+3);
+ _inc(ax);
+ _cmp(ax, 51);
+ if (!flags.z())
goto gotendseq;
- context._cmp(context.data.byte(kIntrocount), 140);
- if (context.flags.z())
+ _cmp(data.byte(kIntrocount), 140);
+ if (flags.z())
goto gotendseq;
- context._inc(context.data.byte(kIntrocount));
- context.push(context.es);
- context.push(context.bx);
- textforend(context);
- context.bx = context.pop();
- context.es = context.pop();
- context.ax = 50;
+ _inc(data.byte(kIntrocount));
+ push(es);
+ push(bx);
+ textforend();
+ bx = pop();
+ es = pop();
+ ax = 50;
gotendseq:
- context.es.word(context.bx+3) = context.ax;
- context._cmp(context.ax, 134);
- if (!context.flags.z())
+ es.word(bx+3) = ax;
+ _cmp(ax, 134);
+ if (!flags.z())
goto notfadedown;
- context.push(context.es);
- context.push(context.bx);
- context.push(context.ax);
- fadescreendownhalf(context);
- context.ax = context.pop();
- context.bx = context.pop();
- context.es = context.pop();
+ push(es);
+ push(bx);
+ push(ax);
+ fadescreendownhalf();
+ ax = pop();
+ bx = pop();
+ es = pop();
goto notendseq;
notfadedown:
- context._cmp(context.ax, 324);
- if (!context.flags.z())
+ _cmp(ax, 324);
+ if (!flags.z())
goto notfadeend;
- context.push(context.es);
- context.push(context.bx);
- context.push(context.ax);
- fadescreendowns(context);
- context.data.byte(kVolumeto) = 7;
- context.data.byte(kVolumedirection) = 1;
- context.ax = context.pop();
- context.bx = context.pop();
- context.es = context.pop();
+ push(es);
+ push(bx);
+ push(ax);
+ fadescreendowns();
+ data.byte(kVolumeto) = 7;
+ data.byte(kVolumedirection) = 1;
+ ax = pop();
+ bx = pop();
+ es = pop();
notfadeend:
- context._cmp(context.ax, 340);
- if (!context.flags.z())
+ _cmp(ax, 340);
+ if (!flags.z())
goto notendseq;
- context.data.byte(kGetback) = 1;
+ data.byte(kGetback) = 1;
notendseq:
- showgamereel(context);
- context.al = context.data.byte(kMapy);
- context.es.byte(context.bx+2) = context.al;
- context.ax = context.es.word(context.bx+3);
- context._cmp(context.ax, 145);
- if (!context.flags.z())
- goto notendcreds;
- context.es.word(context.bx+3) = 146;
- rollendcredits(context);
-notendcreds:
- return;
-}
-
-void rollendcredits(Context &context) {
- STACK_CHECK(context);
- context.al = 16;
- context.ah = 255;
- playchannel0(context);
- context.data.byte(kVolume) = 7;
- context.data.byte(kVolumeto) = 0;
- context.data.byte(kVolumedirection) = -1;
- context.cl = 160;
- context.ch = 160;
- context.di = 75;
- context.bx = 20;
- context.ds = context.data.word(kMapstore);
- context.si = 0;
- multiget(context);
- context.es = context.data.word(kTextfile1);
- context.si = 3*2;
- context.ax = context.es.word(context.si);
- context.si = context.ax;
- context._add(context.si, (66*2));
- context.cx = 254;
+ showgamereel();
+ al = data.byte(kMapy);
+ es.byte(bx+2) = al;
+ ax = es.word(bx+3);
+ _cmp(ax, 145);
+ if (!flags.z())
+ return /* (notendcreds) */;
+ es.word(bx+3) = 146;
+ rollendcredits();
+}
+
+void DreamGenContext::rollendcredits() {
+ STACK_CHECK;
+ al = 16;
+ ah = 255;
+ playchannel0();
+ data.byte(kVolume) = 7;
+ data.byte(kVolumeto) = 0;
+ data.byte(kVolumedirection) = -1;
+ cl = 160;
+ ch = 160;
+ di = 75;
+ bx = 20;
+ ds = data.word(kMapstore);
+ si = 0;
+ multiget();
+ es = data.word(kTextfile1);
+ si = 3*2;
+ ax = es.word(si);
+ si = ax;
+ _add(si, (66*2));
+ cx = 254;
endcredits1:
- context.push(context.cx);
- context.bx = 10;
- context.cx = context.data.word(kLinespacing);
+ push(cx);
+ bx = 10;
+ cx = data.word(kLinespacing);
endcredits2:
- context.push(context.cx);
- context.push(context.si);
- context.push(context.di);
- context.push(context.es);
- context.push(context.bx);
- vsync(context);
- context.cl = 160;
- context.ch = 160;
- context.di = 75;
- context.bx = 20;
- context.ds = context.data.word(kMapstore);
- context.si = 0;
- multiput(context);
- vsync(context);
- context.bx = context.pop();
- context.es = context.pop();
- context.di = context.pop();
- context.si = context.pop();
- context.push(context.si);
- context.push(context.di);
- context.push(context.es);
- context.push(context.bx);
- context.cx = 18;
+ push(cx);
+ push(si);
+ push(di);
+ push(es);
+ push(bx);
+ vsync();
+ cl = 160;
+ ch = 160;
+ di = 75;
+ bx = 20;
+ ds = data.word(kMapstore);
+ si = 0;
+ multiput();
+ vsync();
+ bx = pop();
+ es = pop();
+ di = pop();
+ si = pop();
+ push(si);
+ push(di);
+ push(es);
+ push(bx);
+ cx = 18;
onelot:
- context.push(context.cx);
- context.di = 75;
- context.dx = 161;
- context.ax = 0;
- printdirect(context);
- context._add(context.bx, context.data.word(kLinespacing));
- context.cx = context.pop();
- if (--context.cx)
+ push(cx);
+ di = 75;
+ dx = 161;
+ ax = 0;
+ printdirect();
+ _add(bx, data.word(kLinespacing));
+ cx = pop();
+ if (--cx)
goto onelot;
- vsync(context);
- context.cl = 160;
- context.ch = 160;
- context.di = 75;
- context.bx = 20;
- multidump(context);
- context.bx = context.pop();
- context.es = context.pop();
- context.di = context.pop();
- context.si = context.pop();
- context.cx = context.pop();
- context._dec(context.bx);
- if (--context.cx)
+ vsync();
+ cl = 160;
+ ch = 160;
+ di = 75;
+ bx = 20;
+ multidump();
+ bx = pop();
+ es = pop();
+ di = pop();
+ si = pop();
+ cx = pop();
+ _dec(bx);
+ if (--cx)
goto endcredits2;
- context.cx = context.pop();
+ cx = pop();
looknext:
- context.al = context.es.byte(context.si);
- context._inc(context.si);
- context._cmp(context.al, ':');
- if (context.flags.z())
+ al = es.byte(si);
+ _inc(si);
+ _cmp(al, ':');
+ if (flags.z())
goto gotnext;
- context._cmp(context.al, 0);
- if (context.flags.z())
+ _cmp(al, 0);
+ if (flags.z())
goto gotnext;
goto looknext;
gotnext:
- if (--context.cx)
+ if (--cx)
goto endcredits1;
- context.cx = 100;
- hangon(context);
- paneltomap(context);
- fadescreenuphalf(context);
-}
-
-void priest(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.es.word(context.bx+3), 8);
- if (context.flags.z())
- goto priestspoken;
- context.data.byte(kPointermode) = 0;
- context.data.word(kWatchingtime) = 2;
- checkspeed(context);
- if (!context.flags.z())
- goto priestwait;
- context._inc(context.es.word(context.bx+3));
- context.push(context.es);
- context.push(context.bx);
- priesttext(context);
- context.bx = context.pop();
- context.es = context.pop();
-priestwait:
- return;
-priestspoken:
- return;
-}
-
-void madmanstelly(Context &context) {
- STACK_CHECK(context);
- context.ax = context.es.word(context.bx+3);
- context._inc(context.ax);
- context._cmp(context.ax, 307);
- if (!context.flags.z())
+ cx = 100;
+ hangon();
+ paneltomap();
+ fadescreenuphalf();
+}
+
+void DreamGenContext::priest() {
+ STACK_CHECK;
+ _cmp(es.word(bx+3), 8);
+ if (flags.z())
+ return /* (priestspoken) */;
+ data.byte(kPointermode) = 0;
+ data.word(kWatchingtime) = 2;
+ checkspeed();
+ if (!flags.z())
+ return /* (priestwait) */;
+ _inc(es.word(bx+3));
+ push(es);
+ push(bx);
+ priesttext();
+ bx = pop();
+ es = pop();
+}
+
+void DreamGenContext::madmanstelly() {
+ STACK_CHECK;
+ ax = es.word(bx+3);
+ _inc(ax);
+ _cmp(ax, 307);
+ if (!flags.z())
goto notendtelly;
- context.ax = 300;
+ ax = 300;
notendtelly:
- context.es.word(context.bx+3) = context.ax;
- showgamereel(context);
+ es.word(bx+3) = ax;
+ showgamereel();
}
-void madman(Context &context) {
- STACK_CHECK(context);
- context.data.word(kWatchingtime) = 2;
- checkspeed(context);
- if (!context.flags.z())
+void DreamGenContext::madman() {
+ STACK_CHECK;
+ data.word(kWatchingtime) = 2;
+ checkspeed();
+ if (!flags.z())
goto nomadspeed;
- context.ax = context.es.word(context.bx+3);
- context._cmp(context.ax, 364);
- if (!context.flags.c())
+ ax = es.word(bx+3);
+ _cmp(ax, 364);
+ if (!flags.c())
goto ryansded;
- context._cmp(context.ax, 10);
- if (!context.flags.z())
+ _cmp(ax, 10);
+ if (!flags.z())
goto notfirstmad;
- context.push(context.es);
- context.push(context.bx);
- context.push(context.ax);
- context.dx = 2247;
- loadtemptext(context);
- context.ax = context.pop();
- context.bx = context.pop();
- context.es = context.pop();
- context.data.byte(kCombatcount) = -1;
- context.data.byte(kSpeechcount) = 0;
+ push(es);
+ push(bx);
+ push(ax);
+ dx = 2247;
+ loadtemptext();
+ ax = pop();
+ bx = pop();
+ es = pop();
+ data.byte(kCombatcount) = -1;
+ data.byte(kSpeechcount) = 0;
notfirstmad:
- context._inc(context.ax);
- context._cmp(context.ax, 294);
- if (context.flags.z())
+ _inc(ax);
+ _cmp(ax, 294);
+ if (flags.z())
goto madmanspoken;
- context._cmp(context.ax, 66);
- if (!context.flags.z())
+ _cmp(ax, 66);
+ if (!flags.z())
goto nomadspeak;
- context._inc(context.data.byte(kCombatcount));
- context.push(context.es);
- context.push(context.bx);
- madmantext(context);
- context.bx = context.pop();
- context.es = context.pop();
- context.ax = 53;
- context._cmp(context.data.byte(kCombatcount), 64);
- if (context.flags.c())
+ _inc(data.byte(kCombatcount));
+ push(es);
+ push(bx);
+ madmantext();
+ bx = pop();
+ es = pop();
+ ax = 53;
+ _cmp(data.byte(kCombatcount), 64);
+ if (flags.c())
goto nomadspeak;
- context._cmp(context.data.byte(kCombatcount), 70);
- if (context.flags.z())
+ _cmp(data.byte(kCombatcount), 70);
+ if (flags.z())
goto killryan;
- context._cmp(context.data.byte(kLastweapon), 8);
- if (!context.flags.z())
+ _cmp(data.byte(kLastweapon), 8);
+ if (!flags.z())
goto nomadspeak;
- context.data.byte(kCombatcount) = 72;
- context.data.byte(kLastweapon) = -1;
- context.data.byte(kMadmanflag) = 1;
- context.ax = 67;
+ data.byte(kCombatcount) = 72;
+ data.byte(kLastweapon) = -1;
+ data.byte(kMadmanflag) = 1;
+ ax = 67;
goto nomadspeak;
killryan:
- context.ax = 310;
+ ax = 310;
nomadspeak:
- context.es.word(context.bx+3) = context.ax;
+ es.word(bx+3) = ax;
nomadspeed:
- showgamereel(context);
- context.al = context.data.byte(kMapx);
- context.es.byte(context.bx+1) = context.al;
- madmode(context);
+ showgamereel();
+ al = data.byte(kMapx);
+ es.byte(bx+1) = al;
+ madmode();
return;
madmanspoken:
- context._cmp(context.data.byte(kWongame), 1);
- if (context.flags.z())
- goto alreadywon;
- context.data.byte(kWongame) = 1;
- context.push(context.es);
- context.push(context.bx);
- getridoftemptext(context);
- context.bx = context.pop();
- context.es = context.pop();
-alreadywon:
+ _cmp(data.byte(kWongame), 1);
+ if (flags.z())
+ return /* (alreadywon) */;
+ data.byte(kWongame) = 1;
+ push(es);
+ push(bx);
+ getridoftemptext();
+ bx = pop();
+ es = pop();
return;
ryansded:
- context.data.byte(kMandead) = 2;
- showgamereel(context);
-}
-
-void madmantext(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kSpeechcount), 63);
- if (!context.flags.c())
- goto nomadtext;
- context._cmp(context.data.byte(kCh1playing), 255);
- if (!context.flags.z())
- goto nomadtext;
- context.al = context.data.byte(kSpeechcount);
- context._inc(context.data.byte(kSpeechcount));
- context._add(context.al, 47);
- context.bl = 72;
- context.bh = 80;
- context.cx = 90;
- context.dx = 1;
- context.ah = 82;
- setuptimedtemp(context);
-nomadtext:
- return;
-}
-
-void madmode(Context &context) {
- STACK_CHECK(context);
- context.data.word(kWatchingtime) = 2;
- context.data.byte(kPointermode) = 0;
- context._cmp(context.data.byte(kCombatcount), 65);
- if (context.flags.c())
- goto iswatchmad;
- context._cmp(context.data.byte(kCombatcount), 70);
- if (!context.flags.c())
- goto iswatchmad;
- context.data.byte(kPointermode) = 2;
-iswatchmad:
- return;
-}
-
-void priesttext(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.es.word(context.bx+3), 2);
- if (context.flags.c())
- goto nopriesttext;
- context._cmp(context.es.word(context.bx+3), 7);
- if (!context.flags.c())
- goto nopriesttext;
- context.al = context.es.byte(context.bx+3);
- context._and(context.al, 1);
- if (!context.flags.z())
- goto nopriesttext;
- context.al = context.es.byte(context.bx+3);
- context._shr(context.al, 1);
- context._add(context.al, 50);
- context.bl = 72;
- context.bh = 80;
- context.cx = 54;
- context.dx = 1;
- setuptimeduse(context);
-nopriesttext:
- return;
-}
-
-void textforend(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kIntrocount), 20);
- if (!context.flags.z())
+ data.byte(kMandead) = 2;
+ showgamereel();
+}
+
+void DreamGenContext::madmantext() {
+ STACK_CHECK;
+ _cmp(data.byte(kSpeechcount), 63);
+ if (!flags.c())
+ return /* (nomadtext) */;
+ _cmp(data.byte(kCh1playing), 255);
+ if (!flags.z())
+ return /* (nomadtext) */;
+ al = data.byte(kSpeechcount);
+ _inc(data.byte(kSpeechcount));
+ _add(al, 47);
+ bl = 72;
+ bh = 80;
+ cx = 90;
+ dx = 1;
+ ah = 82;
+ setuptimedtemp();
+}
+
+void DreamGenContext::madmode() {
+ STACK_CHECK;
+ data.word(kWatchingtime) = 2;
+ data.byte(kPointermode) = 0;
+ _cmp(data.byte(kCombatcount), 65);
+ if (flags.c())
+ return /* (iswatchmad) */;
+ _cmp(data.byte(kCombatcount), 70);
+ if (!flags.c())
+ return /* (iswatchmad) */;
+ data.byte(kPointermode) = 2;
+}
+
+void DreamGenContext::priesttext() {
+ STACK_CHECK;
+ _cmp(es.word(bx+3), 2);
+ if (flags.c())
+ return /* (nopriesttext) */;
+ _cmp(es.word(bx+3), 7);
+ if (!flags.c())
+ return /* (nopriesttext) */;
+ al = es.byte(bx+3);
+ _and(al, 1);
+ if (!flags.z())
+ return /* (nopriesttext) */;
+ al = es.byte(bx+3);
+ _shr(al, 1);
+ _add(al, 50);
+ bl = 72;
+ bh = 80;
+ cx = 54;
+ dx = 1;
+ setuptimeduse();
+}
+
+void DreamGenContext::textforend() {
+ STACK_CHECK;
+ _cmp(data.byte(kIntrocount), 20);
+ if (!flags.z())
goto notendtext1;
- context.al = 0;
- context.bl = 34;
- context.bh = 20;
- context.cx = 60;
+ al = 0;
+ bl = 34;
+ bh = 20;
+ cx = 60;
goto gotendtext;
notendtext1:
- context._cmp(context.data.byte(kIntrocount), 50);
- if (!context.flags.z())
+ _cmp(data.byte(kIntrocount), 50);
+ if (!flags.z())
goto notendtext2;
- context.al = 1;
- context.bl = 34;
- context.bh = 20;
- context.cx = 60;
+ al = 1;
+ bl = 34;
+ bh = 20;
+ cx = 60;
goto gotendtext;
notendtext2:
- context._cmp(context.data.byte(kIntrocount), 85);
- if (!context.flags.z())
- goto notendtext3;
- context.al = 2;
- context.bl = 34;
- context.bh = 20;
- context.cx = 60;
+ _cmp(data.byte(kIntrocount), 85);
+ if (!flags.z())
+ return /* (notendtext3) */;
+ al = 2;
+ bl = 34;
+ bh = 20;
+ cx = 60;
goto gotendtext;
-notendtext3:
return;
gotendtext:
- context.dx = 1;
- context.ah = 83;
- setuptimedtemp(context);
+ dx = 1;
+ ah = 83;
+ setuptimedtemp();
}
-void textformonk(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kIntrocount), 1);
- if (!context.flags.z())
+void DreamGenContext::textformonk() {
+ STACK_CHECK;
+ _cmp(data.byte(kIntrocount), 1);
+ if (!flags.z())
goto notmonktext1;
- context.al = 19;
- context.bl = 68;
- context.bh = 154;
- context.cx = 120;
+ al = 19;
+ bl = 68;
+ bh = 154;
+ cx = 120;
goto gotmonktext;
notmonktext1:
- context._cmp(context.data.byte(kIntrocount), 5);
- if (!context.flags.z())
+ _cmp(data.byte(kIntrocount), 5);
+ if (!flags.z())
goto notmonktext2;
- context.al = 20;
- context.bl = 68;
- context.bh = 38;
- context.cx = 120;
+ al = 20;
+ bl = 68;
+ bh = 38;
+ cx = 120;
goto gotmonktext;
notmonktext2:
- context._cmp(context.data.byte(kIntrocount), 9);
- if (!context.flags.z())
+ _cmp(data.byte(kIntrocount), 9);
+ if (!flags.z())
goto notmonktext3;
- context.al = 21;
- context.bl = 48;
- context.bh = 154;
- context.cx = 120;
+ al = 21;
+ bl = 48;
+ bh = 154;
+ cx = 120;
goto gotmonktext;
notmonktext3:
- context._cmp(context.data.byte(kIntrocount), 13);
- if (!context.flags.z())
+ _cmp(data.byte(kIntrocount), 13);
+ if (!flags.z())
goto notmonktext4;
- context.al = 22;
- context.bl = 68;
- context.bh = 38;
- context.cx = 120;
+ al = 22;
+ bl = 68;
+ bh = 38;
+ cx = 120;
goto gotmonktext;
notmonktext4:
- context._cmp(context.data.byte(kIntrocount), 15);
- if (!context.flags.z())
+ _cmp(data.byte(kIntrocount), 15);
+ if (!flags.z())
goto notmonktext5;
- context.al = 23;
- context.bl = 68;
- context.bh = 154;
- context.cx = 120;
+ al = 23;
+ bl = 68;
+ bh = 154;
+ cx = 120;
goto gotmonktext;
notmonktext5:
- context._cmp(context.data.byte(kIntrocount), 21);
- if (!context.flags.z())
+ _cmp(data.byte(kIntrocount), 21);
+ if (!flags.z())
goto notmonktext6;
- context.al = 24;
- context.bl = 68;
- context.bh = 38;
- context.cx = 120;
+ al = 24;
+ bl = 68;
+ bh = 38;
+ cx = 120;
goto gotmonktext;
notmonktext6:
- context._cmp(context.data.byte(kIntrocount), 25);
- if (!context.flags.z())
+ _cmp(data.byte(kIntrocount), 25);
+ if (!flags.z())
goto notmonktext7;
- context.al = 25;
- context.bl = 68;
- context.bh = 154;
- context.cx = 120;
+ al = 25;
+ bl = 68;
+ bh = 154;
+ cx = 120;
goto gotmonktext;
notmonktext7:
- context._cmp(context.data.byte(kIntrocount), 29);
- if (!context.flags.z())
+ _cmp(data.byte(kIntrocount), 29);
+ if (!flags.z())
goto notmonktext8;
- context.al = 26;
- context.bl = 68;
- context.bh = 38;
- context.cx = 120;
+ al = 26;
+ bl = 68;
+ bh = 38;
+ cx = 120;
goto gotmonktext;
notmonktext8:
- context._cmp(context.data.byte(kIntrocount), 33);
- if (!context.flags.z())
+ _cmp(data.byte(kIntrocount), 33);
+ if (!flags.z())
goto notmonktext9;
- context.al = 27;
- context.bl = 68;
- context.bh = 154;
- context.cx = 120;
+ al = 27;
+ bl = 68;
+ bh = 154;
+ cx = 120;
goto gotmonktext;
notmonktext9:
- context._cmp(context.data.byte(kIntrocount), 37);
- if (!context.flags.z())
+ _cmp(data.byte(kIntrocount), 37);
+ if (!flags.z())
goto notmonktext10;
- context.al = 28;
- context.bl = 68;
- context.bh = 154;
- context.cx = 120;
+ al = 28;
+ bl = 68;
+ bh = 154;
+ cx = 120;
goto gotmonktext;
notmonktext10:
- context._cmp(context.data.byte(kIntrocount), 41);
- if (!context.flags.z())
+ _cmp(data.byte(kIntrocount), 41);
+ if (!flags.z())
goto notmonktext11;
- context.al = 29;
- context.bl = 68;
- context.bh = 38;
- context.cx = 120;
+ al = 29;
+ bl = 68;
+ bh = 38;
+ cx = 120;
goto gotmonktext;
notmonktext11:
- context._cmp(context.data.byte(kIntrocount), 45);
- if (!context.flags.z())
+ _cmp(data.byte(kIntrocount), 45);
+ if (!flags.z())
goto notmonktext12;
- context.al = 30;
- context.bl = 68;
- context.bh = 154;
- context.cx = 120;
+ al = 30;
+ bl = 68;
+ bh = 154;
+ cx = 120;
goto gotmonktext;
notmonktext12:
- context._cmp(context.data.byte(kIntrocount), 52);
- if (!context.flags.z())
+ _cmp(data.byte(kIntrocount), 52);
+ if (!flags.z())
goto notmonktext13;
- context.al = 31;
- context.bl = 68;
- context.bh = 154;
- context.cx = 220;
+ al = 31;
+ bl = 68;
+ bh = 154;
+ cx = 220;
goto gotmonktext;
notmonktext13:
- context._cmp(context.data.byte(kIntrocount), 53);
- if (!context.flags.z())
- goto notendtitles;
- fadescreendowns(context);
- context.data.byte(kVolumeto) = 7;
- context.data.byte(kVolumedirection) = 1;
-notendtitles:
+ _cmp(data.byte(kIntrocount), 53);
+ if (!flags.z())
+ return /* (notendtitles) */;
+ fadescreendowns();
+ data.byte(kVolumeto) = 7;
+ data.byte(kVolumedirection) = 1;
return;
gotmonktext:
- context.dx = 1;
- context.ah = 82;
- context._cmp(context.data.byte(kCh1playing), 255);
- if (context.flags.z())
+ dx = 1;
+ ah = 82;
+ _cmp(data.byte(kCh1playing), 255);
+ if (flags.z())
goto oktalk;
- context._dec(context.data.byte(kIntrocount));
+ _dec(data.byte(kIntrocount));
return;
oktalk:
- setuptimedtemp(context);
+ setuptimedtemp();
}
-void drunk(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kGeneraldead), 0);
- if (!context.flags.z())
- goto trampgone;
- context.al = context.es.byte(context.bx+7);
- context._and(context.al, 127);
- context.es.byte(context.bx+7) = context.al;
- showgamereel(context);
- addtopeoplelist(context);
-trampgone:
- return;
+void DreamGenContext::drunk() {
+ STACK_CHECK;
+ _cmp(data.byte(kGeneraldead), 0);
+ if (!flags.z())
+ return /* (trampgone) */;
+ al = es.byte(bx+7);
+ _and(al, 127);
+ es.byte(bx+7) = al;
+ showgamereel();
+ addtopeoplelist();
}
-void advisor(Context &context) {
- STACK_CHECK(context);
- checkspeed(context);
- if (!context.flags.z())
+void DreamGenContext::advisor() {
+ STACK_CHECK;
+ checkspeed();
+ if (!flags.z())
goto noadvisor;
goto noadvisor;
- context.ax = context.es.word(context.bx+3);
- context._inc(context.ax);
- context._cmp(context.ax, 123);
- if (!context.flags.z())
+ ax = es.word(bx+3);
+ _inc(ax);
+ _cmp(ax, 123);
+ if (!flags.z())
goto notendadvis;
- context.ax = 106;
+ ax = 106;
goto gotadvframe;
notendadvis:
- context._cmp(context.ax, 108);
- if (!context.flags.z())
+ _cmp(ax, 108);
+ if (!flags.z())
goto gotadvframe;
- context.push(context.ax);
- randomnumber(context);
- context.cl = context.al;
- context.ax = context.pop();
- context._cmp(context.cl, 3);
- if (context.flags.c())
+ push(ax);
+ randomnumber();
+ cl = al;
+ ax = pop();
+ _cmp(cl, 3);
+ if (flags.c())
goto gotadvframe;
- context.ax = 106;
+ ax = 106;
gotadvframe:
- context.es.word(context.bx+3) = context.ax;
+ es.word(bx+3) = ax;
noadvisor:
- showgamereel(context);
- addtopeoplelist(context);
+ showgamereel();
+ addtopeoplelist();
}
-void copper(Context &context) {
- STACK_CHECK(context);
- checkspeed(context);
- if (!context.flags.z())
+void DreamGenContext::copper() {
+ STACK_CHECK;
+ checkspeed();
+ if (!flags.z())
goto nocopper;
- context.ax = context.es.word(context.bx+3);
- context._inc(context.ax);
- context._cmp(context.ax, 94);
- if (!context.flags.z())
+ ax = es.word(bx+3);
+ _inc(ax);
+ _cmp(ax, 94);
+ if (!flags.z())
goto notendcopper;
- context.ax = 64;
+ ax = 64;
goto gotcopframe;
notendcopper:
- context._cmp(context.ax, 81);
- if (context.flags.z())
+ _cmp(ax, 81);
+ if (flags.z())
goto mightwait;
- context._cmp(context.ax, 66);
- if (!context.flags.z())
+ _cmp(ax, 66);
+ if (!flags.z())
goto gotcopframe;
mightwait:
- context.push(context.ax);
- randomnumber(context);
- context.cl = context.al;
- context.ax = context.pop();
- context._cmp(context.cl, 7);
- if (context.flags.c())
+ push(ax);
+ randomnumber();
+ cl = al;
+ ax = pop();
+ _cmp(cl, 7);
+ if (flags.c())
goto gotcopframe;
- context._dec(context.ax);
+ _dec(ax);
gotcopframe:
- context.es.word(context.bx+3) = context.ax;
+ es.word(bx+3) = ax;
nocopper:
- showgamereel(context);
- addtopeoplelist(context);
+ showgamereel();
+ addtopeoplelist();
}
-void sparky(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.word(kCard1money), 0);
- if (context.flags.z())
+void DreamGenContext::sparky() {
+ STACK_CHECK;
+ _cmp(data.word(kCard1money), 0);
+ if (flags.z())
goto animsparky;
- context.es.byte(context.bx+7) = 3;
+ es.byte(bx+7) = 3;
goto animsparky;
animsparky:
- checkspeed(context);
- if (!context.flags.z())
+ checkspeed();
+ if (!flags.z())
goto finishsparky;
- context._cmp(context.es.word(context.bx+3), 34);
- if (!context.flags.z())
+ _cmp(es.word(bx+3), 34);
+ if (!flags.z())
goto notsparky1;
- randomnumber(context);
- context._cmp(context.al, 30);
- if (context.flags.c())
+ randomnumber();
+ _cmp(al, 30);
+ if (flags.c())
goto dosparky;
- context.es.word(context.bx+3) = 27;
+ es.word(bx+3) = 27;
goto finishsparky;
notsparky1:
- context._cmp(context.es.word(context.bx+3), 48);
- if (!context.flags.z())
+ _cmp(es.word(bx+3), 48);
+ if (!flags.z())
goto dosparky;
- context.es.word(context.bx+3) = 27;
+ es.word(bx+3) = 27;
goto finishsparky;
dosparky:
- context._inc(context.es.word(context.bx+3));
+ _inc(es.word(bx+3));
finishsparky:
- showgamereel(context);
- addtopeoplelist(context);
- context.al = context.es.byte(context.bx+7);
- context._and(context.al, 128);
- if (context.flags.z())
- goto nottalkedsparky;
- context.data.byte(kTalkedtosparky) = 1;
-nottalkedsparky:
- return;
+ showgamereel();
+ addtopeoplelist();
+ al = es.byte(bx+7);
+ _and(al, 128);
+ if (flags.z())
+ return /* (nottalkedsparky) */;
+ data.byte(kTalkedtosparky) = 1;
}
-void train(Context &context) {
- STACK_CHECK(context);
+void DreamGenContext::train() {
+ STACK_CHECK;
return;
- context.ax = context.es.word(context.bx+3);
- context._cmp(context.ax, 21);
- if (!context.flags.c())
+ ax = es.word(bx+3);
+ _cmp(ax, 21);
+ if (!flags.c())
goto notrainyet;
- context._inc(context.ax);
+ _inc(ax);
goto gottrainframe;
notrainyet:
- randomnumber(context);
- context._cmp(context.al, 253);
- if (context.flags.c())
- goto notrainatall;
- context._cmp(context.data.byte(kManspath), 5);
- if (!context.flags.z())
- goto notrainatall;
- context._cmp(context.data.byte(kFinaldest), 5);
- if (!context.flags.z())
- goto notrainatall;
- context.ax = 5;
+ randomnumber();
+ _cmp(al, 253);
+ if (flags.c())
+ return /* (notrainatall) */;
+ _cmp(data.byte(kManspath), 5);
+ if (!flags.z())
+ return /* (notrainatall) */;
+ _cmp(data.byte(kFinaldest), 5);
+ if (!flags.z())
+ return /* (notrainatall) */;
+ ax = 5;
gottrainframe:
- context.es.word(context.bx+3) = context.ax;
- showgamereel(context);
-notrainatall:
- return;
-}
-
-void addtopeoplelist(Context &context) {
- STACK_CHECK(context);
- context.push(context.es);
- context.push(context.bx);
- context.push(context.bx);
- context.cl = context.es.byte(context.bx+7);
- context.ax = context.es.word(context.bx+3);
- context.bx = context.data.word(kListpos);
- context.es = context.data.word(kBuffers);
- context.es.word(context.bx) = context.ax;
- context.ax = context.pop();
- context.es.word(context.bx+2) = context.ax;
- context.es.byte(context.bx+4) = context.cl;
- context.bx = context.pop();
- context.es = context.pop();
- context._add(context.data.word(kListpos), 5);
-}
-
-void showgamereel(Context &context) {
- STACK_CHECK(context);
- context.ax = context.es.word(context.bx+3);
- context._cmp(context.ax, 512);
- if (!context.flags.c())
- goto noshow;
- context.data.word(kReelpointer) = context.ax;
- context.push(context.es);
- context.push(context.bx);
- plotreel(context);
- context.bx = context.pop();
- context.es = context.pop();
- context.ax = context.data.word(kReelpointer);
- context.es.word(context.bx+3) = context.ax;
-noshow:
- return;
-}
-
-void checkspeed(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kLastweapon), -1);
- if (!context.flags.z())
+ es.word(bx+3) = ax;
+ showgamereel();
+}
+
+void DreamGenContext::addtopeoplelist() {
+ STACK_CHECK;
+ push(es);
+ push(bx);
+ push(bx);
+ cl = es.byte(bx+7);
+ ax = es.word(bx+3);
+ bx = data.word(kListpos);
+ es = data.word(kBuffers);
+ es.word(bx) = ax;
+ ax = pop();
+ es.word(bx+2) = ax;
+ es.byte(bx+4) = cl;
+ bx = pop();
+ es = pop();
+ _add(data.word(kListpos), 5);
+}
+
+void DreamGenContext::showgamereel() {
+ STACK_CHECK;
+ ax = es.word(bx+3);
+ _cmp(ax, 512);
+ if (!flags.c())
+ return /* (noshow) */;
+ data.word(kReelpointer) = ax;
+ push(es);
+ push(bx);
+ plotreel();
+ bx = pop();
+ es = pop();
+ ax = data.word(kReelpointer);
+ es.word(bx+3) = ax;
+}
+
+void DreamGenContext::checkspeed() {
+ STACK_CHECK;
+ _cmp(data.byte(kLastweapon), -1);
+ if (!flags.z())
goto forcenext;
- context._inc(context.es.byte(context.bx+6));
- context.al = context.es.byte(context.bx+6);
- context._cmp(context.al, context.es.byte(context.bx+5));
- if (!context.flags.z())
- goto notspeed;
- context.al = 0;
- context.es.byte(context.bx+6) = context.al;
- context._cmp(context.al, context.al);
-notspeed:
+ _inc(es.byte(bx+6));
+ al = es.byte(bx+6);
+ _cmp(al, es.byte(bx+5));
+ if (!flags.z())
+ return /* (notspeed) */;
+ al = 0;
+ es.byte(bx+6) = al;
+ _cmp(al, al);
return;
forcenext:
- context._cmp(context.al, context.al);
+ _cmp(al, al);
}
-void clearsprites(Context &context) {
- STACK_CHECK(context);
- context.es = context.data.word(kBuffers);
- context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768);
- context.al = 255;
- context.cx = (32)*16;
- context._stosb(context.cx);
+void DreamGenContext::clearsprites() {
+ STACK_CHECK;
+ es = data.word(kBuffers);
+ di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768);
+ al = 255;
+ cx = (32)*16;
+ _stosb(cx, true);
}
-void makesprite(Context &context) {
- STACK_CHECK(context);
- context.es = context.data.word(kBuffers);
- context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768);
+void DreamGenContext::makesprite() {
+ STACK_CHECK;
+ es = data.word(kBuffers);
+ bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768);
_tmp17:
- context._cmp(context.es.byte(context.bx+15), 255);
- if (context.flags.z())
+ _cmp(es.byte(bx+15), 255);
+ if (flags.z())
goto _tmp17a;
- context._add(context.bx, (32));
+ _add(bx, (32));
goto _tmp17;
_tmp17a:
- context.es.word(context.bx) = context.cx;
- context.es.word(context.bx+10) = context.si;
- context.es.word(context.bx+6) = context.dx;
- context.es.word(context.bx+8) = context.di;
- context.es.word(context.bx+2) = 0x0ffff;
- context.es.byte(context.bx+15) = 0;
- context.es.byte(context.bx+18) = 0;
-}
-
-void delsprite(Context &context) {
- STACK_CHECK(context);
- context.di = context.bx;
- context.cx = (32);
- context.al = 255;
- context._stosb(context.cx);
-}
-
-void spriteupdate(Context &context) {
- STACK_CHECK(context);
- context.es = context.data.word(kBuffers);
- context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768);
- context.al = context.data.byte(kRyanon);
- context.es.byte(context.bx+31) = context.al;
- context.es = context.data.word(kBuffers);
- context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768);
- context.cx = 16;
+ es.word(bx) = cx;
+ es.word(bx+10) = si;
+ es.word(bx+6) = dx;
+ es.word(bx+8) = di;
+ es.word(bx+2) = 0x0ffff;
+ es.byte(bx+15) = 0;
+ es.byte(bx+18) = 0;
+}
+
+void DreamGenContext::delsprite() {
+ STACK_CHECK;
+ di = bx;
+ cx = (32);
+ al = 255;
+ _stosb(cx, true);
+}
+
+void DreamGenContext::spriteupdate() {
+ STACK_CHECK;
+ es = data.word(kBuffers);
+ bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768);
+ al = data.byte(kRyanon);
+ es.byte(bx+31) = al;
+ es = data.word(kBuffers);
+ bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768);
+ cx = 16;
_tmp18:
- context.push(context.cx);
- context.push(context.bx);
- context.ax = context.es.word(context.bx);
- context._cmp(context.ax, 0x0ffff);
- if (context.flags.z())
+ push(cx);
+ push(bx);
+ ax = es.word(bx);
+ _cmp(ax, 0x0ffff);
+ if (flags.z())
goto _tmp18a;
- context.push(context.es);
- context.push(context.ds);
- context.cx = context.es.word(context.bx+2);
- context.es.word(context.bx+24) = context.cx;
- __dispatch_call(context, context.ax);
- context.ds = context.pop();
- context.es = context.pop();
+ push(es);
+ push(ds);
+ cx = es.word(bx+2);
+ es.word(bx+24) = cx;
+ __dispatch_call(ax);
+ ds = pop();
+ es = pop();
_tmp18a:
- context.bx = context.pop();
- context.cx = context.pop();
- context._cmp(context.data.byte(kNowinnewroom), 1);
- if (context.flags.z())
- goto _tmp18b;
- context._add(context.bx, (32));
- if (--context.cx)
+ bx = pop();
+ cx = pop();
+ _cmp(data.byte(kNowinnewroom), 1);
+ if (flags.z())
+ return /* ($18b) */;
+ _add(bx, (32));
+ if (--cx)
goto _tmp18;
-_tmp18b:
- return;
}
-void printsprites(Context &context) {
- STACK_CHECK(context);
- context.es = context.data.word(kBuffers);
- context.cx = 0;
+void DreamGenContext::printsprites() {
+ STACK_CHECK;
+ es = data.word(kBuffers);
+ cx = 0;
priorityloop:
- context.push(context.cx);
- context.data.byte(kPriority) = context.cl;
- context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768);
- context.cx = 16;
+ push(cx);
+ data.byte(kPriority) = cl;
+ bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768);
+ cx = 16;
prtspriteloop:
- context.push(context.cx);
- context.push(context.bx);
- context.ax = context.es.word(context.bx);
- context._cmp(context.ax, 0x0ffff);
- if (context.flags.z())
+ push(cx);
+ push(bx);
+ ax = es.word(bx);
+ _cmp(ax, 0x0ffff);
+ if (flags.z())
goto skipsprite;
- context.al = context.data.byte(kPriority);
- context._cmp(context.al, context.es.byte(context.bx+23));
- if (!context.flags.z())
+ al = data.byte(kPriority);
+ _cmp(al, es.byte(bx+23));
+ if (!flags.z())
goto skipsprite;
- context._cmp(context.es.byte(context.bx+31), 1);
- if (context.flags.z())
+ _cmp(es.byte(bx+31), 1);
+ if (flags.z())
goto skipsprite;
- printasprite(context);
+ printasprite();
skipsprite:
- context.bx = context.pop();
- context.cx = context.pop();
- context._add(context.bx, (32));
- if (--context.cx)
+ bx = pop();
+ cx = pop();
+ _add(bx, (32));
+ if (--cx)
goto prtspriteloop;
- context.cx = context.pop();
- context._inc(context.cx);
- context._cmp(context.cx, 7);
- if (!context.flags.z())
+ cx = pop();
+ _inc(cx);
+ _cmp(cx, 7);
+ if (!flags.z())
goto priorityloop;
}
-void printasprite(Context &context) {
- STACK_CHECK(context);
- context.push(context.es);
- context.push(context.bx);
- context.si = context.bx;
- context.ds = context.es.word(context.si+6);
- context.al = context.es.byte(context.si+11);
- context.ah = 0;
- context._cmp(context.al, 220);
- if (context.flags.c())
+void DreamGenContext::printasprite() {
+ STACK_CHECK;
+ push(es);
+ push(bx);
+ si = bx;
+ ds = es.word(si+6);
+ al = es.byte(si+11);
+ ah = 0;
+ _cmp(al, 220);
+ if (flags.c())
goto notnegative1;
- context.ah = 255;
+ ah = 255;
notnegative1:
- context.bx = context.ax;
- context._add(context.bx, context.data.word(kMapady));
- context.al = context.es.byte(context.si+10);
- context.ah = 0;
- context._cmp(context.al, 220);
- if (context.flags.c())
+ bx = ax;
+ _add(bx, data.word(kMapady));
+ al = es.byte(si+10);
+ ah = 0;
+ _cmp(al, 220);
+ if (flags.c())
goto notnegative2;
- context.ah = 255;
+ ah = 255;
notnegative2:
- context.di = context.ax;
- context._add(context.di, context.data.word(kMapadx));
- context.al = context.es.byte(context.si+15);
- context.ah = 0;
- context._cmp(context.es.byte(context.si+30), 0);
- if (context.flags.z())
+ di = ax;
+ _add(di, data.word(kMapadx));
+ al = es.byte(si+15);
+ ah = 0;
+ _cmp(es.byte(si+30), 0);
+ if (flags.z())
goto steadyframe;
- context.ah = 8;
+ ah = 8;
steadyframe:
- context._cmp(context.data.byte(kPriority), 6);
- if (!context.flags.z())
+ _cmp(data.byte(kPriority), 6);
+ if (!flags.z())
goto notquickp;
notquickp:
- showframe(context);
- context.bx = context.pop();
- context.es = context.pop();
-}
-
-void checkone(Context &context) {
- STACK_CHECK(context);
- context.push(context.cx);
- context.al = context.ch;
- context.ah = 0;
- context.cl = 4;
- context._shr(context.ax, context.cl);
- context.dl = context.al;
- context.cx = context.pop();
- context.al = context.cl;
- context.ah = 0;
- context.cl = 4;
- context._shr(context.ax, context.cl);
- context.ah = context.dl;
- context.push(context.ax);
- context.ch = 0;
- context.cl = context.al;
- context.push(context.cx);
- context.al = context.ah;
- context.ah = 0;
- context.cx = 11;
- context._mul(context.cx);
- context.cx = context.pop();
- context._add(context.ax, context.cx);
- context.cx = 3;
- context._mul(context.cx);
- context.si = context.ax;
- context.ds = context.data.word(kBuffers);
- context._add(context.si, (0+(180*10)+32+60+(32*32)));
- context._lodsw();
- context.cx = context.ax;
- context._lodsb();
- context.dx = context.pop();
-}
-
-void findsource(Context &context) {
- STACK_CHECK(context);
- context.ax = context.data.word(kCurrentframe);
- context._cmp(context.ax, 160);
- if (!context.flags.c())
+ showframe();
+ bx = pop();
+ es = pop();
+}
+
+void DreamGenContext::checkone() {
+ STACK_CHECK;
+ push(cx);
+ al = ch;
+ ah = 0;
+ cl = 4;
+ _shr(ax, cl);
+ dl = al;
+ cx = pop();
+ al = cl;
+ ah = 0;
+ cl = 4;
+ _shr(ax, cl);
+ ah = dl;
+ push(ax);
+ ch = 0;
+ cl = al;
+ push(cx);
+ al = ah;
+ ah = 0;
+ cx = 11;
+ _mul(cx);
+ cx = pop();
+ _add(ax, cx);
+ cx = 3;
+ _mul(cx);
+ si = ax;
+ ds = data.word(kBuffers);
+ _add(si, (0+(180*10)+32+60+(32*32)));
+ _lodsw();
+ cx = ax;
+ _lodsb();
+ dx = pop();
+}
+
+void DreamGenContext::findsource() {
+ STACK_CHECK;
+ ax = data.word(kCurrentframe);
+ _cmp(ax, 160);
+ if (!flags.c())
goto over1000;
- context.ds = context.data.word(kReel1);
- context.data.word(kTakeoff) = 0;
+ ds = data.word(kReel1);
+ data.word(kTakeoff) = 0;
return;
over1000:
- context._cmp(context.ax, 320);
- if (!context.flags.c())
+ _cmp(ax, 320);
+ if (!flags.c())
goto over1001;
- context.ds = context.data.word(kReel2);
- context.data.word(kTakeoff) = 160;
+ ds = data.word(kReel2);
+ data.word(kTakeoff) = 160;
return;
over1001:
- context.ds = context.data.word(kReel3);
- context.data.word(kTakeoff) = 320;
-}
-
-void initman(Context &context) {
- STACK_CHECK(context);
- context.al = context.data.byte(kRyanx);
- context.ah = context.data.byte(kRyany);
- context.si = context.ax;
- context.cx = 49464;
- context.dx = context.data.word(kMainsprites);
- context.di = 0;
- makesprite(context);
- context.es.byte(context.bx+23) = 4;
- context.es.byte(context.bx+22) = 0;
- context.es.byte(context.bx+29) = 0;
-}
-
-void mainman(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kResetmanxy), 1);
- if (!context.flags.z())
+ ds = data.word(kReel3);
+ data.word(kTakeoff) = 320;
+}
+
+void DreamGenContext::initman() {
+ STACK_CHECK;
+ al = data.byte(kRyanx);
+ ah = data.byte(kRyany);
+ si = ax;
+ cx = 49464;
+ dx = data.word(kMainsprites);
+ di = 0;
+ makesprite();
+ es.byte(bx+23) = 4;
+ es.byte(bx+22) = 0;
+ es.byte(bx+29) = 0;
+}
+
+void DreamGenContext::mainman() {
+ STACK_CHECK;
+ _cmp(data.byte(kResetmanxy), 1);
+ if (!flags.z())
goto notinnewroom;
- context.data.byte(kResetmanxy) = 0;
- context.al = context.data.byte(kRyanx);
- context.ah = context.data.byte(kRyany);
- context.es.word(context.bx+10) = context.ax;
- context.es.byte(context.bx+29) = 0;
+ data.byte(kResetmanxy) = 0;
+ al = data.byte(kRyanx);
+ ah = data.byte(kRyany);
+ es.word(bx+10) = ax;
+ es.byte(bx+29) = 0;
goto executewalk;
notinnewroom:
- context._dec(context.es.byte(context.bx+22));
- context._cmp(context.es.byte(context.bx+22), -1);
- if (context.flags.z())
+ _dec(es.byte(bx+22));
+ _cmp(es.byte(bx+22), -1);
+ if (flags.z())
goto executewalk;
return;
executewalk:
- context.es.byte(context.bx+22) = 0;
- context.al = context.data.byte(kTurntoface);
- context._cmp(context.al, context.data.byte(kFacing));
- if (context.flags.z())
+ es.byte(bx+22) = 0;
+ al = data.byte(kTurntoface);
+ _cmp(al, data.byte(kFacing));
+ if (flags.z())
goto facingok;
- aboutturn(context);
+ aboutturn();
goto notwalk;
facingok:
- context._cmp(context.data.byte(kTurndirection), 0);
- if (context.flags.z())
+ _cmp(data.byte(kTurndirection), 0);
+ if (flags.z())
goto alreadyturned;
- context._cmp(context.data.byte(kLinepointer), 254);
- if (!context.flags.z())
+ _cmp(data.byte(kLinepointer), 254);
+ if (!flags.z())
goto alreadyturned;
- context.data.byte(kReasseschanges) = 1;
- context.al = context.data.byte(kFacing);
- context._cmp(context.al, context.data.byte(kLeavedirection));
- if (!context.flags.z())
+ data.byte(kReasseschanges) = 1;
+ al = data.byte(kFacing);
+ _cmp(al, data.byte(kLeavedirection));
+ if (!flags.z())
goto alreadyturned;
- checkforexit(context);
+ checkforexit();
alreadyturned:
- context.data.byte(kTurndirection) = 0;
- context._cmp(context.data.byte(kLinepointer), 254);
- if (!context.flags.z())
+ data.byte(kTurndirection) = 0;
+ _cmp(data.byte(kLinepointer), 254);
+ if (!flags.z())
goto walkman;
- context.es.byte(context.bx+29) = 0;
+ es.byte(bx+29) = 0;
goto notwalk;
walkman:
- context.al = context.es.byte(context.bx+29);
- context._inc(context.al);
- context._cmp(context.al, 11);
- if (!context.flags.z())
+ al = es.byte(bx+29);
+ _inc(al);
+ _cmp(al, 11);
+ if (!flags.z())
goto notanimend1;
- context.al = 1;
+ al = 1;
notanimend1:
- context.es.byte(context.bx+29) = context.al;
- walking(context);
- context._cmp(context.data.byte(kLinepointer), 254);
- if (context.flags.z())
+ es.byte(bx+29) = al;
+ walking();
+ _cmp(data.byte(kLinepointer), 254);
+ if (flags.z())
goto afterwalk;
- context.al = context.data.byte(kFacing);
- context._and(context.al, 1);
- if (context.flags.z())
+ al = data.byte(kFacing);
+ _and(al, 1);
+ if (flags.z())
goto isdouble;
- context.al = context.es.byte(context.bx+29);
- context._cmp(context.al, 2);
- if (context.flags.z())
+ al = es.byte(bx+29);
+ _cmp(al, 2);
+ if (flags.z())
goto afterwalk;
- context._cmp(context.al, 7);
- if (context.flags.z())
+ _cmp(al, 7);
+ if (flags.z())
goto afterwalk;
isdouble:
- walking(context);
+ walking();
afterwalk:
- context._cmp(context.data.byte(kLinepointer), 254);
- if (!context.flags.z())
+ _cmp(data.byte(kLinepointer), 254);
+ if (!flags.z())
goto notwalk;
- context.al = context.data.byte(kTurntoface);
- context._cmp(context.al, context.data.byte(kFacing));
- if (!context.flags.z())
+ al = data.byte(kTurntoface);
+ _cmp(al, data.byte(kFacing));
+ if (!flags.z())
goto notwalk;
- context.data.byte(kReasseschanges) = 1;
- context.al = context.data.byte(kFacing);
- context._cmp(context.al, context.data.byte(kLeavedirection));
- if (!context.flags.z())
+ data.byte(kReasseschanges) = 1;
+ al = data.byte(kFacing);
+ _cmp(al, data.byte(kLeavedirection));
+ if (!flags.z())
goto notwalk;
- checkforexit(context);
+ checkforexit();
notwalk:
- context.al = context.data.byte(kFacing);
- context.ah = 0;
- context.di = 1105;
- context._add(context.di, context.ax);
- context.al = context.cs.byte(context.di);
- context._add(context.al, context.es.byte(context.bx+29));
- context.es.byte(context.bx+15) = context.al;
- context.ax = context.es.word(context.bx+10);
- context.data.byte(kRyanx) = context.al;
- context.data.byte(kRyany) = context.ah;
-}
-
-void aboutturn(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kTurndirection), 1);
- if (context.flags.z())
+ al = data.byte(kFacing);
+ ah = 0;
+ di = 1105;
+ _add(di, ax);
+ al = cs.byte(di);
+ _add(al, es.byte(bx+29));
+ es.byte(bx+15) = al;
+ ax = es.word(bx+10);
+ data.byte(kRyanx) = al;
+ data.byte(kRyany) = ah;
+}
+
+void DreamGenContext::aboutturn() {
+ STACK_CHECK;
+ _cmp(data.byte(kTurndirection), 1);
+ if (flags.z())
goto incdir;
- context._cmp(context.data.byte(kTurndirection), -1);
- if (context.flags.z())
+ _cmp(data.byte(kTurndirection), -1);
+ if (flags.z())
goto decdir;
- context.al = context.data.byte(kFacing);
- context._sub(context.al, context.data.byte(kTurntoface));
- if (!context.flags.c())
+ al = data.byte(kFacing);
+ _sub(al, data.byte(kTurntoface));
+ if (!flags.c())
goto higher;
- context._neg(context.al);
- context._cmp(context.al, 4);
- if (!context.flags.c())
+ _neg(al);
+ _cmp(al, 4);
+ if (!flags.c())
goto decdir;
goto incdir;
higher:
- context._cmp(context.al, 4);
- if (!context.flags.c())
+ _cmp(al, 4);
+ if (!flags.c())
goto incdir;
goto decdir;
incdir:
- context.data.byte(kTurndirection) = 1;
- context.al = context.data.byte(kFacing);
- context._inc(context.al);
- context._and(context.al, 7);
- context.data.byte(kFacing) = context.al;
- context.es.byte(context.bx+29) = 0;
+ data.byte(kTurndirection) = 1;
+ al = data.byte(kFacing);
+ _inc(al);
+ _and(al, 7);
+ data.byte(kFacing) = al;
+ es.byte(bx+29) = 0;
return;
decdir:
- context.data.byte(kTurndirection) = -1;
- context.al = context.data.byte(kFacing);
- context._dec(context.al);
- context._and(context.al, 7);
- context.data.byte(kFacing) = context.al;
- context.es.byte(context.bx+29) = 0;
-}
-
-void walking(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kLinedirection), 0);
- if (context.flags.z())
+ data.byte(kTurndirection) = -1;
+ al = data.byte(kFacing);
+ _dec(al);
+ _and(al, 7);
+ data.byte(kFacing) = al;
+ es.byte(bx+29) = 0;
+}
+
+void DreamGenContext::walking() {
+ STACK_CHECK;
+ _cmp(data.byte(kLinedirection), 0);
+ if (flags.z())
goto normalwalk;
- context.al = context.data.byte(kLinepointer);
- context._dec(context.al);
- context.data.byte(kLinepointer) = context.al;
- context._cmp(context.al, 200);
- if (!context.flags.c())
+ al = data.byte(kLinepointer);
+ _dec(al);
+ data.byte(kLinepointer) = al;
+ _cmp(al, 200);
+ if (!flags.c())
goto endofline;
goto continuewalk;
normalwalk:
- context.al = context.data.byte(kLinepointer);
- context._inc(context.al);
- context.data.byte(kLinepointer) = context.al;
- context._cmp(context.al, context.data.byte(kLinelength));
- if (!context.flags.c())
+ al = data.byte(kLinepointer);
+ _inc(al);
+ data.byte(kLinepointer) = al;
+ _cmp(al, data.byte(kLinelength));
+ if (!flags.c())
goto endofline;
continuewalk:
- context.ah = 0;
- context._add(context.ax, context.ax);
- context.push(context.es);
- context.push(context.bx);
- context.dx = context.data;
- context.es = context.dx;
- context.bx = 8173;
- context._add(context.bx, context.ax);
- context.ax = context.es.word(context.bx);
- context.bx = context.pop();
- context.es = context.pop();
- context.es.word(context.bx+10) = context.ax;
+ ah = 0;
+ _add(ax, ax);
+ push(es);
+ push(bx);
+ dx = data;
+ es = dx;
+ bx = 8173;
+ _add(bx, ax);
+ ax = es.word(bx);
+ bx = pop();
+ es = pop();
+ es.word(bx+10) = ax;
return;
endofline:
- context.data.byte(kLinepointer) = 254;
- context.al = context.data.byte(kDestination);
- context.data.byte(kManspath) = context.al;
- context._cmp(context.al, context.data.byte(kFinaldest));
- if (context.flags.z())
+ data.byte(kLinepointer) = 254;
+ al = data.byte(kDestination);
+ data.byte(kManspath) = al;
+ _cmp(al, data.byte(kFinaldest));
+ if (flags.z())
goto finishedwalk;
- context.al = context.data.byte(kFinaldest);
- context.data.byte(kDestination) = context.al;
- context.push(context.es);
- context.push(context.bx);
- autosetwalk(context);
- context.bx = context.pop();
- context.es = context.pop();
+ al = data.byte(kFinaldest);
+ data.byte(kDestination) = al;
+ push(es);
+ push(bx);
+ autosetwalk();
+ bx = pop();
+ es = pop();
return;
finishedwalk:
- facerightway(context);
-}
-
-void facerightway(Context &context) {
- STACK_CHECK(context);
- context.push(context.es);
- context.push(context.bx);
- getroomspaths(context);
- context.al = context.data.byte(kManspath);
- context.ah = 0;
- context._add(context.ax, context.ax);
- context._add(context.ax, context.ax);
- context._add(context.ax, context.ax);
- context._add(context.bx, context.ax);
- context.al = context.es.byte(context.bx+7);
- context.data.byte(kTurntoface) = context.al;
- context.data.byte(kLeavedirection) = context.al;
- context.bx = context.pop();
- context.es = context.pop();
-}
-
-void checkforexit(Context &context) {
- STACK_CHECK(context);
- context.cl = context.data.byte(kRyanx);
- context._add(context.cl, 12);
- context.ch = context.data.byte(kRyany);
- context._add(context.ch, 12);
- checkone(context);
- context.data.byte(kLastflag) = context.cl;
- context.data.byte(kLastflagex) = context.ch;
- context.data.byte(kFlagx) = context.dl;
- context.data.byte(kFlagy) = context.dh;
- context.al = context.data.byte(kLastflag);
- context._test(context.al, 64);
- if (context.flags.z())
+ facerightway();
+}
+
+void DreamGenContext::facerightway() {
+ STACK_CHECK;
+ push(es);
+ push(bx);
+ getroomspaths();
+ al = data.byte(kManspath);
+ ah = 0;
+ _add(ax, ax);
+ _add(ax, ax);
+ _add(ax, ax);
+ _add(bx, ax);
+ al = es.byte(bx+7);
+ data.byte(kTurntoface) = al;
+ data.byte(kLeavedirection) = al;
+ bx = pop();
+ es = pop();
+}
+
+void DreamGenContext::checkforexit() {
+ STACK_CHECK;
+ cl = data.byte(kRyanx);
+ _add(cl, 12);
+ ch = data.byte(kRyany);
+ _add(ch, 12);
+ checkone();
+ data.byte(kLastflag) = cl;
+ data.byte(kLastflagex) = ch;
+ data.byte(kFlagx) = dl;
+ data.byte(kFlagy) = dh;
+ al = data.byte(kLastflag);
+ _test(al, 64);
+ if (flags.z())
goto notnewdirect;
- context.al = context.data.byte(kLastflagex);
- context.data.byte(kAutolocation) = context.al;
+ al = data.byte(kLastflagex);
+ data.byte(kAutolocation) = al;
return;
notnewdirect:
- context._test(context.al, 32);
- if (context.flags.z())
+ _test(al, 32);
+ if (flags.z())
goto notleave;
- context.push(context.es);
- context.push(context.bx);
- context._cmp(context.data.byte(kReallocation), 2);
- if (!context.flags.z())
+ push(es);
+ push(bx);
+ _cmp(data.byte(kReallocation), 2);
+ if (!flags.z())
goto notlouis;
- context.bl = 0;
- context.push(context.bx);
- context.al = 'W';
- context.ah = 'E';
- context.cl = 'T';
- context.ch = 'A';
- isryanholding(context);
- context.bx = context.pop();
- if (context.flags.z())
+ bl = 0;
+ push(bx);
+ al = 'W';
+ ah = 'E';
+ cl = 'T';
+ ch = 'A';
+ isryanholding();
+ bx = pop();
+ if (flags.z())
goto noshoe1;
- context._inc(context.bl);
+ _inc(bl);
noshoe1:
- context.push(context.bx);
- context.al = 'W';
- context.ah = 'E';
- context.cl = 'T';
- context.ch = 'B';
- isryanholding(context);
- context.bx = context.pop();
- if (context.flags.z())
+ push(bx);
+ al = 'W';
+ ah = 'E';
+ cl = 'T';
+ ch = 'B';
+ isryanholding();
+ bx = pop();
+ if (flags.z())
goto noshoe2;
- context._inc(context.bl);
+ _inc(bl);
noshoe2:
- context._cmp(context.bl, 2);
- if (context.flags.z())
+ _cmp(bl, 2);
+ if (flags.z())
goto notlouis;
- context.al = 42;
- context._cmp(context.bl, 0);
- if (context.flags.z())
+ al = 42;
+ _cmp(bl, 0);
+ if (flags.z())
goto notravmessage;
- context._inc(context.al);
+ _inc(al);
notravmessage:
- context.cx = 80;
- context.dx = 10;
- context.bl = 68;
- context.bh = 64;
- setuptimeduse(context);
- context.al = context.data.byte(kFacing);
- context._add(context.al, 4);
- context._and(context.al, 7);
- context.data.byte(kTurntoface) = context.al;
- context.bx = context.pop();
- context.es = context.pop();
+ cx = 80;
+ dx = 10;
+ bl = 68;
+ bh = 64;
+ setuptimeduse();
+ al = data.byte(kFacing);
+ _add(al, 4);
+ _and(al, 7);
+ data.byte(kTurntoface) = al;
+ bx = pop();
+ es = pop();
return;
notlouis:
- context.bx = context.pop();
- context.es = context.pop();
- context.data.byte(kNeedtotravel) = 1;
+ bx = pop();
+ es = pop();
+ data.byte(kNeedtotravel) = 1;
return;
notleave:
- context._test(context.al, 4);
- if (context.flags.z())
+ _test(al, 4);
+ if (flags.z())
goto notaleft;
- adjustleft(context);
+ adjustleft();
return;
notaleft:
- context._test(context.al, 2);
- if (context.flags.z())
+ _test(al, 2);
+ if (flags.z())
goto notaright;
- adjustright(context);
+ adjustright();
return;
notaright:
- context._test(context.al, 8);
- if (context.flags.z())
+ _test(al, 8);
+ if (flags.z())
goto notadown;
- adjustdown(context);
+ adjustdown();
return;
notadown:
- context._test(context.al, 16);
- if (context.flags.z())
- goto notanup;
- adjustup(context);
- return;
-notanup:
- return;
-}
-
-void adjustdown(Context &context) {
- STACK_CHECK(context);
- context.push(context.es);
- context.push(context.bx);
- context._add(context.data.byte(kMapy), 10);
- context.al = context.data.byte(kLastflagex);
- context.cl = 16;
- context._mul(context.cl);
- context.es.byte(context.bx+11) = context.al;
- context.data.byte(kNowinnewroom) = 1;
- context.bx = context.pop();
- context.es = context.pop();
-}
-
-void adjustup(Context &context) {
- STACK_CHECK(context);
- context.push(context.es);
- context.push(context.bx);
- context._sub(context.data.byte(kMapy), 10);
- context.al = context.data.byte(kLastflagex);
- context.cl = 16;
- context._mul(context.cl);
- context.es.byte(context.bx+11) = context.al;
- context.data.byte(kNowinnewroom) = 1;
- context.bx = context.pop();
- context.es = context.pop();
-}
-
-void adjustleft(Context &context) {
- STACK_CHECK(context);
- context.push(context.es);
- context.push(context.bx);
- context.data.byte(kLastflag) = 0;
- context._sub(context.data.byte(kMapx), 11);
- context.al = context.data.byte(kLastflagex);
- context.cl = 16;
- context._mul(context.cl);
- context.es.byte(context.bx+10) = context.al;
- context.data.byte(kNowinnewroom) = 1;
- context.bx = context.pop();
- context.es = context.pop();
-}
-
-void adjustright(Context &context) {
- STACK_CHECK(context);
- context.push(context.es);
- context.push(context.bx);
- context._add(context.data.byte(kMapx), 11);
- context.al = context.data.byte(kLastflagex);
- context.cl = 16;
- context._mul(context.cl);
- context._sub(context.al, 2);
- context.es.byte(context.bx+10) = context.al;
- context.data.byte(kNowinnewroom) = 1;
- context.bx = context.pop();
- context.es = context.pop();
-}
-
-void reminders(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kReallocation), 24);
- if (!context.flags.z())
- goto notinedenslift;
- context._cmp(context.data.byte(kMapx), 44);
- if (!context.flags.z())
- goto notinedenslift;
- context._cmp(context.data.byte(kProgresspoints), 0);
- if (!context.flags.z())
- goto notfirst;
- context.al = 'D';
- context.ah = 'K';
- context.cl = 'E';
- context.ch = 'Y';
- isryanholding(context);
- if (context.flags.z())
+ _test(al, 16);
+ if (flags.z())
+ return /* (notanup) */;
+ adjustup();
+}
+
+void DreamGenContext::adjustdown() {
+ STACK_CHECK;
+ push(es);
+ push(bx);
+ _add(data.byte(kMapy), 10);
+ al = data.byte(kLastflagex);
+ cl = 16;
+ _mul(cl);
+ es.byte(bx+11) = al;
+ data.byte(kNowinnewroom) = 1;
+ bx = pop();
+ es = pop();
+}
+
+void DreamGenContext::adjustup() {
+ STACK_CHECK;
+ push(es);
+ push(bx);
+ _sub(data.byte(kMapy), 10);
+ al = data.byte(kLastflagex);
+ cl = 16;
+ _mul(cl);
+ es.byte(bx+11) = al;
+ data.byte(kNowinnewroom) = 1;
+ bx = pop();
+ es = pop();
+}
+
+void DreamGenContext::adjustleft() {
+ STACK_CHECK;
+ push(es);
+ push(bx);
+ data.byte(kLastflag) = 0;
+ _sub(data.byte(kMapx), 11);
+ al = data.byte(kLastflagex);
+ cl = 16;
+ _mul(cl);
+ es.byte(bx+10) = al;
+ data.byte(kNowinnewroom) = 1;
+ bx = pop();
+ es = pop();
+}
+
+void DreamGenContext::adjustright() {
+ STACK_CHECK;
+ push(es);
+ push(bx);
+ _add(data.byte(kMapx), 11);
+ al = data.byte(kLastflagex);
+ cl = 16;
+ _mul(cl);
+ _sub(al, 2);
+ es.byte(bx+10) = al;
+ data.byte(kNowinnewroom) = 1;
+ bx = pop();
+ es = pop();
+}
+
+void DreamGenContext::reminders() {
+ STACK_CHECK;
+ _cmp(data.byte(kReallocation), 24);
+ if (!flags.z())
+ return /* (notinedenslift) */;
+ _cmp(data.byte(kMapx), 44);
+ if (!flags.z())
+ return /* (notinedenslift) */;
+ _cmp(data.byte(kProgresspoints), 0);
+ if (!flags.z())
+ return /* (notfirst) */;
+ al = 'D';
+ ah = 'K';
+ cl = 'E';
+ ch = 'Y';
+ isryanholding();
+ if (flags.z())
goto forgotone;
- context.al = 'C';
- context.ah = 'S';
- context.cl = 'H';
- context.ch = 'R';
- findexobject(context);
- context._cmp(context.al, (114));
- if (context.flags.z())
+ al = 'C';
+ ah = 'S';
+ cl = 'H';
+ ch = 'R';
+ findexobject();
+ _cmp(al, (114));
+ if (flags.z())
goto forgotone;
- context.ax = context.es.word(context.bx+2);
- context._cmp(context.al, 4);
- if (!context.flags.z())
+ ax = es.word(bx+2);
+ _cmp(al, 4);
+ if (!flags.z())
goto forgotone;
- context._cmp(context.ah, 255);
- if (context.flags.z())
+ _cmp(ah, 255);
+ if (flags.z())
goto havegotcard;
- context.cl = 'P';
- context.ch = 'U';
- context.dl = 'R';
- context.dh = 'S';
- context._xchg(context.al, context.ah);
- compare(context);
- if (!context.flags.z())
+ cl = 'P';
+ ch = 'U';
+ dl = 'R';
+ dh = 'S';
+ _xchg(al, ah);
+ compare();
+ if (!flags.z())
goto forgotone;
havegotcard:
- context._inc(context.data.byte(kProgresspoints));
-notfirst:
+ _inc(data.byte(kProgresspoints));
return;
forgotone:
- context.al = 50;
- context.bl = 54;
- context.bh = 70;
- context.cx = 48;
- context.dx = 8;
- setuptimeduse(context);
- return;
-notinedenslift:
- return;
-}
-
-void initrain(Context &context) {
- STACK_CHECK(context);
- context.es = context.data.word(kBuffers);
- context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4)+(256*24));
- context.bx = 1113;
+ al = 50;
+ bl = 54;
+ bh = 70;
+ cx = 48;
+ dx = 8;
+ setuptimeduse();
+}
+
+void DreamGenContext::initrain() {
+ STACK_CHECK;
+ es = data.word(kBuffers);
+ di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4)+(256*24));
+ bx = 1113;
checkmorerain:
- context.al = context.cs.byte(context.bx);
- context._cmp(context.al, 255);
- if (context.flags.z())
+ al = cs.byte(bx);
+ _cmp(al, 255);
+ if (flags.z())
goto finishinitrain;
- context._cmp(context.al, context.data.byte(kReallocation));
- if (!context.flags.z())
+ _cmp(al, data.byte(kReallocation));
+ if (!flags.z())
goto checkrain;
- context.al = context.cs.byte(context.bx+1);
- context._cmp(context.al, context.data.byte(kMapx));
- if (!context.flags.z())
+ al = cs.byte(bx+1);
+ _cmp(al, data.byte(kMapx));
+ if (!flags.z())
goto checkrain;
- context.al = context.cs.byte(context.bx+2);
- context._cmp(context.al, context.data.byte(kMapy));
- if (!context.flags.z())
+ al = cs.byte(bx+2);
+ _cmp(al, data.byte(kMapy));
+ if (!flags.z())
goto checkrain;
- context.al = context.cs.byte(context.bx+3);
- context.data.byte(kRainspace) = context.al;
+ al = cs.byte(bx+3);
+ data.byte(kRainspace) = al;
goto dorain;
checkrain:
- context._add(context.bx, 4);
+ _add(bx, 4);
goto checkmorerain;
dorain:
- context.cx = 4;
+ cx = 4;
initraintop:
- randomnumber(context);
- context._and(context.al, 31);
- context._add(context.al, 3);
- context._cmp(context.al, context.data.byte(kRainspace));
- if (!context.flags.c())
+ randomnumber();
+ _and(al, 31);
+ _add(al, 3);
+ _cmp(al, data.byte(kRainspace));
+ if (!flags.c())
goto initraintop;
- context._add(context.cl, context.al);
- context._cmp(context.cl, context.data.byte(kMapxsize));
- if (!context.flags.c())
+ _add(cl, al);
+ _cmp(cl, data.byte(kMapxsize));
+ if (!flags.c())
goto initrainside;
- context.push(context.cx);
- splitintolines(context);
- context.cx = context.pop();
+ push(cx);
+ splitintolines();
+ cx = pop();
goto initraintop;
initrainside:
- context.cl = context.data.byte(kMapxsize);
- context._dec(context.cl);
+ cl = data.byte(kMapxsize);
+ _dec(cl);
initrainside2:
- randomnumber(context);
- context._and(context.al, 31);
- context._add(context.al, 3);
- context._cmp(context.al, context.data.byte(kRainspace));
- if (!context.flags.c())
+ randomnumber();
+ _and(al, 31);
+ _add(al, 3);
+ _cmp(al, data.byte(kRainspace));
+ if (!flags.c())
goto initrainside2;
- context._add(context.ch, context.al);
- context._cmp(context.ch, context.data.byte(kMapysize));
- if (!context.flags.c())
+ _add(ch, al);
+ _cmp(ch, data.byte(kMapysize));
+ if (!flags.c())
goto finishinitrain;
- context.push(context.cx);
- splitintolines(context);
- context.cx = context.pop();
+ push(cx);
+ splitintolines();
+ cx = pop();
goto initrainside2;
finishinitrain:
- context.al = 255;
- context._stosb();
+ al = 255;
+ _stosb();
}
-void splitintolines(Context &context) {
- STACK_CHECK(context);
+void DreamGenContext::splitintolines() {
+ STACK_CHECK;
lookforlinestart:
- getblockofpixel(context);
- context._cmp(context.al, 0);
- if (!context.flags.z())
+ getblockofpixel();
+ _cmp(al, 0);
+ if (!flags.z())
goto foundlinestart;
- context._dec(context.cl);
- context._inc(context.ch);
- context._cmp(context.cl, 0);
- if (context.flags.z())
- goto endofthisline;
- context._cmp(context.ch, context.data.byte(kMapysize));
- if (!context.flags.c())
- goto endofthisline;
+ _dec(cl);
+ _inc(ch);
+ _cmp(cl, 0);
+ if (flags.z())
+ return /* (endofthisline) */;
+ _cmp(ch, data.byte(kMapysize));
+ if (!flags.c())
+ return /* (endofthisline) */;
goto lookforlinestart;
foundlinestart:
- context.es.word(context.di) = context.cx;
- context.bh = 1;
+ es.word(di) = cx;
+ bh = 1;
lookforlineend:
- getblockofpixel(context);
- context._cmp(context.al, 0);
- if (context.flags.z())
+ getblockofpixel();
+ _cmp(al, 0);
+ if (flags.z())
goto foundlineend;
- context._dec(context.cl);
- context._inc(context.ch);
- context._cmp(context.cl, 0);
- if (context.flags.z())
+ _dec(cl);
+ _inc(ch);
+ _cmp(cl, 0);
+ if (flags.z())
goto foundlineend;
- context._cmp(context.ch, context.data.byte(kMapysize));
- if (!context.flags.c())
+ _cmp(ch, data.byte(kMapysize));
+ if (!flags.c())
goto foundlineend;
- context._inc(context.bh);
+ _inc(bh);
goto lookforlineend;
foundlineend:
- context.push(context.cx);
- context.es.byte(context.di+2) = context.bh;
- randomnumber(context);
- context.es.byte(context.di+3) = context.al;
- randomnumber(context);
- context.es.byte(context.di+4) = context.al;
- randomnumber(context);
- context._and(context.al, 3);
- context._add(context.al, 4);
- context.es.byte(context.di+5) = context.al;
- context._add(context.di, 6);
- context.cx = context.pop();
- context._cmp(context.cl, 0);
- if (context.flags.z())
- goto endofthisline;
- context._cmp(context.ch, context.data.byte(kMapysize));
- if (!context.flags.c())
- goto endofthisline;
+ push(cx);
+ es.byte(di+2) = bh;
+ randomnumber();
+ es.byte(di+3) = al;
+ randomnumber();
+ es.byte(di+4) = al;
+ randomnumber();
+ _and(al, 3);
+ _add(al, 4);
+ es.byte(di+5) = al;
+ _add(di, 6);
+ cx = pop();
+ _cmp(cl, 0);
+ if (flags.z())
+ return /* (endofthisline) */;
+ _cmp(ch, data.byte(kMapysize));
+ if (!flags.c())
+ return /* (endofthisline) */;
goto lookforlinestart;
-endofthisline:
- return;
-}
-
-void getblockofpixel(Context &context) {
- STACK_CHECK(context);
- context.push(context.cx);
- context.push(context.es);
- context.push(context.di);
- context.ax = context.data.word(kMapxstart);
- context._add(context.cl, context.al);
- context.ax = context.data.word(kMapystart);
- context._add(context.ch, context.al);
- checkone(context);
- context._and(context.cl, 1);
- if (!context.flags.z())
+}
+
+void DreamGenContext::getblockofpixel() {
+ STACK_CHECK;
+ push(cx);
+ push(es);
+ push(di);
+ ax = data.word(kMapxstart);
+ _add(cl, al);
+ ax = data.word(kMapystart);
+ _add(ch, al);
+ checkone();
+ _and(cl, 1);
+ if (!flags.z())
goto failrain;
- context.di = context.pop();
- context.es = context.pop();
- context.cx = context.pop();
+ di = pop();
+ es = pop();
+ cx = pop();
return;
failrain:
- context.di = context.pop();
- context.es = context.pop();
- context.cx = context.pop();
- context.al = 0;
-}
-
-void showrain(Context &context) {
- STACK_CHECK(context);
- context.ds = context.data.word(kMainsprites);
- context.si = 6*58;
- context.ax = context.ds.word(context.si+2);
- context.si = context.ax;
- context._add(context.si, 2080);
- context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4)+(256*24));
- context.es = context.data.word(kBuffers);
- context._cmp(context.es.byte(context.bx), 255);
- if (context.flags.z())
- goto nothunder;
+ di = pop();
+ es = pop();
+ cx = pop();
+ al = 0;
+}
+
+void DreamGenContext::showrain() {
+ STACK_CHECK;
+ ds = data.word(kMainsprites);
+ si = 6*58;
+ ax = ds.word(si+2);
+ si = ax;
+ _add(si, 2080);
+ bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4)+(256*24));
+ es = data.word(kBuffers);
+ _cmp(es.byte(bx), 255);
+ if (flags.z())
+ return /* (nothunder) */;
morerain:
- context.es = context.data.word(kBuffers);
- context._cmp(context.es.byte(context.bx), 255);
- if (context.flags.z())
+ es = data.word(kBuffers);
+ _cmp(es.byte(bx), 255);
+ if (flags.z())
goto finishrain;
- context.al = context.es.byte(context.bx+1);
- context.ah = 0;
- context._add(context.ax, context.data.word(kMapady));
- context._add(context.ax, context.data.word(kMapystart));
- context.cx = 320;
- context._mul(context.cx);
- context.cl = context.es.byte(context.bx);
- context.ch = 0;
- context._add(context.ax, context.cx);
- context._add(context.ax, context.data.word(kMapadx));
- context._add(context.ax, context.data.word(kMapxstart));
- context.di = context.ax;
- context.cl = context.es.byte(context.bx+2);
- context.ch = 0;
- context.ax = context.es.word(context.bx+3);
- context.dl = context.es.byte(context.bx+5);
- context.dh = 0;
- context._sub(context.ax, context.dx);
- context._and(context.ax, 511);
- context.es.word(context.bx+3) = context.ax;
- context._add(context.bx, 6);
- context.push(context.si);
- context._add(context.si, context.ax);
- context.es = context.data.word(kWorkspace);
- context.ah = 0;
- context.dx = 320-2;
+ al = es.byte(bx+1);
+ ah = 0;
+ _add(ax, data.word(kMapady));
+ _add(ax, data.word(kMapystart));
+ cx = 320;
+ _mul(cx);
+ cl = es.byte(bx);
+ ch = 0;
+ _add(ax, cx);
+ _add(ax, data.word(kMapadx));
+ _add(ax, data.word(kMapxstart));
+ di = ax;
+ cl = es.byte(bx+2);
+ ch = 0;
+ ax = es.word(bx+3);
+ dl = es.byte(bx+5);
+ dh = 0;
+ _sub(ax, dx);
+ _and(ax, 511);
+ es.word(bx+3) = ax;
+ _add(bx, 6);
+ push(si);
+ _add(si, ax);
+ es = data.word(kWorkspace);
+ ah = 0;
+ dx = 320-2;
rainloop:
- context._lodsb();
- context._cmp(context.al, context.ah);
- if (context.flags.z())
+ _lodsb();
+ _cmp(al, ah);
+ if (flags.z())
goto noplot;
- context._stosb();
- context._add(context.di, context.dx);
- if (--context.cx)
+ _stosb();
+ _add(di, dx);
+ if (--cx)
goto rainloop;
- context.si = context.pop();
+ si = pop();
goto morerain;
noplot:
- context._add(context.di, 320-1);
- if (--context.cx)
+ _add(di, 320-1);
+ if (--cx)
goto rainloop;
- context.si = context.pop();
+ si = pop();
goto morerain;
finishrain:
- context._cmp(context.data.word(kCh1blockstocopy), 0);
- if (!context.flags.z())
- goto nothunder;
- context._cmp(context.data.byte(kReallocation), 2);
- if (!context.flags.z())
+ _cmp(data.word(kCh1blockstocopy), 0);
+ if (!flags.z())
+ return /* (nothunder) */;
+ _cmp(data.byte(kReallocation), 2);
+ if (!flags.z())
goto notlouisthund;
- context._cmp(context.data.byte(kBeenmugged), 1);
- if (!context.flags.z())
- goto nothunder;
+ _cmp(data.byte(kBeenmugged), 1);
+ if (!flags.z())
+ return /* (nothunder) */;
notlouisthund:
- context._cmp(context.data.byte(kReallocation), 55);
- if (context.flags.z())
- goto nothunder;
- randomnum1(context);
- context._cmp(context.al, 1);
- if (!context.flags.c())
- goto nothunder;
- context.al = 7;
- context._cmp(context.data.byte(kCh0playing), 6);
- if (context.flags.z())
+ _cmp(data.byte(kReallocation), 55);
+ if (flags.z())
+ return /* (nothunder) */;
+ randomnum1();
+ _cmp(al, 1);
+ if (!flags.c())
+ return /* (nothunder) */;
+ al = 7;
+ _cmp(data.byte(kCh0playing), 6);
+ if (flags.z())
goto isthunder1;
- context.al = 4;
+ al = 4;
isthunder1:
- playchannel1(context);
-nothunder:
- return;
+ playchannel1();
}
-void backobject(Context &context) {
- STACK_CHECK(context);
- context.ds = context.data.word(kSetdat);
- context.di = context.es.word(context.bx+20);
- context.al = context.es.byte(context.bx+18);
- context._cmp(context.al, 0);
- if (context.flags.z())
+void DreamGenContext::backobject() {
+ STACK_CHECK;
+ ds = data.word(kSetdat);
+ di = es.word(bx+20);
+ al = es.byte(bx+18);
+ _cmp(al, 0);
+ if (flags.z())
goto _tmp48z;
- context._dec(context.al);
- context.es.byte(context.bx+18) = context.al;
- goto finishback;
+ _dec(al);
+ es.byte(bx+18) = al;
+ return /* (finishback) */;
_tmp48z:
- context.al = context.ds.byte(context.di+7);
- context.es.byte(context.bx+18) = context.al;
- context.al = context.ds.byte(context.di+8);
- context._cmp(context.al, 6);
- if (!context.flags.z())
+ al = ds.byte(di+7);
+ es.byte(bx+18) = al;
+ al = ds.byte(di+8);
+ _cmp(al, 6);
+ if (!flags.z())
goto notwidedoor;
- widedoor(context);
- goto finishback;
+ widedoor();
+ return /* (finishback) */;
notwidedoor:
- context._cmp(context.al, 5);
- if (!context.flags.z())
+ _cmp(al, 5);
+ if (!flags.z())
goto notrandom;
- random(context);
- goto finishback;
+ random();
+ return /* (finishback) */;
notrandom:
- context._cmp(context.al, 4);
- if (!context.flags.z())
+ _cmp(al, 4);
+ if (!flags.z())
goto notlockdoor;
- lockeddoorway(context);
- goto finishback;
+ lockeddoorway();
+ return /* (finishback) */;
notlockdoor:
- context._cmp(context.al, 3);
- if (!context.flags.z())
+ _cmp(al, 3);
+ if (!flags.z())
goto notlift;
- liftsprite(context);
- goto finishback;
+ liftsprite();
+ return /* (finishback) */;
notlift:
- context._cmp(context.al, 2);
- if (!context.flags.z())
+ _cmp(al, 2);
+ if (!flags.z())
goto notdoor;
- doorway(context);
- goto finishback;
+ doorway();
+ return /* (finishback) */;
notdoor:
- context._cmp(context.al, 1);
- if (!context.flags.z())
+ _cmp(al, 1);
+ if (!flags.z())
goto steadyob;
- constant(context);
- goto finishback;
+ constant();
+ return /* (finishback) */;
steadyob:
- steady(context);
-finishback:
- return;
+ steady();
}
-void liftsprite(Context &context) {
- STACK_CHECK(context);
- context.al = context.data.byte(kLiftflag);
- context._cmp(context.al, 0);
- if (context.flags.z())
+void DreamGenContext::liftsprite() {
+ STACK_CHECK;
+ al = data.byte(kLiftflag);
+ _cmp(al, 0);
+ if (flags.z())
goto liftclosed;
- context._cmp(context.al, 1);
- if (context.flags.z())
+ _cmp(al, 1);
+ if (flags.z())
goto liftopen;
- context._cmp(context.al, 3);
- if (context.flags.z())
+ _cmp(al, 3);
+ if (flags.z())
goto openlift;
- context.al = context.es.byte(context.bx+19);
- context._cmp(context.al, 0);
- if (context.flags.z())
+ al = es.byte(bx+19);
+ _cmp(al, 0);
+ if (flags.z())
goto finishclose;
- context._dec(context.al);
- context._cmp(context.al, 11);
- if (!context.flags.z())
+ _dec(al);
+ _cmp(al, 11);
+ if (!flags.z())
goto pokelift;
- context.push(context.ax);
- context.al = 3;
- liftnoise(context);
- context.ax = context.pop();
+ push(ax);
+ al = 3;
+ liftnoise();
+ ax = pop();
goto pokelift;
finishclose:
- context.data.byte(kLiftflag) = 0;
+ data.byte(kLiftflag) = 0;
return;
openlift:
- context.al = context.es.byte(context.bx+19);
- context._cmp(context.al, 12);
- if (context.flags.z())
+ al = es.byte(bx+19);
+ _cmp(al, 12);
+ if (flags.z())
goto endoflist;
- context._inc(context.al);
- context._cmp(context.al, 1);
- if (!context.flags.z())
+ _inc(al);
+ _cmp(al, 1);
+ if (!flags.z())
goto pokelift;
- context.push(context.ax);
- context.al = 2;
- liftnoise(context);
- context.ax = context.pop();
+ push(ax);
+ al = 2;
+ liftnoise();
+ ax = pop();
pokelift:
- context.es.byte(context.bx+19) = context.al;
- context.ah = 0;
- context.push(context.di);
- context._add(context.di, context.ax);
- context.al = context.ds.byte(context.di+18);
- context.di = context.pop();
- context.es.byte(context.bx+15) = context.al;
- context.ds.byte(context.di+17) = context.al;
+ es.byte(bx+19) = al;
+ ah = 0;
+ push(di);
+ _add(di, ax);
+ al = ds.byte(di+18);
+ di = pop();
+ es.byte(bx+15) = al;
+ ds.byte(di+17) = al;
return;
endoflist:
- context.data.byte(kLiftflag) = 1;
+ data.byte(kLiftflag) = 1;
return;
liftopen:
- context.al = context.data.byte(kLiftpath);
- context.push(context.es);
- context.push(context.bx);
- turnpathon(context);
- context.bx = context.pop();
- context.es = context.pop();
- context._cmp(context.data.byte(kCounttoclose), 0);
- if (context.flags.z())
+ al = data.byte(kLiftpath);
+ push(es);
+ push(bx);
+ turnpathon();
+ bx = pop();
+ es = pop();
+ _cmp(data.byte(kCounttoclose), 0);
+ if (flags.z())
goto nocountclose;
- context._dec(context.data.byte(kCounttoclose));
- context._cmp(context.data.byte(kCounttoclose), 0);
- if (!context.flags.z())
+ _dec(data.byte(kCounttoclose));
+ _cmp(data.byte(kCounttoclose), 0);
+ if (!flags.z())
goto nocountclose;
- context.data.byte(kLiftflag) = 2;
+ data.byte(kLiftflag) = 2;
nocountclose:
- context.al = 12;
+ al = 12;
goto pokelift;
liftclosed:
- context.al = context.data.byte(kLiftpath);
- context.push(context.es);
- context.push(context.bx);
- turnpathoff(context);
- context.bx = context.pop();
- context.es = context.pop();
- context._cmp(context.data.byte(kCounttoopen), 0);
- if (context.flags.z())
+ al = data.byte(kLiftpath);
+ push(es);
+ push(bx);
+ turnpathoff();
+ bx = pop();
+ es = pop();
+ _cmp(data.byte(kCounttoopen), 0);
+ if (flags.z())
goto nocountopen;
- context._dec(context.data.byte(kCounttoopen));
- context._cmp(context.data.byte(kCounttoopen), 0);
- if (!context.flags.z())
+ _dec(data.byte(kCounttoopen));
+ _cmp(data.byte(kCounttoopen), 0);
+ if (!flags.z())
goto nocountopen;
- context.data.byte(kLiftflag) = 3;
+ data.byte(kLiftflag) = 3;
nocountopen:
- context.al = 0;
+ al = 0;
goto pokelift;
}
-void liftnoise(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kReallocation), 5);
- if (context.flags.z())
+void DreamGenContext::liftnoise() {
+ STACK_CHECK;
+ _cmp(data.byte(kReallocation), 5);
+ if (flags.z())
goto hissnoise;
- context._cmp(context.data.byte(kReallocation), 21);
- if (context.flags.z())
+ _cmp(data.byte(kReallocation), 21);
+ if (flags.z())
goto hissnoise;
- playchannel1(context);
+ playchannel1();
return;
hissnoise:
- context.al = 13;
- playchannel1(context);
-}
-
-void random(Context &context) {
- STACK_CHECK(context);
- randomnum1(context);
- context.push(context.di);
- context._and(context.ax, 7);
- context._add(context.di, 18);
- context._add(context.di, context.ax);
- context.al = context.ds.byte(context.di);
- context.di = context.pop();
- context.es.byte(context.bx+15) = context.al;
-}
-
-void steady(Context &context) {
- STACK_CHECK(context);
- context.al = context.ds.byte(context.di+18);
- context.ds.byte(context.di+17) = context.al;
- context.es.byte(context.bx+15) = context.al;
-}
-
-void constant(Context &context) {
- STACK_CHECK(context);
- context._inc(context.es.byte(context.bx+19));
- context.cl = context.es.byte(context.bx+19);
- context.ch = 0;
- context._add(context.di, context.cx);
- context._cmp(context.ds.byte(context.di+18), 255);
- if (!context.flags.z())
+ al = 13;
+ playchannel1();
+}
+
+void DreamGenContext::random() {
+ STACK_CHECK;
+ randomnum1();
+ push(di);
+ _and(ax, 7);
+ _add(di, 18);
+ _add(di, ax);
+ al = ds.byte(di);
+ di = pop();
+ es.byte(bx+15) = al;
+}
+
+void DreamGenContext::steady() {
+ STACK_CHECK;
+ al = ds.byte(di+18);
+ ds.byte(di+17) = al;
+ es.byte(bx+15) = al;
+}
+
+void DreamGenContext::constant() {
+ STACK_CHECK;
+ _inc(es.byte(bx+19));
+ cl = es.byte(bx+19);
+ ch = 0;
+ _add(di, cx);
+ _cmp(ds.byte(di+18), 255);
+ if (!flags.z())
goto gotconst;
- context._sub(context.di, context.cx);
- context.cx = 0;
- context.es.byte(context.bx+19) = context.cl;
+ _sub(di, cx);
+ cx = 0;
+ es.byte(bx+19) = cl;
gotconst:
- context.al = context.ds.byte(context.di+18);
- context._sub(context.di, context.cx);
- context.es.byte(context.bx+15) = context.al;
- context.ds.byte(context.di+17) = context.al;
-}
-
-void doorway(Context &context) {
- STACK_CHECK(context);
- context.data.byte(kDoorcheck1) = -24;
- context.data.byte(kDoorcheck2) = 10;
- context.data.byte(kDoorcheck3) = -30;
- context.data.byte(kDoorcheck4) = 10;
- dodoor(context);
-}
-
-void widedoor(Context &context) {
- STACK_CHECK(context);
- context.data.byte(kDoorcheck1) = -24;
- context.data.byte(kDoorcheck2) = 24;
- context.data.byte(kDoorcheck3) = -30;
- context.data.byte(kDoorcheck4) = 24;
- dodoor(context);
-}
-
-void dodoor(Context &context) {
- STACK_CHECK(context);
- context.al = context.data.byte(kRyanx);
- context.ah = context.data.byte(kRyany);
- context.cl = context.es.byte(context.bx+10);
- context.ch = context.es.byte(context.bx+11);
- context._cmp(context.al, context.cl);
- if (!context.flags.c())
+ al = ds.byte(di+18);
+ _sub(di, cx);
+ es.byte(bx+15) = al;
+ ds.byte(di+17) = al;
+}
+
+void DreamGenContext::doorway() {
+ STACK_CHECK;
+ data.byte(kDoorcheck1) = -24;
+ data.byte(kDoorcheck2) = 10;
+ data.byte(kDoorcheck3) = -30;
+ data.byte(kDoorcheck4) = 10;
+ dodoor();
+}
+
+void DreamGenContext::widedoor() {
+ STACK_CHECK;
+ data.byte(kDoorcheck1) = -24;
+ data.byte(kDoorcheck2) = 24;
+ data.byte(kDoorcheck3) = -30;
+ data.byte(kDoorcheck4) = 24;
+ dodoor();
+}
+
+void DreamGenContext::dodoor() {
+ STACK_CHECK;
+ al = data.byte(kRyanx);
+ ah = data.byte(kRyany);
+ cl = es.byte(bx+10);
+ ch = es.byte(bx+11);
+ _cmp(al, cl);
+ if (!flags.c())
goto rtofdoor;
- context._sub(context.al, context.cl);
- context._cmp(context.al, context.data.byte(kDoorcheck1));
- if (!context.flags.c())
+ _sub(al, cl);
+ _cmp(al, data.byte(kDoorcheck1));
+ if (!flags.c())
goto upordown;
goto shutdoor;
rtofdoor:
- context._sub(context.al, context.cl);
- context._cmp(context.al, context.data.byte(kDoorcheck2));
- if (!context.flags.c())
+ _sub(al, cl);
+ _cmp(al, data.byte(kDoorcheck2));
+ if (!flags.c())
goto shutdoor;
upordown:
- context._cmp(context.ah, context.ch);
- if (!context.flags.c())
+ _cmp(ah, ch);
+ if (!flags.c())
goto botofdoor;
- context._sub(context.ah, context.ch);
- context._cmp(context.ah, context.data.byte(kDoorcheck3));
- if (context.flags.c())
+ _sub(ah, ch);
+ _cmp(ah, data.byte(kDoorcheck3));
+ if (flags.c())
goto shutdoor;
goto opendoor;
botofdoor:
- context._sub(context.ah, context.ch);
- context._cmp(context.ah, context.data.byte(kDoorcheck4));
- if (!context.flags.c())
+ _sub(ah, ch);
+ _cmp(ah, data.byte(kDoorcheck4));
+ if (!flags.c())
goto shutdoor;
opendoor:
- context.cl = context.es.byte(context.bx+19);
- context._cmp(context.data.byte(kThroughdoor), 1);
- if (!context.flags.z())
+ cl = es.byte(bx+19);
+ _cmp(data.byte(kThroughdoor), 1);
+ if (!flags.z())
goto notthrough;
- context._cmp(context.cl, 0);
- if (!context.flags.z())
+ _cmp(cl, 0);
+ if (!flags.z())
goto notthrough;
- context.cl = 6;
+ cl = 6;
notthrough:
- context._inc(context.cl);
- context._cmp(context.cl, 1);
- if (!context.flags.z())
+ _inc(cl);
+ _cmp(cl, 1);
+ if (!flags.z())
goto notdoorsound2;
- context.al = 0;
- context._cmp(context.data.byte(kReallocation), 5);
- if (!context.flags.z())
+ al = 0;
+ _cmp(data.byte(kReallocation), 5);
+ if (!flags.z())
goto nothoteldoor2;
- context.al = 13;
+ al = 13;
nothoteldoor2:
- playchannel1(context);
+ playchannel1();
notdoorsound2:
- context.ch = 0;
- context.push(context.di);
- context._add(context.di, context.cx);
- context.al = context.ds.byte(context.di+18);
- context._cmp(context.al, 255);
- if (!context.flags.z())
+ ch = 0;
+ push(di);
+ _add(di, cx);
+ al = ds.byte(di+18);
+ _cmp(al, 255);
+ if (!flags.z())
goto atlast1;
- context._dec(context.di);
- context._dec(context.cl);
+ _dec(di);
+ _dec(cl);
atlast1:
- context.es.byte(context.bx+19) = context.cl;
- context.al = context.ds.byte(context.di+18);
- context.di = context.pop();
- context.es.byte(context.bx+15) = context.al;
- context.ds.byte(context.di+17) = context.al;
- context.data.byte(kThroughdoor) = 1;
+ es.byte(bx+19) = cl;
+ al = ds.byte(di+18);
+ di = pop();
+ es.byte(bx+15) = al;
+ ds.byte(di+17) = al;
+ data.byte(kThroughdoor) = 1;
return;
shutdoor:
- context.cl = context.es.byte(context.bx+19);
- context._cmp(context.cl, 5);
- if (!context.flags.z())
+ cl = es.byte(bx+19);
+ _cmp(cl, 5);
+ if (!flags.z())
goto notdoorsound1;
- context.al = 1;
- context._cmp(context.data.byte(kReallocation), 5);
- if (!context.flags.z())
+ al = 1;
+ _cmp(data.byte(kReallocation), 5);
+ if (!flags.z())
goto nothoteldoor1;
- context.al = 13;
+ al = 13;
nothoteldoor1:
- playchannel1(context);
+ playchannel1();
notdoorsound1:
- context._cmp(context.cl, 0);
- if (context.flags.z())
+ _cmp(cl, 0);
+ if (flags.z())
goto atlast2;
- context._dec(context.cl);
- context.es.byte(context.bx+19) = context.cl;
+ _dec(cl);
+ es.byte(bx+19) = cl;
atlast2:
- context.ch = 0;
- context.push(context.di);
- context._add(context.di, context.cx);
- context.al = context.ds.byte(context.di+18);
- context.di = context.pop();
- context.es.byte(context.bx+15) = context.al;
- context.ds.byte(context.di+17) = context.al;
- context._cmp(context.cl, 5);
- if (!context.flags.z())
- goto notnearly;
- context.data.byte(kThroughdoor) = 0;
-notnearly:
- return;
-}
-
-void lockeddoorway(Context &context) {
- STACK_CHECK(context);
- context.al = context.data.byte(kRyanx);
- context.ah = context.data.byte(kRyany);
- context.cl = context.es.byte(context.bx+10);
- context.ch = context.es.byte(context.bx+11);
- context._cmp(context.al, context.cl);
- if (!context.flags.c())
+ ch = 0;
+ push(di);
+ _add(di, cx);
+ al = ds.byte(di+18);
+ di = pop();
+ es.byte(bx+15) = al;
+ ds.byte(di+17) = al;
+ _cmp(cl, 5);
+ if (!flags.z())
+ return /* (notnearly) */;
+ data.byte(kThroughdoor) = 0;
+}
+
+void DreamGenContext::lockeddoorway() {
+ STACK_CHECK;
+ al = data.byte(kRyanx);
+ ah = data.byte(kRyany);
+ cl = es.byte(bx+10);
+ ch = es.byte(bx+11);
+ _cmp(al, cl);
+ if (!flags.c())
goto rtofdoor2;
- context._sub(context.al, context.cl);
- context._cmp(context.al, -24);
- if (!context.flags.c())
+ _sub(al, cl);
+ _cmp(al, -24);
+ if (!flags.c())
goto upordown2;
goto shutdoor2;
rtofdoor2:
- context._sub(context.al, context.cl);
- context._cmp(context.al, 10);
- if (!context.flags.c())
+ _sub(al, cl);
+ _cmp(al, 10);
+ if (!flags.c())
goto shutdoor2;
upordown2:
- context._cmp(context.ah, context.ch);
- if (!context.flags.c())
+ _cmp(ah, ch);
+ if (!flags.c())
goto botofdoor2;
- context._sub(context.ah, context.ch);
- context._cmp(context.ah, -30);
- if (context.flags.c())
+ _sub(ah, ch);
+ _cmp(ah, -30);
+ if (flags.c())
goto shutdoor2;
goto opendoor2;
botofdoor2:
- context._sub(context.ah, context.ch);
- context._cmp(context.ah, 12);
- if (!context.flags.c())
+ _sub(ah, ch);
+ _cmp(ah, 12);
+ if (!flags.c())
goto shutdoor2;
opendoor2:
- context._cmp(context.data.byte(kThroughdoor), 1);
- if (context.flags.z())
+ _cmp(data.byte(kThroughdoor), 1);
+ if (flags.z())
goto mustbeopen;
- context._cmp(context.data.byte(kLockstatus), 1);
- if (context.flags.z())
+ _cmp(data.byte(kLockstatus), 1);
+ if (flags.z())
goto shutdoor;
mustbeopen:
- context.cl = context.es.byte(context.bx+19);
- context._cmp(context.cl, 1);
- if (!context.flags.z())
+ cl = es.byte(bx+19);
+ _cmp(cl, 1);
+ if (!flags.z())
goto notdoorsound4;
- context.al = 0;
- playchannel1(context);
+ al = 0;
+ playchannel1();
notdoorsound4:
- context._cmp(context.cl, 6);
- if (!context.flags.z())
+ _cmp(cl, 6);
+ if (!flags.z())
goto noturnonyet;
- context.al = context.data.byte(kDoorpath);
- context.push(context.es);
- context.push(context.bx);
- turnpathon(context);
- context.bx = context.pop();
- context.es = context.pop();
+ al = data.byte(kDoorpath);
+ push(es);
+ push(bx);
+ turnpathon();
+ bx = pop();
+ es = pop();
noturnonyet:
- context.cl = context.es.byte(context.bx+19);
- context._cmp(context.data.byte(kThroughdoor), 1);
- if (!context.flags.z())
+ cl = es.byte(bx+19);
+ _cmp(data.byte(kThroughdoor), 1);
+ if (!flags.z())
goto notthrough2;
- context._cmp(context.cl, 0);
- if (!context.flags.z())
+ _cmp(cl, 0);
+ if (!flags.z())
goto notthrough2;
- context.cl = 6;
+ cl = 6;
notthrough2:
- context._inc(context.cl);
- context.ch = 0;
- context.push(context.di);
- context._add(context.di, context.cx);
- context.al = context.ds.byte(context.di+18);
- context._cmp(context.al, 255);
- if (!context.flags.z())
+ _inc(cl);
+ ch = 0;
+ push(di);
+ _add(di, cx);
+ al = ds.byte(di+18);
+ _cmp(al, 255);
+ if (!flags.z())
goto atlast3;
- context._dec(context.di);
- context._dec(context.cl);
+ _dec(di);
+ _dec(cl);
atlast3:
- context.es.byte(context.bx+19) = context.cl;
- context.al = context.ds.byte(context.di+18);
- context.di = context.pop();
- context.es.byte(context.bx+15) = context.al;
- context.ds.byte(context.di+17) = context.al;
- context._cmp(context.cl, 5);
- if (!context.flags.z())
- goto justshutting;
- context.data.byte(kThroughdoor) = 1;
-justshutting:
+ es.byte(bx+19) = cl;
+ al = ds.byte(di+18);
+ di = pop();
+ es.byte(bx+15) = al;
+ ds.byte(di+17) = al;
+ _cmp(cl, 5);
+ if (!flags.z())
+ return /* (justshutting) */;
+ data.byte(kThroughdoor) = 1;
return;
shutdoor2:
- context.cl = context.es.byte(context.bx+19);
- context._cmp(context.cl, 5);
- if (!context.flags.z())
+ cl = es.byte(bx+19);
+ _cmp(cl, 5);
+ if (!flags.z())
goto notdoorsound3;
- context.al = 1;
- playchannel1(context);
+ al = 1;
+ playchannel1();
notdoorsound3:
- context._cmp(context.cl, 0);
- if (context.flags.z())
+ _cmp(cl, 0);
+ if (flags.z())
goto atlast4;
- context._dec(context.cl);
- context.es.byte(context.bx+19) = context.cl;
+ _dec(cl);
+ es.byte(bx+19) = cl;
atlast4:
- context.ch = 0;
- context.data.byte(kThroughdoor) = 0;
- context.push(context.di);
- context._add(context.di, context.cx);
- context.al = context.ds.byte(context.di+18);
- context.di = context.pop();
- context.es.byte(context.bx+15) = context.al;
- context.ds.byte(context.di+17) = context.al;
- context._cmp(context.cl, 0);
- if (!context.flags.z())
- goto notlocky;
- context.al = context.data.byte(kDoorpath);
- context.push(context.es);
- context.push(context.bx);
- turnpathoff(context);
- context.bx = context.pop();
- context.es = context.pop();
- context.data.byte(kLockstatus) = 1;
-notlocky:
- return;
+ ch = 0;
+ data.byte(kThroughdoor) = 0;
+ push(di);
+ _add(di, cx);
+ al = ds.byte(di+18);
+ di = pop();
+ es.byte(bx+15) = al;
+ ds.byte(di+17) = al;
+ _cmp(cl, 0);
+ if (!flags.z())
+ return /* (notlocky) */;
+ al = data.byte(kDoorpath);
+ push(es);
+ push(bx);
+ turnpathoff();
+ bx = pop();
+ es = pop();
+ data.byte(kLockstatus) = 1;
/*continuing to unbounded code: shutdoor from dodoor:60-87*/
shutdoor:
- context.cl = context.es.byte(context.bx+19);
- context._cmp(context.cl, 5);
- if (!context.flags.z())
+ cl = es.byte(bx+19);
+ _cmp(cl, 5);
+ if (!flags.z())
goto notdoorsound1;
- context.al = 1;
- context._cmp(context.data.byte(kReallocation), 5);
- if (!context.flags.z())
+ al = 1;
+ _cmp(data.byte(kReallocation), 5);
+ if (!flags.z())
goto nothoteldoor1;
- context.al = 13;
+ al = 13;
nothoteldoor1:
- playchannel1(context);
+ playchannel1();
notdoorsound1:
- context._cmp(context.cl, 0);
- if (context.flags.z())
+ _cmp(cl, 0);
+ if (flags.z())
goto atlast2;
- context._dec(context.cl);
- context.es.byte(context.bx+19) = context.cl;
+ _dec(cl);
+ es.byte(bx+19) = cl;
atlast2:
- context.ch = 0;
- context.push(context.di);
- context._add(context.di, context.cx);
- context.al = context.ds.byte(context.di+18);
- context.di = context.pop();
- context.es.byte(context.bx+15) = context.al;
- context.ds.byte(context.di+17) = context.al;
- context._cmp(context.cl, 5);
- if (!context.flags.z())
- goto notnearly;
- context.data.byte(kThroughdoor) = 0;
-notnearly:
- return;
- return;
-}
-
-void updatepeople(Context &context) {
- STACK_CHECK(context);
- context.es = context.data.word(kBuffers);
- context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5));
- context.data.word(kListpos) = context.di;
- context.cx = 12*5;
- context.al = 255;
- context._stosb(context.cx);
- context._inc(context.data.word(kMaintimer));
- context.es = context.cs;
- context.bx = 534;
- context.di = 991;
+ ch = 0;
+ push(di);
+ _add(di, cx);
+ al = ds.byte(di+18);
+ di = pop();
+ es.byte(bx+15) = al;
+ ds.byte(di+17) = al;
+ _cmp(cl, 5);
+ if (!flags.z())
+ return /* (notnearly) */;
+ data.byte(kThroughdoor) = 0;
+}
+
+void DreamGenContext::updatepeople() {
+ STACK_CHECK;
+ es = data.word(kBuffers);
+ di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5));
+ data.word(kListpos) = di;
+ cx = 12*5;
+ al = 255;
+ _stosb(cx, true);
+ _inc(data.word(kMaintimer));
+ es = cs;
+ bx = 534;
+ di = 991;
updateloop:
- context.al = context.es.byte(context.bx);
- context._cmp(context.al, 255);
- if (context.flags.z())
- goto endupdate;
- context._cmp(context.al, context.data.byte(kReallocation));
- if (!context.flags.z())
+ al = es.byte(bx);
+ _cmp(al, 255);
+ if (flags.z())
+ return /* (endupdate) */;
+ _cmp(al, data.byte(kReallocation));
+ if (!flags.z())
goto notinthisroom;
- context.cx = context.es.word(context.bx+1);
- context._cmp(context.cl, context.data.byte(kMapx));
- if (!context.flags.z())
+ cx = es.word(bx+1);
+ _cmp(cl, data.byte(kMapx));
+ if (!flags.z())
goto notinthisroom;
- context._cmp(context.ch, context.data.byte(kMapy));
- if (!context.flags.z())
+ _cmp(ch, data.byte(kMapy));
+ if (!flags.z())
goto notinthisroom;
- context.push(context.di);
- context.ax = context.cs.word(context.di);
- __dispatch_call(context, context.ax);
- context.di = context.pop();
+ push(di);
+ ax = cs.word(di);
+ __dispatch_call(ax);
+ di = pop();
notinthisroom:
- context._add(context.bx, 8);
- context._add(context.di, 2);
+ _add(bx, 8);
+ _add(di, 2);
goto updateloop;
-endupdate:
- return;
-}
-
-void getreelframeax(Context &context) {
- STACK_CHECK(context);
- context.push(context.ds);
- context.data.word(kCurrentframe) = context.ax;
- findsource(context);
- context.es = context.ds;
- context.ds = context.pop();
- context.ax = context.data.word(kCurrentframe);
- context._sub(context.ax, context.data.word(kTakeoff));
- context._add(context.ax, context.ax);
- context.cx = context.ax;
- context._add(context.ax, context.ax);
- context._add(context.ax, context.cx);
- context.bx = context.ax;
-}
-
-void reelsonscreen(Context &context) {
- STACK_CHECK(context);
- reconstruct(context);
- updatepeople(context);
- watchreel(context);
- showrain(context);
- usetimedtext(context);
-}
-
-void plotreel(Context &context) {
- STACK_CHECK(context);
- getreelstart(context);
+}
+
+void DreamGenContext::getreelframeax() {
+ STACK_CHECK;
+ push(ds);
+ data.word(kCurrentframe) = ax;
+ findsource();
+ es = ds;
+ ds = pop();
+ ax = data.word(kCurrentframe);
+ _sub(ax, data.word(kTakeoff));
+ _add(ax, ax);
+ cx = ax;
+ _add(ax, ax);
+ _add(ax, cx);
+ bx = ax;
+}
+
+void DreamGenContext::reelsonscreen() {
+ STACK_CHECK;
+ reconstruct();
+ updatepeople();
+ watchreel();
+ showrain();
+ usetimedtext();
+}
+
+void DreamGenContext::plotreel() {
+ STACK_CHECK;
+ getreelstart();
retryreel:
- context.push(context.es);
- context.push(context.si);
- context.ax = context.es.word(context.si+2);
- context._cmp(context.al, 220);
- if (context.flags.c())
+ push(es);
+ push(si);
+ ax = es.word(si+2);
+ _cmp(al, 220);
+ if (flags.c())
goto normalreel;
- context._cmp(context.al, 255);
- if (context.flags.z())
+ _cmp(al, 255);
+ if (flags.z())
goto normalreel;
- dealwithspecial(context);
- context._inc(context.data.word(kReelpointer));
- context.si = context.pop();
- context.es = context.pop();
- context._add(context.si, 40);
+ dealwithspecial();
+ _inc(data.word(kReelpointer));
+ si = pop();
+ es = pop();
+ _add(si, 40);
goto retryreel;
normalreel:
- context.cx = 8;
+ cx = 8;
plotloop:
- context.push(context.cx);
- context.push(context.es);
- context.push(context.si);
- context.ax = context.es.word(context.si);
- context._cmp(context.ax, 0x0ffff);
- if (context.flags.z())
+ push(cx);
+ push(es);
+ push(si);
+ ax = es.word(si);
+ _cmp(ax, 0x0ffff);
+ if (flags.z())
goto notplot;
- showreelframe(context);
+ showreelframe();
notplot:
- context.si = context.pop();
- context.es = context.pop();
- context.cx = context.pop();
- context._add(context.si, 5);
- if (--context.cx)
+ si = pop();
+ es = pop();
+ cx = pop();
+ _add(si, 5);
+ if (--cx)
goto plotloop;
- soundonreels(context);
- context.bx = context.pop();
- context.es = context.pop();
-}
-
-void soundonreels(Context &context) {
- STACK_CHECK(context);
- context.bl = context.data.byte(kReallocation);
- context._add(context.bl, context.bl);
- context._xor(context.bh, context.bh);
- context._add(context.bx, 1214);
- context.si = context.cs.word(context.bx);
+ soundonreels();
+ bx = pop();
+ es = pop();
+}
+
+void DreamGenContext::soundonreels() {
+ STACK_CHECK;
+ bl = data.byte(kReallocation);
+ _add(bl, bl);
+ _xor(bh, bh);
+ _add(bx, 1214);
+ si = cs.word(bx);
reelsoundloop:
- context.al = context.cs.byte(context.si);
- context._cmp(context.al, 255);
- if (context.flags.z())
+ al = cs.byte(si);
+ _cmp(al, 255);
+ if (flags.z())
goto endreelsound;
- context.ax = context.cs.word(context.si+1);
- context._cmp(context.ax, context.data.word(kReelpointer));
- if (!context.flags.z())
+ ax = cs.word(si+1);
+ _cmp(ax, data.word(kReelpointer));
+ if (!flags.z())
goto skipreelsound;
- context._cmp(context.ax, context.data.word(kLastsoundreel));
- if (context.flags.z())
+ _cmp(ax, data.word(kLastsoundreel));
+ if (flags.z())
goto skipreelsound;
- context.data.word(kLastsoundreel) = context.ax;
- context.al = context.cs.byte(context.si);
- context._cmp(context.al, 64);
- if (context.flags.c())
- { playchannel1(context); return; };
- context._cmp(context.al, 128);
- if (context.flags.c())
+ data.word(kLastsoundreel) = ax;
+ al = cs.byte(si);
+ _cmp(al, 64);
+ if (flags.c())
+ { playchannel1(); return; };
+ _cmp(al, 128);
+ if (flags.c())
goto channel0once;
- context._and(context.al, 63);
- context.ah = 255;
- { playchannel0(context); return; };
+ _and(al, 63);
+ ah = 255;
+ { playchannel0(); return; };
channel0once:
- context._and(context.al, 63);
- context.ah = 0;
- { playchannel0(context); return; };
+ _and(al, 63);
+ ah = 0;
+ { playchannel0(); return; };
skipreelsound:
- context._add(context.si, 3);
+ _add(si, 3);
goto reelsoundloop;
endreelsound:
- context.ax = context.data.word(kLastsoundreel);
- context._cmp(context.ax, context.data.word(kReelpointer));
- if (context.flags.z())
- goto nochange2;
- context.data.word(kLastsoundreel) = -1;
-nochange2:
- return;
-}
-
-void reconstruct(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kHavedoneobs), 0);
- if (context.flags.z())
- goto noneedtorecon;
- context.data.byte(kNewobs) = 1;
- drawfloor(context);
- spriteupdate(context);
- printsprites(context);
- context.data.byte(kHavedoneobs) = 0;
-noneedtorecon:
- return;
-}
-
-void dealwithspecial(Context &context) {
- STACK_CHECK(context);
- context._sub(context.al, 220);
- context._cmp(context.al, 0);
- if (!context.flags.z())
+ ax = data.word(kLastsoundreel);
+ _cmp(ax, data.word(kReelpointer));
+ if (flags.z())
+ return /* (nochange2) */;
+ data.word(kLastsoundreel) = -1;
+}
+
+void DreamGenContext::reconstruct() {
+ STACK_CHECK;
+ _cmp(data.byte(kHavedoneobs), 0);
+ if (flags.z())
+ return /* (noneedtorecon) */;
+ data.byte(kNewobs) = 1;
+ drawfloor();
+ spriteupdate();
+ printsprites();
+ data.byte(kHavedoneobs) = 0;
+}
+
+void DreamGenContext::dealwithspecial() {
+ STACK_CHECK;
+ _sub(al, 220);
+ _cmp(al, 0);
+ if (!flags.z())
goto notplset;
- context.al = context.ah;
- placesetobject(context);
- context.data.byte(kHavedoneobs) = 1;
+ al = ah;
+ placesetobject();
+ data.byte(kHavedoneobs) = 1;
return;
notplset:
- context._cmp(context.al, 1);
- if (!context.flags.z())
+ _cmp(al, 1);
+ if (!flags.z())
goto notremset;
- context.al = context.ah;
- removesetobject(context);
- context.data.byte(kHavedoneobs) = 1;
+ al = ah;
+ removesetobject();
+ data.byte(kHavedoneobs) = 1;
return;
notremset:
- context._cmp(context.al, 2);
- if (!context.flags.z())
+ _cmp(al, 2);
+ if (!flags.z())
goto notplfree;
- context.al = context.ah;
- placefreeobject(context);
- context.data.byte(kHavedoneobs) = 1;
+ al = ah;
+ placefreeobject();
+ data.byte(kHavedoneobs) = 1;
return;
notplfree:
- context._cmp(context.al, 3);
- if (!context.flags.z())
+ _cmp(al, 3);
+ if (!flags.z())
goto notremfree;
- context.al = context.ah;
- removefreeobject(context);
- context.data.byte(kHavedoneobs) = 1;
+ al = ah;
+ removefreeobject();
+ data.byte(kHavedoneobs) = 1;
return;
notremfree:
- context._cmp(context.al, 4);
- if (!context.flags.z())
+ _cmp(al, 4);
+ if (!flags.z())
goto notryanoff;
- switchryanoff(context);
+ switchryanoff();
return;
notryanoff:
- context._cmp(context.al, 5);
- if (!context.flags.z())
+ _cmp(al, 5);
+ if (!flags.z())
goto notryanon;
- context.data.byte(kTurntoface) = context.ah;
- context.data.byte(kFacing) = context.ah;
- switchryanon(context);
+ data.byte(kTurntoface) = ah;
+ data.byte(kFacing) = ah;
+ switchryanon();
return;
notryanon:
- context._cmp(context.al, 6);
- if (!context.flags.z())
+ _cmp(al, 6);
+ if (!flags.z())
goto notchangeloc;
- context.data.byte(kNewlocation) = context.ah;
+ data.byte(kNewlocation) = ah;
return;
notchangeloc:
- movemap(context);
+ movemap();
}
-void movemap(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.ah, 32);
- if (!context.flags.z())
+void DreamGenContext::movemap() {
+ STACK_CHECK;
+ _cmp(ah, 32);
+ if (!flags.z())
goto notmapup2;
- context._sub(context.data.byte(kMapy), 20);
- context.data.byte(kNowinnewroom) = 1;
+ _sub(data.byte(kMapy), 20);
+ data.byte(kNowinnewroom) = 1;
return;
notmapup2:
- context._cmp(context.ah, 16);
- if (!context.flags.z())
+ _cmp(ah, 16);
+ if (!flags.z())
goto notmapupspec;
- context._sub(context.data.byte(kMapy), 10);
- context.data.byte(kNowinnewroom) = 1;
+ _sub(data.byte(kMapy), 10);
+ data.byte(kNowinnewroom) = 1;
return;
notmapupspec:
- context._cmp(context.ah, 8);
- if (!context.flags.z())
+ _cmp(ah, 8);
+ if (!flags.z())
goto notmapdownspec;
- context._add(context.data.byte(kMapy), 10);
- context.data.byte(kNowinnewroom) = 1;
+ _add(data.byte(kMapy), 10);
+ data.byte(kNowinnewroom) = 1;
return;
notmapdownspec:
- context._cmp(context.ah, 2);
- if (!context.flags.z())
+ _cmp(ah, 2);
+ if (!flags.z())
goto notmaprightspec;
- context._add(context.data.byte(kMapx), 11);
- context.data.byte(kNowinnewroom) = 1;
+ _add(data.byte(kMapx), 11);
+ data.byte(kNowinnewroom) = 1;
return;
notmaprightspec:
- context._sub(context.data.byte(kMapx), 11);
- context.data.byte(kNowinnewroom) = 1;
-}
-
-void getreelstart(Context &context) {
- STACK_CHECK(context);
- context.ax = context.data.word(kReelpointer);
- context.cx = 40;
- context._mul(context.cx);
- context.es = context.data.word(kReels);
- context.si = context.ax;
- context._add(context.si, (0+(36*144)));
-}
-
-void showreelframe(Context &context) {
- STACK_CHECK(context);
- context.al = context.es.byte(context.si+2);
- context.ah = 0;
- context.di = context.ax;
- context._add(context.di, context.data.word(kMapadx));
- context.al = context.es.byte(context.si+3);
- context.bx = context.ax;
- context._add(context.bx, context.data.word(kMapady));
- context.ax = context.es.word(context.si);
- context.data.word(kCurrentframe) = context.ax;
- findsource(context);
- context.ax = context.data.word(kCurrentframe);
- context._sub(context.ax, context.data.word(kTakeoff));
- context.ah = 8;
- showframe(context);
-}
-
-void deleverything(Context &context) {
- STACK_CHECK(context);
- context.al = context.data.byte(kMapysize);
- context.ah = 0;
- context._add(context.ax, context.data.word(kMapoffsety));
- context._cmp(context.ax, 182);
- if (!context.flags.c())
+ _sub(data.byte(kMapx), 11);
+ data.byte(kNowinnewroom) = 1;
+}
+
+void DreamGenContext::getreelstart() {
+ STACK_CHECK;
+ ax = data.word(kReelpointer);
+ cx = 40;
+ _mul(cx);
+ es = data.word(kReels);
+ si = ax;
+ _add(si, (0+(36*144)));
+}
+
+void DreamGenContext::showreelframe() {
+ STACK_CHECK;
+ al = es.byte(si+2);
+ ah = 0;
+ di = ax;
+ _add(di, data.word(kMapadx));
+ al = es.byte(si+3);
+ bx = ax;
+ _add(bx, data.word(kMapady));
+ ax = es.word(si);
+ data.word(kCurrentframe) = ax;
+ findsource();
+ ax = data.word(kCurrentframe);
+ _sub(ax, data.word(kTakeoff));
+ ah = 8;
+ showframe();
+}
+
+void DreamGenContext::deleverything() {
+ STACK_CHECK;
+ al = data.byte(kMapysize);
+ ah = 0;
+ _add(ax, data.word(kMapoffsety));
+ _cmp(ax, 182);
+ if (!flags.c())
goto bigroom;
- maptopanel(context);
+ maptopanel();
return;
bigroom:
- context._sub(context.data.byte(kMapysize), 8);
- maptopanel(context);
- context._add(context.data.byte(kMapysize), 8);
+ _sub(data.byte(kMapysize), 8);
+ maptopanel();
+ _add(data.byte(kMapysize), 8);
}
-void dumpeverything(Context &context) {
- STACK_CHECK(context);
- context.es = context.data.word(kBuffers);
- context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40));
+void DreamGenContext::dumpeverything() {
+ STACK_CHECK;
+ es = data.word(kBuffers);
+ bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40));
dumpevery1:
- context.ax = context.es.word(context.bx);
- context.cx = context.es.word(context.bx+2);
- context._cmp(context.ax, 0x0ffff);
- if (context.flags.z())
+ ax = es.word(bx);
+ cx = es.word(bx+2);
+ _cmp(ax, 0x0ffff);
+ if (flags.z())
goto finishevery1;
- context._cmp(context.ax, context.es.word(context.bx+(40*5)));
- if (!context.flags.z())
+ _cmp(ax, es.word(bx+(40*5)));
+ if (!flags.z())
goto notskip1;
- context._cmp(context.cx, context.es.word(context.bx+(40*5)+2));
- if (context.flags.z())
+ _cmp(cx, es.word(bx+(40*5)+2));
+ if (flags.z())
goto skip1;
notskip1:
- context.push(context.bx);
- context.push(context.es);
- context.push(context.ds);
- context.bl = context.ah;
- context.bh = 0;
- context.ah = 0;
- context.di = context.ax;
- context._add(context.di, context.data.word(kMapadx));
- context._add(context.bx, context.data.word(kMapady));
- multidump(context);
- context.ds = context.pop();
- context.es = context.pop();
- context.bx = context.pop();
+ push(bx);
+ push(es);
+ push(ds);
+ bl = ah;
+ bh = 0;
+ ah = 0;
+ di = ax;
+ _add(di, data.word(kMapadx));
+ _add(bx, data.word(kMapady));
+ multidump();
+ ds = pop();
+ es = pop();
+ bx = pop();
skip1:
- context._add(context.bx, 5);
+ _add(bx, 5);
goto dumpevery1;
finishevery1:
- context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40))+(40*5);
+ bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40))+(40*5);
dumpevery2:
- context.ax = context.es.word(context.bx);
- context.cx = context.es.word(context.bx+2);
- context._cmp(context.ax, 0x0ffff);
- if (context.flags.z())
- goto finishevery2;
- context.push(context.bx);
- context.push(context.es);
- context.push(context.ds);
- context.bl = context.ah;
- context.bh = 0;
- context.ah = 0;
- context.di = context.ax;
- context._add(context.di, context.data.word(kMapadx));
- context._add(context.bx, context.data.word(kMapady));
- multidump(context);
- context.ds = context.pop();
- context.es = context.pop();
- context.bx = context.pop();
- context._add(context.bx, 5);
+ ax = es.word(bx);
+ cx = es.word(bx+2);
+ _cmp(ax, 0x0ffff);
+ if (flags.z())
+ return /* (finishevery2) */;
+ push(bx);
+ push(es);
+ push(ds);
+ bl = ah;
+ bh = 0;
+ ah = 0;
+ di = ax;
+ _add(di, data.word(kMapadx));
+ _add(bx, data.word(kMapady));
+ multidump();
+ ds = pop();
+ es = pop();
+ bx = pop();
+ _add(bx, 5);
goto dumpevery2;
-finishevery2:
- return;
-}
-
-void allocatework(Context &context) {
- STACK_CHECK(context);
- context.bx = 0x1000;
- allocatemem(context);
- context.data.word(kWorkspace) = context.ax;
-}
-
-void readabyte(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.si, 30000);
- if (!context.flags.z())
- goto notendblock;
- context.push(context.bx);
- context.push(context.es);
- context.push(context.di);
- context.push(context.ds);
- context.push(context.si);
- readoneblock(context);
- context.si = context.pop();
- context.ds = context.pop();
- context.di = context.pop();
- context.es = context.pop();
- context.bx = context.pop();
- context.si = 0;
-notendblock:
- context._lodsb();
-}
-
-void loadpalfromiff(Context &context) {
- STACK_CHECK(context);
- context.dx = 2481;
- openfile(context);
- context.cx = 2000;
- context.ds = context.data.word(kMapstore);
- context.dx = 0;
- readfromfile(context);
- closefile(context);
- context.es = context.data.word(kBuffers);
- context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768);
- context.ds = context.data.word(kMapstore);
- context.si = 0x30;
- context.cx = 768;
+}
+
+void DreamGenContext::allocatework() {
+ STACK_CHECK;
+ bx = 0x1000;
+ allocatemem();
+ data.word(kWorkspace) = ax;
+}
+
+void DreamGenContext::loadpalfromiff() {
+ STACK_CHECK;
+ dx = 2481;
+ openfile();
+ cx = 2000;
+ ds = data.word(kMapstore);
+ dx = 0;
+ readfromfile();
+ closefile();
+ es = data.word(kBuffers);
+ di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768);
+ ds = data.word(kMapstore);
+ si = 0x30;
+ cx = 768;
palloop:
- context._lodsb();
- context._shr(context.al, 1);
- context._shr(context.al, 1);
- context._cmp(context.data.byte(kBrightness), 1);
- if (!context.flags.z())
+ _lodsb();
+ _shr(al, 1);
+ _shr(al, 1);
+ _cmp(data.byte(kBrightness), 1);
+ if (!flags.z())
goto nought;
- context._cmp(context.al, 0);
- if (context.flags.z())
+ _cmp(al, 0);
+ if (flags.z())
goto nought;
- context.ah = context.al;
- context._shr(context.ah, 1);
- context._add(context.al, context.ah);
- context._shr(context.ah, 1);
- context._add(context.al, context.ah);
- context._cmp(context.al, 64);
- if (context.flags.c())
+ ah = al;
+ _shr(ah, 1);
+ _add(al, ah);
+ _shr(ah, 1);
+ _add(al, ah);
+ _cmp(al, 64);
+ if (flags.c())
goto nought;
- context.al = 63;
+ al = 63;
nought:
- context._stosb();
- if (--context.cx)
+ _stosb();
+ if (--cx)
goto palloop;
}
-void paneltomap(Context &context) {
- STACK_CHECK(context);
- context.di = context.data.word(kMapxstart);
- context._add(context.di, context.data.word(kMapadx));
- context.bx = context.data.word(kMapystart);
- context._add(context.bx, context.data.word(kMapady));
- context.ds = context.data.word(kMapstore);
- context.si = 0;
- context.cl = context.data.byte(kMapxsize);
- context.ch = context.data.byte(kMapysize);
- multiget(context);
-}
-
-void maptopanel(Context &context) {
- STACK_CHECK(context);
- context.di = context.data.word(kMapxstart);
- context._add(context.di, context.data.word(kMapadx));
- context.bx = context.data.word(kMapystart);
- context._add(context.bx, context.data.word(kMapady));
- context.ds = context.data.word(kMapstore);
- context.si = 0;
- context.cl = context.data.byte(kMapxsize);
- context.ch = context.data.byte(kMapysize);
- multiput(context);
-}
-
-void dumpmap(Context &context) {
- STACK_CHECK(context);
- context.di = context.data.word(kMapxstart);
- context._add(context.di, context.data.word(kMapadx));
- context.bx = context.data.word(kMapystart);
- context._add(context.bx, context.data.word(kMapady));
- context.cl = context.data.byte(kMapxsize);
- context.ch = context.data.byte(kMapysize);
- multidump(context);
-}
-
-void pixelcheckset(Context &context) {
- STACK_CHECK(context);
- context.push(context.ax);
- context._sub(context.al, context.es.byte(context.bx));
- context._sub(context.ah, context.es.byte(context.bx+1));
- context.push(context.es);
- context.push(context.bx);
- context.push(context.cx);
- context.push(context.ax);
- context.al = context.es.byte(context.bx+4);
- getsetad(context);
- context.al = context.es.byte(context.bx+17);
- context.es = context.data.word(kSetframes);
- context.bx = (0);
- context.ah = 0;
- context.cx = 6;
- context._mul(context.cx);
- context._add(context.bx, context.ax);
- context.ax = context.pop();
- context.push(context.ax);
- context.al = context.ah;
- context.ah = 0;
- context.cl = context.es.byte(context.bx);
- context.ch = 0;
- context._mul(context.cx);
- context.cx = context.pop();
- context.ch = 0;
- context._add(context.ax, context.cx);
- context._add(context.ax, context.es.word(context.bx+2));
- context.bx = context.ax;
- context._add(context.bx, (0+2080));
- context.al = context.es.byte(context.bx);
- context.dl = context.al;
- context.cx = context.pop();
- context.bx = context.pop();
- context.es = context.pop();
- context.ax = context.pop();
- context._cmp(context.dl, 0);
-}
-
-void createpanel(Context &context) {
- STACK_CHECK(context);
- context.di = 0;
- context.bx = 8;
- context.ds = context.data.word(kIcons2);
- context.al = 0;
- context.ah = 2;
- showframe(context);
- context.di = 160;
- context.bx = 8;
- context.ds = context.data.word(kIcons2);
- context.al = 0;
- context.ah = 2;
- showframe(context);
- context.di = 0;
- context.bx = 104;
- context.ds = context.data.word(kIcons2);
- context.al = 0;
- context.ah = 2;
- showframe(context);
- context.di = 160;
- context.bx = 104;
- context.ds = context.data.word(kIcons2);
- context.al = 0;
- context.ah = 2;
- showframe(context);
-}
-
-void createpanel2(Context &context) {
- STACK_CHECK(context);
- createpanel(context);
- context.di = 0;
- context.bx = 0;
- context.ds = context.data.word(kIcons2);
- context.al = 5;
- context.ah = 2;
- showframe(context);
- context.di = 160;
- context.bx = 0;
- context.ds = context.data.word(kIcons2);
- context.al = 5;
- context.ah = 2;
- showframe(context);
-}
-
-void clearwork(Context &context) {
- STACK_CHECK(context);
- context.ax = 0x0;
- context.es = context.data.word(kWorkspace);
- context.di = 0;
- context.cx = (200*320)/64;
+void DreamGenContext::paneltomap() {
+ STACK_CHECK;
+ di = data.word(kMapxstart);
+ _add(di, data.word(kMapadx));
+ bx = data.word(kMapystart);
+ _add(bx, data.word(kMapady));
+ ds = data.word(kMapstore);
+ si = 0;
+ cl = data.byte(kMapxsize);
+ ch = data.byte(kMapysize);
+ multiget();
+}
+
+void DreamGenContext::maptopanel() {
+ STACK_CHECK;
+ di = data.word(kMapxstart);
+ _add(di, data.word(kMapadx));
+ bx = data.word(kMapystart);
+ _add(bx, data.word(kMapady));
+ ds = data.word(kMapstore);
+ si = 0;
+ cl = data.byte(kMapxsize);
+ ch = data.byte(kMapysize);
+ multiput();
+}
+
+void DreamGenContext::dumpmap() {
+ STACK_CHECK;
+ di = data.word(kMapxstart);
+ _add(di, data.word(kMapadx));
+ bx = data.word(kMapystart);
+ _add(bx, data.word(kMapady));
+ cl = data.byte(kMapxsize);
+ ch = data.byte(kMapysize);
+ multidump();
+}
+
+void DreamGenContext::pixelcheckset() {
+ STACK_CHECK;
+ push(ax);
+ _sub(al, es.byte(bx));
+ _sub(ah, es.byte(bx+1));
+ push(es);
+ push(bx);
+ push(cx);
+ push(ax);
+ al = es.byte(bx+4);
+ getsetad();
+ al = es.byte(bx+17);
+ es = data.word(kSetframes);
+ bx = (0);
+ ah = 0;
+ cx = 6;
+ _mul(cx);
+ _add(bx, ax);
+ ax = pop();
+ push(ax);
+ al = ah;
+ ah = 0;
+ cl = es.byte(bx);
+ ch = 0;
+ _mul(cx);
+ cx = pop();
+ ch = 0;
+ _add(ax, cx);
+ _add(ax, es.word(bx+2));
+ bx = ax;
+ _add(bx, (0+2080));
+ al = es.byte(bx);
+ dl = al;
+ cx = pop();
+ bx = pop();
+ es = pop();
+ ax = pop();
+ _cmp(dl, 0);
+}
+
+void DreamGenContext::createpanel() {
+ STACK_CHECK;
+ di = 0;
+ bx = 8;
+ ds = data.word(kIcons2);
+ al = 0;
+ ah = 2;
+ showframe();
+ di = 160;
+ bx = 8;
+ ds = data.word(kIcons2);
+ al = 0;
+ ah = 2;
+ showframe();
+ di = 0;
+ bx = 104;
+ ds = data.word(kIcons2);
+ al = 0;
+ ah = 2;
+ showframe();
+ di = 160;
+ bx = 104;
+ ds = data.word(kIcons2);
+ al = 0;
+ ah = 2;
+ showframe();
+}
+
+void DreamGenContext::createpanel2() {
+ STACK_CHECK;
+ createpanel();
+ di = 0;
+ bx = 0;
+ ds = data.word(kIcons2);
+ al = 5;
+ ah = 2;
+ showframe();
+ di = 160;
+ bx = 0;
+ ds = data.word(kIcons2);
+ al = 5;
+ ah = 2;
+ showframe();
+}
+
+void DreamGenContext::clearwork() {
+ STACK_CHECK;
+ ax = 0x0;
+ es = data.word(kWorkspace);
+ di = 0;
+ cx = (200*320)/64;
clearloop:
- context._stosw(32);
- if (--context.cx)
+ _stosw(32);
+ if (--cx)
goto clearloop;
}
-void zoom(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.word(kWatchingtime), 0);
- if (!context.flags.z())
- goto inwatching;
- context._cmp(context.data.byte(kZoomon), 1);
- if (context.flags.z())
+void DreamGenContext::zoom() {
+ STACK_CHECK;
+ _cmp(data.word(kWatchingtime), 0);
+ if (!flags.z())
+ return /* (inwatching) */;
+ _cmp(data.byte(kZoomon), 1);
+ if (flags.z())
goto zoomswitch;
-inwatching:
return;
zoomswitch:
- context._cmp(context.data.byte(kCommandtype), 199);
- if (context.flags.c())
+ _cmp(data.byte(kCommandtype), 199);
+ if (flags.c())
goto zoomit;
- putunderzoom(context);
+ putunderzoom();
return;
zoomit:
- context.ax = context.data.word(kOldpointery);
- context._sub(context.ax, 9);
- context.cx = (320);
- context._mul(context.cx);
- context._add(context.ax, context.data.word(kOldpointerx));
- context._sub(context.ax, 11);
- context.si = context.ax;
- context.ax = (132)+4;
- context.cx = (320);
- context._mul(context.cx);
- context._add(context.ax, (8)+5);
- context.di = context.ax;
- context.es = context.data.word(kWorkspace);
- context.ds = context.data.word(kWorkspace);
- context.cx = 20;
+ ax = data.word(kOldpointery);
+ _sub(ax, 9);
+ cx = (320);
+ _mul(cx);
+ _add(ax, data.word(kOldpointerx));
+ _sub(ax, 11);
+ si = ax;
+ ax = (132)+4;
+ cx = (320);
+ _mul(cx);
+ _add(ax, (8)+5);
+ di = ax;
+ es = data.word(kWorkspace);
+ ds = data.word(kWorkspace);
+ cx = 20;
zoomloop:
- context.push(context.cx);
- context.cx = 23;
+ push(cx);
+ cx = 23;
zoomloop2:
- context._lodsb();
- context.ah = context.al;
- context._stosw();
- context.es.word(context.di+(320)-2) = context.ax;
- if (--context.cx)
+ _lodsb();
+ ah = al;
+ _stosw();
+ es.word(di+(320)-2) = ax;
+ if (--cx)
goto zoomloop2;
- context._add(context.si, (320)-23);
- context._add(context.di, (320)-46+(320));
- context.cx = context.pop();
- if (--context.cx)
+ _add(si, (320)-23);
+ _add(di, (320)-46+(320));
+ cx = pop();
+ if (--cx)
goto zoomloop;
- crosshair(context);
- context.data.byte(kDidzoom) = 1;
-}
-
-void delthisone(Context &context) {
- STACK_CHECK(context);
- context.push(context.ax);
- context.push(context.ax);
- context.al = context.ah;
- context.ah = 0;
- context._add(context.ax, context.data.word(kMapady));
- context.bx = (320);
- context._mul(context.bx);
- context.bx = context.pop();
- context.bh = 0;
- context._add(context.bx, context.data.word(kMapadx));
- context._add(context.ax, context.bx);
- context.di = context.ax;
- context.ax = context.pop();
- context.push(context.ax);
- context.al = context.ah;
- context.ah = 0;
- context.bx = 22*8;
- context._mul(context.bx);
- context.bx = context.pop();
- context.bh = 0;
- context._add(context.ax, context.bx);
- context.si = context.ax;
- context.es = context.data.word(kWorkspace);
- context.ds = context.data.word(kMapstore);
- context.dl = context.cl;
- context.dh = 0;
- context.ax = (320);
- context._sub(context.ax, context.dx);
- context._neg(context.dx);
- context._add(context.dx, 22*8);
+ crosshair();
+ data.byte(kDidzoom) = 1;
+}
+
+void DreamGenContext::delthisone() {
+ STACK_CHECK;
+ push(ax);
+ push(ax);
+ al = ah;
+ ah = 0;
+ _add(ax, data.word(kMapady));
+ bx = (320);
+ _mul(bx);
+ bx = pop();
+ bh = 0;
+ _add(bx, data.word(kMapadx));
+ _add(ax, bx);
+ di = ax;
+ ax = pop();
+ push(ax);
+ al = ah;
+ ah = 0;
+ bx = 22*8;
+ _mul(bx);
+ bx = pop();
+ bh = 0;
+ _add(ax, bx);
+ si = ax;
+ es = data.word(kWorkspace);
+ ds = data.word(kMapstore);
+ dl = cl;
+ dh = 0;
+ ax = (320);
+ _sub(ax, dx);
+ _neg(dx);
+ _add(dx, 22*8);
deloneloop:
- context.push(context.cx);
- context.ch = 0;
- context._movsb(context.cx);
- context.cx = context.pop();
- context._add(context.di, context.ax);
- context._add(context.si, context.dx);
- context._dec(context.ch);
- if (!context.flags.z())
+ push(cx);
+ ch = 0;
+ _movsb(cx, true);
+ cx = pop();
+ _add(di, ax);
+ _add(si, dx);
+ _dec(ch);
+ if (!flags.z())
goto deloneloop;
}
-void doblocks(Context &context) {
- STACK_CHECK(context);
- context.es = context.data.word(kWorkspace);
- context.ax = context.data.word(kMapady);
- context.cx = (320);
- context._mul(context.cx);
- context.di = context.data.word(kMapadx);
- context._add(context.di, context.ax);
- context.al = context.data.byte(kMapy);
- context.ah = 0;
- context.bx = (66);
- context._mul(context.bx);
- context.bl = context.data.byte(kMapx);
- context.bh = 0;
- context._add(context.ax, context.bx);
- context.si = (0);
- context._add(context.si, context.ax);
- context.cx = 10;
+void DreamGenContext::doblocks() {
+ STACK_CHECK;
+ es = data.word(kWorkspace);
+ ax = data.word(kMapady);
+ cx = (320);
+ _mul(cx);
+ di = data.word(kMapadx);
+ _add(di, ax);
+ al = data.byte(kMapy);
+ ah = 0;
+ bx = (66);
+ _mul(bx);
+ bl = data.byte(kMapx);
+ bh = 0;
+ _add(ax, bx);
+ si = (0);
+ _add(si, ax);
+ cx = 10;
loop120:
- context.push(context.di);
- context.push(context.cx);
- context.cx = 11;
+ push(di);
+ push(cx);
+ cx = 11;
loop124:
- context.push(context.cx);
- context.push(context.di);
- context.ds = context.data.word(kMapdata);
- context._lodsb();
- context.ds = context.data.word(kBackdrop);
- context.push(context.si);
- context._cmp(context.al, 0);
- if (context.flags.z())
+ push(cx);
+ push(di);
+ ds = data.word(kMapdata);
+ _lodsb();
+ ds = data.word(kBackdrop);
+ push(si);
+ _cmp(al, 0);
+ if (flags.z())
goto zeroblock;
- context.ah = context.al;
- context.al = 0;
- context.si = (0+192);
- context._add(context.si, context.ax);
- context.bh = 14;
- context.bh = 4;
+ ah = al;
+ al = 0;
+ si = (0+192);
+ _add(si, ax);
+ bh = 14;
+ bh = 4;
firstbitofblock:
- context._movsw(8);
- context._add(context.di, (320)-16);
- context._dec(context.bh);
- if (!context.flags.z())
+ _movsw(8);
+ _add(di, (320)-16);
+ _dec(bh);
+ if (!flags.z())
goto firstbitofblock;
- context.bh = 12;
+ bh = 12;
loop125:
- context._movsw(8);
- context.ax = 0x0dfdf;
- context._stosw(2);
- context._add(context.di, (320)-20);
- context._dec(context.bh);
- if (!context.flags.z())
+ _movsw(8);
+ ax = 0x0dfdf;
+ _stosw(2);
+ _add(di, (320)-20);
+ _dec(bh);
+ if (!flags.z())
goto loop125;
- context._add(context.di, 4);
- context.ax = 0x0dfdf;
- context._stosw(8);
- context._add(context.di, (320)-16);
- context._stosw(8);
- context._add(context.di, (320)-16);
- context._stosw(8);
- context._add(context.di, (320)-16);
- context._stosw(8);
+ _add(di, 4);
+ ax = 0x0dfdf;
+ _stosw(8);
+ _add(di, (320)-16);
+ _stosw(8);
+ _add(di, (320)-16);
+ _stosw(8);
+ _add(di, (320)-16);
+ _stosw(8);
zeroblock:
- context.si = context.pop();
- context.di = context.pop();
- context.cx = context.pop();
- context._add(context.di, 16);
- if (--context.cx)
+ si = pop();
+ di = pop();
+ cx = pop();
+ _add(di, 16);
+ if (--cx)
goto loop124;
- context._add(context.si, (66)-11);
- context.cx = context.pop();
- context.di = context.pop();
- context._add(context.di, (320)*16);
- if (--context.cx)
+ _add(si, (66)-11);
+ cx = pop();
+ di = pop();
+ _add(di, (320)*16);
+ if (--cx)
goto loop120;
}
-void showframe(Context &context) {
- STACK_CHECK(context);
- context.push(context.dx);
- context.push(context.ax);
- context.cx = context.ax;
- context._and(context.cx, 511);
- context._add(context.cx, context.cx);
- context.si = context.cx;
- context._add(context.cx, context.cx);
- context._add(context.si, context.cx);
- context._cmp(context.ds.word(context.si), 0);
- if (!context.flags.z())
+void DreamGenContext::showframe() {
+ STACK_CHECK;
+ push(dx);
+ push(ax);
+ cx = ax;
+ _and(cx, 511);
+ _add(cx, cx);
+ si = cx;
+ _add(cx, cx);
+ _add(si, cx);
+ _cmp(ds.word(si), 0);
+ if (!flags.z())
goto notblankshow;
- context.ax = context.pop();
- context.dx = context.pop();
- context.cx = 0;
+ ax = pop();
+ dx = pop();
+ cx = 0;
return;
notblankshow:
- context._test(context.ah, 128);
- if (!context.flags.z())
+ _test(ah, 128);
+ if (!flags.z())
goto skipoffsets;
- context.al = context.ds.byte(context.si+4);
- context.ah = 0;
- context._add(context.di, context.ax);
- context.al = context.ds.byte(context.si+5);
- context.ah = 0;
- context._add(context.bx, context.ax);
+ al = ds.byte(si+4);
+ ah = 0;
+ _add(di, ax);
+ al = ds.byte(si+5);
+ ah = 0;
+ _add(bx, ax);
skipoffsets:
- context.cx = context.ds.word(context.si+0);
- context.ax = context.ds.word(context.si+2);
- context._add(context.ax, 2080);
- context.si = context.ax;
- context.ax = context.pop();
- context.dx = context.pop();
- context._cmp(context.ah, 0);
- if (context.flags.z())
+ cx = ds.word(si+0);
+ ax = ds.word(si+2);
+ _add(ax, 2080);
+ si = ax;
+ ax = pop();
+ dx = pop();
+ _cmp(ah, 0);
+ if (flags.z())
goto noeffects;
- context._test(context.ah, 128);
- if (context.flags.z())
+ _test(ah, 128);
+ if (flags.z())
goto notcentred;
- context.push(context.ax);
- context.al = context.cl;
- context.ah = 0;
- context._shr(context.ax, 1);
- context._sub(context.di, context.ax);
- context.al = context.ch;
- context.ah = 0;
- context._shr(context.ax, 1);
- context._sub(context.bx, context.ax);
- context.ax = context.pop();
+ push(ax);
+ al = cl;
+ ah = 0;
+ _shr(ax, 1);
+ _sub(di, ax);
+ al = ch;
+ ah = 0;
+ _shr(ax, 1);
+ _sub(bx, ax);
+ ax = pop();
notcentred:
- context._test(context.ah, 64);
- if (context.flags.z())
+ _test(ah, 64);
+ if (flags.z())
goto notdiffdest;
- context.push(context.cx);
- frameoutfx(context);
- context.cx = context.pop();
+ push(cx);
+ frameoutfx();
+ cx = pop();
return;
notdiffdest:
- context._test(context.ah, 8);
- if (context.flags.z())
+ _test(ah, 8);
+ if (flags.z())
goto notprintlist;
- context.push(context.ax);
- context.ax = context.di;
- context._sub(context.ax, context.data.word(kMapadx));
- context.push(context.bx);
- context._sub(context.bx, context.data.word(kMapady));
- context.ah = context.bl;
- context.bx = context.pop();
- context.ax = context.pop();
+ push(ax);
+ ax = di;
+ _sub(ax, data.word(kMapadx));
+ push(bx);
+ _sub(bx, data.word(kMapady));
+ ah = bl;
+ bx = pop();
+ ax = pop();
notprintlist:
- context._test(context.ah, 4);
- if (context.flags.z())
+ _test(ah, 4);
+ if (flags.z())
goto notflippedx;
- context.dx = (320);
- context.es = context.data.word(kWorkspace);
- context.push(context.cx);
- frameoutfx(context);
- context.cx = context.pop();
+ dx = (320);
+ es = data.word(kWorkspace);
+ push(cx);
+ frameoutfx();
+ cx = pop();
return;
notflippedx:
- context._test(context.ah, 2);
- if (context.flags.z())
+ _test(ah, 2);
+ if (flags.z())
goto notnomask;
- context.dx = (320);
- context.es = context.data.word(kWorkspace);
- context.push(context.cx);
- frameoutnm(context);
- context.cx = context.pop();
+ dx = (320);
+ es = data.word(kWorkspace);
+ push(cx);
+ frameoutnm();
+ cx = pop();
return;
notnomask:
- context._test(context.ah, 32);
- if (context.flags.z())
+ _test(ah, 32);
+ if (flags.z())
goto noeffects;
- context.dx = (320);
- context.es = context.data.word(kWorkspace);
- context.push(context.cx);
- frameoutbh(context);
- context.cx = context.pop();
+ dx = (320);
+ es = data.word(kWorkspace);
+ push(cx);
+ frameoutbh();
+ cx = pop();
return;
noeffects:
- context.dx = (320);
- context.es = context.data.word(kWorkspace);
- context.push(context.cx);
- frameoutv(context);
- context.cx = context.pop();
-}
-
-void frameoutv(Context &context) {
- STACK_CHECK(context);
- context.push(context.dx);
- context.ax = context.bx;
- context.bx = context.dx;
- context._mul(context.bx);
- context._add(context.di, context.ax);
- context.dx = context.pop();
- context.push(context.cx);
- context.ch = 0;
- context._sub(context.dx, context.cx);
- context.cx = context.pop();
+ dx = (320);
+ es = data.word(kWorkspace);
+ push(cx);
+ frameoutv();
+ cx = pop();
+}
+
+void DreamGenContext::frameoutv() {
+ STACK_CHECK;
+ push(dx);
+ ax = bx;
+ bx = dx;
+ _mul(bx);
+ _add(di, ax);
+ dx = pop();
+ push(cx);
+ ch = 0;
+ _sub(dx, cx);
+ cx = pop();
frameloop1:
- context.push(context.cx);
- context.ch = 0;
+ push(cx);
+ ch = 0;
frameloop2:
- context._lodsb();
- context._cmp(context.al, 0);
- if (!context.flags.z())
+ _lodsb();
+ _cmp(al, 0);
+ if (!flags.z())
goto backtosolid;
backtoother:
- context._inc(context.di);
- if (--context.cx)
+ _inc(di);
+ if (--cx)
goto frameloop2;
- context.cx = context.pop();
- context._add(context.di, context.dx);
- context._dec(context.ch);
- if (!context.flags.z())
+ cx = pop();
+ _add(di, dx);
+ _dec(ch);
+ if (!flags.z())
goto frameloop1;
return;
frameloop3:
- context._lodsb();
- context._cmp(context.al, 0);
- if (context.flags.z())
+ _lodsb();
+ _cmp(al, 0);
+ if (flags.z())
goto backtoother;
backtosolid:
- context._stosb();
- if (--context.cx)
+ _stosb();
+ if (--cx)
goto frameloop3;
- context.cx = context.pop();
- context._add(context.di, context.dx);
- context._dec(context.ch);
- if (!context.flags.z())
+ cx = pop();
+ _add(di, dx);
+ _dec(ch);
+ if (!flags.z())
goto frameloop1;
}
-void frameoutbh(Context &context) {
- STACK_CHECK(context);
- context.push(context.dx);
- context.ax = context.bx;
- context.bx = context.dx;
- context._mul(context.bx);
- context._add(context.di, context.ax);
- context.dx = context.pop();
- context.push(context.cx);
- context.ch = 0;
- context._sub(context.dx, context.cx);
- context.cx = context.pop();
+void DreamGenContext::frameoutbh() {
+ STACK_CHECK;
+ push(dx);
+ ax = bx;
+ bx = dx;
+ _mul(bx);
+ _add(di, ax);
+ dx = pop();
+ push(cx);
+ ch = 0;
+ _sub(dx, cx);
+ cx = pop();
bhloop2:
- context.push(context.cx);
- context.ch = 0;
- context.ah = 255;
+ push(cx);
+ ch = 0;
+ ah = 255;
bhloop1:
- context._cmp(context.es.byte(context.di), context.ah);
- if (!context.flags.z())
+ _cmp(es.byte(di), ah);
+ if (!flags.z())
goto nofill;
- context._movsb();
- if (--context.cx)
+ _movsb();
+ if (--cx)
goto bhloop1;
goto nextline;
nofill:
- context._inc(context.di);
- context._inc(context.si);
- if (--context.cx)
+ _inc(di);
+ _inc(si);
+ if (--cx)
goto bhloop1;
nextline:
- context._add(context.di, context.dx);
- context.cx = context.pop();
- context._dec(context.ch);
- if (!context.flags.z())
+ _add(di, dx);
+ cx = pop();
+ _dec(ch);
+ if (!flags.z())
goto bhloop2;
}
-void frameoutfx(Context &context) {
- STACK_CHECK(context);
- context.push(context.dx);
- context.ax = context.bx;
- context.bx = context.dx;
- context._mul(context.bx);
- context._add(context.di, context.ax);
- context.dx = context.pop();
- context.push(context.cx);
- context.ch = 0;
- context._add(context.dx, context.cx);
- context.cx = context.pop();
+void DreamGenContext::frameoutfx() {
+ STACK_CHECK;
+ push(dx);
+ ax = bx;
+ bx = dx;
+ _mul(bx);
+ _add(di, ax);
+ dx = pop();
+ push(cx);
+ ch = 0;
+ _add(dx, cx);
+ cx = pop();
frameloopfx1:
- context.push(context.cx);
- context.ch = 0;
+ push(cx);
+ ch = 0;
frameloopfx2:
- context._lodsb();
- context._cmp(context.al, 0);
- if (!context.flags.z())
+ _lodsb();
+ _cmp(al, 0);
+ if (!flags.z())
goto backtosolidfx;
backtootherfx:
- context._dec(context.di);
- if (--context.cx)
+ _dec(di);
+ if (--cx)
goto frameloopfx2;
- context.cx = context.pop();
- context._add(context.di, context.dx);
- context._dec(context.ch);
- if (!context.flags.z())
+ cx = pop();
+ _add(di, dx);
+ _dec(ch);
+ if (!flags.z())
goto frameloopfx1;
return;
frameloopfx3:
- context._lodsb();
- context._cmp(context.al, 0);
- if (context.flags.z())
+ _lodsb();
+ _cmp(al, 0);
+ if (flags.z())
goto backtootherfx;
backtosolidfx:
- context.es.byte(context.di) = context.al;
- context._dec(context.di);
- if (--context.cx)
+ es.byte(di) = al;
+ _dec(di);
+ if (--cx)
goto frameloopfx3;
- context.cx = context.pop();
- context._add(context.di, context.dx);
- context._dec(context.ch);
- if (!context.flags.z())
+ cx = pop();
+ _add(di, dx);
+ _dec(ch);
+ if (!flags.z())
goto frameloopfx1;
}
-void transferinv(Context &context) {
- STACK_CHECK(context);
- context.di = context.data.word(kExframepos);
- context.push(context.di);
- context.al = context.data.byte(kExpos);
- context.ah = 0;
- context.bx = context.ax;
- context._add(context.ax, context.ax);
- context._add(context.ax, context.bx);
- context._inc(context.ax);
- context.cx = 6;
- context._mul(context.cx);
- context.es = context.data.word(kExtras);
- context.bx = (0);
- context._add(context.bx, context.ax);
- context._add(context.di, (0+2080));
- context.push(context.bx);
- context.al = context.data.byte(kItemtotran);
- context.ah = 0;
- context.bx = context.ax;
- context._add(context.ax, context.ax);
- context._add(context.ax, context.bx);
- context._inc(context.ax);
- context.cx = 6;
- context._mul(context.cx);
- context.ds = context.data.word(kFreeframes);
- context.bx = (0);
- context._add(context.bx, context.ax);
- context.si = (0+2080);
- context.al = context.ds.byte(context.bx);
- context.ah = 0;
- context.cl = context.ds.byte(context.bx+1);
- context.ch = 0;
- context._add(context.si, context.ds.word(context.bx+2));
- context.dx = context.ds.word(context.bx+4);
- context.bx = context.pop();
- context.es.byte(context.bx+0) = context.al;
- context.es.byte(context.bx+1) = context.cl;
- context.es.word(context.bx+4) = context.dx;
- context._mul(context.cx);
- context.cx = context.ax;
- context.push(context.cx);
- context._movsb(context.cx);
- context.cx = context.pop();
- context.ax = context.pop();
- context.es.word(context.bx+2) = context.ax;
- context._add(context.data.word(kExframepos), context.cx);
-}
-
-void transfermap(Context &context) {
- STACK_CHECK(context);
- context.di = context.data.word(kExframepos);
- context.push(context.di);
- context.al = context.data.byte(kExpos);
- context.ah = 0;
- context.bx = context.ax;
- context._add(context.ax, context.ax);
- context._add(context.ax, context.bx);
- context.cx = 6;
- context._mul(context.cx);
- context.es = context.data.word(kExtras);
- context.bx = (0);
- context._add(context.bx, context.ax);
- context._add(context.di, (0+2080));
- context.push(context.bx);
- context.al = context.data.byte(kItemtotran);
- context.ah = 0;
- context.bx = context.ax;
- context._add(context.ax, context.ax);
- context._add(context.ax, context.bx);
- context.cx = 6;
- context._mul(context.cx);
- context.ds = context.data.word(kFreeframes);
- context.bx = (0);
- context._add(context.bx, context.ax);
- context.si = (0+2080);
- context.al = context.ds.byte(context.bx);
- context.ah = 0;
- context.cl = context.ds.byte(context.bx+1);
- context.ch = 0;
- context._add(context.si, context.ds.word(context.bx+2));
- context.dx = context.ds.word(context.bx+4);
- context.bx = context.pop();
- context.es.byte(context.bx+0) = context.al;
- context.es.byte(context.bx+1) = context.cl;
- context.es.word(context.bx+4) = context.dx;
- context._mul(context.cx);
- context.cx = context.ax;
- context.push(context.cx);
- context._movsb(context.cx);
- context.cx = context.pop();
- context.ax = context.pop();
- context.es.word(context.bx+2) = context.ax;
- context._add(context.data.word(kExframepos), context.cx);
-}
-
-void dofade(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kFadedirection), 0);
- if (context.flags.z())
- goto finishfade;
- context.cl = context.data.byte(kNumtofade);
- context.ch = 0;
- context.al = context.data.byte(kColourpos);
- context.ah = 0;
- context.ds = context.data.word(kBuffers);
- context.si = (0+(180*10)+32+60+(32*32)+(11*10*3));
- context._add(context.si, context.ax);
- context._add(context.si, context.ax);
- context._add(context.si, context.ax);
- showgroup(context);
- context.al = context.data.byte(kNumtofade);
- context._add(context.al, context.data.byte(kColourpos));
- context.data.byte(kColourpos) = context.al;
- context._cmp(context.al, 0);
- if (!context.flags.z())
- goto finishfade;
- fadecalculation(context);
-finishfade:
- return;
-}
-
-void clearendpal(Context &context) {
- STACK_CHECK(context);
- context.es = context.data.word(kBuffers);
- context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768);
- context.cx = 768;
- context.al = 0;
- context._stosb(context.cx);
-}
-
-void clearpalette(Context &context) {
- STACK_CHECK(context);
- context.data.byte(kFadedirection) = 0;
- clearstartpal(context);
- dumpcurrent(context);
-}
-
-void fadescreenup(Context &context) {
- STACK_CHECK(context);
- clearstartpal(context);
- paltoendpal(context);
- context.data.byte(kFadedirection) = 1;
- context.data.byte(kFadecount) = 63;
- context.data.byte(kColourpos) = 0;
- context.data.byte(kNumtofade) = 128;
-}
-
-void fadetowhite(Context &context) {
- STACK_CHECK(context);
- context.es = context.data.word(kBuffers);
- context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768);
- context.cx = 768;
- context.al = 63;
- context._stosb(context.cx);
- context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768);
- context.al = 0;
- context._stosb(3);
- paltostartpal(context);
- context.data.byte(kFadedirection) = 1;
- context.data.byte(kFadecount) = 63;
- context.data.byte(kColourpos) = 0;
- context.data.byte(kNumtofade) = 128;
-}
-
-void fadefromwhite(Context &context) {
- STACK_CHECK(context);
- context.es = context.data.word(kBuffers);
- context.di = (0+(180*10)+32+60+(32*32)+(11*10*3));
- context.cx = 768;
- context.al = 63;
- context._stosb(context.cx);
- context.di = (0+(180*10)+32+60+(32*32)+(11*10*3));
- context.al = 0;
- context._stosb(3);
- paltoendpal(context);
- context.data.byte(kFadedirection) = 1;
- context.data.byte(kFadecount) = 63;
- context.data.byte(kColourpos) = 0;
- context.data.byte(kNumtofade) = 128;
-}
-
-void fadescreenups(Context &context) {
- STACK_CHECK(context);
- clearstartpal(context);
- paltoendpal(context);
- context.data.byte(kFadedirection) = 1;
- context.data.byte(kFadecount) = 63;
- context.data.byte(kColourpos) = 0;
- context.data.byte(kNumtofade) = 64;
-}
-
-void fadescreendownhalf(Context &context) {
- STACK_CHECK(context);
- paltostartpal(context);
- paltoendpal(context);
- context.cx = 768;
- context.es = context.data.word(kBuffers);
- context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768);
+void DreamGenContext::transferinv() {
+ STACK_CHECK;
+ di = data.word(kExframepos);
+ push(di);
+ al = data.byte(kExpos);
+ ah = 0;
+ bx = ax;
+ _add(ax, ax);
+ _add(ax, bx);
+ _inc(ax);
+ cx = 6;
+ _mul(cx);
+ es = data.word(kExtras);
+ bx = (0);
+ _add(bx, ax);
+ _add(di, (0+2080));
+ push(bx);
+ al = data.byte(kItemtotran);
+ ah = 0;
+ bx = ax;
+ _add(ax, ax);
+ _add(ax, bx);
+ _inc(ax);
+ cx = 6;
+ _mul(cx);
+ ds = data.word(kFreeframes);
+ bx = (0);
+ _add(bx, ax);
+ si = (0+2080);
+ al = ds.byte(bx);
+ ah = 0;
+ cl = ds.byte(bx+1);
+ ch = 0;
+ _add(si, ds.word(bx+2));
+ dx = ds.word(bx+4);
+ bx = pop();
+ es.byte(bx+0) = al;
+ es.byte(bx+1) = cl;
+ es.word(bx+4) = dx;
+ _mul(cx);
+ cx = ax;
+ push(cx);
+ _movsb(cx, true);
+ cx = pop();
+ ax = pop();
+ es.word(bx+2) = ax;
+ _add(data.word(kExframepos), cx);
+}
+
+void DreamGenContext::transfermap() {
+ STACK_CHECK;
+ di = data.word(kExframepos);
+ push(di);
+ al = data.byte(kExpos);
+ ah = 0;
+ bx = ax;
+ _add(ax, ax);
+ _add(ax, bx);
+ cx = 6;
+ _mul(cx);
+ es = data.word(kExtras);
+ bx = (0);
+ _add(bx, ax);
+ _add(di, (0+2080));
+ push(bx);
+ al = data.byte(kItemtotran);
+ ah = 0;
+ bx = ax;
+ _add(ax, ax);
+ _add(ax, bx);
+ cx = 6;
+ _mul(cx);
+ ds = data.word(kFreeframes);
+ bx = (0);
+ _add(bx, ax);
+ si = (0+2080);
+ al = ds.byte(bx);
+ ah = 0;
+ cl = ds.byte(bx+1);
+ ch = 0;
+ _add(si, ds.word(bx+2));
+ dx = ds.word(bx+4);
+ bx = pop();
+ es.byte(bx+0) = al;
+ es.byte(bx+1) = cl;
+ es.word(bx+4) = dx;
+ _mul(cx);
+ cx = ax;
+ push(cx);
+ _movsb(cx, true);
+ cx = pop();
+ ax = pop();
+ es.word(bx+2) = ax;
+ _add(data.word(kExframepos), cx);
+}
+
+void DreamGenContext::dofade() {
+ STACK_CHECK;
+ _cmp(data.byte(kFadedirection), 0);
+ if (flags.z())
+ return /* (finishfade) */;
+ cl = data.byte(kNumtofade);
+ ch = 0;
+ al = data.byte(kColourpos);
+ ah = 0;
+ ds = data.word(kBuffers);
+ si = (0+(180*10)+32+60+(32*32)+(11*10*3));
+ _add(si, ax);
+ _add(si, ax);
+ _add(si, ax);
+ showgroup();
+ al = data.byte(kNumtofade);
+ _add(al, data.byte(kColourpos));
+ data.byte(kColourpos) = al;
+ _cmp(al, 0);
+ if (!flags.z())
+ return /* (finishfade) */;
+ fadecalculation();
+}
+
+void DreamGenContext::clearendpal() {
+ STACK_CHECK;
+ es = data.word(kBuffers);
+ di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768);
+ cx = 768;
+ al = 0;
+ _stosb(cx, true);
+}
+
+void DreamGenContext::clearpalette() {
+ STACK_CHECK;
+ data.byte(kFadedirection) = 0;
+ clearstartpal();
+ dumpcurrent();
+}
+
+void DreamGenContext::fadescreenup() {
+ STACK_CHECK;
+ clearstartpal();
+ paltoendpal();
+ data.byte(kFadedirection) = 1;
+ data.byte(kFadecount) = 63;
+ data.byte(kColourpos) = 0;
+ data.byte(kNumtofade) = 128;
+}
+
+void DreamGenContext::fadetowhite() {
+ STACK_CHECK;
+ es = data.word(kBuffers);
+ di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768);
+ cx = 768;
+ al = 63;
+ _stosb(cx, true);
+ di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768);
+ al = 0;
+ _stosb(3);
+ paltostartpal();
+ data.byte(kFadedirection) = 1;
+ data.byte(kFadecount) = 63;
+ data.byte(kColourpos) = 0;
+ data.byte(kNumtofade) = 128;
+}
+
+void DreamGenContext::fadefromwhite() {
+ STACK_CHECK;
+ es = data.word(kBuffers);
+ di = (0+(180*10)+32+60+(32*32)+(11*10*3));
+ cx = 768;
+ al = 63;
+ _stosb(cx, true);
+ di = (0+(180*10)+32+60+(32*32)+(11*10*3));
+ al = 0;
+ _stosb(3);
+ paltoendpal();
+ data.byte(kFadedirection) = 1;
+ data.byte(kFadecount) = 63;
+ data.byte(kColourpos) = 0;
+ data.byte(kNumtofade) = 128;
+}
+
+void DreamGenContext::fadescreenups() {
+ STACK_CHECK;
+ clearstartpal();
+ paltoendpal();
+ data.byte(kFadedirection) = 1;
+ data.byte(kFadecount) = 63;
+ data.byte(kColourpos) = 0;
+ data.byte(kNumtofade) = 64;
+}
+
+void DreamGenContext::fadescreendownhalf() {
+ STACK_CHECK;
+ paltostartpal();
+ paltoendpal();
+ cx = 768;
+ es = data.word(kBuffers);
+ bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768);
halfend:
- context.al = context.es.byte(context.bx);
- context._shr(context.al, 1);
- context.es.byte(context.bx) = context.al;
- context._inc(context.bx);
- if (--context.cx)
+ al = es.byte(bx);
+ _shr(al, 1);
+ es.byte(bx) = al;
+ _inc(bx);
+ if (--cx)
goto halfend;
- context.ds = context.data.word(kBuffers);
- context.es = context.data.word(kBuffers);
- context.si = (0+(180*10)+32+60+(32*32)+(11*10*3))+(56*3);
- context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768)+(56*3);
- context.cx = 3*5;
- context._movsb(context.cx);
- context.si = (0+(180*10)+32+60+(32*32)+(11*10*3))+(77*3);
- context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768)+(77*3);
- context.cx = 3*2;
- context._movsb(context.cx);
- context.data.byte(kFadedirection) = 1;
- context.data.byte(kFadecount) = 31;
- context.data.byte(kColourpos) = 0;
- context.data.byte(kNumtofade) = 32;
-}
-
-void fadescreenuphalf(Context &context) {
- STACK_CHECK(context);
- endpaltostart(context);
- paltoendpal(context);
- context.data.byte(kFadedirection) = 1;
- context.data.byte(kFadecount) = 31;
- context.data.byte(kColourpos) = 0;
- context.data.byte(kNumtofade) = 32;
-}
-
-void fadescreendown(Context &context) {
- STACK_CHECK(context);
- paltostartpal(context);
- clearendpal(context);
- context.data.byte(kFadedirection) = 1;
- context.data.byte(kFadecount) = 63;
- context.data.byte(kColourpos) = 0;
- context.data.byte(kNumtofade) = 128;
-}
-
-void fadescreendowns(Context &context) {
- STACK_CHECK(context);
- paltostartpal(context);
- clearendpal(context);
- context.data.byte(kFadedirection) = 1;
- context.data.byte(kFadecount) = 63;
- context.data.byte(kColourpos) = 0;
- context.data.byte(kNumtofade) = 64;
-}
-
-void clearstartpal(Context &context) {
- STACK_CHECK(context);
- context.es = context.data.word(kBuffers);
- context.di = (0+(180*10)+32+60+(32*32)+(11*10*3));
- context.cx = 256;
+ ds = data.word(kBuffers);
+ es = data.word(kBuffers);
+ si = (0+(180*10)+32+60+(32*32)+(11*10*3))+(56*3);
+ di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768)+(56*3);
+ cx = 3*5;
+ _movsb(cx, true);
+ si = (0+(180*10)+32+60+(32*32)+(11*10*3))+(77*3);
+ di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768)+(77*3);
+ cx = 3*2;
+ _movsb(cx, true);
+ data.byte(kFadedirection) = 1;
+ data.byte(kFadecount) = 31;
+ data.byte(kColourpos) = 0;
+ data.byte(kNumtofade) = 32;
+}
+
+void DreamGenContext::fadescreenuphalf() {
+ STACK_CHECK;
+ endpaltostart();
+ paltoendpal();
+ data.byte(kFadedirection) = 1;
+ data.byte(kFadecount) = 31;
+ data.byte(kColourpos) = 0;
+ data.byte(kNumtofade) = 32;
+}
+
+void DreamGenContext::fadescreendown() {
+ STACK_CHECK;
+ paltostartpal();
+ clearendpal();
+ data.byte(kFadedirection) = 1;
+ data.byte(kFadecount) = 63;
+ data.byte(kColourpos) = 0;
+ data.byte(kNumtofade) = 128;
+}
+
+void DreamGenContext::fadescreendowns() {
+ STACK_CHECK;
+ paltostartpal();
+ clearendpal();
+ data.byte(kFadedirection) = 1;
+ data.byte(kFadecount) = 63;
+ data.byte(kColourpos) = 0;
+ data.byte(kNumtofade) = 64;
+}
+
+void DreamGenContext::clearstartpal() {
+ STACK_CHECK;
+ es = data.word(kBuffers);
+ di = (0+(180*10)+32+60+(32*32)+(11*10*3));
+ cx = 256;
wholeloop1:
- context.ax = 0;
- context._stosw();
- context.al = 0;
- context._stosb();
- if (--context.cx)
+ ax = 0;
+ _stosw();
+ al = 0;
+ _stosb();
+ if (--cx)
goto wholeloop1;
}
-void showgun(Context &context) {
- STACK_CHECK(context);
- context.data.byte(kAddtored) = 0;
- context.data.byte(kAddtogreen) = 0;
- context.data.byte(kAddtoblue) = 0;
- paltostartpal(context);
- paltoendpal(context);
- greyscalesum(context);
- context.data.byte(kFadedirection) = 1;
- context.data.byte(kFadecount) = 63;
- context.data.byte(kColourpos) = 0;
- context.data.byte(kNumtofade) = 128;
- context.cx = 130;
- hangon(context);
- endpaltostart(context);
- clearendpal(context);
- context.data.byte(kFadedirection) = 1;
- context.data.byte(kFadecount) = 63;
- context.data.byte(kColourpos) = 0;
- context.data.byte(kNumtofade) = 128;
- context.cx = 200;
- hangon(context);
- context.data.byte(kRoomssample) = 34;
- loadroomssample(context);
- context.data.byte(kVolume) = 0;
- context.dx = 2351;
- loadintotemp(context);
- createpanel2(context);
- context.ds = context.data.word(kTempgraphics);
- context.al = 0;
- context.ah = 0;
- context.di = 100;
- context.bx = 4;
- showframe(context);
- context.ds = context.data.word(kTempgraphics);
- context.al = 1;
- context.ah = 0;
- context.di = 158;
- context.bx = 106;
- showframe(context);
- worktoscreen(context);
- getridoftemp(context);
- fadescreenup(context);
- context.cx = 160;
- hangon(context);
- context.al = 12;
- context.ah = 0;
- playchannel0(context);
- context.dx = 2260;
- loadtemptext(context);
- rollendcredits2(context);
- getridoftemptext(context);
-}
-
-void rollendcredits2(Context &context) {
- STACK_CHECK(context);
- rollem(context);
-}
-
-void rollem(Context &context) {
- STACK_CHECK(context);
- context.cl = 160;
- context.ch = 160;
- context.di = 25;
- context.bx = 20;
- context.ds = context.data.word(kMapstore);
- context.si = 0;
- multiget(context);
- context.es = context.data.word(kTextfile1);
- context.si = 49*2;
- context.ax = context.es.word(context.si);
- context.si = context.ax;
- context._add(context.si, (66*2));
- context.cx = 80;
+void DreamGenContext::showgun() {
+ STACK_CHECK;
+ data.byte(kAddtored) = 0;
+ data.byte(kAddtogreen) = 0;
+ data.byte(kAddtoblue) = 0;
+ paltostartpal();
+ paltoendpal();
+ greyscalesum();
+ data.byte(kFadedirection) = 1;
+ data.byte(kFadecount) = 63;
+ data.byte(kColourpos) = 0;
+ data.byte(kNumtofade) = 128;
+ cx = 130;
+ hangon();
+ endpaltostart();
+ clearendpal();
+ data.byte(kFadedirection) = 1;
+ data.byte(kFadecount) = 63;
+ data.byte(kColourpos) = 0;
+ data.byte(kNumtofade) = 128;
+ cx = 200;
+ hangon();
+ data.byte(kRoomssample) = 34;
+ loadroomssample();
+ data.byte(kVolume) = 0;
+ dx = 2351;
+ loadintotemp();
+ createpanel2();
+ ds = data.word(kTempgraphics);
+ al = 0;
+ ah = 0;
+ di = 100;
+ bx = 4;
+ showframe();
+ ds = data.word(kTempgraphics);
+ al = 1;
+ ah = 0;
+ di = 158;
+ bx = 106;
+ showframe();
+ worktoscreen();
+ getridoftemp();
+ fadescreenup();
+ cx = 160;
+ hangon();
+ al = 12;
+ ah = 0;
+ playchannel0();
+ dx = 2260;
+ loadtemptext();
+ rollendcredits2();
+ getridoftemptext();
+}
+
+void DreamGenContext::rollendcredits2() {
+ STACK_CHECK;
+ rollem();
+}
+
+void DreamGenContext::rollem() {
+ STACK_CHECK;
+ cl = 160;
+ ch = 160;
+ di = 25;
+ bx = 20;
+ ds = data.word(kMapstore);
+ si = 0;
+ multiget();
+ es = data.word(kTextfile1);
+ si = 49*2;
+ ax = es.word(si);
+ si = ax;
+ _add(si, (66*2));
+ cx = 80;
endcredits21:
- context.push(context.cx);
- context.bx = 10;
- context.cx = context.data.word(kLinespacing);
+ push(cx);
+ bx = 10;
+ cx = data.word(kLinespacing);
endcredits22:
- context.push(context.cx);
- context.push(context.si);
- context.push(context.di);
- context.push(context.es);
- context.push(context.bx);
- vsync(context);
- context.cl = 160;
- context.ch = 160;
- context.di = 25;
- context.bx = 20;
- context.ds = context.data.word(kMapstore);
- context.si = 0;
- multiput(context);
- vsync(context);
- context.bx = context.pop();
- context.es = context.pop();
- context.di = context.pop();
- context.si = context.pop();
- context.push(context.si);
- context.push(context.di);
- context.push(context.es);
- context.push(context.bx);
- context.cx = 18;
+ push(cx);
+ push(si);
+ push(di);
+ push(es);
+ push(bx);
+ vsync();
+ cl = 160;
+ ch = 160;
+ di = 25;
+ bx = 20;
+ ds = data.word(kMapstore);
+ si = 0;
+ multiput();
+ vsync();
+ bx = pop();
+ es = pop();
+ di = pop();
+ si = pop();
+ push(si);
+ push(di);
+ push(es);
+ push(bx);
+ cx = 18;
onelot2:
- context.push(context.cx);
- context.di = 25;
- context.dx = 161;
- context.ax = 0;
- printdirect(context);
- context._add(context.bx, context.data.word(kLinespacing));
- context.cx = context.pop();
- if (--context.cx)
+ push(cx);
+ di = 25;
+ dx = 161;
+ ax = 0;
+ printdirect();
+ _add(bx, data.word(kLinespacing));
+ cx = pop();
+ if (--cx)
goto onelot2;
- vsync(context);
- context.cl = 160;
- context.ch = 160;
- context.di = 25;
- context.bx = 20;
- multidump(context);
- context.bx = context.pop();
- context.es = context.pop();
- context.di = context.pop();
- context.si = context.pop();
- context.cx = context.pop();
- context._cmp(context.data.byte(kLasthardkey), 1);
- if (context.flags.z())
+ vsync();
+ cl = 160;
+ ch = 160;
+ di = 25;
+ bx = 20;
+ multidump();
+ bx = pop();
+ es = pop();
+ di = pop();
+ si = pop();
+ cx = pop();
+ _cmp(data.byte(kLasthardkey), 1);
+ if (flags.z())
goto endearly2;
- context._dec(context.bx);
- if (--context.cx)
+ _dec(bx);
+ if (--cx)
goto endcredits22;
- context.cx = context.pop();
+ cx = pop();
looknext2:
- context.al = context.es.byte(context.si);
- context._inc(context.si);
- context._cmp(context.al, ':');
- if (context.flags.z())
+ al = es.byte(si);
+ _inc(si);
+ _cmp(al, ':');
+ if (flags.z())
goto gotnext2;
- context._cmp(context.al, 0);
- if (context.flags.z())
+ _cmp(al, 0);
+ if (flags.z())
goto gotnext2;
goto looknext2;
gotnext2:
- context._cmp(context.data.byte(kLasthardkey), 1);
- if (context.flags.z())
- goto endearly;
- if (--context.cx)
+ _cmp(data.byte(kLasthardkey), 1);
+ if (flags.z())
+ return /* (endearly) */;
+ if (--cx)
goto endcredits21;
- context.cx = 120;
- hangone(context);
+ cx = 120;
+ hangone();
return;
endearly2:
- context.cx = context.pop();
-endearly:
- return;
+ cx = pop();
}
-void fadecalculation(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kFadecount), 0);
- if (context.flags.z())
+void DreamGenContext::fadecalculation() {
+ STACK_CHECK;
+ _cmp(data.byte(kFadecount), 0);
+ if (flags.z())
goto nomorefading;
- context.bl = context.data.byte(kFadecount);
- context.es = context.data.word(kBuffers);
- context.si = (0+(180*10)+32+60+(32*32)+(11*10*3));
- context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768);
- context.cx = 768;
+ bl = data.byte(kFadecount);
+ es = data.word(kBuffers);
+ si = (0+(180*10)+32+60+(32*32)+(11*10*3));
+ di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768);
+ cx = 768;
fadecolloop:
- context.al = context.es.byte(context.si);
- context.ah = context.es.byte(context.di);
- context._cmp(context.al, context.ah);
- if (context.flags.z())
+ al = es.byte(si);
+ ah = es.byte(di);
+ _cmp(al, ah);
+ if (flags.z())
goto gotthere;
- if (context.flags.c())
+ if (flags.c())
goto lesscolour;
- context._dec(context.es.byte(context.si));
+ _dec(es.byte(si));
goto gotthere;
lesscolour:
- context._cmp(context.bl, context.ah);
- if (context.flags.z())
+ _cmp(bl, ah);
+ if (flags.z())
goto withit;
- if (!context.flags.c())
+ if (!flags.c())
goto gotthere;
withit:
- context._inc(context.es.byte(context.si));
+ _inc(es.byte(si));
gotthere:
- context._inc(context.si);
- context._inc(context.di);
- if (--context.cx)
+ _inc(si);
+ _inc(di);
+ if (--cx)
goto fadecolloop;
- context._dec(context.data.byte(kFadecount));
+ _dec(data.byte(kFadecount));
return;
nomorefading:
- context.data.byte(kFadedirection) = 0;
+ data.byte(kFadedirection) = 0;
}
-void greyscalesum(Context &context) {
- STACK_CHECK(context);
- context.es = context.data.word(kBuffers);
- context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768);
- context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768);
- context.cx = 256;
+void DreamGenContext::greyscalesum() {
+ STACK_CHECK;
+ es = data.word(kBuffers);
+ si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768);
+ di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768);
+ cx = 256;
greysumloop1:
- context.push(context.cx);
- context.bx = 0;
- context.al = context.es.byte(context.si);
- context.ah = 0;
- context.cx = 20;
- context._mul(context.cx);
- context._add(context.bx, context.ax);
- context.al = context.es.byte(context.si+1);
- context.ah = 0;
- context.cx = 59;
- context._mul(context.cx);
- context._add(context.bx, context.ax);
- context.al = context.es.byte(context.si+2);
- context.ah = 0;
- context.cx = 11;
- context._mul(context.cx);
- context._add(context.bx, context.ax);
- context.al = -1;
+ push(cx);
+ bx = 0;
+ al = es.byte(si);
+ ah = 0;
+ cx = 20;
+ _mul(cx);
+ _add(bx, ax);
+ al = es.byte(si+1);
+ ah = 0;
+ cx = 59;
+ _mul(cx);
+ _add(bx, ax);
+ al = es.byte(si+2);
+ ah = 0;
+ cx = 11;
+ _mul(cx);
+ _add(bx, ax);
+ al = -1;
greysumloop2:
- context._inc(context.al);
- context._sub(context.bx, 100);
- if (!context.flags.c())
+ _inc(al);
+ _sub(bx, 100);
+ if (!flags.c())
goto greysumloop2;
- context.bl = context.al;
- context.al = context.bl;
- context.ah = context.data.byte(kAddtored);
- context._cmp(context.al, 0);
- context._add(context.al, context.ah);
- context._stosb();
- context.ah = context.data.byte(kAddtogreen);
- context.al = context.bl;
- context._cmp(context.al, 0);
- if (context.flags.z())
+ bl = al;
+ al = bl;
+ ah = data.byte(kAddtored);
+ _cmp(al, 0);
+ _add(al, ah);
+ _stosb();
+ ah = data.byte(kAddtogreen);
+ al = bl;
+ _cmp(al, 0);
+ if (flags.z())
goto noaddg;
- context._add(context.al, context.ah);
+ _add(al, ah);
noaddg:
- context._stosb();
- context.ah = context.data.byte(kAddtoblue);
- context.al = context.bl;
- context._cmp(context.al, 0);
- if (context.flags.z())
+ _stosb();
+ ah = data.byte(kAddtoblue);
+ al = bl;
+ _cmp(al, 0);
+ if (flags.z())
goto noaddb;
- context._add(context.al, context.ah);
+ _add(al, ah);
noaddb:
- context._stosb();
- context._add(context.si, 3);
- context.cx = context.pop();
- if (--context.cx)
+ _stosb();
+ _add(si, 3);
+ cx = pop();
+ if (--cx)
goto greysumloop1;
}
-void paltostartpal(Context &context) {
- STACK_CHECK(context);
- context.es = context.data.word(kBuffers);
- context.ds = context.data.word(kBuffers);
- context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768);
- context.di = (0+(180*10)+32+60+(32*32)+(11*10*3));
- context.cx = 768/2;
- context._movsw(context.cx);
-}
-
-void endpaltostart(Context &context) {
- STACK_CHECK(context);
- context.es = context.data.word(kBuffers);
- context.ds = context.data.word(kBuffers);
- context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768);
- context.di = (0+(180*10)+32+60+(32*32)+(11*10*3));
- context.cx = 768/2;
- context._movsw(context.cx);
-}
-
-void startpaltoend(Context &context) {
- STACK_CHECK(context);
- context.es = context.data.word(kBuffers);
- context.ds = context.data.word(kBuffers);
- context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768);
- context.si = (0+(180*10)+32+60+(32*32)+(11*10*3));
- context.cx = 768/2;
- context._movsw(context.cx);
-}
-
-void paltoendpal(Context &context) {
- STACK_CHECK(context);
- context.es = context.data.word(kBuffers);
- context.ds = context.data.word(kBuffers);
- context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768);
- context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768);
- context.cx = 768/2;
- context._movsw(context.cx);
-}
-
-void allpalette(Context &context) {
- STACK_CHECK(context);
- context.es = context.data.word(kBuffers);
- context.ds = context.data.word(kBuffers);
- context.di = (0+(180*10)+32+60+(32*32)+(11*10*3));
- context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768);
- context.cx = 768/2;
- context._movsw(context.cx);
- dumpcurrent(context);
-}
-
-void dumpcurrent(Context &context) {
- STACK_CHECK(context);
- context.si = (0+(180*10)+32+60+(32*32)+(11*10*3));
- context.ds = context.data.word(kBuffers);
- vsync(context);
- context.al = 0;
- context.cx = 128;
- showgroup(context);
- vsync(context);
- context.al = 128;
- context.cx = 128;
- showgroup(context);
-}
-
-void fadedownmon(Context &context) {
- STACK_CHECK(context);
- paltostartpal(context);
- paltoendpal(context);
- context.es = context.data.word(kBuffers);
- context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768)+(231*3);
- context.cx = 3*8;
- context.ax = 0;
- context._stosb(context.cx);
- context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768)+(246*3);
- context._stosb();
- context._stosw();
- context.data.byte(kFadedirection) = 1;
- context.data.byte(kFadecount) = 63;
- context.data.byte(kColourpos) = 0;
- context.data.byte(kNumtofade) = 128;
- context.cx = 64;
- hangon(context);
-}
-
-void fadeupmon(Context &context) {
- STACK_CHECK(context);
- paltostartpal(context);
- paltoendpal(context);
- context.es = context.data.word(kBuffers);
- context.di = (0+(180*10)+32+60+(32*32)+(11*10*3))+(231*3);
- context.cx = 3*8;
- context.ax = 0;
- context._stosb(context.cx);
- context.di = (0+(180*10)+32+60+(32*32)+(11*10*3))+(246*3);
- context._stosb();
- context._stosw();
- context.data.byte(kFadedirection) = 1;
- context.data.byte(kFadecount) = 63;
- context.data.byte(kColourpos) = 0;
- context.data.byte(kNumtofade) = 128;
- context.cx = 128;
- hangon(context);
-}
-
-void fadeupmonfirst(Context &context) {
- STACK_CHECK(context);
- paltostartpal(context);
- paltoendpal(context);
- context.es = context.data.word(kBuffers);
- context.di = (0+(180*10)+32+60+(32*32)+(11*10*3))+(231*3);
- context.cx = 3*8;
- context.ax = 0;
- context._stosb(context.cx);
- context.di = (0+(180*10)+32+60+(32*32)+(11*10*3))+(246*3);
- context._stosb();
- context._stosw();
- context.data.byte(kFadedirection) = 1;
- context.data.byte(kFadecount) = 63;
- context.data.byte(kColourpos) = 0;
- context.data.byte(kNumtofade) = 128;
- context.cx = 64;
- hangon(context);
- context.al = 26;
- playchannel1(context);
- context.cx = 64;
- hangon(context);
-}
-
-void fadeupyellows(Context &context) {
- STACK_CHECK(context);
- paltoendpal(context);
- context.es = context.data.word(kBuffers);
- context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768)+(231*3);
- context.cx = 3*8;
- context.ax = 0;
- context._stosb(context.cx);
- context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768)+(246*3);
- context._stosb();
- context._stosw();
- context.data.byte(kFadedirection) = 1;
- context.data.byte(kFadecount) = 63;
- context.data.byte(kColourpos) = 0;
- context.data.byte(kNumtofade) = 128;
- context.cx = 128;
- hangon(context);
-}
-
-void initialmoncols(Context &context) {
- STACK_CHECK(context);
- paltostartpal(context);
- context.es = context.data.word(kBuffers);
- context.di = (0+(180*10)+32+60+(32*32)+(11*10*3))+(230*3);
- context.cx = 3*9;
- context.ax = 0;
- context._stosb(context.cx);
- context.di = (0+(180*10)+32+60+(32*32)+(11*10*3))+(246*3);
- context._stosb();
- context._stosw();
- context.ds = context.data.word(kBuffers);
- context.si = (0+(180*10)+32+60+(32*32)+(11*10*3))+(230*3);
- context.al = 230;
- context.cx = 18;
- showgroup(context);
-}
-
-void titles(Context &context) {
- STACK_CHECK(context);
- clearpalette(context);
- biblequote(context);
- intro(context);
-}
-
-void endgame(Context &context) {
- STACK_CHECK(context);
- context.dx = 2260;
- loadtemptext(context);
- monkspeaking(context);
- gettingshot(context);
- getridoftemptext(context);
- context.data.byte(kVolumeto) = 7;
- context.data.byte(kVolumedirection) = 1;
- context.cx = 200;
- hangon(context);
-}
-
-void monkspeaking(Context &context) {
- STACK_CHECK(context);
- context.data.byte(kRoomssample) = 35;
- loadroomssample(context);
- context.dx = 2364;
- loadintotemp(context);
- clearwork(context);
- showmonk(context);
- worktoscreen(context);
- context.data.byte(kVolume) = 7;
- context.data.byte(kVolumedirection) = -1;
- context.data.byte(kVolumeto) = 5;
- context.al = 12;
- context.ah = 255;
- playchannel0(context);
- fadescreenups(context);
- context.cx = 300;
- hangon(context);
- context.al = 40;
+void DreamGenContext::paltostartpal() {
+ STACK_CHECK;
+ es = data.word(kBuffers);
+ ds = data.word(kBuffers);
+ si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768);
+ di = (0+(180*10)+32+60+(32*32)+(11*10*3));
+ cx = 768/2;
+ _movsw(cx, true);
+}
+
+void DreamGenContext::endpaltostart() {
+ STACK_CHECK;
+ es = data.word(kBuffers);
+ ds = data.word(kBuffers);
+ si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768);
+ di = (0+(180*10)+32+60+(32*32)+(11*10*3));
+ cx = 768/2;
+ _movsw(cx, true);
+}
+
+void DreamGenContext::startpaltoend() {
+ STACK_CHECK;
+ es = data.word(kBuffers);
+ ds = data.word(kBuffers);
+ di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768);
+ si = (0+(180*10)+32+60+(32*32)+(11*10*3));
+ cx = 768/2;
+ _movsw(cx, true);
+}
+
+void DreamGenContext::paltoendpal() {
+ STACK_CHECK;
+ es = data.word(kBuffers);
+ ds = data.word(kBuffers);
+ di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768);
+ si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768);
+ cx = 768/2;
+ _movsw(cx, true);
+}
+
+void DreamGenContext::allpalette() {
+ STACK_CHECK;
+ es = data.word(kBuffers);
+ ds = data.word(kBuffers);
+ di = (0+(180*10)+32+60+(32*32)+(11*10*3));
+ si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768);
+ cx = 768/2;
+ _movsw(cx, true);
+ dumpcurrent();
+}
+
+void DreamGenContext::dumpcurrent() {
+ STACK_CHECK;
+ si = (0+(180*10)+32+60+(32*32)+(11*10*3));
+ ds = data.word(kBuffers);
+ vsync();
+ al = 0;
+ cx = 128;
+ showgroup();
+ vsync();
+ al = 128;
+ cx = 128;
+ showgroup();
+}
+
+void DreamGenContext::fadedownmon() {
+ STACK_CHECK;
+ paltostartpal();
+ paltoendpal();
+ es = data.word(kBuffers);
+ di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768)+(231*3);
+ cx = 3*8;
+ ax = 0;
+ _stosb(cx, true);
+ di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768)+(246*3);
+ _stosb();
+ _stosw();
+ data.byte(kFadedirection) = 1;
+ data.byte(kFadecount) = 63;
+ data.byte(kColourpos) = 0;
+ data.byte(kNumtofade) = 128;
+ cx = 64;
+ hangon();
+}
+
+void DreamGenContext::fadeupmon() {
+ STACK_CHECK;
+ paltostartpal();
+ paltoendpal();
+ es = data.word(kBuffers);
+ di = (0+(180*10)+32+60+(32*32)+(11*10*3))+(231*3);
+ cx = 3*8;
+ ax = 0;
+ _stosb(cx, true);
+ di = (0+(180*10)+32+60+(32*32)+(11*10*3))+(246*3);
+ _stosb();
+ _stosw();
+ data.byte(kFadedirection) = 1;
+ data.byte(kFadecount) = 63;
+ data.byte(kColourpos) = 0;
+ data.byte(kNumtofade) = 128;
+ cx = 128;
+ hangon();
+}
+
+void DreamGenContext::fadeupmonfirst() {
+ STACK_CHECK;
+ paltostartpal();
+ paltoendpal();
+ es = data.word(kBuffers);
+ di = (0+(180*10)+32+60+(32*32)+(11*10*3))+(231*3);
+ cx = 3*8;
+ ax = 0;
+ _stosb(cx, true);
+ di = (0+(180*10)+32+60+(32*32)+(11*10*3))+(246*3);
+ _stosb();
+ _stosw();
+ data.byte(kFadedirection) = 1;
+ data.byte(kFadecount) = 63;
+ data.byte(kColourpos) = 0;
+ data.byte(kNumtofade) = 128;
+ cx = 64;
+ hangon();
+ al = 26;
+ playchannel1();
+ cx = 64;
+ hangon();
+}
+
+void DreamGenContext::fadeupyellows() {
+ STACK_CHECK;
+ paltoendpal();
+ es = data.word(kBuffers);
+ di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768)+(231*3);
+ cx = 3*8;
+ ax = 0;
+ _stosb(cx, true);
+ di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768)+(246*3);
+ _stosb();
+ _stosw();
+ data.byte(kFadedirection) = 1;
+ data.byte(kFadecount) = 63;
+ data.byte(kColourpos) = 0;
+ data.byte(kNumtofade) = 128;
+ cx = 128;
+ hangon();
+}
+
+void DreamGenContext::initialmoncols() {
+ STACK_CHECK;
+ paltostartpal();
+ es = data.word(kBuffers);
+ di = (0+(180*10)+32+60+(32*32)+(11*10*3))+(230*3);
+ cx = 3*9;
+ ax = 0;
+ _stosb(cx, true);
+ di = (0+(180*10)+32+60+(32*32)+(11*10*3))+(246*3);
+ _stosb();
+ _stosw();
+ ds = data.word(kBuffers);
+ si = (0+(180*10)+32+60+(32*32)+(11*10*3))+(230*3);
+ al = 230;
+ cx = 18;
+ showgroup();
+}
+
+void DreamGenContext::titles() {
+ STACK_CHECK;
+ clearpalette();
+ biblequote();
+ _cmp(data.byte(kQuitrequested), 0);
+ if (!flags.z())
+ return /* (titlesearly) */;
+ intro();
+}
+
+void DreamGenContext::endgame() {
+ STACK_CHECK;
+ dx = 2260;
+ loadtemptext();
+ monkspeaking();
+ gettingshot();
+ getridoftemptext();
+ data.byte(kVolumeto) = 7;
+ data.byte(kVolumedirection) = 1;
+ cx = 200;
+ hangon();
+}
+
+void DreamGenContext::monkspeaking() {
+ STACK_CHECK;
+ data.byte(kRoomssample) = 35;
+ loadroomssample();
+ dx = 2364;
+ loadintotemp();
+ clearwork();
+ showmonk();
+ worktoscreen();
+ data.byte(kVolume) = 7;
+ data.byte(kVolumedirection) = -1;
+ data.byte(kVolumeto) = 5;
+ al = 12;
+ ah = 255;
+ playchannel0();
+ fadescreenups();
+ cx = 300;
+ hangon();
+ al = 40;
loadspeech2:
- context.push(context.ax);
- context.dl = 'T';
- context.dh = 83;
- context.cl = 'T';
- context.ah = 0;
- loadspeech(context);
- context.al = 50+12;
- playchannel1(context);
+ push(ax);
+ dl = 'T';
+ dh = 83;
+ cl = 'T';
+ ah = 0;
+ loadspeech();
+ al = 50+12;
+ playchannel1();
notloadspeech2:
- vsync(context);
- context._cmp(context.data.byte(kCh1playing), 255);
- if (!context.flags.z())
+ vsync();
+ _cmp(data.byte(kCh1playing), 255);
+ if (!flags.z())
goto notloadspeech2;
- context.ax = context.pop();
- context._inc(context.al);
- context._cmp(context.al, 48);
- if (!context.flags.z())
+ ax = pop();
+ _inc(al);
+ _cmp(al, 48);
+ if (!flags.z())
goto loadspeech2;
- context.data.byte(kVolumedirection) = 1;
- context.data.byte(kVolumeto) = 7;
- fadescreendowns(context);
- context.cx = 300;
- hangon(context);
- getridoftemp(context);
-}
-
-void showmonk(Context &context) {
- STACK_CHECK(context);
- context.al = 0;
- context.ah = 128;
- context.di = 160;
- context.bx = 72;
- context.ds = context.data.word(kTempgraphics);
- showframe(context);
-}
-
-void gettingshot(Context &context) {
- STACK_CHECK(context);
- context.data.byte(kNewlocation) = 55;
- clearpalette(context);
- loadintroroom(context);
- fadescreenups(context);
- context.data.byte(kVolumeto) = 0;
- context.data.byte(kVolumedirection) = -1;
- runendseq(context);
- clearbeforeload(context);
-}
-
-void credits(Context &context) {
- STACK_CHECK(context);
- clearpalette(context);
- realcredits(context);
-}
-
-void biblequote(Context &context) {
- STACK_CHECK(context);
- mode640x480(context);
- context.dx = 2377;
- showpcx(context);
- fadescreenups(context);
- context.cx = 80;
- hangone(context);
- context._cmp(context.data.byte(kLasthardkey), 1);
- if (context.flags.z())
+ data.byte(kVolumedirection) = 1;
+ data.byte(kVolumeto) = 7;
+ fadescreendowns();
+ cx = 300;
+ hangon();
+ getridoftemp();
+}
+
+void DreamGenContext::showmonk() {
+ STACK_CHECK;
+ al = 0;
+ ah = 128;
+ di = 160;
+ bx = 72;
+ ds = data.word(kTempgraphics);
+ showframe();
+}
+
+void DreamGenContext::gettingshot() {
+ STACK_CHECK;
+ data.byte(kNewlocation) = 55;
+ clearpalette();
+ loadintroroom();
+ fadescreenups();
+ data.byte(kVolumeto) = 0;
+ data.byte(kVolumedirection) = -1;
+ runendseq();
+ clearbeforeload();
+}
+
+void DreamGenContext::credits() {
+ STACK_CHECK;
+ clearpalette();
+ realcredits();
+}
+
+void DreamGenContext::biblequote() {
+ STACK_CHECK;
+ mode640x480();
+ dx = 2377;
+ showpcx();
+ fadescreenups();
+ cx = 80;
+ hangone();
+ _cmp(data.byte(kLasthardkey), 1);
+ if (flags.z())
goto biblequotearly;
- context.cx = 560;
- hangone(context);
- context._cmp(context.data.byte(kLasthardkey), 1);
- if (context.flags.z())
+ cx = 560;
+ hangone();
+ _cmp(data.byte(kLasthardkey), 1);
+ if (flags.z())
goto biblequotearly;
- fadescreendowns(context);
- context.cx = 200;
- hangone(context);
- context._cmp(context.data.byte(kLasthardkey), 1);
- if (context.flags.z())
+ fadescreendowns();
+ cx = 200;
+ hangone();
+ _cmp(data.byte(kLasthardkey), 1);
+ if (flags.z())
goto biblequotearly;
- cancelch0(context);
+ cancelch0();
biblequotearly:
- context.data.byte(kLasthardkey) = 0;
+ data.byte(kLasthardkey) = 0;
}
-void hangone(Context &context) {
- STACK_CHECK(context);
+void DreamGenContext::hangone() {
+ STACK_CHECK;
hangonloope:
- context.push(context.cx);
- vsync(context);
- context.cx = context.pop();
- context._cmp(context.data.byte(kLasthardkey), 1);
- if (context.flags.z())
- goto hangonearly;
- if (--context.cx)
+ push(cx);
+ vsync();
+ cx = pop();
+ _cmp(data.byte(kLasthardkey), 1);
+ if (flags.z())
+ return /* (hangonearly) */;
+ if (--cx)
goto hangonloope;
-hangonearly:
- return;
-}
-
-void intro(Context &context) {
- STACK_CHECK(context);
- context.dx = 2247;
- loadtemptext(context);
- loadpalfromiff(context);
- setmode(context);
- context.data.byte(kNewlocation) = 50;
- clearpalette(context);
- loadintroroom(context);
- context.data.byte(kVolume) = 7;
- context.data.byte(kVolumedirection) = -1;
- context.data.byte(kVolumeto) = 4;
- context.al = 12;
- context.ah = 255;
- playchannel0(context);
- fadescreenups(context);
- runintroseq(context);
- context._cmp(context.data.byte(kLasthardkey), 1);
- if (context.flags.z())
+}
+
+void DreamGenContext::intro() {
+ STACK_CHECK;
+ dx = 2247;
+ loadtemptext();
+ loadpalfromiff();
+ setmode();
+ data.byte(kNewlocation) = 50;
+ clearpalette();
+ loadintroroom();
+ data.byte(kVolume) = 7;
+ data.byte(kVolumedirection) = -1;
+ data.byte(kVolumeto) = 4;
+ al = 12;
+ ah = 255;
+ playchannel0();
+ fadescreenups();
+ runintroseq();
+ _cmp(data.byte(kLasthardkey), 1);
+ if (flags.z())
goto introearly;
- clearbeforeload(context);
- context.data.byte(kNewlocation) = 52;
- loadintroroom(context);
- runintroseq(context);
- context._cmp(context.data.byte(kLasthardkey), 1);
- if (context.flags.z())
+ clearbeforeload();
+ data.byte(kNewlocation) = 52;
+ loadintroroom();
+ runintroseq();
+ _cmp(data.byte(kLasthardkey), 1);
+ if (flags.z())
goto introearly;
- clearbeforeload(context);
- context.data.byte(kNewlocation) = 53;
- loadintroroom(context);
- runintroseq(context);
- context._cmp(context.data.byte(kLasthardkey), 1);
- if (context.flags.z())
+ clearbeforeload();
+ data.byte(kNewlocation) = 53;
+ loadintroroom();
+ runintroseq();
+ _cmp(data.byte(kLasthardkey), 1);
+ if (flags.z())
goto introearly;
- clearbeforeload(context);
- allpalette(context);
- context.data.byte(kNewlocation) = 54;
- loadintroroom(context);
- runintroseq(context);
- context._cmp(context.data.byte(kLasthardkey), 1);
- if (context.flags.z())
+ clearbeforeload();
+ allpalette();
+ data.byte(kNewlocation) = 54;
+ loadintroroom();
+ runintroseq();
+ _cmp(data.byte(kLasthardkey), 1);
+ if (flags.z())
goto introearly;
- getridoftemptext(context);
- clearbeforeload(context);
+ getridoftemptext();
+ clearbeforeload();
introearly:
- context.data.byte(kLasthardkey) = 0;
+ data.byte(kLasthardkey) = 0;
}
-void runintroseq(Context &context) {
- STACK_CHECK(context);
- context.data.byte(kGetback) = 0;
+void DreamGenContext::runintroseq() {
+ STACK_CHECK;
+ data.byte(kGetback) = 0;
moreintroseq:
- vsync(context);
- context._cmp(context.data.byte(kLasthardkey), 1);
- if (context.flags.z())
+ vsync();
+ _cmp(data.byte(kLasthardkey), 1);
+ if (flags.z())
goto earlyendrun;
- spriteupdate(context);
- vsync(context);
- context._cmp(context.data.byte(kLasthardkey), 1);
- if (context.flags.z())
+ spriteupdate();
+ vsync();
+ _cmp(data.byte(kLasthardkey), 1);
+ if (flags.z())
goto earlyendrun;
- deleverything(context);
- printsprites(context);
- reelsonscreen(context);
- afterintroroom(context);
- usetimedtext(context);
- vsync(context);
- context._cmp(context.data.byte(kLasthardkey), 1);
- if (context.flags.z())
+ deleverything();
+ printsprites();
+ reelsonscreen();
+ afterintroroom();
+ usetimedtext();
+ vsync();
+ _cmp(data.byte(kLasthardkey), 1);
+ if (flags.z())
goto earlyendrun;
- dumpmap(context);
- dumptimedtext(context);
- vsync(context);
- context._cmp(context.data.byte(kLasthardkey), 1);
- if (context.flags.z())
+ dumpmap();
+ dumptimedtext();
+ vsync();
+ _cmp(data.byte(kLasthardkey), 1);
+ if (flags.z())
goto earlyendrun;
- context._cmp(context.data.byte(kGetback), 1);
- if (!context.flags.z())
+ _cmp(data.byte(kGetback), 1);
+ if (!flags.z())
goto moreintroseq;
return;
earlyendrun:
- getridoftemptext(context);
- clearbeforeload(context);
+ getridoftemptext();
+ clearbeforeload();
}
-void runendseq(Context &context) {
- STACK_CHECK(context);
- atmospheres(context);
- context.data.byte(kGetback) = 0;
+void DreamGenContext::runendseq() {
+ STACK_CHECK;
+ atmospheres();
+ data.byte(kGetback) = 0;
moreendseq:
- vsync(context);
- spriteupdate(context);
- vsync(context);
- deleverything(context);
- printsprites(context);
- reelsonscreen(context);
- afterintroroom(context);
- usetimedtext(context);
- vsync(context);
- dumpmap(context);
- dumptimedtext(context);
- vsync(context);
- context._cmp(context.data.byte(kGetback), 1);
- if (!context.flags.z())
+ vsync();
+ spriteupdate();
+ vsync();
+ deleverything();
+ printsprites();
+ reelsonscreen();
+ afterintroroom();
+ usetimedtext();
+ vsync();
+ dumpmap();
+ dumptimedtext();
+ vsync();
+ _cmp(data.byte(kGetback), 1);
+ if (!flags.z())
goto moreendseq;
}
-void loadintroroom(Context &context) {
- STACK_CHECK(context);
- context.data.byte(kIntrocount) = 0;
- context.data.byte(kLocation) = 255;
- loadroom(context);
- context.data.word(kMapoffsetx) = 72;
- context.data.word(kMapoffsety) = 16;
- clearsprites(context);
- context.data.byte(kThroughdoor) = 0;
- context.data.byte(kCurrentkey) = '0';
- context.data.byte(kMainmode) = 0;
- clearwork(context);
- context.data.byte(kNewobs) = 1;
- drawfloor(context);
- reelsonscreen(context);
- spriteupdate(context);
- printsprites(context);
- worktoscreen(context);
-}
-
-void realcredits(Context &context) {
- STACK_CHECK(context);
- context.data.byte(kRoomssample) = 33;
- loadroomssample(context);
- context.data.byte(kVolume) = 0;
- mode640x480(context);
- context.cx = 35;
- hangon(context);
- context.dx = 2390;
- showpcx(context);
- context.al = 12;
- context.ah = 0;
- playchannel0(context);
- context.cx = 2;
- hangone(context);
- context._cmp(context.data.byte(kLasthardkey), 1);
- if (context.flags.z())
+void DreamGenContext::loadintroroom() {
+ STACK_CHECK;
+ data.byte(kIntrocount) = 0;
+ data.byte(kLocation) = 255;
+ loadroom();
+ data.word(kMapoffsetx) = 72;
+ data.word(kMapoffsety) = 16;
+ clearsprites();
+ data.byte(kThroughdoor) = 0;
+ data.byte(kCurrentkey) = '0';
+ data.byte(kMainmode) = 0;
+ clearwork();
+ data.byte(kNewobs) = 1;
+ drawfloor();
+ reelsonscreen();
+ spriteupdate();
+ printsprites();
+ worktoscreen();
+}
+
+void DreamGenContext::realcredits() {
+ STACK_CHECK;
+ data.byte(kRoomssample) = 33;
+ loadroomssample();
+ data.byte(kVolume) = 0;
+ mode640x480();
+ cx = 35;
+ hangon();
+ dx = 2390;
+ showpcx();
+ al = 12;
+ ah = 0;
+ playchannel0();
+ cx = 2;
+ hangone();
+ _cmp(data.byte(kLasthardkey), 1);
+ if (flags.z())
goto realcreditsearly;
- allpalette(context);
- context.cx = 80;
- hangone(context);
- context._cmp(context.data.byte(kLasthardkey), 1);
- if (context.flags.z())
+ allpalette();
+ cx = 80;
+ hangone();
+ _cmp(data.byte(kLasthardkey), 1);
+ if (flags.z())
goto realcreditsearly;
- fadescreendowns(context);
- context.cx = 256;
- hangone(context);
- context._cmp(context.data.byte(kLasthardkey), 1);
- if (context.flags.z())
+ fadescreendowns();
+ cx = 256;
+ hangone();
+ _cmp(data.byte(kLasthardkey), 1);
+ if (flags.z())
goto realcreditsearly;
- context.dx = 2403;
- showpcx(context);
- context.al = 12;
- context.ah = 0;
- playchannel0(context);
- context.cx = 2;
- hangone(context);
- context._cmp(context.data.byte(kLasthardkey), 1);
- if (context.flags.z())
+ dx = 2403;
+ showpcx();
+ al = 12;
+ ah = 0;
+ playchannel0();
+ cx = 2;
+ hangone();
+ _cmp(data.byte(kLasthardkey), 1);
+ if (flags.z())
goto realcreditsearly;
- allpalette(context);
- context.cx = 80;
- hangone(context);
- context._cmp(context.data.byte(kLasthardkey), 1);
- if (context.flags.z())
+ allpalette();
+ cx = 80;
+ hangone();
+ _cmp(data.byte(kLasthardkey), 1);
+ if (flags.z())
goto realcreditsearly;
- fadescreendowns(context);
- context.cx = 256;
- hangone(context);
- context._cmp(context.data.byte(kLasthardkey), 1);
- if (context.flags.z())
+ fadescreendowns();
+ cx = 256;
+ hangone();
+ _cmp(data.byte(kLasthardkey), 1);
+ if (flags.z())
goto realcreditsearly;
- context.dx = 2416;
- showpcx(context);
- context.al = 12;
- context.ah = 0;
- playchannel0(context);
- context.cx = 2;
- hangone(context);
- context._cmp(context.data.byte(kLasthardkey), 1);
- if (context.flags.z())
+ dx = 2416;
+ showpcx();
+ al = 12;
+ ah = 0;
+ playchannel0();
+ cx = 2;
+ hangone();
+ _cmp(data.byte(kLasthardkey), 1);
+ if (flags.z())
goto realcreditsearly;
- allpalette(context);
- context.cx = 80;
- hangone(context);
- context._cmp(context.data.byte(kLasthardkey), 1);
- if (context.flags.z())
+ allpalette();
+ cx = 80;
+ hangone();
+ _cmp(data.byte(kLasthardkey), 1);
+ if (flags.z())
goto realcreditsearly;
- fadescreendowns(context);
- context.cx = 256;
- hangone(context);
- context._cmp(context.data.byte(kLasthardkey), 1);
- if (context.flags.z())
+ fadescreendowns();
+ cx = 256;
+ hangone();
+ _cmp(data.byte(kLasthardkey), 1);
+ if (flags.z())
goto realcreditsearly;
- context.dx = 2429;
- showpcx(context);
- context.al = 12;
- context.ah = 0;
- playchannel0(context);
- context.cx = 2;
- hangone(context);
- context._cmp(context.data.byte(kLasthardkey), 1);
- if (context.flags.z())
+ dx = 2429;
+ showpcx();
+ al = 12;
+ ah = 0;
+ playchannel0();
+ cx = 2;
+ hangone();
+ _cmp(data.byte(kLasthardkey), 1);
+ if (flags.z())
goto realcreditsearly;
- allpalette(context);
- context.cx = 80;
- hangone(context);
- context._cmp(context.data.byte(kLasthardkey), 1);
- if (context.flags.z())
+ allpalette();
+ cx = 80;
+ hangone();
+ _cmp(data.byte(kLasthardkey), 1);
+ if (flags.z())
goto realcreditsearly;
- fadescreendowns(context);
- context.cx = 256;
- hangone(context);
- context._cmp(context.data.byte(kLasthardkey), 1);
- if (context.flags.z())
+ fadescreendowns();
+ cx = 256;
+ hangone();
+ _cmp(data.byte(kLasthardkey), 1);
+ if (flags.z())
goto realcreditsearly;
- context.dx = 2442;
- showpcx(context);
- context.al = 12;
- context.ah = 0;
- playchannel0(context);
- context.cx = 2;
- hangone(context);
- context._cmp(context.data.byte(kLasthardkey), 1);
- if (context.flags.z())
+ dx = 2442;
+ showpcx();
+ al = 12;
+ ah = 0;
+ playchannel0();
+ cx = 2;
+ hangone();
+ _cmp(data.byte(kLasthardkey), 1);
+ if (flags.z())
goto realcreditsearly;
- allpalette(context);
- context.cx = 80;
- hangone(context);
- context._cmp(context.data.byte(kLasthardkey), 1);
- if (context.flags.z())
+ allpalette();
+ cx = 80;
+ hangone();
+ _cmp(data.byte(kLasthardkey), 1);
+ if (flags.z())
goto realcreditsearly;
- fadescreendowns(context);
- context.cx = 256;
- hangone(context);
- context._cmp(context.data.byte(kLasthardkey), 1);
- if (context.flags.z())
+ fadescreendowns();
+ cx = 256;
+ hangone();
+ _cmp(data.byte(kLasthardkey), 1);
+ if (flags.z())
goto realcreditsearly;
- context.dx = 2455;
- showpcx(context);
- fadescreenups(context);
- context.cx = 60;
- hangone(context);
- context._cmp(context.data.byte(kLasthardkey), 1);
- if (context.flags.z())
+ dx = 2455;
+ showpcx();
+ fadescreenups();
+ cx = 60;
+ hangone();
+ _cmp(data.byte(kLasthardkey), 1);
+ if (flags.z())
goto realcreditsearly;
- context.al = 13;
- context.ah = 0;
- playchannel0(context);
- context.cx = 350;
- hangone(context);
- context._cmp(context.data.byte(kLasthardkey), 1);
- if (context.flags.z())
+ al = 13;
+ ah = 0;
+ playchannel0();
+ cx = 350;
+ hangone();
+ _cmp(data.byte(kLasthardkey), 1);
+ if (flags.z())
goto realcreditsearly;
- fadescreendowns(context);
- context.cx = 256;
- hangone(context);
+ fadescreendowns();
+ cx = 256;
+ hangone();
realcreditsearly:
- context.data.byte(kLasthardkey) = 0;
-}
-
-void printchar(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.al, 255);
- if (context.flags.z())
- goto ignoreit;
- context.push(context.si);
- context.push(context.bx);
- context.push(context.di);
- context.push(context.ax);
- context._sub(context.al, 32);
- context.ah = 0;
- context._add(context.ax, context.data.word(kCharshift));
- showframe(context);
- context.ax = context.pop();
- context.di = context.pop();
- context.bx = context.pop();
- context.si = context.pop();
- context._cmp(context.data.byte(kKerning), 0);
- if (!context.flags.z())
+ data.byte(kLasthardkey) = 0;
+}
+
+void DreamGenContext::printchar() {
+ STACK_CHECK;
+ _cmp(al, 255);
+ if (flags.z())
+ return /* (ignoreit) */;
+ push(si);
+ push(bx);
+ push(di);
+ push(ax);
+ _sub(al, 32);
+ ah = 0;
+ _add(ax, data.word(kCharshift));
+ showframe();
+ ax = pop();
+ di = pop();
+ bx = pop();
+ si = pop();
+ _cmp(data.byte(kKerning), 0);
+ if (!flags.z())
goto nokern;
- kernchars(context);
+ kernchars();
nokern:
- context.push(context.cx);
- context.ch = 0;
- context._add(context.di, context.cx);
- context.cx = context.pop();
-ignoreit:
- return;
+ push(cx);
+ ch = 0;
+ _add(di, cx);
+ cx = pop();
}
-void kernchars(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.al, 'a');
- if (context.flags.z())
+void DreamGenContext::kernchars() {
+ STACK_CHECK;
+ _cmp(al, 'a');
+ if (flags.z())
goto iskern;
- context._cmp(context.al, 'u');
- if (context.flags.z())
+ _cmp(al, 'u');
+ if (flags.z())
goto iskern;
return;
iskern:
- context._cmp(context.ah, 'n');
- if (context.flags.z())
+ _cmp(ah, 'n');
+ if (flags.z())
goto kernit;
- context._cmp(context.ah, 't');
- if (context.flags.z())
+ _cmp(ah, 't');
+ if (flags.z())
goto kernit;
- context._cmp(context.ah, 'r');
- if (context.flags.z())
+ _cmp(ah, 'r');
+ if (flags.z())
goto kernit;
- context._cmp(context.ah, 'i');
- if (context.flags.z())
+ _cmp(ah, 'i');
+ if (flags.z())
goto kernit;
- context._cmp(context.ah, 'l');
- if (context.flags.z())
+ _cmp(ah, 'l');
+ if (flags.z())
goto kernit;
return;
kernit:
- context._dec(context.cl);
+ _dec(cl);
}
-void printslow(Context &context) {
- STACK_CHECK(context);
- context.data.byte(kPointerframe) = 1;
- context.data.byte(kPointermode) = 3;
- context.ds = context.data.word(kCharset1);
+void DreamGenContext::printslow() {
+ STACK_CHECK;
+ data.byte(kPointerframe) = 1;
+ data.byte(kPointermode) = 3;
+ ds = data.word(kCharset1);
printloopslow6:
- context.push(context.bx);
- context.push(context.di);
- context.push(context.dx);
- getnumber(context);
- context.ch = 0;
+ push(bx);
+ push(di);
+ push(dx);
+ getnumber();
+ ch = 0;
printloopslow5:
- context.push(context.cx);
- context.push(context.si);
- context.push(context.es);
- context.ax = context.es.word(context.si);
- context.push(context.bx);
- context.push(context.cx);
- context.push(context.es);
- context.push(context.si);
- context.push(context.ds);
- printboth(context);
- context.ds = context.pop();
- context.si = context.pop();
- context.es = context.pop();
- context.cx = context.pop();
- context.bx = context.pop();
- context.ax = context.es.word(context.si+1);
- context._inc(context.si);
- context._cmp(context.al, 0);
- if (context.flags.z())
+ push(cx);
+ push(si);
+ push(es);
+ ax = es.word(si);
+ push(bx);
+ push(cx);
+ push(es);
+ push(si);
+ push(ds);
+ printboth();
+ ds = pop();
+ si = pop();
+ es = pop();
+ cx = pop();
+ bx = pop();
+ ax = es.word(si+1);
+ _inc(si);
+ _cmp(al, 0);
+ if (flags.z())
goto finishslow;
- context._cmp(context.al, ':');
- if (context.flags.z())
+ _cmp(al, ':');
+ if (flags.z())
goto finishslow;
- context._cmp(context.cl, 1);
- if (context.flags.z())
+ _cmp(cl, 1);
+ if (flags.z())
goto afterslow;
- context.push(context.di);
- context.push(context.ds);
- context.push(context.bx);
- context.push(context.cx);
- context.push(context.es);
- context.push(context.si);
- context.data.word(kCharshift) = 91;
- printboth(context);
- context.data.word(kCharshift) = 0;
- context.si = context.pop();
- context.es = context.pop();
- context.cx = context.pop();
- context.bx = context.pop();
- context.ds = context.pop();
- context.di = context.pop();
- waitframes(context);
- context._cmp(context.ax, 0);
- if (context.flags.z())
+ push(di);
+ push(ds);
+ push(bx);
+ push(cx);
+ push(es);
+ push(si);
+ data.word(kCharshift) = 91;
+ printboth();
+ data.word(kCharshift) = 0;
+ si = pop();
+ es = pop();
+ cx = pop();
+ bx = pop();
+ ds = pop();
+ di = pop();
+ waitframes();
+ _cmp(ax, 0);
+ if (flags.z())
goto keepgoing;
- context._cmp(context.ax, context.data.word(kOldbutton));
- if (!context.flags.z())
+ _cmp(ax, data.word(kOldbutton));
+ if (!flags.z())
goto finishslow2;
keepgoing:
- waitframes(context);
- context._cmp(context.ax, 0);
- if (context.flags.z())
+ waitframes();
+ _cmp(ax, 0);
+ if (flags.z())
goto afterslow;
- context._cmp(context.ax, context.data.word(kOldbutton));
- if (!context.flags.z())
+ _cmp(ax, data.word(kOldbutton));
+ if (!flags.z())
goto finishslow2;
afterslow:
- context.es = context.pop();
- context.si = context.pop();
- context.cx = context.pop();
- context._inc(context.si);
- if (--context.cx)
+ es = pop();
+ si = pop();
+ cx = pop();
+ _inc(si);
+ if (--cx)
goto printloopslow5;
- context.dx = context.pop();
- context.di = context.pop();
- context.bx = context.pop();
- context._add(context.bx, 10);
+ dx = pop();
+ di = pop();
+ bx = pop();
+ _add(bx, 10);
goto printloopslow6;
finishslow:
- context.es = context.pop();
- context.si = context.pop();
- context.cx = context.pop();
- context.dx = context.pop();
- context.di = context.pop();
- context.bx = context.pop();
- context.al = 0;
+ es = pop();
+ si = pop();
+ cx = pop();
+ dx = pop();
+ di = pop();
+ bx = pop();
+ al = 0;
return;
finishslow2:
- context.es = context.pop();
- context.si = context.pop();
- context.cx = context.pop();
- context.dx = context.pop();
- context.di = context.pop();
- context.bx = context.pop();
- context.al = 1;
-}
-
-void waitframes(Context &context) {
- STACK_CHECK(context);
- context.push(context.di);
- context.push(context.bx);
- context.push(context.es);
- context.push(context.si);
- context.push(context.ds);
- readmouse(context);
- showpointer(context);
- vsync(context);
- dumppointer(context);
- delpointer(context);
- context.ax = context.data.word(kMousebutton);
- context.ds = context.pop();
- context.si = context.pop();
- context.es = context.pop();
- context.bx = context.pop();
- context.di = context.pop();
-}
-
-void printboth(Context &context) {
- STACK_CHECK(context);
- context.push(context.ax);
- context.push(context.cx);
- context.push(context.bx);
- context.push(context.di);
- printchar(context);
- context.ax = context.pop();
- context.push(context.di);
- context.di = context.ax;
- multidump(context);
- context.di = context.pop();
- context.bx = context.pop();
- context.cx = context.pop();
- context.ax = context.pop();
-}
-
-void printdirect(Context &context) {
- STACK_CHECK(context);
- context.data.word(kLastxpos) = context.di;
- context.ds = context.data.word(kCurrentset);
+ es = pop();
+ si = pop();
+ cx = pop();
+ dx = pop();
+ di = pop();
+ bx = pop();
+ al = 1;
+}
+
+void DreamGenContext::waitframes() {
+ STACK_CHECK;
+ push(di);
+ push(bx);
+ push(es);
+ push(si);
+ push(ds);
+ readmouse();
+ showpointer();
+ vsync();
+ dumppointer();
+ delpointer();
+ ax = data.word(kMousebutton);
+ ds = pop();
+ si = pop();
+ es = pop();
+ bx = pop();
+ di = pop();
+}
+
+void DreamGenContext::printboth() {
+ STACK_CHECK;
+ push(ax);
+ push(cx);
+ push(bx);
+ push(di);
+ printchar();
+ ax = pop();
+ push(di);
+ di = ax;
+ multidump();
+ di = pop();
+ bx = pop();
+ cx = pop();
+ ax = pop();
+}
+
+void DreamGenContext::printdirect() {
+ STACK_CHECK;
+ data.word(kLastxpos) = di;
+ ds = data.word(kCurrentset);
printloop6:
- context.push(context.bx);
- context.push(context.di);
- context.push(context.dx);
- getnumber(context);
- context.ch = 0;
+ push(bx);
+ push(di);
+ push(dx);
+ getnumber();
+ ch = 0;
printloop5:
- context.ax = context.es.word(context.si);
- context._inc(context.si);
- context._cmp(context.al, 0);
- if (context.flags.z())
+ ax = es.word(si);
+ _inc(si);
+ _cmp(al, 0);
+ if (flags.z())
goto finishdirct;
- context._cmp(context.al, ':');
- if (context.flags.z())
+ _cmp(al, ':');
+ if (flags.z())
goto finishdirct;
- context.push(context.cx);
- context.push(context.es);
- printchar(context);
- context.data.word(kLastxpos) = context.di;
- context.es = context.pop();
- context.cx = context.pop();
- if (--context.cx)
+ push(cx);
+ push(es);
+ printchar();
+ data.word(kLastxpos) = di;
+ es = pop();
+ cx = pop();
+ if (--cx)
goto printloop5;
- context.dx = context.pop();
- context.di = context.pop();
- context.bx = context.pop();
- context._add(context.bx, context.data.word(kLinespacing));
+ dx = pop();
+ di = pop();
+ bx = pop();
+ _add(bx, data.word(kLinespacing));
goto printloop6;
finishdirct:
- context.dx = context.pop();
- context.di = context.pop();
- context.bx = context.pop();
-}
-
-void monprint(Context &context) {
- STACK_CHECK(context);
- context.data.byte(kKerning) = 1;
- context.si = context.bx;
- context.dl = 166;
- context.di = context.data.word(kMonadx);
- context.bx = context.data.word(kMonady);
- context.ds = context.data.word(kTempcharset);
+ dx = pop();
+ di = pop();
+ bx = pop();
+}
+
+void DreamGenContext::monprint() {
+ STACK_CHECK;
+ data.byte(kKerning) = 1;
+ si = bx;
+ dl = 166;
+ di = data.word(kMonadx);
+ bx = data.word(kMonady);
+ ds = data.word(kTempcharset);
printloop8:
- context.push(context.bx);
- context.push(context.di);
- context.push(context.dx);
- getnumber(context);
- context.ch = 0;
+ push(bx);
+ push(di);
+ push(dx);
+ getnumber();
+ ch = 0;
printloop7:
- context.al = context.es.byte(context.si);
- context._inc(context.si);
- context._cmp(context.al, ':');
- if (context.flags.z())
+ al = es.byte(si);
+ _inc(si);
+ _cmp(al, ':');
+ if (flags.z())
goto finishmon2;
- context._cmp(context.al, 0);
- if (context.flags.z())
+ _cmp(al, 0);
+ if (flags.z())
goto finishmon;
- context._cmp(context.al, 34);
- if (context.flags.z())
+ _cmp(al, 34);
+ if (flags.z())
goto finishmon;
- context._cmp(context.al, '=');
- if (context.flags.z())
+ _cmp(al, '=');
+ if (flags.z())
goto finishmon;
- context._cmp(context.al, '%');
- if (!context.flags.z())
+ _cmp(al, '%');
+ if (!flags.z())
goto nottrigger;
- context.ah = context.es.byte(context.si);
- context._inc(context.si);
- context._inc(context.si);
+ ah = es.byte(si);
+ _inc(si);
+ _inc(si);
goto finishmon;
nottrigger:
- context.push(context.cx);
- context.push(context.es);
- printchar(context);
- context.data.word(kCurslocx) = context.di;
- context.data.word(kCurslocy) = context.bx;
- context.data.word(kMaintimer) = 1;
- printcurs(context);
- vsync(context);
- context.push(context.si);
- context.push(context.dx);
- context.push(context.ds);
- context.push(context.es);
- context.push(context.bx);
- context.push(context.di);
- lockmon(context);
- context.di = context.pop();
- context.bx = context.pop();
- context.es = context.pop();
- context.ds = context.pop();
- context.dx = context.pop();
- context.si = context.pop();
- delcurs(context);
- context.es = context.pop();
- context.cx = context.pop();
- if (--context.cx)
+ push(cx);
+ push(es);
+ printchar();
+ data.word(kCurslocx) = di;
+ data.word(kCurslocy) = bx;
+ data.word(kMaintimer) = 1;
+ printcurs();
+ vsync();
+ push(si);
+ push(dx);
+ push(ds);
+ push(es);
+ push(bx);
+ push(di);
+ lockmon();
+ di = pop();
+ bx = pop();
+ es = pop();
+ ds = pop();
+ dx = pop();
+ si = pop();
+ delcurs();
+ es = pop();
+ cx = pop();
+ if (--cx)
goto printloop7;
finishmon2:
- context.dx = context.pop();
- context.di = context.pop();
- context.bx = context.pop();
- scrollmonitor(context);
- context.data.word(kCurslocx) = context.di;
+ dx = pop();
+ di = pop();
+ bx = pop();
+ scrollmonitor();
+ data.word(kCurslocx) = di;
goto printloop8;
finishmon:
- context.dx = context.pop();
- context.di = context.pop();
- context.bx = context.pop();
- context._cmp(context.al, '%');
- if (!context.flags.z())
+ dx = pop();
+ di = pop();
+ bx = pop();
+ _cmp(al, '%');
+ if (!flags.z())
goto nottrigger2;
- context.data.byte(kLasttrigger) = context.ah;
+ data.byte(kLasttrigger) = ah;
nottrigger2:
- context.data.word(kCurslocx) = context.di;
- scrollmonitor(context);
- context.bx = context.si;
- context.data.byte(kKerning) = 0;
-}
-
-void getnumber(Context &context) {
- STACK_CHECK(context);
- context.cx = 0;
- context.push(context.si);
- context.push(context.bx);
- context.push(context.di);
- context.push(context.ds);
- context.push(context.es);
- context.di = context.si;
+ data.word(kCurslocx) = di;
+ scrollmonitor();
+ bx = si;
+ data.byte(kKerning) = 0;
+}
+
+void DreamGenContext::getnumber() {
+ STACK_CHECK;
+ cx = 0;
+ push(si);
+ push(bx);
+ push(di);
+ push(ds);
+ push(es);
+ di = si;
wordloop:
- context.push(context.cx);
- context.push(context.dx);
- getnextword(context);
- context.dx = context.pop();
- context.cx = context.pop();
- context._cmp(context.al, 1);
- if (context.flags.z())
+ push(cx);
+ push(dx);
+ getnextword();
+ dx = pop();
+ cx = pop();
+ _cmp(al, 1);
+ if (flags.z())
goto endoftext;
- context.al = context.cl;
- context.ah = 0;
- context.push(context.bx);
- context.bh = 0;
- context._add(context.ax, context.bx);
- context.bx = context.pop();
- context._sub(context.ax, 10);
- context.dh = 0;
- context._cmp(context.ax, context.dx);
- if (!context.flags.c())
+ al = cl;
+ ah = 0;
+ push(bx);
+ bh = 0;
+ _add(ax, bx);
+ bx = pop();
+ _sub(ax, 10);
+ dh = 0;
+ _cmp(ax, dx);
+ if (!flags.c())
goto gotoverend;
- context._add(context.cl, context.bl);
- context._add(context.ch, context.bh);
+ _add(cl, bl);
+ _add(ch, bh);
goto wordloop;
gotoverend:
- context.al = context.dl;
- context._and(context.al, 1);
- if (context.flags.z())
+ al = dl;
+ _and(al, 1);
+ if (flags.z())
goto notcentre;
- context.push(context.cx);
- context.al = context.dl;
- context._and(context.al, 0xfe);
- context.ah = 0;
- context.ch = 0;
- context._sub(context.ax, context.cx);
- context._add(context.ax, 20);
- context._shr(context.ax, 1);
- context.cx = context.pop();
- context.es = context.pop();
- context.ds = context.pop();
- context.di = context.pop();
- context.bx = context.pop();
- context.si = context.pop();
- context._add(context.di, context.ax);
- context.cl = context.ch;
+ push(cx);
+ al = dl;
+ _and(al, 0xfe);
+ ah = 0;
+ ch = 0;
+ _sub(ax, cx);
+ _add(ax, 20);
+ _shr(ax, 1);
+ cx = pop();
+ es = pop();
+ ds = pop();
+ di = pop();
+ bx = pop();
+ si = pop();
+ _add(di, ax);
+ cl = ch;
return;
notcentre:
- context.es = context.pop();
- context.ds = context.pop();
- context.di = context.pop();
- context.bx = context.pop();
- context.si = context.pop();
- context.cl = context.ch;
+ es = pop();
+ ds = pop();
+ di = pop();
+ bx = pop();
+ si = pop();
+ cl = ch;
return;
endoftext:
- context.al = context.cl;
- context.ah = 0;
- context.push(context.bx);
- context.bh = 0;
- context._add(context.ax, context.bx);
- context.bx = context.pop();
- context._sub(context.ax, 10);
- context.dh = 0;
- context._cmp(context.ax, context.dx);
- if (!context.flags.c())
+ al = cl;
+ ah = 0;
+ push(bx);
+ bh = 0;
+ _add(ax, bx);
+ bx = pop();
+ _sub(ax, 10);
+ dh = 0;
+ _cmp(ax, dx);
+ if (!flags.c())
goto gotoverend2;
- context._add(context.cl, context.bl);
- context._add(context.ch, context.bh);
+ _add(cl, bl);
+ _add(ch, bh);
gotoverend2:
- context.al = context.dl;
- context._and(context.al, 1);
- if (context.flags.z())
+ al = dl;
+ _and(al, 1);
+ if (flags.z())
goto notcent2;
- context.push(context.cx);
- context.al = context.dl;
- context._and(context.al, 0xfe);
- context._add(context.al, 2);
- context.ah = 0;
- context.ch = 0;
- context._add(context.ax, 20);
- context._sub(context.ax, context.cx);
- context._shr(context.ax, 1);
- context.cx = context.pop();
- context.es = context.pop();
- context.ds = context.pop();
- context.di = context.pop();
- context.bx = context.pop();
- context.si = context.pop();
- context._add(context.di, context.ax);
- context.cl = context.ch;
+ push(cx);
+ al = dl;
+ _and(al, 0xfe);
+ _add(al, 2);
+ ah = 0;
+ ch = 0;
+ _add(ax, 20);
+ _sub(ax, cx);
+ _shr(ax, 1);
+ cx = pop();
+ es = pop();
+ ds = pop();
+ di = pop();
+ bx = pop();
+ si = pop();
+ _add(di, ax);
+ cl = ch;
return;
notcent2:
- context.es = context.pop();
- context.ds = context.pop();
- context.di = context.pop();
- context.bx = context.pop();
- context.si = context.pop();
- context.cl = context.ch;
+ es = pop();
+ ds = pop();
+ di = pop();
+ bx = pop();
+ si = pop();
+ cl = ch;
}
-void getnextword(Context &context) {
- STACK_CHECK(context);
- context.bx = 0;
+void DreamGenContext::getnextword() {
+ STACK_CHECK;
+ bx = 0;
getloop:
- context.ax = context.es.word(context.di);
- context._inc(context.di);
- context._inc(context.bh);
- context._cmp(context.al, ':');
- if (context.flags.z())
+ ax = es.word(di);
+ _inc(di);
+ _inc(bh);
+ _cmp(al, ':');
+ if (flags.z())
goto endall;
- context._cmp(context.al, 0);
- if (context.flags.z())
+ _cmp(al, 0);
+ if (flags.z())
goto endall;
- context._cmp(context.al, 32);
- if (context.flags.z())
+ _cmp(al, 32);
+ if (flags.z())
goto endword;
- context._cmp(context.al, 255);
- if (context.flags.z())
+ _cmp(al, 255);
+ if (flags.z())
goto getloop;
- context.push(context.ax);
- context._sub(context.al, 32);
- context.ah = 0;
- context._add(context.ax, context.data.word(kCharshift));
- context._add(context.ax, context.ax);
- context.si = context.ax;
- context._add(context.ax, context.ax);
- context._add(context.si, context.ax);
- context.cl = context.ds.byte(context.si+0);
- context.ax = context.pop();
- kernchars(context);
- context._add(context.bl, context.cl);
+ push(ax);
+ _sub(al, 32);
+ ah = 0;
+ _add(ax, data.word(kCharshift));
+ _add(ax, ax);
+ si = ax;
+ _add(ax, ax);
+ _add(si, ax);
+ cl = ds.byte(si+0);
+ ax = pop();
+ kernchars();
+ _add(bl, cl);
goto getloop;
endword:
- context._add(context.bl, 6);
- context.al = 0;
+ _add(bl, 6);
+ al = 0;
return;
endall:
- context._add(context.bl, 6);
- context.al = 1;
-}
-
-void fillryan(Context &context) {
- STACK_CHECK(context);
- context.es = context.data.word(kBuffers);
- context.di = (0+(180*10)+32);
- findallryan(context);
- context.si = (0+(180*10)+32);
- context.al = context.data.byte(kRyanpage);
- context.ah = 0;
- context.cx = 20;
- context._mul(context.cx);
- context._add(context.si, context.ax);
- context.di = (80);
- context.bx = (58);
- context.cx = 2;
+ _add(bl, 6);
+ al = 1;
+}
+
+void DreamGenContext::fillryan() {
+ STACK_CHECK;
+ es = data.word(kBuffers);
+ di = (0+(180*10)+32);
+ findallryan();
+ si = (0+(180*10)+32);
+ al = data.byte(kRyanpage);
+ ah = 0;
+ cx = 20;
+ _mul(cx);
+ _add(si, ax);
+ di = (80);
+ bx = (58);
+ cx = 2;
ryanloop2:
- context.push(context.cx);
- context.push(context.di);
- context.push(context.bx);
- context.cx = 5;
+ push(cx);
+ push(di);
+ push(bx);
+ cx = 5;
ryanloop1:
- context.push(context.cx);
- context.push(context.di);
- context.push(context.bx);
- context.ax = context.es.word(context.si);
- context._add(context.si, 2);
- context.push(context.si);
- context.push(context.es);
- obtoinv(context);
- context.es = context.pop();
- context.si = context.pop();
- context.bx = context.pop();
- context.di = context.pop();
- context.cx = context.pop();
- context._add(context.di, (44));
- if (--context.cx)
+ push(cx);
+ push(di);
+ push(bx);
+ ax = es.word(si);
+ _add(si, 2);
+ push(si);
+ push(es);
+ obtoinv();
+ es = pop();
+ si = pop();
+ bx = pop();
+ di = pop();
+ cx = pop();
+ _add(di, (44));
+ if (--cx)
goto ryanloop1;
- context.bx = context.pop();
- context.di = context.pop();
- context.cx = context.pop();
- context._add(context.bx, (44));
- if (--context.cx)
+ bx = pop();
+ di = pop();
+ cx = pop();
+ _add(bx, (44));
+ if (--cx)
goto ryanloop2;
- showryanpage(context);
+ showryanpage();
}
-void fillopen(Context &context) {
- STACK_CHECK(context);
- deltextline(context);
- getopenedsize(context);
- context._cmp(context.ah, 4);
- if (context.flags.c())
+void DreamGenContext::fillopen() {
+ STACK_CHECK;
+ deltextline();
+ getopenedsize();
+ _cmp(ah, 4);
+ if (flags.c())
goto lessthanapage;
- context.ah = 4;
+ ah = 4;
lessthanapage:
- context.al = 1;
- context.push(context.ax);
- context.es = context.data.word(kBuffers);
- context.di = (0+(180*10));
- findallopen(context);
- context.si = (0+(180*10));
- context.di = (80);
- context.bx = (58)+96;
- context.cx = context.pop();
+ al = 1;
+ push(ax);
+ es = data.word(kBuffers);
+ di = (0+(180*10));
+ findallopen();
+ si = (0+(180*10));
+ di = (80);
+ bx = (58)+96;
+ cx = pop();
openloop1:
- context.push(context.cx);
- context.push(context.di);
- context.push(context.bx);
- context.ax = context.es.word(context.si);
- context._add(context.si, 2);
- context.push(context.si);
- context.push(context.es);
- context._cmp(context.ch, context.cl);
- if (context.flags.c())
+ push(cx);
+ push(di);
+ push(bx);
+ ax = es.word(si);
+ _add(si, 2);
+ push(si);
+ push(es);
+ _cmp(ch, cl);
+ if (flags.c())
goto nextopenslot;
- obtoinv(context);
+ obtoinv();
nextopenslot:
- context.es = context.pop();
- context.si = context.pop();
- context.bx = context.pop();
- context.di = context.pop();
- context.cx = context.pop();
- context._add(context.di, (44));
- context._inc(context.cl);
- context._cmp(context.cl, 5);
- if (!context.flags.z())
+ es = pop();
+ si = pop();
+ bx = pop();
+ di = pop();
+ cx = pop();
+ _add(di, (44));
+ _inc(cl);
+ _cmp(cl, 5);
+ if (!flags.z())
goto openloop1;
- undertextline(context);
-}
-
-void findallryan(Context &context) {
- STACK_CHECK(context);
- context.push(context.di);
- context.cx = 30;
- context.ax = 0x0ffff;
- context._stosw(context.cx);
- context.di = context.pop();
- context.cl = 4;
- context.ds = context.data.word(kExtras);
- context.bx = (0+2080+30000);
- context.ch = 0;
+ undertextline();
+}
+
+void DreamGenContext::findallryan() {
+ STACK_CHECK;
+ push(di);
+ cx = 30;
+ ax = 0x0ffff;
+ _stosw(cx, true);
+ di = pop();
+ cl = 4;
+ ds = data.word(kExtras);
+ bx = (0+2080+30000);
+ ch = 0;
findryanloop:
- context._cmp(context.ds.byte(context.bx+2), context.cl);
- if (!context.flags.z())
+ _cmp(ds.byte(bx+2), cl);
+ if (!flags.z())
goto notinryaninv;
- context._cmp(context.ds.byte(context.bx+3), 255);
- if (!context.flags.z())
+ _cmp(ds.byte(bx+3), 255);
+ if (!flags.z())
goto notinryaninv;
- context.al = context.ds.byte(context.bx+4);
- context.ah = 0;
- context.push(context.di);
- context._add(context.di, context.ax);
- context._add(context.di, context.ax);
- context.al = context.ch;
- context.ah = 4;
- context._stosw();
- context.di = context.pop();
+ al = ds.byte(bx+4);
+ ah = 0;
+ push(di);
+ _add(di, ax);
+ _add(di, ax);
+ al = ch;
+ ah = 4;
+ _stosw();
+ di = pop();
notinryaninv:
- context._add(context.bx, 16);
- context._inc(context.ch);
- context._cmp(context.ch, (114));
- if (!context.flags.z())
+ _add(bx, 16);
+ _inc(ch);
+ _cmp(ch, (114));
+ if (!flags.z())
goto findryanloop;
}
-void findallopen(Context &context) {
- STACK_CHECK(context);
- context.push(context.di);
- context.cx = 16;
- context.ax = 0x0ffff;
- context._stosw(context.cx);
- context.di = context.pop();
- context.cl = context.data.byte(kOpenedob);
- context.dl = context.data.byte(kOpenedtype);
- context.ds = context.data.word(kExtras);
- context.bx = (0+2080+30000);
- context.ch = 0;
+void DreamGenContext::findallopen() {
+ STACK_CHECK;
+ push(di);
+ cx = 16;
+ ax = 0x0ffff;
+ _stosw(cx, true);
+ di = pop();
+ cl = data.byte(kOpenedob);
+ dl = data.byte(kOpenedtype);
+ ds = data.word(kExtras);
+ bx = (0+2080+30000);
+ ch = 0;
findopen1:
- context._cmp(context.ds.byte(context.bx+3), context.cl);
- if (!context.flags.z())
+ _cmp(ds.byte(bx+3), cl);
+ if (!flags.z())
goto findopen2;
- context._cmp(context.ds.byte(context.bx+2), context.dl);
- if (!context.flags.z())
+ _cmp(ds.byte(bx+2), dl);
+ if (!flags.z())
goto findopen2;
- context._cmp(context.data.byte(kOpenedtype), 4);
- if (context.flags.z())
+ _cmp(data.byte(kOpenedtype), 4);
+ if (flags.z())
goto noloccheck;
- context.al = context.ds.byte(context.bx+5);
- context._cmp(context.al, context.data.byte(kReallocation));
- if (!context.flags.z())
+ al = ds.byte(bx+5);
+ _cmp(al, data.byte(kReallocation));
+ if (!flags.z())
goto findopen2;
noloccheck:
- context.al = context.ds.byte(context.bx+4);
- context.ah = 0;
- context.push(context.di);
- context._add(context.di, context.ax);
- context._add(context.di, context.ax);
- context.al = context.ch;
- context.ah = 4;
- context._stosw();
- context.di = context.pop();
+ al = ds.byte(bx+4);
+ ah = 0;
+ push(di);
+ _add(di, ax);
+ _add(di, ax);
+ al = ch;
+ ah = 4;
+ _stosw();
+ di = pop();
findopen2:
- context._add(context.bx, 16);
- context._inc(context.ch);
- context._cmp(context.ch, (114));
- if (!context.flags.z())
+ _add(bx, 16);
+ _inc(ch);
+ _cmp(ch, (114));
+ if (!flags.z())
goto findopen1;
- context.cl = context.data.byte(kOpenedob);
- context.dl = context.data.byte(kOpenedtype);
- context.push(context.dx);
- context.ds = context.data.word(kFreedat);
- context.dx = context.pop();
- context.bx = 0;
- context.ch = 0;
+ cl = data.byte(kOpenedob);
+ dl = data.byte(kOpenedtype);
+ push(dx);
+ ds = data.word(kFreedat);
+ dx = pop();
+ bx = 0;
+ ch = 0;
findopen1a:
- context._cmp(context.ds.byte(context.bx+3), context.cl);
- if (!context.flags.z())
+ _cmp(ds.byte(bx+3), cl);
+ if (!flags.z())
goto findopen2a;
- context._cmp(context.ds.byte(context.bx+2), context.dl);
- if (!context.flags.z())
+ _cmp(ds.byte(bx+2), dl);
+ if (!flags.z())
goto findopen2a;
- context.al = context.ds.byte(context.bx+4);
- context.ah = 0;
- context.push(context.di);
- context._add(context.di, context.ax);
- context._add(context.di, context.ax);
- context.al = context.ch;
- context.ah = 2;
- context._stosw();
- context.di = context.pop();
+ al = ds.byte(bx+4);
+ ah = 0;
+ push(di);
+ _add(di, ax);
+ _add(di, ax);
+ al = ch;
+ ah = 2;
+ _stosw();
+ di = pop();
findopen2a:
- context._add(context.bx, 16);
- context._inc(context.ch);
- context._cmp(context.ch, 80);
- if (!context.flags.z())
+ _add(bx, 16);
+ _inc(ch);
+ _cmp(ch, 80);
+ if (!flags.z())
goto findopen1a;
}
-void obtoinv(Context &context) {
- STACK_CHECK(context);
- context.push(context.bx);
- context.push(context.es);
- context.push(context.si);
- context.push(context.ax);
- context.push(context.ax);
- context.push(context.di);
- context.push(context.bx);
- context.ds = context.data.word(kIcons1);
- context._sub(context.di, 2);
- context._sub(context.bx, 1);
- context.al = 10;
- context.ah = 0;
- showframe(context);
- context.bx = context.pop();
- context.di = context.pop();
- context.ax = context.pop();
- context._cmp(context.al, 255);
- if (context.flags.z())
+void DreamGenContext::obtoinv() {
+ STACK_CHECK;
+ push(bx);
+ push(es);
+ push(si);
+ push(ax);
+ push(ax);
+ push(di);
+ push(bx);
+ ds = data.word(kIcons1);
+ _sub(di, 2);
+ _sub(bx, 1);
+ al = 10;
+ ah = 0;
+ showframe();
+ bx = pop();
+ di = pop();
+ ax = pop();
+ _cmp(al, 255);
+ if (flags.z())
goto finishfill;
- context.push(context.bx);
- context.push(context.di);
- context.push(context.ax);
- context.ds = context.data.word(kExtras);
- context._cmp(context.ah, 4);
- if (context.flags.z())
+ push(bx);
+ push(di);
+ push(ax);
+ ds = data.word(kExtras);
+ _cmp(ah, 4);
+ if (flags.z())
goto isanextra;
- context.ds = context.data.word(kFreeframes);
+ ds = data.word(kFreeframes);
isanextra:
- context.cl = context.al;
- context._add(context.al, context.al);
- context._add(context.al, context.cl);
- context._inc(context.al);
- context.ah = 128;
- context._add(context.bx, 19);
- context._add(context.di, 18);
- showframe(context);
- context.ax = context.pop();
- context.di = context.pop();
- context.bx = context.pop();
- context.push(context.bx);
- getanyaddir(context);
- isitworn(context);
- context.bx = context.pop();
- if (!context.flags.z())
+ cl = al;
+ _add(al, al);
+ _add(al, cl);
+ _inc(al);
+ ah = 128;
+ _add(bx, 19);
+ _add(di, 18);
+ showframe();
+ ax = pop();
+ di = pop();
+ bx = pop();
+ push(bx);
+ getanyaddir();
+ isitworn();
+ bx = pop();
+ if (!flags.z())
goto finishfill;
- context.ds = context.data.word(kIcons1);
- context._sub(context.di, 3);
- context._sub(context.bx, 2);
- context.al = 7;
- context.ah = 0;
- showframe(context);
+ ds = data.word(kIcons1);
+ _sub(di, 3);
+ _sub(bx, 2);
+ al = 7;
+ ah = 0;
+ showframe();
finishfill:
- context.ax = context.pop();
- context.si = context.pop();
- context.es = context.pop();
- context.bx = context.pop();
+ ax = pop();
+ si = pop();
+ es = pop();
+ bx = pop();
}
-void isitworn(Context &context) {
- STACK_CHECK(context);
- context.al = context.es.byte(context.bx+12);
- context._cmp(context.al, 'W'-'A');
- if (!context.flags.z())
- goto notworn;
- context.al = context.es.byte(context.bx+13);
- context._cmp(context.al, 'E'-'A');
-notworn:
- return;
+void DreamGenContext::isitworn() {
+ STACK_CHECK;
+ al = es.byte(bx+12);
+ _cmp(al, 'W'-'A');
+ if (!flags.z())
+ return /* (notworn) */;
+ al = es.byte(bx+13);
+ _cmp(al, 'E'-'A');
}
-void makeworn(Context &context) {
- STACK_CHECK(context);
- context.es.byte(context.bx+12) = 'W'-'A';
- context.es.byte(context.bx+13) = 'E'-'A';
+void DreamGenContext::makeworn() {
+ STACK_CHECK;
+ es.byte(bx+12) = 'W'-'A';
+ es.byte(bx+13) = 'E'-'A';
}
-void examineob(Context &context) {
- STACK_CHECK(context);
- context.data.byte(kPointermode) = 0;
- context.data.word(kTimecount) = 0;
+void DreamGenContext::examineob() {
+ STACK_CHECK;
+ data.byte(kPointermode) = 0;
+ data.word(kTimecount) = 0;
examineagain:
- context.data.byte(kInmaparea) = 0;
- context.data.byte(kExamagain) = 0;
- context.data.byte(kOpenedob) = 255;
- context.data.byte(kOpenedtype) = 255;
- context.data.byte(kInvopen) = 0;
- context.al = context.data.byte(kCommandtype);
- context.data.byte(kObjecttype) = context.al;
- context.data.byte(kItemframe) = 0;
- context.data.byte(kPointerframe) = 0;
- createpanel(context);
- showpanel(context);
- showman(context);
- showexit(context);
- obicons(context);
- obpicture(context);
- describeob(context);
- undertextline(context);
- context.data.byte(kCommandtype) = 255;
- readmouse(context);
- showpointer(context);
- worktoscreen(context);
- delpointer(context);
+ data.byte(kInmaparea) = 0;
+ data.byte(kExamagain) = 0;
+ data.byte(kOpenedob) = 255;
+ data.byte(kOpenedtype) = 255;
+ data.byte(kInvopen) = 0;
+ al = data.byte(kCommandtype);
+ data.byte(kObjecttype) = al;
+ data.byte(kItemframe) = 0;
+ data.byte(kPointerframe) = 0;
+ createpanel();
+ showpanel();
+ showman();
+ showexit();
+ obicons();
+ obpicture();
+ describeob();
+ undertextline();
+ data.byte(kCommandtype) = 255;
+ readmouse();
+ showpointer();
+ worktoscreen();
+ delpointer();
waitexam:
- readmouse(context);
- showpointer(context);
- vsync(context);
- dumppointer(context);
- dumptextline(context);
- delpointer(context);
- context.data.byte(kGetback) = 0;
- context.bx = 2494;
- context._cmp(context.data.byte(kInvopen), 0);
- if (context.flags.z())
+ readmouse();
+ showpointer();
+ vsync();
+ dumppointer();
+ dumptextline();
+ delpointer();
+ data.byte(kGetback) = 0;
+ bx = 2494;
+ _cmp(data.byte(kInvopen), 0);
+ if (flags.z())
goto notuseinv;
- context.bx = 2556;
- context._cmp(context.data.byte(kInvopen), 1);
- if (context.flags.z())
+ bx = 2556;
+ _cmp(data.byte(kInvopen), 1);
+ if (flags.z())
goto notuseinv;
- context.bx = 2618;
+ bx = 2618;
notuseinv:
- checkcoords(context);
- context._cmp(context.data.byte(kExamagain), 0);
- if (context.flags.z())
+ checkcoords();
+ _cmp(data.byte(kExamagain), 0);
+ if (flags.z())
goto norex;
goto examineagain;
norex:
- context._cmp(context.data.byte(kGetback), 0);
- if (context.flags.z())
+ _cmp(data.byte(kGetback), 0);
+ if (flags.z())
goto waitexam;
- context.data.byte(kPickup) = 0;
- context._cmp(context.data.word(kWatchingtime), 0);
- if (!context.flags.z())
+ data.byte(kPickup) = 0;
+ _cmp(data.word(kWatchingtime), 0);
+ if (!flags.z())
goto iswatching;
- context._cmp(context.data.byte(kNewlocation), 255);
- if (!context.flags.z())
+ _cmp(data.byte(kNewlocation), 255);
+ if (!flags.z())
goto justgetback;
iswatching:
- makemainscreen(context);
- context.data.byte(kInvopen) = 0;
- context.data.byte(kOpenedob) = 255;
+ makemainscreen();
+ data.byte(kInvopen) = 0;
+ data.byte(kOpenedob) = 255;
return;
justgetback:
- context.data.byte(kInvopen) = 0;
- context.data.byte(kOpenedob) = 255;
-}
-
-void makemainscreen(Context &context) {
- STACK_CHECK(context);
- createpanel(context);
- context.data.byte(kNewobs) = 1;
- drawfloor(context);
- spriteupdate(context);
- printsprites(context);
- reelsonscreen(context);
- showicon(context);
- getunderzoom(context);
- undertextline(context);
- context.data.byte(kCommandtype) = 255;
- animpointer(context);
- worktoscreenm(context);
- context.data.byte(kCommandtype) = 200;
- context.data.byte(kManisoffscreen) = 0;
-}
-
-void getbackfromob(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kPickup), 1);
- if (!context.flags.z())
+ data.byte(kInvopen) = 0;
+ data.byte(kOpenedob) = 255;
+}
+
+void DreamGenContext::makemainscreen() {
+ STACK_CHECK;
+ createpanel();
+ data.byte(kNewobs) = 1;
+ drawfloor();
+ spriteupdate();
+ printsprites();
+ reelsonscreen();
+ showicon();
+ getunderzoom();
+ undertextline();
+ data.byte(kCommandtype) = 255;
+ animpointer();
+ worktoscreenm();
+ data.byte(kCommandtype) = 200;
+ data.byte(kManisoffscreen) = 0;
+}
+
+void DreamGenContext::getbackfromob() {
+ STACK_CHECK;
+ _cmp(data.byte(kPickup), 1);
+ if (!flags.z())
goto notheldob;
- blank(context);
+ blank();
return;
notheldob:
- getback1(context);
+ getback1();
}
-void incryanpage(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kCommandtype), 222);
- if (context.flags.z())
+void DreamGenContext::incryanpage() {
+ STACK_CHECK;
+ _cmp(data.byte(kCommandtype), 222);
+ if (flags.z())
goto alreadyincryan;
- context.data.byte(kCommandtype) = 222;
- context.al = 31;
- commandonly(context);
+ data.byte(kCommandtype) = 222;
+ al = 31;
+ commandonly();
alreadyincryan:
- context.ax = context.data.word(kMousebutton);
- context._cmp(context.ax, context.data.word(kOldbutton));
- if (context.flags.z())
- goto noincryan;
- context._and(context.ax, 1);
- if (!context.flags.z())
+ ax = data.word(kMousebutton);
+ _cmp(ax, data.word(kOldbutton));
+ if (flags.z())
+ return /* (noincryan) */;
+ _and(ax, 1);
+ if (!flags.z())
goto doincryan;
-noincryan:
return;
doincryan:
- context.ax = context.data.word(kMousex);
- context._sub(context.ax, (80)+167);
- context.data.byte(kRyanpage) = -1;
+ ax = data.word(kMousex);
+ _sub(ax, (80)+167);
+ data.byte(kRyanpage) = -1;
findnewpage:
- context._inc(context.data.byte(kRyanpage));
- context._sub(context.ax, 18);
- if (!context.flags.c())
+ _inc(data.byte(kRyanpage));
+ _sub(ax, 18);
+ if (!flags.c())
goto findnewpage;
- delpointer(context);
- fillryan(context);
- readmouse(context);
- showpointer(context);
- worktoscreen(context);
- delpointer(context);
-}
-
-void openinv(Context &context) {
- STACK_CHECK(context);
- context.data.byte(kInvopen) = 1;
- context.al = 61;
- context.di = (80);
- context.bx = (58)-10;
- context.dl = 240;
- printmessage(context);
- fillryan(context);
- context.data.byte(kCommandtype) = 255;
-}
-
-void showryanpage(Context &context) {
- STACK_CHECK(context);
- context.ds = context.data.word(kIcons1);
- context.di = (80)+167;
- context.bx = (58)-12;
- context.al = 12;
- context.ah = 0;
- showframe(context);
- context.al = 13;
- context._add(context.al, context.data.byte(kRyanpage));
- context.push(context.ax);
- context.al = context.data.byte(kRyanpage);
- context.ah = 0;
- context.cx = 18;
- context._mul(context.cx);
- context.ds = context.data.word(kIcons1);
- context.di = (80)+167;
- context._add(context.di, context.ax);
- context.bx = (58)-12;
- context.ax = context.pop();
- context.ah = 0;
- showframe(context);
-}
-
-void openob(Context &context) {
- STACK_CHECK(context);
- context.al = context.data.byte(kOpenedob);
- context.ah = context.data.byte(kOpenedtype);
- context.di = 5847;
- copyname(context);
- context.di = (80);
- context.bx = (58)+86;
- context.al = 62;
- context.dl = 240;
- printmessage(context);
- context.di = context.data.word(kLastxpos);
- context._add(context.di, 5);
- context.bx = (58)+86;
- context.es = context.cs;
- context.si = 5847;
- context.dl = 220;
- context.al = 0;
- context.ah = 0;
- printdirect(context);
- fillopen(context);
- getopenedsize(context);
- context.al = context.ah;
- context.ah = 0;
- context.cx = (44);
- context._mul(context.cx);
- context._add(context.ax, (80));
- context.bx = 2588;
- context.cs.word(context.bx) = context.ax;
-}
-
-void obicons(Context &context) {
- STACK_CHECK(context);
- context.al = context.data.byte(kCommand);
- getanyad(context);
- context._cmp(context.al, 255);
- if (context.flags.z())
+ delpointer();
+ fillryan();
+ readmouse();
+ showpointer();
+ worktoscreen();
+ delpointer();
+}
+
+void DreamGenContext::openinv() {
+ STACK_CHECK;
+ data.byte(kInvopen) = 1;
+ al = 61;
+ di = (80);
+ bx = (58)-10;
+ dl = 240;
+ printmessage();
+ fillryan();
+ data.byte(kCommandtype) = 255;
+}
+
+void DreamGenContext::showryanpage() {
+ STACK_CHECK;
+ ds = data.word(kIcons1);
+ di = (80)+167;
+ bx = (58)-12;
+ al = 12;
+ ah = 0;
+ showframe();
+ al = 13;
+ _add(al, data.byte(kRyanpage));
+ push(ax);
+ al = data.byte(kRyanpage);
+ ah = 0;
+ cx = 18;
+ _mul(cx);
+ ds = data.word(kIcons1);
+ di = (80)+167;
+ _add(di, ax);
+ bx = (58)-12;
+ ax = pop();
+ ah = 0;
+ showframe();
+}
+
+void DreamGenContext::openob() {
+ STACK_CHECK;
+ al = data.byte(kOpenedob);
+ ah = data.byte(kOpenedtype);
+ di = 5847;
+ copyname();
+ di = (80);
+ bx = (58)+86;
+ al = 62;
+ dl = 240;
+ printmessage();
+ di = data.word(kLastxpos);
+ _add(di, 5);
+ bx = (58)+86;
+ es = cs;
+ si = 5847;
+ dl = 220;
+ al = 0;
+ ah = 0;
+ printdirect();
+ fillopen();
+ getopenedsize();
+ al = ah;
+ ah = 0;
+ cx = (44);
+ _mul(cx);
+ _add(ax, (80));
+ bx = 2588;
+ cs.word(bx) = ax;
+}
+
+void DreamGenContext::obicons() {
+ STACK_CHECK;
+ al = data.byte(kCommand);
+ getanyad();
+ _cmp(al, 255);
+ if (flags.z())
goto cantopenit;
- context.ds = context.data.word(kIcons2);
- context.di = 210;
- context.bx = 1;
- context.al = 4;
- context.ah = 0;
- showframe(context);
+ ds = data.word(kIcons2);
+ di = 210;
+ bx = 1;
+ al = 4;
+ ah = 0;
+ showframe();
cantopenit:
- context.ds = context.data.word(kIcons2);
- context.di = 260;
- context.bx = 1;
- context.al = 1;
- context.ah = 0;
- showframe(context);
-}
-
-void examicon(Context &context) {
- STACK_CHECK(context);
- context.ds = context.data.word(kIcons2);
- context.di = 254;
- context.bx = 5;
- context.al = 3;
- context.ah = 0;
- showframe(context);
-}
-
-void obpicture(Context &context) {
- STACK_CHECK(context);
- context.al = context.data.byte(kCommand);
- context.ah = context.data.byte(kObjecttype);
- context._cmp(context.ah, 1);
- if (context.flags.z())
- goto setframe;
- context._cmp(context.ah, 4);
- if (context.flags.z())
+ ds = data.word(kIcons2);
+ di = 260;
+ bx = 1;
+ al = 1;
+ ah = 0;
+ showframe();
+}
+
+void DreamGenContext::examicon() {
+ STACK_CHECK;
+ ds = data.word(kIcons2);
+ di = 254;
+ bx = 5;
+ al = 3;
+ ah = 0;
+ showframe();
+}
+
+void DreamGenContext::obpicture() {
+ STACK_CHECK;
+ al = data.byte(kCommand);
+ ah = data.byte(kObjecttype);
+ _cmp(ah, 1);
+ if (flags.z())
+ return /* (setframe) */;
+ _cmp(ah, 4);
+ if (flags.z())
goto exframe;
- context.ds = context.data.word(kFreeframes);
- context.di = 160;
- context.bx = 68;
- context.cl = context.al;
- context._add(context.al, context.al);
- context._add(context.al, context.cl);
- context._inc(context.al);
- context.ah = 128;
- showframe(context);
- return;
-setframe:
+ ds = data.word(kFreeframes);
+ di = 160;
+ bx = 68;
+ cl = al;
+ _add(al, al);
+ _add(al, cl);
+ _inc(al);
+ ah = 128;
+ showframe();
return;
exframe:
- context.ds = context.data.word(kExtras);
- context.di = 160;
- context.bx = 68;
- context.cl = context.al;
- context._add(context.al, context.al);
- context._add(context.al, context.cl);
- context._inc(context.al);
- context.ah = 128;
- showframe(context);
-}
-
-void describeob(Context &context) {
- STACK_CHECK(context);
- getobtextstart(context);
- context.di = 33;
- context.bx = 92;
- context.dl = 241;
- context.ah = 16;
- context.data.word(kCharshift) = 91+91;
- printdirect(context);
- context.data.word(kCharshift) = 0;
- context.di = 36;
- context.bx = 104;
- context.dl = 241;
- context.ah = 0;
- printdirect(context);
- context.push(context.bx);
- obsthatdothings(context);
- context.bx = context.pop();
- additionaltext(context);
-}
-
-void additionaltext(Context &context) {
- STACK_CHECK(context);
- context._add(context.bx, 10);
- context.push(context.bx);
- context.al = context.data.byte(kCommand);
- context.ah = context.data.byte(kObjecttype);
- context.cl = 'C';
- context.ch = 'U';
- context.dl = 'P';
- context.dh = 'E';
- compare(context);
- if (context.flags.z())
+ ds = data.word(kExtras);
+ di = 160;
+ bx = 68;
+ cl = al;
+ _add(al, al);
+ _add(al, cl);
+ _inc(al);
+ ah = 128;
+ showframe();
+}
+
+void DreamGenContext::describeob() {
+ STACK_CHECK;
+ getobtextstart();
+ di = 33;
+ bx = 92;
+ dl = 241;
+ ah = 16;
+ data.word(kCharshift) = 91+91;
+ printdirect();
+ data.word(kCharshift) = 0;
+ di = 36;
+ bx = 104;
+ dl = 241;
+ ah = 0;
+ printdirect();
+ push(bx);
+ obsthatdothings();
+ bx = pop();
+ additionaltext();
+}
+
+void DreamGenContext::additionaltext() {
+ STACK_CHECK;
+ _add(bx, 10);
+ push(bx);
+ al = data.byte(kCommand);
+ ah = data.byte(kObjecttype);
+ cl = 'C';
+ ch = 'U';
+ dl = 'P';
+ dh = 'E';
+ compare();
+ if (flags.z())
goto emptycup;
- context.al = context.data.byte(kCommand);
- context.ah = context.data.byte(kObjecttype);
- context.cl = 'C';
- context.ch = 'U';
- context.dl = 'P';
- context.dh = 'F';
- compare(context);
- if (context.flags.z())
+ al = data.byte(kCommand);
+ ah = data.byte(kObjecttype);
+ cl = 'C';
+ ch = 'U';
+ dl = 'P';
+ dh = 'F';
+ compare();
+ if (flags.z())
goto fullcup;
- context.bx = context.pop();
+ bx = pop();
return;
emptycup:
- context.al = 40;
- findpuztext(context);
- context.bx = context.pop();
- context.di = 36;
- context.dl = 241;
- context.ah = 0;
- printdirect(context);
+ al = 40;
+ findpuztext();
+ bx = pop();
+ di = 36;
+ dl = 241;
+ ah = 0;
+ printdirect();
return;
fullcup:
- context.al = 39;
- findpuztext(context);
- context.bx = context.pop();
- context.di = 36;
- context.dl = 241;
- context.ah = 0;
- printdirect(context);
-}
-
-void obsthatdothings(Context &context) {
- STACK_CHECK(context);
- context.al = context.data.byte(kCommand);
- context.ah = context.data.byte(kObjecttype);
- context.cl = 'M';
- context.ch = 'E';
- context.dl = 'M';
- context.dh = 'B';
- compare(context);
- if (!context.flags.z())
- goto notlouiscard;
- context.al = 4;
- getlocation(context);
- context._cmp(context.al, 1);
- if (context.flags.z())
- goto seencard;
- context.al = 4;
- setlocation(context);
- lookatcard(context);
-seencard:
- return;
-notlouiscard:
- return;
-}
-
-void getobtextstart(Context &context) {
- STACK_CHECK(context);
- context.es = context.data.word(kFreedesc);
- context.si = (0);
- context.cx = (0+(82*2));
- context._cmp(context.data.byte(kObjecttype), 2);
- if (context.flags.z())
+ al = 39;
+ findpuztext();
+ bx = pop();
+ di = 36;
+ dl = 241;
+ ah = 0;
+ printdirect();
+}
+
+void DreamGenContext::obsthatdothings() {
+ STACK_CHECK;
+ al = data.byte(kCommand);
+ ah = data.byte(kObjecttype);
+ cl = 'M';
+ ch = 'E';
+ dl = 'M';
+ dh = 'B';
+ compare();
+ if (!flags.z())
+ return /* (notlouiscard) */;
+ al = 4;
+ getlocation();
+ _cmp(al, 1);
+ if (flags.z())
+ return /* (seencard) */;
+ al = 4;
+ setlocation();
+ lookatcard();
+}
+
+void DreamGenContext::getobtextstart() {
+ STACK_CHECK;
+ es = data.word(kFreedesc);
+ si = (0);
+ cx = (0+(82*2));
+ _cmp(data.byte(kObjecttype), 2);
+ if (flags.z())
goto describe;
- context.es = context.data.word(kSetdesc);
- context.si = (0);
- context.cx = (0+(130*2));
- context._cmp(context.data.byte(kObjecttype), 1);
- if (context.flags.z())
+ es = data.word(kSetdesc);
+ si = (0);
+ cx = (0+(130*2));
+ _cmp(data.byte(kObjecttype), 1);
+ if (flags.z())
goto describe;
- context.es = context.data.word(kExtras);
- context.si = (0+2080+30000+(16*114));
- context.cx = (0+2080+30000+(16*114)+((114+2)*2));
+ es = data.word(kExtras);
+ si = (0+2080+30000+(16*114));
+ cx = (0+2080+30000+(16*114)+((114+2)*2));
describe:
- context.al = context.data.byte(kCommand);
- context.ah = 0;
- context._add(context.ax, context.ax);
- context._add(context.si, context.ax);
- context.ax = context.es.word(context.si);
- context._add(context.ax, context.cx);
- context.si = context.ax;
- context.bx = context.ax;
+ al = data.byte(kCommand);
+ ah = 0;
+ _add(ax, ax);
+ _add(si, ax);
+ ax = es.word(si);
+ _add(ax, cx);
+ si = ax;
+ bx = ax;
tryagain:
- context.push(context.si);
- findnextcolon(context);
- context.al = context.es.byte(context.si);
- context.cx = context.si;
- context.si = context.pop();
- context._cmp(context.data.byte(kObjecttype), 1);
- if (!context.flags.z())
- goto cantmakeoneup;
- context._cmp(context.al, 0);
- if (context.flags.z())
+ push(si);
+ findnextcolon();
+ al = es.byte(si);
+ cx = si;
+ si = pop();
+ _cmp(data.byte(kObjecttype), 1);
+ if (!flags.z())
+ return /* (cantmakeoneup) */;
+ _cmp(al, 0);
+ if (flags.z())
goto findsometext;
- context._cmp(context.al, ':');
- if (context.flags.z())
+ _cmp(al, ':');
+ if (flags.z())
goto findsometext;
-cantmakeoneup:
return;
findsometext:
- searchforsame(context);
+ searchforsame();
goto tryagain;
}
-void searchforsame(Context &context) {
- STACK_CHECK(context);
- context.si = context.cx;
+void DreamGenContext::searchforsame() {
+ STACK_CHECK;
+ si = cx;
searchagain:
- context._inc(context.si);
- context.al = context.es.byte(context.bx);
+ _inc(si);
+ al = es.byte(bx);
search:
- context._cmp(context.es.byte(context.si), context.al);
- if (context.flags.z())
+ _cmp(es.byte(si), al);
+ if (flags.z())
goto gotstartletter;
- context._inc(context.cx);
- context._inc(context.si);
- context._cmp(context.si, 8000);
- if (context.flags.c())
+ _inc(cx);
+ _inc(si);
+ _cmp(si, 8000);
+ if (flags.c())
goto search;
- context.si = context.bx;
- context.ax = context.pop();
+ si = bx;
+ ax = pop();
return;
gotstartletter:
- context.push(context.bx);
- context.push(context.si);
+ push(bx);
+ push(si);
keepchecking:
- context._inc(context.si);
- context._inc(context.bx);
- context.al = context.es.byte(context.bx);
- context.ah = context.es.byte(context.si);
- context._cmp(context.al, ':');
- if (context.flags.z())
+ _inc(si);
+ _inc(bx);
+ al = es.byte(bx);
+ ah = es.byte(si);
+ _cmp(al, ':');
+ if (flags.z())
goto foundmatch;
- context._cmp(context.al, 0);
- if (context.flags.z())
+ _cmp(al, 0);
+ if (flags.z())
goto foundmatch;
- context._cmp(context.al, context.ah);
- if (context.flags.z())
+ _cmp(al, ah);
+ if (flags.z())
goto keepchecking;
- context.si = context.pop();
- context.bx = context.pop();
+ si = pop();
+ bx = pop();
goto searchagain;
foundmatch:
- context.si = context.pop();
- context.bx = context.pop();
+ si = pop();
+ bx = pop();
}
-void findnextcolon(Context &context) {
- STACK_CHECK(context);
+void DreamGenContext::findnextcolon() {
+ STACK_CHECK;
isntcolon:
- context.al = context.es.byte(context.si);
- context._inc(context.si);
- context._cmp(context.al, 0);
- if (context.flags.z())
- goto endofcolon;
- context._cmp(context.al, ':');
- if (!context.flags.z())
+ al = es.byte(si);
+ _inc(si);
+ _cmp(al, 0);
+ if (flags.z())
+ return /* (endofcolon) */;
+ _cmp(al, ':');
+ if (!flags.z())
goto isntcolon;
-endofcolon:
- return;
}
-void inventory(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kMandead), 1);
- if (context.flags.z())
+void DreamGenContext::inventory() {
+ STACK_CHECK;
+ _cmp(data.byte(kMandead), 1);
+ if (flags.z())
goto iswatchinv;
- context._cmp(context.data.word(kWatchingtime), 0);
- if (context.flags.z())
+ _cmp(data.word(kWatchingtime), 0);
+ if (flags.z())
goto notwatchinv;
iswatchinv:
- blank(context);
+ blank();
return;
notwatchinv:
- context._cmp(context.data.byte(kCommandtype), 239);
- if (context.flags.z())
+ _cmp(data.byte(kCommandtype), 239);
+ if (flags.z())
goto alreadyopinv;
- context.data.byte(kCommandtype) = 239;
- context.al = 32;
- commandonly(context);
+ data.byte(kCommandtype) = 239;
+ al = 32;
+ commandonly();
alreadyopinv:
- context.ax = context.data.word(kMousebutton);
- context._cmp(context.ax, context.data.word(kOldbutton));
- if (context.flags.z())
- goto cantopinv;
- context._and(context.ax, 1);
- if (!context.flags.z())
+ ax = data.word(kMousebutton);
+ _cmp(ax, data.word(kOldbutton));
+ if (flags.z())
+ return /* (cantopinv) */;
+ _and(ax, 1);
+ if (!flags.z())
goto doopeninv;
-cantopinv:
return;
doopeninv:
- context.data.word(kTimecount) = 0;
- context.data.byte(kPointermode) = 0;
- context.data.byte(kInmaparea) = 0;
- animpointer(context);
- createpanel(context);
- showpanel(context);
- examicon(context);
- showman(context);
- showexit(context);
- undertextline(context);
- context.data.byte(kPickup) = 0;
- context.data.byte(kInvopen) = 2;
- openinv(context);
- readmouse(context);
- showpointer(context);
- worktoscreen(context);
- delpointer(context);
- context.data.byte(kOpenedob) = 255;
+ data.word(kTimecount) = 0;
+ data.byte(kPointermode) = 0;
+ data.byte(kInmaparea) = 0;
+ animpointer();
+ createpanel();
+ showpanel();
+ examicon();
+ showman();
+ showexit();
+ undertextline();
+ data.byte(kPickup) = 0;
+ data.byte(kInvopen) = 2;
+ openinv();
+ readmouse();
+ showpointer();
+ worktoscreen();
+ delpointer();
+ data.byte(kOpenedob) = 255;
goto waitexam;
/*continuing to unbounded code: examineagain from examineob:3-66*/
examineagain:
- context.data.byte(kInmaparea) = 0;
- context.data.byte(kExamagain) = 0;
- context.data.byte(kOpenedob) = 255;
- context.data.byte(kOpenedtype) = 255;
- context.data.byte(kInvopen) = 0;
- context.al = context.data.byte(kCommandtype);
- context.data.byte(kObjecttype) = context.al;
- context.data.byte(kItemframe) = 0;
- context.data.byte(kPointerframe) = 0;
- createpanel(context);
- showpanel(context);
- showman(context);
- showexit(context);
- obicons(context);
- obpicture(context);
- describeob(context);
- undertextline(context);
- context.data.byte(kCommandtype) = 255;
- readmouse(context);
- showpointer(context);
- worktoscreen(context);
- delpointer(context);
+ data.byte(kInmaparea) = 0;
+ data.byte(kExamagain) = 0;
+ data.byte(kOpenedob) = 255;
+ data.byte(kOpenedtype) = 255;
+ data.byte(kInvopen) = 0;
+ al = data.byte(kCommandtype);
+ data.byte(kObjecttype) = al;
+ data.byte(kItemframe) = 0;
+ data.byte(kPointerframe) = 0;
+ createpanel();
+ showpanel();
+ showman();
+ showexit();
+ obicons();
+ obpicture();
+ describeob();
+ undertextline();
+ data.byte(kCommandtype) = 255;
+ readmouse();
+ showpointer();
+ worktoscreen();
+ delpointer();
waitexam:
- readmouse(context);
- showpointer(context);
- vsync(context);
- dumppointer(context);
- dumptextline(context);
- delpointer(context);
- context.data.byte(kGetback) = 0;
- context.bx = 2494;
- context._cmp(context.data.byte(kInvopen), 0);
- if (context.flags.z())
+ readmouse();
+ showpointer();
+ vsync();
+ dumppointer();
+ dumptextline();
+ delpointer();
+ data.byte(kGetback) = 0;
+ bx = 2494;
+ _cmp(data.byte(kInvopen), 0);
+ if (flags.z())
goto notuseinv;
- context.bx = 2556;
- context._cmp(context.data.byte(kInvopen), 1);
- if (context.flags.z())
+ bx = 2556;
+ _cmp(data.byte(kInvopen), 1);
+ if (flags.z())
goto notuseinv;
- context.bx = 2618;
+ bx = 2618;
notuseinv:
- checkcoords(context);
- context._cmp(context.data.byte(kExamagain), 0);
- if (context.flags.z())
+ checkcoords();
+ _cmp(data.byte(kExamagain), 0);
+ if (flags.z())
goto norex;
goto examineagain;
norex:
- context._cmp(context.data.byte(kGetback), 0);
- if (context.flags.z())
+ _cmp(data.byte(kGetback), 0);
+ if (flags.z())
goto waitexam;
- context.data.byte(kPickup) = 0;
- context._cmp(context.data.word(kWatchingtime), 0);
- if (!context.flags.z())
+ data.byte(kPickup) = 0;
+ _cmp(data.word(kWatchingtime), 0);
+ if (!flags.z())
goto iswatching;
- context._cmp(context.data.byte(kNewlocation), 255);
- if (!context.flags.z())
+ _cmp(data.byte(kNewlocation), 255);
+ if (!flags.z())
goto justgetback;
iswatching:
- makemainscreen(context);
- context.data.byte(kInvopen) = 0;
- context.data.byte(kOpenedob) = 255;
+ makemainscreen();
+ data.byte(kInvopen) = 0;
+ data.byte(kOpenedob) = 255;
return;
justgetback:
- context.data.byte(kInvopen) = 0;
- context.data.byte(kOpenedob) = 255;
- return;
-examlist:
-invlist1:
-openchangesize:
-withlist1:
- return;
+ data.byte(kInvopen) = 0;
+ data.byte(kOpenedob) = 255;
}
-void setpickup(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kObjecttype), 1);
- if (context.flags.z())
+void DreamGenContext::setpickup() {
+ STACK_CHECK;
+ _cmp(data.byte(kObjecttype), 1);
+ if (flags.z())
goto cantpick;
- context._cmp(context.data.byte(kObjecttype), 3);
- if (context.flags.z())
+ _cmp(data.byte(kObjecttype), 3);
+ if (flags.z())
goto cantpick;
- getanyad(context);
- context.al = context.es.byte(context.bx+2);
- context._cmp(context.al, 4);
- if (!context.flags.z())
+ getanyad();
+ al = es.byte(bx+2);
+ _cmp(al, 4);
+ if (!flags.z())
goto canpick;
cantpick:
- blank(context);
+ blank();
return;
canpick:
- context._cmp(context.data.byte(kCommandtype), 209);
- if (context.flags.z())
+ _cmp(data.byte(kCommandtype), 209);
+ if (flags.z())
goto alreadysp;
- context.data.byte(kCommandtype) = 209;
- context.bl = context.data.byte(kCommand);
- context.bh = context.data.byte(kObjecttype);
- context.al = 33;
- commandwithob(context);
+ data.byte(kCommandtype) = 209;
+ bl = data.byte(kCommand);
+ bh = data.byte(kObjecttype);
+ al = 33;
+ commandwithob();
alreadysp:
- context.ax = context.data.word(kMousebutton);
- context._cmp(context.ax, 1);
- if (!context.flags.z())
- goto nosetpick;
- context._cmp(context.ax, context.data.word(kOldbutton));
- if (!context.flags.z())
+ ax = data.word(kMousebutton);
+ _cmp(ax, 1);
+ if (!flags.z())
+ return /* (nosetpick) */;
+ _cmp(ax, data.word(kOldbutton));
+ if (!flags.z())
goto dosetpick;
-nosetpick:
return;
dosetpick:
- createpanel(context);
- showpanel(context);
- showman(context);
- showexit(context);
- examicon(context);
- context.data.byte(kPickup) = 1;
- context.data.byte(kInvopen) = 2;
- context._cmp(context.data.byte(kObjecttype), 4);
- if (context.flags.z())
+ createpanel();
+ showpanel();
+ showman();
+ showexit();
+ examicon();
+ data.byte(kPickup) = 1;
+ data.byte(kInvopen) = 2;
+ _cmp(data.byte(kObjecttype), 4);
+ if (flags.z())
goto pickupexob;
- context.al = context.data.byte(kCommand);
- context.data.byte(kItemframe) = context.al;
- context.data.byte(kOpenedob) = 255;
- transfertoex(context);
- context.data.byte(kItemframe) = context.al;
- context.data.byte(kObjecttype) = 4;
- geteitherad(context);
- context.es.byte(context.bx+2) = 20;
- context.es.byte(context.bx+3) = 255;
- openinv(context);
- worktoscreenm(context);
+ al = data.byte(kCommand);
+ data.byte(kItemframe) = al;
+ data.byte(kOpenedob) = 255;
+ transfertoex();
+ data.byte(kItemframe) = al;
+ data.byte(kObjecttype) = 4;
+ geteitherad();
+ es.byte(bx+2) = 20;
+ es.byte(bx+3) = 255;
+ openinv();
+ worktoscreenm();
return;
pickupexob:
- context.al = context.data.byte(kCommand);
- context.data.byte(kItemframe) = context.al;
- context.data.byte(kOpenedob) = 255;
- openinv(context);
- worktoscreenm(context);
+ al = data.byte(kCommand);
+ data.byte(kItemframe) = al;
+ data.byte(kOpenedob) = 255;
+ openinv();
+ worktoscreenm();
}
-void examinventory(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kCommandtype), 249);
- if (context.flags.z())
+void DreamGenContext::examinventory() {
+ STACK_CHECK;
+ _cmp(data.byte(kCommandtype), 249);
+ if (flags.z())
goto alreadyexinv;
- context.data.byte(kCommandtype) = 249;
- context.al = 32;
- commandonly(context);
+ data.byte(kCommandtype) = 249;
+ al = 32;
+ commandonly();
alreadyexinv:
- context.ax = context.data.word(kMousebutton);
- context._and(context.ax, 1);
- if (!context.flags.z())
+ ax = data.word(kMousebutton);
+ _and(ax, 1);
+ if (!flags.z())
goto doexinv;
return;
doexinv:
- createpanel(context);
- showpanel(context);
- showman(context);
- showexit(context);
- examicon(context);
- context.data.byte(kPickup) = 0;
- context.data.byte(kInvopen) = 2;
- openinv(context);
- worktoscreenm(context);
-}
-
-void reexfrominv(Context &context) {
- STACK_CHECK(context);
- findinvpos(context);
- context.ax = context.es.word(context.bx);
- context.data.byte(kCommandtype) = context.ah;
- context.data.byte(kCommand) = context.al;
- context.data.byte(kExamagain) = 1;
- context.data.byte(kPointermode) = 0;
-}
-
-void reexfromopen(Context &context) {
- STACK_CHECK(context);
- return;
- findopenpos(context);
- context.ax = context.es.word(context.bx);
- context.data.byte(kCommandtype) = context.ah;
- context.data.byte(kCommand) = context.al;
- context.data.byte(kExamagain) = 1;
- context.data.byte(kPointermode) = 0;
-}
-
-void swapwithinv(Context &context) {
- STACK_CHECK(context);
- context.al = context.data.byte(kItemframe);
- context.ah = context.data.byte(kObjecttype);
- context._cmp(context.ax, context.data.word(kOldsubject));
- if (!context.flags.z())
+ createpanel();
+ showpanel();
+ showman();
+ showexit();
+ examicon();
+ data.byte(kPickup) = 0;
+ data.byte(kInvopen) = 2;
+ openinv();
+ worktoscreenm();
+}
+
+void DreamGenContext::reexfrominv() {
+ STACK_CHECK;
+ findinvpos();
+ ax = es.word(bx);
+ data.byte(kCommandtype) = ah;
+ data.byte(kCommand) = al;
+ data.byte(kExamagain) = 1;
+ data.byte(kPointermode) = 0;
+}
+
+void DreamGenContext::reexfromopen() {
+ STACK_CHECK;
+ return;
+ findopenpos();
+ ax = es.word(bx);
+ data.byte(kCommandtype) = ah;
+ data.byte(kCommand) = al;
+ data.byte(kExamagain) = 1;
+ data.byte(kPointermode) = 0;
+}
+
+void DreamGenContext::swapwithinv() {
+ STACK_CHECK;
+ al = data.byte(kItemframe);
+ ah = data.byte(kObjecttype);
+ _cmp(ax, data.word(kOldsubject));
+ if (!flags.z())
goto difsub7;
- context._cmp(context.data.byte(kCommandtype), 243);
- if (context.flags.z())
+ _cmp(data.byte(kCommandtype), 243);
+ if (flags.z())
goto alreadyswap1;
- context.data.byte(kCommandtype) = 243;
+ data.byte(kCommandtype) = 243;
difsub7:
- context.data.word(kOldsubject) = context.ax;
- context.bx = context.ax;
- context.al = 34;
- commandwithob(context);
+ data.word(kOldsubject) = ax;
+ bx = ax;
+ al = 34;
+ commandwithob();
alreadyswap1:
- context.ax = context.data.word(kMousebutton);
- context._cmp(context.ax, context.data.word(kOldbutton));
- if (context.flags.z())
- goto cantswap1;
- context._and(context.ax, 1);
- if (!context.flags.z())
+ ax = data.word(kMousebutton);
+ _cmp(ax, data.word(kOldbutton));
+ if (flags.z())
+ return /* (cantswap1) */;
+ _and(ax, 1);
+ if (!flags.z())
goto doswap1;
-cantswap1:
return;
doswap1:
- context.ah = context.data.byte(kObjecttype);
- context.al = context.data.byte(kItemframe);
- context.push(context.ax);
- findinvpos(context);
- context.ax = context.es.word(context.bx);
- context.data.byte(kItemframe) = context.al;
- context.data.byte(kObjecttype) = context.ah;
- geteitherad(context);
- context.es.byte(context.bx+2) = 20;
- context.es.byte(context.bx+3) = 255;
- context.bl = context.data.byte(kItemframe);
- context.bh = context.data.byte(kObjecttype);
- context.ax = context.pop();
- context.data.byte(kObjecttype) = context.ah;
- context.data.byte(kItemframe) = context.al;
- context.push(context.bx);
- findinvpos(context);
- delpointer(context);
- context.al = context.data.byte(kItemframe);
- geteitherad(context);
- context.es.byte(context.bx+2) = 4;
- context.es.byte(context.bx+3) = 255;
- context.al = context.data.byte(kLastinvpos);
- context.es.byte(context.bx+4) = context.al;
- context.ax = context.pop();
- context.data.byte(kObjecttype) = context.ah;
- context.data.byte(kItemframe) = context.al;
- fillryan(context);
- readmouse(context);
- showpointer(context);
- worktoscreen(context);
- delpointer(context);
-}
-
-void swapwithopen(Context &context) {
- STACK_CHECK(context);
- context.al = context.data.byte(kItemframe);
- context.ah = context.data.byte(kObjecttype);
- context._cmp(context.ax, context.data.word(kOldsubject));
- if (!context.flags.z())
+ ah = data.byte(kObjecttype);
+ al = data.byte(kItemframe);
+ push(ax);
+ findinvpos();
+ ax = es.word(bx);
+ data.byte(kItemframe) = al;
+ data.byte(kObjecttype) = ah;
+ geteitherad();
+ es.byte(bx+2) = 20;
+ es.byte(bx+3) = 255;
+ bl = data.byte(kItemframe);
+ bh = data.byte(kObjecttype);
+ ax = pop();
+ data.byte(kObjecttype) = ah;
+ data.byte(kItemframe) = al;
+ push(bx);
+ findinvpos();
+ delpointer();
+ al = data.byte(kItemframe);
+ geteitherad();
+ es.byte(bx+2) = 4;
+ es.byte(bx+3) = 255;
+ al = data.byte(kLastinvpos);
+ es.byte(bx+4) = al;
+ ax = pop();
+ data.byte(kObjecttype) = ah;
+ data.byte(kItemframe) = al;
+ fillryan();
+ readmouse();
+ showpointer();
+ worktoscreen();
+ delpointer();
+}
+
+void DreamGenContext::swapwithopen() {
+ STACK_CHECK;
+ al = data.byte(kItemframe);
+ ah = data.byte(kObjecttype);
+ _cmp(ax, data.word(kOldsubject));
+ if (!flags.z())
goto difsub8;
- context._cmp(context.data.byte(kCommandtype), 242);
- if (context.flags.z())
+ _cmp(data.byte(kCommandtype), 242);
+ if (flags.z())
goto alreadyswap2;
- context.data.byte(kCommandtype) = 242;
+ data.byte(kCommandtype) = 242;
difsub8:
- context.data.word(kOldsubject) = context.ax;
- context.bx = context.ax;
- context.al = 34;
- commandwithob(context);
+ data.word(kOldsubject) = ax;
+ bx = ax;
+ al = 34;
+ commandwithob();
alreadyswap2:
- context.ax = context.data.word(kMousebutton);
- context._cmp(context.ax, context.data.word(kOldbutton));
- if (context.flags.z())
- goto cantswap2;
- context._and(context.ax, 1);
- if (!context.flags.z())
+ ax = data.word(kMousebutton);
+ _cmp(ax, data.word(kOldbutton));
+ if (flags.z())
+ return /* (cantswap2) */;
+ _and(ax, 1);
+ if (!flags.z())
goto doswap2;
-cantswap2:
return;
doswap2:
- geteitherad(context);
- isitworn(context);
- if (!context.flags.z())
+ geteitherad();
+ isitworn();
+ if (!flags.z())
goto notwornswap;
- wornerror(context);
+ wornerror();
return;
notwornswap:
- delpointer(context);
- context.al = context.data.byte(kItemframe);
- context._cmp(context.al, context.data.byte(kOpenedob));
- if (!context.flags.z())
+ delpointer();
+ al = data.byte(kItemframe);
+ _cmp(al, data.byte(kOpenedob));
+ if (!flags.z())
goto isntsame2;
- context.al = context.data.byte(kObjecttype);
- context._cmp(context.al, context.data.byte(kOpenedtype));
- if (!context.flags.z())
+ al = data.byte(kObjecttype);
+ _cmp(al, data.byte(kOpenedtype));
+ if (!flags.z())
goto isntsame2;
- errormessage1(context);
+ errormessage1();
return;
isntsame2:
- checkobjectsize(context);
- context._cmp(context.al, 0);
- if (context.flags.z())
+ checkobjectsize();
+ _cmp(al, 0);
+ if (flags.z())
goto sizeok2;
return;
sizeok2:
- context.ah = context.data.byte(kObjecttype);
- context.al = context.data.byte(kItemframe);
- context.push(context.ax);
- findopenpos(context);
- context.ax = context.es.word(context.bx);
- context.data.byte(kItemframe) = context.al;
- context.data.byte(kObjecttype) = context.ah;
- context._cmp(context.ah, 4);
- if (!context.flags.z())
+ ah = data.byte(kObjecttype);
+ al = data.byte(kItemframe);
+ push(ax);
+ findopenpos();
+ ax = es.word(bx);
+ data.byte(kItemframe) = al;
+ data.byte(kObjecttype) = ah;
+ _cmp(ah, 4);
+ if (!flags.z())
goto makeswapex;
- geteitherad(context);
- context.es.byte(context.bx+2) = 20;
- context.es.byte(context.bx+3) = 255;
+ geteitherad();
+ es.byte(bx+2) = 20;
+ es.byte(bx+3) = 255;
goto actuallyswap;
makeswapex:
- transfertoex(context);
- context.data.byte(kItemframe) = context.al;
- context.data.byte(kObjecttype) = 4;
- geteitherad(context);
- context.es.byte(context.bx+2) = 20;
- context.es.byte(context.bx+3) = 255;
+ transfertoex();
+ data.byte(kItemframe) = al;
+ data.byte(kObjecttype) = 4;
+ geteitherad();
+ es.byte(bx+2) = 20;
+ es.byte(bx+3) = 255;
actuallyswap:
- context.bl = context.data.byte(kItemframe);
- context.bh = context.data.byte(kObjecttype);
- context.ax = context.pop();
- context.data.byte(kObjecttype) = context.ah;
- context.data.byte(kItemframe) = context.al;
- context.push(context.bx);
- findopenpos(context);
- geteitherad(context);
- context.al = context.data.byte(kOpenedtype);
- context.es.byte(context.bx+2) = context.al;
- context.al = context.data.byte(kOpenedob);
- context.es.byte(context.bx+3) = context.al;
- context.al = context.data.byte(kLastinvpos);
- context.es.byte(context.bx+4) = context.al;
- context.al = context.data.byte(kReallocation);
- context.es.byte(context.bx+5) = context.al;
- context.ax = context.pop();
- context.data.byte(kObjecttype) = context.ah;
- context.data.byte(kItemframe) = context.al;
- fillopen(context);
- fillryan(context);
- undertextline(context);
- readmouse(context);
- useopened(context);
- showpointer(context);
- worktoscreen(context);
- delpointer(context);
-}
-
-void intoinv(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kPickup), 0);
- if (!context.flags.z())
+ bl = data.byte(kItemframe);
+ bh = data.byte(kObjecttype);
+ ax = pop();
+ data.byte(kObjecttype) = ah;
+ data.byte(kItemframe) = al;
+ push(bx);
+ findopenpos();
+ geteitherad();
+ al = data.byte(kOpenedtype);
+ es.byte(bx+2) = al;
+ al = data.byte(kOpenedob);
+ es.byte(bx+3) = al;
+ al = data.byte(kLastinvpos);
+ es.byte(bx+4) = al;
+ al = data.byte(kReallocation);
+ es.byte(bx+5) = al;
+ ax = pop();
+ data.byte(kObjecttype) = ah;
+ data.byte(kItemframe) = al;
+ fillopen();
+ fillryan();
+ undertextline();
+ readmouse();
+ useopened();
+ showpointer();
+ worktoscreen();
+ delpointer();
+}
+
+void DreamGenContext::intoinv() {
+ STACK_CHECK;
+ _cmp(data.byte(kPickup), 0);
+ if (!flags.z())
goto notout;
- outofinv(context);
+ outofinv();
return;
notout:
- findinvpos(context);
- context.ax = context.es.word(context.bx);
- context._cmp(context.al, 255);
- if (context.flags.z())
+ findinvpos();
+ ax = es.word(bx);
+ _cmp(al, 255);
+ if (flags.z())
goto canplace1;
- swapwithinv(context);
+ swapwithinv();
return;
canplace1:
- context.al = context.data.byte(kItemframe);
- context.ah = context.data.byte(kObjecttype);
- context._cmp(context.ax, context.data.word(kOldsubject));
- if (!context.flags.z())
+ al = data.byte(kItemframe);
+ ah = data.byte(kObjecttype);
+ _cmp(ax, data.word(kOldsubject));
+ if (!flags.z())
goto difsub1;
- context._cmp(context.data.byte(kCommandtype), 220);
- if (context.flags.z())
+ _cmp(data.byte(kCommandtype), 220);
+ if (flags.z())
goto alreadyplce;
- context.data.byte(kCommandtype) = 220;
+ data.byte(kCommandtype) = 220;
difsub1:
- context.data.word(kOldsubject) = context.ax;
- context.bx = context.ax;
- context.al = 35;
- commandwithob(context);
+ data.word(kOldsubject) = ax;
+ bx = ax;
+ al = 35;
+ commandwithob();
alreadyplce:
- context.ax = context.data.word(kMousebutton);
- context._cmp(context.ax, context.data.word(kOldbutton));
- if (context.flags.z())
- goto notletgo2;
- context._and(context.ax, 1);
- if (!context.flags.z())
+ ax = data.word(kMousebutton);
+ _cmp(ax, data.word(kOldbutton));
+ if (flags.z())
+ return /* (notletgo2) */;
+ _and(ax, 1);
+ if (!flags.z())
goto doplace;
-notletgo2:
return;
doplace:
- delpointer(context);
- context.al = context.data.byte(kItemframe);
- getexad(context);
- context.es.byte(context.bx+2) = 4;
- context.es.byte(context.bx+3) = 255;
- context.al = context.data.byte(kLastinvpos);
- context.es.byte(context.bx+4) = context.al;
- context.data.byte(kPickup) = 0;
- fillryan(context);
- readmouse(context);
- showpointer(context);
- outofinv(context);
- worktoscreen(context);
- delpointer(context);
-}
-
-void deletetaken(Context &context) {
- STACK_CHECK(context);
- context.es = context.data.word(kFreedat);
- context.ah = context.data.byte(kReallocation);
- context.ds = context.data.word(kExtras);
- context.si = (0+2080+30000);
- context.cx = (114);
+ delpointer();
+ al = data.byte(kItemframe);
+ getexad();
+ es.byte(bx+2) = 4;
+ es.byte(bx+3) = 255;
+ al = data.byte(kLastinvpos);
+ es.byte(bx+4) = al;
+ data.byte(kPickup) = 0;
+ fillryan();
+ readmouse();
+ showpointer();
+ outofinv();
+ worktoscreen();
+ delpointer();
+}
+
+void DreamGenContext::deletetaken() {
+ STACK_CHECK;
+ es = data.word(kFreedat);
+ ah = data.byte(kReallocation);
+ ds = data.word(kExtras);
+ si = (0+2080+30000);
+ cx = (114);
takenloop:
- context.al = context.ds.byte(context.si+11);
- context._cmp(context.al, context.ah);
- if (!context.flags.z())
+ al = ds.byte(si+11);
+ _cmp(al, ah);
+ if (!flags.z())
goto notinhere;
- context.bl = context.ds.byte(context.si+1);
- context.bh = 0;
- context._add(context.bx, context.bx);
- context._add(context.bx, context.bx);
- context._add(context.bx, context.bx);
- context._add(context.bx, context.bx);
- context.es.byte(context.bx+2) = 254;
+ bl = ds.byte(si+1);
+ bh = 0;
+ _add(bx, bx);
+ _add(bx, bx);
+ _add(bx, bx);
+ _add(bx, bx);
+ es.byte(bx+2) = 254;
notinhere:
- context._add(context.si, 16);
- if (--context.cx)
+ _add(si, 16);
+ if (--cx)
goto takenloop;
}
-void outofinv(Context &context) {
- STACK_CHECK(context);
- findinvpos(context);
- context.ax = context.es.word(context.bx);
- context._cmp(context.al, 255);
- if (!context.flags.z())
+void DreamGenContext::outofinv() {
+ STACK_CHECK;
+ findinvpos();
+ ax = es.word(bx);
+ _cmp(al, 255);
+ if (!flags.z())
goto canpick2;
- blank(context);
+ blank();
return;
canpick2:
- context.bx = context.data.word(kMousebutton);
- context._cmp(context.bx, 2);
- if (!context.flags.z())
+ bx = data.word(kMousebutton);
+ _cmp(bx, 2);
+ if (!flags.z())
goto canpick2a;
- reexfrominv(context);
+ reexfrominv();
return;
canpick2a:
- context._cmp(context.ax, context.data.word(kOldsubject));
- if (!context.flags.z())
+ _cmp(ax, data.word(kOldsubject));
+ if (!flags.z())
goto difsub3;
- context._cmp(context.data.byte(kCommandtype), 221);
- if (context.flags.z())
+ _cmp(data.byte(kCommandtype), 221);
+ if (flags.z())
goto alreadygrab;
- context.data.byte(kCommandtype) = 221;
+ data.byte(kCommandtype) = 221;
difsub3:
- context.data.word(kOldsubject) = context.ax;
- context.bx = context.ax;
- context.al = 36;
- commandwithob(context);
+ data.word(kOldsubject) = ax;
+ bx = ax;
+ al = 36;
+ commandwithob();
alreadygrab:
- context.ax = context.data.word(kMousebutton);
- context._cmp(context.ax, context.data.word(kOldbutton));
- if (context.flags.z())
- goto notletgo;
- context._and(context.ax, 1);
- if (!context.flags.z())
+ ax = data.word(kMousebutton);
+ _cmp(ax, data.word(kOldbutton));
+ if (flags.z())
+ return /* (notletgo) */;
+ _and(ax, 1);
+ if (!flags.z())
goto dograb;
-notletgo:
return;
dograb:
- delpointer(context);
- context.data.byte(kPickup) = 1;
- findinvpos(context);
- context.ax = context.es.word(context.bx);
- context.data.byte(kItemframe) = context.al;
- context.data.byte(kObjecttype) = context.ah;
- getexad(context);
- context.es.byte(context.bx+2) = 20;
- context.es.byte(context.bx+3) = 255;
- fillryan(context);
- readmouse(context);
- showpointer(context);
- intoinv(context);
- worktoscreen(context);
- delpointer(context);
-}
-
-void getfreead(Context &context) {
- STACK_CHECK(context);
- context.ah = 0;
- context.cl = 4;
- context._shl(context.ax, context.cl);
- context.bx = context.ax;
- context.es = context.data.word(kFreedat);
-}
-
-void getexad(Context &context) {
- STACK_CHECK(context);
- context.ah = 0;
- context.bx = 16;
- context._mul(context.bx);
- context.bx = context.ax;
- context.es = context.data.word(kExtras);
- context._add(context.bx, (0+2080+30000));
-}
-
-void geteitherad(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kObjecttype), 4);
- if (context.flags.z())
+ delpointer();
+ data.byte(kPickup) = 1;
+ findinvpos();
+ ax = es.word(bx);
+ data.byte(kItemframe) = al;
+ data.byte(kObjecttype) = ah;
+ getexad();
+ es.byte(bx+2) = 20;
+ es.byte(bx+3) = 255;
+ fillryan();
+ readmouse();
+ showpointer();
+ intoinv();
+ worktoscreen();
+ delpointer();
+}
+
+void DreamGenContext::getfreead() {
+ STACK_CHECK;
+ ah = 0;
+ cl = 4;
+ _shl(ax, cl);
+ bx = ax;
+ es = data.word(kFreedat);
+}
+
+void DreamGenContext::getexad() {
+ STACK_CHECK;
+ ah = 0;
+ bx = 16;
+ _mul(bx);
+ bx = ax;
+ es = data.word(kExtras);
+ _add(bx, (0+2080+30000));
+}
+
+void DreamGenContext::geteitherad() {
+ STACK_CHECK;
+ _cmp(data.byte(kObjecttype), 4);
+ if (flags.z())
goto isinexlist;
- context.al = context.data.byte(kItemframe);
- getfreead(context);
+ al = data.byte(kItemframe);
+ getfreead();
return;
isinexlist:
- context.al = context.data.byte(kItemframe);
- getexad(context);
+ al = data.byte(kItemframe);
+ getexad();
}
-void getanyad(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kObjecttype), 4);
- if (context.flags.z())
+void DreamGenContext::getanyad() {
+ STACK_CHECK;
+ _cmp(data.byte(kObjecttype), 4);
+ if (flags.z())
goto isex;
- context._cmp(context.data.byte(kObjecttype), 2);
- if (context.flags.z())
+ _cmp(data.byte(kObjecttype), 2);
+ if (flags.z())
goto isfree;
- context.al = context.data.byte(kCommand);
- getsetad(context);
- context.ax = context.es.word(context.bx+4);
+ al = data.byte(kCommand);
+ getsetad();
+ ax = es.word(bx+4);
return;
isfree:
- context.al = context.data.byte(kCommand);
- getfreead(context);
- context.ax = context.es.word(context.bx+7);
+ al = data.byte(kCommand);
+ getfreead();
+ ax = es.word(bx+7);
return;
isex:
- context.al = context.data.byte(kCommand);
- getexad(context);
- context.ax = context.es.word(context.bx+7);
+ al = data.byte(kCommand);
+ getexad();
+ ax = es.word(bx+7);
}
-void getanyaddir(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.ah, 4);
- if (context.flags.z())
+void DreamGenContext::getanyaddir() {
+ STACK_CHECK;
+ _cmp(ah, 4);
+ if (flags.z())
goto isex3;
- context._cmp(context.ah, 2);
- if (context.flags.z())
+ _cmp(ah, 2);
+ if (flags.z())
goto isfree3;
- getsetad(context);
+ getsetad();
return;
isfree3:
- getfreead(context);
+ getfreead();
return;
isex3:
- getexad(context);
+ getexad();
}
-void getopenedsize(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kOpenedtype), 4);
- if (context.flags.z())
+void DreamGenContext::getopenedsize() {
+ STACK_CHECK;
+ _cmp(data.byte(kOpenedtype), 4);
+ if (flags.z())
goto isex2;
- context._cmp(context.data.byte(kOpenedtype), 2);
- if (context.flags.z())
+ _cmp(data.byte(kOpenedtype), 2);
+ if (flags.z())
goto isfree2;
- context.al = context.data.byte(kOpenedob);
- getsetad(context);
- context.ax = context.es.word(context.bx+3);
+ al = data.byte(kOpenedob);
+ getsetad();
+ ax = es.word(bx+3);
return;
isfree2:
- context.al = context.data.byte(kOpenedob);
- getfreead(context);
- context.ax = context.es.word(context.bx+7);
+ al = data.byte(kOpenedob);
+ getfreead();
+ ax = es.word(bx+7);
return;
isex2:
- context.al = context.data.byte(kOpenedob);
- getexad(context);
- context.ax = context.es.word(context.bx+7);
+ al = data.byte(kOpenedob);
+ getexad();
+ ax = es.word(bx+7);
}
-void getsetad(Context &context) {
- STACK_CHECK(context);
- context.ah = 0;
- context.bx = 64;
- context._mul(context.bx);
- context.bx = context.ax;
- context.es = context.data.word(kSetdat);
+void DreamGenContext::getsetad() {
+ STACK_CHECK;
+ ah = 0;
+ bx = 64;
+ _mul(bx);
+ bx = ax;
+ es = data.word(kSetdat);
}
-void findinvpos(Context &context) {
- STACK_CHECK(context);
- context.cx = context.data.word(kMousex);
- context._sub(context.cx, (80));
- context.bx = -1;
+void DreamGenContext::findinvpos() {
+ STACK_CHECK;
+ cx = data.word(kMousex);
+ _sub(cx, (80));
+ bx = -1;
findinv1:
- context._inc(context.bx);
- context._sub(context.cx, (44));
- if (!context.flags.c())
+ _inc(bx);
+ _sub(cx, (44));
+ if (!flags.c())
goto findinv1;
- context.cx = context.data.word(kMousey);
- context._sub(context.cx, (58));
- context._sub(context.bx, 5);
+ cx = data.word(kMousey);
+ _sub(cx, (58));
+ _sub(bx, 5);
findinv2:
- context._add(context.bx, 5);
- context._sub(context.cx, (44));
- if (!context.flags.c())
+ _add(bx, 5);
+ _sub(cx, (44));
+ if (!flags.c())
goto findinv2;
- context.al = context.data.byte(kRyanpage);
- context.ah = 0;
- context.cx = 10;
- context._mul(context.cx);
- context._add(context.bx, context.ax);
- context.al = context.bl;
- context.data.byte(kLastinvpos) = context.al;
- context._add(context.bx, context.bx);
- context.es = context.data.word(kBuffers);
- context._add(context.bx, (0+(180*10)+32));
-}
-
-void findopenpos(Context &context) {
- STACK_CHECK(context);
- context.cx = context.data.word(kMousex);
- context._sub(context.cx, (80));
- context.bx = -1;
+ al = data.byte(kRyanpage);
+ ah = 0;
+ cx = 10;
+ _mul(cx);
+ _add(bx, ax);
+ al = bl;
+ data.byte(kLastinvpos) = al;
+ _add(bx, bx);
+ es = data.word(kBuffers);
+ _add(bx, (0+(180*10)+32));
+}
+
+void DreamGenContext::findopenpos() {
+ STACK_CHECK;
+ cx = data.word(kMousex);
+ _sub(cx, (80));
+ bx = -1;
findopenp1:
- context._inc(context.bx);
- context._sub(context.cx, (44));
- if (!context.flags.c())
+ _inc(bx);
+ _sub(cx, (44));
+ if (!flags.c())
goto findopenp1;
- context.al = context.bl;
- context.data.byte(kLastinvpos) = context.al;
- context._add(context.bx, context.bx);
- context.es = context.data.word(kBuffers);
- context._add(context.bx, (0+(180*10)));
+ al = bl;
+ data.byte(kLastinvpos) = al;
+ _add(bx, bx);
+ es = data.word(kBuffers);
+ _add(bx, (0+(180*10)));
}
-void dropobject(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kCommandtype), 223);
- if (context.flags.z())
+void DreamGenContext::dropobject() {
+ STACK_CHECK;
+ _cmp(data.byte(kCommandtype), 223);
+ if (flags.z())
goto alreadydrop;
- context.data.byte(kCommandtype) = 223;
- context._cmp(context.data.byte(kPickup), 0);
- if (context.flags.z())
- { blank(context); return; };
- context.bl = context.data.byte(kItemframe);
- context.bh = context.data.byte(kObjecttype);
- context.al = 37;
- commandwithob(context);
+ data.byte(kCommandtype) = 223;
+ _cmp(data.byte(kPickup), 0);
+ if (flags.z())
+ { blank(); return; };
+ bl = data.byte(kItemframe);
+ bh = data.byte(kObjecttype);
+ al = 37;
+ commandwithob();
alreadydrop:
- context.ax = context.data.word(kMousebutton);
- context._cmp(context.ax, context.data.word(kOldbutton));
- if (context.flags.z())
- goto nodrop;
- context._and(context.ax, 1);
- if (!context.flags.z())
+ ax = data.word(kMousebutton);
+ _cmp(ax, data.word(kOldbutton));
+ if (flags.z())
+ return /* (nodrop) */;
+ _and(ax, 1);
+ if (!flags.z())
goto dodrop;
-nodrop:
return;
dodrop:
- geteitherad(context);
- isitworn(context);
- if (!context.flags.z())
+ geteitherad();
+ isitworn();
+ if (!flags.z())
goto nowornerror;
- wornerror(context);
+ wornerror();
return;
nowornerror:
- context._cmp(context.data.byte(kReallocation), 47);
- if (context.flags.z())
+ _cmp(data.byte(kReallocation), 47);
+ if (flags.z())
goto nodrop2;
- context.cl = context.data.byte(kRyanx);
- context._add(context.cl, 12);
- context.ch = context.data.byte(kRyany);
- context._add(context.ch, 12);
- checkone(context);
- context._cmp(context.cl, 2);
- if (context.flags.c())
+ cl = data.byte(kRyanx);
+ _add(cl, 12);
+ ch = data.byte(kRyany);
+ _add(ch, 12);
+ checkone();
+ _cmp(cl, 2);
+ if (flags.c())
goto nodroperror;
nodrop2:
- droperror(context);
+ droperror();
return;
nodroperror:
- context._cmp(context.data.byte(kMapxsize), 64);
- if (!context.flags.z())
+ _cmp(data.byte(kMapxsize), 64);
+ if (!flags.z())
goto notinlift;
- context._cmp(context.data.byte(kMapysize), 64);
- if (!context.flags.z())
+ _cmp(data.byte(kMapysize), 64);
+ if (!flags.z())
goto notinlift;
- droperror(context);
+ droperror();
return;
notinlift:
- context.al = context.data.byte(kItemframe);
- context.ah = 4;
- context.cl = 'G';
- context.ch = 'U';
- context.dl = 'N';
- context.dh = 'A';
- compare(context);
- if (context.flags.z())
- { cantdrop(context); return; };
- context.al = context.data.byte(kItemframe);
- context.ah = 4;
- context.cl = 'S';
- context.ch = 'H';
- context.dl = 'L';
- context.dh = 'D';
- compare(context);
- if (context.flags.z())
- { cantdrop(context); return; };
- context.data.byte(kObjecttype) = 4;
- context.al = context.data.byte(kItemframe);
- getexad(context);
- context.es.byte(context.bx+2) = 0;
- context.al = context.data.byte(kRyanx);
- context._add(context.al, 4);
- context.cl = 4;
- context._shr(context.al, context.cl);
- context._add(context.al, context.data.byte(kMapx));
- context.ah = context.data.byte(kRyany);
- context._add(context.ah, 8);
- context.cl = 4;
- context._shr(context.ah, context.cl);
- context._add(context.ah, context.data.byte(kMapy));
- context.es.byte(context.bx+3) = context.al;
- context.es.byte(context.bx+5) = context.ah;
- context.al = context.data.byte(kRyanx);
- context._add(context.al, 4);
- context._and(context.al, 15);
- context.ah = context.data.byte(kRyany);
- context._add(context.ah, 8);
- context._and(context.ah, 15);
- context.es.byte(context.bx+4) = context.al;
- context.es.byte(context.bx+6) = context.ah;
- context.data.byte(kPickup) = 0;
- context.al = context.data.byte(kReallocation);
- context.es.byte(context.bx) = context.al;
-}
-
-void droperror(Context &context) {
- STACK_CHECK(context);
- context.data.byte(kCommandtype) = 255;
- delpointer(context);
- context.di = 76;
- context.bx = 21;
- context.al = 56;
- context.dl = 240;
- printmessage(context);
- worktoscreenm(context);
- context.cx = 50;
- hangonp(context);
- showpanel(context);
- showman(context);
- examicon(context);
- context.data.byte(kCommandtype) = 255;
- worktoscreenm(context);
-}
-
-void cantdrop(Context &context) {
- STACK_CHECK(context);
- context.data.byte(kCommandtype) = 255;
- delpointer(context);
- context.di = 76;
- context.bx = 21;
- context.al = 24;
- context.dl = 240;
- printmessage(context);
- worktoscreenm(context);
- context.cx = 50;
- hangonp(context);
- showpanel(context);
- showman(context);
- examicon(context);
- context.data.byte(kCommandtype) = 255;
- worktoscreenm(context);
-}
-
-void wornerror(Context &context) {
- STACK_CHECK(context);
- context.data.byte(kCommandtype) = 255;
- delpointer(context);
- context.di = 76;
- context.bx = 21;
- context.al = 57;
- context.dl = 240;
- printmessage(context);
- worktoscreenm(context);
- context.cx = 50;
- hangonp(context);
- showpanel(context);
- showman(context);
- examicon(context);
- context.data.byte(kCommandtype) = 255;
- worktoscreenm(context);
-}
-
-void removeobfrominv(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kCommand), 100);
- if (context.flags.z())
- goto obnotexist;
- getanyad(context);
- context.di = context.bx;
- context.cl = context.data.byte(kCommand);
- context.ch = 0;
- deleteexobject(context);
-obnotexist:
- return;
-}
-
-void selectopenob(Context &context) {
- STACK_CHECK(context);
- context.al = context.data.byte(kCommand);
- getanyad(context);
- context._cmp(context.al, 255);
- if (!context.flags.z())
+ al = data.byte(kItemframe);
+ ah = 4;
+ cl = 'G';
+ ch = 'U';
+ dl = 'N';
+ dh = 'A';
+ compare();
+ if (flags.z())
+ { cantdrop(); return; };
+ al = data.byte(kItemframe);
+ ah = 4;
+ cl = 'S';
+ ch = 'H';
+ dl = 'L';
+ dh = 'D';
+ compare();
+ if (flags.z())
+ { cantdrop(); return; };
+ data.byte(kObjecttype) = 4;
+ al = data.byte(kItemframe);
+ getexad();
+ es.byte(bx+2) = 0;
+ al = data.byte(kRyanx);
+ _add(al, 4);
+ cl = 4;
+ _shr(al, cl);
+ _add(al, data.byte(kMapx));
+ ah = data.byte(kRyany);
+ _add(ah, 8);
+ cl = 4;
+ _shr(ah, cl);
+ _add(ah, data.byte(kMapy));
+ es.byte(bx+3) = al;
+ es.byte(bx+5) = ah;
+ al = data.byte(kRyanx);
+ _add(al, 4);
+ _and(al, 15);
+ ah = data.byte(kRyany);
+ _add(ah, 8);
+ _and(ah, 15);
+ es.byte(bx+4) = al;
+ es.byte(bx+6) = ah;
+ data.byte(kPickup) = 0;
+ al = data.byte(kReallocation);
+ es.byte(bx) = al;
+}
+
+void DreamGenContext::droperror() {
+ STACK_CHECK;
+ data.byte(kCommandtype) = 255;
+ delpointer();
+ di = 76;
+ bx = 21;
+ al = 56;
+ dl = 240;
+ printmessage();
+ worktoscreenm();
+ cx = 50;
+ hangonp();
+ showpanel();
+ showman();
+ examicon();
+ data.byte(kCommandtype) = 255;
+ worktoscreenm();
+}
+
+void DreamGenContext::cantdrop() {
+ STACK_CHECK;
+ data.byte(kCommandtype) = 255;
+ delpointer();
+ di = 76;
+ bx = 21;
+ al = 24;
+ dl = 240;
+ printmessage();
+ worktoscreenm();
+ cx = 50;
+ hangonp();
+ showpanel();
+ showman();
+ examicon();
+ data.byte(kCommandtype) = 255;
+ worktoscreenm();
+}
+
+void DreamGenContext::wornerror() {
+ STACK_CHECK;
+ data.byte(kCommandtype) = 255;
+ delpointer();
+ di = 76;
+ bx = 21;
+ al = 57;
+ dl = 240;
+ printmessage();
+ worktoscreenm();
+ cx = 50;
+ hangonp();
+ showpanel();
+ showman();
+ examicon();
+ data.byte(kCommandtype) = 255;
+ worktoscreenm();
+}
+
+void DreamGenContext::removeobfrominv() {
+ STACK_CHECK;
+ _cmp(data.byte(kCommand), 100);
+ if (flags.z())
+ return /* (obnotexist) */;
+ getanyad();
+ di = bx;
+ cl = data.byte(kCommand);
+ ch = 0;
+ deleteexobject();
+}
+
+void DreamGenContext::selectopenob() {
+ STACK_CHECK;
+ al = data.byte(kCommand);
+ getanyad();
+ _cmp(al, 255);
+ if (!flags.z())
goto canopenit1;
- blank(context);
+ blank();
return;
canopenit1:
- context._cmp(context.data.byte(kCommandtype), 224);
- if (context.flags.z())
+ _cmp(data.byte(kCommandtype), 224);
+ if (flags.z())
goto alreadyopob;
- context.data.byte(kCommandtype) = 224;
- context.bl = context.data.byte(kCommand);
- context.bh = context.data.byte(kObjecttype);
- context.al = 38;
- commandwithob(context);
+ data.byte(kCommandtype) = 224;
+ bl = data.byte(kCommand);
+ bh = data.byte(kObjecttype);
+ al = 38;
+ commandwithob();
alreadyopob:
- context.ax = context.data.word(kMousebutton);
- context._cmp(context.ax, context.data.word(kOldbutton));
- if (context.flags.z())
- goto noopenob;
- context._and(context.ax, 1);
- if (!context.flags.z())
+ ax = data.word(kMousebutton);
+ _cmp(ax, data.word(kOldbutton));
+ if (flags.z())
+ return /* (noopenob) */;
+ _and(ax, 1);
+ if (!flags.z())
goto doopenob;
-noopenob:
return;
doopenob:
- context.al = context.data.byte(kCommand);
- context.data.byte(kOpenedob) = context.al;
- context.al = context.data.byte(kObjecttype);
- context.data.byte(kOpenedtype) = context.al;
- createpanel(context);
- showpanel(context);
- showman(context);
- examicon(context);
- showexit(context);
- openinv(context);
- openob(context);
- undertextline(context);
- readmouse(context);
- showpointer(context);
- worktoscreen(context);
- delpointer(context);
-}
-
-void useopened(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kOpenedob), 255);
- if (context.flags.z())
- goto cannotuseopen;
- context._cmp(context.data.byte(kPickup), 0);
- if (!context.flags.z())
+ al = data.byte(kCommand);
+ data.byte(kOpenedob) = al;
+ al = data.byte(kObjecttype);
+ data.byte(kOpenedtype) = al;
+ createpanel();
+ showpanel();
+ showman();
+ examicon();
+ showexit();
+ openinv();
+ openob();
+ undertextline();
+ readmouse();
+ showpointer();
+ worktoscreen();
+ delpointer();
+}
+
+void DreamGenContext::useopened() {
+ STACK_CHECK;
+ _cmp(data.byte(kOpenedob), 255);
+ if (flags.z())
+ return /* (cannotuseopen) */;
+ _cmp(data.byte(kPickup), 0);
+ if (!flags.z())
goto notout2;
- outofopen(context);
+ outofopen();
return;
notout2:
- findopenpos(context);
- context.ax = context.es.word(context.bx);
- context._cmp(context.al, 255);
- if (context.flags.z())
+ findopenpos();
+ ax = es.word(bx);
+ _cmp(al, 255);
+ if (flags.z())
goto canplace3;
- swapwithopen(context);
-cannotuseopen:
+ swapwithopen();
return;
canplace3:
- context._cmp(context.data.byte(kPickup), 1);
- if (context.flags.z())
+ _cmp(data.byte(kPickup), 1);
+ if (flags.z())
goto intoopen;
- blank(context);
+ blank();
return;
intoopen:
- context.al = context.data.byte(kItemframe);
- context.ah = context.data.byte(kObjecttype);
- context._cmp(context.ax, context.data.word(kOldsubject));
- if (!context.flags.z())
+ al = data.byte(kItemframe);
+ ah = data.byte(kObjecttype);
+ _cmp(ax, data.word(kOldsubject));
+ if (!flags.z())
goto difsub2;
- context._cmp(context.data.byte(kCommandtype), 227);
- if (context.flags.z())
+ _cmp(data.byte(kCommandtype), 227);
+ if (flags.z())
goto alreadyplc2;
- context.data.byte(kCommandtype) = 227;
+ data.byte(kCommandtype) = 227;
difsub2:
- context.data.word(kOldsubject) = context.ax;
- context.bx = context.ax;
- context.al = 35;
- commandwithob(context);
+ data.word(kOldsubject) = ax;
+ bx = ax;
+ al = 35;
+ commandwithob();
alreadyplc2:
- context.ax = context.data.word(kMousebutton);
- context._cmp(context.ax, context.data.word(kOldbutton));
- if (context.flags.z())
- goto notletgo3;
- context._cmp(context.ax, 1);
- if (context.flags.z())
+ ax = data.word(kMousebutton);
+ _cmp(ax, data.word(kOldbutton));
+ if (flags.z())
+ return /* (notletgo3) */;
+ _cmp(ax, 1);
+ if (flags.z())
goto doplace2;
-notletgo3:
return;
doplace2:
- geteitherad(context);
- isitworn(context);
- if (!context.flags.z())
+ geteitherad();
+ isitworn();
+ if (!flags.z())
goto notworntoopen;
- wornerror(context);
+ wornerror();
return;
notworntoopen:
- delpointer(context);
- context.al = context.data.byte(kItemframe);
- context._cmp(context.al, context.data.byte(kOpenedob));
- if (!context.flags.z())
+ delpointer();
+ al = data.byte(kItemframe);
+ _cmp(al, data.byte(kOpenedob));
+ if (!flags.z())
goto isntsame;
- context.al = context.data.byte(kObjecttype);
- context._cmp(context.al, context.data.byte(kOpenedtype));
- if (!context.flags.z())
+ al = data.byte(kObjecttype);
+ _cmp(al, data.byte(kOpenedtype));
+ if (!flags.z())
goto isntsame;
- errormessage1(context);
+ errormessage1();
return;
isntsame:
- checkobjectsize(context);
- context._cmp(context.al, 0);
- if (context.flags.z())
+ checkobjectsize();
+ _cmp(al, 0);
+ if (flags.z())
goto sizeok1;
return;
sizeok1:
- context.data.byte(kPickup) = 0;
- context.al = context.data.byte(kItemframe);
- geteitherad(context);
- context.al = context.data.byte(kOpenedtype);
- context.es.byte(context.bx+2) = context.al;
- context.al = context.data.byte(kOpenedob);
- context.es.byte(context.bx+3) = context.al;
- context.al = context.data.byte(kLastinvpos);
- context.es.byte(context.bx+4) = context.al;
- context.al = context.data.byte(kReallocation);
- context.es.byte(context.bx+5) = context.al;
- fillopen(context);
- undertextline(context);
- readmouse(context);
- useopened(context);
- showpointer(context);
- worktoscreen(context);
- delpointer(context);
-}
-
-void errormessage1(Context &context) {
- STACK_CHECK(context);
- delpointer(context);
- context.di = 76;
- context.bx = 21;
- context.al = 58;
- context.dl = 240;
- printmessage(context);
- readmouse(context);
- showpointer(context);
- worktoscreen(context);
- delpointer(context);
- context.cx = 50;
- hangonp(context);
- showpanel(context);
- showman(context);
- examicon(context);
- readmouse(context);
- useopened(context);
- showpointer(context);
- worktoscreen(context);
- delpointer(context);
-}
-
-void errormessage2(Context &context) {
- STACK_CHECK(context);
- context.data.byte(kCommandtype) = 255;
- delpointer(context);
- context.di = 76;
- context.bx = 21;
- context.al = 59;
- context.dl = 240;
- printmessage(context);
- readmouse(context);
- showpointer(context);
- worktoscreen(context);
- delpointer(context);
- context.cx = 50;
- hangonp(context);
- showpanel(context);
- showman(context);
- examicon(context);
- readmouse(context);
- useopened(context);
- showpointer(context);
- worktoscreen(context);
- delpointer(context);
-}
-
-void errormessage3(Context &context) {
- STACK_CHECK(context);
- delpointer(context);
- context.di = 76;
- context.bx = 21;
- context.al = 60;
- context.dl = 240;
- printmessage(context);
- worktoscreenm(context);
- context.cx = 50;
- hangonp(context);
- showpanel(context);
- showman(context);
- examicon(context);
- readmouse(context);
- useopened(context);
- showpointer(context);
- worktoscreen(context);
- delpointer(context);
-}
-
-void checkobjectsize(Context &context) {
- STACK_CHECK(context);
- getopenedsize(context);
- context.push(context.ax);
- context.al = context.data.byte(kItemframe);
- geteitherad(context);
- context.al = context.es.byte(context.bx+9);
- context.cx = context.pop();
- context._cmp(context.al, 255);
- if (!context.flags.z())
+ data.byte(kPickup) = 0;
+ al = data.byte(kItemframe);
+ geteitherad();
+ al = data.byte(kOpenedtype);
+ es.byte(bx+2) = al;
+ al = data.byte(kOpenedob);
+ es.byte(bx+3) = al;
+ al = data.byte(kLastinvpos);
+ es.byte(bx+4) = al;
+ al = data.byte(kReallocation);
+ es.byte(bx+5) = al;
+ fillopen();
+ undertextline();
+ readmouse();
+ useopened();
+ showpointer();
+ worktoscreen();
+ delpointer();
+}
+
+void DreamGenContext::errormessage1() {
+ STACK_CHECK;
+ delpointer();
+ di = 76;
+ bx = 21;
+ al = 58;
+ dl = 240;
+ printmessage();
+ readmouse();
+ showpointer();
+ worktoscreen();
+ delpointer();
+ cx = 50;
+ hangonp();
+ showpanel();
+ showman();
+ examicon();
+ readmouse();
+ useopened();
+ showpointer();
+ worktoscreen();
+ delpointer();
+}
+
+void DreamGenContext::errormessage2() {
+ STACK_CHECK;
+ data.byte(kCommandtype) = 255;
+ delpointer();
+ di = 76;
+ bx = 21;
+ al = 59;
+ dl = 240;
+ printmessage();
+ readmouse();
+ showpointer();
+ worktoscreen();
+ delpointer();
+ cx = 50;
+ hangonp();
+ showpanel();
+ showman();
+ examicon();
+ readmouse();
+ useopened();
+ showpointer();
+ worktoscreen();
+ delpointer();
+}
+
+void DreamGenContext::errormessage3() {
+ STACK_CHECK;
+ delpointer();
+ di = 76;
+ bx = 21;
+ al = 60;
+ dl = 240;
+ printmessage();
+ worktoscreenm();
+ cx = 50;
+ hangonp();
+ showpanel();
+ showman();
+ examicon();
+ readmouse();
+ useopened();
+ showpointer();
+ worktoscreen();
+ delpointer();
+}
+
+void DreamGenContext::checkobjectsize() {
+ STACK_CHECK;
+ getopenedsize();
+ push(ax);
+ al = data.byte(kItemframe);
+ geteitherad();
+ al = es.byte(bx+9);
+ cx = pop();
+ _cmp(al, 255);
+ if (!flags.z())
goto notunsized;
- context.al = 6;
+ al = 6;
notunsized:
- context._cmp(context.al, 100);
- if (!context.flags.c())
+ _cmp(al, 100);
+ if (!flags.c())
goto specialcase;
- context._cmp(context.cl, 100);
- if (context.flags.c())
+ _cmp(cl, 100);
+ if (flags.c())
goto isntspecial;
- errormessage3(context);
+ errormessage3();
goto sizewrong;
isntspecial:
- context._cmp(context.cl, context.al);
- if (!context.flags.c())
+ _cmp(cl, al);
+ if (!flags.c())
goto sizeok;
specialcase:
- context._sub(context.al, 100);
- context._cmp(context.cl, 100);
- if (!context.flags.c())
+ _sub(al, 100);
+ _cmp(cl, 100);
+ if (!flags.c())
goto bothspecial;
- context._cmp(context.cl, context.al);
- if (!context.flags.c())
+ _cmp(cl, al);
+ if (!flags.c())
goto sizeok;
- errormessage2(context);
+ errormessage2();
goto sizewrong;
bothspecial:
- context._sub(context.cl, 100);
- context._cmp(context.al, context.cl);
- if (context.flags.z())
+ _sub(cl, 100);
+ _cmp(al, cl);
+ if (flags.z())
goto sizeok;
- errormessage3(context);
+ errormessage3();
sizewrong:
- context.al = 1;
+ al = 1;
return;
sizeok:
- context.al = 0;
+ al = 0;
}
-void outofopen(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kOpenedob), 255);
- if (context.flags.z())
+void DreamGenContext::outofopen() {
+ STACK_CHECK;
+ _cmp(data.byte(kOpenedob), 255);
+ if (flags.z())
goto cantuseopen;
- findopenpos(context);
- context.ax = context.es.word(context.bx);
- context._cmp(context.al, 255);
- if (!context.flags.z())
+ findopenpos();
+ ax = es.word(bx);
+ _cmp(al, 255);
+ if (!flags.z())
goto canpick4;
cantuseopen:
- blank(context);
+ blank();
return;
canpick4:
- context._cmp(context.ax, context.data.word(kOldsubject));
- if (!context.flags.z())
+ _cmp(ax, data.word(kOldsubject));
+ if (!flags.z())
goto difsub4;
- context._cmp(context.data.byte(kCommandtype), 228);
- if (context.flags.z())
+ _cmp(data.byte(kCommandtype), 228);
+ if (flags.z())
goto alreadygrb;
- context.data.byte(kCommandtype) = 228;
+ data.byte(kCommandtype) = 228;
difsub4:
- context.data.word(kOldsubject) = context.ax;
- context.bx = context.ax;
- context.al = 36;
- commandwithob(context);
+ data.word(kOldsubject) = ax;
+ bx = ax;
+ al = 36;
+ commandwithob();
alreadygrb:
- context.ax = context.data.word(kMousebutton);
- context._cmp(context.ax, context.data.word(kOldbutton));
- if (context.flags.z())
- goto notletgo4;
- context._cmp(context.ax, 1);
- if (context.flags.z())
+ ax = data.word(kMousebutton);
+ _cmp(ax, data.word(kOldbutton));
+ if (flags.z())
+ return /* (notletgo4) */;
+ _cmp(ax, 1);
+ if (flags.z())
goto dogrb;
- context._cmp(context.ax, 2);
- if (!context.flags.z())
- goto notletgo4;
- reexfromopen(context);
-notletgo4:
+ _cmp(ax, 2);
+ if (!flags.z())
+ return /* (notletgo4) */;
+ reexfromopen();
return;
dogrb:
- delpointer(context);
- context.data.byte(kPickup) = 1;
- findopenpos(context);
- context.ax = context.es.word(context.bx);
- context.data.byte(kItemframe) = context.al;
- context.data.byte(kObjecttype) = context.ah;
- context._cmp(context.ah, 4);
- if (!context.flags.z())
+ delpointer();
+ data.byte(kPickup) = 1;
+ findopenpos();
+ ax = es.word(bx);
+ data.byte(kItemframe) = al;
+ data.byte(kObjecttype) = ah;
+ _cmp(ah, 4);
+ if (!flags.z())
goto makeintoex;
- geteitherad(context);
- context.es.byte(context.bx+2) = 20;
- context.es.byte(context.bx+3) = 255;
+ geteitherad();
+ es.byte(bx+2) = 20;
+ es.byte(bx+3) = 255;
goto actuallyout;
makeintoex:
- transfertoex(context);
- context.data.byte(kItemframe) = context.al;
- context.data.byte(kObjecttype) = 4;
- geteitherad(context);
- context.es.byte(context.bx+2) = 20;
- context.es.byte(context.bx+3) = 255;
+ transfertoex();
+ data.byte(kItemframe) = al;
+ data.byte(kObjecttype) = 4;
+ geteitherad();
+ es.byte(bx+2) = 20;
+ es.byte(bx+3) = 255;
actuallyout:
- fillopen(context);
- undertextline(context);
- readmouse(context);
- useopened(context);
- showpointer(context);
- worktoscreen(context);
- delpointer(context);
-}
-
-void transfertoex(Context &context) {
- STACK_CHECK(context);
- emergencypurge(context);
- getexpos(context);
- context.al = context.data.byte(kExpos);
- context.push(context.ax);
- context.push(context.di);
- context.al = context.data.byte(kItemframe);
- context.ah = 0;
- context.bx = 16;
- context._mul(context.bx);
- context.ds = context.data.word(kFreedat);
- context.si = context.ax;
- context.cx = 8;
- context._movsw(context.cx);
- context.di = context.pop();
- context.al = context.data.byte(kReallocation);
- context.es.byte(context.di) = context.al;
- context.es.byte(context.di+11) = context.al;
- context.al = context.data.byte(kItemframe);
- context.es.byte(context.di+1) = context.al;
- context.es.byte(context.di+2) = 4;
- context.es.byte(context.di+3) = 255;
- context.al = context.data.byte(kLastinvpos);
- context.es.byte(context.di+4) = context.al;
- context.al = context.data.byte(kItemframe);
- context.data.byte(kItemtotran) = context.al;
- transfermap(context);
- transferinv(context);
- transfertext(context);
- context.al = context.data.byte(kItemframe);
- context.ah = 0;
- context.bx = 16;
- context._mul(context.bx);
- context.ds = context.data.word(kFreedat);
- context.si = context.ax;
- context.ds.byte(context.si+2) = 254;
- pickupconts(context);
- context.ax = context.pop();
-}
-
-void pickupconts(Context &context) {
- STACK_CHECK(context);
- context.al = context.ds.byte(context.si+7);
- context._cmp(context.al, 255);
- if (context.flags.z())
- goto notopenable;
- context.al = context.data.byte(kItemframe);
- context.ah = context.data.byte(kObjecttype);
- context.dl = context.data.byte(kExpos);
- context.es = context.data.word(kFreedat);
- context.bx = 0;
- context.cx = 0;
+ fillopen();
+ undertextline();
+ readmouse();
+ useopened();
+ showpointer();
+ worktoscreen();
+ delpointer();
+}
+
+void DreamGenContext::transfertoex() {
+ STACK_CHECK;
+ emergencypurge();
+ getexpos();
+ al = data.byte(kExpos);
+ push(ax);
+ push(di);
+ al = data.byte(kItemframe);
+ ah = 0;
+ bx = 16;
+ _mul(bx);
+ ds = data.word(kFreedat);
+ si = ax;
+ cx = 8;
+ _movsw(cx, true);
+ di = pop();
+ al = data.byte(kReallocation);
+ es.byte(di) = al;
+ es.byte(di+11) = al;
+ al = data.byte(kItemframe);
+ es.byte(di+1) = al;
+ es.byte(di+2) = 4;
+ es.byte(di+3) = 255;
+ al = data.byte(kLastinvpos);
+ es.byte(di+4) = al;
+ al = data.byte(kItemframe);
+ data.byte(kItemtotran) = al;
+ transfermap();
+ transferinv();
+ transfertext();
+ al = data.byte(kItemframe);
+ ah = 0;
+ bx = 16;
+ _mul(bx);
+ ds = data.word(kFreedat);
+ si = ax;
+ ds.byte(si+2) = 254;
+ pickupconts();
+ ax = pop();
+}
+
+void DreamGenContext::pickupconts() {
+ STACK_CHECK;
+ al = ds.byte(si+7);
+ _cmp(al, 255);
+ if (flags.z())
+ return /* (notopenable) */;
+ al = data.byte(kItemframe);
+ ah = data.byte(kObjecttype);
+ dl = data.byte(kExpos);
+ es = data.word(kFreedat);
+ bx = 0;
+ cx = 0;
pickupcontloop:
- context.push(context.cx);
- context.push(context.es);
- context.push(context.bx);
- context.push(context.dx);
- context.push(context.ax);
- context._cmp(context.es.byte(context.bx+2), context.ah);
- if (!context.flags.z())
+ push(cx);
+ push(es);
+ push(bx);
+ push(dx);
+ push(ax);
+ _cmp(es.byte(bx+2), ah);
+ if (!flags.z())
goto notinsidethis;
- context._cmp(context.es.byte(context.bx+3), context.al);
- if (!context.flags.z())
+ _cmp(es.byte(bx+3), al);
+ if (!flags.z())
goto notinsidethis;
- context.data.byte(kItemtotran) = context.cl;
- transfercontoex(context);
+ data.byte(kItemtotran) = cl;
+ transfercontoex();
notinsidethis:
- context.ax = context.pop();
- context.dx = context.pop();
- context.bx = context.pop();
- context.es = context.pop();
- context.cx = context.pop();
- context._add(context.bx, 16);
- context._inc(context.cx);
- context._cmp(context.cx, 80);
- if (!context.flags.z())
+ ax = pop();
+ dx = pop();
+ bx = pop();
+ es = pop();
+ cx = pop();
+ _add(bx, 16);
+ _inc(cx);
+ _cmp(cx, 80);
+ if (!flags.z())
goto pickupcontloop;
-notopenable:
- return;
-}
-
-void transfercontoex(Context &context) {
- STACK_CHECK(context);
- context.push(context.es);
- context.push(context.bx);
- context.push(context.dx);
- context.push(context.es);
- context.push(context.bx);
- getexpos(context);
- context.si = context.pop();
- context.ds = context.pop();
- context.push(context.di);
- context.cx = 8;
- context._movsw(context.cx);
- context.di = context.pop();
- context.dx = context.pop();
- context.al = context.data.byte(kReallocation);
- context.es.byte(context.di) = context.al;
- context.es.byte(context.di+11) = context.al;
- context.al = context.data.byte(kItemtotran);
- context.es.byte(context.di+1) = context.al;
- context.es.byte(context.di+3) = context.dl;
- context.es.byte(context.di+2) = 4;
- transfermap(context);
- transferinv(context);
- transfertext(context);
- context.si = context.pop();
- context.ds = context.pop();
- context.ds.byte(context.si+2) = 255;
-}
-
-void transfertext(Context &context) {
- STACK_CHECK(context);
- context.es = context.data.word(kExtras);
- context.al = context.data.byte(kExpos);
- context.ah = 0;
- context._add(context.ax, context.ax);
- context.bx = (0+2080+30000+(16*114));
- context._add(context.bx, context.ax);
- context.di = context.data.word(kExtextpos);
- context.es.word(context.bx) = context.di;
- context._add(context.di, (0+2080+30000+(16*114)+((114+2)*2)));
- context.al = context.data.byte(kItemtotran);
- context.ah = 0;
- context._add(context.ax, context.ax);
- context.ds = context.data.word(kFreedesc);
- context.bx = (0);
- context._add(context.bx, context.ax);
- context.si = (0+(82*2));
- context.ax = context.ds.word(context.bx);
- context._add(context.si, context.ax);
+}
+
+void DreamGenContext::transfercontoex() {
+ STACK_CHECK;
+ push(es);
+ push(bx);
+ push(dx);
+ push(es);
+ push(bx);
+ getexpos();
+ si = pop();
+ ds = pop();
+ push(di);
+ cx = 8;
+ _movsw(cx, true);
+ di = pop();
+ dx = pop();
+ al = data.byte(kReallocation);
+ es.byte(di) = al;
+ es.byte(di+11) = al;
+ al = data.byte(kItemtotran);
+ es.byte(di+1) = al;
+ es.byte(di+3) = dl;
+ es.byte(di+2) = 4;
+ transfermap();
+ transferinv();
+ transfertext();
+ si = pop();
+ ds = pop();
+ ds.byte(si+2) = 255;
+}
+
+void DreamGenContext::transfertext() {
+ STACK_CHECK;
+ es = data.word(kExtras);
+ al = data.byte(kExpos);
+ ah = 0;
+ _add(ax, ax);
+ bx = (0+2080+30000+(16*114));
+ _add(bx, ax);
+ di = data.word(kExtextpos);
+ es.word(bx) = di;
+ _add(di, (0+2080+30000+(16*114)+((114+2)*2)));
+ al = data.byte(kItemtotran);
+ ah = 0;
+ _add(ax, ax);
+ ds = data.word(kFreedesc);
+ bx = (0);
+ _add(bx, ax);
+ si = (0+(82*2));
+ ax = ds.word(bx);
+ _add(si, ax);
moretext:
- context._lodsb();
- context._stosb();
- context._inc(context.data.word(kExtextpos));
- context._cmp(context.al, 0);
- if (!context.flags.z())
+ _lodsb();
+ _stosb();
+ _inc(data.word(kExtextpos));
+ _cmp(al, 0);
+ if (!flags.z())
goto moretext;
}
-void getexpos(Context &context) {
- STACK_CHECK(context);
- context.es = context.data.word(kExtras);
- context.al = 0;
- context.di = (0+2080+30000);
+void DreamGenContext::getexpos() {
+ STACK_CHECK;
+ es = data.word(kExtras);
+ al = 0;
+ di = (0+2080+30000);
tryanotherex:
- context._cmp(context.es.byte(context.di+2), 255);
- if (context.flags.z())
+ _cmp(es.byte(di+2), 255);
+ if (flags.z())
goto foundnewex;
- context._add(context.di, 16);
- context._inc(context.al);
- context._cmp(context.al, (114));
- if (!context.flags.z())
+ _add(di, 16);
+ _inc(al);
+ _cmp(al, (114));
+ if (!flags.z())
goto tryanotherex;
foundnewex:
- context.data.byte(kExpos) = context.al;
+ data.byte(kExpos) = al;
}
-void purgealocation(Context &context) {
- STACK_CHECK(context);
- context.push(context.ax);
- context.es = context.data.word(kExtras);
- context.di = (0+2080+30000);
- context.bx = context.pop();
- context.cx = 0;
+void DreamGenContext::purgealocation() {
+ STACK_CHECK;
+ push(ax);
+ es = data.word(kExtras);
+ di = (0+2080+30000);
+ bx = pop();
+ cx = 0;
purgeloc:
- context._cmp(context.bl, context.es.byte(context.di+0));
- if (!context.flags.z())
+ _cmp(bl, es.byte(di+0));
+ if (!flags.z())
goto dontpurge;
- context._cmp(context.es.byte(context.di+2), 0);
- if (!context.flags.z())
+ _cmp(es.byte(di+2), 0);
+ if (!flags.z())
goto dontpurge;
- context.push(context.di);
- context.push(context.es);
- context.push(context.bx);
- context.push(context.cx);
- deleteexobject(context);
- context.cx = context.pop();
- context.bx = context.pop();
- context.es = context.pop();
- context.di = context.pop();
+ push(di);
+ push(es);
+ push(bx);
+ push(cx);
+ deleteexobject();
+ cx = pop();
+ bx = pop();
+ es = pop();
+ di = pop();
dontpurge:
- context._add(context.di, 16);
- context._inc(context.cx);
- context._cmp(context.cx, (114));
- if (!context.flags.z())
+ _add(di, 16);
+ _inc(cx);
+ _cmp(cx, (114));
+ if (!flags.z())
goto purgeloc;
}
-void emergencypurge(Context &context) {
- STACK_CHECK(context);
+void DreamGenContext::emergencypurge() {
+ STACK_CHECK;
checkpurgeagain:
- context.ax = context.data.word(kExframepos);
- context._add(context.ax, 4000);
- context._cmp(context.ax, (30000));
- if (context.flags.c())
+ ax = data.word(kExframepos);
+ _add(ax, 4000);
+ _cmp(ax, (30000));
+ if (flags.c())
goto notnearframeend;
- purgeanitem(context);
+ purgeanitem();
goto checkpurgeagain;
notnearframeend:
- context.ax = context.data.word(kExtextpos);
- context._add(context.ax, 400);
- context._cmp(context.ax, (18000));
- if (context.flags.c())
- goto notneartextend;
- purgeanitem(context);
+ ax = data.word(kExtextpos);
+ _add(ax, 400);
+ _cmp(ax, (18000));
+ if (flags.c())
+ return /* (notneartextend) */;
+ purgeanitem();
goto checkpurgeagain;
-notneartextend:
- return;
}
-void purgeanitem(Context &context) {
- STACK_CHECK(context);
- context.es = context.data.word(kExtras);
- context.di = (0+2080+30000);
- context.bl = context.data.byte(kReallocation);
- context.cx = 0;
+void DreamGenContext::purgeanitem() {
+ STACK_CHECK;
+ es = data.word(kExtras);
+ di = (0+2080+30000);
+ bl = data.byte(kReallocation);
+ cx = 0;
lookforpurge:
- context.al = context.es.byte(context.di+2);
- context._cmp(context.al, 0);
- if (!context.flags.z())
+ al = es.byte(di+2);
+ _cmp(al, 0);
+ if (!flags.z())
goto cantpurge;
- context._cmp(context.es.byte(context.di+12), 2);
- if (context.flags.z())
+ _cmp(es.byte(di+12), 2);
+ if (flags.z())
goto iscup;
- context._cmp(context.es.byte(context.di+12), 255);
- if (!context.flags.z())
+ _cmp(es.byte(di+12), 255);
+ if (!flags.z())
goto cantpurge;
iscup:
- context._cmp(context.es.byte(context.di+11), context.bl);
- if (context.flags.z())
+ _cmp(es.byte(di+11), bl);
+ if (flags.z())
goto cantpurge;
- deleteexobject(context);
+ deleteexobject();
return;
cantpurge:
- context._add(context.di, 16);
- context._inc(context.cx);
- context._cmp(context.cx, (114));
- if (!context.flags.z())
+ _add(di, 16);
+ _inc(cx);
+ _cmp(cx, (114));
+ if (!flags.z())
goto lookforpurge;
- context.di = (0+2080+30000);
- context.bl = context.data.byte(kReallocation);
- context.cx = 0;
+ di = (0+2080+30000);
+ bl = data.byte(kReallocation);
+ cx = 0;
lookforpurge2:
- context.al = context.es.byte(context.di+2);
- context._cmp(context.al, 0);
- if (!context.flags.z())
+ al = es.byte(di+2);
+ _cmp(al, 0);
+ if (!flags.z())
goto cantpurge2;
- context._cmp(context.es.byte(context.di+12), 255);
- if (!context.flags.z())
+ _cmp(es.byte(di+12), 255);
+ if (!flags.z())
goto cantpurge2;
- deleteexobject(context);
+ deleteexobject();
return;
cantpurge2:
- context._add(context.di, 16);
- context._inc(context.cx);
- context._cmp(context.cx, (114));
- if (!context.flags.z())
+ _add(di, 16);
+ _inc(cx);
+ _cmp(cx, (114));
+ if (!flags.z())
goto lookforpurge2;
}
-void deleteexobject(Context &context) {
- STACK_CHECK(context);
- context.push(context.cx);
- context.push(context.cx);
- context.push(context.cx);
- context.push(context.cx);
- context.al = 255;
- context.cx = 16;
- context._stosb(context.cx);
- context.ax = context.pop();
- context.cl = context.al;
- context._add(context.al, context.al);
- context._add(context.al, context.cl);
- deleteexframe(context);
- context.ax = context.pop();
- context.cl = context.al;
- context._add(context.al, context.al);
- context._add(context.al, context.cl);
- context._inc(context.al);
- deleteexframe(context);
- context.ax = context.pop();
- deleteextext(context);
- context.bx = context.pop();
- context.bh = context.bl;
- context.bl = 4;
- context.di = (0+2080+30000);
- context.cx = 0;
+void DreamGenContext::deleteexobject() {
+ STACK_CHECK;
+ push(cx);
+ push(cx);
+ push(cx);
+ push(cx);
+ al = 255;
+ cx = 16;
+ _stosb(cx, true);
+ ax = pop();
+ cl = al;
+ _add(al, al);
+ _add(al, cl);
+ deleteexframe();
+ ax = pop();
+ cl = al;
+ _add(al, al);
+ _add(al, cl);
+ _inc(al);
+ deleteexframe();
+ ax = pop();
+ deleteextext();
+ bx = pop();
+ bh = bl;
+ bl = 4;
+ di = (0+2080+30000);
+ cx = 0;
deleteconts:
- context._cmp(context.es.word(context.di+2), context.bx);
- if (!context.flags.z())
+ _cmp(es.word(di+2), bx);
+ if (!flags.z())
goto notinsideex;
- context.push(context.bx);
- context.push(context.cx);
- context.push(context.di);
- deleteexobject(context);
- context.di = context.pop();
- context.cx = context.pop();
- context.bx = context.pop();
+ push(bx);
+ push(cx);
+ push(di);
+ deleteexobject();
+ di = pop();
+ cx = pop();
+ bx = pop();
notinsideex:
- context._add(context.di, 16);
- context._inc(context.cx);
- context._cmp(context.cx, (114));
- if (!context.flags.z())
+ _add(di, 16);
+ _inc(cx);
+ _cmp(cx, (114));
+ if (!flags.z())
goto deleteconts;
}
-void deleteexframe(Context &context) {
- STACK_CHECK(context);
- context.di = (0);
- context.ah = 0;
- context._add(context.ax, context.ax);
- context._add(context.di, context.ax);
- context._add(context.ax, context.ax);
- context._add(context.di, context.ax);
- context.al = context.es.byte(context.di);
- context.ah = 0;
- context.cl = context.es.byte(context.di+1);
- context.ch = 0;
- context._mul(context.cx);
- context.si = context.es.word(context.di+2);
- context.push(context.si);
- context._add(context.si, (0+2080));
- context.cx = (30000);
- context._sub(context.cx, context.es.word(context.di+2));
- context.di = context.si;
- context._add(context.si, context.ax);
- context.push(context.ax);
- context.ds = context.es;
- context._movsb(context.cx);
- context.bx = context.pop();
- context._sub(context.data.word(kExframepos), context.bx);
- context.si = context.pop();
- context.cx = (114)*3;
- context.di = (0);
+void DreamGenContext::deleteexframe() {
+ STACK_CHECK;
+ di = (0);
+ ah = 0;
+ _add(ax, ax);
+ _add(di, ax);
+ _add(ax, ax);
+ _add(di, ax);
+ al = es.byte(di);
+ ah = 0;
+ cl = es.byte(di+1);
+ ch = 0;
+ _mul(cx);
+ si = es.word(di+2);
+ push(si);
+ _add(si, (0+2080));
+ cx = (30000);
+ _sub(cx, es.word(di+2));
+ di = si;
+ _add(si, ax);
+ push(ax);
+ ds = es;
+ _movsb(cx, true);
+ bx = pop();
+ _sub(data.word(kExframepos), bx);
+ si = pop();
+ cx = (114)*3;
+ di = (0);
shuffleadsdown:
- context.ax = context.es.word(context.di+2);
- context._cmp(context.ax, context.si);
- if (context.flags.c())
+ ax = es.word(di+2);
+ _cmp(ax, si);
+ if (flags.c())
goto beforethisone;
- context._sub(context.ax, context.bx);
+ _sub(ax, bx);
beforethisone:
- context.es.word(context.di+2) = context.ax;
- context._add(context.di, 6);
- if (--context.cx)
+ es.word(di+2) = ax;
+ _add(di, 6);
+ if (--cx)
goto shuffleadsdown;
}
-void deleteextext(Context &context) {
- STACK_CHECK(context);
- context.di = (0+2080+30000+(16*114));
- context.ah = 0;
- context._add(context.ax, context.ax);
- context._add(context.di, context.ax);
- context.ax = context.es.word(context.di);
- context.si = context.ax;
- context.di = context.ax;
- context._add(context.si, (0+2080+30000+(16*114)+((114+2)*2)));
- context._add(context.di, (0+2080+30000+(16*114)+((114+2)*2)));
- context.ax = 0;
+void DreamGenContext::deleteextext() {
+ STACK_CHECK;
+ di = (0+2080+30000+(16*114));
+ ah = 0;
+ _add(ax, ax);
+ _add(di, ax);
+ ax = es.word(di);
+ si = ax;
+ di = ax;
+ _add(si, (0+2080+30000+(16*114)+((114+2)*2)));
+ _add(di, (0+2080+30000+(16*114)+((114+2)*2)));
+ ax = 0;
findlenextext:
- context.cl = context.es.byte(context.si);
- context._inc(context.ax);
- context._inc(context.si);
- context._cmp(context.cl, 0);
- if (!context.flags.z())
+ cl = es.byte(si);
+ _inc(ax);
+ _inc(si);
+ _cmp(cl, 0);
+ if (!flags.z())
goto findlenextext;
- context.cx = (18000);
- context.bx = context.si;
- context._sub(context.bx, (0+2080+30000+(16*114)+((114+2)*2)));
- context.push(context.bx);
- context.push(context.ax);
- context._sub(context.cx, context.bx);
- context._movsb(context.cx);
- context.bx = context.pop();
- context._sub(context.data.word(kExtextpos), context.bx);
- context.si = context.pop();
- context.cx = (114);
- context.di = (0+2080+30000+(16*114));
+ cx = (18000);
+ bx = si;
+ _sub(bx, (0+2080+30000+(16*114)+((114+2)*2)));
+ push(bx);
+ push(ax);
+ _sub(cx, bx);
+ _cmp(cx, 0xffff);
+ if (flags.z())
+ goto _tmp1;
+ _movsb(cx, true);
+_tmp1:
+ bx = pop();
+ _sub(data.word(kExtextpos), bx);
+ si = pop();
+ cx = (114);
+ di = (0+2080+30000+(16*114));
shuffletextads:
- context.ax = context.es.word(context.di);
- context._cmp(context.ax, context.si);
- if (context.flags.c())
+ ax = es.word(di);
+ _cmp(ax, si);
+ if (flags.c())
goto beforethistext;
- context._sub(context.ax, context.bx);
+ _sub(ax, bx);
beforethistext:
- context.es.word(context.di) = context.ax;
- context._add(context.di, 2);
- if (--context.cx)
+ es.word(di) = ax;
+ _add(di, 2);
+ if (--cx)
goto shuffletextads;
}
-void blockget(Context &context) {
- STACK_CHECK(context);
- context.ah = context.al;
- context.al = 0;
- context.ds = context.data.word(kBackdrop);
- context.si = (0+192);
- context._add(context.si, context.ax);
-}
-
-void drawfloor(Context &context) {
- STACK_CHECK(context);
- context.push(context.es);
- context.push(context.bx);
- eraseoldobs(context);
- drawflags(context);
- calcmapad(context);
- doblocks(context);
- showallobs(context);
- showallfree(context);
- showallex(context);
- paneltomap(context);
- initrain(context);
- context.data.byte(kNewobs) = 0;
- context.bx = context.pop();
- context.es = context.pop();
-}
-
-void calcmapad(Context &context) {
- STACK_CHECK(context);
- getdimension(context);
- context.push(context.cx);
- context.push(context.dx);
- context.al = 11;
- context._sub(context.al, context.dl);
- context._sub(context.al, context.cl);
- context._sub(context.al, context.cl);
- context.ax.cbw();
- context.bx = 8;
- context._mul(context.bx);
- context._add(context.ax, context.data.word(kMapoffsetx));
- context.data.word(kMapadx) = context.ax;
- context.dx = context.pop();
- context.cx = context.pop();
- context.al = 10;
- context._sub(context.al, context.dh);
- context._sub(context.al, context.ch);
- context._sub(context.al, context.ch);
- context.ax.cbw();
- context.bx = 8;
- context._mul(context.bx);
- context._add(context.ax, context.data.word(kMapoffsety));
- context.data.word(kMapady) = context.ax;
-}
-
-void getdimension(Context &context) {
- STACK_CHECK(context);
- context.es = context.data.word(kBuffers);
- context.bx = (0+(180*10)+32+60+(32*32));
- context.ch = 0;
+void DreamGenContext::blockget() {
+ STACK_CHECK;
+ ah = al;
+ al = 0;
+ ds = data.word(kBackdrop);
+ si = (0+192);
+ _add(si, ax);
+}
+
+void DreamGenContext::drawfloor() {
+ STACK_CHECK;
+ push(es);
+ push(bx);
+ eraseoldobs();
+ drawflags();
+ calcmapad();
+ doblocks();
+ showallobs();
+ showallfree();
+ showallex();
+ paneltomap();
+ initrain();
+ data.byte(kNewobs) = 0;
+ bx = pop();
+ es = pop();
+}
+
+void DreamGenContext::calcmapad() {
+ STACK_CHECK;
+ getdimension();
+ push(cx);
+ push(dx);
+ al = 11;
+ _sub(al, dl);
+ _sub(al, cl);
+ _sub(al, cl);
+ ax.cbw();
+ bx = 8;
+ _mul(bx);
+ _add(ax, data.word(kMapoffsetx));
+ data.word(kMapadx) = ax;
+ dx = pop();
+ cx = pop();
+ al = 10;
+ _sub(al, dh);
+ _sub(al, ch);
+ _sub(al, ch);
+ ax.cbw();
+ bx = 8;
+ _mul(bx);
+ _add(ax, data.word(kMapoffsety));
+ data.word(kMapady) = ax;
+}
+
+void DreamGenContext::getdimension() {
+ STACK_CHECK;
+ es = data.word(kBuffers);
+ bx = (0+(180*10)+32+60+(32*32));
+ ch = 0;
dimloop1:
- addalong(context);
- context._cmp(context.al, 0);
- if (!context.flags.z())
+ addalong();
+ _cmp(al, 0);
+ if (!flags.z())
goto finishdim1;
- context._inc(context.ch);
+ _inc(ch);
goto dimloop1;
finishdim1:
- context.bx = (0+(180*10)+32+60+(32*32));
- context.cl = 0;
+ bx = (0+(180*10)+32+60+(32*32));
+ cl = 0;
dimloop2:
- context.push(context.bx);
- addlength(context);
- context.bx = context.pop();
- context._cmp(context.al, 0);
- if (!context.flags.z())
+ push(bx);
+ addlength();
+ bx = pop();
+ _cmp(al, 0);
+ if (!flags.z())
goto finishdim2;
- context._inc(context.cl);
- context._add(context.bx, 3);
+ _inc(cl);
+ _add(bx, 3);
goto dimloop2;
finishdim2:
- context.bx = (0+(180*10)+32+60+(32*32))+(11*3*9);
- context.dh = 10;
+ bx = (0+(180*10)+32+60+(32*32))+(11*3*9);
+ dh = 10;
dimloop3:
- context.push(context.bx);
- addalong(context);
- context.bx = context.pop();
- context._cmp(context.al, 0);
- if (!context.flags.z())
+ push(bx);
+ addalong();
+ bx = pop();
+ _cmp(al, 0);
+ if (!flags.z())
goto finishdim3;
- context._dec(context.dh);
- context._sub(context.bx, 11*3);
+ _dec(dh);
+ _sub(bx, 11*3);
goto dimloop3;
finishdim3:
- context.bx = (0+(180*10)+32+60+(32*32))+(3*10);
- context.dl = 11;
+ bx = (0+(180*10)+32+60+(32*32))+(3*10);
+ dl = 11;
dimloop4:
- context.push(context.bx);
- addlength(context);
- context.bx = context.pop();
- context._cmp(context.al, 0);
- if (!context.flags.z())
+ push(bx);
+ addlength();
+ bx = pop();
+ _cmp(al, 0);
+ if (!flags.z())
goto finishdim4;
- context._dec(context.dl);
- context._sub(context.bx, 3);
+ _dec(dl);
+ _sub(bx, 3);
goto dimloop4;
finishdim4:
- context.al = context.cl;
- context.ah = 0;
- context._shl(context.ax, 1);
- context._shl(context.ax, 1);
- context._shl(context.ax, 1);
- context._shl(context.ax, 1);
- context.data.word(kMapxstart) = context.ax;
- context.al = context.ch;
- context.ah = 0;
- context._shl(context.ax, 1);
- context._shl(context.ax, 1);
- context._shl(context.ax, 1);
- context._shl(context.ax, 1);
- context.data.word(kMapystart) = context.ax;
- context._sub(context.dl, context.cl);
- context._sub(context.dh, context.ch);
- context.al = context.dl;
- context.ah = 0;
- context._shl(context.ax, 1);
- context._shl(context.ax, 1);
- context._shl(context.ax, 1);
- context._shl(context.ax, 1);
- context.data.byte(kMapxsize) = context.al;
- context.al = context.dh;
- context.ah = 0;
- context._shl(context.ax, 1);
- context._shl(context.ax, 1);
- context._shl(context.ax, 1);
- context._shl(context.ax, 1);
- context.data.byte(kMapysize) = context.al;
-}
-
-void addalong(Context &context) {
- STACK_CHECK(context);
- context.ah = 11;
+ al = cl;
+ ah = 0;
+ _shl(ax, 1);
+ _shl(ax, 1);
+ _shl(ax, 1);
+ _shl(ax, 1);
+ data.word(kMapxstart) = ax;
+ al = ch;
+ ah = 0;
+ _shl(ax, 1);
+ _shl(ax, 1);
+ _shl(ax, 1);
+ _shl(ax, 1);
+ data.word(kMapystart) = ax;
+ _sub(dl, cl);
+ _sub(dh, ch);
+ al = dl;
+ ah = 0;
+ _shl(ax, 1);
+ _shl(ax, 1);
+ _shl(ax, 1);
+ _shl(ax, 1);
+ data.byte(kMapxsize) = al;
+ al = dh;
+ ah = 0;
+ _shl(ax, 1);
+ _shl(ax, 1);
+ _shl(ax, 1);
+ _shl(ax, 1);
+ data.byte(kMapysize) = al;
+}
+
+void DreamGenContext::addalong() {
+ STACK_CHECK;
+ ah = 11;
addloop:
- context._cmp(context.es.byte(context.bx), 0);
- if (!context.flags.z())
+ _cmp(es.byte(bx), 0);
+ if (!flags.z())
goto gotalong;
- context._add(context.bx, 3);
- context._dec(context.ah);
- if (!context.flags.z())
+ _add(bx, 3);
+ _dec(ah);
+ if (!flags.z())
goto addloop;
- context.al = 0;
+ al = 0;
return;
gotalong:
- context.al = 1;
+ al = 1;
}
-void addlength(Context &context) {
- STACK_CHECK(context);
- context.ah = 10;
+void DreamGenContext::addlength() {
+ STACK_CHECK;
+ ah = 10;
addloop2:
- context._cmp(context.es.byte(context.bx), 0);
- if (!context.flags.z())
+ _cmp(es.byte(bx), 0);
+ if (!flags.z())
goto gotlength;
- context._add(context.bx, 3*11);
- context._dec(context.ah);
- if (!context.flags.z())
+ _add(bx, 3*11);
+ _dec(ah);
+ if (!flags.z())
goto addloop2;
- context.al = 0;
+ al = 0;
return;
gotlength:
- context.al = 1;
-}
-
-void drawflags(Context &context) {
- STACK_CHECK(context);
- context.es = context.data.word(kBuffers);
- context.di = (0+(180*10)+32+60+(32*32));
- context.al = context.data.byte(kMapy);
- context.ah = 0;
- context.cx = (66);
- context._mul(context.cx);
- context.bl = context.data.byte(kMapx);
- context.bh = 0;
- context._add(context.ax, context.bx);
- context.si = (0);
- context._add(context.si, context.ax);
- context.cx = 10;
+ al = 1;
+}
+
+void DreamGenContext::drawflags() {
+ STACK_CHECK;
+ es = data.word(kBuffers);
+ di = (0+(180*10)+32+60+(32*32));
+ al = data.byte(kMapy);
+ ah = 0;
+ cx = (66);
+ _mul(cx);
+ bl = data.byte(kMapx);
+ bh = 0;
+ _add(ax, bx);
+ si = (0);
+ _add(si, ax);
+ cx = 10;
_tmp28:
- context.push(context.cx);
- context.cx = 11;
+ push(cx);
+ cx = 11;
_tmp28a:
- context.ds = context.data.word(kMapdata);
- context._lodsb();
- context.ds = context.data.word(kBackdrop);
- context.push(context.si);
- context.push(context.ax);
- context.ah = 0;
- context._add(context.ax, context.ax);
- context.si = (0);
- context._add(context.si, context.ax);
- context._movsw();
- context.ax = context.pop();
- context._stosb();
- context.si = context.pop();
- if (--context.cx)
+ ds = data.word(kMapdata);
+ _lodsb();
+ ds = data.word(kBackdrop);
+ push(si);
+ push(ax);
+ ah = 0;
+ _add(ax, ax);
+ si = (0);
+ _add(si, ax);
+ _movsw();
+ ax = pop();
+ _stosb();
+ si = pop();
+ if (--cx)
goto _tmp28a;
- context._add(context.si, (66)-11);
- context.cx = context.pop();
- if (--context.cx)
+ _add(si, (66)-11);
+ cx = pop();
+ if (--cx)
goto _tmp28;
}
-void eraseoldobs(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kNewobs), 0);
- if (context.flags.z())
- goto donterase;
- context.es = context.data.word(kBuffers);
- context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768);
- context.cx = 16;
+void DreamGenContext::eraseoldobs() {
+ STACK_CHECK;
+ _cmp(data.byte(kNewobs), 0);
+ if (flags.z())
+ return /* (donterase) */;
+ es = data.word(kBuffers);
+ bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768);
+ cx = 16;
oberase:
- context.push(context.cx);
- context.push(context.bx);
- context.ax = context.es.word(context.bx+20);
- context._cmp(context.ax, 0x0ffff);
- if (context.flags.z())
+ push(cx);
+ push(bx);
+ ax = es.word(bx+20);
+ _cmp(ax, 0x0ffff);
+ if (flags.z())
goto notthisob;
- context.di = context.bx;
- context.al = 255;
- context.cx = (32);
- context._stosb(context.cx);
+ di = bx;
+ al = 255;
+ cx = (32);
+ _stosb(cx, true);
notthisob:
- context.bx = context.pop();
- context.cx = context.pop();
- context._add(context.bx, (32));
- if (--context.cx)
+ bx = pop();
+ cx = pop();
+ _add(bx, (32));
+ if (--cx)
goto oberase;
-donterase:
- return;
-}
-
-void showallobs(Context &context) {
- STACK_CHECK(context);
- context.es = context.data.word(kBuffers);
- context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32));
- context.data.word(kListpos) = context.bx;
- context.di = context.bx;
- context.cx = 128*5;
- context.al = 255;
- context._stosb(context.cx);
- context.es = context.data.word(kSetframes);
- context.data.word(kFrsegment) = context.es;
- context.ax = (0);
- context.data.word(kDataad) = context.ax;
- context.ax = (0+2080);
- context.data.word(kFramesad) = context.ax;
- context.data.byte(kCurrentob) = 0;
- context.ds = context.data.word(kSetdat);
- context.si = 0;
- context.cx = 128;
+}
+
+void DreamGenContext::showallobs() {
+ STACK_CHECK;
+ es = data.word(kBuffers);
+ bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32));
+ data.word(kListpos) = bx;
+ di = bx;
+ cx = 128*5;
+ al = 255;
+ _stosb(cx, true);
+ es = data.word(kSetframes);
+ data.word(kFrsegment) = es;
+ ax = (0);
+ data.word(kDataad) = ax;
+ ax = (0+2080);
+ data.word(kFramesad) = ax;
+ data.byte(kCurrentob) = 0;
+ ds = data.word(kSetdat);
+ si = 0;
+ cx = 128;
showobsloop:
- context.push(context.cx);
- context.push(context.si);
- context.push(context.si);
- context._add(context.si, 58);
- context.es = context.data.word(kSetdat);
- getmapad(context);
- context.si = context.pop();
- context._cmp(context.ch, 0);
- if (context.flags.z())
+ push(cx);
+ push(si);
+ push(si);
+ _add(si, 58);
+ es = data.word(kSetdat);
+ getmapad();
+ si = pop();
+ _cmp(ch, 0);
+ if (flags.z())
goto blankframe;
- context.al = context.es.byte(context.si+18);
- context.ah = 0;
- context.data.word(kCurrentframe) = context.ax;
- context._cmp(context.al, 255);
- if (context.flags.z())
+ al = es.byte(si+18);
+ ah = 0;
+ data.word(kCurrentframe) = ax;
+ _cmp(al, 255);
+ if (flags.z())
goto blankframe;
- context.push(context.es);
- context.push(context.si);
- calcfrframe(context);
- finalframe(context);
- context.si = context.pop();
- context.es = context.pop();
- context.al = context.es.byte(context.si+18);
- context.es.byte(context.si+17) = context.al;
- context._cmp(context.es.byte(context.si+8), 0);
- if (!context.flags.z())
+ push(es);
+ push(si);
+ calcfrframe();
+ finalframe();
+ si = pop();
+ es = pop();
+ al = es.byte(si+18);
+ es.byte(si+17) = al;
+ _cmp(es.byte(si+8), 0);
+ if (!flags.z())
goto animating;
- context._cmp(context.es.byte(context.si+5), 5);
- if (context.flags.z())
+ _cmp(es.byte(si+5), 5);
+ if (flags.z())
goto animating;
- context._cmp(context.es.byte(context.si+5), 6);
- if (context.flags.z())
+ _cmp(es.byte(si+5), 6);
+ if (flags.z())
goto animating;
- context.ax = context.data.word(kCurrentframe);
- context.ah = 0;
- context._add(context.di, context.data.word(kMapadx));
- context._add(context.bx, context.data.word(kMapady));
- showframe(context);
+ ax = data.word(kCurrentframe);
+ ah = 0;
+ _add(di, data.word(kMapadx));
+ _add(bx, data.word(kMapady));
+ showframe();
goto drawnsetob;
animating:
- makebackob(context);
+ makebackob();
drawnsetob:
- context.si = context.data.word(kListpos);
- context.es = context.data.word(kBuffers);
- context.al = context.data.byte(kSavex);
- context.ah = context.data.byte(kSavey);
- context.es.word(context.si) = context.ax;
- context.cx = context.ax;
- context.ax = context.data.word(kSavesize);
- context._add(context.al, context.cl);
- context._add(context.ah, context.ch);
- context.es.word(context.si+2) = context.ax;
- context.al = context.data.byte(kCurrentob);
- context.es.byte(context.si+4) = context.al;
- context._add(context.si, 5);
- context.data.word(kListpos) = context.si;
+ si = data.word(kListpos);
+ es = data.word(kBuffers);
+ al = data.byte(kSavex);
+ ah = data.byte(kSavey);
+ es.word(si) = ax;
+ cx = ax;
+ ax = data.word(kSavesize);
+ _add(al, cl);
+ _add(ah, ch);
+ es.word(si+2) = ax;
+ al = data.byte(kCurrentob);
+ es.byte(si+4) = al;
+ _add(si, 5);
+ data.word(kListpos) = si;
blankframe:
- context._inc(context.data.byte(kCurrentob));
- context.si = context.pop();
- context.cx = context.pop();
- context._add(context.si, 64);
- context._dec(context.cx);
- if (context.flags.z())
- goto finishedsetobs;
+ _inc(data.byte(kCurrentob));
+ si = pop();
+ cx = pop();
+ _add(si, 64);
+ _dec(cx);
+ if (flags.z())
+ return /* (finishedsetobs) */;
goto showobsloop;
-finishedsetobs:
- return;
-}
-
-void makebackob(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kNewobs), 0);
- if (context.flags.z())
- goto nomake;
- context.al = context.es.byte(context.si+5);
- context.ah = context.es.byte(context.si+8);
- context.push(context.si);
- context.push(context.ax);
- context.push(context.si);
- context.ax = context.data.word(kObjectx);
- context.bx = context.data.word(kObjecty);
- context.ah = context.bl;
- context.si = context.ax;
- context.cx = 49520;
- context.dx = context.data.word(kSetframes);
- context.di = (0);
- makesprite(context);
- context.ax = context.pop();
- context.es.word(context.bx+20) = context.ax;
- context.ax = context.pop();
- context._cmp(context.al, 255);
- if (!context.flags.z())
+}
+
+void DreamGenContext::makebackob() {
+ STACK_CHECK;
+ _cmp(data.byte(kNewobs), 0);
+ if (flags.z())
+ return /* (nomake) */;
+ al = es.byte(si+5);
+ ah = es.byte(si+8);
+ push(si);
+ push(ax);
+ push(si);
+ ax = data.word(kObjectx);
+ bx = data.word(kObjecty);
+ ah = bl;
+ si = ax;
+ cx = 49520;
+ dx = data.word(kSetframes);
+ di = (0);
+ makesprite();
+ ax = pop();
+ es.word(bx+20) = ax;
+ ax = pop();
+ _cmp(al, 255);
+ if (!flags.z())
goto usedpriority;
- context.al = 0;
+ al = 0;
usedpriority:
- context.es.byte(context.bx+23) = context.al;
- context.es.byte(context.bx+30) = context.ah;
- context.es.byte(context.bx+16) = 0;
- context.es.byte(context.bx+18) = 0;
- context.es.byte(context.bx+19) = 0;
- context.si = context.pop();
-nomake:
- return;
-}
-
-void showallfree(Context &context) {
- STACK_CHECK(context);
- context.es = context.data.word(kBuffers);
- context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5));
- context.data.word(kListpos) = context.bx;
- context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5));
- context.cx = 80*5;
- context.al = 255;
- context._stosb(context.cx);
- context.es = context.data.word(kFreeframes);
- context.data.word(kFrsegment) = context.es;
- context.ax = (0);
- context.data.word(kDataad) = context.ax;
- context.ax = (0+2080);
- context.data.word(kFramesad) = context.ax;
- context.al = 0;
- context.data.byte(kCurrentfree) = context.al;
- context.ds = context.data.word(kFreedat);
- context.si = 2;
- context.cx = 0;
+ es.byte(bx+23) = al;
+ es.byte(bx+30) = ah;
+ es.byte(bx+16) = 0;
+ es.byte(bx+18) = 0;
+ es.byte(bx+19) = 0;
+ si = pop();
+}
+
+void DreamGenContext::showallfree() {
+ STACK_CHECK;
+ es = data.word(kBuffers);
+ bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5));
+ data.word(kListpos) = bx;
+ di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5));
+ cx = 80*5;
+ al = 255;
+ _stosb(cx, true);
+ es = data.word(kFreeframes);
+ data.word(kFrsegment) = es;
+ ax = (0);
+ data.word(kDataad) = ax;
+ ax = (0+2080);
+ data.word(kFramesad) = ax;
+ al = 0;
+ data.byte(kCurrentfree) = al;
+ ds = data.word(kFreedat);
+ si = 2;
+ cx = 0;
loop127:
- context.push(context.cx);
- context.push(context.si);
- context.push(context.si);
- context.es = context.data.word(kFreedat);
- getmapad(context);
- context.si = context.pop();
- context._cmp(context.ch, 0);
- if (context.flags.z())
+ push(cx);
+ push(si);
+ push(si);
+ es = data.word(kFreedat);
+ getmapad();
+ si = pop();
+ _cmp(ch, 0);
+ if (flags.z())
goto over138;
- context.al = context.data.byte(kCurrentfree);
- context.ah = 0;
- context.dx = context.ax;
- context._add(context.ax, context.ax);
- context._add(context.ax, context.dx);
- context.data.word(kCurrentframe) = context.ax;
- context.push(context.es);
- context.push(context.si);
- calcfrframe(context);
- context.es = context.data.word(kMapstore);
- context.ds = context.data.word(kFrsegment);
- finalframe(context);
- context.si = context.pop();
- context.es = context.pop();
- context._cmp(context.cx, 0);
- if (context.flags.z())
+ al = data.byte(kCurrentfree);
+ ah = 0;
+ dx = ax;
+ _add(ax, ax);
+ _add(ax, dx);
+ data.word(kCurrentframe) = ax;
+ push(es);
+ push(si);
+ calcfrframe();
+ es = data.word(kMapstore);
+ ds = data.word(kFrsegment);
+ finalframe();
+ si = pop();
+ es = pop();
+ _cmp(cx, 0);
+ if (flags.z())
goto over138;
- context.ax = context.data.word(kCurrentframe);
- context.ah = 0;
- context._add(context.di, context.data.word(kMapadx));
- context._add(context.bx, context.data.word(kMapady));
- showframe(context);
- context.si = context.data.word(kListpos);
- context.es = context.data.word(kBuffers);
- context.al = context.data.byte(kSavex);
- context.ah = context.data.byte(kSavey);
- context.es.word(context.si) = context.ax;
- context.cx = context.ax;
- context.ax = context.data.word(kSavesize);
- context._add(context.al, context.cl);
- context._add(context.ah, context.ch);
- context.es.word(context.si+2) = context.ax;
- context.ax = context.pop();
- context.cx = context.pop();
- context.push(context.cx);
- context.push(context.ax);
- context.es.byte(context.si+4) = context.cl;
- context._add(context.si, 5);
- context.data.word(kListpos) = context.si;
+ ax = data.word(kCurrentframe);
+ ah = 0;
+ _add(di, data.word(kMapadx));
+ _add(bx, data.word(kMapady));
+ showframe();
+ si = data.word(kListpos);
+ es = data.word(kBuffers);
+ al = data.byte(kSavex);
+ ah = data.byte(kSavey);
+ es.word(si) = ax;
+ cx = ax;
+ ax = data.word(kSavesize);
+ _add(al, cl);
+ _add(ah, ch);
+ es.word(si+2) = ax;
+ ax = pop();
+ cx = pop();
+ push(cx);
+ push(ax);
+ es.byte(si+4) = cl;
+ _add(si, 5);
+ data.word(kListpos) = si;
over138:
- context._inc(context.data.byte(kCurrentfree));
- context.si = context.pop();
- context.cx = context.pop();
- context._add(context.si, 16);
- context._inc(context.cx);
- context._cmp(context.cx, 80);
- if (context.flags.z())
- goto finfree;
+ _inc(data.byte(kCurrentfree));
+ si = pop();
+ cx = pop();
+ _add(si, 16);
+ _inc(cx);
+ _cmp(cx, 80);
+ if (flags.z())
+ return /* (finfree) */;
goto loop127;
-finfree:
- return;
-}
-
-void showallex(Context &context) {
- STACK_CHECK(context);
- context.es = context.data.word(kBuffers);
- context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5));
- context.data.word(kListpos) = context.bx;
- context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5));
- context.cx = 100*5;
- context.al = 255;
- context._stosb(context.cx);
- context.es = context.data.word(kExtras);
- context.data.word(kFrsegment) = context.es;
- context.ax = (0);
- context.data.word(kDataad) = context.ax;
- context.ax = (0+2080);
- context.data.word(kFramesad) = context.ax;
- context.data.byte(kCurrentex) = 0;
- context.si = (0+2080+30000)+2;
- context.cx = 0;
+}
+
+void DreamGenContext::showallex() {
+ STACK_CHECK;
+ es = data.word(kBuffers);
+ bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5));
+ data.word(kListpos) = bx;
+ di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5));
+ cx = 100*5;
+ al = 255;
+ _stosb(cx, true);
+ es = data.word(kExtras);
+ data.word(kFrsegment) = es;
+ ax = (0);
+ data.word(kDataad) = ax;
+ ax = (0+2080);
+ data.word(kFramesad) = ax;
+ data.byte(kCurrentex) = 0;
+ si = (0+2080+30000)+2;
+ cx = 0;
exloop:
- context.push(context.cx);
- context.push(context.si);
- context.es = context.data.word(kExtras);
- context.push(context.si);
- context.ch = 0;
- context._cmp(context.es.byte(context.si), 255);
- if (context.flags.z())
+ push(cx);
+ push(si);
+ es = data.word(kExtras);
+ push(si);
+ ch = 0;
+ _cmp(es.byte(si), 255);
+ if (flags.z())
goto notinroom;
- context.al = context.es.byte(context.si-2);
- context._cmp(context.al, context.data.byte(kReallocation));
- if (!context.flags.z())
+ al = es.byte(si-2);
+ _cmp(al, data.byte(kReallocation));
+ if (!flags.z())
goto notinroom;
- getmapad(context);
+ getmapad();
notinroom:
- context.si = context.pop();
- context._cmp(context.ch, 0);
- if (context.flags.z())
+ si = pop();
+ _cmp(ch, 0);
+ if (flags.z())
goto blankex;
- context.al = context.data.byte(kCurrentex);
- context.ah = 0;
- context.dx = context.ax;
- context._add(context.ax, context.ax);
- context._add(context.ax, context.dx);
- context.data.word(kCurrentframe) = context.ax;
- context.push(context.es);
- context.push(context.si);
- calcfrframe(context);
- context.es = context.data.word(kMapstore);
- context.ds = context.data.word(kFrsegment);
- finalframe(context);
- context.si = context.pop();
- context.es = context.pop();
- context._cmp(context.cx, 0);
- if (context.flags.z())
+ al = data.byte(kCurrentex);
+ ah = 0;
+ dx = ax;
+ _add(ax, ax);
+ _add(ax, dx);
+ data.word(kCurrentframe) = ax;
+ push(es);
+ push(si);
+ calcfrframe();
+ es = data.word(kMapstore);
+ ds = data.word(kFrsegment);
+ finalframe();
+ si = pop();
+ es = pop();
+ _cmp(cx, 0);
+ if (flags.z())
goto blankex;
- context.ax = context.data.word(kCurrentframe);
- context.ah = 0;
- context._add(context.di, context.data.word(kMapadx));
- context._add(context.bx, context.data.word(kMapady));
- showframe(context);
- context.si = context.data.word(kListpos);
- context.es = context.data.word(kBuffers);
- context.al = context.data.byte(kSavex);
- context.ah = context.data.byte(kSavey);
- context.es.word(context.si) = context.ax;
- context.cx = context.ax;
- context.ax = context.data.word(kSavesize);
- context._add(context.al, context.cl);
- context._add(context.ah, context.ch);
- context.es.word(context.si+2) = context.ax;
- context.ax = context.pop();
- context.cx = context.pop();
- context.push(context.cx);
- context.push(context.ax);
- context.es.byte(context.si+4) = context.cl;
- context._add(context.si, 5);
- context.data.word(kListpos) = context.si;
+ ax = data.word(kCurrentframe);
+ ah = 0;
+ _add(di, data.word(kMapadx));
+ _add(bx, data.word(kMapady));
+ showframe();
+ si = data.word(kListpos);
+ es = data.word(kBuffers);
+ al = data.byte(kSavex);
+ ah = data.byte(kSavey);
+ es.word(si) = ax;
+ cx = ax;
+ ax = data.word(kSavesize);
+ _add(al, cl);
+ _add(ah, ch);
+ es.word(si+2) = ax;
+ ax = pop();
+ cx = pop();
+ push(cx);
+ push(ax);
+ es.byte(si+4) = cl;
+ _add(si, 5);
+ data.word(kListpos) = si;
blankex:
- context._inc(context.data.byte(kCurrentex));
- context.si = context.pop();
- context.cx = context.pop();
- context._add(context.si, 16);
- context._inc(context.cx);
- context._cmp(context.cx, 100);
- if (context.flags.z())
- goto finex;
+ _inc(data.byte(kCurrentex));
+ si = pop();
+ cx = pop();
+ _add(si, 16);
+ _inc(cx);
+ _cmp(cx, 100);
+ if (flags.z())
+ return /* (finex) */;
goto exloop;
-finex:
- return;
-}
-
-void calcfrframe(Context &context) {
- STACK_CHECK(context);
- context.dx = context.data.word(kFrsegment);
- context.ax = context.data.word(kFramesad);
- context.push(context.ax);
- context.cx = context.data.word(kDataad);
- context.ax = context.data.word(kCurrentframe);
- context.ds = context.dx;
- context.bx = 6;
- context._mul(context.bx);
- context._add(context.ax, context.cx);
- context.bx = context.ax;
- context.cx = context.ds.word(context.bx);
- context.ax = context.ds.word(context.bx+2);
- context.dx = context.ds.word(context.bx+4);
- context.bx = context.pop();
- context.push(context.dx);
- context._add(context.ax, context.bx);
- context.data.word(kSavesource) = context.ax;
- context.data.word(kSavesize) = context.cx;
- context.ax = context.pop();
- context.push(context.ax);
- context.ah = 0;
- context.data.word(kOffsetx) = context.ax;
- context.ax = context.pop();
- context.al = context.ah;
- context.ah = 0;
- context.data.word(kOffsety) = context.ax;
- return;
- context.ax = context.pop();
- context.cx = 0;
- context.data.word(kSavesize) = context.cx;
-}
-
-void finalframe(Context &context) {
- STACK_CHECK(context);
- context.ax = context.data.word(kObjecty);
- context._add(context.ax, context.data.word(kOffsety));
- context.bx = context.data.word(kObjectx);
- context._add(context.bx, context.data.word(kOffsetx));
- context.data.byte(kSavex) = context.bl;
- context.data.byte(kSavey) = context.al;
- context.di = context.data.word(kObjectx);
- context.bx = context.data.word(kObjecty);
-}
-
-void adjustlen(Context &context) {
- STACK_CHECK(context);
- context.ah = context.al;
- context._add(context.al, context.ch);
- context._cmp(context.al, 100);
- if (context.flags.c())
- goto over242;
- context.al = 224;
- context._sub(context.al, context.ch);
- context.ch = context.al;
-over242:
- return;
-}
-
-void getmapad(Context &context) {
- STACK_CHECK(context);
- getxad(context);
- context._cmp(context.ch, 0);
- if (context.flags.z())
- goto over146;
- context.data.word(kObjectx) = context.ax;
- getyad(context);
- context._cmp(context.ch, 0);
- if (context.flags.z())
- goto over146;
- context.data.word(kObjecty) = context.ax;
- context.ch = 1;
-over146:
- return;
-}
-
-void getxad(Context &context) {
- STACK_CHECK(context);
- context.cl = context.es.byte(context.si);
- context._inc(context.si);
- context.al = context.es.byte(context.si);
- context._inc(context.si);
- context.ah = context.es.byte(context.si);
- context._inc(context.si);
- context._cmp(context.cl, 0);
- if (!context.flags.z())
+}
+
+void DreamGenContext::calcfrframe() {
+ STACK_CHECK;
+ dx = data.word(kFrsegment);
+ ax = data.word(kFramesad);
+ push(ax);
+ cx = data.word(kDataad);
+ ax = data.word(kCurrentframe);
+ ds = dx;
+ bx = 6;
+ _mul(bx);
+ _add(ax, cx);
+ bx = ax;
+ cx = ds.word(bx);
+ ax = ds.word(bx+2);
+ dx = ds.word(bx+4);
+ bx = pop();
+ push(dx);
+ _add(ax, bx);
+ data.word(kSavesource) = ax;
+ data.word(kSavesize) = cx;
+ ax = pop();
+ push(ax);
+ ah = 0;
+ data.word(kOffsetx) = ax;
+ ax = pop();
+ al = ah;
+ ah = 0;
+ data.word(kOffsety) = ax;
+ return;
+ ax = pop();
+ cx = 0;
+ data.word(kSavesize) = cx;
+}
+
+void DreamGenContext::finalframe() {
+ STACK_CHECK;
+ ax = data.word(kObjecty);
+ _add(ax, data.word(kOffsety));
+ bx = data.word(kObjectx);
+ _add(bx, data.word(kOffsetx));
+ data.byte(kSavex) = bl;
+ data.byte(kSavey) = al;
+ di = data.word(kObjectx);
+ bx = data.word(kObjecty);
+}
+
+void DreamGenContext::adjustlen() {
+ STACK_CHECK;
+ ah = al;
+ _add(al, ch);
+ _cmp(al, 100);
+ if (flags.c())
+ return /* (over242) */;
+ al = 224;
+ _sub(al, ch);
+ ch = al;
+}
+
+void DreamGenContext::getmapad() {
+ STACK_CHECK;
+ getxad();
+ _cmp(ch, 0);
+ if (flags.z())
+ return /* (over146) */;
+ data.word(kObjectx) = ax;
+ getyad();
+ _cmp(ch, 0);
+ if (flags.z())
+ return /* (over146) */;
+ data.word(kObjecty) = ax;
+ ch = 1;
+}
+
+void DreamGenContext::getxad() {
+ STACK_CHECK;
+ cl = es.byte(si);
+ _inc(si);
+ al = es.byte(si);
+ _inc(si);
+ ah = es.byte(si);
+ _inc(si);
+ _cmp(cl, 0);
+ if (!flags.z())
goto over148;
- context._sub(context.al, context.data.byte(kMapx));
- if (context.flags.c())
+ _sub(al, data.byte(kMapx));
+ if (flags.c())
goto over148;
- context._cmp(context.al, 11);
- if (!context.flags.c())
+ _cmp(al, 11);
+ if (!flags.c())
goto over148;
- context.cl = 4;
- context._shl(context.al, context.cl);
- context._or(context.al, context.ah);
- context.ah = 0;
- context.ch = 1;
+ cl = 4;
+ _shl(al, cl);
+ _or(al, ah);
+ ah = 0;
+ ch = 1;
return;
over148:
- context.ch = 0;
+ ch = 0;
}
-void getyad(Context &context) {
- STACK_CHECK(context);
- context.al = context.es.byte(context.si);
- context._inc(context.si);
- context.ah = context.es.byte(context.si);
- context._inc(context.si);
- context._sub(context.al, context.data.byte(kMapy));
- if (context.flags.c())
+void DreamGenContext::getyad() {
+ STACK_CHECK;
+ al = es.byte(si);
+ _inc(si);
+ ah = es.byte(si);
+ _inc(si);
+ _sub(al, data.byte(kMapy));
+ if (flags.c())
goto over147;
- context._cmp(context.al, 10);
- if (!context.flags.c())
+ _cmp(al, 10);
+ if (!flags.c())
goto over147;
- context.cl = 4;
- context._shl(context.al, context.cl);
- context._or(context.al, context.ah);
- context.ah = 0;
- context.ch = 1;
+ cl = 4;
+ _shl(al, cl);
+ _or(al, ah);
+ ah = 0;
+ ch = 1;
return;
over147:
- context.ch = 0;
+ ch = 0;
}
-void autolook(Context &context) {
- STACK_CHECK(context);
- context.ax = context.data.word(kMousex);
- context._cmp(context.ax, context.data.word(kOldx));
- if (!context.flags.z())
+void DreamGenContext::autolook() {
+ STACK_CHECK;
+ ax = data.word(kMousex);
+ _cmp(ax, data.word(kOldx));
+ if (!flags.z())
goto diffmouse;
- context.ax = context.data.word(kMousey);
- context._cmp(context.ax, context.data.word(kOldy));
- if (!context.flags.z())
+ ax = data.word(kMousey);
+ _cmp(ax, data.word(kOldy));
+ if (!flags.z())
goto diffmouse;
- context._dec(context.data.word(kLookcounter));
- context._cmp(context.data.word(kLookcounter), 0);
- if (!context.flags.z())
- goto noautolook;
- context._cmp(context.data.word(kWatchingtime), 0);
- if (!context.flags.z())
- goto noautolook;
- dolook(context);
-noautolook:
+ _dec(data.word(kLookcounter));
+ _cmp(data.word(kLookcounter), 0);
+ if (!flags.z())
+ return /* (noautolook) */;
+ _cmp(data.word(kWatchingtime), 0);
+ if (!flags.z())
+ return /* (noautolook) */;
+ dolook();
return;
diffmouse:
- context.data.word(kLookcounter) = 1000;
-}
-
-void look(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.word(kWatchingtime), 0);
- if (!context.flags.z())
- { blank(context); return; };
- context._cmp(context.data.byte(kPointermode), 2);
- if (context.flags.z())
- { blank(context); return; };
- context._cmp(context.data.byte(kCommandtype), 241);
- if (context.flags.z())
+ data.word(kLookcounter) = 1000;
+}
+
+void DreamGenContext::look() {
+ STACK_CHECK;
+ _cmp(data.word(kWatchingtime), 0);
+ if (!flags.z())
+ { blank(); return; };
+ _cmp(data.byte(kPointermode), 2);
+ if (flags.z())
+ { blank(); return; };
+ _cmp(data.byte(kCommandtype), 241);
+ if (flags.z())
goto alreadylook;
- context.data.byte(kCommandtype) = 241;
- context.al = 25;
- commandonly(context);
+ data.byte(kCommandtype) = 241;
+ al = 25;
+ commandonly();
alreadylook:
- context._cmp(context.data.word(kMousebutton), 1);
- if (!context.flags.z())
- goto nolook;
- context.ax = context.data.word(kMousebutton);
- context._cmp(context.ax, context.data.word(kOldbutton));
- if (context.flags.z())
- goto nolook;
- dolook(context);
-nolook:
- return;
-}
-
-void dolook(Context &context) {
- STACK_CHECK(context);
- createpanel(context);
- showicon(context);
- undertextline(context);
- worktoscreenm(context);
- context.data.byte(kCommandtype) = 255;
- dumptextline(context);
- context.bl = context.data.byte(kRoomnum);
- context._and(context.bl, 31);
- context.bh = 0;
- context._add(context.bx, context.bx);
- context.es = context.data.word(kRoomdesc);
- context._add(context.bx, (0));
- context.si = context.es.word(context.bx);
- context._add(context.si, (0+(38*2)));
- findnextcolon(context);
- context.di = 66;
- context._cmp(context.data.byte(kReallocation), 50);
- if (context.flags.c())
+ _cmp(data.word(kMousebutton), 1);
+ if (!flags.z())
+ return /* (nolook) */;
+ ax = data.word(kMousebutton);
+ _cmp(ax, data.word(kOldbutton));
+ if (flags.z())
+ return /* (nolook) */;
+ dolook();
+}
+
+void DreamGenContext::dolook() {
+ STACK_CHECK;
+ createpanel();
+ showicon();
+ undertextline();
+ worktoscreenm();
+ data.byte(kCommandtype) = 255;
+ dumptextline();
+ bl = data.byte(kRoomnum);
+ _and(bl, 31);
+ bh = 0;
+ _add(bx, bx);
+ es = data.word(kRoomdesc);
+ _add(bx, (0));
+ si = es.word(bx);
+ _add(si, (0+(38*2)));
+ findnextcolon();
+ di = 66;
+ _cmp(data.byte(kReallocation), 50);
+ if (flags.c())
goto notdream3;
- context.di = 40;
+ di = 40;
notdream3:
- context.bx = 80;
- context.dl = 241;
- printslow(context);
- context._cmp(context.al, 1);
- if (context.flags.z())
+ bx = 80;
+ dl = 241;
+ printslow();
+ _cmp(al, 1);
+ if (flags.z())
goto afterlook;
- context.cx = 400;
- hangonp(context);
+ cx = 400;
+ hangonp();
afterlook:
- context.data.byte(kPointermode) = 0;
- context.data.byte(kCommandtype) = 0;
- redrawmainscrn(context);
- worktoscreenm(context);
-}
-
-void redrawmainscrn(Context &context) {
- STACK_CHECK(context);
- context.data.word(kTimecount) = 0;
- createpanel(context);
- context.data.byte(kNewobs) = 0;
- drawfloor(context);
- printsprites(context);
- reelsonscreen(context);
- showicon(context);
- getunderzoom(context);
- undertextline(context);
- readmouse(context);
- context.data.byte(kCommandtype) = 255;
-}
-
-void getback1(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kPickup), 0);
- if (context.flags.z())
+ data.byte(kPointermode) = 0;
+ data.byte(kCommandtype) = 0;
+ redrawmainscrn();
+ worktoscreenm();
+}
+
+void DreamGenContext::redrawmainscrn() {
+ STACK_CHECK;
+ data.word(kTimecount) = 0;
+ createpanel();
+ data.byte(kNewobs) = 0;
+ drawfloor();
+ printsprites();
+ reelsonscreen();
+ showicon();
+ getunderzoom();
+ undertextline();
+ readmouse();
+ data.byte(kCommandtype) = 255;
+}
+
+void DreamGenContext::getback1() {
+ STACK_CHECK;
+ _cmp(data.byte(kPickup), 0);
+ if (flags.z())
goto notgotobject;
- blank(context);
+ blank();
return;
notgotobject:
- context._cmp(context.data.byte(kCommandtype), 202);
- if (context.flags.z())
+ _cmp(data.byte(kCommandtype), 202);
+ if (flags.z())
goto alreadyget;
- context.data.byte(kCommandtype) = 202;
- context.al = 26;
- commandonly(context);
+ data.byte(kCommandtype) = 202;
+ al = 26;
+ commandonly();
alreadyget:
- context.ax = context.data.word(kMousebutton);
- context._cmp(context.ax, context.data.word(kOldbutton));
- if (context.flags.z())
- goto nogetback;
- context._and(context.ax, 1);
- if (!context.flags.z())
+ ax = data.word(kMousebutton);
+ _cmp(ax, data.word(kOldbutton));
+ if (flags.z())
+ return /* (nogetback) */;
+ _and(ax, 1);
+ if (!flags.z())
goto dogetback;
-nogetback:
return;
dogetback:
- context.data.byte(kGetback) = 1;
- context.data.byte(kPickup) = 0;
-}
-
-void talk(Context &context) {
- STACK_CHECK(context);
- context.data.byte(kTalkpos) = 0;
- context.data.byte(kInmaparea) = 0;
- context.al = context.data.byte(kCommand);
- context.data.byte(kCharacter) = context.al;
- createpanel(context);
- showpanel(context);
- showman(context);
- showexit(context);
- undertextline(context);
- convicons(context);
- starttalk(context);
- context.data.byte(kCommandtype) = 255;
- readmouse(context);
- showpointer(context);
- worktoscreen(context);
+ data.byte(kGetback) = 1;
+ data.byte(kPickup) = 0;
+}
+
+void DreamGenContext::talk() {
+ STACK_CHECK;
+ data.byte(kTalkpos) = 0;
+ data.byte(kInmaparea) = 0;
+ al = data.byte(kCommand);
+ data.byte(kCharacter) = al;
+ createpanel();
+ showpanel();
+ showman();
+ showexit();
+ undertextline();
+ convicons();
+ starttalk();
+ data.byte(kCommandtype) = 255;
+ readmouse();
+ showpointer();
+ worktoscreen();
waittalk:
- delpointer(context);
- readmouse(context);
- animpointer(context);
- showpointer(context);
- vsync(context);
- dumppointer(context);
- dumptextline(context);
- context.data.byte(kGetback) = 0;
- context.bx = 2660;
- checkcoords(context);
- context._cmp(context.data.byte(kGetback), 0);
- if (context.flags.z())
+ delpointer();
+ readmouse();
+ animpointer();
+ showpointer();
+ vsync();
+ dumppointer();
+ dumptextline();
+ data.byte(kGetback) = 0;
+ bx = 2660;
+ checkcoords();
+ _cmp(data.byte(kGetback), 0);
+ if (flags.z())
goto waittalk;
- context.bx = context.data.word(kPersondata);
- context.es = context.cs;
- context._cmp(context.data.byte(kTalkpos), 4);
- if (context.flags.c())
+ bx = data.word(kPersondata);
+ es = cs;
+ _cmp(data.byte(kTalkpos), 4);
+ if (flags.c())
goto notnexttalk;
- context.al = context.es.byte(context.bx+7);
- context._or(context.al, 128);
- context.es.byte(context.bx+7) = context.al;
+ al = es.byte(bx+7);
+ _or(al, 128);
+ es.byte(bx+7) = al;
notnexttalk:
- redrawmainscrn(context);
- worktoscreenm(context);
- context._cmp(context.data.byte(kSpeechloaded), 1);
- if (!context.flags.z())
- goto nospeech;
- cancelch1(context);
- context.data.byte(kVolumedirection) = -1;
- context.data.byte(kVolumeto) = 0;
-nospeech:
- return;
-}
-
-void convicons(Context &context) {
- STACK_CHECK(context);
- context.al = context.data.byte(kCharacter);
- context._and(context.al, 127);
- getpersframe(context);
- context.di = 234;
- context.bx = 2;
- context.data.word(kCurrentframe) = context.ax;
- findsource(context);
- context.ax = context.data.word(kCurrentframe);
- context._sub(context.ax, context.data.word(kTakeoff));
- context.ah = 0;
- showframe(context);
-}
-
-void getpersframe(Context &context) {
- STACK_CHECK(context);
- context.ah = 0;
- context._add(context.ax, context.ax);
- context.bx = context.ax;
- context.es = context.data.word(kPeople);
- context._add(context.bx, (0));
- context.ax = context.es.word(context.bx);
-}
-
-void starttalk(Context &context) {
- STACK_CHECK(context);
- context.data.byte(kTalkmode) = 0;
- context.al = context.data.byte(kCharacter);
- context._and(context.al, 127);
- getpersontext(context);
- context.data.word(kCharshift) = 91+91;
- context.di = 66;
- context.bx = 64;
- context.dl = 241;
- context.al = 0;
- context.ah = 79;
- printdirect(context);
- context.data.word(kCharshift) = 0;
- context.di = 66;
- context.bx = 80;
- context.dl = 241;
- context.al = 0;
- context.ah = 0;
- printdirect(context);
- context.data.byte(kSpeechloaded) = 0;
- context.al = context.data.byte(kCharacter);
- context._and(context.al, 127);
- context.ah = 0;
- context.cx = 64;
- context._mul(context.cx);
- context.cl = 'C';
- context.dl = 'R';
- context.dh = context.data.byte(kReallocation);
- loadspeech(context);
- context._cmp(context.data.byte(kSpeechloaded), 1);
- if (!context.flags.z())
- goto nospeech1;
- context.data.byte(kVolumedirection) = 1;
- context.data.byte(kVolumeto) = 6;
- context.al = 50+12;
- playchannel1(context);
-nospeech1:
- return;
-}
-
-void getpersontext(Context &context) {
- STACK_CHECK(context);
- context.ah = 0;
- context.cx = 64*2;
- context._mul(context.cx);
- context.si = context.ax;
- context.es = context.data.word(kPeople);
- context._add(context.si, (0+24));
- context.cx = (0+24+(1026*2));
- context.ax = context.es.word(context.si);
- context._add(context.ax, context.cx);
- context.si = context.ax;
-}
-
-void moretalk(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kTalkmode), 0);
- if (context.flags.z())
+ redrawmainscrn();
+ worktoscreenm();
+ _cmp(data.byte(kSpeechloaded), 1);
+ if (!flags.z())
+ return /* (nospeech) */;
+ cancelch1();
+ data.byte(kVolumedirection) = -1;
+ data.byte(kVolumeto) = 0;
+}
+
+void DreamGenContext::convicons() {
+ STACK_CHECK;
+ al = data.byte(kCharacter);
+ _and(al, 127);
+ getpersframe();
+ di = 234;
+ bx = 2;
+ data.word(kCurrentframe) = ax;
+ findsource();
+ ax = data.word(kCurrentframe);
+ _sub(ax, data.word(kTakeoff));
+ ah = 0;
+ showframe();
+}
+
+void DreamGenContext::getpersframe() {
+ STACK_CHECK;
+ ah = 0;
+ _add(ax, ax);
+ bx = ax;
+ es = data.word(kPeople);
+ _add(bx, (0));
+ ax = es.word(bx);
+}
+
+void DreamGenContext::starttalk() {
+ STACK_CHECK;
+ data.byte(kTalkmode) = 0;
+ al = data.byte(kCharacter);
+ _and(al, 127);
+ getpersontext();
+ data.word(kCharshift) = 91+91;
+ di = 66;
+ bx = 64;
+ dl = 241;
+ al = 0;
+ ah = 79;
+ printdirect();
+ data.word(kCharshift) = 0;
+ di = 66;
+ bx = 80;
+ dl = 241;
+ al = 0;
+ ah = 0;
+ printdirect();
+ data.byte(kSpeechloaded) = 0;
+ al = data.byte(kCharacter);
+ _and(al, 127);
+ ah = 0;
+ cx = 64;
+ _mul(cx);
+ cl = 'C';
+ dl = 'R';
+ dh = data.byte(kReallocation);
+ loadspeech();
+ _cmp(data.byte(kSpeechloaded), 1);
+ if (!flags.z())
+ return /* (nospeech1) */;
+ data.byte(kVolumedirection) = 1;
+ data.byte(kVolumeto) = 6;
+ al = 50+12;
+ playchannel1();
+}
+
+void DreamGenContext::getpersontext() {
+ STACK_CHECK;
+ ah = 0;
+ cx = 64*2;
+ _mul(cx);
+ si = ax;
+ es = data.word(kPeople);
+ _add(si, (0+24));
+ cx = (0+24+(1026*2));
+ ax = es.word(si);
+ _add(ax, cx);
+ si = ax;
+}
+
+void DreamGenContext::moretalk() {
+ STACK_CHECK;
+ _cmp(data.byte(kTalkmode), 0);
+ if (flags.z())
goto canmore;
- redes(context);
+ redes();
return;
canmore:
- context._cmp(context.data.byte(kCommandtype), 215);
- if (context.flags.z())
+ _cmp(data.byte(kCommandtype), 215);
+ if (flags.z())
goto alreadymore;
- context.data.byte(kCommandtype) = 215;
- context.al = 49;
- commandonly(context);
+ data.byte(kCommandtype) = 215;
+ al = 49;
+ commandonly();
alreadymore:
- context.ax = context.data.word(kMousebutton);
- context._cmp(context.ax, context.data.word(kOldbutton));
- if (context.flags.z())
- goto nomore;
- context._and(context.ax, 1);
- if (!context.flags.z())
+ ax = data.word(kMousebutton);
+ _cmp(ax, data.word(kOldbutton));
+ if (flags.z())
+ return /* (nomore) */;
+ _and(ax, 1);
+ if (!flags.z())
goto domoretalk;
-nomore:
return;
domoretalk:
- context.data.byte(kTalkmode) = 2;
- context.data.byte(kTalkpos) = 4;
- context._cmp(context.data.byte(kCharacter), 100);
- if (context.flags.c())
+ data.byte(kTalkmode) = 2;
+ data.byte(kTalkpos) = 4;
+ _cmp(data.byte(kCharacter), 100);
+ if (flags.c())
goto notsecondpart;
- context.data.byte(kTalkpos) = 48;
+ data.byte(kTalkpos) = 48;
notsecondpart:
- dosometalk(context);
+ dosometalk();
}
-void dosometalk(Context &context) {
- STACK_CHECK(context);
+void DreamGenContext::dosometalk() {
+ STACK_CHECK;
dospeech:
- context.al = context.data.byte(kTalkpos);
- context.al = context.data.byte(kCharacter);
- context._and(context.al, 127);
- context.ah = 0;
- context.cx = 64;
- context._mul(context.cx);
- context.cx = context.ax;
- context.al = context.data.byte(kTalkpos);
- context.ah = 0;
- context._add(context.ax, context.cx);
- context._add(context.ax, context.ax);
- context.si = context.ax;
- context.es = context.data.word(kPeople);
- context._add(context.si, (0+24));
- context.cx = (0+24+(1026*2));
- context.ax = context.es.word(context.si);
- context._add(context.ax, context.cx);
- context.si = context.ax;
- context._cmp(context.es.byte(context.si), 0);
- if (context.flags.z())
+ al = data.byte(kTalkpos);
+ al = data.byte(kCharacter);
+ _and(al, 127);
+ ah = 0;
+ cx = 64;
+ _mul(cx);
+ cx = ax;
+ al = data.byte(kTalkpos);
+ ah = 0;
+ _add(ax, cx);
+ _add(ax, ax);
+ si = ax;
+ es = data.word(kPeople);
+ _add(si, (0+24));
+ cx = (0+24+(1026*2));
+ ax = es.word(si);
+ _add(ax, cx);
+ si = ax;
+ _cmp(es.byte(si), 0);
+ if (flags.z())
goto endheartalk;
- context.push(context.es);
- context.push(context.si);
- createpanel(context);
- showpanel(context);
- showman(context);
- showexit(context);
- convicons(context);
- context.si = context.pop();
- context.es = context.pop();
- context.di = 164;
- context.bx = 64;
- context.dl = 144;
- context.al = 0;
- context.ah = 0;
- printdirect(context);
- context.al = context.data.byte(kCharacter);
- context._and(context.al, 127);
- context.ah = 0;
- context.cx = 64;
- context._mul(context.cx);
- context.cl = context.data.byte(kTalkpos);
- context.ch = 0;
- context._add(context.ax, context.cx);
- context.cl = 'C';
- context.dl = 'R';
- context.dh = context.data.byte(kReallocation);
- loadspeech(context);
- context._cmp(context.data.byte(kSpeechloaded), 0);
- if (context.flags.z())
+ push(es);
+ push(si);
+ createpanel();
+ showpanel();
+ showman();
+ showexit();
+ convicons();
+ si = pop();
+ es = pop();
+ di = 164;
+ bx = 64;
+ dl = 144;
+ al = 0;
+ ah = 0;
+ printdirect();
+ al = data.byte(kCharacter);
+ _and(al, 127);
+ ah = 0;
+ cx = 64;
+ _mul(cx);
+ cl = data.byte(kTalkpos);
+ ch = 0;
+ _add(ax, cx);
+ cl = 'C';
+ dl = 'R';
+ dh = data.byte(kReallocation);
+ loadspeech();
+ _cmp(data.byte(kSpeechloaded), 0);
+ if (flags.z())
goto noplay1;
- context.al = 62;
- playchannel1(context);
+ al = 62;
+ playchannel1();
noplay1:
- context.data.byte(kPointermode) = 3;
- worktoscreenm(context);
- context.cx = 180;
- hangonpq(context);
- if (!context.flags.c())
+ data.byte(kPointermode) = 3;
+ worktoscreenm();
+ cx = 180;
+ hangonpq();
+ if (!flags.c())
goto _tmp1;
return;
_tmp1:
- context._inc(context.data.byte(kTalkpos));
- context.al = context.data.byte(kTalkpos);
- context.al = context.data.byte(kCharacter);
- context._and(context.al, 127);
- context.ah = 0;
- context.cx = 64;
- context._mul(context.cx);
- context.cx = context.ax;
- context.al = context.data.byte(kTalkpos);
- context.ah = 0;
- context._add(context.ax, context.cx);
- context._add(context.ax, context.ax);
- context.si = context.ax;
- context.es = context.data.word(kPeople);
- context._add(context.si, (0+24));
- context.cx = (0+24+(1026*2));
- context.ax = context.es.word(context.si);
- context._add(context.ax, context.cx);
- context.si = context.ax;
- context._cmp(context.es.byte(context.si), 0);
- if (context.flags.z())
+ _inc(data.byte(kTalkpos));
+ al = data.byte(kTalkpos);
+ al = data.byte(kCharacter);
+ _and(al, 127);
+ ah = 0;
+ cx = 64;
+ _mul(cx);
+ cx = ax;
+ al = data.byte(kTalkpos);
+ ah = 0;
+ _add(ax, cx);
+ _add(ax, ax);
+ si = ax;
+ es = data.word(kPeople);
+ _add(si, (0+24));
+ cx = (0+24+(1026*2));
+ ax = es.word(si);
+ _add(ax, cx);
+ si = ax;
+ _cmp(es.byte(si), 0);
+ if (flags.z())
goto endheartalk;
- context._cmp(context.es.byte(context.si), ':');
- if (context.flags.z())
+ _cmp(es.byte(si), ':');
+ if (flags.z())
goto skiptalk2;
- context._cmp(context.es.byte(context.si), 32);
- if (context.flags.z())
+ _cmp(es.byte(si), 32);
+ if (flags.z())
goto skiptalk2;
- context.push(context.es);
- context.push(context.si);
- createpanel(context);
- showpanel(context);
- showman(context);
- showexit(context);
- convicons(context);
- context.si = context.pop();
- context.es = context.pop();
- context.di = 48;
- context.bx = 128;
- context.dl = 144;
- context.al = 0;
- context.ah = 0;
- printdirect(context);
- context.al = context.data.byte(kCharacter);
- context._and(context.al, 127);
- context.ah = 0;
- context.cx = 64;
- context._mul(context.cx);
- context.cl = context.data.byte(kTalkpos);
- context.ch = 0;
- context._add(context.ax, context.cx);
- context.cl = 'C';
- context.dl = 'R';
- context.dh = context.data.byte(kReallocation);
- loadspeech(context);
- context._cmp(context.data.byte(kSpeechloaded), 0);
- if (context.flags.z())
+ push(es);
+ push(si);
+ createpanel();
+ showpanel();
+ showman();
+ showexit();
+ convicons();
+ si = pop();
+ es = pop();
+ di = 48;
+ bx = 128;
+ dl = 144;
+ al = 0;
+ ah = 0;
+ printdirect();
+ al = data.byte(kCharacter);
+ _and(al, 127);
+ ah = 0;
+ cx = 64;
+ _mul(cx);
+ cl = data.byte(kTalkpos);
+ ch = 0;
+ _add(ax, cx);
+ cl = 'C';
+ dl = 'R';
+ dh = data.byte(kReallocation);
+ loadspeech();
+ _cmp(data.byte(kSpeechloaded), 0);
+ if (flags.z())
goto noplay2;
- context.al = 62;
- playchannel1(context);
+ al = 62;
+ playchannel1();
noplay2:
- context.data.byte(kPointermode) = 3;
- worktoscreenm(context);
- context.cx = 180;
- hangonpq(context);
- if (!context.flags.c())
+ data.byte(kPointermode) = 3;
+ worktoscreenm();
+ cx = 180;
+ hangonpq();
+ if (!flags.c())
goto skiptalk2;
return;
skiptalk2:
- context._inc(context.data.byte(kTalkpos));
+ _inc(data.byte(kTalkpos));
goto dospeech;
endheartalk:
- context.data.byte(kPointermode) = 0;
+ data.byte(kPointermode) = 0;
}
-void hangonpq(Context &context) {
- STACK_CHECK(context);
- context.data.byte(kGetback) = 0;
- context.bx = 0;
+void DreamGenContext::hangonpq() {
+ STACK_CHECK;
+ data.byte(kGetback) = 0;
+ bx = 0;
hangloopq:
- context.push(context.cx);
- context.push(context.bx);
- delpointer(context);
- readmouse(context);
- animpointer(context);
- showpointer(context);
- vsync(context);
- dumppointer(context);
- dumptextline(context);
- context.bx = 2692;
- checkcoords(context);
- context.bx = context.pop();
- context.cx = context.pop();
- context._cmp(context.data.byte(kGetback), 1);
- if (context.flags.z())
+ push(cx);
+ push(bx);
+ delpointer();
+ readmouse();
+ animpointer();
+ showpointer();
+ vsync();
+ dumppointer();
+ dumptextline();
+ bx = 2692;
+ checkcoords();
+ bx = pop();
+ cx = pop();
+ _cmp(data.byte(kGetback), 1);
+ if (flags.z())
goto quitconv;
- context._cmp(context.data.byte(kSpeechloaded), 1);
- if (!context.flags.z())
+ _cmp(data.byte(kSpeechloaded), 1);
+ if (!flags.z())
goto notspeaking;
- context._cmp(context.data.byte(kCh1playing), 255);
- if (!context.flags.z())
+ _cmp(data.byte(kCh1playing), 255);
+ if (!flags.z())
goto notspeaking;
- context._inc(context.bx);
- context._cmp(context.bx, 40);
- if (context.flags.z())
+ _inc(bx);
+ _cmp(bx, 40);
+ if (flags.z())
goto finishconv;
notspeaking:
- context._cmp(context.data.word(kMousebutton), 0);
- if (context.flags.z())
+ _cmp(data.word(kMousebutton), 0);
+ if (flags.z())
goto hangloopq;
- context._cmp(context.data.word(kOldbutton), 0);
- if (!context.flags.z())
+ _cmp(data.word(kOldbutton), 0);
+ if (!flags.z())
goto hangloopq;
finishconv:
- delpointer(context);
- context.data.byte(kPointermode) = 0;
- context.flags._c = false;
+ delpointer();
+ data.byte(kPointermode) = 0;
+ flags._c = false;
return;
quitconv:
- delpointer(context);
- context.data.byte(kPointermode) = 0;
- cancelch1(context);
- context.flags._c = true;
+ delpointer();
+ data.byte(kPointermode) = 0;
+ cancelch1();
+ flags._c = true;
}
-void redes(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kCh1playing), 255);
- if (!context.flags.z())
+void DreamGenContext::redes() {
+ STACK_CHECK;
+ _cmp(data.byte(kCh1playing), 255);
+ if (!flags.z())
goto cantredes;
- context._cmp(context.data.byte(kTalkmode), 2);
- if (context.flags.z())
+ _cmp(data.byte(kTalkmode), 2);
+ if (flags.z())
goto canredes;
cantredes:
- blank(context);
+ blank();
return;
canredes:
- context._cmp(context.data.byte(kCommandtype), 217);
- if (context.flags.z())
+ _cmp(data.byte(kCommandtype), 217);
+ if (flags.z())
goto alreadyreds;
- context.data.byte(kCommandtype) = 217;
- context.al = 50;
- commandonly(context);
+ data.byte(kCommandtype) = 217;
+ al = 50;
+ commandonly();
alreadyreds:
- context.ax = context.data.word(kMousebutton);
- context._and(context.ax, 1);
- if (!context.flags.z())
+ ax = data.word(kMousebutton);
+ _and(ax, 1);
+ if (!flags.z())
goto doredes;
return;
doredes:
- delpointer(context);
- createpanel(context);
- showpanel(context);
- showman(context);
- showexit(context);
- convicons(context);
- starttalk(context);
- readmouse(context);
- showpointer(context);
- worktoscreen(context);
- delpointer(context);
-}
-
-void newplace(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kNeedtotravel), 1);
- if (context.flags.z())
+ delpointer();
+ createpanel();
+ showpanel();
+ showman();
+ showexit();
+ convicons();
+ starttalk();
+ readmouse();
+ showpointer();
+ worktoscreen();
+ delpointer();
+}
+
+void DreamGenContext::newplace() {
+ STACK_CHECK;
+ _cmp(data.byte(kNeedtotravel), 1);
+ if (flags.z())
goto istravel;
- context._cmp(context.data.byte(kAutolocation), -1);
- if (!context.flags.z())
+ _cmp(data.byte(kAutolocation), -1);
+ if (!flags.z())
goto isautoloc;
return;
isautoloc:
- context.al = context.data.byte(kAutolocation);
- context.data.byte(kNewlocation) = context.al;
- context.data.byte(kAutolocation) = -1;
+ al = data.byte(kAutolocation);
+ data.byte(kNewlocation) = al;
+ data.byte(kAutolocation) = -1;
return;
istravel:
- context.data.byte(kNeedtotravel) = 0;
- selectlocation(context);
-}
-
-void selectlocation(Context &context) {
- STACK_CHECK(context);
- context.data.byte(kInmaparea) = 0;
- clearbeforeload(context);
- context.data.byte(kGetback) = 0;
- context.data.byte(kPointerframe) = 22;
- readcitypic(context);
- showcity(context);
- getridoftemp(context);
- readdesticon(context);
- loadtraveltext(context);
- showpanel(context);
- showman(context);
- showarrows(context);
- showexit(context);
- locationpic(context);
- undertextline(context);
- context.data.byte(kCommandtype) = 255;
- readmouse(context);
- context.data.byte(kPointerframe) = 0;
- showpointer(context);
- worktoscreen(context);
- context.al = 9;
- context.ah = 255;
- playchannel0(context);
- context.data.byte(kNewlocation) = 255;
+ data.byte(kNeedtotravel) = 0;
+ selectlocation();
+}
+
+void DreamGenContext::selectlocation() {
+ STACK_CHECK;
+ data.byte(kInmaparea) = 0;
+ clearbeforeload();
+ data.byte(kGetback) = 0;
+ data.byte(kPointerframe) = 22;
+ readcitypic();
+ showcity();
+ getridoftemp();
+ readdesticon();
+ loadtraveltext();
+ showpanel();
+ showman();
+ showarrows();
+ showexit();
+ locationpic();
+ undertextline();
+ data.byte(kCommandtype) = 255;
+ readmouse();
+ data.byte(kPointerframe) = 0;
+ showpointer();
+ worktoscreen();
+ al = 9;
+ ah = 255;
+ playchannel0();
+ data.byte(kNewlocation) = 255;
select:
- delpointer(context);
- readmouse(context);
- showpointer(context);
- vsync(context);
- dumppointer(context);
- dumptextline(context);
- context._cmp(context.data.byte(kGetback), 1);
- if (context.flags.z())
+ _cmp(data.byte(kQuitrequested), 0);
+ if (!flags.z())
+ goto quittravel;
+ delpointer();
+ readmouse();
+ showpointer();
+ vsync();
+ dumppointer();
+ dumptextline();
+ _cmp(data.byte(kGetback), 1);
+ if (flags.z())
goto quittravel;
- context.bx = 2714;
- checkcoords(context);
- context._cmp(context.data.byte(kNewlocation), 255);
- if (context.flags.z())
+ bx = 2714;
+ checkcoords();
+ _cmp(data.byte(kNewlocation), 255);
+ if (flags.z())
goto select;
- context.al = context.data.byte(kNewlocation);
- context._cmp(context.al, context.data.byte(kLocation));
- if (context.flags.z())
+ al = data.byte(kNewlocation);
+ _cmp(al, data.byte(kLocation));
+ if (flags.z())
goto quittravel;
- getridoftemp(context);
- getridoftemp2(context);
- getridoftemp3(context);
- context.es = context.data.word(kTraveltext);
- deallocatemem(context);
+ getridoftemp();
+ getridoftemp2();
+ getridoftemp3();
+ es = data.word(kTraveltext);
+ deallocatemem();
return;
quittravel:
- context.al = context.data.byte(kReallocation);
- context.data.byte(kNewlocation) = context.al;
- context.data.byte(kGetback) = 0;
- getridoftemp(context);
- getridoftemp2(context);
- getridoftemp3(context);
- context.es = context.data.word(kTraveltext);
- deallocatemem(context);
-}
-
-void showcity(Context &context) {
- STACK_CHECK(context);
- clearwork(context);
- context.ds = context.data.word(kTempgraphics);
- context.di = 57;
- context.bx = 32;
- context.al = 0;
- context.ah = 0;
- showframe(context);
- context.ds = context.data.word(kTempgraphics);
- context.di = 120+57;
- context.bx = 32;
- context.al = 1;
- context.ah = 0;
- showframe(context);
-}
-
-void lookatplace(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kCommandtype), 224);
- if (context.flags.z())
+ al = data.byte(kReallocation);
+ data.byte(kNewlocation) = al;
+ data.byte(kGetback) = 0;
+ getridoftemp();
+ getridoftemp2();
+ getridoftemp3();
+ es = data.word(kTraveltext);
+ deallocatemem();
+}
+
+void DreamGenContext::showcity() {
+ STACK_CHECK;
+ clearwork();
+ ds = data.word(kTempgraphics);
+ di = 57;
+ bx = 32;
+ al = 0;
+ ah = 0;
+ showframe();
+ ds = data.word(kTempgraphics);
+ di = 120+57;
+ bx = 32;
+ al = 1;
+ ah = 0;
+ showframe();
+}
+
+void DreamGenContext::lookatplace() {
+ STACK_CHECK;
+ _cmp(data.byte(kCommandtype), 224);
+ if (flags.z())
goto alreadyinfo;
- context.data.byte(kCommandtype) = 224;
- context.al = 27;
- commandonly(context);
+ data.byte(kCommandtype) = 224;
+ al = 27;
+ commandonly();
alreadyinfo:
- context.ax = context.data.word(kMousebutton);
- context._and(context.ax, 1);
- if (context.flags.z())
- goto noinfo;
- context._cmp(context.ax, context.data.word(kOldbutton));
- if (context.flags.z())
- goto noinfo;
- context.bl = context.data.byte(kDestpos);
- context._cmp(context.bl, 15);
- if (!context.flags.c())
- goto noinfo;
- context.push(context.bx);
- delpointer(context);
- deltextline(context);
- getundercentre(context);
- context.ds = context.data.word(kTempgraphics3);
- context.al = 0;
- context.ah = 0;
- context.di = 60;
- context.bx = 72;
- showframe(context);
- context.al = 4;
- context.ah = 0;
- context.di = 60;
- context.bx = 72+55;
- showframe(context);
- context.bx = context.pop();
- context.bh = 0;
- context._add(context.bx, context.bx);
- context.es = context.data.word(kTraveltext);
- context.si = context.es.word(context.bx);
- context._add(context.si, (66*2));
- findnextcolon(context);
- context.di = 63;
- context.bx = 84;
- context.dl = 191;
- context.al = 0;
- context.ah = 0;
- printdirect(context);
- worktoscreenm(context);
- context.cx = 500;
- hangonp(context);
- context.data.byte(kPointermode) = 0;
- context.data.byte(kPointerframe) = 0;
- putundercentre(context);
- worktoscreenm(context);
-noinfo:
- return;
-}
-
-void getundercentre(Context &context) {
- STACK_CHECK(context);
- context.di = 58;
- context.bx = 72;
- context.ds = context.data.word(kMapstore);
- context.si = 0;
- context.cl = 254;
- context.ch = 110;
- multiget(context);
-}
-
-void putundercentre(Context &context) {
- STACK_CHECK(context);
- context.di = 58;
- context.bx = 72;
- context.ds = context.data.word(kMapstore);
- context.si = 0;
- context.cl = 254;
- context.ch = 110;
- multiput(context);
-}
-
-void locationpic(Context &context) {
- STACK_CHECK(context);
- getdestinfo(context);
- context.al = context.es.byte(context.si);
- context.push(context.es);
- context.push(context.si);
- context.di = 0;
- context._cmp(context.al, 6);
- if (!context.flags.c())
+ ax = data.word(kMousebutton);
+ _and(ax, 1);
+ if (flags.z())
+ return /* (noinfo) */;
+ _cmp(ax, data.word(kOldbutton));
+ if (flags.z())
+ return /* (noinfo) */;
+ bl = data.byte(kDestpos);
+ _cmp(bl, 15);
+ if (!flags.c())
+ return /* (noinfo) */;
+ push(bx);
+ delpointer();
+ deltextline();
+ getundercentre();
+ ds = data.word(kTempgraphics3);
+ al = 0;
+ ah = 0;
+ di = 60;
+ bx = 72;
+ showframe();
+ al = 4;
+ ah = 0;
+ di = 60;
+ bx = 72+55;
+ showframe();
+ bx = pop();
+ bh = 0;
+ _add(bx, bx);
+ es = data.word(kTraveltext);
+ si = es.word(bx);
+ _add(si, (66*2));
+ findnextcolon();
+ di = 63;
+ bx = 84;
+ dl = 191;
+ al = 0;
+ ah = 0;
+ printdirect();
+ worktoscreenm();
+ cx = 500;
+ hangonp();
+ data.byte(kPointermode) = 0;
+ data.byte(kPointerframe) = 0;
+ putundercentre();
+ worktoscreenm();
+}
+
+void DreamGenContext::getundercentre() {
+ STACK_CHECK;
+ di = 58;
+ bx = 72;
+ ds = data.word(kMapstore);
+ si = 0;
+ cl = 254;
+ ch = 110;
+ multiget();
+}
+
+void DreamGenContext::putundercentre() {
+ STACK_CHECK;
+ di = 58;
+ bx = 72;
+ ds = data.word(kMapstore);
+ si = 0;
+ cl = 254;
+ ch = 110;
+ multiput();
+}
+
+void DreamGenContext::locationpic() {
+ STACK_CHECK;
+ getdestinfo();
+ al = es.byte(si);
+ push(es);
+ push(si);
+ di = 0;
+ _cmp(al, 6);
+ if (!flags.c())
goto secondlot;
- context.ds = context.data.word(kTempgraphics);
- context._add(context.al, 4);
+ ds = data.word(kTempgraphics);
+ _add(al, 4);
goto gotgraphic;
secondlot:
- context._sub(context.al, 6);
- context.ds = context.data.word(kTempgraphics2);
+ _sub(al, 6);
+ ds = data.word(kTempgraphics2);
gotgraphic:
- context._add(context.di, 104);
- context.bx = 138+14;
- context.ah = 0;
- showframe(context);
- context.si = context.pop();
- context.es = context.pop();
- context.al = context.data.byte(kDestpos);
- context._cmp(context.al, context.data.byte(kReallocation));
- if (!context.flags.z())
+ _add(di, 104);
+ bx = 138+14;
+ ah = 0;
+ showframe();
+ si = pop();
+ es = pop();
+ al = data.byte(kDestpos);
+ _cmp(al, data.byte(kReallocation));
+ if (!flags.z())
goto notinthisone;
- context.al = 3;
- context.di = 104;
- context.bx = 140+14;
- context.ds = context.data.word(kTempgraphics);
- context.ah = 0;
- showframe(context);
+ al = 3;
+ di = 104;
+ bx = 140+14;
+ ds = data.word(kTempgraphics);
+ ah = 0;
+ showframe();
notinthisone:
- context.bl = context.data.byte(kDestpos);
- context.bh = 0;
- context._add(context.bx, context.bx);
- context.es = context.data.word(kTraveltext);
- context.si = context.es.word(context.bx);
- context._add(context.si, (66*2));
- context.di = 50;
- context.bx = 20;
- context.dl = 241;
- context.al = 0;
- context.ah = 0;
- printdirect(context);
-}
-
-void getdestinfo(Context &context) {
- STACK_CHECK(context);
- context.al = context.data.byte(kDestpos);
- context.ah = 0;
- context.push(context.ax);
- context.dx = context.data;
- context.es = context.dx;
- context.si = 8011;
- context._add(context.si, context.ax);
- context.cl = context.es.byte(context.si);
- context.ax = context.pop();
- context.push(context.cx);
- context.dx = context.data;
- context.es = context.dx;
- context.si = 8027;
- context._add(context.si, context.ax);
- context.ax = context.pop();
-}
-
-void showarrows(Context &context) {
- STACK_CHECK(context);
- context.di = 116-12;
- context.bx = 16;
- context.ds = context.data.word(kTempgraphics);
- context.al = 0;
- context.ah = 0;
- showframe(context);
- context.di = 226+12;
- context.bx = 16;
- context.ds = context.data.word(kTempgraphics);
- context.al = 1;
- context.ah = 0;
- showframe(context);
- context.di = 280;
- context.bx = 14;
- context.ds = context.data.word(kTempgraphics);
- context.al = 2;
- context.ah = 0;
- showframe(context);
-}
-
-void nextdest(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kCommandtype), 218);
- if (context.flags.z())
+ bl = data.byte(kDestpos);
+ bh = 0;
+ _add(bx, bx);
+ es = data.word(kTraveltext);
+ si = es.word(bx);
+ _add(si, (66*2));
+ di = 50;
+ bx = 20;
+ dl = 241;
+ al = 0;
+ ah = 0;
+ printdirect();
+}
+
+void DreamGenContext::getdestinfo() {
+ STACK_CHECK;
+ al = data.byte(kDestpos);
+ ah = 0;
+ push(ax);
+ dx = data;
+ es = dx;
+ si = 8011;
+ _add(si, ax);
+ cl = es.byte(si);
+ ax = pop();
+ push(cx);
+ dx = data;
+ es = dx;
+ si = 8027;
+ _add(si, ax);
+ ax = pop();
+}
+
+void DreamGenContext::showarrows() {
+ STACK_CHECK;
+ di = 116-12;
+ bx = 16;
+ ds = data.word(kTempgraphics);
+ al = 0;
+ ah = 0;
+ showframe();
+ di = 226+12;
+ bx = 16;
+ ds = data.word(kTempgraphics);
+ al = 1;
+ ah = 0;
+ showframe();
+ di = 280;
+ bx = 14;
+ ds = data.word(kTempgraphics);
+ al = 2;
+ ah = 0;
+ showframe();
+}
+
+void DreamGenContext::nextdest() {
+ STACK_CHECK;
+ _cmp(data.byte(kCommandtype), 218);
+ if (flags.z())
goto alreadydu;
- context.data.byte(kCommandtype) = 218;
- context.al = 28;
- commandonly(context);
+ data.byte(kCommandtype) = 218;
+ al = 28;
+ commandonly();
alreadydu:
- context.ax = context.data.word(kMousebutton);
- context._and(context.ax, 1);
- if (context.flags.z())
- goto nodu;
- context._cmp(context.ax, context.data.word(kOldbutton));
- if (context.flags.z())
- goto nodu;
+ ax = data.word(kMousebutton);
+ _and(ax, 1);
+ if (flags.z())
+ return /* (nodu) */;
+ _cmp(ax, data.word(kOldbutton));
+ if (flags.z())
+ return /* (nodu) */;
searchdestup:
- context._inc(context.data.byte(kDestpos));
- context._cmp(context.data.byte(kDestpos), 15);
- if (!context.flags.z())
+ _inc(data.byte(kDestpos));
+ _cmp(data.byte(kDestpos), 15);
+ if (!flags.z())
goto notlastdest;
- context.data.byte(kDestpos) = 0;
+ data.byte(kDestpos) = 0;
notlastdest:
- getdestinfo(context);
- context._cmp(context.al, 0);
- if (context.flags.z())
+ getdestinfo();
+ _cmp(al, 0);
+ if (flags.z())
goto searchdestup;
- context.data.byte(kNewtextline) = 1;
- deltextline(context);
- delpointer(context);
- showpanel(context);
- showman(context);
- showarrows(context);
- locationpic(context);
- undertextline(context);
- readmouse(context);
- showpointer(context);
- worktoscreen(context);
- delpointer(context);
-nodu:
- return;
-}
-
-void lastdest(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kCommandtype), 219);
- if (context.flags.z())
+ data.byte(kNewtextline) = 1;
+ deltextline();
+ delpointer();
+ showpanel();
+ showman();
+ showarrows();
+ locationpic();
+ undertextline();
+ readmouse();
+ showpointer();
+ worktoscreen();
+ delpointer();
+}
+
+void DreamGenContext::lastdest() {
+ STACK_CHECK;
+ _cmp(data.byte(kCommandtype), 219);
+ if (flags.z())
goto alreadydd;
- context.data.byte(kCommandtype) = 219;
- context.al = 29;
- commandonly(context);
+ data.byte(kCommandtype) = 219;
+ al = 29;
+ commandonly();
alreadydd:
- context.ax = context.data.word(kMousebutton);
- context._and(context.ax, 1);
- if (context.flags.z())
- goto nodd;
- context._cmp(context.ax, context.data.word(kOldbutton));
- if (context.flags.z())
- goto nodd;
+ ax = data.word(kMousebutton);
+ _and(ax, 1);
+ if (flags.z())
+ return /* (nodd) */;
+ _cmp(ax, data.word(kOldbutton));
+ if (flags.z())
+ return /* (nodd) */;
searchdestdown:
- context._dec(context.data.byte(kDestpos));
- context._cmp(context.data.byte(kDestpos), -1);
- if (!context.flags.z())
+ _dec(data.byte(kDestpos));
+ _cmp(data.byte(kDestpos), -1);
+ if (!flags.z())
goto notfirstdest;
- context.data.byte(kDestpos) = 15;
+ data.byte(kDestpos) = 15;
notfirstdest:
- getdestinfo(context);
- context._cmp(context.al, 0);
- if (context.flags.z())
+ getdestinfo();
+ _cmp(al, 0);
+ if (flags.z())
goto searchdestdown;
- context.data.byte(kNewtextline) = 1;
- deltextline(context);
- delpointer(context);
- showpanel(context);
- showman(context);
- showarrows(context);
- locationpic(context);
- undertextline(context);
- readmouse(context);
- showpointer(context);
- worktoscreen(context);
- delpointer(context);
-nodd:
- return;
-}
-
-void destselect(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kCommandtype), 222);
- if (context.flags.z())
+ data.byte(kNewtextline) = 1;
+ deltextline();
+ delpointer();
+ showpanel();
+ showman();
+ showarrows();
+ locationpic();
+ undertextline();
+ readmouse();
+ showpointer();
+ worktoscreen();
+ delpointer();
+}
+
+void DreamGenContext::destselect() {
+ STACK_CHECK;
+ _cmp(data.byte(kCommandtype), 222);
+ if (flags.z())
goto alreadytrav;
- context.data.byte(kCommandtype) = 222;
- context.al = 30;
- commandonly(context);
+ data.byte(kCommandtype) = 222;
+ al = 30;
+ commandonly();
alreadytrav:
- context.ax = context.data.word(kMousebutton);
- context._and(context.ax, 1);
- if (context.flags.z())
- goto notrav;
- context._cmp(context.ax, context.data.word(kOldbutton));
- if (context.flags.z())
- goto notrav;
- getdestinfo(context);
- context.al = context.data.byte(kDestpos);
- context.data.byte(kNewlocation) = context.al;
-notrav:
- return;
-}
-
-void getlocation(Context &context) {
- STACK_CHECK(context);
- context.ah = 0;
- context.bx = context.ax;
- context.dx = context.data;
- context.es = context.dx;
- context._add(context.bx, 8011);
- context.al = context.es.byte(context.bx);
-}
-
-void setlocation(Context &context) {
- STACK_CHECK(context);
- context.ah = 0;
- context.bx = context.ax;
- context.dx = context.data;
- context.es = context.dx;
- context._add(context.bx, 8011);
- context.es.byte(context.bx) = 1;
-}
-
-void resetlocation(Context &context) {
- STACK_CHECK(context);
- context.push(context.ax);
- context._cmp(context.al, 5);
- if (!context.flags.z())
+ ax = data.word(kMousebutton);
+ _and(ax, 1);
+ if (flags.z())
+ return /* (notrav) */;
+ _cmp(ax, data.word(kOldbutton));
+ if (flags.z())
+ return /* (notrav) */;
+ getdestinfo();
+ al = data.byte(kDestpos);
+ data.byte(kNewlocation) = al;
+}
+
+void DreamGenContext::getlocation() {
+ STACK_CHECK;
+ ah = 0;
+ bx = ax;
+ dx = data;
+ es = dx;
+ _add(bx, 8011);
+ al = es.byte(bx);
+}
+
+void DreamGenContext::setlocation() {
+ STACK_CHECK;
+ ah = 0;
+ bx = ax;
+ dx = data;
+ es = dx;
+ _add(bx, 8011);
+ es.byte(bx) = 1;
+}
+
+void DreamGenContext::resetlocation() {
+ STACK_CHECK;
+ push(ax);
+ _cmp(al, 5);
+ if (!flags.z())
goto notdelhotel;
- purgealocation(context);
- context.al = 21;
- purgealocation(context);
- context.al = 22;
- purgealocation(context);
- context.al = 27;
- purgealocation(context);
+ purgealocation();
+ al = 21;
+ purgealocation();
+ al = 22;
+ purgealocation();
+ al = 27;
+ purgealocation();
goto clearedlocations;
notdelhotel:
- context._cmp(context.al, 8);
- if (!context.flags.z())
+ _cmp(al, 8);
+ if (!flags.z())
goto notdeltvstud;
- purgealocation(context);
- context.al = 28;
- purgealocation(context);
+ purgealocation();
+ al = 28;
+ purgealocation();
goto clearedlocations;
notdeltvstud:
- context._cmp(context.al, 6);
- if (!context.flags.z())
+ _cmp(al, 6);
+ if (!flags.z())
goto notdelsarters;
- purgealocation(context);
- context.al = 20;
- purgealocation(context);
- context.al = 25;
- purgealocation(context);
+ purgealocation();
+ al = 20;
+ purgealocation();
+ al = 25;
+ purgealocation();
goto clearedlocations;
notdelsarters:
- context._cmp(context.al, 13);
- if (!context.flags.z())
+ _cmp(al, 13);
+ if (!flags.z())
goto notdelboathouse;
- purgealocation(context);
- context.al = 29;
- purgealocation(context);
+ purgealocation();
+ al = 29;
+ purgealocation();
goto clearedlocations;
notdelboathouse:
clearedlocations:
- context.ax = context.pop();
- context.ah = 0;
- context.bx = context.ax;
- context.dx = context.data;
- context.es = context.dx;
- context._add(context.bx, 8011);
- context.es.byte(context.bx) = 0;
-}
-
-void readdesticon(Context &context) {
- STACK_CHECK(context);
- context.dx = 2013;
- loadintotemp(context);
- context.dx = 2026;
- loadintotemp2(context);
- context.dx = 1961;
- loadintotemp3(context);
-}
-
-void readcitypic(Context &context) {
- STACK_CHECK(context);
- context.dx = 2000;
- loadintotemp(context);
-}
-
-void usemon(Context &context) {
- STACK_CHECK(context);
- context.data.byte(kLasttrigger) = 0;
- context.es = context.cs;
- context.di = 2970+1;
- context.cx = 12;
- context.al = 32;
- context._stosb(context.cx);
- context.es = context.cs;
- context.di = 2942+1;
- context.cx = 12;
- context.al = 32;
- context._stosb(context.cx);
- context.es = context.cs;
- context.di = 2836;
- context.es.byte(context.di) = 1;
- context._add(context.di, 26);
- context.cx = 3;
+ ax = pop();
+ ah = 0;
+ bx = ax;
+ dx = data;
+ es = dx;
+ _add(bx, 8011);
+ es.byte(bx) = 0;
+}
+
+void DreamGenContext::readdesticon() {
+ STACK_CHECK;
+ dx = 2013;
+ loadintotemp();
+ dx = 2026;
+ loadintotemp2();
+ dx = 1961;
+ loadintotemp3();
+}
+
+void DreamGenContext::readcitypic() {
+ STACK_CHECK;
+ dx = 2000;
+ loadintotemp();
+}
+
+void DreamGenContext::usemon() {
+ STACK_CHECK;
+ data.byte(kLasttrigger) = 0;
+ es = cs;
+ di = 2970+1;
+ cx = 12;
+ al = 32;
+ _stosb(cx, true);
+ es = cs;
+ di = 2942+1;
+ cx = 12;
+ al = 32;
+ _stosb(cx, true);
+ es = cs;
+ di = 2836;
+ es.byte(di) = 1;
+ _add(di, 26);
+ cx = 3;
keyloop:
- context.es.byte(context.di) = 0;
- context._add(context.di, 26);
- if (--context.cx)
+ es.byte(di) = 0;
+ _add(di, 26);
+ if (--cx)
goto keyloop;
- createpanel(context);
- showpanel(context);
- showicon(context);
- drawfloor(context);
- getridofall(context);
- context.dx = 1974;
- loadintotemp(context);
- loadpersonal(context);
- loadnews(context);
- loadcart(context);
- context.dx = 1870;
- loadtempcharset(context);
- printoutermon(context);
- initialmoncols(context);
- printlogo(context);
- worktoscreen(context);
- turnonpower(context);
- fadeupyellows(context);
- fadeupmonfirst(context);
- context.data.word(kMonadx) = 76;
- context.data.word(kMonady) = 141;
- context.al = 1;
- monmessage(context);
- context.cx = 120;
- hangoncurs(context);
- context.al = 2;
- monmessage(context);
- context.cx = 60;
- randomaccess(context);
- context.al = 3;
- monmessage(context);
- context.cx = 100;
- hangoncurs(context);
- printlogo(context);
- scrollmonitor(context);
- context.data.word(kBufferin) = 0;
- context.data.word(kBufferout) = 0;
+ createpanel();
+ showpanel();
+ showicon();
+ drawfloor();
+ getridofall();
+ dx = 1974;
+ loadintotemp();
+ loadpersonal();
+ loadnews();
+ loadcart();
+ dx = 1870;
+ loadtempcharset();
+ printoutermon();
+ initialmoncols();
+ printlogo();
+ worktoscreen();
+ turnonpower();
+ fadeupyellows();
+ fadeupmonfirst();
+ data.word(kMonadx) = 76;
+ data.word(kMonady) = 141;
+ al = 1;
+ monmessage();
+ cx = 120;
+ hangoncurs();
+ al = 2;
+ monmessage();
+ cx = 60;
+ randomaccess();
+ al = 3;
+ monmessage();
+ cx = 100;
+ hangoncurs();
+ printlogo();
+ scrollmonitor();
+ data.word(kBufferin) = 0;
+ data.word(kBufferout) = 0;
moreinput:
- context.di = context.data.word(kMonadx);
- context.bx = context.data.word(kMonady);
- context.push(context.di);
- context.push(context.bx);
- input(context);
- context.bx = context.pop();
- context.di = context.pop();
- context.data.word(kMonadx) = context.di;
- context.data.word(kMonady) = context.bx;
- execcommand(context);
- context._cmp(context.al, 0);
- if (context.flags.z())
+ di = data.word(kMonadx);
+ bx = data.word(kMonady);
+ push(di);
+ push(bx);
+ input();
+ bx = pop();
+ di = pop();
+ data.word(kMonadx) = di;
+ data.word(kMonady) = bx;
+ execcommand();
+ _cmp(al, 0);
+ if (flags.z())
goto moreinput;
- getridoftemp(context);
- getridoftempcharset(context);
- context.es = context.data.word(kTextfile1);
- deallocatemem(context);
- context.es = context.data.word(kTextfile2);
- deallocatemem(context);
- context.es = context.data.word(kTextfile3);
- deallocatemem(context);
- context.data.byte(kGetback) = 1;
- context.al = 26;
- playchannel1(context);
- context.data.byte(kManisoffscreen) = 0;
- restoreall(context);
- redrawmainscrn(context);
- worktoscreenm(context);
-}
-
-void printoutermon(Context &context) {
- STACK_CHECK(context);
- context.di = 40;
- context.bx = 32;
- context.ds = context.data.word(kTempgraphics);
- context.al = 1;
- context.ah = 0;
- showframe(context);
- context.di = 264;
- context.bx = 32;
- context.ds = context.data.word(kTempgraphics);
- context.al = 2;
- context.ah = 0;
- showframe(context);
- context.di = 40;
- context.bx = 12;
- context.ds = context.data.word(kTempgraphics);
- context.al = 3;
- context.ah = 0;
- showframe(context);
- context.di = 40;
- context.bx = 164;
- context.ds = context.data.word(kTempgraphics);
- context.al = 4;
- context.ah = 0;
- showframe(context);
-}
-
-void loadpersonal(Context &context) {
- STACK_CHECK(context);
- context.al = context.data.byte(kLocation);
- context.dx = 2052;
- context._cmp(context.al, 0);
- if (context.flags.z())
+ getridoftemp();
+ getridoftempcharset();
+ es = data.word(kTextfile1);
+ deallocatemem();
+ es = data.word(kTextfile2);
+ deallocatemem();
+ es = data.word(kTextfile3);
+ deallocatemem();
+ data.byte(kGetback) = 1;
+ al = 26;
+ playchannel1();
+ data.byte(kManisoffscreen) = 0;
+ restoreall();
+ redrawmainscrn();
+ worktoscreenm();
+}
+
+void DreamGenContext::printoutermon() {
+ STACK_CHECK;
+ di = 40;
+ bx = 32;
+ ds = data.word(kTempgraphics);
+ al = 1;
+ ah = 0;
+ showframe();
+ di = 264;
+ bx = 32;
+ ds = data.word(kTempgraphics);
+ al = 2;
+ ah = 0;
+ showframe();
+ di = 40;
+ bx = 12;
+ ds = data.word(kTempgraphics);
+ al = 3;
+ ah = 0;
+ showframe();
+ di = 40;
+ bx = 164;
+ ds = data.word(kTempgraphics);
+ al = 4;
+ ah = 0;
+ showframe();
+}
+
+void DreamGenContext::loadpersonal() {
+ STACK_CHECK;
+ al = data.byte(kLocation);
+ dx = 2052;
+ _cmp(al, 0);
+ if (flags.z())
goto foundpersonal;
- context._cmp(context.al, 42);
- if (context.flags.z())
+ _cmp(al, 42);
+ if (flags.z())
goto foundpersonal;
- context.dx = 2065;
- context._cmp(context.al, 2);
- if (context.flags.z())
+ dx = 2065;
+ _cmp(al, 2);
+ if (flags.z())
goto foundpersonal;
foundpersonal:
- openfile(context);
- readheader(context);
- context.bx = context.es.word(context.di);
- context.push(context.bx);
- context.cl = 4;
- context._shr(context.bx, context.cl);
- allocatemem(context);
- context.data.word(kTextfile1) = context.ax;
- context.ds = context.ax;
- context.cx = context.pop();
- context.dx = 0;
- readfromfile(context);
- closefile(context);
-}
-
-void loadnews(Context &context) {
- STACK_CHECK(context);
- context.al = context.data.byte(kNewsitem);
- context.dx = 2078;
- context._cmp(context.al, 0);
- if (context.flags.z())
+ openfile();
+ readheader();
+ bx = es.word(di);
+ push(bx);
+ cl = 4;
+ _shr(bx, cl);
+ allocatemem();
+ data.word(kTextfile1) = ax;
+ ds = ax;
+ cx = pop();
+ dx = 0;
+ readfromfile();
+ closefile();
+}
+
+void DreamGenContext::loadnews() {
+ STACK_CHECK;
+ al = data.byte(kNewsitem);
+ dx = 2078;
+ _cmp(al, 0);
+ if (flags.z())
goto foundnews;
- context.dx = 2091;
- context._cmp(context.al, 1);
- if (context.flags.z())
+ dx = 2091;
+ _cmp(al, 1);
+ if (flags.z())
goto foundnews;
- context.dx = 2104;
- context._cmp(context.al, 2);
- if (context.flags.z())
+ dx = 2104;
+ _cmp(al, 2);
+ if (flags.z())
goto foundnews;
- context.dx = 2117;
+ dx = 2117;
foundnews:
- openfile(context);
- readheader(context);
- context.bx = context.es.word(context.di);
- context.push(context.bx);
- context.cl = 4;
- context._shr(context.bx, context.cl);
- allocatemem(context);
- context.data.word(kTextfile2) = context.ax;
- context.ds = context.ax;
- context.cx = context.pop();
- context.dx = 0;
- readfromfile(context);
- closefile(context);
-}
-
-void loadcart(Context &context) {
- STACK_CHECK(context);
- lookininterface(context);
- context.dx = 2130;
- context._cmp(context.al, 0);
- if (context.flags.z())
+ openfile();
+ readheader();
+ bx = es.word(di);
+ push(bx);
+ cl = 4;
+ _shr(bx, cl);
+ allocatemem();
+ data.word(kTextfile2) = ax;
+ ds = ax;
+ cx = pop();
+ dx = 0;
+ readfromfile();
+ closefile();
+}
+
+void DreamGenContext::loadcart() {
+ STACK_CHECK;
+ lookininterface();
+ dx = 2130;
+ _cmp(al, 0);
+ if (flags.z())
goto gotcart;
- context.dx = 2143;
- context._cmp(context.al, 1);
- if (context.flags.z())
+ dx = 2143;
+ _cmp(al, 1);
+ if (flags.z())
goto gotcart;
- context.dx = 2156;
- context._cmp(context.al, 2);
- if (context.flags.z())
+ dx = 2156;
+ _cmp(al, 2);
+ if (flags.z())
goto gotcart;
- context.dx = 2169;
- context._cmp(context.al, 3);
- if (context.flags.z())
+ dx = 2169;
+ _cmp(al, 3);
+ if (flags.z())
goto gotcart;
- context.dx = 2182;
+ dx = 2182;
gotcart:
- openfile(context);
- readheader(context);
- context.bx = context.es.word(context.di);
- context.push(context.bx);
- context.cl = 4;
- context._shr(context.bx, context.cl);
- allocatemem(context);
- context.data.word(kTextfile3) = context.ax;
- context.ds = context.ax;
- context.cx = context.pop();
- context.dx = 0;
- readfromfile(context);
- closefile(context);
-}
-
-void lookininterface(Context &context) {
- STACK_CHECK(context);
- context.al = 'I';
- context.ah = 'N';
- context.cl = 'T';
- context.ch = 'F';
- findsetobject(context);
- context.ah = 1;
- checkinside(context);
- context._cmp(context.cl, (114));
- if (context.flags.z())
+ openfile();
+ readheader();
+ bx = es.word(di);
+ push(bx);
+ cl = 4;
+ _shr(bx, cl);
+ allocatemem();
+ data.word(kTextfile3) = ax;
+ ds = ax;
+ cx = pop();
+ dx = 0;
+ readfromfile();
+ closefile();
+}
+
+void DreamGenContext::lookininterface() {
+ STACK_CHECK;
+ al = 'I';
+ ah = 'N';
+ cl = 'T';
+ ch = 'F';
+ findsetobject();
+ ah = 1;
+ checkinside();
+ _cmp(cl, (114));
+ if (flags.z())
goto emptyinterface;
- context.al = context.es.byte(context.bx+15);
- context._inc(context.al);
+ al = es.byte(bx+15);
+ _inc(al);
return;
emptyinterface:
- context.al = 0;
+ al = 0;
}
-void turnonpower(Context &context) {
- STACK_CHECK(context);
- context.cx = 3;
+void DreamGenContext::turnonpower() {
+ STACK_CHECK;
+ cx = 3;
powerloop:
- context.push(context.cx);
- powerlighton(context);
- context.cx = 30;
- hangon(context);
- powerlightoff(context);
- context.cx = 30;
- hangon(context);
- context.cx = context.pop();
- if (--context.cx)
+ push(cx);
+ powerlighton();
+ cx = 30;
+ hangon();
+ powerlightoff();
+ cx = 30;
+ hangon();
+ cx = pop();
+ if (--cx)
goto powerloop;
- powerlighton(context);
+ powerlighton();
}
-void randomaccess(Context &context) {
- STACK_CHECK(context);
+void DreamGenContext::randomaccess() {
+ STACK_CHECK;
accessloop:
- context.push(context.cx);
- vsync(context);
- vsync(context);
- randomnum1(context);
- context._and(context.al, 15);
- context._cmp(context.al, 10);
- if (context.flags.c())
+ push(cx);
+ vsync();
+ vsync();
+ randomnum1();
+ _and(al, 15);
+ _cmp(al, 10);
+ if (flags.c())
goto off;
- accesslighton(context);
+ accesslighton();
goto chosenaccess;
off:
- accesslightoff(context);
+ accesslightoff();
chosenaccess:
- context.cx = context.pop();
- if (--context.cx)
+ cx = pop();
+ if (--cx)
goto accessloop;
- accesslightoff(context);
-}
-
-void powerlighton(Context &context) {
- STACK_CHECK(context);
- context.di = 257+4;
- context.bx = 182;
- context.ds = context.data.word(kTempgraphics);
- context.al = 6;
- context.ah = 0;
- context.push(context.di);
- context.push(context.bx);
- showframe(context);
- context.bx = context.pop();
- context.di = context.pop();
- context.cl = 12;
- context.ch = 8;
- multidump(context);
-}
-
-void powerlightoff(Context &context) {
- STACK_CHECK(context);
- context.di = 257+4;
- context.bx = 182;
- context.ds = context.data.word(kTempgraphics);
- context.al = 5;
- context.ah = 0;
- context.push(context.di);
- context.push(context.bx);
- showframe(context);
- context.bx = context.pop();
- context.di = context.pop();
- context.cl = 12;
- context.ch = 8;
- multidump(context);
-}
-
-void accesslighton(Context &context) {
- STACK_CHECK(context);
- context.di = 74;
- context.bx = 182;
- context.ds = context.data.word(kTempgraphics);
- context.al = 8;
- context.ah = 0;
- context.push(context.di);
- context.push(context.bx);
- showframe(context);
- context.bx = context.pop();
- context.di = context.pop();
- context.cl = 12;
- context.ch = 8;
- multidump(context);
-}
-
-void accesslightoff(Context &context) {
- STACK_CHECK(context);
- context.di = 74;
- context.bx = 182;
- context.ds = context.data.word(kTempgraphics);
- context.al = 7;
- context.ah = 0;
- context.push(context.di);
- context.push(context.bx);
- showframe(context);
- context.bx = context.pop();
- context.di = context.pop();
- context.cl = 12;
- context.ch = 8;
- multidump(context);
-}
-
-void locklighton(Context &context) {
- STACK_CHECK(context);
- context.di = 56;
- context.bx = 182;
- context.ds = context.data.word(kTempgraphics);
- context.al = 10;
- context.ah = 0;
- context.push(context.di);
- context.push(context.bx);
- showframe(context);
- context.bx = context.pop();
- context.di = context.pop();
- context.cl = 12;
- context.ch = 8;
- multidump(context);
-}
-
-void locklightoff(Context &context) {
- STACK_CHECK(context);
- context.di = 56;
- context.bx = 182;
- context.ds = context.data.word(kTempgraphics);
- context.al = 9;
- context.ah = 0;
- context.push(context.di);
- context.push(context.bx);
- showframe(context);
- context.bx = context.pop();
- context.di = context.pop();
- context.cl = 12;
- context.ch = 8;
- multidump(context);
-}
-
-void input(Context &context) {
- STACK_CHECK(context);
- context.es = context.cs;
- context.di = 8045;
- context.cx = 64;
- context.al = 0;
- context._stosb(context.cx);
- context.data.word(kCurpos) = 0;
- context.al = '>';
- context.di = context.data.word(kMonadx);
- context.bx = context.data.word(kMonady);
- context.ds = context.data.word(kTempcharset);
- context.ah = 0;
- printchar(context);
- context.di = context.data.word(kMonadx);
- context.bx = context.data.word(kMonady);
- context.cl = 6;
- context.ch = 8;
- multidump(context);
- context._add(context.data.word(kMonadx), 6);
- context.ax = context.data.word(kMonadx);
- context.data.word(kCurslocx) = context.ax;
- context.ax = context.data.word(kMonady);
- context.data.word(kCurslocy) = context.ax;
+ accesslightoff();
+}
+
+void DreamGenContext::powerlighton() {
+ STACK_CHECK;
+ di = 257+4;
+ bx = 182;
+ ds = data.word(kTempgraphics);
+ al = 6;
+ ah = 0;
+ push(di);
+ push(bx);
+ showframe();
+ bx = pop();
+ di = pop();
+ cl = 12;
+ ch = 8;
+ multidump();
+}
+
+void DreamGenContext::powerlightoff() {
+ STACK_CHECK;
+ di = 257+4;
+ bx = 182;
+ ds = data.word(kTempgraphics);
+ al = 5;
+ ah = 0;
+ push(di);
+ push(bx);
+ showframe();
+ bx = pop();
+ di = pop();
+ cl = 12;
+ ch = 8;
+ multidump();
+}
+
+void DreamGenContext::accesslighton() {
+ STACK_CHECK;
+ di = 74;
+ bx = 182;
+ ds = data.word(kTempgraphics);
+ al = 8;
+ ah = 0;
+ push(di);
+ push(bx);
+ showframe();
+ bx = pop();
+ di = pop();
+ cl = 12;
+ ch = 8;
+ multidump();
+}
+
+void DreamGenContext::accesslightoff() {
+ STACK_CHECK;
+ di = 74;
+ bx = 182;
+ ds = data.word(kTempgraphics);
+ al = 7;
+ ah = 0;
+ push(di);
+ push(bx);
+ showframe();
+ bx = pop();
+ di = pop();
+ cl = 12;
+ ch = 8;
+ multidump();
+}
+
+void DreamGenContext::locklighton() {
+ STACK_CHECK;
+ di = 56;
+ bx = 182;
+ ds = data.word(kTempgraphics);
+ al = 10;
+ ah = 0;
+ push(di);
+ push(bx);
+ showframe();
+ bx = pop();
+ di = pop();
+ cl = 12;
+ ch = 8;
+ multidump();
+}
+
+void DreamGenContext::locklightoff() {
+ STACK_CHECK;
+ di = 56;
+ bx = 182;
+ ds = data.word(kTempgraphics);
+ al = 9;
+ ah = 0;
+ push(di);
+ push(bx);
+ showframe();
+ bx = pop();
+ di = pop();
+ cl = 12;
+ ch = 8;
+ multidump();
+}
+
+void DreamGenContext::input() {
+ STACK_CHECK;
+ es = cs;
+ di = 8045;
+ cx = 64;
+ al = 0;
+ _stosb(cx, true);
+ data.word(kCurpos) = 0;
+ al = '>';
+ di = data.word(kMonadx);
+ bx = data.word(kMonady);
+ ds = data.word(kTempcharset);
+ ah = 0;
+ printchar();
+ di = data.word(kMonadx);
+ bx = data.word(kMonady);
+ cl = 6;
+ ch = 8;
+ multidump();
+ _add(data.word(kMonadx), 6);
+ ax = data.word(kMonadx);
+ data.word(kCurslocx) = ax;
+ ax = data.word(kMonady);
+ data.word(kCurslocy) = ax;
waitkey:
- printcurs(context);
- vsync(context);
- delcurs(context);
- readkey(context);
- context.al = context.data.byte(kCurrentkey);
- context._cmp(context.al, 0);
- if (context.flags.z())
+ printcurs();
+ vsync();
+ delcurs();
+ readkey();
+ al = data.byte(kCurrentkey);
+ _cmp(al, 0);
+ if (flags.z())
goto waitkey;
- context._cmp(context.al, 13);
- if (context.flags.z())
- goto endofinput;
- context._cmp(context.al, 8);
- if (!context.flags.z())
+ _cmp(al, 13);
+ if (flags.z())
+ return /* (endofinput) */;
+ _cmp(al, 8);
+ if (!flags.z())
goto notdel;
- context._cmp(context.data.word(kCurpos), 0);
- if (context.flags.z())
+ _cmp(data.word(kCurpos), 0);
+ if (flags.z())
goto waitkey;
- delchar(context);
+ delchar();
goto waitkey;
notdel:
- context._cmp(context.data.word(kCurpos), 28);
- if (context.flags.z())
+ _cmp(data.word(kCurpos), 28);
+ if (flags.z())
goto waitkey;
- context._cmp(context.data.byte(kCurrentkey), 32);
- if (!context.flags.z())
+ _cmp(data.byte(kCurrentkey), 32);
+ if (!flags.z())
goto notleadingspace;
- context._cmp(context.data.word(kCurpos), 0);
- if (context.flags.z())
+ _cmp(data.word(kCurpos), 0);
+ if (flags.z())
goto waitkey;
notleadingspace:
- makecaps(context);
- context.es = context.cs;
- context.si = context.data.word(kCurpos);
- context._add(context.si, context.si);
- context._add(context.si, 8045);
- context.es.byte(context.si) = context.al;
- context._cmp(context.al, 'Z'+1);
- if (!context.flags.c())
+ makecaps();
+ es = cs;
+ si = data.word(kCurpos);
+ _add(si, si);
+ _add(si, 8045);
+ es.byte(si) = al;
+ _cmp(al, 'Z'+1);
+ if (!flags.c())
goto waitkey;
- context.push(context.ax);
- context.push(context.es);
- context.push(context.si);
- context.di = context.data.word(kMonadx);
- context.bx = context.data.word(kMonady);
- context.ds = context.data.word(kMapstore);
- context.ax = context.data.word(kCurpos);
- context._xchg(context.al, context.ah);
- context.si = context.ax;
- context.cl = 8;
- context.ch = 8;
- multiget(context);
- context.si = context.pop();
- context.es = context.pop();
- context.ax = context.pop();
- context.push(context.es);
- context.push(context.si);
- context.di = context.data.word(kMonadx);
- context.bx = context.data.word(kMonady);
- context.ds = context.data.word(kTempcharset);
- context.ah = 0;
- printchar(context);
- context.si = context.pop();
- context.es = context.pop();
- context.es.byte(context.si+1) = context.cl;
- context.ch = 0;
- context._add(context.data.word(kMonadx), context.cx);
- context._inc(context.data.word(kCurpos));
- context._add(context.data.word(kCurslocx), context.cx);
+ push(ax);
+ push(es);
+ push(si);
+ di = data.word(kMonadx);
+ bx = data.word(kMonady);
+ ds = data.word(kMapstore);
+ ax = data.word(kCurpos);
+ _xchg(al, ah);
+ si = ax;
+ cl = 8;
+ ch = 8;
+ multiget();
+ si = pop();
+ es = pop();
+ ax = pop();
+ push(es);
+ push(si);
+ di = data.word(kMonadx);
+ bx = data.word(kMonady);
+ ds = data.word(kTempcharset);
+ ah = 0;
+ printchar();
+ si = pop();
+ es = pop();
+ es.byte(si+1) = cl;
+ ch = 0;
+ _add(data.word(kMonadx), cx);
+ _inc(data.word(kCurpos));
+ _add(data.word(kCurslocx), cx);
goto waitkey;
-endofinput:
- return;
-}
-
-void makecaps(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.al, 'a');
- if (context.flags.c())
- goto notupperc;
- context._sub(context.al, 32);
-notupperc:
- return;
-}
-
-void delchar(Context &context) {
- STACK_CHECK(context);
- context._dec(context.data.word(kCurpos));
- context.si = context.data.word(kCurpos);
- context._add(context.si, context.si);
- context.es = context.cs;
- context._add(context.si, 8045);
- context.es.byte(context.si) = 0;
- context.al = context.es.byte(context.si+1);
- context.ah = 0;
- context._sub(context.data.word(kMonadx), context.ax);
- context._sub(context.data.word(kCurslocx), context.ax);
- context.di = context.data.word(kMonadx);
- context.bx = context.data.word(kMonady);
- context.ds = context.data.word(kMapstore);
- context.ax = context.data.word(kCurpos);
- context._xchg(context.al, context.ah);
- context.si = context.ax;
- context.cl = 8;
- context.ch = 8;
- multiput(context);
- context.di = context.data.word(kMonadx);
- context.bx = context.data.word(kMonady);
- context.cl = context.al;
- context.ch = 8;
- multidump(context);
-}
-
-void execcommand(Context &context) {
- STACK_CHECK(context);
- context.es = context.cs;
- context.bx = 2776;
- context.ds = context.cs;
- context.si = 8045;
- context.al = context.ds.byte(context.si);
- context._cmp(context.al, 0);
- if (!context.flags.z())
+}
+
+void DreamGenContext::makecaps() {
+ STACK_CHECK;
+ _cmp(al, 'a');
+ if (flags.c())
+ return /* (notupperc) */;
+ _sub(al, 32);
+}
+
+void DreamGenContext::delchar() {
+ STACK_CHECK;
+ _dec(data.word(kCurpos));
+ si = data.word(kCurpos);
+ _add(si, si);
+ es = cs;
+ _add(si, 8045);
+ es.byte(si) = 0;
+ al = es.byte(si+1);
+ ah = 0;
+ _sub(data.word(kMonadx), ax);
+ _sub(data.word(kCurslocx), ax);
+ di = data.word(kMonadx);
+ bx = data.word(kMonady);
+ ds = data.word(kMapstore);
+ ax = data.word(kCurpos);
+ _xchg(al, ah);
+ si = ax;
+ cl = 8;
+ ch = 8;
+ multiput();
+ di = data.word(kMonadx);
+ bx = data.word(kMonady);
+ cl = al;
+ ch = 8;
+ multidump();
+}
+
+void DreamGenContext::execcommand() {
+ STACK_CHECK;
+ es = cs;
+ bx = 2776;
+ ds = cs;
+ si = 8045;
+ al = ds.byte(si);
+ _cmp(al, 0);
+ if (!flags.z())
goto notblankinp;
- scrollmonitor(context);
+ scrollmonitor();
return;
notblankinp:
- context.cl = 0;
+ cl = 0;
comloop:
- context.push(context.bx);
- context.push(context.si);
+ push(bx);
+ push(si);
comloop2:
- context.al = context.ds.byte(context.si);
- context._add(context.si, 2);
- context.ah = context.es.byte(context.bx);
- context._inc(context.bx);
- context._cmp(context.ah, 32);
- if (context.flags.z())
+ al = ds.byte(si);
+ _add(si, 2);
+ ah = es.byte(bx);
+ _inc(bx);
+ _cmp(ah, 32);
+ if (flags.z())
goto foundcom;
- context._cmp(context.al, context.ah);
- if (context.flags.z())
+ _cmp(al, ah);
+ if (flags.z())
goto comloop2;
- context.si = context.pop();
- context.bx = context.pop();
- context._add(context.bx, 10);
- context._inc(context.cl);
- context._cmp(context.cl, 6);
- if (!context.flags.z())
+ si = pop();
+ bx = pop();
+ _add(bx, 10);
+ _inc(cl);
+ _cmp(cl, 6);
+ if (!flags.z())
goto comloop;
- neterror(context);
- context.al = 0;
+ neterror();
+ al = 0;
return;
foundcom:
- context.si = context.pop();
- context.bx = context.pop();
- context._cmp(context.cl, 1);
- if (context.flags.z())
+ si = pop();
+ bx = pop();
+ _cmp(cl, 1);
+ if (flags.z())
goto testcom;
- context._cmp(context.cl, 2);
- if (context.flags.z())
+ _cmp(cl, 2);
+ if (flags.z())
goto directory;
- context._cmp(context.cl, 3);
- if (context.flags.z())
+ _cmp(cl, 3);
+ if (flags.z())
goto accesscom;
- context._cmp(context.cl, 4);
- if (context.flags.z())
+ _cmp(cl, 4);
+ if (flags.z())
goto signoncom;
- context._cmp(context.cl, 5);
- if (context.flags.z())
+ _cmp(cl, 5);
+ if (flags.z())
goto keyscom;
goto quitcom;
directory:
- dircom(context);
- context.al = 0;
+ dircom();
+ al = 0;
return;
signoncom:
- signon(context);
- context.al = 0;
+ signon();
+ al = 0;
return;
accesscom:
- read(context);
- context.al = 0;
+ read();
+ al = 0;
return;
keyscom:
- showkeys(context);
- context.al = 0;
+ showkeys();
+ al = 0;
return;
testcom:
- context.al = 6;
- monmessage(context);
- context.al = 0;
+ al = 6;
+ monmessage();
+ al = 0;
return;
quitcom:
- context.al = 1;
+ al = 1;
}
-void neterror(Context &context) {
- STACK_CHECK(context);
- context.al = 5;
- monmessage(context);
- scrollmonitor(context);
+void DreamGenContext::neterror() {
+ STACK_CHECK;
+ al = 5;
+ monmessage();
+ scrollmonitor();
}
-void dircom(Context &context) {
- STACK_CHECK(context);
- context.cx = 30;
- randomaccess(context);
- parser(context);
- context._cmp(context.es.byte(context.di+1), 0);
- if (context.flags.z())
+void DreamGenContext::dircom() {
+ STACK_CHECK;
+ cx = 30;
+ randomaccess();
+ parser();
+ _cmp(es.byte(di+1), 0);
+ if (flags.z())
goto dirroot;
- dirfile(context);
+ dirfile();
return;
dirroot:
- context.data.byte(kLogonum) = 0;
- context.ds = context.cs;
- context.si = 2956;
- context._inc(context.si);
- context.es = context.cs;
- context.di = 2970;
- context._inc(context.di);
- context.cx = 12;
- context._movsb(context.cx);
- monitorlogo(context);
- scrollmonitor(context);
- context.al = 9;
- monmessage(context);
- context.es = context.data.word(kTextfile1);
- searchforfiles(context);
- context.es = context.data.word(kTextfile2);
- searchforfiles(context);
- context.es = context.data.word(kTextfile3);
- searchforfiles(context);
- scrollmonitor(context);
-}
-
-void searchforfiles(Context &context) {
- STACK_CHECK(context);
- context.bx = (66*2);
+ data.byte(kLogonum) = 0;
+ ds = cs;
+ si = 2956;
+ _inc(si);
+ es = cs;
+ di = 2970;
+ _inc(di);
+ cx = 12;
+ _movsb(cx, true);
+ monitorlogo();
+ scrollmonitor();
+ al = 9;
+ monmessage();
+ es = data.word(kTextfile1);
+ searchforfiles();
+ es = data.word(kTextfile2);
+ searchforfiles();
+ es = data.word(kTextfile3);
+ searchforfiles();
+ scrollmonitor();
+}
+
+void DreamGenContext::searchforfiles() {
+ STACK_CHECK;
+ bx = (66*2);
directloop1:
- context.al = context.es.byte(context.bx);
- context._inc(context.bx);
- context._cmp(context.al, '*');
- if (context.flags.z())
- goto endofdir;
- context._cmp(context.al, 34);
- if (!context.flags.z())
+ al = es.byte(bx);
+ _inc(bx);
+ _cmp(al, '*');
+ if (flags.z())
+ return /* (endofdir) */;
+ _cmp(al, 34);
+ if (!flags.z())
goto directloop1;
- monprint(context);
+ monprint();
goto directloop1;
-endofdir:
- return;
}
-void signon(Context &context) {
- STACK_CHECK(context);
- parser(context);
- context._inc(context.di);
- context.ds = context.cs;
- context.si = 2836;
- context.cx = 4;
+void DreamGenContext::signon() {
+ STACK_CHECK;
+ parser();
+ _inc(di);
+ ds = cs;
+ si = 2836;
+ cx = 4;
signonloop:
- context.push(context.cx);
- context.push(context.si);
- context.push(context.di);
- context._add(context.si, 14);
- context.cx = 11;
+ push(cx);
+ push(si);
+ push(di);
+ _add(si, 14);
+ cx = 11;
signonloop2:
- context._lodsb();
- context._cmp(context.al, 32);
- if (context.flags.z())
+ _lodsb();
+ _cmp(al, 32);
+ if (flags.z())
goto foundsign;
- makecaps(context);
- context.ah = context.es.byte(context.di);
- context._inc(context.di);
- context._cmp(context.al, context.ah);
- if (!context.flags.z())
+ makecaps();
+ ah = es.byte(di);
+ _inc(di);
+ _cmp(al, ah);
+ if (!flags.z())
goto nomatch;
- if (--context.cx)
+ if (--cx)
goto signonloop2;
nomatch:
- context.di = context.pop();
- context.si = context.pop();
- context.cx = context.pop();
- context._add(context.si, 26);
- if (--context.cx)
+ di = pop();
+ si = pop();
+ cx = pop();
+ _add(si, 26);
+ if (--cx)
goto signonloop;
- context.al = 13;
- monmessage(context);
+ al = 13;
+ monmessage();
return;
foundsign:
- context.di = context.pop();
- context.si = context.pop();
- context.cx = context.pop();
- context.bx = context.si;
- context.es = context.ds;
- context._cmp(context.es.byte(context.bx), 0);
- if (context.flags.z())
+ di = pop();
+ si = pop();
+ cx = pop();
+ bx = si;
+ es = ds;
+ _cmp(es.byte(bx), 0);
+ if (flags.z())
goto notyetassigned;
- context.al = 17;
- monmessage(context);
+ al = 17;
+ monmessage();
return;
notyetassigned:
- context.push(context.es);
- context.push(context.bx);
- scrollmonitor(context);
- context.al = 15;
- monmessage(context);
- context.di = context.data.word(kMonadx);
- context.bx = context.data.word(kMonady);
- context.push(context.di);
- context.push(context.bx);
- input(context);
- context.bx = context.pop();
- context.di = context.pop();
- context.data.word(kMonadx) = context.di;
- context.data.word(kMonady) = context.bx;
- context.bx = context.pop();
- context.es = context.pop();
- context.push(context.es);
- context.push(context.bx);
- context._add(context.bx, 2);
- context.ds = context.cs;
- context.si = 8045;
+ push(es);
+ push(bx);
+ scrollmonitor();
+ al = 15;
+ monmessage();
+ di = data.word(kMonadx);
+ bx = data.word(kMonady);
+ push(di);
+ push(bx);
+ input();
+ bx = pop();
+ di = pop();
+ data.word(kMonadx) = di;
+ data.word(kMonady) = bx;
+ bx = pop();
+ es = pop();
+ push(es);
+ push(bx);
+ _add(bx, 2);
+ ds = cs;
+ si = 8045;
checkpass:
- context._lodsw();
- context.ah = context.es.byte(context.bx);
- context._inc(context.bx);
- context._cmp(context.ah, 32);
- if (context.flags.z())
+ _lodsw();
+ ah = es.byte(bx);
+ _inc(bx);
+ _cmp(ah, 32);
+ if (flags.z())
goto passpassed;
- context._cmp(context.al, context.ah);
- if (context.flags.z())
+ _cmp(al, ah);
+ if (flags.z())
goto checkpass;
- context.bx = context.pop();
- context.es = context.pop();
- scrollmonitor(context);
- context.al = 16;
- monmessage(context);
+ bx = pop();
+ es = pop();
+ scrollmonitor();
+ al = 16;
+ monmessage();
return;
passpassed:
- context.al = 14;
- monmessage(context);
- context.bx = context.pop();
- context.es = context.pop();
- context.push(context.es);
- context.push(context.bx);
- context._add(context.bx, 14);
- monprint(context);
- scrollmonitor(context);
- context.bx = context.pop();
- context.es = context.pop();
- context.es.byte(context.bx) = 1;
-}
-
-void showkeys(Context &context) {
- STACK_CHECK(context);
- context.cx = 10;
- randomaccess(context);
- scrollmonitor(context);
- context.al = 18;
- monmessage(context);
- context.es = context.cs;
- context.bx = 2836;
- context.cx = 4;
+ al = 14;
+ monmessage();
+ bx = pop();
+ es = pop();
+ push(es);
+ push(bx);
+ _add(bx, 14);
+ monprint();
+ scrollmonitor();
+ bx = pop();
+ es = pop();
+ es.byte(bx) = 1;
+}
+
+void DreamGenContext::showkeys() {
+ STACK_CHECK;
+ cx = 10;
+ randomaccess();
+ scrollmonitor();
+ al = 18;
+ monmessage();
+ es = cs;
+ bx = 2836;
+ cx = 4;
keysloop:
- context.push(context.cx);
- context.push(context.bx);
- context._cmp(context.es.byte(context.bx), 0);
- if (context.flags.z())
+ push(cx);
+ push(bx);
+ _cmp(es.byte(bx), 0);
+ if (flags.z())
goto notheld;
- context._add(context.bx, 14);
- monprint(context);
+ _add(bx, 14);
+ monprint();
notheld:
- context.bx = context.pop();
- context.cx = context.pop();
- context._add(context.bx, 26);
- if (--context.cx)
+ bx = pop();
+ cx = pop();
+ _add(bx, 26);
+ if (--cx)
goto keysloop;
- scrollmonitor(context);
+ scrollmonitor();
}
-void read(Context &context) {
- STACK_CHECK(context);
- context.cx = 40;
- randomaccess(context);
- parser(context);
- context._cmp(context.es.byte(context.di+1), 0);
- if (!context.flags.z())
+void DreamGenContext::read() {
+ STACK_CHECK;
+ cx = 40;
+ randomaccess();
+ parser();
+ _cmp(es.byte(di+1), 0);
+ if (!flags.z())
goto okcom;
- neterror(context);
+ neterror();
return;
okcom:
- context.es = context.cs;
- context.di = 2970;
- context.ax = context.data.word(kTextfile1);
- context.data.word(kMonsource) = context.ax;
- context.ds = context.ax;
- context.si = (66*2);
- searchforstring(context);
- context._cmp(context.al, 0);
- if (context.flags.z())
+ es = cs;
+ di = 2970;
+ ax = data.word(kTextfile1);
+ data.word(kMonsource) = ax;
+ ds = ax;
+ si = (66*2);
+ searchforstring();
+ _cmp(al, 0);
+ if (flags.z())
goto foundfile2;
- context.ax = context.data.word(kTextfile2);
- context.data.word(kMonsource) = context.ax;
- context.ds = context.ax;
- context.si = (66*2);
- searchforstring(context);
- context._cmp(context.al, 0);
- if (context.flags.z())
+ ax = data.word(kTextfile2);
+ data.word(kMonsource) = ax;
+ ds = ax;
+ si = (66*2);
+ searchforstring();
+ _cmp(al, 0);
+ if (flags.z())
goto foundfile2;
- context.ax = context.data.word(kTextfile3);
- context.data.word(kMonsource) = context.ax;
- context.ds = context.ax;
- context.si = (66*2);
- searchforstring(context);
- context._cmp(context.al, 0);
- if (context.flags.z())
+ ax = data.word(kTextfile3);
+ data.word(kMonsource) = ax;
+ ds = ax;
+ si = (66*2);
+ searchforstring();
+ _cmp(al, 0);
+ if (flags.z())
goto foundfile2;
- context.al = 7;
- monmessage(context);
+ al = 7;
+ monmessage();
return;
foundfile2:
- getkeyandlogo(context);
- context._cmp(context.al, 0);
- if (context.flags.z())
+ getkeyandlogo();
+ _cmp(al, 0);
+ if (flags.z())
goto keyok1;
return;
keyok1:
- context.es = context.cs;
- context.di = 2942;
- context.ds = context.data.word(kMonsource);
- searchforstring(context);
- context._cmp(context.al, 0);
- if (context.flags.z())
+ es = cs;
+ di = 2942;
+ ds = data.word(kMonsource);
+ searchforstring();
+ _cmp(al, 0);
+ if (flags.z())
goto findtopictext;
- context.al = context.data.byte(kOldlogonum);
- context.data.byte(kLogonum) = context.al;
- context.al = 11;
- monmessage(context);
+ al = data.byte(kOldlogonum);
+ data.byte(kLogonum) = al;
+ al = 11;
+ monmessage();
return;
findtopictext:
- context._inc(context.bx);
- context.push(context.es);
- context.push(context.bx);
- monitorlogo(context);
- scrollmonitor(context);
- context.bx = context.pop();
- context.es = context.pop();
+ _inc(bx);
+ push(es);
+ push(bx);
+ monitorlogo();
+ scrollmonitor();
+ bx = pop();
+ es = pop();
moretopic:
- monprint(context);
- context.al = context.es.byte(context.bx);
- context._cmp(context.al, 34);
- if (context.flags.z())
+ monprint();
+ al = es.byte(bx);
+ _cmp(al, 34);
+ if (flags.z())
goto endoftopic;
- context._cmp(context.al, '=');
- if (context.flags.z())
+ _cmp(al, '=');
+ if (flags.z())
goto endoftopic;
- context._cmp(context.al, '*');
- if (context.flags.z())
+ _cmp(al, '*');
+ if (flags.z())
goto endoftopic;
- context.push(context.es);
- context.push(context.bx);
- processtrigger(context);
- context.cx = 24;
- randomaccess(context);
- context.bx = context.pop();
- context.es = context.pop();
+ push(es);
+ push(bx);
+ processtrigger();
+ cx = 24;
+ randomaccess();
+ bx = pop();
+ es = pop();
goto moretopic;
endoftopic:
- scrollmonitor(context);
-}
-
-void dirfile(Context &context) {
- STACK_CHECK(context);
- context.al = 34;
- context.es.byte(context.di) = context.al;
- context.push(context.es);
- context.push(context.di);
- context.ds = context.data.word(kTextfile1);
- context.si = (66*2);
- searchforstring(context);
- context._cmp(context.al, 0);
- if (context.flags.z())
+ scrollmonitor();
+}
+
+void DreamGenContext::dirfile() {
+ STACK_CHECK;
+ al = 34;
+ es.byte(di) = al;
+ push(es);
+ push(di);
+ ds = data.word(kTextfile1);
+ si = (66*2);
+ searchforstring();
+ _cmp(al, 0);
+ if (flags.z())
goto foundfile;
- context.di = context.pop();
- context.es = context.pop();
- context.push(context.es);
- context.push(context.di);
- context.ds = context.data.word(kTextfile2);
- context.si = (66*2);
- searchforstring(context);
- context._cmp(context.al, 0);
- if (context.flags.z())
+ di = pop();
+ es = pop();
+ push(es);
+ push(di);
+ ds = data.word(kTextfile2);
+ si = (66*2);
+ searchforstring();
+ _cmp(al, 0);
+ if (flags.z())
goto foundfile;
- context.di = context.pop();
- context.es = context.pop();
- context.push(context.es);
- context.push(context.di);
- context.ds = context.data.word(kTextfile3);
- context.si = (66*2);
- searchforstring(context);
- context._cmp(context.al, 0);
- if (context.flags.z())
+ di = pop();
+ es = pop();
+ push(es);
+ push(di);
+ ds = data.word(kTextfile3);
+ si = (66*2);
+ searchforstring();
+ _cmp(al, 0);
+ if (flags.z())
goto foundfile;
- context.di = context.pop();
- context.es = context.pop();
- context.al = 7;
- monmessage(context);
+ di = pop();
+ es = pop();
+ al = 7;
+ monmessage();
return;
foundfile:
- context.ax = context.pop();
- context.ax = context.pop();
- getkeyandlogo(context);
- context._cmp(context.al, 0);
- if (context.flags.z())
+ ax = pop();
+ ax = pop();
+ getkeyandlogo();
+ _cmp(al, 0);
+ if (flags.z())
goto keyok2;
return;
keyok2:
- context.push(context.es);
- context.push(context.bx);
- context.ds = context.cs;
- context.si = 2942+1;
- context.es = context.cs;
- context.di = 2970+1;
- context.cx = 12;
- context._movsb(context.cx);
- monitorlogo(context);
- scrollmonitor(context);
- context.al = 10;
- monmessage(context);
- context.bx = context.pop();
- context.es = context.pop();
+ push(es);
+ push(bx);
+ ds = cs;
+ si = 2942+1;
+ es = cs;
+ di = 2970+1;
+ cx = 12;
+ _movsb(cx, true);
+ monitorlogo();
+ scrollmonitor();
+ al = 10;
+ monmessage();
+ bx = pop();
+ es = pop();
directloop2:
- context.al = context.es.byte(context.bx);
- context._inc(context.bx);
- context._cmp(context.al, 34);
- if (context.flags.z())
+ al = es.byte(bx);
+ _inc(bx);
+ _cmp(al, 34);
+ if (flags.z())
goto endofdir2;
- context._cmp(context.al, '*');
- if (context.flags.z())
+ _cmp(al, '*');
+ if (flags.z())
goto endofdir2;
- context._cmp(context.al, '=');
- if (!context.flags.z())
+ _cmp(al, '=');
+ if (!flags.z())
goto directloop2;
- monprint(context);
+ monprint();
goto directloop2;
endofdir2:
- scrollmonitor(context);
-}
-
-void getkeyandlogo(Context &context) {
- STACK_CHECK(context);
- context._inc(context.bx);
- context.al = context.es.byte(context.bx);
- context._sub(context.al, 48);
- context.data.byte(kNewlogonum) = context.al;
- context._add(context.bx, 2);
- context.al = context.es.byte(context.bx);
- context._sub(context.al, 48);
- context.data.byte(kKeynum) = context.al;
- context._inc(context.bx);
- context.push(context.es);
- context.push(context.bx);
- context.al = context.data.byte(kKeynum);
- context.ah = 0;
- context.cx = 26;
- context._mul(context.cx);
- context.es = context.cs;
- context.bx = 2836;
- context._add(context.bx, context.ax);
- context.al = context.es.byte(context.bx);
- context._cmp(context.al, 1);
- if (context.flags.z())
+ scrollmonitor();
+}
+
+void DreamGenContext::getkeyandlogo() {
+ STACK_CHECK;
+ _inc(bx);
+ al = es.byte(bx);
+ _sub(al, 48);
+ data.byte(kNewlogonum) = al;
+ _add(bx, 2);
+ al = es.byte(bx);
+ _sub(al, 48);
+ data.byte(kKeynum) = al;
+ _inc(bx);
+ push(es);
+ push(bx);
+ al = data.byte(kKeynum);
+ ah = 0;
+ cx = 26;
+ _mul(cx);
+ es = cs;
+ bx = 2836;
+ _add(bx, ax);
+ al = es.byte(bx);
+ _cmp(al, 1);
+ if (flags.z())
goto keyok;
- context.push(context.bx);
- context.push(context.es);
- context.al = 12;
- monmessage(context);
- context.es = context.pop();
- context.bx = context.pop();
- context._add(context.bx, 14);
- monprint(context);
- scrollmonitor(context);
- context.bx = context.pop();
- context.es = context.pop();
- context.al = 1;
+ push(bx);
+ push(es);
+ al = 12;
+ monmessage();
+ es = pop();
+ bx = pop();
+ _add(bx, 14);
+ monprint();
+ scrollmonitor();
+ bx = pop();
+ es = pop();
+ al = 1;
return;
keyok:
- context.bx = context.pop();
- context.es = context.pop();
- context.al = context.data.byte(kNewlogonum);
- context.data.byte(kLogonum) = context.al;
- context.al = 0;
+ bx = pop();
+ es = pop();
+ al = data.byte(kNewlogonum);
+ data.byte(kLogonum) = al;
+ al = 0;
}
-void searchforstring(Context &context) {
- STACK_CHECK(context);
- context.dl = context.es.byte(context.di);
- context.cx = context.di;
+void DreamGenContext::searchforstring() {
+ STACK_CHECK;
+ dl = es.byte(di);
+ cx = di;
restartlook:
- context.di = context.cx;
- context.bx = context.si;
- context.dh = 0;
+ di = cx;
+ bx = si;
+ dh = 0;
keeplooking:
- context._lodsb();
- makecaps(context);
- context._cmp(context.al, '*');
- if (context.flags.z())
+ _lodsb();
+ makecaps();
+ _cmp(al, '*');
+ if (flags.z())
goto notfound;
- context._cmp(context.dl, '=');
- if (!context.flags.z())
+ _cmp(dl, '=');
+ if (!flags.z())
goto nofindingtopic;
- context._cmp(context.al, 34);
- if (context.flags.z())
+ _cmp(al, 34);
+ if (flags.z())
goto notfound;
nofindingtopic:
- context.ah = context.es.byte(context.di);
- context._cmp(context.al, context.dl);
- if (!context.flags.z())
+ ah = es.byte(di);
+ _cmp(al, dl);
+ if (!flags.z())
goto notbracket;
- context._inc(context.dh);
- context._cmp(context.dh, 2);
- if (context.flags.z())
+ _inc(dh);
+ _cmp(dh, 2);
+ if (flags.z())
goto complete;
notbracket:
- context._cmp(context.al, context.ah);
- if (!context.flags.z())
+ _cmp(al, ah);
+ if (!flags.z())
goto restartlook;
- context._inc(context.di);
+ _inc(di);
goto keeplooking;
complete:
- context.es = context.ds;
- context.al = 0;
- context.bx = context.si;
+ es = ds;
+ al = 0;
+ bx = si;
return;
notfound:
- context.al = 1;
-}
-
-void parser(Context &context) {
- STACK_CHECK(context);
- context.es = context.cs;
- context.di = 2942;
- context.cx = 13;
- context.al = 0;
- context._stosb(context.cx);
- context.di = 2942;
- context.al = '=';
- context._stosb();
- context.ds = context.cs;
- context.si = 8045;
+ al = 1;
+}
+
+void DreamGenContext::parser() {
+ STACK_CHECK;
+ es = cs;
+ di = 2942;
+ cx = 13;
+ al = 0;
+ _stosb(cx, true);
+ di = 2942;
+ al = '=';
+ _stosb();
+ ds = cs;
+ si = 8045;
notspace1:
- context._lodsw();
- context._cmp(context.al, 32);
- if (context.flags.z())
+ _lodsw();
+ _cmp(al, 32);
+ if (flags.z())
goto stillspace1;
- context._cmp(context.al, 0);
- if (!context.flags.z())
+ _cmp(al, 0);
+ if (!flags.z())
goto notspace1;
goto finishpars;
stillspace1:
- context._lodsw();
- context._cmp(context.al, 32);
- if (context.flags.z())
+ _lodsw();
+ _cmp(al, 32);
+ if (flags.z())
goto stillspace1;
copyin1:
- context._stosb();
- context._lodsw();
- context._cmp(context.al, 0);
- if (context.flags.z())
+ _stosb();
+ _lodsw();
+ _cmp(al, 0);
+ if (flags.z())
goto finishpars;
- context._cmp(context.al, 32);
- if (!context.flags.z())
+ _cmp(al, 32);
+ if (!flags.z())
goto copyin1;
finishpars:
- context.di = 2942;
-}
-
-void scrollmonitor(Context &context) {
- STACK_CHECK(context);
- context.push(context.ax);
- context.push(context.bx);
- context.push(context.cx);
- context.push(context.dx);
- context.push(context.di);
- context.push(context.si);
- context.push(context.es);
- context.push(context.ds);
- printlogo(context);
- context.di = context.data.word(kMonadx);
- context.bx = context.data.word(kMonady);
- printundermon(context);
- context.ax = context.data.word(kMonady);
- worktoscreen(context);
- context.al = 25;
- playchannel1(context);
- context.ds = context.pop();
- context.es = context.pop();
- context.si = context.pop();
- context.di = context.pop();
- context.dx = context.pop();
- context.cx = context.pop();
- context.bx = context.pop();
- context.ax = context.pop();
-}
-
-void lockmon(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kLasthardkey), 57);
- if (!context.flags.z())
- goto notlock;
- locklighton(context);
+ di = 2942;
+}
+
+void DreamGenContext::scrollmonitor() {
+ STACK_CHECK;
+ push(ax);
+ push(bx);
+ push(cx);
+ push(dx);
+ push(di);
+ push(si);
+ push(es);
+ push(ds);
+ printlogo();
+ di = data.word(kMonadx);
+ bx = data.word(kMonady);
+ printundermon();
+ ax = data.word(kMonady);
+ worktoscreen();
+ al = 25;
+ playchannel1();
+ ds = pop();
+ es = pop();
+ si = pop();
+ di = pop();
+ dx = pop();
+ cx = pop();
+ bx = pop();
+ ax = pop();
+}
+
+void DreamGenContext::lockmon() {
+ STACK_CHECK;
+ _cmp(data.byte(kLasthardkey), 57);
+ if (!flags.z())
+ return /* (notlock) */;
+ locklighton();
lockloop:
- context._cmp(context.data.byte(kLasthardkey), 57);
- if (context.flags.z())
+ _cmp(data.byte(kLasthardkey), 57);
+ if (flags.z())
goto lockloop;
- locklightoff(context);
-notlock:
- return;
+ locklightoff();
}
-void monitorlogo(Context &context) {
- STACK_CHECK(context);
- context.al = context.data.byte(kLogonum);
- context._cmp(context.al, context.data.byte(kOldlogonum));
- if (context.flags.z())
+void DreamGenContext::monitorlogo() {
+ STACK_CHECK;
+ al = data.byte(kLogonum);
+ _cmp(al, data.byte(kOldlogonum));
+ if (flags.z())
goto notnewlogo;
- context.data.byte(kOldlogonum) = context.al;
- printlogo(context);
- printundermon(context);
- worktoscreen(context);
- printlogo(context);
- printlogo(context);
- context.al = 26;
- playchannel1(context);
- context.cx = 20;
- randomaccess(context);
+ data.byte(kOldlogonum) = al;
+ printlogo();
+ printundermon();
+ worktoscreen();
+ printlogo();
+ printlogo();
+ al = 26;
+ playchannel1();
+ cx = 20;
+ randomaccess();
return;
notnewlogo:
- printlogo(context);
+ printlogo();
}
-void printlogo(Context &context) {
- STACK_CHECK(context);
- context.di = 56;
- context.bx = 32;
- context.ds = context.data.word(kTempgraphics);
- context.al = 0;
- context.ah = 0;
- showframe(context);
- showcurrentfile(context);
+void DreamGenContext::printlogo() {
+ STACK_CHECK;
+ di = 56;
+ bx = 32;
+ ds = data.word(kTempgraphics);
+ al = 0;
+ ah = 0;
+ showframe();
+ showcurrentfile();
}
-void showcurrentfile(Context &context) {
- STACK_CHECK(context);
- context.di = 178;
- context.bx = 37;
- context.si = 2970+1;
+void DreamGenContext::showcurrentfile() {
+ STACK_CHECK;
+ di = 178;
+ bx = 37;
+ si = 2970+1;
curfileloop:
- context.al = context.cs.byte(context.si);
- context._cmp(context.al, 0);
- if (context.flags.z())
- goto finishfile;
- context._inc(context.si);
- context.push(context.si);
- context.ds = context.data.word(kTempcharset);
- context.ah = 0;
- printchar(context);
- context.si = context.pop();
+ al = cs.byte(si);
+ _cmp(al, 0);
+ if (flags.z())
+ return /* (finishfile) */;
+ _inc(si);
+ push(si);
+ ds = data.word(kTempcharset);
+ ah = 0;
+ printchar();
+ si = pop();
goto curfileloop;
-finishfile:
- return;
}
-void monmessage(Context &context) {
- STACK_CHECK(context);
- context.es = context.data.word(kTextfile1);
- context.bx = (66*2);
- context.cl = context.al;
- context.ch = 0;
+void DreamGenContext::monmessage() {
+ STACK_CHECK;
+ es = data.word(kTextfile1);
+ bx = (66*2);
+ cl = al;
+ ch = 0;
monmessageloop:
- context.al = context.es.byte(context.bx);
- context._inc(context.bx);
- context._cmp(context.al, '+');
- if (!context.flags.z())
+ al = es.byte(bx);
+ _inc(bx);
+ _cmp(al, '+');
+ if (!flags.z())
goto monmessageloop;
- if (--context.cx)
+ if (--cx)
goto monmessageloop;
- monprint(context);
+ monprint();
}
-void processtrigger(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kLasttrigger), '1');
- if (!context.flags.z())
+void DreamGenContext::processtrigger() {
+ STACK_CHECK;
+ _cmp(data.byte(kLasttrigger), '1');
+ if (!flags.z())
goto notfirsttrigger;
- context.al = 8;
- setlocation(context);
- context.al = 45;
- triggermessage(context);
+ al = 8;
+ setlocation();
+ al = 45;
+ triggermessage();
return;
notfirsttrigger:
- context._cmp(context.data.byte(kLasttrigger), '2');
- if (!context.flags.z())
+ _cmp(data.byte(kLasttrigger), '2');
+ if (!flags.z())
goto notsecondtrigger;
- context.al = 9;
- setlocation(context);
- context.al = 55;
- triggermessage(context);
+ al = 9;
+ setlocation();
+ al = 55;
+ triggermessage();
return;
notsecondtrigger:
- context._cmp(context.data.byte(kLasttrigger), '3');
- if (!context.flags.z())
- goto notthirdtrigger;
- context.al = 2;
- setlocation(context);
- context.al = 59;
- triggermessage(context);
-notthirdtrigger:
- return;
-}
-
-void triggermessage(Context &context) {
- STACK_CHECK(context);
- context.push(context.ax);
- context.di = 174;
- context.bx = 153;
- context.cl = 200;
- context.ch = 63;
- context.ds = context.data.word(kMapstore);
- context.si = 0;
- multiget(context);
- context.ax = context.pop();
- findpuztext(context);
- context.di = 174;
- context.bx = 156;
- context.dl = 141;
- context.ah = 16;
- printdirect(context);
- context.cx = 140;
- hangon(context);
- worktoscreen(context);
- context.cx = 340;
- hangon(context);
- context.di = 174;
- context.bx = 153;
- context.cl = 200;
- context.ch = 63;
- context.ds = context.data.word(kMapstore);
- context.si = 0;
- multiput(context);
- worktoscreen(context);
- context.data.byte(kLasttrigger) = 0;
-}
-
-void printcurs(Context &context) {
- STACK_CHECK(context);
- context.push(context.si);
- context.push(context.di);
- context.push(context.ds);
- context.push(context.dx);
- context.push(context.bx);
- context.push(context.es);
- context.di = context.data.word(kCurslocx);
- context.bx = context.data.word(kCurslocy);
- context.cl = 6;
- context.ch = 8;
- context.ds = context.data.word(kBuffers);
- context.si = (0);
- context.push(context.di);
- context.push(context.bx);
- multiget(context);
- context.bx = context.pop();
- context.di = context.pop();
- context.push(context.bx);
- context.push(context.di);
- context._inc(context.data.word(kMaintimer));
- context.ax = context.data.word(kMaintimer);
- context._and(context.al, 16);
- if (!context.flags.z())
+ _cmp(data.byte(kLasttrigger), '3');
+ if (!flags.z())
+ return /* (notthirdtrigger) */;
+ al = 2;
+ setlocation();
+ al = 59;
+ triggermessage();
+}
+
+void DreamGenContext::triggermessage() {
+ STACK_CHECK;
+ push(ax);
+ di = 174;
+ bx = 153;
+ cl = 200;
+ ch = 63;
+ ds = data.word(kMapstore);
+ si = 0;
+ multiget();
+ ax = pop();
+ findpuztext();
+ di = 174;
+ bx = 156;
+ dl = 141;
+ ah = 16;
+ printdirect();
+ cx = 140;
+ hangon();
+ worktoscreen();
+ cx = 340;
+ hangon();
+ di = 174;
+ bx = 153;
+ cl = 200;
+ ch = 63;
+ ds = data.word(kMapstore);
+ si = 0;
+ multiput();
+ worktoscreen();
+ data.byte(kLasttrigger) = 0;
+}
+
+void DreamGenContext::printcurs() {
+ STACK_CHECK;
+ push(si);
+ push(di);
+ push(ds);
+ push(dx);
+ push(bx);
+ push(es);
+ di = data.word(kCurslocx);
+ bx = data.word(kCurslocy);
+ cl = 6;
+ ch = 8;
+ ds = data.word(kBuffers);
+ si = (0);
+ push(di);
+ push(bx);
+ multiget();
+ bx = pop();
+ di = pop();
+ push(bx);
+ push(di);
+ _inc(data.word(kMaintimer));
+ ax = data.word(kMaintimer);
+ _and(al, 16);
+ if (!flags.z())
goto flashcurs;
- context.al = '/';
- context._sub(context.al, 32);
- context.ah = 0;
- context.ds = context.data.word(kTempcharset);
- showframe(context);
+ al = '/';
+ _sub(al, 32);
+ ah = 0;
+ ds = data.word(kTempcharset);
+ showframe();
flashcurs:
- context.di = context.pop();
- context.bx = context.pop();
- context._sub(context.di, 6);
- context.cl = 12;
- context.ch = 8;
- multidump(context);
- context.es = context.pop();
- context.bx = context.pop();
- context.dx = context.pop();
- context.ds = context.pop();
- context.di = context.pop();
- context.si = context.pop();
-}
-
-void delcurs(Context &context) {
- STACK_CHECK(context);
- context.push(context.es);
- context.push(context.bx);
- context.push(context.di);
- context.push(context.ds);
- context.push(context.dx);
- context.push(context.si);
- context.di = context.data.word(kCurslocx);
- context.bx = context.data.word(kCurslocy);
- context.cl = 6;
- context.ch = 8;
- context.push(context.di);
- context.push(context.bx);
- context.push(context.cx);
- context.ds = context.data.word(kBuffers);
- context.si = (0);
- multiput(context);
- context.cx = context.pop();
- context.bx = context.pop();
- context.di = context.pop();
- multidump(context);
- context.si = context.pop();
- context.dx = context.pop();
- context.ds = context.pop();
- context.di = context.pop();
- context.bx = context.pop();
- context.es = context.pop();
-}
-
-void useobject(Context &context) {
- STACK_CHECK(context);
- context.data.byte(kWithobject) = 255;
- context._cmp(context.data.byte(kCommandtype), 229);
- if (context.flags.z())
+ di = pop();
+ bx = pop();
+ _sub(di, 6);
+ cl = 12;
+ ch = 8;
+ multidump();
+ es = pop();
+ bx = pop();
+ dx = pop();
+ ds = pop();
+ di = pop();
+ si = pop();
+}
+
+void DreamGenContext::delcurs() {
+ STACK_CHECK;
+ push(es);
+ push(bx);
+ push(di);
+ push(ds);
+ push(dx);
+ push(si);
+ di = data.word(kCurslocx);
+ bx = data.word(kCurslocy);
+ cl = 6;
+ ch = 8;
+ push(di);
+ push(bx);
+ push(cx);
+ ds = data.word(kBuffers);
+ si = (0);
+ multiput();
+ cx = pop();
+ bx = pop();
+ di = pop();
+ multidump();
+ si = pop();
+ dx = pop();
+ ds = pop();
+ di = pop();
+ bx = pop();
+ es = pop();
+}
+
+void DreamGenContext::useobject() {
+ STACK_CHECK;
+ data.byte(kWithobject) = 255;
+ _cmp(data.byte(kCommandtype), 229);
+ if (flags.z())
goto alreadyuse;
- context.data.byte(kCommandtype) = 229;
- context.bl = context.data.byte(kCommand);
- context.bh = context.data.byte(kObjecttype);
- context.al = 51;
- commandwithob(context);
+ data.byte(kCommandtype) = 229;
+ bl = data.byte(kCommand);
+ bh = data.byte(kObjecttype);
+ al = 51;
+ commandwithob();
alreadyuse:
- context.ax = context.data.word(kMousebutton);
- context._cmp(context.ax, context.data.word(kOldbutton));
- if (context.flags.z())
- goto nouse;
- context._and(context.ax, 1);
- if (!context.flags.z())
+ ax = data.word(kMousebutton);
+ _cmp(ax, data.word(kOldbutton));
+ if (flags.z())
+ return /* (nouse) */;
+ _and(ax, 1);
+ if (!flags.z())
goto douse;
-nouse:
return;
douse:
- useroutine(context);
+ useroutine();
}
-void useroutine(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kReallocation), 50);
- if (context.flags.c())
+void DreamGenContext::useroutine() {
+ STACK_CHECK;
+ _cmp(data.byte(kReallocation), 50);
+ if (flags.c())
goto nodream7;
- context._cmp(context.data.byte(kPointerpower), 0);
- if (!context.flags.z())
+ _cmp(data.byte(kPointerpower), 0);
+ if (!flags.z())
goto powerok;
return;
powerok:
- context.data.byte(kPointerpower) = 0;
+ data.byte(kPointerpower) = 0;
nodream7:
- getanyad(context);
- context.dx = context.data;
- context.ds = context.dx;
- context.si = 2984;
+ getanyad();
+ dx = data;
+ ds = dx;
+ si = 2984;
checkuselist:
- context.push(context.si);
- context._lodsb();
- context._sub(context.al, 'A');
- context._cmp(context.al, context.es.byte(context.bx+12));
- if (!context.flags.z())
+ push(si);
+ _lodsb();
+ _sub(al, 'A');
+ _cmp(al, es.byte(bx+12));
+ if (!flags.z())
goto failed;
- context._lodsb();
- context._sub(context.al, 'A');
- context._cmp(context.al, context.es.byte(context.bx+13));
- if (!context.flags.z())
+ _lodsb();
+ _sub(al, 'A');
+ _cmp(al, es.byte(bx+13));
+ if (!flags.z())
goto failed;
- context._lodsb();
- context._sub(context.al, 'A');
- context._cmp(context.al, context.es.byte(context.bx+14));
- if (!context.flags.z())
+ _lodsb();
+ _sub(al, 'A');
+ _cmp(al, es.byte(bx+14));
+ if (!flags.z())
goto failed;
- context._lodsb();
- context._sub(context.al, 'A');
- context._cmp(context.al, context.es.byte(context.bx+15));
- if (!context.flags.z())
+ _lodsb();
+ _sub(al, 'A');
+ _cmp(al, es.byte(bx+15));
+ if (!flags.z())
goto failed;
- context._lodsw();
- context.si = context.pop();
- __dispatch_call(context, context.ax);
+ _lodsw();
+ si = pop();
+ __dispatch_call(ax);
return;
failed:
- context.si = context.pop();
- context._add(context.si, 6);
- context._cmp(context.ds.byte(context.si), 140);
- if (!context.flags.z())
+ si = pop();
+ _add(si, 6);
+ _cmp(ds.byte(si), 140);
+ if (!flags.z())
goto checkuselist;
- delpointer(context);
- getobtextstart(context);
- findnextcolon(context);
- context._cmp(context.al, 0);
- if (context.flags.z())
+ delpointer();
+ getobtextstart();
+ findnextcolon();
+ _cmp(al, 0);
+ if (flags.z())
goto cantuse2;
- findnextcolon(context);
- context._cmp(context.al, 0);
- if (context.flags.z())
+ findnextcolon();
+ _cmp(al, 0);
+ if (flags.z())
goto cantuse2;
- context.al = context.es.byte(context.si);
- context._cmp(context.al, 0);
- if (context.flags.z())
+ al = es.byte(si);
+ _cmp(al, 0);
+ if (flags.z())
goto cantuse2;
- usetext(context);
- context.cx = 400;
- hangonp(context);
- putbackobstuff(context);
+ usetext();
+ cx = 400;
+ hangonp();
+ putbackobstuff();
return;
cantuse2:
- createpanel(context);
- showpanel(context);
- showman(context);
- showexit(context);
- obicons(context);
- context.di = 33;
- context.bx = 100;
- context.al = 63;
- context.dl = 241;
- printmessage(context);
- worktoscreenm(context);
- context.cx = 50;
- hangonp(context);
- putbackobstuff(context);
- context.data.byte(kCommandtype) = 255;
-}
-
-void wheelsound(Context &context) {
- STACK_CHECK(context);
- context.al = 17;
- playchannel1(context);
- showfirstuse(context);
- putbackobstuff(context);
-}
-
-void runtap(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kWithobject), 255);
- if (!context.flags.z())
+ createpanel();
+ showpanel();
+ showman();
+ showexit();
+ obicons();
+ di = 33;
+ bx = 100;
+ al = 63;
+ dl = 241;
+ printmessage();
+ worktoscreenm();
+ cx = 50;
+ hangonp();
+ putbackobstuff();
+ data.byte(kCommandtype) = 255;
+}
+
+void DreamGenContext::wheelsound() {
+ STACK_CHECK;
+ al = 17;
+ playchannel1();
+ showfirstuse();
+ putbackobstuff();
+}
+
+void DreamGenContext::runtap() {
+ STACK_CHECK;
+ _cmp(data.byte(kWithobject), 255);
+ if (!flags.z())
goto tapwith;
- withwhat(context);
+ withwhat();
return;
tapwith:
- context.al = context.data.byte(kWithobject);
- context.ah = context.data.byte(kWithtype);
- context.cl = 'C';
- context.ch = 'U';
- context.dl = 'P';
- context.dh = 'E';
- compare(context);
- if (context.flags.z())
+ al = data.byte(kWithobject);
+ ah = data.byte(kWithtype);
+ cl = 'C';
+ ch = 'U';
+ dl = 'P';
+ dh = 'E';
+ compare();
+ if (flags.z())
goto fillcupfromtap;
- context.al = context.data.byte(kWithobject);
- context.ah = context.data.byte(kWithtype);
- context.cl = 'C';
- context.ch = 'U';
- context.dl = 'P';
- context.dh = 'F';
- compare(context);
- if (context.flags.z())
+ al = data.byte(kWithobject);
+ ah = data.byte(kWithtype);
+ cl = 'C';
+ ch = 'U';
+ dl = 'P';
+ dh = 'F';
+ compare();
+ if (flags.z())
goto cupfromtapfull;
- context.cx = 300;
- context.al = 56;
- showpuztext(context);
- putbackobstuff(context);
+ cx = 300;
+ al = 56;
+ showpuztext();
+ putbackobstuff();
return;
fillcupfromtap:
- context.al = context.data.byte(kWithobject);
- getexad(context);
- context.es.byte(context.bx+15) = 'F'-'A';
- context.al = 8;
- playchannel1(context);
- context.cx = 300;
- context.al = 57;
- showpuztext(context);
- putbackobstuff(context);
+ al = data.byte(kWithobject);
+ getexad();
+ es.byte(bx+15) = 'F'-'A';
+ al = 8;
+ playchannel1();
+ cx = 300;
+ al = 57;
+ showpuztext();
+ putbackobstuff();
return;
cupfromtapfull:
- context.cx = 300;
- context.al = 58;
- showpuztext(context);
- putbackobstuff(context);
+ cx = 300;
+ al = 58;
+ showpuztext();
+ putbackobstuff();
}
-void playguitar(Context &context) {
- STACK_CHECK(context);
- context.al = 14;
- playchannel1(context);
- showfirstuse(context);
- putbackobstuff(context);
+void DreamGenContext::playguitar() {
+ STACK_CHECK;
+ al = 14;
+ playchannel1();
+ showfirstuse();
+ putbackobstuff();
}
-void hotelcontrol(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kReallocation), 21);
- if (!context.flags.z())
+void DreamGenContext::hotelcontrol() {
+ STACK_CHECK;
+ _cmp(data.byte(kReallocation), 21);
+ if (!flags.z())
goto notrightcont;
- context._cmp(context.data.byte(kMapx), 33);
- if (!context.flags.z())
+ _cmp(data.byte(kMapx), 33);
+ if (!flags.z())
goto notrightcont;
- showfirstuse(context);
- putbackobstuff(context);
+ showfirstuse();
+ putbackobstuff();
return;
notrightcont:
- showseconduse(context);
- putbackobstuff(context);
-}
-
-void hotelbell(Context &context) {
- STACK_CHECK(context);
- context.al = 12;
- playchannel1(context);
- showfirstuse(context);
- putbackobstuff(context);
-}
-
-void opentomb(Context &context) {
- STACK_CHECK(context);
- context._inc(context.data.byte(kProgresspoints));
- showfirstuse(context);
- context.data.word(kWatchingtime) = 35*2;
- context.data.word(kReeltowatch) = 1;
- context.data.word(kEndwatchreel) = 33;
- context.data.byte(kWatchspeed) = 1;
- context.data.byte(kSpeedcount) = 1;
- context.data.byte(kGetback) = 1;
-}
-
-void usetrainer(Context &context) {
- STACK_CHECK(context);
- getanyad(context);
- context._cmp(context.es.byte(context.bx+2), 4);
- if (!context.flags.z())
+ showseconduse();
+ putbackobstuff();
+}
+
+void DreamGenContext::hotelbell() {
+ STACK_CHECK;
+ al = 12;
+ playchannel1();
+ showfirstuse();
+ putbackobstuff();
+}
+
+void DreamGenContext::opentomb() {
+ STACK_CHECK;
+ _inc(data.byte(kProgresspoints));
+ showfirstuse();
+ data.word(kWatchingtime) = 35*2;
+ data.word(kReeltowatch) = 1;
+ data.word(kEndwatchreel) = 33;
+ data.byte(kWatchspeed) = 1;
+ data.byte(kSpeedcount) = 1;
+ data.byte(kGetback) = 1;
+}
+
+void DreamGenContext::usetrainer() {
+ STACK_CHECK;
+ getanyad();
+ _cmp(es.byte(bx+2), 4);
+ if (!flags.z())
goto notheldtrainer;
- context._inc(context.data.byte(kProgresspoints));
- makeworn(context);
- showseconduse(context);
- putbackobstuff(context);
+ _inc(data.byte(kProgresspoints));
+ makeworn();
+ showseconduse();
+ putbackobstuff();
return;
notheldtrainer:
- nothelderror(context);
-}
-
-void nothelderror(Context &context) {
- STACK_CHECK(context);
- createpanel(context);
- showpanel(context);
- showman(context);
- showexit(context);
- obicons(context);
- context.di = 64;
- context.bx = 100;
- context.al = 63;
- context.ah = 1;
- context.dl = 201;
- printmessage2(context);
- worktoscreenm(context);
- context.cx = 50;
- hangonp(context);
- putbackobstuff(context);
-}
-
-void usepipe(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kWithobject), 255);
- if (!context.flags.z())
+ nothelderror();
+}
+
+void DreamGenContext::nothelderror() {
+ STACK_CHECK;
+ createpanel();
+ showpanel();
+ showman();
+ showexit();
+ obicons();
+ di = 64;
+ bx = 100;
+ al = 63;
+ ah = 1;
+ dl = 201;
+ printmessage2();
+ worktoscreenm();
+ cx = 50;
+ hangonp();
+ putbackobstuff();
+}
+
+void DreamGenContext::usepipe() {
+ STACK_CHECK;
+ _cmp(data.byte(kWithobject), 255);
+ if (!flags.z())
goto pipewith;
- withwhat(context);
+ withwhat();
return;
pipewith:
- context.al = context.data.byte(kWithobject);
- context.ah = context.data.byte(kWithtype);
- context.cl = 'C';
- context.ch = 'U';
- context.dl = 'P';
- context.dh = 'E';
- compare(context);
- if (context.flags.z())
+ al = data.byte(kWithobject);
+ ah = data.byte(kWithtype);
+ cl = 'C';
+ ch = 'U';
+ dl = 'P';
+ dh = 'E';
+ compare();
+ if (flags.z())
goto fillcup;
- context.al = context.data.byte(kWithobject);
- context.ah = context.data.byte(kWithtype);
- context.cl = 'C';
- context.ch = 'U';
- context.dl = 'P';
- context.dh = 'F';
- compare(context);
- if (context.flags.z())
+ al = data.byte(kWithobject);
+ ah = data.byte(kWithtype);
+ cl = 'C';
+ ch = 'U';
+ dl = 'P';
+ dh = 'F';
+ compare();
+ if (flags.z())
goto alreadyfull;
- context.cx = 300;
- context.al = 14;
- showpuztext(context);
- putbackobstuff(context);
+ cx = 300;
+ al = 14;
+ showpuztext();
+ putbackobstuff();
return;
fillcup:
- context.cx = 300;
- context.al = 36;
- showpuztext(context);
- putbackobstuff(context);
- context.al = context.data.byte(kWithobject);
- getexad(context);
- context.es.byte(context.bx+15) = 'F'-'A';
+ cx = 300;
+ al = 36;
+ showpuztext();
+ putbackobstuff();
+ al = data.byte(kWithobject);
+ getexad();
+ es.byte(bx+15) = 'F'-'A';
return;
alreadyfull:
- context.cx = 300;
- context.al = 35;
- showpuztext(context);
- putbackobstuff(context);
-}
-
-void usefullcart(Context &context) {
- STACK_CHECK(context);
- context._inc(context.data.byte(kProgresspoints));
- context.al = 2;
- context.ah = context.data.byte(kRoomnum);
- context._add(context.ah, 6);
- turnanypathon(context);
- context.data.byte(kManspath) = 4;
- context.data.byte(kFacing) = 4;
- context.data.byte(kTurntoface) = 4;
- context.data.byte(kFinaldest) = 4;
- findxyfrompath(context);
- context.data.byte(kResetmanxy) = 1;
- showfirstuse(context);
- context.data.word(kWatchingtime) = 72*2;
- context.data.word(kReeltowatch) = 58;
- context.data.word(kEndwatchreel) = 142;
- context.data.byte(kWatchspeed) = 1;
- context.data.byte(kSpeedcount) = 1;
- context.data.byte(kGetback) = 1;
-}
-
-void useplinth(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kWithobject), 255);
- if (!context.flags.z())
+ cx = 300;
+ al = 35;
+ showpuztext();
+ putbackobstuff();
+}
+
+void DreamGenContext::usefullcart() {
+ STACK_CHECK;
+ _inc(data.byte(kProgresspoints));
+ al = 2;
+ ah = data.byte(kRoomnum);
+ _add(ah, 6);
+ turnanypathon();
+ data.byte(kManspath) = 4;
+ data.byte(kFacing) = 4;
+ data.byte(kTurntoface) = 4;
+ data.byte(kFinaldest) = 4;
+ findxyfrompath();
+ data.byte(kResetmanxy) = 1;
+ showfirstuse();
+ data.word(kWatchingtime) = 72*2;
+ data.word(kReeltowatch) = 58;
+ data.word(kEndwatchreel) = 142;
+ data.byte(kWatchspeed) = 1;
+ data.byte(kSpeedcount) = 1;
+ data.byte(kGetback) = 1;
+}
+
+void DreamGenContext::useplinth() {
+ STACK_CHECK;
+ _cmp(data.byte(kWithobject), 255);
+ if (!flags.z())
goto plinthwith;
- withwhat(context);
+ withwhat();
return;
plinthwith:
- context.al = context.data.byte(kWithobject);
- context.ah = context.data.byte(kWithtype);
- context.cl = 'D';
- context.ch = 'K';
- context.dl = 'E';
- context.dh = 'Y';
- compare(context);
- if (context.flags.z())
+ al = data.byte(kWithobject);
+ ah = data.byte(kWithtype);
+ cl = 'D';
+ ch = 'K';
+ dl = 'E';
+ dh = 'Y';
+ compare();
+ if (flags.z())
goto isrightkey;
- showfirstuse(context);
- putbackobstuff(context);
+ showfirstuse();
+ putbackobstuff();
return;
isrightkey:
- context._inc(context.data.byte(kProgresspoints));
- showseconduse(context);
- context.data.word(kWatchingtime) = 220;
- context.data.word(kReeltowatch) = 0;
- context.data.word(kEndwatchreel) = 104;
- context.data.byte(kWatchspeed) = 1;
- context.data.byte(kSpeedcount) = 1;
- context.data.byte(kGetback) = 1;
- context.al = context.data.byte(kRoomafterdream);
- context.data.byte(kNewlocation) = context.al;
-}
-
-void chewy(Context &context) {
- STACK_CHECK(context);
- showfirstuse(context);
- getanyad(context);
- context.es.byte(context.bx+2) = 255;
- context.data.byte(kGetback) = 1;
-}
-
-void useladder(Context &context) {
- STACK_CHECK(context);
- showfirstuse(context);
- context._sub(context.data.byte(kMapx), 11);
- findroominloc(context);
- context.data.byte(kFacing) = 6;
- context.data.byte(kTurntoface) = 6;
- context.data.byte(kManspath) = 0;
- context.data.byte(kDestination) = 0;
- context.data.byte(kFinaldest) = 0;
- findxyfrompath(context);
- context.data.byte(kResetmanxy) = 1;
- context.data.byte(kGetback) = 1;
-}
-
-void useladderb(Context &context) {
- STACK_CHECK(context);
- showfirstuse(context);
- context._add(context.data.byte(kMapx), 11);
- findroominloc(context);
- context.data.byte(kFacing) = 2;
- context.data.byte(kTurntoface) = 2;
- context.data.byte(kManspath) = 1;
- context.data.byte(kDestination) = 1;
- context.data.byte(kFinaldest) = 1;
- findxyfrompath(context);
- context.data.byte(kResetmanxy) = 1;
- context.data.byte(kGetback) = 1;
-}
-
-void slabdoora(Context &context) {
- STACK_CHECK(context);
- showfirstuse(context);
- context.data.byte(kGetback) = 1;
- context.data.byte(kWatchspeed) = 1;
- context.data.byte(kSpeedcount) = 1;
- context.data.word(kReeltowatch) = 13;
- context._cmp(context.data.byte(kDreamnumber), 3);
- if (!context.flags.z())
+ _inc(data.byte(kProgresspoints));
+ showseconduse();
+ data.word(kWatchingtime) = 220;
+ data.word(kReeltowatch) = 0;
+ data.word(kEndwatchreel) = 104;
+ data.byte(kWatchspeed) = 1;
+ data.byte(kSpeedcount) = 1;
+ data.byte(kGetback) = 1;
+ al = data.byte(kRoomafterdream);
+ data.byte(kNewlocation) = al;
+}
+
+void DreamGenContext::chewy() {
+ STACK_CHECK;
+ showfirstuse();
+ getanyad();
+ es.byte(bx+2) = 255;
+ data.byte(kGetback) = 1;
+}
+
+void DreamGenContext::useladder() {
+ STACK_CHECK;
+ showfirstuse();
+ _sub(data.byte(kMapx), 11);
+ findroominloc();
+ data.byte(kFacing) = 6;
+ data.byte(kTurntoface) = 6;
+ data.byte(kManspath) = 0;
+ data.byte(kDestination) = 0;
+ data.byte(kFinaldest) = 0;
+ findxyfrompath();
+ data.byte(kResetmanxy) = 1;
+ data.byte(kGetback) = 1;
+}
+
+void DreamGenContext::useladderb() {
+ STACK_CHECK;
+ showfirstuse();
+ _add(data.byte(kMapx), 11);
+ findroominloc();
+ data.byte(kFacing) = 2;
+ data.byte(kTurntoface) = 2;
+ data.byte(kManspath) = 1;
+ data.byte(kDestination) = 1;
+ data.byte(kFinaldest) = 1;
+ findxyfrompath();
+ data.byte(kResetmanxy) = 1;
+ data.byte(kGetback) = 1;
+}
+
+void DreamGenContext::slabdoora() {
+ STACK_CHECK;
+ showfirstuse();
+ data.byte(kGetback) = 1;
+ data.byte(kWatchspeed) = 1;
+ data.byte(kSpeedcount) = 1;
+ data.word(kReeltowatch) = 13;
+ _cmp(data.byte(kDreamnumber), 3);
+ if (!flags.z())
goto slabawrong;
- context._inc(context.data.byte(kProgresspoints));
- context.data.word(kWatchingtime) = 60;
- context.data.word(kEndwatchreel) = 42;
- context.data.byte(kNewlocation) = 47;
+ _inc(data.byte(kProgresspoints));
+ data.word(kWatchingtime) = 60;
+ data.word(kEndwatchreel) = 42;
+ data.byte(kNewlocation) = 47;
return;
slabawrong:
- context.data.word(kWatchingtime) = 40;
- context.data.word(kEndwatchreel) = 34;
- context.data.byte(kWatchspeed) = 1;
- context.data.byte(kSpeedcount) = 1;
+ data.word(kWatchingtime) = 40;
+ data.word(kEndwatchreel) = 34;
+ data.byte(kWatchspeed) = 1;
+ data.byte(kSpeedcount) = 1;
}
-void slabdoorb(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kDreamnumber), 1);
- if (!context.flags.z())
+void DreamGenContext::slabdoorb() {
+ STACK_CHECK;
+ _cmp(data.byte(kDreamnumber), 1);
+ if (!flags.z())
goto slabbwrong;
- context.al = 'S';
- context.ah = 'H';
- context.cl = 'L';
- context.ch = 'D';
- isryanholding(context);
- if (!context.flags.z())
+ al = 'S';
+ ah = 'H';
+ cl = 'L';
+ ch = 'D';
+ isryanholding();
+ if (!flags.z())
goto gotcrystal;
- context.al = 44;
- context.cx = 200;
- showpuztext(context);
- putbackobstuff(context);
+ al = 44;
+ cx = 200;
+ showpuztext();
+ putbackobstuff();
return;
gotcrystal:
- showfirstuse(context);
- context._inc(context.data.byte(kProgresspoints));
- context.data.byte(kGetback) = 1;
- context.data.byte(kWatchspeed) = 1;
- context.data.byte(kSpeedcount) = 1;
- context.data.word(kReeltowatch) = 44;
- context.data.word(kWatchingtime) = 60;
- context.data.word(kEndwatchreel) = 71;
- context.data.byte(kNewlocation) = 47;
+ showfirstuse();
+ _inc(data.byte(kProgresspoints));
+ data.byte(kGetback) = 1;
+ data.byte(kWatchspeed) = 1;
+ data.byte(kSpeedcount) = 1;
+ data.word(kReeltowatch) = 44;
+ data.word(kWatchingtime) = 60;
+ data.word(kEndwatchreel) = 71;
+ data.byte(kNewlocation) = 47;
return;
slabbwrong:
- showfirstuse(context);
- context.data.byte(kGetback) = 1;
- context.data.byte(kWatchspeed) = 1;
- context.data.byte(kSpeedcount) = 1;
- context.data.word(kReeltowatch) = 44;
- context.data.word(kWatchingtime) = 40;
- context.data.word(kEndwatchreel) = 63;
- context.data.byte(kWatchspeed) = 1;
- context.data.byte(kSpeedcount) = 1;
-}
-
-void slabdoord(Context &context) {
- STACK_CHECK(context);
- showfirstuse(context);
- context.data.byte(kGetback) = 1;
- context.data.byte(kWatchspeed) = 1;
- context.data.byte(kSpeedcount) = 1;
- context.data.word(kReeltowatch) = 75;
- context._cmp(context.data.byte(kDreamnumber), 0);
- if (!context.flags.z())
+ showfirstuse();
+ data.byte(kGetback) = 1;
+ data.byte(kWatchspeed) = 1;
+ data.byte(kSpeedcount) = 1;
+ data.word(kReeltowatch) = 44;
+ data.word(kWatchingtime) = 40;
+ data.word(kEndwatchreel) = 63;
+ data.byte(kWatchspeed) = 1;
+ data.byte(kSpeedcount) = 1;
+}
+
+void DreamGenContext::slabdoord() {
+ STACK_CHECK;
+ showfirstuse();
+ data.byte(kGetback) = 1;
+ data.byte(kWatchspeed) = 1;
+ data.byte(kSpeedcount) = 1;
+ data.word(kReeltowatch) = 75;
+ _cmp(data.byte(kDreamnumber), 0);
+ if (!flags.z())
goto slabcwrong;
- context._inc(context.data.byte(kProgresspoints));
- context.data.word(kWatchingtime) = 60;
- context.data.word(kEndwatchreel) = 102;
- context.data.byte(kNewlocation) = 47;
+ _inc(data.byte(kProgresspoints));
+ data.word(kWatchingtime) = 60;
+ data.word(kEndwatchreel) = 102;
+ data.byte(kNewlocation) = 47;
return;
slabcwrong:
- context.data.word(kWatchingtime) = 40;
- context.data.word(kEndwatchreel) = 94;
- context.data.byte(kWatchspeed) = 1;
- context.data.byte(kSpeedcount) = 1;
-}
-
-void slabdoorc(Context &context) {
- STACK_CHECK(context);
- showfirstuse(context);
- context.data.byte(kGetback) = 1;
- context.data.byte(kWatchspeed) = 1;
- context.data.byte(kSpeedcount) = 1;
- context.data.word(kReeltowatch) = 108;
- context._cmp(context.data.byte(kDreamnumber), 4);
- if (!context.flags.z())
+ data.word(kWatchingtime) = 40;
+ data.word(kEndwatchreel) = 94;
+ data.byte(kWatchspeed) = 1;
+ data.byte(kSpeedcount) = 1;
+}
+
+void DreamGenContext::slabdoorc() {
+ STACK_CHECK;
+ showfirstuse();
+ data.byte(kGetback) = 1;
+ data.byte(kWatchspeed) = 1;
+ data.byte(kSpeedcount) = 1;
+ data.word(kReeltowatch) = 108;
+ _cmp(data.byte(kDreamnumber), 4);
+ if (!flags.z())
goto slabdwrong;
- context._inc(context.data.byte(kProgresspoints));
- context.data.word(kWatchingtime) = 60;
- context.data.word(kEndwatchreel) = 135;
- context.data.byte(kNewlocation) = 47;
+ _inc(data.byte(kProgresspoints));
+ data.word(kWatchingtime) = 60;
+ data.word(kEndwatchreel) = 135;
+ data.byte(kNewlocation) = 47;
return;
slabdwrong:
- context.data.word(kWatchingtime) = 40;
- context.data.word(kEndwatchreel) = 127;
- context.data.byte(kWatchspeed) = 1;
- context.data.byte(kSpeedcount) = 1;
-}
-
-void slabdoore(Context &context) {
- STACK_CHECK(context);
- showfirstuse(context);
- context.data.byte(kGetback) = 1;
- context.data.byte(kWatchspeed) = 1;
- context.data.byte(kSpeedcount) = 1;
- context.data.word(kReeltowatch) = 141;
- context._cmp(context.data.byte(kDreamnumber), 5);
- if (!context.flags.z())
+ data.word(kWatchingtime) = 40;
+ data.word(kEndwatchreel) = 127;
+ data.byte(kWatchspeed) = 1;
+ data.byte(kSpeedcount) = 1;
+}
+
+void DreamGenContext::slabdoore() {
+ STACK_CHECK;
+ showfirstuse();
+ data.byte(kGetback) = 1;
+ data.byte(kWatchspeed) = 1;
+ data.byte(kSpeedcount) = 1;
+ data.word(kReeltowatch) = 141;
+ _cmp(data.byte(kDreamnumber), 5);
+ if (!flags.z())
goto slabewrong;
- context._inc(context.data.byte(kProgresspoints));
- context.data.word(kWatchingtime) = 60;
- context.data.word(kEndwatchreel) = 168;
- context.data.byte(kNewlocation) = 47;
+ _inc(data.byte(kProgresspoints));
+ data.word(kWatchingtime) = 60;
+ data.word(kEndwatchreel) = 168;
+ data.byte(kNewlocation) = 47;
return;
slabewrong:
- context.data.word(kWatchingtime) = 40;
- context.data.word(kEndwatchreel) = 160;
- context.data.byte(kWatchspeed) = 1;
- context.data.byte(kSpeedcount) = 1;
-}
-
-void slabdoorf(Context &context) {
- STACK_CHECK(context);
- showfirstuse(context);
- context.data.byte(kGetback) = 1;
- context.data.byte(kWatchspeed) = 1;
- context.data.byte(kSpeedcount) = 1;
- context.data.word(kReeltowatch) = 171;
- context._cmp(context.data.byte(kDreamnumber), 2);
- if (!context.flags.z())
+ data.word(kWatchingtime) = 40;
+ data.word(kEndwatchreel) = 160;
+ data.byte(kWatchspeed) = 1;
+ data.byte(kSpeedcount) = 1;
+}
+
+void DreamGenContext::slabdoorf() {
+ STACK_CHECK;
+ showfirstuse();
+ data.byte(kGetback) = 1;
+ data.byte(kWatchspeed) = 1;
+ data.byte(kSpeedcount) = 1;
+ data.word(kReeltowatch) = 171;
+ _cmp(data.byte(kDreamnumber), 2);
+ if (!flags.z())
goto slabfwrong;
- context._inc(context.data.byte(kProgresspoints));
- context.data.word(kWatchingtime) = 60;
- context.data.word(kEndwatchreel) = 197;
- context.data.byte(kNewlocation) = 47;
+ _inc(data.byte(kProgresspoints));
+ data.word(kWatchingtime) = 60;
+ data.word(kEndwatchreel) = 197;
+ data.byte(kNewlocation) = 47;
return;
slabfwrong:
- context.data.word(kWatchingtime) = 40;
- context.data.word(kEndwatchreel) = 189;
- context.data.byte(kWatchspeed) = 1;
- context.data.byte(kSpeedcount) = 1;
+ data.word(kWatchingtime) = 40;
+ data.word(kEndwatchreel) = 189;
+ data.byte(kWatchspeed) = 1;
+ data.byte(kSpeedcount) = 1;
}
-void useslab(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kWithobject), 255);
- if (!context.flags.z())
+void DreamGenContext::useslab() {
+ STACK_CHECK;
+ _cmp(data.byte(kWithobject), 255);
+ if (!flags.z())
goto slabwith;
- withwhat(context);
+ withwhat();
return;
slabwith:
- context.al = context.data.byte(kWithobject);
- context.ah = context.data.byte(kWithtype);
- context.cl = 'J';
- context.ch = 'E';
- context.dl = 'W';
- context.dh = 'L';
- compare(context);
- if (context.flags.z())
+ al = data.byte(kWithobject);
+ ah = data.byte(kWithtype);
+ cl = 'J';
+ ch = 'E';
+ dl = 'W';
+ dh = 'L';
+ compare();
+ if (flags.z())
goto nextslab;
- context.cx = 300;
- context.al = 14;
- showpuztext(context);
- putbackobstuff(context);
+ cx = 300;
+ al = 14;
+ showpuztext();
+ putbackobstuff();
return;
nextslab:
- context.al = context.data.byte(kWithobject);
- getexad(context);
- context.es.byte(context.bx+2) = 0;
- context.al = context.data.byte(kCommand);
- context.push(context.ax);
- removesetobject(context);
- context.ax = context.pop();
- context._inc(context.al);
- context.push(context.ax);
- placesetobject(context);
- context.ax = context.pop();
- context._cmp(context.al, 54);
- if (!context.flags.z())
+ al = data.byte(kWithobject);
+ getexad();
+ es.byte(bx+2) = 0;
+ al = data.byte(kCommand);
+ push(ax);
+ removesetobject();
+ ax = pop();
+ _inc(al);
+ push(ax);
+ placesetobject();
+ ax = pop();
+ _cmp(al, 54);
+ if (!flags.z())
goto notlastslab;
- context.al = 0;
- turnpathon(context);
- context.data.word(kWatchingtime) = 22;
- context.data.word(kReeltowatch) = 35;
- context.data.word(kEndwatchreel) = 48;
- context.data.byte(kWatchspeed) = 1;
- context.data.byte(kSpeedcount) = 1;
+ al = 0;
+ turnpathon();
+ data.word(kWatchingtime) = 22;
+ data.word(kReeltowatch) = 35;
+ data.word(kEndwatchreel) = 48;
+ data.byte(kWatchspeed) = 1;
+ data.byte(kSpeedcount) = 1;
notlastslab:
- context._inc(context.data.byte(kProgresspoints));
- showfirstuse(context);
- context.data.byte(kGetback) = 1;
+ _inc(data.byte(kProgresspoints));
+ showfirstuse();
+ data.byte(kGetback) = 1;
}
-void usecart(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kWithobject), 255);
- if (!context.flags.z())
+void DreamGenContext::usecart() {
+ STACK_CHECK;
+ _cmp(data.byte(kWithobject), 255);
+ if (!flags.z())
goto cartwith;
- withwhat(context);
+ withwhat();
return;
cartwith:
- context.al = context.data.byte(kWithobject);
- context.ah = context.data.byte(kWithtype);
- context.cl = 'R';
- context.ch = 'O';
- context.dl = 'C';
- context.dh = 'K';
- compare(context);
- if (context.flags.z())
+ al = data.byte(kWithobject);
+ ah = data.byte(kWithtype);
+ cl = 'R';
+ ch = 'O';
+ dl = 'C';
+ dh = 'K';
+ compare();
+ if (flags.z())
goto nextcart;
- context.cx = 300;
- context.al = 14;
- showpuztext(context);
- putbackobstuff(context);
+ cx = 300;
+ al = 14;
+ showpuztext();
+ putbackobstuff();
return;
nextcart:
- context.al = context.data.byte(kWithobject);
- getexad(context);
- context.es.byte(context.bx+2) = 0;
- context.al = context.data.byte(kCommand);
- context.push(context.ax);
- removesetobject(context);
- context.ax = context.pop();
- context._inc(context.al);
- placesetobject(context);
- context._inc(context.data.byte(kProgresspoints));
- context.al = 17;
- playchannel1(context);
- showfirstuse(context);
- context.data.byte(kGetback) = 1;
-}
-
-void useclearbox(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kWithobject), 255);
- if (!context.flags.z())
+ al = data.byte(kWithobject);
+ getexad();
+ es.byte(bx+2) = 0;
+ al = data.byte(kCommand);
+ push(ax);
+ removesetobject();
+ ax = pop();
+ _inc(al);
+ placesetobject();
+ _inc(data.byte(kProgresspoints));
+ al = 17;
+ playchannel1();
+ showfirstuse();
+ data.byte(kGetback) = 1;
+}
+
+void DreamGenContext::useclearbox() {
+ STACK_CHECK;
+ _cmp(data.byte(kWithobject), 255);
+ if (!flags.z())
goto clearboxwith;
- withwhat(context);
+ withwhat();
return;
clearboxwith:
- context.al = context.data.byte(kWithobject);
- context.ah = context.data.byte(kWithtype);
- context.cl = 'R';
- context.ch = 'A';
- context.dl = 'I';
- context.dh = 'L';
- compare(context);
- if (context.flags.z())
+ al = data.byte(kWithobject);
+ ah = data.byte(kWithtype);
+ cl = 'R';
+ ch = 'A';
+ dl = 'I';
+ dh = 'L';
+ compare();
+ if (flags.z())
goto openbox;
- context.cx = 300;
- context.al = 14;
- showpuztext(context);
- putbackobstuff(context);
+ cx = 300;
+ al = 14;
+ showpuztext();
+ putbackobstuff();
return;
openbox:
- context._inc(context.data.byte(kProgresspoints));
- showfirstuse(context);
- context.data.word(kWatchingtime) = 80;
- context.data.word(kReeltowatch) = 67;
- context.data.word(kEndwatchreel) = 105;
- context.data.byte(kWatchspeed) = 1;
- context.data.byte(kSpeedcount) = 1;
- context.data.byte(kGetback) = 1;
-}
-
-void usecoveredbox(Context &context) {
- STACK_CHECK(context);
- context._inc(context.data.byte(kProgresspoints));
- showfirstuse(context);
- context.data.word(kWatchingtime) = 50;
- context.data.word(kReeltowatch) = 41;
- context.data.word(kEndwatchreel) = 66;
- context.data.byte(kWatchspeed) = 1;
- context.data.byte(kSpeedcount) = 1;
- context.data.byte(kGetback) = 1;
-}
-
-void userailing(Context &context) {
- STACK_CHECK(context);
- showfirstuse(context);
- context.data.word(kWatchingtime) = 80;
- context.data.word(kReeltowatch) = 0;
- context.data.word(kEndwatchreel) = 30;
- context.data.byte(kWatchspeed) = 1;
- context.data.byte(kSpeedcount) = 1;
- context.data.byte(kGetback) = 1;
- context.data.byte(kMandead) = 4;
-}
-
-void useopenbox(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kWithobject), 255);
- if (!context.flags.z())
+ _inc(data.byte(kProgresspoints));
+ showfirstuse();
+ data.word(kWatchingtime) = 80;
+ data.word(kReeltowatch) = 67;
+ data.word(kEndwatchreel) = 105;
+ data.byte(kWatchspeed) = 1;
+ data.byte(kSpeedcount) = 1;
+ data.byte(kGetback) = 1;
+}
+
+void DreamGenContext::usecoveredbox() {
+ STACK_CHECK;
+ _inc(data.byte(kProgresspoints));
+ showfirstuse();
+ data.word(kWatchingtime) = 50;
+ data.word(kReeltowatch) = 41;
+ data.word(kEndwatchreel) = 66;
+ data.byte(kWatchspeed) = 1;
+ data.byte(kSpeedcount) = 1;
+ data.byte(kGetback) = 1;
+}
+
+void DreamGenContext::userailing() {
+ STACK_CHECK;
+ showfirstuse();
+ data.word(kWatchingtime) = 80;
+ data.word(kReeltowatch) = 0;
+ data.word(kEndwatchreel) = 30;
+ data.byte(kWatchspeed) = 1;
+ data.byte(kSpeedcount) = 1;
+ data.byte(kGetback) = 1;
+ data.byte(kMandead) = 4;
+}
+
+void DreamGenContext::useopenbox() {
+ STACK_CHECK;
+ _cmp(data.byte(kWithobject), 255);
+ if (!flags.z())
goto openboxwith;
- withwhat(context);
+ withwhat();
return;
openboxwith:
- context.al = context.data.byte(kWithobject);
- context.ah = context.data.byte(kWithtype);
- context.cl = 'C';
- context.ch = 'U';
- context.dl = 'P';
- context.dh = 'F';
- compare(context);
- if (context.flags.z())
+ al = data.byte(kWithobject);
+ ah = data.byte(kWithtype);
+ cl = 'C';
+ ch = 'U';
+ dl = 'P';
+ dh = 'F';
+ compare();
+ if (flags.z())
goto destoryopenbox;
- context.al = context.data.byte(kWithobject);
- context.ah = context.data.byte(kWithtype);
- context.cl = 'C';
- context.ch = 'U';
- context.dl = 'P';
- context.dh = 'E';
- compare(context);
- if (context.flags.z())
+ al = data.byte(kWithobject);
+ ah = data.byte(kWithtype);
+ cl = 'C';
+ ch = 'U';
+ dl = 'P';
+ dh = 'E';
+ compare();
+ if (flags.z())
goto openboxwrong;
- showfirstuse(context);
+ showfirstuse();
return;
destoryopenbox:
- context._inc(context.data.byte(kProgresspoints));
- context.cx = 300;
- context.al = 37;
- showpuztext(context);
- context.al = context.data.byte(kWithobject);
- getexad(context);
- context.es.byte(context.bx+15) = 'E'-'A';
- context.data.word(kWatchingtime) = 140;
- context.data.word(kReeltowatch) = 105;
- context.data.word(kEndwatchreel) = 181;
- context.data.byte(kWatchspeed) = 1;
- context.data.byte(kSpeedcount) = 1;
- context.al = 4;
- turnpathon(context);
- context.data.byte(kGetback) = 1;
+ _inc(data.byte(kProgresspoints));
+ cx = 300;
+ al = 37;
+ showpuztext();
+ al = data.byte(kWithobject);
+ getexad();
+ es.byte(bx+15) = 'E'-'A';
+ data.word(kWatchingtime) = 140;
+ data.word(kReeltowatch) = 105;
+ data.word(kEndwatchreel) = 181;
+ data.byte(kWatchspeed) = 1;
+ data.byte(kSpeedcount) = 1;
+ al = 4;
+ turnpathon();
+ data.byte(kGetback) = 1;
return;
openboxwrong:
- context.cx = 300;
- context.al = 38;
- showpuztext(context);
- putbackobstuff(context);
+ cx = 300;
+ al = 38;
+ showpuztext();
+ putbackobstuff();
}
-void wearwatch(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kWatchon), 1);
- if (context.flags.z())
+void DreamGenContext::wearwatch() {
+ STACK_CHECK;
+ _cmp(data.byte(kWatchon), 1);
+ if (flags.z())
goto wearingwatch;
- showfirstuse(context);
- context.data.byte(kWatchon) = 1;
- context.data.byte(kGetback) = 1;
- getanyad(context);
- makeworn(context);
+ showfirstuse();
+ data.byte(kWatchon) = 1;
+ data.byte(kGetback) = 1;
+ getanyad();
+ makeworn();
return;
wearingwatch:
- showseconduse(context);
- putbackobstuff(context);
+ showseconduse();
+ putbackobstuff();
}
-void wearshades(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kShadeson), 1);
- if (context.flags.z())
+void DreamGenContext::wearshades() {
+ STACK_CHECK;
+ _cmp(data.byte(kShadeson), 1);
+ if (flags.z())
goto wearingshades;
- context.data.byte(kShadeson) = 1;
- showfirstuse(context);
- context.data.byte(kGetback) = 1;
- getanyad(context);
- makeworn(context);
+ data.byte(kShadeson) = 1;
+ showfirstuse();
+ data.byte(kGetback) = 1;
+ getanyad();
+ makeworn();
return;
wearingshades:
- showseconduse(context);
- putbackobstuff(context);
+ showseconduse();
+ putbackobstuff();
}
-void sitdowninbar(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kWatchmode), -1);
- if (!context.flags.z())
+void DreamGenContext::sitdowninbar() {
+ STACK_CHECK;
+ _cmp(data.byte(kWatchmode), -1);
+ if (!flags.z())
goto satdown;
- showfirstuse(context);
- context.data.word(kWatchingtime) = 50;
- context.data.word(kReeltowatch) = 55;
- context.data.word(kEndwatchreel) = 71;
- context.data.word(kReeltohold) = 73;
- context.data.word(kEndofholdreel) = 83;
- context.data.byte(kWatchspeed) = 1;
- context.data.byte(kSpeedcount) = 1;
- context.data.byte(kGetback) = 1;
+ showfirstuse();
+ data.word(kWatchingtime) = 50;
+ data.word(kReeltowatch) = 55;
+ data.word(kEndwatchreel) = 71;
+ data.word(kReeltohold) = 73;
+ data.word(kEndofholdreel) = 83;
+ data.byte(kWatchspeed) = 1;
+ data.byte(kSpeedcount) = 1;
+ data.byte(kGetback) = 1;
return;
satdown:
- showseconduse(context);
- putbackobstuff(context);
+ showseconduse();
+ putbackobstuff();
}
-void usechurchhole(Context &context) {
- STACK_CHECK(context);
- showfirstuse(context);
- context.data.byte(kGetback) = 1;
- context.data.word(kWatchingtime) = 28;
- context.data.word(kReeltowatch) = 13;
- context.data.word(kEndwatchreel) = 26;
- context.data.byte(kWatchspeed) = 1;
- context.data.byte(kSpeedcount) = 1;
+void DreamGenContext::usechurchhole() {
+ STACK_CHECK;
+ showfirstuse();
+ data.byte(kGetback) = 1;
+ data.word(kWatchingtime) = 28;
+ data.word(kReeltowatch) = 13;
+ data.word(kEndwatchreel) = 26;
+ data.byte(kWatchspeed) = 1;
+ data.byte(kSpeedcount) = 1;
}
-void usehole(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kWithobject), 255);
- if (!context.flags.z())
+void DreamGenContext::usehole() {
+ STACK_CHECK;
+ _cmp(data.byte(kWithobject), 255);
+ if (!flags.z())
goto holewith;
- withwhat(context);
+ withwhat();
return;
holewith:
- context.al = context.data.byte(kWithobject);
- context.ah = context.data.byte(kWithtype);
- context.cl = 'H';
- context.ch = 'N';
- context.dl = 'D';
- context.dh = 'A';
- compare(context);
- if (context.flags.z())
+ al = data.byte(kWithobject);
+ ah = data.byte(kWithtype);
+ cl = 'H';
+ ch = 'N';
+ dl = 'D';
+ dh = 'A';
+ compare();
+ if (flags.z())
goto righthand;
- context.cx = 300;
- context.al = 14;
- showpuztext(context);
- putbackobstuff(context);
+ cx = 300;
+ al = 14;
+ showpuztext();
+ putbackobstuff();
return;
righthand:
- showfirstuse(context);
- context.al = 86;
- removesetobject(context);
- context.al = context.data.byte(kWithobject);
- getexad(context);
- context.es.byte(context.bx+2) = 255;
- context.data.byte(kCanmovealtar) = 1;
- context.data.byte(kGetback) = 1;
-}
-
-void usealtar(Context &context) {
- STACK_CHECK(context);
- context.al = 'C';
- context.ah = 'N';
- context.cl = 'D';
- context.ch = 'A';
- findexobject(context);
- context._cmp(context.al, (114));
- if (context.flags.z())
+ showfirstuse();
+ al = 86;
+ removesetobject();
+ al = data.byte(kWithobject);
+ getexad();
+ es.byte(bx+2) = 255;
+ data.byte(kCanmovealtar) = 1;
+ data.byte(kGetback) = 1;
+}
+
+void DreamGenContext::usealtar() {
+ STACK_CHECK;
+ al = 'C';
+ ah = 'N';
+ cl = 'D';
+ ch = 'A';
+ findexobject();
+ _cmp(al, (114));
+ if (flags.z())
goto thingsonaltar;
- context.al = 'C';
- context.ah = 'N';
- context.cl = 'D';
- context.ch = 'B';
- findexobject(context);
- context._cmp(context.al, (114));
- if (context.flags.z())
+ al = 'C';
+ ah = 'N';
+ cl = 'D';
+ ch = 'B';
+ findexobject();
+ _cmp(al, (114));
+ if (flags.z())
goto thingsonaltar;
- context._cmp(context.data.byte(kCanmovealtar), 1);
- if (context.flags.z())
+ _cmp(data.byte(kCanmovealtar), 1);
+ if (flags.z())
goto movealtar;
- context.cx = 300;
- context.al = 23;
- showpuztext(context);
- context.data.byte(kGetback) = 1;
+ cx = 300;
+ al = 23;
+ showpuztext();
+ data.byte(kGetback) = 1;
return;
movealtar:
- context._inc(context.data.byte(kProgresspoints));
- showseconduse(context);
- context.data.word(kWatchingtime) = 160;
- context.data.word(kReeltowatch) = 81;
- context.data.word(kEndwatchreel) = 174;
- context.data.byte(kWatchspeed) = 1;
- context.data.byte(kSpeedcount) = 1;
- context.al = 47;
- context.bl = 52;
- context.bh = 76;
- context.cx = 32;
- context.dx = 98;
- setuptimeduse(context);
- context.data.byte(kGetback) = 1;
+ _inc(data.byte(kProgresspoints));
+ showseconduse();
+ data.word(kWatchingtime) = 160;
+ data.word(kReeltowatch) = 81;
+ data.word(kEndwatchreel) = 174;
+ data.byte(kWatchspeed) = 1;
+ data.byte(kSpeedcount) = 1;
+ al = 47;
+ bl = 52;
+ bh = 76;
+ cx = 32;
+ dx = 98;
+ setuptimeduse();
+ data.byte(kGetback) = 1;
return;
thingsonaltar:
- showfirstuse(context);
- context.data.byte(kGetback) = 1;
+ showfirstuse();
+ data.byte(kGetback) = 1;
}
-void opentvdoor(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kWithobject), 255);
- if (!context.flags.z())
+void DreamGenContext::opentvdoor() {
+ STACK_CHECK;
+ _cmp(data.byte(kWithobject), 255);
+ if (!flags.z())
goto tvdoorwith;
- withwhat(context);
+ withwhat();
return;
tvdoorwith:
- context.al = context.data.byte(kWithobject);
- context.ah = context.data.byte(kWithtype);
- context.cl = 'U';
- context.ch = 'L';
- context.dl = 'O';
- context.dh = 'K';
- compare(context);
- if (context.flags.z())
+ al = data.byte(kWithobject);
+ ah = data.byte(kWithtype);
+ cl = 'U';
+ ch = 'L';
+ dl = 'O';
+ dh = 'K';
+ compare();
+ if (flags.z())
goto keyontv;
- context.cx = 300;
- context.al = 14;
- showpuztext(context);
- putbackobstuff(context);
+ cx = 300;
+ al = 14;
+ showpuztext();
+ putbackobstuff();
return;
keyontv:
- showfirstuse(context);
- context.data.byte(kLockstatus) = 0;
- context.data.byte(kGetback) = 1;
+ showfirstuse();
+ data.byte(kLockstatus) = 0;
+ data.byte(kGetback) = 1;
}
-void usedryer(Context &context) {
- STACK_CHECK(context);
- context.al = 12;
- playchannel1(context);
- showfirstuse(context);
- context.data.byte(kGetback) = 1;
+void DreamGenContext::usedryer() {
+ STACK_CHECK;
+ al = 12;
+ playchannel1();
+ showfirstuse();
+ data.byte(kGetback) = 1;
}
-void openlouis(Context &context) {
- STACK_CHECK(context);
- context.al = 5;
- context.ah = 2;
- context.cl = 3;
- context.ch = 8;
- entercode(context);
- context.data.byte(kGetback) = 1;
+void DreamGenContext::openlouis() {
+ STACK_CHECK;
+ al = 5;
+ ah = 2;
+ cl = 3;
+ ch = 8;
+ entercode();
+ data.byte(kGetback) = 1;
}
-void nextcolon(Context &context) {
- STACK_CHECK(context);
+void DreamGenContext::nextcolon() {
+ STACK_CHECK;
lookcolon:
- context.al = context.es.byte(context.si);
- context._inc(context.si);
- context._cmp(context.al, ':');
- if (!context.flags.z())
+ al = es.byte(si);
+ _inc(si);
+ _cmp(al, ':');
+ if (!flags.z())
goto lookcolon;
}
-void openyourneighbour(Context &context) {
- STACK_CHECK(context);
- context.al = 255;
- context.ah = 255;
- context.cl = 255;
- context.ch = 255;
- entercode(context);
- context.data.byte(kGetback) = 1;
+void DreamGenContext::openyourneighbour() {
+ STACK_CHECK;
+ al = 255;
+ ah = 255;
+ cl = 255;
+ ch = 255;
+ entercode();
+ data.byte(kGetback) = 1;
}
-void usewindow(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kManspath), 6);
- if (!context.flags.z())
+void DreamGenContext::usewindow() {
+ STACK_CHECK;
+ _cmp(data.byte(kManspath), 6);
+ if (!flags.z())
goto notonbalc;
- context._inc(context.data.byte(kProgresspoints));
- showfirstuse(context);
- context.data.byte(kNewlocation) = 29;
- context.data.byte(kGetback) = 1;
+ _inc(data.byte(kProgresspoints));
+ showfirstuse();
+ data.byte(kNewlocation) = 29;
+ data.byte(kGetback) = 1;
return;
notonbalc:
- showseconduse(context);
- putbackobstuff(context);
-}
-
-void usebalcony(Context &context) {
- STACK_CHECK(context);
- showfirstuse(context);
- context.al = 6;
- turnpathon(context);
- context.al = 0;
- turnpathoff(context);
- context.al = 1;
- turnpathoff(context);
- context.al = 2;
- turnpathoff(context);
- context.al = 3;
- turnpathoff(context);
- context.al = 4;
- turnpathoff(context);
- context.al = 5;
- turnpathoff(context);
- context._inc(context.data.byte(kProgresspoints));
- context.data.byte(kManspath) = 6;
- context.data.byte(kDestination) = 6;
- context.data.byte(kFinaldest) = 6;
- findxyfrompath(context);
- switchryanoff(context);
- context.data.byte(kResetmanxy) = 1;
- context.data.word(kWatchingtime) = 30*2;
- context.data.word(kReeltowatch) = 183;
- context.data.word(kEndwatchreel) = 212;
- context.data.byte(kWatchspeed) = 1;
- context.data.byte(kSpeedcount) = 1;
- context.data.byte(kGetback) = 1;
-}
-
-void openryan(Context &context) {
- STACK_CHECK(context);
- context.al = 5;
- context.ah = 1;
- context.cl = 0;
- context.ch = 6;
- entercode(context);
- context.data.byte(kGetback) = 1;
-}
-
-void openpoolboss(Context &context) {
- STACK_CHECK(context);
- context.al = 5;
- context.ah = 2;
- context.cl = 2;
- context.ch = 2;
- entercode(context);
- context.data.byte(kGetback) = 1;
-}
-
-void openeden(Context &context) {
- STACK_CHECK(context);
- context.al = 2;
- context.ah = 8;
- context.cl = 6;
- context.ch = 5;
- entercode(context);
- context.data.byte(kGetback) = 1;
-}
-
-void opensarters(Context &context) {
- STACK_CHECK(context);
- context.al = 7;
- context.ah = 8;
- context.cl = 3;
- context.ch = 3;
- entercode(context);
- context.data.byte(kGetback) = 1;
-}
-
-void isitright(Context &context) {
- STACK_CHECK(context);
- context.bx = context.data;
- context.es = context.bx;
- context.bx = 8573;
- context._cmp(context.es.byte(context.bx+0), context.al);
- if (!context.flags.z())
- goto notright;
- context._cmp(context.es.byte(context.bx+1), context.ah);
- if (!context.flags.z())
- goto notright;
- context._cmp(context.es.byte(context.bx+2), context.cl);
- if (!context.flags.z())
- goto notright;
- context._cmp(context.es.byte(context.bx+3), context.ch);
-notright:
- return;
-}
-
-void drawitall(Context &context) {
- STACK_CHECK(context);
- createpanel(context);
- drawfloor(context);
- printsprites(context);
- showicon(context);
-}
-
-void openhoteldoor(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kWithobject), 255);
- if (!context.flags.z())
+ showseconduse();
+ putbackobstuff();
+}
+
+void DreamGenContext::usebalcony() {
+ STACK_CHECK;
+ showfirstuse();
+ al = 6;
+ turnpathon();
+ al = 0;
+ turnpathoff();
+ al = 1;
+ turnpathoff();
+ al = 2;
+ turnpathoff();
+ al = 3;
+ turnpathoff();
+ al = 4;
+ turnpathoff();
+ al = 5;
+ turnpathoff();
+ _inc(data.byte(kProgresspoints));
+ data.byte(kManspath) = 6;
+ data.byte(kDestination) = 6;
+ data.byte(kFinaldest) = 6;
+ findxyfrompath();
+ switchryanoff();
+ data.byte(kResetmanxy) = 1;
+ data.word(kWatchingtime) = 30*2;
+ data.word(kReeltowatch) = 183;
+ data.word(kEndwatchreel) = 212;
+ data.byte(kWatchspeed) = 1;
+ data.byte(kSpeedcount) = 1;
+ data.byte(kGetback) = 1;
+}
+
+void DreamGenContext::openryan() {
+ STACK_CHECK;
+ al = 5;
+ ah = 1;
+ cl = 0;
+ ch = 6;
+ entercode();
+ data.byte(kGetback) = 1;
+}
+
+void DreamGenContext::openpoolboss() {
+ STACK_CHECK;
+ al = 5;
+ ah = 2;
+ cl = 2;
+ ch = 2;
+ entercode();
+ data.byte(kGetback) = 1;
+}
+
+void DreamGenContext::openeden() {
+ STACK_CHECK;
+ al = 2;
+ ah = 8;
+ cl = 6;
+ ch = 5;
+ entercode();
+ data.byte(kGetback) = 1;
+}
+
+void DreamGenContext::opensarters() {
+ STACK_CHECK;
+ al = 7;
+ ah = 8;
+ cl = 3;
+ ch = 3;
+ entercode();
+ data.byte(kGetback) = 1;
+}
+
+void DreamGenContext::isitright() {
+ STACK_CHECK;
+ bx = data;
+ es = bx;
+ bx = 8573;
+ _cmp(es.byte(bx+0), al);
+ if (!flags.z())
+ return /* (notright) */;
+ _cmp(es.byte(bx+1), ah);
+ if (!flags.z())
+ return /* (notright) */;
+ _cmp(es.byte(bx+2), cl);
+ if (!flags.z())
+ return /* (notright) */;
+ _cmp(es.byte(bx+3), ch);
+}
+
+void DreamGenContext::drawitall() {
+ STACK_CHECK;
+ createpanel();
+ drawfloor();
+ printsprites();
+ showicon();
+}
+
+void DreamGenContext::openhoteldoor() {
+ STACK_CHECK;
+ _cmp(data.byte(kWithobject), 255);
+ if (!flags.z())
goto hoteldoorwith;
- withwhat(context);
+ withwhat();
return;
hoteldoorwith:
- context.al = context.data.byte(kWithobject);
- context.ah = context.data.byte(kWithtype);
- context.cl = 'K';
- context.ch = 'E';
- context.dl = 'Y';
- context.dh = 'A';
- compare(context);
- if (context.flags.z())
+ al = data.byte(kWithobject);
+ ah = data.byte(kWithtype);
+ cl = 'K';
+ ch = 'E';
+ dl = 'Y';
+ dh = 'A';
+ compare();
+ if (flags.z())
goto keyonhotel1;
- context.cx = 300;
- context.al = 14;
- showpuztext(context);
- putbackobstuff(context);
+ cx = 300;
+ al = 14;
+ showpuztext();
+ putbackobstuff();
return;
keyonhotel1:
- context.al = 16;
- playchannel1(context);
- showfirstuse(context);
- context.data.byte(kLockstatus) = 0;
- context.data.byte(kGetback) = 1;
+ al = 16;
+ playchannel1();
+ showfirstuse();
+ data.byte(kLockstatus) = 0;
+ data.byte(kGetback) = 1;
}
-void openhoteldoor2(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kWithobject), 255);
- if (!context.flags.z())
+void DreamGenContext::openhoteldoor2() {
+ STACK_CHECK;
+ _cmp(data.byte(kWithobject), 255);
+ if (!flags.z())
goto hoteldoorwith2;
- withwhat(context);
+ withwhat();
return;
hoteldoorwith2:
- context.al = context.data.byte(kWithobject);
- context.ah = context.data.byte(kWithtype);
- context.cl = 'K';
- context.ch = 'E';
- context.dl = 'Y';
- context.dh = 'A';
- compare(context);
- if (context.flags.z())
+ al = data.byte(kWithobject);
+ ah = data.byte(kWithtype);
+ cl = 'K';
+ ch = 'E';
+ dl = 'Y';
+ dh = 'A';
+ compare();
+ if (flags.z())
goto keyonhotel2;
- context.cx = 300;
- context.al = 14;
- showpuztext(context);
- putbackobstuff(context);
+ cx = 300;
+ al = 14;
+ showpuztext();
+ putbackobstuff();
return;
keyonhotel2:
- context.al = 16;
- playchannel1(context);
- showfirstuse(context);
- putbackobstuff(context);
+ al = 16;
+ playchannel1();
+ showfirstuse();
+ putbackobstuff();
}
-void grafittidoor(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kWithobject), 255);
- if (!context.flags.z())
+void DreamGenContext::grafittidoor() {
+ STACK_CHECK;
+ _cmp(data.byte(kWithobject), 255);
+ if (!flags.z())
goto grafwith;
- withwhat(context);
+ withwhat();
return;
grafwith:
- context.al = context.data.byte(kWithobject);
- context.ah = context.data.byte(kWithtype);
- context.cl = 'A';
- context.ch = 'P';
- context.dl = 'E';
- context.dh = 'N';
- compare(context);
- if (context.flags.z())
+ al = data.byte(kWithobject);
+ ah = data.byte(kWithtype);
+ cl = 'A';
+ ch = 'P';
+ dl = 'E';
+ dh = 'N';
+ compare();
+ if (flags.z())
goto dograf;
- context.cx = 300;
- context.al = 14;
- showpuztext(context);
- putbackobstuff(context);
+ cx = 300;
+ al = 14;
+ showpuztext();
+ putbackobstuff();
return;
dograf:
- showfirstuse(context);
- putbackobstuff(context);
-}
-
-void trapdoor(Context &context) {
- STACK_CHECK(context);
- context._inc(context.data.byte(kProgresspoints));
- showfirstuse(context);
- switchryanoff(context);
- context.data.word(kWatchingtime) = 20*2;
- context.data.word(kReeltowatch) = 181;
- context.data.word(kEndwatchreel) = 197;
- context.data.byte(kNewlocation) = 26;
- context.data.byte(kWatchspeed) = 1;
- context.data.byte(kSpeedcount) = 1;
- context.data.byte(kGetback) = 1;
-}
-
-void callhotellift(Context &context) {
- STACK_CHECK(context);
- context.al = 12;
- playchannel1(context);
- showfirstuse(context);
- context.data.byte(kCounttoopen) = 8;
- context.data.byte(kGetback) = 1;
- context.data.byte(kDestination) = 5;
- context.data.byte(kFinaldest) = 5;
- autosetwalk(context);
- context.al = 4;
- turnpathon(context);
-}
-
-void calledenslift(Context &context) {
- STACK_CHECK(context);
- showfirstuse(context);
- context.data.byte(kCounttoopen) = 8;
- context.data.byte(kGetback) = 1;
- context.al = 2;
- turnpathon(context);
-}
-
-void calledensdlift(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kLiftflag), 1);
- if (context.flags.z())
+ showfirstuse();
+ putbackobstuff();
+}
+
+void DreamGenContext::trapdoor() {
+ STACK_CHECK;
+ _inc(data.byte(kProgresspoints));
+ showfirstuse();
+ switchryanoff();
+ data.word(kWatchingtime) = 20*2;
+ data.word(kReeltowatch) = 181;
+ data.word(kEndwatchreel) = 197;
+ data.byte(kNewlocation) = 26;
+ data.byte(kWatchspeed) = 1;
+ data.byte(kSpeedcount) = 1;
+ data.byte(kGetback) = 1;
+}
+
+void DreamGenContext::callhotellift() {
+ STACK_CHECK;
+ al = 12;
+ playchannel1();
+ showfirstuse();
+ data.byte(kCounttoopen) = 8;
+ data.byte(kGetback) = 1;
+ data.byte(kDestination) = 5;
+ data.byte(kFinaldest) = 5;
+ autosetwalk();
+ al = 4;
+ turnpathon();
+}
+
+void DreamGenContext::calledenslift() {
+ STACK_CHECK;
+ showfirstuse();
+ data.byte(kCounttoopen) = 8;
+ data.byte(kGetback) = 1;
+ al = 2;
+ turnpathon();
+}
+
+void DreamGenContext::calledensdlift() {
+ STACK_CHECK;
+ _cmp(data.byte(kLiftflag), 1);
+ if (flags.z())
goto edensdhere;
- showfirstuse(context);
- context.data.byte(kCounttoopen) = 8;
- context.data.byte(kGetback) = 1;
- context.al = 2;
- turnpathon(context);
+ showfirstuse();
+ data.byte(kCounttoopen) = 8;
+ data.byte(kGetback) = 1;
+ al = 2;
+ turnpathon();
return;
edensdhere:
- showseconduse(context);
- putbackobstuff(context);
+ showseconduse();
+ putbackobstuff();
}
-void usepoolreader(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kWithobject), 255);
- if (!context.flags.z())
+void DreamGenContext::usepoolreader() {
+ STACK_CHECK;
+ _cmp(data.byte(kWithobject), 255);
+ if (!flags.z())
goto poolwith;
- withwhat(context);
+ withwhat();
return;
poolwith:
- context.al = context.data.byte(kWithobject);
- context.ah = context.data.byte(kWithtype);
- context.cl = 'M';
- context.ch = 'E';
- context.dl = 'M';
- context.dh = 'B';
- compare(context);
- if (context.flags.z())
+ al = data.byte(kWithobject);
+ ah = data.byte(kWithtype);
+ cl = 'M';
+ ch = 'E';
+ dl = 'M';
+ dh = 'B';
+ compare();
+ if (flags.z())
goto openpool;
- context.cx = 300;
- context.al = 14;
- showpuztext(context);
- putbackobstuff(context);
+ cx = 300;
+ al = 14;
+ showpuztext();
+ putbackobstuff();
return;
openpool:
- context._cmp(context.data.byte(kTalkedtoattendant), 1);
- if (context.flags.z())
+ _cmp(data.byte(kTalkedtoattendant), 1);
+ if (flags.z())
goto canopenpool;
- showseconduse(context);
- putbackobstuff(context);
+ showseconduse();
+ putbackobstuff();
return;
canopenpool:
- context.al = 17;
- playchannel1(context);
- showfirstuse(context);
- context.data.byte(kCounttoopen) = 6;
- context.data.byte(kGetback) = 1;
+ al = 17;
+ playchannel1();
+ showfirstuse();
+ data.byte(kCounttoopen) = 6;
+ data.byte(kGetback) = 1;
}
-void uselighter(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kWithobject), 255);
- if (!context.flags.z())
+void DreamGenContext::uselighter() {
+ STACK_CHECK;
+ _cmp(data.byte(kWithobject), 255);
+ if (!flags.z())
goto gotlighterwith;
- withwhat(context);
+ withwhat();
return;
gotlighterwith:
- context.al = context.data.byte(kWithobject);
- context.ah = context.data.byte(kWithtype);
- context.cl = 'S';
- context.ch = 'M';
- context.dl = 'K';
- context.dh = 'E';
- compare(context);
- if (context.flags.z())
+ al = data.byte(kWithobject);
+ ah = data.byte(kWithtype);
+ cl = 'S';
+ ch = 'M';
+ dl = 'K';
+ dh = 'E';
+ compare();
+ if (flags.z())
goto cigarette;
- showfirstuse(context);
- putbackobstuff(context);
+ showfirstuse();
+ putbackobstuff();
return;
cigarette:
- context.cx = 300;
- context.al = 9;
- showpuztext(context);
- context.al = context.data.byte(kWithobject);
- getexad(context);
- context.es.byte(context.bx+2) = 255;
- context.data.byte(kGetback) = 1;
-}
-
-void showseconduse(Context &context) {
- STACK_CHECK(context);
- getobtextstart(context);
- nextcolon(context);
- nextcolon(context);
- nextcolon(context);
- usetext(context);
- context.cx = 400;
- hangonp(context);
-}
-
-void usecardreader1(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kWithobject), 255);
- if (!context.flags.z())
+ cx = 300;
+ al = 9;
+ showpuztext();
+ al = data.byte(kWithobject);
+ getexad();
+ es.byte(bx+2) = 255;
+ data.byte(kGetback) = 1;
+}
+
+void DreamGenContext::showseconduse() {
+ STACK_CHECK;
+ getobtextstart();
+ nextcolon();
+ nextcolon();
+ nextcolon();
+ usetext();
+ cx = 400;
+ hangonp();
+}
+
+void DreamGenContext::usecardreader1() {
+ STACK_CHECK;
+ _cmp(data.byte(kWithobject), 255);
+ if (!flags.z())
goto gotreader1with;
- withwhat(context);
+ withwhat();
return;
gotreader1with:
- context.al = context.data.byte(kWithobject);
- context.ah = context.data.byte(kWithtype);
- context.cl = 'C';
- context.ch = 'S';
- context.dl = 'H';
- context.dh = 'R';
- compare(context);
- if (context.flags.z())
+ al = data.byte(kWithobject);
+ ah = data.byte(kWithtype);
+ cl = 'C';
+ ch = 'S';
+ dl = 'H';
+ dh = 'R';
+ compare();
+ if (flags.z())
goto correctcard;
- context.cx = 300;
- context.al = 14;
- showpuztext(context);
- putbackobstuff(context);
+ cx = 300;
+ al = 14;
+ showpuztext();
+ putbackobstuff();
return;
correctcard:
- context._cmp(context.data.byte(kTalkedtosparky), 0);
- if (context.flags.z())
+ _cmp(data.byte(kTalkedtosparky), 0);
+ if (flags.z())
goto notyet;
- context._cmp(context.data.word(kCard1money), 0);
- if (context.flags.z())
+ _cmp(data.word(kCard1money), 0);
+ if (flags.z())
goto getscash;
- context.cx = 300;
- context.al = 17;
- showpuztext(context);
- putbackobstuff(context);
+ cx = 300;
+ al = 17;
+ showpuztext();
+ putbackobstuff();
return;
getscash:
- context.al = 16;
- playchannel1(context);
- context.cx = 300;
- context.al = 18;
- showpuztext(context);
- context._inc(context.data.byte(kProgresspoints));
- context.data.word(kCard1money) = 12432;
- context.data.byte(kGetback) = 1;
+ al = 16;
+ playchannel1();
+ cx = 300;
+ al = 18;
+ showpuztext();
+ _inc(data.byte(kProgresspoints));
+ data.word(kCard1money) = 12432;
+ data.byte(kGetback) = 1;
return;
notyet:
- showfirstuse(context);
- putbackobstuff(context);
+ showfirstuse();
+ putbackobstuff();
}
-void usecardreader2(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kWithobject), 255);
- if (!context.flags.z())
+void DreamGenContext::usecardreader2() {
+ STACK_CHECK;
+ _cmp(data.byte(kWithobject), 255);
+ if (!flags.z())
goto gotreader2with;
- withwhat(context);
+ withwhat();
return;
gotreader2with:
- context.al = context.data.byte(kWithobject);
- context.ah = context.data.byte(kWithtype);
- context.cl = 'C';
- context.ch = 'S';
- context.dl = 'H';
- context.dh = 'R';
- compare(context);
- if (context.flags.z())
+ al = data.byte(kWithobject);
+ ah = data.byte(kWithtype);
+ cl = 'C';
+ ch = 'S';
+ dl = 'H';
+ dh = 'R';
+ compare();
+ if (flags.z())
goto correctcard2;
- context.cx = 300;
- context.al = 14;
- showpuztext(context);
- putbackobstuff(context);
+ cx = 300;
+ al = 14;
+ showpuztext();
+ putbackobstuff();
return;
correctcard2:
- context._cmp(context.data.byte(kTalkedtoboss), 0);
- if (context.flags.z())
+ _cmp(data.byte(kTalkedtoboss), 0);
+ if (flags.z())
goto notyetboss;
- context._cmp(context.data.word(kCard1money), 0);
- if (context.flags.z())
+ _cmp(data.word(kCard1money), 0);
+ if (flags.z())
goto nocash;
- context._cmp(context.data.byte(kGunpassflag), 2);
- if (context.flags.z())
+ _cmp(data.byte(kGunpassflag), 2);
+ if (flags.z())
goto alreadygotnew;
- context.al = 18;
- playchannel1(context);
- context.cx = 300;
- context.al = 19;
- showpuztext(context);
- context.al = 94;
- placesetobject(context);
- context.data.byte(kGunpassflag) = 1;
- context._sub(context.data.word(kCard1money), 2000);
- context._inc(context.data.byte(kProgresspoints));
- context.data.byte(kGetback) = 1;
+ al = 18;
+ playchannel1();
+ cx = 300;
+ al = 19;
+ showpuztext();
+ al = 94;
+ placesetobject();
+ data.byte(kGunpassflag) = 1;
+ _sub(data.word(kCard1money), 2000);
+ _inc(data.byte(kProgresspoints));
+ data.byte(kGetback) = 1;
return;
nocash:
- context.cx = 300;
- context.al = 20;
- showpuztext(context);
- putbackobstuff(context);
+ cx = 300;
+ al = 20;
+ showpuztext();
+ putbackobstuff();
return;
alreadygotnew:
- context.cx = 300;
- context.al = 22;
- showpuztext(context);
- putbackobstuff(context);
+ cx = 300;
+ al = 22;
+ showpuztext();
+ putbackobstuff();
return;
notyetboss:
- showfirstuse(context);
- putbackobstuff(context);
+ showfirstuse();
+ putbackobstuff();
}
-void usecardreader3(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kWithobject), 255);
- if (!context.flags.z())
+void DreamGenContext::usecardreader3() {
+ STACK_CHECK;
+ _cmp(data.byte(kWithobject), 255);
+ if (!flags.z())
goto gotreader3with;
- withwhat(context);
+ withwhat();
return;
gotreader3with:
- context.al = context.data.byte(kWithobject);
- context.ah = context.data.byte(kWithtype);
- context.cl = 'C';
- context.ch = 'S';
- context.dl = 'H';
- context.dh = 'R';
- compare(context);
- if (context.flags.z())
+ al = data.byte(kWithobject);
+ ah = data.byte(kWithtype);
+ cl = 'C';
+ ch = 'S';
+ dl = 'H';
+ dh = 'R';
+ compare();
+ if (flags.z())
goto rightcard;
- context.cx = 300;
- context.al = 14;
- showpuztext(context);
- putbackobstuff(context);
+ cx = 300;
+ al = 14;
+ showpuztext();
+ putbackobstuff();
return;
rightcard:
- context._cmp(context.data.byte(kTalkedtorecep), 0);
- if (context.flags.z())
+ _cmp(data.byte(kTalkedtorecep), 0);
+ if (flags.z())
goto notyetrecep;
- context._cmp(context.data.byte(kCardpassflag), 0);
- if (!context.flags.z())
+ _cmp(data.byte(kCardpassflag), 0);
+ if (!flags.z())
goto alreadyusedit;
- context.al = 16;
- playchannel1(context);
- context.cx = 300;
- context.al = 25;
- showpuztext(context);
- context._inc(context.data.byte(kProgresspoints));
- context._sub(context.data.word(kCard1money), 8300);
- context.data.byte(kCardpassflag) = 1;
- context.data.byte(kGetback) = 1;
+ al = 16;
+ playchannel1();
+ cx = 300;
+ al = 25;
+ showpuztext();
+ _inc(data.byte(kProgresspoints));
+ _sub(data.word(kCard1money), 8300);
+ data.byte(kCardpassflag) = 1;
+ data.byte(kGetback) = 1;
return;
alreadyusedit:
- context.cx = 300;
- context.al = 26;
- showpuztext(context);
- putbackobstuff(context);
+ cx = 300;
+ al = 26;
+ showpuztext();
+ putbackobstuff();
return;
notyetrecep:
- showfirstuse(context);
- putbackobstuff(context);
-}
-
-void usecashcard(Context &context) {
- STACK_CHECK(context);
- getridofreels(context);
- loadkeypad(context);
- createpanel(context);
- showpanel(context);
- showexit(context);
- showman(context);
- context.di = 114;
- context.bx = 120;
- context.ds = context.data.word(kTempgraphics);
- context.al = 39;
- context.ah = 0;
- showframe(context);
- context.ax = context.data.word(kCard1money);
- moneypoke(context);
- getobtextstart(context);
- nextcolon(context);
- nextcolon(context);
- context.di = 36;
- context.bx = 98;
- context.dl = 241;
- context.al = 0;
- context.ah = 0;
- printdirect(context);
- context.di = 160;
- context.bx = 155;
- context.es = context.cs;
- context.si = 3474;
- context.data.word(kCharshift) = 91*2+75;
- context.al = 0;
- context.ah = 0;
- context.dl = 240;
- printdirect(context);
- context.di = 187;
- context.bx = 155;
- context.es = context.cs;
- context.si = 3479;
- context.data.word(kCharshift) = 91*2+85;
- context.al = 0;
- context.ah = 0;
- context.dl = 240;
- printdirect(context);
- context.data.word(kCharshift) = 0;
- worktoscreenm(context);
- context.cx = 400;
- hangonp(context);
- getridoftemp(context);
- restorereels(context);
- putbackobstuff(context);
-}
-
-void lookatcard(Context &context) {
- STACK_CHECK(context);
- context.data.byte(kManisoffscreen) = 1;
- getridofreels(context);
- loadkeypad(context);
- createpanel2(context);
- context.di = 160;
- context.bx = 80;
- context.ds = context.data.word(kTempgraphics);
- context.al = 42;
- context.ah = 128;
- showframe(context);
- getobtextstart(context);
- findnextcolon(context);
- findnextcolon(context);
- findnextcolon(context);
- context.di = 36;
- context.bx = 124;
- context.dl = 241;
- context.al = 0;
- context.ah = 0;
- printdirect(context);
- context.push(context.es);
- context.push(context.si);
- worktoscreenm(context);
- context.cx = 280;
- hangonw(context);
- createpanel2(context);
- context.di = 160;
- context.bx = 80;
- context.ds = context.data.word(kTempgraphics);
- context.al = 42;
- context.ah = 128;
- showframe(context);
- context.si = context.pop();
- context.es = context.pop();
- context.di = 36;
- context.bx = 130;
- context.dl = 241;
- context.al = 0;
- context.ah = 0;
- printdirect(context);
- worktoscreenm(context);
- context.cx = 200;
- hangonw(context);
- context.data.byte(kManisoffscreen) = 0;
- getridoftemp(context);
- restorereels(context);
- putbackobstuff(context);
-}
-
-void moneypoke(Context &context) {
- STACK_CHECK(context);
- context.bx = 3474;
- context.cl = 48-1;
+ showfirstuse();
+ putbackobstuff();
+}
+
+void DreamGenContext::usecashcard() {
+ STACK_CHECK;
+ getridofreels();
+ loadkeypad();
+ createpanel();
+ showpanel();
+ showexit();
+ showman();
+ di = 114;
+ bx = 120;
+ ds = data.word(kTempgraphics);
+ al = 39;
+ ah = 0;
+ showframe();
+ ax = data.word(kCard1money);
+ moneypoke();
+ getobtextstart();
+ nextcolon();
+ nextcolon();
+ di = 36;
+ bx = 98;
+ dl = 241;
+ al = 0;
+ ah = 0;
+ printdirect();
+ di = 160;
+ bx = 155;
+ es = cs;
+ si = 3474;
+ data.word(kCharshift) = 91*2+75;
+ al = 0;
+ ah = 0;
+ dl = 240;
+ printdirect();
+ di = 187;
+ bx = 155;
+ es = cs;
+ si = 3479;
+ data.word(kCharshift) = 91*2+85;
+ al = 0;
+ ah = 0;
+ dl = 240;
+ printdirect();
+ data.word(kCharshift) = 0;
+ worktoscreenm();
+ cx = 400;
+ hangonp();
+ getridoftemp();
+ restorereels();
+ putbackobstuff();
+}
+
+void DreamGenContext::lookatcard() {
+ STACK_CHECK;
+ data.byte(kManisoffscreen) = 1;
+ getridofreels();
+ loadkeypad();
+ createpanel2();
+ di = 160;
+ bx = 80;
+ ds = data.word(kTempgraphics);
+ al = 42;
+ ah = 128;
+ showframe();
+ getobtextstart();
+ findnextcolon();
+ findnextcolon();
+ findnextcolon();
+ di = 36;
+ bx = 124;
+ dl = 241;
+ al = 0;
+ ah = 0;
+ printdirect();
+ push(es);
+ push(si);
+ worktoscreenm();
+ cx = 280;
+ hangonw();
+ createpanel2();
+ di = 160;
+ bx = 80;
+ ds = data.word(kTempgraphics);
+ al = 42;
+ ah = 128;
+ showframe();
+ si = pop();
+ es = pop();
+ di = 36;
+ bx = 130;
+ dl = 241;
+ al = 0;
+ ah = 0;
+ printdirect();
+ worktoscreenm();
+ cx = 200;
+ hangonw();
+ data.byte(kManisoffscreen) = 0;
+ getridoftemp();
+ restorereels();
+ putbackobstuff();
+}
+
+void DreamGenContext::moneypoke() {
+ STACK_CHECK;
+ bx = 3474;
+ cl = 48-1;
numberpoke0:
- context._inc(context.cl);
- context._sub(context.ax, 10000);
- if (!context.flags.c())
+ _inc(cl);
+ _sub(ax, 10000);
+ if (!flags.c())
goto numberpoke0;
- context._add(context.ax, 10000);
- context.cs.byte(context.bx) = context.cl;
- context._inc(context.bx);
- context.cl = 48-1;
+ _add(ax, 10000);
+ cs.byte(bx) = cl;
+ _inc(bx);
+ cl = 48-1;
numberpoke1:
- context._inc(context.cl);
- context._sub(context.ax, 1000);
- if (!context.flags.c())
+ _inc(cl);
+ _sub(ax, 1000);
+ if (!flags.c())
goto numberpoke1;
- context._add(context.ax, 1000);
- context.cs.byte(context.bx) = context.cl;
- context._inc(context.bx);
- context.cl = 48-1;
+ _add(ax, 1000);
+ cs.byte(bx) = cl;
+ _inc(bx);
+ cl = 48-1;
numberpoke2:
- context._inc(context.cl);
- context._sub(context.ax, 100);
- if (!context.flags.c())
+ _inc(cl);
+ _sub(ax, 100);
+ if (!flags.c())
goto numberpoke2;
- context._add(context.ax, 100);
- context.cs.byte(context.bx) = context.cl;
- context._inc(context.bx);
- context.cl = 48-1;
+ _add(ax, 100);
+ cs.byte(bx) = cl;
+ _inc(bx);
+ cl = 48-1;
numberpoke3:
- context._inc(context.cl);
- context._sub(context.ax, 10);
- if (!context.flags.c())
+ _inc(cl);
+ _sub(ax, 10);
+ if (!flags.c())
goto numberpoke3;
- context._add(context.ax, 10);
- context.cs.byte(context.bx) = context.cl;
- context.bx = 3479;
- context._add(context.al, 48);
- context.cs.byte(context.bx) = context.al;
+ _add(ax, 10);
+ cs.byte(bx) = cl;
+ bx = 3479;
+ _add(al, 48);
+ cs.byte(bx) = al;
}
-void usecontrol(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kWithobject), 255);
- if (!context.flags.z())
+void DreamGenContext::usecontrol() {
+ STACK_CHECK;
+ _cmp(data.byte(kWithobject), 255);
+ if (!flags.z())
goto gotcontrolwith;
- withwhat(context);
+ withwhat();
return;
gotcontrolwith:
- context.al = context.data.byte(kWithobject);
- context.ah = context.data.byte(kWithtype);
- context.cl = 'K';
- context.ch = 'E';
- context.dl = 'Y';
- context.dh = 'A';
- compare(context);
- if (context.flags.z())
+ al = data.byte(kWithobject);
+ ah = data.byte(kWithtype);
+ cl = 'K';
+ ch = 'E';
+ dl = 'Y';
+ dh = 'A';
+ compare();
+ if (flags.z())
goto rightkey;
- context._cmp(context.data.byte(kReallocation), 21);
- if (!context.flags.z())
+ _cmp(data.byte(kReallocation), 21);
+ if (!flags.z())
goto balls;
- context.al = context.data.byte(kWithobject);
- context.ah = context.data.byte(kWithtype);
- context.cl = 'K';
- context.ch = 'N';
- context.dl = 'F';
- context.dh = 'E';
- compare(context);
- if (context.flags.z())
+ al = data.byte(kWithobject);
+ ah = data.byte(kWithtype);
+ cl = 'K';
+ ch = 'N';
+ dl = 'F';
+ dh = 'E';
+ compare();
+ if (flags.z())
goto jimmycontrols;
- context.al = context.data.byte(kWithobject);
- context.ah = context.data.byte(kWithtype);
- context.cl = 'A';
- context.ch = 'X';
- context.dl = 'E';
- context.dh = 'D';
- compare(context);
- if (context.flags.z())
+ al = data.byte(kWithobject);
+ ah = data.byte(kWithtype);
+ cl = 'A';
+ ch = 'X';
+ dl = 'E';
+ dh = 'D';
+ compare();
+ if (flags.z())
goto axeoncontrols;
balls:
- showfirstuse(context);
- putbackobstuff(context);
+ showfirstuse();
+ putbackobstuff();
return;
rightkey:
- context.al = 16;
- playchannel1(context);
- context._cmp(context.data.byte(kLocation), 21);
- if (context.flags.z())
+ al = 16;
+ playchannel1();
+ _cmp(data.byte(kLocation), 21);
+ if (flags.z())
goto goingdown;
- context.cx = 300;
- context.al = 0;
- showpuztext(context);
- context.data.byte(kNewlocation) = 21;
- context.data.byte(kCounttoclose) = 8;
- context.data.byte(kCounttoopen) = 0;
- context.data.word(kWatchingtime) = 80;
- context.data.byte(kGetback) = 1;
+ cx = 300;
+ al = 0;
+ showpuztext();
+ data.byte(kNewlocation) = 21;
+ data.byte(kCounttoclose) = 8;
+ data.byte(kCounttoopen) = 0;
+ data.word(kWatchingtime) = 80;
+ data.byte(kGetback) = 1;
return;
goingdown:
- context.cx = 300;
- context.al = 3;
- showpuztext(context);
- context.data.byte(kNewlocation) = 30;
- context.data.byte(kCounttoclose) = 8;
- context.data.byte(kCounttoopen) = 0;
- context.data.word(kWatchingtime) = 80;
- context.data.byte(kGetback) = 1;
+ cx = 300;
+ al = 3;
+ showpuztext();
+ data.byte(kNewlocation) = 30;
+ data.byte(kCounttoclose) = 8;
+ data.byte(kCounttoopen) = 0;
+ data.word(kWatchingtime) = 80;
+ data.byte(kGetback) = 1;
return;
jimmycontrols:
- context.al = 50;
- placesetobject(context);
- context.al = 51;
- placesetobject(context);
- context.al = 26;
- placesetobject(context);
- context.al = 30;
- placesetobject(context);
- context.al = 16;
- removesetobject(context);
- context.al = 17;
- removesetobject(context);
- context.al = 14;
- playchannel1(context);
- context.cx = 300;
- context.al = 10;
- showpuztext(context);
- context._inc(context.data.byte(kProgresspoints));
- context.data.byte(kGetback) = 1;
+ al = 50;
+ placesetobject();
+ al = 51;
+ placesetobject();
+ al = 26;
+ placesetobject();
+ al = 30;
+ placesetobject();
+ al = 16;
+ removesetobject();
+ al = 17;
+ removesetobject();
+ al = 14;
+ playchannel1();
+ cx = 300;
+ al = 10;
+ showpuztext();
+ _inc(data.byte(kProgresspoints));
+ data.byte(kGetback) = 1;
return;
axeoncontrols:
- context.cx = 300;
- context.al = 16;
- showpuztext(context);
- context._inc(context.data.byte(kProgresspoints));
- putbackobstuff(context);
+ cx = 300;
+ al = 16;
+ showpuztext();
+ _inc(data.byte(kProgresspoints));
+ putbackobstuff();
}
-void usehatch(Context &context) {
- STACK_CHECK(context);
- showfirstuse(context);
- context.data.byte(kNewlocation) = 40;
- context.data.byte(kGetback) = 1;
+void DreamGenContext::usehatch() {
+ STACK_CHECK;
+ showfirstuse();
+ data.byte(kNewlocation) = 40;
+ data.byte(kGetback) = 1;
}
-void usewire(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kWithobject), 255);
- if (!context.flags.z())
+void DreamGenContext::usewire() {
+ STACK_CHECK;
+ _cmp(data.byte(kWithobject), 255);
+ if (!flags.z())
goto gotwirewith;
- withwhat(context);
+ withwhat();
return;
gotwirewith:
- context.al = context.data.byte(kWithobject);
- context.ah = context.data.byte(kWithtype);
- context.cl = 'K';
- context.ch = 'N';
- context.dl = 'F';
- context.dh = 'E';
- compare(context);
- if (context.flags.z())
+ al = data.byte(kWithobject);
+ ah = data.byte(kWithtype);
+ cl = 'K';
+ ch = 'N';
+ dl = 'F';
+ dh = 'E';
+ compare();
+ if (flags.z())
goto wireknife;
- context.al = context.data.byte(kWithobject);
- context.ah = context.data.byte(kWithtype);
- context.cl = 'A';
- context.ch = 'X';
- context.dl = 'E';
- context.dh = 'D';
- compare(context);
- if (context.flags.z())
+ al = data.byte(kWithobject);
+ ah = data.byte(kWithtype);
+ cl = 'A';
+ ch = 'X';
+ dl = 'E';
+ dh = 'D';
+ compare();
+ if (flags.z())
goto wireaxe;
- context.cx = 300;
- context.al = 14;
- showpuztext(context);
- putbackobstuff(context);
+ cx = 300;
+ al = 14;
+ showpuztext();
+ putbackobstuff();
return;
wireaxe:
- context.cx = 300;
- context.al = 16;
- showpuztext(context);
- putbackobstuff(context);
+ cx = 300;
+ al = 16;
+ showpuztext();
+ putbackobstuff();
return;
wireknife:
- context.al = 51;
- removesetobject(context);
- context.al = 52;
- placesetobject(context);
- context.cx = 300;
- context.al = 11;
- showpuztext(context);
- context._inc(context.data.byte(kProgresspoints));
- context.data.byte(kGetback) = 1;
-}
-
-void usehandle(Context &context) {
- STACK_CHECK(context);
- context.al = 'C';
- context.ah = 'U';
- context.cl = 'T';
- context.ch = 'W';
- findsetobject(context);
- context.al = context.es.byte(context.bx+58);
- context._cmp(context.al, 255);
- if (!context.flags.z())
+ al = 51;
+ removesetobject();
+ al = 52;
+ placesetobject();
+ cx = 300;
+ al = 11;
+ showpuztext();
+ _inc(data.byte(kProgresspoints));
+ data.byte(kGetback) = 1;
+}
+
+void DreamGenContext::usehandle() {
+ STACK_CHECK;
+ al = 'C';
+ ah = 'U';
+ cl = 'T';
+ ch = 'W';
+ findsetobject();
+ al = es.byte(bx+58);
+ _cmp(al, 255);
+ if (!flags.z())
goto havecutwire;
- context.cx = 300;
- context.al = 12;
- showpuztext(context);
- context.data.byte(kGetback) = 1;
+ cx = 300;
+ al = 12;
+ showpuztext();
+ data.byte(kGetback) = 1;
return;
havecutwire:
- context.cx = 300;
- context.al = 13;
- showpuztext(context);
- context.data.byte(kNewlocation) = 22;
- context.data.byte(kGetback) = 1;
-}
-
-void useelevator1(Context &context) {
- STACK_CHECK(context);
- showfirstuse(context);
- selectlocation(context);
- context.data.byte(kGetback) = 1;
-}
-
-void showfirstuse(Context &context) {
- STACK_CHECK(context);
- getobtextstart(context);
- findnextcolon(context);
- findnextcolon(context);
- usetext(context);
- context.cx = 400;
- hangonp(context);
-}
-
-void useelevator3(Context &context) {
- STACK_CHECK(context);
- showfirstuse(context);
- context.data.byte(kCounttoclose) = 20;
- context.data.byte(kNewlocation) = 34;
- context.data.word(kReeltowatch) = 46;
- context.data.word(kEndwatchreel) = 63;
- context.data.byte(kWatchspeed) = 1;
- context.data.byte(kSpeedcount) = 1;
- context.data.word(kWatchingtime) = 80;
- context.data.byte(kGetback) = 1;
-}
-
-void useelevator4(Context &context) {
- STACK_CHECK(context);
- showfirstuse(context);
- context.data.word(kReeltowatch) = 0;
- context.data.word(kEndwatchreel) = 11;
- context.data.byte(kWatchspeed) = 1;
- context.data.byte(kSpeedcount) = 1;
- context.data.byte(kCounttoclose) = 20;
- context.data.word(kWatchingtime) = 80;
- context.data.byte(kGetback) = 1;
- context.data.byte(kNewlocation) = 24;
-}
-
-void useelevator2(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kLocation), 23);
- if (context.flags.z())
+ cx = 300;
+ al = 13;
+ showpuztext();
+ data.byte(kNewlocation) = 22;
+ data.byte(kGetback) = 1;
+}
+
+void DreamGenContext::useelevator1() {
+ STACK_CHECK;
+ showfirstuse();
+ selectlocation();
+ data.byte(kGetback) = 1;
+}
+
+void DreamGenContext::showfirstuse() {
+ STACK_CHECK;
+ getobtextstart();
+ findnextcolon();
+ findnextcolon();
+ usetext();
+ cx = 400;
+ hangonp();
+}
+
+void DreamGenContext::useelevator3() {
+ STACK_CHECK;
+ showfirstuse();
+ data.byte(kCounttoclose) = 20;
+ data.byte(kNewlocation) = 34;
+ data.word(kReeltowatch) = 46;
+ data.word(kEndwatchreel) = 63;
+ data.byte(kWatchspeed) = 1;
+ data.byte(kSpeedcount) = 1;
+ data.word(kWatchingtime) = 80;
+ data.byte(kGetback) = 1;
+}
+
+void DreamGenContext::useelevator4() {
+ STACK_CHECK;
+ showfirstuse();
+ data.word(kReeltowatch) = 0;
+ data.word(kEndwatchreel) = 11;
+ data.byte(kWatchspeed) = 1;
+ data.byte(kSpeedcount) = 1;
+ data.byte(kCounttoclose) = 20;
+ data.word(kWatchingtime) = 80;
+ data.byte(kGetback) = 1;
+ data.byte(kNewlocation) = 24;
+}
+
+void DreamGenContext::useelevator2() {
+ STACK_CHECK;
+ _cmp(data.byte(kLocation), 23);
+ if (flags.z())
goto inpoolhall;
- showfirstuse(context);
- context.data.byte(kNewlocation) = 23;
- context.data.byte(kCounttoclose) = 20;
- context.data.byte(kCounttoopen) = 0;
- context.data.word(kWatchingtime) = 80;
- context.data.byte(kGetback) = 1;
+ showfirstuse();
+ data.byte(kNewlocation) = 23;
+ data.byte(kCounttoclose) = 20;
+ data.byte(kCounttoopen) = 0;
+ data.word(kWatchingtime) = 80;
+ data.byte(kGetback) = 1;
return;
inpoolhall:
- showfirstuse(context);
- context.data.byte(kNewlocation) = 31;
- context.data.byte(kCounttoclose) = 20;
- context.data.byte(kCounttoopen) = 0;
- context.data.word(kWatchingtime) = 80;
- context.data.byte(kGetback) = 1;
-}
-
-void useelevator5(Context &context) {
- STACK_CHECK(context);
- context.al = 4;
- placesetobject(context);
- context.al = 0;
- removesetobject(context);
- context.data.byte(kNewlocation) = 20;
- context.data.word(kWatchingtime) = 80;
- context.data.byte(kLiftflag) = 1;
- context.data.byte(kCounttoclose) = 8;
- context.data.byte(kGetback) = 1;
-}
-
-void usekey(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kLocation), 5);
- if (context.flags.z())
+ showfirstuse();
+ data.byte(kNewlocation) = 31;
+ data.byte(kCounttoclose) = 20;
+ data.byte(kCounttoopen) = 0;
+ data.word(kWatchingtime) = 80;
+ data.byte(kGetback) = 1;
+}
+
+void DreamGenContext::useelevator5() {
+ STACK_CHECK;
+ al = 4;
+ placesetobject();
+ al = 0;
+ removesetobject();
+ data.byte(kNewlocation) = 20;
+ data.word(kWatchingtime) = 80;
+ data.byte(kLiftflag) = 1;
+ data.byte(kCounttoclose) = 8;
+ data.byte(kGetback) = 1;
+}
+
+void DreamGenContext::usekey() {
+ STACK_CHECK;
+ _cmp(data.byte(kLocation), 5);
+ if (flags.z())
goto usekey1;
- context._cmp(context.data.byte(kLocation), 30);
- if (context.flags.z())
+ _cmp(data.byte(kLocation), 30);
+ if (flags.z())
goto usekey1;
- context._cmp(context.data.byte(kLocation), 21);
- if (context.flags.z())
+ _cmp(data.byte(kLocation), 21);
+ if (flags.z())
goto usekey2;
- context.cx = 200;
- context.al = 1;
- showpuztext(context);
- putbackobstuff(context);
+ cx = 200;
+ al = 1;
+ showpuztext();
+ putbackobstuff();
return;
usekey1:
- context._cmp(context.data.byte(kMapx), 22);
- if (!context.flags.z())
+ _cmp(data.byte(kMapx), 22);
+ if (!flags.z())
goto wrongroom1;
- context._cmp(context.data.byte(kMapy), 10);
- if (!context.flags.z())
+ _cmp(data.byte(kMapy), 10);
+ if (!flags.z())
goto wrongroom1;
- context.cx = 300;
- context.al = 0;
- showpuztext(context);
- context.data.byte(kCounttoclose) = 100;
- context.data.byte(kGetback) = 1;
+ cx = 300;
+ al = 0;
+ showpuztext();
+ data.byte(kCounttoclose) = 100;
+ data.byte(kGetback) = 1;
return;
usekey2:
- context._cmp(context.data.byte(kMapx), 11);
- if (!context.flags.z())
+ _cmp(data.byte(kMapx), 11);
+ if (!flags.z())
goto wrongroom1;
- context._cmp(context.data.byte(kMapy), 10);
- if (!context.flags.z())
+ _cmp(data.byte(kMapy), 10);
+ if (!flags.z())
goto wrongroom1;
- context.cx = 300;
- context.al = 3;
- showpuztext(context);
- context.data.byte(kNewlocation) = 30;
- context.al = 2;
- fadescreendown(context);
- showfirstuse(context);
- putbackobstuff(context);
+ cx = 300;
+ al = 3;
+ showpuztext();
+ data.byte(kNewlocation) = 30;
+ al = 2;
+ fadescreendown();
+ showfirstuse();
+ putbackobstuff();
return;
wrongroom1:
- context.cx = 200;
- context.al = 2;
- showpuztext(context);
- putbackobstuff(context);
+ cx = 200;
+ al = 2;
+ showpuztext();
+ putbackobstuff();
}
-void usestereo(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kLocation), 0);
- if (context.flags.z())
+void DreamGenContext::usestereo() {
+ STACK_CHECK;
+ _cmp(data.byte(kLocation), 0);
+ if (flags.z())
goto stereook;
- context.cx = 400;
- context.al = 4;
- showpuztext(context);
- putbackobstuff(context);
+ cx = 400;
+ al = 4;
+ showpuztext();
+ putbackobstuff();
return;
stereook:
- context._cmp(context.data.byte(kMapx), 11);
- if (!context.flags.z())
+ _cmp(data.byte(kMapx), 11);
+ if (!flags.z())
goto stereonotok;
- context._cmp(context.data.byte(kMapy), 0);
- if (context.flags.z())
+ _cmp(data.byte(kMapy), 0);
+ if (flags.z())
goto stereook2;
stereonotok:
- context.cx = 400;
- context.al = 5;
- showpuztext(context);
- putbackobstuff(context);
+ cx = 400;
+ al = 5;
+ showpuztext();
+ putbackobstuff();
return;
stereook2:
- context.al = 'C';
- context.ah = 'D';
- context.cl = 'P';
- context.ch = 'L';
- findsetobject(context);
- context.ah = 1;
- checkinside(context);
- context._cmp(context.cl, (114));
- if (!context.flags.z())
+ al = 'C';
+ ah = 'D';
+ cl = 'P';
+ ch = 'L';
+ findsetobject();
+ ah = 1;
+ checkinside();
+ _cmp(cl, (114));
+ if (!flags.z())
goto cdinside;
- context.al = 6;
- context.cx = 400;
- showpuztext(context);
- putbackobstuff(context);
- getanyad(context);
- context.al = 255;
- context.es.byte(context.bx+10) = context.al;
+ al = 6;
+ cx = 400;
+ showpuztext();
+ putbackobstuff();
+ getanyad();
+ al = 255;
+ es.byte(bx+10) = al;
return;
cdinside:
- getanyad(context);
- context.al = context.es.byte(context.bx+10);
- context._xor(context.al, 1);
- context.es.byte(context.bx+10) = context.al;
- context._cmp(context.al, 255);
- if (context.flags.z())
+ getanyad();
+ al = es.byte(bx+10);
+ _xor(al, 1);
+ es.byte(bx+10) = al;
+ _cmp(al, 255);
+ if (flags.z())
goto stereoon;
- context.al = 7;
- context.cx = 400;
- showpuztext(context);
- putbackobstuff(context);
+ al = 7;
+ cx = 400;
+ showpuztext();
+ putbackobstuff();
return;
stereoon:
- context.al = 8;
- context.cx = 400;
- showpuztext(context);
- putbackobstuff(context);
-}
-
-void usecooker(Context &context) {
- STACK_CHECK(context);
- context.al = context.data.byte(kCommand);
- context.ah = context.data.byte(kObjecttype);
- checkinside(context);
- context._cmp(context.cl, (114));
- if (!context.flags.z())
+ al = 8;
+ cx = 400;
+ showpuztext();
+ putbackobstuff();
+}
+
+void DreamGenContext::usecooker() {
+ STACK_CHECK;
+ al = data.byte(kCommand);
+ ah = data.byte(kObjecttype);
+ checkinside();
+ _cmp(cl, (114));
+ if (!flags.z())
goto foodinside;
- showfirstuse(context);
- putbackobstuff(context);
+ showfirstuse();
+ putbackobstuff();
return;
foodinside:
- showseconduse(context);
- putbackobstuff(context);
+ showseconduse();
+ putbackobstuff();
}
-void useaxe(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kReallocation), 22);
- if (!context.flags.z())
+void DreamGenContext::useaxe() {
+ STACK_CHECK;
+ _cmp(data.byte(kReallocation), 22);
+ if (!flags.z())
goto notinpool;
- context._cmp(context.data.byte(kMapy), 10);
- if (context.flags.z())
+ _cmp(data.byte(kMapy), 10);
+ if (flags.z())
goto axeondoor;
- showseconduse(context);
- context._inc(context.data.byte(kProgresspoints));
- context.data.byte(kLastweapon) = 2;
- context.data.byte(kGetback) = 1;
- removeobfrominv(context);
+ showseconduse();
+ _inc(data.byte(kProgresspoints));
+ data.byte(kLastweapon) = 2;
+ data.byte(kGetback) = 1;
+ removeobfrominv();
return;
notinpool:
- showfirstuse(context);
-/*continuing to unbounded code: axeondoor from useelvdoor:19-29*/
+ showfirstuse();
+/*continuing to unbounded code: axeondoor from useelvdoor:19-30*/
axeondoor:
- context.al = 15;
- context.cx = 300;
- showpuztext(context);
- context._inc(context.data.byte(kProgresspoints));
- context.data.word(kWatchingtime) = 46*2;
- context.data.word(kReeltowatch) = 31;
- context.data.word(kEndwatchreel) = 77;
- context.data.byte(kWatchspeed) = 1;
- context.data.byte(kSpeedcount) = 1;
- context.data.byte(kGetback) = 1;
- return;
-}
-
-void useelvdoor(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kWithobject), 255);
- if (!context.flags.z())
+ al = 15;
+ cx = 300;
+ showpuztext();
+ _inc(data.byte(kProgresspoints));
+ data.word(kWatchingtime) = 46*2;
+ data.word(kReeltowatch) = 31;
+ data.word(kEndwatchreel) = 77;
+ data.byte(kWatchspeed) = 1;
+ data.byte(kSpeedcount) = 1;
+ data.byte(kGetback) = 1;
+}
+
+void DreamGenContext::useelvdoor() {
+ STACK_CHECK;
+ _cmp(data.byte(kWithobject), 255);
+ if (!flags.z())
goto gotdoorwith;
- withwhat(context);
+ withwhat();
return;
gotdoorwith:
- context.al = context.data.byte(kWithobject);
- context.ah = context.data.byte(kWithtype);
- context.cl = 'A';
- context.ch = 'X';
- context.dl = 'E';
- context.dh = 'D';
- compare(context);
- if (context.flags.z())
+ al = data.byte(kWithobject);
+ ah = data.byte(kWithtype);
+ cl = 'A';
+ ch = 'X';
+ dl = 'E';
+ dh = 'D';
+ compare();
+ if (flags.z())
goto axeondoor;
- context.al = 14;
- context.cx = 300;
- showpuztext(context);
- putbackobstuff(context);
+ al = 14;
+ cx = 300;
+ showpuztext();
+ putbackobstuff();
return;
axeondoor:
- context.al = 15;
- context.cx = 300;
- showpuztext(context);
- context._inc(context.data.byte(kProgresspoints));
- context.data.word(kWatchingtime) = 46*2;
- context.data.word(kReeltowatch) = 31;
- context.data.word(kEndwatchreel) = 77;
- context.data.byte(kWatchspeed) = 1;
- context.data.byte(kSpeedcount) = 1;
- context.data.byte(kGetback) = 1;
-}
-
-void withwhat(Context &context) {
- STACK_CHECK(context);
- createpanel(context);
- showpanel(context);
- showman(context);
- showexit(context);
- context.al = context.data.byte(kCommand);
- context.ah = context.data.byte(kObjecttype);
- context.es = context.cs;
- context.di = 5847;
- copyname(context);
- context.di = 100;
- context.bx = 21;
- context.dl = 200;
- context.al = 63;
- context.ah = 2;
- printmessage2(context);
- context.di = context.data.word(kLastxpos);
- context._add(context.di, 5);
- context.bx = 21;
- context.es = context.cs;
- context.si = 5847;
- context.dl = 220;
- context.al = 0;
- context.ah = 0;
- printdirect(context);
- context.di = context.data.word(kLastxpos);
- context._add(context.di, 5);
- context.bx = 21;
- context.dl = 200;
- context.al = 63;
- context.ah = 3;
- printmessage2(context);
- fillryan(context);
- context.data.byte(kCommandtype) = 255;
- readmouse(context);
- showpointer(context);
- worktoscreen(context);
- delpointer(context);
- context.data.byte(kInvopen) = 2;
-}
-
-void selectob(Context &context) {
- STACK_CHECK(context);
- findinvpos(context);
- context.ax = context.es.word(context.bx);
- context._cmp(context.al, 255);
- if (!context.flags.z())
+ al = 15;
+ cx = 300;
+ showpuztext();
+ _inc(data.byte(kProgresspoints));
+ data.word(kWatchingtime) = 46*2;
+ data.word(kReeltowatch) = 31;
+ data.word(kEndwatchreel) = 77;
+ data.byte(kWatchspeed) = 1;
+ data.byte(kSpeedcount) = 1;
+ data.byte(kGetback) = 1;
+}
+
+void DreamGenContext::withwhat() {
+ STACK_CHECK;
+ createpanel();
+ showpanel();
+ showman();
+ showexit();
+ al = data.byte(kCommand);
+ ah = data.byte(kObjecttype);
+ es = cs;
+ di = 5847;
+ copyname();
+ di = 100;
+ bx = 21;
+ dl = 200;
+ al = 63;
+ ah = 2;
+ printmessage2();
+ di = data.word(kLastxpos);
+ _add(di, 5);
+ bx = 21;
+ es = cs;
+ si = 5847;
+ dl = 220;
+ al = 0;
+ ah = 0;
+ printdirect();
+ di = data.word(kLastxpos);
+ _add(di, 5);
+ bx = 21;
+ dl = 200;
+ al = 63;
+ ah = 3;
+ printmessage2();
+ fillryan();
+ data.byte(kCommandtype) = 255;
+ readmouse();
+ showpointer();
+ worktoscreen();
+ delpointer();
+ data.byte(kInvopen) = 2;
+}
+
+void DreamGenContext::selectob() {
+ STACK_CHECK;
+ findinvpos();
+ ax = es.word(bx);
+ _cmp(al, 255);
+ if (!flags.z())
goto canselectob;
- blank(context);
+ blank();
return;
canselectob:
- context.data.byte(kWithobject) = context.al;
- context.data.byte(kWithtype) = context.ah;
- context._cmp(context.ax, context.data.word(kOldsubject));
- if (!context.flags.z())
+ data.byte(kWithobject) = al;
+ data.byte(kWithtype) = ah;
+ _cmp(ax, data.word(kOldsubject));
+ if (!flags.z())
goto diffsub3;
- context._cmp(context.data.byte(kCommandtype), 221);
- if (context.flags.z())
+ _cmp(data.byte(kCommandtype), 221);
+ if (flags.z())
goto alreadyselob;
- context.data.byte(kCommandtype) = 221;
+ data.byte(kCommandtype) = 221;
diffsub3:
- context.data.word(kOldsubject) = context.ax;
- context.bx = context.ax;
- context.al = 0;
- commandwithob(context);
+ data.word(kOldsubject) = ax;
+ bx = ax;
+ al = 0;
+ commandwithob();
alreadyselob:
- context.ax = context.data.word(kMousebutton);
- context._cmp(context.ax, context.data.word(kOldbutton));
- if (context.flags.z())
- goto notselob;
- context._and(context.ax, 1);
- if (!context.flags.z())
+ ax = data.word(kMousebutton);
+ _cmp(ax, data.word(kOldbutton));
+ if (flags.z())
+ return /* (notselob) */;
+ _and(ax, 1);
+ if (!flags.z())
goto doselob;
-notselob:
return;
doselob:
- delpointer(context);
- context.data.byte(kInvopen) = 0;
- useroutine(context);
-}
-
-void compare(Context &context) {
- STACK_CHECK(context);
- context._sub(context.dl, 'A');
- context._sub(context.dh, 'A');
- context._sub(context.cl, 'A');
- context._sub(context.ch, 'A');
- context.push(context.cx);
- context.push(context.dx);
- getanyaddir(context);
- context.dx = context.pop();
- context.cx = context.pop();
- context._cmp(context.es.word(context.bx+12), context.cx);
- if (!context.flags.z())
- goto comparefin;
- context._cmp(context.es.word(context.bx+14), context.dx);
-comparefin:
- return;
-}
-
-void findsetobject(Context &context) {
- STACK_CHECK(context);
- context._sub(context.al, 'A');
- context._sub(context.ah, 'A');
- context._sub(context.cl, 'A');
- context._sub(context.ch, 'A');
- context.es = context.data.word(kSetdat);
- context.bx = 0;
- context.dl = 0;
+ delpointer();
+ data.byte(kInvopen) = 0;
+ useroutine();
+}
+
+void DreamGenContext::compare() {
+ STACK_CHECK;
+ _sub(dl, 'A');
+ _sub(dh, 'A');
+ _sub(cl, 'A');
+ _sub(ch, 'A');
+ push(cx);
+ push(dx);
+ getanyaddir();
+ dx = pop();
+ cx = pop();
+ _cmp(es.word(bx+12), cx);
+ if (!flags.z())
+ return /* (comparefin) */;
+ _cmp(es.word(bx+14), dx);
+}
+
+void DreamGenContext::findsetobject() {
+ STACK_CHECK;
+ _sub(al, 'A');
+ _sub(ah, 'A');
+ _sub(cl, 'A');
+ _sub(ch, 'A');
+ es = data.word(kSetdat);
+ bx = 0;
+ dl = 0;
findsetloop:
- context._cmp(context.al, context.es.byte(context.bx+12));
- if (!context.flags.z())
+ _cmp(al, es.byte(bx+12));
+ if (!flags.z())
goto nofind;
- context._cmp(context.ah, context.es.byte(context.bx+13));
- if (!context.flags.z())
+ _cmp(ah, es.byte(bx+13));
+ if (!flags.z())
goto nofind;
- context._cmp(context.cl, context.es.byte(context.bx+14));
- if (!context.flags.z())
+ _cmp(cl, es.byte(bx+14));
+ if (!flags.z())
goto nofind;
- context._cmp(context.ch, context.es.byte(context.bx+15));
- if (!context.flags.z())
+ _cmp(ch, es.byte(bx+15));
+ if (!flags.z())
goto nofind;
- context.al = context.dl;
+ al = dl;
return;
nofind:
- context._add(context.bx, 64);
- context._inc(context.dl);
- context._cmp(context.dl, 128);
- if (!context.flags.z())
+ _add(bx, 64);
+ _inc(dl);
+ _cmp(dl, 128);
+ if (!flags.z())
goto findsetloop;
- context.al = context.dl;
-}
-
-void findexobject(Context &context) {
- STACK_CHECK(context);
- context._sub(context.al, 'A');
- context._sub(context.ah, 'A');
- context._sub(context.cl, 'A');
- context._sub(context.ch, 'A');
- context.es = context.data.word(kExtras);
- context.bx = (0+2080+30000);
- context.dl = 0;
+ al = dl;
+}
+
+void DreamGenContext::findexobject() {
+ STACK_CHECK;
+ _sub(al, 'A');
+ _sub(ah, 'A');
+ _sub(cl, 'A');
+ _sub(ch, 'A');
+ es = data.word(kExtras);
+ bx = (0+2080+30000);
+ dl = 0;
findexloop:
- context._cmp(context.al, context.es.byte(context.bx+12));
- if (!context.flags.z())
+ _cmp(al, es.byte(bx+12));
+ if (!flags.z())
goto nofindex;
- context._cmp(context.ah, context.es.byte(context.bx+13));
- if (!context.flags.z())
+ _cmp(ah, es.byte(bx+13));
+ if (!flags.z())
goto nofindex;
- context._cmp(context.cl, context.es.byte(context.bx+14));
- if (!context.flags.z())
+ _cmp(cl, es.byte(bx+14));
+ if (!flags.z())
goto nofindex;
- context._cmp(context.ch, context.es.byte(context.bx+15));
- if (!context.flags.z())
+ _cmp(ch, es.byte(bx+15));
+ if (!flags.z())
goto nofindex;
- context.al = context.dl;
+ al = dl;
return;
nofindex:
- context._add(context.bx, 16);
- context._inc(context.dl);
- context._cmp(context.dl, (114));
- if (!context.flags.z())
+ _add(bx, 16);
+ _inc(dl);
+ _cmp(dl, (114));
+ if (!flags.z())
goto findexloop;
- context.al = context.dl;
-}
-
-void isryanholding(Context &context) {
- STACK_CHECK(context);
- context._sub(context.al, 'A');
- context._sub(context.ah, 'A');
- context._sub(context.cl, 'A');
- context._sub(context.ch, 'A');
- context.es = context.data.word(kExtras);
- context.bx = (0+2080+30000);
- context.dl = 0;
+ al = dl;
+}
+
+void DreamGenContext::isryanholding() {
+ STACK_CHECK;
+ _sub(al, 'A');
+ _sub(ah, 'A');
+ _sub(cl, 'A');
+ _sub(ch, 'A');
+ es = data.word(kExtras);
+ bx = (0+2080+30000);
+ dl = 0;
searchinv:
- context._cmp(context.es.byte(context.bx+2), 4);
- if (!context.flags.z())
+ _cmp(es.byte(bx+2), 4);
+ if (!flags.z())
goto nofindininv;
- context._cmp(context.al, context.es.byte(context.bx+12));
- if (!context.flags.z())
+ _cmp(al, es.byte(bx+12));
+ if (!flags.z())
goto nofindininv;
- context._cmp(context.ah, context.es.byte(context.bx+13));
- if (!context.flags.z())
+ _cmp(ah, es.byte(bx+13));
+ if (!flags.z())
goto nofindininv;
- context._cmp(context.cl, context.es.byte(context.bx+14));
- if (!context.flags.z())
+ _cmp(cl, es.byte(bx+14));
+ if (!flags.z())
goto nofindininv;
- context._cmp(context.ch, context.es.byte(context.bx+15));
- if (!context.flags.z())
+ _cmp(ch, es.byte(bx+15));
+ if (!flags.z())
goto nofindininv;
- context.al = context.dl;
- context._cmp(context.al, (114));
+ al = dl;
+ _cmp(al, (114));
return;
nofindininv:
- context._add(context.bx, 16);
- context._inc(context.dl);
- context._cmp(context.dl, (114));
- if (!context.flags.z())
+ _add(bx, 16);
+ _inc(dl);
+ _cmp(dl, (114));
+ if (!flags.z())
goto searchinv;
- context.al = context.dl;
- context._cmp(context.al, (114));
+ al = dl;
+ _cmp(al, (114));
}
-void checkinside(Context &context) {
- STACK_CHECK(context);
- context.es = context.data.word(kExtras);
- context.bx = (0+2080+30000);
- context.cl = 0;
+void DreamGenContext::checkinside() {
+ STACK_CHECK;
+ es = data.word(kExtras);
+ bx = (0+2080+30000);
+ cl = 0;
insideloop:
- context._cmp(context.al, context.es.byte(context.bx+3));
- if (!context.flags.z())
+ _cmp(al, es.byte(bx+3));
+ if (!flags.z())
goto notfoundinside;
- context._cmp(context.ah, context.es.byte(context.bx+2));
- if (!context.flags.z())
+ _cmp(ah, es.byte(bx+2));
+ if (!flags.z())
goto notfoundinside;
return;
notfoundinside:
- context._add(context.bx, 16);
- context._inc(context.cl);
- context._cmp(context.cl, (114));
- if (!context.flags.z())
+ _add(bx, 16);
+ _inc(cl);
+ _cmp(cl, (114));
+ if (!flags.z())
goto insideloop;
}
-void usetext(Context &context) {
- STACK_CHECK(context);
- context.push(context.es);
- context.push(context.si);
- createpanel(context);
- showpanel(context);
- showman(context);
- showexit(context);
- obicons(context);
- context.si = context.pop();
- context.es = context.pop();
- context.di = 36;
- context.bx = 104;
- context.dl = 241;
- context.al = 0;
- context.ah = 0;
- printdirect(context);
- worktoscreenm(context);
-}
-
-void putbackobstuff(Context &context) {
- STACK_CHECK(context);
- createpanel(context);
- showpanel(context);
- showman(context);
- obicons(context);
- showexit(context);
- obpicture(context);
- describeob(context);
- undertextline(context);
- context.data.byte(kCommandtype) = 255;
- readmouse(context);
- showpointer(context);
- worktoscreen(context);
- delpointer(context);
-}
-
-void showpuztext(Context &context) {
- STACK_CHECK(context);
- context.push(context.cx);
- findpuztext(context);
- context.push(context.es);
- context.push(context.si);
- createpanel(context);
- showpanel(context);
- showman(context);
- showexit(context);
- obicons(context);
- context.si = context.pop();
- context.es = context.pop();
- context.di = 36;
- context.bx = 104;
- context.dl = 241;
- context.ah = 0;
- printdirect(context);
- worktoscreenm(context);
- context.cx = context.pop();
- hangonp(context);
-}
-
-void findpuztext(Context &context) {
- STACK_CHECK(context);
- context.ah = 0;
- context.si = context.ax;
- context._add(context.si, context.si);
- context.es = context.data.word(kPuzzletext);
- context.ax = context.es.word(context.si);
- context._add(context.ax, (66*2));
- context.si = context.ax;
-}
-
-void placesetobject(Context &context) {
- STACK_CHECK(context);
- context.push(context.es);
- context.push(context.bx);
- context.cl = 0;
- context.ch = 0;
- findormake(context);
- getsetad(context);
- context.es.byte(context.bx+58) = 0;
- context.bx = context.pop();
- context.es = context.pop();
-}
-
-void removesetobject(Context &context) {
- STACK_CHECK(context);
- context.push(context.es);
- context.push(context.bx);
- context.cl = 255;
- context.ch = 0;
- findormake(context);
- getsetad(context);
- context.es.byte(context.bx+58) = 255;
- context.bx = context.pop();
- context.es = context.pop();
-}
-
-void issetobonmap(Context &context) {
- STACK_CHECK(context);
- context.push(context.es);
- context.push(context.bx);
- getsetad(context);
- context.al = context.es.byte(context.bx+58);
- context.bx = context.pop();
- context.es = context.pop();
- context._cmp(context.al, 0);
-}
-
-void placefreeobject(Context &context) {
- STACK_CHECK(context);
- context.push(context.es);
- context.push(context.bx);
- context.cl = 0;
- context.ch = 1;
- findormake(context);
- getfreead(context);
- context.es.byte(context.bx+2) = 0;
- context.bx = context.pop();
- context.es = context.pop();
-}
-
-void removefreeobject(Context &context) {
- STACK_CHECK(context);
- context.push(context.es);
- context.push(context.bx);
- getfreead(context);
- context.es.byte(context.bx+2) = 255;
- context.bx = context.pop();
- context.es = context.pop();
-}
-
-void findormake(Context &context) {
- STACK_CHECK(context);
- context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80));
- context.push(context.ax);
- context.es = context.data.word(kBuffers);
- context.ah = context.data.byte(kReallocation);
+void DreamGenContext::usetext() {
+ STACK_CHECK;
+ push(es);
+ push(si);
+ createpanel();
+ showpanel();
+ showman();
+ showexit();
+ obicons();
+ si = pop();
+ es = pop();
+ di = 36;
+ bx = 104;
+ dl = 241;
+ al = 0;
+ ah = 0;
+ printdirect();
+ worktoscreenm();
+}
+
+void DreamGenContext::putbackobstuff() {
+ STACK_CHECK;
+ createpanel();
+ showpanel();
+ showman();
+ obicons();
+ showexit();
+ obpicture();
+ describeob();
+ undertextline();
+ data.byte(kCommandtype) = 255;
+ readmouse();
+ showpointer();
+ worktoscreen();
+ delpointer();
+}
+
+void DreamGenContext::showpuztext() {
+ STACK_CHECK;
+ push(cx);
+ findpuztext();
+ push(es);
+ push(si);
+ createpanel();
+ showpanel();
+ showman();
+ showexit();
+ obicons();
+ si = pop();
+ es = pop();
+ di = 36;
+ bx = 104;
+ dl = 241;
+ ah = 0;
+ printdirect();
+ worktoscreenm();
+ cx = pop();
+ hangonp();
+}
+
+void DreamGenContext::findpuztext() {
+ STACK_CHECK;
+ ah = 0;
+ si = ax;
+ _add(si, si);
+ es = data.word(kPuzzletext);
+ ax = es.word(si);
+ _add(ax, (66*2));
+ si = ax;
+}
+
+void DreamGenContext::placesetobject() {
+ STACK_CHECK;
+ push(es);
+ push(bx);
+ cl = 0;
+ ch = 0;
+ findormake();
+ getsetad();
+ es.byte(bx+58) = 0;
+ bx = pop();
+ es = pop();
+}
+
+void DreamGenContext::removesetobject() {
+ STACK_CHECK;
+ push(es);
+ push(bx);
+ cl = 255;
+ ch = 0;
+ findormake();
+ getsetad();
+ es.byte(bx+58) = 255;
+ bx = pop();
+ es = pop();
+}
+
+void DreamGenContext::issetobonmap() {
+ STACK_CHECK;
+ push(es);
+ push(bx);
+ getsetad();
+ al = es.byte(bx+58);
+ bx = pop();
+ es = pop();
+ _cmp(al, 0);
+}
+
+void DreamGenContext::placefreeobject() {
+ STACK_CHECK;
+ push(es);
+ push(bx);
+ cl = 0;
+ ch = 1;
+ findormake();
+ getfreead();
+ es.byte(bx+2) = 0;
+ bx = pop();
+ es = pop();
+}
+
+void DreamGenContext::removefreeobject() {
+ STACK_CHECK;
+ push(es);
+ push(bx);
+ getfreead();
+ es.byte(bx+2) = 255;
+ bx = pop();
+ es = pop();
+}
+
+void DreamGenContext::findormake() {
+ STACK_CHECK;
+ bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80));
+ push(ax);
+ es = data.word(kBuffers);
+ ah = data.byte(kReallocation);
changeloop:
- context._cmp(context.es.byte(context.bx), 255);
- if (context.flags.z())
+ _cmp(es.byte(bx), 255);
+ if (flags.z())
goto haventfound;
- context._cmp(context.ax, context.es.word(context.bx));
- if (!context.flags.z())
+ _cmp(ax, es.word(bx));
+ if (!flags.z())
goto nofoundchange;
- context._cmp(context.ch, context.es.byte(context.bx+3));
- if (context.flags.z())
+ _cmp(ch, es.byte(bx+3));
+ if (flags.z())
goto foundchange;
nofoundchange:
- context._add(context.bx, 4);
+ _add(bx, 4);
goto changeloop;
foundchange:
- context.ax = context.pop();
- context.es.byte(context.bx+2) = context.cl;
+ ax = pop();
+ es.byte(bx+2) = cl;
return;
haventfound:
- context.es.word(context.bx) = context.ax;
- context.es.word(context.bx+2) = context.cx;
- context.ax = context.pop();
+ es.word(bx) = ax;
+ es.word(bx+2) = cx;
+ ax = pop();
}
-void switchryanon(Context &context) {
- STACK_CHECK(context);
- context.data.byte(kRyanon) = 255;
+void DreamGenContext::switchryanon() {
+ STACK_CHECK;
+ data.byte(kRyanon) = 255;
}
-void switchryanoff(Context &context) {
- STACK_CHECK(context);
- context.data.byte(kRyanon) = 1;
+void DreamGenContext::switchryanoff() {
+ STACK_CHECK;
+ data.byte(kRyanon) = 1;
}
-void setallchanges(Context &context) {
- STACK_CHECK(context);
- context.es = context.data.word(kBuffers);
- context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80));
+void DreamGenContext::setallchanges() {
+ STACK_CHECK;
+ es = data.word(kBuffers);
+ bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80));
setallloop:
- context.ax = context.es.word(context.bx);
- context._cmp(context.al, 255);
- if (context.flags.z())
- goto endsetloop;
- context.cx = context.es.word(context.bx+2);
- context._add(context.bx, 4);
- context._cmp(context.ah, context.data.byte(kReallocation));
- if (!context.flags.z())
+ ax = es.word(bx);
+ _cmp(al, 255);
+ if (flags.z())
+ return /* (endsetloop) */;
+ cx = es.word(bx+2);
+ _add(bx, 4);
+ _cmp(ah, data.byte(kReallocation));
+ if (!flags.z())
goto setallloop;
- context.push(context.es);
- context.push(context.bx);
- dochange(context);
- context.bx = context.pop();
- context.es = context.pop();
+ push(es);
+ push(bx);
+ dochange();
+ bx = pop();
+ es = pop();
goto setallloop;
-endsetloop:
- return;
}
-void dochange(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.ch, 0);
- if (context.flags.z())
+void DreamGenContext::dochange() {
+ STACK_CHECK;
+ _cmp(ch, 0);
+ if (flags.z())
goto object;
- context._cmp(context.ch, 1);
- if (context.flags.z())
+ _cmp(ch, 1);
+ if (flags.z())
goto freeobject;
- context.push(context.cx);
- context.ah = 0;
- context._add(context.ax, context.ax);
- context._add(context.ax, context.ax);
- context._add(context.ax, context.ax);
- context.push(context.ax);
- context.al = context.ch;
- context._sub(context.al, 100);
- context.ah = 0;
- context.cx = 144;
- context._mul(context.cx);
- context.bx = context.pop();
- context._add(context.bx, context.ax);
- context._add(context.bx, (0));
- context.es = context.data.word(kReels);
- context.cx = context.pop();
- context.es.byte(context.bx+6) = context.cl;
+ push(cx);
+ ah = 0;
+ _add(ax, ax);
+ _add(ax, ax);
+ _add(ax, ax);
+ push(ax);
+ al = ch;
+ _sub(al, 100);
+ ah = 0;
+ cx = 144;
+ _mul(cx);
+ bx = pop();
+ _add(bx, ax);
+ _add(bx, (0));
+ es = data.word(kReels);
+ cx = pop();
+ es.byte(bx+6) = cl;
return;
object:
- context.push(context.cx);
- getsetad(context);
- context.cx = context.pop();
- context.es.byte(context.bx+58) = context.cl;
+ push(cx);
+ getsetad();
+ cx = pop();
+ es.byte(bx+58) = cl;
return;
freeobject:
- context.push(context.cx);
- getfreead(context);
- context.cx = context.pop();
- context._cmp(context.es.byte(context.bx+2), 255);
- if (!context.flags.z())
- goto beenpickedup;
- context.es.byte(context.bx+2) = context.cl;
-beenpickedup:
- return;
-}
-
-void autoappear(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kLocation), 32);
- if (!context.flags.z())
+ push(cx);
+ getfreead();
+ cx = pop();
+ _cmp(es.byte(bx+2), 255);
+ if (!flags.z())
+ return /* (beenpickedup) */;
+ es.byte(bx+2) = cl;
+}
+
+void DreamGenContext::autoappear() {
+ STACK_CHECK;
+ _cmp(data.byte(kLocation), 32);
+ if (!flags.z())
goto notinalley;
- context.al = 5;
- resetlocation(context);
- context.al = 10;
- setlocation(context);
- context.data.byte(kDestpos) = 10;
+ al = 5;
+ resetlocation();
+ al = 10;
+ setlocation();
+ data.byte(kDestpos) = 10;
return;
notinalley:
- context._cmp(context.data.byte(kReallocation), 24);
- if (!context.flags.z())
+ _cmp(data.byte(kReallocation), 24);
+ if (!flags.z())
goto notinedens;
- context._cmp(context.data.byte(kGeneraldead), 1);
- if (!context.flags.z())
+ _cmp(data.byte(kGeneraldead), 1);
+ if (!flags.z())
goto edenspart2;
- context._inc(context.data.byte(kGeneraldead));
- context.al = 44;
- placesetobject(context);
- context.al = 18;
- placesetobject(context);
- context.al = 93;
- placesetobject(context);
- context.al = 92;
- removesetobject(context);
- context.al = 55;
- removesetobject(context);
- context.al = 75;
- removesetobject(context);
- context.al = 84;
- removesetobject(context);
- context.al = 85;
- removesetobject(context);
+ _inc(data.byte(kGeneraldead));
+ al = 44;
+ placesetobject();
+ al = 18;
+ placesetobject();
+ al = 93;
+ placesetobject();
+ al = 92;
+ removesetobject();
+ al = 55;
+ removesetobject();
+ al = 75;
+ removesetobject();
+ al = 84;
+ removesetobject();
+ al = 85;
+ removesetobject();
return;
edenspart2:
- context._cmp(context.data.byte(kSartaindead), 1);
- if (!context.flags.z())
- goto notedens2;
- context.al = 44;
- removesetobject(context);
- context.al = 93;
- removesetobject(context);
- context.al = 55;
- placesetobject(context);
- context._inc(context.data.byte(kSartaindead));
-notedens2:
+ _cmp(data.byte(kSartaindead), 1);
+ if (!flags.z())
+ return /* (notedens2) */;
+ al = 44;
+ removesetobject();
+ al = 93;
+ removesetobject();
+ al = 55;
+ placesetobject();
+ _inc(data.byte(kSartaindead));
return;
notinedens:
- context._cmp(context.data.byte(kReallocation), 25);
- if (!context.flags.z())
+ _cmp(data.byte(kReallocation), 25);
+ if (!flags.z())
goto notonsartroof;
- context.data.byte(kNewsitem) = 3;
- context.al = 6;
- resetlocation(context);
- context.al = 11;
- setlocation(context);
- context.data.byte(kDestpos) = 11;
+ data.byte(kNewsitem) = 3;
+ al = 6;
+ resetlocation();
+ al = 11;
+ setlocation();
+ data.byte(kDestpos) = 11;
return;
notonsartroof:
- context._cmp(context.data.byte(kReallocation), 2);
- if (!context.flags.z())
- goto notinlouiss;
- context._cmp(context.data.byte(kRockstardead), 0);
- if (context.flags.z())
- goto notinlouiss;
- context.al = 23;
- placesetobject(context);
-notinlouiss:
- return;
-}
-
-void getundertimed(Context &context) {
- STACK_CHECK(context);
- context.al = context.data.byte(kTimedy);
- context.ah = 0;
- context.bx = context.ax;
- context.al = context.data.byte(kTimedx);
- context.ah = 0;
- context.di = context.ax;
- context.ch = (24);
- context.cl = 240;
- context.ds = context.data.word(kBuffers);
- context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4));
- multiget(context);
-}
-
-void putundertimed(Context &context) {
- STACK_CHECK(context);
- context.al = context.data.byte(kTimedy);
- context.ah = 0;
- context.bx = context.ax;
- context.al = context.data.byte(kTimedx);
- context.ah = 0;
- context.di = context.ax;
- context.ch = (24);
- context.cl = 240;
- context.ds = context.data.word(kBuffers);
- context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4));
- multiput(context);
-}
-
-void dumptimedtext(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kNeedtodumptimed), 1);
- if (!context.flags.z())
- goto nodumptimed;
- context.al = context.data.byte(kTimedy);
- context.ah = 0;
- context.bx = context.ax;
- context.al = context.data.byte(kTimedx);
- context.ah = 0;
- context.di = context.ax;
- context.cl = 240;
- context.ch = (24);
- multidump(context);
- context.data.byte(kNeedtodumptimed) = 0;
-nodumptimed:
- return;
-}
-
-void setuptimeduse(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.word(kTimecount), 0);
- if (!context.flags.z())
- goto cantsetup;
- context.data.byte(kTimedy) = context.bh;
- context.data.byte(kTimedx) = context.bl;
- context.data.word(kCounttotimed) = context.cx;
- context._add(context.dx, context.cx);
- context.data.word(kTimecount) = context.dx;
- context.bl = context.al;
- context.bh = 0;
- context._add(context.bx, context.bx);
- context.es = context.data.word(kPuzzletext);
- context.cx = (66*2);
- context.ax = context.es.word(context.bx);
- context._add(context.ax, context.cx);
- context.bx = context.ax;
- context.data.word(kTimedseg) = context.es;
- context.data.word(kTimedoffset) = context.bx;
-cantsetup:
- return;
-}
-
-void setuptimedtemp(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.ah, 0);
- if (context.flags.z())
+ _cmp(data.byte(kReallocation), 2);
+ if (!flags.z())
+ return /* (notinlouiss) */;
+ _cmp(data.byte(kRockstardead), 0);
+ if (flags.z())
+ return /* (notinlouiss) */;
+ al = 23;
+ placesetobject();
+}
+
+void DreamGenContext::getundertimed() {
+ STACK_CHECK;
+ al = data.byte(kTimedy);
+ ah = 0;
+ bx = ax;
+ al = data.byte(kTimedx);
+ ah = 0;
+ di = ax;
+ ch = (24);
+ cl = 240;
+ ds = data.word(kBuffers);
+ si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4));
+ multiget();
+}
+
+void DreamGenContext::putundertimed() {
+ STACK_CHECK;
+ al = data.byte(kTimedy);
+ ah = 0;
+ bx = ax;
+ al = data.byte(kTimedx);
+ ah = 0;
+ di = ax;
+ ch = (24);
+ cl = 240;
+ ds = data.word(kBuffers);
+ si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4));
+ multiput();
+}
+
+void DreamGenContext::dumptimedtext() {
+ STACK_CHECK;
+ _cmp(data.byte(kNeedtodumptimed), 1);
+ if (!flags.z())
+ return /* (nodumptimed) */;
+ al = data.byte(kTimedy);
+ ah = 0;
+ bx = ax;
+ al = data.byte(kTimedx);
+ ah = 0;
+ di = ax;
+ cl = 240;
+ ch = (24);
+ multidump();
+ data.byte(kNeedtodumptimed) = 0;
+}
+
+void DreamGenContext::setuptimeduse() {
+ STACK_CHECK;
+ _cmp(data.word(kTimecount), 0);
+ if (!flags.z())
+ return /* (cantsetup) */;
+ data.byte(kTimedy) = bh;
+ data.byte(kTimedx) = bl;
+ data.word(kCounttotimed) = cx;
+ _add(dx, cx);
+ data.word(kTimecount) = dx;
+ bl = al;
+ bh = 0;
+ _add(bx, bx);
+ es = data.word(kPuzzletext);
+ cx = (66*2);
+ ax = es.word(bx);
+ _add(ax, cx);
+ bx = ax;
+ data.word(kTimedseg) = es;
+ data.word(kTimedoffset) = bx;
+}
+
+void DreamGenContext::setuptimedtemp() {
+ STACK_CHECK;
+ _cmp(ah, 0);
+ if (flags.z())
goto notloadspeech3;
- context.dl = 'T';
- context.dh = context.ah;
- context.cl = 'T';
- context.ah = 0;
- loadspeech(context);
- context._cmp(context.data.byte(kSpeechloaded), 1);
- if (!context.flags.z())
+ dl = 'T';
+ dh = ah;
+ cl = 'T';
+ ah = 0;
+ loadspeech();
+ _cmp(data.byte(kSpeechloaded), 1);
+ if (!flags.z())
goto notloadspeech3;
- context.al = 50+12;
- playchannel1(context);
+ al = 50+12;
+ playchannel1();
return;
notloadspeech3:
- context._cmp(context.data.word(kTimecount), 0);
- if (!context.flags.z())
- goto cantsetup2;
- context.data.byte(kTimedy) = context.bh;
- context.data.byte(kTimedx) = context.bl;
- context.data.word(kCounttotimed) = context.cx;
- context._add(context.dx, context.cx);
- context.data.word(kTimecount) = context.dx;
- context.bl = context.al;
- context.bh = 0;
- context._add(context.bx, context.bx);
- context.es = context.data.word(kTextfile1);
- context.cx = (66*2);
- context.ax = context.es.word(context.bx);
- context._add(context.ax, context.cx);
- context.bx = context.ax;
- context.data.word(kTimedseg) = context.es;
- context.data.word(kTimedoffset) = context.bx;
-cantsetup2:
- return;
-}
-
-void usetimedtext(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.word(kTimecount), 0);
- if (context.flags.z())
- goto notext;
- context._dec(context.data.word(kTimecount));
- context._cmp(context.data.word(kTimecount), 0);
- if (context.flags.z())
+ _cmp(data.word(kTimecount), 0);
+ if (!flags.z())
+ return /* (cantsetup2) */;
+ data.byte(kTimedy) = bh;
+ data.byte(kTimedx) = bl;
+ data.word(kCounttotimed) = cx;
+ _add(dx, cx);
+ data.word(kTimecount) = dx;
+ bl = al;
+ bh = 0;
+ _add(bx, bx);
+ es = data.word(kTextfile1);
+ cx = (66*2);
+ ax = es.word(bx);
+ _add(ax, cx);
+ bx = ax;
+ data.word(kTimedseg) = es;
+ data.word(kTimedoffset) = bx;
+}
+
+void DreamGenContext::usetimedtext() {
+ STACK_CHECK;
+ _cmp(data.word(kTimecount), 0);
+ if (flags.z())
+ return /* (notext) */;
+ _dec(data.word(kTimecount));
+ _cmp(data.word(kTimecount), 0);
+ if (flags.z())
goto deltimedtext;
- context.ax = context.data.word(kTimecount);
- context._cmp(context.ax, context.data.word(kCounttotimed));
- if (context.flags.z())
+ ax = data.word(kTimecount);
+ _cmp(ax, data.word(kCounttotimed));
+ if (flags.z())
goto firsttimed;
- if (!context.flags.c())
- goto notext;
+ if (!flags.c())
+ return /* (notext) */;
goto notfirsttimed;
firsttimed:
- getundertimed(context);
+ getundertimed();
notfirsttimed:
- context.bl = context.data.byte(kTimedy);
- context.bh = 0;
- context.al = context.data.byte(kTimedx);
- context.ah = 0;
- context.di = context.ax;
- context.es = context.data.word(kTimedseg);
- context.si = context.data.word(kTimedoffset);
- context.dl = 237;
- context.ah = 0;
- printdirect(context);
- context.data.byte(kNeedtodumptimed) = 1;
-notext:
+ bl = data.byte(kTimedy);
+ bh = 0;
+ al = data.byte(kTimedx);
+ ah = 0;
+ di = ax;
+ es = data.word(kTimedseg);
+ si = data.word(kTimedoffset);
+ dl = 237;
+ ah = 0;
+ printdirect();
+ data.byte(kNeedtodumptimed) = 1;
return;
deltimedtext:
- putundertimed(context);
- context.data.byte(kNeedtodumptimed) = 1;
-}
-
-void edenscdplayer(Context &context) {
- STACK_CHECK(context);
- showfirstuse(context);
- context.data.word(kWatchingtime) = 18*2;
- context.data.word(kReeltowatch) = 25;
- context.data.word(kEndwatchreel) = 42;
- context.data.byte(kWatchspeed) = 1;
- context.data.byte(kSpeedcount) = 1;
- context.data.byte(kGetback) = 1;
-}
-
-void usewall(Context &context) {
- STACK_CHECK(context);
- showfirstuse(context);
- context._cmp(context.data.byte(kManspath), 3);
- if (context.flags.z())
+ putundertimed();
+ data.byte(kNeedtodumptimed) = 1;
+}
+
+void DreamGenContext::edenscdplayer() {
+ STACK_CHECK;
+ showfirstuse();
+ data.word(kWatchingtime) = 18*2;
+ data.word(kReeltowatch) = 25;
+ data.word(kEndwatchreel) = 42;
+ data.byte(kWatchspeed) = 1;
+ data.byte(kSpeedcount) = 1;
+ data.byte(kGetback) = 1;
+}
+
+void DreamGenContext::usewall() {
+ STACK_CHECK;
+ showfirstuse();
+ _cmp(data.byte(kManspath), 3);
+ if (flags.z())
goto gobackover;
- context.data.word(kWatchingtime) = 30*2;
- context.data.word(kReeltowatch) = 2;
- context.data.word(kEndwatchreel) = 31;
- context.data.byte(kWatchspeed) = 1;
- context.data.byte(kSpeedcount) = 1;
- context.data.byte(kGetback) = 1;
- context.al = 3;
- turnpathon(context);
- context.al = 4;
- turnpathon(context);
- context.al = 0;
- turnpathoff(context);
- context.al = 1;
- turnpathoff(context);
- context.al = 2;
- turnpathoff(context);
- context.al = 5;
- turnpathoff(context);
- context.data.byte(kManspath) = 3;
- context.data.byte(kFinaldest) = 3;
- findxyfrompath(context);
- context.data.byte(kResetmanxy) = 1;
- switchryanoff(context);
+ data.word(kWatchingtime) = 30*2;
+ data.word(kReeltowatch) = 2;
+ data.word(kEndwatchreel) = 31;
+ data.byte(kWatchspeed) = 1;
+ data.byte(kSpeedcount) = 1;
+ data.byte(kGetback) = 1;
+ al = 3;
+ turnpathon();
+ al = 4;
+ turnpathon();
+ al = 0;
+ turnpathoff();
+ al = 1;
+ turnpathoff();
+ al = 2;
+ turnpathoff();
+ al = 5;
+ turnpathoff();
+ data.byte(kManspath) = 3;
+ data.byte(kFinaldest) = 3;
+ findxyfrompath();
+ data.byte(kResetmanxy) = 1;
+ switchryanoff();
return;
gobackover:
- context.data.word(kWatchingtime) = 30*2;
- context.data.word(kReeltowatch) = 34;
- context.data.word(kEndwatchreel) = 60;
- context.data.byte(kWatchspeed) = 1;
- context.data.byte(kSpeedcount) = 1;
- context.data.byte(kGetback) = 1;
- context.al = 3;
- turnpathoff(context);
- context.al = 4;
- turnpathoff(context);
- context.al = 0;
- turnpathon(context);
- context.al = 1;
- turnpathon(context);
- context.al = 2;
- turnpathon(context);
- context.al = 5;
- turnpathon(context);
- context.data.byte(kManspath) = 5;
- context.data.byte(kFinaldest) = 5;
- findxyfrompath(context);
- context.data.byte(kResetmanxy) = 1;
- switchryanoff(context);
-}
-
-void usechurchgate(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kWithobject), 255);
- if (!context.flags.z())
+ data.word(kWatchingtime) = 30*2;
+ data.word(kReeltowatch) = 34;
+ data.word(kEndwatchreel) = 60;
+ data.byte(kWatchspeed) = 1;
+ data.byte(kSpeedcount) = 1;
+ data.byte(kGetback) = 1;
+ al = 3;
+ turnpathoff();
+ al = 4;
+ turnpathoff();
+ al = 0;
+ turnpathon();
+ al = 1;
+ turnpathon();
+ al = 2;
+ turnpathon();
+ al = 5;
+ turnpathon();
+ data.byte(kManspath) = 5;
+ data.byte(kFinaldest) = 5;
+ findxyfrompath();
+ data.byte(kResetmanxy) = 1;
+ switchryanoff();
+}
+
+void DreamGenContext::usechurchgate() {
+ STACK_CHECK;
+ _cmp(data.byte(kWithobject), 255);
+ if (!flags.z())
goto gatewith;
- withwhat(context);
+ withwhat();
return;
gatewith:
- context.al = context.data.byte(kWithobject);
- context.ah = context.data.byte(kWithtype);
- context.cl = 'C';
- context.ch = 'U';
- context.dl = 'T';
- context.dh = 'T';
- compare(context);
- if (context.flags.z())
+ al = data.byte(kWithobject);
+ ah = data.byte(kWithtype);
+ cl = 'C';
+ ch = 'U';
+ dl = 'T';
+ dh = 'T';
+ compare();
+ if (flags.z())
goto cutgate;
- context.cx = 300;
- context.al = 14;
- showpuztext(context);
- putbackobstuff(context);
+ cx = 300;
+ al = 14;
+ showpuztext();
+ putbackobstuff();
return;
cutgate:
- showfirstuse(context);
- context.data.word(kWatchingtime) = 64*2;
- context.data.word(kReeltowatch) = 4;
- context.data.word(kEndwatchreel) = 70;
- context.data.byte(kWatchspeed) = 1;
- context.data.byte(kSpeedcount) = 1;
- context.data.byte(kGetback) = 1;
- context._inc(context.data.byte(kProgresspoints));
- context.al = 3;
- turnpathon(context);
- context._cmp(context.data.byte(kAidedead), 0);
- if (context.flags.z())
- goto notopenchurch;
- context.al = 2;
- turnpathon(context);
-notopenchurch:
- return;
-}
-
-void usegun(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kObjecttype), 4);
- if (context.flags.z())
+ showfirstuse();
+ data.word(kWatchingtime) = 64*2;
+ data.word(kReeltowatch) = 4;
+ data.word(kEndwatchreel) = 70;
+ data.byte(kWatchspeed) = 1;
+ data.byte(kSpeedcount) = 1;
+ data.byte(kGetback) = 1;
+ _inc(data.byte(kProgresspoints));
+ al = 3;
+ turnpathon();
+ _cmp(data.byte(kAidedead), 0);
+ if (flags.z())
+ return /* (notopenchurch) */;
+ al = 2;
+ turnpathon();
+}
+
+void DreamGenContext::usegun() {
+ STACK_CHECK;
+ _cmp(data.byte(kObjecttype), 4);
+ if (flags.z())
goto istakengun;
- showseconduse(context);
- putbackobstuff(context);
+ showseconduse();
+ putbackobstuff();
return;
istakengun:
- context._cmp(context.data.byte(kReallocation), 22);
- if (!context.flags.z())
+ _cmp(data.byte(kReallocation), 22);
+ if (!flags.z())
goto notinpoolroom;
- context.cx = 300;
- context.al = 34;
- showpuztext(context);
- context.data.byte(kLastweapon) = 1;
- context.data.byte(kCombatcount) = 39;
- context.data.byte(kGetback) = 1;
- context._inc(context.data.byte(kProgresspoints));
+ cx = 300;
+ al = 34;
+ showpuztext();
+ data.byte(kLastweapon) = 1;
+ data.byte(kCombatcount) = 39;
+ data.byte(kGetback) = 1;
+ _inc(data.byte(kProgresspoints));
return;
notinpoolroom:
- context._cmp(context.data.byte(kReallocation), 25);
- if (!context.flags.z())
+ _cmp(data.byte(kReallocation), 25);
+ if (!flags.z())
goto nothelicopter;
- context.cx = 300;
- context.al = 34;
- showpuztext(context);
- context.data.byte(kLastweapon) = 1;
- context.data.byte(kCombatcount) = 19;
- context.data.byte(kGetback) = 1;
- context.data.byte(kDreamnumber) = 2;
- context.data.byte(kRoomafterdream) = 38;
- context.data.byte(kSartaindead) = 1;
- context._inc(context.data.byte(kProgresspoints));
+ cx = 300;
+ al = 34;
+ showpuztext();
+ data.byte(kLastweapon) = 1;
+ data.byte(kCombatcount) = 19;
+ data.byte(kGetback) = 1;
+ data.byte(kDreamnumber) = 2;
+ data.byte(kRoomafterdream) = 38;
+ data.byte(kSartaindead) = 1;
+ _inc(data.byte(kProgresspoints));
return;
nothelicopter:
- context._cmp(context.data.byte(kReallocation), 27);
- if (!context.flags.z())
+ _cmp(data.byte(kReallocation), 27);
+ if (!flags.z())
goto notinrockroom;
- context.cx = 300;
- context.al = 46;
- showpuztext(context);
- context.data.byte(kPointermode) = 2;
- context.data.byte(kRockstardead) = 1;
- context.data.byte(kLastweapon) = 1;
- context.data.byte(kNewsitem) = 1;
- context.data.byte(kGetback) = 1;
- context.data.byte(kRoomafterdream) = 32;
- context.data.byte(kDreamnumber) = 0;
- context._inc(context.data.byte(kProgresspoints));
+ cx = 300;
+ al = 46;
+ showpuztext();
+ data.byte(kPointermode) = 2;
+ data.byte(kRockstardead) = 1;
+ data.byte(kLastweapon) = 1;
+ data.byte(kNewsitem) = 1;
+ data.byte(kGetback) = 1;
+ data.byte(kRoomafterdream) = 32;
+ data.byte(kDreamnumber) = 0;
+ _inc(data.byte(kProgresspoints));
return;
notinrockroom:
- context._cmp(context.data.byte(kReallocation), 8);
- if (!context.flags.z())
+ _cmp(data.byte(kReallocation), 8);
+ if (!flags.z())
goto notbystudio;
- context._cmp(context.data.byte(kMapx), 22);
- if (!context.flags.z())
+ _cmp(data.byte(kMapx), 22);
+ if (!flags.z())
goto notbystudio;
- context._cmp(context.data.byte(kMapy), 40);
- if (!context.flags.z())
+ _cmp(data.byte(kMapy), 40);
+ if (!flags.z())
goto notbystudio;
- context.al = 92;
- issetobonmap(context);
- if (context.flags.z())
+ al = 92;
+ issetobonmap();
+ if (flags.z())
goto notbystudio;
- context._cmp(context.data.byte(kManspath), 9);
- if (context.flags.z())
+ _cmp(data.byte(kManspath), 9);
+ if (flags.z())
goto notbystudio;
- context.data.byte(kDestination) = 9;
- context.data.byte(kFinaldest) = 9;
- autosetwalk(context);
- context.data.byte(kLastweapon) = 1;
- context.data.byte(kGetback) = 1;
- context._inc(context.data.byte(kProgresspoints));
+ data.byte(kDestination) = 9;
+ data.byte(kFinaldest) = 9;
+ autosetwalk();
+ data.byte(kLastweapon) = 1;
+ data.byte(kGetback) = 1;
+ _inc(data.byte(kProgresspoints));
return;
notbystudio:
- context._cmp(context.data.byte(kReallocation), 6);
- if (!context.flags.z())
+ _cmp(data.byte(kReallocation), 6);
+ if (!flags.z())
goto notsarters;
- context._cmp(context.data.byte(kMapx), 11);
- if (!context.flags.z())
+ _cmp(data.byte(kMapx), 11);
+ if (!flags.z())
goto notsarters;
- context._cmp(context.data.byte(kMapy), 20);
- if (!context.flags.z())
+ _cmp(data.byte(kMapy), 20);
+ if (!flags.z())
goto notsarters;
- context.al = 5;
- issetobonmap(context);
- if (!context.flags.z())
+ al = 5;
+ issetobonmap();
+ if (!flags.z())
goto notsarters;
- context.data.byte(kDestination) = 1;
- context.data.byte(kFinaldest) = 1;
- autosetwalk(context);
- context.al = 5;
- removesetobject(context);
- context.al = 6;
- placesetobject(context);
- context.al = 1;
- context.ah = context.data.byte(kRoomnum);
- context._dec(context.ah);
- turnanypathon(context);
- context.data.byte(kLiftflag) = 1;
- context.data.word(kWatchingtime) = 40*2;
- context.data.word(kReeltowatch) = 4;
- context.data.word(kEndwatchreel) = 43;
- context.data.byte(kWatchspeed) = 1;
- context.data.byte(kSpeedcount) = 1;
- context.data.byte(kGetback) = 1;
- context._inc(context.data.byte(kProgresspoints));
+ data.byte(kDestination) = 1;
+ data.byte(kFinaldest) = 1;
+ autosetwalk();
+ al = 5;
+ removesetobject();
+ al = 6;
+ placesetobject();
+ al = 1;
+ ah = data.byte(kRoomnum);
+ _dec(ah);
+ turnanypathon();
+ data.byte(kLiftflag) = 1;
+ data.word(kWatchingtime) = 40*2;
+ data.word(kReeltowatch) = 4;
+ data.word(kEndwatchreel) = 43;
+ data.byte(kWatchspeed) = 1;
+ data.byte(kSpeedcount) = 1;
+ data.byte(kGetback) = 1;
+ _inc(data.byte(kProgresspoints));
return;
notsarters:
- context._cmp(context.data.byte(kReallocation), 29);
- if (!context.flags.z())
+ _cmp(data.byte(kReallocation), 29);
+ if (!flags.z())
goto notaide;
- context.data.byte(kGetback) = 1;
- context.al = 13;
- resetlocation(context);
- context.al = 12;
- setlocation(context);
- context.data.byte(kDestpos) = 12;
- context.data.byte(kDestination) = 2;
- context.data.byte(kFinaldest) = 2;
- autosetwalk(context);
- context.data.word(kWatchingtime) = 164*2;
- context.data.word(kReeltowatch) = 3;
- context.data.word(kEndwatchreel) = 164;
- context.data.byte(kWatchspeed) = 1;
- context.data.byte(kSpeedcount) = 1;
- context.data.byte(kAidedead) = 1;
- context.data.byte(kDreamnumber) = 3;
- context.data.byte(kRoomafterdream) = 33;
- context._inc(context.data.byte(kProgresspoints));
+ data.byte(kGetback) = 1;
+ al = 13;
+ resetlocation();
+ al = 12;
+ setlocation();
+ data.byte(kDestpos) = 12;
+ data.byte(kDestination) = 2;
+ data.byte(kFinaldest) = 2;
+ autosetwalk();
+ data.word(kWatchingtime) = 164*2;
+ data.word(kReeltowatch) = 3;
+ data.word(kEndwatchreel) = 164;
+ data.byte(kWatchspeed) = 1;
+ data.byte(kSpeedcount) = 1;
+ data.byte(kAidedead) = 1;
+ data.byte(kDreamnumber) = 3;
+ data.byte(kRoomafterdream) = 33;
+ _inc(data.byte(kProgresspoints));
return;
notaide:
- context._cmp(context.data.byte(kReallocation), 23);
- if (!context.flags.z())
+ _cmp(data.byte(kReallocation), 23);
+ if (!flags.z())
goto notwithboss;
- context._cmp(context.data.byte(kMapx), 0);
- if (!context.flags.z())
+ _cmp(data.byte(kMapx), 0);
+ if (!flags.z())
goto notwithboss;
- context._cmp(context.data.byte(kMapy), 50);
- if (!context.flags.z())
+ _cmp(data.byte(kMapy), 50);
+ if (!flags.z())
goto notwithboss;
- context._cmp(context.data.byte(kManspath), 5);
- if (context.flags.z())
+ _cmp(data.byte(kManspath), 5);
+ if (flags.z())
goto pathokboss;
- context.data.byte(kDestination) = 5;
- context.data.byte(kFinaldest) = 5;
- autosetwalk(context);
+ data.byte(kDestination) = 5;
+ data.byte(kFinaldest) = 5;
+ autosetwalk();
pathokboss:
- context.data.byte(kLastweapon) = 1;
- context.data.byte(kGetback) = 1;
+ data.byte(kLastweapon) = 1;
+ data.byte(kGetback) = 1;
return;
notwithboss:
- context._cmp(context.data.byte(kReallocation), 8);
- if (!context.flags.z())
+ _cmp(data.byte(kReallocation), 8);
+ if (!flags.z())
goto nottvsoldier;
- context._cmp(context.data.byte(kMapx), 11);
- if (!context.flags.z())
+ _cmp(data.byte(kMapx), 11);
+ if (!flags.z())
goto nottvsoldier;
- context._cmp(context.data.byte(kMapy), 10);
- if (!context.flags.z())
+ _cmp(data.byte(kMapy), 10);
+ if (!flags.z())
goto nottvsoldier;
- context._cmp(context.data.byte(kManspath), 2);
- if (context.flags.z())
+ _cmp(data.byte(kManspath), 2);
+ if (flags.z())
goto pathoktv;
- context.data.byte(kDestination) = 2;
- context.data.byte(kFinaldest) = 2;
- autosetwalk(context);
+ data.byte(kDestination) = 2;
+ data.byte(kFinaldest) = 2;
+ autosetwalk();
pathoktv:
- context.data.byte(kLastweapon) = 1;
- context.data.byte(kGetback) = 1;
+ data.byte(kLastweapon) = 1;
+ data.byte(kGetback) = 1;
return;
nottvsoldier:
- showfirstuse(context);
- putbackobstuff(context);
+ showfirstuse();
+ putbackobstuff();
}
-void useshield(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kReallocation), 20);
- if (!context.flags.z())
+void DreamGenContext::useshield() {
+ STACK_CHECK;
+ _cmp(data.byte(kReallocation), 20);
+ if (!flags.z())
goto notinsartroom;
- context._cmp(context.data.byte(kCombatcount), 0);
- if (context.flags.z())
+ _cmp(data.byte(kCombatcount), 0);
+ if (flags.z())
goto notinsartroom;
- context.data.byte(kLastweapon) = 3;
- showseconduse(context);
- context.data.byte(kGetback) = 1;
- context._inc(context.data.byte(kProgresspoints));
- removeobfrominv(context);
+ data.byte(kLastweapon) = 3;
+ showseconduse();
+ data.byte(kGetback) = 1;
+ _inc(data.byte(kProgresspoints));
+ removeobfrominv();
return;
notinsartroom:
- showfirstuse(context);
- putbackobstuff(context);
+ showfirstuse();
+ putbackobstuff();
}
-void usebuttona(Context &context) {
- STACK_CHECK(context);
- context.al = 95;
- issetobonmap(context);
- if (context.flags.z())
+void DreamGenContext::usebuttona() {
+ STACK_CHECK;
+ al = 95;
+ issetobonmap();
+ if (flags.z())
goto donethisbit;
- showfirstuse(context);
- context.al = 0;
- context.ah = context.data.byte(kRoomnum);
- context._dec(context.ah);
- turnanypathon(context);
- context.al = 9;
- removesetobject(context);
- context.al = 95;
- placesetobject(context);
- context.data.word(kWatchingtime) = 15*2;
- context.data.word(kReeltowatch) = 71;
- context.data.word(kEndwatchreel) = 85;
- context.data.byte(kWatchspeed) = 1;
- context.data.byte(kSpeedcount) = 1;
- context.data.byte(kGetback) = 1;
- context._inc(context.data.byte(kProgresspoints));
+ showfirstuse();
+ al = 0;
+ ah = data.byte(kRoomnum);
+ _dec(ah);
+ turnanypathon();
+ al = 9;
+ removesetobject();
+ al = 95;
+ placesetobject();
+ data.word(kWatchingtime) = 15*2;
+ data.word(kReeltowatch) = 71;
+ data.word(kEndwatchreel) = 85;
+ data.byte(kWatchspeed) = 1;
+ data.byte(kSpeedcount) = 1;
+ data.byte(kGetback) = 1;
+ _inc(data.byte(kProgresspoints));
return;
donethisbit:
- showseconduse(context);
- putbackobstuff(context);
+ showseconduse();
+ putbackobstuff();
}
-void useplate(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kWithobject), 255);
- if (!context.flags.z())
+void DreamGenContext::useplate() {
+ STACK_CHECK;
+ _cmp(data.byte(kWithobject), 255);
+ if (!flags.z())
goto platewith;
- withwhat(context);
+ withwhat();
return;
platewith:
- context.al = context.data.byte(kWithobject);
- context.ah = context.data.byte(kWithtype);
- context.cl = 'S';
- context.ch = 'C';
- context.dl = 'R';
- context.dh = 'W';
- compare(context);
- if (context.flags.z())
+ al = data.byte(kWithobject);
+ ah = data.byte(kWithtype);
+ cl = 'S';
+ ch = 'C';
+ dl = 'R';
+ dh = 'W';
+ compare();
+ if (flags.z())
goto unscrewplate;
- context.al = context.data.byte(kWithobject);
- context.ah = context.data.byte(kWithtype);
- context.cl = 'K';
- context.ch = 'N';
- context.dl = 'F';
- context.dh = 'E';
- compare(context);
- if (context.flags.z())
+ al = data.byte(kWithobject);
+ ah = data.byte(kWithtype);
+ cl = 'K';
+ ch = 'N';
+ dl = 'F';
+ dh = 'E';
+ compare();
+ if (flags.z())
goto triedknife;
- context.cx = 300;
- context.al = 14;
- showpuztext(context);
- putbackobstuff(context);
+ cx = 300;
+ al = 14;
+ showpuztext();
+ putbackobstuff();
return;
unscrewplate:
- context.al = 20;
- playchannel1(context);
- showfirstuse(context);
- context.al = 28;
- placesetobject(context);
- context.al = 24;
- placesetobject(context);
- context.al = 25;
- removesetobject(context);
- context.al = 0;
- placefreeobject(context);
- context._inc(context.data.byte(kProgresspoints));
- context.data.byte(kGetback) = 1;
+ al = 20;
+ playchannel1();
+ showfirstuse();
+ al = 28;
+ placesetobject();
+ al = 24;
+ placesetobject();
+ al = 25;
+ removesetobject();
+ al = 0;
+ placefreeobject();
+ _inc(data.byte(kProgresspoints));
+ data.byte(kGetback) = 1;
return;
triedknife:
- context.cx = 300;
- context.al = 54;
- showpuztext(context);
- putbackobstuff(context);
-}
-
-void usewinch(Context &context) {
- STACK_CHECK(context);
- context.al = 40;
- context.ah = 1;
- checkinside(context);
- context._cmp(context.cl, (114));
- if (context.flags.z())
+ cx = 300;
+ al = 54;
+ showpuztext();
+ putbackobstuff();
+}
+
+void DreamGenContext::usewinch() {
+ STACK_CHECK;
+ al = 40;
+ ah = 1;
+ checkinside();
+ _cmp(cl, (114));
+ if (flags.z())
goto nowinch;
- context.al = context.cl;
- context.ah = 4;
- context.cl = 'F';
- context.ch = 'U';
- context.dl = 'S';
- context.dh = 'E';
- compare(context);
- if (!context.flags.z())
+ al = cl;
+ ah = 4;
+ cl = 'F';
+ ch = 'U';
+ dl = 'S';
+ dh = 'E';
+ compare();
+ if (!flags.z())
goto nowinch;
- context.data.word(kWatchingtime) = 217*2;
- context.data.word(kReeltowatch) = 0;
- context.data.word(kEndwatchreel) = 217;
- context.data.byte(kWatchspeed) = 1;
- context.data.byte(kSpeedcount) = 1;
- context.data.byte(kDestpos) = 1;
- context.data.byte(kNewlocation) = 45;
- context.data.byte(kDreamnumber) = 1;
- context.data.byte(kRoomafterdream) = 44;
- context.data.byte(kGeneraldead) = 1;
- context.data.byte(kNewsitem) = 2;
- context.data.byte(kGetback) = 1;
- context._inc(context.data.byte(kProgresspoints));
+ data.word(kWatchingtime) = 217*2;
+ data.word(kReeltowatch) = 0;
+ data.word(kEndwatchreel) = 217;
+ data.byte(kWatchspeed) = 1;
+ data.byte(kSpeedcount) = 1;
+ data.byte(kDestpos) = 1;
+ data.byte(kNewlocation) = 45;
+ data.byte(kDreamnumber) = 1;
+ data.byte(kRoomafterdream) = 44;
+ data.byte(kGeneraldead) = 1;
+ data.byte(kNewsitem) = 2;
+ data.byte(kGetback) = 1;
+ _inc(data.byte(kProgresspoints));
return;
nowinch:
- showfirstuse(context);
- putbackobstuff(context);
-}
-
-void entercode(Context &context) {
- STACK_CHECK(context);
- context.data.word(kKeypadax) = context.ax;
- context.data.word(kKeypadcx) = context.cx;
- getridofreels(context);
- loadkeypad(context);
- createpanel(context);
- showicon(context);
- showouterpad(context);
- showkeypad(context);
- readmouse(context);
- showpointer(context);
- worktoscreen(context);
- delpointer(context);
- context.data.word(kPresspointer) = 0;
- context.data.byte(kGetback) = 0;
+ showfirstuse();
+ putbackobstuff();
+}
+
+void DreamGenContext::entercode() {
+ STACK_CHECK;
+ data.word(kKeypadax) = ax;
+ data.word(kKeypadcx) = cx;
+ getridofreels();
+ loadkeypad();
+ createpanel();
+ showicon();
+ showouterpad();
+ showkeypad();
+ readmouse();
+ showpointer();
+ worktoscreen();
+ delpointer();
+ data.word(kPresspointer) = 0;
+ data.byte(kGetback) = 0;
keypadloop:
- delpointer(context);
- readmouse(context);
- showkeypad(context);
- showpointer(context);
- context._cmp(context.data.byte(kPresscount), 0);
- if (context.flags.z())
+ delpointer();
+ readmouse();
+ showkeypad();
+ showpointer();
+ _cmp(data.byte(kPresscount), 0);
+ if (flags.z())
goto nopresses;
- context._dec(context.data.byte(kPresscount));
+ _dec(data.byte(kPresscount));
goto afterpress;
nopresses:
- context.data.byte(kPressed) = 255;
- context.data.byte(kGraphicpress) = 255;
- vsync(context);
+ data.byte(kPressed) = 255;
+ data.byte(kGraphicpress) = 255;
+ vsync();
afterpress:
- dumppointer(context);
- dumpkeypad(context);
- dumptextline(context);
- context.bx = 3482;
- checkcoords(context);
- context._cmp(context.data.byte(kGetback), 1);
- if (context.flags.z())
+ dumppointer();
+ dumpkeypad();
+ dumptextline();
+ bx = 3482;
+ checkcoords();
+ _cmp(data.byte(kGetback), 1);
+ if (flags.z())
goto numberright;
- context._cmp(context.data.byte(kLightcount), 1);
- if (!context.flags.z())
+ _cmp(data.byte(kLightcount), 1);
+ if (!flags.z())
goto notendkey;
- context._cmp(context.data.byte(kLockstatus), 0);
- if (context.flags.z())
+ _cmp(data.byte(kLockstatus), 0);
+ if (flags.z())
goto numberright;
goto keypadloop;
notendkey:
- context._cmp(context.data.byte(kPresscount), 40);
- if (!context.flags.z())
+ _cmp(data.byte(kPresscount), 40);
+ if (!flags.z())
goto keypadloop;
- addtopresslist(context);
- context._cmp(context.data.byte(kPressed), 11);
- if (!context.flags.z())
+ addtopresslist();
+ _cmp(data.byte(kPressed), 11);
+ if (!flags.z())
goto keypadloop;
- context.ax = context.data.word(kKeypadax);
- context.cx = context.data.word(kKeypadcx);
- isitright(context);
- if (!context.flags.z())
+ ax = data.word(kKeypadax);
+ cx = data.word(kKeypadcx);
+ isitright();
+ if (!flags.z())
goto incorrect;
- context.data.byte(kLockstatus) = 0;
- context.al = 11;
- playchannel1(context);
- context.data.byte(kLightcount) = 120;
- context.data.word(kPresspointer) = 0;
+ data.byte(kLockstatus) = 0;
+ al = 11;
+ playchannel1();
+ data.byte(kLightcount) = 120;
+ data.word(kPresspointer) = 0;
goto keypadloop;
incorrect:
- context.al = 11;
- playchannel1(context);
- context.data.byte(kLightcount) = 120;
- context.data.word(kPresspointer) = 0;
+ al = 11;
+ playchannel1();
+ data.byte(kLightcount) = 120;
+ data.word(kPresspointer) = 0;
goto keypadloop;
numberright:
- context.data.byte(kManisoffscreen) = 0;
- getridoftemp(context);
- restorereels(context);
- redrawmainscrn(context);
- worktoscreenm(context);
+ data.byte(kManisoffscreen) = 0;
+ getridoftemp();
+ restorereels();
+ redrawmainscrn();
+ worktoscreenm();
}
-void loadkeypad(Context &context) {
- STACK_CHECK(context);
- context.dx = 1948;
- loadintotemp(context);
+void DreamGenContext::loadkeypad() {
+ STACK_CHECK;
+ dx = 1948;
+ loadintotemp();
}
-void quitkey(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kCommandtype), 222);
- if (context.flags.z())
+void DreamGenContext::quitkey() {
+ STACK_CHECK;
+ _cmp(data.byte(kCommandtype), 222);
+ if (flags.z())
goto alreadyqk;
- context.data.byte(kCommandtype) = 222;
- context.al = 4;
- commandonly(context);
+ data.byte(kCommandtype) = 222;
+ al = 4;
+ commandonly();
alreadyqk:
- context.ax = context.data.word(kMousebutton);
- context._cmp(context.ax, context.data.word(kOldbutton));
- if (context.flags.z())
- goto notqk;
- context._and(context.ax, 1);
- if (!context.flags.z())
+ ax = data.word(kMousebutton);
+ _cmp(ax, data.word(kOldbutton));
+ if (flags.z())
+ return /* (notqk) */;
+ _and(ax, 1);
+ if (!flags.z())
goto doqk;
-notqk:
return;
doqk:
- context.data.byte(kGetback) = 1;
+ data.byte(kGetback) = 1;
}
-void addtopresslist(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.word(kPresspointer), 5);
- if (context.flags.z())
- goto nomorekeys;
- context.al = context.data.byte(kPressed);
- context._cmp(context.al, 10);
- if (!context.flags.z())
+void DreamGenContext::addtopresslist() {
+ STACK_CHECK;
+ _cmp(data.word(kPresspointer), 5);
+ if (flags.z())
+ return /* (nomorekeys) */;
+ al = data.byte(kPressed);
+ _cmp(al, 10);
+ if (!flags.z())
goto not10;
- context.al = 0;
+ al = 0;
not10:
- context.bx = context.data.word(kPresspointer);
- context.dx = context.data;
- context.es = context.dx;
- context._add(context.bx, 8573);
- context.es.byte(context.bx) = context.al;
- context._inc(context.data.word(kPresspointer));
-nomorekeys:
- return;
+ bx = data.word(kPresspointer);
+ dx = data;
+ es = dx;
+ _add(bx, 8573);
+ es.byte(bx) = al;
+ _inc(data.word(kPresspointer));
}
-void buttonone(Context &context) {
- STACK_CHECK(context);
- context.cl = 1;
- buttonpress(context);
+void DreamGenContext::buttonone() {
+ STACK_CHECK;
+ cl = 1;
+ buttonpress();
}
-void buttontwo(Context &context) {
- STACK_CHECK(context);
- context.cl = 2;
- buttonpress(context);
+void DreamGenContext::buttontwo() {
+ STACK_CHECK;
+ cl = 2;
+ buttonpress();
}
-void buttonthree(Context &context) {
- STACK_CHECK(context);
- context.cl = 3;
- buttonpress(context);
+void DreamGenContext::buttonthree() {
+ STACK_CHECK;
+ cl = 3;
+ buttonpress();
}
-void buttonfour(Context &context) {
- STACK_CHECK(context);
- context.cl = 4;
- buttonpress(context);
+void DreamGenContext::buttonfour() {
+ STACK_CHECK;
+ cl = 4;
+ buttonpress();
}
-void buttonfive(Context &context) {
- STACK_CHECK(context);
- context.cl = 5;
- buttonpress(context);
+void DreamGenContext::buttonfive() {
+ STACK_CHECK;
+ cl = 5;
+ buttonpress();
}
-void buttonsix(Context &context) {
- STACK_CHECK(context);
- context.cl = 6;
- buttonpress(context);
+void DreamGenContext::buttonsix() {
+ STACK_CHECK;
+ cl = 6;
+ buttonpress();
}
-void buttonseven(Context &context) {
- STACK_CHECK(context);
- context.cl = 7;
- buttonpress(context);
+void DreamGenContext::buttonseven() {
+ STACK_CHECK;
+ cl = 7;
+ buttonpress();
}
-void buttoneight(Context &context) {
- STACK_CHECK(context);
- context.cl = 8;
- buttonpress(context);
+void DreamGenContext::buttoneight() {
+ STACK_CHECK;
+ cl = 8;
+ buttonpress();
}
-void buttonnine(Context &context) {
- STACK_CHECK(context);
- context.cl = 9;
- buttonpress(context);
+void DreamGenContext::buttonnine() {
+ STACK_CHECK;
+ cl = 9;
+ buttonpress();
}
-void buttonnought(Context &context) {
- STACK_CHECK(context);
- context.cl = 10;
- buttonpress(context);
+void DreamGenContext::buttonnought() {
+ STACK_CHECK;
+ cl = 10;
+ buttonpress();
}
-void buttonenter(Context &context) {
- STACK_CHECK(context);
- context.cl = 11;
- buttonpress(context);
+void DreamGenContext::buttonenter() {
+ STACK_CHECK;
+ cl = 11;
+ buttonpress();
}
-void buttonpress(Context &context) {
- STACK_CHECK(context);
- context.ch = context.cl;
- context._add(context.ch, 100);
- context._cmp(context.data.byte(kCommandtype), context.ch);
- if (context.flags.z())
+void DreamGenContext::buttonpress() {
+ STACK_CHECK;
+ ch = cl;
+ _add(ch, 100);
+ _cmp(data.byte(kCommandtype), ch);
+ if (flags.z())
goto alreadyb;
- context.data.byte(kCommandtype) = context.ch;
- context.al = context.cl;
- context._add(context.al, 4);
- context.push(context.cx);
- commandonly(context);
- context.cx = context.pop();
+ data.byte(kCommandtype) = ch;
+ al = cl;
+ _add(al, 4);
+ push(cx);
+ commandonly();
+ cx = pop();
alreadyb:
- context.ax = context.data.word(kMousebutton);
- context._cmp(context.ax, context.data.word(kOldbutton));
- if (context.flags.z())
- goto notb;
- context._and(context.ax, 1);
- if (!context.flags.z())
+ ax = data.word(kMousebutton);
+ _cmp(ax, data.word(kOldbutton));
+ if (flags.z())
+ return /* (notb) */;
+ _and(ax, 1);
+ if (!flags.z())
goto dob;
-notb:
return;
dob:
- context.data.byte(kPressed) = context.cl;
- context._add(context.cl, 21);
- context.data.byte(kGraphicpress) = context.cl;
- context.data.byte(kPresscount) = 40;
- context._cmp(context.cl, 32);
- if (context.flags.z())
- goto nonoise;
- context.al = 10;
- playchannel1(context);
-nonoise:
- return;
-}
-
-void showouterpad(Context &context) {
- STACK_CHECK(context);
- context.di = (36+112)-3;
- context.bx = (72)-4;
- context.ds = context.data.word(kTempgraphics);
- context.al = 1;
- context.ah = 0;
- showframe(context);
- context.di = (36+112)+74;
- context.bx = (72)+76;
- context.ds = context.data.word(kTempgraphics);
- context.al = 37;
- context.ah = 0;
- showframe(context);
-}
-
-void showkeypad(Context &context) {
- STACK_CHECK(context);
- context.al = 22;
- context.di = (36+112)+9;
- context.bx = (72)+5;
- singlekey(context);
- context.al = 23;
- context.di = (36+112)+31;
- context.bx = (72)+5;
- singlekey(context);
- context.al = 24;
- context.di = (36+112)+53;
- context.bx = (72)+5;
- singlekey(context);
- context.al = 25;
- context.di = (36+112)+9;
- context.bx = (72)+23;
- singlekey(context);
- context.al = 26;
- context.di = (36+112)+31;
- context.bx = (72)+23;
- singlekey(context);
- context.al = 27;
- context.di = (36+112)+53;
- context.bx = (72)+23;
- singlekey(context);
- context.al = 28;
- context.di = (36+112)+9;
- context.bx = (72)+41;
- singlekey(context);
- context.al = 29;
- context.di = (36+112)+31;
- context.bx = (72)+41;
- singlekey(context);
- context.al = 30;
- context.di = (36+112)+53;
- context.bx = (72)+41;
- singlekey(context);
- context.al = 31;
- context.di = (36+112)+9;
- context.bx = (72)+59;
- singlekey(context);
- context.al = 32;
- context.di = (36+112)+31;
- context.bx = (72)+59;
- singlekey(context);
- context._cmp(context.data.byte(kLightcount), 0);
- if (context.flags.z())
- goto notenter;
- context._dec(context.data.byte(kLightcount));
- context.al = 36;
- context.bx = (72)-1+63;
- context._cmp(context.data.byte(kLockstatus), 0);
- if (!context.flags.z())
+ data.byte(kPressed) = cl;
+ _add(cl, 21);
+ data.byte(kGraphicpress) = cl;
+ data.byte(kPresscount) = 40;
+ _cmp(cl, 32);
+ if (flags.z())
+ return /* (nonoise) */;
+ al = 10;
+ playchannel1();
+}
+
+void DreamGenContext::showouterpad() {
+ STACK_CHECK;
+ di = (36+112)-3;
+ bx = (72)-4;
+ ds = data.word(kTempgraphics);
+ al = 1;
+ ah = 0;
+ showframe();
+ di = (36+112)+74;
+ bx = (72)+76;
+ ds = data.word(kTempgraphics);
+ al = 37;
+ ah = 0;
+ showframe();
+}
+
+void DreamGenContext::showkeypad() {
+ STACK_CHECK;
+ al = 22;
+ di = (36+112)+9;
+ bx = (72)+5;
+ singlekey();
+ al = 23;
+ di = (36+112)+31;
+ bx = (72)+5;
+ singlekey();
+ al = 24;
+ di = (36+112)+53;
+ bx = (72)+5;
+ singlekey();
+ al = 25;
+ di = (36+112)+9;
+ bx = (72)+23;
+ singlekey();
+ al = 26;
+ di = (36+112)+31;
+ bx = (72)+23;
+ singlekey();
+ al = 27;
+ di = (36+112)+53;
+ bx = (72)+23;
+ singlekey();
+ al = 28;
+ di = (36+112)+9;
+ bx = (72)+41;
+ singlekey();
+ al = 29;
+ di = (36+112)+31;
+ bx = (72)+41;
+ singlekey();
+ al = 30;
+ di = (36+112)+53;
+ bx = (72)+41;
+ singlekey();
+ al = 31;
+ di = (36+112)+9;
+ bx = (72)+59;
+ singlekey();
+ al = 32;
+ di = (36+112)+31;
+ bx = (72)+59;
+ singlekey();
+ _cmp(data.byte(kLightcount), 0);
+ if (flags.z())
+ return /* (notenter) */;
+ _dec(data.byte(kLightcount));
+ al = 36;
+ bx = (72)-1+63;
+ _cmp(data.byte(kLockstatus), 0);
+ if (!flags.z())
goto changelight;
- context.al = 41;
- context.bx = (72)+4+63;
+ al = 41;
+ bx = (72)+4+63;
changelight:
- context._cmp(context.data.byte(kLightcount), 60);
- if (context.flags.c())
+ _cmp(data.byte(kLightcount), 60);
+ if (flags.c())
goto gotlight;
- context._cmp(context.data.byte(kLightcount), 100);
- if (!context.flags.c())
+ _cmp(data.byte(kLightcount), 100);
+ if (!flags.c())
goto gotlight;
- context._dec(context.al);
+ _dec(al);
gotlight:
- context.ds = context.data.word(kTempgraphics);
- context.ah = 0;
- context.di = (36+112)+60;
- showframe(context);
-notenter:
- return;
+ ds = data.word(kTempgraphics);
+ ah = 0;
+ di = (36+112)+60;
+ showframe();
}
-void singlekey(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kGraphicpress), context.al);
- if (!context.flags.z())
+void DreamGenContext::singlekey() {
+ STACK_CHECK;
+ _cmp(data.byte(kGraphicpress), al);
+ if (!flags.z())
goto gotkey;
- context._add(context.al, 11);
- context._cmp(context.data.byte(kPresscount), 8);
- if (!context.flags.c())
+ _add(al, 11);
+ _cmp(data.byte(kPresscount), 8);
+ if (!flags.c())
goto gotkey;
- context._sub(context.al, 11);
+ _sub(al, 11);
gotkey:
- context.ds = context.data.word(kTempgraphics);
- context._sub(context.al, 20);
- context.ah = 0;
- showframe(context);
-}
-
-void dumpkeypad(Context &context) {
- STACK_CHECK(context);
- context.di = (36+112)-3;
- context.bx = (72)-4;
- context.cl = 120;
- context.ch = 90;
- multidump(context);
-}
-
-void usemenu(Context &context) {
- STACK_CHECK(context);
- getridofreels(context);
- loadmenu(context);
- createpanel(context);
- showpanel(context);
- showicon(context);
- context.data.byte(kNewobs) = 0;
- drawfloor(context);
- printsprites(context);
- context.al = 4;
- context.ah = 0;
- context.di = (80+40)-48;
- context.bx = (60)-4;
- context.ds = context.data.word(kTempgraphics2);
- showframe(context);
- getundermenu(context);
- context.al = 5;
- context.ah = 0;
- context.di = (80+40)+54;
- context.bx = (60)+72;
- context.ds = context.data.word(kTempgraphics2);
- showframe(context);
- worktoscreenm(context);
- context.data.byte(kGetback) = 0;
+ ds = data.word(kTempgraphics);
+ _sub(al, 20);
+ ah = 0;
+ showframe();
+}
+
+void DreamGenContext::dumpkeypad() {
+ STACK_CHECK;
+ di = (36+112)-3;
+ bx = (72)-4;
+ cl = 120;
+ ch = 90;
+ multidump();
+}
+
+void DreamGenContext::usemenu() {
+ STACK_CHECK;
+ getridofreels();
+ loadmenu();
+ createpanel();
+ showpanel();
+ showicon();
+ data.byte(kNewobs) = 0;
+ drawfloor();
+ printsprites();
+ al = 4;
+ ah = 0;
+ di = (80+40)-48;
+ bx = (60)-4;
+ ds = data.word(kTempgraphics2);
+ showframe();
+ getundermenu();
+ al = 5;
+ ah = 0;
+ di = (80+40)+54;
+ bx = (60)+72;
+ ds = data.word(kTempgraphics2);
+ showframe();
+ worktoscreenm();
+ data.byte(kGetback) = 0;
menuloop:
- delpointer(context);
- putundermenu(context);
- showmenu(context);
- readmouse(context);
- showpointer(context);
- vsync(context);
- dumppointer(context);
- dumpmenu(context);
- dumptextline(context);
- context.bx = 3614;
- checkcoords(context);
- context._cmp(context.data.byte(kGetback), 1);
- if (!context.flags.z())
+ delpointer();
+ putundermenu();
+ showmenu();
+ readmouse();
+ showpointer();
+ vsync();
+ dumppointer();
+ dumpmenu();
+ dumptextline();
+ bx = 3614;
+ checkcoords();
+ _cmp(data.byte(kGetback), 1);
+ if (!flags.z())
goto menuloop;
- context.data.byte(kManisoffscreen) = 0;
- redrawmainscrn(context);
- getridoftemp(context);
- getridoftemp2(context);
- restorereels(context);
- worktoscreenm(context);
- return;
- return;
-}
-
-void dumpmenu(Context &context) {
- STACK_CHECK(context);
- context.di = (80+40);
- context.bx = (60);
- context.cl = 48;
- context.ch = 48;
- multidump(context);
-}
-
-void getundermenu(Context &context) {
- STACK_CHECK(context);
- context.di = (80+40);
- context.bx = (60);
- context.cl = 48;
- context.ch = 48;
- context.ds = context.data.word(kBuffers);
- context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4));
- multiget(context);
-}
-
-void putundermenu(Context &context) {
- STACK_CHECK(context);
- context.di = (80+40);
- context.bx = (60);
- context.cl = 48;
- context.ch = 48;
- context.ds = context.data.word(kBuffers);
- context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4));
- multiput(context);
-}
-
-void showoutermenu(Context &context) {
- STACK_CHECK(context);
- context.al = 40;
- context.ah = 0;
- context.di = (80+40)-34;
- context.bx = (60)-40;
- context.ds = context.data.word(kTempgraphics);
- showframe(context);
- context.al = 41;
- context.ah = 0;
- context.di = (80+40)+64-34;
- context.bx = (60)-40;
- context.ds = context.data.word(kTempgraphics);
- showframe(context);
- context.al = 42;
- context.ah = 0;
- context.di = (80+40)-26;
- context.bx = (60)+57-40;
- context.ds = context.data.word(kTempgraphics);
- showframe(context);
- context.al = 43;
- context.ah = 0;
- context.di = (80+40)+64-26;
- context.bx = (60)+57-40;
- context.ds = context.data.word(kTempgraphics);
- showframe(context);
-}
-
-void showmenu(Context &context) {
- STACK_CHECK(context);
- context._inc(context.data.byte(kMenucount));
- context._cmp(context.data.byte(kMenucount), 37*2);
- if (!context.flags.z())
+ data.byte(kManisoffscreen) = 0;
+ redrawmainscrn();
+ getridoftemp();
+ getridoftemp2();
+ restorereels();
+ worktoscreenm();
+}
+
+void DreamGenContext::dumpmenu() {
+ STACK_CHECK;
+ di = (80+40);
+ bx = (60);
+ cl = 48;
+ ch = 48;
+ multidump();
+}
+
+void DreamGenContext::getundermenu() {
+ STACK_CHECK;
+ di = (80+40);
+ bx = (60);
+ cl = 48;
+ ch = 48;
+ ds = data.word(kBuffers);
+ si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4));
+ multiget();
+}
+
+void DreamGenContext::putundermenu() {
+ STACK_CHECK;
+ di = (80+40);
+ bx = (60);
+ cl = 48;
+ ch = 48;
+ ds = data.word(kBuffers);
+ si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4));
+ multiput();
+}
+
+void DreamGenContext::showoutermenu() {
+ STACK_CHECK;
+ al = 40;
+ ah = 0;
+ di = (80+40)-34;
+ bx = (60)-40;
+ ds = data.word(kTempgraphics);
+ showframe();
+ al = 41;
+ ah = 0;
+ di = (80+40)+64-34;
+ bx = (60)-40;
+ ds = data.word(kTempgraphics);
+ showframe();
+ al = 42;
+ ah = 0;
+ di = (80+40)-26;
+ bx = (60)+57-40;
+ ds = data.word(kTempgraphics);
+ showframe();
+ al = 43;
+ ah = 0;
+ di = (80+40)+64-26;
+ bx = (60)+57-40;
+ ds = data.word(kTempgraphics);
+ showframe();
+}
+
+void DreamGenContext::showmenu() {
+ STACK_CHECK;
+ _inc(data.byte(kMenucount));
+ _cmp(data.byte(kMenucount), 37*2);
+ if (!flags.z())
goto menuframeok;
- context.data.byte(kMenucount) = 0;
+ data.byte(kMenucount) = 0;
menuframeok:
- context.al = context.data.byte(kMenucount);
- context._shr(context.al, 1);
- context.ah = 0;
- context.di = (80+40);
- context.bx = (60);
- context.ds = context.data.word(kTempgraphics);
- showframe(context);
-}
-
-void loadmenu(Context &context) {
- STACK_CHECK(context);
- context.dx = 1832;
- loadintotemp(context);
- context.dx = 1987;
- loadintotemp2(context);
-}
-
-void viewfolder(Context &context) {
- STACK_CHECK(context);
- context.data.byte(kManisoffscreen) = 1;
- getridofall(context);
- loadfolder(context);
- context.data.byte(kFolderpage) = 0;
- showfolder(context);
- worktoscreenm(context);
- context.data.byte(kGetback) = 0;
+ al = data.byte(kMenucount);
+ _shr(al, 1);
+ ah = 0;
+ di = (80+40);
+ bx = (60);
+ ds = data.word(kTempgraphics);
+ showframe();
+}
+
+void DreamGenContext::loadmenu() {
+ STACK_CHECK;
+ dx = 1832;
+ loadintotemp();
+ dx = 1987;
+ loadintotemp2();
+}
+
+void DreamGenContext::viewfolder() {
+ STACK_CHECK;
+ data.byte(kManisoffscreen) = 1;
+ getridofall();
+ loadfolder();
+ data.byte(kFolderpage) = 0;
+ showfolder();
+ worktoscreenm();
+ data.byte(kGetback) = 0;
folderloop:
- delpointer(context);
- readmouse(context);
- showpointer(context);
- vsync(context);
- dumppointer(context);
- dumptextline(context);
- context.bx = 3636;
- checkcoords(context);
- context._cmp(context.data.byte(kGetback), 0);
- if (context.flags.z())
+ delpointer();
+ readmouse();
+ showpointer();
+ vsync();
+ dumppointer();
+ dumptextline();
+ bx = 3636;
+ checkcoords();
+ _cmp(data.byte(kGetback), 0);
+ if (flags.z())
goto folderloop;
- context.data.byte(kManisoffscreen) = 0;
- getridoftemp(context);
- getridoftemp2(context);
- getridoftemp3(context);
- getridoftempcharset(context);
- restoreall(context);
- redrawmainscrn(context);
- worktoscreenm(context);
-}
-
-void nextfolder(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kFolderpage), 12);
- if (!context.flags.z())
+ data.byte(kManisoffscreen) = 0;
+ getridoftemp();
+ getridoftemp2();
+ getridoftemp3();
+ getridoftempcharset();
+ restoreall();
+ redrawmainscrn();
+ worktoscreenm();
+}
+
+void DreamGenContext::nextfolder() {
+ STACK_CHECK;
+ _cmp(data.byte(kFolderpage), 12);
+ if (!flags.z())
goto cannextf;
- blank(context);
+ blank();
return;
cannextf:
- context._cmp(context.data.byte(kCommandtype), 201);
- if (context.flags.z())
+ _cmp(data.byte(kCommandtype), 201);
+ if (flags.z())
goto alreadynextf;
- context.data.byte(kCommandtype) = 201;
- context.al = 16;
- commandonly(context);
+ data.byte(kCommandtype) = 201;
+ al = 16;
+ commandonly();
alreadynextf:
- context.ax = context.data.word(kMousebutton);
- context._cmp(context.ax, context.data.word(kOldbutton));
- if (context.flags.z())
- goto notnextf;
- context._cmp(context.ax, 1);
- if (context.flags.z())
+ ax = data.word(kMousebutton);
+ _cmp(ax, data.word(kOldbutton));
+ if (flags.z())
+ return /* (notnextf) */;
+ _cmp(ax, 1);
+ if (flags.z())
goto donextf;
-notnextf:
return;
donextf:
- context._inc(context.data.byte(kFolderpage));
- folderhints(context);
- delpointer(context);
- showfolder(context);
- context.data.word(kMousebutton) = 0;
- context.bx = 3636;
- checkcoords(context);
- worktoscreenm(context);
-}
-
-void folderhints(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kFolderpage), 5);
- if (!context.flags.z())
+ _inc(data.byte(kFolderpage));
+ folderhints();
+ delpointer();
+ showfolder();
+ data.word(kMousebutton) = 0;
+ bx = 3636;
+ checkcoords();
+ worktoscreenm();
+}
+
+void DreamGenContext::folderhints() {
+ STACK_CHECK;
+ _cmp(data.byte(kFolderpage), 5);
+ if (!flags.z())
goto notaideadd;
- context._cmp(context.data.byte(kAidedead), 1);
- if (context.flags.z())
+ _cmp(data.byte(kAidedead), 1);
+ if (flags.z())
goto notaideadd;
- context.al = 13;
- getlocation(context);
- context._cmp(context.al, 1);
- if (context.flags.z())
+ al = 13;
+ getlocation();
+ _cmp(al, 1);
+ if (flags.z())
goto notaideadd;
- context.al = 13;
- setlocation(context);
- showfolder(context);
- context.al = 30;
- findtext1(context);
- context.di = 0;
- context.bx = 86;
- context.dl = 141;
- context.ah = 16;
- printdirect(context);
- worktoscreenm(context);
- context.cx = 200;
- hangonp(context);
+ al = 13;
+ setlocation();
+ showfolder();
+ al = 30;
+ findtext1();
+ di = 0;
+ bx = 86;
+ dl = 141;
+ ah = 16;
+ printdirect();
+ worktoscreenm();
+ cx = 200;
+ hangonp();
return;
notaideadd:
- context._cmp(context.data.byte(kFolderpage), 9);
- if (!context.flags.z())
- goto notaristoadd;
- context.al = 7;
- getlocation(context);
- context._cmp(context.al, 1);
- if (context.flags.z())
- goto notaristoadd;
- context.al = 7;
- setlocation(context);
- showfolder(context);
- context.al = 31;
- findtext1(context);
- context.di = 0;
- context.bx = 86;
- context.dl = 141;
- context.ah = 16;
- printdirect(context);
- worktoscreenm(context);
- context.cx = 200;
- hangonp(context);
-notaristoadd:
- return;
-}
-
-void lastfolder(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kFolderpage), 0);
- if (!context.flags.z())
+ _cmp(data.byte(kFolderpage), 9);
+ if (!flags.z())
+ return /* (notaristoadd) */;
+ al = 7;
+ getlocation();
+ _cmp(al, 1);
+ if (flags.z())
+ return /* (notaristoadd) */;
+ al = 7;
+ setlocation();
+ showfolder();
+ al = 31;
+ findtext1();
+ di = 0;
+ bx = 86;
+ dl = 141;
+ ah = 16;
+ printdirect();
+ worktoscreenm();
+ cx = 200;
+ hangonp();
+}
+
+void DreamGenContext::lastfolder() {
+ STACK_CHECK;
+ _cmp(data.byte(kFolderpage), 0);
+ if (!flags.z())
goto canlastf;
- blank(context);
+ blank();
return;
canlastf:
- context._cmp(context.data.byte(kCommandtype), 202);
- if (context.flags.z())
+ _cmp(data.byte(kCommandtype), 202);
+ if (flags.z())
goto alreadylastf;
- context.data.byte(kCommandtype) = 202;
- context.al = 17;
- commandonly(context);
+ data.byte(kCommandtype) = 202;
+ al = 17;
+ commandonly();
alreadylastf:
- context._cmp(context.data.byte(kFolderpage), 0);
- if (context.flags.z())
- goto notlastf;
- context.ax = context.data.word(kMousebutton);
- context._cmp(context.ax, context.data.word(kOldbutton));
- if (context.flags.z())
- goto notlastf;
- context._cmp(context.ax, 1);
- if (context.flags.z())
+ _cmp(data.byte(kFolderpage), 0);
+ if (flags.z())
+ return /* (notlastf) */;
+ ax = data.word(kMousebutton);
+ _cmp(ax, data.word(kOldbutton));
+ if (flags.z())
+ return /* (notlastf) */;
+ _cmp(ax, 1);
+ if (flags.z())
goto dolastf;
-notlastf:
return;
dolastf:
- context._dec(context.data.byte(kFolderpage));
- delpointer(context);
- showfolder(context);
- context.data.word(kMousebutton) = 0;
- context.bx = 3636;
- checkcoords(context);
- worktoscreenm(context);
-}
-
-void loadfolder(Context &context) {
- STACK_CHECK(context);
- context.dx = 2299;
- loadintotemp(context);
- context.dx = 2312;
- loadintotemp2(context);
- context.dx = 2325;
- loadintotemp3(context);
- context.dx = 1883;
- loadtempcharset(context);
- context.dx = 2195;
- loadtemptext(context);
-}
-
-void showfolder(Context &context) {
- STACK_CHECK(context);
- context.data.byte(kCommandtype) = 255;
- context._cmp(context.data.byte(kFolderpage), 0);
- if (context.flags.z())
+ _dec(data.byte(kFolderpage));
+ delpointer();
+ showfolder();
+ data.word(kMousebutton) = 0;
+ bx = 3636;
+ checkcoords();
+ worktoscreenm();
+}
+
+void DreamGenContext::loadfolder() {
+ STACK_CHECK;
+ dx = 2299;
+ loadintotemp();
+ dx = 2312;
+ loadintotemp2();
+ dx = 2325;
+ loadintotemp3();
+ dx = 1883;
+ loadtempcharset();
+ dx = 2195;
+ loadtemptext();
+}
+
+void DreamGenContext::showfolder() {
+ STACK_CHECK;
+ data.byte(kCommandtype) = 255;
+ _cmp(data.byte(kFolderpage), 0);
+ if (flags.z())
goto closedfolder;
- usetempcharset(context);
- createpanel2(context);
- context.ds = context.data.word(kTempgraphics);
- context.di = 0;
- context.bx = 0;
- context.al = 0;
- context.ah = 0;
- showframe(context);
- context.ds = context.data.word(kTempgraphics);
- context.di = 143;
- context.bx = 0;
- context.al = 1;
- context.ah = 0;
- showframe(context);
- context.ds = context.data.word(kTempgraphics);
- context.di = 0;
- context.bx = 92;
- context.al = 2;
- context.ah = 0;
- showframe(context);
- context.ds = context.data.word(kTempgraphics);
- context.di = 143;
- context.bx = 92;
- context.al = 3;
- context.ah = 0;
- showframe(context);
- folderexit(context);
- context._cmp(context.data.byte(kFolderpage), 1);
- if (context.flags.z())
+ usetempcharset();
+ createpanel2();
+ ds = data.word(kTempgraphics);
+ di = 0;
+ bx = 0;
+ al = 0;
+ ah = 0;
+ showframe();
+ ds = data.word(kTempgraphics);
+ di = 143;
+ bx = 0;
+ al = 1;
+ ah = 0;
+ showframe();
+ ds = data.word(kTempgraphics);
+ di = 0;
+ bx = 92;
+ al = 2;
+ ah = 0;
+ showframe();
+ ds = data.word(kTempgraphics);
+ di = 143;
+ bx = 92;
+ al = 3;
+ ah = 0;
+ showframe();
+ folderexit();
+ _cmp(data.byte(kFolderpage), 1);
+ if (flags.z())
goto noleftpage;
- showleftpage(context);
+ showleftpage();
noleftpage:
- context._cmp(context.data.byte(kFolderpage), 12);
- if (context.flags.z())
+ _cmp(data.byte(kFolderpage), 12);
+ if (flags.z())
goto norightpage;
- showrightpage(context);
+ showrightpage();
norightpage:
- usecharset1(context);
- undertextline(context);
+ usecharset1();
+ undertextline();
return;
closedfolder:
- createpanel2(context);
- context.ds = context.data.word(kTempgraphics3);
- context.di = 143-28;
- context.bx = 0;
- context.al = 0;
- context.ah = 0;
- showframe(context);
- context.ds = context.data.word(kTempgraphics3);
- context.di = 143-28;
- context.bx = 92;
- context.al = 1;
- context.ah = 0;
- showframe(context);
- folderexit(context);
- undertextline(context);
-}
-
-void folderexit(Context &context) {
- STACK_CHECK(context);
- context.ds = context.data.word(kTempgraphics2);
- context.di = 296;
- context.bx = 178;
- context.al = 6;
- context.ah = 0;
- showframe(context);
-}
-
-void showleftpage(Context &context) {
- STACK_CHECK(context);
- context.ds = context.data.word(kTempgraphics2);
- context.di = 0;
- context.bx = 12;
- context.al = 3;
- context.ah = 0;
- showframe(context);
- context.bx = 12+5;
- context.cx = 9;
+ createpanel2();
+ ds = data.word(kTempgraphics3);
+ di = 143-28;
+ bx = 0;
+ al = 0;
+ ah = 0;
+ showframe();
+ ds = data.word(kTempgraphics3);
+ di = 143-28;
+ bx = 92;
+ al = 1;
+ ah = 0;
+ showframe();
+ folderexit();
+ undertextline();
+}
+
+void DreamGenContext::folderexit() {
+ STACK_CHECK;
+ ds = data.word(kTempgraphics2);
+ di = 296;
+ bx = 178;
+ al = 6;
+ ah = 0;
+ showframe();
+}
+
+void DreamGenContext::showleftpage() {
+ STACK_CHECK;
+ ds = data.word(kTempgraphics2);
+ di = 0;
+ bx = 12;
+ al = 3;
+ ah = 0;
+ showframe();
+ bx = 12+5;
+ cx = 9;
leftpageloop:
- context.push(context.cx);
- context.push(context.bx);
- context.ds = context.data.word(kTempgraphics2);
- context.di = 0;
- context.al = 4;
- context.ah = 0;
- showframe(context);
- context.bx = context.pop();
- context.cx = context.pop();
- context._add(context.bx, 16);
- if (--context.cx)
+ push(cx);
+ push(bx);
+ ds = data.word(kTempgraphics2);
+ di = 0;
+ al = 4;
+ ah = 0;
+ showframe();
+ bx = pop();
+ cx = pop();
+ _add(bx, 16);
+ if (--cx)
goto leftpageloop;
- context.ds = context.data.word(kTempgraphics2);
- context.di = 0;
- context.al = 5;
- context.ah = 0;
- showframe(context);
- context.data.word(kLinespacing) = 8;
- context.data.word(kCharshift) = 91;
- context.data.byte(kKerning) = 1;
- context.bl = context.data.byte(kFolderpage);
- context._dec(context.bl);
- context._dec(context.bl);
- context._add(context.bl, context.bl);
- context.bh = 0;
- context._add(context.bx, context.bx);
- context.es = context.data.word(kTextfile1);
- context.si = context.es.word(context.bx);
- context._add(context.si, 66*2);
- context.di = 2;
- context.bx = 48;
- context.dl = 140;
- context.cx = 2;
+ ds = data.word(kTempgraphics2);
+ di = 0;
+ al = 5;
+ ah = 0;
+ showframe();
+ data.word(kLinespacing) = 8;
+ data.word(kCharshift) = 91;
+ data.byte(kKerning) = 1;
+ bl = data.byte(kFolderpage);
+ _dec(bl);
+ _dec(bl);
+ _add(bl, bl);
+ bh = 0;
+ _add(bx, bx);
+ es = data.word(kTextfile1);
+ si = es.word(bx);
+ _add(si, 66*2);
+ di = 2;
+ bx = 48;
+ dl = 140;
+ cx = 2;
twolotsleft:
- context.push(context.cx);
+ push(cx);
contleftpage:
- printdirect(context);
- context._add(context.bx, context.data.word(kLinespacing));
- context._cmp(context.al, 0);
- if (!context.flags.z())
+ printdirect();
+ _add(bx, data.word(kLinespacing));
+ _cmp(al, 0);
+ if (!flags.z())
goto contleftpage;
- context.cx = context.pop();
- if (--context.cx)
+ cx = pop();
+ if (--cx)
goto twolotsleft;
- context.data.byte(kKerning) = 0;
- context.data.word(kCharshift) = 0;
- context.data.word(kLinespacing) = 10;
- context.es = context.data.word(kWorkspace);
- context.ds = context.data.word(kWorkspace);
- context.di = (48*320)+2;
- context.si = (48*320)+2+130;
- context.cx = 120;
+ data.byte(kKerning) = 0;
+ data.word(kCharshift) = 0;
+ data.word(kLinespacing) = 10;
+ es = data.word(kWorkspace);
+ ds = data.word(kWorkspace);
+ di = (48*320)+2;
+ si = (48*320)+2+130;
+ cx = 120;
flipfolder:
- context.push(context.cx);
- context.push(context.di);
- context.push(context.si);
- context.cx = 65;
+ push(cx);
+ push(di);
+ push(si);
+ cx = 65;
flipfolderline:
- context.al = context.es.byte(context.di);
- context.ah = context.es.byte(context.si);
- context.es.byte(context.di) = context.ah;
- context.es.byte(context.si) = context.al;
- context._dec(context.si);
- context._inc(context.di);
- if (--context.cx)
+ al = es.byte(di);
+ ah = es.byte(si);
+ es.byte(di) = ah;
+ es.byte(si) = al;
+ _dec(si);
+ _inc(di);
+ if (--cx)
goto flipfolderline;
- context.si = context.pop();
- context.di = context.pop();
- context.cx = context.pop();
- context._add(context.si, 320);
- context._add(context.di, 320);
- if (--context.cx)
+ si = pop();
+ di = pop();
+ cx = pop();
+ _add(si, 320);
+ _add(di, 320);
+ if (--cx)
goto flipfolder;
}
-void showrightpage(Context &context) {
- STACK_CHECK(context);
- context.ds = context.data.word(kTempgraphics2);
- context.di = 143;
- context.bx = 12;
- context.al = 0;
- context.ah = 0;
- showframe(context);
- context.bx = 12+37;
- context.cx = 7;
+void DreamGenContext::showrightpage() {
+ STACK_CHECK;
+ ds = data.word(kTempgraphics2);
+ di = 143;
+ bx = 12;
+ al = 0;
+ ah = 0;
+ showframe();
+ bx = 12+37;
+ cx = 7;
rightpageloop:
- context.push(context.cx);
- context.push(context.bx);
- context.ds = context.data.word(kTempgraphics2);
- context.di = 143;
- context.al = 1;
- context.ah = 0;
- showframe(context);
- context.bx = context.pop();
- context.cx = context.pop();
- context._add(context.bx, 16);
- if (--context.cx)
+ push(cx);
+ push(bx);
+ ds = data.word(kTempgraphics2);
+ di = 143;
+ al = 1;
+ ah = 0;
+ showframe();
+ bx = pop();
+ cx = pop();
+ _add(bx, 16);
+ if (--cx)
goto rightpageloop;
- context.ds = context.data.word(kTempgraphics2);
- context.di = 143;
- context.al = 2;
- context.ah = 0;
- showframe(context);
- context.data.word(kLinespacing) = 8;
- context.data.byte(kKerning) = 1;
- context.bl = context.data.byte(kFolderpage);
- context._dec(context.bl);
- context._add(context.bl, context.bl);
- context.bh = 0;
- context._add(context.bx, context.bx);
- context.es = context.data.word(kTextfile1);
- context.si = context.es.word(context.bx);
- context._add(context.si, 66*2);
- context.di = 152;
- context.bx = 48;
- context.dl = 140;
- context.cx = 2;
+ ds = data.word(kTempgraphics2);
+ di = 143;
+ al = 2;
+ ah = 0;
+ showframe();
+ data.word(kLinespacing) = 8;
+ data.byte(kKerning) = 1;
+ bl = data.byte(kFolderpage);
+ _dec(bl);
+ _add(bl, bl);
+ bh = 0;
+ _add(bx, bx);
+ es = data.word(kTextfile1);
+ si = es.word(bx);
+ _add(si, 66*2);
+ di = 152;
+ bx = 48;
+ dl = 140;
+ cx = 2;
twolotsright:
- context.push(context.cx);
+ push(cx);
contrightpage:
- printdirect(context);
- context._add(context.bx, context.data.word(kLinespacing));
- context._cmp(context.al, 0);
- if (!context.flags.z())
+ printdirect();
+ _add(bx, data.word(kLinespacing));
+ _cmp(al, 0);
+ if (!flags.z())
goto contrightpage;
- context.cx = context.pop();
- if (--context.cx)
+ cx = pop();
+ if (--cx)
goto twolotsright;
- context.data.byte(kKerning) = 0;
- context.data.word(kLinespacing) = 10;
-}
-
-void entersymbol(Context &context) {
- STACK_CHECK(context);
- context.data.byte(kManisoffscreen) = 1;
- getridofreels(context);
- context.dx = 2338;
- loadintotemp(context);
- context.data.byte(kSymboltopx) = 24;
- context.data.byte(kSymboltopdir) = 0;
- context.data.byte(kSymbolbotx) = 24;
- context.data.byte(kSymbolbotdir) = 0;
- redrawmainscrn(context);
- showsymbol(context);
- undertextline(context);
- worktoscreenm(context);
- context.data.byte(kGetback) = 0;
+ data.byte(kKerning) = 0;
+ data.word(kLinespacing) = 10;
+}
+
+void DreamGenContext::entersymbol() {
+ STACK_CHECK;
+ data.byte(kManisoffscreen) = 1;
+ getridofreels();
+ dx = 2338;
+ loadintotemp();
+ data.byte(kSymboltopx) = 24;
+ data.byte(kSymboltopdir) = 0;
+ data.byte(kSymbolbotx) = 24;
+ data.byte(kSymbolbotdir) = 0;
+ redrawmainscrn();
+ showsymbol();
+ undertextline();
+ worktoscreenm();
+ data.byte(kGetback) = 0;
symbolloop:
- delpointer(context);
- updatesymboltop(context);
- updatesymbolbot(context);
- showsymbol(context);
- readmouse(context);
- showpointer(context);
- vsync(context);
- dumppointer(context);
- dumptextline(context);
- dumpsymbol(context);
- context.bx = 3678;
- checkcoords(context);
- context._cmp(context.data.byte(kGetback), 0);
- if (context.flags.z())
+ delpointer();
+ updatesymboltop();
+ updatesymbolbot();
+ showsymbol();
+ readmouse();
+ showpointer();
+ vsync();
+ dumppointer();
+ dumptextline();
+ dumpsymbol();
+ bx = 3678;
+ checkcoords();
+ _cmp(data.byte(kGetback), 0);
+ if (flags.z())
goto symbolloop;
- context._cmp(context.data.byte(kSymbolbotnum), 3);
- if (!context.flags.z())
+ _cmp(data.byte(kSymbolbotnum), 3);
+ if (!flags.z())
goto symbolwrong;
- context._cmp(context.data.byte(kSymboltopnum), 5);
- if (!context.flags.z())
+ _cmp(data.byte(kSymboltopnum), 5);
+ if (!flags.z())
goto symbolwrong;
- context.al = 43;
- removesetobject(context);
- context.al = 46;
- placesetobject(context);
- context.ah = context.data.byte(kRoomnum);
- context._add(context.ah, 12);
- context.al = 0;
- turnanypathon(context);
- context.data.byte(kManisoffscreen) = 0;
- redrawmainscrn(context);
- getridoftemp(context);
- restorereels(context);
- worktoscreenm(context);
- context.al = 13;
- playchannel1(context);
+ al = 43;
+ removesetobject();
+ al = 46;
+ placesetobject();
+ ah = data.byte(kRoomnum);
+ _add(ah, 12);
+ al = 0;
+ turnanypathon();
+ data.byte(kManisoffscreen) = 0;
+ redrawmainscrn();
+ getridoftemp();
+ restorereels();
+ worktoscreenm();
+ al = 13;
+ playchannel1();
return;
symbolwrong:
- context.al = 46;
- removesetobject(context);
- context.al = 43;
- placesetobject(context);
- context.ah = context.data.byte(kRoomnum);
- context._add(context.ah, 12);
- context.al = 0;
- turnanypathoff(context);
- context.data.byte(kManisoffscreen) = 0;
- redrawmainscrn(context);
- getridoftemp(context);
- restorereels(context);
- worktoscreenm(context);
-}
-
-void quitsymbol(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kSymboltopx), 24);
- if (!context.flags.z())
- { blank(context); return; };
- context._cmp(context.data.byte(kSymbolbotx), 24);
- if (!context.flags.z())
- { blank(context); return; };
- context._cmp(context.data.byte(kCommandtype), 222);
- if (context.flags.z())
+ al = 46;
+ removesetobject();
+ al = 43;
+ placesetobject();
+ ah = data.byte(kRoomnum);
+ _add(ah, 12);
+ al = 0;
+ turnanypathoff();
+ data.byte(kManisoffscreen) = 0;
+ redrawmainscrn();
+ getridoftemp();
+ restorereels();
+ worktoscreenm();
+}
+
+void DreamGenContext::quitsymbol() {
+ STACK_CHECK;
+ _cmp(data.byte(kSymboltopx), 24);
+ if (!flags.z())
+ { blank(); return; };
+ _cmp(data.byte(kSymbolbotx), 24);
+ if (!flags.z())
+ { blank(); return; };
+ _cmp(data.byte(kCommandtype), 222);
+ if (flags.z())
goto alreadyqs;
- context.data.byte(kCommandtype) = 222;
- context.al = 18;
- commandonly(context);
+ data.byte(kCommandtype) = 222;
+ al = 18;
+ commandonly();
alreadyqs:
- context.ax = context.data.word(kMousebutton);
- context._cmp(context.ax, context.data.word(kOldbutton));
- if (context.flags.z())
- goto notqs;
- context._and(context.ax, 1);
- if (!context.flags.z())
+ ax = data.word(kMousebutton);
+ _cmp(ax, data.word(kOldbutton));
+ if (flags.z())
+ return /* (notqs) */;
+ _and(ax, 1);
+ if (!flags.z())
goto doqs;
-notqs:
return;
doqs:
- context.data.byte(kGetback) = 1;
+ data.byte(kGetback) = 1;
}
-void settopleft(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kSymboltopdir), 0);
- if (!context.flags.z())
- { blank(context); return; };
- context._cmp(context.data.byte(kCommandtype), 210);
- if (context.flags.z())
+void DreamGenContext::settopleft() {
+ STACK_CHECK;
+ _cmp(data.byte(kSymboltopdir), 0);
+ if (!flags.z())
+ { blank(); return; };
+ _cmp(data.byte(kCommandtype), 210);
+ if (flags.z())
goto alreadytopl;
- context.data.byte(kCommandtype) = 210;
- context.al = 19;
- commandonly(context);
+ data.byte(kCommandtype) = 210;
+ al = 19;
+ commandonly();
alreadytopl:
- context._cmp(context.data.word(kMousebutton), 0);
- if (context.flags.z())
- goto notopleft;
- context.data.byte(kSymboltopdir) = -1;
-notopleft:
- return;
-}
-
-void settopright(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kSymboltopdir), 0);
- if (!context.flags.z())
- { blank(context); return; };
- context._cmp(context.data.byte(kCommandtype), 211);
- if (context.flags.z())
+ _cmp(data.word(kMousebutton), 0);
+ if (flags.z())
+ return /* (notopleft) */;
+ data.byte(kSymboltopdir) = -1;
+}
+
+void DreamGenContext::settopright() {
+ STACK_CHECK;
+ _cmp(data.byte(kSymboltopdir), 0);
+ if (!flags.z())
+ { blank(); return; };
+ _cmp(data.byte(kCommandtype), 211);
+ if (flags.z())
goto alreadytopr;
- context.data.byte(kCommandtype) = 211;
- context.al = 20;
- commandonly(context);
+ data.byte(kCommandtype) = 211;
+ al = 20;
+ commandonly();
alreadytopr:
- context._cmp(context.data.word(kMousebutton), 0);
- if (context.flags.z())
- goto notopright;
- context.data.byte(kSymboltopdir) = 1;
-notopright:
- return;
-}
-
-void setbotleft(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kSymbolbotdir), 0);
- if (!context.flags.z())
- { blank(context); return; };
- context._cmp(context.data.byte(kCommandtype), 212);
- if (context.flags.z())
+ _cmp(data.word(kMousebutton), 0);
+ if (flags.z())
+ return /* (notopright) */;
+ data.byte(kSymboltopdir) = 1;
+}
+
+void DreamGenContext::setbotleft() {
+ STACK_CHECK;
+ _cmp(data.byte(kSymbolbotdir), 0);
+ if (!flags.z())
+ { blank(); return; };
+ _cmp(data.byte(kCommandtype), 212);
+ if (flags.z())
goto alreadybotl;
- context.data.byte(kCommandtype) = 212;
- context.al = 21;
- commandonly(context);
+ data.byte(kCommandtype) = 212;
+ al = 21;
+ commandonly();
alreadybotl:
- context._cmp(context.data.word(kMousebutton), 0);
- if (context.flags.z())
- goto nobotleft;
- context.data.byte(kSymbolbotdir) = -1;
-nobotleft:
- return;
-}
-
-void setbotright(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kSymbolbotdir), 0);
- if (!context.flags.z())
- { blank(context); return; };
- context._cmp(context.data.byte(kCommandtype), 213);
- if (context.flags.z())
+ _cmp(data.word(kMousebutton), 0);
+ if (flags.z())
+ return /* (nobotleft) */;
+ data.byte(kSymbolbotdir) = -1;
+}
+
+void DreamGenContext::setbotright() {
+ STACK_CHECK;
+ _cmp(data.byte(kSymbolbotdir), 0);
+ if (!flags.z())
+ { blank(); return; };
+ _cmp(data.byte(kCommandtype), 213);
+ if (flags.z())
goto alreadybotr;
- context.data.byte(kCommandtype) = 213;
- context.al = 22;
- commandonly(context);
+ data.byte(kCommandtype) = 213;
+ al = 22;
+ commandonly();
alreadybotr:
- context._cmp(context.data.word(kMousebutton), 0);
- if (context.flags.z())
- goto nobotright;
- context.data.byte(kSymbolbotdir) = 1;
-nobotright:
- return;
-}
-
-void dumpsymbol(Context &context) {
- STACK_CHECK(context);
- context.data.byte(kNewtextline) = 0;
- context.di = (64);
- context.bx = (56)+20;
- context.cl = 104;
- context.ch = 60;
- multidump(context);
-}
-
-void showsymbol(Context &context) {
- STACK_CHECK(context);
- context.al = 12;
- context.ah = 0;
- context.di = (64);
- context.bx = (56);
- context.ds = context.data.word(kTempgraphics);
- showframe(context);
- context.al = context.data.byte(kSymboltopx);
- context.ah = 0;
- context.di = context.ax;
- context._add(context.di, (64)-44);
- context.al = context.data.byte(kSymboltopnum);
- context.bx = (56)+20;
- context.ds = context.data.word(kTempgraphics);
- context.ah = 32;
- context.push(context.ax);
- context.push(context.di);
- context.push(context.bx);
- context.push(context.ds);
- showframe(context);
- context.ds = context.pop();
- context.bx = context.pop();
- context.di = context.pop();
- context.ax = context.pop();
- nextsymbol(context);
- context._add(context.di, 49);
- context.push(context.ax);
- context.push(context.di);
- context.push(context.bx);
- context.push(context.ds);
- showframe(context);
- context.ds = context.pop();
- context.bx = context.pop();
- context.di = context.pop();
- context.ax = context.pop();
- nextsymbol(context);
- context._add(context.di, 49);
- showframe(context);
- context.al = context.data.byte(kSymbolbotx);
- context.ah = 0;
- context.di = context.ax;
- context._add(context.di, (64)-44);
- context.al = context.data.byte(kSymbolbotnum);
- context._add(context.al, 6);
- context.bx = (56)+49;
- context.ds = context.data.word(kTempgraphics);
- context.ah = 32;
- context.push(context.ax);
- context.push(context.di);
- context.push(context.bx);
- context.push(context.ds);
- showframe(context);
- context.ds = context.pop();
- context.bx = context.pop();
- context.di = context.pop();
- context.ax = context.pop();
- nextsymbol(context);
- context._add(context.di, 49);
- context.push(context.ax);
- context.push(context.di);
- context.push(context.bx);
- context.push(context.ds);
- showframe(context);
- context.ds = context.pop();
- context.bx = context.pop();
- context.di = context.pop();
- context.ax = context.pop();
- nextsymbol(context);
- context._add(context.di, 49);
- showframe(context);
-}
-
-void nextsymbol(Context &context) {
- STACK_CHECK(context);
- context._inc(context.al);
- context._cmp(context.al, 6);
- if (context.flags.z())
+ _cmp(data.word(kMousebutton), 0);
+ if (flags.z())
+ return /* (nobotright) */;
+ data.byte(kSymbolbotdir) = 1;
+}
+
+void DreamGenContext::dumpsymbol() {
+ STACK_CHECK;
+ data.byte(kNewtextline) = 0;
+ di = (64);
+ bx = (56)+20;
+ cl = 104;
+ ch = 60;
+ multidump();
+}
+
+void DreamGenContext::showsymbol() {
+ STACK_CHECK;
+ al = 12;
+ ah = 0;
+ di = (64);
+ bx = (56);
+ ds = data.word(kTempgraphics);
+ showframe();
+ al = data.byte(kSymboltopx);
+ ah = 0;
+ di = ax;
+ _add(di, (64)-44);
+ al = data.byte(kSymboltopnum);
+ bx = (56)+20;
+ ds = data.word(kTempgraphics);
+ ah = 32;
+ push(ax);
+ push(di);
+ push(bx);
+ push(ds);
+ showframe();
+ ds = pop();
+ bx = pop();
+ di = pop();
+ ax = pop();
+ nextsymbol();
+ _add(di, 49);
+ push(ax);
+ push(di);
+ push(bx);
+ push(ds);
+ showframe();
+ ds = pop();
+ bx = pop();
+ di = pop();
+ ax = pop();
+ nextsymbol();
+ _add(di, 49);
+ showframe();
+ al = data.byte(kSymbolbotx);
+ ah = 0;
+ di = ax;
+ _add(di, (64)-44);
+ al = data.byte(kSymbolbotnum);
+ _add(al, 6);
+ bx = (56)+49;
+ ds = data.word(kTempgraphics);
+ ah = 32;
+ push(ax);
+ push(di);
+ push(bx);
+ push(ds);
+ showframe();
+ ds = pop();
+ bx = pop();
+ di = pop();
+ ax = pop();
+ nextsymbol();
+ _add(di, 49);
+ push(ax);
+ push(di);
+ push(bx);
+ push(ds);
+ showframe();
+ ds = pop();
+ bx = pop();
+ di = pop();
+ ax = pop();
+ nextsymbol();
+ _add(di, 49);
+ showframe();
+}
+
+void DreamGenContext::nextsymbol() {
+ STACK_CHECK;
+ _inc(al);
+ _cmp(al, 6);
+ if (flags.z())
goto topwrap;
- context._cmp(context.al, 12);
- if (context.flags.z())
+ _cmp(al, 12);
+ if (flags.z())
goto botwrap;
return;
topwrap:
- context.al = 0;
+ al = 0;
return;
botwrap:
- context.al = 6;
+ al = 6;
}
-void updatesymboltop(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kSymboltopdir), 0);
- if (context.flags.z())
- goto topfinished;
- context._cmp(context.data.byte(kSymboltopdir), -1);
- if (context.flags.z())
+void DreamGenContext::updatesymboltop() {
+ STACK_CHECK;
+ _cmp(data.byte(kSymboltopdir), 0);
+ if (flags.z())
+ return /* (topfinished) */;
+ _cmp(data.byte(kSymboltopdir), -1);
+ if (flags.z())
goto backwards;
- context._inc(context.data.byte(kSymboltopx));
- context._cmp(context.data.byte(kSymboltopx), 49);
- if (!context.flags.z())
+ _inc(data.byte(kSymboltopx));
+ _cmp(data.byte(kSymboltopx), 49);
+ if (!flags.z())
goto notwrapfor;
- context.data.byte(kSymboltopx) = 0;
- context._dec(context.data.byte(kSymboltopnum));
- context._cmp(context.data.byte(kSymboltopnum), -1);
- if (!context.flags.z())
- goto topfinished;
- context.data.byte(kSymboltopnum) = 5;
+ data.byte(kSymboltopx) = 0;
+ _dec(data.byte(kSymboltopnum));
+ _cmp(data.byte(kSymboltopnum), -1);
+ if (!flags.z())
+ return /* (topfinished) */;
+ data.byte(kSymboltopnum) = 5;
return;
notwrapfor:
- context._cmp(context.data.byte(kSymboltopx), 24);
- if (!context.flags.z())
- goto topfinished;
- context.data.byte(kSymboltopdir) = 0;
+ _cmp(data.byte(kSymboltopx), 24);
+ if (!flags.z())
+ return /* (topfinished) */;
+ data.byte(kSymboltopdir) = 0;
return;
backwards:
- context._dec(context.data.byte(kSymboltopx));
- context._cmp(context.data.byte(kSymboltopx), -1);
- if (!context.flags.z())
+ _dec(data.byte(kSymboltopx));
+ _cmp(data.byte(kSymboltopx), -1);
+ if (!flags.z())
goto notwrapback;
- context.data.byte(kSymboltopx) = 48;
- context._inc(context.data.byte(kSymboltopnum));
- context._cmp(context.data.byte(kSymboltopnum), 6);
- if (!context.flags.z())
- goto topfinished;
- context.data.byte(kSymboltopnum) = 0;
+ data.byte(kSymboltopx) = 48;
+ _inc(data.byte(kSymboltopnum));
+ _cmp(data.byte(kSymboltopnum), 6);
+ if (!flags.z())
+ return /* (topfinished) */;
+ data.byte(kSymboltopnum) = 0;
return;
notwrapback:
- context._cmp(context.data.byte(kSymboltopx), 24);
- if (!context.flags.z())
- goto topfinished;
- context.data.byte(kSymboltopdir) = 0;
-topfinished:
- return;
-}
-
-void updatesymbolbot(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kSymbolbotdir), 0);
- if (context.flags.z())
- goto botfinished;
- context._cmp(context.data.byte(kSymbolbotdir), -1);
- if (context.flags.z())
+ _cmp(data.byte(kSymboltopx), 24);
+ if (!flags.z())
+ return /* (topfinished) */;
+ data.byte(kSymboltopdir) = 0;
+}
+
+void DreamGenContext::updatesymbolbot() {
+ STACK_CHECK;
+ _cmp(data.byte(kSymbolbotdir), 0);
+ if (flags.z())
+ return /* (botfinished) */;
+ _cmp(data.byte(kSymbolbotdir), -1);
+ if (flags.z())
goto backwardsbot;
- context._inc(context.data.byte(kSymbolbotx));
- context._cmp(context.data.byte(kSymbolbotx), 49);
- if (!context.flags.z())
+ _inc(data.byte(kSymbolbotx));
+ _cmp(data.byte(kSymbolbotx), 49);
+ if (!flags.z())
goto notwrapforb;
- context.data.byte(kSymbolbotx) = 0;
- context._dec(context.data.byte(kSymbolbotnum));
- context._cmp(context.data.byte(kSymbolbotnum), -1);
- if (!context.flags.z())
- goto botfinished;
- context.data.byte(kSymbolbotnum) = 5;
+ data.byte(kSymbolbotx) = 0;
+ _dec(data.byte(kSymbolbotnum));
+ _cmp(data.byte(kSymbolbotnum), -1);
+ if (!flags.z())
+ return /* (botfinished) */;
+ data.byte(kSymbolbotnum) = 5;
return;
notwrapforb:
- context._cmp(context.data.byte(kSymbolbotx), 24);
- if (!context.flags.z())
- goto botfinished;
- context.data.byte(kSymbolbotdir) = 0;
+ _cmp(data.byte(kSymbolbotx), 24);
+ if (!flags.z())
+ return /* (botfinished) */;
+ data.byte(kSymbolbotdir) = 0;
return;
backwardsbot:
- context._dec(context.data.byte(kSymbolbotx));
- context._cmp(context.data.byte(kSymbolbotx), -1);
- if (!context.flags.z())
+ _dec(data.byte(kSymbolbotx));
+ _cmp(data.byte(kSymbolbotx), -1);
+ if (!flags.z())
goto notwrapbackb;
- context.data.byte(kSymbolbotx) = 48;
- context._inc(context.data.byte(kSymbolbotnum));
- context._cmp(context.data.byte(kSymbolbotnum), 6);
- if (!context.flags.z())
- goto botfinished;
- context.data.byte(kSymbolbotnum) = 0;
+ data.byte(kSymbolbotx) = 48;
+ _inc(data.byte(kSymbolbotnum));
+ _cmp(data.byte(kSymbolbotnum), 6);
+ if (!flags.z())
+ return /* (botfinished) */;
+ data.byte(kSymbolbotnum) = 0;
return;
notwrapbackb:
- context._cmp(context.data.byte(kSymbolbotx), 24);
- if (!context.flags.z())
- goto botfinished;
- context.data.byte(kSymbolbotdir) = 0;
-botfinished:
- return;
-}
-
-void dumpsymbox(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.word(kDumpx), -1);
- if (context.flags.z())
- goto nodumpsym;
- context.di = context.data.word(kDumpx);
- context.bx = context.data.word(kDumpy);
- context.cl = 30;
- context.ch = 77;
- multidump(context);
- context.data.word(kDumpx) = -1;
-nodumpsym:
- return;
-}
-
-void usediary(Context &context) {
- STACK_CHECK(context);
- getridofreels(context);
- context.dx = 2039;
- loadintotemp(context);
- context.dx = 2208;
- loadtemptext(context);
- context.dx = 1883;
- loadtempcharset(context);
- createpanel(context);
- showicon(context);
- showdiary(context);
- undertextline(context);
- showdiarypage(context);
- readmouse(context);
- showpointer(context);
- worktoscreen(context);
- delpointer(context);
- context.data.byte(kGetback) = 0;
+ _cmp(data.byte(kSymbolbotx), 24);
+ if (!flags.z())
+ return /* (botfinished) */;
+ data.byte(kSymbolbotdir) = 0;
+}
+
+void DreamGenContext::dumpsymbox() {
+ STACK_CHECK;
+ _cmp(data.word(kDumpx), -1);
+ if (flags.z())
+ return /* (nodumpsym) */;
+ di = data.word(kDumpx);
+ bx = data.word(kDumpy);
+ cl = 30;
+ ch = 77;
+ multidump();
+ data.word(kDumpx) = -1;
+}
+
+void DreamGenContext::usediary() {
+ STACK_CHECK;
+ getridofreels();
+ dx = 2039;
+ loadintotemp();
+ dx = 2208;
+ loadtemptext();
+ dx = 1883;
+ loadtempcharset();
+ createpanel();
+ showicon();
+ showdiary();
+ undertextline();
+ showdiarypage();
+ readmouse();
+ showpointer();
+ worktoscreen();
+ delpointer();
+ data.byte(kGetback) = 0;
diaryloop:
- delpointer(context);
- readmouse(context);
- showdiarykeys(context);
- showpointer(context);
- vsync(context);
- dumppointer(context);
- dumpdiarykeys(context);
- dumptextline(context);
- context.bx = 3740;
- checkcoords(context);
- context._cmp(context.data.byte(kGetback), 0);
- if (context.flags.z())
+ delpointer();
+ readmouse();
+ showdiarykeys();
+ showpointer();
+ vsync();
+ dumppointer();
+ dumpdiarykeys();
+ dumptextline();
+ bx = 3740;
+ checkcoords();
+ _cmp(data.byte(kGetback), 0);
+ if (flags.z())
goto diaryloop;
- getridoftemp(context);
- getridoftemptext(context);
- getridoftempcharset(context);
- restorereels(context);
- context.data.byte(kManisoffscreen) = 0;
- redrawmainscrn(context);
- worktoscreenm(context);
- return;
- return;
-}
-
-void showdiary(Context &context) {
- STACK_CHECK(context);
- context.al = 1;
- context.ah = 0;
- context.di = (68+24);
- context.bx = (48+12)+37;
- context.ds = context.data.word(kTempgraphics);
- showframe(context);
- context.al = 2;
- context.ah = 0;
- context.di = (68+24)+176;
- context.bx = (48+12)+108;
- context.ds = context.data.word(kTempgraphics);
- showframe(context);
-}
-
-void showdiarykeys(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kPresscount), 0);
- if (context.flags.z())
- goto nokeyatall;
- context._dec(context.data.byte(kPresscount));
- context._cmp(context.data.byte(kPresscount), 0);
- if (context.flags.z())
- goto nokeyatall;
- context._cmp(context.data.byte(kPressed), 'N');
- if (!context.flags.z())
+ getridoftemp();
+ getridoftemptext();
+ getridoftempcharset();
+ restorereels();
+ data.byte(kManisoffscreen) = 0;
+ redrawmainscrn();
+ worktoscreenm();
+}
+
+void DreamGenContext::showdiary() {
+ STACK_CHECK;
+ al = 1;
+ ah = 0;
+ di = (68+24);
+ bx = (48+12)+37;
+ ds = data.word(kTempgraphics);
+ showframe();
+ al = 2;
+ ah = 0;
+ di = (68+24)+176;
+ bx = (48+12)+108;
+ ds = data.word(kTempgraphics);
+ showframe();
+}
+
+void DreamGenContext::showdiarykeys() {
+ STACK_CHECK;
+ _cmp(data.byte(kPresscount), 0);
+ if (flags.z())
+ return /* (nokeyatall) */;
+ _dec(data.byte(kPresscount));
+ _cmp(data.byte(kPresscount), 0);
+ if (flags.z())
+ return /* (nokeyatall) */;
+ _cmp(data.byte(kPressed), 'N');
+ if (!flags.z())
goto nokeyn;
- context.al = 3;
- context._cmp(context.data.byte(kPresscount), 1);
- if (context.flags.z())
+ al = 3;
+ _cmp(data.byte(kPresscount), 1);
+ if (flags.z())
goto gotkeyn;
- context.al = 4;
+ al = 4;
gotkeyn:
- context.ah = 0;
- context.di = (68+24)+94;
- context.bx = (48+12)+97;
- context.ds = context.data.word(kTempgraphics);
- showframe(context);
- context._cmp(context.data.byte(kPresscount), 1);
- if (!context.flags.z())
- goto notshown;
- showdiarypage(context);
-notshown:
+ ah = 0;
+ di = (68+24)+94;
+ bx = (48+12)+97;
+ ds = data.word(kTempgraphics);
+ showframe();
+ _cmp(data.byte(kPresscount), 1);
+ if (!flags.z())
+ return /* (notshown) */;
+ showdiarypage();
return;
nokeyn:
- context.al = 5;
- context._cmp(context.data.byte(kPresscount), 1);
- if (context.flags.z())
+ al = 5;
+ _cmp(data.byte(kPresscount), 1);
+ if (flags.z())
goto gotkeyp;
- context.al = 6;
+ al = 6;
gotkeyp:
- context.ah = 0;
- context.di = (68+24)+151;
- context.bx = (48+12)+71;
- context.ds = context.data.word(kTempgraphics);
- showframe(context);
- context._cmp(context.data.byte(kPresscount), 1);
- if (!context.flags.z())
- goto notshowp;
- showdiarypage(context);
-notshowp:
- return;
-nokeyatall:
- return;
-}
-
-void dumpdiarykeys(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kPresscount), 1);
- if (!context.flags.z())
+ ah = 0;
+ di = (68+24)+151;
+ bx = (48+12)+71;
+ ds = data.word(kTempgraphics);
+ showframe();
+ _cmp(data.byte(kPresscount), 1);
+ if (!flags.z())
+ return /* (notshowp) */;
+ showdiarypage();
+}
+
+void DreamGenContext::dumpdiarykeys() {
+ STACK_CHECK;
+ _cmp(data.byte(kPresscount), 1);
+ if (!flags.z())
goto notdumpdiary;
- context._cmp(context.data.byte(kSartaindead), 1);
- if (context.flags.z())
+ _cmp(data.byte(kSartaindead), 1);
+ if (flags.z())
goto notsartadd;
- context._cmp(context.data.byte(kDiarypage), 5);
- if (!context.flags.z())
+ _cmp(data.byte(kDiarypage), 5);
+ if (!flags.z())
goto notsartadd;
- context._cmp(context.data.byte(kDiarypage), 5);
- if (!context.flags.z())
+ _cmp(data.byte(kDiarypage), 5);
+ if (!flags.z())
goto notsartadd;
- context.al = 6;
- getlocation(context);
- context._cmp(context.al, 1);
- if (context.flags.z())
+ al = 6;
+ getlocation();
+ _cmp(al, 1);
+ if (flags.z())
goto notsartadd;
- context.al = 6;
- setlocation(context);
- delpointer(context);
- context.al = 12;
- findtext1(context);
- context.di = 70;
- context.bx = 106;
- context.dl = 241;
- context.ah = 16;
- printdirect(context);
- worktoscreenm(context);
- context.cx = 200;
- hangonp(context);
- createpanel(context);
- showicon(context);
- showdiary(context);
- showdiarypage(context);
- worktoscreenm(context);
- showpointer(context);
+ al = 6;
+ setlocation();
+ delpointer();
+ al = 12;
+ findtext1();
+ di = 70;
+ bx = 106;
+ dl = 241;
+ ah = 16;
+ printdirect();
+ worktoscreenm();
+ cx = 200;
+ hangonp();
+ createpanel();
+ showicon();
+ showdiary();
+ showdiarypage();
+ worktoscreenm();
+ showpointer();
return;
notsartadd:
- context.di = (68+24)+48;
- context.bx = (48+12)+15;
- context.cl = 200;
- context.ch = 16;
- multidump(context);
+ di = (68+24)+48;
+ bx = (48+12)+15;
+ cl = 200;
+ ch = 16;
+ multidump();
notdumpdiary:
- context.di = (68+24)+94;
- context.bx = (48+12)+97;
- context.cl = 16;
- context.ch = 16;
- multidump(context);
- context.di = (68+24)+151;
- context.bx = (48+12)+71;
- context.cl = 16;
- context.ch = 16;
- multidump(context);
-}
-
-void diarykeyp(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kCommandtype), 214);
- if (context.flags.z())
+ di = (68+24)+94;
+ bx = (48+12)+97;
+ cl = 16;
+ ch = 16;
+ multidump();
+ di = (68+24)+151;
+ bx = (48+12)+71;
+ cl = 16;
+ ch = 16;
+ multidump();
+}
+
+void DreamGenContext::diarykeyp() {
+ STACK_CHECK;
+ _cmp(data.byte(kCommandtype), 214);
+ if (flags.z())
goto alreadykeyp;
- context.data.byte(kCommandtype) = 214;
- context.al = 23;
- commandonly(context);
+ data.byte(kCommandtype) = 214;
+ al = 23;
+ commandonly();
alreadykeyp:
- context._cmp(context.data.word(kMousebutton), 0);
- if (context.flags.z())
- goto notkeyp;
- context.ax = context.data.word(kOldbutton);
- context._cmp(context.ax, context.data.word(kMousebutton));
- if (context.flags.z())
- goto notkeyp;
- context._cmp(context.data.byte(kPresscount), 0);
- if (!context.flags.z())
- goto notkeyp;
- context.al = 16;
- playchannel1(context);
- context.data.byte(kPresscount) = 12;
- context.data.byte(kPressed) = 'P';
- context._dec(context.data.byte(kDiarypage));
- context._cmp(context.data.byte(kDiarypage), -1);
- if (!context.flags.z())
- goto notkeyp;
- context.data.byte(kDiarypage) = 11;
-notkeyp:
- return;
-}
-
-void diarykeyn(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kCommandtype), 213);
- if (context.flags.z())
+ _cmp(data.word(kMousebutton), 0);
+ if (flags.z())
+ return /* (notkeyp) */;
+ ax = data.word(kOldbutton);
+ _cmp(ax, data.word(kMousebutton));
+ if (flags.z())
+ return /* (notkeyp) */;
+ _cmp(data.byte(kPresscount), 0);
+ if (!flags.z())
+ return /* (notkeyp) */;
+ al = 16;
+ playchannel1();
+ data.byte(kPresscount) = 12;
+ data.byte(kPressed) = 'P';
+ _dec(data.byte(kDiarypage));
+ _cmp(data.byte(kDiarypage), -1);
+ if (!flags.z())
+ return /* (notkeyp) */;
+ data.byte(kDiarypage) = 11;
+}
+
+void DreamGenContext::diarykeyn() {
+ STACK_CHECK;
+ _cmp(data.byte(kCommandtype), 213);
+ if (flags.z())
goto alreadykeyn;
- context.data.byte(kCommandtype) = 213;
- context.al = 23;
- commandonly(context);
+ data.byte(kCommandtype) = 213;
+ al = 23;
+ commandonly();
alreadykeyn:
- context._cmp(context.data.word(kMousebutton), 0);
- if (context.flags.z())
- goto notkeyn;
- context.ax = context.data.word(kOldbutton);
- context._cmp(context.ax, context.data.word(kMousebutton));
- if (context.flags.z())
- goto notkeyn;
- context._cmp(context.data.byte(kPresscount), 0);
- if (!context.flags.z())
- goto notkeyn;
- context.al = 16;
- playchannel1(context);
- context.data.byte(kPresscount) = 12;
- context.data.byte(kPressed) = 'N';
- context._inc(context.data.byte(kDiarypage));
- context._cmp(context.data.byte(kDiarypage), 12);
- if (!context.flags.z())
- goto notkeyn;
- context.data.byte(kDiarypage) = 0;
-notkeyn:
- return;
-}
-
-void showdiarypage(Context &context) {
- STACK_CHECK(context);
- context.al = 0;
- context.ah = 0;
- context.di = (68+24);
- context.bx = (48+12);
- context.ds = context.data.word(kTempgraphics);
- showframe(context);
- context.al = context.data.byte(kDiarypage);
- findtext1(context);
- context.data.byte(kKerning) = 1;
- usetempcharset(context);
- context.di = (68+24)+48;
- context.bx = (48+12)+16;
- context.dl = 240;
- context.ah = 16;
- context.data.word(kCharshift) = 91+91;
- printdirect(context);
- context.di = (68+24)+129;
- context.bx = (48+12)+16;
- context.dl = 240;
- context.ah = 16;
- printdirect(context);
- context.di = (68+24)+48;
- context.bx = (48+12)+23;
- context.dl = 240;
- context.ah = 16;
- printdirect(context);
- context.data.byte(kKerning) = 0;
- context.data.word(kCharshift) = 0;
- usecharset1(context);
-}
-
-void findtext1(Context &context) {
- STACK_CHECK(context);
- context.ah = 0;
- context.si = context.ax;
- context._add(context.si, context.si);
- context.es = context.data.word(kTextfile1);
- context.ax = context.es.word(context.si);
- context._add(context.ax, (66*2));
- context.si = context.ax;
-}
-
-void zoomonoff(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.word(kWatchingtime), 0);
- if (!context.flags.z())
- { blank(context); return; };
- context._cmp(context.data.byte(kPointermode), 2);
- if (context.flags.z())
- { blank(context); return; };
- context._cmp(context.data.byte(kCommandtype), 222);
- if (context.flags.z())
+ _cmp(data.word(kMousebutton), 0);
+ if (flags.z())
+ return /* (notkeyn) */;
+ ax = data.word(kOldbutton);
+ _cmp(ax, data.word(kMousebutton));
+ if (flags.z())
+ return /* (notkeyn) */;
+ _cmp(data.byte(kPresscount), 0);
+ if (!flags.z())
+ return /* (notkeyn) */;
+ al = 16;
+ playchannel1();
+ data.byte(kPresscount) = 12;
+ data.byte(kPressed) = 'N';
+ _inc(data.byte(kDiarypage));
+ _cmp(data.byte(kDiarypage), 12);
+ if (!flags.z())
+ return /* (notkeyn) */;
+ data.byte(kDiarypage) = 0;
+}
+
+void DreamGenContext::showdiarypage() {
+ STACK_CHECK;
+ al = 0;
+ ah = 0;
+ di = (68+24);
+ bx = (48+12);
+ ds = data.word(kTempgraphics);
+ showframe();
+ al = data.byte(kDiarypage);
+ findtext1();
+ data.byte(kKerning) = 1;
+ usetempcharset();
+ di = (68+24)+48;
+ bx = (48+12)+16;
+ dl = 240;
+ ah = 16;
+ data.word(kCharshift) = 91+91;
+ printdirect();
+ di = (68+24)+129;
+ bx = (48+12)+16;
+ dl = 240;
+ ah = 16;
+ printdirect();
+ di = (68+24)+48;
+ bx = (48+12)+23;
+ dl = 240;
+ ah = 16;
+ printdirect();
+ data.byte(kKerning) = 0;
+ data.word(kCharshift) = 0;
+ usecharset1();
+}
+
+void DreamGenContext::findtext1() {
+ STACK_CHECK;
+ ah = 0;
+ si = ax;
+ _add(si, si);
+ es = data.word(kTextfile1);
+ ax = es.word(si);
+ _add(ax, (66*2));
+ si = ax;
+}
+
+void DreamGenContext::zoomonoff() {
+ STACK_CHECK;
+ _cmp(data.word(kWatchingtime), 0);
+ if (!flags.z())
+ { blank(); return; };
+ _cmp(data.byte(kPointermode), 2);
+ if (flags.z())
+ { blank(); return; };
+ _cmp(data.byte(kCommandtype), 222);
+ if (flags.z())
goto alreadyonoff;
- context.data.byte(kCommandtype) = 222;
- context.al = 39;
- commandonly(context);
+ data.byte(kCommandtype) = 222;
+ al = 39;
+ commandonly();
alreadyonoff:
- context.ax = context.data.word(kMousebutton);
- context._cmp(context.ax, context.data.word(kOldbutton));
- if (context.flags.z())
- goto nozoomonoff;
- context._and(context.ax, 1);
- if (!context.flags.z())
+ ax = data.word(kMousebutton);
+ _cmp(ax, data.word(kOldbutton));
+ if (flags.z())
+ return /* (nozoomonoff) */;
+ _and(ax, 1);
+ if (!flags.z())
goto dozoomonoff;
-nozoomonoff:
return;
dozoomonoff:
- context.al = context.data.byte(kZoomon);
- context._xor(context.al, 1);
- context.data.byte(kZoomon) = context.al;
- createpanel(context);
- context.data.byte(kNewobs) = 0;
- drawfloor(context);
- printsprites(context);
- reelsonscreen(context);
- showicon(context);
- getunderzoom(context);
- undertextline(context);
- context.al = 39;
- commandonly(context);
- readmouse(context);
- worktoscreenm(context);
-}
-
-void saveload(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.word(kWatchingtime), 0);
- if (!context.flags.z())
- { blank(context); return; };
- context._cmp(context.data.byte(kPointermode), 2);
- if (context.flags.z())
- { blank(context); return; };
- context._cmp(context.data.byte(kCommandtype), 253);
- if (context.flags.z())
+ al = data.byte(kZoomon);
+ _xor(al, 1);
+ data.byte(kZoomon) = al;
+ createpanel();
+ data.byte(kNewobs) = 0;
+ drawfloor();
+ printsprites();
+ reelsonscreen();
+ showicon();
+ getunderzoom();
+ undertextline();
+ al = 39;
+ commandonly();
+ readmouse();
+ worktoscreenm();
+}
+
+void DreamGenContext::saveload() {
+ STACK_CHECK;
+ _cmp(data.word(kWatchingtime), 0);
+ if (!flags.z())
+ { blank(); return; };
+ _cmp(data.byte(kPointermode), 2);
+ if (flags.z())
+ { blank(); return; };
+ _cmp(data.byte(kCommandtype), 253);
+ if (flags.z())
goto alreadyops;
- context.data.byte(kCommandtype) = 253;
- context.al = 43;
- commandonly(context);
+ data.byte(kCommandtype) = 253;
+ al = 43;
+ commandonly();
alreadyops:
- context.ax = context.data.word(kMousebutton);
- context._cmp(context.ax, context.data.word(kOldbutton));
- if (context.flags.z())
- goto noops;
- context._and(context.ax, 1);
- if (context.flags.z())
- goto noops;
- dosaveload(context);
-noops:
- return;
-}
-
-void dosaveload(Context &context) {
- STACK_CHECK(context);
- context.data.byte(kPointerframe) = 0;
- context.data.word(kTextaddressx) = 70;
- context.data.word(kTextaddressy) = 182-8;
- context.data.byte(kTextlen) = 181;
- context.data.byte(kManisoffscreen) = 1;
- clearwork(context);
- createpanel2(context);
- undertextline(context);
- getridofall(context);
- loadsavebox(context);
- showopbox(context);
- showmainops(context);
- worktoscreen(context);
+ ax = data.word(kMousebutton);
+ _cmp(ax, data.word(kOldbutton));
+ if (flags.z())
+ return /* (noops) */;
+ _and(ax, 1);
+ if (flags.z())
+ return /* (noops) */;
+ dosaveload();
+}
+
+void DreamGenContext::dosaveload() {
+ STACK_CHECK;
+ data.byte(kPointerframe) = 0;
+ data.word(kTextaddressx) = 70;
+ data.word(kTextaddressy) = 182-8;
+ data.byte(kTextlen) = 181;
+ data.byte(kManisoffscreen) = 1;
+ clearwork();
+ createpanel2();
+ undertextline();
+ getridofall();
+ loadsavebox();
+ showopbox();
+ showmainops();
+ worktoscreen();
goto donefirstops;
restartops:
- showopbox(context);
- showmainops(context);
- worktoscreenm(context);
+ showopbox();
+ showmainops();
+ worktoscreenm();
donefirstops:
- context.data.byte(kGetback) = 0;
+ data.byte(kGetback) = 0;
waitops:
- readmouse(context);
- showpointer(context);
- vsync(context);
- dumppointer(context);
- dumptextline(context);
- delpointer(context);
- context.bx = 3782;
- checkcoords(context);
- context._cmp(context.data.byte(kGetback), 0);
- if (context.flags.z())
+ _cmp(data.byte(kQuitrequested), 0);
+ if (!flags.z())
+ goto justret;
+ readmouse();
+ showpointer();
+ vsync();
+ dumppointer();
+ dumptextline();
+ delpointer();
+ bx = 3782;
+ checkcoords();
+ _cmp(data.byte(kGetback), 0);
+ if (flags.z())
goto waitops;
- context._cmp(context.data.byte(kGetback), 2);
- if (context.flags.z())
+ _cmp(data.byte(kGetback), 2);
+ if (flags.z())
goto restartops;
- context.data.word(kTextaddressx) = 13;
- context.data.word(kTextaddressy) = 182;
- context.data.byte(kTextlen) = 240;
- context._cmp(context.data.byte(kGetback), 4);
- if (context.flags.z())
+ data.word(kTextaddressx) = 13;
+ data.word(kTextaddressy) = 182;
+ data.byte(kTextlen) = 240;
+ _cmp(data.byte(kGetback), 4);
+ if (flags.z())
goto justret;
- getridoftemp(context);
- restoreall(context);
- redrawmainscrn(context);
- worktoscreenm(context);
- context.data.byte(kCommandtype) = 200;
+ getridoftemp();
+ restoreall();
+ redrawmainscrn();
+ worktoscreenm();
+ data.byte(kCommandtype) = 200;
justret:
- context.data.byte(kManisoffscreen) = 0;
+ data.byte(kManisoffscreen) = 0;
}
-void getbackfromops(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kMandead), 2);
- if (context.flags.z())
+void DreamGenContext::getbackfromops() {
+ STACK_CHECK;
+ _cmp(data.byte(kMandead), 2);
+ if (flags.z())
goto opsblock1;
- getback1(context);
+ getback1();
return;
opsblock1:
- blank(context);
-}
-
-void showmainops(Context &context) {
- STACK_CHECK(context);
- context.ds = context.data.word(kTempgraphics);
- context.di = (60)+10;
- context.bx = (52)+10;
- context.al = 8;
- context.ah = 0;
- showframe(context);
- context.ds = context.data.word(kTempgraphics);
- context.di = (60)+59;
- context.bx = (52)+30;
- context.al = 7;
- context.ah = 0;
- showframe(context);
- context.ds = context.data.word(kTempgraphics);
- context.di = (60)+128+4;
- context.bx = (52)+12;
- context.al = 1;
- context.ah = 0;
- showframe(context);
-}
-
-void showdiscops(Context &context) {
- STACK_CHECK(context);
- context.ds = context.data.word(kTempgraphics);
- context.di = (60)+128+4;
- context.bx = (52)+12;
- context.al = 1;
- context.ah = 0;
- showframe(context);
- context.ds = context.data.word(kTempgraphics);
- context.di = (60)+10;
- context.bx = (52)+10;
- context.al = 9;
- context.ah = 0;
- showframe(context);
- context.ds = context.data.word(kTempgraphics);
- context.di = (60)+59;
- context.bx = (52)+30;
- context.al = 10;
- context.ah = 0;
- showframe(context);
- context.ds = context.data.word(kTempgraphics);
- context.di = (60)+176+2;
- context.bx = (52)+60-4;
- context.al = 5;
- context.ah = 0;
- showframe(context);
-}
-
-void loadsavebox(Context &context) {
- STACK_CHECK(context);
- context.dx = 1961;
- loadintotemp(context);
-}
-
-void loadgame(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kCommandtype), 246);
- if (context.flags.z())
+ blank();
+}
+
+void DreamGenContext::showmainops() {
+ STACK_CHECK;
+ ds = data.word(kTempgraphics);
+ di = (60)+10;
+ bx = (52)+10;
+ al = 8;
+ ah = 0;
+ showframe();
+ ds = data.word(kTempgraphics);
+ di = (60)+59;
+ bx = (52)+30;
+ al = 7;
+ ah = 0;
+ showframe();
+ ds = data.word(kTempgraphics);
+ di = (60)+128+4;
+ bx = (52)+12;
+ al = 1;
+ ah = 0;
+ showframe();
+}
+
+void DreamGenContext::showdiscops() {
+ STACK_CHECK;
+ ds = data.word(kTempgraphics);
+ di = (60)+128+4;
+ bx = (52)+12;
+ al = 1;
+ ah = 0;
+ showframe();
+ ds = data.word(kTempgraphics);
+ di = (60)+10;
+ bx = (52)+10;
+ al = 9;
+ ah = 0;
+ showframe();
+ ds = data.word(kTempgraphics);
+ di = (60)+59;
+ bx = (52)+30;
+ al = 10;
+ ah = 0;
+ showframe();
+ ds = data.word(kTempgraphics);
+ di = (60)+176+2;
+ bx = (52)+60-4;
+ al = 5;
+ ah = 0;
+ showframe();
+}
+
+void DreamGenContext::loadsavebox() {
+ STACK_CHECK;
+ dx = 1961;
+ loadintotemp();
+}
+
+void DreamGenContext::loadgame() {
+ STACK_CHECK;
+ _cmp(data.byte(kCommandtype), 246);
+ if (flags.z())
goto alreadyload;
- context.data.byte(kCommandtype) = 246;
- context.al = 41;
- commandonly(context);
+ data.byte(kCommandtype) = 246;
+ al = 41;
+ commandonly();
alreadyload:
- context.ax = context.data.word(kMousebutton);
- context._cmp(context.ax, context.data.word(kOldbutton));
- if (context.flags.z())
- goto noload;
- context._cmp(context.ax, 1);
- if (context.flags.z())
+ ax = data.word(kMousebutton);
+ _cmp(ax, data.word(kOldbutton));
+ if (flags.z())
+ return /* (noload) */;
+ _cmp(ax, 1);
+ if (flags.z())
goto doload;
-noload:
return;
doload:
- context.data.byte(kLoadingorsave) = 1;
- showopbox(context);
- showloadops(context);
- context.data.byte(kCurrentslot) = 0;
- showslots(context);
- shownames(context);
- context.data.byte(kPointerframe) = 0;
- worktoscreenm(context);
- namestoold(context);
- context.data.byte(kGetback) = 0;
+ data.byte(kLoadingorsave) = 1;
+ showopbox();
+ showloadops();
+ data.byte(kCurrentslot) = 0;
+ showslots();
+ shownames();
+ data.byte(kPointerframe) = 0;
+ worktoscreenm();
+ namestoold();
+ data.byte(kGetback) = 0;
loadops:
- delpointer(context);
- readmouse(context);
- showpointer(context);
- vsync(context);
- dumppointer(context);
- dumptextline(context);
- context.bx = 3824;
- checkcoords(context);
- context._cmp(context.data.byte(kGetback), 0);
- if (context.flags.z())
+ _cmp(data.byte(kQuitrequested), 0);
+ if (!flags.z())
+ return /* (quitloaded) */;
+ delpointer();
+ readmouse();
+ showpointer();
+ vsync();
+ dumppointer();
+ dumptextline();
+ bx = 3824;
+ checkcoords();
+ _cmp(data.byte(kGetback), 0);
+ if (flags.z())
goto loadops;
- context._cmp(context.data.byte(kGetback), 2);
- if (context.flags.z())
- goto quitloaded;
- getridoftemp(context);
- context.dx = context.data;
- context.es = context.dx;
- context.bx = 7979;
- startloading(context);
- loadroomssample(context);
- context.data.byte(kRoomloaded) = 1;
- context.data.byte(kNewlocation) = 255;
- clearsprites(context);
- initman(context);
- initrain(context);
- context.data.word(kTextaddressx) = 13;
- context.data.word(kTextaddressy) = 182;
- context.data.byte(kTextlen) = 240;
- startup(context);
- worktoscreen(context);
- context.data.byte(kGetback) = 4;
-quitloaded:
- return;
-}
-
-void getbacktoops(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kCommandtype), 201);
- if (context.flags.z())
+ _cmp(data.byte(kGetback), 2);
+ if (flags.z())
+ return /* (quitloaded) */;
+ getridoftemp();
+ dx = data;
+ es = dx;
+ bx = 7979;
+ startloading();
+ loadroomssample();
+ data.byte(kRoomloaded) = 1;
+ data.byte(kNewlocation) = 255;
+ clearsprites();
+ initman();
+ initrain();
+ data.word(kTextaddressx) = 13;
+ data.word(kTextaddressy) = 182;
+ data.byte(kTextlen) = 240;
+ startup();
+ worktoscreen();
+ data.byte(kGetback) = 4;
+}
+
+void DreamGenContext::getbacktoops() {
+ STACK_CHECK;
+ _cmp(data.byte(kCommandtype), 201);
+ if (flags.z())
goto alreadygetops;
- context.data.byte(kCommandtype) = 201;
- context.al = 42;
- commandonly(context);
+ data.byte(kCommandtype) = 201;
+ al = 42;
+ commandonly();
alreadygetops:
- context.ax = context.data.word(kMousebutton);
- context._cmp(context.ax, context.data.word(kOldbutton));
- if (context.flags.z())
- goto nogetbackops;
- context._and(context.ax, 1);
- if (!context.flags.z())
+ ax = data.word(kMousebutton);
+ _cmp(ax, data.word(kOldbutton));
+ if (flags.z())
+ return /* (nogetbackops) */;
+ _and(ax, 1);
+ if (!flags.z())
goto dogetbackops;
-nogetbackops:
return;
dogetbackops:
- oldtonames(context);
- context.data.byte(kGetback) = 2;
+ oldtonames();
+ data.byte(kGetback) = 2;
}
-void discops(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kCommandtype), 249);
- if (context.flags.z())
+void DreamGenContext::discops() {
+ STACK_CHECK;
+ _cmp(data.byte(kCommandtype), 249);
+ if (flags.z())
goto alreadydiscops;
- context.data.byte(kCommandtype) = 249;
- context.al = 43;
- commandonly(context);
+ data.byte(kCommandtype) = 249;
+ al = 43;
+ commandonly();
alreadydiscops:
- context.ax = context.data.word(kMousebutton);
- context._cmp(context.ax, context.data.word(kOldbutton));
- if (context.flags.z())
- goto nodiscops;
- context._and(context.ax, 1);
- if (!context.flags.z())
+ ax = data.word(kMousebutton);
+ _cmp(ax, data.word(kOldbutton));
+ if (flags.z())
+ return /* (nodiscops) */;
+ _and(ax, 1);
+ if (!flags.z())
goto dodiscops;
-nodiscops:
return;
dodiscops:
- scanfornames(context);
- context.data.byte(kLoadingorsave) = 2;
- showopbox(context);
- showdiscops(context);
- context.data.byte(kCurrentslot) = 0;
- worktoscreenm(context);
- context.data.byte(kGetback) = 0;
+ scanfornames();
+ data.byte(kLoadingorsave) = 2;
+ showopbox();
+ showdiscops();
+ data.byte(kCurrentslot) = 0;
+ worktoscreenm();
+ data.byte(kGetback) = 0;
discopsloop:
- delpointer(context);
- readmouse(context);
- showpointer(context);
- vsync(context);
- dumppointer(context);
- dumptextline(context);
- context.bx = 3866;
- checkcoords(context);
- context._cmp(context.data.byte(kGetback), 0);
- if (context.flags.z())
+ _cmp(data.byte(kQuitrequested), 0);
+ if (!flags.z())
+ return /* (quitdiscops) */;
+ delpointer();
+ readmouse();
+ showpointer();
+ vsync();
+ dumppointer();
+ dumptextline();
+ bx = 3866;
+ checkcoords();
+ _cmp(data.byte(kGetback), 0);
+ if (flags.z())
goto discopsloop;
}
-void savegame(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kMandead), 2);
- if (!context.flags.z())
+void DreamGenContext::savegame() {
+ STACK_CHECK;
+ _cmp(data.byte(kMandead), 2);
+ if (!flags.z())
goto cansaveok;
- blank(context);
+ blank();
return;
cansaveok:
- context._cmp(context.data.byte(kCommandtype), 247);
- if (context.flags.z())
+ _cmp(data.byte(kCommandtype), 247);
+ if (flags.z())
goto alreadysave;
- context.data.byte(kCommandtype) = 247;
- context.al = 44;
- commandonly(context);
+ data.byte(kCommandtype) = 247;
+ al = 44;
+ commandonly();
alreadysave:
- context.ax = context.data.word(kMousebutton);
- context._and(context.ax, 1);
- if (!context.flags.z())
+ ax = data.word(kMousebutton);
+ _and(ax, 1);
+ if (!flags.z())
goto dosave;
return;
dosave:
- context.data.byte(kLoadingorsave) = 2;
- showopbox(context);
- showsaveops(context);
- context.data.byte(kCurrentslot) = 0;
- showslots(context);
- shownames(context);
- worktoscreenm(context);
- namestoold(context);
- context.data.word(kBufferin) = 0;
- context.data.word(kBufferout) = 0;
- context.data.byte(kGetback) = 0;
+ data.byte(kLoadingorsave) = 2;
+ showopbox();
+ showsaveops();
+ data.byte(kCurrentslot) = 0;
+ showslots();
+ shownames();
+ worktoscreenm();
+ namestoold();
+ data.word(kBufferin) = 0;
+ data.word(kBufferout) = 0;
+ data.byte(kGetback) = 0;
saveops:
- delpointer(context);
- checkinput(context);
- readmouse(context);
- showpointer(context);
- vsync(context);
- dumppointer(context);
- dumptextline(context);
- context.bx = 3908;
- checkcoords(context);
- context._cmp(context.data.byte(kGetback), 0);
- if (context.flags.z())
+ _cmp(data.byte(kQuitrequested), 0);
+ if (!flags.z())
+ return /* (quitsavegame) */;
+ delpointer();
+ checkinput();
+ readmouse();
+ showpointer();
+ vsync();
+ dumppointer();
+ dumptextline();
+ bx = 3908;
+ checkcoords();
+ _cmp(data.byte(kGetback), 0);
+ if (flags.z())
goto saveops;
}
-void actualsave(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kCommandtype), 222);
- if (context.flags.z())
+void DreamGenContext::actualsave() {
+ STACK_CHECK;
+ _cmp(data.byte(kCommandtype), 222);
+ if (flags.z())
goto alreadyactsave;
- context.data.byte(kCommandtype) = 222;
- context.al = 44;
- commandonly(context);
+ data.byte(kCommandtype) = 222;
+ al = 44;
+ commandonly();
alreadyactsave:
- context.ax = context.data.word(kMousebutton);
- context._and(context.ax, 1);
- if (context.flags.z())
- goto noactsave;
- context.dx = context.data;
- context.ds = context.dx;
- context.si = 8579;
- context.al = context.data.byte(kCurrentslot);
- context.ah = 0;
- context.cx = 17;
- context._mul(context.cx);
- context._add(context.si, context.ax);
- context._inc(context.si);
- context._cmp(context.ds.byte(context.si), 0);
- if (context.flags.z())
- goto noactsave;
- context.al = context.data.byte(kLocation);
- context.ah = 0;
- context.cx = 32;
- context._mul(context.cx);
- context.ds = context.cs;
- context.si = 6187;
- context._add(context.si, context.ax);
- context.di = 7979;
- context.bx = context.di;
- context.es = context.cs;
- context.cx = 16;
- context._movsw(context.cx);
- context.al = context.data.byte(kRoomssample);
- context.es.byte(context.bx+13) = context.al;
- context.al = context.data.byte(kMapx);
- context.es.byte(context.bx+15) = context.al;
- context.al = context.data.byte(kMapy);
- context.es.byte(context.bx+16) = context.al;
- context.al = context.data.byte(kLiftflag);
- context.es.byte(context.bx+20) = context.al;
- context.al = context.data.byte(kManspath);
- context.es.byte(context.bx+21) = context.al;
- context.al = context.data.byte(kFacing);
- context.es.byte(context.bx+22) = context.al;
- context.al = 255;
- context.es.byte(context.bx+27) = context.al;
- saveposition(context);
- getridoftemp(context);
- restoreall(context);
- context.data.word(kTextaddressx) = 13;
- context.data.word(kTextaddressy) = 182;
- context.data.byte(kTextlen) = 240;
- redrawmainscrn(context);
- worktoscreenm(context);
- context.data.byte(kGetback) = 4;
-noactsave:
- return;
-}
-
-void actualload(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kCommandtype), 221);
- if (context.flags.z())
+ ax = data.word(kMousebutton);
+ _and(ax, 1);
+ if (flags.z())
+ return /* (noactsave) */;
+ dx = data;
+ ds = dx;
+ si = 8579;
+ al = data.byte(kCurrentslot);
+ ah = 0;
+ cx = 17;
+ _mul(cx);
+ _add(si, ax);
+ _inc(si);
+ _cmp(ds.byte(si), 0);
+ if (flags.z())
+ return /* (noactsave) */;
+ al = data.byte(kLocation);
+ ah = 0;
+ cx = 32;
+ _mul(cx);
+ ds = cs;
+ si = 6187;
+ _add(si, ax);
+ di = 7979;
+ bx = di;
+ es = cs;
+ cx = 16;
+ _movsw(cx, true);
+ al = data.byte(kRoomssample);
+ es.byte(bx+13) = al;
+ al = data.byte(kMapx);
+ es.byte(bx+15) = al;
+ al = data.byte(kMapy);
+ es.byte(bx+16) = al;
+ al = data.byte(kLiftflag);
+ es.byte(bx+20) = al;
+ al = data.byte(kManspath);
+ es.byte(bx+21) = al;
+ al = data.byte(kFacing);
+ es.byte(bx+22) = al;
+ al = 255;
+ es.byte(bx+27) = al;
+ saveposition();
+ getridoftemp();
+ restoreall();
+ data.word(kTextaddressx) = 13;
+ data.word(kTextaddressy) = 182;
+ data.byte(kTextlen) = 240;
+ redrawmainscrn();
+ worktoscreenm();
+ data.byte(kGetback) = 4;
+}
+
+void DreamGenContext::actualload() {
+ STACK_CHECK;
+ _cmp(data.byte(kCommandtype), 221);
+ if (flags.z())
goto alreadyactload;
- context.data.byte(kCommandtype) = 221;
- context.al = 41;
- commandonly(context);
+ data.byte(kCommandtype) = 221;
+ al = 41;
+ commandonly();
alreadyactload:
- context.ax = context.data.word(kMousebutton);
- context._cmp(context.ax, context.data.word(kOldbutton));
- if (context.flags.z())
- goto notactload;
- context._cmp(context.ax, 1);
- if (!context.flags.z())
- goto notactload;
- context.dx = context.data;
- context.ds = context.dx;
- context.si = 8579;
- context.al = context.data.byte(kCurrentslot);
- context.ah = 0;
- context.cx = 17;
- context._mul(context.cx);
- context._add(context.si, context.ax);
- context._inc(context.si);
- context._cmp(context.ds.byte(context.si), 0);
- if (context.flags.z())
- goto notactload;
- loadposition(context);
- context.data.byte(kGetback) = 1;
-notactload:
- return;
-}
-
-void selectslot2(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.word(kMousebutton), 0);
- if (context.flags.z())
+ ax = data.word(kMousebutton);
+ _cmp(ax, data.word(kOldbutton));
+ if (flags.z())
+ return /* (notactload) */;
+ _cmp(ax, 1);
+ if (!flags.z())
+ return /* (notactload) */;
+ dx = data;
+ ds = dx;
+ si = 8579;
+ al = data.byte(kCurrentslot);
+ ah = 0;
+ cx = 17;
+ _mul(cx);
+ _add(si, ax);
+ _inc(si);
+ _cmp(ds.byte(si), 0);
+ if (flags.z())
+ return /* (notactload) */;
+ loadposition();
+ data.byte(kGetback) = 1;
+}
+
+void DreamGenContext::selectslot2() {
+ STACK_CHECK;
+ _cmp(data.word(kMousebutton), 0);
+ if (flags.z())
goto noselslot2;
- context.data.byte(kLoadingorsave) = 2;
+ data.byte(kLoadingorsave) = 2;
noselslot2:
- selectslot(context);
-}
-
-void checkinput(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kLoadingorsave), 3);
- if (context.flags.z())
- goto nokeypress;
- readkey(context);
- context.al = context.data.byte(kCurrentkey);
- context._cmp(context.al, 0);
- if (context.flags.z())
- goto nokeypress;
- context._cmp(context.al, 13);
- if (!context.flags.z())
+ selectslot();
+}
+
+void DreamGenContext::checkinput() {
+ STACK_CHECK;
+ _cmp(data.byte(kLoadingorsave), 3);
+ if (flags.z())
+ return /* (nokeypress) */;
+ readkey();
+ al = data.byte(kCurrentkey);
+ _cmp(al, 0);
+ if (flags.z())
+ return /* (nokeypress) */;
+ _cmp(al, 13);
+ if (!flags.z())
goto notret;
- context.data.byte(kLoadingorsave) = 3;
+ data.byte(kLoadingorsave) = 3;
goto afterkey;
notret:
- context._cmp(context.al, 8);
- if (!context.flags.z())
+ _cmp(al, 8);
+ if (!flags.z())
goto nodel2;
- context._cmp(context.data.byte(kCursorpos), 0);
- if (context.flags.z())
- goto nokeypress;
- getnamepos(context);
- context._dec(context.data.byte(kCursorpos));
- context.es.byte(context.bx) = 0;
- context.es.byte(context.bx+1) = 1;
+ _cmp(data.byte(kCursorpos), 0);
+ if (flags.z())
+ return /* (nokeypress) */;
+ getnamepos();
+ _dec(data.byte(kCursorpos));
+ es.byte(bx) = 0;
+ es.byte(bx+1) = 1;
goto afterkey;
nodel2:
- context._cmp(context.data.byte(kCursorpos), 14);
- if (context.flags.z())
- goto nokeypress;
- getnamepos(context);
- context._inc(context.data.byte(kCursorpos));
- context.al = context.data.byte(kCurrentkey);
- context.es.byte(context.bx+1) = context.al;
- context.es.byte(context.bx+2) = 0;
- context.es.byte(context.bx+3) = 1;
+ _cmp(data.byte(kCursorpos), 14);
+ if (flags.z())
+ return /* (nokeypress) */;
+ getnamepos();
+ _inc(data.byte(kCursorpos));
+ al = data.byte(kCurrentkey);
+ es.byte(bx+1) = al;
+ es.byte(bx+2) = 0;
+ es.byte(bx+3) = 1;
goto afterkey;
-nokeypress:
return;
afterkey:
- showopbox(context);
- shownames(context);
- showslots(context);
- showsaveops(context);
- worktoscreenm(context);
-}
-
-void getnamepos(Context &context) {
- STACK_CHECK(context);
- context.al = context.data.byte(kCurrentslot);
- context.ah = 0;
- context.cx = 17;
- context._mul(context.cx);
- context.dx = context.data;
- context.es = context.dx;
- context.bx = 8579;
- context._add(context.bx, context.ax);
- context.al = context.data.byte(kCursorpos);
- context.ah = 0;
- context._add(context.bx, context.ax);
-}
-
-void showopbox(Context &context) {
- STACK_CHECK(context);
- context.ds = context.data.word(kTempgraphics);
- context.di = (60);
- context.bx = (52);
- context.al = 0;
- context.ah = 0;
- showframe(context);
- context.ds = context.data.word(kTempgraphics);
- context.di = (60);
- context.bx = (52)+55;
- context.al = 4;
- context.ah = 0;
- showframe(context);
-}
-
-void showloadops(Context &context) {
- STACK_CHECK(context);
- context.ds = context.data.word(kTempgraphics);
- context.di = (60)+128+4;
- context.bx = (52)+12;
- context.al = 1;
- context.ah = 0;
- showframe(context);
- context.ds = context.data.word(kTempgraphics);
- context.di = (60)+176+2;
- context.bx = (52)+60-4;
- context.al = 5;
- context.ah = 0;
- showframe(context);
- context.di = (60)+104;
- context.bx = (52)+14;
- context.al = 55;
- context.dl = 101;
- printmessage(context);
-}
-
-void showsaveops(Context &context) {
- STACK_CHECK(context);
- context.ds = context.data.word(kTempgraphics);
- context.di = (60)+128+4;
- context.bx = (52)+12;
- context.al = 1;
- context.ah = 0;
- showframe(context);
- context.ds = context.data.word(kTempgraphics);
- context.di = (60)+176+2;
- context.bx = (52)+60-4;
- context.al = 5;
- context.ah = 0;
- showframe(context);
- context.di = (60)+104;
- context.bx = (52)+14;
- context.al = 54;
- context.dl = 101;
- printmessage(context);
-}
-
-void selectslot(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kCommandtype), 244);
- if (context.flags.z())
+ showopbox();
+ shownames();
+ showslots();
+ showsaveops();
+ worktoscreenm();
+}
+
+void DreamGenContext::getnamepos() {
+ STACK_CHECK;
+ al = data.byte(kCurrentslot);
+ ah = 0;
+ cx = 17;
+ _mul(cx);
+ dx = data;
+ es = dx;
+ bx = 8579;
+ _add(bx, ax);
+ al = data.byte(kCursorpos);
+ ah = 0;
+ _add(bx, ax);
+}
+
+void DreamGenContext::showopbox() {
+ STACK_CHECK;
+ ds = data.word(kTempgraphics);
+ di = (60);
+ bx = (52);
+ al = 0;
+ ah = 0;
+ showframe();
+ ds = data.word(kTempgraphics);
+ di = (60);
+ bx = (52)+55;
+ al = 4;
+ ah = 0;
+ showframe();
+}
+
+void DreamGenContext::showloadops() {
+ STACK_CHECK;
+ ds = data.word(kTempgraphics);
+ di = (60)+128+4;
+ bx = (52)+12;
+ al = 1;
+ ah = 0;
+ showframe();
+ ds = data.word(kTempgraphics);
+ di = (60)+176+2;
+ bx = (52)+60-4;
+ al = 5;
+ ah = 0;
+ showframe();
+ di = (60)+104;
+ bx = (52)+14;
+ al = 55;
+ dl = 101;
+ printmessage();
+}
+
+void DreamGenContext::showsaveops() {
+ STACK_CHECK;
+ ds = data.word(kTempgraphics);
+ di = (60)+128+4;
+ bx = (52)+12;
+ al = 1;
+ ah = 0;
+ showframe();
+ ds = data.word(kTempgraphics);
+ di = (60)+176+2;
+ bx = (52)+60-4;
+ al = 5;
+ ah = 0;
+ showframe();
+ di = (60)+104;
+ bx = (52)+14;
+ al = 54;
+ dl = 101;
+ printmessage();
+}
+
+void DreamGenContext::selectslot() {
+ STACK_CHECK;
+ _cmp(data.byte(kCommandtype), 244);
+ if (flags.z())
goto alreadysel;
- context.data.byte(kCommandtype) = 244;
- context.al = 45;
- commandonly(context);
+ data.byte(kCommandtype) = 244;
+ al = 45;
+ commandonly();
alreadysel:
- context.ax = context.data.word(kMousebutton);
- context._cmp(context.ax, 1);
- if (!context.flags.z())
- goto noselslot;
- context._cmp(context.ax, context.data.word(kOldbutton));
- if (context.flags.z())
- goto noselslot;
- context._cmp(context.data.byte(kLoadingorsave), 3);
- if (!context.flags.z())
+ ax = data.word(kMousebutton);
+ _cmp(ax, 1);
+ if (!flags.z())
+ return /* (noselslot) */;
+ _cmp(ax, data.word(kOldbutton));
+ if (flags.z())
+ return /* (noselslot) */;
+ _cmp(data.byte(kLoadingorsave), 3);
+ if (!flags.z())
goto notnocurs;
- context._dec(context.data.byte(kLoadingorsave));
+ _dec(data.byte(kLoadingorsave));
notnocurs:
- oldtonames(context);
- context.ax = context.data.word(kMousey);
- context._sub(context.ax, (52)+4);
- context.cl = -1;
+ oldtonames();
+ ax = data.word(kMousey);
+ _sub(ax, (52)+4);
+ cl = -1;
getslotnum:
- context._inc(context.cl);
- context._sub(context.ax, 11);
- if (!context.flags.c())
+ _inc(cl);
+ _sub(ax, 11);
+ if (!flags.c())
goto getslotnum;
- context.data.byte(kCurrentslot) = context.cl;
- delpointer(context);
- showopbox(context);
- showslots(context);
- shownames(context);
- context._cmp(context.data.byte(kLoadingorsave), 1);
- if (context.flags.z())
+ data.byte(kCurrentslot) = cl;
+ delpointer();
+ showopbox();
+ showslots();
+ shownames();
+ _cmp(data.byte(kLoadingorsave), 1);
+ if (flags.z())
goto isloadmode;
- showsaveops(context);
- readmouse(context);
- showpointer(context);
- worktoscreen(context);
- delpointer(context);
+ showsaveops();
+ readmouse();
+ showpointer();
+ worktoscreen();
+ delpointer();
return;
isloadmode:
- showloadops(context);
- readmouse(context);
- showpointer(context);
- worktoscreen(context);
- delpointer(context);
- return;
-noselslot:
- return;
-}
-
-void showslots(Context &context) {
- STACK_CHECK(context);
- context.di = (60)+7;
- context.bx = (52)+8;
- context.al = 2;
- context.ds = context.data.word(kTempgraphics);
- context.ah = 0;
- showframe(context);
- context.di = (60)+10;
- context.bx = (52)+11;
- context.cl = 0;
+ showloadops();
+ readmouse();
+ showpointer();
+ worktoscreen();
+ delpointer();
+}
+
+void DreamGenContext::showslots() {
+ STACK_CHECK;
+ di = (60)+7;
+ bx = (52)+8;
+ al = 2;
+ ds = data.word(kTempgraphics);
+ ah = 0;
+ showframe();
+ di = (60)+10;
+ bx = (52)+11;
+ cl = 0;
slotloop:
- context.push(context.cx);
- context.push(context.di);
- context.push(context.bx);
- context._cmp(context.cl, context.data.byte(kCurrentslot));
- if (!context.flags.z())
+ push(cx);
+ push(di);
+ push(bx);
+ _cmp(cl, data.byte(kCurrentslot));
+ if (!flags.z())
goto nomatchslot;
- context.al = 3;
- context.ds = context.data.word(kTempgraphics);
- context.ah = 0;
- showframe(context);
+ al = 3;
+ ds = data.word(kTempgraphics);
+ ah = 0;
+ showframe();
nomatchslot:
- context.bx = context.pop();
- context.di = context.pop();
- context.cx = context.pop();
- context._add(context.bx, 10);
- context._inc(context.cl);
- context._cmp(context.cl, 7);
- if (!context.flags.z())
+ bx = pop();
+ di = pop();
+ cx = pop();
+ _add(bx, 10);
+ _inc(cl);
+ _cmp(cl, 7);
+ if (!flags.z())
goto slotloop;
}
-void shownames(Context &context) {
- STACK_CHECK(context);
- context.dx = context.data;
- context.es = context.dx;
- context.si = 8579+1;
- context.di = (60)+21;
- context.bx = (52)+10;
- context.cl = 0;
+void DreamGenContext::shownames() {
+ STACK_CHECK;
+ dx = data;
+ es = dx;
+ si = 8579+1;
+ di = (60)+21;
+ bx = (52)+10;
+ cl = 0;
shownameloop:
- context.push(context.cx);
- context.push(context.di);
- context.push(context.es);
- context.push(context.bx);
- context.push(context.si);
- context.al = 4;
- context._cmp(context.cl, context.data.byte(kCurrentslot));
- if (!context.flags.z())
+ push(cx);
+ push(di);
+ push(es);
+ push(bx);
+ push(si);
+ al = 4;
+ _cmp(cl, data.byte(kCurrentslot));
+ if (!flags.z())
goto nomatchslot2;
- context._cmp(context.data.byte(kLoadingorsave), 2);
- if (!context.flags.z())
+ _cmp(data.byte(kLoadingorsave), 2);
+ if (!flags.z())
goto loadmode;
- context.dx = context.si;
- context.cx = 15;
- context._add(context.si, 15);
+ dx = si;
+ cx = 15;
+ _add(si, 15);
zerostill:
- context._dec(context.si);
- context._dec(context.cl);
- context._cmp(context.es.byte(context.si), 1);
- if (!context.flags.z())
+ _dec(si);
+ _dec(cl);
+ _cmp(es.byte(si), 1);
+ if (!flags.z())
goto foundcharacter;
goto zerostill;
foundcharacter:
- context.data.byte(kCursorpos) = context.cl;
- context.es.byte(context.si) = '/';
- context.es.byte(context.si+1) = 0;
- context.push(context.si);
- context.si = context.dx;
- context.dl = 200;
- context.ah = 0;
- printdirect(context);
- context.si = context.pop();
- context.es.byte(context.si) = 0;
- context.es.byte(context.si+1) = 1;
+ data.byte(kCursorpos) = cl;
+ es.byte(si) = '/';
+ es.byte(si+1) = 0;
+ push(si);
+ si = dx;
+ dl = 200;
+ ah = 0;
+ printdirect();
+ si = pop();
+ es.byte(si) = 0;
+ es.byte(si+1) = 1;
goto afterprintname;
loadmode:
- context.al = 0;
- context.dl = 200;
- context.ah = 0;
- context.data.word(kCharshift) = 91;
- printdirect(context);
- context.data.word(kCharshift) = 0;
+ al = 0;
+ dl = 200;
+ ah = 0;
+ data.word(kCharshift) = 91;
+ printdirect();
+ data.word(kCharshift) = 0;
goto afterprintname;
nomatchslot2:
- context.dl = 200;
- context.ah = 0;
- printdirect(context);
+ dl = 200;
+ ah = 0;
+ printdirect();
afterprintname:
- context.si = context.pop();
- context.bx = context.pop();
- context.es = context.pop();
- context.di = context.pop();
- context.cx = context.pop();
- context._add(context.si, 17);
- context._add(context.bx, 10);
- context._inc(context.cl);
- context._cmp(context.cl, 7);
- if (!context.flags.z())
+ si = pop();
+ bx = pop();
+ es = pop();
+ di = pop();
+ cx = pop();
+ _add(si, 17);
+ _add(bx, 10);
+ _inc(cl);
+ _cmp(cl, 7);
+ if (!flags.z())
goto shownameloop;
}
-void namestoold(Context &context) {
- STACK_CHECK(context);
- context.ds = context.cs;
- context.si = 8579;
- context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5));
- context.es = context.data.word(kBuffers);
- context.cx = 17*4;
- context._movsb(context.cx);
-}
-
-void oldtonames(Context &context) {
- STACK_CHECK(context);
- context.es = context.cs;
- context.di = 8579;
- context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5));
- context.ds = context.data.word(kBuffers);
- context.cx = 17*4;
- context._movsb(context.cx);
-}
-
-void saveposition(Context &context) {
- STACK_CHECK(context);
- makeheader(context);
- context.al = context.data.byte(kCurrentslot);
- context.ah = 0;
- context.push(context.ax);
- context.cx = 13;
- context._mul(context.cx);
- context.dx = context.data;
- context.ds = context.dx;
- context.dx = 8698;
- context._add(context.dx, context.ax);
- openforsave(context);
- context.dx = context.data;
- context.ds = context.dx;
- context.dx = 6091;
- context.cx = (6187-6091);
- savefilewrite(context);
- context.dx = context.data;
- context.es = context.dx;
- context.di = 6141;
- context.ax = context.pop();
- context.cx = 17;
- context._mul(context.cx);
- context.dx = context.data;
- context.ds = context.dx;
- context.dx = 8579;
- context._add(context.dx, context.ax);
- saveseg(context);
- context.dx = context.data;
- context.ds = context.dx;
- context.dx = 0;
- saveseg(context);
- context.ds = context.data.word(kExtras);
- context.dx = (0);
- saveseg(context);
- context.ds = context.data.word(kBuffers);
- context.dx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80));
- saveseg(context);
- context.dx = context.data;
- context.ds = context.dx;
- context.dx = 7979;
- saveseg(context);
- context.dx = context.data;
- context.ds = context.dx;
- context.dx = 534;
- saveseg(context);
- closefile(context);
-}
-
-void loadposition(Context &context) {
- STACK_CHECK(context);
- context.data.word(kTimecount) = 0;
- clearchanges(context);
- context.al = context.data.byte(kCurrentslot);
- context.ah = 0;
- context.push(context.ax);
- context.cx = 13;
- context._mul(context.cx);
- context.dx = context.data;
- context.ds = context.dx;
- context.dx = 8698;
- context._add(context.dx, context.ax);
- openfilefromc(context);
- context.ds = context.cs;
- context.dx = 6091;
- context.cx = (6187-6091);
- savefileread(context);
- context.es = context.cs;
- context.di = 6141;
- context.ax = context.pop();
- context.cx = 17;
- context._mul(context.cx);
- context.dx = context.data;
- context.ds = context.dx;
- context.dx = 8579;
- context._add(context.dx, context.ax);
- loadseg(context);
- context.dx = context.data;
- context.ds = context.dx;
- context.dx = 0;
- loadseg(context);
- context.ds = context.data.word(kExtras);
- context.dx = (0);
- loadseg(context);
- context.ds = context.data.word(kBuffers);
- context.dx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80));
- loadseg(context);
- context.dx = context.data;
- context.ds = context.dx;
- context.dx = 7979;
- loadseg(context);
- context.ds = context.cs;
- context.dx = 534;
- loadseg(context);
- closefile(context);
-}
-
-void makeheader(Context &context) {
- STACK_CHECK(context);
- context.dx = context.data;
- context.es = context.dx;
- context.di = 6141;
- context.ax = 17;
- storeit(context);
- context.ax = (68-0);
- storeit(context);
- context.ax = (0+2080+30000+(16*114)+((114+2)*2)+18000);
- storeit(context);
- context.ax = (250)*4;
- storeit(context);
- context.ax = 48;
- storeit(context);
- context.ax = (991-534);
- storeit(context);
-}
-
-void storeit(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.ax, 0);
- if (!context.flags.z())
+void DreamGenContext::namestoold() {
+ STACK_CHECK;
+ ds = cs;
+ si = 8579;
+ di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5));
+ es = data.word(kBuffers);
+ cx = 17*4;
+ _movsb(cx, true);
+}
+
+void DreamGenContext::oldtonames() {
+ STACK_CHECK;
+ es = cs;
+ di = 8579;
+ si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5));
+ ds = data.word(kBuffers);
+ cx = 17*4;
+ _movsb(cx, true);
+}
+
+void DreamGenContext::saveposition() {
+ STACK_CHECK;
+ makeheader();
+ al = data.byte(kCurrentslot);
+ ah = 0;
+ push(ax);
+ cx = 13;
+ _mul(cx);
+ dx = data;
+ ds = dx;
+ dx = 8698;
+ _add(dx, ax);
+ openforsave();
+ dx = data;
+ ds = dx;
+ dx = 6091;
+ cx = (6187-6091);
+ savefilewrite();
+ dx = data;
+ es = dx;
+ di = 6141;
+ ax = pop();
+ cx = 17;
+ _mul(cx);
+ dx = data;
+ ds = dx;
+ dx = 8579;
+ _add(dx, ax);
+ saveseg();
+ dx = data;
+ ds = dx;
+ dx = 0;
+ saveseg();
+ ds = data.word(kExtras);
+ dx = (0);
+ saveseg();
+ ds = data.word(kBuffers);
+ dx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80));
+ saveseg();
+ dx = data;
+ ds = dx;
+ dx = 7979;
+ saveseg();
+ dx = data;
+ ds = dx;
+ dx = 534;
+ saveseg();
+ closefile();
+}
+
+void DreamGenContext::loadposition() {
+ STACK_CHECK;
+ data.word(kTimecount) = 0;
+ clearchanges();
+ al = data.byte(kCurrentslot);
+ ah = 0;
+ push(ax);
+ cx = 13;
+ _mul(cx);
+ dx = data;
+ ds = dx;
+ dx = 8698;
+ _add(dx, ax);
+ openfilefromc();
+ ds = cs;
+ dx = 6091;
+ cx = (6187-6091);
+ savefileread();
+ es = cs;
+ di = 6141;
+ ax = pop();
+ cx = 17;
+ _mul(cx);
+ dx = data;
+ ds = dx;
+ dx = 8579;
+ _add(dx, ax);
+ loadseg();
+ dx = data;
+ ds = dx;
+ dx = 0;
+ loadseg();
+ ds = data.word(kExtras);
+ dx = (0);
+ loadseg();
+ ds = data.word(kBuffers);
+ dx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80));
+ loadseg();
+ dx = data;
+ ds = dx;
+ dx = 7979;
+ loadseg();
+ ds = cs;
+ dx = 534;
+ loadseg();
+ closefile();
+}
+
+void DreamGenContext::makeheader() {
+ STACK_CHECK;
+ dx = data;
+ es = dx;
+ di = 6141;
+ ax = 17;
+ storeit();
+ ax = (68-0);
+ storeit();
+ ax = (0+2080+30000+(16*114)+((114+2)*2)+18000);
+ storeit();
+ ax = (250)*4;
+ storeit();
+ ax = 48;
+ storeit();
+ ax = (991-534);
+ storeit();
+}
+
+void DreamGenContext::storeit() {
+ STACK_CHECK;
+ _cmp(ax, 0);
+ if (!flags.z())
goto isntblank;
- context._inc(context.ax);
+ _inc(ax);
isntblank:
- context._stosw();
+ _stosw();
}
-void findlen(Context &context) {
- STACK_CHECK(context);
- context._dec(context.bx);
- context._add(context.bx, context.ax);
+void DreamGenContext::findlen() {
+ STACK_CHECK;
+ _dec(bx);
+ _add(bx, ax);
nextone:
- context._cmp(context.cl, context.ds.byte(context.bx));
- if (!context.flags.z())
- goto foundlen;
- context._dec(context.bx);
- context._dec(context.ax);
- context._cmp(context.ax, 0);
- if (!context.flags.z())
+ _cmp(cl, ds.byte(bx));
+ if (!flags.z())
+ return /* (foundlen) */;
+ _dec(bx);
+ _dec(ax);
+ _cmp(ax, 0);
+ if (!flags.z())
goto nextone;
-foundlen:
- return;
}
-void scanfornames(Context &context) {
- STACK_CHECK(context);
- context.dx = context.data;
- context.es = context.dx;
- context.di = 8579;
- context.dx = context.data;
- context.ds = context.dx;
- context.dx = 8698;
- context.cx = 7;
+void DreamGenContext::scanfornames() {
+ STACK_CHECK;
+ dx = data;
+ es = dx;
+ di = 8579;
+ dx = data;
+ ds = dx;
+ dx = 8698;
+ cx = 7;
scanloop:
- context.push(context.es);
- context.push(context.ds);
- context.push(context.di);
- context.push(context.dx);
- context.push(context.cx);
- openfilefromc(context);
- if (context.flags.c())
+ push(es);
+ push(ds);
+ push(di);
+ push(dx);
+ push(cx);
+ openfilefromc();
+ if (flags.c())
goto notexist;
- context.cx = context.pop();
- context._inc(context.ch);
- context.push(context.cx);
- context.push(context.di);
- context.push(context.es);
- context.dx = context.data;
- context.ds = context.dx;
- context.dx = 6091;
- context.cx = (6187-6091);
- savefileread(context);
- context.dx = context.data;
- context.es = context.dx;
- context.di = 6141;
- context.ds = context.pop();
- context.dx = context.pop();
- loadseg(context);
- context.bx = context.data.word(kHandle);
- closefile(context);
+ cx = pop();
+ _inc(ch);
+ push(cx);
+ push(di);
+ push(es);
+ dx = data;
+ ds = dx;
+ dx = 6091;
+ cx = (6187-6091);
+ savefileread();
+ dx = data;
+ es = dx;
+ di = 6141;
+ ds = pop();
+ dx = pop();
+ loadseg();
+ bx = data.word(kHandle);
+ closefile();
notexist:
- context.cx = context.pop();
- context.dx = context.pop();
- context.di = context.pop();
- context.ds = context.pop();
- context.es = context.pop();
- context._add(context.dx, 13);
- context._add(context.di, 17);
- context._dec(context.cl);
- if (!context.flags.z())
+ cx = pop();
+ dx = pop();
+ di = pop();
+ ds = pop();
+ es = pop();
+ _add(dx, 13);
+ _add(di, 17);
+ _dec(cl);
+ if (!flags.z())
goto scanloop;
- context.al = context.ch;
-}
-
-void decide(Context &context) {
- STACK_CHECK(context);
- setmode(context);
- loadpalfromiff(context);
- clearpalette(context);
- context.data.byte(kPointermode) = 0;
- context.data.word(kWatchingtime) = 0;
- context.data.byte(kPointerframe) = 0;
- context.data.word(kTextaddressx) = 70;
- context.data.word(kTextaddressy) = 182-8;
- context.data.byte(kTextlen) = 181;
- context.data.byte(kManisoffscreen) = 1;
- loadsavebox(context);
- showdecisions(context);
- worktoscreen(context);
- fadescreenup(context);
- context.data.byte(kGetback) = 0;
+ al = ch;
+}
+
+void DreamGenContext::decide() {
+ STACK_CHECK;
+ setmode();
+ loadpalfromiff();
+ clearpalette();
+ data.byte(kPointermode) = 0;
+ data.word(kWatchingtime) = 0;
+ data.byte(kPointerframe) = 0;
+ data.word(kTextaddressx) = 70;
+ data.word(kTextaddressy) = 182-8;
+ data.byte(kTextlen) = 181;
+ data.byte(kManisoffscreen) = 1;
+ loadsavebox();
+ showdecisions();
+ worktoscreen();
+ fadescreenup();
+ data.byte(kGetback) = 0;
waitdecide:
- readmouse(context);
- showpointer(context);
- vsync(context);
- dumppointer(context);
- dumptextline(context);
- delpointer(context);
- context.bx = 5057;
- checkcoords(context);
- context._cmp(context.data.byte(kGetback), 0);
- if (context.flags.z())
+ _cmp(data.byte(kQuitrequested), 0);
+ if (flags.z())
+ goto _tmp1;
+ return;
+_tmp1:
+ readmouse();
+ showpointer();
+ vsync();
+ dumppointer();
+ dumptextline();
+ delpointer();
+ bx = 5057;
+ checkcoords();
+ _cmp(data.byte(kGetback), 0);
+ if (flags.z())
goto waitdecide;
- context._cmp(context.data.byte(kGetback), 4);
- if (context.flags.z())
+ _cmp(data.byte(kGetback), 4);
+ if (flags.z())
goto hasloadedroom;
- getridoftemp(context);
+ getridoftemp();
hasloadedroom:
- context.data.word(kTextaddressx) = 13;
- context.data.word(kTextaddressy) = 182;
- context.data.byte(kTextlen) = 240;
-}
-
-void showdecisions(Context &context) {
- STACK_CHECK(context);
- createpanel2(context);
- showopbox(context);
- context.ds = context.data.word(kTempgraphics);
- context.di = (60)+17;
- context.bx = (52)+13;
- context.al = 6;
- context.ah = 0;
- showframe(context);
- undertextline(context);
-}
-
-void newgame(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kCommandtype), 251);
- if (context.flags.z())
+ data.word(kTextaddressx) = 13;
+ data.word(kTextaddressy) = 182;
+ data.byte(kTextlen) = 240;
+}
+
+void DreamGenContext::showdecisions() {
+ STACK_CHECK;
+ createpanel2();
+ showopbox();
+ ds = data.word(kTempgraphics);
+ di = (60)+17;
+ bx = (52)+13;
+ al = 6;
+ ah = 0;
+ showframe();
+ undertextline();
+}
+
+void DreamGenContext::newgame() {
+ STACK_CHECK;
+ _cmp(data.byte(kCommandtype), 251);
+ if (flags.z())
goto alreadynewgame;
- context.data.byte(kCommandtype) = 251;
- context.al = 47;
- commandonly(context);
+ data.byte(kCommandtype) = 251;
+ al = 47;
+ commandonly();
alreadynewgame:
- context.ax = context.data.word(kMousebutton);
- context._cmp(context.ax, 1);
- if (!context.flags.z())
- goto nonewgame;
- context.data.byte(kGetback) = 3;
-nonewgame:
- return;
-}
-
-void doload(Context &context) {
- STACK_CHECK(context);
- context.data.byte(kLoadingorsave) = 1;
- showopbox(context);
- showloadops(context);
- context.data.byte(kCurrentslot) = 0;
- showslots(context);
- shownames(context);
- context.data.byte(kPointerframe) = 0;
- worktoscreenm(context);
- namestoold(context);
- context.data.byte(kGetback) = 0;
+ ax = data.word(kMousebutton);
+ _cmp(ax, 1);
+ if (!flags.z())
+ return /* (nonewgame) */;
+ data.byte(kGetback) = 3;
+}
+
+void DreamGenContext::doload() {
+ STACK_CHECK;
+ data.byte(kLoadingorsave) = 1;
+ showopbox();
+ showloadops();
+ data.byte(kCurrentslot) = 0;
+ showslots();
+ shownames();
+ data.byte(kPointerframe) = 0;
+ worktoscreenm();
+ namestoold();
+ data.byte(kGetback) = 0;
loadops:
- delpointer(context);
- readmouse(context);
- showpointer(context);
- vsync(context);
- dumppointer(context);
- dumptextline(context);
- context.bx = 3824;
- checkcoords(context);
- context._cmp(context.data.byte(kGetback), 0);
- if (context.flags.z())
+ _cmp(data.byte(kQuitrequested), 0);
+ if (!flags.z())
+ return /* (quitloaded) */;
+ delpointer();
+ readmouse();
+ showpointer();
+ vsync();
+ dumppointer();
+ dumptextline();
+ bx = 3824;
+ checkcoords();
+ _cmp(data.byte(kGetback), 0);
+ if (flags.z())
goto loadops;
- context._cmp(context.data.byte(kGetback), 2);
- if (context.flags.z())
- goto quitloaded;
- getridoftemp(context);
- context.dx = context.data;
- context.es = context.dx;
- context.bx = 7979;
- startloading(context);
- loadroomssample(context);
- context.data.byte(kRoomloaded) = 1;
- context.data.byte(kNewlocation) = 255;
- clearsprites(context);
- initman(context);
- initrain(context);
- context.data.word(kTextaddressx) = 13;
- context.data.word(kTextaddressy) = 182;
- context.data.byte(kTextlen) = 240;
- startup(context);
- worktoscreen(context);
- context.data.byte(kGetback) = 4;
-quitloaded:
- return;
-}
-
-void loadold(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kCommandtype), 252);
- if (context.flags.z())
+ _cmp(data.byte(kGetback), 2);
+ if (flags.z())
+ return /* (quitloaded) */;
+ getridoftemp();
+ dx = data;
+ es = dx;
+ bx = 7979;
+ startloading();
+ loadroomssample();
+ data.byte(kRoomloaded) = 1;
+ data.byte(kNewlocation) = 255;
+ clearsprites();
+ initman();
+ initrain();
+ data.word(kTextaddressx) = 13;
+ data.word(kTextaddressy) = 182;
+ data.byte(kTextlen) = 240;
+ startup();
+ worktoscreen();
+ data.byte(kGetback) = 4;
+}
+
+void DreamGenContext::loadold() {
+ STACK_CHECK;
+ _cmp(data.byte(kCommandtype), 252);
+ if (flags.z())
goto alreadyloadold;
- context.data.byte(kCommandtype) = 252;
- context.al = 48;
- commandonly(context);
+ data.byte(kCommandtype) = 252;
+ al = 48;
+ commandonly();
alreadyloadold:
- context.ax = context.data.word(kMousebutton);
- context._and(context.ax, 1);
- if (context.flags.z())
- goto noloadold;
- doload(context);
- context._cmp(context.data.byte(kGetback), 4);
- if (context.flags.z())
- goto noloadold;
- showdecisions(context);
- worktoscreenm(context);
- context.data.byte(kGetback) = 0;
-noloadold:
- return;
-}
-
-void createname(Context &context) {
- STACK_CHECK(context);
- context.push(context.ax);
- context.di = 5105;
- context.cs.byte(context.di+0) = context.dl;
- context.cs.byte(context.di+3) = context.cl;
- context.al = context.dh;
- context.ah = '0'-1;
+ ax = data.word(kMousebutton);
+ _and(ax, 1);
+ if (flags.z())
+ return /* (noloadold) */;
+ doload();
+ _cmp(data.byte(kGetback), 4);
+ if (flags.z())
+ return /* (noloadold) */;
+ _cmp(data.byte(kQuitrequested), 0);
+ if (!flags.z())
+ return /* (noloadold) */;
+ showdecisions();
+ worktoscreenm();
+ data.byte(kGetback) = 0;
+}
+
+void DreamGenContext::createname() {
+ STACK_CHECK;
+ push(ax);
+ di = 5105;
+ cs.byte(di+0) = dl;
+ cs.byte(di+3) = cl;
+ al = dh;
+ ah = '0'-1;
findten:
- context._inc(context.ah);
- context._sub(context.al, 10);
- if (!context.flags.c())
+ _inc(ah);
+ _sub(al, 10);
+ if (!flags.c())
goto findten;
- context.cs.byte(context.di+1) = context.ah;
- context._add(context.al, 10+'0');
- context.cs.byte(context.di+2) = context.al;
- context.ax = context.pop();
- context.cl = '0'-1;
+ cs.byte(di+1) = ah;
+ _add(al, 10+'0');
+ cs.byte(di+2) = al;
+ ax = pop();
+ cl = '0'-1;
thousandsc:
- context._inc(context.cl);
- context._sub(context.ax, 1000);
- if (!context.flags.c())
+ _inc(cl);
+ _sub(ax, 1000);
+ if (!flags.c())
goto thousandsc;
- context._add(context.ax, 1000);
- context.cs.byte(context.di+4) = context.cl;
- context.cl = '0'-1;
+ _add(ax, 1000);
+ cs.byte(di+4) = cl;
+ cl = '0'-1;
hundredsc:
- context._inc(context.cl);
- context._sub(context.ax, 100);
- if (!context.flags.c())
+ _inc(cl);
+ _sub(ax, 100);
+ if (!flags.c())
goto hundredsc;
- context._add(context.ax, 100);
- context.cs.byte(context.di+5) = context.cl;
- context.cl = '0'-1;
+ _add(ax, 100);
+ cs.byte(di+5) = cl;
+ cl = '0'-1;
tensc:
- context._inc(context.cl);
- context._sub(context.ax, 10);
- if (!context.flags.c())
+ _inc(cl);
+ _sub(ax, 10);
+ if (!flags.c())
goto tensc;
- context._add(context.ax, 10);
- context.cs.byte(context.di+6) = context.cl;
- context._add(context.al, '0');
- context.cs.byte(context.di+7) = context.al;
-}
-
-void trysoundalloc(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kNeedsoundbuff), 1);
- if (context.flags.z())
- goto gotsoundbuff;
- context._inc(context.data.byte(kSoundtimes));
- context.bx = (16384+2048)/16;
- allocatemem(context);
- context.data.word(kSoundbuffer) = context.ax;
- context.push(context.ax);
- context.al = context.ah;
- context.cl = 4;
- context._shr(context.al, context.cl);
- context.data.byte(kSoundbufferpage) = context.al;
- context.ax = context.pop();
- context.cl = 4;
- context._shl(context.ax, context.cl);
- context.data.word(kSoundbufferad) = context.ax;
- context._cmp(context.ax, 0x0b7ff);
- if (!context.flags.c())
+ _add(ax, 10);
+ cs.byte(di+6) = cl;
+ _add(al, '0');
+ cs.byte(di+7) = al;
+}
+
+void DreamGenContext::trysoundalloc() {
+ STACK_CHECK;
+ _cmp(data.byte(kNeedsoundbuff), 1);
+ if (flags.z())
+ return /* (gotsoundbuff) */;
+ _inc(data.byte(kSoundtimes));
+ bx = (16384+2048)/16;
+ allocatemem();
+ data.word(kSoundbuffer) = ax;
+ push(ax);
+ al = ah;
+ cl = 4;
+ _shr(al, cl);
+ data.byte(kSoundbufferpage) = al;
+ ax = pop();
+ cl = 4;
+ _shl(ax, cl);
+ data.word(kSoundbufferad) = ax;
+ _cmp(ax, 0x0b7ff);
+ if (!flags.c())
goto soundfail;
- context.es = context.data.word(kSoundbuffer);
- context.di = 0;
- context.cx = 16384/2;
- context.ax = 0x7f7f;
- context._stosw(context.cx);
- context.data.byte(kNeedsoundbuff) = 1;
+ es = data.word(kSoundbuffer);
+ di = 0;
+ cx = 16384/2;
+ ax = 0x7f7f;
+ _stosw(cx, true);
+ data.byte(kNeedsoundbuff) = 1;
return;
soundfail:
- context.es = context.data.word(kSoundbuffer);
- deallocatemem(context);
-gotsoundbuff:
- return;
-}
-
-void playchannel0(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kSoundint), 255);
- if (context.flags.z())
- goto dontbother4;
- context.push(context.es);
- context.push(context.ds);
- context.push(context.bx);
- context.push(context.cx);
- context.push(context.di);
- context.push(context.si);
- context.data.byte(kCh0playing) = context.al;
- context.es = context.data.word(kSounddata);
- context._cmp(context.al, 12);
- if (context.flags.c())
+ es = data.word(kSoundbuffer);
+ deallocatemem();
+}
+
+void DreamGenContext::playchannel0() {
+ STACK_CHECK;
+ _cmp(data.byte(kSoundint), 255);
+ if (flags.z())
+ return /* (dontbother4) */;
+ push(es);
+ push(ds);
+ push(bx);
+ push(cx);
+ push(di);
+ push(si);
+ data.byte(kCh0playing) = al;
+ es = data.word(kSounddata);
+ _cmp(al, 12);
+ if (flags.c())
goto notsecondbank;
- context.es = context.data.word(kSounddata2);
- context._sub(context.al, 12);
+ es = data.word(kSounddata2);
+ _sub(al, 12);
notsecondbank:
- context.data.byte(kCh0repeat) = context.ah;
- context.ah = 0;
- context._add(context.ax, context.ax);
- context.bx = context.ax;
- context._add(context.ax, context.ax);
- context._add(context.bx, context.ax);
- context.al = context.es.byte(context.bx);
- context.ah = 0;
- context.data.word(kCh0emmpage) = context.ax;
- context.ax = context.es.word(context.bx+1);
- context.data.word(kCh0offset) = context.ax;
- context.ax = context.es.word(context.bx+3);
- context.data.word(kCh0blockstocopy) = context.ax;
- context._cmp(context.data.byte(kCh0repeat), 0);
- if (context.flags.z())
+ data.byte(kCh0repeat) = ah;
+ ah = 0;
+ _add(ax, ax);
+ bx = ax;
+ _add(ax, ax);
+ _add(bx, ax);
+ al = es.byte(bx);
+ ah = 0;
+ data.word(kCh0emmpage) = ax;
+ ax = es.word(bx+1);
+ data.word(kCh0offset) = ax;
+ ax = es.word(bx+3);
+ data.word(kCh0blockstocopy) = ax;
+ _cmp(data.byte(kCh0repeat), 0);
+ if (flags.z())
goto nosetloop;
- context.ax = context.data.word(kCh0emmpage);
- context.data.word(kCh0oldemmpage) = context.ax;
- context.ax = context.data.word(kCh0offset);
- context.data.word(kCh0oldoffset) = context.ax;
- context.ax = context.data.word(kCh0blockstocopy);
- context.data.word(kCh0oldblockstocopy) = context.ax;
+ ax = data.word(kCh0emmpage);
+ data.word(kCh0oldemmpage) = ax;
+ ax = data.word(kCh0offset);
+ data.word(kCh0oldoffset) = ax;
+ ax = data.word(kCh0blockstocopy);
+ data.word(kCh0oldblockstocopy) = ax;
nosetloop:
- context.si = context.pop();
- context.di = context.pop();
- context.cx = context.pop();
- context.bx = context.pop();
- context.ds = context.pop();
- context.es = context.pop();
-dontbother4:
- return;
-}
-
-void playchannel1(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kSoundint), 255);
- if (context.flags.z())
- goto dontbother5;
- context._cmp(context.data.byte(kCh1playing), 7);
- if (context.flags.z())
- goto dontbother5;
- context.push(context.es);
- context.push(context.ds);
- context.push(context.bx);
- context.push(context.cx);
- context.push(context.di);
- context.push(context.si);
- context.data.byte(kCh1playing) = context.al;
- context.es = context.data.word(kSounddata);
- context._cmp(context.al, 12);
- if (context.flags.c())
+ si = pop();
+ di = pop();
+ cx = pop();
+ bx = pop();
+ ds = pop();
+ es = pop();
+}
+
+void DreamGenContext::playchannel1() {
+ STACK_CHECK;
+ _cmp(data.byte(kSoundint), 255);
+ if (flags.z())
+ return /* (dontbother5) */;
+ _cmp(data.byte(kCh1playing), 7);
+ if (flags.z())
+ return /* (dontbother5) */;
+ push(es);
+ push(ds);
+ push(bx);
+ push(cx);
+ push(di);
+ push(si);
+ data.byte(kCh1playing) = al;
+ es = data.word(kSounddata);
+ _cmp(al, 12);
+ if (flags.c())
goto notsecondbank1;
- context.es = context.data.word(kSounddata2);
- context._sub(context.al, 12);
+ es = data.word(kSounddata2);
+ _sub(al, 12);
notsecondbank1:
- context.ah = 0;
- context._add(context.ax, context.ax);
- context.bx = context.ax;
- context._add(context.ax, context.ax);
- context._add(context.bx, context.ax);
- context.al = context.es.byte(context.bx);
- context.ah = 0;
- context.data.word(kCh1emmpage) = context.ax;
- context.ax = context.es.word(context.bx+1);
- context.data.word(kCh1offset) = context.ax;
- context.ax = context.es.word(context.bx+3);
- context.data.word(kCh1blockstocopy) = context.ax;
- context.si = context.pop();
- context.di = context.pop();
- context.cx = context.pop();
- context.bx = context.pop();
- context.ds = context.pop();
- context.es = context.pop();
-dontbother5:
- return;
-}
-
-void makenextblock(Context &context) {
- STACK_CHECK(context);
- volumeadjust(context);
- loopchannel0(context);
- context._cmp(context.data.word(kCh1blockstocopy), 0);
- if (context.flags.z())
+ ah = 0;
+ _add(ax, ax);
+ bx = ax;
+ _add(ax, ax);
+ _add(bx, ax);
+ al = es.byte(bx);
+ ah = 0;
+ data.word(kCh1emmpage) = ax;
+ ax = es.word(bx+1);
+ data.word(kCh1offset) = ax;
+ ax = es.word(bx+3);
+ data.word(kCh1blockstocopy) = ax;
+ si = pop();
+ di = pop();
+ cx = pop();
+ bx = pop();
+ ds = pop();
+ es = pop();
+}
+
+void DreamGenContext::makenextblock() {
+ STACK_CHECK;
+ volumeadjust();
+ loopchannel0();
+ _cmp(data.word(kCh1blockstocopy), 0);
+ if (flags.z())
goto mightbeonlych0;
- context._cmp(context.data.word(kCh0blockstocopy), 0);
- if (context.flags.z())
+ _cmp(data.word(kCh0blockstocopy), 0);
+ if (flags.z())
goto mightbeonlych1;
- context._dec(context.data.word(kCh0blockstocopy));
- context._dec(context.data.word(kCh1blockstocopy));
- bothchannels(context);
+ _dec(data.word(kCh0blockstocopy));
+ _dec(data.word(kCh1blockstocopy));
+ bothchannels();
return;
mightbeonlych1:
- context.data.byte(kCh0playing) = 255;
- context._cmp(context.data.word(kCh1blockstocopy), 0);
- if (context.flags.z())
- goto notch1only;
- context._dec(context.data.word(kCh1blockstocopy));
- channel1only(context);
-notch1only:
+ data.byte(kCh0playing) = 255;
+ _cmp(data.word(kCh1blockstocopy), 0);
+ if (flags.z())
+ return /* (notch1only) */;
+ _dec(data.word(kCh1blockstocopy));
+ channel1only();
return;
mightbeonlych0:
- context.data.byte(kCh1playing) = 255;
- context._cmp(context.data.word(kCh0blockstocopy), 0);
- if (context.flags.z())
+ data.byte(kCh1playing) = 255;
+ _cmp(data.word(kCh0blockstocopy), 0);
+ if (flags.z())
goto notch0only;
- context._dec(context.data.word(kCh0blockstocopy));
- channel0only(context);
+ _dec(data.word(kCh0blockstocopy));
+ channel0only();
return;
notch0only:
- context.es = context.data.word(kSoundbuffer);
- context.di = context.data.word(kSoundbufferwrite);
- context.cx = 1024;
- context.ax = 0x7f7f;
- context._stosw(context.cx);
- context._and(context.di, 16384-1);
- context.data.word(kSoundbufferwrite) = context.di;
-}
-
-void volumeadjust(Context &context) {
- STACK_CHECK(context);
- context.al = context.data.byte(kVolumedirection);
- context._cmp(context.al, 0);
- if (context.flags.z())
- goto volok;
- context.al = context.data.byte(kVolume);
- context._cmp(context.al, context.data.byte(kVolumeto));
- if (context.flags.z())
+ es = data.word(kSoundbuffer);
+ di = data.word(kSoundbufferwrite);
+ cx = 1024;
+ ax = 0x7f7f;
+ _stosw(cx, true);
+ _and(di, 16384-1);
+ data.word(kSoundbufferwrite) = di;
+}
+
+void DreamGenContext::volumeadjust() {
+ STACK_CHECK;
+ al = data.byte(kVolumedirection);
+ _cmp(al, 0);
+ if (flags.z())
+ return /* (volok) */;
+ al = data.byte(kVolume);
+ _cmp(al, data.byte(kVolumeto));
+ if (flags.z())
goto volfinish;
- context._add(context.data.byte(kVolumecount), 64);
- if (!context.flags.z())
- goto volok;
- context.al = context.data.byte(kVolume);
- context._add(context.al, context.data.byte(kVolumedirection));
- context.data.byte(kVolume) = context.al;
+ _add(data.byte(kVolumecount), 64);
+ if (!flags.z())
+ return /* (volok) */;
+ al = data.byte(kVolume);
+ _add(al, data.byte(kVolumedirection));
+ data.byte(kVolume) = al;
return;
volfinish:
- context.data.byte(kVolumedirection) = 0;
-volok:
- return;
-}
-
-void loopchannel0(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.word(kCh0blockstocopy), 0);
- if (!context.flags.z())
- goto notloop;
- context._cmp(context.data.byte(kCh0repeat), 0);
- if (context.flags.z())
- goto notloop;
- context._cmp(context.data.byte(kCh0repeat), 255);
- if (context.flags.z())
+ data.byte(kVolumedirection) = 0;
+}
+
+void DreamGenContext::loopchannel0() {
+ STACK_CHECK;
+ _cmp(data.word(kCh0blockstocopy), 0);
+ if (!flags.z())
+ return /* (notloop) */;
+ _cmp(data.byte(kCh0repeat), 0);
+ if (flags.z())
+ return /* (notloop) */;
+ _cmp(data.byte(kCh0repeat), 255);
+ if (flags.z())
goto endlessloop;
- context._dec(context.data.byte(kCh0repeat));
+ _dec(data.byte(kCh0repeat));
endlessloop:
- context.ax = context.data.word(kCh0oldemmpage);
- context.data.word(kCh0emmpage) = context.ax;
- context.ax = context.data.word(kCh0oldoffset);
- context.data.word(kCh0offset) = context.ax;
- context.ax = context.data.word(kCh0blockstocopy);
- context._add(context.ax, context.data.word(kCh0oldblockstocopy));
- context.data.word(kCh0blockstocopy) = context.ax;
- return;
-notloop:
- return;
+ ax = data.word(kCh0oldemmpage);
+ data.word(kCh0emmpage) = ax;
+ ax = data.word(kCh0oldoffset);
+ data.word(kCh0offset) = ax;
+ ax = data.word(kCh0blockstocopy);
+ _add(ax, data.word(kCh0oldblockstocopy));
+ data.word(kCh0blockstocopy) = ax;
}
-void cancelch0(Context &context) {
- STACK_CHECK(context);
- context.data.byte(kCh0repeat) = 0;
- context.data.word(kCh0blockstocopy) = 0;
- context.data.byte(kCh0playing) = 255;
+void DreamGenContext::cancelch0() {
+ STACK_CHECK;
+ data.byte(kCh0repeat) = 0;
+ data.word(kCh0blockstocopy) = 0;
+ data.byte(kCh0playing) = 255;
}
-void cancelch1(Context &context) {
- STACK_CHECK(context);
- context.data.word(kCh1blockstocopy) = 0;
- context.data.byte(kCh1playing) = 255;
+void DreamGenContext::cancelch1() {
+ STACK_CHECK;
+ data.word(kCh1blockstocopy) = 0;
+ data.byte(kCh1playing) = 255;
}
-void channel0tran(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kVolume), 0);
- if (!context.flags.z())
+void DreamGenContext::channel0tran() {
+ STACK_CHECK;
+ _cmp(data.byte(kVolume), 0);
+ if (!flags.z())
goto lowvolumetran;
- context.cx = 1024;
- context._movsw(context.cx);
+ cx = 1024;
+ _movsw(cx, true);
return;
lowvolumetran:
- context.cx = 1024;
- context.bh = context.data.byte(kVolume);
- context.bl = 0;
- context._add(context.bx, 16384-256);
+ cx = 1024;
+ bh = data.byte(kVolume);
+ bl = 0;
+ _add(bx, 16384-256);
volloop:
- context._lodsw();
- context.bl = context.al;
- context.al = context.es.byte(context.bx);
- context.bl = context.ah;
- context.ah = context.es.byte(context.bx);
- context._stosw();
- if (--context.cx)
+ _lodsw();
+ bl = al;
+ al = es.byte(bx);
+ bl = ah;
+ ah = es.byte(bx);
+ _stosw();
+ if (--cx)
goto volloop;
}
-void domix(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kVolume), 0);
- if (!context.flags.z())
+void DreamGenContext::domix() {
+ STACK_CHECK;
+ _cmp(data.byte(kVolume), 0);
+ if (!flags.z())
goto lowvolumemix;
slow:
- context._lodsb();
- context.ah = context.ds.byte(context.bx);
- context._inc(context.bx);
- context._cmp(context.al, context.dh);
- if (!context.flags.c())
+ _lodsb();
+ ah = ds.byte(bx);
+ _inc(bx);
+ _cmp(al, dh);
+ if (!flags.c())
goto toplot;
- context._cmp(context.ah, context.dh);
- if (!context.flags.c())
+ _cmp(ah, dh);
+ if (!flags.c())
goto nodistort;
- context._add(context.al, context.ah);
- if (context.flags.s())
+ _add(al, ah);
+ if (flags.s())
goto botok;
- context._xor(context.al, context.al);
- context._stosb();
- if (--context.cx)
+ _xor(al, al);
+ _stosb();
+ if (--cx)
goto slow;
- goto doneit;
+ return /* (doneit) */;
botok:
- context._xor(context.al, context.dh);
- context._stosb();
- if (--context.cx)
+ _xor(al, dh);
+ _stosb();
+ if (--cx)
goto slow;
- goto doneit;
+ return /* (doneit) */;
toplot:
- context._cmp(context.ah, context.dh);
- if (context.flags.c())
+ _cmp(ah, dh);
+ if (flags.c())
goto nodistort;
- context._add(context.al, context.ah);
- if (!context.flags.s())
+ _add(al, ah);
+ if (!flags.s())
goto topok;
- context.al = context.dl;
- context._stosb();
- if (--context.cx)
+ al = dl;
+ _stosb();
+ if (--cx)
goto slow;
- goto doneit;
+ return /* (doneit) */;
topok:
- context._xor(context.al, context.dh);
- context._stosb();
- if (--context.cx)
+ _xor(al, dh);
+ _stosb();
+ if (--cx)
goto slow;
- goto doneit;
+ return /* (doneit) */;
nodistort:
- context._add(context.al, context.ah);
- context._xor(context.al, context.dh);
- context._stosb();
- if (--context.cx)
+ _add(al, ah);
+ _xor(al, dh);
+ _stosb();
+ if (--cx)
goto slow;
- goto doneit;
+ return /* (doneit) */;
lowvolumemix:
- context._lodsb();
- context.push(context.bx);
- context.bh = context.data.byte(kVolume);
- context._add(context.bh, 63);
- context.bl = context.al;
- context.al = context.es.byte(context.bx);
- context.bx = context.pop();
- context.ah = context.ds.byte(context.bx);
- context._inc(context.bx);
- context._cmp(context.al, context.dh);
- if (!context.flags.c())
+ _lodsb();
+ push(bx);
+ bh = data.byte(kVolume);
+ _add(bh, 63);
+ bl = al;
+ al = es.byte(bx);
+ bx = pop();
+ ah = ds.byte(bx);
+ _inc(bx);
+ _cmp(al, dh);
+ if (!flags.c())
goto toplotv;
- context._cmp(context.ah, context.dh);
- if (!context.flags.c())
+ _cmp(ah, dh);
+ if (!flags.c())
goto nodistortv;
- context._add(context.al, context.ah);
- if (context.flags.s())
+ _add(al, ah);
+ if (flags.s())
goto botokv;
- context._xor(context.al, context.al);
- context._stosb();
- if (--context.cx)
+ _xor(al, al);
+ _stosb();
+ if (--cx)
goto lowvolumemix;
- goto doneit;
+ return /* (doneit) */;
botokv:
- context._xor(context.al, context.dh);
- context._stosb();
- if (--context.cx)
+ _xor(al, dh);
+ _stosb();
+ if (--cx)
goto lowvolumemix;
- goto doneit;
+ return /* (doneit) */;
toplotv:
- context._cmp(context.ah, context.dh);
- if (context.flags.c())
+ _cmp(ah, dh);
+ if (flags.c())
goto nodistortv;
- context._add(context.al, context.ah);
- if (!context.flags.s())
+ _add(al, ah);
+ if (!flags.s())
goto topokv;
- context.al = context.dl;
- context._stosb();
- if (--context.cx)
+ al = dl;
+ _stosb();
+ if (--cx)
goto lowvolumemix;
- goto doneit;
+ return /* (doneit) */;
topokv:
- context._xor(context.al, context.dh);
- context._stosb();
- if (--context.cx)
+ _xor(al, dh);
+ _stosb();
+ if (--cx)
goto lowvolumemix;
- goto doneit;
+ return /* (doneit) */;
nodistortv:
- context._add(context.al, context.ah);
- context._xor(context.al, context.dh);
- context._stosb();
- if (--context.cx)
+ _add(al, ah);
+ _xor(al, dh);
+ _stosb();
+ if (--cx)
goto lowvolumemix;
-doneit:
- return;
}
-void entrytexts(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kLocation), 21);
- if (!context.flags.z())
+void DreamGenContext::entrytexts() {
+ STACK_CHECK;
+ _cmp(data.byte(kLocation), 21);
+ if (!flags.z())
goto notloc15;
- context.al = 28;
- context.cx = 60;
- context.dx = 11;
- context.bl = 68;
- context.bh = 64;
- setuptimeduse(context);
+ al = 28;
+ cx = 60;
+ dx = 11;
+ bl = 68;
+ bh = 64;
+ setuptimeduse();
return;
notloc15:
- context._cmp(context.data.byte(kLocation), 30);
- if (!context.flags.z())
+ _cmp(data.byte(kLocation), 30);
+ if (!flags.z())
goto notloc43;
- context.al = 27;
- context.cx = 60;
- context.dx = 11;
- context.bl = 68;
- context.bh = 64;
- setuptimeduse(context);
+ al = 27;
+ cx = 60;
+ dx = 11;
+ bl = 68;
+ bh = 64;
+ setuptimeduse();
return;
notloc43:
- context._cmp(context.data.byte(kLocation), 23);
- if (!context.flags.z())
+ _cmp(data.byte(kLocation), 23);
+ if (!flags.z())
goto notloc23;
- context.al = 29;
- context.cx = 60;
- context.dx = 11;
- context.bl = 68;
- context.bh = 64;
- setuptimeduse(context);
+ al = 29;
+ cx = 60;
+ dx = 11;
+ bl = 68;
+ bh = 64;
+ setuptimeduse();
return;
notloc23:
- context._cmp(context.data.byte(kLocation), 31);
- if (!context.flags.z())
+ _cmp(data.byte(kLocation), 31);
+ if (!flags.z())
goto notloc44;
- context.al = 30;
- context.cx = 60;
- context.dx = 11;
- context.bl = 68;
- context.bh = 64;
- setuptimeduse(context);
+ al = 30;
+ cx = 60;
+ dx = 11;
+ bl = 68;
+ bh = 64;
+ setuptimeduse();
return;
notloc44:
- context._cmp(context.data.byte(kLocation), 20);
- if (!context.flags.z())
+ _cmp(data.byte(kLocation), 20);
+ if (!flags.z())
goto notsarters2;
- context.al = 31;
- context.cx = 60;
- context.dx = 11;
- context.bl = 68;
- context.bh = 64;
- setuptimeduse(context);
+ al = 31;
+ cx = 60;
+ dx = 11;
+ bl = 68;
+ bh = 64;
+ setuptimeduse();
return;
notsarters2:
- context._cmp(context.data.byte(kLocation), 24);
- if (!context.flags.z())
+ _cmp(data.byte(kLocation), 24);
+ if (!flags.z())
goto notedenlob;
- context.al = 32;
- context.cx = 60;
- context.dx = 3;
- context.bl = 68;
- context.bh = 64;
- setuptimeduse(context);
+ al = 32;
+ cx = 60;
+ dx = 3;
+ bl = 68;
+ bh = 64;
+ setuptimeduse();
return;
notedenlob:
- context._cmp(context.data.byte(kLocation), 34);
- if (!context.flags.z())
- goto noteden2;
- context.al = 33;
- context.cx = 60;
- context.dx = 3;
- context.bl = 68;
- context.bh = 64;
- setuptimeduse(context);
- return;
-noteden2:
- return;
-}
-
-void entryanims(Context &context) {
- STACK_CHECK(context);
- context.data.word(kReeltowatch) = -1;
- context.data.byte(kWatchmode) = -1;
- context._cmp(context.data.byte(kLocation), 33);
- if (!context.flags.z())
+ _cmp(data.byte(kLocation), 34);
+ if (!flags.z())
+ return /* (noteden2) */;
+ al = 33;
+ cx = 60;
+ dx = 3;
+ bl = 68;
+ bh = 64;
+ setuptimeduse();
+}
+
+void DreamGenContext::entryanims() {
+ STACK_CHECK;
+ data.word(kReeltowatch) = -1;
+ data.byte(kWatchmode) = -1;
+ _cmp(data.byte(kLocation), 33);
+ if (!flags.z())
goto notinthebeach;
- switchryanoff(context);
- context.data.word(kWatchingtime) = 76*2;
- context.data.word(kReeltowatch) = 0;
- context.data.word(kEndwatchreel) = 76;
- context.data.byte(kWatchspeed) = 1;
- context.data.byte(kSpeedcount) = 1;
+ switchryanoff();
+ data.word(kWatchingtime) = 76*2;
+ data.word(kReeltowatch) = 0;
+ data.word(kEndwatchreel) = 76;
+ data.byte(kWatchspeed) = 1;
+ data.byte(kSpeedcount) = 1;
return;
notinthebeach:
- context._cmp(context.data.byte(kLocation), 44);
- if (!context.flags.z())
+ _cmp(data.byte(kLocation), 44);
+ if (!flags.z())
goto notsparkys;
- context.al = 8;
- resetlocation(context);
- context.data.word(kWatchingtime) = 50*2;
- context.data.word(kReeltowatch) = 247;
- context.data.word(kEndwatchreel) = 297;
- context.data.byte(kWatchspeed) = 1;
- context.data.byte(kSpeedcount) = 1;
- switchryanoff(context);
+ al = 8;
+ resetlocation();
+ data.word(kWatchingtime) = 50*2;
+ data.word(kReeltowatch) = 247;
+ data.word(kEndwatchreel) = 297;
+ data.byte(kWatchspeed) = 1;
+ data.byte(kSpeedcount) = 1;
+ switchryanoff();
return;
notsparkys:
- context._cmp(context.data.byte(kLocation), 22);
- if (!context.flags.z())
+ _cmp(data.byte(kLocation), 22);
+ if (!flags.z())
goto notinthelift;
- context.data.word(kWatchingtime) = 31*2;
- context.data.word(kReeltowatch) = 0;
- context.data.word(kEndwatchreel) = 30;
- context.data.byte(kWatchspeed) = 1;
- context.data.byte(kSpeedcount) = 1;
- switchryanoff(context);
+ data.word(kWatchingtime) = 31*2;
+ data.word(kReeltowatch) = 0;
+ data.word(kEndwatchreel) = 30;
+ data.byte(kWatchspeed) = 1;
+ data.byte(kSpeedcount) = 1;
+ switchryanoff();
return;
notinthelift:
- context._cmp(context.data.byte(kLocation), 26);
- if (!context.flags.z())
+ _cmp(data.byte(kLocation), 26);
+ if (!flags.z())
goto notunderchurch;
- context.data.byte(kSymboltopnum) = 2;
- context.data.byte(kSymbolbotnum) = 1;
+ data.byte(kSymboltopnum) = 2;
+ data.byte(kSymbolbotnum) = 1;
return;
notunderchurch:
- context._cmp(context.data.byte(kLocation), 45);
- if (!context.flags.z())
+ _cmp(data.byte(kLocation), 45);
+ if (!flags.z())
goto notenterdream;
- context.data.byte(kKeeperflag) = 0;
- context.data.word(kWatchingtime) = 296;
- context.data.word(kReeltowatch) = 45;
- context.data.word(kEndwatchreel) = 198;
- context.data.byte(kWatchspeed) = 1;
- context.data.byte(kSpeedcount) = 1;
- switchryanoff(context);
+ data.byte(kKeeperflag) = 0;
+ data.word(kWatchingtime) = 296;
+ data.word(kReeltowatch) = 45;
+ data.word(kEndwatchreel) = 198;
+ data.byte(kWatchspeed) = 1;
+ data.byte(kSpeedcount) = 1;
+ switchryanoff();
return;
notenterdream:
- context._cmp(context.data.byte(kReallocation), 46);
- if (!context.flags.z())
+ _cmp(data.byte(kReallocation), 46);
+ if (!flags.z())
goto notcrystal;
- context._cmp(context.data.byte(kSartaindead), 1);
- if (!context.flags.z())
+ _cmp(data.byte(kSartaindead), 1);
+ if (!flags.z())
goto notcrystal;
- context.al = 0;
- removefreeobject(context);
+ al = 0;
+ removefreeobject();
return;
notcrystal:
- context._cmp(context.data.byte(kLocation), 9);
- if (!context.flags.z())
+ _cmp(data.byte(kLocation), 9);
+ if (!flags.z())
goto nottopchurch;
- context.al = 2;
- checkifpathison(context);
- if (context.flags.z())
+ al = 2;
+ checkifpathison();
+ if (flags.z())
goto nottopchurch;
- context._cmp(context.data.byte(kAidedead), 0);
- if (context.flags.z())
+ _cmp(data.byte(kAidedead), 0);
+ if (flags.z())
goto nottopchurch;
- context.al = 3;
- checkifpathison(context);
- if (!context.flags.z())
+ al = 3;
+ checkifpathison();
+ if (!flags.z())
goto makedoorsopen;
- context.al = 2;
- turnpathon(context);
+ al = 2;
+ turnpathon();
makedoorsopen:
- context.al = 4;
- removesetobject(context);
- context.al = 5;
- placesetobject(context);
+ al = 4;
+ removesetobject();
+ al = 5;
+ placesetobject();
return;
nottopchurch:
- context._cmp(context.data.byte(kLocation), 47);
- if (!context.flags.z())
+ _cmp(data.byte(kLocation), 47);
+ if (!flags.z())
goto notdreamcentre;
- context.al = 4;
- placesetobject(context);
- context.al = 5;
- placesetobject(context);
+ al = 4;
+ placesetobject();
+ al = 5;
+ placesetobject();
return;
notdreamcentre:
- context._cmp(context.data.byte(kLocation), 38);
- if (!context.flags.z())
+ _cmp(data.byte(kLocation), 38);
+ if (!flags.z())
goto notcarpark;
- context.data.word(kWatchingtime) = 57*2;
- context.data.word(kReeltowatch) = 4;
- context.data.word(kEndwatchreel) = 57;
- context.data.byte(kWatchspeed) = 1;
- context.data.byte(kSpeedcount) = 1;
- switchryanoff(context);
+ data.word(kWatchingtime) = 57*2;
+ data.word(kReeltowatch) = 4;
+ data.word(kEndwatchreel) = 57;
+ data.byte(kWatchspeed) = 1;
+ data.byte(kSpeedcount) = 1;
+ switchryanoff();
return;
notcarpark:
- context._cmp(context.data.byte(kLocation), 32);
- if (!context.flags.z())
+ _cmp(data.byte(kLocation), 32);
+ if (!flags.z())
goto notalley;
- context.data.word(kWatchingtime) = 66*2;
- context.data.word(kReeltowatch) = 0;
- context.data.word(kEndwatchreel) = 66;
- context.data.byte(kWatchspeed) = 1;
- context.data.byte(kSpeedcount) = 1;
- switchryanoff(context);
+ data.word(kWatchingtime) = 66*2;
+ data.word(kReeltowatch) = 0;
+ data.word(kEndwatchreel) = 66;
+ data.byte(kWatchspeed) = 1;
+ data.byte(kSpeedcount) = 1;
+ switchryanoff();
return;
notalley:
- context._cmp(context.data.byte(kLocation), 24);
- if (!context.flags.z())
- goto notedensagain;
- context.al = 2;
- context.ah = context.data.byte(kRoomnum);
- context._dec(context.ah);
- turnanypathon(context);
-notedensagain:
- return;
-}
-
-void initialinv(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kReallocation), 24);
- if (context.flags.z())
+ _cmp(data.byte(kLocation), 24);
+ if (!flags.z())
+ return /* (notedensagain) */;
+ al = 2;
+ ah = data.byte(kRoomnum);
+ _dec(ah);
+ turnanypathon();
+}
+
+void DreamGenContext::initialinv() {
+ STACK_CHECK;
+ _cmp(data.byte(kReallocation), 24);
+ if (flags.z())
goto isedens;
return;
isedens:
- context.al = 11;
- context.ah = 5;
- pickupob(context);
- context.al = 12;
- context.ah = 6;
- pickupob(context);
- context.al = 13;
- context.ah = 7;
- pickupob(context);
- context.al = 14;
- context.ah = 8;
- pickupob(context);
- context.al = 18;
- context.al = 18;
- context.ah = 0;
- pickupob(context);
- context.al = 19;
- context.ah = 1;
- pickupob(context);
- context.al = 20;
- context.ah = 9;
- pickupob(context);
- context.al = 16;
- context.ah = 2;
- pickupob(context);
- context.data.byte(kWatchmode) = 1;
- context.data.word(kReeltohold) = 0;
- context.data.word(kEndofholdreel) = 6;
- context.data.byte(kWatchspeed) = 1;
- context.data.byte(kSpeedcount) = 1;
- switchryanoff(context);
-}
-
-void pickupob(Context &context) {
- STACK_CHECK(context);
- context.data.byte(kLastinvpos) = context.ah;
- context.data.byte(kObjecttype) = 2;
- context.data.byte(kItemframe) = context.al;
- context.data.byte(kCommand) = context.al;
- getanyad(context);
- transfertoex(context);
-}
-
-void checkforemm(Context &context) {
- STACK_CHECK(context);
-}
-
-void checkbasemem(Context &context) {
- STACK_CHECK(context);
- context.bx = context.data.word(kHowmuchalloc);
- context._cmp(context.bx, 0x9360);
- if (!context.flags.c())
- goto enoughmem;
- context.data.byte(kGameerror) = 5;
- { quickquit(context); return; };
-enoughmem:
- return;
-}
-
-void allocatebuffers(Context &context) {
- STACK_CHECK(context);
- context.bx = (0+2080+30000+(16*114)+((114+2)*2)+18000)/16;
- allocatemem(context);
- context.data.word(kExtras) = context.ax;
- trysoundalloc(context);
- context.bx = (0+(66*60))/16;
- allocatemem(context);
- context.data.word(kMapdata) = context.ax;
- trysoundalloc(context);
- context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4)+(256*24)+(6*64)+991-534+68-0)/16;
- allocatemem(context);
- context.data.word(kBuffers) = context.ax;
- trysoundalloc(context);
- context.bx = (16*80)/16;
- allocatemem(context);
- context.data.word(kFreedat) = context.ax;
- trysoundalloc(context);
- context.bx = (64*128)/16;
- allocatemem(context);
- context.data.word(kSetdat) = context.ax;
- trysoundalloc(context);
- context.bx = (22*8*20*8)/16;
- allocatemem(context);
- context.data.word(kMapstore) = context.ax;
- allocatework(context);
- context.bx = 2048/16;
- allocatemem(context);
- context.data.word(kSounddata) = context.ax;
- context.bx = 2048/16;
- allocatemem(context);
- context.data.word(kSounddata2) = context.ax;
-}
-
-void clearbuffers(Context &context) {
- STACK_CHECK(context);
- context.es = context.data.word(kBuffers);
- context.cx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4)+(256*24)+(6*64)+991-534+68-0)/2;
- context.ax = 0;
- context.di = 0;
- context._stosw(context.cx);
- context.es = context.data.word(kExtras);
- context.cx = (0+2080+30000+(16*114)+((114+2)*2)+18000)/2;
- context.ax = 0x0ffff;
- context.di = 0;
- context._stosw(context.cx);
- context.es = context.data.word(kBuffers);
- context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4)+(256*24)+(6*64));
- context.ds = context.cs;
- context.si = 534;
- context.cx = (991-534);
- context._movsb(context.cx);
- context.es = context.data.word(kBuffers);
- context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4)+(256*24)+(6*64)+991-534);
- context.ds = context.cs;
- context.si = 0;
- context.cx = (68-0);
- context._movsb(context.cx);
- clearchanges(context);
-}
-
-void clearchanges(Context &context) {
- STACK_CHECK(context);
- context.es = context.data.word(kBuffers);
- context.cx = (250)*2;
- context.ax = 0x0ffff;
- context.di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80));
- context._stosw(context.cx);
- context.ds = context.data.word(kBuffers);
- context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4)+(256*24)+(6*64));
- context.es = context.cs;
- context.di = 534;
- context.cx = (991-534);
- context._movsb(context.cx);
- context.ds = context.data.word(kBuffers);
- context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4)+(256*24)+(6*64)+991-534);
- context.es = context.cs;
- context.di = 0;
- context.cx = (68-0);
- context._movsb(context.cx);
- context.data.byte(kExpos) = 0;
- context.data.word(kExframepos) = 0;
- context.data.word(kExtextpos) = 0;
- context.es = context.data.word(kExtras);
- context.cx = (0+2080+30000+(16*114)+((114+2)*2)+18000)/2;
- context.ax = 0x0ffff;
- context.di = 0;
- context._stosw(context.cx);
- context.es = context.cs;
- context.di = 8011;
- context.al = 1;
- context._stosb(2);
- context.al = 0;
- context._stosb();
- context.al = 1;
- context._stosb();
- context.ax = 0;
- context.cx = 6;
- context._stosw(context.cx);
-}
-
-void clearbeforeload(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kRoomloaded), 1);
- if (!context.flags.z())
- goto noclear;
- clearreels(context);
- clearrest(context);
- context.data.byte(kRoomloaded) = 0;
-noclear:
- return;
-}
-
-void clearreels(Context &context) {
- STACK_CHECK(context);
- context.es = context.data.word(kReel1);
- deallocatemem(context);
- context.es = context.data.word(kReel2);
- deallocatemem(context);
- context.es = context.data.word(kReel3);
- deallocatemem(context);
-}
-
-void clearrest(Context &context) {
- STACK_CHECK(context);
- context.es = context.data.word(kMapdata);
- context.cx = (66*60)/2;
- context.ax = 0;
- context.di = (0);
- context._stosw(context.cx);
- context.es = context.data.word(kBackdrop);
- deallocatemem(context);
- context.es = context.data.word(kSetframes);
- deallocatemem(context);
- context.es = context.data.word(kReels);
- deallocatemem(context);
- context.es = context.data.word(kPeople);
- deallocatemem(context);
- context.es = context.data.word(kSetdesc);
- deallocatemem(context);
- context.es = context.data.word(kBlockdesc);
- deallocatemem(context);
- context.es = context.data.word(kRoomdesc);
- deallocatemem(context);
- context.es = context.data.word(kFreeframes);
- deallocatemem(context);
- context.es = context.data.word(kFreedesc);
- deallocatemem(context);
-}
-
-void parseblaster(Context &context) {
- STACK_CHECK(context);
+ al = 11;
+ ah = 5;
+ pickupob();
+ al = 12;
+ ah = 6;
+ pickupob();
+ al = 13;
+ ah = 7;
+ pickupob();
+ al = 14;
+ ah = 8;
+ pickupob();
+ al = 18;
+ al = 18;
+ ah = 0;
+ pickupob();
+ al = 19;
+ ah = 1;
+ pickupob();
+ al = 20;
+ ah = 9;
+ pickupob();
+ al = 16;
+ ah = 2;
+ pickupob();
+ data.byte(kWatchmode) = 1;
+ data.word(kReeltohold) = 0;
+ data.word(kEndofholdreel) = 6;
+ data.byte(kWatchspeed) = 1;
+ data.byte(kSpeedcount) = 1;
+ switchryanoff();
+}
+
+void DreamGenContext::pickupob() {
+ STACK_CHECK;
+ data.byte(kLastinvpos) = ah;
+ data.byte(kObjecttype) = 2;
+ data.byte(kItemframe) = al;
+ data.byte(kCommand) = al;
+ getanyad();
+ transfertoex();
+}
+
+void DreamGenContext::checkforemm() {
+ STACK_CHECK;
+}
+
+void DreamGenContext::checkbasemem() {
+ STACK_CHECK;
+ bx = data.word(kHowmuchalloc);
+ _cmp(bx, 0x9360);
+ if (!flags.c())
+ return /* (enoughmem) */;
+ data.byte(kGameerror) = 5;
+ { quickquit(); return; };
+}
+
+void DreamGenContext::allocatebuffers() {
+ STACK_CHECK;
+ bx = (0+2080+30000+(16*114)+((114+2)*2)+18000)/16;
+ allocatemem();
+ data.word(kExtras) = ax;
+ trysoundalloc();
+ bx = (0+(66*60))/16;
+ allocatemem();
+ data.word(kMapdata) = ax;
+ trysoundalloc();
+ bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4)+(256*24)+(6*64)+991-534+68-0)/16;
+ allocatemem();
+ data.word(kBuffers) = ax;
+ trysoundalloc();
+ bx = (16*80)/16;
+ allocatemem();
+ data.word(kFreedat) = ax;
+ trysoundalloc();
+ bx = (64*128)/16;
+ allocatemem();
+ data.word(kSetdat) = ax;
+ trysoundalloc();
+ bx = (22*8*20*8)/16;
+ allocatemem();
+ data.word(kMapstore) = ax;
+ allocatework();
+ bx = 2048/16;
+ allocatemem();
+ data.word(kSounddata) = ax;
+ bx = 2048/16;
+ allocatemem();
+ data.word(kSounddata2) = ax;
+}
+
+void DreamGenContext::clearbuffers() {
+ STACK_CHECK;
+ es = data.word(kBuffers);
+ cx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4)+(256*24)+(6*64)+991-534+68-0)/2;
+ ax = 0;
+ di = 0;
+ _stosw(cx, true);
+ es = data.word(kExtras);
+ cx = (0+2080+30000+(16*114)+((114+2)*2)+18000)/2;
+ ax = 0x0ffff;
+ di = 0;
+ _stosw(cx, true);
+ es = data.word(kBuffers);
+ di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4)+(256*24)+(6*64));
+ ds = cs;
+ si = 534;
+ cx = (991-534);
+ _movsb(cx, true);
+ es = data.word(kBuffers);
+ di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4)+(256*24)+(6*64)+991-534);
+ ds = cs;
+ si = 0;
+ cx = (68-0);
+ _movsb(cx, true);
+ clearchanges();
+}
+
+void DreamGenContext::clearchanges() {
+ STACK_CHECK;
+ es = data.word(kBuffers);
+ cx = (250)*2;
+ ax = 0x0ffff;
+ di = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80));
+ _stosw(cx, true);
+ ds = data.word(kBuffers);
+ si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4)+(256*24)+(6*64));
+ es = cs;
+ di = 534;
+ cx = (991-534);
+ _movsb(cx, true);
+ ds = data.word(kBuffers);
+ si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5)+(46*40)+(5*80)+(250*4)+(256*24)+(6*64)+991-534);
+ es = cs;
+ di = 0;
+ cx = (68-0);
+ _movsb(cx, true);
+ data.byte(kExpos) = 0;
+ data.word(kExframepos) = 0;
+ data.word(kExtextpos) = 0;
+ es = data.word(kExtras);
+ cx = (0+2080+30000+(16*114)+((114+2)*2)+18000)/2;
+ ax = 0x0ffff;
+ di = 0;
+ _stosw(cx, true);
+ es = cs;
+ di = 8011;
+ al = 1;
+ _stosb(2);
+ al = 0;
+ _stosb();
+ al = 1;
+ _stosb();
+ ax = 0;
+ cx = 6;
+ _stosw(cx, true);
+}
+
+void DreamGenContext::clearbeforeload() {
+ STACK_CHECK;
+ _cmp(data.byte(kRoomloaded), 1);
+ if (!flags.z())
+ return /* (noclear) */;
+ clearreels();
+ clearrest();
+ data.byte(kRoomloaded) = 0;
+}
+
+void DreamGenContext::clearreels() {
+ STACK_CHECK;
+ es = data.word(kReel1);
+ deallocatemem();
+ es = data.word(kReel2);
+ deallocatemem();
+ es = data.word(kReel3);
+ deallocatemem();
+}
+
+void DreamGenContext::clearrest() {
+ STACK_CHECK;
+ es = data.word(kMapdata);
+ cx = (66*60)/2;
+ ax = 0;
+ di = (0);
+ _stosw(cx, true);
+ es = data.word(kBackdrop);
+ deallocatemem();
+ es = data.word(kSetframes);
+ deallocatemem();
+ es = data.word(kReels);
+ deallocatemem();
+ es = data.word(kPeople);
+ deallocatemem();
+ es = data.word(kSetdesc);
+ deallocatemem();
+ es = data.word(kBlockdesc);
+ deallocatemem();
+ es = data.word(kRoomdesc);
+ deallocatemem();
+ es = data.word(kFreeframes);
+ deallocatemem();
+ es = data.word(kFreedesc);
+ deallocatemem();
+}
+
+void DreamGenContext::parseblaster() {
+ STACK_CHECK;
lookattail:
- context.al = context.es.byte(context.bx);
- context._cmp(context.al, 0);
- if (context.flags.z())
- goto endtail;
- context._cmp(context.al, 13);
- if (context.flags.z())
- goto endtail;
- context._cmp(context.al, 'i');
- if (context.flags.z())
+ al = es.byte(bx);
+ _cmp(al, 0);
+ if (flags.z())
+ return /* (endtail) */;
+ _cmp(al, 13);
+ if (flags.z())
+ return /* (endtail) */;
+ _cmp(al, 'i');
+ if (flags.z())
goto issoundint;
- context._cmp(context.al, 'I');
- if (context.flags.z())
+ _cmp(al, 'I');
+ if (flags.z())
goto issoundint;
- context._cmp(context.al, 'b');
- if (context.flags.z())
+ _cmp(al, 'b');
+ if (flags.z())
goto isbright;
- context._cmp(context.al, 'B');
- if (context.flags.z())
+ _cmp(al, 'B');
+ if (flags.z())
goto isbright;
- context._cmp(context.al, 'a');
- if (context.flags.z())
+ _cmp(al, 'a');
+ if (flags.z())
goto isbaseadd;
- context._cmp(context.al, 'A');
- if (context.flags.z())
+ _cmp(al, 'A');
+ if (flags.z())
goto isbaseadd;
- context._cmp(context.al, 'n');
- if (context.flags.z())
+ _cmp(al, 'n');
+ if (flags.z())
goto isnosound;
- context._cmp(context.al, 'N');
- if (context.flags.z())
+ _cmp(al, 'N');
+ if (flags.z())
goto isnosound;
- context._cmp(context.al, 'd');
- if (context.flags.z())
+ _cmp(al, 'd');
+ if (flags.z())
goto isdma;
- context._cmp(context.al, 'D');
- if (context.flags.z())
+ _cmp(al, 'D');
+ if (flags.z())
goto isdma;
- context._inc(context.bx);
- if (--context.cx)
+ _inc(bx);
+ if (--cx)
goto lookattail;
return;
issoundint:
- context.al = context.es.byte(context.bx+1);
- context._sub(context.al, '0');
- context.data.byte(kSoundint) = context.al;
- context._inc(context.bx);
+ al = es.byte(bx+1);
+ _sub(al, '0');
+ data.byte(kSoundint) = al;
+ _inc(bx);
goto lookattail;
isdma:
- context.al = context.es.byte(context.bx+1);
- context._sub(context.al, '0');
- context.data.byte(kSounddmachannel) = context.al;
- context._inc(context.bx);
+ al = es.byte(bx+1);
+ _sub(al, '0');
+ data.byte(kSounddmachannel) = al;
+ _inc(bx);
goto lookattail;
isbaseadd:
- context.push(context.cx);
- context.al = context.es.byte(context.bx+2);
- context._sub(context.al, '0');
- context.ah = 0;
- context.cl = 4;
- context._shl(context.ax, context.cl);
- context._add(context.ax, 0x200);
- context.data.word(kSoundbaseadd) = context.ax;
- context.cx = context.pop();
- context._inc(context.bx);
+ push(cx);
+ al = es.byte(bx+2);
+ _sub(al, '0');
+ ah = 0;
+ cl = 4;
+ _shl(ax, cl);
+ _add(ax, 0x200);
+ data.word(kSoundbaseadd) = ax;
+ cx = pop();
+ _inc(bx);
goto lookattail;
isbright:
- context.data.byte(kBrightness) = 1;
- context._inc(context.bx);
+ data.byte(kBrightness) = 1;
+ _inc(bx);
goto lookattail;
isnosound:
- context.data.byte(kSoundint) = 255;
- context._inc(context.bx);
+ data.byte(kSoundint) = 255;
+ _inc(bx);
goto lookattail;
-endtail:
- return;
-}
-
-void startup(Context &context) {
- STACK_CHECK(context);
- context.data.byte(kCurrentkey) = 0;
- context.data.byte(kMainmode) = 0;
- createpanel(context);
- context.data.byte(kNewobs) = 1;
- drawfloor(context);
- showicon(context);
- getunderzoom(context);
- spriteupdate(context);
- printsprites(context);
- undertextline(context);
- reelsonscreen(context);
- atmospheres(context);
-}
-
-void startup1(Context &context) {
- STACK_CHECK(context);
- clearpalette(context);
- context.data.byte(kThroughdoor) = 0;
- context.data.byte(kCurrentkey) = '0';
- context.data.byte(kMainmode) = 0;
- createpanel(context);
- context.data.byte(kNewobs) = 1;
- drawfloor(context);
- showicon(context);
- getunderzoom(context);
- spriteupdate(context);
- printsprites(context);
- undertextline(context);
- reelsonscreen(context);
- atmospheres(context);
- worktoscreen(context);
- fadescreenup(context);
-}
-
-void screenupdate(Context &context) {
- STACK_CHECK(context);
- newplace(context);
- mainscreen(context);
- animpointer(context);
- showpointer(context);
- context._cmp(context.data.word(kWatchingtime), 0);
- if (!context.flags.z())
+}
+
+void DreamGenContext::startup() {
+ STACK_CHECK;
+ data.byte(kCurrentkey) = 0;
+ data.byte(kMainmode) = 0;
+ createpanel();
+ data.byte(kNewobs) = 1;
+ drawfloor();
+ showicon();
+ getunderzoom();
+ spriteupdate();
+ printsprites();
+ undertextline();
+ reelsonscreen();
+ atmospheres();
+}
+
+void DreamGenContext::startup1() {
+ STACK_CHECK;
+ clearpalette();
+ data.byte(kThroughdoor) = 0;
+ data.byte(kCurrentkey) = '0';
+ data.byte(kMainmode) = 0;
+ createpanel();
+ data.byte(kNewobs) = 1;
+ drawfloor();
+ showicon();
+ getunderzoom();
+ spriteupdate();
+ printsprites();
+ undertextline();
+ reelsonscreen();
+ atmospheres();
+ worktoscreen();
+ fadescreenup();
+}
+
+void DreamGenContext::screenupdate() {
+ STACK_CHECK;
+ newplace();
+ mainscreen();
+ animpointer();
+ showpointer();
+ _cmp(data.word(kWatchingtime), 0);
+ if (!flags.z())
goto iswatchingmode;
- context._cmp(context.data.byte(kNewlocation), 255);
- if (!context.flags.z())
- goto finishearly;
+ _cmp(data.byte(kNewlocation), 255);
+ if (!flags.z())
+ return /* (finishearly) */;
iswatchingmode:
- vsync(context);
- readmouse1(context);
- dumppointer(context);
- dumptextline(context);
- delpointer(context);
- autolook(context);
- spriteupdate(context);
- watchcount(context);
- zoom(context);
- showpointer(context);
- context._cmp(context.data.byte(kWongame), 0);
- if (!context.flags.z())
- goto finishearly;
- vsync(context);
- readmouse2(context);
- dumppointer(context);
- dumpzoom(context);
- delpointer(context);
- deleverything(context);
- printsprites(context);
- reelsonscreen(context);
- afternewroom(context);
- showpointer(context);
- vsync(context);
- readmouse3(context);
- dumppointer(context);
- dumpmap(context);
- dumptimedtext(context);
- delpointer(context);
- showpointer(context);
- vsync(context);
- readmouse4(context);
- dumppointer(context);
- dumpwatch(context);
- delpointer(context);
-finishearly:
- return;
-}
-
-void watchreel(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.word(kReeltowatch), -1);
- if (context.flags.z())
+ vsync();
+ readmouse1();
+ dumppointer();
+ dumptextline();
+ delpointer();
+ autolook();
+ spriteupdate();
+ watchcount();
+ zoom();
+ showpointer();
+ _cmp(data.byte(kWongame), 0);
+ if (!flags.z())
+ return /* (finishearly) */;
+ vsync();
+ readmouse2();
+ dumppointer();
+ dumpzoom();
+ delpointer();
+ deleverything();
+ printsprites();
+ reelsonscreen();
+ afternewroom();
+ showpointer();
+ vsync();
+ readmouse3();
+ dumppointer();
+ dumpmap();
+ dumptimedtext();
+ delpointer();
+ showpointer();
+ vsync();
+ readmouse4();
+ dumppointer();
+ dumpwatch();
+ delpointer();
+}
+
+void DreamGenContext::watchreel() {
+ STACK_CHECK;
+ _cmp(data.word(kReeltowatch), -1);
+ if (flags.z())
goto notplayingreel;
- context.al = context.data.byte(kManspath);
- context._cmp(context.al, context.data.byte(kFinaldest));
- if (!context.flags.z())
- goto waitstopwalk;
- context.al = context.data.byte(kTurntoface);
- context._cmp(context.al, context.data.byte(kFacing));
- if (context.flags.z())
+ al = data.byte(kManspath);
+ _cmp(al, data.byte(kFinaldest));
+ if (!flags.z())
+ return /* (waitstopwalk) */;
+ al = data.byte(kTurntoface);
+ _cmp(al, data.byte(kFacing));
+ if (flags.z())
goto notwatchpath;
-waitstopwalk:
return;
notwatchpath:
- context._dec(context.data.byte(kSpeedcount));
- context._cmp(context.data.byte(kSpeedcount), -1);
- if (!context.flags.z())
+ _dec(data.byte(kSpeedcount));
+ _cmp(data.byte(kSpeedcount), -1);
+ if (!flags.z())
goto showwatchreel;
- context.al = context.data.byte(kWatchspeed);
- context.data.byte(kSpeedcount) = context.al;
- context.ax = context.data.word(kReeltowatch);
- context._cmp(context.ax, context.data.word(kEndwatchreel));
- if (!context.flags.z())
+ al = data.byte(kWatchspeed);
+ data.byte(kSpeedcount) = al;
+ ax = data.word(kReeltowatch);
+ _cmp(ax, data.word(kEndwatchreel));
+ if (!flags.z())
goto ismorereel;
- context._cmp(context.data.word(kWatchingtime), 0);
- if (!context.flags.z())
+ _cmp(data.word(kWatchingtime), 0);
+ if (!flags.z())
goto showwatchreel;
- context.data.word(kReeltowatch) = -1;
- context.data.byte(kWatchmode) = -1;
- context._cmp(context.data.word(kReeltohold), -1);
- if (context.flags.z())
- goto nomorereel;
- context.data.byte(kWatchmode) = 1;
+ data.word(kReeltowatch) = -1;
+ data.byte(kWatchmode) = -1;
+ _cmp(data.word(kReeltohold), -1);
+ if (flags.z())
+ return /* (nomorereel) */;
+ data.byte(kWatchmode) = 1;
goto notplayingreel;
ismorereel:
- context._inc(context.data.word(kReeltowatch));
+ _inc(data.word(kReeltowatch));
showwatchreel:
- context.ax = context.data.word(kReeltowatch);
- context.data.word(kReelpointer) = context.ax;
- plotreel(context);
- context.ax = context.data.word(kReelpointer);
- context.data.word(kReeltowatch) = context.ax;
- checkforshake(context);
-nomorereel:
+ ax = data.word(kReeltowatch);
+ data.word(kReelpointer) = ax;
+ plotreel();
+ ax = data.word(kReelpointer);
+ data.word(kReeltowatch) = ax;
+ checkforshake();
return;
notplayingreel:
- context._cmp(context.data.byte(kWatchmode), 1);
- if (!context.flags.z())
+ _cmp(data.byte(kWatchmode), 1);
+ if (!flags.z())
goto notholdingreel;
- context.ax = context.data.word(kReeltohold);
- context.data.word(kReelpointer) = context.ax;
- plotreel(context);
+ ax = data.word(kReeltohold);
+ data.word(kReelpointer) = ax;
+ plotreel();
return;
notholdingreel:
- context._cmp(context.data.byte(kWatchmode), 2);
- if (!context.flags.z())
- goto notreleasehold;
- context._dec(context.data.byte(kSpeedcount));
- context._cmp(context.data.byte(kSpeedcount), -1);
- if (!context.flags.z())
+ _cmp(data.byte(kWatchmode), 2);
+ if (!flags.z())
+ return /* (notreleasehold) */;
+ _dec(data.byte(kSpeedcount));
+ _cmp(data.byte(kSpeedcount), -1);
+ if (!flags.z())
goto notlastspeed2;
- context.al = context.data.byte(kWatchspeed);
- context.data.byte(kSpeedcount) = context.al;
- context._inc(context.data.word(kReeltohold));
+ al = data.byte(kWatchspeed);
+ data.byte(kSpeedcount) = al;
+ _inc(data.word(kReeltohold));
notlastspeed2:
- context.ax = context.data.word(kReeltohold);
- context._cmp(context.ax, context.data.word(kEndofholdreel));
- if (!context.flags.z())
+ ax = data.word(kReeltohold);
+ _cmp(ax, data.word(kEndofholdreel));
+ if (!flags.z())
goto ismorereel2;
- context.data.word(kReeltohold) = -1;
- context.data.byte(kWatchmode) = -1;
- context.al = context.data.byte(kDestafterhold);
- context.data.byte(kDestination) = context.al;
- context.data.byte(kFinaldest) = context.al;
- autosetwalk(context);
+ data.word(kReeltohold) = -1;
+ data.byte(kWatchmode) = -1;
+ al = data.byte(kDestafterhold);
+ data.byte(kDestination) = al;
+ data.byte(kFinaldest) = al;
+ autosetwalk();
return;
ismorereel2:
- context.ax = context.data.word(kReeltohold);
- context.data.word(kReelpointer) = context.ax;
- plotreel(context);
- return;
-notreleasehold:
- return;
-}
-
-void checkforshake(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kReallocation), 26);
- if (!context.flags.z())
- goto notstartshake;
- context._cmp(context.ax, 104);
- if (!context.flags.z())
- goto notstartshake;
- context.data.byte(kShakecounter) = -1;
-notstartshake:
- return;
-}
-
-void watchcount(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kWatchon), 0);
- if (context.flags.z())
- goto nowatchworn;
- context._inc(context.data.byte(kTimercount));
- context._cmp(context.data.byte(kTimercount), 9);
- if (context.flags.z())
+ ax = data.word(kReeltohold);
+ data.word(kReelpointer) = ax;
+ plotreel();
+}
+
+void DreamGenContext::checkforshake() {
+ STACK_CHECK;
+ _cmp(data.byte(kReallocation), 26);
+ if (!flags.z())
+ return /* (notstartshake) */;
+ _cmp(ax, 104);
+ if (!flags.z())
+ return /* (notstartshake) */;
+ data.byte(kShakecounter) = -1;
+}
+
+void DreamGenContext::watchcount() {
+ STACK_CHECK;
+ _cmp(data.byte(kWatchon), 0);
+ if (flags.z())
+ return /* (nowatchworn) */;
+ _inc(data.byte(kTimercount));
+ _cmp(data.byte(kTimercount), 9);
+ if (flags.z())
goto flashdots;
- context._cmp(context.data.byte(kTimercount), 18);
- if (context.flags.z())
+ _cmp(data.byte(kTimercount), 18);
+ if (flags.z())
goto uptime;
-nowatchworn:
return;
flashdots:
- context.ax = 91*3+21;
- context.di = 268+4;
- context.bx = 21;
- context.ds = context.data.word(kCharset1);
- showframe(context);
+ ax = 91*3+21;
+ di = 268+4;
+ bx = 21;
+ ds = data.word(kCharset1);
+ showframe();
goto finishwatch;
uptime:
- context.data.byte(kTimercount) = 0;
- context._add(context.data.byte(kSecondcount), 1);
- context._cmp(context.data.byte(kSecondcount), 60);
- if (!context.flags.z())
+ data.byte(kTimercount) = 0;
+ _add(data.byte(kSecondcount), 1);
+ _cmp(data.byte(kSecondcount), 60);
+ if (!flags.z())
goto finishtime;
- context.data.byte(kSecondcount) = 0;
- context._inc(context.data.byte(kMinutecount));
- context._cmp(context.data.byte(kMinutecount), 60);
- if (!context.flags.z())
+ data.byte(kSecondcount) = 0;
+ _inc(data.byte(kMinutecount));
+ _cmp(data.byte(kMinutecount), 60);
+ if (!flags.z())
goto finishtime;
- context.data.byte(kMinutecount) = 0;
- context._inc(context.data.byte(kHourcount));
- context._cmp(context.data.byte(kHourcount), 24);
- if (!context.flags.z())
+ data.byte(kMinutecount) = 0;
+ _inc(data.byte(kHourcount));
+ _cmp(data.byte(kHourcount), 24);
+ if (!flags.z())
goto finishtime;
- context.data.byte(kHourcount) = 0;
+ data.byte(kHourcount) = 0;
finishtime:
- showtime(context);
+ showtime();
finishwatch:
- context.data.byte(kWatchdump) = 1;
-}
-
-void showtime(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kWatchon), 0);
- if (context.flags.z())
- goto nowatch;
- context.al = context.data.byte(kSecondcount);
- context.cl = 0;
- twodigitnum(context);
- context.push(context.ax);
- context.al = context.ah;
- context.ah = 0;
- context._add(context.ax, 91*3+10);
- context.ds = context.data.word(kCharset1);
- context.di = 282+5;
- context.bx = 21;
- showframe(context);
- context.ax = context.pop();
- context.ah = 0;
- context._add(context.ax, 91*3+10);
- context.ds = context.data.word(kCharset1);
- context.di = 282+9;
- context.bx = 21;
- showframe(context);
- context.al = context.data.byte(kMinutecount);
- context.cl = 0;
- twodigitnum(context);
- context.push(context.ax);
- context.al = context.ah;
- context.ah = 0;
- context._add(context.ax, 91*3);
- context.ds = context.data.word(kCharset1);
- context.di = 270+5;
- context.bx = 21;
- showframe(context);
- context.ax = context.pop();
- context.ah = 0;
- context._add(context.ax, 91*3);
- context.ds = context.data.word(kCharset1);
- context.di = 270+11;
- context.bx = 21;
- showframe(context);
- context.al = context.data.byte(kHourcount);
- context.cl = 0;
- twodigitnum(context);
- context.push(context.ax);
- context.al = context.ah;
- context.ah = 0;
- context._add(context.ax, 91*3);
- context.ds = context.data.word(kCharset1);
- context.di = 256+5;
- context.bx = 21;
- showframe(context);
- context.ax = context.pop();
- context.ah = 0;
- context._add(context.ax, 91*3);
- context.ds = context.data.word(kCharset1);
- context.di = 256+11;
- context.bx = 21;
- showframe(context);
- context.ax = 91*3+20;
- context.ds = context.data.word(kCharset1);
- context.di = 267+5;
- context.bx = 21;
- showframe(context);
-nowatch:
- return;
-}
-
-void dumpwatch(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kWatchdump), 1);
- if (!context.flags.z())
- goto nodumpwatch;
- context.di = 256;
- context.bx = 21;
- context.cl = 40;
- context.ch = 12;
- multidump(context);
- context.data.byte(kWatchdump) = 0;
-nodumpwatch:
- return;
-}
-
-void showbyte(Context &context) {
- STACK_CHECK(context);
- context.dl = context.al;
- context._shr(context.dl, 1);
- context._shr(context.dl, 1);
- context._shr(context.dl, 1);
- context._shr(context.dl, 1);
- onedigit(context);
- context.es.byte(context.di) = context.dl;
- context.dl = context.al;
- context._and(context.dl, 15);
- onedigit(context);
- context.es.byte(context.di+1) = context.dl;
- context._add(context.di, 3);
-}
-
-void onedigit(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.dl, 10);
- if (!context.flags.c())
+ data.byte(kWatchdump) = 1;
+}
+
+void DreamGenContext::showtime() {
+ STACK_CHECK;
+ _cmp(data.byte(kWatchon), 0);
+ if (flags.z())
+ return /* (nowatch) */;
+ al = data.byte(kSecondcount);
+ cl = 0;
+ twodigitnum();
+ push(ax);
+ al = ah;
+ ah = 0;
+ _add(ax, 91*3+10);
+ ds = data.word(kCharset1);
+ di = 282+5;
+ bx = 21;
+ showframe();
+ ax = pop();
+ ah = 0;
+ _add(ax, 91*3+10);
+ ds = data.word(kCharset1);
+ di = 282+9;
+ bx = 21;
+ showframe();
+ al = data.byte(kMinutecount);
+ cl = 0;
+ twodigitnum();
+ push(ax);
+ al = ah;
+ ah = 0;
+ _add(ax, 91*3);
+ ds = data.word(kCharset1);
+ di = 270+5;
+ bx = 21;
+ showframe();
+ ax = pop();
+ ah = 0;
+ _add(ax, 91*3);
+ ds = data.word(kCharset1);
+ di = 270+11;
+ bx = 21;
+ showframe();
+ al = data.byte(kHourcount);
+ cl = 0;
+ twodigitnum();
+ push(ax);
+ al = ah;
+ ah = 0;
+ _add(ax, 91*3);
+ ds = data.word(kCharset1);
+ di = 256+5;
+ bx = 21;
+ showframe();
+ ax = pop();
+ ah = 0;
+ _add(ax, 91*3);
+ ds = data.word(kCharset1);
+ di = 256+11;
+ bx = 21;
+ showframe();
+ ax = 91*3+20;
+ ds = data.word(kCharset1);
+ di = 267+5;
+ bx = 21;
+ showframe();
+}
+
+void DreamGenContext::dumpwatch() {
+ STACK_CHECK;
+ _cmp(data.byte(kWatchdump), 1);
+ if (!flags.z())
+ return /* (nodumpwatch) */;
+ di = 256;
+ bx = 21;
+ cl = 40;
+ ch = 12;
+ multidump();
+ data.byte(kWatchdump) = 0;
+}
+
+void DreamGenContext::showbyte() {
+ STACK_CHECK;
+ dl = al;
+ _shr(dl, 1);
+ _shr(dl, 1);
+ _shr(dl, 1);
+ _shr(dl, 1);
+ onedigit();
+ es.byte(di) = dl;
+ dl = al;
+ _and(dl, 15);
+ onedigit();
+ es.byte(di+1) = dl;
+ _add(di, 3);
+}
+
+void DreamGenContext::onedigit() {
+ STACK_CHECK;
+ _cmp(dl, 10);
+ if (!flags.c())
goto morethan10;
- context._add(context.dl, '0');
+ _add(dl, '0');
return;
morethan10:
- context._sub(context.dl, 10);
- context._add(context.dl, 'A');
+ _sub(dl, 10);
+ _add(dl, 'A');
}
-void twodigitnum(Context &context) {
- STACK_CHECK(context);
- context.ah = context.cl;
- context._dec(context.ah);
+void DreamGenContext::twodigitnum() {
+ STACK_CHECK;
+ ah = cl;
+ _dec(ah);
numloop1:
- context._inc(context.ah);
- context._sub(context.al, 10);
- if (!context.flags.c())
+ _inc(ah);
+ _sub(al, 10);
+ if (!flags.c())
goto numloop1;
- context._add(context.al, 10);
- context._add(context.al, context.cl);
+ _add(al, 10);
+ _add(al, cl);
}
-void showword(Context &context) {
- STACK_CHECK(context);
- context.ch = 0;
- context.bx = 10000;
- context.cl = 47;
+void DreamGenContext::showword() {
+ STACK_CHECK;
+ ch = 0;
+ bx = 10000;
+ cl = 47;
word1:
- context._inc(context.cl);
- context._sub(context.ax, context.bx);
- if (!context.flags.c())
+ _inc(cl);
+ _sub(ax, bx);
+ if (!flags.c())
goto word1;
- context._add(context.ax, context.bx);
- convnum(context);
- context.cs.byte(context.di) = context.cl;
- context.bx = 1000;
- context.cl = 47;
+ _add(ax, bx);
+ convnum();
+ cs.byte(di) = cl;
+ bx = 1000;
+ cl = 47;
word2:
- context._inc(context.cl);
- context._sub(context.ax, context.bx);
- if (!context.flags.c())
+ _inc(cl);
+ _sub(ax, bx);
+ if (!flags.c())
goto word2;
- context._add(context.ax, context.bx);
- convnum(context);
- context.cs.byte(context.di+1) = context.cl;
- context.bx = 100;
- context.cl = 47;
+ _add(ax, bx);
+ convnum();
+ cs.byte(di+1) = cl;
+ bx = 100;
+ cl = 47;
word3:
- context._inc(context.cl);
- context._sub(context.ax, context.bx);
- if (!context.flags.c())
+ _inc(cl);
+ _sub(ax, bx);
+ if (!flags.c())
goto word3;
- context._add(context.ax, context.bx);
- convnum(context);
- context.cs.byte(context.di+2) = context.cl;
- context.bx = 10;
- context.cl = 47;
+ _add(ax, bx);
+ convnum();
+ cs.byte(di+2) = cl;
+ bx = 10;
+ cl = 47;
word4:
- context._inc(context.cl);
- context._sub(context.ax, context.bx);
- if (!context.flags.c())
+ _inc(cl);
+ _sub(ax, bx);
+ if (!flags.c())
goto word4;
- context._add(context.ax, context.bx);
- convnum(context);
- context.cs.byte(context.di+3) = context.cl;
- context._add(context.al, 48);
- context.cl = context.al;
- convnum(context);
- context.cs.byte(context.di+4) = context.cl;
-}
-
-void convnum(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.ch, 0);
- if (!context.flags.z())
- goto noconvnum;
- context._cmp(context.cl, '0');
- if (!context.flags.z())
+ _add(ax, bx);
+ convnum();
+ cs.byte(di+3) = cl;
+ _add(al, 48);
+ cl = al;
+ convnum();
+ cs.byte(di+4) = cl;
+}
+
+void DreamGenContext::convnum() {
+ STACK_CHECK;
+ _cmp(ch, 0);
+ if (!flags.z())
+ return /* (noconvnum) */;
+ _cmp(cl, '0');
+ if (!flags.z())
goto notzeronum;
- context.cl = 32;
- goto noconvnum;
+ cl = 32;
+ return /* (noconvnum) */;
notzeronum:
- context.ch = 1;
-noconvnum:
- return;
-}
-
-void walkandexamine(Context &context) {
- STACK_CHECK(context);
- finishedwalking(context);
- if (!context.flags.z())
- goto noobselect;
- context.al = context.data.byte(kWalkexamtype);
- context.data.byte(kCommandtype) = context.al;
- context.al = context.data.byte(kWalkexamnum);
- context.data.byte(kCommand) = context.al;
- context.data.byte(kWalkandexam) = 0;
- context._cmp(context.data.byte(kCommandtype), 5);
- if (context.flags.z())
- goto noobselect;
- examineob(context);
+ ch = 1;
+}
+
+void DreamGenContext::walkandexamine() {
+ STACK_CHECK;
+ finishedwalking();
+ if (!flags.z())
+ return /* (noobselect) */;
+ al = data.byte(kWalkexamtype);
+ data.byte(kCommandtype) = al;
+ al = data.byte(kWalkexamnum);
+ data.byte(kCommand) = al;
+ data.byte(kWalkandexam) = 0;
+ _cmp(data.byte(kCommandtype), 5);
+ if (flags.z())
+ return /* (noobselect) */;
+ examineob();
return;
wantstowalk:
- setwalk(context);
- context.data.byte(kReasseschanges) = 1;
-noobselect:
+ setwalk();
+ data.byte(kReasseschanges) = 1;
return;
diff:
- context.data.byte(kCommand) = context.al;
- context.data.byte(kCommandtype) = context.ah;
- context._cmp(context.data.byte(kLinepointer), 254);
- if (!context.flags.z())
+ data.byte(kCommand) = al;
+ data.byte(kCommandtype) = ah;
+ _cmp(data.byte(kLinepointer), 254);
+ if (!flags.z())
goto middleofwalk;
- context._cmp(context.data.word(kWatchingtime), 0);
- if (!context.flags.z())
+ _cmp(data.word(kWatchingtime), 0);
+ if (!flags.z())
goto middleofwalk;
- context.al = context.data.byte(kFacing);
- context._cmp(context.al, context.data.byte(kTurntoface));
- if (!context.flags.z())
+ al = data.byte(kFacing);
+ _cmp(al, data.byte(kTurntoface));
+ if (!flags.z())
goto middleofwalk;
- context._cmp(context.data.byte(kCommandtype), 3);
- if (!context.flags.z())
+ _cmp(data.byte(kCommandtype), 3);
+ if (!flags.z())
goto notblock;
- context.bl = context.data.byte(kManspath);
- context._cmp(context.bl, context.data.byte(kPointerspath));
- if (!context.flags.z())
+ bl = data.byte(kManspath);
+ _cmp(bl, data.byte(kPointerspath));
+ if (!flags.z())
goto dontcheck;
- context.cl = context.data.byte(kRyanx);
- context._add(context.cl, 12);
- context.ch = context.data.byte(kRyany);
- context._add(context.ch, 12);
- checkone(context);
- context._cmp(context.cl, 2);
- if (context.flags.c())
+ cl = data.byte(kRyanx);
+ _add(cl, 12);
+ ch = data.byte(kRyany);
+ _add(ch, 12);
+ checkone();
+ _cmp(cl, 2);
+ if (flags.c())
goto isblock;
dontcheck:
- getflagunderp(context);
- context._cmp(context.data.byte(kLastflag), 2);
- if (context.flags.c())
+ getflagunderp();
+ _cmp(data.byte(kLastflag), 2);
+ if (flags.c())
goto isblock;
- context._cmp(context.data.byte(kLastflag), 128);
- if (!context.flags.c())
+ _cmp(data.byte(kLastflag), 128);
+ if (!flags.c())
goto isblock;
goto toofaraway;
notblock:
- context.bl = context.data.byte(kManspath);
- context._cmp(context.bl, context.data.byte(kPointerspath));
- if (!context.flags.z())
+ bl = data.byte(kManspath);
+ _cmp(bl, data.byte(kPointerspath));
+ if (!flags.z())
goto toofaraway;
- context._cmp(context.data.byte(kCommandtype), 3);
- if (context.flags.z())
+ _cmp(data.byte(kCommandtype), 3);
+ if (flags.z())
goto isblock;
- context._cmp(context.data.byte(kCommandtype), 5);
- if (context.flags.z())
+ _cmp(data.byte(kCommandtype), 5);
+ if (flags.z())
goto isaperson;
- examineobtext(context);
+ examineobtext();
return;
middleofwalk:
- blocknametext(context);
+ blocknametext();
return;
isblock:
- blocknametext(context);
+ blocknametext();
return;
isaperson:
- personnametext(context);
+ personnametext();
return;
toofaraway:
- walktotext(context);
+ walktotext();
}
-void mainscreen(Context &context) {
- STACK_CHECK(context);
- context.data.byte(kInmaparea) = 0;
- context.bx = 5122;
- context._cmp(context.data.byte(kWatchon), 1);
- if (context.flags.z())
+void DreamGenContext::mainscreen() {
+ STACK_CHECK;
+ data.byte(kInmaparea) = 0;
+ bx = 5122;
+ _cmp(data.byte(kWatchon), 1);
+ if (flags.z())
goto checkmain;
- context.bx = 5184;
+ bx = 5184;
checkmain:
- checkcoords(context);
- context._cmp(context.data.byte(kWalkandexam), 0);
- if (context.flags.z())
- goto finishmain;
- walkandexamine(context);
-finishmain:
- return;
-}
-
-void madmanrun(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kLocation), 14);
- if (!context.flags.z())
- { identifyob(context); return; };
- context._cmp(context.data.byte(kMapx), 22);
- if (!context.flags.z())
- { identifyob(context); return; };
- context._cmp(context.data.byte(kPointermode), 2);
- if (!context.flags.z())
- { identifyob(context); return; };
- context._cmp(context.data.byte(kMadmanflag), 0);
- if (!context.flags.z())
- { identifyob(context); return; };
- context._cmp(context.data.byte(kCommandtype), 211);
- if (context.flags.z())
+ checkcoords();
+ _cmp(data.byte(kWalkandexam), 0);
+ if (flags.z())
+ return /* (finishmain) */;
+ walkandexamine();
+}
+
+void DreamGenContext::madmanrun() {
+ STACK_CHECK;
+ _cmp(data.byte(kLocation), 14);
+ if (!flags.z())
+ { identifyob(); return; };
+ _cmp(data.byte(kMapx), 22);
+ if (!flags.z())
+ { identifyob(); return; };
+ _cmp(data.byte(kPointermode), 2);
+ if (!flags.z())
+ { identifyob(); return; };
+ _cmp(data.byte(kMadmanflag), 0);
+ if (!flags.z())
+ { identifyob(); return; };
+ _cmp(data.byte(kCommandtype), 211);
+ if (flags.z())
goto alreadyrun;
- context.data.byte(kCommandtype) = 211;
- context.al = 52;
- commandonly(context);
+ data.byte(kCommandtype) = 211;
+ al = 52;
+ commandonly();
alreadyrun:
- context._cmp(context.data.word(kMousebutton), 1);
- if (!context.flags.z())
- goto norun;
- context.ax = context.data.word(kMousebutton);
- context._cmp(context.ax, context.data.word(kOldbutton));
- if (context.flags.z())
- goto norun;
- context.data.byte(kLastweapon) = 8;
-norun:
- return;
-}
-
-void checkcoords(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kNewlocation), 255);
- if (context.flags.z())
+ _cmp(data.word(kMousebutton), 1);
+ if (!flags.z())
+ return /* (norun) */;
+ ax = data.word(kMousebutton);
+ _cmp(ax, data.word(kOldbutton));
+ if (flags.z())
+ return /* (norun) */;
+ data.byte(kLastweapon) = 8;
+}
+
+void DreamGenContext::checkcoords() {
+ STACK_CHECK;
+ _cmp(data.byte(kNewlocation), 255);
+ if (flags.z())
goto loop048;
return;
loop048:
- context.ax = context.cs.word(context.bx);
- context._cmp(context.ax, 0x0ffff);
- if (context.flags.z())
- goto nonefound;
- context.push(context.bx);
- context._cmp(context.data.word(kMousex), context.ax);
- if (context.flags.l())
+ ax = cs.word(bx);
+ _cmp(ax, 0x0ffff);
+ if (flags.z())
+ return /* (nonefound) */;
+ push(bx);
+ _cmp(data.word(kMousex), ax);
+ if (flags.l())
goto over045;
- context.ax = context.cs.word(context.bx+2);
- context._cmp(context.data.word(kMousex), context.ax);
- if (!context.flags.l())
+ ax = cs.word(bx+2);
+ _cmp(data.word(kMousex), ax);
+ if (!flags.l())
goto over045;
- context.ax = context.cs.word(context.bx+4);
- context._cmp(context.data.word(kMousey), context.ax);
- if (context.flags.l())
+ ax = cs.word(bx+4);
+ _cmp(data.word(kMousey), ax);
+ if (flags.l())
goto over045;
- context.ax = context.cs.word(context.bx+6);
- context._cmp(context.data.word(kMousey), context.ax);
- if (!context.flags.l())
+ ax = cs.word(bx+6);
+ _cmp(data.word(kMousey), ax);
+ if (!flags.l())
goto over045;
- context.ax = context.cs.word(context.bx+8);
- __dispatch_call(context, context.ax);
- context.ax = context.pop();
+ ax = cs.word(bx+8);
+ __dispatch_call(ax);
+ ax = pop();
return;
over045:
- context.bx = context.pop();
- context._add(context.bx, 10);
+ bx = pop();
+ _add(bx, 10);
goto loop048;
-nonefound:
- return;
}
-void identifyob(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.word(kWatchingtime), 0);
- if (!context.flags.z())
- { blank(context); return; };
- context.ax = context.data.word(kMousex);
- context._sub(context.ax, context.data.word(kMapadx));
- context._cmp(context.ax, 22*8);
- if (context.flags.c())
+void DreamGenContext::identifyob() {
+ STACK_CHECK;
+ _cmp(data.word(kWatchingtime), 0);
+ if (!flags.z())
+ { blank(); return; };
+ ax = data.word(kMousex);
+ _sub(ax, data.word(kMapadx));
+ _cmp(ax, 22*8);
+ if (flags.c())
goto notover1;
- blank(context);
+ blank();
return;
notover1:
- context.bx = context.data.word(kMousey);
- context._sub(context.bx, context.data.word(kMapady));
- context._cmp(context.bx, 20*8);
- if (context.flags.c())
+ bx = data.word(kMousey);
+ _sub(bx, data.word(kMapady));
+ _cmp(bx, 20*8);
+ if (flags.c())
goto notover2;
- blank(context);
+ blank();
return;
notover2:
- context.data.byte(kInmaparea) = 1;
- context.ah = context.bl;
- context.push(context.ax);
- findpathofpoint(context);
- context.data.byte(kPointerspath) = context.dl;
- context.ax = context.pop();
- context.push(context.ax);
- findfirstpath(context);
- context.data.byte(kPointerfirstpath) = context.al;
- context.ax = context.pop();
- checkifex(context);
- if (!context.flags.z())
- goto finishidentify;
- checkiffree(context);
- if (!context.flags.z())
- goto finishidentify;
- checkifperson(context);
- if (!context.flags.z())
- goto finishidentify;
- checkifset(context);
- if (!context.flags.z())
- goto finishidentify;
- context.ax = context.data.word(kMousex);
- context._sub(context.ax, context.data.word(kMapadx));
- context.cl = context.al;
- context.ax = context.data.word(kMousey);
- context._sub(context.ax, context.data.word(kMapady));
- context.ch = context.al;
- checkone(context);
- context._cmp(context.al, 0);
- if (context.flags.z())
+ data.byte(kInmaparea) = 1;
+ ah = bl;
+ push(ax);
+ findpathofpoint();
+ data.byte(kPointerspath) = dl;
+ ax = pop();
+ push(ax);
+ findfirstpath();
+ data.byte(kPointerfirstpath) = al;
+ ax = pop();
+ checkifex();
+ if (!flags.z())
+ return /* (finishidentify) */;
+ checkiffree();
+ if (!flags.z())
+ return /* (finishidentify) */;
+ checkifperson();
+ if (!flags.z())
+ return /* (finishidentify) */;
+ checkifset();
+ if (!flags.z())
+ return /* (finishidentify) */;
+ ax = data.word(kMousex);
+ _sub(ax, data.word(kMapadx));
+ cl = al;
+ ax = data.word(kMousey);
+ _sub(ax, data.word(kMapady));
+ ch = al;
+ checkone();
+ _cmp(al, 0);
+ if (flags.z())
goto nothingund;
- context._cmp(context.data.byte(kMandead), 1);
- if (context.flags.z())
+ _cmp(data.byte(kMandead), 1);
+ if (flags.z())
goto nothingund;
- context.ah = 3;
- obname(context);
-finishidentify:
+ ah = 3;
+ obname();
return;
nothingund:
- blank(context);
+ blank();
}
-void checkifperson(Context &context) {
- STACK_CHECK(context);
- context.es = context.data.word(kBuffers);
- context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5));
- context.cx = 12;
+void DreamGenContext::checkifperson() {
+ STACK_CHECK;
+ es = data.word(kBuffers);
+ bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5));
+ cx = 12;
identifyreel:
- context.push(context.cx);
- context._cmp(context.es.byte(context.bx+4), 255);
- if (context.flags.z())
+ push(cx);
+ _cmp(es.byte(bx+4), 255);
+ if (flags.z())
goto notareelid;
- context.push(context.es);
- context.push(context.bx);
- context.push(context.ax);
- context.ax = context.es.word(context.bx+0);
- context.data.word(kReelpointer) = context.ax;
- getreelstart(context);
- context._cmp(context.es.word(context.si+2), 0x0ffff);
- if (!context.flags.z())
+ push(es);
+ push(bx);
+ push(ax);
+ ax = es.word(bx+0);
+ data.word(kReelpointer) = ax;
+ getreelstart();
+ _cmp(es.word(si+2), 0x0ffff);
+ if (!flags.z())
goto notblankpers;
- context._add(context.si, 5);
+ _add(si, 5);
notblankpers:
- context.cx = context.es.word(context.si+2);
- context.ax = context.es.word(context.si+0);
- context.push(context.cx);
- getreelframeax(context);
- context.cx = context.pop();
- context._add(context.cl, context.es.byte(context.bx+4));
- context._add(context.ch, context.es.byte(context.bx+5));
- context.dx = context.cx;
- context._add(context.dl, context.es.byte(context.bx+0));
- context._add(context.dh, context.es.byte(context.bx+1));
- context.ax = context.pop();
- context.bx = context.pop();
- context.es = context.pop();
- context._cmp(context.al, context.cl);
- if (context.flags.c())
+ cx = es.word(si+2);
+ ax = es.word(si+0);
+ push(cx);
+ getreelframeax();
+ cx = pop();
+ _add(cl, es.byte(bx+4));
+ _add(ch, es.byte(bx+5));
+ dx = cx;
+ _add(dl, es.byte(bx+0));
+ _add(dh, es.byte(bx+1));
+ ax = pop();
+ bx = pop();
+ es = pop();
+ _cmp(al, cl);
+ if (flags.c())
goto notareelid;
- context._cmp(context.ah, context.ch);
- if (context.flags.c())
+ _cmp(ah, ch);
+ if (flags.c())
goto notareelid;
- context._cmp(context.al, context.dl);
- if (!context.flags.c())
+ _cmp(al, dl);
+ if (!flags.c())
goto notareelid;
- context._cmp(context.ah, context.dh);
- if (!context.flags.c())
+ _cmp(ah, dh);
+ if (!flags.c())
goto notareelid;
- context.cx = context.pop();
- context.ax = context.es.word(context.bx+2);
- context.data.word(kPersondata) = context.ax;
- context.al = context.es.byte(context.bx+4);
- context.ah = 5;
- obname(context);
- context.al = 0;
- context._cmp(context.al, 1);
+ cx = pop();
+ ax = es.word(bx+2);
+ data.word(kPersondata) = ax;
+ al = es.byte(bx+4);
+ ah = 5;
+ obname();
+ al = 0;
+ _cmp(al, 1);
return;
notareelid:
- context.cx = context.pop();
- context._add(context.bx, 5);
- context._dec(context.cx);
- if (!context.flags.z())
+ cx = pop();
+ _add(bx, 5);
+ _dec(cx);
+ if (!flags.z())
goto identifyreel;
}
-void checkifset(Context &context) {
- STACK_CHECK(context);
- context.es = context.data.word(kBuffers);
- context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32))+(127*5);
- context.cx = 127;
+void DreamGenContext::checkifset() {
+ STACK_CHECK;
+ es = data.word(kBuffers);
+ bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32))+(127*5);
+ cx = 127;
identifyset:
- context._cmp(context.es.byte(context.bx+4), 255);
- if (context.flags.z())
+ _cmp(es.byte(bx+4), 255);
+ if (flags.z())
goto notasetid;
- context._cmp(context.al, context.es.byte(context.bx));
- if (context.flags.c())
+ _cmp(al, es.byte(bx));
+ if (flags.c())
goto notasetid;
- context._cmp(context.al, context.es.byte(context.bx+2));
- if (!context.flags.c())
+ _cmp(al, es.byte(bx+2));
+ if (!flags.c())
goto notasetid;
- context._cmp(context.ah, context.es.byte(context.bx+1));
- if (context.flags.c())
+ _cmp(ah, es.byte(bx+1));
+ if (flags.c())
goto notasetid;
- context._cmp(context.ah, context.es.byte(context.bx+3));
- if (!context.flags.c())
+ _cmp(ah, es.byte(bx+3));
+ if (!flags.c())
goto notasetid;
- pixelcheckset(context);
- if (context.flags.z())
+ pixelcheckset();
+ if (flags.z())
goto notasetid;
- isitdescribed(context);
- if (context.flags.z())
+ isitdescribed();
+ if (flags.z())
goto notasetid;
- context.al = context.es.byte(context.bx+4);
- context.ah = 1;
- obname(context);
- context.al = 0;
- context._cmp(context.al, 1);
+ al = es.byte(bx+4);
+ ah = 1;
+ obname();
+ al = 0;
+ _cmp(al, 1);
return;
notasetid:
- context._sub(context.bx, 5);
- context._dec(context.cx);
- context._cmp(context.cx, -1);
- if (!context.flags.z())
+ _sub(bx, 5);
+ _dec(cx);
+ _cmp(cx, -1);
+ if (!flags.z())
goto identifyset;
}
-void checkifex(Context &context) {
- STACK_CHECK(context);
- context.es = context.data.word(kBuffers);
- context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5))+(99*5);
- context.cx = 99;
+void DreamGenContext::checkifex() {
+ STACK_CHECK;
+ es = data.word(kBuffers);
+ bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5))+(99*5);
+ cx = 99;
identifyex:
- context._cmp(context.es.byte(context.bx+4), 255);
- if (context.flags.z())
+ _cmp(es.byte(bx+4), 255);
+ if (flags.z())
goto notanexid;
- context._cmp(context.al, context.es.byte(context.bx));
- if (context.flags.c())
+ _cmp(al, es.byte(bx));
+ if (flags.c())
goto notanexid;
- context._cmp(context.al, context.es.byte(context.bx+2));
- if (!context.flags.c())
+ _cmp(al, es.byte(bx+2));
+ if (!flags.c())
goto notanexid;
- context._cmp(context.ah, context.es.byte(context.bx+1));
- if (context.flags.c())
+ _cmp(ah, es.byte(bx+1));
+ if (flags.c())
goto notanexid;
- context._cmp(context.ah, context.es.byte(context.bx+3));
- if (!context.flags.c())
+ _cmp(ah, es.byte(bx+3));
+ if (!flags.c())
goto notanexid;
- context.al = context.es.byte(context.bx+4);
- context.ah = 4;
- obname(context);
- context.al = 1;
- context._cmp(context.al, 0);
+ al = es.byte(bx+4);
+ ah = 4;
+ obname();
+ al = 1;
+ _cmp(al, 0);
return;
notanexid:
- context._sub(context.bx, 5);
- context._dec(context.cx);
- context._cmp(context.cx, -1);
- if (!context.flags.z())
+ _sub(bx, 5);
+ _dec(cx);
+ _cmp(cx, -1);
+ if (!flags.z())
goto identifyex;
}
-void checkiffree(Context &context) {
- STACK_CHECK(context);
- context.es = context.data.word(kBuffers);
- context.bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5))+(79*5);
- context.cx = 79;
+void DreamGenContext::checkiffree() {
+ STACK_CHECK;
+ es = data.word(kBuffers);
+ bx = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5))+(79*5);
+ cx = 79;
identifyfree:
- context._cmp(context.es.byte(context.bx+4), 255);
- if (context.flags.z())
+ _cmp(es.byte(bx+4), 255);
+ if (flags.z())
goto notafreeid;
- context._cmp(context.al, context.es.byte(context.bx));
- if (context.flags.c())
+ _cmp(al, es.byte(bx));
+ if (flags.c())
goto notafreeid;
- context._cmp(context.al, context.es.byte(context.bx+2));
- if (!context.flags.c())
+ _cmp(al, es.byte(bx+2));
+ if (!flags.c())
goto notafreeid;
- context._cmp(context.ah, context.es.byte(context.bx+1));
- if (context.flags.c())
+ _cmp(ah, es.byte(bx+1));
+ if (flags.c())
goto notafreeid;
- context._cmp(context.ah, context.es.byte(context.bx+3));
- if (!context.flags.c())
+ _cmp(ah, es.byte(bx+3));
+ if (!flags.c())
goto notafreeid;
- context.al = context.es.byte(context.bx+4);
- context.ah = 2;
- obname(context);
- context.al = 0;
- context._cmp(context.al, 1);
+ al = es.byte(bx+4);
+ ah = 2;
+ obname();
+ al = 0;
+ _cmp(al, 1);
return;
notafreeid:
- context._sub(context.bx, 5);
- context._dec(context.cx);
- context._cmp(context.cx, -1);
- if (!context.flags.z())
+ _sub(bx, 5);
+ _dec(cx);
+ _cmp(cx, -1);
+ if (!flags.z())
goto identifyfree;
}
-void isitdescribed(Context &context) {
- STACK_CHECK(context);
- context.push(context.ax);
- context.push(context.cx);
- context.push(context.es);
- context.push(context.bx);
- context.al = context.es.byte(context.bx+4);
- context.ah = 0;
- context._add(context.ax, context.ax);
- context.bx = context.ax;
- context.es = context.data.word(kSetdesc);
- context._add(context.bx, (0));
- context.ax = context.es.word(context.bx);
- context._add(context.ax, (0+(130*2)));
- context.bx = context.ax;
- context.dl = context.es.byte(context.bx);
- context.bx = context.pop();
- context.es = context.pop();
- context.cx = context.pop();
- context.ax = context.pop();
- context._cmp(context.dl, 0);
-}
-
-void findpathofpoint(Context &context) {
- STACK_CHECK(context);
- context.push(context.ax);
- context.bx = (0);
- context.es = context.data.word(kReels);
- context.al = context.data.byte(kRoomnum);
- context.ah = 0;
- context.cx = 144;
- context._mul(context.cx);
- context._add(context.bx, context.ax);
- context.cx = context.pop();
- context.dl = 0;
+void DreamGenContext::isitdescribed() {
+ STACK_CHECK;
+ push(ax);
+ push(cx);
+ push(es);
+ push(bx);
+ al = es.byte(bx+4);
+ ah = 0;
+ _add(ax, ax);
+ bx = ax;
+ es = data.word(kSetdesc);
+ _add(bx, (0));
+ ax = es.word(bx);
+ _add(ax, (0+(130*2)));
+ bx = ax;
+ dl = es.byte(bx);
+ bx = pop();
+ es = pop();
+ cx = pop();
+ ax = pop();
+ _cmp(dl, 0);
+}
+
+void DreamGenContext::findpathofpoint() {
+ STACK_CHECK;
+ push(ax);
+ bx = (0);
+ es = data.word(kReels);
+ al = data.byte(kRoomnum);
+ ah = 0;
+ cx = 144;
+ _mul(cx);
+ _add(bx, ax);
+ cx = pop();
+ dl = 0;
pathloop:
- context.al = context.es.byte(context.bx+6);
- context._cmp(context.al, 255);
- if (!context.flags.z())
+ al = es.byte(bx+6);
+ _cmp(al, 255);
+ if (!flags.z())
goto flunkedit;
- context.ax = context.es.word(context.bx+2);
- context._cmp(context.ax, 0x0ffff);
- if (context.flags.z())
+ ax = es.word(bx+2);
+ _cmp(ax, 0x0ffff);
+ if (flags.z())
goto flunkedit;
- context._cmp(context.cl, context.al);
- if (context.flags.c())
+ _cmp(cl, al);
+ if (flags.c())
goto flunkedit;
- context._cmp(context.ch, context.ah);
- if (context.flags.c())
+ _cmp(ch, ah);
+ if (flags.c())
goto flunkedit;
- context.ax = context.es.word(context.bx+4);
- context._cmp(context.cl, context.al);
- if (!context.flags.c())
+ ax = es.word(bx+4);
+ _cmp(cl, al);
+ if (!flags.c())
goto flunkedit;
- context._cmp(context.ch, context.ah);
- if (!context.flags.c())
+ _cmp(ch, ah);
+ if (!flags.c())
goto flunkedit;
- goto gotvalidpath;
+ return /* (gotvalidpath) */;
flunkedit:
- context._add(context.bx, 8);
- context._inc(context.dl);
- context._cmp(context.dl, 12);
- if (!context.flags.z())
+ _add(bx, 8);
+ _inc(dl);
+ _cmp(dl, 12);
+ if (!flags.z())
goto pathloop;
- context.dl = 255;
-gotvalidpath:
- return;
-}
-
-void findfirstpath(Context &context) {
- STACK_CHECK(context);
- context.push(context.ax);
- context.bx = (0);
- context.es = context.data.word(kReels);
- context.al = context.data.byte(kRoomnum);
- context.ah = 0;
- context.cx = 144;
- context._mul(context.cx);
- context._add(context.bx, context.ax);
- context.cx = context.pop();
- context.dl = 0;
+ dl = 255;
+}
+
+void DreamGenContext::findfirstpath() {
+ STACK_CHECK;
+ push(ax);
+ bx = (0);
+ es = data.word(kReels);
+ al = data.byte(kRoomnum);
+ ah = 0;
+ cx = 144;
+ _mul(cx);
+ _add(bx, ax);
+ cx = pop();
+ dl = 0;
fpathloop:
- context.ax = context.es.word(context.bx+2);
- context._cmp(context.ax, 0x0ffff);
- if (context.flags.z())
+ ax = es.word(bx+2);
+ _cmp(ax, 0x0ffff);
+ if (flags.z())
goto nofirst;
- context._cmp(context.cl, context.al);
- if (context.flags.c())
+ _cmp(cl, al);
+ if (flags.c())
goto nofirst;
- context._cmp(context.ch, context.ah);
- if (context.flags.c())
+ _cmp(ch, ah);
+ if (flags.c())
goto nofirst;
- context.ax = context.es.word(context.bx+4);
- context._cmp(context.cl, context.al);
- if (!context.flags.c())
+ ax = es.word(bx+4);
+ _cmp(cl, al);
+ if (!flags.c())
goto nofirst;
- context._cmp(context.ch, context.ah);
- if (!context.flags.c())
+ _cmp(ch, ah);
+ if (!flags.c())
goto nofirst;
goto gotfirst;
nofirst:
- context._add(context.bx, 8);
- context._inc(context.dl);
- context._cmp(context.dl, 12);
- if (!context.flags.z())
+ _add(bx, 8);
+ _inc(dl);
+ _cmp(dl, 12);
+ if (!flags.z())
goto fpathloop;
- context.al = 0;
+ al = 0;
return;
gotfirst:
- context.al = context.es.byte(context.bx+6);
-}
-
-void turnpathon(Context &context) {
- STACK_CHECK(context);
- context.push(context.ax);
- context.push(context.ax);
- context.cl = 255;
- context.ch = context.data.byte(kRoomnum);
- context._add(context.ch, 100);
- findormake(context);
- context.ax = context.pop();
- getroomspaths(context);
- context.ax = context.pop();
- context._cmp(context.al, 255);
- if (context.flags.z())
- goto nopathon;
- context.ah = 0;
- context._add(context.ax, context.ax);
- context._add(context.ax, context.ax);
- context._add(context.ax, context.ax);
- context._add(context.bx, context.ax);
- context.al = 255;
- context.es.byte(context.bx+6) = context.al;
-nopathon:
- return;
-}
-
-void turnpathoff(Context &context) {
- STACK_CHECK(context);
- context.push(context.ax);
- context.push(context.ax);
- context.cl = 0;
- context.ch = context.data.byte(kRoomnum);
- context._add(context.ch, 100);
- findormake(context);
- context.ax = context.pop();
- getroomspaths(context);
- context.ax = context.pop();
- context._cmp(context.al, 255);
- if (context.flags.z())
- goto nopathoff;
- context.ah = 0;
- context._add(context.ax, context.ax);
- context._add(context.ax, context.ax);
- context._add(context.ax, context.ax);
- context._add(context.bx, context.ax);
- context.al = 0;
- context.es.byte(context.bx+6) = context.al;
-nopathoff:
- return;
-}
-
-void turnanypathon(Context &context) {
- STACK_CHECK(context);
- context.push(context.ax);
- context.push(context.ax);
- context.cl = 255;
- context.ch = context.ah;
- context._add(context.ch, 100);
- findormake(context);
- context.ax = context.pop();
- context.al = context.ah;
- context.ah = 0;
- context.cx = 144;
- context._mul(context.cx);
- context.es = context.data.word(kReels);
- context.bx = (0);
- context._add(context.bx, context.ax);
- context.ax = context.pop();
- context.ah = 0;
- context._add(context.ax, context.ax);
- context._add(context.ax, context.ax);
- context._add(context.ax, context.ax);
- context._add(context.bx, context.ax);
- context.al = 255;
- context.es.byte(context.bx+6) = context.al;
-}
-
-void turnanypathoff(Context &context) {
- STACK_CHECK(context);
- context.push(context.ax);
- context.push(context.ax);
- context.cl = 0;
- context.ch = context.ah;
- context._add(context.ch, 100);
- findormake(context);
- context.ax = context.pop();
- context.al = context.ah;
- context.ah = 0;
- context.cx = 144;
- context._mul(context.cx);
- context.es = context.data.word(kReels);
- context.bx = (0);
- context._add(context.bx, context.ax);
- context.ax = context.pop();
- context.ah = 0;
- context._add(context.ax, context.ax);
- context._add(context.ax, context.ax);
- context._add(context.ax, context.ax);
- context._add(context.bx, context.ax);
- context.al = 0;
- context.es.byte(context.bx+6) = context.al;
-}
-
-void checkifpathison(Context &context) {
- STACK_CHECK(context);
- context.push(context.ax);
- getroomspaths(context);
- context.ax = context.pop();
- context.ah = 0;
- context._add(context.ax, context.ax);
- context._add(context.ax, context.ax);
- context._add(context.ax, context.ax);
- context._add(context.bx, context.ax);
- context.al = context.es.byte(context.bx+6);
- context._cmp(context.al, 255);
-}
-
-void afternewroom(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kNowinnewroom), 0);
- if (context.flags.z())
- goto notnew;
- context.data.word(kTimecount) = 0;
- createpanel(context);
- context.data.byte(kCommandtype) = 0;
- findroominloc(context);
- context._cmp(context.data.byte(kRyanon), 1);
- if (context.flags.z())
+ al = es.byte(bx+6);
+}
+
+void DreamGenContext::turnpathon() {
+ STACK_CHECK;
+ push(ax);
+ push(ax);
+ cl = 255;
+ ch = data.byte(kRoomnum);
+ _add(ch, 100);
+ findormake();
+ ax = pop();
+ getroomspaths();
+ ax = pop();
+ _cmp(al, 255);
+ if (flags.z())
+ return /* (nopathon) */;
+ ah = 0;
+ _add(ax, ax);
+ _add(ax, ax);
+ _add(ax, ax);
+ _add(bx, ax);
+ al = 255;
+ es.byte(bx+6) = al;
+}
+
+void DreamGenContext::turnpathoff() {
+ STACK_CHECK;
+ push(ax);
+ push(ax);
+ cl = 0;
+ ch = data.byte(kRoomnum);
+ _add(ch, 100);
+ findormake();
+ ax = pop();
+ getroomspaths();
+ ax = pop();
+ _cmp(al, 255);
+ if (flags.z())
+ return /* (nopathoff) */;
+ ah = 0;
+ _add(ax, ax);
+ _add(ax, ax);
+ _add(ax, ax);
+ _add(bx, ax);
+ al = 0;
+ es.byte(bx+6) = al;
+}
+
+void DreamGenContext::turnanypathon() {
+ STACK_CHECK;
+ push(ax);
+ push(ax);
+ cl = 255;
+ ch = ah;
+ _add(ch, 100);
+ findormake();
+ ax = pop();
+ al = ah;
+ ah = 0;
+ cx = 144;
+ _mul(cx);
+ es = data.word(kReels);
+ bx = (0);
+ _add(bx, ax);
+ ax = pop();
+ ah = 0;
+ _add(ax, ax);
+ _add(ax, ax);
+ _add(ax, ax);
+ _add(bx, ax);
+ al = 255;
+ es.byte(bx+6) = al;
+}
+
+void DreamGenContext::turnanypathoff() {
+ STACK_CHECK;
+ push(ax);
+ push(ax);
+ cl = 0;
+ ch = ah;
+ _add(ch, 100);
+ findormake();
+ ax = pop();
+ al = ah;
+ ah = 0;
+ cx = 144;
+ _mul(cx);
+ es = data.word(kReels);
+ bx = (0);
+ _add(bx, ax);
+ ax = pop();
+ ah = 0;
+ _add(ax, ax);
+ _add(ax, ax);
+ _add(ax, ax);
+ _add(bx, ax);
+ al = 0;
+ es.byte(bx+6) = al;
+}
+
+void DreamGenContext::checkifpathison() {
+ STACK_CHECK;
+ push(ax);
+ getroomspaths();
+ ax = pop();
+ ah = 0;
+ _add(ax, ax);
+ _add(ax, ax);
+ _add(ax, ax);
+ _add(bx, ax);
+ al = es.byte(bx+6);
+ _cmp(al, 255);
+}
+
+void DreamGenContext::afternewroom() {
+ STACK_CHECK;
+ _cmp(data.byte(kNowinnewroom), 0);
+ if (flags.z())
+ return /* (notnew) */;
+ data.word(kTimecount) = 0;
+ createpanel();
+ data.byte(kCommandtype) = 0;
+ findroominloc();
+ _cmp(data.byte(kRyanon), 1);
+ if (flags.z())
goto ryansoff;
- context.al = context.data.byte(kRyanx);
- context._add(context.al, 12);
- context.ah = context.data.byte(kRyany);
- context._add(context.ah, 12);
- findpathofpoint(context);
- context.data.byte(kManspath) = context.dl;
- findxyfrompath(context);
- context.data.byte(kResetmanxy) = 1;
+ al = data.byte(kRyanx);
+ _add(al, 12);
+ ah = data.byte(kRyany);
+ _add(ah, 12);
+ findpathofpoint();
+ data.byte(kManspath) = dl;
+ findxyfrompath();
+ data.byte(kResetmanxy) = 1;
ryansoff:
- context.data.byte(kNewobs) = 1;
- drawfloor(context);
- context.data.word(kLookcounter) = 160;
- context.data.byte(kNowinnewroom) = 0;
- showicon(context);
- spriteupdate(context);
- printsprites(context);
- undertextline(context);
- reelsonscreen(context);
- mainscreen(context);
- getunderzoom(context);
- zoom(context);
- worktoscreenm(context);
- walkintoroom(context);
- reminders(context);
- atmospheres(context);
-notnew:
- return;
-}
-
-void atmospheres(Context &context) {
- STACK_CHECK(context);
- context.cl = context.data.byte(kMapx);
- context.ch = context.data.byte(kMapy);
- context.bx = 5246;
+ data.byte(kNewobs) = 1;
+ drawfloor();
+ data.word(kLookcounter) = 160;
+ data.byte(kNowinnewroom) = 0;
+ showicon();
+ spriteupdate();
+ printsprites();
+ undertextline();
+ reelsonscreen();
+ mainscreen();
+ getunderzoom();
+ zoom();
+ worktoscreenm();
+ walkintoroom();
+ reminders();
+ atmospheres();
+}
+
+void DreamGenContext::atmospheres() {
+ STACK_CHECK;
+ cl = data.byte(kMapx);
+ ch = data.byte(kMapy);
+ bx = 5246;
nextatmos:
- context.al = context.cs.byte(context.bx);
- context._cmp(context.al, 255);
- if (context.flags.z())
+ al = cs.byte(bx);
+ _cmp(al, 255);
+ if (flags.z())
goto nomoreatmos;
- context._cmp(context.al, context.data.byte(kReallocation));
- if (!context.flags.z())
+ _cmp(al, data.byte(kReallocation));
+ if (!flags.z())
goto wrongatmos;
- context.ax = context.cs.word(context.bx+1);
- context._cmp(context.ax, context.cx);
- if (!context.flags.z())
+ ax = cs.word(bx+1);
+ _cmp(ax, cx);
+ if (!flags.z())
goto wrongatmos;
- context.ax = context.cs.word(context.bx+3);
- context._cmp(context.al, context.data.byte(kCh0playing));
- if (context.flags.z())
+ ax = cs.word(bx+3);
+ _cmp(al, data.byte(kCh0playing));
+ if (flags.z())
goto playingalready;
- context._cmp(context.data.byte(kLocation), 45);
- if (!context.flags.z())
+ _cmp(data.byte(kLocation), 45);
+ if (!flags.z())
goto notweb;
- context._cmp(context.data.word(kReeltowatch), 45);
- if (context.flags.z())
+ _cmp(data.word(kReeltowatch), 45);
+ if (flags.z())
goto wrongatmos;
notweb:
- playchannel0(context);
- context._cmp(context.data.byte(kReallocation), 2);
- context._cmp(context.data.byte(kMapy), 0);
- if (context.flags.z())
+ playchannel0();
+ _cmp(data.byte(kReallocation), 2);
+ _cmp(data.byte(kMapy), 0);
+ if (flags.z())
goto fullvol;
- if (!context.flags.z())
+ if (!flags.z())
goto notlouisvol;
- context._cmp(context.data.byte(kMapy), 10);
- if (!context.flags.z())
+ _cmp(data.byte(kMapy), 10);
+ if (!flags.z())
goto notlouisvol;
- context._cmp(context.data.byte(kMapx), 22);
- if (!context.flags.z())
+ _cmp(data.byte(kMapx), 22);
+ if (!flags.z())
goto notlouisvol;
- context.data.byte(kVolume) = 5;
+ data.byte(kVolume) = 5;
notlouisvol:
- context._cmp(context.data.byte(kReallocation), 14);
- if (!context.flags.z())
+ _cmp(data.byte(kReallocation), 14);
+ if (!flags.z())
goto notmad1;
- context._cmp(context.data.byte(kMapx), 33);
- if (context.flags.z())
+ _cmp(data.byte(kMapx), 33);
+ if (flags.z())
goto ismad2;
- context._cmp(context.data.byte(kMapx), 22);
- if (!context.flags.z())
+ _cmp(data.byte(kMapx), 22);
+ if (!flags.z())
goto notmad1;
- context.data.byte(kVolume) = 5;
+ data.byte(kVolume) = 5;
return;
ismad2:
- context.data.byte(kVolume) = 0;
+ data.byte(kVolume) = 0;
return;
notmad1:
playingalready:
- context._cmp(context.data.byte(kReallocation), 2);
- if (!context.flags.z())
- goto notlouisvol2;
- context._cmp(context.data.byte(kMapx), 22);
- if (context.flags.z())
+ _cmp(data.byte(kReallocation), 2);
+ if (!flags.z())
+ return /* (notlouisvol2) */;
+ _cmp(data.byte(kMapx), 22);
+ if (flags.z())
goto louisvol;
- context._cmp(context.data.byte(kMapx), 11);
- if (!context.flags.z())
- goto notlouisvol2;
+ _cmp(data.byte(kMapx), 11);
+ if (!flags.z())
+ return /* (notlouisvol2) */;
fullvol:
- context.data.byte(kVolume) = 0;
-notlouisvol2:
+ data.byte(kVolume) = 0;
return;
louisvol:
- context.data.byte(kVolume) = 5;
+ data.byte(kVolume) = 5;
return;
wrongatmos:
- context._add(context.bx, 5);
+ _add(bx, 5);
goto nextatmos;
nomoreatmos:
- cancelch0(context);
-}
-
-void walkintoroom(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kLocation), 14);
- if (!context.flags.z())
- goto notlair;
- context._cmp(context.data.byte(kMapx), 22);
- if (!context.flags.z())
- goto notlair;
- context.data.byte(kDestination) = 1;
- context.data.byte(kFinaldest) = 1;
- autosetwalk(context);
-notlair:
- return;
-}
-
-void afterintroroom(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kNowinnewroom), 0);
- if (context.flags.z())
- goto notnewintro;
- clearwork(context);
- findroominloc(context);
- context.data.byte(kNewobs) = 1;
- drawfloor(context);
- reelsonscreen(context);
- spriteupdate(context);
- printsprites(context);
- worktoscreen(context);
- context.data.byte(kNowinnewroom) = 0;
-notnewintro:
- return;
-}
-
-void obname(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kReasseschanges), 0);
- if (context.flags.z())
+ cancelch0();
+}
+
+void DreamGenContext::walkintoroom() {
+ STACK_CHECK;
+ _cmp(data.byte(kLocation), 14);
+ if (!flags.z())
+ return /* (notlair) */;
+ _cmp(data.byte(kMapx), 22);
+ if (!flags.z())
+ return /* (notlair) */;
+ data.byte(kDestination) = 1;
+ data.byte(kFinaldest) = 1;
+ autosetwalk();
+}
+
+void DreamGenContext::afterintroroom() {
+ STACK_CHECK;
+ _cmp(data.byte(kNowinnewroom), 0);
+ if (flags.z())
+ return /* (notnewintro) */;
+ clearwork();
+ findroominloc();
+ data.byte(kNewobs) = 1;
+ drawfloor();
+ reelsonscreen();
+ spriteupdate();
+ printsprites();
+ worktoscreen();
+ data.byte(kNowinnewroom) = 0;
+}
+
+void DreamGenContext::obname() {
+ STACK_CHECK;
+ _cmp(data.byte(kReasseschanges), 0);
+ if (flags.z())
goto notnewpath;
- context.data.byte(kReasseschanges) = 0;
+ data.byte(kReasseschanges) = 0;
goto diff;
notnewpath:
- context._cmp(context.ah, context.data.byte(kCommandtype));
- if (context.flags.z())
+ _cmp(ah, data.byte(kCommandtype));
+ if (flags.z())
goto notdiffob;
goto diff;
notdiffob:
- context._cmp(context.al, context.data.byte(kCommand));
- if (!context.flags.z())
+ _cmp(al, data.byte(kCommand));
+ if (!flags.z())
goto diff;
- context._cmp(context.data.byte(kWalkandexam), 1);
- if (context.flags.z())
+ _cmp(data.byte(kWalkandexam), 1);
+ if (flags.z())
goto walkandexamine;
- context._cmp(context.data.word(kMousebutton), 0);
- if (context.flags.z())
- goto noobselect;
- context._cmp(context.data.byte(kCommandtype), 3);
- if (!context.flags.z())
+ _cmp(data.word(kMousebutton), 0);
+ if (flags.z())
+ return /* (noobselect) */;
+ _cmp(data.byte(kCommandtype), 3);
+ if (!flags.z())
goto isntblock;
- context._cmp(context.data.byte(kLastflag), 2);
- if (context.flags.c())
- goto noobselect;
+ _cmp(data.byte(kLastflag), 2);
+ if (flags.c())
+ return /* (noobselect) */;
isntblock:
- context.bl = context.data.byte(kManspath);
- context._cmp(context.bl, context.data.byte(kPointerspath));
- if (!context.flags.z())
+ bl = data.byte(kManspath);
+ _cmp(bl, data.byte(kPointerspath));
+ if (!flags.z())
goto wantstowalk;
- context._cmp(context.data.byte(kCommandtype), 3);
- if (context.flags.z())
+ _cmp(data.byte(kCommandtype), 3);
+ if (flags.z())
goto wantstowalk;
- finishedwalking(context);
- if (!context.flags.z())
- goto noobselect;
- context._cmp(context.data.byte(kCommandtype), 5);
- if (context.flags.z())
+ finishedwalking();
+ if (!flags.z())
+ return /* (noobselect) */;
+ _cmp(data.byte(kCommandtype), 5);
+ if (flags.z())
goto wantstotalk;
- context._cmp(context.data.word(kWatchingtime), 0);
- if (!context.flags.z())
- goto noobselect;
- examineob(context);
+ _cmp(data.word(kWatchingtime), 0);
+ if (!flags.z())
+ return /* (noobselect) */;
+ examineob();
return;
wantstotalk:
- context._cmp(context.data.word(kWatchingtime), 0);
- if (!context.flags.z())
- goto noobselect;
- talk(context);
+ _cmp(data.word(kWatchingtime), 0);
+ if (!flags.z())
+ return /* (noobselect) */;
+ talk();
return;
walkandexamine:
- finishedwalking(context);
- if (!context.flags.z())
- goto noobselect;
- context.al = context.data.byte(kWalkexamtype);
- context.data.byte(kCommandtype) = context.al;
- context.al = context.data.byte(kWalkexamnum);
- context.data.byte(kCommand) = context.al;
- context.data.byte(kWalkandexam) = 0;
- context._cmp(context.data.byte(kCommandtype), 5);
- if (context.flags.z())
- goto noobselect;
- examineob(context);
+ finishedwalking();
+ if (!flags.z())
+ return /* (noobselect) */;
+ al = data.byte(kWalkexamtype);
+ data.byte(kCommandtype) = al;
+ al = data.byte(kWalkexamnum);
+ data.byte(kCommand) = al;
+ data.byte(kWalkandexam) = 0;
+ _cmp(data.byte(kCommandtype), 5);
+ if (flags.z())
+ return /* (noobselect) */;
+ examineob();
return;
wantstowalk:
- setwalk(context);
- context.data.byte(kReasseschanges) = 1;
-noobselect:
+ setwalk();
+ data.byte(kReasseschanges) = 1;
return;
diff:
- context.data.byte(kCommand) = context.al;
- context.data.byte(kCommandtype) = context.ah;
- context._cmp(context.data.byte(kLinepointer), 254);
- if (!context.flags.z())
+ data.byte(kCommand) = al;
+ data.byte(kCommandtype) = ah;
+ _cmp(data.byte(kLinepointer), 254);
+ if (!flags.z())
goto middleofwalk;
- context._cmp(context.data.word(kWatchingtime), 0);
- if (!context.flags.z())
+ _cmp(data.word(kWatchingtime), 0);
+ if (!flags.z())
goto middleofwalk;
- context.al = context.data.byte(kFacing);
- context._cmp(context.al, context.data.byte(kTurntoface));
- if (!context.flags.z())
+ al = data.byte(kFacing);
+ _cmp(al, data.byte(kTurntoface));
+ if (!flags.z())
goto middleofwalk;
- context._cmp(context.data.byte(kCommandtype), 3);
- if (!context.flags.z())
+ _cmp(data.byte(kCommandtype), 3);
+ if (!flags.z())
goto notblock;
- context.bl = context.data.byte(kManspath);
- context._cmp(context.bl, context.data.byte(kPointerspath));
- if (!context.flags.z())
+ bl = data.byte(kManspath);
+ _cmp(bl, data.byte(kPointerspath));
+ if (!flags.z())
goto dontcheck;
- context.cl = context.data.byte(kRyanx);
- context._add(context.cl, 12);
- context.ch = context.data.byte(kRyany);
- context._add(context.ch, 12);
- checkone(context);
- context._cmp(context.cl, 2);
- if (context.flags.c())
+ cl = data.byte(kRyanx);
+ _add(cl, 12);
+ ch = data.byte(kRyany);
+ _add(ch, 12);
+ checkone();
+ _cmp(cl, 2);
+ if (flags.c())
goto isblock;
dontcheck:
- getflagunderp(context);
- context._cmp(context.data.byte(kLastflag), 2);
- if (context.flags.c())
+ getflagunderp();
+ _cmp(data.byte(kLastflag), 2);
+ if (flags.c())
goto isblock;
- context._cmp(context.data.byte(kLastflag), 128);
- if (!context.flags.c())
+ _cmp(data.byte(kLastflag), 128);
+ if (!flags.c())
goto isblock;
goto toofaraway;
notblock:
- context.bl = context.data.byte(kManspath);
- context._cmp(context.bl, context.data.byte(kPointerspath));
- if (!context.flags.z())
+ bl = data.byte(kManspath);
+ _cmp(bl, data.byte(kPointerspath));
+ if (!flags.z())
goto toofaraway;
- context._cmp(context.data.byte(kCommandtype), 3);
- if (context.flags.z())
+ _cmp(data.byte(kCommandtype), 3);
+ if (flags.z())
goto isblock;
- context._cmp(context.data.byte(kCommandtype), 5);
- if (context.flags.z())
+ _cmp(data.byte(kCommandtype), 5);
+ if (flags.z())
goto isaperson;
- examineobtext(context);
+ examineobtext();
return;
middleofwalk:
- blocknametext(context);
+ blocknametext();
return;
isblock:
- blocknametext(context);
+ blocknametext();
return;
isaperson:
- personnametext(context);
+ personnametext();
return;
toofaraway:
- walktotext(context);
-}
-
-void finishedwalking(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kLinepointer), 254);
- if (!context.flags.z())
- goto iswalking;
- context.al = context.data.byte(kFacing);
- context._cmp(context.al, context.data.byte(kTurntoface));
-iswalking:
- return;
-}
-
-void examineobtext(Context &context) {
- STACK_CHECK(context);
- context.bl = context.data.byte(kCommand);
- context.bh = context.data.byte(kCommandtype);
- context.al = 1;
- commandwithob(context);
-}
-
-void commandwithob(Context &context) {
- STACK_CHECK(context);
- context.push(context.ax);
- context.push(context.ax);
- context.push(context.bx);
- context.push(context.cx);
- context.push(context.dx);
- context.push(context.es);
- context.push(context.ds);
- context.push(context.si);
- context.push(context.di);
- deltextline(context);
- context.di = context.pop();
- context.si = context.pop();
- context.ds = context.pop();
- context.es = context.pop();
- context.dx = context.pop();
- context.cx = context.pop();
- context.bx = context.pop();
- context.ax = context.pop();
- context.push(context.bx);
- context.ah = 0;
- context._add(context.ax, context.ax);
- context.bx = context.ax;
- context.es = context.data.word(kCommandtext);
- context.ax = context.es.word(context.bx);
- context._add(context.ax, (66*2));
- context.si = context.ax;
- context.di = context.data.word(kTextaddressx);
- context.bx = context.data.word(kTextaddressy);
- context.dl = context.data.byte(kTextlen);
- context.al = 0;
- context.ah = 0;
- printdirect(context);
- context.ax = context.pop();
- context.di = 5847;
- copyname(context);
- context.ax = context.pop();
- context.di = context.data.word(kLastxpos);
- context._cmp(context.al, 0);
- if (context.flags.z())
+ walktotext();
+}
+
+void DreamGenContext::finishedwalking() {
+ STACK_CHECK;
+ _cmp(data.byte(kLinepointer), 254);
+ if (!flags.z())
+ return /* (iswalking) */;
+ al = data.byte(kFacing);
+ _cmp(al, data.byte(kTurntoface));
+}
+
+void DreamGenContext::examineobtext() {
+ STACK_CHECK;
+ bl = data.byte(kCommand);
+ bh = data.byte(kCommandtype);
+ al = 1;
+ commandwithob();
+}
+
+void DreamGenContext::commandwithob() {
+ STACK_CHECK;
+ push(ax);
+ push(ax);
+ push(bx);
+ push(cx);
+ push(dx);
+ push(es);
+ push(ds);
+ push(si);
+ push(di);
+ deltextline();
+ di = pop();
+ si = pop();
+ ds = pop();
+ es = pop();
+ dx = pop();
+ cx = pop();
+ bx = pop();
+ ax = pop();
+ push(bx);
+ ah = 0;
+ _add(ax, ax);
+ bx = ax;
+ es = data.word(kCommandtext);
+ ax = es.word(bx);
+ _add(ax, (66*2));
+ si = ax;
+ di = data.word(kTextaddressx);
+ bx = data.word(kTextaddressy);
+ dl = data.byte(kTextlen);
+ al = 0;
+ ah = 0;
+ printdirect();
+ ax = pop();
+ di = 5847;
+ copyname();
+ ax = pop();
+ di = data.word(kLastxpos);
+ _cmp(al, 0);
+ if (flags.z())
goto noadd;
- context._add(context.di, 5);
+ _add(di, 5);
noadd:
- context.bx = context.data.word(kTextaddressy);
- context.es = context.cs;
- context.si = 5847;
- context.dl = context.data.byte(kTextlen);
- context.al = 0;
- context.ah = 0;
- printdirect(context);
- context.data.byte(kNewtextline) = 1;
-}
-
-void commandonly(Context &context) {
- STACK_CHECK(context);
- context.push(context.ax);
- context.push(context.bx);
- context.push(context.cx);
- context.push(context.dx);
- context.push(context.es);
- context.push(context.ds);
- context.push(context.si);
- context.push(context.di);
- deltextline(context);
- context.di = context.pop();
- context.si = context.pop();
- context.ds = context.pop();
- context.es = context.pop();
- context.dx = context.pop();
- context.cx = context.pop();
- context.bx = context.pop();
- context.ax = context.pop();
- context.ah = 0;
- context._add(context.ax, context.ax);
- context.bx = context.ax;
- context.es = context.data.word(kCommandtext);
- context.ax = context.es.word(context.bx);
- context._add(context.ax, (66*2));
- context.si = context.ax;
- context.di = context.data.word(kTextaddressx);
- context.bx = context.data.word(kTextaddressy);
- context.dl = context.data.byte(kTextlen);
- context.al = 0;
- context.ah = 0;
- printdirect(context);
- context.data.byte(kNewtextline) = 1;
-}
-
-void printmessage(Context &context) {
- STACK_CHECK(context);
- context.push(context.dx);
- context.push(context.bx);
- context.push(context.di);
- context.ah = 0;
- context._add(context.ax, context.ax);
- context.bx = context.ax;
- context.es = context.data.word(kCommandtext);
- context.ax = context.es.word(context.bx);
- context._add(context.ax, (66*2));
- context.si = context.ax;
- context.di = context.pop();
- context.bx = context.pop();
- context.dx = context.pop();
- context.al = 0;
- context.ah = 0;
- printdirect(context);
-}
-
-void printmessage2(Context &context) {
- STACK_CHECK(context);
- context.push(context.dx);
- context.push(context.bx);
- context.push(context.di);
- context.push(context.ax);
- context.ah = 0;
- context._add(context.ax, context.ax);
- context.bx = context.ax;
- context.es = context.data.word(kCommandtext);
- context.ax = context.es.word(context.bx);
- context._add(context.ax, (66*2));
- context.si = context.ax;
- context.ax = context.pop();
+ bx = data.word(kTextaddressy);
+ es = cs;
+ si = 5847;
+ dl = data.byte(kTextlen);
+ al = 0;
+ ah = 0;
+ printdirect();
+ data.byte(kNewtextline) = 1;
+}
+
+void DreamGenContext::commandonly() {
+ STACK_CHECK;
+ push(ax);
+ push(bx);
+ push(cx);
+ push(dx);
+ push(es);
+ push(ds);
+ push(si);
+ push(di);
+ deltextline();
+ di = pop();
+ si = pop();
+ ds = pop();
+ es = pop();
+ dx = pop();
+ cx = pop();
+ bx = pop();
+ ax = pop();
+ ah = 0;
+ _add(ax, ax);
+ bx = ax;
+ es = data.word(kCommandtext);
+ ax = es.word(bx);
+ _add(ax, (66*2));
+ si = ax;
+ di = data.word(kTextaddressx);
+ bx = data.word(kTextaddressy);
+ dl = data.byte(kTextlen);
+ al = 0;
+ ah = 0;
+ printdirect();
+ data.byte(kNewtextline) = 1;
+}
+
+void DreamGenContext::printmessage() {
+ STACK_CHECK;
+ push(dx);
+ push(bx);
+ push(di);
+ ah = 0;
+ _add(ax, ax);
+ bx = ax;
+ es = data.word(kCommandtext);
+ ax = es.word(bx);
+ _add(ax, (66*2));
+ si = ax;
+ di = pop();
+ bx = pop();
+ dx = pop();
+ al = 0;
+ ah = 0;
+ printdirect();
+}
+
+void DreamGenContext::printmessage2() {
+ STACK_CHECK;
+ push(dx);
+ push(bx);
+ push(di);
+ push(ax);
+ ah = 0;
+ _add(ax, ax);
+ bx = ax;
+ es = data.word(kCommandtext);
+ ax = es.word(bx);
+ _add(ax, (66*2));
+ si = ax;
+ ax = pop();
searchmess:
- context.push(context.ax);
- findnextcolon(context);
- context.ax = context.pop();
- context._dec(context.ah);
- if (!context.flags.z())
+ push(ax);
+ findnextcolon();
+ ax = pop();
+ _dec(ah);
+ if (!flags.z())
goto searchmess;
- context.di = context.pop();
- context.bx = context.pop();
- context.dx = context.pop();
- context.al = 0;
- context.ah = 0;
- printdirect(context);
-}
-
-void blocknametext(Context &context) {
- STACK_CHECK(context);
- context.bl = context.data.byte(kCommand);
- context.bh = context.data.byte(kCommandtype);
- context.al = 0;
- commandwithob(context);
-}
-
-void personnametext(Context &context) {
- STACK_CHECK(context);
- context.bl = context.data.byte(kCommand);
- context._and(context.bl, 127);
- context.bh = context.data.byte(kCommandtype);
- context.al = 2;
- commandwithob(context);
-}
-
-void walktotext(Context &context) {
- STACK_CHECK(context);
- context.bl = context.data.byte(kCommand);
- context.bh = context.data.byte(kCommandtype);
- context.al = 3;
- commandwithob(context);
-}
-
-void getflagunderp(Context &context) {
- STACK_CHECK(context);
- context.cx = context.data.word(kMousex);
- context._sub(context.cx, context.data.word(kMapadx));
- context.ax = context.data.word(kMousey);
- context._sub(context.ax, context.data.word(kMapady));
- context.ch = context.al;
- checkone(context);
- context.data.byte(kLastflag) = context.cl;
- context.data.byte(kLastflagex) = context.ch;
-}
-
-void setwalk(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kLinepointer), 254);
- if (!context.flags.z())
+ di = pop();
+ bx = pop();
+ dx = pop();
+ al = 0;
+ ah = 0;
+ printdirect();
+}
+
+void DreamGenContext::blocknametext() {
+ STACK_CHECK;
+ bl = data.byte(kCommand);
+ bh = data.byte(kCommandtype);
+ al = 0;
+ commandwithob();
+}
+
+void DreamGenContext::personnametext() {
+ STACK_CHECK;
+ bl = data.byte(kCommand);
+ _and(bl, 127);
+ bh = data.byte(kCommandtype);
+ al = 2;
+ commandwithob();
+}
+
+void DreamGenContext::walktotext() {
+ STACK_CHECK;
+ bl = data.byte(kCommand);
+ bh = data.byte(kCommandtype);
+ al = 3;
+ commandwithob();
+}
+
+void DreamGenContext::getflagunderp() {
+ STACK_CHECK;
+ cx = data.word(kMousex);
+ _sub(cx, data.word(kMapadx));
+ ax = data.word(kMousey);
+ _sub(ax, data.word(kMapady));
+ ch = al;
+ checkone();
+ data.byte(kLastflag) = cl;
+ data.byte(kLastflagex) = ch;
+}
+
+void DreamGenContext::setwalk() {
+ STACK_CHECK;
+ _cmp(data.byte(kLinepointer), 254);
+ if (!flags.z())
goto alreadywalking;
- context.al = context.data.byte(kPointerspath);
- context._cmp(context.al, context.data.byte(kManspath));
- if (context.flags.z())
+ al = data.byte(kPointerspath);
+ _cmp(al, data.byte(kManspath));
+ if (flags.z())
goto cantwalk2;
- context._cmp(context.data.byte(kWatchmode), 1);
- if (context.flags.z())
+ _cmp(data.byte(kWatchmode), 1);
+ if (flags.z())
goto holdingreel;
- context._cmp(context.data.byte(kWatchmode), 2);
- if (context.flags.z())
- goto cantwalk;
- context.data.byte(kDestination) = context.al;
- context.data.byte(kFinaldest) = context.al;
- context._cmp(context.data.word(kMousebutton), 2);
- if (!context.flags.z())
+ _cmp(data.byte(kWatchmode), 2);
+ if (flags.z())
+ return /* (cantwalk) */;
+ data.byte(kDestination) = al;
+ data.byte(kFinaldest) = al;
+ _cmp(data.word(kMousebutton), 2);
+ if (!flags.z())
goto notwalkandexam;
- context._cmp(context.data.byte(kCommandtype), 3);
- if (context.flags.z())
+ _cmp(data.byte(kCommandtype), 3);
+ if (flags.z())
goto notwalkandexam;
- context.data.byte(kWalkandexam) = 1;
- context.al = context.data.byte(kCommandtype);
- context.data.byte(kWalkexamtype) = context.al;
- context.al = context.data.byte(kCommand);
- context.data.byte(kWalkexamnum) = context.al;
+ data.byte(kWalkandexam) = 1;
+ al = data.byte(kCommandtype);
+ data.byte(kWalkexamtype) = al;
+ al = data.byte(kCommand);
+ data.byte(kWalkexamnum) = al;
notwalkandexam:
- autosetwalk(context);
-cantwalk:
+ autosetwalk();
return;
cantwalk2:
- facerightway(context);
+ facerightway();
return;
alreadywalking:
- context.al = context.data.byte(kPointerspath);
- context.data.byte(kFinaldest) = context.al;
+ al = data.byte(kPointerspath);
+ data.byte(kFinaldest) = al;
return;
holdingreel:
- context.data.byte(kDestafterhold) = context.al;
- context.data.byte(kWatchmode) = 2;
+ data.byte(kDestafterhold) = al;
+ data.byte(kWatchmode) = 2;
}
-void autosetwalk(Context &context) {
- STACK_CHECK(context);
- context.al = context.data.byte(kManspath);
- context._cmp(context.data.byte(kFinaldest), context.al);
- if (!context.flags.z())
+void DreamGenContext::autosetwalk() {
+ STACK_CHECK;
+ al = data.byte(kManspath);
+ _cmp(data.byte(kFinaldest), al);
+ if (!flags.z())
goto notsamealready;
return;
notsamealready:
- getroomspaths(context);
- checkdest(context);
- context.push(context.bx);
- context.al = context.data.byte(kManspath);
- context.ah = 0;
- context._add(context.ax, context.ax);
- context._add(context.ax, context.ax);
- context._add(context.ax, context.ax);
- context._add(context.bx, context.ax);
- context.al = context.es.byte(context.bx);
- context.ah = 0;
- context._sub(context.ax, 12);
- context.data.word(kLinestartx) = context.ax;
- context.al = context.es.byte(context.bx+1);
- context.ah = 0;
- context._sub(context.ax, 12);
- context.data.word(kLinestarty) = context.ax;
- context.bx = context.pop();
- context.al = context.data.byte(kDestination);
- context.ah = 0;
- context._add(context.ax, context.ax);
- context._add(context.ax, context.ax);
- context._add(context.ax, context.ax);
- context._add(context.bx, context.ax);
- context.al = context.es.byte(context.bx);
- context.ah = 0;
- context._sub(context.ax, 12);
- context.data.word(kLineendx) = context.ax;
- context.al = context.es.byte(context.bx+1);
- context.ah = 0;
- context._sub(context.ax, 12);
- context.data.word(kLineendy) = context.ax;
- bresenhams(context);
- context._cmp(context.data.byte(kLinedirection), 0);
- if (context.flags.z())
+ getroomspaths();
+ checkdest();
+ push(bx);
+ al = data.byte(kManspath);
+ ah = 0;
+ _add(ax, ax);
+ _add(ax, ax);
+ _add(ax, ax);
+ _add(bx, ax);
+ al = es.byte(bx);
+ ah = 0;
+ _sub(ax, 12);
+ data.word(kLinestartx) = ax;
+ al = es.byte(bx+1);
+ ah = 0;
+ _sub(ax, 12);
+ data.word(kLinestarty) = ax;
+ bx = pop();
+ al = data.byte(kDestination);
+ ah = 0;
+ _add(ax, ax);
+ _add(ax, ax);
+ _add(ax, ax);
+ _add(bx, ax);
+ al = es.byte(bx);
+ ah = 0;
+ _sub(ax, 12);
+ data.word(kLineendx) = ax;
+ al = es.byte(bx+1);
+ ah = 0;
+ _sub(ax, 12);
+ data.word(kLineendy) = ax;
+ bresenhams();
+ _cmp(data.byte(kLinedirection), 0);
+ if (flags.z())
goto normalline;
- context.al = context.data.byte(kLinelength);
- context._dec(context.al);
- context.data.byte(kLinepointer) = context.al;
- context.data.byte(kLinedirection) = 1;
+ al = data.byte(kLinelength);
+ _dec(al);
+ data.byte(kLinepointer) = al;
+ data.byte(kLinedirection) = 1;
return;
normalline:
- context.data.byte(kLinepointer) = 0;
-}
-
-void checkdest(Context &context) {
- STACK_CHECK(context);
- context.push(context.bx);
- context._add(context.bx, 12*8);
- context.ah = context.data.byte(kManspath);
- context.cl = 4;
- context._shl(context.ah, context.cl);
- context.al = context.data.byte(kDestination);
- context.cl = 24;
- context.ch = context.data.byte(kDestination);
+ data.byte(kLinepointer) = 0;
+}
+
+void DreamGenContext::checkdest() {
+ STACK_CHECK;
+ push(bx);
+ _add(bx, 12*8);
+ ah = data.byte(kManspath);
+ cl = 4;
+ _shl(ah, cl);
+ al = data.byte(kDestination);
+ cl = 24;
+ ch = data.byte(kDestination);
checkdestloop:
- context.dh = context.es.byte(context.bx);
- context._and(context.dh, 0xf0);
- context.dl = context.es.byte(context.bx);
- context._and(context.dl, 0xf);
- context._cmp(context.ax, context.dx);
- if (!context.flags.z())
+ dh = es.byte(bx);
+ _and(dh, 0xf0);
+ dl = es.byte(bx);
+ _and(dl, 0xf);
+ _cmp(ax, dx);
+ if (!flags.z())
goto nextcheck;
- context.al = context.es.byte(context.bx+1);
- context._and(context.al, 15);
- context.data.byte(kDestination) = context.al;
- context.bx = context.pop();
+ al = es.byte(bx+1);
+ _and(al, 15);
+ data.byte(kDestination) = al;
+ bx = pop();
return;
nextcheck:
- context.dl = context.es.byte(context.bx);
- context._and(context.dl, 0xf0);
- context._shr(context.dl, 1);
- context._shr(context.dl, 1);
- context._shr(context.dl, 1);
- context._shr(context.dl, 1);
- context.dh = context.es.byte(context.bx);
- context._and(context.dh, 0xf);
- context._shl(context.dh, 1);
- context._shl(context.dh, 1);
- context._shl(context.dh, 1);
- context._shl(context.dh, 1);
- context._cmp(context.ax, context.dx);
- if (!context.flags.z())
+ dl = es.byte(bx);
+ _and(dl, 0xf0);
+ _shr(dl, 1);
+ _shr(dl, 1);
+ _shr(dl, 1);
+ _shr(dl, 1);
+ dh = es.byte(bx);
+ _and(dh, 0xf);
+ _shl(dh, 1);
+ _shl(dh, 1);
+ _shl(dh, 1);
+ _shl(dh, 1);
+ _cmp(ax, dx);
+ if (!flags.z())
goto nextcheck2;
- context.ch = context.es.byte(context.bx+1);
- context._and(context.ch, 15);
+ ch = es.byte(bx+1);
+ _and(ch, 15);
nextcheck2:
- context._add(context.bx, 2);
- context._dec(context.cl);
- if (!context.flags.z())
+ _add(bx, 2);
+ _dec(cl);
+ if (!flags.z())
goto checkdestloop;
- context.data.byte(kDestination) = context.ch;
- context.bx = context.pop();
-}
-
-void bresenhams(Context &context) {
- STACK_CHECK(context);
- workoutframes(context);
- context.dx = context.data;
- context.es = context.dx;
- context.di = 8173;
- context.si = 1;
- context.data.byte(kLinedirection) = 0;
- context.cx = context.data.word(kLineendx);
- context._sub(context.cx, context.data.word(kLinestartx));
- if (context.flags.z())
+ data.byte(kDestination) = ch;
+ bx = pop();
+}
+
+void DreamGenContext::bresenhams() {
+ STACK_CHECK;
+ workoutframes();
+ dx = data;
+ es = dx;
+ di = 8173;
+ si = 1;
+ data.byte(kLinedirection) = 0;
+ cx = data.word(kLineendx);
+ _sub(cx, data.word(kLinestartx));
+ if (flags.z())
goto vertline;
- if (!context.flags.s())
+ if (!flags.s())
goto line1;
- context._neg(context.cx);
- context.bx = context.data.word(kLineendx);
- context._xchg(context.bx, context.data.word(kLinestartx));
- context.data.word(kLineendx) = context.bx;
- context.bx = context.data.word(kLineendy);
- context._xchg(context.bx, context.data.word(kLinestarty));
- context.data.word(kLineendy) = context.bx;
- context.data.byte(kLinedirection) = 1;
+ _neg(cx);
+ bx = data.word(kLineendx);
+ _xchg(bx, data.word(kLinestartx));
+ data.word(kLineendx) = bx;
+ bx = data.word(kLineendy);
+ _xchg(bx, data.word(kLinestarty));
+ data.word(kLineendy) = bx;
+ data.byte(kLinedirection) = 1;
line1:
- context.bx = context.data.word(kLineendy);
- context._sub(context.bx, context.data.word(kLinestarty));
- if (context.flags.z())
+ bx = data.word(kLineendy);
+ _sub(bx, data.word(kLinestarty));
+ if (flags.z())
goto horizline;
- if (!context.flags.s())
+ if (!flags.s())
goto line3;
- context._neg(context.bx);
- context._neg(context.si);
+ _neg(bx);
+ _neg(si);
line3:
- context.push(context.si);
- context.data.byte(kLineroutine) = 0;
- context._cmp(context.bx, context.cx);
- if (context.flags.le())
+ push(si);
+ data.byte(kLineroutine) = 0;
+ _cmp(bx, cx);
+ if (flags.le())
goto line4;
- context.data.byte(kLineroutine) = 1;
- context._xchg(context.bx, context.cx);
+ data.byte(kLineroutine) = 1;
+ _xchg(bx, cx);
line4:
- context._shl(context.bx, 1);
- context.data.word(kIncrement1) = context.bx;
- context._sub(context.bx, context.cx);
- context.si = context.bx;
- context._sub(context.bx, context.cx);
- context.data.word(kIncrement2) = context.bx;
- context.ax = context.data.word(kLinestartx);
- context.bx = context.data.word(kLinestarty);
- context.ah = context.bl;
- context._inc(context.cx);
- context.bx = context.pop();
- context._cmp(context.data.byte(kLineroutine), 1);
- if (context.flags.z())
+ _shl(bx, 1);
+ data.word(kIncrement1) = bx;
+ _sub(bx, cx);
+ si = bx;
+ _sub(bx, cx);
+ data.word(kIncrement2) = bx;
+ ax = data.word(kLinestartx);
+ bx = data.word(kLinestarty);
+ ah = bl;
+ _inc(cx);
+ bx = pop();
+ _cmp(data.byte(kLineroutine), 1);
+ if (flags.z())
goto hislope;
goto loslope;
vertline:
- context.ax = context.data.word(kLinestarty);
- context.bx = context.data.word(kLineendy);
- context.cx = context.bx;
- context._sub(context.cx, context.ax);
- if (!context.flags.l())
+ ax = data.word(kLinestarty);
+ bx = data.word(kLineendy);
+ cx = bx;
+ _sub(cx, ax);
+ if (!flags.l())
goto line31;
- context._neg(context.cx);
- context.ax = context.bx;
- context.data.byte(kLinedirection) = 1;
+ _neg(cx);
+ ax = bx;
+ data.byte(kLinedirection) = 1;
line31:
- context._inc(context.cx);
- context.bx = context.data.word(kLinestartx);
- context._xchg(context.ax, context.bx);
- context.ah = context.bl;
- context.bx = context.si;
+ _inc(cx);
+ bx = data.word(kLinestartx);
+ _xchg(ax, bx);
+ ah = bl;
+ bx = si;
line32:
- context._stosw();
- context._add(context.ah, context.bl);
- if (--context.cx)
+ _stosw();
+ _add(ah, bl);
+ if (--cx)
goto line32;
goto lineexit;
horizline:
- context.ax = context.data.word(kLinestartx);
- context.bx = context.data.word(kLinestarty);
- context.ah = context.bl;
- context._inc(context.cx);
+ ax = data.word(kLinestartx);
+ bx = data.word(kLinestarty);
+ ah = bl;
+ _inc(cx);
horizloop:
- context._stosw();
- context._inc(context.al);
- if (--context.cx)
+ _stosw();
+ _inc(al);
+ if (--cx)
goto horizloop;
goto lineexit;
loslope:
loloop:
- context._stosw();
- context._inc(context.al);
- context._or(context.si, context.si);
- if (!context.flags.s())
+ _stosw();
+ _inc(al);
+ _or(si, si);
+ if (!flags.s())
goto line12;
- context._add(context.si, context.data.word(kIncrement1));
- if (--context.cx)
+ _add(si, data.word(kIncrement1));
+ if (--cx)
goto loloop;
goto lineexit;
line12:
- context._add(context.si, context.data.word(kIncrement2));
- context._add(context.ah, context.bl);
- if (--context.cx)
+ _add(si, data.word(kIncrement2));
+ _add(ah, bl);
+ if (--cx)
goto loloop;
goto lineexit;
hislope:
hiloop:
- context._stosw();
- context._add(context.ah, context.bl);
- context._or(context.si, context.si);
- if (!context.flags.s())
+ _stosw();
+ _add(ah, bl);
+ _or(si, si);
+ if (!flags.s())
goto line23;
- context._add(context.si, context.data.word(kIncrement1));
- if (--context.cx)
+ _add(si, data.word(kIncrement1));
+ if (--cx)
goto hiloop;
goto lineexit;
line23:
- context._add(context.si, context.data.word(kIncrement2));
- context._inc(context.al);
- if (--context.cx)
+ _add(si, data.word(kIncrement2));
+ _inc(al);
+ if (--cx)
goto hiloop;
lineexit:
- context._sub(context.di, 8173);
- context.ax = context.di;
- context._shr(context.ax, 1);
- context.data.byte(kLinelength) = context.al;
-}
-
-void workoutframes(Context &context) {
- STACK_CHECK(context);
- context.bx = context.data.word(kLinestartx);
- context._add(context.bx, 32);
- context.ax = context.data.word(kLineendx);
- context._add(context.ax, 32);
- context._sub(context.bx, context.ax);
- if (!context.flags.c())
+ _sub(di, 8173);
+ ax = di;
+ _shr(ax, 1);
+ data.byte(kLinelength) = al;
+}
+
+void DreamGenContext::workoutframes() {
+ STACK_CHECK;
+ bx = data.word(kLinestartx);
+ _add(bx, 32);
+ ax = data.word(kLineendx);
+ _add(ax, 32);
+ _sub(bx, ax);
+ if (!flags.c())
goto notneg1;
- context._neg(context.bx);
+ _neg(bx);
notneg1:
- context.cx = context.data.word(kLinestarty);
- context._add(context.cx, 32);
- context.ax = context.data.word(kLineendy);
- context._add(context.ax, 32);
- context._sub(context.cx, context.ax);
- if (!context.flags.c())
+ cx = data.word(kLinestarty);
+ _add(cx, 32);
+ ax = data.word(kLineendy);
+ _add(ax, 32);
+ _sub(cx, ax);
+ if (!flags.c())
goto notneg2;
- context._neg(context.cx);
+ _neg(cx);
notneg2:
- context._cmp(context.bx, context.cx);
- if (!context.flags.c())
+ _cmp(bx, cx);
+ if (!flags.c())
goto tendstohoriz;
- context.dl = 2;
- context.ax = context.cx;
- context._shr(context.ax, 1);
- context._cmp(context.bx, context.ax);
- if (context.flags.c())
+ dl = 2;
+ ax = cx;
+ _shr(ax, 1);
+ _cmp(bx, ax);
+ if (flags.c())
goto gotquad;
- context.dl = 1;
+ dl = 1;
goto gotquad;
tendstohoriz:
- context.dl = 0;
- context.ax = context.bx;
- context._shr(context.ax, 1);
- context._cmp(context.cx, context.ax);
- if (context.flags.c())
+ dl = 0;
+ ax = bx;
+ _shr(ax, 1);
+ _cmp(cx, ax);
+ if (flags.c())
goto gotquad;
- context.dl = 1;
+ dl = 1;
goto gotquad;
gotquad:
- context.bx = context.data.word(kLinestartx);
- context._add(context.bx, 32);
- context.ax = context.data.word(kLineendx);
- context._add(context.ax, 32);
- context._sub(context.bx, context.ax);
- if (context.flags.c())
+ bx = data.word(kLinestartx);
+ _add(bx, 32);
+ ax = data.word(kLineendx);
+ _add(ax, 32);
+ _sub(bx, ax);
+ if (flags.c())
goto isinright;
- context.cx = context.data.word(kLinestarty);
- context._add(context.cx, 32);
- context.ax = context.data.word(kLineendy);
- context._add(context.ax, 32);
- context._sub(context.cx, context.ax);
- if (!context.flags.c())
+ cx = data.word(kLinestarty);
+ _add(cx, 32);
+ ax = data.word(kLineendy);
+ _add(ax, 32);
+ _sub(cx, ax);
+ if (!flags.c())
goto topleft;
- context._cmp(context.dl, 1);
- if (context.flags.z())
+ _cmp(dl, 1);
+ if (flags.z())
goto noswap1;
- context._xor(context.dl, 2);
+ _xor(dl, 2);
noswap1:
- context._add(context.dl, 4);
+ _add(dl, 4);
goto success;
topleft:
- context._add(context.dl, 6);
+ _add(dl, 6);
goto success;
isinright:
- context.cx = context.data.word(kLinestarty);
- context._add(context.cx, 32);
- context.ax = context.data.word(kLineendy);
- context._add(context.ax, 32);
- context._sub(context.cx, context.ax);
- if (!context.flags.c())
+ cx = data.word(kLinestarty);
+ _add(cx, 32);
+ ax = data.word(kLineendy);
+ _add(ax, 32);
+ _sub(cx, ax);
+ if (!flags.c())
goto botright;
- context._add(context.dl, 2);
+ _add(dl, 2);
goto success;
botright:
- context._cmp(context.dl, 1);
- if (context.flags.z())
+ _cmp(dl, 1);
+ if (flags.z())
goto noswap2;
- context._xor(context.dl, 2);
+ _xor(dl, 2);
noswap2:
success:
- context._and(context.dl, 7);
- context.data.byte(kTurntoface) = context.dl;
- context.data.byte(kTurndirection) = 0;
-}
-
-void getroomspaths(Context &context) {
- STACK_CHECK(context);
- context.al = context.data.byte(kRoomnum);
- context.ah = 0;
- context.cx = 144;
- context._mul(context.cx);
- context.es = context.data.word(kReels);
- context.bx = (0);
- context._add(context.bx, context.ax);
-}
-
-void copyname(Context &context) {
- STACK_CHECK(context);
- context.push(context.di);
- findobname(context);
- context.di = context.pop();
- context.es = context.cs;
- context.cx = 28;
+ _and(dl, 7);
+ data.byte(kTurntoface) = dl;
+ data.byte(kTurndirection) = 0;
+}
+
+void DreamGenContext::getroomspaths() {
+ STACK_CHECK;
+ al = data.byte(kRoomnum);
+ ah = 0;
+ cx = 144;
+ _mul(cx);
+ es = data.word(kReels);
+ bx = (0);
+ _add(bx, ax);
+}
+
+void DreamGenContext::copyname() {
+ STACK_CHECK;
+ push(di);
+ findobname();
+ di = pop();
+ es = cs;
+ cx = 28;
make:
- context._lodsb();
- context._cmp(context.al, ':');
- if (context.flags.z())
+ _lodsb();
+ _cmp(al, ':');
+ if (flags.z())
goto finishmakename;
- context._cmp(context.al, 0);
- if (context.flags.z())
+ _cmp(al, 0);
+ if (flags.z())
goto finishmakename;
- context._stosb();
- if (--context.cx)
+ _stosb();
+ if (--cx)
goto make;
finishmakename:
- context._inc(context.cx);
- context.al = 0;
- context._stosb();
- return;
- context.al = 255;
- context._stosb(context.cx);
-}
-
-void findobname(Context &context) {
- STACK_CHECK(context);
- context.push(context.ax);
- context.ah = 0;
- context._add(context.ax, context.ax);
- context.bx = context.ax;
- context.ax = context.pop();
- context._cmp(context.ah, 5);
- if (!context.flags.z())
+ _inc(cx);
+ al = 0;
+ _stosb();
+ return;
+ al = 255;
+ _stosb(cx, true);
+}
+
+void DreamGenContext::findobname() {
+ STACK_CHECK;
+ push(ax);
+ ah = 0;
+ _add(ax, ax);
+ bx = ax;
+ ax = pop();
+ _cmp(ah, 5);
+ if (!flags.z())
goto notpersonname;
- context.push(context.ax);
- context._and(context.al, 127);
- context.ah = 0;
- context.bx = 64*2;
- context._mul(context.bx);
- context.si = context.ax;
- context.ds = context.data.word(kPeople);
- context._add(context.si, (0+24));
- context.cx = (0+24+(1026*2));
- context.ax = context.ds.word(context.si);
- context._add(context.ax, context.cx);
- context.si = context.ax;
- context.ax = context.pop();
+ push(ax);
+ _and(al, 127);
+ ah = 0;
+ bx = 64*2;
+ _mul(bx);
+ si = ax;
+ ds = data.word(kPeople);
+ _add(si, (0+24));
+ cx = (0+24+(1026*2));
+ ax = ds.word(si);
+ _add(ax, cx);
+ si = ax;
+ ax = pop();
return;
notpersonname:
- context._cmp(context.ah, 4);
- if (!context.flags.z())
+ _cmp(ah, 4);
+ if (!flags.z())
goto notextraname;
- context.ds = context.data.word(kExtras);
- context._add(context.bx, (0+2080+30000+(16*114)));
- context.ax = context.ds.word(context.bx);
- context._add(context.ax, (0+2080+30000+(16*114)+((114+2)*2)));
- context.si = context.ax;
+ ds = data.word(kExtras);
+ _add(bx, (0+2080+30000+(16*114)));
+ ax = ds.word(bx);
+ _add(ax, (0+2080+30000+(16*114)+((114+2)*2)));
+ si = ax;
return;
notextraname:
- context._cmp(context.ah, 2);
- if (!context.flags.z())
+ _cmp(ah, 2);
+ if (!flags.z())
goto notfreename;
- context.ds = context.data.word(kFreedesc);
- context._add(context.bx, (0));
- context.ax = context.ds.word(context.bx);
- context._add(context.ax, (0+(82*2)));
- context.si = context.ax;
+ ds = data.word(kFreedesc);
+ _add(bx, (0));
+ ax = ds.word(bx);
+ _add(ax, (0+(82*2)));
+ si = ax;
return;
notfreename:
- context._cmp(context.ah, 1);
- if (!context.flags.z())
+ _cmp(ah, 1);
+ if (!flags.z())
goto notsetname;
- context.ds = context.data.word(kSetdesc);
- context._add(context.bx, (0));
- context.ax = context.ds.word(context.bx);
- context._add(context.ax, (0+(130*2)));
- context.si = context.ax;
+ ds = data.word(kSetdesc);
+ _add(bx, (0));
+ ax = ds.word(bx);
+ _add(ax, (0+(130*2)));
+ si = ax;
return;
notsetname:
- context.ds = context.data.word(kBlockdesc);
- context._add(context.bx, (0));
- context.ax = context.ds.word(context.bx);
- context._add(context.ax, (0+(98*2)));
- context.si = context.ax;
+ ds = data.word(kBlockdesc);
+ _add(bx, (0));
+ ax = ds.word(bx);
+ _add(ax, (0+(98*2)));
+ si = ax;
}
-void showicon(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kReallocation), 50);
- if (!context.flags.c())
+void DreamGenContext::showicon() {
+ STACK_CHECK;
+ _cmp(data.byte(kReallocation), 50);
+ if (!flags.c())
goto isdream1;
- showpanel(context);
- showman(context);
- roomname(context);
- panelicons1(context);
- zoomicon(context);
+ showpanel();
+ showman();
+ roomname();
+ panelicons1();
+ zoomicon();
return;
isdream1:
- context.ds = context.data.word(kTempsprites);
- context.di = 72;
- context.bx = 2;
- context.al = 45;
- context.ah = 0;
- showframe(context);
- context.ds = context.data.word(kTempsprites);
- context.di = 72+47;
- context.bx = 2;
- context.al = 46;
- context.ah = 0;
- showframe(context);
- context.ds = context.data.word(kTempsprites);
- context.di = 69-10;
- context.bx = 21;
- context.al = 49;
- context.ah = 0;
- showframe(context);
- context.ds = context.data.word(kTempsprites);
- context.di = 160+88;
- context.bx = 2;
- context.al = 45;
- context.ah = 4;
- showframe(context);
- context.ds = context.data.word(kTempsprites);
- context.di = 160+43;
- context.bx = 2;
- context.al = 46;
- context.ah = 4;
- showframe(context);
- context.ds = context.data.word(kTempsprites);
- context.di = 160+101;
- context.bx = 21;
- context.al = 49;
- context.ah = 4;
- showframe(context);
- middlepanel(context);
-}
-
-void middlepanel(Context &context) {
- STACK_CHECK(context);
- context.ds = context.data.word(kTempsprites);
- context.di = 72+47+20;
- context.bx = 0;
- context.al = 48;
- context.ah = 0;
- showframe(context);
- context.ds = context.data.word(kTempsprites);
- context.di = 72+19;
- context.bx = 21;
- context.al = 47;
- context.ah = 0;
- showframe(context);
- context.ds = context.data.word(kTempsprites);
- context.di = 160+23;
- context.bx = 0;
- context.al = 48;
- context.ah = 4;
- showframe(context);
- context.ds = context.data.word(kTempsprites);
- context.di = 160+71;
- context.bx = 21;
- context.al = 47;
- context.ah = 4;
- showframe(context);
-}
-
-void showman(Context &context) {
- STACK_CHECK(context);
- context.ds = context.data.word(kIcons1);
- context.di = 0;
- context.bx = 0;
- context.al = 0;
- context.ah = 0;
- showframe(context);
- context.ds = context.data.word(kIcons1);
- context.di = 0;
- context.bx = 114;
- context.al = 1;
- context.ah = 0;
- showframe(context);
- context._cmp(context.data.byte(kShadeson), 0);
- if (context.flags.z())
- goto notverycool;
- context.ds = context.data.word(kIcons1);
- context.di = 28;
- context.bx = 25;
- context.al = 2;
- context.ah = 0;
- showframe(context);
-notverycool:
- return;
-}
-
-void showpanel(Context &context) {
- STACK_CHECK(context);
- context.ds = context.data.word(kIcons1);
- context.di = 72;
- context.bx = 0;
- context.al = 19;
- context.ah = 0;
- showframe(context);
- context.ds = context.data.word(kIcons1);
- context.di = 192;
- context.bx = 0;
- context.al = 19;
- context.ah = 0;
- showframe(context);
-}
-
-void roomname(Context &context) {
- STACK_CHECK(context);
- context.di = 88;
- context.bx = 18;
- context.al = 53;
- context.dl = 240;
- printmessage(context);
- context.bl = context.data.byte(kRoomnum);
- context._cmp(context.bl, 32);
- if (context.flags.c())
+ ds = data.word(kTempsprites);
+ di = 72;
+ bx = 2;
+ al = 45;
+ ah = 0;
+ showframe();
+ ds = data.word(kTempsprites);
+ di = 72+47;
+ bx = 2;
+ al = 46;
+ ah = 0;
+ showframe();
+ ds = data.word(kTempsprites);
+ di = 69-10;
+ bx = 21;
+ al = 49;
+ ah = 0;
+ showframe();
+ ds = data.word(kTempsprites);
+ di = 160+88;
+ bx = 2;
+ al = 45;
+ ah = 4;
+ showframe();
+ ds = data.word(kTempsprites);
+ di = 160+43;
+ bx = 2;
+ al = 46;
+ ah = 4;
+ showframe();
+ ds = data.word(kTempsprites);
+ di = 160+101;
+ bx = 21;
+ al = 49;
+ ah = 4;
+ showframe();
+ middlepanel();
+}
+
+void DreamGenContext::middlepanel() {
+ STACK_CHECK;
+ ds = data.word(kTempsprites);
+ di = 72+47+20;
+ bx = 0;
+ al = 48;
+ ah = 0;
+ showframe();
+ ds = data.word(kTempsprites);
+ di = 72+19;
+ bx = 21;
+ al = 47;
+ ah = 0;
+ showframe();
+ ds = data.word(kTempsprites);
+ di = 160+23;
+ bx = 0;
+ al = 48;
+ ah = 4;
+ showframe();
+ ds = data.word(kTempsprites);
+ di = 160+71;
+ bx = 21;
+ al = 47;
+ ah = 4;
+ showframe();
+}
+
+void DreamGenContext::showman() {
+ STACK_CHECK;
+ ds = data.word(kIcons1);
+ di = 0;
+ bx = 0;
+ al = 0;
+ ah = 0;
+ showframe();
+ ds = data.word(kIcons1);
+ di = 0;
+ bx = 114;
+ al = 1;
+ ah = 0;
+ showframe();
+ _cmp(data.byte(kShadeson), 0);
+ if (flags.z())
+ return /* (notverycool) */;
+ ds = data.word(kIcons1);
+ di = 28;
+ bx = 25;
+ al = 2;
+ ah = 0;
+ showframe();
+}
+
+void DreamGenContext::showpanel() {
+ STACK_CHECK;
+ ds = data.word(kIcons1);
+ di = 72;
+ bx = 0;
+ al = 19;
+ ah = 0;
+ showframe();
+ ds = data.word(kIcons1);
+ di = 192;
+ bx = 0;
+ al = 19;
+ ah = 0;
+ showframe();
+}
+
+void DreamGenContext::roomname() {
+ STACK_CHECK;
+ di = 88;
+ bx = 18;
+ al = 53;
+ dl = 240;
+ printmessage();
+ bl = data.byte(kRoomnum);
+ _cmp(bl, 32);
+ if (flags.c())
goto notover32;
- context._sub(context.bl, 32);
+ _sub(bl, 32);
notover32:
- context.bh = 0;
- context._add(context.bx, context.bx);
- context.es = context.data.word(kRoomdesc);
- context._add(context.bx, (0));
- context.ax = context.es.word(context.bx);
- context._add(context.ax, (0+(38*2)));
- context.si = context.ax;
- context.data.word(kLinespacing) = 7;
- context.di = 88;
- context.bx = 25;
- context.dl = 120;
- context._cmp(context.data.byte(kWatchon), 1);
- if (context.flags.z())
+ bh = 0;
+ _add(bx, bx);
+ es = data.word(kRoomdesc);
+ _add(bx, (0));
+ ax = es.word(bx);
+ _add(ax, (0+(38*2)));
+ si = ax;
+ data.word(kLinespacing) = 7;
+ di = 88;
+ bx = 25;
+ dl = 120;
+ _cmp(data.byte(kWatchon), 1);
+ if (flags.z())
goto gotpl;
- context.dl = 160;
+ dl = 160;
gotpl:
- context.al = 0;
- context.ah = 0;
- printdirect(context);
- context.data.word(kLinespacing) = 10;
- usecharset1(context);
+ al = 0;
+ ah = 0;
+ printdirect();
+ data.word(kLinespacing) = 10;
+ usecharset1();
}
-void usecharset1(Context &context) {
- STACK_CHECK(context);
- context.ax = context.data.word(kCharset1);
- context.data.word(kCurrentset) = context.ax;
+void DreamGenContext::usecharset1() {
+ STACK_CHECK;
+ ax = data.word(kCharset1);
+ data.word(kCurrentset) = ax;
}
-void usetempcharset(Context &context) {
- STACK_CHECK(context);
- context.ax = context.data.word(kTempcharset);
- context.data.word(kCurrentset) = context.ax;
+void DreamGenContext::usetempcharset() {
+ STACK_CHECK;
+ ax = data.word(kTempcharset);
+ data.word(kCurrentset) = ax;
}
-void showexit(Context &context) {
- STACK_CHECK(context);
- context.ds = context.data.word(kIcons1);
- context.di = 274;
- context.bx = 154;
- context.al = 11;
- context.ah = 0;
- showframe(context);
+void DreamGenContext::showexit() {
+ STACK_CHECK;
+ ds = data.word(kIcons1);
+ di = 274;
+ bx = 154;
+ al = 11;
+ ah = 0;
+ showframe();
}
-void panelicons1(Context &context) {
- STACK_CHECK(context);
- context.di = 0;
- context._cmp(context.data.byte(kWatchon), 1);
- if (context.flags.z())
+void DreamGenContext::panelicons1() {
+ STACK_CHECK;
+ di = 0;
+ _cmp(data.byte(kWatchon), 1);
+ if (flags.z())
goto watchison;
- context.di = 48;
+ di = 48;
watchison:
- context.push(context.di);
- context.ds = context.data.word(kIcons2);
- context._add(context.di, 204);
- context.bx = 4;
- context.al = 2;
- context.ah = 0;
- showframe(context);
- context.di = context.pop();
- context.push(context.di);
- context._cmp(context.data.byte(kZoomon), 1);
- if (context.flags.z())
+ push(di);
+ ds = data.word(kIcons2);
+ _add(di, 204);
+ bx = 4;
+ al = 2;
+ ah = 0;
+ showframe();
+ di = pop();
+ push(di);
+ _cmp(data.byte(kZoomon), 1);
+ if (flags.z())
goto zoomisoff;
- context.ds = context.data.word(kIcons1);
- context._add(context.di, 228);
- context.bx = 8;
- context.al = 5;
- context.ah = 0;
- showframe(context);
+ ds = data.word(kIcons1);
+ _add(di, 228);
+ bx = 8;
+ al = 5;
+ ah = 0;
+ showframe();
zoomisoff:
- context.di = context.pop();
- showwatch(context);
-}
-
-void showwatch(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kWatchon), 0);
- if (context.flags.z())
- goto nowristwatch;
- context.ds = context.data.word(kIcons1);
- context.di = 250;
- context.bx = 1;
- context.al = 6;
- context.ah = 0;
- showframe(context);
- showtime(context);
-nowristwatch:
- return;
-}
-
-void zoomicon(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kZoomon), 0);
- if (context.flags.z())
- goto nozoom1;
- context.ds = context.data.word(kIcons1);
- context.di = (8);
- context.bx = (132)-1;
- context.al = 8;
- context.ah = 0;
- showframe(context);
-nozoom1:
- return;
-}
-
-void showblink(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kManisoffscreen), 1);
- if (context.flags.z())
- goto finblink1;
- context._inc(context.data.byte(kBlinkcount));
- context._cmp(context.data.byte(kShadeson), 0);
- if (!context.flags.z())
- goto finblink1;
- context._cmp(context.data.byte(kReallocation), 50);
- if (!context.flags.c())
- goto eyesshut;
- context.al = context.data.byte(kBlinkcount);
- context._cmp(context.al, 3);
- if (!context.flags.z())
- goto finblink1;
- context.data.byte(kBlinkcount) = 0;
- context.al = context.data.byte(kBlinkframe);
- context._inc(context.al);
- context.data.byte(kBlinkframe) = context.al;
- context._cmp(context.al, 6);
- if (context.flags.c())
+ di = pop();
+ showwatch();
+}
+
+void DreamGenContext::showwatch() {
+ STACK_CHECK;
+ _cmp(data.byte(kWatchon), 0);
+ if (flags.z())
+ return /* (nowristwatch) */;
+ ds = data.word(kIcons1);
+ di = 250;
+ bx = 1;
+ al = 6;
+ ah = 0;
+ showframe();
+ showtime();
+}
+
+void DreamGenContext::zoomicon() {
+ STACK_CHECK;
+ _cmp(data.byte(kZoomon), 0);
+ if (flags.z())
+ return /* (nozoom1) */;
+ ds = data.word(kIcons1);
+ di = (8);
+ bx = (132)-1;
+ al = 8;
+ ah = 0;
+ showframe();
+}
+
+void DreamGenContext::showblink() {
+ STACK_CHECK;
+ _cmp(data.byte(kManisoffscreen), 1);
+ if (flags.z())
+ return /* (finblink1) */;
+ _inc(data.byte(kBlinkcount));
+ _cmp(data.byte(kShadeson), 0);
+ if (!flags.z())
+ return /* (finblink1) */;
+ _cmp(data.byte(kReallocation), 50);
+ if (!flags.c())
+ return /* (eyesshut) */;
+ al = data.byte(kBlinkcount);
+ _cmp(al, 3);
+ if (!flags.z())
+ return /* (finblink1) */;
+ data.byte(kBlinkcount) = 0;
+ al = data.byte(kBlinkframe);
+ _inc(al);
+ data.byte(kBlinkframe) = al;
+ _cmp(al, 6);
+ if (flags.c())
goto nomorethan6;
- context.al = 6;
+ al = 6;
nomorethan6:
- context.ah = 0;
- context.bx = 5888;
- context._add(context.bx, context.ax);
- context.al = context.cs.byte(context.bx);
- context.ds = context.data.word(kIcons1);
- context.di = 44;
- context.bx = 32;
- context.ah = 0;
- showframe(context);
-finblink1:
- return;
-eyesshut:
- return;
-}
-
-void dumpblink(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kShadeson), 0);
- if (!context.flags.z())
- goto nodumpeye;
- context._cmp(context.data.byte(kBlinkcount), 0);
- if (!context.flags.z())
- goto nodumpeye;
- context.al = context.data.byte(kBlinkframe);
- context._cmp(context.al, 6);
- if (!context.flags.c())
- goto nodumpeye;
- context.push(context.ds);
- context.di = 44;
- context.bx = 32;
- context.cl = 16;
- context.ch = 12;
- multidump(context);
- context.ds = context.pop();
-nodumpeye:
- return;
-}
-
-void worktoscreenm(Context &context) {
- STACK_CHECK(context);
- animpointer(context);
- readmouse(context);
- showpointer(context);
- vsync(context);
- worktoscreen(context);
- delpointer(context);
-}
-
-void blank(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kCommandtype), 199);
- if (context.flags.z())
- goto alreadyblnk;
- context.data.byte(kCommandtype) = 199;
- context.al = 0;
- commandonly(context);
-alreadyblnk:
- return;
-}
-
-void allpointer(Context &context) {
- STACK_CHECK(context);
- readmouse(context);
- showpointer(context);
- dumppointer(context);
-}
-
-void hangonp(Context &context) {
- STACK_CHECK(context);
- context.push(context.cx);
- context._add(context.cx, context.cx);
- context.ax = context.pop();
- context._add(context.cx, context.ax);
- context.data.word(kMaintimer) = 0;
- context.al = context.data.byte(kPointerframe);
- context.ah = context.data.byte(kPickup);
- context.push(context.ax);
- context.data.byte(kPointermode) = 3;
- context.data.byte(kPickup) = 0;
- context.push(context.cx);
- context.data.byte(kCommandtype) = 255;
- readmouse(context);
- animpointer(context);
- showpointer(context);
- vsync(context);
- dumppointer(context);
- context.cx = context.pop();
+ ah = 0;
+ bx = 5888;
+ _add(bx, ax);
+ al = cs.byte(bx);
+ ds = data.word(kIcons1);
+ di = 44;
+ bx = 32;
+ ah = 0;
+ showframe();
+}
+
+void DreamGenContext::dumpblink() {
+ STACK_CHECK;
+ _cmp(data.byte(kShadeson), 0);
+ if (!flags.z())
+ return /* (nodumpeye) */;
+ _cmp(data.byte(kBlinkcount), 0);
+ if (!flags.z())
+ return /* (nodumpeye) */;
+ al = data.byte(kBlinkframe);
+ _cmp(al, 6);
+ if (!flags.c())
+ return /* (nodumpeye) */;
+ push(ds);
+ di = 44;
+ bx = 32;
+ cl = 16;
+ ch = 12;
+ multidump();
+ ds = pop();
+}
+
+void DreamGenContext::worktoscreenm() {
+ STACK_CHECK;
+ animpointer();
+ readmouse();
+ showpointer();
+ vsync();
+ worktoscreen();
+ delpointer();
+}
+
+void DreamGenContext::blank() {
+ STACK_CHECK;
+ _cmp(data.byte(kCommandtype), 199);
+ if (flags.z())
+ return /* (alreadyblnk) */;
+ data.byte(kCommandtype) = 199;
+ al = 0;
+ commandonly();
+}
+
+void DreamGenContext::allpointer() {
+ STACK_CHECK;
+ readmouse();
+ showpointer();
+ dumppointer();
+}
+
+void DreamGenContext::hangonp() {
+ STACK_CHECK;
+ push(cx);
+ _add(cx, cx);
+ ax = pop();
+ _add(cx, ax);
+ data.word(kMaintimer) = 0;
+ al = data.byte(kPointerframe);
+ ah = data.byte(kPickup);
+ push(ax);
+ data.byte(kPointermode) = 3;
+ data.byte(kPickup) = 0;
+ push(cx);
+ data.byte(kCommandtype) = 255;
+ readmouse();
+ animpointer();
+ showpointer();
+ vsync();
+ dumppointer();
+ cx = pop();
hangloop:
- context.push(context.cx);
- delpointer(context);
- readmouse(context);
- animpointer(context);
- showpointer(context);
- vsync(context);
- dumppointer(context);
- context.cx = context.pop();
- context.ax = context.data.word(kMousebutton);
- context._cmp(context.ax, 0);
- if (context.flags.z())
+ push(cx);
+ delpointer();
+ readmouse();
+ animpointer();
+ showpointer();
+ vsync();
+ dumppointer();
+ cx = pop();
+ ax = data.word(kMousebutton);
+ _cmp(ax, 0);
+ if (flags.z())
goto notpressed;
- context._cmp(context.ax, context.data.word(kOldbutton));
- if (!context.flags.z())
+ _cmp(ax, data.word(kOldbutton));
+ if (!flags.z())
goto getoutofit;
notpressed:
- if (--context.cx)
+ if (--cx)
goto hangloop;
getoutofit:
- delpointer(context);
- context.ax = context.pop();
- context.data.byte(kPointerframe) = context.al;
- context.data.byte(kPickup) = context.ah;
- context.data.byte(kPointermode) = 0;
+ delpointer();
+ ax = pop();
+ data.byte(kPointerframe) = al;
+ data.byte(kPickup) = ah;
+ data.byte(kPointermode) = 0;
}
-void hangonw(Context &context) {
- STACK_CHECK(context);
+void DreamGenContext::hangonw() {
+ STACK_CHECK;
hangloopw:
- context.push(context.cx);
- delpointer(context);
- readmouse(context);
- animpointer(context);
- showpointer(context);
- vsync(context);
- dumppointer(context);
- context.cx = context.pop();
- if (--context.cx)
+ push(cx);
+ delpointer();
+ readmouse();
+ animpointer();
+ showpointer();
+ vsync();
+ dumppointer();
+ cx = pop();
+ if (--cx)
goto hangloopw;
}
-void hangoncurs(Context &context) {
- STACK_CHECK(context);
+void DreamGenContext::hangoncurs() {
+ STACK_CHECK;
monloop1:
- context.push(context.cx);
- printcurs(context);
- vsync(context);
- delcurs(context);
- context.cx = context.pop();
- if (--context.cx)
+ push(cx);
+ printcurs();
+ vsync();
+ delcurs();
+ cx = pop();
+ if (--cx)
goto monloop1;
}
-void getunderzoom(Context &context) {
- STACK_CHECK(context);
- context.di = (8)+5;
- context.bx = (132)+4;
- context.ds = context.data.word(kBuffers);
- context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5));
- context.cl = 46;
- context.ch = 40;
- multiget(context);
-}
-
-void dumpzoom(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kZoomon), 1);
- if (!context.flags.z())
- goto notzoomon;
- context.di = (8)+5;
- context.bx = (132)+4;
- context.cl = 46;
- context.ch = 40;
- multidump(context);
-notzoomon:
- return;
-}
-
-void putunderzoom(Context &context) {
- STACK_CHECK(context);
- context.di = (8)+5;
- context.bx = (132)+4;
- context.ds = context.data.word(kBuffers);
- context.si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5));
- context.cl = 46;
- context.ch = 40;
- multiput(context);
-}
-
-void crosshair(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kCommandtype), 3);
- if (context.flags.z())
+void DreamGenContext::getunderzoom() {
+ STACK_CHECK;
+ di = (8)+5;
+ bx = (132)+4;
+ ds = data.word(kBuffers);
+ si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5));
+ cl = 46;
+ ch = 40;
+ multiget();
+}
+
+void DreamGenContext::dumpzoom() {
+ STACK_CHECK;
+ _cmp(data.byte(kZoomon), 1);
+ if (!flags.z())
+ return /* (notzoomon) */;
+ di = (8)+5;
+ bx = (132)+4;
+ cl = 46;
+ ch = 40;
+ multidump();
+}
+
+void DreamGenContext::putunderzoom() {
+ STACK_CHECK;
+ di = (8)+5;
+ bx = (132)+4;
+ ds = data.word(kBuffers);
+ si = (0+(180*10)+32+60+(32*32)+(11*10*3)+768+768+768+(32*32)+(128*5)+(80*5)+(100*5)+(12*5));
+ cl = 46;
+ ch = 40;
+ multiput();
+}
+
+void DreamGenContext::crosshair() {
+ STACK_CHECK;
+ _cmp(data.byte(kCommandtype), 3);
+ if (flags.z())
goto nocross;
- context._cmp(context.data.byte(kCommandtype), 10);
- if (!context.flags.c())
+ _cmp(data.byte(kCommandtype), 10);
+ if (!flags.c())
goto nocross;
- context.es = context.data.word(kWorkspace);
- context.ds = context.data.word(kIcons1);
- context.di = (8)+24;
- context.bx = (132)+19;
- context.al = 9;
- context.ah = 0;
- showframe(context);
+ es = data.word(kWorkspace);
+ ds = data.word(kIcons1);
+ di = (8)+24;
+ bx = (132)+19;
+ al = 9;
+ ah = 0;
+ showframe();
return;
nocross:
- context.es = context.data.word(kWorkspace);
- context.ds = context.data.word(kIcons1);
- context.di = (8)+24;
- context.bx = (132)+19;
- context.al = 29;
- context.ah = 0;
- showframe(context);
-}
-
-void showpointer(Context &context) {
- STACK_CHECK(context);
- showblink(context);
- context.di = context.data.word(kMousex);
- context.data.word(kOldpointerx) = context.di;
- context.bx = context.data.word(kMousey);
- context.data.word(kOldpointery) = context.bx;
- context._cmp(context.data.byte(kPickup), 1);
- if (context.flags.z())
+ es = data.word(kWorkspace);
+ ds = data.word(kIcons1);
+ di = (8)+24;
+ bx = (132)+19;
+ al = 29;
+ ah = 0;
+ showframe();
+}
+
+void DreamGenContext::showpointer() {
+ STACK_CHECK;
+ showblink();
+ di = data.word(kMousex);
+ data.word(kOldpointerx) = di;
+ bx = data.word(kMousey);
+ data.word(kOldpointery) = bx;
+ _cmp(data.byte(kPickup), 1);
+ if (flags.z())
goto itsanobject;
- context.push(context.bx);
- context.push(context.di);
- context.ds = context.data.word(kIcons1);
- context.al = context.data.byte(kPointerframe);
- context._add(context.al, 20);
- context.ah = 0;
- context._add(context.ax, context.ax);
- context.si = context.ax;
- context._add(context.ax, context.ax);
- context._add(context.si, context.ax);
- context.cx = context.ds.word(context.si);
- context._cmp(context.cl, 12);
- if (!context.flags.c())
+ push(bx);
+ push(di);
+ ds = data.word(kIcons1);
+ al = data.byte(kPointerframe);
+ _add(al, 20);
+ ah = 0;
+ _add(ax, ax);
+ si = ax;
+ _add(ax, ax);
+ _add(si, ax);
+ cx = ds.word(si);
+ _cmp(cl, 12);
+ if (!flags.c())
goto notsmallx;
- context.cl = 12;
+ cl = 12;
notsmallx:
- context._cmp(context.ch, 12);
- if (!context.flags.c())
+ _cmp(ch, 12);
+ if (!flags.c())
goto notsmally;
- context.ch = 12;
+ ch = 12;
notsmally:
- context.data.byte(kPointerxs) = context.cl;
- context.data.byte(kPointerys) = context.ch;
- context.push(context.ds);
- context.ds = context.data.word(kBuffers);
- context.si = (0+(180*10)+32+60);
- multiget(context);
- context.ds = context.pop();
- context.di = context.pop();
- context.bx = context.pop();
- context.push(context.di);
- context.push(context.bx);
- context.al = context.data.byte(kPointerframe);
- context._add(context.al, 20);
- context.ah = 0;
- showframe(context);
- context.bx = context.pop();
- context.di = context.pop();
+ data.byte(kPointerxs) = cl;
+ data.byte(kPointerys) = ch;
+ push(ds);
+ ds = data.word(kBuffers);
+ si = (0+(180*10)+32+60);
+ multiget();
+ ds = pop();
+ di = pop();
+ bx = pop();
+ push(di);
+ push(bx);
+ al = data.byte(kPointerframe);
+ _add(al, 20);
+ ah = 0;
+ showframe();
+ bx = pop();
+ di = pop();
return;
itsanobject:
- context.al = context.data.byte(kItemframe);
- context.ds = context.data.word(kExtras);
- context._cmp(context.data.byte(kObjecttype), 4);
- if (context.flags.z())
+ al = data.byte(kItemframe);
+ ds = data.word(kExtras);
+ _cmp(data.byte(kObjecttype), 4);
+ if (flags.z())
goto itsfrominv;
- context.ds = context.data.word(kFreeframes);
+ ds = data.word(kFreeframes);
itsfrominv:
- context.cl = context.al;
- context._add(context.al, context.al);
- context._add(context.al, context.cl);
- context._inc(context.al);
- context.ah = 0;
- context.push(context.ax);
- context._add(context.ax, context.ax);
- context.si = context.ax;
- context._add(context.ax, context.ax);
- context._add(context.si, context.ax);
- context.ax = 2080;
- context.cx = context.ds.word(context.si);
- context._cmp(context.cl, 12);
- if (!context.flags.c())
+ cl = al;
+ _add(al, al);
+ _add(al, cl);
+ _inc(al);
+ ah = 0;
+ push(ax);
+ _add(ax, ax);
+ si = ax;
+ _add(ax, ax);
+ _add(si, ax);
+ ax = 2080;
+ cx = ds.word(si);
+ _cmp(cl, 12);
+ if (!flags.c())
goto notsmallx2;
- context.cl = 12;
+ cl = 12;
notsmallx2:
- context._cmp(context.ch, 12);
- if (!context.flags.c())
+ _cmp(ch, 12);
+ if (!flags.c())
goto notsmally2;
- context.ch = 12;
+ ch = 12;
notsmally2:
- context.data.byte(kPointerxs) = context.cl;
- context.data.byte(kPointerys) = context.ch;
- context.ax = context.pop();
- context.push(context.di);
- context.push(context.bx);
- context.push(context.ax);
- context.push(context.bx);
- context.push(context.di);
- context.push(context.ds);
- context.al = context.cl;
- context.ah = 0;
- context._shr(context.ax, 1);
- context._sub(context.data.word(kOldpointerx), context.ax);
- context._sub(context.di, context.ax);
- context.al = context.ch;
- context._shr(context.ax, 1);
- context._sub(context.data.word(kOldpointery), context.ax);
- context._sub(context.bx, context.ax);
- context.ds = context.data.word(kBuffers);
- context.si = (0+(180*10)+32+60);
- multiget(context);
- context.ds = context.pop();
- context.di = context.pop();
- context.bx = context.pop();
- context.ax = context.pop();
- context.ah = 128;
- showframe(context);
- context.bx = context.pop();
- context.di = context.pop();
- context.ds = context.data.word(kIcons1);
- context.al = 3;
- context.ah = 128;
- showframe(context);
-}
-
-void delpointer(Context &context) {
- STACK_CHECK(context);
- context.ax = context.data.word(kOldpointerx);
- context._cmp(context.ax, 0x0ffff);
- if (context.flags.z())
- goto nevershown;
- context.data.word(kDelherex) = context.ax;
- context.ax = context.data.word(kOldpointery);
- context.data.word(kDelherey) = context.ax;
- context.cl = context.data.byte(kPointerxs);
- context.data.byte(kDelxs) = context.cl;
- context.ch = context.data.byte(kPointerys);
- context.data.byte(kDelys) = context.ch;
- context.ds = context.data.word(kBuffers);
- context.si = (0+(180*10)+32+60);
- context.di = context.data.word(kDelherex);
- context.bx = context.data.word(kDelherey);
- multiput(context);
-nevershown:
- return;
-}
-
-void dumppointer(Context &context) {
- STACK_CHECK(context);
- dumpblink(context);
- context.cl = context.data.byte(kDelxs);
- context.ch = context.data.byte(kDelys);
- context.di = context.data.word(kDelherex);
- context.bx = context.data.word(kDelherey);
- multidump(context);
- context.bx = context.data.word(kOldpointery);
- context.di = context.data.word(kOldpointerx);
- context._cmp(context.di, context.data.word(kDelherex));
- if (!context.flags.z())
+ data.byte(kPointerxs) = cl;
+ data.byte(kPointerys) = ch;
+ ax = pop();
+ push(di);
+ push(bx);
+ push(ax);
+ push(bx);
+ push(di);
+ push(ds);
+ al = cl;
+ ah = 0;
+ _shr(ax, 1);
+ _sub(data.word(kOldpointerx), ax);
+ _sub(di, ax);
+ al = ch;
+ _shr(ax, 1);
+ _sub(data.word(kOldpointery), ax);
+ _sub(bx, ax);
+ ds = data.word(kBuffers);
+ si = (0+(180*10)+32+60);
+ multiget();
+ ds = pop();
+ di = pop();
+ bx = pop();
+ ax = pop();
+ ah = 128;
+ showframe();
+ bx = pop();
+ di = pop();
+ ds = data.word(kIcons1);
+ al = 3;
+ ah = 128;
+ showframe();
+}
+
+void DreamGenContext::delpointer() {
+ STACK_CHECK;
+ ax = data.word(kOldpointerx);
+ _cmp(ax, 0x0ffff);
+ if (flags.z())
+ return /* (nevershown) */;
+ data.word(kDelherex) = ax;
+ ax = data.word(kOldpointery);
+ data.word(kDelherey) = ax;
+ cl = data.byte(kPointerxs);
+ data.byte(kDelxs) = cl;
+ ch = data.byte(kPointerys);
+ data.byte(kDelys) = ch;
+ ds = data.word(kBuffers);
+ si = (0+(180*10)+32+60);
+ di = data.word(kDelherex);
+ bx = data.word(kDelherey);
+ multiput();
+}
+
+void DreamGenContext::dumppointer() {
+ STACK_CHECK;
+ dumpblink();
+ cl = data.byte(kDelxs);
+ ch = data.byte(kDelys);
+ di = data.word(kDelherex);
+ bx = data.word(kDelherey);
+ multidump();
+ bx = data.word(kOldpointery);
+ di = data.word(kOldpointerx);
+ _cmp(di, data.word(kDelherex));
+ if (!flags.z())
goto difffound;
- context._cmp(context.bx, context.data.word(kDelherey));
- if (context.flags.z())
- goto notboth;
+ _cmp(bx, data.word(kDelherey));
+ if (flags.z())
+ return /* (notboth) */;
difffound:
- context.cl = context.data.byte(kPointerxs);
- context.ch = context.data.byte(kPointerys);
- multidump(context);
-notboth:
- return;
-}
-
-void undertextline(Context &context) {
- STACK_CHECK(context);
- context.di = context.data.word(kTextaddressx);
- context.bx = context.data.word(kTextaddressy);
- context.ds = context.data.word(kBuffers);
- context.si = (0);
- context.cl = (180);
- context.ch = (10);
- multiget(context);
-}
-
-void deltextline(Context &context) {
- STACK_CHECK(context);
- context.di = context.data.word(kTextaddressx);
- context.bx = context.data.word(kTextaddressy);
- context.ds = context.data.word(kBuffers);
- context.si = (0);
- context.cl = (180);
- context.ch = (10);
- multiput(context);
-}
-
-void dumptextline(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kNewtextline), 1);
- if (!context.flags.z())
- goto nodumptextline;
- context.data.byte(kNewtextline) = 0;
- context.di = context.data.word(kTextaddressx);
- context.bx = context.data.word(kTextaddressy);
- context.cl = (180);
- context.ch = (10);
- multidump(context);
-nodumptextline:
- return;
-}
-
-void animpointer(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kPointermode), 2);
- if (context.flags.z())
+ cl = data.byte(kPointerxs);
+ ch = data.byte(kPointerys);
+ multidump();
+}
+
+void DreamGenContext::undertextline() {
+ STACK_CHECK;
+ di = data.word(kTextaddressx);
+ bx = data.word(kTextaddressy);
+ ds = data.word(kBuffers);
+ si = (0);
+ cl = (180);
+ ch = (10);
+ multiget();
+}
+
+void DreamGenContext::deltextline() {
+ STACK_CHECK;
+ di = data.word(kTextaddressx);
+ bx = data.word(kTextaddressy);
+ ds = data.word(kBuffers);
+ si = (0);
+ cl = (180);
+ ch = (10);
+ multiput();
+}
+
+void DreamGenContext::dumptextline() {
+ STACK_CHECK;
+ _cmp(data.byte(kNewtextline), 1);
+ if (!flags.z())
+ return /* (nodumptextline) */;
+ data.byte(kNewtextline) = 0;
+ di = data.word(kTextaddressx);
+ bx = data.word(kTextaddressy);
+ cl = (180);
+ ch = (10);
+ multidump();
+}
+
+void DreamGenContext::animpointer() {
+ STACK_CHECK;
+ _cmp(data.byte(kPointermode), 2);
+ if (flags.z())
goto combathand;
- context._cmp(context.data.byte(kPointermode), 3);
- if (context.flags.z())
+ _cmp(data.byte(kPointermode), 3);
+ if (flags.z())
goto mousehand;
- context._cmp(context.data.word(kWatchingtime), 0);
- if (context.flags.z())
+ _cmp(data.word(kWatchingtime), 0);
+ if (flags.z())
goto notwatchpoint;
- context.data.byte(kPointerframe) = 11;
+ data.byte(kPointerframe) = 11;
return;
notwatchpoint:
- context.data.byte(kPointerframe) = 0;
- context._cmp(context.data.byte(kInmaparea), 0);
- if (context.flags.z())
- goto gothand;
- context._cmp(context.data.byte(kPointerfirstpath), 0);
- if (context.flags.z())
- goto gothand;
- getflagunderp(context);
- context._cmp(context.cl, 2);
- if (context.flags.c())
- goto gothand;
- context._cmp(context.cl, 128);
- if (!context.flags.c())
- goto gothand;
- context.data.byte(kPointerframe) = 3;
- context._test(context.cl, 4);
- if (!context.flags.z())
- goto gothand;
- context.data.byte(kPointerframe) = 4;
- context._test(context.cl, 16);
- if (!context.flags.z())
- goto gothand;
- context.data.byte(kPointerframe) = 5;
- context._test(context.cl, 2);
- if (!context.flags.z())
- goto gothand;
- context.data.byte(kPointerframe) = 6;
- context._test(context.cl, 8);
- if (!context.flags.z())
- goto gothand;
- context.data.byte(kPointerframe) = 8;
-gothand:
+ data.byte(kPointerframe) = 0;
+ _cmp(data.byte(kInmaparea), 0);
+ if (flags.z())
+ return /* (gothand) */;
+ _cmp(data.byte(kPointerfirstpath), 0);
+ if (flags.z())
+ return /* (gothand) */;
+ getflagunderp();
+ _cmp(cl, 2);
+ if (flags.c())
+ return /* (gothand) */;
+ _cmp(cl, 128);
+ if (!flags.c())
+ return /* (gothand) */;
+ data.byte(kPointerframe) = 3;
+ _test(cl, 4);
+ if (!flags.z())
+ return /* (gothand) */;
+ data.byte(kPointerframe) = 4;
+ _test(cl, 16);
+ if (!flags.z())
+ return /* (gothand) */;
+ data.byte(kPointerframe) = 5;
+ _test(cl, 2);
+ if (!flags.z())
+ return /* (gothand) */;
+ data.byte(kPointerframe) = 6;
+ _test(cl, 8);
+ if (!flags.z())
+ return /* (gothand) */;
+ data.byte(kPointerframe) = 8;
return;
mousehand:
- context._cmp(context.data.byte(kPointerspeed), 0);
- if (context.flags.z())
+ _cmp(data.byte(kPointerspeed), 0);
+ if (flags.z())
goto rightspeed3;
- context._dec(context.data.byte(kPointerspeed));
+ _dec(data.byte(kPointerspeed));
goto finflashmouse;
rightspeed3:
- context.data.byte(kPointerspeed) = 5;
- context._inc(context.data.byte(kPointercount));
- context._cmp(context.data.byte(kPointercount), 16);
- if (!context.flags.z())
+ data.byte(kPointerspeed) = 5;
+ _inc(data.byte(kPointercount));
+ _cmp(data.byte(kPointercount), 16);
+ if (!flags.z())
goto finflashmouse;
- context.data.byte(kPointercount) = 0;
+ data.byte(kPointercount) = 0;
finflashmouse:
- context.al = context.data.byte(kPointercount);
- context.ah = 0;
- context.bx = 5895;
- context._add(context.bx, context.ax);
- context.al = context.cs.byte(context.bx);
- context.data.byte(kPointerframe) = context.al;
+ al = data.byte(kPointercount);
+ ah = 0;
+ bx = 5895;
+ _add(bx, ax);
+ al = cs.byte(bx);
+ data.byte(kPointerframe) = al;
return;
combathand:
- context.data.byte(kPointerframe) = 0;
- context._cmp(context.data.byte(kReallocation), 14);
- if (!context.flags.z())
- goto notarrow;
- context._cmp(context.data.byte(kCommandtype), 211);
- if (!context.flags.z())
- goto notarrow;
- context.data.byte(kPointerframe) = 5;
-notarrow:
- return;
-}
-
-void readmouse(Context &context) {
- STACK_CHECK(context);
- context.ax = context.data.word(kMousebutton);
- context.data.word(kOldbutton) = context.ax;
- context.ax = context.data.word(kMousex);
- context.data.word(kOldx) = context.ax;
- context.ax = context.data.word(kMousey);
- context.data.word(kOldy) = context.ax;
- mousecall(context);
- context.data.word(kMousex) = context.cx;
- context.data.word(kMousey) = context.dx;
- context.data.word(kMousebutton) = context.bx;
-}
-
-void readmouse1(Context &context) {
- STACK_CHECK(context);
- context.ax = context.data.word(kMousex);
- context.data.word(kOldx) = context.ax;
- context.ax = context.data.word(kMousey);
- context.data.word(kOldy) = context.ax;
- mousecall(context);
- context.data.word(kMousex) = context.cx;
- context.data.word(kMousey) = context.dx;
- context.data.word(kMousebutton1) = context.bx;
-}
-
-void readmouse2(Context &context) {
- STACK_CHECK(context);
- context.ax = context.data.word(kMousex);
- context.data.word(kOldx) = context.ax;
- context.ax = context.data.word(kMousey);
- context.data.word(kOldy) = context.ax;
- mousecall(context);
- context.data.word(kMousex) = context.cx;
- context.data.word(kMousey) = context.dx;
- context.data.word(kMousebutton2) = context.bx;
-}
-
-void readmouse3(Context &context) {
- STACK_CHECK(context);
- context.ax = context.data.word(kMousex);
- context.data.word(kOldx) = context.ax;
- context.ax = context.data.word(kMousey);
- context.data.word(kOldy) = context.ax;
- mousecall(context);
- context.data.word(kMousex) = context.cx;
- context.data.word(kMousey) = context.dx;
- context.data.word(kMousebutton3) = context.bx;
-}
-
-void readmouse4(Context &context) {
- STACK_CHECK(context);
- context.ax = context.data.word(kMousebutton);
- context.data.word(kOldbutton) = context.ax;
- context.ax = context.data.word(kMousex);
- context.data.word(kOldx) = context.ax;
- context.ax = context.data.word(kMousey);
- context.data.word(kOldy) = context.ax;
- mousecall(context);
- context.data.word(kMousex) = context.cx;
- context.data.word(kMousey) = context.dx;
- context.ax = context.data.word(kMousebutton1);
- context._or(context.ax, context.data.word(kMousebutton2));
- context._or(context.ax, context.data.word(kMousebutton3));
- context._or(context.bx, context.ax);
- context.data.word(kMousebutton) = context.bx;
-}
-
-void readkey(Context &context) {
- STACK_CHECK(context);
- context.bx = context.data.word(kBufferout);
- context._cmp(context.bx, context.data.word(kBufferin));
- if (context.flags.z())
+ data.byte(kPointerframe) = 0;
+ _cmp(data.byte(kReallocation), 14);
+ if (!flags.z())
+ return /* (notarrow) */;
+ _cmp(data.byte(kCommandtype), 211);
+ if (!flags.z())
+ return /* (notarrow) */;
+ data.byte(kPointerframe) = 5;
+}
+
+void DreamGenContext::readmouse() {
+ STACK_CHECK;
+ ax = data.word(kMousebutton);
+ data.word(kOldbutton) = ax;
+ ax = data.word(kMousex);
+ data.word(kOldx) = ax;
+ ax = data.word(kMousey);
+ data.word(kOldy) = ax;
+ mousecall();
+ data.word(kMousex) = cx;
+ data.word(kMousey) = dx;
+ data.word(kMousebutton) = bx;
+}
+
+void DreamGenContext::readmouse1() {
+ STACK_CHECK;
+ ax = data.word(kMousex);
+ data.word(kOldx) = ax;
+ ax = data.word(kMousey);
+ data.word(kOldy) = ax;
+ mousecall();
+ data.word(kMousex) = cx;
+ data.word(kMousey) = dx;
+ data.word(kMousebutton1) = bx;
+}
+
+void DreamGenContext::readmouse2() {
+ STACK_CHECK;
+ ax = data.word(kMousex);
+ data.word(kOldx) = ax;
+ ax = data.word(kMousey);
+ data.word(kOldy) = ax;
+ mousecall();
+ data.word(kMousex) = cx;
+ data.word(kMousey) = dx;
+ data.word(kMousebutton2) = bx;
+}
+
+void DreamGenContext::readmouse3() {
+ STACK_CHECK;
+ ax = data.word(kMousex);
+ data.word(kOldx) = ax;
+ ax = data.word(kMousey);
+ data.word(kOldy) = ax;
+ mousecall();
+ data.word(kMousex) = cx;
+ data.word(kMousey) = dx;
+ data.word(kMousebutton3) = bx;
+}
+
+void DreamGenContext::readmouse4() {
+ STACK_CHECK;
+ ax = data.word(kMousebutton);
+ data.word(kOldbutton) = ax;
+ ax = data.word(kMousex);
+ data.word(kOldx) = ax;
+ ax = data.word(kMousey);
+ data.word(kOldy) = ax;
+ mousecall();
+ data.word(kMousex) = cx;
+ data.word(kMousey) = dx;
+ ax = data.word(kMousebutton1);
+ _or(ax, data.word(kMousebutton2));
+ _or(ax, data.word(kMousebutton3));
+ _or(bx, ax);
+ data.word(kMousebutton) = bx;
+}
+
+void DreamGenContext::readkey() {
+ STACK_CHECK;
+ bx = data.word(kBufferout);
+ _cmp(bx, data.word(kBufferin));
+ if (flags.z())
goto nokey;
- context._inc(context.bx);
- context._and(context.bx, 15);
- context.data.word(kBufferout) = context.bx;
- context.di = 5912;
- context._add(context.di, context.bx);
- context.al = context.cs.byte(context.di);
- context.data.byte(kCurrentkey) = context.al;
+ _inc(bx);
+ _and(bx, 15);
+ data.word(kBufferout) = bx;
+ di = 5912;
+ _add(di, bx);
+ al = cs.byte(di);
+ data.byte(kCurrentkey) = al;
return;
nokey:
- context.data.byte(kCurrentkey) = 0;
-}
-
-void convertkey(Context &context) {
- STACK_CHECK(context);
- context._and(context.al, 127);
- context.ah = 0;
- context.di = 5928;
- context._add(context.di, context.ax);
- context.al = context.cs.byte(context.di);
-}
-
-void randomnum1(Context &context) {
- STACK_CHECK(context);
- context.push(context.ds);
- context.push(context.es);
- context.push(context.di);
- context.push(context.bx);
- context.push(context.cx);
- randomnumber(context);
- context.cx = context.pop();
- context.bx = context.pop();
- context.di = context.pop();
- context.es = context.pop();
- context.ds = context.pop();
-}
-
-void randomnum2(Context &context) {
- STACK_CHECK(context);
- context.push(context.ds);
- context.push(context.es);
- context.push(context.di);
- context.push(context.bx);
- context.push(context.ax);
- randomnumber(context);
- context.cl = context.al;
- context.ax = context.pop();
- context.bx = context.pop();
- context.di = context.pop();
- context.es = context.pop();
- context.ds = context.pop();
-}
-
-void hangon(Context &context) {
- STACK_CHECK(context);
+ data.byte(kCurrentkey) = 0;
+}
+
+void DreamGenContext::randomnum1() {
+ STACK_CHECK;
+ push(ds);
+ push(es);
+ push(di);
+ push(bx);
+ push(cx);
+ randomnumber();
+ cx = pop();
+ bx = pop();
+ di = pop();
+ es = pop();
+ ds = pop();
+}
+
+void DreamGenContext::randomnum2() {
+ STACK_CHECK;
+ push(ds);
+ push(es);
+ push(di);
+ push(bx);
+ push(ax);
+ randomnumber();
+ cl = al;
+ ax = pop();
+ bx = pop();
+ di = pop();
+ es = pop();
+ ds = pop();
+}
+
+void DreamGenContext::hangon() {
+ STACK_CHECK;
hangonloop:
- context.push(context.cx);
- vsync(context);
- context.cx = context.pop();
- if (--context.cx)
+ push(cx);
+ vsync();
+ cx = pop();
+ if (--cx)
goto hangonloop;
}
-void loadtraveltext(Context &context) {
- STACK_CHECK(context);
- context.dx = 2234;
- standardload(context);
- context.data.word(kTraveltext) = context.ax;
-}
-
-void loadintotemp(Context &context) {
- STACK_CHECK(context);
- context.ds = context.cs;
- standardload(context);
- context.data.word(kTempgraphics) = context.ax;
-}
-
-void loadintotemp2(Context &context) {
- STACK_CHECK(context);
- context.ds = context.cs;
- standardload(context);
- context.data.word(kTempgraphics2) = context.ax;
-}
-
-void loadintotemp3(Context &context) {
- STACK_CHECK(context);
- context.ds = context.cs;
- standardload(context);
- context.data.word(kTempgraphics3) = context.ax;
-}
-
-void loadtempcharset(Context &context) {
- STACK_CHECK(context);
- standardload(context);
- context.data.word(kTempcharset) = context.ax;
-}
-
-void standardload(Context &context) {
- STACK_CHECK(context);
- openfile(context);
- readheader(context);
- context.bx = context.es.word(context.di);
- context.push(context.bx);
- context.cl = 4;
- context._shr(context.bx, context.cl);
- allocatemem(context);
- context.ds = context.ax;
- context.cx = context.pop();
- context.push(context.ax);
- context.dx = 0;
- readfromfile(context);
- closefile(context);
- context.ax = context.pop();
-}
-
-void loadtemptext(Context &context) {
- STACK_CHECK(context);
- standardload(context);
- context.data.word(kTextfile1) = context.ax;
-}
-
-void loadroom(Context &context) {
- STACK_CHECK(context);
- context.data.byte(kRoomloaded) = 1;
- context.data.word(kTimecount) = 0;
- context.data.word(kMaintimer) = 0;
- context.data.word(kMapoffsetx) = 104;
- context.data.word(kMapoffsety) = 38;
- context.data.word(kTextaddressx) = 13;
- context.data.word(kTextaddressy) = 182;
- context.data.byte(kTextlen) = 240;
- context.al = context.data.byte(kNewlocation);
- context.data.byte(kLocation) = context.al;
- getroomdata(context);
- startloading(context);
- loadroomssample(context);
- switchryanon(context);
- drawflags(context);
- getdimension(context);
-}
-
-void loadroomssample(Context &context) {
- STACK_CHECK(context);
- context.al = context.data.byte(kRoomssample);
- context._cmp(context.al, 255);
- if (context.flags.z())
- goto loadedalready;
- context._cmp(context.al, context.data.byte(kCurrentsample));
- if (context.flags.z())
- goto loadedalready;
- context.data.byte(kCurrentsample) = context.al;
- context.al = context.data.byte(kCurrentsample);
- context.cl = '0';
- twodigitnum(context);
- context.di = 1896;
- context._xchg(context.al, context.ah);
- context.cs.word(context.di+10) = context.ax;
- context.dx = context.di;
- loadsecondsample(context);
-loadedalready:
- return;
-}
-
-void getridofreels(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kRoomloaded), 0);
- if (context.flags.z())
- goto dontgetrid;
- context.es = context.data.word(kReel1);
- deallocatemem(context);
- context.es = context.data.word(kReel2);
- deallocatemem(context);
- context.es = context.data.word(kReel3);
- deallocatemem(context);
-dontgetrid:
- return;
-}
-
-void getridofall(Context &context) {
- STACK_CHECK(context);
- context.es = context.data.word(kBackdrop);
- deallocatemem(context);
- context.es = context.data.word(kSetframes);
- deallocatemem(context);
- context.es = context.data.word(kReel1);
- deallocatemem(context);
- context.es = context.data.word(kReel2);
- deallocatemem(context);
- context.es = context.data.word(kReel3);
- deallocatemem(context);
- context.es = context.data.word(kReels);
- deallocatemem(context);
- context.es = context.data.word(kPeople);
- deallocatemem(context);
- context.es = context.data.word(kSetdesc);
- deallocatemem(context);
- context.es = context.data.word(kBlockdesc);
- deallocatemem(context);
- context.es = context.data.word(kRoomdesc);
- deallocatemem(context);
- context.es = context.data.word(kFreeframes);
- deallocatemem(context);
- context.es = context.data.word(kFreedesc);
- deallocatemem(context);
-}
-
-void restorereels(Context &context) {
- STACK_CHECK(context);
- context._cmp(context.data.byte(kRoomloaded), 0);
- if (context.flags.z())
- goto dontrestore;
- context.al = context.data.byte(kReallocation);
- getroomdata(context);
- context.dx = context.bx;
- openfile(context);
- readheader(context);
- dontloadseg(context);
- dontloadseg(context);
- dontloadseg(context);
- dontloadseg(context);
- allocateload(context);
- context.data.word(kReel1) = context.ax;
- context.ds = context.ax;
- context.dx = 0;
- loadseg(context);
- allocateload(context);
- context.data.word(kReel2) = context.ax;
- context.ds = context.ax;
- context.dx = 0;
- loadseg(context);
- allocateload(context);
- context.data.word(kReel3) = context.ax;
- context.ds = context.ax;
- context.dx = 0;
- loadseg(context);
- closefile(context);
-dontrestore:
- return;
-}
-
-void restoreall(Context &context) {
- STACK_CHECK(context);
- context.al = context.data.byte(kLocation);
- getroomdata(context);
- context.dx = context.bx;
- openfile(context);
- readheader(context);
- allocateload(context);
- context.ds = context.ax;
- context.data.word(kBackdrop) = context.ax;
- context.dx = (0);
- loadseg(context);
- context.ds = context.data.word(kWorkspace);
- context.dx = (0);
- context.cx = 132*66;
- context.al = 0;
- fillspace(context);
- loadseg(context);
- sortoutmap(context);
- allocateload(context);
- context.data.word(kSetframes) = context.ax;
- context.ds = context.ax;
- context.dx = (0);
- loadseg(context);
- dontloadseg(context);
- allocateload(context);
- context.data.word(kReel1) = context.ax;
- context.ds = context.ax;
- context.dx = 0;
- loadseg(context);
- allocateload(context);
- context.data.word(kReel2) = context.ax;
- context.ds = context.ax;
- context.dx = 0;
- loadseg(context);
- allocateload(context);
- context.data.word(kReel3) = context.ax;
- context.ds = context.ax;
- context.dx = 0;
- loadseg(context);
- allocateload(context);
- context.data.word(kReels) = context.ax;
- context.ds = context.ax;
- context.dx = 0;
- loadseg(context);
- allocateload(context);
- context.data.word(kPeople) = context.ax;
- context.ds = context.ax;
- context.dx = 0;
- loadseg(context);
- allocateload(context);
- context.data.word(kSetdesc) = context.ax;
- context.ds = context.ax;
- context.dx = 0;
- loadseg(context);
- allocateload(context);
- context.data.word(kBlockdesc) = context.ax;
- context.ds = context.ax;
- context.dx = 0;
- loadseg(context);
- allocateload(context);
- context.data.word(kRoomdesc) = context.ax;
- context.ds = context.ax;
- context.dx = 0;
- loadseg(context);
- allocateload(context);
- context.data.word(kFreeframes) = context.ax;
- context.ds = context.ax;
- context.dx = 0;
- loadseg(context);
- dontloadseg(context);
- allocateload(context);
- context.data.word(kFreedesc) = context.ax;
- context.ds = context.ax;
- context.dx = (0);
- loadseg(context);
- closefile(context);
- setallchanges(context);
-}
-
-void sortoutmap(Context &context) {
- STACK_CHECK(context);
- context.push(context.es);
- context.push(context.di);
- context.ds = context.data.word(kWorkspace);
- context.si = 0;
- context.es = context.data.word(kMapdata);
- context.di = 0;
- context.cx = (60);
+void DreamGenContext::loadtraveltext() {
+ STACK_CHECK;
+ dx = 2234;
+ standardload();
+ data.word(kTraveltext) = ax;
+}
+
+void DreamGenContext::loadintotemp() {
+ STACK_CHECK;
+ ds = cs;
+ standardload();
+ data.word(kTempgraphics) = ax;
+}
+
+void DreamGenContext::loadintotemp2() {
+ STACK_CHECK;
+ ds = cs;
+ standardload();
+ data.word(kTempgraphics2) = ax;
+}
+
+void DreamGenContext::loadintotemp3() {
+ STACK_CHECK;
+ ds = cs;
+ standardload();
+ data.word(kTempgraphics3) = ax;
+}
+
+void DreamGenContext::loadtempcharset() {
+ STACK_CHECK;
+ standardload();
+ data.word(kTempcharset) = ax;
+}
+
+void DreamGenContext::standardload() {
+ STACK_CHECK;
+ openfile();
+ readheader();
+ bx = es.word(di);
+ push(bx);
+ cl = 4;
+ _shr(bx, cl);
+ allocatemem();
+ ds = ax;
+ cx = pop();
+ push(ax);
+ dx = 0;
+ readfromfile();
+ closefile();
+ ax = pop();
+}
+
+void DreamGenContext::loadtemptext() {
+ STACK_CHECK;
+ standardload();
+ data.word(kTextfile1) = ax;
+}
+
+void DreamGenContext::loadroom() {
+ STACK_CHECK;
+ data.byte(kRoomloaded) = 1;
+ data.word(kTimecount) = 0;
+ data.word(kMaintimer) = 0;
+ data.word(kMapoffsetx) = 104;
+ data.word(kMapoffsety) = 38;
+ data.word(kTextaddressx) = 13;
+ data.word(kTextaddressy) = 182;
+ data.byte(kTextlen) = 240;
+ al = data.byte(kNewlocation);
+ data.byte(kLocation) = al;
+ getroomdata();
+ startloading();
+ loadroomssample();
+ switchryanon();
+ drawflags();
+ getdimension();
+}
+
+void DreamGenContext::loadroomssample() {
+ STACK_CHECK;
+ al = data.byte(kRoomssample);
+ _cmp(al, 255);
+ if (flags.z())
+ return /* (loadedalready) */;
+ _cmp(al, data.byte(kCurrentsample));
+ if (flags.z())
+ return /* (loadedalready) */;
+ data.byte(kCurrentsample) = al;
+ al = data.byte(kCurrentsample);
+ cl = '0';
+ twodigitnum();
+ di = 1896;
+ _xchg(al, ah);
+ cs.word(di+10) = ax;
+ dx = di;
+ loadsecondsample();
+}
+
+void DreamGenContext::getridofreels() {
+ STACK_CHECK;
+ _cmp(data.byte(kRoomloaded), 0);
+ if (flags.z())
+ return /* (dontgetrid) */;
+ es = data.word(kReel1);
+ deallocatemem();
+ es = data.word(kReel2);
+ deallocatemem();
+ es = data.word(kReel3);
+ deallocatemem();
+}
+
+void DreamGenContext::getridofall() {
+ STACK_CHECK;
+ es = data.word(kBackdrop);
+ deallocatemem();
+ es = data.word(kSetframes);
+ deallocatemem();
+ es = data.word(kReel1);
+ deallocatemem();
+ es = data.word(kReel2);
+ deallocatemem();
+ es = data.word(kReel3);
+ deallocatemem();
+ es = data.word(kReels);
+ deallocatemem();
+ es = data.word(kPeople);
+ deallocatemem();
+ es = data.word(kSetdesc);
+ deallocatemem();
+ es = data.word(kBlockdesc);
+ deallocatemem();
+ es = data.word(kRoomdesc);
+ deallocatemem();
+ es = data.word(kFreeframes);
+ deallocatemem();
+ es = data.word(kFreedesc);
+ deallocatemem();
+}
+
+void DreamGenContext::restorereels() {
+ STACK_CHECK;
+ _cmp(data.byte(kRoomloaded), 0);
+ if (flags.z())
+ return /* (dontrestore) */;
+ al = data.byte(kReallocation);
+ getroomdata();
+ dx = bx;
+ openfile();
+ readheader();
+ dontloadseg();
+ dontloadseg();
+ dontloadseg();
+ dontloadseg();
+ allocateload();
+ data.word(kReel1) = ax;
+ ds = ax;
+ dx = 0;
+ loadseg();
+ allocateload();
+ data.word(kReel2) = ax;
+ ds = ax;
+ dx = 0;
+ loadseg();
+ allocateload();
+ data.word(kReel3) = ax;
+ ds = ax;
+ dx = 0;
+ loadseg();
+ closefile();
+}
+
+void DreamGenContext::restoreall() {
+ STACK_CHECK;
+ al = data.byte(kLocation);
+ getroomdata();
+ dx = bx;
+ openfile();
+ readheader();
+ allocateload();
+ ds = ax;
+ data.word(kBackdrop) = ax;
+ dx = (0);
+ loadseg();
+ ds = data.word(kWorkspace);
+ dx = (0);
+ cx = 132*66;
+ al = 0;
+ fillspace();
+ loadseg();
+ sortoutmap();
+ allocateload();
+ data.word(kSetframes) = ax;
+ ds = ax;
+ dx = (0);
+ loadseg();
+ dontloadseg();
+ allocateload();
+ data.word(kReel1) = ax;
+ ds = ax;
+ dx = 0;
+ loadseg();
+ allocateload();
+ data.word(kReel2) = ax;
+ ds = ax;
+ dx = 0;
+ loadseg();
+ allocateload();
+ data.word(kReel3) = ax;
+ ds = ax;
+ dx = 0;
+ loadseg();
+ allocateload();
+ data.word(kReels) = ax;
+ ds = ax;
+ dx = 0;
+ loadseg();
+ allocateload();
+ data.word(kPeople) = ax;
+ ds = ax;
+ dx = 0;
+ loadseg();
+ allocateload();
+ data.word(kSetdesc) = ax;
+ ds = ax;
+ dx = 0;
+ loadseg();
+ allocateload();
+ data.word(kBlockdesc) = ax;
+ ds = ax;
+ dx = 0;
+ loadseg();
+ allocateload();
+ data.word(kRoomdesc) = ax;
+ ds = ax;
+ dx = 0;
+ loadseg();
+ allocateload();
+ data.word(kFreeframes) = ax;
+ ds = ax;
+ dx = 0;
+ loadseg();
+ dontloadseg();
+ allocateload();
+ data.word(kFreedesc) = ax;
+ ds = ax;
+ dx = (0);
+ loadseg();
+ closefile();
+ setallchanges();
+}
+
+void DreamGenContext::sortoutmap() {
+ STACK_CHECK;
+ push(es);
+ push(di);
+ ds = data.word(kWorkspace);
+ si = 0;
+ es = data.word(kMapdata);
+ di = 0;
+ cx = (60);
blimey:
- context.push(context.cx);
- context.push(context.si);
- context.cx = (66);
- context._movsb(context.cx);
- context.si = context.pop();
- context.cx = context.pop();
- context._add(context.si, 132);
- if (--context.cx)
+ push(cx);
+ push(si);
+ cx = (66);
+ _movsb(cx, true);
+ si = pop();
+ cx = pop();
+ _add(si, 132);
+ if (--cx)
goto blimey;
- context.di = context.pop();
- context.es = context.pop();
-}
-
-void startloading(Context &context) {
- STACK_CHECK(context);
- context.data.byte(kCombatcount) = 0;
- context.al = context.cs.byte(context.bx+13);
- context.data.byte(kRoomssample) = context.al;
- context.al = context.cs.byte(context.bx+15);
- context.data.byte(kMapx) = context.al;
- context.al = context.cs.byte(context.bx+16);
- context.data.byte(kMapy) = context.al;
- context.al = context.cs.byte(context.bx+20);
- context.data.byte(kLiftflag) = context.al;
- context.al = context.cs.byte(context.bx+21);
- context.data.byte(kManspath) = context.al;
- context.data.byte(kDestination) = context.al;
- context.data.byte(kFinaldest) = context.al;
- context.al = context.cs.byte(context.bx+22);
- context.data.byte(kFacing) = context.al;
- context.data.byte(kTurntoface) = context.al;
- context.al = context.cs.byte(context.bx+23);
- context.data.byte(kCounttoopen) = context.al;
- context.al = context.cs.byte(context.bx+24);
- context.data.byte(kLiftpath) = context.al;
- context.al = context.cs.byte(context.bx+25);
- context.data.byte(kDoorpath) = context.al;
- context.data.byte(kLastweapon) = -1;
- context.al = context.cs.byte(context.bx+27);
- context.push(context.ax);
- context.al = context.cs.byte(context.bx+31);
- context.ah = context.data.byte(kReallocation);
- context.data.byte(kReallocation) = context.al;
- context.dx = context.bx;
- openfile(context);
- readheader(context);
- allocateload(context);
- context.ds = context.ax;
- context.data.word(kBackdrop) = context.ax;
- context.dx = (0);
- loadseg(context);
- context.ds = context.data.word(kWorkspace);
- context.dx = (0);
- context.cx = 132*66;
- context.al = 0;
- fillspace(context);
- loadseg(context);
- sortoutmap(context);
- allocateload(context);
- context.data.word(kSetframes) = context.ax;
- context.ds = context.ax;
- context.dx = (0);
- loadseg(context);
- context.ds = context.data.word(kSetdat);
- context.dx = 0;
- context.cx = (64*128);
- context.al = 255;
- fillspace(context);
- loadseg(context);
- allocateload(context);
- context.data.word(kReel1) = context.ax;
- context.ds = context.ax;
- context.dx = 0;
- loadseg(context);
- allocateload(context);
- context.data.word(kReel2) = context.ax;
- context.ds = context.ax;
- context.dx = 0;
- loadseg(context);
- allocateload(context);
- context.data.word(kReel3) = context.ax;
- context.ds = context.ax;
- context.dx = 0;
- loadseg(context);
- allocateload(context);
- context.data.word(kReels) = context.ax;
- context.ds = context.ax;
- context.dx = 0;
- loadseg(context);
- allocateload(context);
- context.data.word(kPeople) = context.ax;
- context.ds = context.ax;
- context.dx = 0;
- loadseg(context);
- allocateload(context);
- context.data.word(kSetdesc) = context.ax;
- context.ds = context.ax;
- context.dx = 0;
- loadseg(context);
- allocateload(context);
- context.data.word(kBlockdesc) = context.ax;
- context.ds = context.ax;
- context.dx = 0;
- loadseg(context);
- allocateload(context);
- context.data.word(kRoomdesc) = context.ax;
- context.ds = context.ax;
- context.dx = 0;
- loadseg(context);
- allocateload(context);
- context.data.word(kFreeframes) = context.ax;
- context.ds = context.ax;
- context.dx = 0;
- loadseg(context);
- context.ds = context.data.word(kFreedat);
- context.dx = 0;
- context.cx = (16*80);
- context.al = 255;
- fillspace(context);
- loadseg(context);
- allocateload(context);
- context.data.word(kFreedesc) = context.ax;
- context.ds = context.ax;
- context.dx = (0);
- loadseg(context);
- closefile(context);
- findroominloc(context);
- deletetaken(context);
- setallchanges(context);
- autoappear(context);
- context.al = context.data.byte(kNewlocation);
- getroomdata(context);
- context.data.byte(kLastweapon) = -1;
- context.data.byte(kMandead) = 0;
- context.data.word(kLookcounter) = 160;
- context.data.byte(kNewlocation) = 255;
- context.data.byte(kLinepointer) = 254;
- context.ax = context.pop();
- context._cmp(context.al, 255);
- if (context.flags.z())
+ di = pop();
+ es = pop();
+}
+
+void DreamGenContext::startloading() {
+ STACK_CHECK;
+ data.byte(kCombatcount) = 0;
+ al = cs.byte(bx+13);
+ data.byte(kRoomssample) = al;
+ al = cs.byte(bx+15);
+ data.byte(kMapx) = al;
+ al = cs.byte(bx+16);
+ data.byte(kMapy) = al;
+ al = cs.byte(bx+20);
+ data.byte(kLiftflag) = al;
+ al = cs.byte(bx+21);
+ data.byte(kManspath) = al;
+ data.byte(kDestination) = al;
+ data.byte(kFinaldest) = al;
+ al = cs.byte(bx+22);
+ data.byte(kFacing) = al;
+ data.byte(kTurntoface) = al;
+ al = cs.byte(bx+23);
+ data.byte(kCounttoopen) = al;
+ al = cs.byte(bx+24);
+ data.byte(kLiftpath) = al;
+ al = cs.byte(bx+25);
+ data.byte(kDoorpath) = al;
+ data.byte(kLastweapon) = -1;
+ al = cs.byte(bx+27);
+ push(ax);
+ al = cs.byte(bx+31);
+ ah = data.byte(kReallocation);
+ data.byte(kReallocation) = al;
+ dx = bx;
+ openfile();
+ readheader();
+ allocateload();
+ ds = ax;
+ data.word(kBackdrop) = ax;
+ dx = (0);
+ loadseg();
+ ds = data.word(kWorkspace);
+ dx = (0);
+ cx = 132*66;
+ al = 0;
+ fillspace();
+ loadseg();
+ sortoutmap();
+ allocateload();
+ data.word(kSetframes) = ax;
+ ds = ax;
+ dx = (0);
+ loadseg();
+ ds = data.word(kSetdat);
+ dx = 0;
+ cx = (64*128);
+ al = 255;
+ fillspace();
+ loadseg();
+ allocateload();
+ data.word(kReel1) = ax;
+ ds = ax;
+ dx = 0;
+ loadseg();
+ allocateload();
+ data.word(kReel2) = ax;
+ ds = ax;
+ dx = 0;
+ loadseg();
+ allocateload();
+ data.word(kReel3) = ax;
+ ds = ax;
+ dx = 0;
+ loadseg();
+ allocateload();
+ data.word(kReels) = ax;
+ ds = ax;
+ dx = 0;
+ loadseg();
+ allocateload();
+ data.word(kPeople) = ax;
+ ds = ax;
+ dx = 0;
+ loadseg();
+ allocateload();
+ data.word(kSetdesc) = ax;
+ ds = ax;
+ dx = 0;
+ loadseg();
+ allocateload();
+ data.word(kBlockdesc) = ax;
+ ds = ax;
+ dx = 0;
+ loadseg();
+ allocateload();
+ data.word(kRoomdesc) = ax;
+ ds = ax;
+ dx = 0;
+ loadseg();
+ allocateload();
+ data.word(kFreeframes) = ax;
+ ds = ax;
+ dx = 0;
+ loadseg();
+ ds = data.word(kFreedat);
+ dx = 0;
+ cx = (16*80);
+ al = 255;
+ fillspace();
+ loadseg();
+ allocateload();
+ data.word(kFreedesc) = ax;
+ ds = ax;
+ dx = (0);
+ loadseg();
+ closefile();
+ findroominloc();
+ deletetaken();
+ setallchanges();
+ autoappear();
+ al = data.byte(kNewlocation);
+ getroomdata();
+ data.byte(kLastweapon) = -1;
+ data.byte(kMandead) = 0;
+ data.word(kLookcounter) = 160;
+ data.byte(kNewlocation) = 255;
+ data.byte(kLinepointer) = 254;
+ ax = pop();
+ _cmp(al, 255);
+ if (flags.z())
goto dontwalkin;
- context.data.byte(kManspath) = context.al;
- context.push(context.bx);
- autosetwalk(context);
- context.bx = context.pop();
+ data.byte(kManspath) = al;
+ push(bx);
+ autosetwalk();
+ bx = pop();
dontwalkin:
- findxyfrompath(context);
+ findxyfrompath();
}
-void disablepath(Context &context) {
- STACK_CHECK(context);
- context.push(context.cx);
- context._xchg(context.al, context.ah);
- context.cx = -6;
+void DreamGenContext::disablepath() {
+ STACK_CHECK;
+ push(cx);
+ _xchg(al, ah);
+ cx = -6;
looky2:
- context._add(context.cx, 6);
- context._sub(context.al, 10);
- if (!context.flags.c())
+ _add(cx, 6);
+ _sub(al, 10);
+ if (!flags.c())
goto looky2;
- context.al = context.ah;
- context._dec(context.cx);
+ al = ah;
+ _dec(cx);
lookx2:
- context._inc(context.cx);
- context._sub(context.al, 11);
- if (!context.flags.c())
+ _inc(cx);
+ _sub(al, 11);
+ if (!flags.c())
goto lookx2;
- context.al = context.cl;
- context.ah = 0;
- context.cx = 144;
- context._mul(context.cx);
- context.es = context.data.word(kReels);
- context.bx = (0);
- context._add(context.bx, context.ax);
- context.ax = context.pop();
- context.ah = 0;
- context._add(context.ax, context.ax);
- context._add(context.ax, context.ax);
- context._add(context.ax, context.ax);
- context._add(context.bx, context.ax);
- context.al = 0;
- context.es.byte(context.bx+6) = context.al;
-}
-
-void findxyfrompath(Context &context) {
- STACK_CHECK(context);
- getroomspaths(context);
- context.al = context.data.byte(kManspath);
- context.ah = 0;
- context._add(context.ax, context.ax);
- context._add(context.ax, context.ax);
- context._add(context.ax, context.ax);
- context._add(context.bx, context.ax);
- context.ax = context.es.word(context.bx);
- context._sub(context.al, 12);
- context._sub(context.ah, 12);
- context.data.byte(kRyanx) = context.al;
- context.data.byte(kRyany) = context.ah;
-}
-
-void findroominloc(Context &context) {
- STACK_CHECK(context);
- context.al = context.data.byte(kMapy);
- context.cx = -6;
+ al = cl;
+ ah = 0;
+ cx = 144;
+ _mul(cx);
+ es = data.word(kReels);
+ bx = (0);
+ _add(bx, ax);
+ ax = pop();
+ ah = 0;
+ _add(ax, ax);
+ _add(ax, ax);
+ _add(ax, ax);
+ _add(bx, ax);
+ al = 0;
+ es.byte(bx+6) = al;
+}
+
+void DreamGenContext::findxyfrompath() {
+ STACK_CHECK;
+ getroomspaths();
+ al = data.byte(kManspath);
+ ah = 0;
+ _add(ax, ax);
+ _add(ax, ax);
+ _add(ax, ax);
+ _add(bx, ax);
+ ax = es.word(bx);
+ _sub(al, 12);
+ _sub(ah, 12);
+ data.byte(kRyanx) = al;
+ data.byte(kRyany) = ah;
+}
+
+void DreamGenContext::findroominloc() {
+ STACK_CHECK;
+ al = data.byte(kMapy);
+ cx = -6;
looky:
- context._add(context.cx, 6);
- context._sub(context.al, 10);
- if (!context.flags.c())
+ _add(cx, 6);
+ _sub(al, 10);
+ if (!flags.c())
goto looky;
- context.al = context.data.byte(kMapx);
- context._dec(context.cx);
+ al = data.byte(kMapx);
+ _dec(cx);
lookx:
- context._inc(context.cx);
- context._sub(context.al, 11);
- if (!context.flags.c())
+ _inc(cx);
+ _sub(al, 11);
+ if (!flags.c())
goto lookx;
- context.data.byte(kRoomnum) = context.cl;
-}
-
-void getroomdata(Context &context) {
- STACK_CHECK(context);
- context.ah = 0;
- context.cx = 32;
- context._mul(context.cx);
- context.bx = 6187;
- context._add(context.bx, context.ax);
-}
-
-void readheader(Context &context) {
- STACK_CHECK(context);
- context.ds = context.cs;
- context.dx = 6091;
- context.cx = (6187-6091);
- readfromfile(context);
- context.es = context.cs;
- context.di = 6141;
-}
-
-void allocateload(Context &context) {
- STACK_CHECK(context);
- context.push(context.es);
- context.push(context.di);
- context.bx = context.es.word(context.di);
- context.cl = 4;
- context._shr(context.bx, context.cl);
- allocatemem(context);
- context.di = context.pop();
- context.es = context.pop();
-}
-
-void fillspace(Context &context) {
- STACK_CHECK(context);
- context.push(context.es);
- context.push(context.ds);
- context.push(context.dx);
- context.push(context.di);
- context.push(context.bx);
- context.di = context.dx;
- context.es = context.ds;
- context._stosb(context.cx);
- context.bx = context.pop();
- context.di = context.pop();
- context.dx = context.pop();
- context.ds = context.pop();
- context.es = context.pop();
-}
-
-void getridoftemp(Context &context) {
- STACK_CHECK(context);
- context.es = context.data.word(kTempgraphics);
- deallocatemem(context);
-}
-
-void getridoftemptext(Context &context) {
- STACK_CHECK(context);
- context.es = context.data.word(kTextfile1);
- deallocatemem(context);
-}
-
-void getridoftemp2(Context &context) {
- STACK_CHECK(context);
- context.es = context.data.word(kTempgraphics2);
- deallocatemem(context);
-}
-
-void getridoftemp3(Context &context) {
- STACK_CHECK(context);
- context.es = context.data.word(kTempgraphics3);
- deallocatemem(context);
-}
-
-void getridoftempcharset(Context &context) {
- STACK_CHECK(context);
- context.es = context.data.word(kTempcharset);
- deallocatemem(context);
-}
-
-void getridoftempsp(Context &context) {
- STACK_CHECK(context);
- context.es = context.data.word(kTempsprites);
- deallocatemem(context);
-}
-
-void readsetdata(Context &context) {
- STACK_CHECK(context);
- context.dx = 1857;
- standardload(context);
- context.data.word(kCharset1) = context.ax;
- context.dx = 1922;
- standardload(context);
- context.data.word(kIcons1) = context.ax;
- context.dx = 1935;
- standardload(context);
- context.data.word(kIcons2) = context.ax;
- context.dx = 1819;
- standardload(context);
- context.data.word(kMainsprites) = context.ax;
- context.dx = 2221;
- standardload(context);
- context.data.word(kPuzzletext) = context.ax;
- context.dx = 2273;
- standardload(context);
- context.data.word(kCommandtext) = context.ax;
- context.ax = context.data.word(kCharset1);
- context.data.word(kCurrentset) = context.ax;
- context._cmp(context.data.byte(kSoundint), 255);
- if (context.flags.z())
- goto novolumeload;
- context.dx = 2286;
- openfile(context);
- context.cx = 2048-256;
- context.ds = context.data.word(kSoundbuffer);
- context.dx = 16384;
- readfromfile(context);
- closefile(context);
-novolumeload:
- return;
-}
-
-void makename(Context &context) {
- STACK_CHECK(context);
- context.si = context.dx;
- context.di = 6061;
+ data.byte(kRoomnum) = cl;
+}
+
+void DreamGenContext::getroomdata() {
+ STACK_CHECK;
+ ah = 0;
+ cx = 32;
+ _mul(cx);
+ bx = 6187;
+ _add(bx, ax);
+}
+
+void DreamGenContext::readheader() {
+ STACK_CHECK;
+ ds = cs;
+ dx = 6091;
+ cx = (6187-6091);
+ readfromfile();
+ es = cs;
+ di = 6141;
+}
+
+void DreamGenContext::allocateload() {
+ STACK_CHECK;
+ push(es);
+ push(di);
+ bx = es.word(di);
+ cl = 4;
+ _shr(bx, cl);
+ allocatemem();
+ di = pop();
+ es = pop();
+}
+
+void DreamGenContext::fillspace() {
+ STACK_CHECK;
+ push(es);
+ push(ds);
+ push(dx);
+ push(di);
+ push(bx);
+ di = dx;
+ es = ds;
+ _stosb(cx, true);
+ bx = pop();
+ di = pop();
+ dx = pop();
+ ds = pop();
+ es = pop();
+}
+
+void DreamGenContext::getridoftemp() {
+ STACK_CHECK;
+ es = data.word(kTempgraphics);
+ deallocatemem();
+}
+
+void DreamGenContext::getridoftemptext() {
+ STACK_CHECK;
+ es = data.word(kTextfile1);
+ deallocatemem();
+}
+
+void DreamGenContext::getridoftemp2() {
+ STACK_CHECK;
+ es = data.word(kTempgraphics2);
+ deallocatemem();
+}
+
+void DreamGenContext::getridoftemp3() {
+ STACK_CHECK;
+ es = data.word(kTempgraphics3);
+ deallocatemem();
+}
+
+void DreamGenContext::getridoftempcharset() {
+ STACK_CHECK;
+ es = data.word(kTempcharset);
+ deallocatemem();
+}
+
+void DreamGenContext::getridoftempsp() {
+ STACK_CHECK;
+ es = data.word(kTempsprites);
+ deallocatemem();
+}
+
+void DreamGenContext::readsetdata() {
+ STACK_CHECK;
+ dx = 1857;
+ standardload();
+ data.word(kCharset1) = ax;
+ dx = 1922;
+ standardload();
+ data.word(kIcons1) = ax;
+ dx = 1935;
+ standardload();
+ data.word(kIcons2) = ax;
+ dx = 1819;
+ standardload();
+ data.word(kMainsprites) = ax;
+ dx = 2221;
+ standardload();
+ data.word(kPuzzletext) = ax;
+ dx = 2273;
+ standardload();
+ data.word(kCommandtext) = ax;
+ ax = data.word(kCharset1);
+ data.word(kCurrentset) = ax;
+ _cmp(data.byte(kSoundint), 255);
+ if (flags.z())
+ return /* (novolumeload) */;
+ dx = 2286;
+ openfile();
+ cx = 2048-256;
+ ds = data.word(kSoundbuffer);
+ dx = 16384;
+ readfromfile();
+ closefile();
+}
+
+void DreamGenContext::makename() {
+ STACK_CHECK;
+ si = dx;
+ di = 6061;
transfer:
- context.al = context.cs.byte(context.si);
- context.cs.byte(context.di) = context.al;
- context._inc(context.si);
- context._inc(context.di);
- context._cmp(context.al, 0);
- if (!context.flags.z())
+ al = cs.byte(si);
+ cs.byte(di) = al;
+ _inc(si);
+ _inc(di);
+ _cmp(al, 0);
+ if (!flags.z())
goto transfer;
- context.dx = 6059;
-}
-
-void dreamweb(Context &context) {
- STACK_CHECK(context);
- seecommandtail(context);
- checkbasemem(context);
- soundstartup(context);
- setkeyboardint(context);
- setupemm(context);
- allocatebuffers(context);
- setmouse(context);
- fadedos(context);
- gettime(context);
- clearbuffers(context);
- clearpalette(context);
- set16colpalette(context);
- readsetdata(context);
- context.data.byte(kWongame) = 0;
- context.dx = 1909;
- loadsample(context);
- setsoundoff(context);
- scanfornames(context);
- context._cmp(context.al, 0);
- if (!context.flags.z())
+ dx = 6059;
+}
+
+void DreamGenContext::dreamweb() {
+ STACK_CHECK;
+ seecommandtail();
+ checkbasemem();
+ soundstartup();
+ setkeyboardint();
+ setupemm();
+ allocatebuffers();
+ setmouse();
+ fadedos();
+ gettime();
+ clearbuffers();
+ clearpalette();
+ set16colpalette();
+ readsetdata();
+ data.byte(kWongame) = 0;
+ dx = 1909;
+ loadsample();
+ setsoundoff();
+ scanfornames();
+ _cmp(al, 0);
+ if (!flags.z())
goto dodecisions;
- setmode(context);
- loadpalfromiff(context);
- titles(context);
- credits(context);
+ setmode();
+ loadpalfromiff();
+ titles();
+ credits();
goto playgame;
dodecisions:
- cls(context);
- setmode(context);
- decide(context);
- context._cmp(context.data.byte(kGetback), 4);
- if (context.flags.z())
+ cls();
+ setmode();
+ decide();
+ _cmp(data.byte(kQuitrequested), 0);
+ if (!flags.z())
+ return /* (exitgame) */;
+ _cmp(data.byte(kGetback), 4);
+ if (flags.z())
goto mainloop;
- titles(context);
- credits(context);
+ titles();
+ _cmp(data.byte(kQuitrequested), 0);
+ if (!flags.z())
+ return /* (exitgame) */;
+ credits();
playgame:
- clearchanges(context);
- setmode(context);
- loadpalfromiff(context);
- context.data.byte(kLocation) = 255;
- context.data.byte(kRoomafterdream) = 1;
- context.data.byte(kNewlocation) = 35;
- context.data.byte(kVolume) = 7;
- loadroom(context);
- clearsprites(context);
- initman(context);
- entrytexts(context);
- entryanims(context);
- context.data.byte(kDestpos) = 3;
- initialinv(context);
- context.data.byte(kLastflag) = 32;
- startup1(context);
- context.data.byte(kVolumeto) = 0;
- context.data.byte(kVolumedirection) = -1;
- context.data.byte(kCommandtype) = 255;
+ _cmp(data.byte(kQuitrequested), 0);
+ if (!flags.z())
+ return /* (exitgame) */;
+ clearchanges();
+ setmode();
+ loadpalfromiff();
+ data.byte(kLocation) = 255;
+ data.byte(kRoomafterdream) = 1;
+ data.byte(kNewlocation) = 35;
+ data.byte(kVolume) = 7;
+ loadroom();
+ clearsprites();
+ initman();
+ entrytexts();
+ entryanims();
+ data.byte(kDestpos) = 3;
+ initialinv();
+ data.byte(kLastflag) = 32;
+ startup1();
+ data.byte(kVolumeto) = 0;
+ data.byte(kVolumedirection) = -1;
+ data.byte(kCommandtype) = 255;
goto mainloop;
loadnew:
- clearbeforeload(context);
- loadroom(context);
- clearsprites(context);
- initman(context);
- entrytexts(context);
- entryanims(context);
- context.data.byte(kNewlocation) = 255;
- startup(context);
- context.data.byte(kCommandtype) = 255;
- worktoscreenm(context);
+ clearbeforeload();
+ loadroom();
+ clearsprites();
+ initman();
+ entrytexts();
+ entryanims();
+ data.byte(kNewlocation) = 255;
+ startup();
+ data.byte(kCommandtype) = 255;
+ worktoscreenm();
goto mainloop;
- context.data.byte(kNewlocation) = 255;
- clearsprites(context);
- initman(context);
- startup(context);
- context.data.byte(kCommandtype) = 255;
+ data.byte(kNewlocation) = 255;
+ clearsprites();
+ initman();
+ startup();
+ data.byte(kCommandtype) = 255;
mainloop:
- screenupdate(context);
- context._cmp(context.data.byte(kWongame), 0);
- if (!context.flags.z())
+ _cmp(data.byte(kQuitrequested), 0);
+ if (!flags.z())
+ return /* (exitgame) */;
+ screenupdate();
+ _cmp(data.byte(kWongame), 0);
+ if (!flags.z())
goto endofgame;
- context._cmp(context.data.byte(kMandead), 1);
- if (context.flags.z())
+ _cmp(data.byte(kMandead), 1);
+ if (flags.z())
goto gameover;
- context._cmp(context.data.byte(kMandead), 2);
- if (context.flags.z())
+ _cmp(data.byte(kMandead), 2);
+ if (flags.z())
goto gameover;
- context._cmp(context.data.word(kWatchingtime), 0);
- if (context.flags.z())
+ _cmp(data.word(kWatchingtime), 0);
+ if (flags.z())
goto notwatching;
- context.al = context.data.byte(kFinaldest);
- context._cmp(context.al, context.data.byte(kManspath));
- if (!context.flags.z())
+ al = data.byte(kFinaldest);
+ _cmp(al, data.byte(kManspath));
+ if (!flags.z())
goto mainloop;
- context._dec(context.data.word(kWatchingtime));
- if (!context.flags.z())
+ _dec(data.word(kWatchingtime));
+ if (!flags.z())
goto mainloop;
notwatching:
- context._cmp(context.data.byte(kMandead), 4);
- if (context.flags.z())
+ _cmp(data.byte(kMandead), 4);
+ if (flags.z())
goto gameover;
- context._cmp(context.data.byte(kNewlocation), 255);
- if (!context.flags.z())
+ _cmp(data.byte(kNewlocation), 255);
+ if (!flags.z())
goto loadnew;
goto mainloop;
gameover:
- clearbeforeload(context);
- showgun(context);
- fadescreendown(context);
- context.cx = 100;
- hangon(context);
+ clearbeforeload();
+ showgun();
+ fadescreendown();
+ cx = 100;
+ hangon();
goto dodecisions;
endofgame:
- clearbeforeload(context);
- fadescreendowns(context);
- context.cx = 200;
- hangon(context);
- endgame(context);
- { quickquit2(context); return; };
+ clearbeforeload();
+ fadescreendowns();
+ cx = 200;
+ hangon();
+ endgame();
+ { quickquit2(); return; };
}
-void __start(Context &context) {
+void DreamGenContext::__start() {
static const uint8 src[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x13, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff,
@@ -22812,757 +21988,754 @@ void __start(Context &context) {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, };
- context.ds.assign(src, src + sizeof(src));
-dreamweb(context);
+ 0x00, 0x00, 0x00, };
+ ds.assign(src, src + sizeof(src));
+dreamweb();
}
-void __dispatch_call(Context &context, unsigned addr) {
+void DreamGenContext::__dispatch_call(uint16 addr) {
switch(addr) {
- case 0xc000: alleybarksound(context); break;
- case 0xc004: intromusic(context); break;
- case 0xc008: foghornsound(context); break;
- case 0xc00c: receptionist(context); break;
- case 0xc010: smokebloke(context); break;
- case 0xc014: attendant(context); break;
- case 0xc018: manasleep(context); break;
- case 0xc01c: eden(context); break;
- case 0xc020: edeninbath(context); break;
- case 0xc024: malefan(context); break;
- case 0xc028: femalefan(context); break;
- case 0xc02c: louis(context); break;
- case 0xc030: louischair(context); break;
- case 0xc034: manasleep2(context); break;
- case 0xc038: mansatstill(context); break;
- case 0xc03c: tattooman(context); break;
- case 0xc040: drinker(context); break;
- case 0xc044: bartender(context); break;
- case 0xc048: othersmoker(context); break;
- case 0xc04c: barwoman(context); break;
- case 0xc050: interviewer(context); break;
- case 0xc054: soldier1(context); break;
- case 0xc058: rockstar(context); break;
- case 0xc05c: helicopter(context); break;
- case 0xc060: mugger(context); break;
- case 0xc064: aide(context); break;
- case 0xc068: businessman(context); break;
- case 0xc06c: poolguard(context); break;
- case 0xc070: security(context); break;
- case 0xc074: heavy(context); break;
- case 0xc078: bossman(context); break;
- case 0xc07c: gamer(context); break;
- case 0xc080: sparkydrip(context); break;
- case 0xc084: carparkdrip(context); break;
- case 0xc088: keeper(context); break;
- case 0xc08c: candles1(context); break;
- case 0xc090: smallcandle(context); break;
- case 0xc094: intromagic1(context); break;
- case 0xc098: candles(context); break;
- case 0xc09c: candles2(context); break;
- case 0xc0a0: gates(context); break;
- case 0xc0a4: intromagic2(context); break;
- case 0xc0a8: intromagic3(context); break;
- case 0xc0ac: intromonks1(context); break;
- case 0xc0b0: intromonks2(context); break;
- case 0xc0b4: handclap(context); break;
- case 0xc0b8: monks2text(context); break;
- case 0xc0bc: intro1text(context); break;
- case 0xc0c0: intro2text(context); break;
- case 0xc0c4: intro3text(context); break;
- case 0xc0c8: monkandryan(context); break;
- case 0xc0cc: endgameseq(context); break;
- case 0xc0d0: rollendcredits(context); break;
- case 0xc0d4: priest(context); break;
- case 0xc0d8: madmanstelly(context); break;
- case 0xc0dc: madman(context); break;
- case 0xc0e0: madmantext(context); break;
- case 0xc0e4: madmode(context); break;
- case 0xc0e8: priesttext(context); break;
- case 0xc0ec: textforend(context); break;
- case 0xc0f0: textformonk(context); break;
- case 0xc0f4: drunk(context); break;
- case 0xc0f8: advisor(context); break;
- case 0xc0fc: copper(context); break;
- case 0xc100: sparky(context); break;
- case 0xc104: train(context); break;
- case 0xc108: addtopeoplelist(context); break;
- case 0xc10c: showgamereel(context); break;
- case 0xc110: checkspeed(context); break;
- case 0xc114: clearsprites(context); break;
- case 0xc118: makesprite(context); break;
- case 0xc11c: delsprite(context); break;
- case 0xc120: spriteupdate(context); break;
- case 0xc124: printsprites(context); break;
- case 0xc128: printasprite(context); break;
- case 0xc12c: checkone(context); break;
- case 0xc130: findsource(context); break;
- case 0xc134: initman(context); break;
- case 0xc138: mainman(context); break;
- case 0xc13c: aboutturn(context); break;
- case 0xc140: walking(context); break;
- case 0xc144: facerightway(context); break;
- case 0xc148: checkforexit(context); break;
- case 0xc14c: adjustdown(context); break;
- case 0xc150: adjustup(context); break;
- case 0xc154: adjustleft(context); break;
- case 0xc158: adjustright(context); break;
- case 0xc15c: reminders(context); break;
- case 0xc160: initrain(context); break;
- case 0xc164: splitintolines(context); break;
- case 0xc168: getblockofpixel(context); break;
- case 0xc16c: showrain(context); break;
- case 0xc170: backobject(context); break;
- case 0xc174: liftsprite(context); break;
- case 0xc178: liftnoise(context); break;
- case 0xc17c: random(context); break;
- case 0xc180: steady(context); break;
- case 0xc184: constant(context); break;
- case 0xc188: doorway(context); break;
- case 0xc18c: widedoor(context); break;
- case 0xc190: dodoor(context); break;
- case 0xc194: lockeddoorway(context); break;
- case 0xc198: updatepeople(context); break;
- case 0xc19c: getreelframeax(context); break;
- case 0xc1a0: reelsonscreen(context); break;
- case 0xc1a4: plotreel(context); break;
- case 0xc1a8: soundonreels(context); break;
- case 0xc1ac: reconstruct(context); break;
- case 0xc1b0: dealwithspecial(context); break;
- case 0xc1b4: movemap(context); break;
- case 0xc1b8: getreelstart(context); break;
- case 0xc1bc: showreelframe(context); break;
- case 0xc1c0: deleverything(context); break;
- case 0xc1c4: dumpeverything(context); break;
- case 0xc1c8: allocatework(context); break;
- case 0xc1cc: showpcx(context); break;
- case 0xc1d0: readabyte(context); break;
- case 0xc1d4: readoneblock(context); break;
- case 0xc1d8: loadpalfromiff(context); break;
- case 0xc1dc: setmode(context); break;
- case 0xc1ec: paneltomap(context); break;
- case 0xc1f0: maptopanel(context); break;
- case 0xc1f4: dumpmap(context); break;
- case 0xc1f8: pixelcheckset(context); break;
- case 0xc1fc: createpanel(context); break;
- case 0xc200: createpanel2(context); break;
- case 0xc204: clearwork(context); break;
- case 0xc208: vsync(context); break;
- case 0xc20c: doshake(context); break;
- case 0xc210: zoom(context); break;
- case 0xc214: delthisone(context); break;
- case 0xc228: doblocks(context); break;
- case 0xc22c: showframe(context); break;
- case 0xc230: frameoutv(context); break;
- case 0xc238: frameoutbh(context); break;
- case 0xc23c: frameoutfx(context); break;
- case 0xc240: transferinv(context); break;
- case 0xc244: transfermap(context); break;
- case 0xc248: fadedos(context); break;
- case 0xc24c: dofade(context); break;
- case 0xc250: clearendpal(context); break;
- case 0xc254: clearpalette(context); break;
- case 0xc258: fadescreenup(context); break;
- case 0xc25c: fadetowhite(context); break;
- case 0xc260: fadefromwhite(context); break;
- case 0xc264: fadescreenups(context); break;
- case 0xc268: fadescreendownhalf(context); break;
- case 0xc26c: fadescreenuphalf(context); break;
- case 0xc270: fadescreendown(context); break;
- case 0xc274: fadescreendowns(context); break;
- case 0xc278: clearstartpal(context); break;
- case 0xc27c: showgun(context); break;
- case 0xc280: rollendcredits2(context); break;
- case 0xc284: rollem(context); break;
- case 0xc288: fadecalculation(context); break;
- case 0xc28c: greyscalesum(context); break;
- case 0xc290: showgroup(context); break;
- case 0xc294: paltostartpal(context); break;
- case 0xc298: endpaltostart(context); break;
- case 0xc29c: startpaltoend(context); break;
- case 0xc2a0: paltoendpal(context); break;
- case 0xc2a4: allpalette(context); break;
- case 0xc2a8: dumpcurrent(context); break;
- case 0xc2ac: fadedownmon(context); break;
- case 0xc2b0: fadeupmon(context); break;
- case 0xc2b4: fadeupmonfirst(context); break;
- case 0xc2b8: fadeupyellows(context); break;
- case 0xc2bc: initialmoncols(context); break;
- case 0xc2c0: titles(context); break;
- case 0xc2c4: endgame(context); break;
- case 0xc2c8: monkspeaking(context); break;
- case 0xc2cc: showmonk(context); break;
- case 0xc2d0: gettingshot(context); break;
- case 0xc2d4: credits(context); break;
- case 0xc2d8: biblequote(context); break;
- case 0xc2dc: hangone(context); break;
- case 0xc2e0: intro(context); break;
- case 0xc2e4: runintroseq(context); break;
- case 0xc2e8: runendseq(context); break;
- case 0xc2ec: loadintroroom(context); break;
- case 0xc2f0: mode640x480(context); break;
- case 0xc2f4: set16colpalette(context); break;
- case 0xc2f8: realcredits(context); break;
- case 0xc2fc: printchar(context); break;
- case 0xc300: kernchars(context); break;
- case 0xc304: printslow(context); break;
- case 0xc308: waitframes(context); break;
- case 0xc30c: printboth(context); break;
- case 0xc310: printdirect(context); break;
- case 0xc314: monprint(context); break;
- case 0xc318: getnumber(context); break;
- case 0xc31c: getnextword(context); break;
- case 0xc320: fillryan(context); break;
- case 0xc324: fillopen(context); break;
- case 0xc328: findallryan(context); break;
- case 0xc32c: findallopen(context); break;
- case 0xc330: obtoinv(context); break;
- case 0xc334: isitworn(context); break;
- case 0xc338: makeworn(context); break;
- case 0xc33c: examineob(context); break;
- case 0xc340: makemainscreen(context); break;
- case 0xc344: getbackfromob(context); break;
- case 0xc348: incryanpage(context); break;
- case 0xc34c: openinv(context); break;
- case 0xc350: showryanpage(context); break;
- case 0xc354: openob(context); break;
- case 0xc358: obicons(context); break;
- case 0xc35c: examicon(context); break;
- case 0xc360: obpicture(context); break;
- case 0xc364: describeob(context); break;
- case 0xc368: additionaltext(context); break;
- case 0xc36c: obsthatdothings(context); break;
- case 0xc370: getobtextstart(context); break;
- case 0xc374: searchforsame(context); break;
- case 0xc378: findnextcolon(context); break;
- case 0xc37c: inventory(context); break;
- case 0xc380: setpickup(context); break;
- case 0xc384: examinventory(context); break;
- case 0xc388: reexfrominv(context); break;
- case 0xc38c: reexfromopen(context); break;
- case 0xc390: swapwithinv(context); break;
- case 0xc394: swapwithopen(context); break;
- case 0xc398: intoinv(context); break;
- case 0xc39c: deletetaken(context); break;
- case 0xc3a0: outofinv(context); break;
- case 0xc3a4: getfreead(context); break;
- case 0xc3a8: getexad(context); break;
- case 0xc3ac: geteitherad(context); break;
- case 0xc3b0: getanyad(context); break;
- case 0xc3b4: getanyaddir(context); break;
- case 0xc3b8: getopenedsize(context); break;
- case 0xc3bc: getsetad(context); break;
- case 0xc3c0: findinvpos(context); break;
- case 0xc3c4: findopenpos(context); break;
- case 0xc3c8: dropobject(context); break;
- case 0xc3cc: droperror(context); break;
- case 0xc3d0: cantdrop(context); break;
- case 0xc3d4: wornerror(context); break;
- case 0xc3d8: removeobfrominv(context); break;
- case 0xc3dc: selectopenob(context); break;
- case 0xc3e0: useopened(context); break;
- case 0xc3e4: errormessage1(context); break;
- case 0xc3e8: errormessage2(context); break;
- case 0xc3ec: errormessage3(context); break;
- case 0xc3f0: checkobjectsize(context); break;
- case 0xc3f4: outofopen(context); break;
- case 0xc3f8: transfertoex(context); break;
- case 0xc3fc: pickupconts(context); break;
- case 0xc400: transfercontoex(context); break;
- case 0xc404: transfertext(context); break;
- case 0xc408: getexpos(context); break;
- case 0xc40c: purgealocation(context); break;
- case 0xc410: emergencypurge(context); break;
- case 0xc414: purgeanitem(context); break;
- case 0xc418: deleteexobject(context); break;
- case 0xc41c: deleteexframe(context); break;
- case 0xc420: deleteextext(context); break;
- case 0xc424: blockget(context); break;
- case 0xc428: drawfloor(context); break;
- case 0xc42c: calcmapad(context); break;
- case 0xc430: getdimension(context); break;
- case 0xc434: addalong(context); break;
- case 0xc438: addlength(context); break;
- case 0xc43c: drawflags(context); break;
- case 0xc440: eraseoldobs(context); break;
- case 0xc444: showallobs(context); break;
- case 0xc448: makebackob(context); break;
- case 0xc44c: showallfree(context); break;
- case 0xc450: showallex(context); break;
- case 0xc454: calcfrframe(context); break;
- case 0xc458: finalframe(context); break;
- case 0xc45c: adjustlen(context); break;
- case 0xc460: getmapad(context); break;
- case 0xc464: getxad(context); break;
- case 0xc468: getyad(context); break;
- case 0xc46c: autolook(context); break;
- case 0xc470: look(context); break;
- case 0xc474: dolook(context); break;
- case 0xc478: redrawmainscrn(context); break;
- case 0xc47c: getback1(context); break;
- case 0xc480: talk(context); break;
- case 0xc484: convicons(context); break;
- case 0xc488: getpersframe(context); break;
- case 0xc48c: starttalk(context); break;
- case 0xc490: getpersontext(context); break;
- case 0xc494: moretalk(context); break;
- case 0xc498: dosometalk(context); break;
- case 0xc49c: hangonpq(context); break;
- case 0xc4a0: redes(context); break;
- case 0xc4a4: newplace(context); break;
- case 0xc4a8: selectlocation(context); break;
- case 0xc4ac: showcity(context); break;
- case 0xc4b0: lookatplace(context); break;
- case 0xc4b4: getundercentre(context); break;
- case 0xc4b8: putundercentre(context); break;
- case 0xc4bc: locationpic(context); break;
- case 0xc4c0: getdestinfo(context); break;
- case 0xc4c4: showarrows(context); break;
- case 0xc4c8: nextdest(context); break;
- case 0xc4cc: lastdest(context); break;
- case 0xc4d0: destselect(context); break;
- case 0xc4d4: getlocation(context); break;
- case 0xc4d8: setlocation(context); break;
- case 0xc4dc: resetlocation(context); break;
- case 0xc4e0: readdesticon(context); break;
- case 0xc4e4: readcitypic(context); break;
- case 0xc4e8: usemon(context); break;
- case 0xc4ec: printoutermon(context); break;
- case 0xc4f0: loadpersonal(context); break;
- case 0xc4f4: loadnews(context); break;
- case 0xc4f8: loadcart(context); break;
- case 0xc4fc: lookininterface(context); break;
- case 0xc500: turnonpower(context); break;
- case 0xc504: randomaccess(context); break;
- case 0xc508: powerlighton(context); break;
- case 0xc50c: powerlightoff(context); break;
- case 0xc510: accesslighton(context); break;
- case 0xc514: accesslightoff(context); break;
- case 0xc518: locklighton(context); break;
- case 0xc51c: locklightoff(context); break;
- case 0xc520: input(context); break;
- case 0xc524: makecaps(context); break;
- case 0xc528: delchar(context); break;
- case 0xc52c: execcommand(context); break;
- case 0xc530: neterror(context); break;
- case 0xc534: dircom(context); break;
- case 0xc538: searchforfiles(context); break;
- case 0xc53c: signon(context); break;
- case 0xc540: showkeys(context); break;
- case 0xc544: read(context); break;
- case 0xc548: dirfile(context); break;
- case 0xc54c: getkeyandlogo(context); break;
- case 0xc550: searchforstring(context); break;
- case 0xc554: parser(context); break;
- case 0xc558: scrollmonitor(context); break;
- case 0xc55c: lockmon(context); break;
- case 0xc560: monitorlogo(context); break;
- case 0xc564: printlogo(context); break;
- case 0xc568: showcurrentfile(context); break;
- case 0xc56c: monmessage(context); break;
- case 0xc570: processtrigger(context); break;
- case 0xc574: triggermessage(context); break;
- case 0xc578: printcurs(context); break;
- case 0xc57c: delcurs(context); break;
- case 0xc580: useobject(context); break;
- case 0xc584: useroutine(context); break;
- case 0xc588: wheelsound(context); break;
- case 0xc58c: runtap(context); break;
- case 0xc590: playguitar(context); break;
- case 0xc594: hotelcontrol(context); break;
- case 0xc598: hotelbell(context); break;
- case 0xc59c: opentomb(context); break;
- case 0xc5a0: usetrainer(context); break;
- case 0xc5a4: nothelderror(context); break;
- case 0xc5a8: usepipe(context); break;
- case 0xc5ac: usefullcart(context); break;
- case 0xc5b0: useplinth(context); break;
- case 0xc5b4: chewy(context); break;
- case 0xc5b8: useladder(context); break;
- case 0xc5bc: useladderb(context); break;
- case 0xc5c0: slabdoora(context); break;
- case 0xc5c4: slabdoorb(context); break;
- case 0xc5c8: slabdoord(context); break;
- case 0xc5cc: slabdoorc(context); break;
- case 0xc5d0: slabdoore(context); break;
- case 0xc5d4: slabdoorf(context); break;
- case 0xc5d8: useslab(context); break;
- case 0xc5dc: usecart(context); break;
- case 0xc5e0: useclearbox(context); break;
- case 0xc5e4: usecoveredbox(context); break;
- case 0xc5e8: userailing(context); break;
- case 0xc5ec: useopenbox(context); break;
- case 0xc5f0: wearwatch(context); break;
- case 0xc5f4: wearshades(context); break;
- case 0xc5f8: sitdowninbar(context); break;
- case 0xc5fc: usechurchhole(context); break;
- case 0xc600: usehole(context); break;
- case 0xc604: usealtar(context); break;
- case 0xc608: opentvdoor(context); break;
- case 0xc60c: usedryer(context); break;
- case 0xc610: openlouis(context); break;
- case 0xc614: nextcolon(context); break;
- case 0xc618: openyourneighbour(context); break;
- case 0xc61c: usewindow(context); break;
- case 0xc620: usebalcony(context); break;
- case 0xc624: openryan(context); break;
- case 0xc628: openpoolboss(context); break;
- case 0xc62c: openeden(context); break;
- case 0xc630: opensarters(context); break;
- case 0xc634: isitright(context); break;
- case 0xc638: drawitall(context); break;
- case 0xc63c: openhoteldoor(context); break;
- case 0xc640: openhoteldoor2(context); break;
- case 0xc644: grafittidoor(context); break;
- case 0xc648: trapdoor(context); break;
- case 0xc64c: callhotellift(context); break;
- case 0xc650: calledenslift(context); break;
- case 0xc654: calledensdlift(context); break;
- case 0xc658: usepoolreader(context); break;
- case 0xc65c: uselighter(context); break;
- case 0xc660: showseconduse(context); break;
- case 0xc664: usecardreader1(context); break;
- case 0xc668: usecardreader2(context); break;
- case 0xc66c: usecardreader3(context); break;
- case 0xc670: usecashcard(context); break;
- case 0xc674: lookatcard(context); break;
- case 0xc678: moneypoke(context); break;
- case 0xc67c: usecontrol(context); break;
- case 0xc680: usehatch(context); break;
- case 0xc684: usewire(context); break;
- case 0xc688: usehandle(context); break;
- case 0xc68c: useelevator1(context); break;
- case 0xc690: showfirstuse(context); break;
- case 0xc694: useelevator3(context); break;
- case 0xc698: useelevator4(context); break;
- case 0xc69c: useelevator2(context); break;
- case 0xc6a0: useelevator5(context); break;
- case 0xc6a4: usekey(context); break;
- case 0xc6a8: usestereo(context); break;
- case 0xc6ac: usecooker(context); break;
- case 0xc6b0: useaxe(context); break;
- case 0xc6b4: useelvdoor(context); break;
- case 0xc6b8: withwhat(context); break;
- case 0xc6bc: selectob(context); break;
- case 0xc6c0: compare(context); break;
- case 0xc6c4: findsetobject(context); break;
- case 0xc6c8: findexobject(context); break;
- case 0xc6cc: isryanholding(context); break;
- case 0xc6d0: checkinside(context); break;
- case 0xc6d4: usetext(context); break;
- case 0xc6d8: putbackobstuff(context); break;
- case 0xc6dc: showpuztext(context); break;
- case 0xc6e0: findpuztext(context); break;
- case 0xc6e4: placesetobject(context); break;
- case 0xc6e8: removesetobject(context); break;
- case 0xc6ec: issetobonmap(context); break;
- case 0xc6f0: placefreeobject(context); break;
- case 0xc6f4: removefreeobject(context); break;
- case 0xc6f8: findormake(context); break;
- case 0xc6fc: switchryanon(context); break;
- case 0xc700: switchryanoff(context); break;
- case 0xc704: setallchanges(context); break;
- case 0xc708: dochange(context); break;
- case 0xc70c: autoappear(context); break;
- case 0xc710: getundertimed(context); break;
- case 0xc714: putundertimed(context); break;
- case 0xc718: dumptimedtext(context); break;
- case 0xc71c: setuptimeduse(context); break;
- case 0xc720: setuptimedtemp(context); break;
- case 0xc724: usetimedtext(context); break;
- case 0xc728: edenscdplayer(context); break;
- case 0xc72c: usewall(context); break;
- case 0xc730: usechurchgate(context); break;
- case 0xc734: usegun(context); break;
- case 0xc738: useshield(context); break;
- case 0xc73c: usebuttona(context); break;
- case 0xc740: useplate(context); break;
- case 0xc744: usewinch(context); break;
- case 0xc748: entercode(context); break;
- case 0xc74c: loadkeypad(context); break;
- case 0xc750: quitkey(context); break;
- case 0xc754: addtopresslist(context); break;
- case 0xc758: buttonone(context); break;
- case 0xc75c: buttontwo(context); break;
- case 0xc760: buttonthree(context); break;
- case 0xc764: buttonfour(context); break;
- case 0xc768: buttonfive(context); break;
- case 0xc76c: buttonsix(context); break;
- case 0xc770: buttonseven(context); break;
- case 0xc774: buttoneight(context); break;
- case 0xc778: buttonnine(context); break;
- case 0xc77c: buttonnought(context); break;
- case 0xc780: buttonenter(context); break;
- case 0xc784: buttonpress(context); break;
- case 0xc788: showouterpad(context); break;
- case 0xc78c: showkeypad(context); break;
- case 0xc790: singlekey(context); break;
- case 0xc794: dumpkeypad(context); break;
- case 0xc798: usemenu(context); break;
- case 0xc79c: dumpmenu(context); break;
- case 0xc7a0: getundermenu(context); break;
- case 0xc7a4: putundermenu(context); break;
- case 0xc7a8: showoutermenu(context); break;
- case 0xc7ac: showmenu(context); break;
- case 0xc7b0: loadmenu(context); break;
- case 0xc7b4: viewfolder(context); break;
- case 0xc7b8: nextfolder(context); break;
- case 0xc7bc: folderhints(context); break;
- case 0xc7c0: lastfolder(context); break;
- case 0xc7c4: loadfolder(context); break;
- case 0xc7c8: showfolder(context); break;
- case 0xc7cc: folderexit(context); break;
- case 0xc7d0: showleftpage(context); break;
- case 0xc7d4: showrightpage(context); break;
- case 0xc7d8: entersymbol(context); break;
- case 0xc7dc: quitsymbol(context); break;
- case 0xc7e0: settopleft(context); break;
- case 0xc7e4: settopright(context); break;
- case 0xc7e8: setbotleft(context); break;
- case 0xc7ec: setbotright(context); break;
- case 0xc7f0: dumpsymbol(context); break;
- case 0xc7f4: showsymbol(context); break;
- case 0xc7f8: nextsymbol(context); break;
- case 0xc7fc: updatesymboltop(context); break;
- case 0xc800: updatesymbolbot(context); break;
- case 0xc804: dumpsymbox(context); break;
- case 0xc808: usediary(context); break;
- case 0xc80c: showdiary(context); break;
- case 0xc810: showdiarykeys(context); break;
- case 0xc814: dumpdiarykeys(context); break;
- case 0xc818: diarykeyp(context); break;
- case 0xc81c: diarykeyn(context); break;
- case 0xc820: showdiarypage(context); break;
- case 0xc824: findtext1(context); break;
- case 0xc828: zoomonoff(context); break;
- case 0xc82c: saveload(context); break;
- case 0xc830: dosaveload(context); break;
- case 0xc834: getbackfromops(context); break;
- case 0xc838: showmainops(context); break;
- case 0xc83c: showdiscops(context); break;
- case 0xc840: loadsavebox(context); break;
- case 0xc844: loadgame(context); break;
- case 0xc848: getbacktoops(context); break;
- case 0xc84c: discops(context); break;
- case 0xc850: savegame(context); break;
- case 0xc854: actualsave(context); break;
- case 0xc858: actualload(context); break;
- case 0xc85c: selectslot2(context); break;
- case 0xc860: checkinput(context); break;
- case 0xc864: getnamepos(context); break;
- case 0xc868: showopbox(context); break;
- case 0xc86c: showloadops(context); break;
- case 0xc870: showsaveops(context); break;
- case 0xc874: selectslot(context); break;
- case 0xc878: showslots(context); break;
- case 0xc87c: shownames(context); break;
- case 0xc880: dosreturn(context); break;
- case 0xc884: error(context); break;
- case 0xc888: namestoold(context); break;
- case 0xc88c: oldtonames(context); break;
- case 0xc890: savefilewrite(context); break;
- case 0xc894: savefileread(context); break;
- case 0xc898: saveposition(context); break;
- case 0xc89c: loadposition(context); break;
- case 0xc8a0: loadseg(context); break;
- case 0xc8a4: makeheader(context); break;
- case 0xc8a8: storeit(context); break;
- case 0xc8ac: saveseg(context); break;
- case 0xc8b0: findlen(context); break;
- case 0xc8b4: scanfornames(context); break;
- case 0xc8b8: decide(context); break;
- case 0xc8bc: showdecisions(context); break;
- case 0xc8c0: newgame(context); break;
- case 0xc8c4: loadold(context); break;
- case 0xc8c8: loadspeech(context); break;
- case 0xc8cc: createname(context); break;
- case 0xc8d0: loadsample(context); break;
- case 0xc8d4: loadsecondsample(context); break;
- case 0xc8d8: soundstartup(context); break;
- case 0xc8dc: trysoundalloc(context); break;
- case 0xc8e0: setsoundoff(context); break;
- case 0xc8e4: checksoundint(context); break;
- case 0xc8e8: enablesoundint(context); break;
- case 0xc8ec: disablesoundint(context); break;
- case 0xc8f0: interupttest(context); break;
- case 0xc8f4: soundend(context); break;
- case 0xc8f8: out22c(context); break;
- case 0xc8fc: playchannel0(context); break;
- case 0xc900: playchannel1(context); break;
- case 0xc904: makenextblock(context); break;
- case 0xc908: volumeadjust(context); break;
- case 0xc90c: loopchannel0(context); break;
- case 0xc910: cancelch0(context); break;
- case 0xc914: cancelch1(context); break;
- case 0xc918: channel0only(context); break;
- case 0xc91c: channel1only(context); break;
- case 0xc920: channel0tran(context); break;
- case 0xc924: bothchannels(context); break;
- case 0xc928: saveems(context); break;
- case 0xc92c: restoreems(context); break;
- case 0xc930: domix(context); break;
- case 0xc934: dmaend(context); break;
- case 0xc938: startdmablock(context); break;
- case 0xc93c: setuppit(context); break;
- case 0xc940: getridofpit(context); break;
- case 0xc944: pitinterupt(context); break;
- case 0xc948: dreamweb(context); break;
- case 0xc94c: entrytexts(context); break;
- case 0xc950: entryanims(context); break;
- case 0xc954: initialinv(context); break;
- case 0xc958: pickupob(context); break;
- case 0xc95c: setupemm(context); break;
- case 0xc960: removeemm(context); break;
- case 0xc964: checkforemm(context); break;
- case 0xc968: checkbasemem(context); break;
- case 0xc96c: allocatebuffers(context); break;
- case 0xc970: clearbuffers(context); break;
- case 0xc974: clearchanges(context); break;
- case 0xc978: clearbeforeload(context); break;
- case 0xc97c: clearreels(context); break;
- case 0xc980: clearrest(context); break;
- case 0xc984: deallocatemem(context); break;
- case 0xc988: allocatemem(context); break;
- case 0xc990: parseblaster(context); break;
- case 0xc994: startup(context); break;
- case 0xc998: startup1(context); break;
- case 0xc99c: screenupdate(context); break;
- case 0xc9a0: watchreel(context); break;
- case 0xc9a4: checkforshake(context); break;
- case 0xc9a8: watchcount(context); break;
- case 0xc9ac: showtime(context); break;
- case 0xc9b0: dumpwatch(context); break;
- case 0xc9b4: showbyte(context); break;
- case 0xc9b8: onedigit(context); break;
- case 0xc9bc: twodigitnum(context); break;
- case 0xc9c0: showword(context); break;
- case 0xc9c4: convnum(context); break;
- case 0xc9c8: mainscreen(context); break;
- case 0xc9cc: madmanrun(context); break;
- case 0xc9d0: checkcoords(context); break;
- case 0xc9d4: identifyob(context); break;
- case 0xc9d8: checkifperson(context); break;
- case 0xc9dc: checkifset(context); break;
- case 0xc9e0: checkifex(context); break;
- case 0xc9e4: checkiffree(context); break;
- case 0xc9e8: isitdescribed(context); break;
- case 0xc9ec: findpathofpoint(context); break;
- case 0xc9f0: findfirstpath(context); break;
- case 0xc9f4: turnpathon(context); break;
- case 0xc9f8: turnpathoff(context); break;
- case 0xc9fc: turnanypathon(context); break;
- case 0xca00: turnanypathoff(context); break;
- case 0xca04: checkifpathison(context); break;
- case 0xca08: afternewroom(context); break;
- case 0xca0c: atmospheres(context); break;
- case 0xca10: walkintoroom(context); break;
- case 0xca14: afterintroroom(context); break;
- case 0xca18: obname(context); break;
- case 0xca1c: finishedwalking(context); break;
- case 0xca20: examineobtext(context); break;
- case 0xca24: commandwithob(context); break;
- case 0xca28: commandonly(context); break;
- case 0xca2c: printmessage(context); break;
- case 0xca30: printmessage2(context); break;
- case 0xca34: blocknametext(context); break;
- case 0xca38: personnametext(context); break;
- case 0xca3c: walktotext(context); break;
- case 0xca40: getflagunderp(context); break;
- case 0xca44: setwalk(context); break;
- case 0xca48: autosetwalk(context); break;
- case 0xca4c: checkdest(context); break;
- case 0xca50: bresenhams(context); break;
- case 0xca54: workoutframes(context); break;
- case 0xca58: getroomspaths(context); break;
- case 0xca5c: copyname(context); break;
- case 0xca60: findobname(context); break;
- case 0xca64: showicon(context); break;
- case 0xca68: middlepanel(context); break;
- case 0xca6c: showman(context); break;
- case 0xca70: showpanel(context); break;
- case 0xca74: roomname(context); break;
- case 0xca78: usecharset1(context); break;
- case 0xca7c: usetempcharset(context); break;
- case 0xca80: showexit(context); break;
- case 0xca84: panelicons1(context); break;
- case 0xca88: showwatch(context); break;
- case 0xca8c: gettime(context); break;
- case 0xca90: zoomicon(context); break;
- case 0xca94: showblink(context); break;
- case 0xca98: dumpblink(context); break;
- case 0xca9c: worktoscreenm(context); break;
- case 0xcaa0: blank(context); break;
- case 0xcaa4: allpointer(context); break;
- case 0xcaa8: hangonp(context); break;
- case 0xcaac: hangonw(context); break;
- case 0xcab0: hangoncurs(context); break;
- case 0xcab4: getunderzoom(context); break;
- case 0xcab8: dumpzoom(context); break;
- case 0xcabc: putunderzoom(context); break;
- case 0xcac0: crosshair(context); break;
- case 0xcac4: showpointer(context); break;
- case 0xcac8: delpointer(context); break;
- case 0xcacc: dumppointer(context); break;
- case 0xcad0: undertextline(context); break;
- case 0xcad4: deltextline(context); break;
- case 0xcad8: dumptextline(context); break;
- case 0xcadc: animpointer(context); break;
- case 0xcae0: setmouse(context); break;
- case 0xcae4: readmouse(context); break;
- case 0xcae8: mousecall(context); break;
- case 0xcaec: readmouse1(context); break;
- case 0xcaf0: readmouse2(context); break;
- case 0xcaf4: readmouse3(context); break;
- case 0xcaf8: readmouse4(context); break;
- case 0xcafc: readkey(context); break;
- case 0xcb00: convertkey(context); break;
- case 0xcb04: randomnum1(context); break;
- case 0xcb08: randomnum2(context); break;
- case 0xcb10: hangon(context); break;
- case 0xcb14: loadtraveltext(context); break;
- case 0xcb18: loadintotemp(context); break;
- case 0xcb1c: loadintotemp2(context); break;
- case 0xcb20: loadintotemp3(context); break;
- case 0xcb24: loadtempcharset(context); break;
- case 0xcb28: standardload(context); break;
- case 0xcb2c: loadtemptext(context); break;
- case 0xcb30: loadroom(context); break;
- case 0xcb34: loadroomssample(context); break;
- case 0xcb38: getridofreels(context); break;
- case 0xcb3c: getridofall(context); break;
- case 0xcb40: restorereels(context); break;
- case 0xcb44: restoreall(context); break;
- case 0xcb48: sortoutmap(context); break;
- case 0xcb4c: startloading(context); break;
- case 0xcb50: disablepath(context); break;
- case 0xcb54: findxyfrompath(context); break;
- case 0xcb58: findroominloc(context); break;
- case 0xcb5c: getroomdata(context); break;
- case 0xcb60: readheader(context); break;
- case 0xcb64: dontloadseg(context); break;
- case 0xcb68: allocateload(context); break;
- case 0xcb6c: fillspace(context); break;
- case 0xcb70: getridoftemp(context); break;
- case 0xcb74: getridoftemptext(context); break;
- case 0xcb78: getridoftemp2(context); break;
- case 0xcb7c: getridoftemp3(context); break;
- case 0xcb80: getridoftempcharset(context); break;
- case 0xcb84: getridoftempsp(context); break;
- case 0xcb88: readsetdata(context); break;
- case 0xcb8c: createfile(context); break;
- case 0xcb90: openfile(context); break;
- case 0xcb94: openfilefromc(context); break;
- case 0xcb98: makename(context); break;
- case 0xcb9c: openfilenocheck(context); break;
- case 0xcba0: openforsave(context); break;
- case 0xcba4: closefile(context); break;
- case 0xcba8: readfromfile(context); break;
- case 0xcbac: setkeyboardint(context); break;
- case 0xcbb0: resetkeyboard(context); break;
- case 0xcbb4: keyboardread(context); break;
- case 0xcbb8: walkandexamine(context); break;
- case 0xcbbc: doload(context); break;
- case 0xcbc0: generalerror(context); break;
- default: ::error("invalid call to %04x dispatched", (uint16)context.ax);
+ case 0xc000: alleybarksound(); break;
+ case 0xc004: intromusic(); break;
+ case 0xc008: foghornsound(); break;
+ case 0xc00c: receptionist(); break;
+ case 0xc010: smokebloke(); break;
+ case 0xc014: attendant(); break;
+ case 0xc018: manasleep(); break;
+ case 0xc01c: eden(); break;
+ case 0xc020: edeninbath(); break;
+ case 0xc024: malefan(); break;
+ case 0xc028: femalefan(); break;
+ case 0xc02c: louis(); break;
+ case 0xc030: louischair(); break;
+ case 0xc034: manasleep2(); break;
+ case 0xc038: mansatstill(); break;
+ case 0xc03c: tattooman(); break;
+ case 0xc040: drinker(); break;
+ case 0xc044: bartender(); break;
+ case 0xc048: othersmoker(); break;
+ case 0xc04c: barwoman(); break;
+ case 0xc050: interviewer(); break;
+ case 0xc054: soldier1(); break;
+ case 0xc058: rockstar(); break;
+ case 0xc05c: helicopter(); break;
+ case 0xc060: mugger(); break;
+ case 0xc064: aide(); break;
+ case 0xc068: businessman(); break;
+ case 0xc06c: poolguard(); break;
+ case 0xc070: security(); break;
+ case 0xc074: heavy(); break;
+ case 0xc078: bossman(); break;
+ case 0xc07c: gamer(); break;
+ case 0xc080: sparkydrip(); break;
+ case 0xc084: carparkdrip(); break;
+ case 0xc088: keeper(); break;
+ case 0xc08c: candles1(); break;
+ case 0xc090: smallcandle(); break;
+ case 0xc094: intromagic1(); break;
+ case 0xc098: candles(); break;
+ case 0xc09c: candles2(); break;
+ case 0xc0a0: gates(); break;
+ case 0xc0a4: intromagic2(); break;
+ case 0xc0a8: intromagic3(); break;
+ case 0xc0ac: intromonks1(); break;
+ case 0xc0b0: intromonks2(); break;
+ case 0xc0b4: handclap(); break;
+ case 0xc0b8: monks2text(); break;
+ case 0xc0bc: intro1text(); break;
+ case 0xc0c0: intro2text(); break;
+ case 0xc0c4: intro3text(); break;
+ case 0xc0c8: monkandryan(); break;
+ case 0xc0cc: endgameseq(); break;
+ case 0xc0d0: rollendcredits(); break;
+ case 0xc0d4: priest(); break;
+ case 0xc0d8: madmanstelly(); break;
+ case 0xc0dc: madman(); break;
+ case 0xc0e0: madmantext(); break;
+ case 0xc0e4: madmode(); break;
+ case 0xc0e8: priesttext(); break;
+ case 0xc0ec: textforend(); break;
+ case 0xc0f0: textformonk(); break;
+ case 0xc0f4: drunk(); break;
+ case 0xc0f8: advisor(); break;
+ case 0xc0fc: copper(); break;
+ case 0xc100: sparky(); break;
+ case 0xc104: train(); break;
+ case 0xc108: addtopeoplelist(); break;
+ case 0xc10c: showgamereel(); break;
+ case 0xc110: checkspeed(); break;
+ case 0xc114: clearsprites(); break;
+ case 0xc118: makesprite(); break;
+ case 0xc11c: delsprite(); break;
+ case 0xc120: spriteupdate(); break;
+ case 0xc124: printsprites(); break;
+ case 0xc128: printasprite(); break;
+ case 0xc12c: checkone(); break;
+ case 0xc130: findsource(); break;
+ case 0xc134: initman(); break;
+ case 0xc138: mainman(); break;
+ case 0xc13c: aboutturn(); break;
+ case 0xc140: walking(); break;
+ case 0xc144: facerightway(); break;
+ case 0xc148: checkforexit(); break;
+ case 0xc14c: adjustdown(); break;
+ case 0xc150: adjustup(); break;
+ case 0xc154: adjustleft(); break;
+ case 0xc158: adjustright(); break;
+ case 0xc15c: reminders(); break;
+ case 0xc160: initrain(); break;
+ case 0xc164: splitintolines(); break;
+ case 0xc168: getblockofpixel(); break;
+ case 0xc16c: showrain(); break;
+ case 0xc170: backobject(); break;
+ case 0xc174: liftsprite(); break;
+ case 0xc178: liftnoise(); break;
+ case 0xc17c: random(); break;
+ case 0xc180: steady(); break;
+ case 0xc184: constant(); break;
+ case 0xc188: doorway(); break;
+ case 0xc18c: widedoor(); break;
+ case 0xc190: dodoor(); break;
+ case 0xc194: lockeddoorway(); break;
+ case 0xc198: updatepeople(); break;
+ case 0xc19c: getreelframeax(); break;
+ case 0xc1a0: reelsonscreen(); break;
+ case 0xc1a4: plotreel(); break;
+ case 0xc1a8: soundonreels(); break;
+ case 0xc1ac: reconstruct(); break;
+ case 0xc1b0: dealwithspecial(); break;
+ case 0xc1b4: movemap(); break;
+ case 0xc1b8: getreelstart(); break;
+ case 0xc1bc: showreelframe(); break;
+ case 0xc1c0: deleverything(); break;
+ case 0xc1c4: dumpeverything(); break;
+ case 0xc1c8: allocatework(); break;
+ case 0xc1cc: showpcx(); break;
+ case 0xc1d8: loadpalfromiff(); break;
+ case 0xc1dc: setmode(); break;
+ case 0xc1ec: paneltomap(); break;
+ case 0xc1f0: maptopanel(); break;
+ case 0xc1f4: dumpmap(); break;
+ case 0xc1f8: pixelcheckset(); break;
+ case 0xc1fc: createpanel(); break;
+ case 0xc200: createpanel2(); break;
+ case 0xc204: clearwork(); break;
+ case 0xc208: vsync(); break;
+ case 0xc20c: doshake(); break;
+ case 0xc210: zoom(); break;
+ case 0xc214: delthisone(); break;
+ case 0xc228: doblocks(); break;
+ case 0xc22c: showframe(); break;
+ case 0xc230: frameoutv(); break;
+ case 0xc238: frameoutbh(); break;
+ case 0xc23c: frameoutfx(); break;
+ case 0xc240: transferinv(); break;
+ case 0xc244: transfermap(); break;
+ case 0xc248: fadedos(); break;
+ case 0xc24c: dofade(); break;
+ case 0xc250: clearendpal(); break;
+ case 0xc254: clearpalette(); break;
+ case 0xc258: fadescreenup(); break;
+ case 0xc25c: fadetowhite(); break;
+ case 0xc260: fadefromwhite(); break;
+ case 0xc264: fadescreenups(); break;
+ case 0xc268: fadescreendownhalf(); break;
+ case 0xc26c: fadescreenuphalf(); break;
+ case 0xc270: fadescreendown(); break;
+ case 0xc274: fadescreendowns(); break;
+ case 0xc278: clearstartpal(); break;
+ case 0xc27c: showgun(); break;
+ case 0xc280: rollendcredits2(); break;
+ case 0xc284: rollem(); break;
+ case 0xc288: fadecalculation(); break;
+ case 0xc28c: greyscalesum(); break;
+ case 0xc290: showgroup(); break;
+ case 0xc294: paltostartpal(); break;
+ case 0xc298: endpaltostart(); break;
+ case 0xc29c: startpaltoend(); break;
+ case 0xc2a0: paltoendpal(); break;
+ case 0xc2a4: allpalette(); break;
+ case 0xc2a8: dumpcurrent(); break;
+ case 0xc2ac: fadedownmon(); break;
+ case 0xc2b0: fadeupmon(); break;
+ case 0xc2b4: fadeupmonfirst(); break;
+ case 0xc2b8: fadeupyellows(); break;
+ case 0xc2bc: initialmoncols(); break;
+ case 0xc2c0: titles(); break;
+ case 0xc2c4: endgame(); break;
+ case 0xc2c8: monkspeaking(); break;
+ case 0xc2cc: showmonk(); break;
+ case 0xc2d0: gettingshot(); break;
+ case 0xc2d4: credits(); break;
+ case 0xc2d8: biblequote(); break;
+ case 0xc2dc: hangone(); break;
+ case 0xc2e0: intro(); break;
+ case 0xc2e4: runintroseq(); break;
+ case 0xc2e8: runendseq(); break;
+ case 0xc2ec: loadintroroom(); break;
+ case 0xc2f0: mode640x480(); break;
+ case 0xc2f4: set16colpalette(); break;
+ case 0xc2f8: realcredits(); break;
+ case 0xc2fc: printchar(); break;
+ case 0xc300: kernchars(); break;
+ case 0xc304: printslow(); break;
+ case 0xc308: waitframes(); break;
+ case 0xc30c: printboth(); break;
+ case 0xc310: printdirect(); break;
+ case 0xc314: monprint(); break;
+ case 0xc318: getnumber(); break;
+ case 0xc31c: getnextword(); break;
+ case 0xc320: fillryan(); break;
+ case 0xc324: fillopen(); break;
+ case 0xc328: findallryan(); break;
+ case 0xc32c: findallopen(); break;
+ case 0xc330: obtoinv(); break;
+ case 0xc334: isitworn(); break;
+ case 0xc338: makeworn(); break;
+ case 0xc33c: examineob(); break;
+ case 0xc340: makemainscreen(); break;
+ case 0xc344: getbackfromob(); break;
+ case 0xc348: incryanpage(); break;
+ case 0xc34c: openinv(); break;
+ case 0xc350: showryanpage(); break;
+ case 0xc354: openob(); break;
+ case 0xc358: obicons(); break;
+ case 0xc35c: examicon(); break;
+ case 0xc360: obpicture(); break;
+ case 0xc364: describeob(); break;
+ case 0xc368: additionaltext(); break;
+ case 0xc36c: obsthatdothings(); break;
+ case 0xc370: getobtextstart(); break;
+ case 0xc374: searchforsame(); break;
+ case 0xc378: findnextcolon(); break;
+ case 0xc37c: inventory(); break;
+ case 0xc380: setpickup(); break;
+ case 0xc384: examinventory(); break;
+ case 0xc388: reexfrominv(); break;
+ case 0xc38c: reexfromopen(); break;
+ case 0xc390: swapwithinv(); break;
+ case 0xc394: swapwithopen(); break;
+ case 0xc398: intoinv(); break;
+ case 0xc39c: deletetaken(); break;
+ case 0xc3a0: outofinv(); break;
+ case 0xc3a4: getfreead(); break;
+ case 0xc3a8: getexad(); break;
+ case 0xc3ac: geteitherad(); break;
+ case 0xc3b0: getanyad(); break;
+ case 0xc3b4: getanyaddir(); break;
+ case 0xc3b8: getopenedsize(); break;
+ case 0xc3bc: getsetad(); break;
+ case 0xc3c0: findinvpos(); break;
+ case 0xc3c4: findopenpos(); break;
+ case 0xc3c8: dropobject(); break;
+ case 0xc3cc: droperror(); break;
+ case 0xc3d0: cantdrop(); break;
+ case 0xc3d4: wornerror(); break;
+ case 0xc3d8: removeobfrominv(); break;
+ case 0xc3dc: selectopenob(); break;
+ case 0xc3e0: useopened(); break;
+ case 0xc3e4: errormessage1(); break;
+ case 0xc3e8: errormessage2(); break;
+ case 0xc3ec: errormessage3(); break;
+ case 0xc3f0: checkobjectsize(); break;
+ case 0xc3f4: outofopen(); break;
+ case 0xc3f8: transfertoex(); break;
+ case 0xc3fc: pickupconts(); break;
+ case 0xc400: transfercontoex(); break;
+ case 0xc404: transfertext(); break;
+ case 0xc408: getexpos(); break;
+ case 0xc40c: purgealocation(); break;
+ case 0xc410: emergencypurge(); break;
+ case 0xc414: purgeanitem(); break;
+ case 0xc418: deleteexobject(); break;
+ case 0xc41c: deleteexframe(); break;
+ case 0xc420: deleteextext(); break;
+ case 0xc424: blockget(); break;
+ case 0xc428: drawfloor(); break;
+ case 0xc42c: calcmapad(); break;
+ case 0xc430: getdimension(); break;
+ case 0xc434: addalong(); break;
+ case 0xc438: addlength(); break;
+ case 0xc43c: drawflags(); break;
+ case 0xc440: eraseoldobs(); break;
+ case 0xc444: showallobs(); break;
+ case 0xc448: makebackob(); break;
+ case 0xc44c: showallfree(); break;
+ case 0xc450: showallex(); break;
+ case 0xc454: calcfrframe(); break;
+ case 0xc458: finalframe(); break;
+ case 0xc45c: adjustlen(); break;
+ case 0xc460: getmapad(); break;
+ case 0xc464: getxad(); break;
+ case 0xc468: getyad(); break;
+ case 0xc46c: autolook(); break;
+ case 0xc470: look(); break;
+ case 0xc474: dolook(); break;
+ case 0xc478: redrawmainscrn(); break;
+ case 0xc47c: getback1(); break;
+ case 0xc480: talk(); break;
+ case 0xc484: convicons(); break;
+ case 0xc488: getpersframe(); break;
+ case 0xc48c: starttalk(); break;
+ case 0xc490: getpersontext(); break;
+ case 0xc494: moretalk(); break;
+ case 0xc498: dosometalk(); break;
+ case 0xc49c: hangonpq(); break;
+ case 0xc4a0: redes(); break;
+ case 0xc4a4: newplace(); break;
+ case 0xc4a8: selectlocation(); break;
+ case 0xc4ac: showcity(); break;
+ case 0xc4b0: lookatplace(); break;
+ case 0xc4b4: getundercentre(); break;
+ case 0xc4b8: putundercentre(); break;
+ case 0xc4bc: locationpic(); break;
+ case 0xc4c0: getdestinfo(); break;
+ case 0xc4c4: showarrows(); break;
+ case 0xc4c8: nextdest(); break;
+ case 0xc4cc: lastdest(); break;
+ case 0xc4d0: destselect(); break;
+ case 0xc4d4: getlocation(); break;
+ case 0xc4d8: setlocation(); break;
+ case 0xc4dc: resetlocation(); break;
+ case 0xc4e0: readdesticon(); break;
+ case 0xc4e4: readcitypic(); break;
+ case 0xc4e8: usemon(); break;
+ case 0xc4ec: printoutermon(); break;
+ case 0xc4f0: loadpersonal(); break;
+ case 0xc4f4: loadnews(); break;
+ case 0xc4f8: loadcart(); break;
+ case 0xc4fc: lookininterface(); break;
+ case 0xc500: turnonpower(); break;
+ case 0xc504: randomaccess(); break;
+ case 0xc508: powerlighton(); break;
+ case 0xc50c: powerlightoff(); break;
+ case 0xc510: accesslighton(); break;
+ case 0xc514: accesslightoff(); break;
+ case 0xc518: locklighton(); break;
+ case 0xc51c: locklightoff(); break;
+ case 0xc520: input(); break;
+ case 0xc524: makecaps(); break;
+ case 0xc528: delchar(); break;
+ case 0xc52c: execcommand(); break;
+ case 0xc530: neterror(); break;
+ case 0xc534: dircom(); break;
+ case 0xc538: searchforfiles(); break;
+ case 0xc53c: signon(); break;
+ case 0xc540: showkeys(); break;
+ case 0xc544: read(); break;
+ case 0xc548: dirfile(); break;
+ case 0xc54c: getkeyandlogo(); break;
+ case 0xc550: searchforstring(); break;
+ case 0xc554: parser(); break;
+ case 0xc558: scrollmonitor(); break;
+ case 0xc55c: lockmon(); break;
+ case 0xc560: monitorlogo(); break;
+ case 0xc564: printlogo(); break;
+ case 0xc568: showcurrentfile(); break;
+ case 0xc56c: monmessage(); break;
+ case 0xc570: processtrigger(); break;
+ case 0xc574: triggermessage(); break;
+ case 0xc578: printcurs(); break;
+ case 0xc57c: delcurs(); break;
+ case 0xc580: useobject(); break;
+ case 0xc584: useroutine(); break;
+ case 0xc588: wheelsound(); break;
+ case 0xc58c: runtap(); break;
+ case 0xc590: playguitar(); break;
+ case 0xc594: hotelcontrol(); break;
+ case 0xc598: hotelbell(); break;
+ case 0xc59c: opentomb(); break;
+ case 0xc5a0: usetrainer(); break;
+ case 0xc5a4: nothelderror(); break;
+ case 0xc5a8: usepipe(); break;
+ case 0xc5ac: usefullcart(); break;
+ case 0xc5b0: useplinth(); break;
+ case 0xc5b4: chewy(); break;
+ case 0xc5b8: useladder(); break;
+ case 0xc5bc: useladderb(); break;
+ case 0xc5c0: slabdoora(); break;
+ case 0xc5c4: slabdoorb(); break;
+ case 0xc5c8: slabdoord(); break;
+ case 0xc5cc: slabdoorc(); break;
+ case 0xc5d0: slabdoore(); break;
+ case 0xc5d4: slabdoorf(); break;
+ case 0xc5d8: useslab(); break;
+ case 0xc5dc: usecart(); break;
+ case 0xc5e0: useclearbox(); break;
+ case 0xc5e4: usecoveredbox(); break;
+ case 0xc5e8: userailing(); break;
+ case 0xc5ec: useopenbox(); break;
+ case 0xc5f0: wearwatch(); break;
+ case 0xc5f4: wearshades(); break;
+ case 0xc5f8: sitdowninbar(); break;
+ case 0xc5fc: usechurchhole(); break;
+ case 0xc600: usehole(); break;
+ case 0xc604: usealtar(); break;
+ case 0xc608: opentvdoor(); break;
+ case 0xc60c: usedryer(); break;
+ case 0xc610: openlouis(); break;
+ case 0xc614: nextcolon(); break;
+ case 0xc618: openyourneighbour(); break;
+ case 0xc61c: usewindow(); break;
+ case 0xc620: usebalcony(); break;
+ case 0xc624: openryan(); break;
+ case 0xc628: openpoolboss(); break;
+ case 0xc62c: openeden(); break;
+ case 0xc630: opensarters(); break;
+ case 0xc634: isitright(); break;
+ case 0xc638: drawitall(); break;
+ case 0xc63c: openhoteldoor(); break;
+ case 0xc640: openhoteldoor2(); break;
+ case 0xc644: grafittidoor(); break;
+ case 0xc648: trapdoor(); break;
+ case 0xc64c: callhotellift(); break;
+ case 0xc650: calledenslift(); break;
+ case 0xc654: calledensdlift(); break;
+ case 0xc658: usepoolreader(); break;
+ case 0xc65c: uselighter(); break;
+ case 0xc660: showseconduse(); break;
+ case 0xc664: usecardreader1(); break;
+ case 0xc668: usecardreader2(); break;
+ case 0xc66c: usecardreader3(); break;
+ case 0xc670: usecashcard(); break;
+ case 0xc674: lookatcard(); break;
+ case 0xc678: moneypoke(); break;
+ case 0xc67c: usecontrol(); break;
+ case 0xc680: usehatch(); break;
+ case 0xc684: usewire(); break;
+ case 0xc688: usehandle(); break;
+ case 0xc68c: useelevator1(); break;
+ case 0xc690: showfirstuse(); break;
+ case 0xc694: useelevator3(); break;
+ case 0xc698: useelevator4(); break;
+ case 0xc69c: useelevator2(); break;
+ case 0xc6a0: useelevator5(); break;
+ case 0xc6a4: usekey(); break;
+ case 0xc6a8: usestereo(); break;
+ case 0xc6ac: usecooker(); break;
+ case 0xc6b0: useaxe(); break;
+ case 0xc6b4: useelvdoor(); break;
+ case 0xc6b8: withwhat(); break;
+ case 0xc6bc: selectob(); break;
+ case 0xc6c0: compare(); break;
+ case 0xc6c4: findsetobject(); break;
+ case 0xc6c8: findexobject(); break;
+ case 0xc6cc: isryanholding(); break;
+ case 0xc6d0: checkinside(); break;
+ case 0xc6d4: usetext(); break;
+ case 0xc6d8: putbackobstuff(); break;
+ case 0xc6dc: showpuztext(); break;
+ case 0xc6e0: findpuztext(); break;
+ case 0xc6e4: placesetobject(); break;
+ case 0xc6e8: removesetobject(); break;
+ case 0xc6ec: issetobonmap(); break;
+ case 0xc6f0: placefreeobject(); break;
+ case 0xc6f4: removefreeobject(); break;
+ case 0xc6f8: findormake(); break;
+ case 0xc6fc: switchryanon(); break;
+ case 0xc700: switchryanoff(); break;
+ case 0xc704: setallchanges(); break;
+ case 0xc708: dochange(); break;
+ case 0xc70c: autoappear(); break;
+ case 0xc710: getundertimed(); break;
+ case 0xc714: putundertimed(); break;
+ case 0xc718: dumptimedtext(); break;
+ case 0xc71c: setuptimeduse(); break;
+ case 0xc720: setuptimedtemp(); break;
+ case 0xc724: usetimedtext(); break;
+ case 0xc728: edenscdplayer(); break;
+ case 0xc72c: usewall(); break;
+ case 0xc730: usechurchgate(); break;
+ case 0xc734: usegun(); break;
+ case 0xc738: useshield(); break;
+ case 0xc73c: usebuttona(); break;
+ case 0xc740: useplate(); break;
+ case 0xc744: usewinch(); break;
+ case 0xc748: entercode(); break;
+ case 0xc74c: loadkeypad(); break;
+ case 0xc750: quitkey(); break;
+ case 0xc754: addtopresslist(); break;
+ case 0xc758: buttonone(); break;
+ case 0xc75c: buttontwo(); break;
+ case 0xc760: buttonthree(); break;
+ case 0xc764: buttonfour(); break;
+ case 0xc768: buttonfive(); break;
+ case 0xc76c: buttonsix(); break;
+ case 0xc770: buttonseven(); break;
+ case 0xc774: buttoneight(); break;
+ case 0xc778: buttonnine(); break;
+ case 0xc77c: buttonnought(); break;
+ case 0xc780: buttonenter(); break;
+ case 0xc784: buttonpress(); break;
+ case 0xc788: showouterpad(); break;
+ case 0xc78c: showkeypad(); break;
+ case 0xc790: singlekey(); break;
+ case 0xc794: dumpkeypad(); break;
+ case 0xc798: usemenu(); break;
+ case 0xc79c: dumpmenu(); break;
+ case 0xc7a0: getundermenu(); break;
+ case 0xc7a4: putundermenu(); break;
+ case 0xc7a8: showoutermenu(); break;
+ case 0xc7ac: showmenu(); break;
+ case 0xc7b0: loadmenu(); break;
+ case 0xc7b4: viewfolder(); break;
+ case 0xc7b8: nextfolder(); break;
+ case 0xc7bc: folderhints(); break;
+ case 0xc7c0: lastfolder(); break;
+ case 0xc7c4: loadfolder(); break;
+ case 0xc7c8: showfolder(); break;
+ case 0xc7cc: folderexit(); break;
+ case 0xc7d0: showleftpage(); break;
+ case 0xc7d4: showrightpage(); break;
+ case 0xc7d8: entersymbol(); break;
+ case 0xc7dc: quitsymbol(); break;
+ case 0xc7e0: settopleft(); break;
+ case 0xc7e4: settopright(); break;
+ case 0xc7e8: setbotleft(); break;
+ case 0xc7ec: setbotright(); break;
+ case 0xc7f0: dumpsymbol(); break;
+ case 0xc7f4: showsymbol(); break;
+ case 0xc7f8: nextsymbol(); break;
+ case 0xc7fc: updatesymboltop(); break;
+ case 0xc800: updatesymbolbot(); break;
+ case 0xc804: dumpsymbox(); break;
+ case 0xc808: usediary(); break;
+ case 0xc80c: showdiary(); break;
+ case 0xc810: showdiarykeys(); break;
+ case 0xc814: dumpdiarykeys(); break;
+ case 0xc818: diarykeyp(); break;
+ case 0xc81c: diarykeyn(); break;
+ case 0xc820: showdiarypage(); break;
+ case 0xc824: findtext1(); break;
+ case 0xc828: zoomonoff(); break;
+ case 0xc82c: saveload(); break;
+ case 0xc830: dosaveload(); break;
+ case 0xc834: getbackfromops(); break;
+ case 0xc838: showmainops(); break;
+ case 0xc83c: showdiscops(); break;
+ case 0xc840: loadsavebox(); break;
+ case 0xc844: loadgame(); break;
+ case 0xc848: getbacktoops(); break;
+ case 0xc84c: discops(); break;
+ case 0xc850: savegame(); break;
+ case 0xc854: actualsave(); break;
+ case 0xc858: actualload(); break;
+ case 0xc85c: selectslot2(); break;
+ case 0xc860: checkinput(); break;
+ case 0xc864: getnamepos(); break;
+ case 0xc868: showopbox(); break;
+ case 0xc86c: showloadops(); break;
+ case 0xc870: showsaveops(); break;
+ case 0xc874: selectslot(); break;
+ case 0xc878: showslots(); break;
+ case 0xc87c: shownames(); break;
+ case 0xc880: dosreturn(); break;
+ case 0xc884: error(); break;
+ case 0xc888: namestoold(); break;
+ case 0xc88c: oldtonames(); break;
+ case 0xc890: savefilewrite(); break;
+ case 0xc894: savefileread(); break;
+ case 0xc898: saveposition(); break;
+ case 0xc89c: loadposition(); break;
+ case 0xc8a0: loadseg(); break;
+ case 0xc8a4: makeheader(); break;
+ case 0xc8a8: storeit(); break;
+ case 0xc8ac: saveseg(); break;
+ case 0xc8b0: findlen(); break;
+ case 0xc8b4: scanfornames(); break;
+ case 0xc8b8: decide(); break;
+ case 0xc8bc: showdecisions(); break;
+ case 0xc8c0: newgame(); break;
+ case 0xc8c4: loadold(); break;
+ case 0xc8c8: loadspeech(); break;
+ case 0xc8cc: createname(); break;
+ case 0xc8d0: loadsample(); break;
+ case 0xc8d4: loadsecondsample(); break;
+ case 0xc8d8: soundstartup(); break;
+ case 0xc8dc: trysoundalloc(); break;
+ case 0xc8e0: setsoundoff(); break;
+ case 0xc8e4: checksoundint(); break;
+ case 0xc8e8: enablesoundint(); break;
+ case 0xc8ec: disablesoundint(); break;
+ case 0xc8f0: interupttest(); break;
+ case 0xc8f4: soundend(); break;
+ case 0xc8f8: out22c(); break;
+ case 0xc8fc: playchannel0(); break;
+ case 0xc900: playchannel1(); break;
+ case 0xc904: makenextblock(); break;
+ case 0xc908: volumeadjust(); break;
+ case 0xc90c: loopchannel0(); break;
+ case 0xc910: cancelch0(); break;
+ case 0xc914: cancelch1(); break;
+ case 0xc918: channel0only(); break;
+ case 0xc91c: channel1only(); break;
+ case 0xc920: channel0tran(); break;
+ case 0xc924: bothchannels(); break;
+ case 0xc928: saveems(); break;
+ case 0xc92c: restoreems(); break;
+ case 0xc930: domix(); break;
+ case 0xc934: dmaend(); break;
+ case 0xc938: startdmablock(); break;
+ case 0xc93c: setuppit(); break;
+ case 0xc940: getridofpit(); break;
+ case 0xc944: pitinterupt(); break;
+ case 0xc948: dreamweb(); break;
+ case 0xc94c: entrytexts(); break;
+ case 0xc950: entryanims(); break;
+ case 0xc954: initialinv(); break;
+ case 0xc958: pickupob(); break;
+ case 0xc95c: setupemm(); break;
+ case 0xc960: removeemm(); break;
+ case 0xc964: checkforemm(); break;
+ case 0xc968: checkbasemem(); break;
+ case 0xc96c: allocatebuffers(); break;
+ case 0xc970: clearbuffers(); break;
+ case 0xc974: clearchanges(); break;
+ case 0xc978: clearbeforeload(); break;
+ case 0xc97c: clearreels(); break;
+ case 0xc980: clearrest(); break;
+ case 0xc984: deallocatemem(); break;
+ case 0xc988: allocatemem(); break;
+ case 0xc990: parseblaster(); break;
+ case 0xc994: startup(); break;
+ case 0xc998: startup1(); break;
+ case 0xc99c: screenupdate(); break;
+ case 0xc9a0: watchreel(); break;
+ case 0xc9a4: checkforshake(); break;
+ case 0xc9a8: watchcount(); break;
+ case 0xc9ac: showtime(); break;
+ case 0xc9b0: dumpwatch(); break;
+ case 0xc9b4: showbyte(); break;
+ case 0xc9b8: onedigit(); break;
+ case 0xc9bc: twodigitnum(); break;
+ case 0xc9c0: showword(); break;
+ case 0xc9c4: convnum(); break;
+ case 0xc9c8: mainscreen(); break;
+ case 0xc9cc: madmanrun(); break;
+ case 0xc9d0: checkcoords(); break;
+ case 0xc9d4: identifyob(); break;
+ case 0xc9d8: checkifperson(); break;
+ case 0xc9dc: checkifset(); break;
+ case 0xc9e0: checkifex(); break;
+ case 0xc9e4: checkiffree(); break;
+ case 0xc9e8: isitdescribed(); break;
+ case 0xc9ec: findpathofpoint(); break;
+ case 0xc9f0: findfirstpath(); break;
+ case 0xc9f4: turnpathon(); break;
+ case 0xc9f8: turnpathoff(); break;
+ case 0xc9fc: turnanypathon(); break;
+ case 0xca00: turnanypathoff(); break;
+ case 0xca04: checkifpathison(); break;
+ case 0xca08: afternewroom(); break;
+ case 0xca0c: atmospheres(); break;
+ case 0xca10: walkintoroom(); break;
+ case 0xca14: afterintroroom(); break;
+ case 0xca18: obname(); break;
+ case 0xca1c: finishedwalking(); break;
+ case 0xca20: examineobtext(); break;
+ case 0xca24: commandwithob(); break;
+ case 0xca28: commandonly(); break;
+ case 0xca2c: printmessage(); break;
+ case 0xca30: printmessage2(); break;
+ case 0xca34: blocknametext(); break;
+ case 0xca38: personnametext(); break;
+ case 0xca3c: walktotext(); break;
+ case 0xca40: getflagunderp(); break;
+ case 0xca44: setwalk(); break;
+ case 0xca48: autosetwalk(); break;
+ case 0xca4c: checkdest(); break;
+ case 0xca50: bresenhams(); break;
+ case 0xca54: workoutframes(); break;
+ case 0xca58: getroomspaths(); break;
+ case 0xca5c: copyname(); break;
+ case 0xca60: findobname(); break;
+ case 0xca64: showicon(); break;
+ case 0xca68: middlepanel(); break;
+ case 0xca6c: showman(); break;
+ case 0xca70: showpanel(); break;
+ case 0xca74: roomname(); break;
+ case 0xca78: usecharset1(); break;
+ case 0xca7c: usetempcharset(); break;
+ case 0xca80: showexit(); break;
+ case 0xca84: panelicons1(); break;
+ case 0xca88: showwatch(); break;
+ case 0xca8c: gettime(); break;
+ case 0xca90: zoomicon(); break;
+ case 0xca94: showblink(); break;
+ case 0xca98: dumpblink(); break;
+ case 0xca9c: worktoscreenm(); break;
+ case 0xcaa0: blank(); break;
+ case 0xcaa4: allpointer(); break;
+ case 0xcaa8: hangonp(); break;
+ case 0xcaac: hangonw(); break;
+ case 0xcab0: hangoncurs(); break;
+ case 0xcab4: getunderzoom(); break;
+ case 0xcab8: dumpzoom(); break;
+ case 0xcabc: putunderzoom(); break;
+ case 0xcac0: crosshair(); break;
+ case 0xcac4: showpointer(); break;
+ case 0xcac8: delpointer(); break;
+ case 0xcacc: dumppointer(); break;
+ case 0xcad0: undertextline(); break;
+ case 0xcad4: deltextline(); break;
+ case 0xcad8: dumptextline(); break;
+ case 0xcadc: animpointer(); break;
+ case 0xcae0: setmouse(); break;
+ case 0xcae4: readmouse(); break;
+ case 0xcae8: mousecall(); break;
+ case 0xcaec: readmouse1(); break;
+ case 0xcaf0: readmouse2(); break;
+ case 0xcaf4: readmouse3(); break;
+ case 0xcaf8: readmouse4(); break;
+ case 0xcafc: readkey(); break;
+ case 0xcb04: randomnum1(); break;
+ case 0xcb08: randomnum2(); break;
+ case 0xcb10: hangon(); break;
+ case 0xcb14: loadtraveltext(); break;
+ case 0xcb18: loadintotemp(); break;
+ case 0xcb1c: loadintotemp2(); break;
+ case 0xcb20: loadintotemp3(); break;
+ case 0xcb24: loadtempcharset(); break;
+ case 0xcb28: standardload(); break;
+ case 0xcb2c: loadtemptext(); break;
+ case 0xcb30: loadroom(); break;
+ case 0xcb34: loadroomssample(); break;
+ case 0xcb38: getridofreels(); break;
+ case 0xcb3c: getridofall(); break;
+ case 0xcb40: restorereels(); break;
+ case 0xcb44: restoreall(); break;
+ case 0xcb48: sortoutmap(); break;
+ case 0xcb4c: startloading(); break;
+ case 0xcb50: disablepath(); break;
+ case 0xcb54: findxyfrompath(); break;
+ case 0xcb58: findroominloc(); break;
+ case 0xcb5c: getroomdata(); break;
+ case 0xcb60: readheader(); break;
+ case 0xcb64: dontloadseg(); break;
+ case 0xcb68: allocateload(); break;
+ case 0xcb6c: fillspace(); break;
+ case 0xcb70: getridoftemp(); break;
+ case 0xcb74: getridoftemptext(); break;
+ case 0xcb78: getridoftemp2(); break;
+ case 0xcb7c: getridoftemp3(); break;
+ case 0xcb80: getridoftempcharset(); break;
+ case 0xcb84: getridoftempsp(); break;
+ case 0xcb88: readsetdata(); break;
+ case 0xcb8c: createfile(); break;
+ case 0xcb90: openfile(); break;
+ case 0xcb94: openfilefromc(); break;
+ case 0xcb98: makename(); break;
+ case 0xcb9c: openfilenocheck(); break;
+ case 0xcba0: openforsave(); break;
+ case 0xcba4: closefile(); break;
+ case 0xcba8: readfromfile(); break;
+ case 0xcbac: setkeyboardint(); break;
+ case 0xcbb0: resetkeyboard(); break;
+ case 0xcbb4: keyboardread(); break;
+ case 0xcbb8: walkandexamine(); break;
+ case 0xcbbc: doload(); break;
+ case 0xcbc0: generalerror(); break;
+ default: ::error("invalid call to %04x dispatched", (uint16)ax);
}
}
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index 5dd8e847c1..b012663ab6 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -8,76 +8,10 @@
namespace DreamGen {
- void __dispatch_call(Context &context, unsigned addr);
- void __start(Context &context);
-
- void randomnumber(Context &context);
- void quickquit(Context &context);
- void quickquit2(Context &context);
- void seecommandtail(Context &context);
- void multiget(Context &context);
- void multiput(Context &context);
- void multidump(Context &context);
- void frameoutnm(Context &context);
- void cls(Context &context);
- void printundermon(Context &context);
- void worktoscreen(Context &context);
- void width160(Context &context);
- void keyboardread(Context &context);
- void resetkeyboard(Context &context);
- void setkeyboardint(Context &context);
- void readfromfile(Context &context);
- void closefile(Context &context);
- void openforsave(Context &context);
- void openfilenocheck(Context &context);
- void openfilefromc(Context &context);
- void openfile(Context &context);
- void createfile(Context &context);
- void dontloadseg(Context &context);
- void mousecall(Context &context);
- void setmouse(Context &context);
- void gettime(Context &context);
- void allocatemem(Context &context);
- void deallocatemem(Context &context);
- void removeemm(Context &context);
- void setupemm(Context &context);
- void pitinterupt(Context &context);
- void getridofpit(Context &context);
- void setuppit(Context &context);
- void startdmablock(Context &context);
- void dmaend(Context &context);
- void restoreems(Context &context);
- void saveems(Context &context);
- void bothchannels(Context &context);
- void channel1only(Context &context);
- void channel0only(Context &context);
- void out22c(Context &context);
- void soundend(Context &context);
- void interupttest(Context &context);
- void disablesoundint(Context &context);
- void enablesoundint(Context &context);
- void checksoundint(Context &context);
- void setsoundoff(Context &context);
- void soundstartup(Context &context);
- void loadsecondsample(Context &context);
- void loadsample(Context &context);
- void loadspeech(Context &context);
- void saveseg(Context &context);
- void loadseg(Context &context);
- void savefileread(Context &context);
- void savefilewrite(Context &context);
- void error(Context &context);
- void generalerror(Context &context);
- void dosreturn(Context &context);
- void set16colpalette(Context &context);
- void mode640x480(Context &context);
- void showgroup(Context &context);
- void fadedos(Context &context);
- void doshake(Context &context);
- void vsync(Context &context);
- void setmode(Context &context);
- void readoneblock(Context &context);
- void showpcx(Context &context);
+class DreamGenContext : public Context {
+public:
+ void __start();
+ void __dispatch_call(uint16 addr);
const static uint16 kStartvars = 0;
const static uint16 kProgresspoints = 1;
@@ -552,7 +486,8 @@ namespace DreamGen {
const static uint16 kSavenames = 8579;
const static uint16 kSavefiles = 8698;
const static uint16 kRecname = 8789;
- const static uint16 kStak = 8802;
+ const static uint16 kQuitrequested = 8802;
+ const static uint16 kStak = 8803;
const static uint16 kBlocktextdat = (0);
const static uint16 kPersonframes = (0);
const static uint16 kDebuglevel1 = (0);
@@ -646,7 +581,762 @@ namespace DreamGen {
const static uint16 kMenux = (80+40);
const static uint16 kLenofreelrouts = (991-534);
-
+ void bothchannels();
+ void usewire();
+ void getnamepos();
+ void drawitall();
+ void clearstartpal();
+ void femalefan();
+ void greyscalesum();
+ void showgamereel();
+ void identifyob();
+ void trysoundalloc();
+ void uselighter();
+ void showmenu();
+ void usepoolreader();
+ void showgroup();
+ void startdmablock();
+ void useopenbox();
+ void clearbuffers();
+ void neterror();
+ void storeit();
+ void lockeddoorway();
+ void isitworn();
+ void putundertimed();
+ void dumpmap();
+ void multidump();
+ void channel0only();
+ void worktoscreenm();
+ void removeemm();
+ void mansatstill();
+ void getobtextstart();
+ void loadfolder();
+ void decide();
+ void dumppointer();
+ void reelsonscreen();
+ void getridofreels();
+ void readkey();
+ void louis();
+ void entrytexts();
+ void getreelstart();
+ void buttonenter();
+ void checkinput();
+ void crosshair();
+ void bresenhams();
+ void getbackfromops();
+ void frameoutv();
+ void restoreall();
+ void screenupdate();
+ void addlength();
+ void usetimedtext();
+ void putundercentre();
+ void checkobjectsize();
+ void commandonly();
+ void adjustlen();
+ void deallocatemem();
+ void mainscreen();
+ void watchreel();
+ void showfolder();
+ void turnanypathoff();
+ void openfilefromc();
+ void gettime();
+ void clearwork();
+ void loadtraveltext();
+ void worktoscreen();
+ void getexpos();
+ void fadedos();
+ void multiget();
+ void fadeupmonfirst();
+ void drawfloor();
+ void loadkeypad();
+ void findsource();
+ void clearendpal();
+ void findtext1();
+ void isryanholding();
+ void interupttest();
+ void usecashcard();
+ void usewall();
+ void opentomb();
+ void buttonfour();
+ void animpointer();
+ void lockmon();
+ void dochange();
+ void getanyaddir();
+ void showsaveops();
+ void intromonks1();
+ void resetlocation();
+ void oldtonames();
+ void showdiscops();
+ void advisor();
+ void additionaltext();
+ void kernchars();
+ void othersmoker();
+ void autosetwalk();
+ void setuptimedtemp();
+ void blocknametext();
+ void useelevator5();
+ void useelevator4();
+ void useelevator1();
+ void attendant();
+ void useelevator3();
+ void useelevator2();
+ void buttonone();
+ void keyboardread();
+ void deltextline();
+ void entercode();
+ void getopenedsize();
+ void getpersframe();
+ void doshake();
+ void resetkeyboard();
+ void showpanel();
+ void soundstartup();
+ void slabdoora();
+ void fadeupyellows();
+ void slabdoorc();
+ void slabdoorb();
+ void slabdoore();
+ void slabdoord();
+ void adjustup();
+ void readsetdata();
+ void loadintotemp();
+ void loadintroroom();
+ void saveseg();
+ void showblink();
+ void mousecall();
+ void train();
+ void watchcount();
+ void fadedownmon();
+ void loadcart();
+ void splitintolines();
+ void bartender();
+ void eden();
+ void showdiary();
+ void purgealocation();
+ void updatepeople();
+ void slabdoorf();
+ void addtopeoplelist();
+ void hangoncurs();
+ void sparkydrip();
+ void compare();
+ void printcurs();
+ void convertkey();
+ void outofopen();
+ void dealwithspecial();
+ void dircom();
+ void liftsprite();
+ void dumpkeypad();
+ void dumpzoom();
+ void endgameseq();
+ void cancelch0();
+ void setbotleft();
+ void findfirstpath();
+ void showallfree();
+ void loadold();
+ void loadtempcharset();
+ void useslab();
+ void aboutturn();
+ void usealtar();
+ void createpanel2();
+ void turnonpower();
+ void manasleep2();
+ void moretalk();
+ void printslow();
+ void loadroom();
+ void starttalk();
+ void delchar();
+ void getanyad();
+ void endgame();
+ void monprint();
+ void usepipe();
+ void startloading();
+ void getunderzoom();
+ void candles();
+ void backobject();
+ void rollendcredits2();
+ void reminders();
+ void selectslot2();
+ void runtap();
+ void domix();
+ void priesttext();
+ void paneltomap();
+ void obname();
+ void getridoftemp3();
+ void getridoftemp2();
+ void usebalcony();
+ void runendseq();
+ void dumpdiarykeys();
+ void disablesoundint();
+ void checkifset();
+ void showallex();
+ void showrain();
+ void openpoolboss();
+ void buttontwo();
+ void fillopen();
+ void delsprite();
+ void getroomspaths();
+ void dumptextline();
+ void fadescreendownhalf();
+ void useplate();
+ void candles1();
+ void lookininterface();
+ void manasleep();
+ void isitdescribed();
+ void hotelbell();
+ void loadspeech();
+ void cls();
+ void printsprites();
+ void dumptimedtext();
+ void showallobs();
+ void getnumber();
+ void adjustleft();
+ void calledenslift();
+ void useclearbox();
+ void entryanims();
+ void nextfolder();
+ void getfreead();
+ void showarrows();
+ void walkintoroom();
+ void getridoftemptext();
+ void printoutermon();
+ void setuppit();
+ void showpcx();
+ void showdecisions();
+ void checkspeed();
+ void printchar();
+ void showkeypad();
+ void obtoinv();
+ void removeobfrominv();
+ void usecoveredbox();
+ void openyourneighbour();
+ void fadescreenuphalf();
+ void getridoftempcharset();
+ void heavy();
+ void endpaltostart();
+ void showkeys();
+ void usekey();
+ void locklighton();
+ void useladderb();
+ void spriteupdate();
+ void usetempcharset();
+ void discops();
+ void printdirect();
+ void delthisone();
+ void makebackob();
+ void middlepanel();
+ void dumpwatch();
+ void saveload();
+ void monitorlogo();
+ void loadposition();
+ void wornerror();
+ void entersymbol();
+ void showword();
+ void dirfile();
+ void setmode();
+ void walktotext();
+ void pickupconts();
+ void locklightoff();
+ void wearwatch();
+ void runintroseq();
+ void doblocks();
+ void showbyte();
+ void allpalette();
+ void findormake();
+ void nextsymbol();
+ void monks2text();
+ void poolguard();
+ void clearpalette();
+ void cantdrop();
+ void maptopanel();
+ void calcmapad();
+ void getridofall();
+ void copper();
+ void folderhints();
+ void openhoteldoor();
+ void removesetobject();
+ void checkifperson();
+ void frameoutfx();
+ void blank();
+ void drinker();
+ void nextcolon();
+ void placefreeobject();
+ void delpointer();
+ void loopchannel0();
+ void initrain();
+ void showleftpage();
+ void rockstar();
+ void adjustright();
+ void putunderzoom();
+ void vsync();
+ void turnpathoff();
+ void findinvpos();
+ void usetext();
+ void hangonpq();
+ void liftnoise();
+ void workoutframes();
+ void getbackfromob();
+ void dumpsymbox();
+ void loadgame();
+ void getridoftemp();
+ void showcity();
+ void dumpsymbol();
+ void disablepath();
+ void buttonsix();
+ void intro2text();
+ void showouterpad();
+ void getkeyandlogo();
+ void selectob();
+ void checkcoords();
+ void dumpmenu();
+ void chewy();
+ void accesslighton();
+ void dosreturn();
+ void titles();
+ void quickquit();
+ void showpointer();
+ void usecooker();
+ void loadmenu();
+ void checkforemm();
+ void checkifpathison();
+ void smallcandle();
+ void receptionist();
+ void selectslot();
+ void edenscdplayer();
+ void readoneblock();
+ void fadeupmon();
+ void paltoendpal();
+ void fadetowhite();
+ void textformonk();
+ void loadsavebox();
+ void fadescreenup();
+ void soundend();
+ void redes();
+ void errormessage1();
+ void clearchanges();
+ void errormessage3();
+ void deletetaken();
+ void putundermenu();
+ void checkifex();
+ void intromagic2();
+ void findobname();
+ void edeninbath();
+ void intromagic1();
+ void showdiarypage();
+ void useshield();
+ void getbacktoops();
+ void rollendcredits();
+ void intro1text();
+ void getmapad();
+ void playchannel1();
+ void playchannel0();
+ void usemon();
+ void steady();
+ void pixelcheckset();
+ void reexfrominv();
+ void fillspace();
+ void talk();
+ void usedryer();
+ void dumpeverything();
+ void usehatch();
+ void zoom();
+ void outofinv();
+ void viewfolder();
+ void walking();
+ void diarykeyp();
+ void readabyte();
+ void showframe();
+ void random();
+ void obicons();
+ void frameoutbh();
+ void channel1only();
+ void playguitar();
+ void lastfolder();
+ void transfermap();
+ void showreelframe();
+ void showmonk();
+ void diarykeyn();
+ void set16colpalette();
+ void convicons();
+ void interviewer();
+ void sparky();
+ void purgeanitem();
+ void madman();
+ void createpanel();
+ void turnpathon();
+ void showmainops();
+ void madmanstelly();
+ void constant();
+ void loadroomssample();
+ void getblockofpixel();
+ void paltostartpal();
+ void bossman();
+ void getridofpit();
+ void convnum();
+ void nothelderror();
+ void readheader();
+ void getsetad();
+ void getyad();
+ void reconstruct();
+ void soldier1();
+ void getundercentre();
+ void checkforexit();
+ void loadseg();
+ void makeheader();
+ void setkeyboardint();
+ void priest();
+ void readmouse();
+ void powerlighton();
+ void savefilewrite();
+ void printmessage2();
+ void loadnews();
+ void rollem();
+ void makeworn();
+ void examineobtext();
+ void startup();
+ void savegame();
+ void startpaltoend();
+ void showicon();
+ void findopenpos();
+ void describeob();
+ void deleteexframe();
+ void folderexit();
+ void useplinth();
+ void wheelsound();
+ void actualsave();
+ void autolook();
+ void checkbasemem();
+ void transfertext();
+ void searchforsame();
+ void enablesoundint();
+ void getback1();
+ void setlocation();
+ void fadefromwhite();
+ void checksoundint();
+ void usewindow();
+ void wearshades();
+ void onedigit();
+ void pitinterupt();
+ void deleverything();
+ void fadescreendown();
+ void findxyfrompath();
+ void namestoold();
+ void getxad();
+ void openinv();
+ void lookatplace();
+ void useaxe();
+ void examineob();
+ void buttonnought();
+ void useelvdoor();
+ void putbackobstuff();
+ void useladder();
+ void realcredits();
+ void handclap();
+ void smokebloke();
+ void showexit();
+ void printundermon();
+ void buttonnine();
+ void findallopen();
+ void loadintotemp3();
+ void loadintotemp2();
+ void gamer();
+ void personnametext();
+ void quitsymbol();
+ void readfromfile();
+ void initialinv();
+ void showslots();
+ void dofade();
+ void hangon();
+ void settopright();
+ void findsetobject();
+ void singlekey();
+ void seecommandtail();
+ void getundertimed();
+ void hangone();
+ void carparkdrip();
+ void usediary();
+ void deleteexobject();
+ void frameoutnm();
+ void moneypoke();
+ void destselect();
+ void restoreems();
+ void lastdest();
+ void removefreeobject();
+ void trapdoor();
+ void openlouis();
+ void buttonthree();
+ void getundermenu();
+ void randomnumber();
+ void lookatcard();
+ void helicopter();
+ void scrollmonitor();
+ void setsoundoff();
+ void setpickup();
+ void dropobject();
+ void printmessage();
+ void reexfromopen();
+ void fillryan();
+ void loadtemptext();
+ void usestereo();
+ void showcurrentfile();
+ void copyname();
+ void look();
+ void setmouse();
+ void checkone();
+ void transferinv();
+ void candles2();
+ void pickupob();
+ void error();
+ void showopbox();
+ void clearbeforeload();
+ void biblequote();
+ void doload();
+ void afterintroroom();
+ void blockget();
+ void usetrainer();
+ void allocatework();
+ void addtopresslist();
+ void walkandexamine();
+ void dmaend();
+ void quickquit2();
+ void twodigitnum();
+ void madmantext();
+ void dumpcurrent();
+ void textforend();
+ void showdiarykeys();
+ void dontloadseg();
+ void madmode();
+ void intro3text();
+ void allocatemem();
+ void sortoutmap();
+ void doorway();
+ void useopened();
+ void inventory();
+ void powerlightoff();
+ void getroomdata();
+ void showoutermenu();
+ void signon();
+ void deleteextext();
+ void foghornsound();
+ void showrightpage();
+ void openhoteldoor2();
+ void examicon();
+ void showgun();
+ void switchryanon();
+ void louischair();
+ void saveems();
+ void locationpic();
+ void getflagunderp();
+ void dolook();
+ void opentvdoor();
+ void triggermessage();
+ void finalframe();
+ void plotreel();
+ void swapwithopen();
+ void makesprite();
+ void dreamweb();
+ void droperror();
+ void openfilenocheck();
+ void calledensdlift();
+ void checkinside();
+ void gates();
+ void selectlocation();
+ void showwatch();
+ void turnanypathon();
+ void restorereels();
+ void setwalk();
+ void printboth();
+ void useroutine();
+ void zoomicon();
+ void hotelcontrol();
+ void findpathofpoint();
+ void issetobonmap();
+ void getdestinfo();
+ void drunk();
+ void dumpblink();
+ void setuptimeduse();
+ void grafittidoor();
+ void input();
+ void nextdest();
+ void getdimension();
+ void makecaps();
+ void read();
+ void fadescreenups();
+ void checkdest();
+ void initman();
+ void loadpalfromiff();
+ void facerightway();
+ void startup1();
+ void findlen();
+ void showsymbol();
+ void mugger();
+ void atmospheres();
+ void out22c();
+ void loadpersonal();
+ void gettingshot();
+ void settopleft();
+ void searchforstring();
+ void clearsprites();
+ void obpicture();
+ void selectopenob();
+ void widedoor();
+ void security();
+ void printasprite();
+ void buttonfive();
+ void soundonreels();
+ void usegun();
+ void autoappear();
+ void findnextcolon();
+ void readmouse4();
+ void openryan();
+ void readmouse1();
+ void showman();
+ void readmouse2();
+ void newplace();
+ void movemap();
+ void loadsample();
+ void usecardreader1();
+ void usecardreader2();
+ void usecardreader3();
+ void tattooman();
+ void usehandle();
+ void quitkey();
+ void openfile();
+ void usecharset1();
+ void makenextblock();
+ void showpuztext();
+ void addalong();
+ void width160();
+ void incryanpage();
+ void dodoor();
+ void eraseoldobs();
+ void buttoneight();
+ void opensarters();
+ void findexobject();
+ void errormessage2();
+ void usechurchhole();
+ void searchforfiles();
+ void monkspeaking();
+ void fadecalculation();
+ void waitframes();
+ void clearrest();
+ void getreelframeax();
+ void barwoman();
+ void roomname();
+ void credits();
+ void madmanrun();
+ void randomnum1();
+ void keeper();
+ void afternewroom();
+ void getexad();
+ void aide();
+ void openforsave();
+ void closefile();
+ void delcurs();
+ void randomaccess();
+ void calcfrframe();
+ void intromagic3();
+ void initialmoncols();
+ void checkforshake();
+ void usebuttona();
+ void cancelch1();
+ void getnextword();
+ void generalerror();
+ void actualload();
+ void allocateload();
+ void saveposition();
+ void mode640x480();
+ void openeden();
+ void execcommand();
+ void obsthatdothings();
+ void updatesymbolbot();
+ void findpuztext();
+ void usechurchgate();
+ void monkandryan();
+ void allocatebuffers();
+ void swapwithinv();
+ void usecontrol();
+ void buttonseven();
+ void redrawmainscrn();
+ void finishedwalking();
+ void findallryan();
+ void channel0tran();
+ void buttonpress();
+ void parseblaster();
+ void callhotellift();
+ void makemainscreen();
+ void intromonks2();
+ void usewinch();
+ void setbotright();
+ void readmouse3();
+ void showfirstuse();
+ void setupemm();
+ void usefullcart();
+ void transfertoex();
+ void getlocation();
+ void geteitherad();
+ void placesetobject();
+ void drawflags();
+ void zoomonoff();
+ void updatesymboltop();
+ void showryanpage();
+ void printlogo();
+ void allpointer();
+ void showseconduse();
+ void clearreels();
+ void malefan();
+ void dosaveload();
+ void createname();
+ void readcitypic();
+ void getpersontext();
+ void intoinv();
+ void showtime();
+ void parser();
+ void hangonw();
+ void intro();
+ void hangonp();
+ void fadescreendowns();
+ void showloadops();
+ void getridoftempsp();
+ void scanfornames();
+ void setallchanges();
+ void newgame();
+ void examinventory();
+ void standardload();
+ void undertextline();
+ void findroominloc();
+ void sitdowninbar();
+ void shownames();
+ void savefileread();
+ void emergencypurge();
+ void usemenu();
+ void alleybarksound();
+ void dosometalk();
+ void usecart();
+ void intromusic();
+ void makename();
+ void processtrigger();
+ void monmessage();
+ void readdesticon();
+ void randomnum2();
+ void loadsecondsample();
+ void transfercontoex();
+ void multiput();
+ void isitright();
+ void businessman();
+ void switchryanoff();
+ void commandwithob();
+ void panelicons1();
+ void adjustdown();
+ void withwhat();
+ void openob();
+ void createfile();
+ void userailing();
+ void accesslightoff();
+ void usehole();
+ void useobject();
+ void mainman();
+ void volumeadjust();
+ void checkiffree();
+};
}
#endif
diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp
index 37d47b26c5..8be02dc90e 100644
--- a/engines/dreamweb/dreamweb.cpp
+++ b/engines/dreamweb/dreamweb.cpp
@@ -42,15 +42,9 @@
#include "dreamweb/dreamweb.h"
#include "dreamweb/dreamgen.h"
-namespace DreamGen {
- void doshake(DreamGen::Context &context);
- void dofade(DreamGen::Context &context);
- void volumeadjust(DreamGen::Context &context);
-}
-
namespace DreamWeb {
-DreamWebEngine::DreamWebEngine(OSystem *syst, const DreamWebGameDescription *gameDesc) :
+DreamWebEngine::DreamWebEngine(OSystem *syst, const DreamWebGameDescription *gameDesc) :
Engine(syst), _gameDescription(gameDesc), _rnd("dreamweb") {
_context.engine = this;
@@ -100,14 +94,14 @@ void DreamWebEngine::waitForVSync() {
setVSyncInterrupt(false);
}
- DreamGen::doshake(_context);
- DreamGen::dofade(_context);
+ _context.doshake();
+ _context.dofade();
_system->updateScreen();
}
void DreamWebEngine::quit() {
- warning("Engine should quit gracefully (but doesn't yet)");
- g_system->quit();
+ _context.data.byte(DreamGen::DreamGenContext::kQuitrequested) = 1;
+ _context.data.byte(DreamGen::DreamGenContext::kLasthardkey) = 1;
}
void DreamWebEngine::processEvents() {
@@ -116,11 +110,23 @@ void DreamWebEngine::processEvents() {
quit();
return;
}
+
+ if (_enableSavingOrLoading && _loadSavefile >= 0 && _loadSavefile <= 6) {
+ debug(1, "loading save state %d", _loadSavefile);
+ _context.data.byte(_context.kCurrentslot) = _loadSavefile;
+ _loadSavefile = -1;
+ _context.loadposition();
+ _context.data.byte(_context.kGetback) = 1;
+ }
+
soundHandler();
Common::Event event;
int softKey, hardKey;
while (event_manager->pollEvent(event)) {
switch(event.type) {
+ case Common::EVENT_RTL:
+ quit();
+ break;
case Common::EVENT_KEYDOWN:
if (event.kbd.flags & Common::KBD_CTRL) {
switch (event.kbd.keycode) {
@@ -139,8 +145,8 @@ void DreamWebEngine::processEvents() {
break;
case Common::KEYCODE_c: //skip statue puzzle
- _context.data.byte(DreamGen::kSymbolbotnum) = 3;
- _context.data.byte(DreamGen::kSymboltopnum) = 5;
+ _context.data.byte(DreamGen::DreamGenContext::kSymbolbotnum) = 3;
+ _context.data.byte(DreamGen::DreamGenContext::kSymboltopnum) = 5;
break;
default:
@@ -170,7 +176,7 @@ void DreamWebEngine::processEvents() {
break;
}
- _context.data.byte(DreamGen::kLasthardkey) = hardKey;
+ _context.data.byte(DreamGen::DreamGenContext::kLasthardkey) = hardKey;
// The rest of the keys are converted to ASCII. This
// is fairly restrictive, and eventually we may want
@@ -210,11 +216,14 @@ void DreamWebEngine::processEvents() {
Common::Error DreamWebEngine::run() {
_console = new DreamWebConsole(this);
+ _loadSavefile = Common::ConfigManager::instance().getInt("save_slot");
+
getTimerManager()->installTimerProc(vSyncInterrupt, 1000000 / 70, this);
//http://martin.hinner.info/vga/timing.html
- DreamGen::__start(_context);
-
+ _context.__start();
+ _context.data.byte(DreamGen::DreamGenContext::kQuitrequested) = 0;
+
getTimerManager()->removeTimerProc(vSyncInterrupt);
return Common::kNoError;
@@ -294,13 +303,13 @@ uint DreamWebEngine::readFromSaveFile(uint8 *data, uint size) {
void DreamWebEngine::keyPressed(uint16 ascii) {
debug(2, "key pressed = %04x", ascii);
uint8* keybuf = _context.data.ptr(5912, 16); //fixme: some hardcoded offsets are not added as consts
- uint16 in = (_context.data.word(DreamGen::kBufferin) + 1) & 0x0f;
- uint16 out = _context.data.word(DreamGen::kBufferout);
+ uint16 in = (_context.data.word(DreamGen::DreamGenContext::kBufferin) + 1) & 0x0f;
+ uint16 out = _context.data.word(DreamGen::DreamGenContext::kBufferout);
if (in == out) {
warning("keyboard buffer is full");
return;
}
- _context.data.word(DreamGen::kBufferin) = in;
+ _context.data.word(DreamGen::DreamGenContext::kBufferin) = in;
keybuf[in] = ascii;
}
@@ -326,11 +335,11 @@ void DreamWebEngine::mouseCall() {
}
void DreamWebEngine::fadeDos() {
- _context.ds = _context.es = _context.data.word(DreamGen::kBuffers);
+ _context.ds = _context.es = _context.data.word(DreamGen::DreamGenContext::kBuffers);
return; //fixme later
waitForVSync();
//processEvents will be called from vsync
- uint8 *dst = _context.es.ptr(DreamGen::kStartpal, 768);
+ uint8 *dst = _context.es.ptr(DreamGen::DreamGenContext::kStartpal, 768);
getPalette(dst, 0, 64);
for(int fade = 0; fade < 64; ++fade) {
for(int c = 0; c < 768; ++c) { //original sources decrement 768 values -> 256 colors
@@ -379,9 +388,9 @@ void DreamWebEngine::blit(const uint8 *src, int pitch, int x, int y, int w, int
}
void DreamWebEngine::printUnderMonitor() {
- _context.es = _context.data.word(DreamGen::kWorkspace);
- _context.di = DreamGen::kScreenwidth * 43 + 76;
- _context.si = _context.di + 8 * DreamGen::kScreenwidth;
+ _context.es = _context.data.word(DreamGen::DreamGenContext::kWorkspace);
+ _context.di = DreamGen::DreamGenContext::kScreenwidth * 43 + 76;
+ _context.si = _context.di + 8 * DreamGen::DreamGenContext::kScreenwidth;
Graphics::Surface *s = _system->lockScreen();
if (!s)
@@ -397,8 +406,8 @@ void DreamWebEngine::printUnderMonitor() {
++dst; ++src;
}
}
- _context._add(_context.di, DreamGen::kScreenwidth);
- _context._add(_context.si, DreamGen::kScreenwidth);
+ _context._add(_context.di, DreamGen::DreamGenContext::kScreenwidth);
+ _context._add(_context.si, DreamGen::DreamGenContext::kScreenwidth);
}
_context.cx = 0;
_system->unlockScreen();
@@ -419,7 +428,7 @@ void DreamWebEngine::playSound(uint8 channel, uint8 id, uint8 loops) {
type = Audio::Mixer::kSFXSoundType;
} else if (speech)
type = Audio::Mixer::kSpeechSoundType;
- else
+ else
type = Audio::Mixer::kMusicSoundType;
Audio::SeekableAudioStream *raw;
@@ -436,7 +445,7 @@ void DreamWebEngine::playSound(uint8 channel, uint8 id, uint8 loops) {
memcpy(buffer, data.data.begin() + sample.offset, sample.size);
raw = Audio::makeRawStream(
- buffer,
+ buffer,
sample.size, 22050, Audio::FLAG_UNSIGNED);
} else {
uint8 *buffer = (uint8 *)malloc(_speechData.size());
@@ -444,9 +453,9 @@ void DreamWebEngine::playSound(uint8 channel, uint8 id, uint8 loops) {
if (!buffer)
error("out of memory: cannot allocate memory for sound(%u bytes)", _speechData.size());
raw = Audio::makeRawStream(
- buffer,
+ buffer,
_speechData.size(), 22050, Audio::FLAG_UNSIGNED);
-
+
}
Audio::AudioStream *stream;
@@ -477,10 +486,10 @@ bool DreamWebEngine::loadSpeech(const Common::String &filename) {
void DreamWebEngine::soundHandler() {
_context.push(_context.ax);
- volumeadjust(_context);
+ _context.volumeadjust();
_context.ax = _context.pop();
- uint volume = _context.data.byte(DreamGen::kVolume);
+ uint volume = _context.data.byte(DreamGen::DreamGenContext::kVolume);
//.vol file loaded into soundbuf:0x4000
//volume table at (volume * 0x100 + 0x3f00)
//volume value could be from 1 to 7
@@ -496,13 +505,13 @@ void DreamWebEngine::soundHandler() {
volume = (8 - volume) * Audio::Mixer::kMaxChannelVolume / 8;
_mixer->setChannelVolume(_channelHandle[0], volume);
- uint8 ch0 = _context.data.byte(DreamGen::kCh0playing);
+ uint8 ch0 = _context.data.byte(DreamGen::DreamGenContext::kCh0playing);
if (ch0 == 255)
ch0 = 0;
- uint8 ch1 = _context.data.byte(DreamGen::kCh1playing);
+ uint8 ch1 = _context.data.byte(DreamGen::DreamGenContext::kCh1playing);
if (ch1 == 255)
ch1 = 0;
- uint8 ch0loop = _context.data.byte(DreamGen::kCh0repeat);
+ uint8 ch0loop = _context.data.byte(DreamGen::DreamGenContext::kCh0repeat);
if (_channel0 != ch0) {
_channel0 = ch0;
@@ -517,11 +526,11 @@ void DreamWebEngine::soundHandler() {
}
}
if (!_mixer->isSoundHandleActive(_channelHandle[0])) {
- _context.data.byte(DreamGen::kCh0playing) = 255;
+ _context.data.byte(DreamGen::DreamGenContext::kCh0playing) = 255;
_channel0 = 0;
}
if (!_mixer->isSoundHandleActive(_channelHandle[1])) {
- _context.data.byte(DreamGen::kCh1playing) = 255;
+ _context.data.byte(DreamGen::DreamGenContext::kCh1playing) = 255;
_channel1 = 0;
}
diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h
index 7ccc0e6cd3..e0797bc96b 100644
--- a/engines/dreamweb/dreamweb.h
+++ b/engines/dreamweb/dreamweb.h
@@ -69,7 +69,7 @@ public:
void waitForVSync();
Common::Error loadGameState(int slot);
- Common::Error saveGameState(int slot, const char *desc);
+ Common::Error saveGameState(int slot, const Common::String &desc);
bool canLoadGameStateCurrently();
bool canSaveGameStateCurrently();
@@ -105,6 +105,8 @@ public:
void loadSounds(uint bank, const Common::String &file);
bool loadSpeech(const Common::String &filename);
+ void enableSavingOrLoading(bool enable = true) { _enableSavingOrLoading = enable; }
+
private:
void keyPressed(uint16 ascii);
void setSpeed(uint speed);
@@ -121,6 +123,8 @@ private:
uint _speed;
bool _turbo;
uint _oldMouseState;
+ int _loadSavefile;
+ bool _enableSavingOrLoading;
struct Sample {
uint offset;
@@ -138,7 +142,7 @@ private:
Audio::SoundHandle _channelHandle[2];
uint8 _channel0, _channel1;
- DreamGen::Context _context;
+ DreamGen::DreamGenContext _context;
};
} // End of namespace DreamWeb
diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h
index 8932e123a8..724d5e4053 100644
--- a/engines/dreamweb/runtime.h
+++ b/engines/dreamweb/runtime.h
@@ -97,16 +97,16 @@ public:
struct Segment {
Common::Array<uint8> data;
-
+
inline void assign(const uint8 *b, const uint8 *e) {
data.assign(b, e);
}
-
+
inline uint8 &byte(unsigned index) {
assert(index < data.size());
return data[index];
}
-
+
inline WordRef word(unsigned index) {
return WordRef(data, index);
}
@@ -163,7 +163,7 @@ public:
assert(_segment != 0);
_segment->assign(b, e);
}
-
+
inline uint8* ptr(unsigned index, unsigned size) {
assert(_segment != 0);
return _segment->ptr(index, size);
@@ -180,7 +180,7 @@ struct Flags {
inline bool l() const { return _o != _s; }
inline bool le() const { return _o != _s|| _z; }
-
+
inline void update_zs(uint8 v) {
_s = v & 0x80;
_z = v == 0;
@@ -228,7 +228,7 @@ public:
//data == fake segment register always pointing to data segment
Flags flags;
- inline Context(): engine(0), al(ax), ah(ax), bl(bx), bh(bx), cl(cx), ch(cx), dl(dx), dh(dx),
+ inline Context(): engine(0), al(ax), ah(ax), bl(bx), bh(bx), cl(cx), ch(cx), dl(dx), dh(dx),
cs(this), ds(this), es(this), data(this) {
_segments[kDefaultDataSegment] = SegmentPtr(new Segment());
cs.reset(kDefaultDataSegment);
@@ -462,12 +462,15 @@ public:
es.byte(di++) = ds.byte(si++);
}
- inline void _movsb(uint size) {
+ inline void _movsb(uint size, bool clear_cx = false) {
+ assert(size != 0xffff);
uint8 *dst = es.ptr(di, size);
uint8 *src = ds.ptr(si, size);
memcpy(dst, src, size);
di += size;
si += size;
+ if (clear_cx)
+ cx = 0;
}
inline void _movsw() {
@@ -475,18 +478,22 @@ public:
_movsb();
}
- inline void _movsw(uint size) {
- _movsb(size * 2);
+ inline void _movsw(uint size, bool clear_cx = false) {
+ assert(size != 0xffff);
+ _movsb(size * 2, clear_cx);
}
inline void _stosb() {
es.byte(di++) = al;
}
- inline void _stosb(uint size) {
+ inline void _stosb(uint size, bool clear_cx = false) {
+ assert(size != 0xffff);
uint8 *dst = es.ptr(di, size);
memset(dst, al, size);
di += size;
+ if (clear_cx)
+ cx = 0;
}
inline void _stosw() {
@@ -494,13 +501,16 @@ public:
es.byte(di++) = ah;
}
- inline void _stosw(uint size) {
- uint8 *dst = es.ptr(di, size);
+ inline void _stosw(uint size, bool clear_cx = false) {
+ assert(size != 0xffff);
+ uint8 *dst = es.ptr(di, size * 2);
di += 2 * size;
while(size--) {
*dst++ = al;
*dst++ = ah;
}
+ if (clear_cx)
+ cx = 0;
}
inline void _xchg(uint16 &a, uint16 &b) {
@@ -542,9 +552,9 @@ public:
};
#ifndef NDEBUG
-# define STACK_CHECK(context) StackChecker checker(context)
+# define STACK_CHECK StackChecker checker(*this)
#else
-# define STACK_CHECK(context) do {} while (0)
+# define STACK_CHECK do {} while (0)
#endif
}
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 129186ca07..eebfbeb0d4 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -13,220 +13,217 @@ Common::String getFilename(Context &context) {
return name;
}
-void multiget(Context &context) {
- unsigned w = (uint8)context.cl, h = (uint8)context.ch;
- unsigned x = (uint16)context.di, y = (uint16)context.bx;
+void DreamGenContext::multiget() {
+ unsigned w = (uint8)cl, h = (uint8)ch;
+ unsigned x = (uint16)di, y = (uint16)bx;
unsigned src = x + y * kScreenwidth;
- unsigned dst = (uint16)context.si;
- context.es = context.ds;
- context.ds = context.data.word(kWorkspace);
+ unsigned dst = (uint16)si;
+ es = ds;
+ ds = data.word(kWorkspace);
if (y + h > 200)
h = 200 - y;
if (x + w > 320)
w = 320 - x;
- //debug(1, "multiget %u,%u %ux%u -> segment: %04x->%04x", x, y, w, h, (uint16)context.ds, (uint16)context.es);
+ //debug(1, "multiget %u,%u %ux%u -> segment: %04x->%04x", x, y, w, h, (uint16)ds, (uint16)es);
for(unsigned l = 0; l < h; ++l) {
- uint8 *src_p = context.ds.ptr(src + kScreenwidth * l, w);
- uint8 *dst_p = context.es.ptr(dst + w * l, w);
+ uint8 *src_p = ds.ptr(src + kScreenwidth * l, w);
+ uint8 *dst_p = es.ptr(dst + w * l, w);
memcpy(dst_p, src_p, w);
}
- context.si += w * h;
- context.di = src + kScreenwidth * h;
- context.cx = 0;
+ si += w * h;
+ di = src + kScreenwidth * h;
+ cx = 0;
}
-void multiput(Context &context) {
- unsigned w = (uint8)context.cl, h = (uint8)context.ch;
- unsigned x = (uint16)context.di, y = (uint16)context.bx;
- unsigned src = (uint16)context.si;
+void DreamGenContext::multiput() {
+ unsigned w = (uint8)cl, h = (uint8)ch;
+ unsigned x = (uint16)di, y = (uint16)bx;
+ unsigned src = (uint16)si;
unsigned dst = x + y * kScreenwidth;
- context.es = context.data.word(kWorkspace);
+ es = data.word(kWorkspace);
if (y + h > 200)
h = 200 - y;
if (x + w > 320)
w = 320 - x;
- //debug(1, "multiput %ux%u -> segment: %04x->%04x", w, h, (uint16)context.ds, (uint16)context.es);
+ //debug(1, "multiput %ux%u -> segment: %04x->%04x", w, h, (uint16)ds, (uint16)es);
for(unsigned l = 0; l < h; ++l) {
- uint8 *src_p = context.ds.ptr(src + w * l, w);
- uint8 *dst_p = context.es.ptr(dst + kScreenwidth * l, w);
+ uint8 *src_p = ds.ptr(src + w * l, w);
+ uint8 *dst_p = es.ptr(dst + kScreenwidth * l, w);
memcpy(dst_p, src_p, w);
}
- context.si += w * h;
- context.di = dst + kScreenwidth * h;
- context.cx = 0;
+ si += w * h;
+ di = dst + kScreenwidth * h;
+ cx = 0;
}
-void multidump(Context &context) {
- context.ds = context.data.word(kWorkspace);
- int w = (uint8)context.cl, h = (uint8)context.ch;
- int x = (int16)context.di, y = (int16)context.bx;
+void DreamGenContext::multidump() {
+ ds = data.word(kWorkspace);
+ int w = (uint8)cl, h = (uint8)ch;
+ int x = (int16)di, y = (int16)bx;
unsigned offset = x + y * kScreenwidth;
- //debug(1, "multidump %ux%u(segment: %04x) -> %d,%d(address: %d)", w, h, (uint16)context.ds, x, y, offset);
- context.engine->blit(context.ds.ptr(offset, w * h), kScreenwidth, x, y, w, h);
- context.si = context.di = offset + h * kScreenwidth;
- context.cx = 0;
+ //debug(1, "multidump %ux%u(segment: %04x) -> %d,%d(address: %d)", w, h, (uint16)ds, x, y, offset);
+ engine->blit(ds.ptr(offset, w * h), kScreenwidth, x, y, w, h);
+ si = di = offset + h * kScreenwidth;
+ cx = 0;
}
-void worktoscreen(Context &context) {
- context.ds = context.data.word(kWorkspace);
+void DreamGenContext::worktoscreen() {
+ ds = data.word(kWorkspace);
uint size = 320 * 200;
- context.engine->blit(context.ds.ptr(0, size), 320, 0, 0, 320, 200);
- context.di = context.si = size;
- context.cx = 0;
+ engine->blit(ds.ptr(0, size), 320, 0, 0, 320, 200);
+ di = si = size;
+ cx = 0;
}
-void printundermon(Context &context) {
- context.engine->printUnderMonitor();
+void DreamGenContext::printundermon() {
+ engine->printUnderMonitor();
}
-void cls(Context &context) {
- context.engine->cls();
+void DreamGenContext::cls() {
+ engine->cls();
}
-void frameoutnm(Context &context) {
- unsigned w = (uint8)context.cl, h = (uint8)context.ch;
- unsigned pitch = (uint16)context.dx;
- unsigned src = (uint16)context.si;
- int x = (uint16)context.di, y = (uint16)context.bx;
+void DreamGenContext::frameoutnm() {
+ unsigned w = (uint8)cl, h = (uint8)ch;
+ unsigned pitch = (uint16)dx;
+ unsigned src = (uint16)si;
+ int x = (uint16)di, y = (uint16)bx;
unsigned dst = x + y * pitch;
- //debug(1, "framenm %ux%u[pitch: %u]-> %d,%d, segment: %04x->%04x", w, h, pitch, x, y, (uint16)context.ds, (uint16)context.es);
+ //debug(1, "framenm %ux%u[pitch: %u]-> %d,%d, segment: %04x->%04x", w, h, pitch, x, y, (uint16)ds, (uint16)es);
for(unsigned l = 0; l < h; ++l) {
- uint8 *src_p = context.ds.ptr(src + w * l, w);
- uint8 *dst_p = context.es.ptr(dst + pitch * l, w);
+ uint8 *src_p = ds.ptr(src + w * l, w);
+ uint8 *dst_p = es.ptr(dst + pitch * l, w);
memcpy(dst_p, src_p, w);
}
- context.di += dst + pitch * h;
- context.si += w * h;
- context.cx = 0;
+ di += dst + pitch * h;
+ si += w * h;
+ cx = 0;
}
-void seecommandtail(Context &context) {
- context.data.word(kSoundbaseadd) = 0x220;
- context.data.byte(kSoundint) = 5;
- context.data.byte(kSounddmachannel) = 1;
- context.data.byte(kBrightness) = 1;
- context.data.word(kHowmuchalloc) = 0x9360;
+void DreamGenContext::seecommandtail() {
+ data.word(kSoundbaseadd) = 0x220;
+ data.byte(kSoundint) = 5;
+ data.byte(kSounddmachannel) = 1;
+ data.byte(kBrightness) = 1;
+ data.word(kHowmuchalloc) = 0x9360;
}
-void randomnumber(Context &context) {
- context.al = context.engine->randomNumber();
+void DreamGenContext::randomnumber() {
+ al = engine->randomNumber();
}
-void quickquit(Context &context) {
- context.engine->quit();
+void DreamGenContext::quickquit() {
+ engine->quit();
}
-void quickquit2(Context &context) {
- context.engine->quit();
+void DreamGenContext::quickquit2() {
+ engine->quit();
}
-void keyboardread(Context &context) {
+void DreamGenContext::keyboardread() {
::error("keyboardread"); //this keyboard int handler, must never be called
}
-void resetkeyboard(Context &context) {
+void DreamGenContext::resetkeyboard() {
}
-void setkeyboardint(Context &context) {
+void DreamGenContext::setkeyboardint() {
}
-void readfromfile(Context &context) {
- uint16 dst_offset = context.dx;
- uint16 size = context.cx;
- debug(1, "readfromfile(%04x:%u, %u)", (uint16)context.ds, dst_offset, size);
- context.ax = context.engine->readFromFile(context.ds.ptr(dst_offset, size), size);
- context.flags._c = false;
+void DreamGenContext::readfromfile() {
+ uint16 dst_offset = dx;
+ uint16 size = cx;
+ debug(1, "readfromfile(%04x:%u, %u)", (uint16)ds, dst_offset, size);
+ ax = engine->readFromFile(ds.ptr(dst_offset, size), size);
+ flags._c = false;
}
-void closefile(Context &context) {
- context.engine->closeFile();
- context.data.byte(kHandle) = 0;
+void DreamGenContext::closefile() {
+ engine->closeFile();
+ data.byte(kHandle) = 0;
}
-void openforsave(Context &context) {
- const char *name = (const char *)context.ds.ptr(context.dx, 13);
+void DreamGenContext::openforsave() {
+ const char *name = (const char *)ds.ptr(dx, 13);
debug(1, "openforsave(%s)", name);
- context.engine->openSaveFileForWriting(name);
+ engine->openSaveFileForWriting(name);
}
-void openfilenocheck(Context &context) {
- const char *name = (const char *)context.ds.ptr(context.dx, 13);
+void DreamGenContext::openfilenocheck() {
+ const char *name = (const char *)ds.ptr(dx, 13);
debug(1, "checksavefile(%s)", name);
- bool ok = context.engine->openSaveFileForReading(name);
- context.flags._c = !ok;
+ bool ok = engine->openSaveFileForReading(name);
+ flags._c = !ok;
}
-void openfilefromc(Context &context) {
- openfilenocheck(context);
+void DreamGenContext::openfilefromc() {
+ openfilenocheck();
}
-void openfile(Context &context) {
- Common::String name = getFilename(context);
+void DreamGenContext::openfile() {
+ Common::String name = getFilename(*this);
debug(1, "opening file: %s", name.c_str());
- context.engine->openFile(name);
- context.cs.word(kHandle) = 1; //only one handle
- context.flags._c = false;
+ engine->openFile(name);
+ cs.word(kHandle) = 1; //only one handle
+ flags._c = false;
}
-void createfile(Context &context) {
+void DreamGenContext::createfile() {
::error("createfile");
}
-void dontloadseg(Context &context) {
- context.ax = context.es.word(context.di);
- context._add(context.di, 2);
- context.dx = context.ax;
- context.cx = 0;
- unsigned pos = context.engine->skipBytes(context.dx);
- context.dx = pos >> 16;
- context.ax = pos & 0xffff;
- context.flags._c = false;
+void DreamGenContext::dontloadseg() {
+ ax = es.word(di);
+ _add(di, 2);
+ dx = ax;
+ cx = 0;
+ unsigned pos = engine->skipBytes(dx);
+ dx = pos >> 16;
+ ax = pos & 0xffff;
+ flags._c = false;
}
-void mousecall(Context &context) {
- context.engine->mouseCall();
+void DreamGenContext::mousecall() {
+ engine->mouseCall();
}
-void setmouse(Context &context) {
- context.data.word(kOldpointerx) = 0xffff;
- //warning("setmouse: fixme: add range setting");
- //set vertical range to 15-184
- //set horizontal range to 15-298*2
+void DreamGenContext::setmouse() {
+ data.word(kOldpointerx) = 0xffff;
}
-void gettime(Context &context) {
+void DreamGenContext::gettime() {
TimeDate t;
g_system->getTimeAndDate(t);
debug(1, "\tgettime: %02d:%02d:%02d", t.tm_hour, t.tm_min, t.tm_sec);
- context.ch = t.tm_hour;
- context.cl = t.tm_min;
- context.dh = t.tm_sec;
- context.data.byte(kSecondcount) = context.dh;
- context.data.byte(kMinutecount) = context.cl;
- context.data.byte(kHourcount) = context.ch;
+ ch = t.tm_hour;
+ cl = t.tm_min;
+ dh = t.tm_sec;
+ data.byte(kSecondcount) = dh;
+ data.byte(kMinutecount) = cl;
+ data.byte(kHourcount) = ch;
}
-void allocatemem(Context &context) {
- uint size = (context.bx + 2) * 16;
+void DreamGenContext::allocatemem() {
+ uint size = (bx + 2) * 16;
debug(1, "allocate mem, %u bytes", size);
- context.flags._c = false;
- SegmentRef seg = context.allocateSegment(size);
- context.ax = (uint16)seg;
- debug(1, "\tsegment address -> %04x", (uint16)context.ax);
+ flags._c = false;
+ SegmentRef seg = allocateSegment(size);
+ ax = (uint16)seg;
+ debug(1, "\tsegment address -> %04x", (uint16)ax);
}
-void deallocatemem(Context &context) {
- uint16 id = (uint16)context.es;
+void DreamGenContext::deallocatemem() {
+ uint16 id = (uint16)es;
debug(1, "deallocating segment %04x", id);
- context.deallocateSegment(id);
+ deallocateSegment(id);
//fixing invalid entries in the sprite table
- context.es = context.data;
+ es = data;
uint tsize = 16 * 32;
- uint16 bseg = context.data.word(kBuffers);
+ uint16 bseg = data.word(kBuffers);
if (!bseg)
return;
- SegmentRef buffers(&context);
+ SegmentRef buffers(this);
buffers = bseg;
uint8 *ptr = buffers.ptr(kSpritetable, tsize);
for(uint i = 0; i < tsize; i += 32) {
@@ -237,192 +234,173 @@ void deallocatemem(Context &context) {
}
}
-void removeemm(Context &context) {
+void DreamGenContext::removeemm() {
::error("removeemm");
}
-void setupemm(Context &context) {
- //fixme: double check this, but it seems that emm pages used only for sound
+void DreamGenContext::setupemm() {
}
-void pitinterupt(Context &context) {
+void DreamGenContext::pitinterupt() {
::error("pitinterupt");
}
-void getridofpit(Context &context) {
+void DreamGenContext::getridofpit() {
::error("getridofpit");
}
-void setuppit(Context &context) {
+void DreamGenContext::setuppit() {
::error("setuppit");
}
-void startdmablock(Context &context) {
+void DreamGenContext::startdmablock() {
::error("startdmablock");
}
-void dmaend(Context &context) {
+void DreamGenContext::dmaend() {
::error("dmaend");
}
-void restoreems(Context &context) {
+void DreamGenContext::restoreems() {
::error("restoreems");
}
-void saveems(Context &context) {
+void DreamGenContext::saveems() {
::error("saveems");
}
-void bothchannels(Context &context) {
+void DreamGenContext::bothchannels() {
::error("bothchannels");
}
-void channel1only(Context &context) {
+void DreamGenContext::channel1only() {
::error("channel1only");
}
-void channel0only(Context &context) {
+void DreamGenContext::channel0only() {
::error("channel0only");
}
-void out22c(Context &context) {
+void DreamGenContext::out22c() {
::error("out22c");
}
-void soundstartup(Context &context) {
+void DreamGenContext::soundstartup() {}
+void DreamGenContext::soundend() {}
+void DreamGenContext::interupttest() {}
+void DreamGenContext::disablesoundint() {}
+void DreamGenContext::enablesoundint() {}
+void DreamGenContext::checksoundint() {
+ data.byte(kTestresult) = 1;
}
-void soundend(Context &context) {
-}
-
-void interupttest(Context &context) {
- ::error("interupttest");
-}
-
-void disablesoundint(Context &context) {
- warning("disablesoundint: STUB");
-}
-
-void enablesoundint(Context &context) {
- warning("enablesoundint: STUB");
-}
-
-void checksoundint(Context &context) {
- context.data.byte(kTestresult) = 1;
- warning("checksoundint: STUB");
-}
-
-void setsoundoff(Context &context) {
+void DreamGenContext::setsoundoff() {
warning("setsoundoff: STUB");
}
-void readheader(Context &context);
-
-void loadsample(Context &context) {
- context.engine->loadSounds(0, (const char *)context.data.ptr(context.dx, 13));
+void DreamGenContext::loadsample() {
+ engine->loadSounds(0, (const char *)data.ptr(dx, 13));
}
-void cancelch0(Context &context);
-void cancelch1(Context &context);
-
-void loadsecondsample(Context &context) {
- uint8 ch0 = context.data.byte(kCh0playing);
+void DreamGenContext::loadsecondsample() {
+ uint8 ch0 = data.byte(kCh0playing);
if (ch0 >= 12 && ch0 != 255)
- cancelch0(context);
- uint8 ch1 = context.data.byte(kCh1playing);
+ cancelch0();
+ uint8 ch1 = data.byte(kCh1playing);
if (ch1 >= 12)
- cancelch1(context);
- context.engine->loadSounds(1, (const char *)context.data.ptr(context.dx, 13));
+ cancelch1();
+ engine->loadSounds(1, (const char *)data.ptr(dx, 13));
}
-void createname(Context &context);
-
-void loadspeech(Context &context) {
- cancelch1(context);
- context.data.byte(kSpeechloaded) = 0;
- createname(context);
- const char *name = (const char *)context.data.ptr(context.di, 13);
+void DreamGenContext::loadspeech() {
+ cancelch1();
+ data.byte(kSpeechloaded) = 0;
+ createname();
+ const char *name = (const char *)data.ptr(di, 13);
//warning("name = %s", name);
- if (context.engine->loadSpeech(name))
- context.data.byte(kSpeechloaded) = 1;
+ if (engine->loadSpeech(name))
+ data.byte(kSpeechloaded) = 1;
}
-void saveseg(Context &context) {
- context.cx = context.es.word(context.di);
- context._add(context.di, 2);
- savefilewrite(context);
+void DreamGenContext::saveseg() {
+ cx = es.word(di);
+ _add(di, 2);
+ savefilewrite();
}
-void savefilewrite(Context &context) {
- context.ax = context.engine->writeToSaveFile(context.ds.ptr(context.dx, context.cx), context.cx);
+void DreamGenContext::savefilewrite() {
+ ax = engine->writeToSaveFile(ds.ptr(dx, cx), cx);
}
-void savefileread(Context &context) {
- context.ax = context.engine->readFromSaveFile(context.ds.ptr(context.dx, context.cx), context.cx);
+void DreamGenContext::savefileread() {
+ ax = engine->readFromSaveFile(ds.ptr(dx, cx), cx);
}
-void loadseg(Context &context) {
- context.ax = context.es.word(context.di);
- context.di += 2;
+void DreamGenContext::loadseg() {
+ ax = es.word(di);
+ di += 2;
- uint16 dst_offset = context.dx;
- uint16 size = context.ax;
+ uint16 dst_offset = dx;
+ uint16 size = ax;
- debug(1, "loadseg(%04x:%u, %u)", (uint16)context.ds, dst_offset, size);
- context.ax = context.engine->readFromFile(context.ds.ptr(dst_offset, size), size);
- context.flags._c = false;
+ debug(1, "loadseg(%04x:%u, %u)", (uint16)ds, dst_offset, size);
+ ax = engine->readFromFile(ds.ptr(dst_offset, size), size);
+ flags._c = false;
}
-void error(Context &context) {
+void DreamGenContext::error() {
::error("error");
}
-void generalerror(Context &context) {
+void DreamGenContext::generalerror() {
::error("generalerror");
}
-void commandonly(Context &context);
+void DreamGenContext::dosreturn() {
-void dosreturn(Context &context) {
- context._cmp(context.data.byte(kCommandtype), 250);
- if (context.flags.z()) goto alreadydos;
- context.data.byte(kCommandtype) = 250;
- context.al = 46;
- commandonly(context);
-alreadydos:
- context.ax = context.data.word(kMousebutton);
- context._and(context.ax, 1);
- if (context.flags.z()) return;
+ _cmp(data.byte(kCommandtype), 250);
+ if (!flags.z()) {
+ data.byte(kCommandtype) = 250;
+ al = 46;
+ commandonly();
+ }
- quickquit2(context);
- quickquit(context);
+ ax = data.word(kMousebutton);
+ _and(ax, 1);
+ if (flags.z())
+ return;
+
+ data.word(kMousebutton) = 0;
+ engine->quit();
}
-void set16colpalette(Context &context) {
+void DreamGenContext::set16colpalette() {
+ //fixme: this is a bit hackish, set16colpalette called after initialization and nearly before main loop.
+ engine->enableSavingOrLoading();
}
-void mode640x480(Context &context) {
+void DreamGenContext::mode640x480() {
// Video mode 12h: 640x480 pixels, 16 colors, I believe
- context.al = 0x12 + 128;
- context.ah = 0;
+ al = 0x12 + 128;
+ ah = 0;
initGraphics(640, 480, true);
}
-void showgroup(Context &context) {
- context.engine->setPalette();
+void DreamGenContext::showgroup() {
+ engine->setPalette();
}
-void fadedos(Context &context) {
- context.engine->fadeDos();
+void DreamGenContext::fadedos() {
+ engine->fadeDos();
}
-void doshake(Context &context) {
- uint8 &counter = context.data.byte(kShakecounter);
- context._cmp(counter, 48);
- if (context.flags.z())
+void DreamGenContext::doshake() {
+ uint8 &counter = data.byte(kShakecounter);
+ _cmp(counter, 48);
+ if (flags.z())
return;
- context._add(counter, 1);
+ _add(counter, 1);
static const int shakeTable[] = {
0, -2, 3, -2, 0, 2, 4, -1,
1, -3, 3, 2, 0, -2, 3, -2,
@@ -443,27 +421,20 @@ void doshake(Context &context) {
1, -3, 3, 0,
};
int offset = shakeTable[counter];
- context.engine->setShakePos(offset >= 0? offset: -offset);
+ engine->setShakePos(offset >= 0? offset: -offset);
}
-void vsync(Context &context) {
- context.engine->waitForVSync();
+void DreamGenContext::vsync() {
+ engine->waitForVSync();
}
-void setmode(Context &context) {
- vsync(context);
+void DreamGenContext::setmode() {
+ vsync();
initGraphics(320, 200, false);
}
-void readoneblock(Context &context) {
- context.ds = context.data.word(kWorkspace);
- context.cx = 30000;
- context.dx = 0;
- readfromfile(context);
-}
-
-void showpcx(Context &context) {
- Common::String name = getFilename(context);
+void DreamGenContext::showpcx() {
+ Common::String name = getFilename(*this);
Common::File pcxFile;
if (!pcxFile.open(name)) {
@@ -478,8 +449,8 @@ void showpcx(Context &context) {
// the color components have to be adjusted from 8 to 6 bits.
pcxFile.seek(16, SEEK_SET);
- context.es = context.data.word(kBuffers);
- maingamepal = context.es.ptr(4782, 768); //fixme: hardcoded offset
+ es = data.word(kBuffers);
+ maingamepal = es.ptr(kMaingamepal, 768);
pcxFile.read(maingamepal, 48);
memset(maingamepal + 48, 0xff, 720);
diff --git a/engines/engine.cpp b/engines/engine.cpp
index dc30b4bd0d..dde5064dc4 100644
--- a/engines/engine.cpp
+++ b/engines/engine.cpp
@@ -400,6 +400,17 @@ void Engine::openMainMenuDialog() {
syncSoundSettings();
}
+bool Engine::warnUserAboutUnsupportedGame() {
+ if (ConfMan.getBool("enable_unsupported_game_warning")) {
+ GUI::MessageDialog alert(_("WARNING: The game you are about to start is"
+ " not yet fully supported by ScummVM. As such, it is likely to be"
+ " unstable, and any saves you make might not work in future"
+ " versions of ScummVM."), _("Start anyway"), _("Cancel"));
+ return alert.runModal() == GUI::kMessageOK;
+ }
+ return true;
+}
+
uint32 Engine::getTotalPlayTime() const {
if (!_pauseLevel)
return _system->getMillis() - _engineStartTime;
diff --git a/engines/engine.h b/engines/engine.h
index d7d971ad97..06b7f7dedd 100644
--- a/engines/engine.h
+++ b/engines/engine.h
@@ -252,6 +252,13 @@ public:
void openMainMenuDialog();
/**
+ * Display a warning to the user that the game is not fully supported.
+ *
+ * @return true if the user chose to start anyway, false otherwise
+ */
+ static bool warnUserAboutUnsupportedGame();
+
+ /**
* Get the total play time.
*
* @return How long the player has been playing in ms.
diff --git a/engines/game.cpp b/engines/game.cpp
index c6d9905b52..8ea68bb681 100644
--- a/engines/game.cpp
+++ b/engines/game.cpp
@@ -46,7 +46,7 @@ GameDescriptor::GameDescriptor(const PlainGameDescriptor &pgd, uint32 guioptions
setVal("guioptions", Common::getGameGUIOptionsDescription(guioptions));
}
-GameDescriptor::GameDescriptor(const Common::String &g, const Common::String &d, Common::Language l, Common::Platform p, uint32 guioptions) {
+GameDescriptor::GameDescriptor(const Common::String &g, const Common::String &d, Common::Language l, Common::Platform p, uint32 guioptions, GameSupportLevel gsl) {
setVal("gameid", g);
setVal("description", d);
if (l != Common::UNK_LANG)
@@ -55,6 +55,8 @@ GameDescriptor::GameDescriptor(const Common::String &g, const Common::String &d,
setVal("platform", Common::getPlatformCode(p));
if (guioptions != 0)
setVal("guioptions", Common::getGameGUIOptionsDescription(guioptions));
+
+ setSupportLevel(gsl);
}
void GameDescriptor::setGUIOptions(uint32 guioptions) {
@@ -69,9 +71,6 @@ void GameDescriptor::appendGUIOptions(const Common::String &str) {
}
void GameDescriptor::updateDesc(const char *extra) {
- // TODO: The format used here (LANG/PLATFORM/EXTRA) is not set in stone.
- // We may want to change the order (PLATFORM/EXTRA/LANG, anybody?), or
- // the seperator (instead of '/' use ', ' or ' ').
const bool hasCustomLanguage = (language() != Common::UNK_LANG);
const bool hasCustomPlatform = (platform() != Common::kPlatformUnknown);
const bool hasExtraDesc = (extra && extra[0]);
@@ -97,3 +96,30 @@ void GameDescriptor::updateDesc(const char *extra) {
setVal("description", descr);
}
}
+
+GameSupportLevel GameDescriptor::getSupportLevel() {
+ GameSupportLevel gsl = kStableGame;
+ if (contains("gsl")) {
+ Common::String gslString = getVal("gsl");
+ if (gslString.equals("unstable"))
+ gsl = kUnstableGame;
+ else if (gslString.equals("testing"))
+ gsl = kTestingGame;
+ }
+ return gsl;
+}
+
+void GameDescriptor::setSupportLevel(GameSupportLevel gsl) {
+ switch (gsl) {
+ case kUnstableGame:
+ setVal("gsl", "unstable");
+ break;
+ case kTestingGame:
+ setVal("gsl", "testing");
+ break;
+ case kStableGame:
+ // Fall Through intended
+ default:
+ erase("gsl");
+ }
+}
diff --git a/engines/game.h b/engines/game.h
index 3216cfb628..9082d93793 100644
--- a/engines/game.h
+++ b/engines/game.h
@@ -47,6 +47,15 @@ struct PlainGameDescriptor {
const PlainGameDescriptor *findPlainGameDescriptor(const char *gameid, const PlainGameDescriptor *list);
/**
+ * Ths is an enum to describe how done a game is. This also indicates what level of support is expected.
+ */
+enum GameSupportLevel {
+ kStableGame = 0, // the game is fully supported
+ kTestingGame, // the game is not supposed to end up in releases yet but is ready for public testing
+ kUnstableGame // the game is not even ready for public testing yet
+};
+
+/**
* A hashmap describing details about a given game. In a sense this is a refined
* version of PlainGameDescriptor, as it also contains a gameid and a description string.
* But in addition, platform and language settings, as well as arbitrary other settings,
@@ -61,16 +70,25 @@ public:
const Common::String &description,
Common::Language language = Common::UNK_LANG,
Common::Platform platform = Common::kPlatformUnknown,
- uint32 guioptions = 0);
+ uint32 guioptions = 0,
+ GameSupportLevel gsl = kStableGame);
/**
- * Update the description string by appending (LANG/PLATFORM/EXTRA) to it.
+ * Update the description string by appending (EXTRA/PLATFORM/LANG) to it.
+ * Values that are missing are omitted, so e.g. (EXTRA/LANG) would be
+ * added if no platform has been specified but a language and an extra string.
*/
void updateDesc(const char *extra = 0);
void setGUIOptions(uint32 options);
void appendGUIOptions(const Common::String &str);
+ /**
+ * What level of support is expected of this game
+ */
+ GameSupportLevel getSupportLevel();
+ void setSupportLevel(GameSupportLevel gsl);
+
Common::String &gameid() { return getVal("gameid"); }
Common::String &description() { return getVal("description"); }
const Common::String &gameid() const { return getVal("gameid"); }
diff --git a/engines/gob/inter_fascin.cpp b/engines/gob/inter_fascin.cpp
index bab1975abc..081b48fbad 100644
--- a/engines/gob/inter_fascin.cpp
+++ b/engines/gob/inter_fascin.cpp
@@ -174,7 +174,7 @@ void Inter_Fascination::oFascin_assign(OpFuncParams &params) {
case TYPE_VAR_INT32_AS_INT16:
case TYPE_ARRAY_INT16:
- WRITE_VARO_UINT16(dest + i * 2, _vm->_game->_script->getResultInt());
+ WRITE_VARO_UINT16(dest + i * 2, _vm->_game->_script->getResultInt());
break;
case TYPE_VAR_INT32:
diff --git a/engines/gob/video_v6.cpp b/engines/gob/video_v6.cpp
index e2c952952d..7fb3104162 100644
--- a/engines/gob/video_v6.cpp
+++ b/engines/gob/video_v6.cpp
@@ -124,7 +124,7 @@ void Video_v6::drawYUV(Surface &destDesc, int16 x, int16 y,
Pixel dstRow = dst;
int nextChromaLine = (i < ((height - 1) & ~3) ) ? dataWidth : 0;
-
+
for (int j = 0; j < width; j++, dstRow++) {
int nextChromaColumn = (j < ((width - 1) & ~3)) ? 1 : 0;
diff --git a/engines/groovie/detection.cpp b/engines/groovie/detection.cpp
index 2065307ca9..62887bac1e 100644
--- a/engines/groovie/detection.cpp
+++ b/engines/groovie/detection.cpp
@@ -131,7 +131,7 @@ static const GroovieGameDescription gameDescriptions[] = {
{
"11h", "",
AD_ENTRY1s("disk.1", "5c0428cd3659fc7bbcd0aa16485ed5da", 227),
- Common::EN_ANY, Common::kPlatformPC, ADGF_NO_FLAGS,
+ Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE,
Common::GUIO_MIDIADLIB | Common::GUIO_MIDIMT32 | Common::GUIO_MIDIGM
},
kGroovieV2, 1
@@ -142,7 +142,7 @@ static const GroovieGameDescription gameDescriptions[] = {
{
"11h", "Demo",
AD_ENTRY1s("disk.1", "aacb32ce07e0df2894bd83a3dee40c12", 70),
- Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, Common::GUIO_NOLAUNCHLOAD |
+ Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO | ADGF_UNSTABLE, Common::GUIO_NOLAUNCHLOAD |
Common::GUIO_MIDIADLIB | Common::GUIO_MIDIMT32 | Common::GUIO_MIDIGM
},
kGroovieV2, 1
@@ -153,7 +153,7 @@ static const GroovieGameDescription gameDescriptions[] = {
{
"11h", "Making Of",
AD_ENTRY1s("disk.1", "5c0428cd3659fc7bbcd0aa16485ed5da", 227),
- Common::EN_ANY, Common::kPlatformPC, ADGF_NO_FLAGS, Common::GUIO_NOMIDI | Common::GUIO_NOLAUNCHLOAD
+ Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE, Common::GUIO_NOMIDI | Common::GUIO_NOLAUNCHLOAD
},
kGroovieV2, 2
},
@@ -163,7 +163,7 @@ static const GroovieGameDescription gameDescriptions[] = {
{
"clandestiny", "Trailer",
AD_ENTRY1s("disk.1", "5c0428cd3659fc7bbcd0aa16485ed5da", 227),
- Common::EN_ANY, Common::kPlatformPC, ADGF_NO_FLAGS, Common::GUIO_NOMIDI | Common::GUIO_NOLAUNCHLOAD
+ Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE, Common::GUIO_NOMIDI | Common::GUIO_NOLAUNCHLOAD
},
kGroovieV2, 3
},
@@ -173,7 +173,7 @@ static const GroovieGameDescription gameDescriptions[] = {
{
"clandestiny", "",
AD_ENTRY1s("disk.1", "f79fc1515174540fef6a34132efc4c53", 76),
- Common::EN_ANY, Common::kPlatformPC, ADGF_NO_FLAGS, Common::GUIO_NOMIDI
+ Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE, Common::GUIO_NOMIDI
},
kGroovieV2, 1
},
@@ -183,7 +183,7 @@ static const GroovieGameDescription gameDescriptions[] = {
{
"unclehenry", "",
AD_ENTRY1s("disk.1", "0e1b1d3cecc4fc7efa62a968844d1f7a", 72),
- Common::EN_ANY, Common::kPlatformPC, ADGF_NO_FLAGS, Common::GUIO_NOMIDI
+ Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE, Common::GUIO_NOMIDI
},
kGroovieV2, 1
},
@@ -193,7 +193,7 @@ static const GroovieGameDescription gameDescriptions[] = {
{
"tlc", "",
AD_ENTRY1s("disk.1", "32a1afa68478f1f9d2b25eeea427f2e3", 84),
- Common::EN_ANY, Common::kPlatformPC, ADGF_NO_FLAGS, Common::GUIO_NOMIDI
+ Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE, Common::GUIO_NOMIDI
},
kGroovieV2, 1
},
diff --git a/engines/groovie/music.cpp b/engines/groovie/music.cpp
index 33fc986193..c6e990dfcf 100644
--- a/engines/groovie/music.cpp
+++ b/engines/groovie/music.cpp
@@ -801,17 +801,17 @@ bool MusicPlayerIOS::load(uint32 fileref, bool loop) {
19468 ambient (but not 69, amb b. odd)
19470 puzzle
19471
- 19473
+ 19473
19475 coffins or blood pump
19476 blood pump or coffins
19493
19499 chapel
19509 downstair ambient
19510 bedroom 'skip 3 and 5' puzzle (should loop from partway?)
- 19514
+ 19514
19515 bathroom drain teeth
*/
- if ((fileref >= 19462 && fileref <= 19468) ||
+ if ((fileref >= 19462 && fileref <= 19468) ||
fileref == 19470 || fileref == 19471 ||
fileref == 19473 || fileref == 19475 ||
fileref == 19476 || fileref == 19493 ||
@@ -849,7 +849,7 @@ bool MusicPlayerIOS::load(uint32 fileref, bool loop) {
updateVolume();
// Play!
- _vm->_system->getMixer()->playStream(Audio::Mixer::kMusicSoundType, &_handle, audStream);
+ _vm->_system->getMixer()->playStream(Audio::Mixer::kMusicSoundType, &_handle, audStream);
return true;
}
diff --git a/engines/groovie/player.h b/engines/groovie/player.h
index d8135a99b2..c9258ffdbd 100644
--- a/engines/groovie/player.h
+++ b/engines/groovie/player.h
@@ -53,8 +53,8 @@ protected:
Common::SeekableReadStream *_file;
uint16 _flags;
Audio::QueuingAudioStream *_audioStream;
-
-
+
+
private:
// Synchronization stuff
bool _begunPlaying;
diff --git a/engines/hugo/console.cpp b/engines/hugo/console.cpp
index 0a67b5cd0a..19fd91e3fa 100644
--- a/engines/hugo/console.cpp
+++ b/engines/hugo/console.cpp
@@ -64,8 +64,8 @@ bool HugoConsole::Cmd_gotoScreen(int argc, const char **argv) {
if ((argc != 2) || (strToInt(argv[1]) > _vm->_numScreens)){
DebugPrintf("Usage: %s <screen number>\n", argv[0]);
return true;
- }
-
+ }
+
_vm->_scheduler->newScreen(strToInt(argv[1]));
return false;
}
@@ -78,7 +78,7 @@ bool HugoConsole::Cmd_listScreens(int argc, const char **argv) {
DebugPrintf("Usage: %s\n", argv[0]);
return true;
}
-
+
DebugPrintf("Available screens for this game are:\n");
for (int i = 0; i < _vm->_numScreens; i++)
DebugPrintf("%2d - %s\n", i, _vm->_text->getScreenNames(i));
@@ -93,7 +93,7 @@ bool HugoConsole::Cmd_listObjects(int argc, const char **argv) {
DebugPrintf("Usage: %s\n", argv[0]);
return true;
}
-
+
DebugPrintf("Available objects for this game are:\n");
for (int i = 0; i < _vm->_object->_numObj; i++) {
if (_vm->_object->_objects[i].genericCmd & TAKE)
@@ -110,7 +110,7 @@ bool HugoConsole::Cmd_getObject(int argc, const char **argv) {
DebugPrintf("Usage: %s <object number>\n", argv[0]);
return true;
}
-
+
if (_vm->_object->_objects[strToInt(argv[1])].genericCmd & TAKE)
_vm->_parser->takeObject(&_vm->_object->_objects[strToInt(argv[1])]);
else
@@ -127,7 +127,7 @@ bool HugoConsole::Cmd_getAllObjects(int argc, const char **argv) {
DebugPrintf("Usage: %s\n", argv[0]);
return true;
}
-
+
for (int i = 0; i < _vm->_object->_numObj; i++) {
if (_vm->_object->_objects[i].genericCmd & TAKE)
_vm->_parser->takeObject(&_vm->_object->_objects[i]);
diff --git a/engines/hugo/dialogs.cpp b/engines/hugo/dialogs.cpp
index 6c816141f7..c43cdd7b46 100644
--- a/engines/hugo/dialogs.cpp
+++ b/engines/hugo/dialogs.cpp
@@ -95,15 +95,15 @@ void TopMenu::reflowLayout() {
_recallButton->resize(x * scale, y * scale, kButtonWidth * scale, kButtonHeight * scale);
x += kButtonWidth + kButtonPad;
-
+
_turboButton->resize(x * scale, y * scale, kButtonWidth * scale, kButtonHeight * scale);
x += kButtonWidth + kButtonPad;
x += kButtonSpace;
-
+
_lookButton->resize(x * scale, y * scale, kButtonWidth * scale, kButtonHeight * scale);
x += kButtonWidth + kButtonPad;
-
+
_inventButton->resize(x * scale, y * scale, kButtonWidth * scale, kButtonHeight * scale);
x += kButtonWidth + kButtonPad;
@@ -133,7 +133,7 @@ void TopMenu::loadBmpArr(Common::SeekableReadStream &in) {
arrayBmp[i * 2 + 1]->create(arrayBmp[i * 2]->w * 2, arrayBmp[i * 2]->h * 2, g_system->getOverlayFormat());
byte *src = (byte *)arrayBmp[i * 2]->pixels;
byte *dst = (byte *)arrayBmp[i * 2 + 1]->pixels;
-
+
for (int j = 0; j < arrayBmp[i * 2]->h; j++) {
src = (byte *)arrayBmp[i * 2]->getBasePtr(0, j);
dst = (byte *)arrayBmp[i * 2 + 1]->getBasePtr(0, j * 2);
@@ -153,7 +153,7 @@ void TopMenu::loadBmpArr(Common::SeekableReadStream &in) {
*dst++ = *src++;
}
}
-
+
in.skip(bmpSize);
}
}
diff --git a/engines/hugo/display.cpp b/engines/hugo/display.cpp
index c716e80d87..2d35bb0448 100644
--- a/engines/hugo/display.cpp
+++ b/engines/hugo/display.cpp
@@ -736,7 +736,7 @@ overlayState_t Screen_v1d::findOvl(seq_t *seq_p, image_pt dst_p, uint16 y) {
uint16 index = (uint16)(dst_p - _frontBuffer) >> 3;
for (int i = 0; i < seq_p->lines-y; i++) { // Each line in object
- if (_vm->_object->getBaseBoundary(index)) // If any overlay base byte is non-zero then the object is foreground, else back.
+ if (_vm->_object->getBaseBoundary(index)) // If any overlay base byte is non-zero then the object is foreground, else back.
return kOvlForeground;
index += kCompLineSize;
}
diff --git a/engines/hugo/hugo.cpp b/engines/hugo/hugo.cpp
index 10d61f25a2..7b54c7701d 100644
--- a/engines/hugo/hugo.cpp
+++ b/engines/hugo/hugo.cpp
@@ -299,7 +299,7 @@ Common::Error HugoEngine::run() {
_status.helpFl = false;
_file->instructions();
}
-
+
_mouse->mouseHandler(); // Mouse activity - adds to display list
_screen->displayList(kDisplayDisplay); // Blit the display list to screen
_status.doQuitFl |= shouldQuit(); // update game quit flag
@@ -315,7 +315,7 @@ void HugoEngine::initMachine() {
_object->readObjectImages(); // Read all object images
if (_platform == Common::kPlatformWindows)
_file->readUIFImages(); // Read all uif images (only in Win versions)
-
+
_sound->initPcspkrPlayer();
}
diff --git a/engines/hugo/hugo.h b/engines/hugo/hugo.h
index 81d194f1d6..125819a39b 100644
--- a/engines/hugo/hugo.h
+++ b/engines/hugo/hugo.h
@@ -177,7 +177,7 @@ struct status_t { // Game status (not saved)
bool recallFl; // Toolbar "recall" button pressed
bool newScreenFl; // New screen just loaded in dib_a
bool godModeFl; // Allow DEBUG features in live version
- bool showBoundariesFl; // Flag used to show and hide boundaries,
+ bool showBoundariesFl; // Flag used to show and hide boundaries,
// used by the console
bool doQuitFl;
bool skipIntroFl;
diff --git a/engines/hugo/inventory.h b/engines/hugo/inventory.h
index de9e4cd1f0..666cc37b51 100644
--- a/engines/hugo/inventory.h
+++ b/engines/hugo/inventory.h
@@ -56,7 +56,7 @@ private:
HugoEngine *_vm;
static const int kStepDy = 8; // Pixels per step movement
-
+
int16 _firstIconId; // Index of first icon to display
int16 *_invent;
istate_t _inventoryState; // Inventory icon bar state
diff --git a/engines/hugo/object.cpp b/engines/hugo/object.cpp
index e888a1d998..e5c7b4bf90 100644
--- a/engines/hugo/object.cpp
+++ b/engines/hugo/object.cpp
@@ -157,7 +157,7 @@ void ObjectHandler::useObject(int16 objId) {
if (inventObjId == use->objId) {
// Look for secondary object, if found use matching verb
bool foundFl = false;
-
+
for (target_t *target = use->targets; target->nounIndex != 0; target++)
if (target->nounIndex == obj->nounIndex) {
foundFl = true;
@@ -425,7 +425,7 @@ void ObjectHandler::loadObjectUses(Common::ReadStream &in) {
}
for (int i = 0; i < numElem; i++) {
- if (varnt == _vm->_gameVariant)
+ if (varnt == _vm->_gameVariant)
readUse(in, _uses[i]);
else {
readUse(in, tmpUse);
diff --git a/engines/hugo/parser.cpp b/engines/hugo/parser.cpp
index 4a53d67377..5cb97f2dc5 100644
--- a/engines/hugo/parser.cpp
+++ b/engines/hugo/parser.cpp
@@ -60,7 +60,7 @@ Parser::~Parser() {
uint16 Parser::getCmdDefaultVerbIdx(const uint16 index) const {
return _cmdList[index][0].verbIndex;
}
-
+
/**
* Read a cmd structure from Hugo.dat
*/
@@ -391,6 +391,8 @@ void Parser::command(const char *format, ...) {
va_list marker;
va_start(marker, format);
+// TODO:
+// _vm->_line = Common::String::vformat(format, marker);
vsprintf(_vm->_line, format, marker);
va_end(marker);
diff --git a/engines/hugo/parser.h b/engines/hugo/parser.h
index faa6dc2303..f8b9d9f13b 100644
--- a/engines/hugo/parser.h
+++ b/engines/hugo/parser.h
@@ -81,9 +81,9 @@ public:
virtual ~Parser();
bool isWordPresent(char **wordArr) const;
-
+
uint16 getCmdDefaultVerbIdx(const uint16 index) const;
-
+
void charHandler();
void command(const char *format, ...);
void freeParser();
diff --git a/engines/hugo/schedule.cpp b/engines/hugo/schedule.cpp
index a099bec21c..d1b4aa6a9c 100644
--- a/engines/hugo/schedule.cpp
+++ b/engines/hugo/schedule.cpp
@@ -1040,7 +1040,7 @@ void Scheduler::saveActions(Common::WriteStream *f) const {
* Find the index in the action list to be able to serialize the action to save game
*/
void Scheduler::findAction(const act* action, int16* index, int16* subElem) {
-
+
assert(index && subElem);
if (!action) {
*index = -1;
@@ -1106,7 +1106,7 @@ void Scheduler::restoreEvents(Common::ReadStream *f) {
else
_events[i].action = (act*)&_actListArr[index][subElem];
- _events[i].localActionFl = (f->readByte() == 1) ? true : false;
+ _events[i].localActionFl = (f->readByte() == 1) ? true : false;
_events[i].time = f->readUint32BE();
int16 prevIndex = f->readSint16BE();
diff --git a/engines/hugo/schedule.h b/engines/hugo/schedule.h
index e3107809cf..60d51f0673 100644
--- a/engines/hugo/schedule.h
+++ b/engines/hugo/schedule.h
@@ -616,7 +616,7 @@ public:
protected:
virtual const char *getCypher() const;
-
+
void promptAction(act *action);
};
diff --git a/engines/hugo/sound.cpp b/engines/hugo/sound.cpp
index 9473536a47..1fea1f4343 100644
--- a/engines/hugo/sound.cpp
+++ b/engines/hugo/sound.cpp
@@ -127,7 +127,7 @@ SoundHandler::SoundHandler(HugoEngine *vm) : _vm(vm) {
curPriority = 0;
pcspkrTimer = 0;
pcspkrOctave = 3;
- pcspkrNoteDuration = 2;
+ pcspkrNoteDuration = 2;
}
SoundHandler::~SoundHandler() {
@@ -290,7 +290,7 @@ void SoundHandler::pcspkr_player() {
} else if (pcspkrTimer >= 0) { // Note still going
return;
}
-
+
// Time to play next note
do {
cmd_note = true;
diff --git a/engines/kyra/gui.cpp b/engines/kyra/gui.cpp
index b9477c950a..f58ca0117c 100644
--- a/engines/kyra/gui.cpp
+++ b/engines/kyra/gui.cpp
@@ -643,32 +643,31 @@ void MainMenu::printString(const char *format, int x, int y, int col1, int col2,
if (!format)
return;
- char string[512];
va_list vaList;
va_start(vaList, flags);
- vsprintf(string, format, vaList);
+ Common::String string = Common::String::vformat(format, vaList);
va_end(vaList);
if (flags & 1)
- x -= _screen->getTextWidth(string) >> 1;
+ x -= _screen->getTextWidth(string.c_str()) >> 1;
if (flags & 2)
- x -= _screen->getTextWidth(string);
+ x -= _screen->getTextWidth(string.c_str());
if (_vm->gameFlags().use16ColorMode)
flags &= 3;
if (flags & 4) {
- _screen->printText(string, x - 1, y, _static.altColor, col2);
- _screen->printText(string, x, y + 1, _static.altColor, col2);
+ _screen->printText(string.c_str(), x - 1, y, _static.altColor, col2);
+ _screen->printText(string.c_str(), x, y + 1, _static.altColor, col2);
}
if (flags & 8) {
- _screen->printText(string, x - 1, y, 227, col2);
- _screen->printText(string, x, y + 1, 227, col2);
+ _screen->printText(string.c_str(), x - 1, y, 227, col2);
+ _screen->printText(string.c_str(), x, y + 1, 227, col2);
}
- _screen->printText(string, x, y, col1, col2);
+ _screen->printText(string.c_str(), x, y, col1, col2);
}
} // End of namespace Kyra
diff --git a/engines/kyra/lol.h b/engines/kyra/lol.h
index 943bb7f8d5..06a4f29f63 100644
--- a/engines/kyra/lol.h
+++ b/engines/kyra/lol.h
@@ -717,7 +717,7 @@ private:
int olol_setScriptTimer(EMCState *script);
int olol_createHandItem(EMCState *script);
int olol_playAttackSound(EMCState *script);
- int olol_characterJoinsParty(EMCState *script);
+ int olol_addRemoveCharacter(EMCState *script);
int olol_giveItem(EMCState *script);
int olol_loadTimScript(EMCState *script);
int olol_runTimScript(EMCState *script);
diff --git a/engines/kyra/script_lol.cpp b/engines/kyra/script_lol.cpp
index 695528b8d1..1afefcffa4 100644
--- a/engines/kyra/script_lol.cpp
+++ b/engines/kyra/script_lol.cpp
@@ -1088,33 +1088,27 @@ int LoLEngine::olol_playAttackSound(EMCState *script) {
return 1;
}
-int LoLEngine::olol_characterJoinsParty(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "LoLEngine::olol_characterJoinsParty(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
+int LoLEngine::olol_addRemoveCharacter(EMCState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "LoLEngine::olol_addRemoveCharacter(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
int16 id = stackPos(0);
- if (id < 0)
+ if (id < 0) {
id = -id;
+ for (int i = 0; i < 4; i++) {
+ if (!(_characters[i].flags & 1) || _characters[i].id != id)
+ continue;
- for (int i = 0; i < 4; i++) {
- if (!(_characters[i].flags & 1) || _characters[i].id != id)
- continue;
-
- _characters[i].flags &= 0xfffe;
- calcCharPortraitXpos();
+ _characters[i].flags &= 0xfffe;
+ calcCharPortraitXpos();
- if (!_updateFlags) {
- gui_enableDefaultPlayfieldButtons();
- gui_drawPlayField();
+ if (_selectedCharacter == i)
+ _selectedCharacter = 0;
+ break;
}
-
- if (_selectedCharacter == i)
- _selectedCharacter = 0;
-
- return 1;
+ } else {
+ addCharacter(id);
}
- addCharacter(id);
-
if (!_updateFlags) {
gui_enableDefaultPlayfieldButtons();
gui_drawPlayField();
@@ -2823,7 +2817,7 @@ void LoLEngine::setupOpcodeTable() {
Opcode(olol_setScriptTimer);
Opcode(olol_createHandItem);
Opcode(olol_playAttackSound);
- Opcode(olol_characterJoinsParty);
+ Opcode(olol_addRemoveCharacter);
// 0x4C
Opcode(olol_giveItem);
diff --git a/engines/kyra/sequences_lol.cpp b/engines/kyra/sequences_lol.cpp
index 01bf3c5e26..27f3951faf 100644
--- a/engines/kyra/sequences_lol.cpp
+++ b/engines/kyra/sequences_lol.cpp
@@ -202,7 +202,7 @@ void LoLEngine::setupPrologueData(bool load) {
void LoLEngine::showIntro() {
_tim = new TIMInterpreter(this, _screen, _system);
assert(_tim);
-
+
if (_flags.platform == Common::kPlatformPC98)
showStarcraftLogo();
@@ -1115,7 +1115,7 @@ void LoLEngine::showOutro(int character, bool maxDifficulty) {
showCredits();
_eventList.clear();
-
+
if (!shouldQuit()) {
switch (character) {
case 0:
diff --git a/engines/kyra/sound_intern.h b/engines/kyra/sound_intern.h
index 2ba0890789..be3c09de96 100644
--- a/engines/kyra/sound_intern.h
+++ b/engines/kyra/sound_intern.h
@@ -140,7 +140,7 @@ private:
uint8 _sfxChannel;
TownsEuphonyDriver *_driver;
-
+
bool _cdaPlaying;
const uint8 *_musicFadeTable;
diff --git a/engines/kyra/sound_towns.cpp b/engines/kyra/sound_towns.cpp
index 73d435f3e5..012f1f5d7d 100644
--- a/engines/kyra/sound_towns.cpp
+++ b/engines/kyra/sound_towns.cpp
@@ -107,11 +107,11 @@ void SoundTowns::haltTrack() {
g_system->getAudioCDManager()->stop();
g_system->getAudioCDManager()->updateCD();
_cdaPlaying = false;
-
+
for (int i = 0; i < 6; i++)
_driver->chanVolume(i, 0);
for (int i = 0x40; i < 0x46; i++)
- _driver->chanVolume(i, 0);
+ _driver->chanVolume(i, 0);
for (int i = 0; i < 32; i++)
_driver->configChan_enable(i, 0);
_driver->stopParser();
@@ -128,7 +128,7 @@ void SoundTowns::loadSoundFile(uint file) {
void SoundTowns::playSoundEffect(uint8 track) {
if (!_sfxEnabled || !_sfxFileData)
return;
-
+
if (track == 0 || track == 10) {
stopAllSoundEffects();
return;
@@ -258,13 +258,13 @@ void SoundTowns::beginFadeOut() {
uint16 fadeVolCur[12];
uint16 fadeVolStep[12];
-
+
for (int i = 0; i < 6; i++) {
fadeVolCur[i] = READ_LE_UINT16(&_musicFadeTable[(_lastTrack * 12 + i) * 2]);
fadeVolStep[i] = fadeVolCur[i] / 50;
fadeVolCur[i + 6] = READ_LE_UINT16(&_musicFadeTable[(_lastTrack * 12 + 6 + i) * 2]);
fadeVolStep[i + 6] = fadeVolCur[i + 6] / 30;
- }
+ }
for (int i = 0; i < 12; i++) {
for (int ii = 0; ii < 6; ii++)
@@ -344,7 +344,7 @@ void SoundTowns::playEuphonyTrack(uint32 offset, int loop) {
uint32 trackSize = READ_LE_UINT32(_musicTrackData + 2048);
uint8 startTick = _musicTrackData[2052];
-
+
_driver->setMusicTempo(_musicTrackData[2053]);
src = _musicTrackData + 2054;
diff --git a/engines/lastexpress/detection.cpp b/engines/lastexpress/detection.cpp
index 369d815543..de80e75341 100644
--- a/engines/lastexpress/detection.cpp
+++ b/engines/lastexpress/detection.cpp
@@ -47,7 +47,7 @@ static const ADGameDescription gameDescriptions[] = {
},
Common::EN_ANY,
Common::kPlatformUnknown,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
@@ -65,7 +65,7 @@ static const ADGameDescription gameDescriptions[] = {
},
Common::EN_ANY,
Common::kPlatformUnknown,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
@@ -83,7 +83,7 @@ static const ADGameDescription gameDescriptions[] = {
},
Common::EN_ANY,
Common::kPlatformUnknown,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
@@ -98,7 +98,7 @@ static const ADGameDescription gameDescriptions[] = {
},
Common::EN_ANY,
Common::kPlatformUnknown,
- ADGF_DEMO,
+ ADGF_DEMO | ADGF_UNSTABLE,
Common::GUIO_NONE
},
@@ -116,7 +116,7 @@ static const ADGameDescription gameDescriptions[] = {
},
Common::FR_FRA,
Common::kPlatformUnknown,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
@@ -134,7 +134,7 @@ static const ADGameDescription gameDescriptions[] = {
},
Common::DE_DEU,
Common::kPlatformUnknown,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
@@ -152,7 +152,7 @@ static const ADGameDescription gameDescriptions[] = {
},
Common::ES_ESP,
Common::kPlatformUnknown,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
@@ -170,7 +170,7 @@ static const ADGameDescription gameDescriptions[] = {
},
Common::IT_ITA,
Common::kPlatformUnknown,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
diff --git a/engines/lastexpress/game/sound.cpp b/engines/lastexpress/game/sound.cpp
index 3f98ac79ea..1c7abbf95e 100644
--- a/engines/lastexpress/game/sound.cpp
+++ b/engines/lastexpress/game/sound.cpp
@@ -40,7 +40,7 @@ namespace LastExpress {
#define SOUNDCACHE_MAX_SIZE 6
// Letters & messages
-const char *messages[24] = {
+static const char *const messages[24] = {
"",
"TXT1001", // 1
"TXT1001A", // 2
@@ -67,7 +67,7 @@ const char *messages[24] = {
"ENDALRM3" // 65
};
-const char *cities[17] = {
+static const char *const cities[17] = {
"EPERNAY",
"CHALONS",
"BARLEDUC",
@@ -87,7 +87,7 @@ const char *cities[17] = {
"POLICE"
};
-const char *locomotiveSounds[5] = {
+static const char *const locomotiveSounds[5] = {
"ZFX1005",
"ZFX1006",
"ZFX1007",
@@ -614,16 +614,16 @@ void SoundManager::saveLoadWithSerializer(Common::Serializer &s) {
if (entry->name2.matchString("NISSND?") && (entry->status.status & kFlagType7) != kFlag3) {
s.syncAsUint32LE(entry->status.status); // status;
s.syncAsUint32LE(entry->type); // type;
- s.syncAsUint32LE(entry->field_1C); // field_8;
+ s.syncAsUint32LE(entry->blockCount); // field_8;
s.syncAsUint32LE(entry->time); // time;
s.syncAsUint32LE(entry->field_34); // field_10;
s.syncAsUint32LE(entry->field_38); // field_14;
s.syncAsUint32LE(entry->entity); // entity;
- uint32 field_1C = (uint32)entry->field_48 - _data2;
- if (field_1C > kFlag8)
- field_1C = 0;
- s.syncAsUint32LE(field_1C); // field_1C;
+ uint32 blockCount = (uint32)entry->field_48 - _data2;
+ if (blockCount > kFlag8)
+ blockCount = 0;
+ s.syncAsUint32LE(blockCount); // blockCount;
s.syncAsUint32LE(entry->field_4C); // field_20;
@@ -1948,4 +1948,355 @@ void SoundManager::stopAllSound() {
(*i)->soundStream->stop();
}
+//////////////////////////////////////////////////////////////////////////
+// Sound filter
+//////////////////////////////////////////////////////////////////////////
+
+static const int filterData[1424] = {
+ 0, 0, 0, 0, 128, 256, 384, 512, 0, 0, 0, 0, 128, 256,
+ 384, 512, 0, 0, 0, 0, 192, 320, 448, 576, 0, 0, 0, 0,
+ 192, 320, 448, 576, 64, 64, 64, 64, 256, 384, 512, 640,
+ 64, 64, 64, 64, 256, 384, 512, 640, 128, 128, 128, 128,
+ 320, 448, 576, 704, 128, 128, 128, 128, 320, 448, 576,
+ 704, 192, 192, 192, 192, 384, 512, 640, 768, 192, 192,
+ 192, 192, 384, 512, 640, 768, 256, 256, 256, 256, 448,
+ 576, 704, 832, 256, 256, 256, 256, 448, 576, 704, 832,
+ 320, 320, 320, 320, 512, 640, 768, 896, 320, 320, 320,
+ 320, 512, 640, 768, 896, 384, 384, 384, 384, 576, 704,
+ 832, 960, 384, 384, 384, 384, 576, 704, 832, 960, 448,
+ 448, 448, 448, 640, 768, 896, 1024, 448, 448, 448, 448,
+ 640, 768, 896, 1024, 512, 512, 512, 512, 704, 832, 960,
+ 1088, 512, 512, 512, 512, 704, 832, 960, 1088, 576,
+ 576, 576, 576, 768, 896, 1024, 1152, 576, 576, 576,
+ 576, 768, 896, 1024, 1152, 640, 640, 640, 640, 832,
+ 960, 1088, 1216, 640, 640, 640, 640, 832, 960, 1088,
+ 1216, 704, 704, 704, 704, 896, 1024, 1152, 1280, 704,
+ 704, 704, 704, 896, 1024, 1152, 1280, 768, 768, 768,
+ 768, 960, 1088, 1216, 1344, 768, 768, 768, 768, 960,
+ 1088, 1216, 1344, 832, 832, 832, 832, 1024, 1152, 1280,
+ 1408, 832, 832, 832, 832, 1024, 1152, 1280, 1408, 896,
+ 896, 896, 896, 1088, 1216, 1344, 1472, 896, 896, 896,
+ 896, 1088, 1216, 1344, 1472, 960, 960, 960, 960, 1152,
+ 1280, 1408, 1536, 960, 960, 960, 960, 1152, 1280, 1408,
+ 1536, 1024, 1024, 1024, 1024, 1216, 1344, 1472, 1600,
+ 1024, 1024, 1024, 1024, 1216, 1344, 1472, 1600, 1088,
+ 1088, 1088, 1088, 1280, 1408, 1536, 1664, 1088, 1088,
+ 1088, 1088, 1280, 1408, 1536, 1664, 1152, 1152, 1152,
+ 1152, 1344, 1472, 1600, 1728, 1152, 1152, 1152, 1152,
+ 1344, 1472, 1600, 1728, 1216, 1216, 1216, 1216, 1408,
+ 1536, 1664, 1792, 1216, 1216, 1216, 1216, 1408, 1536,
+ 1664, 1792, 1280, 1280, 1280, 1280, 1472, 1600, 1728,
+ 1856, 1280, 1280, 1280, 1280, 1472, 1600, 1728, 1856,
+ 1344, 1344, 1344, 1344, 1536, 1664, 1792, 1920, 1344,
+ 1344, 1344, 1344, 1536, 1664, 1792, 1920, 1408, 1408,
+ 1408, 1408, 1600, 1728, 1856, 1984, 1408, 1408, 1408,
+ 1408, 1600, 1728, 1856, 1984, 1472, 1472, 1472, 1472,
+ 1664, 1792, 1920, 2048, 1472, 1472, 1472, 1472, 1664,
+ 1792, 1920, 2048, 1536, 1536, 1536, 1536, 1728, 1856,
+ 1984, 2112, 1536, 1536, 1536, 1536, 1728, 1856, 1984,
+ 2112, 1600, 1600, 1600, 1600, 1792, 1920, 2048, 2176,
+ 1600, 1600, 1600, 1600, 1792, 1920, 2048, 2176, 1664,
+ 1664, 1664, 1664, 1856, 1984, 2112, 2240, 1664, 1664,
+ 1664, 1664, 1856, 1984, 2112, 2240, 1728, 1728, 1728,
+ 1728, 1920, 2048, 2176, 2304, 1728, 1728, 1728, 1728,
+ 1920, 2048, 2176, 2304, 1792, 1792, 1792, 1792, 1984,
+ 2112, 2240, 2368, 1792, 1792, 1792, 1792, 1984, 2112,
+ 2240, 2368, 1856, 1856, 1856, 1856, 2048, 2176, 2304,
+ 2432, 1856, 1856, 1856, 1856, 2048, 2176, 2304, 2432,
+ 1920, 1920, 1920, 1920, 2112, 2240, 2368, 2496, 1920,
+ 1920, 1920, 1920, 2112, 2240, 2368, 2496, 1984, 1984,
+ 1984, 1984, 2176, 2304, 2432, 2560, 1984, 1984, 1984,
+ 1984, 2176, 2304, 2432, 2560, 2048, 2048, 2048, 2048,
+ 2240, 2368, 2496, 2624, 2048, 2048, 2048, 2048, 2240,
+ 2368, 2496, 2624, 2112, 2112, 2112, 2112, 2304, 2432,
+ 2560, 2688, 2112, 2112, 2112, 2112, 2304, 2432, 2560,
+ 2688, 2176, 2176, 2176, 2176, 2368, 2496, 2624, 2752,
+ 2176, 2176, 2176, 2176, 2368, 2496, 2624, 2752, 2240,
+ 2240, 2240, 2240, 2432, 2560, 2688, 2816, 2240, 2240,
+ 2240, 2240, 2432, 2560, 2688, 2816, 2304, 2304, 2304,
+ 2304, 2496, 2624, 2752, 2880, 2304, 2304, 2304, 2304,
+ 2496, 2624, 2752, 2880, 2368, 2368, 2368, 2368, 2560,
+ 2688, 2816, 2944, 2368, 2368, 2368, 2368, 2560, 2688,
+ 2816, 2944, 2432, 2432, 2432, 2432, 2624, 2752, 2880,
+ 3008, 2432, 2432, 2432, 2432, 2624, 2752, 2880, 3008,
+ 2496, 2496, 2496, 2496, 2688, 2816, 2944, 3072, 2496,
+ 2496, 2496, 2496, 2688, 2816, 2944, 3072, 2560, 2560,
+ 2560, 2560, 2752, 2880, 3008, 3136, 2560, 2560, 2560,
+ 2560, 2752, 2880, 3008, 3136, 2624, 2624, 2624, 2624,
+ 2816, 2944, 3072, 3200, 2624, 2624, 2624, 2624, 2816,
+ 2944, 3072, 3200, 2688, 2688, 2688, 2688, 2880, 3008,
+ 3136, 3264, 2688, 2688, 2688, 2688, 2880, 3008, 3136,
+ 3264, 2752, 2752, 2752, 2752, 2944, 3072, 3200, 3328,
+ 2752, 2752, 2752, 2752, 2944, 3072, 3200, 3328, 2816,
+ 2816, 2816, 2816, 3008, 3136, 3264, 3392, 2816, 2816,
+ 2816, 2816, 3008, 3136, 3264, 3392, 2880, 2880, 2880,
+ 2880, 3072, 3200, 3328, 3456, 2880, 2880, 2880, 2880,
+ 3072, 3200, 3328, 3456, 2944, 2944, 2944, 2944, 3136,
+ 3264, 3392, 3520, 2944, 2944, 2944, 2944, 3136, 3264,
+ 3392, 3520, 3008, 3008, 3008, 3008, 3200, 3328, 3456,
+ 3584, 3008, 3008, 3008, 3008, 3200, 3328, 3456, 3584,
+ 3072, 3072, 3072, 3072, 3264, 3392, 3520, 3648, 3072,
+ 3072, 3072, 3072, 3264, 3392, 3520, 3648, 3136, 3136,
+ 3136, 3136, 3328, 3456, 3584, 3712, 3136, 3136, 3136,
+ 3136, 3328, 3456, 3584, 3712, 3200, 3200, 3200, 3200,
+ 3392, 3520, 3648, 3776, 3200, 3200, 3200, 3200, 3392,
+ 3520, 3648, 3776, 3264, 3264, 3264, 3264, 3456, 3584,
+ 3712, 3840, 3264, 3264, 3264, 3264, 3456, 3584, 3712,
+ 3840, 3328, 3328, 3328, 3328, 3520, 3648, 3776, 3904,
+ 3328, 3328, 3328, 3328, 3520, 3648, 3776, 3904, 3392,
+ 3392, 3392, 3392, 3584, 3712, 3840, 3968, 3392, 3392,
+ 3392, 3392, 3584, 3712, 3840, 3968, 3456, 3456, 3456,
+ 3456, 3648, 3776, 3904, 4032, 3456, 3456, 3456, 3456,
+ 3648, 3776, 3904, 4032, 3520, 3520, 3520, 3520, 3712,
+ 3840, 3968, 4096, 3520, 3520, 3520, 3520, 3712, 3840,
+ 3968, 4096, 3584, 3584, 3584, 3584, 3776, 3904, 4032,
+ 4160, 3584, 3584, 3584, 3584, 3776, 3904, 4032, 4160,
+ 3648, 3648, 3648, 3648, 3840, 3968, 4096, 4224, 3648,
+ 3648, 3648, 3648, 3840, 3968, 4096, 4224, 3712, 3712,
+ 3712, 3712, 3904, 4032, 4160, 4288, 3712, 3712, 3712,
+ 3712, 3904, 4032, 4160, 4288, 3776, 3776, 3776, 3776,
+ 3968, 4096, 4224, 4352, 3776, 3776, 3776, 3776, 3968,
+ 4096, 4224, 4352, 3840, 3840, 3840, 3840, 4032, 4160,
+ 4288, 4416, 3840, 3840, 3840, 3840, 4032, 4160, 4288,
+ 4416, 3904, 3904, 3904, 3904, 4096, 4224, 4352, 4480,
+ 3904, 3904, 3904, 3904, 4096, 4224, 4352, 4480, 3968,
+ 3968, 3968, 3968, 4160, 4288, 4416, 4544, 3968, 3968,
+ 3968, 3968, 4160, 4288, 4416, 4544, 4032, 4032, 4032,
+ 4032, 4224, 4352, 4480, 4608, 4032, 4032, 4032, 4032,
+ 4224, 4352, 4480, 4608, 4096, 4096, 4096, 4096, 4288,
+ 4416, 4544, 4672, 4096, 4096, 4096, 4096, 4288, 4416,
+ 4544, 4672, 4160, 4160, 4160, 4160, 4352, 4480, 4608,
+ 4736, 4160, 4160, 4160, 4160, 4352, 4480, 4608, 4736,
+ 4224, 4224, 4224, 4224, 4416, 4544, 4672, 4800, 4224,
+ 4224, 4224, 4224, 4416, 4544, 4672, 4800, 4288, 4288,
+ 4288, 4288, 4480, 4608, 4736, 4864, 4288, 4288, 4288,
+ 4288, 4480, 4608, 4736, 4864, 4352, 4352, 4352, 4352,
+ 4544, 4672, 4800, 4928, 4352, 4352, 4352, 4352, 4544,
+ 4672, 4800, 4928, 4416, 4416, 4416, 4416, 4608, 4736,
+ 4864, 4992, 4416, 4416, 4416, 4416, 4608, 4736, 4864,
+ 4992, 4480, 4480, 4480, 4480, 4672, 4800, 4928, 5056,
+ 4480, 4480, 4480, 4480, 4672, 4800, 4928, 5056, 4544,
+ 4544, 4544, 4544, 4736, 4864, 4992, 5120, 4544, 4544,
+ 4544, 4544, 4736, 4864, 4992, 5120, 4608, 4608, 4608,
+ 4608, 4800, 4928, 5056, 5184, 4608, 4608, 4608, 4608,
+ 4800, 4928, 5056, 5184, 4672, 4672, 4672, 4672, 4864,
+ 4992, 5120, 5248, 4672, 4672, 4672, 4672, 4864, 4992,
+ 5120, 5248, 4736, 4736, 4736, 4736, 4928, 5056, 5184,
+ 5312, 4736, 4736, 4736, 4736, 4928, 5056, 5184, 5312,
+ 4800, 4800, 4800, 4800, 4992, 5120, 5248, 5376, 4800,
+ 4800, 4800, 4800, 4992, 5120, 5248, 5376, 4864, 4864,
+ 4864, 4864, 5056, 5184, 5312, 5440, 4864, 4864, 4864,
+ 4864, 5056, 5184, 5312, 5440, 4928, 4928, 4928, 4928,
+ 5120, 5248, 5376, 5504, 4928, 4928, 4928, 4928, 5120,
+ 5248, 5376, 5504, 4992, 4992, 4992, 4992, 5184, 5312,
+ 5440, 5568, 4992, 4992, 4992, 4992, 5184, 5312, 5440,
+ 5568, 5056, 5056, 5056, 5056, 5248, 5376, 5504, 5632,
+ 5056, 5056, 5056, 5056, 5248, 5376, 5504, 5632, 5120,
+ 5120, 5120, 5120, 5312, 5440, 5568, 5632, 5120, 5120,
+ 5120, 5120, 5312, 5440, 5568, 5632, 5184, 5184, 5184,
+ 5184, 5376, 5504, 5632, 5632, 5184, 5184, 5184, 5184,
+ 5376, 5504, 5632, 5632, 5248, 5248, 5248, 5248, 5440,
+ 5568, 5632, 5632, 5248, 5248, 5248, 5248, 5440, 5568,
+ 5632, 5632, 5312, 5312, 5312, 5312, 5504, 5632, 5632,
+ 5632, 5312, 5312, 5312, 5312, 5504, 5632, 5632, 5632,
+ 5376, 5376, 5376, 5376, 5568, 5632, 5632, 5632, 5376,
+ 5376, 5376, 5376, 5568, 5632, 5632, 5632, 5440, 5440,
+ 5440, 5440, 5632, 5632, 5632, 5632, 5440, 5440, 5440,
+ 5440, 5632, 5632, 5632, 5632, 5504, 5504, 5504, 5504,
+ 5632, 5632, 5632, 5632, 5504, 5504, 5504, 5504, 5632,
+ 5632, 5632, 5632, 5568, 5568, 5568, 5568, 5632, 5632,
+ 5632, 5632, 5568, 5568, 5568, 5568, 5632, 5632, 5632,
+ 5632
+};
+
+static const int filterData2[1424] = {
+ 0, 2, 4, 6, 7, 9, 11, 13, 0, -2, -4, -6, -7, -9, -11,
+ -13, 1, 3, 5, 7, 9, 11, 13, 15, -1, -3, -5, -7, -9,
+ -11, -13, -15, 1, 3, 5, 7, 10, 12, 14, 16, -1, -3, -5,
+ -7, -10, -12, -14, -16, 1, 3, 6, 8, 11, 13, 16, 18,
+ -1, -3, -6, -8, -11, -13, -16, -18, 1, 4, 6, 9, 12,
+ 15, 17, 20, -1, -4, -6, -9, -12, -15, -17, -20, 1, 4,
+ 7, 10, 13, 16, 19, 22, -1, -4, -7, -10, -13, -16, -19,
+ -22, 1, 4, 8, 11, 14, 17, 21, 24, -1, -4, -8, -11, -14,
+ -17, -21, -24, 1, 5, 8, 12, 15, 19, 22, 26, -1, -5,
+ -8, -12, -15, -19, -22, -26, 2, 6, 10, 14, 18, 22, 26,
+ 30, -2, -6, -10, -14, -18, -22, -26, -30, 2, 6, 10,
+ 14, 19, 23, 27, 31, -2, -6, -10, -14, -19, -23, -27,
+ -31, 2, 7, 11, 16, 21, 26, 30, 35, -2, -7, -11, -16,
+ -21, -26, -30, -35, 2, 7, 13, 18, 23, 28, 34, 39, -2,
+ -7, -13, -18, -23, -28, -34, -39, 2, 8, 14, 20, 25,
+ 31, 37, 43, -2, -8, -14, -20, -25, -31, -37, -43, 3,
+ 9, 15, 21, 28, 34, 40, 46, -3, -9, -15, -21, -28, -34,
+ -40, -46, 3, 10, 17, 24, 31, 38, 45, 52, -3, -10, -17,
+ -24, -31, -38, -45, -52, 3, 11, 19, 27, 34, 42, 50,
+ 58, -3, -11, -19, -27, -34, -42, -50, -58, 4, 12, 21,
+ 29, 38, 46, 55, 63, -4, -12, -21, -29, -38, -46, -55,
+ -63, 4, 13, 23, 32, 41, 50, 60, 69, -4, -13, -23, -32,
+ -41, -50, -60, -69, 5, 15, 25, 35, 46, 56, 66, 76, -5,
+ -15, -25, -35, -46, -56, -66, -76, 5, 16, 28, 39, 50,
+ 61, 73, 84, -5, -16, -28, -39, -50, -61, -73, -84, 6,
+ 18, 31, 43, 56, 68, 81, 93, -6, -18, -31, -43, -56,
+ -68, -81, -93, 6, 20, 34, 48, 61, 75, 89, 103, -6, -20,
+ -34, -48, -61, -75, -89, -103, 7, 22, 37, 52, 67, 82,
+ 97, 112, -7, -22, -37, -52, -67, -82, -97, -112, 8,
+ 24, 41, 57, 74, 90, 107, 123, -8, -24, -41, -57, -74,
+ -90, -107, -123, 9, 27, 45, 63, 82, 100, 118, 136, -9,
+ -27, -45, -63, -82, -100, -118, -136, 10, 30, 50, 70,
+ 90, 110, 130, 150, -10, -30, -50, -70, -90, -110, -130,
+ -150, 11, 33, 55, 77, 99, 121, 143, 165, -11, -33, -55,
+ -77, -99, -121, -143, -165, 12, 36, 60, 84, 109, 133,
+ 157, 181, -12, -36, -60, -84, -109, -133, -157, -181,
+ 13, 40, 66, 93, 120, 147, 173, 200, -13, -40, -66, -93,
+ -120, -147, -173, -200, 14, 44, 73, 103, 132, 162, 191,
+ 221, -14, -44, -73, -103, -132, -162, -191, -221, 16,
+ 48, 81, 113, 146, 178, 211, 243, -16, -48, -81, -113,
+ -146, -178, -211, -243, 17, 53, 89, 125, 160, 196, 232,
+ 268, -17, -53, -89, -125, -160, -196, -232, -268, 19,
+ 58, 98, 137, 176, 215, 255, 294, -19, -58, -98, -137,
+ -176, -215, -255, -294, 21, 64, 108, 151, 194, 237,
+ 281, 324, -21, -64, -108, -151, -194, -237, -281, -324,
+ 23, 71, 118, 166, 213, 261, 308, 356, -23, -71, -118,
+ -166, -213, -261, -308, -356, 26, 78, 130, 182, 235,
+ 287, 339, 391, -26, -78, -130, -182, -235, -287, -339,
+ -391, 28, 86, 143, 201, 258, 316, 373, 431, -28, -86,
+ -143, -201, -258, -316, -373, -431, 31, 94, 158, 221,
+ 284, 347, 411, 474, -31, -94, -158, -221, -284, -347,
+ -411, -474, 34, 104, 174, 244, 313, 383, 453, 523, -34,
+ -104, -174, -244, -313, -383, -453, -523, 38, 115, 191,
+ 268, 345, 422, 498, 575, -38, -115, -191, -268, -345,
+ -422, -498, -575, 42, 126, 210, 294, 379, 463, 547,
+ 631, -42, -126, -210, -294, -379, -463, -547, -631,
+ 46, 139, 231, 324, 417, 510, 602, 695, -46, -139, -231,
+ -324, -417, -510, -602, -695, 51, 153, 255, 357, 459,
+ 561, 663, 765, -51, -153, -255, -357, -459, -561, -663,
+ -765, 56, 168, 280, 392, 505, 617, 729, 841, -56, -168,
+ -280, -392, -505, -617, -729, -841, 61, 185, 308, 432,
+ 555, 679, 802, 926, -61, -185, -308, -432, -555, -679,
+ -802, -926, 68, 204, 340, 476, 612, 748, 884, 1020,
+ -68, -204, -340, -476, -612, -748, -884, -1020, 74,
+ 224, 373, 523, 672, 822, 971, 1121, -74, -224, -373,
+ -523, -672, -822, -971, -1121, 82, 246, 411, 575, 740,
+ 904, 1069, 1233, -82, -246, -411, -575, -740, -904,
+ -1069, -1233, 90, 271, 452, 633, 814, 995, 1176, 1357,
+ -90, -271, -452, -633, -814, -995, -1176, -1357, 99,
+ 298, 497, 696, 895, 1094, 1293, 1492, -99, -298, -497,
+ -696, -895, -1094, -1293, -1492, 109, 328, 547, 766,
+ 985, 1204, 1423, 1642, -109, -328, -547, -766, -985,
+ -1204, -1423, -1642, 120, 361, 601, 842, 1083, 1324,
+ 1564, 1805, -120, -361, -601, -842, -1083, -1324, -1564,
+ -1805, 132, 397, 662, 927, 1192, 1457, 1722, 1987, -132,
+ -397, -662, -927, -1192, -1457, -1722, -1987, 145, 437,
+ 728, 1020, 1311, 1603, 1894, 2186, -145, -437, -728,
+ -1020, -1311, -1603, -1894, -2186, 160, 480, 801, 1121,
+ 1442, 1762, 2083, 2403, -160, -480, -801, -1121, -1442,
+ -1762, -2083, -2403, 176, 529, 881, 1234, 1587, 1940,
+ 2292, 2645, -176, -529, -881, -1234, -1587, -1940, -2292,
+ -2645, 194, 582, 970, 1358, 1746, 2134, 2522, 2910,
+ -194, -582, -970, -1358, -1746, -2134, -2522, -2910,
+ 213, 640, 1066, 1493, 1920, 2347, 2773, 3200, -213,
+ -640, -1066, -1493, -1920, -2347, -2773, -3200, 234,
+ 704, 1173, 1643, 2112, 2582, 3051, 3521, -234, -704,
+ -1173, -1643, -2112, -2582, -3051, -3521, 258, 774,
+ 1291, 1807, 2324, 2840, 3357, 3873, -258, -774, -1291,
+ -1807, -2324, -2840, -3357, -3873, 284, 852, 1420, 1988,
+ 2556, 3124, 3692, 4260, -284, -852, -1420, -1988, -2556,
+ -3124, -3692, -4260, 312, 937, 1561, 2186, 2811, 3436,
+ 4060, 4685, -312, -937, -1561, -2186, -2811, -3436,
+ -4060, -4685, 343, 1030, 1718, 2405, 3092, 3779, 4467,
+ 5154, -343, -1030, -1718, -2405, -3092, -3779, -4467,
+ -5154, 378, 1134, 1890, 2646, 3402, 4158, 4914, 5670,
+ -378, -1134, -1890, -2646, -3402, -4158, -4914, -5670,
+ 415, 1247, 2079, 2911, 3742, 4574, 5406, 6238, -415,
+ -1247, -2079, -2911, -3742, -4574, -5406, -6238, 457,
+ 1372, 2287, 3202, 4117, 5032, 5947, 6862, -457, -1372,
+ -2287, -3202, -4117, -5032, -5947, -6862, 503, 1509,
+ 2516, 3522, 4529, 5535, 6542, 7548, -503, -1509, -2516,
+ -3522, -4529, -5535, -6542, -7548, 553, 1660, 2767,
+ 3874, 4981, 6088, 7195, 8302, -553, -1660, -2767, -3874,
+ -4981, -6088, -7195, -8302, 608, 1826, 3044, 4262, 5479,
+ 6697, 7915, 9133, -608, -1826, -3044, -4262, -5479,
+ -6697, -7915, -9133, 669, 2009, 3348, 4688, 6027, 7367,
+ 8706, 10046, -669, -2009, -3348, -4688, -6027, -7367,
+ -8706, -10046, 736, 2210, 3683, 5157, 6630, 8104, 9577,
+ 11051, -736, -2210, -3683, -5157, -6630, -8104, -9577,
+ -11051, 810, 2431, 4052, 5673, 7294, 8915, 10536, 12157,
+ -810, -2431, -4052, -5673, -7294, -8915, -10536, -12157,
+ 891, 2674, 4457, 6240, 8023, 9806, 11589, 13372, -891,
+ -2674, -4457, -6240, -8023, -9806, -11589, -13372, 980,
+ 2941, 4903, 6864, 8825, 10786, 12748, 14709, -980, -2941,
+ -4903, -6864, -8825, -10786, -12748, -14709, 1078, 3236,
+ 5393, 7551, 9708, 11866, 14023, 16181, -1078, -3236,
+ -5393, -7551, -9708, -11866, -14023, -16181, 1186, 3559,
+ 5933, 8306, 10679, 13052, 15426, 17799, -1186, -3559,
+ -5933, -8306, -10679, -13052, -15426, -17799, 1305,
+ 3915, 6526, 9136, 11747, 14357, 16968, 19578, -1305,
+ -3915, -6526, -9136, -11747, -14357, -16968, -19578,
+ 1435, 4307, 7179, 10051, 12922, 15794, 18666, 21538,
+ -1435, -4307, -7179, -10051, -12922, -15794, -18666,
+ -21538, 1579, 4738, 7896, 11055, 14214, 17373, 20531,
+ 23690, -1579, -4738, -7896, -11055, -14214, -17373,
+ -20531, -23690, 1737, 5212, 8686, 12161, 15636, 19111,
+ 22585, 26060, -1737, -5212, -8686, -12161, -15636, -19111,
+ -22585, -26060, 1911, 5733, 9555, 13377, 17200, 21022,
+ 24844, 28666, -1911, -5733, -9555, -13377, -17200, -21022,
+ -24844, -28666, 2102, 6306, 10511, 14715, 18920, 23124,
+ 27329, 31533, -2102, -6306, -10511, -14715, -18920,
+ -23124, -27329, -31533, 2312, 6937, 11562, 16187, 20812,
+ 25437, 30062, 32767, -2312, -6937, -11562, -16187, -20812,
+ -25437, -30062, -32767, 2543, 7631, 12718, 17806, 22893,
+ 27981, 32767, 32767, -2543, -7631, -12718, -17806, -22893,
+ -27981, -32767, -32767, 2798, 8394, 13990, 19586, 25183,
+ 30779, 32767, 32767, -2798, -8394, -13990, -19586, -25183,
+ -30779, -32767, -32767, 3077, 9233, 15389, 21545, 27700,
+ 32767, 32767, 32767, -3077, -9233, -15389, -21545, -27700,
+ -32767, -32767, -32767, 3385, 10157, 16928, 23700, 30471,
+ 32767, 32767, 32767, -3385, -10157, -16928, -23700,
+ -30471, -32767, -32767, -32767, 3724, 11172, 18621,
+ 26069, 32767, 32767, 32767, 32767, -3724, -11172, -18621,
+ -26069, -32767, -32767, -32767, -32767, 4095, 12287,
+ 20479, 28671, 32767, 32767, 32767, 32767, -4095, -12287,
+ -20479, -28671, -32767, -32767, -32767, -32767
+};
+
+static const int p1s[17] = { 0, 4, 3, 4, 2, 4, 3, 4, 1, 4, 3, 4, 2, 4, 3, 4, 0 };
+static const int p2s[17] = { 0, 1, 1, 3, 1, 5, 3, 7, 1, 9, 5, 11, 3, 13, 7, 15, 1 };
+
+static void soundFilter(byte *data, int16 *buffer, int p1, int p2);
+
+void SoundManager::applyFilter(SoundEntry *entry, int16 *buffer) {
+ if ((((byte *)entry->soundData)[1] << 6) > 0x1600) {
+ entry->status.status |= 0x20000000;
+ } else {
+ int variant = entry->status.status & 0x1f;
+
+ soundFilter((byte *)entry->soundData, buffer, p1s[variant], p2s[variant]);
+ }
+}
+
+
+static void soundFilter(byte *data, int16 *buffer, int p1, int p2) {
+ int data1, data2, data1p, data2p;
+ byte idx;
+
+ data2 = data[0];
+ data1 = data[1] << 6;
+
+ data += 2;
+
+ for (int count = 0; count < 735; count++) {
+ idx = data[count] >> 4;
+ data1p = filterData[idx + data1];
+ data2p = CLIP(filterData2[idx + data1] + data2, -32767, 32767);
+
+ buffer[2 * count] = (p2 * data2p) >> p1;
+
+ idx = data[count] & 0xF;
+
+ data1 = filterData[idx + data1p];
+ data2 = CLIP(filterData2[idx + data1p] + data2p, -32767, 32767);
+ buffer[2 * count + 1] = (p2 * data2) >> p1;
+ }
+}
+
+
} // End of namespace LastExpress
diff --git a/engines/lastexpress/game/sound.h b/engines/lastexpress/game/sound.h
index ddafc21829..839c868813 100644
--- a/engines/lastexpress/game/sound.h
+++ b/engines/lastexpress/game/sound.h
@@ -246,14 +246,14 @@ private:
struct SoundEntry {
SoundStatusUnion status;
SoundType type; // int
- //int field_8;
- //int field_C;
- int processedFrameCount;
+ //int data;
+ //int endOffset;
+ int currentDataPtr;
void *soundData;
- //int field_18;
- int field_1C;
+ //int currentBufferPtr;
+ int blockCount;
uint32 time;
- //int field_24;
+ //int size;
//int field_28;
Common::SeekableReadStream *stream; // int
//int field_30;
@@ -276,10 +276,10 @@ private:
status.status = 0;
type = kSoundTypeNone;
- processedFrameCount = 0;
+ currentDataPtr = 0;
soundData = NULL;
- field_1C = 0;
+ blockCount = 0;
time = 0;
stream = NULL;
@@ -381,7 +381,7 @@ private:
void drawSubtitleOnScreen(SubtitleEntry *subtitle);
// Sound filter
- void applyFilter(SoundEntry *entry, SoundBuffer buffer);
+ void applyFilter(SoundEntry *entry, int16 *buffer);
};
} // End of namespace LastExpress
diff --git a/engines/lure/res_struct.h b/engines/lure/res_struct.h
index 49b6ef78ba..8d6c557297 100644
--- a/engines/lure/res_struct.h
+++ b/engines/lure/res_struct.h
@@ -470,7 +470,7 @@ public:
bool isEmpty() const { return _actions.begin() == _actions.end(); }
void clear() { _actions.clear(); }
CurrentActionEntry &top() { return **_actions.begin(); }
- CurrentActionEntry &bottom() {
+ CurrentActionEntry &bottom() {
ActionsList::iterator i = _actions.end();
--i;
return **i;
diff --git a/engines/m4/animation.cpp b/engines/m4/animation.cpp
index 39a3f175cd..4f315dd396 100644
--- a/engines/m4/animation.cpp
+++ b/engines/m4/animation.cpp
@@ -91,7 +91,7 @@ void MadsAnimation::initialize(const Common::String &filename, uint16 flags, M4S
_scrollY = animStream->readSint16LE();
_scrollTicks = animStream->readUint16LE();
animStream->skip(8);
-
+
animStream->read(buffer, FILENAME_SIZE);
buffer[FILENAME_SIZE] = '\0';
_interfaceFile = Common::String(buffer);
@@ -230,7 +230,7 @@ void MadsAnimation::initialize(const Common::String &filename, uint16 flags, M4S
// Load all the sprite sets for the animation
for (int i = 0; i < spriteListCount; ++i) {
if (_field12 && (i == _spriteListIndex))
- // Skip over field, since it's manually loaded
+ // Skip over field, since it's manually loaded
continue;
_spriteListIndexes[i] = _view->_spriteSlots.addSprites(_spriteSetNames[i].c_str());
@@ -242,7 +242,7 @@ void MadsAnimation::initialize(const Common::String &filename, uint16 flags, M4S
if (madsRes)
resName += "*";
resName += _spriteSetNames[_spriteListIndex];
-
+
_spriteListIndexes[_spriteListIndex] = _view->_spriteSlots.addSprites(resName.c_str());
}
@@ -298,7 +298,7 @@ void MadsAnimation::update() {
if (_field12) {
int spriteListIndex = _spriteListIndexes[_spriteListIndex];
int newIndex = -1;
-
+
for (uint idx = _oldFrameEntry; idx < _frameEntries.size(); ++idx) {
if (_frameEntries[idx].frameNumber > _currentFrame)
break;
@@ -378,7 +378,7 @@ void MadsAnimation::update() {
if (_frameEntries[_oldFrameEntry].frameNumber > _currentFrame)
break;
else if (_frameEntries[_oldFrameEntry].frameNumber == _currentFrame) {
- // Found the correct frame
+ // Found the correct frame
int spriteSlotIndex = 0;
int index = 0;
@@ -393,14 +393,14 @@ void MadsAnimation::update() {
}
++index;
continue;
- }
-
+ }
+
if (spriteSlotIndex == 0) {
int slotIndex = _view->_spriteSlots.getIndex();
MadsSpriteSlot &slot = _view->_spriteSlots[slotIndex];
slot.copy(_frameEntries[_oldFrameEntry].spriteSlot);
slot.seqIndex = _frameEntries[_oldFrameEntry].seqIndex + 0x80;
-
+
SpriteAsset &spriteSet = _view->_spriteSlots.getSprite(
_view->_spriteSlots[slotIndex].spriteListIndex);
slot.spriteType = spriteSet.isBackground() ? BACKGROUND_SPRITE : FOREGROUND_SPRITE;
@@ -408,7 +408,7 @@ void MadsAnimation::update() {
break;
}
}
-
+
++_oldFrameEntry;
}
diff --git a/engines/m4/assets.cpp b/engines/m4/assets.cpp
index 8ffdeb53e0..d6cc71e133 100644
--- a/engines/m4/assets.cpp
+++ b/engines/m4/assets.cpp
@@ -97,8 +97,8 @@ long *DataAsset::getRow(int index) {
return &_data[_recSize * index];
}
-SpriteAsset::SpriteAsset(MadsM4Engine *vm, Common::SeekableReadStream* stream, int size, const char *name,
- bool asStream, int flags) :
+SpriteAsset::SpriteAsset(MadsM4Engine *vm, Common::SeekableReadStream* stream, int size, const char *name,
+ bool asStream, int flags) :
BaseAsset(vm) {
_stream = stream;
_palInterface = NULL;
@@ -285,7 +285,7 @@ void SpriteAsset::loadMadsSpriteAsset(MadsM4Engine *vm, Common::SeekableReadStre
// Load the frame
Common::MemoryReadStream *rs = new Common::MemoryReadStream(destData, frameSizes[curFrame]);
- _frames[curFrame].frame = new M4Sprite(rs, _frames[curFrame].x, _frames[curFrame].y,
+ _frames[curFrame].frame = new M4Sprite(rs, _frames[curFrame].x, _frames[curFrame].y,
_frames[curFrame].w, _frames[curFrame].h, false);
delete rs;
@@ -634,7 +634,7 @@ MadsSpriteSetCharInfo::MadsSpriteSetCharInfo(Common::SeekableReadStream *s) {
_totalFrames = s->readByte();
s->skip(1);
_numEntries = s->readUint16LE();
-
+
for (int i = 0; i < 16; ++i)
_frameList[i] = s->readUint16LE();
for (int i = 0; i < 16; ++i)
diff --git a/engines/m4/assets.h b/engines/m4/assets.h
index 90670dde53..25996a421e 100644
--- a/engines/m4/assets.h
+++ b/engines/m4/assets.h
@@ -115,7 +115,7 @@ public:
class SpriteAsset : public BaseAsset {
public:
- SpriteAsset(MadsM4Engine *vm, Common::SeekableReadStream* stream, int size, const char *name,
+ SpriteAsset(MadsM4Engine *vm, Common::SeekableReadStream* stream, int size, const char *name,
bool asStream = false, int flags = 0);
SpriteAsset(MadsM4Engine *vm, const char *name);
~SpriteAsset();
@@ -151,7 +151,7 @@ protected:
Common::Array<uint32> _frameOffsets;
Common::Array<SpriteAssetFrame> _frames;
uint32 _frameStartOffset;
-
+
// MADS sprite set fields
uint8 _mode;
bool _isBackground;
diff --git a/engines/m4/detection.cpp b/engines/m4/detection.cpp
index 02ed967777..9c359c081f 100644
--- a/engines/m4/detection.cpp
+++ b/engines/m4/detection.cpp
@@ -79,7 +79,7 @@ static const M4GameDescription gameDescriptions[] = {
},
Common::EN_ANY,
Common::kPlatformPC,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
GUIO_NONE
},
GType_Burger,
@@ -95,7 +95,7 @@ static const M4GameDescription gameDescriptions[] = {
},
Common::DE_DEU,
Common::kPlatformPC,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
GUIO_NONE
},
GType_Burger,
@@ -111,7 +111,7 @@ static const M4GameDescription gameDescriptions[] = {
},
Common::RU_RUS,
Common::kPlatformPC,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
GUIO_NONE
},
GType_Burger,
@@ -127,7 +127,7 @@ static const M4GameDescription gameDescriptions[] = {
},
Common::EN_ANY,
Common::kPlatformPC,
- ADGF_DEMO,
+ ADGF_DEMO | ADGF_UNSTABLE,
GUIO_NONE
},
GType_Burger,
@@ -143,7 +143,7 @@ static const M4GameDescription gameDescriptions[] = {
},
Common::EN_ANY,
Common::kPlatformPC,
- ADGF_DEMO,
+ ADGF_DEMO | ADGF_UNSTABLE,
GUIO_NONE
},
GType_Burger,
@@ -159,7 +159,7 @@ static const M4GameDescription gameDescriptions[] = {
},
Common::EN_ANY,
Common::kPlatformPC,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
GUIO_NONE
},
GType_Riddle,
@@ -175,7 +175,7 @@ static const M4GameDescription gameDescriptions[] = {
},
Common::EN_ANY,
Common::kPlatformPC,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
GUIO_NONE
},
GType_Riddle,
@@ -191,7 +191,7 @@ static const M4GameDescription gameDescriptions[] = {
},
Common::DE_DEU,
Common::kPlatformPC,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
GUIO_NONE
},
GType_Riddle,
@@ -207,7 +207,7 @@ static const M4GameDescription gameDescriptions[] = {
},
Common::FR_FRA,
Common::kPlatformPC,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
GUIO_NONE
},
GType_Riddle,
@@ -223,7 +223,7 @@ static const M4GameDescription gameDescriptions[] = {
},
Common::ES_ESP,
Common::kPlatformPC,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
GUIO_NONE
},
GType_Riddle,
@@ -239,7 +239,7 @@ static const M4GameDescription gameDescriptions[] = {
},
Common::EN_ANY,
Common::kPlatformPC,
- ADGF_DEMO,
+ ADGF_DEMO | ADGF_UNSTABLE,
GUIO_NONE
},
GType_Riddle,
@@ -255,7 +255,7 @@ static const M4GameDescription gameDescriptions[] = {
},
Common::EN_ANY,
Common::kPlatformPC,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
GUIO_NOSPEECH
},
GType_RexNebular,
@@ -271,7 +271,7 @@ static const M4GameDescription gameDescriptions[] = {
},
Common::EN_ANY,
Common::kPlatformPC,
- ADGF_DEMO,
+ ADGF_DEMO | ADGF_UNSTABLE,
GUIO_NONE
},
GType_RexNebular,
@@ -287,7 +287,7 @@ static const M4GameDescription gameDescriptions[] = {
},
Common::EN_ANY,
Common::kPlatformPC,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
GUIO_NOSPEECH
},
GType_DragonSphere,
@@ -304,7 +304,7 @@ static const M4GameDescription gameDescriptions[] = {
},
Common::EN_ANY,
Common::kPlatformPC,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
GUIO_NONE
},
GType_DragonSphere,
@@ -320,7 +320,7 @@ static const M4GameDescription gameDescriptions[] = {
},
Common::EN_ANY,
Common::kPlatformPC,
- ADGF_DEMO,
+ ADGF_DEMO | ADGF_UNSTABLE,
GUIO_NONE
},
GType_DragonSphere,
@@ -336,7 +336,7 @@ static const M4GameDescription gameDescriptions[] = {
},
Common::EN_ANY,
Common::kPlatformPC,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
GUIO_NOSPEECH
},
GType_Phantom,
@@ -352,7 +352,7 @@ static const M4GameDescription gameDescriptions[] = {
},
Common::EN_ANY,
Common::kPlatformPC,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
GUIO_NONE
},
GType_Phantom,
@@ -368,7 +368,7 @@ static const M4GameDescription gameDescriptions[] = {
},
Common::EN_ANY,
Common::kPlatformPC,
- ADGF_DEMO,
+ ADGF_DEMO | ADGF_UNSTABLE,
GUIO_NONE
},
GType_Phantom,
diff --git a/engines/m4/dialogs.cpp b/engines/m4/dialogs.cpp
index afe2692753..390ca711d1 100644
--- a/engines/m4/dialogs.cpp
+++ b/engines/m4/dialogs.cpp
@@ -532,7 +532,7 @@ void Dialog::display(MadsM4Engine *vm, int widthChars, const char **descEntries)
}
dlg->_lines[0].underline = true;
-
+
dlg->draw();
vm->_viewManager->addView(dlg);
vm->_viewManager->moveToFront(dlg);
@@ -554,7 +554,7 @@ void Dialog::getValue(MadsM4Engine *vm, const char *title, const char *text, int
vm->_viewManager->moveToFront(dlg);
// TODO: How to wait until the dialog is closed
-
+
}
} // End of namespace M4
diff --git a/engines/m4/events.cpp b/engines/m4/events.cpp
index f8225fba3e..b476d08c9c 100644
--- a/engines/m4/events.cpp
+++ b/engines/m4/events.cpp
@@ -253,7 +253,7 @@ bool Mouse::setCursorNum(int cursorIndex) {
_cursor = _cursorSprites->getFrame(cursorIndex);
// Set the cursor to the sprite
- CursorMan.replaceCursor((const byte *)_cursor->getBasePtr(), _cursor->width(), _cursor->height(),
+ CursorMan.replaceCursor((const byte *)_cursor->getBasePtr(), _cursor->width(), _cursor->height(),
_cursor->xOffset, _cursor->yOffset, TRANSPARENT_COLOR_INDEX);
return true;
diff --git a/engines/m4/font.h b/engines/m4/font.h
index b00a393811..5a9c73e5d5 100644
--- a/engines/m4/font.h
+++ b/engines/m4/font.h
@@ -108,7 +108,7 @@ public:
Font *getFont(const char *filename);
void setFont(const char *filename);
- Font *current() {
+ Font *current() {
assert(_currentFont);
return _currentFont;
}
diff --git a/engines/m4/globals.cpp b/engines/m4/globals.cpp
index bf2c3abe1c..f4aab8ae8f 100644
--- a/engines/m4/globals.cpp
+++ b/engines/m4/globals.cpp
@@ -414,7 +414,7 @@ const char *MadsGlobals::loadMessage(uint index) {
}
/**
- * Adds the specified scene number to list of scenes previously visited
+ * Adds the specified scene number to list of scenes previously visited
*/
void MadsGlobals::addVisitedScene(int newSceneNumber) {
if (!isSceneVisited(newSceneNumber))
@@ -539,7 +539,7 @@ void MadsObject::load(Common::SeekableReadStream *stream) {
}
void MadsObject::setRoom(int roomNumber) {
-
+
}
} // End of namespace M4
diff --git a/engines/m4/graphics.cpp b/engines/m4/graphics.cpp
index 786c975850..4c272de32c 100644
--- a/engines/m4/graphics.cpp
+++ b/engines/m4/graphics.cpp
@@ -408,7 +408,7 @@ void M4Surface::copyFrom(M4Surface *src, const Common::Rect &srcBounds, int dest
* Copies a given image onto a destination surface with scaling, transferring only pixels that meet
* the specified depth requirement on a secondary surface contain depth information
*/
-void M4Surface::copyFrom(M4Surface *src, int destX, int destY, int depth,
+void M4Surface::copyFrom(M4Surface *src, int destX, int destY, int depth,
M4Surface *depthsSurface, int scale, int transparentColor) {
if (scale == 100) {
@@ -451,7 +451,7 @@ void M4Surface::copyFrom(M4Surface *src, int destX, int destY, int depth,
}
src->freeData();
- depthsSurface->freeData();
+ depthsSurface->freeData();
return;
}
@@ -501,7 +501,7 @@ void M4Surface::copyFrom(M4Surface *src, int destX, int destY, int depth,
widthAmount -= destRight;
if (widthAmount > 0)
spriteWidth -= widthAmount;
-
+
int spriteRight = spriteLeft + spriteWidth;
if (spriteWidth <= 0)
return;
@@ -568,7 +568,7 @@ void M4Surface::copyFrom(M4Surface *src, int destX, int destY, int depth,
}
src->freeData();
- depthsSurface->freeData();
+ depthsSurface->freeData();
this->freeData();
}
@@ -919,7 +919,7 @@ void M4Surface::scrollY(int yAmount) {
// Vertically shift all the lines
Common::copy(pixelsP + (pitch * ySize), pixelsP + (pitch * height()), pixelsP);
// Transfer the buffered lines to the bottom of the screen
- Common::copy(tempData, tempData + blockSize, pixelsP + (pitch * (height() - ySize)));
+ Common::copy(tempData, tempData + blockSize, pixelsP + (pitch * (height() - ySize)));
}
::free(tempData);
@@ -945,7 +945,7 @@ void M4Surface::translate(RGBList *list, bool isTransparent) {
M4Surface *M4Surface::flipHorizontal() const {
M4Surface *dest = new M4Surface(width(), height());
dest->_rgbList = (this->_rgbList == NULL) ? NULL : this->_rgbList->clone();
-
+
byte *destP = dest->getBasePtr();
for (int y = 0; y < height(); ++y) {
diff --git a/engines/m4/graphics.h b/engines/m4/graphics.h
index 242857ba1a..f3dde454f3 100644
--- a/engines/m4/graphics.h
+++ b/engines/m4/graphics.h
@@ -170,7 +170,7 @@ public:
void frameRect(const Common::Rect &r, uint8 color);
void fillRect(const Common::Rect &r, uint8 color);
void copyFrom(M4Surface *src, const Common::Rect &srcBounds, int destX, int destY, int transparentColor = -1);
- void copyFrom(M4Surface *src, int destX, int destY, int depth, M4Surface *depthSurface,
+ void copyFrom(M4Surface *src, int destX, int destY, int depth, M4Surface *depthSurface,
int scale, int transparentColor = -1);
void update() {
diff --git a/engines/m4/m4.cpp b/engines/m4/m4.cpp
index 93f5ab4cba..efc7943114 100644
--- a/engines/m4/m4.cpp
+++ b/engines/m4/m4.cpp
@@ -259,7 +259,7 @@ void MadsM4Engine::dumpFile(const char *filename, bool uncompress) {
Common::DumpFile f;
byte buffer[DUMP_BUFFER_SIZE];
Common::SeekableReadStream *fileS = res()->get(filename);
-
+
if (!f.open(filename))
error("Could not open '%s' for writing", filename);
diff --git a/engines/m4/m4.h b/engines/m4/m4.h
index 18c3936db8..46107cb20a 100644
--- a/engines/m4/m4.h
+++ b/engines/m4/m4.h
@@ -94,7 +94,7 @@ class Animation;
enum M4GameType {
GType_Riddle = 1,
GType_Burger = 2,
- GType_RexNebular = 3,
+ GType_RexNebular = 3,
GType_DragonSphere = 4,
GType_Phantom = 5
};
diff --git a/engines/m4/m4_views.cpp b/engines/m4/m4_views.cpp
index 4eb84a7488..78c409252b 100644
--- a/engines/m4/m4_views.cpp
+++ b/engines/m4/m4_views.cpp
@@ -217,7 +217,7 @@ const char *INTERFACE_SERIES = "999intr";
#define SPR(x) _sprites->getFrame(x)
-M4InterfaceView::M4InterfaceView(MadsM4Engine *vm):
+M4InterfaceView::M4InterfaceView(MadsM4Engine *vm):
GameInterfaceView(vm, Common::Rect(0, vm->_screen->height() - INTERFACE_HEIGHT,
vm->_screen->width(), vm->_screen->height())),
_statusText(GUITextField(this, Common::Rect(200, 1, 450, 21))),
diff --git a/engines/m4/mads_anim.cpp b/engines/m4/mads_anim.cpp
index d35b31943a..2ea576dfa4 100644
--- a/engines/m4/mads_anim.cpp
+++ b/engines/m4/mads_anim.cpp
@@ -536,7 +536,7 @@ void AnimviewView::updateState() {
// Clear up current background and sprites
_backgroundSurface.reset();
clearLists();
-
+
// Reset flags
_startFrame = -1;
diff --git a/engines/m4/mads_logic.cpp b/engines/m4/mads_logic.cpp
index b1e57bd7f3..cc28a26e68 100644
--- a/engines/m4/mads_logic.cpp
+++ b/engines/m4/mads_logic.cpp
@@ -177,7 +177,7 @@ void MadsSceneLogic::initializeDataMap() {
uint32 MadsSceneLogic::getDataValue(int dataId) {
switch (dataId) {
- case 1:
+ case 1:
return _madsVm->scene()->_abortTimersMode2;
case 2:
return _madsVm->scene()->_abortTimers;
@@ -208,7 +208,7 @@ uint32 MadsSceneLogic::getDataValue(int dataId) {
void MadsSceneLogic::setDataValue(int dataId, uint16 dataValue) {
switch (dataId) {
- case 1:
+ case 1:
_madsVm->scene()->_abortTimersMode2 = (AbortTimerMode)dataValue;
break;
case 2:
@@ -297,7 +297,7 @@ uint16 MadsSceneLogic::startReversibleSpriteSequence(uint16 srcSpriteIdx, bool f
uint8 depth = _madsVm->_rails->getDepth(Common::Point(spriteFrame->x + (spriteFrame->width() / 2),
spriteFrame->y + (spriteFrame->height() / 2)));
- return _madsVm->scene()->_sequenceList.add(srcSpriteIdx, flipped, 1, triggerCountdown, timeoutTicks, extraTicks, numTicks, 0, 0,
+ return _madsVm->scene()->_sequenceList.add(srcSpriteIdx, flipped, 1, triggerCountdown, timeoutTicks, extraTicks, numTicks, 0, 0,
true, 100, depth - 1, 1, ANIMTYPE_REVERSIBLE, 0, 0);
}
@@ -306,7 +306,7 @@ uint16 MadsSceneLogic::startCycledSpriteSequence(uint16 srcSpriteIdx, bool flipp
uint8 depth = _madsVm->_rails->getDepth(Common::Point(spriteFrame->x + (spriteFrame->width() / 2),
spriteFrame->y + (spriteFrame->height() / 2)));
- return _madsVm->scene()->_sequenceList.add(srcSpriteIdx, flipped, 1, triggerCountdown, timeoutTicks, extraTicks, numTicks, 0, 0,
+ return _madsVm->scene()->_sequenceList.add(srcSpriteIdx, flipped, 1, triggerCountdown, timeoutTicks, extraTicks, numTicks, 0, 0,
true, 100, depth - 1, 1, ANIMTYPE_CYCLED, 0, 0);
}
@@ -315,7 +315,7 @@ uint16 MadsSceneLogic::startSpriteSequence3(uint16 srcSpriteIdx, bool flipped, i
uint8 depth = _madsVm->_rails->getDepth(Common::Point(spriteFrame->x + (spriteFrame->width() / 2),
spriteFrame->y + (spriteFrame->height() / 2)));
- return _madsVm->scene()->_sequenceList.add(srcSpriteIdx, flipped, 1, triggerCountdown, timeoutTicks, extraTicks, numTicks, 0, 0,
+ return _madsVm->scene()->_sequenceList.add(srcSpriteIdx, flipped, 1, triggerCountdown, timeoutTicks, extraTicks, numTicks, 0, 0,
true, 100, depth - 1, -1, ANIMTYPE_CYCLED, 0, 0);
}
@@ -335,11 +335,11 @@ void MadsSceneLogic::getPlayerSpritesPrefix() {
strcpy(_madsVm->_player._spritesPrefix, "RXSM");
else if (_madsVm->globals()->_nextSceneId == 112)
strcpy(_madsVm->_player._spritesPrefix, "");
-
+
if (strcmp(oldName, _madsVm->_player._spritesPrefix) != 0)
_madsVm->_player._spritesChanged = true;
- if ((_madsVm->globals()->_nextSceneId == 105) ||
+ if ((_madsVm->globals()->_nextSceneId == 105) ||
((_madsVm->globals()->_nextSceneId == 109) && (_madsVm->globals()->_globals[15] != 0))) {
// TODO: unknown flag setting
_madsVm->_player._spritesChanged = true;
@@ -420,7 +420,7 @@ void MadsSceneLogic::initializeScripts() {
if ((language != 1) || (_madsVm->getLanguage() != Common::EN_ANY))
continue;
- // Found script block for the given game and language.
+ // Found script block for the given game and language.
_scriptsSize = (i < (offsets.size() - 1)) ? offsets[i + 1] - offsets[i] : f.size() - offsets[i];
break;
}
@@ -433,7 +433,7 @@ void MadsSceneLogic::initializeScripts() {
// Load up the list of subroutines into a hash map
uint32 blockOffset = f.pos() - 3;
- uint32 subsStart = 0;
+ uint32 subsStart = 0;
for (;;) {
// Get next entry
Common::String subName;
@@ -593,12 +593,12 @@ void MadsSceneLogic::execute(uint32 subOffset) {
}
case OP_DSTORE: { // Stores data variable
- param = getParam(scriptOffset, opcode);
+ param = getParam(scriptOffset, opcode);
ScriptVar v = stack.pop();
setDataValue(param, v.isInt() ? v.get() : 0);
break;
}
-
+
case OP_LOAD: // loads local variable onto stack
param = getParam(scriptOffset, opcode);
stack.push(locals[param]);
@@ -621,7 +621,7 @@ void MadsSceneLogic::execute(uint32 subOffset) {
case OP_GSTORE: // pops stack and stores in global variable
param = getParam(scriptOffset, opcode);
- assert(param < TOTAL_NUM_VARIABLES);
+ assert(param < TOTAL_NUM_VARIABLES);
_madsVm->globals()->_globals[param] = stack.pop().get();
break;
@@ -647,7 +647,7 @@ void MadsSceneLogic::execute(uint32 subOffset) {
// Condition satisfied - do the jump
scriptOffset = param;
break;
-
+
case OP_JMPTRUE: // conditional jump
param = subOffset + getParam(scriptOffset, opcode);
if (stack.pop().get() != 0)
@@ -708,7 +708,7 @@ void MadsSceneLogic::execute(uint32 subOffset) {
case OP_OR: param1 |= param2; break;
case OP_EOR: param1 ^= param2; break;
}
-
+
stack.push(ScriptVar(param1));
}
break;
@@ -774,7 +774,7 @@ uint32 MadsSceneLogic::getParam(uint32 &scriptOffset, int opcode) {
*/
void MadsSceneLogic::getCallParameters(int numParams, Common::Stack<ScriptVar> &stack, ScriptVar *callParams) {
assert(numParams <= MAX_CALL_PARAMS);
- for (int i = 0; i < numParams; ++i, ++callParams)
+ for (int i = 0; i < numParams; ++i, ++callParams)
*callParams = stack.pop();
}
@@ -881,7 +881,7 @@ void MadsSceneLogic::callSubroutine(int subIndex, Common::Stack<ScriptVar> &stac
case 14: {
// DynamicHotspots_add
EXTRACT_PARAMS(7);
- int idx = _madsVm->scene()->_dynamicHotspots.add(p[0], p[1], p[2],
+ int idx = _madsVm->scene()->_dynamicHotspots.add(p[0], p[1], p[2],
Common::Rect(p[6], p[5], p[6] + p[4], p[5] + p[3]));
stack.push(ScriptVar(idx));
break;
diff --git a/engines/m4/mads_logic.h b/engines/m4/mads_logic.h
index 3132094252..4f0b0d5ba2 100644
--- a/engines/m4/mads_logic.h
+++ b/engines/m4/mads_logic.h
@@ -19,8 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* The MADS game logic is all hard-coded into the games, although for Rex at least
- * it seems to use only a fairly basic set of instructions and function calls, so it should be
- * possible
+ * it seems to use only a fairly basic set of instructions and function calls, so it should be
+ * possible
*/
#ifndef M4_MADS_LOGIC_H
diff --git a/engines/m4/mads_menus.cpp b/engines/m4/mads_menus.cpp
index fa65329d76..8a2ab67f11 100644
--- a/engines/m4/mads_menus.cpp
+++ b/engines/m4/mads_menus.cpp
@@ -210,7 +210,7 @@ void RexMainMenuView::updateState() {
M4Sprite *spr = _menuItem->getFrame(0);
itemSize = _menuItem->getFrame(0)->height();
spr->copyTo(this, _menuItemPosList[_menuItemIndex - 1].x,
- _menuItemPosList[_menuItemIndex - 1].y + row + (itemSize / 2) - (spr->height() / 2),
+ _menuItemPosList[_menuItemIndex - 1].y + row + (itemSize / 2) - (spr->height() / 2),
spr->getTransparencyIndex());
delete _menuItem;
@@ -876,7 +876,7 @@ void RexDialogView::addLine(const char *msg_p, Font *font, MadsTextAlignment ali
}
break;
}
-
+
case RIGHT_ALIGN:
// Right align (moving left from given passed left)
rec->pos.x = left - font->getWidth(rec->text);
@@ -920,7 +920,7 @@ void RexDialogView::setClickableLines() {
for (int i = 0; i < DIALOG_LINES_SIZE; ++i) {
if (_dialogText[i].in_use) {
// Add an entry for the line
- _screenObjects.add(Common::Rect(_dialogText[i].pos.x, _dialogText[i].pos.y,
+ _screenObjects.add(Common::Rect(_dialogText[i].pos.x, _dialogText[i].pos.y,
_dialogText[i].pos.x + _dialogText[i].font->getWidth(_dialogText[i].text, _dialogText[i].widthAdjust),
_dialogText[i].pos.y + _dialogText[i].font->getHeight()), 19, i, 1);
}
@@ -988,7 +988,7 @@ RexGameMenuDialog::RexGameMenuDialog(): RexDialogView() {
void RexGameMenuDialog::addLines() {
// Add the title
int top = MADS_Y_OFFSET - 2 - ((((_vm->_font->current()->getHeight() + 2) * 6) >> 1) - 78);
-
+
addQuote(_vm->_font->current(), ALIGN_CENTER, 0, top, 10);
// Loop for adding the option lines of the dialog
@@ -1163,7 +1163,7 @@ bool RexOptionsDialog::onEvent(M4EventType eventType, int32 param1, int x, int y
return true;
}
- // Update the option selections
+ // Update the option selections
reload();
}
diff --git a/engines/m4/mads_player.cpp b/engines/m4/mads_player.cpp
index 0b83b54ff5..73480088ee 100644
--- a/engines/m4/mads_player.cpp
+++ b/engines/m4/mads_player.cpp
@@ -46,7 +46,7 @@ MadsPlayer::MadsPlayer() {
_unk4 = false;
_spritesChanged = true;
-
+
_direction = 0;
_newDirection = 0;
_priorTimer = 0;
@@ -131,7 +131,7 @@ void MadsPlayer::update() {
// Figure out the depth for the sprite
int newDepth = 1;
int yp = MIN(_playerPos.y, (int16)155);
-
+
for (int idx = 1; idx < 15; ++idx) {
if (_madsVm->scene()->getSceneResources()._depthBands[newDepth] >= yp)
newDepth = idx + 1;
@@ -199,7 +199,7 @@ void MadsPlayer::updateFrame() {
_unk2 = 0;
} else {
_unk2 = _actionList2[_actionIndex];
-
+
if (_actionIndex > 0)
--_actionIndex;
}
@@ -237,7 +237,7 @@ void MadsPlayer::setupFrame() {
_frameCount = spriteSet.getCount();
_yScale = spriteSet._charInfo->_yScale;
-
+
if ((_frameNum <= 0) || (_frameNum > _frameCount))
_frameNum = 1;
_forceRefresh = true;
@@ -336,7 +336,7 @@ void MadsPlayer::setDest(int destX, int destY, int facing) {
setTicksAmount();
_moving = true;
_destFacing = facing;
-
+
_madsVm->scene()->getSceneResources().setRouteNode(_madsVm->scene()->getSceneResources()._nodes.size() - 2,
_playerPos, _madsVm->scene()->_depthSurface);
_madsVm->scene()->getSceneResources().setRouteNode(_madsVm->scene()->getSceneResources()._nodes.size() - 1,
@@ -448,7 +448,7 @@ void MadsPlayer::move() {
bool routeFlag = false;
if (_moving) {
- int idx = _routeCount;
+ int idx = _routeCount;
while (!_v844C0 && (_destPos.x == _playerPos.x) && (_destPos.y == _playerPos.y)) {
if (idx != 0) {
--idx;
@@ -650,7 +650,7 @@ int MadsPlayer::scanPath(M4Surface *depthSurface, const Common::Point &srcPos, c
srcP += xDirection;
}
-
+
return 0;
}
@@ -730,12 +730,12 @@ void MadsPlayer::startMovement() {
int majorChange = MAX(xDiff, yDiff);
_v84530 = (majorChange == 0) ? 0 : _hypotenuse / majorChange;
-
+
if (_playerPos.x > _destPos.x)
_v8452C = MAX(_posChange.x, _posChange.y);
else
_v8452C = 0;
-
+
_hypotenuse /= 100;
_v8452E = -_v84530;
}
diff --git a/engines/m4/mads_scene.cpp b/engines/m4/mads_scene.cpp
index a0acbdd69d..5f160aa300 100644
--- a/engines/m4/mads_scene.cpp
+++ b/engines/m4/mads_scene.cpp
@@ -169,7 +169,7 @@ void MadsScene::loadScene(int sceneNumber) {
}
_abortTimers = 0;
_abortTimersMode2 = ABORTMODE_1;
-
+
// Do any scene specific setup
if (_vm->getGameType() == GType_RexNebular)
@@ -376,7 +376,7 @@ void MadsScene::updateState() {
if (_madsVm->globals()->_config.easyMouse)
_action.refresh();
-
+
if ((_activeAnimation) && !_abortTimers) {
_activeAnimation->update();
if (((MadsAnimation *) _activeAnimation)->freeFlag() || freeFlag) {
@@ -598,7 +598,7 @@ void MadsScene::loadAnimation(const Common::String &animName, int abortTimers) {
bool MadsScene::getDepthHighBit(const Common::Point &pt) {
const byte *p = _depthSurface->getBasePtr(pt.x, pt.y);
- if (_sceneResources._depthStyle == 2)
+ if (_sceneResources._depthStyle == 2)
return ((*p << 4) & 0x80) != 0;
return (*p & 0x80) != 0;
@@ -653,7 +653,7 @@ void MadsSceneResources::load(int sceneNumber, const char *resName, int v0, M4Su
_depthStyle = stream->readUint16LE();
_width = stream->readUint16LE();
_height = stream->readUint16LE();
-
+
stream->skip(24);
int nodeCount = stream->readUint16LE();
@@ -771,7 +771,7 @@ void MadsSceneResources::setRouteNode(int nodeIndex, const Common::Point &pt, M4
if (hypotenuse >= 0x3FFF)
// Shouldn't ever be this large
hypotenuse = 0x3FFF;
-
+
entry = hypotenuse | flags;
_nodes[idx].indexes[nodeIndex] = entry;
_nodes[nodeIndex].indexes[idx] = entry;
@@ -794,7 +794,7 @@ int MadsSceneResources::getRouteFlags(const Common::Point &src, const Common::Po
++yDiff;
byte *srcP = depthSurface->getBasePtr(src.x, src.y);
-
+
int totalCtr = majorDiff;
for (int xCtr = 0; xCtr < xDiff; ++xCtr, srcP += xDirection) {
totalCtr += yDiff;
@@ -837,7 +837,7 @@ int MadsSceneResources::getRouteFlags(const Common::Point &src, const Common::Po
*--------------------------------------------------------------------------
*/
-MadsInterfaceView::MadsInterfaceView(MadsM4Engine *vm): GameInterfaceView(vm,
+MadsInterfaceView::MadsInterfaceView(MadsM4Engine *vm): GameInterfaceView(vm,
Common::Rect(0, MADS_SURFACE_HEIGHT, vm->_screen->width(), vm->_screen->height())) {
_screenType = VIEWID_INTERFACE;
_highlightedElement = -1;
@@ -1078,7 +1078,7 @@ bool MadsInterfaceView::onEvent(M4EventType eventType, int32 param1, int x, int
// A standard action was selected
int verbId = kVerbLook + (_highlightedElement - ACTIONS_START);
warning("Selected action #%d", verbId);
-
+
} else if ((_highlightedElement >= VOCAB_START) && (_highlightedElement < (VOCAB_START + 5))) {
// A vocab action was selected
MadsObject *obj = _madsVm->globals()->getObject(_selectedObject);
@@ -1259,8 +1259,8 @@ void MadsInterfaceView::leaveScene() {
//--------------------------------------------------------------------------
-int getActiveAnimationBool() {
- return (_madsVm->scene()->activeAnimation()) ? 1 : 0;
+int getActiveAnimationBool() {
+ return (_madsVm->scene()->activeAnimation()) ? 1 : 0;
}
int getAnimationCurrentFrame() {
diff --git a/engines/m4/mads_views.cpp b/engines/m4/mads_views.cpp
index b66591a207..0521903c95 100644
--- a/engines/m4/mads_views.cpp
+++ b/engines/m4/mads_views.cpp
@@ -99,7 +99,7 @@ void MadsAction::set() {
// Use/to action
int selectedObject = _madsVm->scene()->getInterface()->getSelectedObject();
MadsObject *objEntry = _madsVm->globals()->getObject(selectedObject);
-
+
_action.objectNameId = objEntry->_descId;
_currentAction = objEntry->_vocabList[_selectedRow].vocabId;
@@ -244,7 +244,7 @@ void MadsAction::refresh() {
// Add a new text display entry to display the status text at the bottom of the screen area
uint colors = (_vm->getGameType() == GType_DragonSphere) ? 0x0300 : 0x0003;
- _statusTextIndex = _owner._textDisplay.add(160 - (strWidth / 2),
+ _statusTextIndex = _owner._textDisplay.add(160 - (strWidth / 2),
MADS_SURFACE_HEIGHT + _owner._posAdjust.y - 13, colors, textSpacing, _statusText, font);
}
}
@@ -476,7 +476,7 @@ void MadsSpriteSlots::drawBackground() {
if (slot.depth > 1) {
// Draw the frame with depth processing
- _owner._bgSurface->copyFrom(frame, xp, yp, slot.depth, _owner._depthSurface, 100,
+ _owner._bgSurface->copyFrom(frame, xp, yp, slot.depth, _owner._depthSurface, 100,
frame->getTransparencyIndex());
} else {
// No depth, so simply draw the image
@@ -526,7 +526,7 @@ void MadsSpriteSlots::drawForeground(M4Surface *viewport) {
if ((slot.scale < 100) && (slot.scale != -1)) {
// Minimalised drawing
- viewport->copyFrom(spr, slot.xp, slot.yp, slot.depth, _owner._depthSurface, slot.scale,
+ viewport->copyFrom(spr, slot.xp, slot.yp, slot.depth, _owner._depthSurface, slot.scale,
sprite->getTransparencyIndex());
} else {
int xp, yp;
@@ -665,7 +665,7 @@ void MadsTextDisplay::draw(M4Surface *view) {
for (uint idx = 0; idx < _entries.size(); ++idx) {
if (_entries[idx].active && (_entries[idx].expire >= 0)) {
_entries[idx].font->setColors(_entries[idx].color1, _entries[idx].color2, 0);
- _entries[idx].font->writeString(view, _entries[idx].msg,
+ _entries[idx].font->writeString(view, _entries[idx].msg,
_entries[idx].bounds.left, _entries[idx].bounds.top, _entries[idx].bounds.width(),
_entries[idx].spacing);
}
@@ -728,7 +728,7 @@ int MadsKernelMessageList::add(const Common::Point &pt, uint fontColor, uint8 fl
rec.frameTimer = _madsVm->_currentTimer;
rec.abortTimers = abortTimers;
rec.abortMode = _owner._abortTimersMode2;
-
+
for (int i = 0; i < 3; ++i)
rec.actionNouns[i] = _madsVm->globals()->actionNouns[i];
@@ -850,7 +850,7 @@ void MadsKernelMessageList::processText(int msgIndex) {
y1 = seqEntry.msgPos.y;
}
}
-
+
if (msg.flags & KMSG_PLAYER_TIMEOUT) {
if (word_8469E != 0) {
// TODO: Figure out various flags
@@ -867,7 +867,7 @@ void MadsKernelMessageList::processText(int msgIndex) {
msg.msg[msg.msgOffset] = msg.asciiChar;
char *msgP = &msg.msg[++msg.msgOffset];
*msgP = msg.asciiChar2;
-
+
msg.asciiChar = *msgP;
msg.asciiChar2 = *(msgP + 1);
@@ -884,7 +884,7 @@ void MadsKernelMessageList::processText(int msgIndex) {
flag = true;
}
- int strWidth = _talkFont->getWidth(msg.msg, _owner._textSpacing);
+ int strWidth = _talkFont->getWidth(msg.msg, _owner._textSpacing);
if (msg.flags & (KMSG_RIGHT_ALIGN | KMSG_CENTER_ALIGN)) {
x1 -= (msg.flags & KMSG_CENTER_ALIGN) ? strWidth / 2 : strWidth;
@@ -935,7 +935,7 @@ ScreenObjects::ScreenObjects(MadsView &owner): _owner(owner) {
_category = 0;
_objectIndex = 0;
}
-
+
/**
* Clears the entries list
*/
@@ -1153,7 +1153,7 @@ void MadsDirtyAreas::setSpriteSlot(int dirtyIdx, const MadsSpriteSlot &spriteSlo
SpriteAsset &spriteSet = _owner._spriteSlots.getSprite(spriteSlot.spriteListIndex);
M4Sprite *frame = spriteSet.getFrame(((spriteSlot.frameNumber & 0x7fff) - 1) & 0x7f);
-
+
if (spriteSlot.scale == -1) {
width = frame->width();
height = frame->height();
@@ -1270,8 +1270,8 @@ bool MadsSequenceList::addSubEntry(int index, SequenceSubEntryMode mode, int fra
return false;
}
-int MadsSequenceList::add(int spriteListIndex, bool flipped, int frameIndex, int triggerCountdown, int delayTicks, int extraTicks, int numTicks,
- int msgX, int msgY, bool nonFixed, char scale, uint8 depth, int frameInc, SpriteAnimType animType, int numSprites,
+int MadsSequenceList::add(int spriteListIndex, bool flipped, int frameIndex, int triggerCountdown, int delayTicks, int extraTicks, int numTicks,
+ int msgX, int msgY, bool nonFixed, char scale, uint8 depth, int frameInc, SpriteAnimType animType, int numSprites,
int frameStart) {
// Find a free slot
@@ -1340,7 +1340,7 @@ void MadsSequenceList::setSpriteSlot(int seqIndex, MadsSpriteSlot &spriteSlot) {
spriteSlot.frameNumber = (timerEntry.flipped ? 0x8000 : 0) | timerEntry.frameIndex;
spriteSlot.depth = timerEntry.depth;
spriteSlot.scale = timerEntry.scale;
-
+
if (!timerEntry.nonFixed) {
spriteSlot.xp = timerEntry.msgPos.x;
spriteSlot.yp = timerEntry.msgPos.y;
@@ -1420,7 +1420,7 @@ bool MadsSequenceList::loadSprites(int seqIndex) {
seqEntry.frameInc = 1;
} else {
// Otherwise reset back to last sprite for further reverse animating
- seqEntry.frameIndex = seqEntry.numSprites;
+ seqEntry.frameIndex = seqEntry.numSprites;
}
}
@@ -1478,7 +1478,7 @@ void MadsSequenceList::tick() {
continue;
// Set the next timeout for the timer entry
- seqEntry.timeout = currentTimer + seqEntry.numTicks;
+ seqEntry.timeout = currentTimer + seqEntry.numTicks;
// Action the sprite
if (loadSprites(idx)) {
@@ -1509,7 +1509,7 @@ void MadsSequenceList::setAnimRange(int seqIndex, int startVal, int endVal) {
tempStart = 1;
break;
}
-
+
switch (endVal) {
case -2:
case 0:
@@ -1558,7 +1558,7 @@ Animation::~Animation() {
MadsView::MadsView(View *view): _view(view), _dynamicHotspots(*this), _sequenceList(*this),
_kernelMessages(*this), _spriteSlots(*this), _dirtyAreas(*this), _textDisplay(*this),
_screenObjects(*this), _action(*this) {
-
+
_textSpacing = -1;
_newTimeout = 0;
_abortTimers = 0;
@@ -1590,8 +1590,8 @@ void MadsView::refresh() {
// Merge any identified dirty areas
_dirtyAreas.merge(1, DIRTY_AREAS_SIZE);
-
- // Copy dirty areas to the main display surface
+
+ // Copy dirty areas to the main display surface
_dirtyAreas.copy(_viewport, _bgSurface, _posAdjust);
// Handle dirty areas for foreground objects
diff --git a/engines/m4/mads_views.h b/engines/m4/mads_views.h
index 6be2283a32..41caaa2ded 100644
--- a/engines/m4/mads_views.h
+++ b/engines/m4/mads_views.h
@@ -208,7 +208,7 @@ public:
#define TIMED_TEXT_SIZE 10
#define INDEFINITE_TIMEOUT 9999999
-enum KernelMessageFlags {KMSG_QUOTED = 1, KMSG_PLAYER_TIMEOUT = 2, KMSG_SEQ_ENTRY = 4, KMSG_SCROLL = 8, KMSG_RIGHT_ALIGN = 0x10,
+enum KernelMessageFlags {KMSG_QUOTED = 1, KMSG_PLAYER_TIMEOUT = 2, KMSG_SEQ_ENTRY = 4, KMSG_SCROLL = 8, KMSG_RIGHT_ALIGN = 0x10,
KMSG_CENTER_ALIGN = 0x20, KMSG_EXPIRE = 0x40, KMSG_ACTIVE = 0x80};
class MadsKernelMessageEntry {
@@ -388,7 +388,7 @@ struct MadsSequenceEntry {
int8 active;
int8 spriteListIndex;
bool flipped;
-
+
int frameIndex;
int frameStart;
int numSprites;
@@ -402,7 +402,7 @@ struct MadsSequenceEntry {
bool nonFixed;
int field_13;
-
+
Common::Point msgPos;
int triggerCountdown;
bool doneFlag;
@@ -424,10 +424,10 @@ private:
public:
MadsSequenceList(MadsView &owner);
- MadsSequenceEntry &operator[](int index) { return _entries[index]; }
+ MadsSequenceEntry &operator[](int index) { return _entries[index]; }
void clear();
bool addSubEntry(int index, SequenceSubEntryMode mode, int frameIndex, int abortVal);
- int add(int spriteListIndex, bool flipped, int frameIndex, int triggerCountdown, int delayTicks,
+ int add(int spriteListIndex, bool flipped, int frameIndex, int triggerCountdown, int delayTicks,
int extraTicks, int numTicks, int msgX, int msgY, bool nonFixed, char scale, uint8 depth,
int frameInc, SpriteAnimType animType, int numSprites, int frameStart);
void remove(int seqIndex);
@@ -452,7 +452,7 @@ public:
virtual void setCurrentFrame(int frameNumber) = 0;
virtual int getCurrentFrame() = 0;
};
-
+
class MadsView {
private:
diff --git a/engines/m4/resource.cpp b/engines/m4/resource.cpp
index 2ae29ca0bb..f5b2050052 100644
--- a/engines/m4/resource.cpp
+++ b/engines/m4/resource.cpp
@@ -313,7 +313,7 @@ const char *MADSResourceManager::getResourceFilename(const char *resourceName) {
/**
* Forms a resource name based on the passed specifiers
*/
-const char *MADSResourceManager::getResourceName(char asciiCh, int prefix, ExtensionType extType,
+const char *MADSResourceManager::getResourceName(char asciiCh, int prefix, ExtensionType extType,
const char *suffix, int index) {
static char resourceName[100];
diff --git a/engines/m4/resource.h b/engines/m4/resource.h
index 00c54a3680..c13c293544 100644
--- a/engines/m4/resource.h
+++ b/engines/m4/resource.h
@@ -109,7 +109,7 @@ public:
enum ResourceType {RESTYPE_ROOM, RESTYPE_SC, RESTYPE_TEXT, RESTYPE_QUO, RESTYPE_I,
RESTYPE_OB, RESTYPE_FONT, RESTYPE_SOUND, RESTYPE_SPEECH, RESTYPE_HAS_EXT, RESTYPE_NO_EXT};
-enum ExtensionType {EXTTYPE_SS = 1, EXTTYPE_AA = 2, EXTTYPE_DAT = 3, EXTTYPE_HH = 4, EXTTYPE_ART = 5,
+enum ExtensionType {EXTTYPE_SS = 1, EXTTYPE_AA = 2, EXTTYPE_DAT = 3, EXTTYPE_HH = 4, EXTTYPE_ART = 5,
EXTTYPE_INT = 6, EXTTYPE_NONE = -1};
enum ResourcePrefixType {RESPREFIX_GL = 1, RESPREFIX_SC = 2, RESPREFIX_RM = 3};
diff --git a/engines/m4/scene.cpp b/engines/m4/scene.cpp
index a38be20086..be49dcb13f 100644
--- a/engines/m4/scene.cpp
+++ b/engines/m4/scene.cpp
@@ -36,7 +36,7 @@
namespace M4 {
-Scene::Scene(MadsM4Engine *vm, SceneResources *res): View(vm, Common::Rect(0, 0, vm->_screen->width(),
+Scene::Scene(MadsM4Engine *vm, SceneResources *res): View(vm, Common::Rect(0, 0, vm->_screen->width(),
vm->_screen->height())), _sceneResources(res) {
_screenType = VIEWID_SCENE;
@@ -142,7 +142,7 @@ void Scene::showCodes() {
// Show the walk areas for the M4 engine in black and white
const byte *srcP = (const byte *)_walkSurface->getBasePtr(0, 0);
byte *destP = _backgroundSurface->getBasePtr(0, 0);
-
+
for (int i = 0; i < _walkSurface->width() * _walkSurface->height(); i++)
destP[i] = (srcP[i] & 0x10) ? 0xFF : 0;
@@ -154,7 +154,7 @@ void Scene::showCodes() {
_vm->_palette->setPalette(colors, 0, 256);
} else {
// MADS handling
-
+
// copy the walk data to the background, in whatever current palette is active
_walkSurface->copyTo(_backgroundSurface);
diff --git a/engines/m4/sound.cpp b/engines/m4/sound.cpp
index d10dea5cad..76eae8a661 100644
--- a/engines/m4/sound.cpp
+++ b/engines/m4/sound.cpp
@@ -97,8 +97,8 @@ void Sound::playSound(const char *soundName, int volume, bool loop, int channel)
_mixer->playStream(Audio::Mixer::kSFXSoundType, &handle->handle, stream, -1, volume);
}
-void Sound::playSound(int soundNum) {
- warning("TODO: playSound(%d)", soundNum);
+void Sound::playSound(int soundNum) {
+ warning("TODO: playSound(%d)", soundNum);
}
void Sound::pauseSound() {
diff --git a/engines/m4/sprite.cpp b/engines/m4/sprite.cpp
index 1a3228d1bb..d0741732f3 100644
--- a/engines/m4/sprite.cpp
+++ b/engines/m4/sprite.cpp
@@ -182,7 +182,7 @@ void M4Sprite::loadMadsSprite(Common::SeekableReadStream* source) {
}
}
}
-
+
// Check if we need to scan forward to find the end of the line
if (!newLine) {
do {
diff --git a/engines/made/database.cpp b/engines/made/database.cpp
index 1151339d49..004f1462a6 100644
--- a/engines/made/database.cpp
+++ b/engines/made/database.cpp
@@ -511,7 +511,7 @@ int16 GameDatabaseV2::loadgame(const char *filename, int16 version) {
_objects[i]->load(*in);
}
delete in;
-
+
_objectPropertyCache.clear(); // make sure to clear cache
return result;
}
@@ -642,7 +642,7 @@ void GameDatabaseV3::load(Common::SeekableReadStream &sourceS) {
void GameDatabaseV3::reloadFromStream(Common::SeekableReadStream &sourceS) {
sourceS.seek(_gameStateOffs);
sourceS.read(_gameState, _gameStateSize);
-
+
_objectPropertyCache.clear(); // make sure to clear cache
}
@@ -734,9 +734,9 @@ int16 GameDatabaseV3::loadgame(const char *filename, int16 version) {
in->skip(64); // skip savegame description
in->read(_gameState, _gameStateSize);
delete in;
-
+
_objectPropertyCache.clear(); // make sure to clear cache
-
+
return 0;
}
diff --git a/engines/mohawk/bitmap.cpp b/engines/mohawk/bitmap.cpp
index d54e2dac6b..f61516c91d 100644
--- a/engines/mohawk/bitmap.cpp
+++ b/engines/mohawk/bitmap.cpp
@@ -910,7 +910,7 @@ void DOSBitmap::expandEGAPlanes(Graphics::Surface *surface, Common::SeekableRead
j = -1;
x++;
}
- }
+ }
dst += surface->w;
}
diff --git a/engines/mohawk/console.cpp b/engines/mohawk/console.cpp
index 4e5b7186ff..05012bec3d 100644
--- a/engines/mohawk/console.cpp
+++ b/engines/mohawk/console.cpp
@@ -632,7 +632,7 @@ bool RivenConsole::Cmd_Combos(int argc, const char **argv) {
uint32 teleCombo = _vm->_vars["tcorrectorder"];
uint32 prisonCombo = _vm->_vars["pcorrectorder"];
uint32 domeCombo = _vm->_vars["adomecombo"];
-
+
DebugPrintf("Telescope Combo:\n ");
for (int i = 0; i < 5; i++)
DebugPrintf("%d ", _vm->_externalScriptHandler->getComboDigit(teleCombo, i));
diff --git a/engines/mohawk/detection_tables.h b/engines/mohawk/detection_tables.h
index 2cf80377f6..2243dd1c1d 100644
--- a/engines/mohawk/detection_tables.h
+++ b/engines/mohawk/detection_tables.h
@@ -33,7 +33,7 @@ static const MohawkGameDescription gameDescriptions[] = {
AD_ENTRY1("MYST.DAT", "ae3258c9c90128d274aa6a790b3ad181"),
Common::EN_ANY,
Common::kPlatformWindows,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
GType_MYST,
@@ -51,7 +51,7 @@ static const MohawkGameDescription gameDescriptions[] = {
AD_ENTRY1("DEMO.DAT", "c39303dd53fb5c4e7f3c23231c606cd0"),
Common::EN_ANY,
Common::kPlatformWindows,
- ADGF_DEMO,
+ ADGF_DEMO | ADGF_UNSTABLE,
Common::GUIO_NONE
},
GType_MYST,
@@ -69,7 +69,7 @@ static const MohawkGameDescription gameDescriptions[] = {
AD_ENTRY1("MYST.DAT", "4beb3366ed3f3b9bfb6e81a14a43bdcc"),
Common::DE_DEU,
Common::kPlatformWindows,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
GType_MYST,
@@ -87,7 +87,7 @@ static const MohawkGameDescription gameDescriptions[] = {
AD_ENTRY1("MYST.DAT", "e0937cca1ab125e48e30dc3cd5046ddf"),
Common::DE_DEU,
Common::kPlatformWindows,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
GType_MYST,
@@ -105,7 +105,7 @@ static const MohawkGameDescription gameDescriptions[] = {
AD_ENTRY1("MYST.DAT", "f7e7d7ca69934f1351b5acd4fe4d44c2"),
Common::ES_ESP,
Common::kPlatformWindows,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
GType_MYST,
@@ -123,7 +123,7 @@ static const MohawkGameDescription gameDescriptions[] = {
AD_ENTRY1("MYST.DAT", "032c88e3b7e8db4ca475e7b7db9a66bb"),
Common::JA_JPN,
Common::kPlatformWindows,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
GType_MYST,
@@ -141,7 +141,7 @@ static const MohawkGameDescription gameDescriptions[] = {
AD_ENTRY1("MYST.DAT", "d631d42567a941c67c78f2e491f4ea58"),
Common::FR_FRA,
Common::kPlatformWindows,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
GType_MYST,
@@ -159,7 +159,7 @@ static const MohawkGameDescription gameDescriptions[] = {
AD_ENTRY1("MAKING.DAT", "f6387e8f0f7b8a3e42c95294315d6a0e"),
Common::EN_ANY,
Common::kPlatformWindows,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
GType_MAKINGOF,
@@ -177,7 +177,7 @@ static const MohawkGameDescription gameDescriptions[] = {
AD_ENTRY1("MAKING.DAT", "03ff62607e64419ab2b6ebf7b7bcdf63"),
Common::JA_JPN,
Common::kPlatformWindows,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
GType_MAKINGOF,
@@ -195,7 +195,7 @@ static const MohawkGameDescription gameDescriptions[] = {
AD_ENTRY1("MYST.DAT", "c4cae9f143b5947262e6cb2397e1617e"),
Common::EN_ANY,
Common::kPlatformWindows,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
GType_MYST,
@@ -213,7 +213,7 @@ static const MohawkGameDescription gameDescriptions[] = {
AD_ENTRY1("MYST.DAT", "c4cae9f143b5947262e6cb2397e1617e"),
Common::EN_ANY,
Common::kPlatformMacintosh,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
GType_MYST,
@@ -231,7 +231,7 @@ static const MohawkGameDescription gameDescriptions[] = {
AD_ENTRY1("MYST.DAT", "f88e0ace66dbca78eebdaaa1d3314ceb"),
Common::DE_DEU,
Common::kPlatformWindows,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
GType_MYST,
@@ -249,7 +249,7 @@ static const MohawkGameDescription gameDescriptions[] = {
AD_ENTRY1("MYST.DAT", "aea81633b2d2ae498f09072fb87263b6"),
Common::FR_FRA,
Common::kPlatformWindows,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
GType_MYST,
@@ -267,7 +267,7 @@ static const MohawkGameDescription gameDescriptions[] = {
AD_ENTRY1("a_Data.MHK", "71145fdecbd68a0cfc292c2fbddf8e08"),
Common::EN_ANY,
Common::kPlatformWindows,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
GType_RIVEN,
@@ -285,7 +285,7 @@ static const MohawkGameDescription gameDescriptions[] = {
AD_ENTRY1("a_Data.MHK", "d8ccae34a0e3c709135a73f449b783be"),
Common::EN_ANY,
Common::kPlatformWindows,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
GType_RIVEN,
@@ -303,7 +303,7 @@ static const MohawkGameDescription gameDescriptions[] = {
AD_ENTRY1("a_Data.MHK", "249e8c995d191b03ee94c892c0eac775"),
Common::ES_ESP,
Common::kPlatformWindows,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
GType_RIVEN,
@@ -321,7 +321,7 @@ static const MohawkGameDescription gameDescriptions[] = {
AD_ENTRY1("a_Data.MHK", "08fcaa5d5a2a01d7a5a6960f497212fe"),
Common::EN_ANY,
Common::kPlatformWindows,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
GType_RIVEN,
@@ -339,7 +339,7 @@ static const MohawkGameDescription gameDescriptions[] = {
AD_ENTRY1("a_Data.MHK", "a5fe1c91a6033eb6ee54b287578b74b9"),
Common::DE_DEU,
Common::kPlatformWindows,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
GType_RIVEN,
@@ -357,7 +357,7 @@ static const MohawkGameDescription gameDescriptions[] = {
AD_ENTRY1("a_Data.MHK", "aff2a384aaa9a0e0ec51010f708c5c04"),
Common::FR_FRA,
Common::kPlatformWindows,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
GType_RIVEN,
@@ -375,7 +375,7 @@ static const MohawkGameDescription gameDescriptions[] = {
AD_ENTRY1("a_Data.MHK", "bae6b03bd8d6eb350d35fd13f0e3139f"),
Common::EN_ANY,
Common::kPlatformWindows,
- ADGF_DEMO,
+ ADGF_DEMO | ADGF_UNSTABLE,
Common::GUIO_NONE
},
GType_RIVEN,
@@ -390,7 +390,7 @@ static const MohawkGameDescription gameDescriptions[] = {
AD_ENTRY1("signin.mhk", "410b4ce8d1a8702971e4d1ffba9b965d"),
Common::EN_ANY,
Common::kPlatformWindows,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
GType_CSTIME,
@@ -405,7 +405,7 @@ static const MohawkGameDescription gameDescriptions[] = {
AD_ENTRY1("iface.mhk", "5c1203712a16513bd158dc3c1b6cebd7"),
Common::EN_ANY,
Common::kPlatformWindows,
- ADGF_DEMO,
+ ADGF_DEMO | ADGF_UNSTABLE,
Common::GUIO_NONE
},
GType_CSTIME,
@@ -421,7 +421,7 @@ static const MohawkGameDescription gameDescriptions[] = {
AD_ENTRY1("ZOOMBINI.MHK", "98b758fec55104c096cfd129048be9a6"),
Common::EN_ANY,
Common::kPlatformWindows,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
GType_ZOOMBINI,
@@ -436,6 +436,21 @@ static const MohawkGameDescription gameDescriptions[] = {
AD_ENTRY1("ZOOMBINI.MHK", "0672f65c40dd065840c896e41c13f980"),
Common::EN_ANY,
Common::kPlatformWindows,
+ ADGF_UNSTABLE,
+ Common::GUIO_NONE
+ },
+ GType_ZOOMBINI,
+ GF_HASMIDI,
+ 0
+ },
+
+ {
+ {
+ "zoombini",
+ "v2.0",
+ AD_ENTRY1("ZOOMBINI.MHK", "506b1122ffa740e2566cf0b583d24478"),
+ Common::EN_ANY,
+ Common::kPlatformWindows,
ADGF_NO_FLAGS,
Common::GUIO_NONE
},
@@ -451,7 +466,7 @@ static const MohawkGameDescription gameDescriptions[] = {
AD_ENTRY1("ZOOMBINI.MHK", "6ae0bdf791266b1fe3d4fabbf44c3faa"),
Common::DE_DEU,
Common::kPlatformWindows,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
GType_ZOOMBINI,
@@ -466,7 +481,7 @@ static const MohawkGameDescription gameDescriptions[] = {
AD_ENTRY1("ZOOMBINI.MHK", "8231e58525143ccf6e8b747df34b139f"),
Common::FR_FRA,
Common::kPlatformWindows,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
GType_ZOOMBINI,
@@ -481,7 +496,7 @@ static const MohawkGameDescription gameDescriptions[] = {
AD_ENTRY1("C2K.MHK", "605fe88380848031bbd0ff84ade6fe40"),
Common::EN_ANY,
Common::kPlatformWindows,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
GType_CSWORLD,
@@ -496,7 +511,7 @@ static const MohawkGameDescription gameDescriptions[] = {
AD_ENTRY1("C2K.MHK", "d4857aeb0f5e2e0c4ac556aa74f38c23"),
Common::EN_ANY,
Common::kPlatformWindows,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
GType_CSWORLD,
@@ -511,7 +526,7 @@ static const MohawkGameDescription gameDescriptions[] = {
AD_ENTRY1("AMTRAK.MHK", "2f95301f0bb950d555bb7b0e3b1b7eb1"),
Common::EN_ANY,
Common::kPlatformWindows,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
GType_CSAMTRAK,
@@ -645,7 +660,7 @@ static const MohawkGameDescription gameDescriptions[] = {
AD_ENTRY1("Outline.txt", "67abce5dcda969c23f367a98c90439bc"),
Common::EN_ANY,
Common::kPlatformWindows,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
GType_LIVINGBOOKSV5,
@@ -660,7 +675,7 @@ static const MohawkGameDescription gameDescriptions[] = {
AD_ENTRY1("Outline.txt", "6a281eefe72987afb0f8fb6cf84553f5"),
Common::EN_ANY,
Common::kPlatformWindows,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
GType_LIVINGBOOKSV5,
@@ -675,7 +690,7 @@ static const MohawkGameDescription gameDescriptions[] = {
AD_ENTRY1("Outline", "b7dc6e65fa9e80784a5bb8b557aa37c4"),
Common::EN_ANY,
Common::kPlatformWindows,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
GType_LIVINGBOOKSV3,
@@ -690,7 +705,7 @@ static const MohawkGameDescription gameDescriptions[] = {
AD_ENTRY1("BookOutline", "1ce006d7daaa26cf61040203856b88f1"),
Common::EN_ANY,
Common::kPlatformMacintosh,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
GType_LIVINGBOOKSV3,
@@ -705,7 +720,7 @@ static const MohawkGameDescription gameDescriptions[] = {
AD_ENTRY1("BRODER.MHK", "007299da8b2c6e8ec1cde9598c243024"),
Common::EN_ANY,
Common::kPlatformWindows,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
GType_JAMESMATH,
@@ -721,7 +736,7 @@ static const MohawkGameDescription gameDescriptions[] = {
AD_ENTRY1("BRODER.MHK", "53c000938a50dca92860fd9b546dd276"),
Common::EN_ANY,
Common::kPlatformWindows,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
GType_JAMESMATH,
@@ -736,7 +751,7 @@ static const MohawkGameDescription gameDescriptions[] = {
AD_ENTRY1("MAINROOM.MHK", "12f51894d7f838af639ea9bf1bc8f45b"),
Common::EN_ANY,
Common::kPlatformWindows,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
GType_TREEHOUSE,
@@ -858,7 +873,7 @@ static const MohawkGameDescription gameDescriptions[] = {
AD_ENTRY1("AL236_1.MHK", "3ba145492a7b8b4dee0ef4222c5639c3"),
Common::EN_ANY,
Common::kPlatformWindows,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
GType_1STDEGREE,
@@ -876,7 +891,7 @@ static const MohawkGameDescription gameDescriptions[] = {
AD_ENTRY1("AL236_1.MHK", "0e0c70b1b702b6ddca61a1192ada1282"),
Common::FR_FRA,
Common::kPlatformWindows,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
GType_1STDEGREE,
@@ -891,7 +906,7 @@ static const MohawkGameDescription gameDescriptions[] = {
AD_ENTRY1("USAC2K.MHK", "b8c9d3a2586f62bce3a48b50d7a700e9"),
Common::EN_ANY,
Common::kPlatformWindows,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
GType_CSUSA,
@@ -1435,7 +1450,7 @@ static const MohawkGameDescription gameDescriptions[] = {
AD_ENTRY1("RACE.LB", "1645f36bcb36e440d928e920aa48c373"),
Common::EN_ANY,
Common::kPlatformWindows,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
GType_LIVINGBOOKSV3,
@@ -1451,7 +1466,7 @@ static const MohawkGameDescription gameDescriptions[] = {
AD_ENTRY1("RACE32.LB", "292a05bc48c1dd9583821a4181a02ef2"),
Common::EN_ANY,
Common::kPlatformWindows,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
GType_LIVINGBOOKSV3,
@@ -1686,7 +1701,7 @@ static const MohawkGameDescription gameDescriptions[] = {
AD_ENTRY1("Outline", "0b5ab6dd7c08cf23066efa709fa48bbc"),
Common::EN_ANY,
Common::kPlatformWindows,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
GType_LIVINGBOOKSV3,
@@ -1701,7 +1716,7 @@ static const MohawkGameDescription gameDescriptions[] = {
AD_ENTRY1("BookOutline", "e139903eee98f0b0c3f39247a23b8f10"),
Common::EN_ANY,
Common::kPlatformMacintosh,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
GType_LIVINGBOOKSV3,
@@ -1716,7 +1731,7 @@ static const MohawkGameDescription gameDescriptions[] = {
AD_ENTRY1("outline", "525be248363fe27d50d750632c1e759e"),
Common::EN_ANY,
Common::kPlatformWindows,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
GType_LIVINGBOOKSV4,
@@ -1731,7 +1746,7 @@ static const MohawkGameDescription gameDescriptions[] = {
AD_ENTRY1("BookOutline", "54a324ee6f8260258bff7043a05b0004"),
Common::EN_ANY,
Common::kPlatformMacintosh,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
GType_LIVINGBOOKSV4,
@@ -1749,7 +1764,7 @@ static const MohawkGameDescription gameDescriptions[] = {
AD_ENTRY1("outline", "36225e0b4986a80135cfdd9643cc7030"),
Common::FR_FRA,
Common::kPlatformWindows,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
GType_LIVINGBOOKSV4,
@@ -1825,7 +1840,7 @@ static const MohawkGameDescription gameDescriptions[] = {
AD_ENTRY1("outline", "d239506f969ff68fa886f084082e9158"),
Common::EN_ANY,
Common::kPlatformWindows,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
GType_LIVINGBOOKSV3,
@@ -1840,7 +1855,7 @@ static const MohawkGameDescription gameDescriptions[] = {
AD_ENTRY1("BookOutline", "6dd1c0606f1db3b71207121b4370e487"),
Common::EN_ANY,
Common::kPlatformMacintosh,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
GType_LIVINGBOOKSV3,
@@ -1934,7 +1949,7 @@ static const MohawkGameDescription gameDescriptions[] = {
AD_ENTRY1("OUTLINE", "dec4d1a05449f81b6012706932658326"),
Common::EN_ANY,
Common::kPlatformWindows,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
GType_LIVINGBOOKSV4,
@@ -1949,7 +1964,7 @@ static const MohawkGameDescription gameDescriptions[] = {
AD_ENTRY1("BookOutline", "87bf1f9113340ce1c6c880932e815882"),
Common::EN_ANY,
Common::kPlatformMacintosh,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
GType_LIVINGBOOKSV4,
@@ -2150,7 +2165,7 @@ static const MohawkGameDescription fallbackDescs[] = {
AD_ENTRY1(0, 0),
Common::UNK_LANG,
Common::kPlatformWindows,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
GType_MYST,
@@ -2165,7 +2180,7 @@ static const MohawkGameDescription fallbackDescs[] = {
AD_ENTRY1(0, 0),
Common::UNK_LANG,
Common::kPlatformWindows,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
GType_MAKINGOF,
@@ -2180,7 +2195,7 @@ static const MohawkGameDescription fallbackDescs[] = {
AD_ENTRY1(0, 0),
Common::UNK_LANG,
Common::kPlatformWindows,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
GType_MYST,
@@ -2195,7 +2210,7 @@ static const MohawkGameDescription fallbackDescs[] = {
AD_ENTRY1(0, 0),
Common::UNK_LANG,
Common::kPlatformWindows,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
GType_RIVEN,
@@ -2210,7 +2225,7 @@ static const MohawkGameDescription fallbackDescs[] = {
AD_ENTRY1(0, 0),
Common::UNK_LANG,
Common::kPlatformWindows,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
GType_RIVEN,
diff --git a/engines/mohawk/livingbooks.h b/engines/mohawk/livingbooks.h
index de84b0f13f..56107ad97b 100644
--- a/engines/mohawk/livingbooks.h
+++ b/engines/mohawk/livingbooks.h
@@ -459,7 +459,7 @@ public:
void setGlobalVisible(bool visible);
void startPhase(uint phase);
void stop();
-
+
protected:
bool _starting;
diff --git a/engines/mohawk/myst_stacks/demo.cpp b/engines/mohawk/myst_stacks/demo.cpp
index 53d946dd66..5788f4b3a3 100644
--- a/engines/mohawk/myst_stacks/demo.cpp
+++ b/engines/mohawk/myst_stacks/demo.cpp
@@ -69,7 +69,7 @@ void Demo::disablePersistentScripts() {
void Demo::runPersistentScripts() {
Intro::runPersistentScripts();
-
+
if (_enabled201) {
// Used on Card 2001, 2002 and 2003
diff --git a/engines/mohawk/myst_stacks/myst.cpp b/engines/mohawk/myst_stacks/myst.cpp
index 70abf0ccd3..66492d1200 100644
--- a/engines/mohawk/myst_stacks/myst.cpp
+++ b/engines/mohawk/myst_stacks/myst.cpp
@@ -397,7 +397,7 @@ uint16 Myst::getVar(uint16 var) {
else
return 0;
case 25: // Fireplace Red Page Present
- if (_globals.ending != 4)
+ if (_globals.ending != 4)
return !(_globals.redPagesInBook & 32) && (_globals.heldPage != 12);
else
return 0;
@@ -3269,7 +3269,7 @@ void Myst::generatorControlRoom_run(void) {
if (_generatorVoltage == _state.generatorVoltage) {
generatorRedrawRocket();
} else {
- // Animate generator gauge
+ // Animate generator gauge
if (_generatorVoltage > _state.generatorVoltage)
_generatorVoltage--;
else
diff --git a/engines/mohawk/resource.cpp b/engines/mohawk/resource.cpp
index 3a95b83199..37fc73de67 100644
--- a/engines/mohawk/resource.cpp
+++ b/engines/mohawk/resource.cpp
@@ -79,12 +79,12 @@ bool MohawkArchive::open(Common::SeekableReadStream *stream) {
}
_rsrc.version = _mhk->readUint16BE();
-
+
if (_rsrc.version != 0x100) {
warning("Unsupported Mohawk resource version %d.%d", (_rsrc.version >> 8) & 0xff, _rsrc.version & 0xff);
return false;
}
-
+
_rsrc.compaction = _mhk->readUint16BE(); // Only used in creation, not in reading
_rsrc.filesize = _mhk->readUint32BE();
_rsrc.abs_offset = _mhk->readUint32BE();
diff --git a/engines/mohawk/riven.cpp b/engines/mohawk/riven.cpp
index 3514afdb61..8f8bc15990 100644
--- a/engines/mohawk/riven.cpp
+++ b/engines/mohawk/riven.cpp
@@ -178,7 +178,7 @@ Common::Error MohawkEngine_Riven::run() {
changeToCard(1);
}
-
+
while (!_gameOver && !shouldQuit())
handleEvents();
@@ -436,7 +436,7 @@ void MohawkEngine_Riven::loadCard(uint16 id) {
void MohawkEngine_Riven::loadHotspots(uint16 id) {
// Clear old hotspots
delete[] _hotspots;
-
+
// NOTE: The hotspot scripts are cleared by the RivenScriptManager automatically.
Common::SeekableReadStream *inStream = getResource(ID_HSPT, id);
@@ -460,8 +460,8 @@ void MohawkEngine_Riven::loadHotspots(uint16 id) {
// - tspit 371 (DVD: 377), hotspot 4
if (left >= right || top >= bottom) {
warning("%s %d hotspot %d is invalid: (%d, %d, %d, %d)", getStackName(_curStack).c_str(), _curCard, i, left, top, right, bottom);
- left = top = right = bottom = 0;
- _hotspots[i].enabled = 0;
+ left = top = right = bottom = 0;
+ _hotspots[i].enabled = 0;
}
_hotspots[i].rect = Common::Rect(left, top, right, bottom);
diff --git a/engines/mohawk/riven_external.cpp b/engines/mohawk/riven_external.cpp
index 8ad05ded13..60e94ea795 100644
--- a/engines/mohawk/riven_external.cpp
+++ b/engines/mohawk/riven_external.cpp
@@ -244,7 +244,7 @@ void RivenExternal::runCredits(uint16 video, uint32 delay) {
_vm->_gfx->updateCredits();
}
} else if (_vm->_video->updateMovies())
- _vm->_system->updateScreen();
+ _vm->_system->updateScreen();
Common::Event event;
while (_vm->_system->getEventManager()->pollEvent(event))
@@ -2060,7 +2060,7 @@ void RivenExternal::xbookclick(uint16 argc, uint16 *argv) {
_vm->_cursor->setCursor(kRivenMainCursor);
_vm->_system->updateScreen();
-
+
// OK, Gehn has opened the trap book and has asked us to go in. Let's watch
// and see what the player will do...
while (_vm->_video->getElapsedTime(video) < endTime && !_vm->shouldQuit()) {
@@ -2216,7 +2216,7 @@ void RivenExternal::xgwatch(uint16 argc, uint16 *argv) {
curSound++;
soundTime = _vm->_system->getMillis();
}
-
+
// Poll events just to check for quitting
Common::Event event;
while (_vm->_system->getEventManager()->pollEvent(event)) {}
@@ -2525,7 +2525,7 @@ static Common::Rect generateMarbleGridRect(uint16 x, uint16 y) {
}
void RivenExternal::xt7500_checkmarbles(uint16 argc, uint16 *argv) {
- // Set apower if the marbles are in their correct spot.
+ // Set apower if the marbles are in their correct spot.
bool valid = true;
static const uint32 marbleFinalValues[] = { 1114121, 1441798, 0, 65552, 65558, 262146 };
diff --git a/engines/mohawk/riven_scripts.cpp b/engines/mohawk/riven_scripts.cpp
index 161acb665f..6e3e9a34dc 100644
--- a/engines/mohawk/riven_scripts.cpp
+++ b/engines/mohawk/riven_scripts.cpp
@@ -546,7 +546,7 @@ void RivenScript::storeMovieOpcode(uint16 op, uint16 argc, uint16 *argv) {
byte *scriptBuf = (byte *)malloc(scriptSize);
WRITE_BE_UINT16(scriptBuf, 1); // One command
WRITE_BE_UINT16(scriptBuf + 2, argv[3]); // One opcode
- WRITE_BE_UINT16(scriptBuf + 4, argc - 4); // argc - 4 args
+ WRITE_BE_UINT16(scriptBuf + 4, argc - 4); // argc - 4 args
for (int i = 0; i < argc - 4; i++)
WRITE_BE_UINT16(scriptBuf + 6 + (i * 2), argv[i + 4]);
diff --git a/engines/mohawk/video.cpp b/engines/mohawk/video.cpp
index eec6256276..cd8fc8ef80 100644
--- a/engines/mohawk/video.cpp
+++ b/engines/mohawk/video.cpp
@@ -436,22 +436,22 @@ VideoHandle VideoManager::createVideoHandle(const Common::String &filename, uint
entry.filename = filename;
entry.loop = loop;
entry.enabled = true;
-
+
Common::File *file = new Common::File();
if (!file->open(filename)) {
delete file;
return NULL_VID_HANDLE;
}
-
+
entry->loadStream(file);
-
+
// Search for any deleted videos so we can take a formerly used slot
for (uint32 i = 0; i < _videoStreams.size(); i++)
if (!_videoStreams[i].video) {
_videoStreams[i] = entry;
return i;
}
-
+
// Otherwise, just add it to the list
_videoStreams.push_back(entry);
return _videoStreams.size() - 1;
diff --git a/engines/parallaction/dialogue.cpp b/engines/parallaction/dialogue.cpp
index 880d41a8a3..a908152bf8 100644
--- a/engines/parallaction/dialogue.cpp
+++ b/engines/parallaction/dialogue.cpp
@@ -52,7 +52,7 @@ struct BalloonPositions {
class DialogueManager {
-
+
Parallaction *_vm;
Dialogue *_dialogue;
@@ -81,10 +81,10 @@ protected:
bool _isKeyDown;
uint16 _downKey;
-protected:
+protected:
Gfx *_gfx;
BalloonManager *_balloonMan;
-
+
public:
DialogueManager(Parallaction *vm, ZonePtr z);
virtual ~DialogueManager();
@@ -108,11 +108,11 @@ protected:
NEXT_ANSWER,
DIALOGUE_OVER
} _state;
-
+
static const int NO_ANSWER_SELECTED = -1;
void transitionToState(DialogueState newState);
-
+
bool displayQuestion();
void displayAnswers();
bool testAnswerFlags(Answer *a);
@@ -132,7 +132,7 @@ protected:
DialogueManager::DialogueManager(Parallaction *vm, ZonePtr z) : _vm(vm), _z(z) {
_gfx = _vm->_gfx;
_balloonMan = _vm->_balloonMan;
-
+
_dialogue = _z->u._speakDialogue;
isNpc = !_z->u._filename.empty() && _z->u._filename.compareToIgnoreCase("yourself");
_questioner = isNpc ? _vm->_disk->loadTalk(_z->u._filename.c_str()) : _vm->_char._talk;
@@ -166,11 +166,11 @@ void DialogueManager::transitionToState(DialogueState newState) {
"nextanswer",
"over"
};
-
+
if (_state != newState) {
debugC(3, kDebugDialogue, "DialogueManager moved to state '%s'", dialogueStates[newState]);
- if (DebugMan.isDebugChannelEnabled(kDebugDialogue) && gDebugLevel == 9) {
+ if (DebugMan.isDebugChannelEnabled(kDebugDialogue) && gDebugLevel == 9) {
switch (newState) {
case RUN_QUESTION:
debug(" Q : %s", _q->_text.c_str());
@@ -188,7 +188,7 @@ void DialogueManager::transitionToState(DialogueState newState) {
_state = newState;
}
-
+
bool DialogueManager::testAnswerFlags(Answer *a) {
uint32 flags = _vm->getLocationFlags();
if (a->_yesFlags & kFlagsGlobal)
@@ -240,7 +240,7 @@ int16 DialogueManager::selectAnswerN() {
VisibleAnswer *oldAnswer = &_visAnswers[_oldSelection];
VisibleAnswer *answer = &_visAnswers[_selection];
-
+
if (_selection != _oldSelection) {
if (_oldSelection != NO_ANSWER_SELECTED) {
_balloonMan->setBalloonText(oldAnswer->_balloon, oldAnswer->_a->_text, BalloonManager::kUnselectedColor);
@@ -286,7 +286,7 @@ void DialogueManager::nextAnswer() {
return;
}
- // try and check if there are any suitable answers,
+ // try and check if there are any suitable answers,
// given the current game state.
addVisibleAnswers(_q);
if (!_numVisAnswers) {
@@ -294,9 +294,9 @@ void DialogueManager::nextAnswer() {
transitionToState(DIALOGUE_OVER);
return;
}
-
+
if (_visAnswers[0]._a->textIsNull()) {
- // if the first answer is null (it's implied that it's the
+ // if the first answer is null (it's implied that it's the
// only one because we already called addVisibleAnswers),
// then jump to the next question
_answerId = _visAnswers[0]._index;
@@ -547,7 +547,7 @@ void Parallaction::runDialogueFrame() {
if (_input->_inputMode != Input::kInputModeDialogue) {
return;
}
-
+
_dialogueMan->run();
if (_dialogueMan->isOver()) {
diff --git a/engines/parallaction/exec_br.cpp b/engines/parallaction/exec_br.cpp
index 0ec1675c48..658ef5af82 100644
--- a/engines/parallaction/exec_br.cpp
+++ b/engines/parallaction/exec_br.cpp
@@ -530,11 +530,11 @@ DECLARE_INSTRUCTION_OPCODE(endif) {
DECLARE_INSTRUCTION_OPCODE(stop) {
ZonePtr z = ctxt._inst->_z;
-
- // Prevent execution if zone is missing. The known case is "PART2/insegui.scr", which has
+
+ // Prevent execution if zone is missing. The known case is "PART2/insegui.scr", which has
// "STOP insegui", which doesn't exist (see ticket #3021744 for the gory details)
if (!z) return;
-
+
if (ACTIONTYPE(z) == kZoneHear) {
warning("Parallaction_br::instOp_stop not yet implemented for HEAR zones");
// TODO: stop music or sound effects generated by a zone.
diff --git a/engines/parallaction/gfxbase.cpp b/engines/parallaction/gfxbase.cpp
index 24544f46dd..48d84ed101 100644
--- a/engines/parallaction/gfxbase.cpp
+++ b/engines/parallaction/gfxbase.cpp
@@ -296,19 +296,19 @@ void Gfx::bltMaskScale(const Common::Rect& r, byte *data, Graphics::Surface *sur
// clipped scaled destination rectangle
Common::Rect dstRect(scaledWidth, scaledHeight);
dstRect.moveTo(scaledLeft, scaledTop);
-
- Common::Rect clipper(surf->w, surf->h);
+
+ Common::Rect clipper(surf->w, surf->h);
dstRect.clip(clipper);
if (!dstRect.isValidRect()) return;
-
-
+
+
// clipped source rectangle
Common::Rect srcRect;
srcRect.left = (dstRect.left - scaledLeft) * 100 / scale;
srcRect.top = (dstRect.top - scaledTop) * 100 / scale;
srcRect.setWidth(dstRect.width() * 100 / scale);
srcRect.setHeight(dstRect.height() * 100 / scale);
- if (!srcRect.isValidRect()) return;
+ if (!srcRect.isValidRect()) return;
Common::Point dp;
dp.x = dstRect.left;
diff --git a/engines/parallaction/graphics.cpp b/engines/parallaction/graphics.cpp
index cf0cf13333..1da61b68ae 100644
--- a/engines/parallaction/graphics.cpp
+++ b/engines/parallaction/graphics.cpp
@@ -565,7 +565,7 @@ void Gfx::showFloatingLabel(GfxObj *label) {
label->x = -1000;
label->y = -1000;
label->setFlags(kGfxObjVisible);
-
+
_floatingLabel = label;
_labels.push_back(label);
}
@@ -673,7 +673,7 @@ void Gfx::showLabel(GfxObj *label, int16 x, int16 y) {
label->x = x;
label->y = y;
-
+
_labels.push_back(label);
}
@@ -695,7 +695,7 @@ void Gfx::unregisterLabel(GfxObj *label) {
_labels.remove_at(i);
break;
}
- }
+ }
}
diff --git a/engines/parallaction/gui_br.cpp b/engines/parallaction/gui_br.cpp
index c520ad4f25..d1361a6e8c 100644
--- a/engines/parallaction/gui_br.cpp
+++ b/engines/parallaction/gui_br.cpp
@@ -223,10 +223,10 @@ public:
}
break;
- default:
+ default:
_vm->_nextPart = _firstLocation[selection].part;
_vm->scheduleLocationSwitch(_firstLocation[selection].location);
-
+
}
_vm->_system->showMouse(false);
diff --git a/engines/parallaction/gui_ns.cpp b/engines/parallaction/gui_ns.cpp
index ef1a8a6e7e..3794aeae29 100644
--- a/engines/parallaction/gui_ns.cpp
+++ b/engines/parallaction/gui_ns.cpp
@@ -122,7 +122,7 @@ public:
_dosLanguageSelectBlocks[1] = Common::Rect( 129, 85, 177, 155 ); // French
_dosLanguageSelectBlocks[2] = Common::Rect( 178, 60, 226, 130 ); // English
_dosLanguageSelectBlocks[3] = Common::Rect( 227, 35, 275, 105 ); // German
-
+
_amigaLanguageSelectBlocks[0] = Common::Rect( -1, -1, -1, -1 ); // Italian: not supported by Amiga multi-lingual version
_amigaLanguageSelectBlocks[1] = Common::Rect( 129, 85, 177, 155 ); // French
_amigaLanguageSelectBlocks[2] = Common::Rect( 178, 60, 226, 130 ); // English
@@ -149,7 +149,7 @@ public:
_language = -1;
_allowChoice = true;
}
-
+
~ChooseLanguageInputState_NS() {
destroyLabels();
}
@@ -222,15 +222,15 @@ public:
_nextState[0] = "newgame";
_nextState[1] = "loadgame";
-
+
_labels[0] = 0;
_labels[1] = 0;
}
-
+
~SelectGameInputState_NS() {
destroyLabels();
}
-
+
void destroyLabels() {
_vm->_gfx->unregisterLabel(_labels[0]);
_vm->_gfx->unregisterLabel(_labels[1]);
@@ -326,7 +326,7 @@ public:
_labels[2] = 0;
_labels[3] = 0;
}
-
+
~NewGameInputState_NS() {
destroyLabels();
}
@@ -475,7 +475,7 @@ public:
_block.create(BLOCK_WIDTH, BLOCK_HEIGHT, Graphics::PixelFormat::createFormatCLUT8());
_labels[0] = 0;
_labels[1] = 0;
-
+
_codeSelectBlocks[0] = Common::Rect( 111, 129, 127, 153 ); // na
_codeSelectBlocks[1] = Common::Rect( 128, 120, 144, 144 ); // wa
_codeSelectBlocks[2] = Common::Rect( 145, 111, 161, 135 ); // ra
@@ -698,7 +698,7 @@ public:
_vm->_gfx->unregisterLabel(_labels[0]);
_vm->_gfx->unregisterLabel(_labels[1]);
delete _labels[0];
- delete _labels[1];
+ delete _labels[1];
_labels[0] = 0;
_labels[1] = 0;
}
@@ -827,18 +827,18 @@ public:
_labels[2] = 0;
_labels[3] = 0;
}
-
+
void destroyLabels() {
_vm->_gfx->unregisterLabel(_labels[0]);
_vm->_gfx->unregisterLabel(_labels[1]);
_vm->_gfx->unregisterLabel(_labels[2]);
_vm->_gfx->unregisterLabel(_labels[3]);
-
+
delete _labels[0];
delete _labels[1];
delete _labels[2];
delete _labels[3];
-
+
_labels[0] = 0;
_labels[1] = 0;
_labels[2] = 0;
diff --git a/engines/parallaction/objects.cpp b/engines/parallaction/objects.cpp
index 3750602076..22406013a1 100644
--- a/engines/parallaction/objects.cpp
+++ b/engines/parallaction/objects.cpp
@@ -264,7 +264,7 @@ bool Answer::textIsNull() {
int Answer::speakerMood() {
return _mood & 0xF;
}
-
+
Question::Question(const Common::String &name) : _name(name), _mood(0) {
memset(_answers, 0, sizeof(_answers));
}
@@ -278,16 +278,16 @@ Question::~Question() {
bool Question::textIsNull() {
return (_text.equalsIgnoreCase("NULL"));
}
-
+
int Question::speakerMood() {
return _mood & 0xF;
}
int Question::balloonWinding() {
- return _mood & 0x10;
+ return _mood & 0x10;
}
-
+
Instruction::Instruction() {
_index = 0;
_flags = 0;
diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp
index 9bbc7d0c57..a37c4439a1 100644
--- a/engines/parallaction/parallaction.cpp
+++ b/engines/parallaction/parallaction.cpp
@@ -627,7 +627,7 @@ bool Parallaction::checkSpecialZoneBox(ZonePtr z, uint32 type, uint x, uint y) {
return false;
}
}
-
+
// WORKAROUND: this huge condition is needed because we made TypeData a collection of structs
// instead of an union. So, merge->_obj1 and get->_icon were just aliases in the original engine,
// but we need to check it separately here. The same workaround is applied in freeZones.
@@ -659,14 +659,14 @@ bool Parallaction::checkZoneType(ZonePtr z, uint32 type) {
if (_gameType == GType_BRA) {
if (type == 0) {
- if (ITEMTYPE(z) == 0) {
+ if (ITEMTYPE(z) == 0) {
if (ACTIONTYPE(z) != kZonePath) {
return true;
}
- }
+ }
if (ACTIONTYPE(z) == kZoneDoor) {
return true;
- }
+ }
}
}
@@ -751,7 +751,7 @@ ZonePtr Parallaction::hitZone(uint32 type, uint16 x, uint16 y) {
AnimationPtr a = *ait;
_a = (a->_flags & kFlagsActive) ? 1 : 0; // _a: active Animation
-
+
if (!_a) {
if (_gameType == GType_BRA && ACTIONTYPE(a) != kZoneTrap) {
continue;
diff --git a/engines/parallaction/parallaction_ns.cpp b/engines/parallaction/parallaction_ns.cpp
index 64cf1b437d..0b92db1f0a 100644
--- a/engines/parallaction/parallaction_ns.cpp
+++ b/engines/parallaction/parallaction_ns.cpp
@@ -351,7 +351,7 @@ void Parallaction_ns::changeLocation() {
// prevent music changes during the introduction
_soundManI->playLocationMusic(location);
}
-
+
_input->stopHovering();
// this is still needed to remove the floatingLabel
_gfx->freeLabels();
@@ -471,7 +471,7 @@ void Parallaction_ns::changeCharacter(const char *name) {
// prevent music changes during the introduction
_soundManI->playCharacterMusic(_char.getBaseName());
}
-
+
// The original engine used to reload 'common' only on loadgames. We are reloading here since 'common'
// contains character specific stuff. This causes crashes like bug #1816899, because parseLocation tries
// to reload scripts but the data archive selected is occasionally wrong. This has been solved by having
diff --git a/engines/parallaction/parser_br.cpp b/engines/parallaction/parser_br.cpp
index e4be53022e..f53d71caec 100644
--- a/engines/parallaction/parser_br.cpp
+++ b/engines/parallaction/parser_br.cpp
@@ -824,12 +824,12 @@ void LocationParser_br::parseHearData(ZonePtr z) {
}
void LocationParser_br::parseNoneData(ZonePtr z) {
- /* the only case we have to handle here is that of "scende2", which is the only Animation with
+ /* the only case we have to handle here is that of "scende2", which is the only Animation with
a command list following the type marker.
*/
if (!scumm_stricmp(_tokens[0], "commands")) {
parseCommands(z->_commands);
- }
+ }
}
diff --git a/engines/parallaction/parser_ns.cpp b/engines/parallaction/parser_ns.cpp
index 69763affc8..213f0ae191 100644
--- a/engines/parallaction/parser_ns.cpp
+++ b/engines/parallaction/parser_ns.cpp
@@ -1412,9 +1412,9 @@ void LocationParser_ns::parseSpeakData(ZonePtr z) {
}
void LocationParser_ns::parseNoneData(ZonePtr z) {
- // "None" zones should have no content, but some
- // inconsistently define their command list after
- // the TYPE marker. This routine catches these
+ // "None" zones should have no content, but some
+ // inconsistently define their command list after
+ // the TYPE marker. This routine catches these
// command lists that would be lost otherwise.
if (!scumm_stricmp(_tokens[0], "commands")) {
parseCommands(z->_commands);
@@ -1423,7 +1423,7 @@ void LocationParser_ns::parseNoneData(ZonePtr z) {
_script->readLineToken(true);
_parser->parseStatement();
} while (!ctxt.endcommands);
-
+
// no need to parse one more line here, as
// it is done by the caller
}
diff --git a/engines/parallaction/sound.h b/engines/parallaction/sound.h
index baca5a7213..d0b5e5c175 100644
--- a/engines/parallaction/sound.h
+++ b/engines/parallaction/sound.h
@@ -131,11 +131,11 @@ class DosSoundMan_ns : public SoundMan_ns {
MidiPlayer *_midiPlayer;
bool _playing;
-
+
bool isLocationSilent(const char *locationName);
bool locationHasOwnSoftMusic(const char *locationName);
-
+
public:
DosSoundMan_ns(Parallaction_ns *vm);
~DosSoundMan_ns();
diff --git a/engines/parallaction/sound_ns.cpp b/engines/parallaction/sound_ns.cpp
index 917d310738..b5d4c72ea4 100644
--- a/engines/parallaction/sound_ns.cpp
+++ b/engines/parallaction/sound_ns.cpp
@@ -140,7 +140,7 @@ void DosSoundMan_ns::playMusic() {
Common::SeekableReadStream *stream = _vm->_disk->loadMusic(_musicFile);
_midiPlayer->play(stream);
_midiPlayer->setVolume(255);
-
+
_playing = true;
}
@@ -159,7 +159,7 @@ void DosSoundMan_ns::pause(bool p) {
bool DosSoundMan_ns::locationHasOwnSoftMusic(const char *locationName) {
return !scumm_stricmp(locationName, "night") || !scumm_stricmp(locationName, "intsushi");
}
-
+
void DosSoundMan_ns::playCharacterMusic(const char *character) {
if (!character || locationHasOwnSoftMusic(_vm->_location._name)) {
return;
@@ -167,7 +167,7 @@ void DosSoundMan_ns::playCharacterMusic(const char *character) {
char *name = const_cast<char*>(character);
const char *newMusicFile = 0;
-
+
if (!scumm_stricmp(name, _dinoName)) {
newMusicFile = "dino";
} else
@@ -200,7 +200,7 @@ void DosSoundMan_ns::playLocationMusic(const char *location) {
debugC(2, kDebugExec, "changeLocation: music stopped");
} else {
playCharacterMusic(_vm->_char.getBaseName());
- }
+ }
}
diff --git a/engines/parallaction/walk.cpp b/engines/parallaction/walk.cpp
index 21ee5ee5d9..5d5695ace4 100644
--- a/engines/parallaction/walk.cpp
+++ b/engines/parallaction/walk.cpp
@@ -590,14 +590,14 @@ void PathWalker_BR::doWalk(State &s) {
int xStep = (scale * 16) / 100 + 1;
int yStep = (scale * 10) / 100 + 1;
- /* WORKAROUND: in the balloon scene, the position of the balloon (which is implemented as a
+ /* WORKAROUND: in the balloon scene, the position of the balloon (which is implemented as a
Character) is controlled by the user (for movement, via this walking code) and by the scripts
(to simulate the balloon floating in the air, in a neverending loop that alters the position
coordinates).
When the two step sizes are equal in magnitude and opposite in direction, then the walk code
enters an infinite loop without giving control back to the user (this happens quite frequently
- when navigating the balloon near the borders of the screen, where the calculated step is
- forcibly small because of clipping). Since the "floating" script (part1/scripts/mongolo.scr)
+ when navigating the balloon near the borders of the screen, where the calculated step is
+ forcibly small because of clipping). Since the "floating" script (part1/scripts/mongolo.scr)
uses increments of 3 for both x and y, we tweak the calculated steps accordingly here. */
if (xStep == 3) xStep--;
if (yStep == 3) yStep--;
diff --git a/engines/saga/actor.cpp b/engines/saga/actor.cpp
index 86606855e3..862a0b4d64 100644
--- a/engines/saga/actor.cpp
+++ b/engines/saga/actor.cpp
@@ -340,7 +340,7 @@ void Actor::loadActorSpriteList(ActorData *actor) {
uint lastFrame = 0;
uint curFrameIndex;
int resourceId = actor->_spriteListResourceId;
-
+
if (actor->_frames != NULL) {
for (ActorFrameSequences::const_iterator i = actor->_frames->begin(); i != actor->_frames->end(); ++i) {
for (int orient = 0; orient < ACTOR_DIRECTIONS_COUNT; orient++) {
diff --git a/engines/saga/actor.h b/engines/saga/actor.h
index 451497986d..a4f475660d 100644
--- a/engines/saga/actor.h
+++ b/engines/saga/actor.h
@@ -321,7 +321,7 @@ public:
_screenDepth = in->readSint32LE();
_screenScale = in->readSint32LE();
}
-
+
CommonObjectData() {
_index = 0;
_id = 0;
@@ -463,7 +463,7 @@ public:
void cmdActorWalkTo(int argc, const char **argv);
bool validActorId(uint16 id) {
- return (id == ID_PROTAG) || ((id >= objectIndexToId(kGameObjectActor, 0)) && (id < objectIndexToId(kGameObjectActor, _actors.size())));
+ return (id == ID_PROTAG) || ((id >= objectIndexToId(kGameObjectActor, 0)) && (id < objectIndexToId(kGameObjectActor, _actors.size())));
}
int actorIdToIndex(uint16 id) { return (id == ID_PROTAG) ? 0 : objectIdToIndex(id); }
uint16 actorIndexToId(int index) { return (index == 0) ? ID_PROTAG : objectIndexToId(kGameObjectActor, index); }
diff --git a/engines/saga/animation.cpp b/engines/saga/animation.cpp
index 7ec4a59398..8b2d1e9dad 100644
--- a/engines/saga/animation.cpp
+++ b/engines/saga/animation.cpp
@@ -169,7 +169,7 @@ int Anim::playCutaway(int cut, bool fade) {
ByteArray resourceData;
_vm->_resource->loadResource(context, _cutawayList[cut].animResourceId, resourceData);
load(MAX_ANIMATIONS + cutawaySlot, resourceData);
-
+
setCycles(MAX_ANIMATIONS + cutawaySlot, _cutawayList[cut].cycles);
setFrameTime(MAX_ANIMATIONS + cutawaySlot, 1000 / _cutawayList[cut].frameRate);
@@ -414,7 +414,7 @@ void Anim::load(uint16 animId, const ByteArray &resourceData) {
}
anim->resourceData.resize(resourceData.size() - dataOffset);
-
+
memcpy(anim->resourceData.getBuffer(), resourceData.getBuffer() + dataOffset, anim->resourceData.size());
// Cache frame offsets
diff --git a/engines/saga/detection_tables.h b/engines/saga/detection_tables.h
index f63efd206b..ab73fcba6e 100644
--- a/engines/saga/detection_tables.h
+++ b/engines/saga/detection_tables.h
@@ -821,7 +821,7 @@ static const SAGAGameDescription gameDescriptions[] = {
},
Common::EN_ANY,
Common::kPlatformPC,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
GUIO_NONE
},
GID_DINO,
@@ -851,7 +851,7 @@ static const SAGAGameDescription gameDescriptions[] = {
},
Common::EN_ANY,
Common::kPlatformPC,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
GUIO_NONE
},
GID_FTA2,
diff --git a/engines/saga/events.cpp b/engines/saga/events.cpp
index 35f41e30ab..ec3ef2f6f9 100644
--- a/engines/saga/events.cpp
+++ b/engines/saga/events.cpp
@@ -557,7 +557,7 @@ int Events::handleInterval(Event *event) {
}
EventColumns *Events::chain(EventColumns *eventColumns, const Event &event) {
-
+
if (eventColumns == NULL) {
EventColumns tmp;
diff --git a/engines/saga/introproc_saga2.cpp b/engines/saga/introproc_saga2.cpp
index 80d53a2794..bdf8936a55 100644
--- a/engines/saga/introproc_saga2.cpp
+++ b/engines/saga/introproc_saga2.cpp
@@ -113,7 +113,7 @@ void Scene::playMovie(const char *filename) {
_vm->_system->updateScreen();
}
}
-
+
Common::Event event;
while (_vm->_system->getEventManager()->pollEvent(event)) {
if ((event.type == Common::EVENT_KEYDOWN && event.kbd.keycode == Common::KEYCODE_ESCAPE) || event.type == Common::EVENT_LBUTTONUP)
diff --git a/engines/saga/isomap.cpp b/engines/saga/isomap.cpp
index adea59ca9a..e886f0df82 100644
--- a/engines/saga/isomap.cpp
+++ b/engines/saga/isomap.cpp
@@ -836,7 +836,7 @@ void IsoMap::drawTile(uint16 tileIndex, const Point &point, const Location *loca
count = colDiff;
col += colDiff;
}
-
+
colDiff = _tileClip.right - col;
if (colDiff > 0) {
int countDiff = fgRunCount - count;
diff --git a/engines/saga/palanim.cpp b/engines/saga/palanim.cpp
index 1fefad93ab..021a4c9bac 100644
--- a/engines/saga/palanim.cpp
+++ b/engines/saga/palanim.cpp
@@ -53,7 +53,7 @@ void PalAnim::loadPalAnim(const ByteArray &resourceData) {
debug(3, "PalAnim::loadPalAnim(): Loading %d PALANIM entries.", _entries.size());
for (Common::Array<PalanimEntry>::iterator i = _entries.begin(); i != _entries.end(); ++i) {
-
+
i->cycle = 0;
i->colors.resize(readS.readUint16());
@@ -139,7 +139,7 @@ void PalAnim::cycleStep(int vectortime) {
void PalAnim::clear() {
debug(3, "PalAnim::clear()");
-
+
_entries.clear();
}
diff --git a/engines/saga/saga.cpp b/engines/saga/saga.cpp
index 15bd2aff72..d168605e99 100644
--- a/engines/saga/saga.cpp
+++ b/engines/saga/saga.cpp
@@ -451,7 +451,7 @@ void SagaEngine::loadStrings(StringsTable &stringsTable, const ByteArray &string
error("SagaEngine::loadStrings() Wrong offset");
}
stringsTable.strings[ui] = &stringsTable.buffer[offset];
-
+
debug(9, "string[%i]=%s", ui, stringsTable.strings[ui]);
}
}
diff --git a/engines/saga/scene.h b/engines/saga/scene.h
index adac3b622a..6e2cb12380 100644
--- a/engines/saga/scene.h
+++ b/engines/saga/scene.h
@@ -126,7 +126,7 @@ struct SceneDescription {
uint16 sceneScriptEntrypointNumber;
uint16 startScriptEntrypointNumber;
int16 musicResourceId;
-
+
void reset() {
flags = resourceListResourceId = endSlope = beginSlope = scriptModuleNumber = sceneScriptEntrypointNumber = startScriptEntrypointNumber = musicResourceId = 0;
}
diff --git a/engines/saga/sprite.cpp b/engines/saga/sprite.cpp
index 81893c7480..2895c6800c 100644
--- a/engines/saga/sprite.cpp
+++ b/engines/saga/sprite.cpp
@@ -207,7 +207,7 @@ void Sprite::drawClip(const Point &spritePointer, int width, int height, const b
const byte *srcPointer;
int backBufferPitch = _vm->_gfx->getBackBufferPitch();
-
+
//find Rects intersection
yDiff = clipRect.top - spritePointer.y;
if (yDiff > 0) {
@@ -247,10 +247,10 @@ void Sprite::drawClip(const Point &spritePointer, int width, int height, const b
}
bufRowPointer = _vm->_gfx->getBackBufferPixels() + backBufferPitch * yDstOffset + xDstOffset;
srcRowPointer = spriteBuffer + width * ySrcOffset + xSrcOffset;
-
+
// validate src, dst buffers
assert(_vm->_gfx->getBackBufferPixels() <= bufRowPointer);
- assert((_vm->_gfx->getBackBufferPixels() + (_vm->getDisplayInfo().width * _vm->getDisplayInfo().height)) >=
+ assert((_vm->_gfx->getBackBufferPixels() + (_vm->getDisplayInfo().width * _vm->getDisplayInfo().height)) >=
(byte *)(bufRowPointer + backBufferPitch * (cHeight - 1) + cWidth));
assert((const byte *)spriteBuffer <= srcRowPointer);
assert(((const byte *)spriteBuffer + (width * height)) >= (const byte *)(srcRowPointer + width * (cHeight - 1) + cWidth));
@@ -469,7 +469,7 @@ void Sprite::scaleBuffer(const byte *src, int width, int height, int scale, size
_decodeBuf.resize(outLength);
byte *dst = &_decodeBuf.front();
-
+
memset(dst, 0, _decodeBuf.size());
for (int i = 0; i < height; i++) {
diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp
index b1b5f81995..2f69d5caa1 100644
--- a/engines/sci/console.cpp
+++ b/engines/sci/console.cpp
@@ -255,7 +255,7 @@ void Console::postEnter() {
videoDecoder = new RobotDecoder(g_system->getMixer(), _engine->getPlatform() == Common::kPlatformMacintosh);
} else if (_videoFile.hasSuffix(".duk")) {
duckMode = true;
- videoDecoder = new Video::AviDecoder(g_system->getMixer());
+ videoDecoder = new Video::AviDecoder(g_system->getMixer());
#endif
} else if (_videoFile.hasSuffix(".avi")) {
videoDecoder = new Video::AviDecoder(g_system->getMixer());
@@ -895,7 +895,7 @@ bool Console::cmdVerifyScripts(int argc, const char **argv) {
return true;
}
-// Same as in sound/drivers/midi.cpp
+// Same as in sound/drivers/midi.cpp
uint8 getGmInstrument(const Mt32ToGmMap &Mt32Ins) {
if (Mt32Ins.gmInstr == MIDI_MAPPED_TO_RHYTHM)
return Mt32Ins.gmRhythmKey + 0x80;
@@ -913,7 +913,7 @@ bool Console::cmdShowInstruments(int argc, const char **argv) {
MidiPlayer *player = MidiPlayer_Midi_create(doSoundVersion);
MidiParser_SCI *parser = new MidiParser_SCI(doSoundVersion, 0);
parser->setMidiDriver(player);
-
+
Common::List<ResourceId> *resources = _engine->getResMan()->listResources(kResourceTypeSound);
Common::sort(resources->begin(), resources->end());
Common::List<ResourceId>::iterator itr = resources->begin();
@@ -984,7 +984,7 @@ bool Console::cmdShowInstruments(int argc, const char **argv) {
if (channel != 15) { // SCI special
byte instrument = *channelData++;
if (!firstOneShown)
- firstOneShown = true;
+ firstOneShown = true;
else
DebugPrintf(",");
@@ -1577,7 +1577,7 @@ bool Console::cmdPlayVideo(int argc, const char **argv) {
Common::String filename = argv[1];
filename.toLowercase();
- if (filename.hasSuffix(".seq") || filename.hasSuffix(".avi") || filename.hasSuffix(".vmd") ||
+ if (filename.hasSuffix(".seq") || filename.hasSuffix(".avi") || filename.hasSuffix(".vmd") ||
filename.hasSuffix(".rbt") || filename.hasSuffix(".duk")) {
_videoFile = filename;
_videoFrameDelay = (argc == 2) ? 10 : atoi(argv[2]);
@@ -1699,7 +1699,7 @@ bool Console::cmdShowSavedBits(int argc, const char **argv) {
return true;
}
- // Now we _finally_ know these are valid saved bits
+ // Now we _finally_ know these are valid saved bits
Common::Rect rect;
byte mask;
@@ -1829,7 +1829,7 @@ bool Console::cmdPrintSegmentTable(int argc, const char **argv) {
case SEG_TYPE_STRING:
DebugPrintf("T SCI32 strings (%d)", (*(StringTable *)mobj).entries_used);
break;
-#endif
+#endif
default:
DebugPrintf("I Invalid (type = %x)", mobj->getType());
@@ -2954,8 +2954,8 @@ void Console::printKernelCallsFound(int kernelFuncNum, bool showFoundScripts) {
uint16 argc2 = opparams[1];
if (kFuncNum == kernelFuncNum) {
- DebugPrintf("Called from script %d, object %s, method %s(%d) with %d bytes for arguments\n",
- itr->getNumber(), objName,
+ DebugPrintf("Called from script %d, object %s, method %s(%d) with %d bytes for arguments\n",
+ itr->getNumber(), objName,
_engine->getKernel()->getSelectorName(obj->getFuncSelector(i)).c_str(), i, argc2);
}
}
diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp
index 7bc9699e9b..2285e512bd 100644
--- a/engines/sci/detection.cpp
+++ b/engines/sci/detection.cpp
@@ -23,6 +23,7 @@
#include "engines/advancedDetector.h"
#include "base/plugins.h"
#include "common/file.h"
+#include "common/ptr.h"
#include "common/savefile.h"
#include "common/system.h"
#include "graphics/thumbnail.h"
@@ -224,6 +225,7 @@ static const OldNewIdTableEntry s_oldNewTable[] = {
{ "emc", "funseeker", SCI_VERSION_NONE },
{ "gk", "gk1", SCI_VERSION_NONE },
// gk2 is the same
+ { "gk2demo", "gk2", SCI_VERSION_NONE },
{ "hoyledemo", "hoyle1", SCI_VERSION_NONE },
{ "cardgames", "hoyle1", SCI_VERSION_NONE },
{ "solitare", "hoyle2", SCI_VERSION_NONE },
@@ -235,7 +237,7 @@ static const OldNewIdTableEntry s_oldNewTable[] = {
{ "kq4", "kq4sci", SCI_VERSION_NONE },
// kq5 is the same
// kq6 is the same
- // kq7 is the same
+ { "kq7cd", "kq7", SCI_VERSION_NONE },
{ "mm1", "laurabow", SCI_VERSION_NONE },
{ "cb1", "laurabow", SCI_VERSION_NONE },
{ "lb2", "laurabow2", SCI_VERSION_NONE },
@@ -323,7 +325,7 @@ Common::String convertSierraGameId(Common::String sierraId, uint32 *gameFlags, R
for (const OldNewIdTableEntry *cur = s_oldNewTable; cur->oldId[0]; ++cur) {
if (sierraId == cur->oldId) {
- // Distinguish same IDs from the SCI version
+ // Distinguish same IDs via the SCI version
if (cur->version != SCI_VERSION_NONE && cur->version != getSciVersion())
continue;
@@ -428,64 +430,57 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const FileMap &allFiles,
s_fallbackDesc.flags = ADGF_NO_FLAGS;
s_fallbackDesc.platform = Common::kPlatformPC; // default to PC platform
s_fallbackDesc.gameid = "sci";
+ s_fallbackDesc.guioptions = Common::GUIO_NONE;
- // First grab all filenames
- // TODO: Consider using allFiles instead of fslist
- for (Common::FSList::const_iterator file = fslist.begin(); file != fslist.end(); ++file) {
- if (file->isDirectory())
- continue;
-
- Common::String filename = file->getName();
- filename.toLowercase();
+ if (allFiles.contains("resource.map") || allFiles.contains("Data1")
+ || allFiles.contains("resmap.001") || allFiles.contains("resmap.001")) {
+ foundResMap = true;
+ }
- if (filename.contains("resource.map") || filename.contains("resmap.00") || filename.contains("Data1")) {
- foundResMap = true;
+ // Determine if we got a CD version and set the CD flag accordingly, by checking for
+ // resource.aud for SCI1.1 CD games, or audio001.002 for SCI1 CD games. We assume that
+ // the file should be over 10MB, as it contains all the game speech and is usually
+ // around 450MB+. The size check is for some floppy game versions like KQ6 floppy, which
+ // also have a small resource.aud file
+ if (allFiles.contains("resource.aud") || allFiles.contains("audio001.002")) {
+ Common::FSNode file = allFiles.contains("resource.aud") ? allFiles["resource.aud"] : allFiles["audio001.002"];
+ Common::SeekableReadStream *tmpStream = file.createReadStream();
+ if (tmpStream->size() > 10 * 1024 * 1024) {
+ // We got a CD version, so set the CD flag accordingly
+ s_fallbackDesc.flags |= ADGF_CD;
}
+ delete tmpStream;
+ }
- // Determine if we got a CD version and set the CD flag accordingly, by checking for
- // resource.aud for SCI1.1 CD games, or audio001.002 for SCI1 CD games. We assume that
- // the file should be over 10MB, as it contains all the game speech and is usually
- // around 450MB+. The size check is for some floppy game versions like KQ6 floppy, which
- // also have a small resource.aud file
- if (filename.contains("resource.aud") || filename.contains("audio001.002")) {
- Common::SeekableReadStream *tmpStream = file->createReadStream();
- if (tmpStream->size() > 10 * 1024 * 1024) {
- // We got a CD version, so set the CD flag accordingly
- s_fallbackDesc.flags |= ADGF_CD;
- s_fallbackDesc.extra = "CD";
- }
- delete tmpStream;
- }
+ if (allFiles.contains("resource.000") || allFiles.contains("resource.001")
+ || allFiles.contains("ressci.000") || allFiles.contains("ressci.001"))
+ foundRes000 = true;
- if (filename.contains("resource.000") || filename.contains("resource.001")
- || filename.contains("ressci.000") || filename.contains("ressci.001"))
- foundRes000 = true;
+ // Data1 contains both map and volume for SCI1.1+ Mac games
+ if (allFiles.contains("Data1")) {
+ foundResMap = foundRes000 = true;
+ s_fallbackDesc.platform = Common::kPlatformMacintosh;
+ }
- // Data1 contains both map and volume for SCI1.1+ Mac games
- if (filename.contains("Data1")) {
- foundResMap = foundRes000 = true;
- s_fallbackDesc.platform = Common::kPlatformMacintosh;
- }
+ // Determine the game platform
+ // The existence of any of these files indicates an Amiga game
+ if (allFiles.contains("9.pat") || allFiles.contains("spal") ||
+ allFiles.contains("patch.005") || allFiles.contains("bank.001"))
+ s_fallbackDesc.platform = Common::kPlatformAmiga;
- // Determine the game platform
- // The existence of any of these files indicates an Amiga game
- if (filename.contains("9.pat") || filename.contains("spal") ||
- filename.contains("patch.005") || filename.contains("bank.001"))
- s_fallbackDesc.platform = Common::kPlatformAmiga;
+ // The existence of 7.pat or patch.200 indicates a Mac game
+ if (allFiles.contains("7.pat") || allFiles.contains("patch.200"))
+ s_fallbackDesc.platform = Common::kPlatformMacintosh;
- // The existence of 7.pat or patch.200 indicates a Mac game
- if (filename.contains("7.pat") || filename.contains("patch.200"))
- s_fallbackDesc.platform = Common::kPlatformMacintosh;
+ // The data files for Atari ST versions are the same as their DOS counterparts
- // The data files for Atari ST versions are the same as their DOS counterparts
- }
// If these files aren't found, it can't be SCI
if (!foundResMap && !foundRes000) {
return 0;
}
- ResourceManager *resMan = new ResourceManager();
+ Common::ScopedPtr<ResourceManager> resMan(new ResourceManager());
assert(resMan);
resMan->addAppropriateSources(fslist);
resMan->init(true);
@@ -495,7 +490,6 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const FileMap &allFiles,
// Is SCI32 compiled in? If not, and this is a SCI32 game,
// stop here
if (getSciVersion() >= SCI_VERSION_2) {
- delete resMan;
return (const ADGameDescription *)&s_fallbackDesc;
}
#endif
@@ -506,7 +500,6 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const FileMap &allFiles,
// Can't be SCI (or unsupported SCI views). Pinball Creep by sierra also uses resource.map/resource.000 files
// but doesnt share sci format at all, if we dont return 0 here we will detect this game as SCI
if (gameViews == kViewUnknown) {
- delete resMan;
return 0;
}
@@ -519,7 +512,6 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const FileMap &allFiles,
// If we don't have a game id, the game is not SCI
if (sierraGameId.empty()) {
- delete resMan;
return 0;
}
@@ -558,24 +550,43 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const FileMap &allFiles,
}
- // Fill in extras field
+ // Fill in "extra" field
+
+ // Is this an EGA version that might have a VGA pendant? Then we want
+ // to mark it as such in the "extra" field.
+ const bool markAsEGA = (gameViews == kViewEga && s_fallbackDesc.platform != Common::kPlatformAmiga
+ && getSciVersion() > SCI_VERSION_1_EGA_ONLY);
+
+ const bool isDemo = (s_fallbackDesc.flags & ADGF_DEMO);
+ const bool isCD = (s_fallbackDesc.flags & ADGF_CD);
+
+ if (!isCD)
+ s_fallbackDesc.guioptions |= Common::GUIO_NOSPEECH;
if (gameId.hasSuffix("sci")) {
s_fallbackDesc.extra = "SCI";
// Differentiate EGA versions from the VGA ones, where needed
- if (gameViews == kViewEga && s_fallbackDesc.platform != Common::kPlatformAmiga)
+ if (markAsEGA)
s_fallbackDesc.extra = "SCI/EGA";
+
+ // Mark as demo.
+ // Note: This overwrites the 'EGA' info, if it was previously set.
+ if (isDemo)
+ s_fallbackDesc.extra = "SCI/Demo";
} else {
- if (gameViews == kViewEga && s_fallbackDesc.platform != Common::kPlatformAmiga)
+ if (markAsEGA)
s_fallbackDesc.extra = "EGA";
- }
-
- // Add "demo" to the description for demos
- if (s_fallbackDesc.flags & ADGF_DEMO)
- s_fallbackDesc.extra = (gameId.hasSuffix("sci")) ? "SCI/Demo" : "Demo";
- delete resMan;
+ // Set "CD" and "Demo" as appropriate.
+ // Note: This overwrites the 'EGA' info, if it was previously set.
+ if (isDemo && isCD)
+ s_fallbackDesc.extra = "CD Demo";
+ else if (isDemo)
+ s_fallbackDesc.extra = "Demo";
+ else if (isCD)
+ s_fallbackDesc.extra = "CD";
+ }
return (const ADGameDescription *)&s_fallbackDesc;
}
diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h
index def3879945..0010f095e1 100644
--- a/engines/sci/detection_tables.h
+++ b/engines/sci/detection_tables.h
@@ -617,7 +617,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "372d059f75856afa6d73dd84cbb8913d", 10783},
{"resource.000", 0, "69b7516962510f780d38519cc15fcc7c", 13022630},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH },
+ Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NOSPEECH },
// Gabriel Knight - English DOS Floppy (supplied my markcoolio in bug report #2723777)
// SCI interpreter version 2.000.000
@@ -625,7 +625,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "65e8c14092e4c9b3b3538b7602c8c5ec", 10783},
{"resource.000", 0, "69b7516962510f780d38519cc15fcc7c", 13022630},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH },
+ Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NOSPEECH },
// Gabriel Knight - English DOS Floppy
// SCI interpreter version 2.000.000, VERSION file reports "1.0\nGabriel Knight\n11/22/10:33 pm\n\x1A"
@@ -633,7 +633,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "ef41df08cf2c1f680216cdbeed0f8311", 10783},
{"resource.000", 0, "69b7516962510f780d38519cc15fcc7c", 13022630},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH },
+ Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NOSPEECH },
// Gabriel Knight - German DOS Floppy (supplied my markcoolio in bug report #2723775)
// SCI interpreter version 2.000.000
@@ -641,7 +641,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "ad6508b0296b25c07b1f58828dc33696", 10789},
{"resource.000", 0, "091cf08910780feabc56f8551b09cb36", 13077029},
AD_LISTEND},
- Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH },
+ Common::DE_DEU, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NOSPEECH },
// Gabriel Knight - English DOS CD (from jvprat)
// Executable scanning reports "2.000.000", VERSION file reports "01.100.000"
@@ -649,7 +649,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "372d059f75856afa6d73dd84cbb8913d", 10996},
{"resource.000", 0, "69b7516962510f780d38519cc15fcc7c", 12581736},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformPC, ADGF_CD, GUIO_NONE },
+ Common::EN_ANY, Common::kPlatformPC, ADGF_CD | ADGF_UNSTABLE, GUIO_NONE },
// Gabriel Knight - English Windows CD (from jvprat)
// Executable scanning reports "2.000.000", VERSION file reports "01.100.000"
@@ -657,7 +657,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "372d059f75856afa6d73dd84cbb8913d", 10996},
{"resource.000", 0, "69b7516962510f780d38519cc15fcc7c", 12581736},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformWindows, ADGF_CD, GUIO_NONE },
+ Common::EN_ANY, Common::kPlatformWindows, ADGF_CD | ADGF_UNSTABLE, GUIO_NONE },
// Gabriel Knight - German DOS CD (from Tobis87)
// SCI interpreter version 2.000.000
@@ -665,7 +665,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "a7d3e55114c65647310373cb390815ba", 11392},
{"resource.000", 0, "091cf08910780feabc56f8551b09cb36", 13400497},
AD_LISTEND},
- Common::DE_DEU, Common::kPlatformPC, ADGF_CD, GUIO_NONE },
+ Common::DE_DEU, Common::kPlatformPC, ADGF_CD | ADGF_UNSTABLE, GUIO_NONE },
// Gabriel Knight - Spanish DOS CD (from jvprat)
// Executable scanning reports "2.000.000", VERSION file reports "1.000.000, April 13, 1995"
@@ -673,7 +673,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "7cb6e9bba15b544ec7a635c45bde9953", 11404},
{"resource.000", 0, "091cf08910780feabc56f8551b09cb36", 13381599},
AD_LISTEND},
- Common::ES_ESP, Common::kPlatformPC, ADGF_CD, GUIO_NONE },
+ Common::ES_ESP, Common::kPlatformPC, ADGF_CD | ADGF_UNSTABLE, GUIO_NONE },
// Gabriel Knight - French DOS CD (from Hkz)
// VERSION file reports "1.000.000, May 3, 1994"
@@ -681,7 +681,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "55f909ba93a2515042a08d8a2da8414e", 11392},
{"resource.000", 0, "091cf08910780feabc56f8551b09cb36", 13325145},
AD_LISTEND},
- Common::FR_FRA, Common::kPlatformPC, ADGF_CD, GUIO_NONE },
+ Common::FR_FRA, Common::kPlatformPC, ADGF_CD | ADGF_UNSTABLE, GUIO_NONE },
// Gabriel Knight - German Windows CD (from Tobis87)
// SCI interpreter version 2.000.000
@@ -689,7 +689,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "a7d3e55114c65647310373cb390815ba", 11392},
{"resource.000", 0, "091cf08910780feabc56f8551b09cb36", 13400497},
AD_LISTEND},
- Common::DE_DEU, Common::kPlatformWindows, ADGF_CD, GUIO_NONE },
+ Common::DE_DEU, Common::kPlatformWindows, ADGF_CD | ADGF_UNSTABLE, GUIO_NONE },
// Gabriel Knight - Spanish Windows CD (from jvprat)
// Executable scanning reports "2.000.000", VERSION file reports "1.000.000, April 13, 1995"
@@ -697,7 +697,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "7cb6e9bba15b544ec7a635c45bde9953", 11404},
{"resource.000", 0, "091cf08910780feabc56f8551b09cb36", 13381599},
AD_LISTEND},
- Common::ES_ESP, Common::kPlatformWindows, ADGF_CD, GUIO_NONE },
+ Common::ES_ESP, Common::kPlatformWindows, ADGF_CD | ADGF_UNSTABLE, GUIO_NONE },
// Gabriel Knight - English Macintosh
{"gk1", "", {
@@ -706,7 +706,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"Data3", 0, "f25068b408b09275d8b698866462f578", 3677599},
{"Data4", 0, "1cceebbe411b26c860a74f91c337fdf3", 3230086},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformMacintosh, ADGF_MACRESFORK, GUIO_NONE },
+ Common::EN_ANY, Common::kPlatformMacintosh, ADGF_MACRESFORK | ADGF_UNSTABLE, GUIO_NONE },
// Gabriel Knight 2 - English Windows Non-Interactive Demo
// Executable scanning reports "2.100.002"
@@ -714,7 +714,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "e0effce11c4908f4b91838741716c83d", 1351},
{"resource.000", 0, "d04cfc7f04b6f74d13025378be49ec2b", 4640330},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformWindows, ADGF_DEMO, GUIO_NOSPEECH },
+ Common::EN_ANY, Common::kPlatformWindows, ADGF_DEMO | ADGF_UNSTABLE, GUIO_NOSPEECH },
// Gabriel Knight 2 - English DOS (from jvprat)
// Executable scanning reports "2.100.002", VERSION file reports "1.1"
@@ -732,7 +732,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.006", 0, "ce9359037277b7d7976da185c2fa0aad", 2977},
{"ressci.006", 0, "8e44e03890205a7be12f45aaba9644b4", 60659424},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH },
+ Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NOSPEECH },
// Gabriel Knight 2 - French DOS (6-CDs Sierra Originals reedition)
// Executable scanning reports "2.100.002", VERSION file reports "1.0"
@@ -750,7 +750,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.006", 0, "11b2e722170b8c93fdaa5428e2c7676f", 3001},
{"ressci.006", 0, "4037d941aec39d2e654e20960429aefc", 60568486},
AD_LISTEND},
- Common::FR_FRA, Common::kPlatformPC, 0,
+ Common::FR_FRA, Common::kPlatformPC, ADGF_UNSTABLE,
GUIO_NOSPEECH },
// Gabriel Knight 2 - English Macintosh
@@ -763,7 +763,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"Data4", 0, "8b843c62eb53136a855d6e0087e3cb0d", 5889553},
{"Data5", 0, "f9fcf9ab2eb13b2125c33a1cda03a093", 14349984},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformMacintosh, ADGF_MACRESFORK, GUIO_NONE },
+ Common::EN_ANY, Common::kPlatformMacintosh, ADGF_MACRESFORK | ADGF_UNSTABLE, GUIO_NONE },
#endif // ENABLE_SCI32
@@ -1446,7 +1446,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.000", 0, "4948e4e1506f1e1c4e1d47abfa06b7f8", 204385195},
{"resource.map", 0, "40ccafb2195301504eba2e4f4f2c7f3d", 18925},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformWindows, 0, GUIO_NOSPEECH },
+ Common::EN_ANY, Common::kPlatformWindows, ADGF_UNSTABLE, GUIO_NOSPEECH },
// King's Quest 7 - English Windows (from the King's Quest Collection)
// Executable scanning reports "2.100.002", VERSION file reports "1.4"
@@ -1454,7 +1454,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "2be9ab94429c721af8e05c507e048a15", 18697},
{"resource.000", 0, "eb63ea3a2c2469dc2d777d351c626404", 203882535},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformWindows, 0, GUIO_NOSPEECH },
+ Common::EN_ANY, Common::kPlatformWindows, ADGF_UNSTABLE, GUIO_NOSPEECH },
// King's Quest 7 - English DOS (from FRG)
// SCI interpreter version 2.100.002, VERSION file reports "2.00b"
@@ -1462,7 +1462,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "8676b0fbbd7362989a029fe72fea14c6", 18709},
{"resource.000", 0, "51c1ead1163e19a2de8f121c39df7a76", 200764100},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH },
+ Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NOSPEECH },
// King's Quest 7 - English Windows (from FRG)
// SCI interpreter version 2.100.002, VERSION file reports "2.00b"
@@ -1470,7 +1470,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "8676b0fbbd7362989a029fe72fea14c6", 18709},
{"resource.000", 0, "51c1ead1163e19a2de8f121c39df7a76", 200764100},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformWindows, 0, GUIO_NOSPEECH },
+ Common::EN_ANY, Common::kPlatformWindows, ADGF_UNSTABLE, GUIO_NOSPEECH },
// King's Quest 7 - German Windows (supplied by markcoolio in bug report #2727402)
// SCI interpreter version 2.100.002
@@ -1478,7 +1478,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "838b9ff132bd6962026fee832e8a7ddb", 18697},
{"resource.000", 0, "eb63ea3a2c2469dc2d777d351c626404", 206626576},
AD_LISTEND},
- Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH },
+ Common::DE_DEU, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NOSPEECH },
// King's Quest 7 - Spanish DOS (from jvprat)
// Executable scanning reports "2.100.002", VERSION file reports "2.00"
@@ -1486,7 +1486,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "0b62693cbe87e3aaca3e8655a437f27f", 18709},
{"resource.000", 0, "51c1ead1163e19a2de8f121c39df7a76", 200764100},
AD_LISTEND},
- Common::ES_ESP, Common::kPlatformPC, 0, GUIO_NOSPEECH },
+ Common::ES_ESP, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NOSPEECH },
// King's Quest 7 - English DOS Non-Interactive Demo
// SCI interpreter version 2.100.002
@@ -1494,7 +1494,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "b44f774108d63faa1d021101221c5a54", 1690},
{"resource.000", 0, "d9659d2cf0c269c6a9dc776707f5bea0", 2433827},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH },
+ Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO | ADGF_UNSTABLE, GUIO_NOSPEECH },
#endif // ENABLE_SCI32
@@ -2087,7 +2087,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "0c0804434ea62278dd15032b1947426c", 8872},
{"resource.000", 0, "9a9f4870504444cda863dd14d077a680", 18520872},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NONE },
+ Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NONE },
// Larry 6 - German DOS CD - HIRES (provided by richiefs in bug report #2670691)
// SCI interpreter version 2.100.002
@@ -2095,7 +2095,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "badfdf446ffed569a310d2c63a249421", 8896},
{"resource.000", 0, "bd944d2b06614a5b39f1586906f0ee88", 18534274},
AD_LISTEND},
- Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NONE },
+ Common::DE_DEU, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NONE },
// Larry 6 - French DOS CD - HIRES (provided by richiefs in bug report #2670691)
// SCI interpreter version 2.100.002
@@ -2103,7 +2103,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "d184e9aa4f2d4b5670ddb3669db82cda", 8896},
{"resource.000", 0, "bd944d2b06614a5b39f1586906f0ee88", 18538987},
AD_LISTEND},
- Common::FR_FRA, Common::kPlatformPC, 0, GUIO_NONE },
+ Common::FR_FRA, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NONE },
// Larry 7 - English DOS Demo (provided by richiefs in bug report #2670691)
// SCI interpreter version 2.100.002
@@ -2111,7 +2111,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"ressci.000", 0, "5cc6159688b2dc03790a67c90ccc67f9", 10195878},
{"resmap.000", 0, "6a2b2811eef82e87cde91cf1de845af8", 2695},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH },
+ Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO | ADGF_UNSTABLE, GUIO_NOSPEECH },
#ifdef ENABLE_SCI3_GAMES
// Larry 7 - English DOS CD (from spookypeanut)
@@ -2120,7 +2120,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.000", 0, "eae93e1b1d1ccc58b4691c371281c95d", 8188},
{"ressci.000", 0, "89353723488219e25589165d73ed663e", 66965678},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NONE },
+ Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NONE },
// Larry 7 - German DOS (from Tobis87)
// SCI interpreter version 3.000.000
@@ -2128,7 +2128,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.000", 0, "c11e6bfcfc2f2d05da47e5a7df3e9b1a", 8188},
{"ressci.000", 0, "a8c6817bb94f332ff498a71c8b47f893", 66971724},
AD_LISTEND},
- Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH },
+ Common::DE_DEU, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NOSPEECH },
// Larry 7 - French DOS (provided by richiefs in bug report #2670691)
// SCI interpreter version 3.000.000
@@ -2136,7 +2136,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.000", 0, "4407849fd52fe3efb0c30fba60cd5cd4", 8206},
{"ressci.000", 0, "dc37c3055fffbefb494ff22b145d377b", 66964472},
AD_LISTEND},
- Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH },
+ Common::DE_DEU, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NOSPEECH },
// Larry 7 - Italian DOS CD (from glorifindel)
// SCI interpreter version 3.000.000
@@ -2144,7 +2144,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.000", 0, "9852a97141f789413f29bf956052acdb", 8212},
{"ressci.000", 0, "440b9fed89590abb4e4386ed6f948ee2", 67140181},
AD_LISTEND},
- Common::IT_ITA, Common::kPlatformPC, 0, GUIO_NONE },
+ Common::IT_ITA, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NONE },
// Larry 7 - Spanish DOS (from the Leisure Suit Larry Collection)
// Executable scanning reports "3.000.000", VERSION file reports "1.0s"
@@ -2152,7 +2152,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.000", 0, "8f3d603e1acc834a5d598b30cdfc93f3", 8188},
{"ressci.000", 0, "32792f9bc1bf3633a88b382bb3f6e40d", 67071418},
AD_LISTEND},
- Common::ES_ESP, Common::kPlatformPC, 0, GUIO_NOSPEECH },
+ Common::ES_ESP, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NOSPEECH },
#endif
// Lighthouse - English Windows Demo (from jvprat)
@@ -2161,7 +2161,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "543124606352bfa5e07696ddf2a669be", 64},
{"resource.000", 0, "5d7714416b612463d750fb9c5690c859", 28952},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH },
+ Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO | ADGF_UNSTABLE, GUIO_NOSPEECH },
#ifdef ENABLE_SCI3_GAMES
// Lighthouse - English Windows Demo
@@ -2170,7 +2170,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.000", 0, "3bdee7a16926975a4729f75cf6b80a92", 1525},
{"ressci.000", 0, "3c585827fa4a82f4c04a56a0bc52ccee", 11494351},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH },
+ Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO | ADGF_UNSTABLE, GUIO_NOSPEECH },
// Lighthouse - English DOS (from jvprat)
// Executable scanning reports "3.000.000", VERSION file reports "1.1"
@@ -2180,7 +2180,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.002", 0, "c68db5333f152fea6ca2dfc75cad8b34", 7573},
{"ressci.002", 0, "175468431a979b9f317c294ce3bc1430", 94628315},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH },
+ Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NOSPEECH },
// Lighthouse - Spanish DOS (from jvprat)
// Executable scanning reports "3.000.000", VERSION file reports "1.1"
@@ -2190,7 +2190,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.002", 0, "e7dc85884a2417e2eff9de0c63dd65fa", 7630},
{"ressci.002", 0, "3c8d627c555b0e3e4f1d9955bc0f0df4", 94631127},
AD_LISTEND},
- Common::ES_ESP, Common::kPlatformPC, 0, GUIO_NOSPEECH },
+ Common::ES_ESP, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NOSPEECH },
#endif // ENABLE_SCI3_GAMES
#endif // ENABLE_SCI32
@@ -2307,7 +2307,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "5159a1578c4306bfe070a3e4d8c2e1d3", 4741},
{"resource.000", 0, "1926925c95d82f0999590e93b02887c5", 15150768},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NONE },
+ Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NONE },
// Mixed-Up Mother Goose Deluxe - Multilingual Windows CD (English/French/German/Spanish)
// Executable scanning reports "2.100.002"
@@ -2315,7 +2315,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.000", 0, "ef611af561898dcfea87846919ebf3eb", 4969},
{"ressci.000", 0, "227685bc59d90821978d330713e44a7a", 17205800},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NONE },
+ Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NONE },
#endif // ENABLE_SCI32
// Ms. Astro Chicken - English DOS
@@ -2345,15 +2345,15 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.007", 0, "afbd16ea77869a720afa1c5371de107d", 7972},
//{"ressci.007", 0, "3aae6559aa1df273bc542d5ac6330d75", 25859038},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH },
-
+ Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NOSPEECH },
+
// Phantasmagoria - English DOS Demo
// Executable scanning reports "2.100.002"
{"phantasmagoria", "Demo", {
{"resmap.001", 0, "416138651ea828219ca454cae18341a3", 11518},
{"ressci.001", 0, "3aae6559aa1df273bc542d5ac6330d75", 65844612},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH },
+ Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO | ADGF_UNSTABLE, GUIO_NOSPEECH },
// Phantasmagoria - English DOS/Windows (GOG version) - ressci.* merged in ressci.000
// Windows executable scanning reports "2.100.002" - "Sep 19 1995 15:09:43"
@@ -2364,7 +2364,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"ressci.000", 0, "cd5967f9b9586e3380645961c0765be3", 116822037},
{"resmap.000", 0, "3cafc1c6a53945c1f3babbfd6380c64c", 16468},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH },
+ Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NOSPEECH },
// Phantasmagoria - English Macintosh
// NOTE: This only contains disc 1 files (as well as the two persistent files:
@@ -2380,7 +2380,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
// Data8-12 are empty
{"Data13", 0, "6d2c450fca19a69b5af74ed5b03c0a17", 14923328},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformMacintosh, ADGF_MACRESFORK, GUIO_NONE },
+ Common::EN_ANY, Common::kPlatformMacintosh, ADGF_MACRESFORK | ADGF_UNSTABLE, GUIO_NONE },
#ifdef ENABLE_SCI3_GAMES
// Phantasmagoria 2 - English Windows (from jvprat)
@@ -2397,7 +2397,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.005", 0, "8bd5ceeedcbe16dfe55d1b90dcd4be84", 1942},
{"ressci.005", 0, "05f9fe2bee749659acb3cd2c90252fc5", 67905112},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformWindows, 0, GUIO_NOSPEECH },
+ Common::EN_ANY, Common::kPlatformWindows, ADGF_UNSTABLE, GUIO_NOSPEECH },
// Phantasmagoria 2 - English DOS (GOG version) - ressci.* merged in ressci.000
// Executable scanning reports "3.000.000" - "Dec 07 1996 09:29:03"
@@ -2407,7 +2407,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"ressci.000", 0, "c54f26d9f43f908151263254b6d97053", 108134481},
{"resmap.000", 0, "de154a223a9ef4ea7358b76adc38ef5b", 2956},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformWindows, 0, GUIO_NOSPEECH },
+ Common::EN_ANY, Common::kPlatformWindows, ADGF_UNSTABLE, GUIO_NOSPEECH },
#endif // ENABLE_SCI3_GAMES
#endif // ENABLE_SCI32
@@ -2614,7 +2614,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "379dfe80ed6bd16c47e4b950c4722eac", 11374},
{"resource.000", 0, "fd316a09b628b7032248139003369022", 18841068},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformPC, ADGF_CD, GUIO_NONE },
+ Common::EN_ANY, Common::kPlatformPC, ADGF_CD | ADGF_UNSTABLE, GUIO_NONE },
// Police Quest 4 - English DOS
// SCI interpreter version 2.000.000 (a guess?)
@@ -2622,7 +2622,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "aed9643158ccf01b71f359db33137f82", 9895},
{"resource.000", 0, "da383857b3be1e4514daeba2524359e0", 15141432},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH },
+ Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NOSPEECH },
// Police Quest 4 - French DOS (supplied by abevi in bug report #2612718)
// SCI interpreter version 2.000.000
@@ -2630,7 +2630,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "008030846edcc7c5c7a812c7f4ae4ceb", 9256},
{"resource.000", 0, "6ba98bd2e436739d87ecd2a9b99cabb4", 14730153},
AD_LISTEND},
- Common::FR_FRA, Common::kPlatformPC, 0, GUIO_NOSPEECH },
+ Common::FR_FRA, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NOSPEECH },
// Police Quest 4 - German DOS (supplied by markcoolio in bug report #2723840)
// SCI interpreter version 2.000.000 (a guess?)
@@ -2638,7 +2638,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "2393ee728ab930b2762cb5889f9b5aff", 9256},
{"resource.000", 0, "6ba98bd2e436739d87ecd2a9b99cabb4", 14730155},
AD_LISTEND},
- Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH },
+ Common::DE_DEU, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NOSPEECH },
// Police Quest: SWAT - English DOS/Windows Demo (from jvprat)
// Executable scanning reports "2.100.002", VERSION file reports "0.001.200"
@@ -2646,7 +2646,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "8c96733ef94c21526792f7ca4e3f2120", 1648},
{"resource.000", 0, "d8892f1b8c56c8f7704325460f49b300", 3676175},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH },
+ Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO | ADGF_UNSTABLE, GUIO_NOSPEECH },
// Police Quest: SWAT - English DOS (from GOG.com)
// Executable scanning reports "2.100.002", VERSION file reports "1.0c"
@@ -2654,7 +2654,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.000", 0, "1c2563fee189885e29d9348f37306d94", 12175},
{"ressci.000", 0, "b2e1826ca81ce2e7e764587f5a14eee9", 127149181},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NONE },
+ Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NONE },
// Police Quest: SWAT - English Windows (from the Police Quest Collection)
// Executable scanning reports "2.100.002", VERSION file reports "1.0c"
@@ -2669,7 +2669,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.004", 0, "4228038906f041623e65789500b22285", 6835},
{"ressci.004", 0, "b7e619e6ecf62fe65d5116a3a422e5f0", 46223872},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformWindows, 0, GUIO_NONE },
+ Common::EN_ANY, Common::kPlatformWindows, ADGF_UNSTABLE, GUIO_NONE },
#endif // ENABLE_SCI32
// Quest for Glory 1 / Hero's Quest - English DOS 3.5" Floppy (supplied by merkur in bug report #2718784)
@@ -2980,7 +2980,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "685bdb1ed47bbbb0e5e25db392da83ce", 9301},
{"resource.000", 0, "f64fd6aa3977939a86ff30783dd677e1", 11004993},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH },
+ Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NOSPEECH },
// Quest for Glory 4 1.1 Floppy - English DOS (supplied by abevi in bug report #2612718)
// SCI interpreter version 2.000.000
@@ -2988,7 +2988,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "d10a4cc177d2091d744e2ad8c049b0ae", 9295},
{"resource.000", 0, "f64fd6aa3977939a86ff30783dd677e1", 11003589},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NOSPEECH },
+ Common::EN_ANY, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NOSPEECH },
// Quest for Glory 4 1.1 Floppy - German DOS (supplied by markcool in bug report #2723850)
// Executable scanning reports "2.000.000", VERSION file reports "1.1"
@@ -2996,7 +2996,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "9e0abba8746f40565bc7eb5720522ecd", 9301},
{"resource.000", 0, "57f22cdc54eeb35fce1f26b31b5c3ee1", 11076197},
AD_LISTEND},
- Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NOSPEECH },
+ Common::DE_DEU, Common::kPlatformPC, ADGF_UNSTABLE, GUIO_NOSPEECH },
// Quest for Glory 4 CD - English DOS/Windows (from jvprat)
// Executable scanning reports "2.100.002", VERSION file reports "1.0"
@@ -3004,7 +3004,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "aba367f2102e81782d961b14fbe3d630", 10246},
{"resource.000", 0, "263dce4aa34c49d3ad29bec889007b1c", 11571394},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformPC, ADGF_CD, GUIO_NONE },
+ Common::EN_ANY, Common::kPlatformPC, ADGF_CD | ADGF_UNSTABLE, GUIO_NONE },
// RAMA - English DOS/Windows Demo
// Executable scanning reports "2.100.002", VERSION file reports "000.000.008"
@@ -3012,7 +3012,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.001", 0, "775304e9b2a545156be4d94209550094", 1393},
{"ressci.001", 0, "259437fd75fdf51e8207fda8c01fa4fd", 2334384},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformWindows, ADGF_DEMO, GUIO_NONE },
+ Common::EN_ANY, Common::kPlatformWindows, ADGF_DEMO | ADGF_UNSTABLE, GUIO_NONE },
#ifdef ENABLE_SCI3_GAMES
// RAMA - English Windows (from jvprat)
@@ -3025,7 +3025,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.003", 0, "31ef4c0621711585d031f0ae81707251", 1636},
{"ressci.003", 0, "2a68edd064e5e4937b5e9c74b38f2082", 6860492},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformWindows, 0, GUIO_NONE },
+ Common::EN_ANY, Common::kPlatformWindows, ADGF_UNSTABLE, GUIO_NONE },
// RAMA - English Windows (from Quietust, in bug report #2850645)
{"rama", "", {
@@ -3036,7 +3036,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.003", 0, "48841e4b84ef1b98b48d43566fda9e13", 1636},
{"ressci.003", 0, "2a68edd064e5e4937b5e9c74b38f2082", 6870356},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformWindows, 0, GUIO_NONE },
+ Common::EN_ANY, Common::kPlatformWindows, ADGF_UNSTABLE, GUIO_NONE },
// RAMA - Italian Windows CD (from glorifindel)
// SCI interpreter version 3.000.000 (a guess?)
@@ -3044,7 +3044,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"ressci.001", 0, "2a68edd064e5e4937b5e9c74b38f2082", 70611091},
{"resmap.001", 0, "70ba2ff04a2b7fb2c52420ba7fbd47c2", 8338},
AD_LISTEND},
- Common::IT_ITA, Common::kPlatformWindows, 0, GUIO_NONE },
+ Common::IT_ITA, Common::kPlatformWindows, ADGF_UNSTABLE, GUIO_NONE },
#endif // ENABLE_SCI3_GAMES
// Shivers - English Windows (from jvprat)
@@ -3053,14 +3053,14 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.000", 0, "f2ead37749ed8f6535a2445a7d05a0cc", 46525},
{"ressci.000", 0, "4294c6d7510935f2e0a52e302073c951", 262654836},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformWindows, 0, GUIO_NONE },
+ Common::EN_ANY, Common::kPlatformWindows, ADGF_UNSTABLE, GUIO_NONE },
// Shivers - German Windows (from Tobis87)
{"shivers", "", {
{"resmap.000", 0, "f483d0a1f78334c18052e92785c3086e", 46537},
{"ressci.000", 0, "6751b144671e2deed919eb9d284b07eb", 262390692},
AD_LISTEND},
- Common::DE_DEU, Common::kPlatformWindows, 0, GUIO_NONE },
+ Common::DE_DEU, Common::kPlatformWindows, ADGF_UNSTABLE, GUIO_NONE },
// Shivers - English Windows Demo
// Executable scanning reports "2.100.002"
@@ -3068,7 +3068,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.000", 0, "d9e0bc5eddefcbe47f528760085d8927", 1186},
{"ressci.000", 0, "3a93c6340b54e07e65d0e5583354d186", 10505469},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformWindows, ADGF_DEMO, GUIO_NONE },
+ Common::EN_ANY, Common::kPlatformWindows, ADGF_DEMO | ADGF_UNSTABLE, GUIO_NONE },
// Shivers 2 doesn't contain SCI scripts. The whole game logic has
// been reimplemented from SCI in native code placed in DLL files.
@@ -3086,7 +3086,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.000", 0, "d8659188b84beaef076bd869837cd530", 634},
{"ressci.000", 0, "7fbac0807a044c9543e8ac376d200e59", 4925003},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformWindows, ADGF_DEMO, GUIO_NONE },
+ Common::EN_ANY, Common::kPlatformWindows, ADGF_DEMO | ADGF_UNSTABLE, GUIO_NONE },
// Shivers 2 - English Windows (from abevi)
// VERSION.TXT Version 1.0 (3/25/97)
@@ -3094,7 +3094,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"ressci.001", 0, "a79d03d6eb75be0a79324f14e3d2ace4", 95346793},
{"resmap.001", 0, "a4804d436d90c4ec2e46b537f5e954db", 6268},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformWindows, 0, GUIO_NOSPEECH },
+ Common::EN_ANY, Common::kPlatformWindows, ADGF_UNSTABLE, GUIO_NOSPEECH },
#endif
@@ -3479,7 +3479,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
// Space Quest 4 - English Macintosh
// Executable scanning reports "x.yyy.zzz"
- // VERSION file reports "1.148"
+ // VERSION file reports "1.148"
{"sq4", "", {
{"resource.map", 0, "6ffc6f76c4127d140759a512ab9a07be", 6042},
{"resource.000", 0, "6a538b389705232cf9b2d7de2cf9c0a7", 224833},
@@ -3572,7 +3572,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "6dddfa3a8f3a3a513ec9dfdfae955005", 10528},
{"resource.000", 0, "c4259ab7355aead07773397b1052827d", 41150806},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NONE },
+ Common::EN_ANY, Common::kPlatformPC, ADGF_CD | ADGF_UNSTABLE, GUIO_NONE },
// Space Quest 6 - English DOS/Win3.11 CD ver 1.11 (from FRG)
// SCI interpreter version 2.100.002 (just a guess)
@@ -3580,7 +3580,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "e0615d6e4e10e37ae42e6a2a95aaf145", 10528},
{"resource.000", 0, "c4259ab7355aead07773397b1052827d", 41150806},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformPC, 0, GUIO_NONE },
+ Common::EN_ANY, Common::kPlatformPC, ADGF_CD | ADGF_UNSTABLE, GUIO_NONE },
// Space Quest 6 - French DOS/Win3.11 CD (from French magazine Joystick - September 1997)
// Executable scanning reports "2.100.002", VERSION file reports "1.0"
@@ -3588,7 +3588,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "3c831625931d5079b73ae8c275f52c95", 10534},
{"resource.000", 0, "4195ca940f759424f62b90e262cc1737", 40932397},
AD_LISTEND},
- Common::FR_FRA, Common::kPlatformPC, 0, GUIO_NONE },
+ Common::FR_FRA, Common::kPlatformPC, ADGF_CD | ADGF_UNSTABLE, GUIO_NONE },
// Space Quest 6 - German DOS (from Tobis87, updated info from markcoolio in bug report #2723884)
// SCI interpreter version 2.100.002 (just a guess)
@@ -3596,7 +3596,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "664d797415484f85c90b1b45aedc7686", 10534},
{"resource.000", 0, "ba87ba91e5bdabb4169dd0df75777722", 40933685},
AD_LISTEND},
- Common::DE_DEU, Common::kPlatformPC, 0, GUIO_NONE },
+ Common::DE_DEU, Common::kPlatformPC, ADGF_CD | ADGF_UNSTABLE, GUIO_NONE },
// Space Quest 6 - English DOS/Win3.11 Interactive Demo (from FRG)
// SCI interpreter version 2.100.002 (just a guess)
@@ -3604,7 +3604,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "368f07b07433db3f819fa3fa0e5efee5", 2572},
{"resource.000", 0, "ab12724e078dea34b624e0d2a38dcd7c", 2272050},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH },
+ Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO | ADGF_UNSTABLE, GUIO_NOSPEECH },
#endif // ENABLE_SCI32
// The Island of Dr. Brain - English DOS CD (from jvprat)
@@ -3638,7 +3638,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.000", 0, "9a3e172cde9963d0a969f26469318cec", 3403},
{"ressci.000", 0, "db3e290481c35c3224e9602e71e4a1f1", 5073868},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformWindows, ADGF_DEMO, GUIO_NOSPEECH },
+ Common::EN_ANY, Common::kPlatformWindows, ADGF_DEMO | ADGF_UNSTABLE, GUIO_NOSPEECH },
// Torin's Passage - English Windows
// SCI interpreter version 2.100.002 (just a guess)
@@ -3646,7 +3646,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.000", 0, "bb3b0b22ff08df54fbe2d06263409be6", 9799},
{"ressci.000", 0, "693a259d346c9360f4a0c11fdaae430a", 55973887},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformWindows, 0, GUIO_NOSPEECH },
+ Common::EN_ANY, Common::kPlatformWindows, ADGF_UNSTABLE, GUIO_NOSPEECH },
// Torin's Passage - Spanish Windows (from jvprat)
// Executable scanning reports "2.100.002", VERSION file reports "1.0"
@@ -3655,7 +3655,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"ressci.000", 0, "693a259d346c9360f4a0c11fdaae430a", 55973887},
// TODO: depend on one of the patches?
AD_LISTEND},
- Common::ES_ESP, Common::kPlatformWindows, 0, GUIO_NOSPEECH },
+ Common::ES_ESP, Common::kPlatformWindows, ADGF_UNSTABLE, GUIO_NOSPEECH },
// Torin's Passage - French Windows
// SCI interpreter version 2.100.002 (just a guess)
@@ -3663,7 +3663,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.000", 0, "bb3b0b22ff08df54fbe2d06263409be6", 9799},
{"ressci.000", 0, "693a259d346c9360f4a0c11fdaae430a", 55973887},
AD_LISTEND},
- Common::FR_FRA, Common::kPlatformWindows, 0, GUIO_NOSPEECH },
+ Common::FR_FRA, Common::kPlatformWindows, ADGF_UNSTABLE, GUIO_NOSPEECH },
// Torin's Passage - German Windows
// SCI interpreter version 2.100.002 (just a guess)
@@ -3671,7 +3671,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.000", 0, "bb3b0b22ff08df54fbe2d06263409be6", 9799},
{"ressci.000", 0, "693a259d346c9360f4a0c11fdaae430a", 55973887},
AD_LISTEND},
- Common::DE_DEU, Common::kPlatformWindows, 0, GUIO_NOSPEECH },
+ Common::DE_DEU, Common::kPlatformWindows, ADGF_UNSTABLE, GUIO_NOSPEECH },
// Torin's Passage - Italian Windows CD (from glorifindel)
// SCI interpreter version 2.100.002 (just a guess)
@@ -3679,7 +3679,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.000", 0, "bb3b0b22ff08df54fbe2d06263409be6", 9799},
{"ressci.000", 0, "693a259d346c9360f4a0c11fdaae430a", 55973887},
AD_LISTEND},
- Common::IT_ITA, Common::kPlatformWindows, 0, GUIO_NONE },
+ Common::IT_ITA, Common::kPlatformWindows, ADGF_UNSTABLE, GUIO_NONE },
#endif // ENABLE_SCI32
// SCI Fanmade Games
diff --git a/engines/sci/engine/features.h b/engines/sci/engine/features.h
index 07ba626d15..4592c5be9c 100644
--- a/engines/sci/engine/features.h
+++ b/engines/sci/engine/features.h
@@ -75,7 +75,7 @@ public:
* @return Message function type, SCI_VERSION_1_LATE / SCI_VERSION_1_1
*/
SciVersion detectMessageFunctionType();
-
+
#ifdef ENABLE_SCI32
/**
* Autodetects the kernel functions used in SCI2.1
diff --git a/engines/sci/engine/kernel.h b/engines/sci/engine/kernel.h
index 68b1601580..ff3c67c84b 100644
--- a/engines/sci/engine/kernel.h
+++ b/engines/sci/engine/kernel.h
@@ -272,7 +272,7 @@ private:
// Kernel-related lists
Common::StringArray _selectorNames;
Common::StringArray _kernelNames;
-
+
const Common::String _invalid;
};
diff --git a/engines/sci/engine/kernel_tables.h b/engines/sci/engine/kernel_tables.h
index 31ef64d109..0c5d4e680d 100644
--- a/engines/sci/engine/kernel_tables.h
+++ b/engines/sci/engine/kernel_tables.h
@@ -558,16 +558,16 @@ static SciKernelMapEntry s_kernelMap[] = {
// SetWindowsOption is used to set Windows specific options, like for example the title bar visibility of
// the game window in Phantasmagoria 2. We ignore these settings completely.
{ MAP_EMPTY(SetWindowsOption), SIG_EVERYWHERE, "ii", NULL, NULL },
-
+
// Used by the Windows version of Phantasmagoria 1 to get the video speed setting. This is called after
- // kGetConfig and overrides the setting obtained by it. It is a dummy function in the DOS Version. We can
+ // kGetConfig and overrides the setting obtained by it. It is a dummy function in the DOS Version. We can
// just use GetConfig and mark this one as empty, like the DOS version does.
{ MAP_EMPTY(GetSierraProfileInt), SIG_EVERYWHERE, "(.*)", NULL, NULL },
// Unused / debug SCI2.1 unused functions, always mapped to kDummy
// The debug functions are called from the inbuilt debugger or polygon
- // editor in SCI2.1 games. Related objects are: PEditor, EditablePolygon,
+ // editor in SCI2.1 games. Related objects are: PEditor, EditablePolygon,
// aeDisplayClass and scalerCode
{ MAP_DUMMY(FindSelector), SIG_EVERYWHERE, "(.*)", NULL, NULL },
{ MAP_DUMMY(FindClass), SIG_EVERYWHERE, "(.*)", NULL, NULL },
diff --git a/engines/sci/engine/kevent.cpp b/engines/sci/engine/kevent.cpp
index 2cd6b198de..df3b3efd57 100644
--- a/engines/sci/engine/kevent.cpp
+++ b/engines/sci/engine/kevent.cpp
@@ -194,7 +194,7 @@ reg_t kGetEvent(EngineState *s, int argc, reg_t *argv) {
// Wait a bit here, so that the CPU isn't maxed out when the game
// is waiting for user input (e.g. when showing text boxes) - bug
// #3037874. Make sure that we're not delaying while the game is
- // benchmarking, as that will affect the final benchmarked result -
+ // benchmarking, as that will affect the final benchmarked result -
// check bugs #3058865 and #3127824
if (s->_gameIsBenchmarking) {
// Game is benchmarking, don't add a delay
diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp
index e1e52215d2..1bd6754ca5 100644
--- a/engines/sci/engine/kfile.cpp
+++ b/engines/sci/engine/kfile.cpp
@@ -208,7 +208,7 @@ reg_t kFClose(EngineState *s, int argc, reg_t *argv) {
reg_t kFPuts(EngineState *s, int argc, reg_t *argv) {
int handle = argv[0].toUint16();
Common::String data = s->_segMan->getString(argv[1]);
-
+
FileHandle *f = getFileFromHandle(s, handle);
if (f)
f->_out->write(data.c_str(), data.size());
@@ -812,7 +812,7 @@ reg_t kFileIOReadRaw(EngineState *s, int argc, reg_t *argv) {
int bytesRead = 0;
char *buf = new char[size];
debugC(kDebugLevelFile, "kFileIO(readRaw): %d, %d", handle, size);
-
+
FileHandle *f = getFileFromHandle(s, handle);
if (f) {
bytesRead = f->_in->read(buf, size);
@@ -910,7 +910,7 @@ reg_t kFileIOSeek(EngineState *s, int argc, reg_t *argv) {
int offset = argv[1].toUint16();
int whence = argv[2].toUint16();
debugC(kDebugLevelFile, "kFileIO(seek): %d, %d, %d", handle, offset, whence);
-
+
FileHandle *f = getFileFromHandle(s, handle);
if (f)
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp
index 6c96266922..36de767464 100644
--- a/engines/sci/engine/kgraphics.cpp
+++ b/engines/sci/engine/kgraphics.cpp
@@ -151,7 +151,7 @@ static reg_t kSetCursorSci11(EngineState *s, int argc, reg_t *argv) {
case 2:
pos.y = argv[1].toSint16();
pos.x = argv[0].toSint16();
-
+
g_sci->_gfxCursor->kernelSetPos(pos);
break;
case 4: {
@@ -192,7 +192,7 @@ static reg_t kSetCursorSci11(EngineState *s, int argc, reg_t *argv) {
break;
case 10:
// Freddy pharkas, when using the whiskey glass to read the prescription (bug #3034973)
- g_sci->_gfxCursor->kernelSetZoomZone(argv[0].toUint16(),
+ g_sci->_gfxCursor->kernelSetZoomZone(argv[0].toUint16(),
Common::Rect(argv[1].toUint16(), argv[2].toUint16(), argv[3].toUint16(), argv[4].toUint16()),
argv[5].toUint16(), argv[6].toUint16(), argv[7].toUint16(),
argv[8].toUint16(), argv[9].toUint16());
@@ -428,7 +428,7 @@ reg_t kCanBeHere(EngineState *s, int argc, reg_t *argv) {
reg_t kCantBeHere(EngineState *s, int argc, reg_t *argv) {
reg_t curObject = argv[0];
reg_t listReference = (argc > 1) ? argv[1] : NULL_REG;
-
+
reg_t canBeHere = g_sci->_gfxCompare->kernelCanBeHere(curObject, listReference);
return canBeHere;
}
@@ -1279,7 +1279,7 @@ reg_t kCantBeHere32(EngineState *s, int argc, reg_t *argv) {
// TODO
// reg_t curObject = argv[0];
// reg_t listReference = (argc > 1) ? argv[1] : NULL_REG;
-
+
return NULL_REG;
}
@@ -1642,8 +1642,8 @@ reg_t kScrollWindow(EngineState *s, int argc, reg_t *argv) {
reg_t kSetFontRes(EngineState *s, int argc, reg_t *argv) {
// TODO: This defines the resolution that the fonts are supposed to be displayed
// in. Currently, this is only used for showing high-res fonts in GK1 Mac, but
- // should be extended to handle other font resolutions such as those
-
+ // should be extended to handle other font resolutions such as those
+
int xResolution = argv[0].toUint16();
//int yResolution = argv[1].toUint16();
diff --git a/engines/sci/engine/kmisc.cpp b/engines/sci/engine/kmisc.cpp
index daed248db1..e6837242e4 100644
--- a/engines/sci/engine/kmisc.cpp
+++ b/engines/sci/engine/kmisc.cpp
@@ -75,11 +75,11 @@ reg_t kGameIsRestarting(EngineState *s, int argc, reg_t *argv) {
}
break;
case GID_SQ4:
- // In SQ4 (floppy and CD) the sequel police appear way too quickly in
+ // In SQ4 (floppy and CD) the sequel police appear way too quickly in
// the Skate-o-rama rooms, resulting in all sorts of timer issues, like
// #3109139 (which occurs because a police officer instantly teleports
// just before Roger exits and shoots him). We throttle these scenes a
- // bit more, in order to prevent timer bugs related to the sequel police
+ // bit more, in order to prevent timer bugs related to the sequel police
if (s->currentRoomNumber() == 405 || s->currentRoomNumber() == 406 ||
s->currentRoomNumber() == 410 || s->currentRoomNumber() == 411) {
s->_throttleTrigger = true;
@@ -186,7 +186,7 @@ reg_t kSetDebug(EngineState *s, int argc, reg_t *argv) {
if (g_sci->getGameId() != GID_GK1) {
debug("Debug mode activated");
-
+
g_sci->getDebugger()->attach();
}
diff --git a/engines/sci/engine/kmovement.cpp b/engines/sci/engine/kmovement.cpp
index 31715f19d3..14f7db47a0 100644
--- a/engines/sci/engine/kmovement.cpp
+++ b/engines/sci/engine/kmovement.cpp
@@ -239,7 +239,7 @@ reg_t kInitBresen(EngineState *s, int argc, reg_t *argv) {
client_step--;
if (!client_step)
- error("kInitBresen failed");
+ error("kInitBresen failed");
client_xStep--;
}
@@ -440,7 +440,7 @@ reg_t kDoAvoider(EngineState *s, int argc, reg_t *argv) {
invokeSelector(s, clientLooper, SELECTOR(doit), argc, argv, 2, params);
}
s->r_acc = SIGNAL_REG;
-
+
} else {
// is blocked
if (avoiderHeading == -1)
diff --git a/engines/sci/engine/kpathing.cpp b/engines/sci/engine/kpathing.cpp
index 8904a48978..375aeaa06b 100644
--- a/engines/sci/engine/kpathing.cpp
+++ b/engines/sci/engine/kpathing.cpp
@@ -1110,7 +1110,7 @@ static Polygon *convert_polygon(EngineState *s, reg_t polygon) {
// Make sure that we have enough points
if (pointList.maxSize < size * POLY_POINT_SIZE) {
warning("convert_polygon: Not enough memory allocated for polygon points. "
- "Expected %d, got %d. Skipping polygon",
+ "Expected %d, got %d. Skipping polygon",
size * POLY_POINT_SIZE, pointList.maxSize);
return NULL;
}
@@ -1202,7 +1202,7 @@ static PathfindingState *convert_polygon_set(EngineState *s, reg_t poly_list, Co
change_polygons_opt_0(pf_s);
Common::Point *new_start = fixup_start_point(pf_s, start);
-
+
if (!new_start) {
warning("AvoidPath: Couldn't fixup start position for pathfinding");
delete pf_s;
@@ -1210,7 +1210,7 @@ static PathfindingState *convert_polygon_set(EngineState *s, reg_t poly_list, Co
}
Common::Point *new_end = fixup_end_point(pf_s, end);
-
+
if (!new_end) {
warning("AvoidPath: Couldn't fixup end position for pathfinding");
delete new_start;
diff --git a/engines/sci/engine/kscripts.cpp b/engines/sci/engine/kscripts.cpp
index d83254b2c4..93c1fffe3c 100644
--- a/engines/sci/engine/kscripts.cpp
+++ b/engines/sci/engine/kscripts.cpp
@@ -163,7 +163,7 @@ reg_t kClone(EngineState *s, int argc, reg_t *argv) {
// extend the internal storage size.
if (infoSelector & kInfoFlagClone)
parentObj = s->_segMan->getObject(parentAddr);
-
+
*cloneObj = *parentObj;
// Mark as clone
diff --git a/engines/sci/engine/kstring.cpp b/engines/sci/engine/kstring.cpp
index c3c10bd2a2..07b87a7cbc 100644
--- a/engines/sci/engine/kstring.cpp
+++ b/engines/sci/engine/kstring.cpp
@@ -427,7 +427,7 @@ reg_t kGetFarText(EngineState *s, int argc, reg_t *argv) {
}
seeker = (char *)textres->data;
-
+
// The second parameter (counter) determines the number of the string
// inside the text resource.
while (counter--) {
@@ -715,7 +715,7 @@ reg_t kString(EngineState *s, int argc, reg_t *argv) {
// triggers an assert when doing string2[i + index2].
for (uint16 i = 0; i < count; i++)
string1->setValue(i + index1, string2[i + index2]);
-
+
return strAddress;
}
case 7: { // Cmp
@@ -781,14 +781,14 @@ reg_t kString(EngineState *s, int argc, reg_t *argv) {
return NULL_REG;
case 15: { // upper
Common::String string = s->_segMan->getString(argv[1]);
-
+
string.toUppercase();
s->_segMan->strcpy(argv[1], string.c_str());
return NULL_REG;
}
case 16: { // lower
Common::String string = s->_segMan->getString(argv[1]);
-
+
string.toLowercase();
s->_segMan->strcpy(argv[1], string.c_str());
return NULL_REG;
diff --git a/engines/sci/engine/kvideo.cpp b/engines/sci/engine/kvideo.cpp
index 9a60f39c85..6d810d516c 100644
--- a/engines/sci/engine/kvideo.cpp
+++ b/engines/sci/engine/kvideo.cpp
@@ -65,7 +65,7 @@ void playVideo(Video::VideoDecoder *videoDecoder, VideoState videoState) {
scaleBuffer = new byte[width * height * bytesPerPixel];
}
- uint16 x, y;
+ uint16 x, y;
// Sanity check...
if (videoState.x > 0 && videoState.y > 0 && isVMD) {
@@ -94,7 +94,7 @@ void playVideo(Video::VideoDecoder *videoDecoder, VideoState videoState) {
if (frame) {
if (scaleBuffer) {
- // TODO: Probably should do aspect ratio correction in e.g. GK1 Windows
+ // TODO: Probably should do aspect ratio correction in e.g. GK1 Windows
g_sci->_gfxScreen->scale2x((byte *)frame->pixels, scaleBuffer, videoDecoder->getWidth(), videoDecoder->getHeight(), bytesPerPixel);
g_system->copyRectToScreen(scaleBuffer, pitch, x, y, width, height);
} else {
@@ -130,7 +130,7 @@ reg_t kShowMovie(EngineState *s, int argc, reg_t *argv) {
uint16 screenWidth = g_system->getWidth();
uint16 screenHeight = g_system->getHeight();
-
+
Video::VideoDecoder *videoDecoder = 0;
if (argv[0].segment != 0) {
diff --git a/engines/sci/engine/object.cpp b/engines/sci/engine/object.cpp
index f09f18298a..a1854a2723 100644
--- a/engines/sci/engine/object.cpp
+++ b/engines/sci/engine/object.cpp
@@ -259,13 +259,13 @@ void Object::initSelectorsSci3(const byte *buf) {
// two selectors are always reserved (because their storage
// space is used by the typeMask).
// We don't know beforehand how many methods and properties
- // there are, so we count them first.
+ // there are, so we count them first.
for (int groupNr = 0; groupNr < groups; ++groupNr) {
byte groupLocation = groupInfo[groupNr];
const byte *seeker = selectorBase + groupLocation * 32 * 2;
if (groupLocation != 0) {
- // This object actually has selectors belonging to this group
+ // This object actually has selectors belonging to this group
int typeMask = READ_SCI11ENDIAN_UINT32(seeker);
for (int bit = 2; bit < 32; ++bit) {
@@ -277,7 +277,7 @@ void Object::initSelectorsSci3(const byte *buf) {
} else {
// Undefined selector
}
-
+
}
}
}
@@ -296,7 +296,7 @@ void Object::initSelectorsSci3(const byte *buf) {
const byte *seeker = selectorBase + groupLocation * 32 * 2;
if (groupLocation != 0) {
- // This object actually has selectors belonging to this group
+ // This object actually has selectors belonging to this group
int typeMask = READ_SCI11ENDIAN_UINT32(seeker);
int groupBaseId = groupNr * 32;
@@ -323,7 +323,7 @@ void Object::initSelectorsSci3(const byte *buf) {
} else {
// Undefined selector
}
-
+
}
}
}
diff --git a/engines/sci/engine/object.h b/engines/sci/engine/object.h
index 80c8e9e83d..0ca16b48a2 100644
--- a/engines/sci/engine/object.h
+++ b/engines/sci/engine/object.h
@@ -79,7 +79,7 @@ public:
}
reg_t getSpeciesSelector() const {
- if (getSciVersion() <= SCI_VERSION_2_1)
+ if (getSciVersion() <= SCI_VERSION_2_1)
return _variables[_offset];
else // SCI3
return _speciesSelectorSci3;
@@ -93,7 +93,7 @@ public:
}
reg_t getSuperClassSelector() const {
- if (getSciVersion() <= SCI_VERSION_2_1)
+ if (getSciVersion() <= SCI_VERSION_2_1)
return _variables[_offset + 1];
else // SCI3
return _superClassPosSci3;
diff --git a/engines/sci/engine/savegame.h b/engines/sci/engine/savegame.h
index fbd77eb076..1d899b0d37 100644
--- a/engines/sci/engine/savegame.h
+++ b/engines/sci/engine/savegame.h
@@ -51,7 +51,7 @@ struct EngineState;
* 19 - exportsAreWide
* 18 - SCI32 arrays/strings
* 17 - sound
- *
+ *
*/
enum {
diff --git a/engines/sci/engine/script.cpp b/engines/sci/engine/script.cpp
index a38aa06bc4..01e1afe5ea 100644
--- a/engines/sci/engine/script.cpp
+++ b/engines/sci/engine/script.cpp
@@ -160,7 +160,7 @@ void Script::load(ResourceManager *resMan) {
_numExports = 0;
_synonyms = 0;
_numSynonyms = 0;
-
+
if (getSciVersion() <= SCI_VERSION_1_LATE) {
_exportTable = (const uint16 *)findBlockSCI0(SCI_OBJ_EXPORTS);
if (_exportTable) {
diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp
index 2d3d8f6155..a714980a35 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -209,7 +209,7 @@ const byte ecoquest2SignatureEcorderTutorial[] = {
const uint16 ecoquest2PatchEcorderTutorial[] = {
0x31, 0x23, // bnt [next state] (save 1 byte)
- // The parameter count below should be 7, but we're out of bytes
+ // The parameter count below should be 7, but we're out of bytes
// to patch! A workaround has been added because of this
0x78, // push1 (parameter count)
//0x39, 0x07, // pushi 07 (parameter count)
@@ -221,7 +221,7 @@ const uint16 ecoquest2PatchEcorderTutorial[] = {
0x78, // push1 (visual screen)
0x39, 0x17, // pushi 17 (color)
0x43, 0x6c, 0x0e, // call kGraph
- // The parameter count below should be 5, but we're out of bytes
+ // The parameter count below should be 5, but we're out of bytes
// to patch! A workaround has been added because of this
0x78, // push1 (parameter count)
//0x39, 0x05, // pushi 05 (parameter count)
@@ -697,7 +697,7 @@ const SciScriptSignature laurabow2Signatures[] = {
// ===========================================================================
// Mother Goose SCI1/SCI1.1
-// MG::replay somewhat calculates the savedgame-id used when saving again
+// MG::replay somewhat calculates the savedgame-id used when saving again
// this doesn't work right and we remove the code completely.
// We set the savedgame-id directly right after restoring in kRestoreGame.
const byte mothergoose256SignatureReplay[] = {
@@ -1034,7 +1034,7 @@ const uint16 sq1vgaPatchEgoShowsCard[] = {
// script, description, magic DWORD, adjust
const SciScriptSignature sq1vgaSignatures[] = {
- { 58, "Sarien armory droid zapping ego first time", 1, PATCH_MAGICDWORD( 0x72, 0x88, 0x15, 0x36 ), -70,
+ { 58, "Sarien armory droid zapping ego first time", 1, PATCH_MAGICDWORD( 0x72, 0x88, 0x15, 0x36 ), -70,
sq1vgaSignatureEgoShowsCard, sq1vgaPatchEgoShowsCard },
SCI_SIGNATUREENTRY_TERMINATOR};
@@ -1087,7 +1087,7 @@ void Script::applyPatch(const uint16 *patch, byte *scriptData, const uint32 scri
}
patch++;
patchWord = *patch;
- }
+ }
}
// will return -1 if no match was found, otherwise an offset to the start of the signature match
diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp
index 957930784b..3a18fbc68f 100644
--- a/engines/sci/engine/scriptdebug.cpp
+++ b/engines/sci/engine/scriptdebug.cpp
@@ -72,7 +72,7 @@ reg_t disassemble(EngineState *s, reg_t pos, bool printBWTag, bool printBytecode
const byte *scr;
int scr_size;
reg_t retval = make_reg(pos.segment, pos.offset + 1);
- uint16 param_value = 0xffff; // Suppress GCC warning by setting default value, chose value as invalid to getKernelName etc.
+ uint16 param_value = 0xffff; // Suppress GCC warning by setting default value, chose value as invalid to getKernelName etc.
int i = 0;
Kernel *kernel = g_sci->getKernel();
@@ -617,8 +617,8 @@ void debugSelectorCall(reg_t send_obj, Selector selector, int argc, StackPtr arg
Console *con = g_sci->getSciDebugger();
#ifdef VM_DEBUG_SEND
- debugN("Send to %04x:%04x (%s), selector %04x (%s):", PRINT_REG(send_obj),
- s->_segMan->getObjectName(send_obj), selector,
+ debugN("Send to %04x:%04x (%s), selector %04x (%s):", PRINT_REG(send_obj),
+ s->_segMan->getObjectName(send_obj), selector,
g_sci->getKernel()->getSelectorName(selector).c_str());
#endif // VM_DEBUG_SEND
@@ -644,18 +644,18 @@ void debugSelectorCall(reg_t send_obj, Selector selector, int argc, StackPtr arg
reg_t selectorValue = *varp.getPointer(segMan);
if (!argc && (activeBreakpointTypes & BREAK_SELECTORREAD)) {
if (g_sci->checkSelectorBreakpoint(BREAK_SELECTORREAD, send_obj, selector))
- con->DebugPrintf("Read from selector (%s:%s): %04x:%04x\n",
+ con->DebugPrintf("Read from selector (%s:%s): %04x:%04x\n",
objectName, selectorName,
PRINT_REG(selectorValue));
} else if (argc && (activeBreakpointTypes & BREAK_SELECTORWRITE)) {
if (g_sci->checkSelectorBreakpoint(BREAK_SELECTORWRITE, send_obj, selector))
- con->DebugPrintf("Write to selector (%s:%s): change %04x:%04x to %04x:%04x\n",
+ con->DebugPrintf("Write to selector (%s:%s): change %04x:%04x to %04x:%04x\n",
objectName, selectorName,
PRINT_REG(selectorValue), PRINT_REG(argp[1]));
}
if (argc > 1)
- debug(kDebugLevelScripts, "Write to selector (%s:%s): change %04x:%04x to %04x:%04x, argc == %d\n",
+ debug(kDebugLevelScripts, "Write to selector (%s:%s): change %04x:%04x to %04x:%04x, argc == %d\n",
objectName, selectorName,
PRINT_REG(selectorValue), PRINT_REG(argp[1]), argc);
}
diff --git a/engines/sci/engine/segment.cpp b/engines/sci/engine/segment.cpp
index 5d8a81a7f1..3f11d6ff49 100644
--- a/engines/sci/engine/segment.cpp
+++ b/engines/sci/engine/segment.cpp
@@ -255,7 +255,7 @@ SegmentRef ArrayTable::dereference(reg_t pointer) {
return ret;
}
-void ArrayTable::freeAtAddress(SegManager *segMan, reg_t sub_addr) {
+void ArrayTable::freeAtAddress(SegManager *segMan, reg_t sub_addr) {
_table[sub_addr.offset].destroy();
freeEntry(sub_addr.offset);
}
diff --git a/engines/sci/engine/selector.cpp b/engines/sci/engine/selector.cpp
index 2edbea9676..c2f857f319 100644
--- a/engines/sci/engine/selector.cpp
+++ b/engines/sci/engine/selector.cpp
@@ -212,7 +212,7 @@ void writeSelector(SegManager *segMan, reg_t object, Selector selectorId, reg_t
*address.getPointer(segMan) = value;
}
-void invokeSelector(EngineState *s, reg_t object, int selectorId,
+void invokeSelector(EngineState *s, reg_t object, int selectorId,
int k_argc, StackPtr k_argp, int argc, const reg_t *argv) {
int i;
int framesize = 2 + 1 * argc;
diff --git a/engines/sci/engine/selector.h b/engines/sci/engine/selector.h
index f13c13e00c..085dd6e832 100644
--- a/engines/sci/engine/selector.h
+++ b/engines/sci/engine/selector.h
@@ -185,7 +185,7 @@ void writeSelector(SegManager *segMan, reg_t object, Selector selectorId, reg_t
/**
* Invokes a selector from an object.
*/
-void invokeSelector(EngineState *s, reg_t object, int selectorId,
+void invokeSelector(EngineState *s, reg_t object, int selectorId,
int k_argc, StackPtr k_argp, int argc = 0, const reg_t *argv = 0);
} // End of namespace Sci
diff --git a/engines/sci/engine/state.cpp b/engines/sci/engine/state.cpp
index 3328f80de1..4ea9f72054 100644
--- a/engines/sci/engine/state.cpp
+++ b/engines/sci/engine/state.cpp
@@ -144,7 +144,7 @@ void EngineState::wait(int16 ticks) {
void EngineState::initGlobals() {
Script *script_000 = _segMan->getScript(1);
-
+
if (!script_000->_localsBlock)
error("Script 0 has no locals block");
@@ -331,7 +331,7 @@ void SciEngine::checkVocabularySwitch() {
uint16 parserLanguage = 1;
if (SELECTOR(parseLang) != -1)
parserLanguage = readSelectorValue(_gamestate->_segMan, _gameObjectAddress, SELECTOR(parseLang));
-
+
if (parserLanguage != _vocabularyLanguage) {
delete _vocabulary;
_vocabulary = new Vocabulary(_resMan, parserLanguage > 1 ? true : false);
diff --git a/engines/sci/engine/static_selectors.cpp b/engines/sci/engine/static_selectors.cpp
index 6526eff2db..cca4c47be8 100644
--- a/engines/sci/engine/static_selectors.cpp
+++ b/engines/sci/engine/static_selectors.cpp
@@ -96,7 +96,7 @@ static const char * const sci2Selectors[] = {
"center", "all", "show", "textLeft", "textTop", // 115 - 119
"textRight", "textBottom", "borderColor", "titleFore", "titleBack", // 120 - 124
"titleFont", "dimmed", "frameOut", "lastKey", "magnifier", // 125 - 129
- "magPower", "mirrored", "pitch", "roll", "yaw", // 130 - 134
+ "magPower", "mirrored", "pitch", "roll", "yaw", // 130 - 134
"left", "right", "top", "bottom", "numLines" // 135 - 139
};
#endif
@@ -265,8 +265,8 @@ void Kernel::findSpecificSelectors(Common::StringArray &selectorNames) {
if (targetClass) {
if (classReferences[i].selectorType == kSelectorMethod) {
if (targetClass->getMethodCount() < selectorOffset + 1)
- error("The %s class has less than %d methods (%d)",
- classReferences[i].className, selectorOffset + 1,
+ error("The %s class has less than %d methods (%d)",
+ classReferences[i].className, selectorOffset + 1,
targetClass->getMethodCount());
targetSelectorPos = targetClass->getFuncSelector(selectorOffset);
@@ -275,7 +275,7 @@ void Kernel::findSpecificSelectors(Common::StringArray &selectorNames) {
selectorOffset += (getSciVersion() <= SCI_VERSION_1_LATE) ? 3 : 8;
if (targetClass->getVarCount() < selectorOffset + 1)
- error("The %s class has less than %d variables (%d)",
+ error("The %s class has less than %d variables (%d)",
classReferences[i].className, selectorOffset + 1,
targetClass->getVarCount());
diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp
index 1517355365..db682de16f 100644
--- a/engines/sci/engine/vm.cpp
+++ b/engines/sci/engine/vm.cpp
@@ -42,7 +42,7 @@ const reg_t NULL_REG = {0, 0};
const reg_t SIGNAL_REG = {0, SIGNAL_OFFSET};
const reg_t TRUE_REG = {0, 1};
//#define VM_DEBUG_SEND
-// Enable the define below to have the VM abort on cases where a conditional
+// Enable the define below to have the VM abort on cases where a conditional
// statement is followed by an unconditional jump (which will most likely lead
// to an infinite loop). Aids in detecting script bugs such as #3040722.
//#define ABORT_ON_INFINITE_LOOP
@@ -130,14 +130,14 @@ static reg_t read_var(EngineState *s, int type, int index) {
if (solution.type == WORKAROUND_NONE) {
#ifdef RELEASE_BUILD
// If we are running an official ScummVM release -> fake 0 in unknown cases
- warning("Uninitialized read for temp %d from method %s::%s (room %d, script %d, localCall %x)",
+ warning("Uninitialized read for temp %d from method %s::%s (room %d, script %d, localCall %x)",
index, originReply.objectName.c_str(), originReply.methodName.c_str(), s->currentRoomNumber(),
originReply.scriptNr, originReply.localCallOffset);
s->variables[type][index] = NULL_REG;
break;
#else
- error("Uninitialized read for temp %d from method %s::%s (room %d, script %d, localCall %x)",
+ error("Uninitialized read for temp %d from method %s::%s (room %d, script %d, localCall %x)",
index, originReply.objectName.c_str(), originReply.methodName.c_str(), s->currentRoomNumber(),
originReply.scriptNr, originReply.localCallOffset);
#endif
@@ -366,8 +366,8 @@ static void callKernelFunc(EngineState *s, int kernelCallNr, int argc) {
switch (solution.type) {
case WORKAROUND_NONE:
kernel->signatureDebug(kernelCall.signature, argc, argv);
- error("[VM] k%s[%x]: signature mismatch via method %s::%s (room %d, script %d, localCall 0x%x)",
- kernelCall.name, kernelCallNr, originReply.objectName.c_str(), originReply.methodName.c_str(),
+ error("[VM] k%s[%x]: signature mismatch via method %s::%s (room %d, script %d, localCall 0x%x)",
+ kernelCall.name, kernelCallNr, originReply.objectName.c_str(), originReply.methodName.c_str(),
s->currentRoomNumber(), originReply.scriptNr, originReply.localCallOffset);
break;
case WORKAROUND_IGNORE: // don't do kernel call, leave acc alone
@@ -418,12 +418,12 @@ static void callKernelFunc(EngineState *s, int kernelCallNr, int argc) {
int callNameLen = strlen(kernelCall.name);
if (strncmp(kernelCall.name, kernelSubCall.name, callNameLen) == 0) {
const char *subCallName = kernelSubCall.name + callNameLen;
- error("[VM] k%s(%s): signature mismatch via method %s::%s (room %d, script %d, localCall %x)",
- kernelCall.name, subCallName, originReply.objectName.c_str(), originReply.methodName.c_str(),
+ error("[VM] k%s(%s): signature mismatch via method %s::%s (room %d, script %d, localCall %x)",
+ kernelCall.name, subCallName, originReply.objectName.c_str(), originReply.methodName.c_str(),
s->currentRoomNumber(), originReply.scriptNr, originReply.localCallOffset);
}
- error("[VM] k%s: signature mismatch via method %s::%s (room %d, script %d, localCall %x)",
- kernelSubCall.name, originReply.objectName.c_str(), originReply.methodName.c_str(),
+ error("[VM] k%s: signature mismatch via method %s::%s (room %d, script %d, localCall %x)",
+ kernelSubCall.name, originReply.objectName.c_str(), originReply.methodName.c_str(),
s->currentRoomNumber(), originReply.scriptNr, originReply.localCallOffset);
break;
}
@@ -828,10 +828,10 @@ void run_vm(EngineState *s) {
uint16 localCallOffset = s->xs->addr.pc.offset + opparams[0];
- ExecStack xstack(s->xs->objp, s->xs->objp, s->xs->sp,
+ ExecStack xstack(s->xs->objp, s->xs->objp, s->xs->sp,
(call_base->requireUint16()) + s->r_rest, call_base,
s->xs->local_segment, make_reg(s->xs->addr.pc.segment, localCallOffset),
- NULL_SELECTOR, -1, localCallOffset, s->_executionStack.size() - 1,
+ NULL_SELECTOR, -1, localCallOffset, s->_executionStack.size() - 1,
EXEC_STACK_TYPE_CALL);
s->_executionStack.push_back(xstack);
diff --git a/engines/sci/engine/vm_types.cpp b/engines/sci/engine/vm_types.cpp
index e39c7708ad..b95fd58129 100644
--- a/engines/sci/engine/vm_types.cpp
+++ b/engines/sci/engine/vm_types.cpp
@@ -32,8 +32,8 @@ reg_t reg_t::lookForWorkaround(const reg_t right) const {
SciTrackOriginReply originReply;
SciWorkaroundSolution solution = trackOriginAndFindWorkaround(0, arithmeticWorkarounds, &originReply);
if (solution.type == WORKAROUND_NONE)
- error("Invalid arithmetic operation (params: %04x:%04x and %04x:%04x) from method %s::%s (room %d, script %d, localCall %x)",
- PRINT_REG(*this), PRINT_REG(right), originReply.objectName.c_str(),
+ error("Invalid arithmetic operation (params: %04x:%04x and %04x:%04x) from method %s::%s (room %d, script %d, localCall %x)",
+ PRINT_REG(*this), PRINT_REG(right), originReply.objectName.c_str(),
originReply.methodName.c_str(), g_sci->getEngineState()->currentRoomNumber(), originReply.scriptNr,
originReply.localCallOffset);
assert(solution.type == WORKAROUND_FAKE);
@@ -56,7 +56,7 @@ reg_t reg_t::operator+(const reg_t right) const {
return make_reg(segment, offset + right.toSint16());
default:
return lookForWorkaround(right);
- }
+ }
} else if (isNumber() && right.isPointer()) {
// Adding a pointer to a number, flip the order
return right + *this;
@@ -94,9 +94,9 @@ reg_t reg_t::operator/(const reg_t right) const {
reg_t reg_t::operator%(const reg_t right) const {
if (isNumber() && right.isNumber() && !right.isNull()) {
- // Support for negative numbers was added in Iceman, and perhaps in
+ // Support for negative numbers was added in Iceman, and perhaps in
// SCI0 0.000.685 and later. Theoretically, this wasn't really used
- // in SCI0, so the result is probably unpredictable. Such a case
+ // in SCI0, so the result is probably unpredictable. Such a case
// would indicate either a script bug, or a modulo on an unsigned
// integer larger than 32767. In any case, such a case should be
// investigated, instead of being silently accepted.
@@ -178,7 +178,7 @@ int reg_t::cmp(const reg_t right, bool treatAsUnsigned) const {
if (treatAsUnsigned || !isNumber())
return toUint16() - right.toUint16();
else
- return toSint16() - right.toSint16();
+ return toSint16() - right.toSint16();
} else if (pointerComparisonWithInteger(right)) {
return 1;
} else if (right.pointerComparisonWithInteger(*this)) {
diff --git a/engines/sci/engine/workarounds.cpp b/engines/sci/engine/workarounds.cpp
index 464b4d8d5b..768ba28518 100644
--- a/engines/sci/engine/workarounds.cpp
+++ b/engines/sci/engine/workarounds.cpp
@@ -447,7 +447,7 @@ SciWorkaroundSolution trackOriginAndFindWorkaround(int index, const SciWorkaroun
do {
workaround = workaroundList;
while (workaround->methodName) {
- bool objectNameMatches = (workaround->objectName == NULL) ||
+ bool objectNameMatches = (workaround->objectName == NULL) ||
(workaround->objectName == g_sci->getSciLanguageString(searchObjectName, K_LANG_ENGLISH));
// Special case: in the fanmade Russian translation of SQ4, all
diff --git a/engines/sci/event.cpp b/engines/sci/event.cpp
index 74879f6c63..c14cfada07 100644
--- a/engines/sci/event.cpp
+++ b/engines/sci/event.cpp
@@ -261,7 +261,7 @@ SciEvent EventManager::getScummVMEvent() {
else if ((modifiers & Common::KBD_CTRL) && input.character > 0 && input.character < 27)
input.character += 96; // 0x01 -> 'a'
}
-
+
// If no actual key was pressed (e.g. if only a modifier key was pressed),
// ignore the event
if (!input.character)
@@ -277,7 +277,7 @@ void EventManager::updateScreen() {
if (g_system->getMillis() - s->_screenUpdateTime >= 1000 / 60) {
g_system->updateScreen();
s->_screenUpdateTime = g_system->getMillis();
- // Throttle the checking of shouldQuit() to 60fps as well, since
+ // Throttle the checking of shouldQuit() to 60fps as well, since
// Engine::shouldQuit() invokes 2 virtual functions
// (EventManager::shouldQuit() and EventManager::shouldRTL()),
// which is very expensive to invoke constantly without any
diff --git a/engines/sci/graphics/animate.cpp b/engines/sci/graphics/animate.cpp
index c36ecd112a..18f8511953 100644
--- a/engines/sci/graphics/animate.cpp
+++ b/engines/sci/graphics/animate.cpp
@@ -201,7 +201,7 @@ void GfxAnimate::fill(byte &old_picNotValid) {
adjustInvalidCels(view, it);
processViewScaling(view, it);
setNsRect(view, it);
-
+
//warning("%s view %d, loop %d, cel %d, signal %x", _s->_segMan->getObjectName(curObject), it->viewId, it->loopNo, it->celNo, it->signal);
// Calculate current priority according to y-coordinate
@@ -659,7 +659,7 @@ void GfxAnimate::throttleSpeed() {
// No entries drawn -> no speed throttler triggering
break;
case 1: {
-
+
// One entry drawn -> check if that entry was a speed benchmark view, if not enable speed throttler
AnimateEntry *onlyCast = &_lastCastData[0];
if ((onlyCast->viewId == 0) && (onlyCast->loopNo == 13) && (onlyCast->celNo == 0)) {
diff --git a/engines/sci/graphics/compare.h b/engines/sci/graphics/compare.h
index 83b4f49c08..bacb6e71e2 100644
--- a/engines/sci/graphics/compare.h
+++ b/engines/sci/graphics/compare.h
@@ -51,7 +51,7 @@ private:
GfxCoordAdjuster *_coordAdjuster;
uint16 isOnControl(uint16 screenMask, const Common::Rect &rect);
-
+
/**
* This function checks whether any of the objects in the given list,
* *different* from checkObject, has a brRect which is contained inside
diff --git a/engines/sci/graphics/coordadjuster.h b/engines/sci/graphics/coordadjuster.h
index 1b8a3e2679..23cf79d209 100644
--- a/engines/sci/graphics/coordadjuster.h
+++ b/engines/sci/graphics/coordadjuster.h
@@ -68,7 +68,7 @@ public:
void moveCursor(Common::Point &pos);
Common::Rect pictureGetDisplayArea();
-
+
private:
GfxPorts *_ports;
@@ -90,7 +90,7 @@ public:
void pictureSetDisplayArea(Common::Rect displayArea);
Common::Rect pictureGetDisplayArea();
-
+
private:
SegManager *_segMan;
diff --git a/engines/sci/graphics/menu.cpp b/engines/sci/graphics/menu.cpp
index 913f680e99..673729784f 100644
--- a/engines/sci/graphics/menu.cpp
+++ b/engines/sci/graphics/menu.cpp
@@ -423,8 +423,8 @@ reg_t GfxMenu::kernelSelect(reg_t eventObject, bool pauseSound) {
default:
while (itemIterator != itemEnd) {
itemEntry = *itemIterator;
- if (itemEntry->keyPress == keyPress &&
- itemEntry->keyModifier == keyModifier &&
+ if (itemEntry->keyPress == keyPress &&
+ itemEntry->keyModifier == keyModifier &&
itemEntry->enabled)
break;
itemIterator++;
diff --git a/engines/sci/graphics/palette.cpp b/engines/sci/graphics/palette.cpp
index 899ef10b33..c5a3545701 100644
--- a/engines/sci/graphics/palette.cpp
+++ b/engines/sci/graphics/palette.cpp
@@ -71,7 +71,7 @@ GfxPalette::GfxPalette(ResourceManager *resMan, GfxScreen *screen, bool useMergi
_macClut = 0;
loadMacIconBarPalette();
-
+
#ifdef ENABLE_SCI32
_clutTable = 0;
#endif
@@ -236,7 +236,7 @@ static byte blendColors(byte c1, byte c2) {
// return (c1/2+c2/2)+((c1&1)+(c2&1))/2;
// gamma 2.2
- double t = (pow(c1/255.0, 2.2/1.0) * 255.0) +
+ double t = (pow(c1/255.0, 2.2/1.0) * 255.0) +
(pow(c2/255.0, 2.2/1.0) * 255.0);
return (byte)(0.5 + (pow(0.5*t/255.0, 1.0/2.2) * 255.0));
}
@@ -378,7 +378,7 @@ bool GfxPalette::merge(Palette *newPalette, bool force, bool forceRealMerge) {
break;
}
}
-
+
// if still no luck - set an approximate color
if (j == 256) {
newPalette->mapping[i] = res & 0xFF;
@@ -991,7 +991,7 @@ void GfxPalette::unloadClut() {
delete[] _clutTable;
_clutTable = 0;
}
-
+
#endif
} // End of namespace Sci
diff --git a/engines/sci/graphics/palette.h b/engines/sci/graphics/palette.h
index 9b0c45baf6..243420cc47 100644
--- a/engines/sci/graphics/palette.h
+++ b/engines/sci/graphics/palette.h
@@ -125,7 +125,7 @@ private:
void loadMacIconBarPalette();
byte *_macClut;
-
+
#ifdef ENABLE_SCI32
byte *_clutTable;
#endif
diff --git a/engines/sci/graphics/picture.cpp b/engines/sci/graphics/picture.cpp
index ce69ba8922..ecb54e89e8 100644
--- a/engines/sci/graphics/picture.cpp
+++ b/engines/sci/graphics/picture.cpp
@@ -357,7 +357,7 @@ void GfxPicture::drawCelData(byte *inbuffer, int size, int headerPos, int rlePos
curByte = *ptr++;
if ((curByte != clearColor) && (priority >= _screen->getPriority(x, y)))
_screen->putPixel(x, y, drawMask, curByte, priority, 0);
-
+
if (x == leftX) {
ptr += sourcePixelSkipPerRow;
x = rightX;
@@ -515,7 +515,7 @@ void GfxPicture::drawVectorData(byte *data, int dataSize) {
icemanDrawFix = true;
}
if (g_sci->getGameId() == GID_KQ5) {
- // WORKAROUND: ignore the seemingly broken priority of picture 48
+ // WORKAROUND: ignore the seemingly broken priority of picture 48
// (island overview). Fixes bug #3041044.
if (_resourceId == 48)
ignoreBrokenPriority = true;
@@ -551,7 +551,7 @@ void GfxPicture::drawVectorData(byte *data, int dataSize) {
case PIC_OP_SET_PRIORITY:
pic_priority = data[curPos++] & 0x0F;
- if (isEGA)
+ if (isEGA)
pic_priority = EGApriority[pic_priority];
if (ignoreBrokenPriority)
pic_priority = 255;
diff --git a/engines/sci/graphics/ports.cpp b/engines/sci/graphics/ports.cpp
index 9412976d5b..6b4c8180bf 100644
--- a/engines/sci/graphics/ports.cpp
+++ b/engines/sci/graphics/ports.cpp
@@ -721,7 +721,7 @@ void GfxPorts::printWindowList(Console *con) {
if ((*it)->isWindow()) {
Window *wnd = ((Window *)*it);
con->DebugPrintf("%d: '%s' at %d, %d, (%d, %d, %d, %d), drawn: %d, style: %d\n",
- wnd->id, wnd->title.c_str(), wnd->left, wnd->top,
+ wnd->id, wnd->title.c_str(), wnd->left, wnd->top,
wnd->rect.left, wnd->rect.top, wnd->rect.right, wnd->rect.bottom,
wnd->bDrawn, wnd->wndStyle);
}
diff --git a/engines/sci/graphics/view.cpp b/engines/sci/graphics/view.cpp
index afb4c184e8..6ca4903e17 100644
--- a/engines/sci/graphics/view.cpp
+++ b/engines/sci/graphics/view.cpp
@@ -202,7 +202,7 @@ void GfxView::initData(GuiResourceId resourceId) {
palOffset = READ_SCI11ENDIAN_UINT32(_resourceData + 8);
// For SCI32, this is a scale flag
- if (getSciVersion() >= SCI_VERSION_2) {
+ if (getSciVersion() >= SCI_VERSION_2) {
_sci2ScaleRes = (Sci32ViewNativeResolution)_resourceData[5];
if (_screen->getUpscaledHires() == GFX_SCREEN_UPSCALED_DISABLED)
_sci2ScaleRes = SCI_VIEW_NATIVERES_NONE;
@@ -426,7 +426,7 @@ void unpackCelData(byte *inBuffer, byte *celBitmap, byte clearColor, int pixelCo
// compression for SCI1.1+ Mac
while (pixelNr < pixelCount) {
uint32 pixelLine = pixelNr;
-
+
if (hasByteLengths) {
pixelNr += *rlePtr++;
runLength = *rlePtr++;
@@ -500,7 +500,7 @@ void unpackCelData(byte *inBuffer, byte *celBitmap, byte clearColor, int pixelCo
} else {
memcpy(outPtr + pixelNr, literalPtr, MIN<uint16>(runLength, pixelCount - pixelNr));
literalPtr += runLength;
- }
+ }
break;
case 0x80: // fill with color
if (!literalPos)
diff --git a/engines/sci/parser/said.cpp b/engines/sci/parser/said.cpp
index 827e28073a..01c25ef401 100644
--- a/engines/sci/parser/said.cpp
+++ b/engines/sci/parser/said.cpp
@@ -224,7 +224,7 @@ static bool parsePart2(ParseTreeNode* parentNode, bool& nonempty)
} else if (said_tokens[said_token] == TOKEN_BRACKETO) {
said_token++;
-
+
found = parsePart2(newNode, nonempty);
if (found) {
@@ -282,7 +282,7 @@ static bool parsePart3(ParseTreeNode* parentNode, bool& nonempty)
} else if (said_tokens[said_token] == TOKEN_BRACKETO) {
said_token++;
-
+
found = parsePart3(newNode, nonempty);
if (found) {
@@ -366,7 +366,7 @@ static bool parseRef(ParseTreeNode* parentNode)
said_attach_subtree(newParent, 0x144, 0x14f, newNode);
newParent = newParent->right;
-
+
newNode = said_branch_node(said_next_node(), 0, 0);
found = parseRef(newNode);
@@ -381,14 +381,14 @@ static bool parseRef(ParseTreeNode* parentNode)
}
- }
+ }
// NB: This is not an "else if'.
// If there is a "< [ ... ]", that is parsed as "< ..."
if (said_tokens[said_token] == TOKEN_BRACKETO) {
said_token++;
-
+
found = parseRef(newNode);
if (found) {
diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp
index 308bd92ef4..fa70481bdc 100644
--- a/engines/sci/resource.cpp
+++ b/engines/sci/resource.cpp
@@ -128,7 +128,7 @@ static const char *s_resourceTypeSuffixes[] = {
"trn", "rbt", "vmd", "chk", "",
"etc", "duk", "clu", "tga", "zzz",
"", "", ""
-};
+};
const char *getResourceTypeName(ResourceType restype) {
if (restype != kResourceTypeInvalid)
@@ -449,11 +449,11 @@ bool MacResourceForkResourceSource::isCompressableResource(ResourceType type) co
*ptr++ = value; \
}
-void MacResourceForkResourceSource::decompressResource(Common::SeekableReadStream *stream, Resource *resource) const {
+void MacResourceForkResourceSource::decompressResource(Common::SeekableReadStream *stream, Resource *resource) const {
// KQ6 Mac is the only game not compressed. It's not worth writing a
// heuristic just for that game. Also, skip over any resource that cannot
// be compressed.
- bool canBeCompressed = !(g_sci && g_sci->getGameId() == GID_KQ6) && isCompressableResource(resource->_id.getType());
+ bool canBeCompressed = !(g_sci && g_sci->getGameId() == GID_KQ6) && isCompressableResource(resource->_id.getType());
uint32 uncompressedSize = 0;
// GK2 Mac is crazy. In its Patches resource fork, picture 2315 is not
@@ -503,7 +503,7 @@ void MacResourceForkResourceSource::decompressResource(Common::SeekableReadStrea
// Copy chunk expanded
extraByte1 = stream->readByte();
extraByte2 = stream->readByte();
-
+
literalLength = extraByte2 & 3;
OUTPUT_LITERAL()
@@ -824,7 +824,7 @@ void ChunkResourceSource::scanSource(ResourceManager *resMan) {
byte *ptr = chunk->data;
uint32 firstOffset = 0;
-
+
for (;;) {
ResourceType type = resMan->convertResType(*ptr);
uint16 number = READ_LE_UINT16(ptr + 1);
@@ -844,7 +844,7 @@ void ChunkResourceSource::scanSource(ResourceManager *resMan) {
// There's no end marker to the data table, but the first resource
// begins directly after the entry table. So, when we hit the first
// resource, we're at the end of the entry table.
-
+
if (!firstOffset)
firstOffset = entry.offset;
@@ -1243,7 +1243,7 @@ ResVersion ResourceManager::detectVolVersion() {
for (Common::List<ResourceSource *>::iterator it = _sources.begin(); it != _sources.end(); ++it) {
rsrc = *it;
-
+
if (rsrc->getSourceType() == kSourceVolume) {
if (rsrc->_resourceFile) {
fileStream = rsrc->_resourceFile->createReadStream();
@@ -1291,7 +1291,7 @@ ResVersion ResourceManager::detectVolVersion() {
// loading SCI3 volumes, the format is otherwise
// identical to SCI2. We therefore get the compression
// indicator here, but disregard it in the following
- // code.
+ // code.
wCompression = fileStream->readUint16LE();
if (fileStream->eos()) {
@@ -1473,7 +1473,7 @@ void ResourceManager::readResourcePatchesBase36() {
name = (*x)->getName();
ResourceId resource36 = convertPatchNameBase36((ResourceType)i, name);
-
+
/*
if (i == kResourceTypeAudio36)
debug("audio36 patch: %s => %s. tuple:%d, %s\n", name.c_str(), inputName.c_str(), resource36.tuple, resource36.toString().c_str());
@@ -1494,7 +1494,7 @@ void ResourceManager::readResourcePatchesBase36() {
// Check for SOL as well
tag = (tag << 16) | stream->readUint16BE();
-
+
if (tag != MKTAG('S','O','L',0)) {
delete stream;
continue;
@@ -1613,7 +1613,7 @@ int ResourceManager::readResourceMapSCI0(ResourceSource *map) {
warning("Error while reading %s", map->getLocationName().c_str());
return SCI_ERROR_RESMAP_NOT_FOUND;
}
-
+
if (offset == 0xFFFFFFFF)
break;
@@ -2129,7 +2129,7 @@ void ResourceManager::detectSciVersion() {
bool oldDecompressors = true;
ResourceCompression viewCompression;
-#ifdef ENABLE_SCI32
+#ifdef ENABLE_SCI32
viewCompression = getViewCompression();
#else
if (_volVersion >= kResVersionSci2) {
@@ -2173,7 +2173,7 @@ void ResourceManager::detectSciVersion() {
}
#endif
}
-
+
if (_volVersion == kResVersionSci11Mac) {
// SCI32 doesn't have the resource.cfg file, so we can figure out
// which of the games are SCI1.1. Note that there are no Mac SCI2 games.
diff --git a/engines/sci/resource_audio.cpp b/engines/sci/resource_audio.cpp
index 588ea76ea5..032040fc2c 100644
--- a/engines/sci/resource_audio.cpp
+++ b/engines/sci/resource_audio.cpp
@@ -356,14 +356,14 @@ int ResourceManager::readAudioMapSCI11(ResourceSource *map) {
stream->seek(offset + 1);
byte headerSize = stream->readByte();
assert(headerSize == 11 || headerSize == 12);
-
+
stream->skip(5);
uint32 size = stream->readUint32LE() + headerSize + 2;
addResource(ResourceId(kResourceTypeAudio, n), src, offset, size);
}
} else {
- bool isEarly = (entrySize != 11);
+ bool isEarly = (entrySize != 11);
if (!isEarly) {
offset = READ_LE_UINT32(ptr);
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp
index cc9042ceb7..de1aafb8e2 100644
--- a/engines/sci/sci.cpp
+++ b/engines/sci/sci.cpp
@@ -282,7 +282,7 @@ Common::Error SciEngine::run() {
// without this games would be pretty badly broken
}
- // Show any special warnings for buggy scripts with severe game bugs,
+ // Show any special warnings for buggy scripts with severe game bugs,
// which have been patched by Sierra
if (getGameId() == GID_LONGBOW) {
// Longbow 1.0 has a buggy script which prevents the game
@@ -868,7 +868,7 @@ void SciEngine::syncIngameAudioOptions() {
_gamestate->variables[VAR_GLOBAL][90] = make_reg(0, 2); // speech
} else if (subtitlesOn && speechOn) {
// Is it a game that supports simultaneous speech and subtitles?
- if (getGameId() == GID_SQ4
+ if (getGameId() == GID_SQ4
|| getGameId() == GID_FREDDYPHARKAS
// TODO: The following need script patches for simultaneous speech and subtitles
//|| getGameId() == GID_KQ6
@@ -907,7 +907,7 @@ void SciEngine::loadMacExecutable() {
// KQ6/Freddy require the executable to load their icon bar palettes
if (hasMacIconBar())
error("Could not load Mac resource fork '%s'", filename.c_str());
-
+
// TODO: Show some sort of warning dialog saying they can't get any
// high-res Mac fonts, when we get to that point ;)
}
diff --git a/engines/sci/sci.h b/engines/sci/sci.h
index 04ccbd97d2..b419d862a4 100644
--- a/engines/sci/sci.h
+++ b/engines/sci/sci.h
@@ -38,7 +38,7 @@ struct ADGameDescription;
* Status of this engine: ???
*
* Games using this engine:
- * - Newer Sierra adventure games (based on FreeSCI)
+ * - Newer Sierra adventure games (based on FreeSCI)
*
* @todo give a concrete list of supported games. Could also
* list future games, with status for each.
@@ -176,7 +176,7 @@ enum SciGameId {
GID_FANMADE // FIXME: Do we really need/want this?
};
-/**
+/**
* SCI versions
* For more information, check here:
* http://wiki.scummvm.org/index.php/Sierra_Game_Versions#SCI_Games
diff --git a/engines/sci/sound/audio.cpp b/engines/sci/sound/audio.cpp
index 592caa5814..123dd21894 100644
--- a/engines/sci/sound/audio.cpp
+++ b/engines/sci/sound/audio.cpp
@@ -285,7 +285,7 @@ Audio::RewindableAudioStream *AudioPlayer::getAudioStream(uint32 number, uint32
// instead.
memcpy(compressedData, audioRes->data, audioRes->size);
Common::SeekableReadStream *compressedStream = new Common::MemoryReadStream(compressedData, audioRes->size, DisposeAfterUse::YES);
-
+
switch (audioCompressionType) {
case MKTAG('M','P','3',' '):
#ifdef USE_MAD
diff --git a/engines/sci/sound/drivers/amigamac.cpp b/engines/sci/sound/drivers/amigamac.cpp
index 1436ca45a7..3c750401b9 100644
--- a/engines/sci/sound/drivers/amigamac.cpp
+++ b/engines/sci/sound/drivers/amigamac.cpp
@@ -178,7 +178,7 @@ int MidiDriver_AmigaMac::interpolate(int8 *samples, frac_t offset, bool isUnsign
int diff = (s2 - s1) << 8;
return (s1 << 8) + fracToInt(diff * (offset & FRAC_LO_MASK));
}
-
+
int diff = (samples[x + 1] - samples[x]) << 8;
return (samples[x] << 8) + fracToInt(diff * (offset & FRAC_LO_MASK));
}
@@ -373,7 +373,7 @@ void MidiDriver_AmigaMac::setOutputFrac(int voice) {
fnote -= instrument->baseNote;
fnote *= 4;
// FIXME: check how SSCI maps this
- fnote += (_channels[_voices[voice].hw_channel].pitch - 0x2000) / 169;
+ fnote += (_channels[_voices[voice].hw_channel].pitch - 0x2000) / 169;
while (fnote < 0) {
divFact *= 2;
@@ -617,7 +617,7 @@ int MidiDriver_AmigaMac::open() {
} else if (!loadInstrumentsSCI0Mac(stream))
return Common::kUnknownError;
}
-
+
MidiDriver_Emulated::open();
_mixer->playStream(Audio::Mixer::kPlainSoundType, &_mixerSoundHandle, this, -1, _mixer->kMaxChannelVolume, 0, DisposeAfterUse::NO);
diff --git a/engines/sci/sound/music.cpp b/engines/sci/sound/music.cpp
index 96cbf135ed..2afab3858d 100644
--- a/engines/sci/sound/music.cpp
+++ b/engines/sci/sound/music.cpp
@@ -291,8 +291,8 @@ void SciMusic::soundInitSnd(MusicEntry *pSnd) {
if (_soundVersion >= SCI_VERSION_1_EARLY && g_sci->getPlatform() == Common::kPlatformAmiga)
flags = 0;
int endPart = track->digitalSampleEnd > 0 ? (track->digitalSampleSize - track->digitalSampleEnd) : 0;
- pSnd->pStreamAud = Audio::makeRawStream(channelData + track->digitalSampleStart,
- track->digitalSampleSize - track->digitalSampleStart - endPart,
+ pSnd->pStreamAud = Audio::makeRawStream(channelData + track->digitalSampleStart,
+ track->digitalSampleSize - track->digitalSampleStart - endPart,
track->digitalSampleRate, flags, DisposeAfterUse::NO);
delete pSnd->pLoopStream;
pSnd->pLoopStream = 0;
diff --git a/engines/sci/video/robot_decoder.cpp b/engines/sci/video/robot_decoder.cpp
index d394fd0b2b..77f45e0788 100644
--- a/engines/sci/video/robot_decoder.cpp
+++ b/engines/sci/video/robot_decoder.cpp
@@ -53,14 +53,14 @@ namespace Sci {
// Taken from http://anthonylarme.tripod.com/phantas/phintgtp.html
//
// (...) What we needed was a way of playing video, but have it blend into
-// normal room art instead of occupying its own rectangular area. Room art
-// consists of a background pic overlaid with various animating cels
-// (traditional lingo: sprites). The cels each have a priority that determines
-// who is on top and who is behind in the drawing order. Cels are read from
-// *.v56 files (another proprietary format). A Robot is video frames with
-// transparent background including priority and x,y information. Thus, it is
+// normal room art instead of occupying its own rectangular area. Room art
+// consists of a background pic overlaid with various animating cels
+// (traditional lingo: sprites). The cels each have a priority that determines
+// who is on top and who is behind in the drawing order. Cels are read from
+// *.v56 files (another proprietary format). A Robot is video frames with
+// transparent background including priority and x,y information. Thus, it is
// like a cel, except it comes from an RBT - not a v56. Because it blends into
-// our graphics engine, it looks just like a part of the room. A RBT can move
+// our graphics engine, it looks just like a part of the room. A RBT can move
// around the screen and go behind other objects. (...)
#ifdef ENABLE_SCI32
@@ -105,7 +105,7 @@ bool RobotDecoder::loadStream(Common::SeekableReadStream *stream) {
_surface = new Graphics::Surface();
readHeaderChunk();
-
+
// There are several versions of robot files, ranging from 3 to 6.
// v3: no known examples
// v4: PQ:SWAT demo
@@ -223,7 +223,7 @@ void RobotDecoder::calculateVideoDimensions() {
// This is an O(n) operation, as each frame has a different size.
// We need to know the actual frame size to have a constant video size.
uint32 pos = _fileStream->pos();
-
+
for (uint32 curFrame = 0; curFrame < _header.frameCount; curFrame++) {
_fileStream->skip(4);
uint16 frameWidth = _fileStream->readUint16();
@@ -327,8 +327,8 @@ const Graphics::Surface *RobotDecoder::decodeNextFrame() {
// FIXME: For some reason, there are audio hiccups/gaps
if (_header.hasSound) {
_fileStream->skip(8); // header
- _audioStream->queueBuffer(g_sci->_audio->getDecodedRobotAudioFrame(_fileStream, audioChunkSize - 8),
- (audioChunkSize - 8) * 2, DisposeAfterUse::NO,
+ _audioStream->queueBuffer(g_sci->_audio->getDecodedRobotAudioFrame(_fileStream, audioChunkSize - 8),
+ (audioChunkSize - 8) * 2, DisposeAfterUse::NO,
Audio::FLAG_16BITS | Audio::FLAG_LITTLE_ENDIAN);
} else {
_fileStream->skip(audioChunkSize);
@@ -359,7 +359,7 @@ void RobotDecoder::close() {
}
reset();
-}
+}
#endif
diff --git a/engines/sci/video/seq_decoder.h b/engines/sci/video/seq_decoder.h
index f5e8ad9b05..800a3c9024 100644
--- a/engines/sci/video/seq_decoder.h
+++ b/engines/sci/video/seq_decoder.h
@@ -58,7 +58,7 @@ public:
Graphics::PixelFormat getPixelFormat() const { return Graphics::PixelFormat::createFormatCLUT8(); }
const byte *getPalette() { _dirtyPalette = false; return _palette; }
bool hasDirtyPalette() const { return _dirtyPalette; }
-
+
protected:
Common::Rational getFrameRate() const { assert(_frameDelay); return Common::Rational(60, _frameDelay); }
diff --git a/engines/scumm/actor.cpp b/engines/scumm/actor.cpp
index e4057d1f13..20b929dfd4 100644
--- a/engines/scumm/actor.cpp
+++ b/engines/scumm/actor.cpp
@@ -1066,7 +1066,7 @@ static int checkXYInBoxBounds(int boxnum, int x, int y, int &destX, int &destY)
int dist;
// MM C64: This fixes the trunk bug (#3070065), as well
- // as the fruit bowl, however im not sure if its
+ // as the fruit bowl, however im not sure if its
// the proper solution or not.
if( g_scumm->_game.version == 0 )
yDist = ABS(y - destY);
diff --git a/engines/scumm/charset.cpp b/engines/scumm/charset.cpp
index dce6c9c144..7fb834ce98 100644
--- a/engines/scumm/charset.cpp
+++ b/engines/scumm/charset.cpp
@@ -50,6 +50,7 @@ void ScummEngine::loadCJKFont() {
if (_game.version <= 5 && _game.platform == Common::kPlatformFMTowns && _language == Common::JA_JPN) { // FM-TOWNS v3 / v5 Kanji
#ifdef DISABLE_TOWNS_DUAL_LAYER_MODE
+ GUIErrorMessage("FM-Towns Kanji font drawing requires dual graphics layer support which is disabled in this build");
error("FM-Towns Kanji font drawing requires dual graphics layer support which is disabled in this build");
#else
// use FM-TOWNS font rom, since game files don't have kanji font resources
@@ -788,8 +789,10 @@ void CharsetRendererV3::printChar(int chr, bool ignoreCharsetMask) {
else if (_vm->_cjkFont)
_vm->_cjkFont->drawChar(_vm->_textSurface, chr, _left * _vm->_textSurfaceMultiplier, _top * _vm->_textSurfaceMultiplier, _color, _shadowColor);
#endif
- if (is2byte)
+ if (is2byte) {
origWidth /= _vm->_textSurfaceMultiplier;
+ height /= _vm->_textSurfaceMultiplier;
+ }
}
if (_str.left > _left)
@@ -803,8 +806,8 @@ void CharsetRendererV3::printChar(int chr, bool ignoreCharsetMask) {
_str.right++;
}
- if (_str.bottom < _top + height / _vm->_textSurfaceMultiplier)
- _str.bottom = _top + height / _vm->_textSurfaceMultiplier;
+ if (_str.bottom < _top + height)
+ _str.bottom = _top + height;
}
void CharsetRendererV3::drawChar(int chr, Graphics::Surface &s, int x, int y) {
@@ -1067,7 +1070,7 @@ void CharsetRendererClassic::printCharIntern(bool is2byte, const byte *charPtr,
Graphics::Surface backSurface;
if ((ignoreCharsetMask || !vs->hasTwoBuffers)
#ifndef DISABLE_TOWNS_DUAL_LAYER_MODE
- && (_vm->_game.platform != Common::kPlatformFMTowns)
+ && (_vm->_game.platform != Common::kPlatformFMTowns)
#endif
) {
dstSurface = *vs;
diff --git a/engines/scumm/costume.cpp b/engines/scumm/costume.cpp
index 75cde5e33a..4ca4988605 100644
--- a/engines/scumm/costume.cpp
+++ b/engines/scumm/costume.cpp
@@ -73,10 +73,10 @@ static const int v1MMNESLookup[25] = {
};
static const byte v0ActorTalkArray[0x19] = {
- 0x00, 0x06, 0x06, 0x06, 0x06,
- 0x06, 0x06, 0x00, 0x46, 0x06,
- 0x06, 0x06, 0x06, 0xFF, 0xFF,
- 0x06, 0xC0, 0x06, 0x06, 0x00,
+ 0x00, 0x06, 0x06, 0x06, 0x06,
+ 0x06, 0x06, 0x00, 0x46, 0x06,
+ 0x06, 0x06, 0x06, 0xFF, 0xFF,
+ 0x06, 0xC0, 0x06, 0x06, 0x00,
0xC0, 0xC0, 0x00, 0x06, 0x06
};
@@ -1417,7 +1417,7 @@ byte C64CostumeLoader::increaseAnims(Actor *a) {
if (A->_moving && _vm->_currentRoom != 1 && _vm->_currentRoom != 44) {
if (a->_cost.soundPos == 0)
a->_cost.soundCounter++;
-
+
// Is this the correct location?
// 0x073C
if (v0ActorTalkArray[a->_number] & 0x3F)
diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp
index e5c5906404..18f2f4ddec 100644
--- a/engines/scumm/detection.cpp
+++ b/engines/scumm/detection.cpp
@@ -272,7 +272,7 @@ static BaseScummFile *openDiskImage(const Common::FSNode &node, const GameFilena
GameSettings gs;
memset(&gs, 0, sizeof(GameSettings));
gs.gameid = gfp->gameid;
- gs.id = (Common::String(gfp->gameid) == "maniac" ? GID_MANIAC : GID_ZAK);
+ gs.id = (Common::String(gfp->gameid) == "maniac" ? GID_MANIAC : GID_ZAK);
gs.platform = gfp->platform;
// determine second disk file name
@@ -454,7 +454,7 @@ static void composeFileHashMap(DescMap &fileMD5Map, const Common::FSList &fslist
matched = true;
break;
}
-
+
if (!matched)
continue;
@@ -515,7 +515,7 @@ static void detectGames(const Common::FSList &fslist, Common::List<DetectorResul
if (d.md5.empty()) {
Common::SeekableReadStream *tmp = 0;
bool isDiskImg = (file.hasSuffix(".d64") || file.hasSuffix(".dsk") || file.hasSuffix(".prg"));
-
+
if (isDiskImg) {
tmp = openDiskImage(d.node, gfp);
diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp
index 98d447fdaf..f22547f193 100644
--- a/engines/scumm/gfx.cpp
+++ b/engines/scumm/gfx.cpp
@@ -251,7 +251,7 @@ GdiV2::~GdiV2() {
}
#ifdef USE_RGB_COLOR
-Gdi16Bit::Gdi16Bit(ScummEngine *vm) : Gdi(vm) {
+GdiHE16bit::GdiHE16bit(ScummEngine *vm) : GdiHE(vm) {
}
#endif
@@ -652,15 +652,12 @@ void ScummEngine::drawStripToScreen(VirtScreen *vs, int x, int width, int top, i
assert(0 == (width & 3));
// Compose the text over the game graphics
-#ifdef USE_ARM_GFX_ASM
- asmDrawStripToScreen(height, width, text, src, _compositeBuf, vs->pitch, width, _textSurface.pitch);
-#else
#ifndef DISABLE_TOWNS_DUAL_LAYER_MODE
if (_game.platform == Common::kPlatformFMTowns) {
towns_drawStripToScreen(vs, x, y, x, top, width, height);
- return;
+ return;
} else
-#endif
+#endif
if (_outputPixelFormat.bytesPerPixel == 2) {
const byte *srcPtr = (const byte *)src;
const byte *textPtr = (byte *)_textSurface.getBasePtr(x * m, y * m);
@@ -682,7 +679,11 @@ void ScummEngine::drawStripToScreen(VirtScreen *vs, int x, int width, int top, i
srcPtr += vsPitch;
textPtr += _textSurface.pitch - width * m;
}
- } else {
+ }
+#ifdef USE_ARM_GFX_ASM
+ asmDrawStripToScreen(height, width, text, src, _compositeBuf, vs->pitch, width, _textSurface.pitch);
+#else
+ else {
// We blit four pixels at a time, for improved performance.
const uint32 *src32 = (const uint32 *)src;
uint32 *dst32 = (uint32 *)_compositeBuf;
@@ -721,11 +722,11 @@ void ScummEngine::drawStripToScreen(VirtScreen *vs, int x, int width, int top, i
if (_renderMode == Common::kRenderHercA || _renderMode == Common::kRenderHercG) {
ditherHerc(_compositeBuf, _herculesBuf, width, &x, &y, &width, &height);
- src = _herculesBuf + x + y * Common::kHercW;
- pitch = Common::kHercW;
+ src = _herculesBuf + x + y * kHercWidth;
+ pitch = kHercWidth;
// center image on the screen
- x += (Common::kHercW - _screenWidth * 2) / 2; // (720 - 320*2)/2 = 40
+ x += (kHercWidth - _screenWidth * 2) / 2; // (720 - 320*2)/2 = 40
} else if (_useCJKMode && m == 2) {
pitch *= m;
x *= m;
@@ -818,10 +819,10 @@ void ditherHerc(byte *src, byte *hercbuf, int srcPitch, int *x, int *y, int *wid
int dsty = yo*2 - yo/4;
for (int y1 = 0; y1 < heighto;) {
- assert(dsty < Common::kHercH);
+ assert(dsty < kHercHeight);
srcptr = src + y1 * srcPitch;
- dstptr = hercbuf + dsty * Common::kHercW + xo * 2;
+ dstptr = hercbuf + dsty * kHercWidth + xo * 2;
const int idx1 = (dsty % 7) % 2;
for (int x1 = 0; x1 < widtho; x1++) {
@@ -1023,7 +1024,7 @@ void ScummEngine::restoreBackground(Common::Rect rect, byte backColor) {
if (rect.left > vs->w)
return;
-
+
// Convert 'rect' to local (virtual screen) coordinates
rect.top -= vs->topline;
rect.bottom -= vs->topline;
@@ -1067,7 +1068,7 @@ void ScummEngine::restoreBackground(Common::Rect rect, byte backColor) {
fill(mask, _textSurface.pitch, backColor, width * _textSurfaceMultiplier, height * _textSurfaceMultiplier, _textSurface.format.bytesPerPixel);
}
#endif
-
+
if (_game.features & GF_16BIT_COLOR)
fill(screenBuf, vs->pitch, _16BitPalette[backColor], width, height, vs->format.bytesPerPixel);
else
@@ -1127,7 +1128,7 @@ void ScummEngine::clearTextSurface() {
fill((byte*)_textSurface.pixels, _textSurface.pitch,
#ifndef DISABLE_TOWNS_DUAL_LAYER_MODE
_game.platform == Common::kPlatformFMTowns ? 0 :
-#endif
+#endif
CHARSET_MASK_TRANSPARENCY, _textSurface.w, _textSurface.h, _textSurface.format.bytesPerPixel);
}
@@ -1344,12 +1345,12 @@ void ScummEngine::drawBox(int x, int y, int x2, int y2, int color) {
color = ((color & 0x0f) << 4) | (color & 0x0f);
byte *mask = (byte *)_textSurface.getBasePtr(x * _textSurfaceMultiplier, (y - _screenTop + vs->topline) * _textSurfaceMultiplier);
fill(mask, _textSurface.pitch, color, width * _textSurfaceMultiplier, height * _textSurfaceMultiplier, _textSurface.format.bytesPerPixel);
-
+
if (_game.id == GID_MONKEY2 || _game.id == GID_INDY4 || ((_game.id == GID_INDY3 || _game.id == GID_ZAK) && vs->number != kTextVirtScreen) || (_game.id == GID_LOOM && vs->number == kMainVirtScreen))
return;
}
#endif
-
+
fill(backbuff, vs->pitch, color, width, height, vs->format.bytesPerPixel);
}
}
@@ -3673,7 +3674,7 @@ void Gdi::unkDecode11(byte *dst, int dstPitch, const byte *src, int height) cons
#undef READ_BIT_256
#ifdef USE_RGB_COLOR
-void Gdi16Bit::writeRoomColor(byte *dst, byte color) const {
+void GdiHE16bit::writeRoomColor(byte *dst, byte color) const {
WRITE_UINT16(dst, READ_LE_UINT16(_vm->_hePalettes + 2048 + color * 2));
}
#endif
@@ -4009,7 +4010,7 @@ void ScummEngine::scrollEffect(int dir) {
y = 1 + step;
while (y < vs->h) {
moveScreen(0, -step, vs->h);
-#ifndef DISABLE_TOWNS_DUAL_LAYER_MODE
+#ifndef DISABLE_TOWNS_DUAL_LAYER_MODE
if (_townsScreen) {
towns_drawStripToScreen(vs, 0, vs->topline + vs->h - step, 0, y - step, vs->w, step);
} else
@@ -4022,7 +4023,7 @@ void ScummEngine::scrollEffect(int dir) {
vs->w * m, step * m);
_system->updateScreen();
}
-
+
waitForTimer(delay);
y += step;
}
@@ -4045,7 +4046,7 @@ void ScummEngine::scrollEffect(int dir) {
vs->w * m, step * m);
_system->updateScreen();
}
-
+
waitForTimer(delay);
y += step;
}
@@ -4092,7 +4093,7 @@ void ScummEngine::scrollEffect(int dir) {
0, 0,
step, vs->h);
_system->updateScreen();
- }
+ }
waitForTimer(delay);
x += step;
diff --git a/engines/scumm/gfx.h b/engines/scumm/gfx.h
index 54ce724da1..4b44ddc376 100644
--- a/engines/scumm/gfx.h
+++ b/engines/scumm/gfx.h
@@ -32,6 +32,11 @@ namespace Scumm {
class ScummEngine;
+enum HerculesDimensions {
+ kHercWidth = 720,
+ kHercHeight = 350
+};
+
/** Camera modes */
enum {
kNormalCameraMode = 1,
@@ -430,11 +435,11 @@ public:
};
#ifdef USE_RGB_COLOR
-class Gdi16Bit : public Gdi {
+class GdiHE16bit : public GdiHE {
protected:
virtual void writeRoomColor(byte *dst, byte color) const;
public:
- Gdi16Bit(ScummEngine *vm);
+ GdiHE16bit(ScummEngine *vm);
};
#endif
@@ -450,14 +455,14 @@ public:
void clearLayer(int layer);
void fillLayerRect(int layer, int x, int y, int w, int h, int col);
//void copyRectToLayer(int layer, int x, int y, int w, int h, const uint8 *src);
-
+
uint8 *getLayerPixels(int layer, int x, int y);
int getLayerPitch(int layer);
int getLayerHeight(int layer);
int getLayerBpp(int layer);
int getLayerScaleW(int layer);
int getLayerScaleH(int layer);
-
+
void addDirtyRect(int x, int y, int w, int h);
void toggleLayers(int flag);
void update();
@@ -484,16 +489,16 @@ private:
uint8 **bltInternY;
uint16 *bltTmpPal;
} _layers[2];
-
+
uint8 *_outBuffer;
int _height;
int _width;
int _pitch;
Graphics::PixelFormat _pixelFormat;
-
+
int _numDirtyRects;
- Common::List<Common::Rect> _dirtyRects;
+ Common::List<Common::Rect> _dirtyRects;
OSystem *_system;
};
#endif // DISABLE_TOWNS_DUAL_LAYER_MODE
diff --git a/engines/scumm/gfx_towns.cpp b/engines/scumm/gfx_towns.cpp
index 3c96be8b9c..6a3f50a1af 100644
--- a/engines/scumm/gfx_towns.cpp
+++ b/engines/scumm/gfx_towns.cpp
@@ -47,7 +47,7 @@ void ScummEngine::towns_drawStripToScreen(VirtScreen *vs, int dstX, int dstY, in
int dp2 = _townsScreen->getLayerPitch(1) - width * m * _townsScreen->getLayerBpp(1);
int sp1 = vs->pitch - (width * vs->format.bytesPerPixel);
int sp2 = _textSurface.pitch - width * m;
-
+
if (vs->number == kMainVirtScreen || _game.id == GID_INDY3 || _game.id == GID_ZAK) {
for (int h = 0; h < height; ++h) {
if (_outputPixelFormat.bytesPerPixel == 2) {
@@ -63,13 +63,13 @@ void ScummEngine::towns_drawStripToScreen(VirtScreen *vs, int dstX, int dstY, in
src1 += vs->pitch;
dst1 += _townsScreen->getLayerPitch(0);
}
-
+
for (int sH = 0; sH < m; ++sH) {
memcpy(dst2, src2, width * m);
src2 += _textSurface.pitch;
dst2 += _townsScreen->getLayerPitch(1);
}
- }
+ }
} else {
dst1 = dst2;
for (int h = 0; h < height; ++h) {
@@ -81,7 +81,7 @@ void ScummEngine::towns_drawStripToScreen(VirtScreen *vs, int dstX, int dstY, in
dst1 = dst2;
uint8 *src3 = src2;
-
+
if (m == 2) {
dst2 += _townsScreen->getLayerPitch(1);
src3 += _townsScreen->getLayerPitch(1);
@@ -95,7 +95,7 @@ void ScummEngine::towns_drawStripToScreen(VirtScreen *vs, int dstX, int dstY, in
dst1++;
}
- src1 += sp1;
+ src1 += sp1;
src2 = src3 + sp2;
dst1 = dst2 + dp2;
dst2 += dp2;
@@ -231,7 +231,7 @@ void TownsScreen::setupLayer(int layer, int width, int height, int numCol, void
if (width > _width || height > _height)
error("TownsScreen::setupLayer(): Layer width/height must be equal or less than screen width/height");
-
+
l->scaleW = _width / width;
l->scaleH = _height / height;
@@ -268,13 +268,13 @@ void TownsScreen::setupLayer(int layer, int width, int height, int numCol, void
delete[] l->bltTmpPal;
l->bltTmpPal = (l->bpp == 1 && _pixelFormat.bytesPerPixel == 2) ? new uint16[l->numCol] : 0;
-
+
l->enabled = true;
_layers[0].onBottom = true;
_layers[1].onBottom = _layers[0].enabled ? false : true;
l->ready = true;
}
-
+
void TownsScreen::clearLayer(int layer) {
if (layer < 0 || layer > 1)
return;
@@ -300,10 +300,10 @@ void TownsScreen::fillLayerRect(int layer, int x, int y, int w, int h, int col)
assert(x >= 0 && y >= 0 && ((x + w) * l->bpp) <= (l->pitch) && (y + h) <= (l->height));
uint8 *pos = l->pixels + y * l->pitch + x * l->bpp;
-
+
for (int i = 0; i < h; ++i) {
if (l->bpp == 2) {
- for (int ii = 0; ii < w; ++ii) {
+ for (int ii = 0; ii < w; ++ii) {
*(uint16*)pos = col;
pos += 2;
}
@@ -359,8 +359,8 @@ int TownsScreen::getLayerScaleH(int layer) {
void TownsScreen::addDirtyRect(int x, int y, int w, int h) {
if (w <= 0 || h <= 0 || _numDirtyRects > DIRTY_RECTS_MAX)
- return;
-
+ return;
+
if (_numDirtyRects == DIRTY_RECTS_MAX) {
// full redraw
_dirtyRects.clear();
@@ -383,25 +383,25 @@ void TownsScreen::addDirtyRect(int x, int y, int w, int h) {
y = r->top;
skip = true;
}
-
+
if (x2 > r->left && x2 < r->right && y > r->top && y < r->bottom) {
x2 = r->right;
y = r->top;
skip = true;
}
-
+
if (x2 > r->left && x2 < r->right && y2 > r->top && y2 < r->bottom) {
x2 = r->right;
y2 = r->bottom;
skip = true;
}
-
+
if (x > r->left && x < r->right && y2 > r->top && y2 < r->bottom) {
x = r->left;
y2 = r->bottom;
skip = true;
- }
-
+ }
+
if (skip) {
r->left = x;
r->top = y;
@@ -453,6 +453,8 @@ void TownsScreen::updateOutputBuffer() {
int ptch = _pitch - (r->right - r->left + 1) * _pixelFormat.bytesPerPixel;
if (_pixelFormat.bytesPerPixel == 2 && l->bpp == 1) {
+ if (!l->palette)
+ error("void TownsScreen::updateOutputBuffer(): No palette assigned to 8 bit layer %d", i);
for (int ic = 0; ic < l->numCol; ic++)
l->bltTmpPal[ic] = calc16BitColor(&l->palette[ic * 3]);
}
@@ -484,13 +486,13 @@ void TownsScreen::updateOutputBuffer() {
uint8 col = l->bltInternY[y][l->bltInternX[x]];
if (col || l->onBottom) {
if (l->numCol == 16)
- col = (col >> 4) & (col & 0x0f);
+ col = (col >> 4) & (col & 0x0f);
*dst = col;
}
dst++;
}
dst += ptch;
- }
+ }
}
}
}
@@ -503,7 +505,7 @@ void TownsScreen::outputToScreen() {
_numDirtyRects = 0;
}
-uint16 TownsScreen::calc16BitColor(const uint8 *palEntry) {
+uint16 TownsScreen::calc16BitColor(const uint8 *palEntry) {
return _pixelFormat.RGBToColor(palEntry[0], palEntry[1], palEntry[2]);
}
diff --git a/engines/scumm/he/logic_he.cpp b/engines/scumm/he/logic_he.cpp
index a7d808e316..af56bca2ee 100644
--- a/engines/scumm/he/logic_he.cpp
+++ b/engines/scumm/he/logic_he.cpp
@@ -1018,7 +1018,7 @@ int LogicHEsoccer::op_1007(int32 *args) {
// Returns the square root of the sum of the squares of the arguments
static inline double sqrtSquare(double a1, double a2, double a3) {
return sqrt(a1 * a1 + a2 * a2 + a3 * a3);
-}
+}
int LogicHEsoccer::op_1008(int32 *args) {
// TODO: Used during a match (kicking?)
diff --git a/engines/scumm/he/resource_he.cpp b/engines/scumm/he/resource_he.cpp
index 4565bb9f26..39240e347f 100644
--- a/engines/scumm/he/resource_he.cpp
+++ b/engines/scumm/he/resource_he.cpp
@@ -166,7 +166,7 @@ bool MacResExtractor::extractResource(int id, CachedCursor *cc) {
}
Common::SeekableReadStream *dataStream = _resMgr->getResource('crsr', id + 1000);
-
+
if (!dataStream)
return false;
diff --git a/engines/scumm/he/resource_he.h b/engines/scumm/he/resource_he.h
index 9978869ffc..6996ce81eb 100644
--- a/engines/scumm/he/resource_he.h
+++ b/engines/scumm/he/resource_he.h
@@ -61,7 +61,7 @@ private:
ResExtractor::CachedCursor *findCachedCursor(int id);
ResExtractor::CachedCursor *getCachedCursorSlot();
-
+
CachedCursor _cursorCache[MAX_CACHED_CURSORS];
};
diff --git a/engines/scumm/he/script_v60he.cpp b/engines/scumm/he/script_v60he.cpp
index fb070b3e27..cf7d9fbd2f 100644
--- a/engines/scumm/he/script_v60he.cpp
+++ b/engines/scumm/he/script_v60he.cpp
@@ -744,7 +744,7 @@ void ScummEngine_v60he::o60_closeFile() {
_hOutFileTable[slot] = 0;
}
- delete _hInFileTable[slot];
+ delete _hInFileTable[slot];
_hInFileTable[slot] = 0;
}
}
diff --git a/engines/scumm/he/script_v72he.cpp b/engines/scumm/he/script_v72he.cpp
index 8f16bf0f3a..5af4035930 100644
--- a/engines/scumm/he/script_v72he.cpp
+++ b/engines/scumm/he/script_v72he.cpp
@@ -1446,7 +1446,7 @@ void ScummEngine_v72he::o72_openFile() {
_hOutFileTable[slot]->write(initialData, initialSize);
delete[] initialData;
}
-
+
} break;
default:
error("o72_openFile(): wrong open file mode %d", mode);
diff --git a/engines/scumm/imuse/imuse.cpp b/engines/scumm/imuse/imuse.cpp
index 6813566144..317ef36cb9 100644
--- a/engines/scumm/imuse/imuse.cpp
+++ b/engines/scumm/imuse/imuse.cpp
@@ -100,16 +100,16 @@ IMuseInternal::~IMuseInternal() {
}
}
-byte *IMuseInternal::findStartOfSound(int sound, int ct) {
+byte *IMuseInternal::findStartOfSound(int sound, int ct) {
int32 size, pos;
-
+
static const uint32 id[] = {
MKTAG('M', 'T', 'h', 'd'),
MKTAG('F', 'O', 'R', 'M'),
MKTAG('M', 'D', 'h', 'd'),
MKTAG('M', 'D', 'p', 'g')
};
-
+
byte *ptr = g_scumm->_res->_types[rtSound][sound]._address;
if (ptr == NULL) {
@@ -952,7 +952,7 @@ void IMuseInternal::handle_marker(uint id, byte data) {
_trigger_count--;
_queue_cleared = false;
_queue_end = (_queue_end + 1) % ARRAYSIZE(_cmd_queue);
-
+
while (_queue_end != _queue_pos && _cmd_queue[_queue_end].array[0] == COMMAND_ID && !_queue_cleared) {
p = _cmd_queue[_queue_end].array;
doCommand_internal(p[1], p[2], p[3], p[4], p[5], p[6], p[7], 0);
diff --git a/engines/scumm/imuse/imuse_internal.h b/engines/scumm/imuse/imuse_internal.h
index 8808a3655a..6a7b9fc7d9 100644
--- a/engines/scumm/imuse/imuse_internal.h
+++ b/engines/scumm/imuse/imuse_internal.h
@@ -450,7 +450,7 @@ protected:
kMThd = 1,
kFORM = 2,
kMDhd = 4, // Used in MI2 and INDY4. Contain certain start parameters (priority, volume, etc. ) for the player.
- kMDpg = 8 // These chunks exist in DOTT and SAMNMAX. They don't get processed, however.
+ kMDpg = 8 // These chunks exist in DOTT and SAMNMAX. They don't get processed, however.
};
byte *findStartOfSound(int sound, int ct = (kMThd | kFORM));
diff --git a/engines/scumm/imuse/imuse_player.cpp b/engines/scumm/imuse/imuse_player.cpp
index 0b084f3116..61b9cad2cb 100644
--- a/engines/scumm/imuse/imuse_player.cpp
+++ b/engines/scumm/imuse/imuse_player.cpp
@@ -120,7 +120,7 @@ bool Player::startSound(int sound, MidiDriver *midi) {
_midi = NULL;
return false;
}
-
+
debugC(DEBUG_IMUSE, "Starting music %d", sound);
return true;
}
@@ -194,7 +194,7 @@ int Player::start_seq_sound(int sound, bool reset_vars) {
_parser->property(MidiParser::mpSmartJump, 1);
_parser->loadMusic(ptr, 0);
_parser->setTrack(_track_index);
-
+
ptr = _se->findStartOfSound(sound, IMuseInternal::kMDhd);
setSpeed(reset_vars ? (ptr ? (READ_BE_UINT32(&ptr[4]) && ptr[15] ? ptr[15] : 128) : 128) : _speed);
@@ -226,7 +226,7 @@ void Player::loadStartParameters(int sound) {
_pan = ptr[4];
_transpose = ptr[5];
_detune = ptr[6];
- setSpeed(ptr[7]);
+ setSpeed(ptr[7]);
}
}
}
diff --git a/engines/scumm/imuse/sysex_scumm.cpp b/engines/scumm/imuse/sysex_scumm.cpp
index 4eb3bee93c..c3bec93a60 100644
--- a/engines/scumm/imuse/sysex_scumm.cpp
+++ b/engines/scumm/imuse/sysex_scumm.cpp
@@ -76,7 +76,7 @@ void sysexHandler_Scumm(Player *player, const byte *msg, uint16 len) {
part->set_pri(p[4]);
part->volume((p[5] & 0x0F) << 4 |(p[6] & 0x0F));
part->set_pan((p[7] & 0x0F) << 4 | (p[8] & 0x0F));
- part->_percussion = player->_isMIDI ? ((p[9] & 0x08) > 0) : false;
+ part->_percussion = player->_isMIDI ? ((p[9] & 0x08) > 0) : false;
part->set_transpose((p[9] & 0x0F) << 4 | (p[10] & 0x0F));
part->set_detune((p[11] & 0x0F) << 4 | (p[12] & 0x0F));
part->pitchBendFactor((p[13] & 0x0F) << 4 | (p[14] & 0x0F));
diff --git a/engines/scumm/input.cpp b/engines/scumm/input.cpp
index 07c52578c3..5eea7acc6b 100644
--- a/engines/scumm/input.cpp
+++ b/engines/scumm/input.cpp
@@ -181,7 +181,7 @@ void ScummEngine::parseEvent(Common::Event event) {
_mouse.y = event.mouse.y;
if (_renderMode == Common::kRenderHercA || _renderMode == Common::kRenderHercG) {
- _mouse.x -= (Common::kHercW - _screenWidth * 2) / 2;
+ _mouse.x -= (kHercWidth - _screenWidth * 2) / 2;
_mouse.x >>= 1;
_mouse.y = _mouse.y * 4 / 7;
} else if (_useCJKMode && _textSurfaceMultiplier == 2) {
diff --git a/engines/scumm/player_towns.cpp b/engines/scumm/player_towns.cpp
index e71a8d0587..dd7630d370 100644
--- a/engines/scumm/player_towns.cpp
+++ b/engines/scumm/player_towns.cpp
@@ -32,7 +32,7 @@ Player_Towns::Player_Towns(ScummEngine *vm, bool isVersion2) : _vm(vm), _v2(isVe
void Player_Towns::setSfxVolume(int vol) {
if (!_intf)
- return;
+ return;
_intf->setSoundEffectVolume(vol);
}
@@ -98,17 +98,17 @@ void Player_Towns::playPcmTrack(int sound, const uint8 *data, int velo, int pan,
return;
const uint8 *sfxData = data + 16;
-
+
int numChan = _v2 ? 1 : data[14];
for (int i = 0; i < numChan; i++) {
int chan = allocatePcmChannel(sound, i, priority);
if (!chan)
return;
-
+
_intf->callback(70, _unkFlags);
_intf->callback(3, chan + 0x3f, pan);
_intf->callback(37, chan + 0x3f, note, velo, sfxData);
-
+
_pcmCurrentSound[chan].note = note;
_pcmCurrentSound[chan].velo = velo;
_pcmCurrentSound[chan].pan = pan;
@@ -191,7 +191,7 @@ Player_Towns_v1::Player_Towns_v1(ScummEngine *vm, Audio::Mixer *mixer) : Player_
if (_vm->_game.version == 3) {
_soundOverride = new SoundOvrParameters[_numSoundMax];
memset(_soundOverride, 0, _numSoundMax * sizeof(SoundOvrParameters));
- }
+ }
_driver = new TownsEuphonyDriver(mixer);
}
@@ -204,7 +204,7 @@ Player_Towns_v1::~Player_Towns_v1() {
bool Player_Towns_v1::init() {
if (!_driver)
return false;
-
+
if (!_driver->init())
return false;
@@ -235,13 +235,13 @@ void Player_Towns_v1::startSound(int sound) {
if (type == 0) {
uint8 velocity = 0;
uint8 note = 0;
-
+
if (_vm->_game.version == 3) {
velocity = (_soundOverride[sound].vLeft + _soundOverride[sound].vRight);
note = _soundOverride[sound].note;
}
- velocity = velocity ? velocity >> 2 : ptr[14] >> 1;
+ velocity = velocity ? velocity >> 2 : ptr[14] >> 1;
playPcmTrack(sound, ptr + 6, velocity, 64, note ? note : ptr[50], READ_LE_UINT16(ptr + 10));
} else if (type == 1) {
@@ -267,7 +267,7 @@ void Player_Towns_v1::stopSound(int sound) {
_eupLooping = false;
_driver->stopParser();
}
-
+
stopPcmTrack(sound);
}
@@ -293,7 +293,7 @@ int Player_Towns_v1::getSoundStatus(int sound) const {
int32 Player_Towns_v1::doCommand(int numargs, int args[]) {
int32 res = 0;
-
+
switch (args[0]) {
case 2:
_driver->intf()->callback(73, 0);
@@ -381,12 +381,12 @@ void Player_Towns_v1::saveLoadWithSerializer(Serializer *ser) {
void Player_Towns_v1::restoreAfterLoad() {
setVolumeCD(_cdaVolLeft, _cdaVolRight);
-
+
if (_cdaCurrentSoundTemp) {
uint8 *ptr = _vm->getResourceAddress(rtSound, _cdaCurrentSoundTemp) + 6;
if (_vm->_game.version != 3)
ptr += 2;
-
+
if (ptr[7] == 2) {
playCdaTrack(_cdaCurrentSoundTemp, ptr, true);
_cdaCurrentSound = _cdaCurrentSoundTemp;
@@ -398,7 +398,7 @@ void Player_Towns_v1::restoreAfterLoad() {
uint8 *ptr = _vm->getResourceAddress(rtSound, _eupCurrentSound) + 6;
if (_vm->_game.version != 3)
ptr += 2;
-
+
if (ptr[7] == 1) {
setSoundVolume(_eupCurrentSound, _eupVolLeft, _eupVolRight);
playEuphonyTrack(_eupCurrentSound, ptr);
@@ -458,7 +458,7 @@ void Player_Towns_v1::startSoundEx(int sound, int velo, int pan, int note) {
} else if (ptr[13] == 2) {
int volLeft = velo;
int volRight = velo;
-
+
if (pan < 50)
volRight = ((pan * 2 + 1) * velo + 50) / 100;
else if (pan > 50)
@@ -478,7 +478,7 @@ void Player_Towns_v1::stopSoundSuspendLooping(int sound) {
return;
} else if (sound == _cdaCurrentSound) {
if (_cdaNumLoops && _cdaForceRestart)
- _cdaForceRestart = 1;
+ _cdaForceRestart = 1;
} else {
for (int i = 1; i < 9; i++) {
if (sound == _pcmCurrentSound[i].index) {
@@ -487,7 +487,7 @@ void Player_Towns_v1::stopSoundSuspendLooping(int sound) {
_driver->stopSoundEffect(i + 0x3f);
if (_pcmCurrentSound[i].looping)
_pcmCurrentSound[i].paused = 1;
- else
+ else
_pcmCurrentSound[i].index = 0;
}
}
@@ -532,7 +532,7 @@ void Player_Towns_v1::playEuphonyTrack(int sound, const uint8 *data) {
uint32 trackSize = READ_LE_UINT32(src);
src += 4;
uint8 startTick = *src++;
-
+
_driver->setMusicTempo(*src++);
_driver->startMusicTrack(trackData, trackSize, startTick);
@@ -559,7 +559,7 @@ void Player_Towns_v1::playCdaTrack(int sound, const uint8 *data, bool skipTrackV
}
}
- if (sound == _cdaCurrentSound && _vm->_sound->pollCD() == 1)
+ if (sound == _cdaCurrentSound && _vm->_sound->pollCD() == 1)
return;
ptr += 16;
@@ -585,7 +585,7 @@ Player_Towns_v2::~Player_Towns_v2() {
_intf = 0;
if (_imuseDispose)
- delete _imuse;
+ delete _imuse;
delete[] _sblData;
delete[] _soundOverride;
@@ -594,7 +594,7 @@ Player_Towns_v2::~Player_Towns_v2() {
bool Player_Towns_v2::init() {
if (!_intf)
return false;
-
+
if (!_intf->init())
return false;
@@ -637,7 +637,7 @@ void Player_Towns_v2::startSound(int sound) {
void Player_Towns_v2::stopSound(int sound) {
if (_soundOverride[sound].type == 7) {
- stopPcmTrack(sound);
+ stopPcmTrack(sound);
} else {
_imuse->stopSound(sound);
}
@@ -651,7 +651,7 @@ void Player_Towns_v2::stopAllSounds() {
int32 Player_Towns_v2::doCommand(int numargs, int args[]) {
int32 res = -1;
uint8 *ptr = 0;
-
+
switch (args[0]) {
case 8:
startSound(args[1]);
@@ -675,7 +675,7 @@ int32 Player_Towns_v2::doCommand(int numargs, int args[]) {
case 258:
if (_soundOverride[args[1]].type == 0) {
ptr = _vm->getResourceAddress(rtSound, args[1]);
- if (READ_BE_UINT32(ptr) == MKTAG('T','O','W','S'))
+ if (READ_BE_UINT32(ptr) == MKTAG('T','O','W','S'))
_soundOverride[args[1]].type = 7;
}
if (_soundOverride[args[1]].type == 7) {
@@ -683,11 +683,11 @@ int32 Player_Towns_v2::doCommand(int numargs, int args[]) {
res = 0;
}
break;
-
+
case 259:
if (_soundOverride[args[1]].type == 0) {
ptr = _vm->getResourceAddress(rtSound, args[1]);
- if (READ_BE_UINT32(ptr) == MKTAG('T','O','W','S'))
+ if (READ_BE_UINT32(ptr) == MKTAG('T','O','W','S'))
_soundOverride[args[1]].type = 7;
}
if (_soundOverride[args[1]].type == 7) {
@@ -702,7 +702,7 @@ int32 Player_Towns_v2::doCommand(int numargs, int args[]) {
if (res == -1)
return _imuse->doCommand(numargs, args);
-
+
return res;
}
@@ -718,9 +718,9 @@ void Player_Towns_v2::playVocTrack(const uint8 *data) {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x36, 0x04, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x00
};
-
+
uint32 len = (READ_LE_UINT32(data) >> 8) - 2;
-
+
int chan = allocatePcmChannel(0xffff, 0, 0x1000);
if (!chan)
return;
diff --git a/engines/scumm/player_towns.h b/engines/scumm/player_towns.h
index 470020d621..5c76d7c6c7 100644
--- a/engines/scumm/player_towns.h
+++ b/engines/scumm/player_towns.h
@@ -47,8 +47,8 @@ public:
virtual void restoreAfterLoad();
// version 1 specific
- virtual int getCurrentCdaSound() { return 0; }
- virtual int getCurrentCdaVolume() { return 0; }
+ virtual int getCurrentCdaSound() { return 0; }
+ virtual int getCurrentCdaVolume() { return 0; }
virtual void setVolumeCD(int left, int right) {}
virtual void setSoundVolume(int sound, int left, int right) {}
virtual void setSoundNote(int sound, int note) {}
@@ -92,8 +92,8 @@ public:
void stopAllSounds();
int getSoundStatus(int sound) const;
- int getCurrentCdaSound() { return _cdaCurrentSound; }
- int getCurrentCdaVolume() { return (_cdaVolLeft + _cdaVolRight + 1) >> 1; }
+ int getCurrentCdaSound() { return _cdaCurrentSound; }
+ int getCurrentCdaVolume() { return (_cdaVolLeft + _cdaVolRight + 1) >> 1; }
int32 doCommand(int numargs, int args[]);
@@ -124,7 +124,7 @@ private:
uint8 _cdaVolLeft;
uint8 _cdaVolRight;
-
+
uint8 _eupCurrentSound;
uint8 _eupLooping;
uint8 _eupVolLeft;
@@ -170,7 +170,7 @@ private:
SoundOvrParameters *_soundOverride;
uint8 *_sblData;
-
+
IMuse *_imuse;
const bool _imuseDispose;
};
diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp
index 2be032d496..3cc710c207 100644
--- a/engines/scumm/saveload.cpp
+++ b/engines/scumm/saveload.cpp
@@ -1316,10 +1316,10 @@ void ScummEngine::saveOrLoad(Serializer *s) {
MKEND()
};
- s->saveLoadArrayOf(_textPalette, 48, sizeof(_textPalette[0]), sleUint8);
+ s->saveLoadArrayOf(_textPalette, 48, sizeof(_textPalette[0]), sleUint8);
s->saveLoadArrayOf(_cyclRects, 10, sizeof(_cyclRects[0]), townsFields);
s->saveLoadArrayOf(&_curStringRect, 1, sizeof(_curStringRect), townsFields);
- s->saveLoadArrayOf(_townsCharsetColorMap, 16, sizeof(_townsCharsetColorMap[0]), sleUint8);
+ s->saveLoadArrayOf(_townsCharsetColorMap, 16, sizeof(_townsCharsetColorMap[0]), sleUint8);
s->saveLoadEntries(this, townsExtraEntries);
}
#endif
@@ -1497,6 +1497,16 @@ void ScummEngine_v5::saveOrLoad(Serializer *s) {
resetCursors();
}
}
+
+ // Regenerate 16bit palette after loading.
+ // This avoids color issues when loading savegames that have been saved with a different ScummVM port
+ // that uses a different 16bit color mode than the ScummVM port which is currently used.
+#ifdef USE_RGB_COLOR
+ if (_game.platform == Common::kPlatformPCEngine && s->isLoading()) {
+ for (int i = 0; i < 256; ++i)
+ _16BitPalette[i] = get16BitColor(_currentPalette[i * 3 + 0], _currentPalette[i * 3 + 1], _currentPalette[i * 3 + 2]);
+ }
+#endif
}
#ifdef ENABLE_SCUMM_7_8
diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp
index 2c8f65496f..a6cf504586 100644
--- a/engines/scumm/script_v5.cpp
+++ b/engines/scumm/script_v5.cpp
@@ -1611,7 +1611,7 @@ void ScummEngine_v5::o5_resourceRoutines() {
foo = getVarOrDirectByte(PARAM_2);
bar = fetchScriptByte();
if (_townsPlayer)
- _townsPlayer->setSoundVolume(resid, foo, bar);
+ _townsPlayer->setSoundVolume(resid, foo, bar);
break;
case 37:
if (_townsPlayer)
@@ -2319,7 +2319,7 @@ void ScummEngine_v5::o5_verbOps() {
if (_game.platform == Common::kPlatformFMTowns && _game.version == 3 && slot)
continue;
-
+
if (slot == 0) {
for (slot = 1; slot < _numVerbs; slot++) {
if (_verbs[slot].verbid == 0)
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index c74e4d1824..7b136dc36d 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -114,17 +114,18 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr)
_rnd("scumm")
{
- if (_game.heversion > 0) {
- _gdi = new GdiHE(this);
- } else if (_game.platform == Common::kPlatformNES) {
- _gdi = new GdiNES(this);
#ifdef USE_RGB_COLOR
- } else if (_game.features & GF_16BIT_COLOR) {
+ if (_game.features & GF_16BIT_COLOR) {
if (_game.platform == Common::kPlatformPCEngine)
_gdi = new GdiPCEngine(this);
- else
- _gdi = new Gdi16Bit(this);
+ else if (_game.heversion > 0)
+ _gdi = new GdiHE16bit(this);
+ } else
#endif
+ if (_game.heversion > 0) {
+ _gdi = new GdiHE(this);
+ } else if (_game.platform == Common::kPlatformNES) {
+ _gdi = new GdiNES(this);
} else if (_game.version <= 1) {
_gdi = new GdiV1(this);
} else if (_game.version == 2) {
@@ -328,7 +329,7 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr)
memset(&_cyclRects, 0, 16 * sizeof(Common::Rect));
_numCyclRects = 0;
#endif
-
+
//
// Init all VARS to 0xFF
//
@@ -563,7 +564,7 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr)
_herculesBuf = 0;
if (_renderMode == Common::kRenderHercA || _renderMode == Common::kRenderHercG) {
- _herculesBuf = (byte *)malloc(Common::kHercW * Common::kHercH);
+ _herculesBuf = (byte *)malloc(kHercWidth * kHercHeight);
}
// Add debug levels
@@ -590,7 +591,7 @@ ScummEngine::~ScummEngine() {
delete _actors[i];
delete[] _actors;
}
-
+
delete[] _sortedActors;
delete[] _2byteFontPtr;
@@ -1139,7 +1140,7 @@ Common::Error ScummEngine::init() {
// Initialize backend
if (_renderMode == Common::kRenderHercA || _renderMode == Common::kRenderHercG) {
- initGraphics(Common::kHercW, Common::kHercH, true);
+ initGraphics(kHercWidth, kHercHeight, true);
} else {
int screenWidth = _screenWidth;
int screenHeight = _screenHeight;
@@ -1149,30 +1150,37 @@ Common::Error ScummEngine::init() {
screenWidth *= _textSurfaceMultiplier;
screenHeight *= _textSurfaceMultiplier;
}
- if (_game.features & GF_16BIT_COLOR
+ if (_game.features & GF_16BIT_COLOR
#ifndef DISABLE_TOWNS_DUAL_LAYER_MODE
|| _game.platform == Common::kPlatformFMTowns
#endif
) {
#ifdef USE_RGB_COLOR
_outputPixelFormat = Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0);
- Common::List<Graphics::PixelFormat> tryModes = _system->getSupportedFormats();
- // Try default 555 mode first
- tryModes.push_front(_outputPixelFormat);
-
- for (Common::List<Graphics::PixelFormat>::iterator g = tryModes.begin(); g != tryModes.end(); ++g) {
- if (g->bytesPerPixel != 2 || g->aBits())
- continue;
- _outputPixelFormat = *g;
+
+ if (_game.platform != Common::kPlatformFMTowns && _game.platform != Common::kPlatformPCEngine) {
initGraphics(screenWidth, screenHeight, screenWidth > 320, &_outputPixelFormat);
- // Other modes than 555 are only supported for FM-TOWNS games and LOOM PCE.
- // Especially the HE games require 555.
- if (*g == _system->getScreenFormat() || (_game.platform != Common::kPlatformFMTowns && _game.platform != Common::kPlatformPCEngine))
- break;
+ if (_outputPixelFormat != _system->getScreenFormat())
+ return Common::kUnsupportedColorMode;
+ } else {
+ Common::List<Graphics::PixelFormat> tryModes = _system->getSupportedFormats();
+ for (Common::List<Graphics::PixelFormat>::iterator g = tryModes.begin(); g != tryModes.end(); ++g) {
+ if (g->bytesPerPixel != 2 || g->aBits()) {
+ g = tryModes.erase(g);
+ g--;
+ }
+
+ if (*g == _outputPixelFormat) {
+ tryModes.clear();
+ tryModes.push_back(_outputPixelFormat);
+ break;
+ }
+ }
+
+ initGraphics(screenWidth, screenHeight, screenWidth > 320, tryModes);
+ if (_system->getScreenFormat().bytesPerPixel != 2)
+ return Common::kUnsupportedColorMode;
}
-
- if (_outputPixelFormat != _system->getScreenFormat())
- return Common::kUnsupportedColorMode;
#else
if (_game.platform == Common::kPlatformFMTowns && _game.version == 3) {
warning("Starting game without the required 16bit color support.\nYou may experience color glitches");
@@ -1184,7 +1192,7 @@ Common::Error ScummEngine::init() {
} else {
#ifdef DISABLE_TOWNS_DUAL_LAYER_MODE
if (_game.platform == Common::kPlatformFMTowns && _game.version == 5)
- error("This game requires dual graphics layer support which is disabled in this build");
+ return Common::Error(Common::kUnsupportedColorMode, "This game requires dual graphics layer support which is disabled in this build");
#endif
initGraphics(screenWidth, screenHeight, (screenWidth > 320));
}
@@ -1860,7 +1868,7 @@ void ScummEngine::setupMusic(int midi) {
}
_imuse = IMuse::create(_system, nativeMidiDriver, adlibMidiDriver);
-
+
if (_game.platform == Common::kPlatformFMTowns) {
_musicEngine = _townsPlayer = new Player_Towns_v2(this, _mixer, _imuse, true);
if (!_townsPlayer->init())
diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h
index 5700271911..01bde90e1c 100644
--- a/engines/scumm/scumm.h
+++ b/engines/scumm/scumm.h
@@ -1004,7 +1004,7 @@ protected:
// Screen rendering
byte *_compositeBuf;
byte *_herculesBuf;
-
+
virtual void drawDirtyScreenParts();
void updateDirtyScreen(VirtScreenNumber slot);
void drawStripToScreen(VirtScreen *vs, int x, int w, int t, int b);
@@ -1148,7 +1148,7 @@ protected:
void restoreCharsetBg();
void clearCharsetMask();
void clearTextSurface();
-
+
virtual void initCharset(int charset);
virtual void printString(int m, const byte *msg);
@@ -1348,10 +1348,10 @@ protected:
Common::Rect _cyclRects[16];
int _numCyclRects;
-
+
Common::Rect _curStringRect;
- byte _townsOverrideShadowColor;
+ byte _townsOverrideShadowColor;
byte _textPalette[48];
byte _townsClearLayerFlag;
byte _townsActiveLayerFlags;
diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp
index c22da8e7c7..27e43b3740 100644
--- a/engines/scumm/sound.cpp
+++ b/engines/scumm/sound.cpp
@@ -312,7 +312,7 @@ void Sound::playSound(int soundID) {
sound = (byte *)malloc(size);
memcpy(sound, ptr + 6, size);
stream = Audio::makeRawStream(sound, size, rate, Audio::FLAG_UNSIGNED);
- _mixer->playStream(Audio::Mixer::kSFXSoundType, NULL, stream, soundID);
+ _mixer->playStream(Audio::Mixer::kSFXSoundType, NULL, stream, soundID);
}
else if (_vm->_game.platform != Common::kPlatformFMTowns && READ_BE_UINT32(ptr) == MKTAG('S','O','U','N')) {
if (_vm->_game.version != 3)
diff --git a/engines/scumm/verbs.cpp b/engines/scumm/verbs.cpp
index 69caceb53a..0c1554840e 100644
--- a/engines/scumm/verbs.cpp
+++ b/engines/scumm/verbs.cpp
@@ -152,7 +152,7 @@ void ScummEngine_v0::setNewKidVerbs() {
void ScummEngine_v0::switchActor(int slot) {
resetSentence(false);
-
+
if (_currentRoom == 45)
return;
@@ -728,7 +728,7 @@ void ScummEngine_v0::runObject(int obj, int entry) {
entry = 0x0F;
}
}
-
+
_v0ObjectInInventory = prev;
if (getVerbEntrypoint(obj, entry) != 0) {
@@ -830,7 +830,7 @@ bool ScummEngine_v0::verbObtain(int obj, int objIndex) {
} else {
_verbPickup = false;
}
-
+
// Ignore verbs?
Actor *a = derefActor(VAR(VAR_EGO), "verbObtain");
if (((ActorC64 *)a)->_miscflags & 0x40) {
@@ -989,7 +989,7 @@ bool ScummEngine_v0::verbExec() {
runObject(_activeObjectIndex, entry);
_v0ObjectIndex = false;
} else if (_activeInventory) {
- // Not sure this is the correct way to do this,
+ // Not sure this is the correct way to do this,
// however its working for most situations - segra
if (verbExecutes(_activeInventory, true) == false) {
if (_activeObject2 && _activeObject2Inv && verbExecutes(_activeObject2, true)) {
@@ -1001,7 +1001,7 @@ bool ScummEngine_v0::verbExec() {
runObject(_activeObject, _activeVerb);
} else {
_v0ObjectInInventory = true;
-
+
if (_activeObject2) {
_activeObject = _activeObject2;
@@ -1085,7 +1085,7 @@ void ScummEngine_v0::checkExecVerbs() {
// Click into V2 inventory
checkV2Inventory(_mouse.x, _mouse.y);
-
+
// Did the Inventory position changed (arrows pressed, do nothing)
if (invOff != _inventoryOffset)
return;
@@ -1143,7 +1143,7 @@ void ScummEngine_v0::checkExecVerbs() {
obj = 0;
objIdx = 0;
}
-
+
if (a->_miscflags & 0x80) {
if (_activeVerb != 7 && over != 7) {
_activeVerb = 0;
@@ -1444,9 +1444,9 @@ void ScummEngine::restoreVerbBG(int verb) {
VerbSlot *vs;
vs = &_verbs[verb];
- uint8 col =
+ uint8 col =
#ifndef DISABLE_TOWNS_DUAL_LAYER_MODE
- ((_game.platform == Common::kPlatformFMTowns) && (_game.id == GID_MONKEY2 || _game.id == GID_INDY4) && (vs->bkcolor == _townsOverrideShadowColor)) ? 0 :
+ ((_game.platform == Common::kPlatformFMTowns) && (_game.id == GID_MONKEY2 || _game.id == GID_INDY4) && (vs->bkcolor == _townsOverrideShadowColor)) ? 0 :
#endif
vs->bkcolor;
diff --git a/engines/sword1/animation.cpp b/engines/sword1/animation.cpp
index cb86264eeb..4ce3e2e88d 100644
--- a/engines/sword1/animation.cpp
+++ b/engines/sword1/animation.cpp
@@ -261,7 +261,7 @@ bool MoviePlayer::playVideo() {
uint32 minWeight = 0xFFFFFFFF;
uint32 weight;
byte r, g, b;
-
+
const byte *palette = _decoder->getPalette();
for (int i = 0; i < 256; i++) {
diff --git a/engines/sword2/animation.cpp b/engines/sword2/animation.cpp
index 133abf165e..80b4809722 100644
--- a/engines/sword2/animation.cpp
+++ b/engines/sword2/animation.cpp
@@ -296,7 +296,7 @@ bool MoviePlayer::playVideo() {
uint32 minWeight = 0xFFFFFFFF;
uint32 weight;
byte r, g, b;
-
+
const byte *palette = _decoder->getPalette();
for (int i = 0; i < 256; i++) {
diff --git a/engines/sword25/detection_tables.h b/engines/sword25/detection_tables.h
index ca586b4f01..fe9e6e7934 100644
--- a/engines/sword25/detection_tables.h
+++ b/engines/sword25/detection_tables.h
@@ -34,7 +34,7 @@ static const ADGameDescription gameDescriptions[] = {
AD_ENTRY1s("data.b25c", "f8b6e03ada2d2f6cf27fbc11ad1572e9", 654310588),
Common::EN_ANY,
Common::kPlatformUnknown,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
{
@@ -43,7 +43,7 @@ static const ADGameDescription gameDescriptions[] = {
AD_ENTRY1s("lang_fr.b25c", "690caf157387e06d2c3d1ca53c43f428", 1006043),
Common::FR_FRA,
Common::kPlatformUnknown,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
{
@@ -52,7 +52,7 @@ static const ADGameDescription gameDescriptions[] = {
AD_ENTRY1s("data.b25c", "f8b6e03ada2d2f6cf27fbc11ad1572e9", 654310588),
Common::DE_DEU,
Common::kPlatformUnknown,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
{
@@ -61,7 +61,7 @@ static const ADGameDescription gameDescriptions[] = {
AD_ENTRY1s("lang_hr.b25c", "e881054d1f8ec1e527422fc521c25405", 1273217),
Common::HU_HUN,
Common::kPlatformUnknown,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
{
@@ -70,7 +70,7 @@ static const ADGameDescription gameDescriptions[] = {
AD_ENTRY1s("lang_it.b25c", "f3325666da0515cc2b42062e953c0889", 996197),
Common::IT_ITA,
Common::kPlatformUnknown,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
{
@@ -79,7 +79,7 @@ static const ADGameDescription gameDescriptions[] = {
AD_ENTRY1s("lang_pl.b25c", "49dc1a20f95391a808e475c49be2bac0", 1281799),
Common::PL_POL,
Common::kPlatformUnknown,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
{
@@ -88,7 +88,7 @@ static const ADGameDescription gameDescriptions[] = {
AD_ENTRY1s("lang_pt.b25c", "1df701432f9e13dcefe1adeb890b9c69", 993812),
Common::PT_BRA,
Common::kPlatformUnknown,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
{
@@ -97,7 +97,7 @@ static const ADGameDescription gameDescriptions[] = {
AD_ENTRY1s("lang_ru.b25c", "deb33dd2f90a71ff60181918a8ce5063", 1235378),
Common::RU_RUS,
Common::kPlatformUnknown,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
{
@@ -106,7 +106,7 @@ static const ADGameDescription gameDescriptions[] = {
AD_ENTRY1s("lang_es.b25c", "384c19072d83725f351bb9ecb4d3f02b", 987965),
Common::ES_ESP,
Common::kPlatformUnknown,
- ADGF_NO_FLAGS,
+ ADGF_UNSTABLE,
Common::GUIO_NONE
},
@@ -120,7 +120,7 @@ static const ADGameDescription gameDescriptions[] = {
AD_LISTEND},
Common::EN_ANY,
Common::kPlatformUnknown,
- GF_EXTRACTED,
+ GF_EXTRACTED | ADGF_UNSTABLE,
Common::GUIO_NONE
},
AD_TABLE_END_MARKER
diff --git a/engines/sword25/gfx/animation.h b/engines/sword25/gfx/animation.h
index 55deacd333..60070be214 100644
--- a/engines/sword25/gfx/animation.h
+++ b/engines/sword25/gfx/animation.h
@@ -210,7 +210,7 @@ private:
AnimationDescription *getAnimationDescription() const;
/**
- * Initializes a new animation resource from an XML file.
+ * Initializes a new animation resource from an XML file.
*/
void initializeAnimationResource(const Common::String &fileName);
};
diff --git a/engines/sword25/gfx/animationresource.cpp b/engines/sword25/gfx/animationresource.cpp
index b9d70cf87b..621e20ad8c 100644
--- a/engines/sword25/gfx/animationresource.cpp
+++ b/engines/sword25/gfx/animationresource.cpp
@@ -64,7 +64,7 @@ AnimationResource::AnimationResource(const Common::String &filename) :
char *xmlData = _pPackage->getXmlFile(getFileName(), &fileSize);
if (!xmlData) {
error("Could not read \"%s\".", getFileName().c_str());
- return;
+ return;
}
// Parse the contents
@@ -118,7 +118,7 @@ bool AnimationResource::parserCallback_animation(ParserNode *node) {
// Loop type value
const char *loopTypeString = node->values["type"].c_str();
-
+
if (strcmp(loopTypeString, "oneshot") == 0) {
_animationType = Animation::AT_ONESHOT;
} else if (strcmp(loopTypeString, "loop") == 0) {
@@ -148,7 +148,7 @@ bool AnimationResource::parserCallback_frame(ParserNode *node) {
}
frame.fileName = _pPackage->getAbsolutePath(fileString);
if (frame.fileName.empty()) {
- error("Could not create absolute path for file specified in <frame> tag in \"%s\": \"%s\".",
+ error("Could not create absolute path for file specified in <frame> tag in \"%s\": \"%s\".",
getFileName().c_str(), fileString);
return false;
}
diff --git a/engines/sword25/gfx/fontresource.cpp b/engines/sword25/gfx/fontresource.cpp
index 7657abb5f2..0aeca7c180 100644
--- a/engines/sword25/gfx/fontresource.cpp
+++ b/engines/sword25/gfx/fontresource.cpp
@@ -85,7 +85,7 @@ bool FontResource::parserCallback_font(ParserNode *node) {
getFileName().c_str(), DEFAULT_GAPWIDTH);
_gapWidth = DEFAULT_GAPWIDTH;
}
-
+
// Get a reference to the package manager
assert(_pKernel);
PackageManager *pPackage = _pKernel->getPackage();
diff --git a/engines/sword25/gfx/graphicengine.cpp b/engines/sword25/gfx/graphicengine.cpp
index 6b1c2bc514..91133b9fd2 100644
--- a/engines/sword25/gfx/graphicengine.cpp
+++ b/engines/sword25/gfx/graphicengine.cpp
@@ -365,7 +365,7 @@ void GraphicEngine::updateLastFrameDuration() {
}
bool GraphicEngine::saveThumbnailScreenshot(const Common::String &filename) {
- // Note: In ScumMVM, rather than saivng the thumbnail to a file, we store it in memory
+ // Note: In ScumMVM, rather than saivng the thumbnail to a file, we store it in memory
// until needed when creating savegame files
delete _thumbnail;
diff --git a/engines/sword25/gfx/image/art.cpp b/engines/sword25/gfx/image/art.cpp
index cd7cfb6b69..2df8bd4f3e 100644
--- a/engines/sword25/gfx/image/art.cpp
+++ b/engines/sword25/gfx/image/art.cpp
@@ -2499,7 +2499,7 @@ void art_svp_render_aa_iter_step(ArtSVPRenderAAIter *iter, int *p_start,
ADD_STEP(x, xdelta)
}
if (x < x1) {
- this_ =
+ this_ =
(int)(delta * (1 - 0.5 *
(x_max - ix_max) * (x_max - ix_max) *
rslope));
diff --git a/engines/sword25/gfx/image/renderedimage.cpp b/engines/sword25/gfx/image/renderedimage.cpp
index a9c9de4f0c..f5f33d8e02 100644
--- a/engines/sword25/gfx/image/renderedimage.cpp
+++ b/engines/sword25/gfx/image/renderedimage.cpp
@@ -373,17 +373,23 @@ bool RenderedImage::blit(int posX, int posY, int flipping, Common::Rect *pPartRe
default: // alpha blending
#if defined(SCUMM_LITTLE_ENDIAN)
- if (cb != 255)
+ if (cb == 0)
+ *out = 0;
+ else if (cb != 255)
*out += ((b - *out) * a * cb) >> 16;
else
*out += ((b - *out) * a) >> 8;
out++;
- if (cg != 255)
+ if (cg == 0)
+ *out = 0;
+ else if (cg != 255)
*out += ((g - *out) * a * cg) >> 16;
else
*out += ((g - *out) * a) >> 8;
out++;
- if (cr != 255)
+ if (cr == 0)
+ *out = 0;
+ else if (cr != 255)
*out += ((r - *out) * a * cr) >> 16;
else
*out += ((r - *out) * a) >> 8;
@@ -393,17 +399,23 @@ bool RenderedImage::blit(int posX, int posY, int flipping, Common::Rect *pPartRe
#else
*out = 255;
out++;
- if (cr != 255)
+ if (cr == 0)
+ *out = 0;
+ else if (cr != 255)
*out += ((r - *out) * a * cr) >> 16;
else
*out += ((r - *out) * a) >> 8;
out++;
- if (cg != 255)
+ if (cg == 0)
+ *out = 0;
+ else if (cg != 255)
*out += ((g - *out) * a * cg) >> 16;
else
*out += ((g - *out) * a) >> 8;
out++;
- if (cb != 255)
+ if (cb == 0)
+ *out = 0;
+ else if (cb != 255)
*out += ((b - *out) * a * cb) >> 16;
else
*out += ((b - *out) * a) >> 8;
diff --git a/engines/sword25/gfx/screenshot.cpp b/engines/sword25/gfx/screenshot.cpp
index 4f9ba1d3c5..de7b62fba9 100644
--- a/engines/sword25/gfx/screenshot.cpp
+++ b/engines/sword25/gfx/screenshot.cpp
@@ -67,8 +67,8 @@ bool Screenshot::saveToFile(Graphics::Surface *data, Common::WriteStream *stream
Common::SeekableReadStream *Screenshot::createThumbnail(Graphics::Surface *data) {
// This method takes a screen image with a dimension of 800x600, and creates a screenshot with a dimension of 200x125.
- // First 50 pixels are cut off the top and bottom (the interface boards in the game). The remaining image of 800x500
- // will be on a 16th of its size, reduced by being handed out in 4x4 pixel blocks and the average of each block
+ // First 50 pixels are cut off the top and bottom (the interface boards in the game). The remaining image of 800x500
+ // will be on a 16th of its size, reduced by being handed out in 4x4 pixel blocks and the average of each block
// generates a pixel of the target image. Finally, the result as a PNG file is stored as a file.
// The source image must be 800x600.
@@ -84,7 +84,7 @@ Common::SeekableReadStream *Screenshot::createThumbnail(Graphics::Surface *data)
// мber das Zielbild iterieren und einen Pixel zur Zeit berechnen.
uint x, y;
x = y = 0;
-
+
for (byte *pDest = (byte *)thumbnail.pixels; pDest < ((byte *)thumbnail.pixels + thumbnail.pitch * thumbnail.h); ) {
// Get an average over a 4x4 pixel block in the source image
int alpha, red, green, blue;
diff --git a/engines/sword25/gfx/text.cpp b/engines/sword25/gfx/text.cpp
index 8e18d2936d..82bb7cdff7 100644
--- a/engines/sword25/gfx/text.cpp
+++ b/engines/sword25/gfx/text.cpp
@@ -61,7 +61,7 @@ Text::Text(InputPersistenceBlock &reader, RenderObjectPtr<RenderObject> parentPt
// Temporarily set fields prior to unpersisting actual values
_modulationColor(0xffffffff),
_autoWrap(false),
- _autoWrapThreshold(AUTO_WRAP_THRESHOLD_DEFAULT) {
+ _autoWrapThreshold(AUTO_WRAP_THRESHOLD_DEFAULT) {
// Unpersist the fields
_initSuccess = unpersist(reader);
diff --git a/engines/sword25/kernel/persistenceservice.cpp b/engines/sword25/kernel/persistenceservice.cpp
index 17e9199b5c..c88360e031 100644
--- a/engines/sword25/kernel/persistenceservice.cpp
+++ b/engines/sword25/kernel/persistenceservice.cpp
@@ -199,7 +199,7 @@ Common::String PersistenceService::getSavegameDirectory() {
// Try and return the path using the savegame subfolder. But if doesn't exist, fall back on the data directory
if (childNode.exists())
return childNode.getPath();
-
+
return node.getPath();
}
diff --git a/engines/sword25/package/packagemanager.cpp b/engines/sword25/package/packagemanager.cpp
index 5c869203c6..5549f50c3c 100644
--- a/engines/sword25/package/packagemanager.cpp
+++ b/engines/sword25/package/packagemanager.cpp
@@ -157,7 +157,7 @@ byte *PackageManager::getFile(const Common::String &fileName, uint *fileSizePtr)
byte *buffer = new byte[file->size()];
file->read(buffer, file->size());
-
+
delete file;
return buffer;
}
diff --git a/engines/sword25/package/packagemanager.h b/engines/sword25/package/packagemanager.h
index 3c4c4e89c5..c57c30636d 100644
--- a/engines/sword25/package/packagemanager.h
+++ b/engines/sword25/package/packagemanager.h
@@ -151,7 +151,7 @@ public:
return result;
}
-
+
/**
* Returns the path to the current directory.
* @return Returns a string containing the path to the current directory.
diff --git a/engines/sword25/util/lua/lapi.cpp b/engines/sword25/util/lua/lapi.cpp
index 16f8460e39..ff25cfc653 100644
--- a/engines/sword25/util/lua/lapi.cpp
+++ b/engines/sword25/util/lua/lapi.cpp
@@ -213,7 +213,7 @@ LUA_API void lua_replace (lua_State *L, int idx) {
api_checkvalidindex(L, o);
if (idx == LUA_ENVIRONINDEX) {
Closure *func = curr_func(L);
- api_check(L, ttistable(L->top - 1));
+ api_check(L, ttistable(L->top - 1));
func->c.env = hvalue(L->top - 1);
luaC_barrier(L, func, L->top - 1);
}
@@ -773,7 +773,7 @@ LUA_API int lua_setfenv (lua_State *L, int idx) {
#define checkresults(L,na,nr) \
api_check(L, (nr) == LUA_MULTRET || (L->ci->top - L->top >= (nr) - (na)))
-
+
LUA_API void lua_call (lua_State *L, int nargs, int nresults) {
StkId func;
diff --git a/engines/sword25/util/lua/lauxlib.cpp b/engines/sword25/util/lua/lauxlib.cpp
index 8978cd5613..1261777315 100644
--- a/engines/sword25/util/lua/lauxlib.cpp
+++ b/engines/sword25/util/lua/lauxlib.cpp
@@ -570,13 +570,13 @@ LUALIB_API int luaL_loadfile (lua_State *L, const char *filename) {
}
c = lf.f->getc();
- if (c == '#') { // Unix exec. file?
+ if (c == '#') { // Unix exec. file?
lf.extraline = 1;
- while ((c = lf.f->getc()) != EOF && c != '\n') ; // skip first line
+ while ((c = lf.f->getc()) != EOF && c != '\n') ; // skip first line
if (c == '\n') c = lf.f->getc();
}
- if (c == LUA_SIGNATURE[0] && filename) { // binary file?
- lf.f = freopen(filename, "rb", lf.f); // reopen in binary mode
+ if (c == LUA_SIGNATURE[0] && filename) { // binary file?
+ lf.f = freopen(filename, "rb", lf.f); // reopen in binary mode
if (lf.f == NULL) return errfile(L, "reopen", fnameindex);
// skip eventual `#!...'
while ((c = lf.f->getc()) != EOF && c != LUA_SIGNATURE[0]) ;
diff --git a/engines/sword25/util/lua/ldblib.cpp b/engines/sword25/util/lua/ldblib.cpp
index 4d0333b46e..618e9a843f 100644
--- a/engines/sword25/util/lua/ldblib.cpp
+++ b/engines/sword25/util/lua/ldblib.cpp
@@ -142,7 +142,7 @@ static int db_getinfo (lua_State *L) {
treatstackoption(L, L1, "func");
return 1; /* return table */
}
-
+
static int db_getlocal (lua_State *L) {
int arg;
diff --git a/engines/sword25/util/lua/ldebug.cpp b/engines/sword25/util/lua/ldebug.cpp
index 0b26522b31..85c492cc77 100644
--- a/engines/sword25/util/lua/ldebug.cpp
+++ b/engines/sword25/util/lua/ldebug.cpp
@@ -184,7 +184,7 @@ static void collectvalidlines (lua_State *L, Closure *f) {
int i;
for (i=0; i<f->l.p->sizelineinfo; i++)
setbvalue(luaH_setnum(L, t, lineinfo[i]), 1);
- sethvalue(L, L->top, t);
+ sethvalue(L, L->top, t);
}
incr_top(L);
}
diff --git a/engines/sword25/util/lua/ldo.cpp b/engines/sword25/util/lua/ldo.cpp
index bbcdf98b3d..49e0881a45 100644
--- a/engines/sword25/util/lua/ldo.cpp
+++ b/engines/sword25/util/lua/ldo.cpp
@@ -384,7 +384,7 @@ int luaD_poscall (lua_State *L, StkId firstResult) {
** The arguments are on the stack, right after the function.
** When returns, all the results are on the stack, starting at the original
** function position.
-*/
+*/
void luaD_call (lua_State *L, StkId func, int nResults) {
if (++L->nCcalls >= LUAI_MAXCCALLS) {
if (L->nCcalls == LUAI_MAXCCALLS)
diff --git a/engines/sword25/util/lua/lgc.cpp b/engines/sword25/util/lua/lgc.cpp
index 52ff72bdc9..71e581ad30 100644
--- a/engines/sword25/util/lua/lgc.cpp
+++ b/engines/sword25/util/lua/lgc.cpp
@@ -310,7 +310,7 @@ static l_mem propagatemark (global_State *g) {
traverseproto(g, p);
return sizeof(Proto) + sizeof(Instruction) * p->sizecode +
sizeof(Proto *) * p->sizep +
- sizeof(TValue) * p->sizek +
+ sizeof(TValue) * p->sizek +
sizeof(int) * p->sizelineinfo +
sizeof(LocVar) * p->sizelocvars +
sizeof(TString *) * p->sizeupvalues;
@@ -697,7 +697,7 @@ void luaC_linkupval (lua_State *L, UpVal *uv) {
GCObject *o = obj2gco(uv);
o->gch.next = g->rootgc; /* link upvalue into `rootgc' list */
g->rootgc = o;
- if (isgray(o)) {
+ if (isgray(o)) {
if (g->gcstate == GCSpropagate) {
gray2black(o); /* closed upvalues need barrier */
luaC_barrier(L, uv, uv->v);
diff --git a/engines/sword25/util/lua/liolib.cpp b/engines/sword25/util/lua/liolib.cpp
index b505d1e4df..6c00de5094 100644
--- a/engines/sword25/util/lua/liolib.cpp
+++ b/engines/sword25/util/lua/liolib.cpp
@@ -228,7 +228,7 @@ static int g_iofile (lua_State *L, int f, const char *mode) {
}
lua_rawseti(L, LUA_ENVIRONINDEX, f);
}
- // return current value
+ // return current value
lua_rawgeti(L, LUA_ENVIRONINDEX, f);
return 1;
}
@@ -315,7 +315,7 @@ static int read_line (lua_State *L, Sword25::Sword25FileProxy *f) {
for (;;) {
size_t l;
char *p = luaL_prepbuffer(&b);
- if (fgets(p, LUAL_BUFFERSIZE, f) == NULL) { // eof?
+ if (fgets(p, LUAL_BUFFERSIZE, f) == NULL) { // eof?
luaL_pushresult(&b); // close buffer
return (lua_objlen(L, -1) > 0); // check whether read something
}
@@ -332,19 +332,19 @@ static int read_line (lua_State *L, Sword25::Sword25FileProxy *f) {
static int read_chars (lua_State *L, Sword25::Sword25FileProxy *f, size_t n) {
- size_t rlen; // how much to read
- size_t nr; // number of chars actually read
+ size_t rlen; // how much to read
+ size_t nr; // number of chars actually read
luaL_Buffer b;
luaL_buffinit(L, &b);
- rlen = LUAL_BUFFERSIZE; // try to read that much each time
+ rlen = LUAL_BUFFERSIZE; // try to read that much each time
do {
char *p = luaL_prepbuffer(&b);
- if (rlen > n) rlen = n; // cannot read more than asked
+ if (rlen > n) rlen = n; // cannot read more than asked
nr = fread(p, sizeof(char), rlen, f);
luaL_addsize(&b, nr);
- n -= nr; // still have to read `n' chars
- } while (n > 0 && nr == rlen); // until end of count or eof
- luaL_pushresult(&b); // close buffer
+ n -= nr; // still have to read `n' chars
+ } while (n > 0 && nr == rlen); // until end of count or eof
+ luaL_pushresult(&b); // close buffer
return (n == 0 || lua_objlen(L, -1) > 0);
}
@@ -354,11 +354,11 @@ static int g_read (lua_State *L, Sword25::Sword25FileProxy *f, int first) {
int success;
int n;
clearerr(f);
- if (nargs == 0) { // no arguments?
+ if (nargs == 0) { // no arguments?
success = read_line(L, f);
- n = first+1; // to return 1 result
+ n = first+1; // to return 1 result
}
- else { // ensure stack space for all results and for auxlib's buffer
+ else { // ensure stack space for all results and for auxlib's buffer
luaL_checkstack(L, nargs+LUA_MINSTACK, "too many arguments");
success = 1;
for (n = first; nargs-- && success; n++) {
@@ -370,15 +370,15 @@ static int g_read (lua_State *L, Sword25::Sword25FileProxy *f, int first) {
const char *p = lua_tostring(L, n);
luaL_argcheck(L, p && p[0] == '*', n, "invalid option");
switch (p[1]) {
- case 'n': // number
+ case 'n': // number
success = read_number(L, f);
break;
- case 'l': // line
+ case 'l': // line
success = read_line(L, f);
break;
- case 'a': // file
- read_chars(L, f, ~((size_t)0)); // read MAX_SIZE_T chars
- success = 1; // always success
+ case 'a': // file
+ read_chars(L, f, ~((size_t)0)); // read MAX_SIZE_T chars
+ success = 1; // always success
break;
default:
return luaL_argerror(L, n, "invalid format");
@@ -389,8 +389,8 @@ static int g_read (lua_State *L, Sword25::Sword25FileProxy *f, int first) {
if (ferror(f))
return pushresult(L, 0, NULL);
if (!success) {
- lua_pop(L, 1); // remove last result
- lua_pushnil(L); // push nil instead
+ lua_pop(L, 1); // remove last result
+ lua_pushnil(L); // push nil instead
}
return n - first;
}
@@ -419,8 +419,8 @@ static int io_readline (lua_State *L) {
if (ferror(f))
return luaL_error(L, "%s", "LUA I/O error descriptions have been removed in ScummVM");
if (sucess) return 1;
- else { // EOF
- if (lua_toboolean(L, lua_upvalueindex(2))) { // generator created file?
+ else { // EOF
+ if (lua_toboolean(L, lua_upvalueindex(2))) { // generator created file?
lua_settop(L, 0);
lua_pushvalue(L, lua_upvalueindex(1));
aux_close(L); // close it
diff --git a/engines/sword25/util/lua/llimits.h b/engines/sword25/util/lua/llimits.h
index a31ad160ad..0925231350 100644
--- a/engines/sword25/util/lua/llimits.h
+++ b/engines/sword25/util/lua/llimits.h
@@ -107,7 +107,7 @@ typedef lu_int32 Instruction;
#ifndef lua_lock
-#define lua_lock(L) ((void) 0)
+#define lua_lock(L) ((void) 0)
#define lua_unlock(L) ((void) 0)
#endif
@@ -118,7 +118,7 @@ typedef lu_int32 Instruction;
/*
** macro to control inclusion of some hard tests on stack reallocation
-*/
+*/
#ifndef HARDSTACKTESTS
#define condhardstacktests(x) ((void)0)
#else
diff --git a/engines/sword25/util/lua/loadlib.cpp b/engines/sword25/util/lua/loadlib.cpp
index 9795a575f5..f4cdd70a78 100644
--- a/engines/sword25/util/lua/loadlib.cpp
+++ b/engines/sword25/util/lua/loadlib.cpp
@@ -182,7 +182,7 @@ static int ll_require (lua_State *L) {
** 'module' function
** =======================================================
*/
-
+
static void setfenv (lua_State *L) {
lua_Debug ar;
@@ -298,7 +298,7 @@ LUALIB_API int luaopen_package (lua_State *L) {
lua_setfield(L, -2, "__gc");
/* create `package' table */
luaL_register(L, LUA_LOADLIBNAME, pk_funcs);
-#if defined(LUA_COMPAT_LOADLIB)
+#if defined(LUA_COMPAT_LOADLIB)
lua_getfield(L, -1, "loadlib");
lua_setfield(L, LUA_GLOBALSINDEX, "loadlib");
#endif
diff --git a/engines/sword25/util/lua/lobject.h b/engines/sword25/util/lua/lobject.h
index 35aaed028a..5418a918b1 100644
--- a/engines/sword25/util/lua/lobject.h
+++ b/engines/sword25/util/lua/lobject.h
@@ -337,7 +337,7 @@ typedef struct Node {
typedef struct Table {
CommonHeader;
- lu_byte flags; /* 1<<p means tagmethod(p) is not present */
+ lu_byte flags; /* 1<<p means tagmethod(p) is not present */
lu_byte lsizenode; /* log2 of size of `node' array */
struct Table *metatable;
TValue *array; /* array part */
diff --git a/engines/sword25/util/lua/lopcodes.h b/engines/sword25/util/lua/lopcodes.h
index e1aed0f637..2f850c4365 100644
--- a/engines/sword25/util/lua/lopcodes.h
+++ b/engines/sword25/util/lua/lopcodes.h
@@ -186,8 +186,8 @@ OP_EQ,/* A B C if ((RK(B) == RK(C)) ~= A) then pc++ */
OP_LT,/* A B C if ((RK(B) < RK(C)) ~= A) then pc++ */
OP_LE,/* A B C if ((RK(B) <= RK(C)) ~= A) then pc++ */
-OP_TEST,/* A C if not (R(A) <=> C) then pc++ */
-OP_TESTSET,/* A B C if (R(B) <=> C) then R(A) := R(B) else pc++ */
+OP_TEST,/* A C if not (R(A) <=> C) then pc++ */
+OP_TESTSET,/* A B C if (R(B) <=> C) then R(A) := R(B) else pc++ */
OP_CALL,/* A B C R(A), ... ,R(A+C-2) := R(A)(R(A+1), ... ,R(A+B-1)) */
OP_TAILCALL,/* A B C return R(A)(R(A+1), ... ,R(A+B-1)) */
@@ -197,8 +197,8 @@ OP_FORLOOP,/* A sBx R(A)+=R(A+2);
if R(A) <?= R(A+1) then { pc+=sBx; R(A+3)=R(A) }*/
OP_FORPREP,/* A sBx R(A)-=R(A+2); pc+=sBx */
-OP_TFORLOOP,/* A C R(A+3), ... ,R(A+2+C) := R(A)(R(A+1), R(A+2));
- if R(A+3) ~= nil then R(A+2)=R(A+3) else pc++ */
+OP_TFORLOOP,/* A C R(A+3), ... ,R(A+2+C) := R(A)(R(A+1), R(A+2));
+ if R(A+3) ~= nil then R(A+2)=R(A+3) else pc++ */
OP_SETLIST,/* A B C R(A)[(C-1)*FPF+i] := R(A+i), 1 <= i <= B */
OP_CLOSE,/* A close all variables in the stack up to (>=) R(A)*/
@@ -240,7 +240,7 @@ OP_VARARG/* A B R(A), R(A+1), ..., R(A+B-1) = vararg */
** bits 4-5: B arg mode
** bit 6: instruction set register A
** bit 7: operator is a test
-*/
+*/
enum OpArgMask {
OpArgN, /* argument is not used */
diff --git a/engines/sword25/util/lua/lstate.cpp b/engines/sword25/util/lua/lstate.cpp
index 495d75c8a6..e542bcbacc 100644
--- a/engines/sword25/util/lua/lstate.cpp
+++ b/engines/sword25/util/lua/lstate.cpp
@@ -36,7 +36,7 @@ typedef struct LG {
lua_State l;
global_State g;
} LG;
-
+
static void stack_init (lua_State *L1, lua_State *L) {
diff --git a/engines/sword25/util/lua/lstrlib.cpp b/engines/sword25/util/lua/lstrlib.cpp
index e5501b9b49..2a1b8690e2 100644
--- a/engines/sword25/util/lua/lstrlib.cpp
+++ b/engines/sword25/util/lua/lstrlib.cpp
@@ -635,7 +635,7 @@ static void add_value (MatchState *ms, luaL_Buffer *b, const char *s,
lua_pushlstring(L, s, e - s); /* keep original text */
}
else if (!lua_isstring(L, -1))
- luaL_error(L, "invalid replacement value (a %s)", luaL_typename(L, -1));
+ luaL_error(L, "invalid replacement value (a %s)", luaL_typename(L, -1));
luaL_addvalue(b); /* add result to accumulator */
}
diff --git a/engines/sword25/util/lua/ltable.cpp b/engines/sword25/util/lua/ltable.cpp
index b2ec0e912a..45381fe673 100644
--- a/engines/sword25/util/lua/ltable.cpp
+++ b/engines/sword25/util/lua/ltable.cpp
@@ -48,7 +48,7 @@
#define hashpow2(t,n) (gnode(t, lmod((n), sizenode(t))))
-
+
#define hashstr(t,str) hashpow2(t, (str)->tsv.hash)
#define hashboolean(t,p) hashpow2(t, p)
@@ -303,7 +303,7 @@ static void resize (lua_State *L, Table *t, int nasize, int nhsize) {
if (nasize > oldasize) /* array part must grow? */
setarrayvector(L, t, nasize);
/* create new hash part with appropriate size */
- setnodevector(L, t, nhsize);
+ setnodevector(L, t, nhsize);
if (nasize < oldasize) { /* array part must shrink? */
t->sizearray = nasize;
/* re-insert elements from vanishing slice */
@@ -392,11 +392,11 @@ static Node *getfreepos (Table *t) {
/*
-** inserts a new key into a hash table; first, check whether key's main
-** position is free. If not, check whether colliding node is in its main
-** position or not: if it is not, move colliding node to an empty place and
-** put new key in its main position; otherwise (colliding node is in its main
-** position), new key goes to an empty position.
+** inserts a new key into a hash table; first, check whether key's main
+** position is free. If not, check whether colliding node is in its main
+** position or not: if it is not, move colliding node to an empty place and
+** put new key in its main position; otherwise (colliding node is in its main
+** position), new key goes to an empty position.
*/
static TValue *newkey (lua_State *L, Table *t, const TValue *key) {
Node *mp = mainposition(t, key);
diff --git a/engines/sword25/util/lua/lua.h b/engines/sword25/util/lua/lua.h
index 417cdadf8b..08ad80d70f 100644
--- a/engines/sword25/util/lua/lua.h
+++ b/engines/sword25/util/lua/lua.h
@@ -247,7 +247,7 @@ LUA_API void lua_setallocf (lua_State *L, lua_Alloc f, void *ud);
-/*
+/*
** ===============================================================
** some useful macros
** ===============================================================
diff --git a/engines/sword25/util/lua/lualib.h b/engines/sword25/util/lua/lualib.h
index 33d4e314c2..830f6a0894 100644
--- a/engines/sword25/util/lua/lualib.h
+++ b/engines/sword25/util/lua/lualib.h
@@ -41,7 +41,7 @@ LUALIB_API int (luaopen_package) (lua_State *L);
/* open all previous libraries */
-LUALIB_API void (luaL_openlibs) (lua_State *L);
+LUALIB_API void (luaL_openlibs) (lua_State *L);
diff --git a/engines/sword25/util/lua/lvm.cpp b/engines/sword25/util/lua/lvm.cpp
index fb700c20a2..d0f2198651 100644
--- a/engines/sword25/util/lua/lvm.cpp
+++ b/engines/sword25/util/lua/lvm.cpp
@@ -125,7 +125,7 @@ void luaV_gettable (lua_State *L, const TValue *t, TValue *key, StkId val) {
callTMres(L, val, tm, t, key);
return;
}
- t = tm; /* else repeat with `tm' */
+ t = tm; /* else repeat with `tm' */
}
luaG_runerror(L, "loop in gettable");
}
@@ -152,7 +152,7 @@ void luaV_settable (lua_State *L, const TValue *t, TValue *key, StkId val) {
callTM(L, tm, t, key, val);
return;
}
- t = tm; /* else repeat with `tm' */
+ t = tm; /* else repeat with `tm' */
}
luaG_runerror(L, "loop in settable");
}
diff --git a/engines/sword25/util/lua/scummvm_file.cpp b/engines/sword25/util/lua/scummvm_file.cpp
index 3c0377d0ee..33053a71cb 100644
--- a/engines/sword25/util/lua/scummvm_file.cpp
+++ b/engines/sword25/util/lua/scummvm_file.cpp
@@ -32,11 +32,30 @@ Sword25FileProxy::Sword25FileProxy(const Common::String &filename, const Common:
setupConfigFile();
}
+Common::String Sword25FileProxy::formatDouble(double value) {
+ // This is a bit hackish. The point of it is that it's important that
+ // we ignore the locale decimal mark and force it to be a point. If it
+ // would happen to be a comma instead, it seems that it's seen as two
+ // comma-separated integers rather than one floating-point value. Or
+ // something like that.
+
+ bool negative = value < 0.0;
+ value = fabs(value);
+ double integerPart = floor(value);
+ double fractionalPart = (value - integerPart) * 1000000.0;
+
+ Common::String out = Common::String::format("%.0f.%.0f", integerPart, fractionalPart);
+ if (negative)
+ out = "-" + out;
+
+ return out;
+}
+
void Sword25FileProxy::setupConfigFile() {
- double sfxVolume = ConfMan.hasKey("sfx_volume") ? 1.0 : 1.0 * ConfMan.getInt("sfx_volume") / 255.0;
- double musicVolume = ConfMan.hasKey("music_volume") ? 0.5 : 1.0 * ConfMan.getInt("music_volume") / 255.0;
- double speechVolume = ConfMan.hasKey("speech_volume") ? 1.0 : 1.0 * ConfMan.getInt("speech_volume") / 255.0;
- bool subtitles = ConfMan.hasKey("subtitles") ? true : ConfMan.getBool("subtitles");
+ double sfxVolume = !ConfMan.hasKey("sfx_volume") ? 1.0 : 1.0 * ConfMan.getInt("sfx_volume") / 255.0;
+ double musicVolume = !ConfMan.hasKey("music_volume") ? 0.5 : 1.0 * ConfMan.getInt("music_volume") / 255.0;
+ double speechVolume = !ConfMan.hasKey("speech_volume") ? 1.0 : 1.0 * ConfMan.getInt("speech_volume") / 255.0;
+ bool subtitles = !ConfMan.hasKey("subtitles") ? true : ConfMan.getBool("subtitles");
_readData = Common::String::format(
"GAME_LANGUAGE = \"%s\"\r\n\
@@ -45,10 +64,13 @@ MAX_MEMORY_USAGE = 256000000\r\n\
GFX_VSYNC_ACTIVE = true\r\n\
SFX_SAMPLING_RATE = 44100\r\n\
SFX_CHANNEL_COUNT = 32\r\n\
-SFX_SOUND_VOLUME = %f\r\n\
-SFX_MUSIC_VOLUME = %f\r\n\
-SFX_SPEECH_VOLUME = %f\r\n",
- getLanguage().c_str(), subtitles ? "true" : "false", sfxVolume, musicVolume, speechVolume);
+SFX_SOUND_VOLUME = %s\r\n\
+SFX_MUSIC_VOLUME = %s\r\n\
+SFX_SPEECH_VOLUME = %s\r\n",
+ getLanguage().c_str(), subtitles ? "true" : "false",
+ formatDouble(sfxVolume).c_str(),
+ formatDouble(musicVolume).c_str(),
+ formatDouble(speechVolume).c_str());
_readPos = 0;
}
@@ -76,14 +98,14 @@ size_t Sword25FileProxy::write(const char *ptr, size_t count) {
// Legitimate data
const char *p = strchr(ptr, '\n');
if (!p) p = ptr + strlen(ptr);
- while ((*p == '\r') || (*p == '\n'))
+ while ((*p == '\r') || (*p == '\n'))
++p;
_settings += Common::String(ptr, p - ptr);
ptr = p;
}
- while ((*ptr == '\r') || (*ptr == '\n'))
+ while ((*ptr == '\r') || (*ptr == '\n'))
++ptr;
}
@@ -97,7 +119,7 @@ void Sword25FileProxy::writeSettings() {
if ((*pSrc != '\r') && (*pSrc != '\n')) {
const char *p = strchr(pSrc, '=');
assert(p);
-
+
// Get the setting name
const char *pEnd = p - 1;
while (*pEnd == ' ')
@@ -110,10 +132,10 @@ void Sword25FileProxy::writeSettings() {
++pStart;
pEnd = pStart + 1;
- while ((*pEnd != '\r') && (*pEnd != '\n') && (*pEnd != '\0'))
+ while ((*pEnd != '\r') && (*pEnd != '\n') && (*pEnd != '\0'))
++pEnd;
Common::String value(pStart + (*pStart == '"' ? 1 : 0), pEnd - pStart - (*pStart == '"' ? 2 : 0));
-
+
// Update the setting
updateSetting(settingName, value);
pSrc = pEnd;
diff --git a/engines/sword25/util/lua/scummvm_file.h b/engines/sword25/util/lua/scummvm_file.h
index a4cbd2a6cf..e8c468ee07 100644
--- a/engines/sword25/util/lua/scummvm_file.h
+++ b/engines/sword25/util/lua/scummvm_file.h
@@ -37,6 +37,7 @@ private:
uint _readPos;
Common::String _settings;
+ Common::String formatDouble(double value);
void setupConfigFile();
Common::String getLanguage();
void setLanguage(const Common::String &lang);
diff --git a/engines/teenagent/animation.cpp b/engines/teenagent/animation.cpp
index af54bca6a4..e945bda1e5 100644
--- a/engines/teenagent/animation.cpp
+++ b/engines/teenagent/animation.cpp
@@ -115,7 +115,7 @@ void Animation::load(Common::SeekableReadStream *s, Type type) {
return;
}
- uint16 pos = 0;
+ //uint16 pos = 0;
int off = 0;
switch (type) {
case kTypeLan:
@@ -141,7 +141,7 @@ void Animation::load(Common::SeekableReadStream *s, Type type) {
frames = new Surface[frames_count];
s->skip(frames_count * 2 - 2); //sizes
- pos = s->readUint16LE();
+ /*pos = */s->readUint16LE();
//debug(0, "pos?: %04x", pos);
for (uint16 i = 0; i < frames_count; ++i) {
diff --git a/engines/teenagent/inventory.cpp b/engines/teenagent/inventory.cpp
index 8430f42c61..4951b2d940 100644
--- a/engines/teenagent/inventory.cpp
+++ b/engines/teenagent/inventory.cpp
@@ -58,7 +58,7 @@ Inventory::Inventory(TeenAgentEngine *engine) {
for (byte i = 0; i < offsets; ++i) {
_offset[i] = READ_LE_UINT16(_items + i * 2 + 1);
}
- _offset[92] = items_size;
+ _offset[92] = items_size;
Resources *res = Resources::instance();
for (byte i = 0; i <= 92; ++i) {
diff --git a/engines/teenagent/inventory.h b/engines/teenagent/inventory.h
index 55c58a1c22..61e5364542 100644
--- a/engines/teenagent/inventory.h
+++ b/engines/teenagent/inventory.h
@@ -75,12 +75,12 @@ private:
void backgroundEffect(Graphics::Surface *s);
void render(Inventory *inventory, uint item_id, Graphics::Surface *surface, int delta);
};
-
+
Item _graphics[24];
bool _active;
Common::Point _mouse;
-
+
bool tryObjectCallback(InventoryObject *obj);
InventoryObject *_hoveredObj;
diff --git a/engines/teenagent/resources.h b/engines/teenagent/resources.h
index c2eb32dbd4..5c08a46489 100644
--- a/engines/teenagent/resources.h
+++ b/engines/teenagent/resources.h
@@ -44,9 +44,9 @@ public:
//void loadOn(Graphics::Surface &surface, int id, uint16 &dst, uint16 *flags);
//void loadOns(Graphics::Surface &surface, int id, uint16 &dst);
- /*
- * PSP (as the other sony playstation consoles - to be confirmed and 'ifdef'ed here too)
- * is very sensitive to the number of simultaneously opened files.
+ /*
+ * PSP (as the other sony playstation consoles - to be confirmed and 'ifdef'ed here too)
+ * is very sensitive to the number of simultaneously opened files.
* This is an attempt to reduce their number to zero.
* TransientFilePack does not keep opened file descriptors and reopens it on each request.
*/
diff --git a/engines/teenagent/scene.cpp b/engines/teenagent/scene.cpp
index ef18b95f5a..4be6c9c31a 100644
--- a/engines/teenagent/scene.cpp
+++ b/engines/teenagent/scene.cpp
@@ -576,7 +576,7 @@ void Scene::paletteEffect(byte step) {
byte *src = res->dseg.ptr(0x6609);
byte *dst = palette + 3 * 0xf2;
for(byte i = 0; i < 0xd; ++i) {
- for(byte c = 0; c < 3; ++c, ++src)
+ for(byte c = 0; c < 3; ++c, ++src)
*dst++ = *src > step? *src - step: 0;
}
}
@@ -812,9 +812,9 @@ bool Scene::render(bool tick_game, bool tick_mark, uint32 delta) {
_system->unlockScreen();
continue;
}
- //removed mark == null. In final scene of chapter 2 mark rendered above table.
- //if it'd cause any bugs, add hack here. (_id != 23 && mark == NULL)
- if (on_enabled &&
+ //removed mark == null. In final scene of chapter 2 mark rendered above table.
+ //if it'd cause any bugs, add hack here. (_id != 23 && mark == NULL)
+ if (on_enabled &&
debug_features.feature[DebugFeatures::kShowOn]) {
on.render(surface, actor_animation_position);
}
diff --git a/engines/teenagent/teenagent.cpp b/engines/teenagent/teenagent.cpp
index ce8862ffd0..724f75be2f 100644
--- a/engines/teenagent/teenagent.cpp
+++ b/engines/teenagent/teenagent.cpp
@@ -206,7 +206,7 @@ void TeenAgentEngine::deinit() {
Common::Error TeenAgentEngine::loadGameState(int slot) {
debug(0, "loading from slot %d", slot);
- Common::ScopedPtr<Common::InSaveFile>
+ Common::ScopedPtr<Common::InSaveFile>
in(_saveFileMan->openForLoading(Common::String::format("teenagent.%02d", slot)));
if (!in)
in.reset(_saveFileMan->openForLoading(Common::String::format("teenagent.%d", slot)));
@@ -963,10 +963,10 @@ void TeenAgentEngine::playSoundNow(byte id) {
void TeenAgentEngine::setMusic(byte id) {
debug(0, "starting music %u", id);
Resources *res = Resources::instance();
-
+
if (id != 1) //intro music
*res->dseg.ptr(0xDB90) = id;
-
+
if (_gameDescription->flags & ADGF_CD) {
byte track2cd[] = {7, 2, 0, 9, 3, 6, 8, 10, 4, 5, 11};
if (id == 0 || id > 11 || track2cd[id - 1] == 0) {
diff --git a/engines/testbed/config-params.h b/engines/testbed/config-params.h
index e982f62c72..6906d9248e 100644
--- a/engines/testbed/config-params.h
+++ b/engines/testbed/config-params.h
@@ -34,7 +34,7 @@ class ConfigParams : public Common::Singleton<ConfigParams> {
private:
friend class Common::Singleton<SingletonBaseType>;
ConfigParams();
-
+
/**
* Private variables related to log files.
*/
@@ -57,16 +57,16 @@ private:
TestbedConfigManager *_testbedConfMan;
public:
-
+
bool isRerunRequired();
void setRerunFlag(bool flag) { _rerunTests = flag; }
bool isSessionInteractive() { return _isInteractive; }
void setSessionAsInteractive(bool status) { _isInteractive = status; }
-
+
bool isGameDataFound() { return _isGameDataFound; }
void setGameDataFound(bool status) { _isGameDataFound = status; }
-
+
TestbedConfigManager *getTestbedConfigManager() { return _testbedConfMan; }
void setTestbedConfigManager(TestbedConfigManager* confMan) { _testbedConfMan = confMan; }
@@ -74,7 +74,7 @@ public:
void setLogDirectory(const Common::String &dirname) { _logDirectory = dirname; }
Common::String &getLogFilename() { return _logFilename; }
void setLogFilename(const Common::String &filename) { _logFilename = filename; }
-
+
Common::WriteStream *getLogWriteStream() { return _ws; }
Graphics::FontManager::FontUsage getCurrentFontUsageType() { return _displayFont; }
void setCurrentFontUsageType(Graphics::FontManager::FontUsage f) { _displayFont = f; }
diff --git a/engines/tinsel/coroutine.h b/engines/tinsel/coroutine.h
index b62c40b4e5..5bcf1149d9 100644
--- a/engines/tinsel/coroutine.h
+++ b/engines/tinsel/coroutine.h
@@ -178,10 +178,15 @@ public:
#define CORO_RESCHEDULE do { g_scheduler->reschedule(); CORO_SLEEP(1); } while (0)
/**
- * Stop the currently running coroutine.
+ * Stop the currently running coroutine and all calling coroutines.
+ *
+ * This sets _sleep to -1 rather than 0 so that the context doesn't get
+ * deleted by CoroContextHolder, since we want CORO_INVOKE_ARGS to
+ * propogate the _sleep value and return immediately (the scheduler will
+ * then delete the entire coroutine's state, including all subcontexts).
*/
#define CORO_KILL_SELF() \
- do { if (&coroParam != &nullContext) { coroParam->_sleep = 0; } return; } while (0)
+ do { if (&coroParam != &nullContext) { coroParam->_sleep = -1; } return; } while (0)
/**
@@ -193,8 +198,12 @@ public:
/**
* Invoke another coroutine.
*
- * What makes this tricky is that the coroutine we called my yield/sleep,
- * and we need to deal with this adequately.
+ * If the subcontext still exists after the coroutine is invoked, it has
+ * either yielded/slept or killed itself, and so we copy the _sleep value
+ * to our own context and return (execution will continue at the case
+ * statement below, where we loop and call the coroutine again).
+ * If the subcontext is null, the coroutine ended normally, and we can
+ * simply break out of the loop and continue execution.
*
* @param subCoro name of the coroutine-enabled function to invoke
* @param ARGS list of arguments to pass to subCoro
diff --git a/engines/tinsel/detection_tables.h b/engines/tinsel/detection_tables.h
index c86db9e438..116322aa89 100644
--- a/engines/tinsel/detection_tables.h
+++ b/engines/tinsel/detection_tables.h
@@ -119,7 +119,7 @@ static const TinselGameDescription gameDescriptions[] = {
TINSEL_V1,
},
- {
+ {
{
"dw",
"Floppy",
@@ -142,7 +142,7 @@ static const TinselGameDescription gameDescriptions[] = {
TINSEL_V1,
},
- {
+ {
{
"dw",
"Floppy",
@@ -165,7 +165,7 @@ static const TinselGameDescription gameDescriptions[] = {
TINSEL_V1,
},
- {
+ {
{
"dw",
"Floppy",
diff --git a/engines/tinsel/pcode.cpp b/engines/tinsel/pcode.cpp
index 0834e7df24..2ab1e653d4 100644
--- a/engines/tinsel/pcode.cpp
+++ b/engines/tinsel/pcode.cpp
@@ -140,11 +140,11 @@ static const byte fragment7[] = {OP_IMM | OPSIZE16, FRAGMENT_WORD(908), OP_JUMP
static const byte fragment8[] = {OP_IMM | OPSIZE16, FRAGMENT_WORD(910), OP_JUMP | OPSIZE16, FRAGMENT_WORD(644)};
static const byte fragment9[] = {OP_JUMP | OPSIZE8, 123};
static const byte fragment10[] = {OP_IMM | OPSIZE16, FRAGMENT_WORD(160), OP_JUMP | OPSIZE16, FRAGMENT_WORD(136)};
-static const byte fragment11[] = {OP_JMPTRUE | OPSIZE16, FRAGMENT_WORD(1572),
+static const byte fragment11[] = {OP_JMPTRUE | OPSIZE16, FRAGMENT_WORD(1572),
OP_ONE, OP_LIBCALL | OPSIZE8, 14, // Re-show the cursor
OP_IMM | OPSIZE16, FRAGMENT_WORD(322), OP_LIBCALL | OPSIZE8, 46, // Give back the whistle
OP_JUMP | OPSIZE16, FRAGMENT_WORD(1661)};
-static const byte fragment12[] = {OP_JMPTRUE | OPSIZE16, FRAGMENT_WORD(1491),
+static const byte fragment12[] = {OP_JMPTRUE | OPSIZE16, FRAGMENT_WORD(1491),
OP_ONE, OP_LIBCALL | OPSIZE8, 14, // Re-show the cursor
OP_IMM | OPSIZE16, FRAGMENT_WORD(322), OP_LIBCALL | OPSIZE8, 46, // Give back the whistle
OP_JUMP | OPSIZE16, FRAGMENT_WORD(1568)};
@@ -208,10 +208,10 @@ const WorkaroundEntry workaroundList[] = {
// See bug report #2934211.
{TINSEL_V1, true, 352601285, 1569, sizeof(fragment11), fragment11},
{TINSEL_V1, false, 352602304, 1488, sizeof(fragment12), fragment12},
-
+
// DW2: Corrects a bug with global 306 not being cleared if you leave
// the marketplace scene whilst D'Blah is talking (even if it's not
- // actually audible); returning to the scene and clicking on him multiple
+ // actually audible); returning to the scene and clicking on him multiple
// times would cause the game to crash
{TINSEL_V2, true, 1109294728, 0, sizeof(fragment13), fragment13},
diff --git a/engines/tinsel/saveload.cpp b/engines/tinsel/saveload.cpp
index 1244168a21..7a973ba4be 100644
--- a/engines/tinsel/saveload.cpp
+++ b/engines/tinsel/saveload.cpp
@@ -483,7 +483,7 @@ static void DoSave() {
NeedLoad = true;
if (SaveSceneName == NULL) {
- // Generate a new unique save name
+ // Generate a new unique save name
int i;
int ano = 1; // Allocated number
diff --git a/engines/tinsel/sched.cpp b/engines/tinsel/sched.cpp
index b24d6bf9b8..d6cd806eb2 100644
--- a/engines/tinsel/sched.cpp
+++ b/engines/tinsel/sched.cpp
@@ -70,6 +70,7 @@ Scheduler::Scheduler() {
active = new PROCESS;
active->pPrevious = NULL;
+ active->pNext = NULL;
g_scheduler = this; // FIXME HACK
}
@@ -113,6 +114,14 @@ void Scheduler::reset() {
memset(processList, 'S', MAX_PROCESSES * sizeof(PROCESS));
}
+ // Kill all running processes (i.e. free memory allocated for their state).
+ PROCESS *pProc = active->pNext;
+ while (pProc != NULL) {
+ delete pProc->state;
+ pProc->state = 0;
+ pProc = pProc->pNext;
+ }
+
// no active processes
pCurrent = active->pNext = NULL;
diff --git a/engines/tinsel/tinlib.cpp b/engines/tinsel/tinlib.cpp
index 7613c1a897..7fbec69cbf 100644
--- a/engines/tinsel/tinlib.cpp
+++ b/engines/tinsel/tinlib.cpp
@@ -214,39 +214,39 @@ static const MASTER_LIB_CODES DW1_CODES[] = {
};
static const MASTER_LIB_CODES DW2DEMO_CODES[] = {
- ACTORBRIGHTNESS, ACTORDIRECTION, ACTORPALETTE, ACTORPRIORITY,
+ ACTORBRIGHTNESS, ACTORDIRECTION, ACTORPALETTE, ACTORPRIORITY,
ACTORREF, ACTORRGB, ACTORSCALE, ACTORXPOS, ACTORYPOS,
ADDHIGHLIGHT, ADDINV, ADDINV1, ADDINV2, ADDOPENINV, ADDTOPIC,
- BACKGROUND, CALLACTOR, CALLGLOBALPROCESS, CALLOBJECT,
+ BACKGROUND, CALLACTOR, CALLGLOBALPROCESS, CALLOBJECT,
CALLPROCESS, CALLSCENE, CALLTAG, CAMERA, CDCHANGESCENE,
CDDOCHANGE, CDLOAD, CDPLAY, CLEARHOOKSCENE, CLOSEINVENTORY,
- CONTROL, CONVERSATION, CURSOR, CURSORXPOS, CURSORYPOS,
- DECCONVW, DECCURSOR, DECFLAGS, DECINV1, DECINV2, DECINVW,
+ CONTROL, CONVERSATION, CURSOR, CURSORXPOS, CURSORYPOS,
+ DECCONVW, DECCURSOR, DECFLAGS, DECINV1, DECINV2, DECINVW,
DECLEAD, DECSCALE, DECTAGFONT, DECTALKFONT, DELTOPIC,
DIMMUSIC, DROP, DROPOUT, EFFECTACTOR, ENABLEMENU, ENDACTOR,
- ESCAPEOFF, ESCAPEON, EVENT, FACETAG, FADEIN, FADEOUT, FRAMEGRAB,
- FREEZECURSOR, GETINVLIMIT, GHOST, GLOBALVAR, HASRESTARTED,
- HAVE, HELDOBJECT, HIDEACTOR, HIDEBLOCK, HIDEEFFECT, HIDEPATH,
+ ESCAPEOFF, ESCAPEON, EVENT, FACETAG, FADEIN, FADEOUT, FRAMEGRAB,
+ FREEZECURSOR, GETINVLIMIT, GHOST, GLOBALVAR, HASRESTARTED,
+ HAVE, HELDOBJECT, HIDEACTOR, HIDEBLOCK, HIDEEFFECT, HIDEPATH,
HIDEREFER, HIDETAG, HOLD, HOOKSCENE, IDLETIME, INSTANTSCROLL,
- INVENTORY, INVPLAY, INWHICHINV, KILLACTOR, KILLGLOBALPROCESS,
- KILLPROCESS, LOCALVAR, MOVECURSOR, MOVETAG, MOVETAGTO, NEWSCENE,
- NOBLOCKING, NOPAUSE, NOSCROLL, OFFSET, OTHEROBJECT, PAUSE, PLAY,
- PLAYMUSIC, PLAYRTF, PLAYSAMPLE, POINTACTOR, POINTTAG, POSTACTOR,
+ INVENTORY, INVPLAY, INWHICHINV, KILLACTOR, KILLGLOBALPROCESS,
+ KILLPROCESS, LOCALVAR, MOVECURSOR, MOVETAG, MOVETAGTO, NEWSCENE,
+ NOBLOCKING, NOPAUSE, NOSCROLL, OFFSET, OTHEROBJECT, PAUSE, PLAY,
+ PLAYMUSIC, PLAYRTF, PLAYSAMPLE, POINTACTOR, POINTTAG, POSTACTOR,
POSTGLOBALPROCESS, POSTOBJECT, POSTPROCESS, POSTTAG, PRINT,
PRINTCURSOR, PRINTOBJ, PRINTTAG, QUITGAME, RANDOM, RESETIDLETIME,
- RESTARTGAME, RESTORESCENE, RUNMODE, SAVESCENE, SAY, SAYAT,
- SCALINGREELS, SCREENXPOS, SCREENYPOS, SCROLL, SCROLLPARAMETERS,
+ RESTARTGAME, RESTORESCENE, RUNMODE, SAVESCENE, SAY, SAYAT,
+ SCALINGREELS, SCREENXPOS, SCREENYPOS, SCROLL, SCROLLPARAMETERS,
SENDACTOR, SENDGLOBALPROCESS, SENDOBJECT, SENDPROCESS, SENDTAG,
- SETBRIGHTNESS, SETINVLIMIT, SETINVSIZE, SETLANGUAGE, SETPALETTE,
- SETSYSTEMSTRING, SETSYSTEMVAR, SHELL, SHOWACTOR, SHOWBLOCK,
+ SETBRIGHTNESS, SETINVLIMIT, SETINVSIZE, SETLANGUAGE, SETPALETTE,
+ SETSYSTEMSTRING, SETSYSTEMVAR, SHELL, SHOWACTOR, SHOWBLOCK,
SHOWEFFECT, SHOWPATH, SHOWREFER, SHOWTAG, STAND, STANDTAG,
- STARTGLOBALPROCESS, STARTPROCESS, STARTTIMER, STOPWALK, SUBTITLES,
- SWALK, SYSTEMVAR, TAGTAGXPOS, TAGTAGYPOS, TAGWALKXPOS, TAGWALKYPOS,
+ STARTGLOBALPROCESS, STARTPROCESS, STARTTIMER, STOPWALK, SUBTITLES,
+ SWALK, SYSTEMVAR, TAGTAGXPOS, TAGTAGYPOS, TAGWALKXPOS, TAGWALKYPOS,
TALK, TALKAT, TALKPALETTEINDEX, TALKRGB, TALKVIA, THISOBJECT,
- THISTAG, TIMER, TOPIC, TOPPLAY, TOPWINDOW, TRANSLUCENTINDEX,
- UNDIMMUSIC, UNHOOKSCENE, WAITFRAME, WAITKEY, WAITSCROLL, WAITTIME,
- WALK, WALKED, WALKEDPOLY, WALKEDTAG, WALKINGACTOR, WALKPOLY,
- WALKTAG, WALKXPOS, WALKYPOS, WHICHCD, WHICHINVENTORY,
+ THISTAG, TIMER, TOPIC, TOPPLAY, TOPWINDOW, TRANSLUCENTINDEX,
+ UNDIMMUSIC, UNHOOKSCENE, WAITFRAME, WAITKEY, WAITSCROLL, WAITTIME,
+ WALK, WALKED, WALKEDPOLY, WALKEDTAG, WALKINGACTOR, WALKPOLY,
+ WALKTAG, WALKXPOS, WALKYPOS, WHICHCD, WHICHINVENTORY,
HIGHEST_LIBCODE
};
diff --git a/engines/toon/path.cpp b/engines/toon/path.cpp
index c116d63663..dde7be07d0 100644
--- a/engines/toon/path.cpp
+++ b/engines/toon/path.cpp
@@ -406,8 +406,8 @@ void PathFinding::init(Picture *mask) {
_height = mask->getHeight();
_currentMask = mask;
_heap->unload();
- // In order to reduce memory fragmentation on small devices, we use the maximum
- // possible size here which is TOON_BACKBUFFER_WIDTH. Even though this is
+ // In order to reduce memory fragmentation on small devices, we use the maximum
+ // possible size here which is TOON_BACKBUFFER_WIDTH. Even though this is
// 1280 as opposed to the possible 640, it actually helps memory allocation on
// those devices.
_heap->init(TOON_BACKBUFFER_WIDTH * _height); // should really be _width
diff --git a/engines/toon/tools.cpp b/engines/toon/tools.cpp
index c9aa470deb..c2ee8acf8a 100644
--- a/engines/toon/tools.cpp
+++ b/engines/toon/tools.cpp
@@ -372,7 +372,7 @@ int32 RncDecoder::unpackM1(const void *input, uint16 inputSize, void *output) {
_dstPtr += inputLength;
_srcPtr += inputLength;
_inputByteLeft -= inputLength;
- uint16 a;
+ uint16 a;
if (_inputByteLeft <= 0)
a = 0;
else if (_inputByteLeft == 1)
diff --git a/engines/toon/toon.cpp b/engines/toon/toon.cpp
index 0e0978b3d6..cb41db1967 100644
--- a/engines/toon/toon.cpp
+++ b/engines/toon/toon.cpp
@@ -114,7 +114,7 @@ void ToonEngine::init() {
_drew = _characters[0];
_flux = _characters[1];
-
+
// preload walk anim for flux and drew
_drew->loadWalkAnimation("STNDWALK.CAF");
diff --git a/engines/toon/toon.h b/engines/toon/toon.h
index 65c6ba0234..cad684d590 100644
--- a/engines/toon/toon.h
+++ b/engines/toon/toon.h
@@ -204,7 +204,7 @@ public:
void viewInventoryItem(Common::String str, int32 lineId, int32 itemDest);
void storePalette();
void restorePalette();
- const char *getSpecialConversationMusic(int32 locationId);
+ const char *getSpecialConversationMusic(int32 locationId);
void playRoomMusic();
void waitForScriptStep();
void doMagnifierEffect();
@@ -320,7 +320,7 @@ public:
}
Common::Error saveGameState(int slot, const Common::String &desc) {
-
+
return (saveGame(slot, desc) ? Common::kWritingFailed : Common::kNoError);
}
@@ -381,7 +381,7 @@ protected:
Common::Array<Common::Rect> _oldDirtyRects;
bool _dirtyAll;
-
+
AnimationInstance *_cursorAnimationInstance;
Animation *_cursorAnimation;
diff --git a/engines/tsage/blueforce_logic.cpp b/engines/tsage/blueforce_logic.cpp
index 9813bef6f7..d266d5e1d9 100644
--- a/engines/tsage/blueforce_logic.cpp
+++ b/engines/tsage/blueforce_logic.cpp
@@ -30,7 +30,7 @@ namespace tSage {
void BlueForceGame::start() {
// Start the game
_globals->_sceneManager.changeScene(20);
-
+
_globals->_events.setCursor(CURSOR_WALK);
}
diff --git a/engines/tsage/converse.cpp b/engines/tsage/converse.cpp
index 5fa36142e7..b475310533 100644
--- a/engines/tsage/converse.cpp
+++ b/engines/tsage/converse.cpp
@@ -231,7 +231,7 @@ void SequenceManager::signal() {
case 26:
v1 = getNextValue();
v2 = getNextValue();
- _soundHandler.startSound(v1, v2 ? this : NULL, 127);
+ _soundHandler.play(v1, v2 ? this : NULL, 127);
break;
case 27: {
v1 = getNextValue();
diff --git a/engines/tsage/converse.h b/engines/tsage/converse.h
index 6876fa41cb..13c490e995 100644
--- a/engines/tsage/converse.h
+++ b/engines/tsage/converse.h
@@ -25,6 +25,7 @@
#include "tsage/core.h"
#include "tsage/dialogs.h"
+#include "tsage/sound.h"
namespace tSage {
@@ -50,7 +51,7 @@ public:
int _objectIndex;
SceneObject *_sceneObject;
SceneObject *_objectList[6];
- SoundHandler _soundHandler;
+ ASound _soundHandler;
public:
SequenceManager();
diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp
index ed2b03ebc4..76714a6f10 100644
--- a/engines/tsage/core.cpp
+++ b/engines/tsage/core.cpp
@@ -31,6 +31,7 @@
#include "tsage/scenes.h"
#include "tsage/staticres.h"
#include "tsage/globals.h"
+#include "tsage/sound.h"
namespace tSage {
@@ -2868,8 +2869,6 @@ void Region::draw() {
}
void Region::uniteLine(int yp, LineSliceSet &sliceSet) {
- // TODO: More properly implement like the original
-
// First expand the bounds as necessary to fit in the row
if (_ySlices.empty()) {
_bounds = Rect(sliceSet.items[0].xs, yp, sliceSet.items[sliceSet.items.size() - 1].xe, yp + 1);
@@ -2961,55 +2960,6 @@ int SceneRegions::indexOf(const Common::Point &pt) {
/*--------------------------------------------------------------------------*/
-SoundHandler::SoundHandler() {
- _action = NULL;
- _field280 = -1;
- if (_globals)
- _globals->_sceneListeners.push_back(this);
-}
-
-SoundHandler::~SoundHandler() {
- if (_globals)
- _globals->_sceneListeners.remove(this);
-}
-
-void SoundHandler::dispatch() {
- EventHandler::dispatch();
- int v = _sound.proc12();
-
- if (v != -1) {
- _field280 = v;
- _sound.proc2(-1);
-
- if (_action)
- _action->signal();
- }
-
- if (_field280 != -1) {
- // FIXME: Hardcoded to only flag a sound ended if an action has been set
- if (_action) {
-// if (!_sound.proc3()) {
- _field280 = -1;
- if (_action) {
- _action->signal();
- _action = NULL;
- }
- }
- }
-}
-
-void SoundHandler::startSound(int soundNum, Action *action, int volume) {
- _action = action;
- _field280 = 0;
- setVolume(volume);
- _sound.startSound(soundNum);
-
- warning("TODO: SoundHandler::startSound");
-}
-
-
-/*--------------------------------------------------------------------------*/
-
void SceneItemList::addItems(SceneItem *first, ...) {
va_list va;
va_start(va, first);
@@ -3072,13 +3022,12 @@ void WalkRegion::loadProcessList(byte *dataP, int dataSize, int &dataIndex, int
int yp = READ_LE_UINT16(dataP + idx * 4 + 2);
if (yp != y1) {
/*
- * Commented out: doesn't seem to be used
+ * Commented out: v doesn't seem to be used
int v;
if (idx == (dataSize - 1))
v = READ_LE_UINT16(dataP + 2);
else
v = process1(idx, dataP, dataSize);
- warning("TODO: v not used? - %d", v);
*/
process2(dataIndex, x1, y1, xp, yp);
++dataIndex;
@@ -3490,8 +3439,9 @@ void SceneHandler::postInit(SceneObjectList *OwnerList) {
_globals->_scenePalette.loadPalette(0);
_globals->_scenePalette.refresh();
- // TODO: Bunch of other scene related setup goes here
_globals->_soundManager.postInit();
+ _globals->_soundManager.buildDriverList(true);
+ _globals->_soundManager.installConfigDrivers();
_globals->_game->start();
}
@@ -3594,9 +3544,10 @@ void SceneHandler::dispatch() {
if (_globals->_sceneManager._scene)
_globals->_sceneManager._scene->dispatch();
- //TODO: Figure out purpose of the given list
- //_globals->_regions.forEach(SceneHandler::handleListener);
+ // Not actually used
+ //_eventListeners.forEach(SceneHandler::handleListener);
+ // Handle pending eents
Event event;
while (_globals->_events.getEvent(event))
process(event);
@@ -3620,7 +3571,6 @@ void SceneHandler::dispatchObject(EventHandler *obj) {
}
void SceneHandler::saveListener(Serializer &ser) {
- warning("TODO: SceneHandler::saveListener");
}
} // End of namespace tSage
diff --git a/engines/tsage/core.h b/engines/tsage/core.h
index 92907addbc..b86e2f63fe 100644
--- a/engines/tsage/core.h
+++ b/engines/tsage/core.h
@@ -33,7 +33,6 @@
#include "tsage/graphics.h"
#include "tsage/resources.h"
#include "tsage/saveload.h"
-#include "tsage/sound.h"
namespace tSage {
@@ -719,74 +718,6 @@ public:
/*--------------------------------------------------------------------------*/
-class GameSoundHandler {
-public:
- void proc1() {
- warning("TODO: GameSoundHandler::proc1");
- }
- void proc5(int v) {
- warning("TODO: GameSoundHandler::proc5");
- }
- void proc11(int v1, int v2, int v3, int v4) {
- warning("TODO: GameSoundHandler::proc11");
- }
- int proc12() {
- // TODO
- return -1;
- }
- void proc2(int v) {
- // TODO
- }
- int proc3() {
- return 0;
- }
- void setVolume(int volume) {
- warning("TODO GameSoundHandler::setVolume");
- }
- void startSound(int soundNum) {
- warning("TODO GameSoundHandler::startSound");
- }
-};
-
-class SoundHandler : public EventHandler {
-public:
- GameSoundHandler _sound;
- Action *_action;
- int _field280;
-public:
- SoundHandler();
- ~SoundHandler();
-
- void startSound(int soundNum, Action *action = NULL, int volume = 127);
- void proc1(Action *action) {
- proc11(0, 5, 10, 1, action);
- }
- void proc2(int v) {
- warning("TODO: SoundHandler::proc2");
- }
- void proc3() {
- warning("TODO: SoundHandler::proc5");
- }
- void proc4() {
- _sound.proc1();
- }
- void proc5(int v) {
- _sound.proc5(v);
- }
- void proc11(int v1, int v2, int v3, int v4, Action *action) {
- if (action)
- _action = action;
-
- _sound.proc11(v1, v2, v3, v4);
- }
- void setVolume(int volume) { _sound.setVolume(volume); }
-
- virtual Common::String getClassName() { return "SoundHandler"; }
- virtual void dispatch();
-};
-
-/*--------------------------------------------------------------------------*/
-
class SceneItemList : public SynchronizedList<SceneItem *> {
public:
void addItems(SceneItem *first, ...);
diff --git a/engines/tsage/debugger.cpp b/engines/tsage/debugger.cpp
index 5288c98b72..9277fd429a 100644
--- a/engines/tsage/debugger.cpp
+++ b/engines/tsage/debugger.cpp
@@ -63,7 +63,7 @@ bool Debugger::Cmd_Scene(int argc, const char **argv) {
if (argc < 2) {
DebugPrintf("Usage: %s <scene number> [prior scene #]\n", argv[0]);
return true;
- }
+ }
if (argc == 3)
_globals->_sceneManager._sceneNumber = strToInt(argv[2]);
@@ -222,7 +222,7 @@ bool Debugger::Cmd_ListObjects(int argc, const char **argv) {
DebugPrintf("Usage: %s\n", argv[0]);
return true;
}
-
+
DebugPrintf("Available objects for this game are:\n");
DebugPrintf("0 - Stunner\n");
DebugPrintf("1 - Scanner\n");
@@ -393,7 +393,7 @@ bool Debugger::Cmd_Hotspots(int argc, const char **argv) {
// Lock the background surface for access
Graphics::Surface destSurface = _globals->_sceneManager._scene->_backSurface.lockSurface();
-
+
// Iterate through the scene items
SynchronizedList<SceneItem *>::iterator i;
for (i = _globals->_sceneItems.reverse_begin(); i != _globals->_sceneItems.end(); --i, ++colIndex) {
@@ -418,7 +418,7 @@ bool Debugger::Cmd_Hotspots(int argc, const char **argv) {
LineSliceSet set = r.getLineSlices(y);
for (uint p = 0; p < set.items.size(); ++p)
- destSurface.hLine(set.items[p].xs - sceneBounds.left, y - sceneBounds.top,
+ destSurface.hLine(set.items[p].xs - sceneBounds.left, y - sceneBounds.top,
set.items[p].xe - sceneBounds.left - 1, colIndex);
}
}
diff --git a/engines/tsage/detection_tables.h b/engines/tsage/detection_tables.h
index 4cd74ff13d..8b80edf89d 100644
--- a/engines/tsage/detection_tables.h
+++ b/engines/tsage/detection_tables.h
@@ -32,8 +32,8 @@ static const tSageGameDescription gameDescriptions[] = {
AD_ENTRY1s("ring.rlb", "466f0e6492d9d0f34d35c5cd088de90f", 37847618),
Common::EN_ANY,
Common::kPlatformPC,
- ADGF_NO_FLAGS,
- Common::GUIO_NONE
+ ADGF_UNSTABLE,
+ Common::GUIO_NOSPEECH | Common::GUIO_NOSFX
},
GType_Ringworld,
GF_CD | GF_ALT_REGIONS
@@ -46,8 +46,8 @@ static const tSageGameDescription gameDescriptions[] = {
AD_ENTRY1s("ring.rlb", "7b7f0c5b37b58fa5ec06ebb2ca0d0d9d", 8438770),
Common::EN_ANY,
Common::kPlatformPC,
- ADGF_NO_FLAGS,
- Common::GUIO_NONE
+ ADGF_UNSTABLE,
+ Common::GUIO_NOSPEECH | Common::GUIO_NOSFX
},
GType_Ringworld,
GF_FLOPPY
@@ -61,7 +61,7 @@ static const tSageGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformPC,
ADGF_DEMO,
- Common::GUIO_NONE
+ Common::GUIO_NOSPEECH | Common::GUIO_NOSFX
},
GType_Ringworld,
GF_FLOPPY | GF_DEMO
@@ -76,7 +76,7 @@ static const tSageGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformPC,
ADGF_DEMO,
- Common::GUIO_NONE
+ Common::GUIO_NOSPEECH | Common::GUIO_NOSFX
},
GType_Ringworld,
GF_FLOPPY | GF_DEMO | GF_ALT_REGIONS
@@ -91,8 +91,8 @@ static const tSageGameDescription gameDescriptions[] = {
AD_ENTRY1s("blue.rlb", "17c3993415e8a2cf93040eef7e88ec93", 1156508),
Common::EN_ANY,
Common::kPlatformPC,
- ADGF_NO_FLAGS,
- Common::GUIO_NONE
+ ADGF_UNSTABLE,
+ Common::GUIO_NOSPEECH | Common::GUIO_NOSFX
},
GType_BlueForce,
GF_FLOPPY
@@ -107,7 +107,7 @@ static const tSageGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformPC,
ADGF_NO_FLAGS,
- Common::GUIO_NONE
+ Common::GUIO_NOSPEECH | Common::GUIO_NOSFX
},
GType_BlueForce,
GF_FLOPPY
@@ -121,7 +121,7 @@ static const tSageGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformPC,
ADGF_NO_FLAGS,
- Common::GUIO_NONE
+ Common::GUIO_NOSPEECH | Common::GUIO_NOSFX
},
GType_BlueForce,
GF_CD
diff --git a/engines/tsage/dialogs.cpp b/engines/tsage/dialogs.cpp
index c1bd1d027f..86fbbc8e43 100644
--- a/engines/tsage/dialogs.cpp
+++ b/engines/tsage/dialogs.cpp
@@ -43,7 +43,7 @@ MessageDialog::MessageDialog(const Common::String &message, const Common::String
const Common::String &btn2Message) : GfxDialog() {
// Set up the message
addElements(&_msg, &_btn1, NULL);
-
+
_msg.set(message, 200, ALIGN_LEFT);
_msg._bounds.moveTo(0, 0);
_defaultButton = &_btn1;
diff --git a/engines/tsage/events.cpp b/engines/tsage/events.cpp
index 9df2a7ccd6..a24f65421b 100644
--- a/engines/tsage/events.cpp
+++ b/engines/tsage/events.cpp
@@ -48,6 +48,7 @@ bool EventsClass::pollEvent() {
_priorFrameTime = milli;
++_frameNumber;
+ // Update screen
g_system->updateScreen();
}
@@ -280,7 +281,7 @@ void EventsClass::hideCursor() {
setCursor(CURSOR_NONE);
}
-bool EventsClass::isCursorVisible() const {
+bool EventsClass::isCursorVisible() const {
return !_globals->getFlag(122);
}
@@ -307,7 +308,7 @@ void EventsClass::delay(int numFrames) {
void EventsClass::listenerSynchronize(Serializer &s) {
s.syncAsUint32LE(_frameNumber);
s.syncAsUint32LE(_prevDelayFrame);
-
+
if (s.getVersion() >= 5) {
s.syncAsSint16LE(_currentCursor);
s.syncAsSint16LE(_lastCursor);
diff --git a/engines/tsage/globals.cpp b/engines/tsage/globals.cpp
index 863f1458b1..34b26ec311 100644
--- a/engines/tsage/globals.cpp
+++ b/engines/tsage/globals.cpp
@@ -94,8 +94,8 @@ Globals::Globals() : _dialogCenter(160, 140), _gfxManagerInstance(_screenSurface
_sceneObjects_queue.push_front(_sceneObjects);
_prevSceneOffset = Common::Point(-1, -1);
- _sceneListeners.push_back(&_soundHandler);
- _sceneListeners.push_back(&_sequenceManager._soundHandler);
+ _sounds.push_back(&_soundHandler);
+ _sounds.push_back(&_sequenceManager._soundHandler);
_scrollFollower = NULL;
_inventory = NULL;
@@ -117,9 +117,9 @@ Globals::Globals() : _dialogCenter(160, 140), _gfxManagerInstance(_screenSurface
}
Globals::~Globals() {
- _globals = NULL;
delete _inventory;
delete _game;
+ _globals = NULL;
}
void Globals::reset() {
@@ -140,7 +140,7 @@ void Globals::synchronize(Serializer &s) {
s.syncAsSint32LE(_gfxColors.foreground);
s.syncAsSint32LE(_fontColors.background);
s.syncAsSint32LE(_fontColors.foreground);
-
+
if (s.getVersion() >= 4) {
s.syncAsByte(_unkColor1);
s.syncAsByte(_unkColor2);
@@ -148,7 +148,7 @@ void Globals::synchronize(Serializer &s) {
}
s.syncAsSint16LE(_dialogCenter.x); s.syncAsSint16LE(_dialogCenter.y);
- _sceneListeners.synchronize(s);
+ _sounds.synchronize(s);
for (int i = 0; i < 256; ++i)
s.syncAsByte(_flags[i]);
@@ -158,4 +158,13 @@ void Globals::synchronize(Serializer &s) {
s.syncAsSint32LE(_stripNum);
}
+void Globals::dispatchSound(ASound *obj) {
+ obj->dispatch();
+}
+
+void Globals::dispatchSounds() {
+ Common::for_each(_sounds.begin(), _sounds.end(), Globals::dispatchSound);
+}
+
+
} // end of namespace tSage
diff --git a/engines/tsage/globals.h b/engines/tsage/globals.h
index 8212387ed1..7cfec718e2 100644
--- a/engines/tsage/globals.h
+++ b/engines/tsage/globals.h
@@ -28,11 +28,14 @@
#include "tsage/dialogs.h"
#include "tsage/scenes.h"
#include "tsage/events.h"
+#include "tsage/sound.h"
#include "tsage/saveload.h"
namespace tSage {
class Globals : public SavedObject {
+private:
+ static void dispatchSound(ASound *obj);
public:
GfxSurface _screenSurface;
GfxManager _gfxManagerInstance;
@@ -55,10 +58,10 @@ public:
SoundManager _soundManager;
Common::Point _dialogCenter;
WalkRegions _walkRegions;
- SynchronizedList<EventHandler *> _sceneListeners;
+ SynchronizedList<ASound *> _sounds;
bool _flags[256];
Player _player;
- SoundHandler _soundHandler;
+ ASound _soundHandler;
InvObjectList *_inventory;
Region _paneRegions[2];
int _paneRefreshFlag[2];
@@ -90,6 +93,7 @@ public:
GfxManager &gfxManager() { return **_gfxManagers.begin(); }
virtual Common::String getClassName() { return "Globals"; }
virtual void synchronize(Serializer &s);
+ void dispatchSounds();
};
extern Globals *_globals;
diff --git a/engines/tsage/graphics.cpp b/engines/tsage/graphics.cpp
index 25dc897ecd..1d432724dc 100644
--- a/engines/tsage/graphics.cpp
+++ b/engines/tsage/graphics.cpp
@@ -846,7 +846,7 @@ void GfxButton::setDefaults() {
gfxManager._font.getStringBounds(_message.c_str(), tempRect, 240);
tempRect.right = ((tempRect.right + 15) / 16) * 16;
- // Set the button bounds
+ // Set the button bounds
tempRect.collapse(-_globals->_gfxEdgeAdjust, -_globals->_gfxEdgeAdjust);
if (_vm->getFeatures() & GF_CD)
--tempRect.top;
@@ -866,7 +866,7 @@ void GfxButton::draw() {
// Set the font and color
gfxManager._font.setFontNumber(_fontNumber);
- //
+ //
gfxManager._font._colors.foreground = this->_unkColor1;
gfxManager._font._colors2.background = this->_unkColor2;
gfxManager._font._colors2.foreground = this->_unkColor3;
@@ -895,7 +895,7 @@ bool GfxButton::process(Event &event) {
case EVENT_KEYPRESS:
if (!event.handled && (event.kbd.keycode == _keycode)) {
- // TODO: Ensure momentary click operation displays
+ // Highlight the button momentarily
highlight();
g_system->delayMillis(20);
highlight();
diff --git a/engines/tsage/resources.cpp b/engines/tsage/resources.cpp
index 676d319ba9..d24c564a1f 100644
--- a/engines/tsage/resources.cpp
+++ b/engines/tsage/resources.cpp
@@ -66,7 +66,9 @@ uint16 MemoryManager::allocate(uint32 size) {
byte *MemoryManager::allocate2(uint32 size) {
uint32 idx = allocate(size);
- return lock(idx);
+ byte *result = lock(idx);
+ Common::set_to(result, result + size, 0);
+ return result;
}
byte *MemoryManager::lock(uint32 handle) {
diff --git a/engines/tsage/ringworld_demo.cpp b/engines/tsage/ringworld_demo.cpp
index de8dbf8c12..b24fec98f9 100644
--- a/engines/tsage/ringworld_demo.cpp
+++ b/engines/tsage/ringworld_demo.cpp
@@ -30,7 +30,7 @@ namespace tSage {
void RingworldDemoGame::start() {
// Start the demo's single scene
_globals->_sceneManager.changeScene(1);
-
+
_globals->_events.setCursor(CURSOR_NONE);
}
@@ -72,6 +72,7 @@ void RingworldDemoGame::processEvent(Event &event) {
ConfigDialog *dlg = new ConfigDialog();
dlg->runModal();
delete dlg;
+ _globals->_soundManager.syncSounds();
_globals->_events.setCursorFromFlag();
break;
}
@@ -101,19 +102,19 @@ void RingworldDemoScene::postInit(SceneObjectList *OwnerList) {
}
void RingworldDemoScene::signal() {
- _soundHandler.startSound(4);
+ _soundHandler.play(4);
_actor1.postInit();
_actor2.postInit();
_actor3.postInit();
_actor4.postInit();
_actor5.postInit();
_actor6.postInit();
-
+
setAction(&_sequenceManager, this, 22, &_actor1, &_actor2, &_actor3, &_actor4, &_actor5, &_actor6, NULL);
}
void RingworldDemoScene::process(Event &event) {
-
+
}
} // End of namespace tSage
diff --git a/engines/tsage/ringworld_demo.h b/engines/tsage/ringworld_demo.h
index 7492c1e871..3e7431e107 100644
--- a/engines/tsage/ringworld_demo.h
+++ b/engines/tsage/ringworld_demo.h
@@ -28,6 +28,7 @@
#include "tsage/core.h"
#include "tsage/scenes.h"
#include "tsage/globals.h"
+#include "tsage/sound.h"
namespace tSage {
@@ -46,7 +47,7 @@ public:
SequenceManager _sequenceManager;
SceneObject _actor1, _actor2, _actor3;
SceneObject _actor4, _actor5, _actor6;
- SoundHandler _soundHandler;
+ ASound _soundHandler;
virtual void postInit(SceneObjectList *OwnerList = NULL);
virtual void process(Event &event);
diff --git a/engines/tsage/ringworld_logic.cpp b/engines/tsage/ringworld_logic.cpp
index 95c9da9fe7..58501172af 100644
--- a/engines/tsage/ringworld_logic.cpp
+++ b/engines/tsage/ringworld_logic.cpp
@@ -268,7 +268,7 @@ void SceneArea::setup(int resNum, int rlbNum, int subNum, int actionId) {
}
void SceneArea::draw2() {
- _surface.draw(Common::Point(_bounds.left, _bounds.top));
+ _surface.draw(Common::Point(_bounds.left, _bounds.top));
}
void SceneArea::display() {
@@ -619,7 +619,7 @@ void SpeakerSKL::setText(const Common::String &msg) {
_object1._frame = 1;
_object1.setPosition(Common::Point(203, 120));
_object1.animate(ANIM_MODE_7, 0, NULL);
-
+
_object2.postInit(&_objectList);
_object2.setVisage(7013);
_object2.setStrip2(1);
@@ -651,7 +651,7 @@ void SpeakerQL::setText(const Common::String &msg) {
_object1._frame = 1;
_object1.setPosition(Common::Point(128, 146));
_object1.animate(ANIM_MODE_7, 0, NULL);
-
+
_object2.postInit(&_objectList);
_object2.setVisage(2612);
_object2.setStrip2(1);
@@ -667,7 +667,6 @@ void SpeakerQL::setText(const Common::String &msg) {
/*--------------------------------------------------------------------------*/
SpeakerSR::SpeakerSR() {
- // TODO: check initialization of object3
_speakerName = "SR";
_newSceneNumber = 2811;
_textPos = Common::Point(10, 30);
@@ -684,7 +683,7 @@ void SpeakerSR::setText(const Common::String &msg) {
_object1._frame = 1;
_object1.setPosition(Common::Point(224, 198));
_object1.animate(ANIM_MODE_7, 0, NULL);
-
+
_object2.postInit(&_objectList);
_object2.setVisage(2813);
_object2.setStrip2(1);
@@ -725,7 +724,7 @@ void SpeakerSL::setText(const Common::String &msg) {
_object1._frame = 1;
_object1.setPosition(Common::Point(95, 198));
_object1.animate(ANIM_MODE_7, 0, NULL);
-
+
_object2.postInit(&_objectList);
_object2.setVisage(2812);
_object2.setStrip2(1);
@@ -757,7 +756,7 @@ void SpeakerQR::setText(const Common::String &msg) {
_object1._frame = 1;
_object1.setPosition(Common::Point(191, 146));
_object1.animate(ANIM_MODE_7, 0, NULL);
-
+
_object2.postInit(&_objectList);
_object2.setVisage(2613);
_object2.setStrip2(1);
@@ -789,7 +788,7 @@ void SpeakerQU::setText(const Common::String &msg) {
_object1._frame = 1;
_object1.setPosition(Common::Point(116, 120));
_object1.animate(ANIM_MODE_7, 0, NULL);
-
+
_object2.postInit(&_objectList);
_object2.setVisage(7021);
_object2.setStrip2(1);
@@ -818,7 +817,7 @@ void SpeakerCR::setText(const Common::String &msg) {
_object1.fixPriority(255);
_object1.setPosition(Common::Point(219, 168));
_object1.animate(ANIM_MODE_7, 0, NULL);
-
+
_object2.postInit(&_objectList);
_object2.setVisage(9011);
_object2.setStrip2(1);
@@ -847,7 +846,7 @@ void SpeakerMR::setText(const Common::String &msg) {
_object1._frame = 1;
_object1.setPosition(Common::Point(220, 143));
_object1.animate(ANIM_MODE_7, 0, NULL);
-
+
_object2.postInit(&_objectList);
_object2.setVisage(2713);
_object2.setStrip2(1);
@@ -879,7 +878,7 @@ void SpeakerSAL::setText(const Common::String &msg) {
_object1._frame = 1;
_object1.setPosition(Common::Point(185, 200));
_object1.animate(ANIM_MODE_7, 0, NULL);
-
+
_object2.postInit(&_objectList);
_object2.setVisage(2853);
_object2.setStrip2(1);
@@ -910,7 +909,7 @@ void SpeakerML::setText(const Common::String &msg) {
_object1._frame = 1;
_object1.setPosition(Common::Point(99, 143));
_object1.animate(ANIM_MODE_7, 0, NULL);
-
+
_object2.postInit(&_objectList);
_object2.setVisage(2712);
_object2.setStrip2(1);
@@ -941,7 +940,7 @@ void SpeakerCHFL::setText(const Common::String &msg) {
_object1._frame = 1;
_object1.setPosition(Common::Point(205, 116));
_object1.animate(ANIM_MODE_7, 0, NULL);
-
+
_object2.postInit(&_objectList);
_object2.setVisage(4113);
_object2.setStrip2(1);
@@ -972,7 +971,7 @@ void SpeakerCHFR::setText(const Common::String &msg) {
_object1._frame = 1;
_object1.setPosition(Common::Point(103, 116));
_object1.animate(ANIM_MODE_7, 0, NULL);
-
+
_object2.postInit(&_objectList);
_object2.setVisage(4112);
_object2.setStrip2(1);
@@ -1003,7 +1002,7 @@ void SpeakerPL::setText(const Common::String &msg) {
_object1._frame = 1;
_object1.setPosition(Common::Point(107, 117));
_object1.animate(ANIM_MODE_7, 0, NULL);
-
+
_object2.postInit(&_objectList);
_object2.setVisage(4062);
_object2.setStrip2(1);
@@ -1048,7 +1047,7 @@ void SpeakerPR::setText(const Common::String &msg) {
_object1._frame = 1;
_object1.setPosition(Common::Point(212, 117));
_object1.animate(ANIM_MODE_7, 0, NULL);
-
+
_object2.postInit(&_objectList);
_object2.setVisage(4063);
_object2.setStrip2(2);
@@ -1093,7 +1092,7 @@ void SpeakerCDR::setText(const Common::String &msg) {
_object1._frame = 1;
_object1.setPosition(Common::Point(208, 97));
_object1.animate(ANIM_MODE_7, 0, NULL);
-
+
_object2.postInit(&_objectList);
_object2.setVisage(4163);
_object2.setStrip2(2);
@@ -1124,7 +1123,7 @@ void SpeakerCDL::setText(const Common::String &msg) {
_object1._frame = 1;
_object1.setPosition(Common::Point(112, 97));
_object1.animate(ANIM_MODE_7, 0, NULL);
-
+
_object2.postInit(&_objectList);
_object2.setVisage(4162);
_object2.setStrip2(2);
@@ -1155,7 +1154,7 @@ void SpeakerFLL::setText(const Common::String &msg) {
_object1._frame = 1;
_object1.setPosition(Common::Point(216, 129));
_object1.animate(ANIM_MODE_7, 0, NULL);
-
+
_object2.postInit(&_objectList);
_object2.setVisage(5223);
_object2.setStrip2(1);
@@ -1186,7 +1185,7 @@ void SpeakerBatR::setText(const Common::String &msg) {
_object1._frame = 1;
_object1.setPosition(Common::Point(137, 122));
_object1.animate(ANIM_MODE_7, 0, NULL);
-
+
_object2.postInit(&_objectList);
_object2.setVisage(5361);
_object2.setStrip2(1);
@@ -1334,9 +1333,20 @@ void RingworldGame::start() {
RING_INVENTORY._scanner._sceneNumber = 1;
RING_INVENTORY._ring._sceneNumber = 1;
+ int slot = -1;
+
+ if (ConfMan.hasKey("save_slot")) {
+ slot = ConfMan.getInt("save_slot");
+ Common::String file = _vm->generateSaveName(slot);
+ Common::InSaveFile *in = _vm->_system->getSavefileManager()->openForLoading(file);
+ if (in)
+ delete in;
+ else
+ slot = -1;
+ }
- if (ConfMan.hasKey("save_slot"))
- _globals->_sceneHandler._loadGameSlot = ConfMan.getInt("save_slot");
+ if (slot >= 0)
+ _globals->_sceneHandler._loadGameSlot = slot;
else
// Switch to the title screen
_globals->_sceneManager.setNewScene(1000);
@@ -1346,7 +1356,7 @@ void RingworldGame::start() {
void RingworldGame::restart() {
_globals->_scenePalette.clearListeners();
- _globals->_soundHandler.proc3();
+ _globals->_soundHandler.stop();
// Reset the flags
_globals->reset();
@@ -1441,6 +1451,7 @@ void RingworldGame::processEvent(Event &event) {
ConfigDialog *dlg = new ConfigDialog();
dlg->runModal();
delete dlg;
+ _globals->_soundManager.syncSounds();
_globals->_events.setCursorFromFlag();
break;
}
diff --git a/engines/tsage/ringworld_scenes1.cpp b/engines/tsage/ringworld_scenes1.cpp
index 6960788db3..29b7c9b997 100644
--- a/engines/tsage/ringworld_scenes1.cpp
+++ b/engines/tsage/ringworld_scenes1.cpp
@@ -98,7 +98,7 @@ void Scene10::Action1::signal() {
scene->_object4.animate(ANIM_MODE_6, this);
break;
case 10:
- _globals->_soundHandler.proc1(this);
+ _globals->_soundHandler.fadeOut(this);
break;
case 11:
_globals->_scenePalette.clearListeners();
@@ -185,7 +185,7 @@ void Scene10::postInit(SceneObjectList *OwnerList) {
_globals->_sceneOffset.x = (_globals->_sceneManager._scene->_sceneBounds.left / 160) * 160;
setAction(&_action1);
- _globals->_soundHandler.startSound(5);
+ _globals->_soundHandler.play(5);
}
void Scene10::stripCallback(int v) {
@@ -232,7 +232,7 @@ void Scene15::Action1::signal() {
Common::Point pt(160, 100);
NpcMover *mover = new NpcMover();
scene->_object1.addMover(mover, &pt, this);
- scene->_soundHandler.startSound(7);
+ scene->_soundHandler.play(7);
break;
}
case 3:
@@ -256,7 +256,7 @@ void Scene15::postInit(SceneObjectList *OwnerList) {
loadScene(15);
Scene::postInit();
setZoomPercents(0, 100, 200, 100);
- _globals->_soundHandler.startSound(6);
+ _globals->_soundHandler.play(6);
setAction(&_action1);
}
@@ -276,7 +276,7 @@ void Scene20::Action1::signal() {
scene->_stripManager.start(20, this);
break;
case 2:
- _globals->_soundHandler.proc1(this);
+ _globals->_soundHandler.fadeOut(this);
break;
case 3:
_globals->_sceneManager._fadeMode = FADEMODE_GRADUAL;
@@ -341,8 +341,8 @@ void Scene20::Action2::signal() {
break;
}
case 8:
- scene->_sound.proc4();
- scene->_sound.proc1(this);
+ scene->_sound.release();
+ scene->_sound.fadeOut(this);
break;
case 9:
SceneItem::display(0, 0, LIST_END);
@@ -400,8 +400,8 @@ void Scene20::Action3::signal() {
break;
}
case 6:
- scene->_sound.startSound(60, this, 127);
- _globals->_soundHandler.proc4();
+ scene->_sound.play(60, this, 127);
+ _globals->_soundHandler.release();
break;
case 7:
_globals->_sceneManager._fadeMode = FADEMODE_GRADUAL;
@@ -450,7 +450,7 @@ void Scene20::Action4::signal() {
break;
}
case 4: {
- scene->_sound.startSound(28);
+ scene->_sound.play(28);
scene->_sceneObject4.postInit();
scene->_sceneObject4.setVisage(21);
scene->_sceneObject4.setStrip(3);
@@ -463,7 +463,7 @@ void Scene20::Action4::signal() {
break;
}
case 5: {
- scene->_sound.startSound(42);
+ scene->_sound.play(42);
scene->_sceneObject4.remove();
scene->_SceneObjectExt.setVisage(21);
scene->_SceneObjectExt.setStrip(1);
@@ -487,7 +487,7 @@ void Scene20::Action4::signal() {
break;
}
case 6: {
- scene->_sound.startSound(42);
+ scene->_sound.play(42);
scene->_SceneObjectExt.setStrip(2);
scene->_SceneObjectExt.animate(ANIM_MODE_2, NULL);
@@ -506,7 +506,7 @@ void Scene20::Action4::signal() {
case 7:
_globals->_player.setStrip(2);
_globals->_player.animate(ANIM_MODE_2, NULL);
- scene->_sound.startSound(77, this, 127);
+ scene->_sound.play(77, this, 127);
break;
case 8:
_globals->_game->endGame(20, 0);
@@ -549,15 +549,15 @@ void Scene20::postInit(SceneObjectList *OwnerList) {
_SceneObjectExt._moveDiff = Common::Point(10, 10);
_sceneObject3._moveDiff = Common::Point(10, 10);
- _globals->_soundHandler.startSound(20);
- _sound.startSound(21);
- _sound.proc5(1);
+ _globals->_soundHandler.play(20);
+ _sound.play(21);
+ _sound.holdAt(true);
setAction(&_action2);
_sceneBounds = Rect(320, 0, 640, 200);
} else if (_globals->_sceneManager._previousScene == 60) {
// Evasion
- _sound.startSound(30);
+ _sound.play(30);
_globals->_player.postInit();
_globals->_player.setVisage(20);
_globals->_player.setPosition(Common::Point(588, 79));
@@ -605,7 +605,7 @@ void Scene20::postInit(SceneObjectList *OwnerList) {
_speakerGameText.setTextPos(Common::Point(350, 20));
_speakerGameText._textWidth = 260;
- _globals->_soundHandler.startSound(8);
+ _globals->_soundHandler.play(8);
_sceneBounds = Rect(320, 0, 640, 200);
}
@@ -669,7 +669,7 @@ void Scene30::BeamAction::signal() {
case 2:
// Hide the beam and lower the player's hand
- scene->_sound.startSound(10, NULL, 127);
+ scene->_sound.play(10, NULL, 127);
_globals->_player.animate(ANIM_MODE_6, this);
scene->_beam.remove();
break;
@@ -693,14 +693,14 @@ void Scene30::BeamAction::signal() {
case 4:
// Open the door
- scene->_sound.startSound(11, NULL, 127);
+ scene->_sound.play(11, NULL, 127);
scene->_door.animate(ANIM_MODE_5, this);
break;
case 5:
// Run the Kzin's talk sequence
- scene->_sound.startSound(13, NULL, 127);
- _globals->_soundHandler.startSound(12, NULL, 127);
+ scene->_sound.play(13, NULL, 127);
+ _globals->_soundHandler.play(12, NULL, 127);
scene->_stripManager.start((scene->_sceneMode == 0) ? 30 : 37, this);
break;
@@ -732,7 +732,7 @@ void Scene30::KzinAction::signal() {
setDelay(1200);
break;
case 1:
- _globals->_soundHandler.proc2(0);
+ _globals->_soundHandler.fadeOut(NULL);
_globals->_player.disableControl();
setAction(&scene->_sequenceManager, _globals->_sceneManager._scene, 31, &scene->_kzin, &scene->_door, NULL);
break;
@@ -772,12 +772,12 @@ void Scene30::RingAction::signal() {
}
case 3:
- scene->_sound.startSound(11, NULL, 127);
+ scene->_sound.play(11, NULL, 127);
scene->_door.animate(ANIM_MODE_6, this);
break;
case 4: {
- scene->_sound.startSound(13, NULL, 127);
+ scene->_sound.play(13, NULL, 127);
NpcMover *kzinMover = new NpcMover();
Common::Point pt(354, 5);
scene->_kzin.addMover(kzinMover, &pt, this);
@@ -955,7 +955,7 @@ void Scene40::Action1::signal() {
scene->_doorway.setVisage(46);
scene->_doorway.setPosition(Common::Point(305, 61));
scene->_doorway.animate(ANIM_MODE_5, this);
- scene->_soundHandler.startSound(25);
+ scene->_soundHandler.play(25);
break;
case 3:
scene->_doorway.hide();
@@ -976,7 +976,7 @@ void Scene40::Action1::signal() {
scene->_assassin.setFrame(1);
scene->_assassin.setPosition(Common::Point(13, 171));
scene->_assassin.animate(ANIM_MODE_5, this);
- scene->_soundHandler.startSound(25);
+ scene->_soundHandler.play(25);
break;
case 5:
scene->_doorway.show();
@@ -1011,7 +1011,7 @@ void Scene40::Action1::signal() {
break;
}
case 10: {
- scene->_soundHandler.startSound(27);
+ scene->_soundHandler.play(27);
Common::Point pt(223, 184);
NpcMover *mover = new NpcMover();
scene->_dyingKzin.addMover(mover, &pt, this);
@@ -1024,7 +1024,7 @@ void Scene40::Action1::signal() {
break;
}
case 12: {
- _globals->_soundHandler.startSound(26);
+ _globals->_soundHandler.play(26);
_globals->_player._uiEnabled = true;
scene->_assassin.setVisage(42);
scene->_assassin.setPosition(Common::Point(4, 191));
@@ -1043,7 +1043,7 @@ void Scene40::Action1::signal() {
scene->_assassin.setStrip(1);
scene->_assassin.setFrame(1);
scene->_assassin.animate(ANIM_MODE_5, this);
- scene->_soundHandler.startSound(28);
+ scene->_soundHandler.play(28);
break;
case 15:
_globals->_player.disableControl();
@@ -1057,7 +1057,7 @@ void Scene40::Action1::signal() {
_globals->_player.animate(ANIM_MODE_5, this);
break;
case 16:
- _globals->_soundHandler.startSound(77, this);
+ _globals->_soundHandler.play(77, this);
break;
case 17:
_globals->_game->endGame(40, 20);
@@ -1083,7 +1083,7 @@ void Scene40::Action2::signal() {
_globals->_player.animate(ANIM_MODE_5, this);
break;
case 2: {
- scene->_soundHandler.startSound(28);
+ scene->_soundHandler.play(28);
scene->_doorway.postInit();
scene->_doorway.setVisage(16);
scene->_doorway.setStrip2(6);
@@ -1103,7 +1103,7 @@ void Scene40::Action2::signal() {
scene->_assassin.setVisage(44);
scene->_assassin._frame = 1;
scene->_assassin.animate(ANIM_MODE_5, this);
- scene->_soundHandler.startSound(29);
+ scene->_soundHandler.play(29);
RING_INVENTORY._infoDisk._sceneNumber = 40;
break;
case 4:
@@ -1234,11 +1234,11 @@ void Scene40::Action6::signal() {
scene->_doorway.setVisage(46);
scene->_doorway.setPosition(Common::Point(305, 61));
scene->_doorway.animate(ANIM_MODE_5, this);
- scene->_soundHandler.startSound(25);
+ scene->_soundHandler.play(25);
break;
}
case 1:
- scene->_soundHandler.startSound(28);
+ scene->_soundHandler.play(28);
scene->_doorway.setPosition(Common::Point(148, 74));
scene->_doorway.setFrame(1);
scene->_doorway.setStrip(2);
@@ -1255,8 +1255,7 @@ void Scene40::Action7::signal() {
switch (_actionIndex++) {
case 0:
- // TODO: check if it's rand(500) or rand(499)+500
- setDelay(_globals->_randomSource.getRandomNumber(500));
+ setDelay(_globals->_randomSource.getRandomNumber(499) + 500);
break;
case 1:
scene->_object7.postInit();
@@ -1270,7 +1269,7 @@ void Scene40::Action7::signal() {
scene->_object7.setFrame(15);
}
scene->_object7.animate(ANIM_MODE_5, this);
- scene->_soundHandler.startSound(25);
+ scene->_soundHandler.play(25);
break;
case 2:
scene->_object7.remove();
@@ -1322,7 +1321,7 @@ void Scene40::Action8::signal() {
_globals->_player.animate(ANIM_MODE_5, this);
break;
case 3:
- _globals->_soundHandler.startSound(77, this);
+ _globals->_soundHandler.play(77, this);
break;
case 4:
_globals->_game->endGame(40, 45);
@@ -1480,7 +1479,7 @@ void Scene40::postInit(SceneObjectList *OwnerList) {
_globals->_player.disableControl();
if (_globals->_sceneManager._previousScene == 20) {
- _globals->_soundHandler.startSound(24);
+ _globals->_soundHandler.play(24);
_globals->_player.setVisage(43);
_object1.postInit();
@@ -1872,7 +1871,7 @@ void Scene60::Action1::signal() {
scene->_floppyDrive.setPosition(Common::Point(136, 65));
scene->_floppyDrive.animate(ANIM_MODE_5, this);
- scene->_soundHandler1.startSound(35);
+ scene->_soundHandler1.play(35);
break;
case 2:
scene->_redLights.postInit();
@@ -1893,13 +1892,13 @@ void Scene60::Action1::signal() {
scene->_message._numFrames = 5;
_globals->_sceneItems.push_front(&scene->_message);
- scene->_soundHandler2.startSound(38);
+ scene->_soundHandler2.play(38);
}
_globals->_events.setCursor(CURSOR_USE);
break;
case 3:
- scene->_soundHandler2.startSound(37);
+ scene->_soundHandler2.play(37);
scene->loadScene(65);
scene->_message.remove();
@@ -1968,8 +1967,8 @@ void Scene60::Action1::signal() {
scene->_floppyDrive.setFrame(scene->_floppyDrive.getFrameCount());
scene->_floppyDrive.animate(ANIM_MODE_6, this);
- scene->_soundHandler1.startSound(35);
- scene->_soundHandler3.proc3();
+ scene->_soundHandler1.play(35);
+ scene->_soundHandler3.stop();
scene->_masterButton.setFrame(1);
scene->_masterButton._state = 0;
@@ -2019,7 +2018,7 @@ void Scene60::PrevObject::doAction(int action) {
animate(ANIM_MODE_8, 1, NULL);
if (scene->_action1.getActionIndex() > 5) {
- scene->_soundHandler3.startSound(36);
+ scene->_soundHandler3.play(36);
scene->_action1.setActionIndex(scene->_action1.getActionIndex() - 2);
scene->_action1.setDelay(1);
}
@@ -2037,7 +2036,7 @@ void Scene60::NextObject::doAction(int action) {
animate(ANIM_MODE_8, 1, NULL);
if (scene->_action1.getActionIndex() < 8) {
- scene->_soundHandler3.startSound(36);
+ scene->_soundHandler3.play(36);
scene->_action1.setDelay(1);
}
} else {
@@ -2051,7 +2050,7 @@ void Scene60::ExitObject::doAction(int action) {
if (action == CURSOR_LOOK) {
SceneItem::display2(60, 18);
} else if (action == CURSOR_USE) {
- scene->_soundHandler3.startSound(36);
+ scene->_soundHandler3.play(36);
animate(ANIM_MODE_8, 1, NULL);
scene->_nextButton.remove();
scene->_prevButton.remove();
@@ -2132,8 +2131,8 @@ void Scene60::ControlObject::doAction(int action) {
if (_animateMode == ANIM_MODE_NONE)
SceneItem::display2(60, 14);
else if (!scene->_slaveButton._state) {
- _globals->_soundHandler.startSound(40);
- _globals->_soundHandler.proc5(1);
+ _globals->_soundHandler.play(40);
+ _globals->_soundHandler.holdAt(true);
_globals->_sceneManager.changeScene(20);
} else {
scene->_sceneMode = 15;
@@ -2153,14 +2152,14 @@ void Scene60::SlaveObject::doAction(int action) {
if (scene->_masterButton._state)
scene->_sceneMode = 19;
else if (_state) {
- scene->_soundHandler3.proc3();
+ scene->_soundHandler3.stop();
animate(ANIM_MODE_6, NULL);
_globals->clearFlag(102);
_globals->clearFlag(!_globals->_stripNum ? 117 : 120);
_state = 0;
scene->_sceneMode = 9998;
} else {
- scene->_soundHandler3.startSound(39);
+ scene->_soundHandler3.play(39);
_globals->setFlag(102);
_globals->setFlag(!_globals->_stripNum ? 117 : 120);
animate(ANIM_MODE_5, NULL);
@@ -2185,14 +2184,14 @@ void Scene60::MasterObject::doAction(int action) {
else if (scene->_slaveButton._state)
scene->_sceneMode = 20;
else if (_state) {
- scene->_soundHandler3.proc3();
+ scene->_soundHandler3.stop();
animate(ANIM_MODE_6, NULL);
_state = 0;
_globals->clearFlag(103);
_globals->clearFlag(!_globals->_stripNum ? 116 : 119);
scene->_sceneMode = 9998;
} else {
- scene->_soundHandler3.startSound(39);
+ scene->_soundHandler3.play(39);
animate(ANIM_MODE_5, NULL);
_state = 1;
_globals->setFlag(103);
@@ -2347,7 +2346,7 @@ void Scene60::postInit(SceneObjectList *OwnerList) {
_redLights.setPosition(Common::Point(199, 186));
_redLights.animate(ANIM_MODE_8, 0, NULL);
- _soundHandler1.startSound(35);
+ _soundHandler1.play(35);
if (!_globals->getFlag(83)) {
_message.postInit();
@@ -2359,7 +2358,7 @@ void Scene60::postInit(SceneObjectList *OwnerList) {
_message._numFrames = 5;
_globals->_sceneItems.push_front(&_message);
- _soundHandler2.startSound(38);
+ _soundHandler2.play(38);
}
}
} else {
@@ -2382,7 +2381,7 @@ void Scene60::postInit(SceneObjectList *OwnerList) {
_redLights.animate(ANIM_MODE_8, 0, NULL);
_redLights._numFrames = 5;
- _soundHandler1.startSound(35);
+ _soundHandler1.play(35);
if (!_globals->getFlag(83)) {
_message.postInit();
@@ -2394,7 +2393,7 @@ void Scene60::postInit(SceneObjectList *OwnerList) {
_message._numFrames = 5;
_globals->_sceneItems.push_front(&_message);
- _soundHandler2.startSound(38);
+ _soundHandler2.play(38);
}
}
}
@@ -2462,7 +2461,7 @@ void Scene90::Action1::signal() {
setDelay(2);
break;
case 5:
- scene->_soundHandler2.startSound(58);
+ scene->_soundHandler2.play(58);
if (scene->_stripManager._field2E8 == 220)
scene->_stripManager.start(91, this, scene);
@@ -2477,7 +2476,7 @@ void Scene90::Action1::signal() {
break;
case 7:
scene->_object2.animate(ANIM_MODE_NONE);
- _globals->_soundHandler.startSound(56);
+ _globals->_soundHandler.play(56);
scene->_object3.animate(ANIM_MODE_5, this);
break;
case 8: {
@@ -2507,8 +2506,8 @@ void Scene90::Action1::signal() {
break;
}
case 11:
- _globals->_soundHandler.startSound(57);
- _globals->_soundHandler.startSound(68);
+ _globals->_soundHandler.play(57);
+ _globals->_soundHandler.play(68);
scene->_object3.animate(ANIM_MODE_6, NULL);
SceneItem::display(90, _globals->getFlag(104) ? 15 : 14,
@@ -2556,8 +2555,8 @@ void Scene90::Object2::doAction(int action) {
scene->_object6.hide();
scene->_sceneMode = 91;
- scene->_soundHandler1.startSound(59);
- scene->_soundHandler1.proc5(1);
+ scene->_soundHandler1.play(59);
+ scene->_soundHandler1.holdAt(true);
scene->setAction(&scene->_sequenceManager, scene, 91, this, &scene->_object6, NULL);
break;
case CURSOR_LOOK:
@@ -2653,9 +2652,9 @@ void Scene90::postInit(SceneObjectList *OwnerList) {
_globals->_sceneItems.push_back(&_object3);
_globals->_player.disableControl();
- _globals->_soundHandler.startSound(55);
- _soundHandler1.startSound(52);
- _soundHandler1.proc5(1);
+ _globals->_soundHandler.play(55);
+ _soundHandler1.play(52);
+ _soundHandler1.holdAt(true);
setAction(&_action1);
@@ -2670,7 +2669,7 @@ void Scene90::signal() {
switch (_sceneMode) {
case 91:
_sceneMode = 92;
- _globals->_soundHandler.startSound(77, this);
+ _globals->_soundHandler.play(77, this);
break;
case 92:
_globals->_scenePalette.clearListeners();
@@ -2713,7 +2712,7 @@ void Scene95::Action1::signal() {
setDelay(60);
break;
case 2: {
- scene->_soundHandler.startSound(66);
+ scene->_soundHandler.play(66);
scene->_object3._numFrames = 5;
scene->_object3.animate(ANIM_MODE_5, NULL);
SceneItem::display(0, 0);
@@ -2728,7 +2727,7 @@ void Scene95::Action1::signal() {
break;
}
case 3: {
- scene->_soundHandler.startSound(21);
+ scene->_soundHandler.play(21);
Common::Point pt1(235, 72);
PlayerMover *mover1 = new PlayerMover();
@@ -2768,7 +2767,7 @@ void Scene95::Action1::signal() {
scene->_object1.setVisage(91);
scene->_object1.setPosition(Common::Point(-22, 220));
- scene->_soundHandler.startSound(21);
+ scene->_soundHandler.play(21);
Common::Point pt1(5, 198);
NpcMover *mover1 = new NpcMover();
@@ -2826,7 +2825,7 @@ void Scene95::postInit(SceneObjectList *OwnerList) {
_object3.setVisage(96);
_object3.setPosition(Common::Point(29, 198));
- _soundHandler.startSound(67);
+ _soundHandler.play(67);
setAction(&_action1);
}
@@ -2890,7 +2889,7 @@ void Scene6100::Action3::signal() {
scene->_sunflower3.hide();
scene->_rocks.hide();
scene->_sceneText.hide();
-
+
_globals->_events.setCursor(CURSOR_WALK);
scene->_stripManager.start(8120, this);
break;
@@ -3000,21 +2999,21 @@ void Scene6100::Action5::dispatch() {
(tempSet.sqrt(zeroSet) < 150.0)) {
switch (scene->_hitCount++) {
case 0:
- scene->_soundHandler.startSound(233);
+ scene->_soundHandler.play(233);
scene->showMessage(NULL, 0, NULL);
if (!_globals->getFlag(76))
scene->_probe.setAction(&scene->_action1);
break;
case 1:
- scene->_soundHandler.startSound(233);
+ scene->_soundHandler.play(233);
scene->showMessage(NULL, 0, NULL);
if (!_globals->getFlag(76))
scene->_probe.setAction(&scene->_action2);
break;
case 2:
- scene->_soundHandler.startSound(234);
+ scene->_soundHandler.play(234);
scene->showMessage(NULL, 0, NULL);
if (!_globals->getFlag(76))
@@ -3243,7 +3242,7 @@ void Scene6100::postInit(SceneObjectList *OwnerList) {
if (!_globals->getFlag(76))
_probe.setAction(&_action4);
- _globals->_soundHandler.startSound(231);
+ _globals->_soundHandler.play(231);
}
void Scene6100::remove() {
diff --git a/engines/tsage/ringworld_scenes1.h b/engines/tsage/ringworld_scenes1.h
index abd765473c..283cf68e07 100644
--- a/engines/tsage/ringworld_scenes1.h
+++ b/engines/tsage/ringworld_scenes1.h
@@ -30,6 +30,7 @@
#include "tsage/core.h"
#include "tsage/scenes.h"
#include "tsage/globals.h"
+#include "tsage/sound.h"
namespace tSage {
@@ -65,7 +66,7 @@ class Scene15 : public Scene {
public:
Action1 _action1;
SceneObject _object1;
- SoundHandler _soundHandler;
+ ASound _soundHandler;
virtual void postInit(SceneObjectList *OwnerList = NULL);
};
@@ -97,7 +98,7 @@ public:
Action3 _action3;
Action4 _action4;
SceneObject _sceneObject1, _SceneObjectExt, _sceneObject3, _sceneObject4, _sceneObject5;
- SoundHandler _sound;
+ ASound _sound;
public:
Scene20();
virtual ~Scene20() {}
@@ -143,7 +144,7 @@ class Scene30 : public Scene {
};
public:
- SoundHandler _sound;
+ ASound _sound;
DisplayHotspot _groundHotspot, _wallsHotspot, _courtyardHotspot, _treeHotspot;
BeamObject _beam;
DoorObject _door;
@@ -232,7 +233,7 @@ public:
SpeakerQText _speakerQText;
SpeakerSText _speakerSText;
SpeakerGameText _speakerGameText;
- SoundHandler _soundHandler;
+ ASound _soundHandler;
Action1 _action1;
Action2 _action2;
Action3 _action3;
@@ -271,7 +272,7 @@ class Scene50 : public Scene {
public:
virtual void signal();
};
-
+
/* Objects */
class Object1 : public SceneObject {
public:
@@ -311,7 +312,7 @@ public:
virtual void dispatch();
};
-class Scene60 : public Scene {
+class Scene60 : public Scene {
class Action1 : public Action {
public:
virtual void signal();
@@ -387,9 +388,9 @@ public:
SceneObject _redLights;
Item1 _item1;
Item _item2, _item3, _item4, _item5, _item6;
- SoundHandler _soundHandler1;
- SoundHandler _soundHandler2;
- SoundHandler _soundHandler3;
+ ASound _soundHandler1;
+ ASound _soundHandler2;
+ ASound _soundHandler3;
Scene60();
virtual void postInit(SceneObjectList *OwnerList = NULL);
@@ -423,7 +424,7 @@ public:
DisplayObject _object3, _object4, _object5;
SceneObject _object6;
DisplayHotspot _item1, _item2, _item3;
- SoundHandler _soundHandler1, _soundHandler2;
+ ASound _soundHandler1, _soundHandler2;
Scene90();
@@ -441,7 +442,7 @@ class Scene95 : public Scene {
public:
Action1 _action1;
SceneObject _object1, _object2, _object3;
- SoundHandler _soundHandler;
+ ASound _soundHandler;
Scene95();
virtual void postInit(SceneObjectList *OwnerList);
@@ -505,7 +506,7 @@ public:
Action5 _action5;
GetBoxAction _getBoxAction;
Action7 _action7;
- SoundHandler _soundHandler;
+ ASound _soundHandler;
Speaker _speaker1;
SpeakerQR _speakerQR;
SpeakerSL _speakerSL;
diff --git a/engines/tsage/ringworld_scenes10.cpp b/engines/tsage/ringworld_scenes10.cpp
index 0b4186531d..ba4060548e 100644
--- a/engines/tsage/ringworld_scenes10.cpp
+++ b/engines/tsage/ringworld_scenes10.cpp
@@ -151,7 +151,7 @@ void Scene9100::postInit(SceneObjectList *OwnerList) {
_sceneHotspot5.setup(69, 36, 121, 272, 9100, 45, 46);
_sceneHotspot6.setup(127, 0, 200, 52, 9100, 47, 48);
- _globals->_soundHandler.startSound(251);
+ _globals->_soundHandler.play(251);
if (_globals->_sceneManager._previousScene == 9150) {
if (_globals->getFlag(20)) {
_globals->_player.disableControl();
@@ -236,7 +236,7 @@ void Scene9150::dispatch() {
} else {
_globals->_player.disableControl();
if (_globals->getFlag(11)) {
- _globals->_soundHandler.startSound(286);
+ _globals->_soundHandler.play(286);
_sceneMode = 9153;
} else {
_sceneMode = 9156;
@@ -270,7 +270,7 @@ void Scene9150::postInit(SceneObjectList *OwnerList) {
_sceneHotspot8.setup(133, 584, 142, 640, 9150, 57, -1);
_sceneHotspot10.setup(83, 304, 103, 323, 9150, 58, 59);
- _globals->_soundHandler.startSound(285);
+ _globals->_soundHandler.play(285);
_globals->_player.disableControl();
if (_globals->getFlag(20)) {
@@ -402,7 +402,8 @@ void Scene9200::postInit(SceneObjectList *OwnerList) {
_object1.animate(ANIM_MODE_2, NULL);
_object1.setPosition(Common::Point(132, 114));
_object1.fixPriority(140);
- _soundHandler.startSound(297);
+ _soundHandler.play(297);
+
_stripManager.addSpeaker(&_speakerQText);
_stripManager.addSpeaker(&_speakerGR);
_stripManager.addSpeaker(&_speakerGText);
@@ -479,7 +480,7 @@ void Scene9300::signal() {
_globals->setFlag(84);
// No break on purpose
case 9303:
- _globals->_soundHandler.startSound(295);
+ _globals->_soundHandler.play(295);
_globals->_sceneManager.changeScene(9350);
break;
case 9302:
@@ -509,7 +510,7 @@ void Scene9300::postInit(SceneObjectList *OwnerList) {
_globals->_player.changeZoom(-1);
_object1.postInit();
_object2.postInit();
- _globals->_soundHandler.startSound(289);
+ _globals->_soundHandler.play(289);
_hotspot1.setup(35, 142, 76, 212, 9300, 0, 1);
_hotspot2.setup(28, 90, 81, 143, 9300, 2, 3);
@@ -764,7 +765,7 @@ void Scene9400::signal() {
void Scene9400::dispatch() {
if ((_object1._animateMode == 2) && (_object1._strip == 1) && (_object1._frame == 4)){
if (_field1032 == 0) {
- _soundHandler.startSound(296);
+ _soundHandler.play(296);
_field1032 = 1;
}
} else {
@@ -1083,7 +1084,7 @@ void Scene9500::signal() {
switch (_sceneMode) {
case 9503:
_globals->_sceneManager.changeScene(9200);
- _globals->_soundHandler.startSound(295);
+ _globals->_soundHandler.play(295);
break;
case 9504:
_globals->_sceneManager.changeScene(9850);
@@ -1141,7 +1142,7 @@ void Scene9500::postInit(SceneObjectList *OwnerList) {
setZoomPercents(110, 75, 200, 150);
_globals->_player.postInit();
- _globals->_soundHandler.startSound(305);
+ _globals->_soundHandler.play(305);
_candle.postInit();
_candle.setVisage(9500);
@@ -1249,7 +1250,7 @@ void Scene9700::signal() {
_globals->_events.setCursor(CURSOR_USE);
break;
case 9704:
- _globals->_soundHandler.startSound(323);
+ _globals->_soundHandler.play(323);
_globals->_sceneManager.changeScene(9750);
break;
}
@@ -1308,7 +1309,7 @@ void Scene9700::postInit(SceneObjectList *OwnerList) {
void Scene9750::signal() {
switch (_sceneMode ++) {
case 9751:
- _globals->_soundHandler.proc1(this);
+ _globals->_soundHandler.fadeOut(this);
break;
case 9752:
_globals->_sceneManager.changeScene(2100);
@@ -1440,7 +1441,7 @@ void Scene9850::Hotspot17::doAction(int action) {
SceneItem::display(9850, 32, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
} else {
if (action == CURSOR_USE)
- scene->_soundHandler.startSound(306);
+ scene->_soundHandler.play(306);
NamedHotspot::doAction(action);
}
}
@@ -1452,7 +1453,7 @@ void Scene9850::Hotspot18::doAction(int action) {
SceneItem::display(9850, 32, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
} else {
if (action == CURSOR_USE)
- scene->_soundHandler.startSound(306);
+ scene->_soundHandler.play(306);
NamedHotspot::doAction(action);
}
}
@@ -1464,7 +1465,7 @@ void Scene9850::Hotspot19::doAction(int action) {
SceneItem::display(9850, 31, SET_Y, 20, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
} else {
if (action == CURSOR_USE)
- scene->_soundHandler.startSound(313);
+ scene->_soundHandler.play(313);
NamedHotspot::doAction(action);
}
}
@@ -1653,7 +1654,7 @@ void Scene9900::strAction1::signal() {
switch (_actionIndex++) {
case 0:
- scene->_soundHandler.startSound(351);
+ scene->_soundHandler.play(351);
_object9.postInit();
_object9.setVisage(18);
_object9._frame = 1;
@@ -1673,7 +1674,7 @@ void Scene9900::strAction1::signal() {
_globals->_scenePalette.addFader(&mask2[0], 1, 5, this);
break;
case 3:
- _globals->_soundHandler.startSound(377);
+ _globals->_soundHandler.play(377);
setDelay(120);
break;
case 4:
@@ -1854,7 +1855,7 @@ void Scene9900::signal() {
switch (_sceneMode){
case 150:
- _globals->_soundHandler.startSound(380);
+ _globals->_soundHandler.play(380);
_object8.postInit();
_object8.setVisage(2002);
_object8.setStrip(1);
@@ -1887,7 +1888,7 @@ void Scene9900::signal() {
setAction(&_sequenceManager, this, 9902, &_object1, &_object2, &_object3, &_object4, &_object5, &_object6);
break;
case 9904:
- _globals->_soundHandler.startSound(390);
+ _globals->_soundHandler.play(390);
_sceneMode = 9912;
setAction(&_strAction2, this);
break;
@@ -1918,7 +1919,7 @@ void Scene9900::signal() {
setAction(&_sequenceManager, this, 9904, &_object1, &_object2, &_object3, &_object4, &_object5, &_object6);
break;
case 9909:
- _globals->_soundHandler.startSound(375);
+ _globals->_soundHandler.play(375);
_globals->_player.disableControl();
_sceneMode = 9907;
setAction(&_sequenceManager, this, 9907, &_object1, &_object2, &_object3, &_object4, &_object5, &_object6);
@@ -1929,7 +1930,7 @@ void Scene9900::signal() {
setAction(&_sequenceManager, this, 9911, &_object1, &_object2, &_object3, &_object4, &_object5, &_object6);
break;
case 9911:
- _globals->_soundHandler.startSound(367);
+ _globals->_soundHandler.play(367);
_globals->_player.disableControl();
_sceneMode = 9909;
setAction(&_sequenceManager, this, 9909, &_object1, &_object2, &_object3, &_object4, &_object5, &_object6);
@@ -2080,7 +2081,7 @@ void Scene9999::postInit(SceneObjectList *OwnerList) {
else
_globals->_stripNum = 2121;
- _globals->_soundHandler.startSound(118);
+ _globals->_soundHandler.play(118);
}
diff --git a/engines/tsage/ringworld_scenes10.h b/engines/tsage/ringworld_scenes10.h
index aa41555718..33b16d0014 100644
--- a/engines/tsage/ringworld_scenes10.h
+++ b/engines/tsage/ringworld_scenes10.h
@@ -129,7 +129,7 @@ public:
SpeakerGText _speakerGText;
SpeakerGR _speakerGR;
SpeakerQText _speakerQText;
- SoundHandler _soundHandler;
+ ASound _soundHandler;
SceneHotspot1 _hotspot1;
NamedHotspot _hotspot2;
NamedHotspot _hotspot3;
@@ -230,7 +230,7 @@ public:
NamedHotspot _hotspot4;
NamedHotspot _hotspot5;
NamedHotspot _hotspot6;
- SoundHandler _soundHandler;
+ ASound _soundHandler;
int _field1032;
SceneHotspot7 _hotspot7;
SceneHotspot8 _hotspot8;
@@ -424,7 +424,7 @@ public:
SceneObject _objLever;
Object6 _objScimitar;
Object7 _objSword;
- SoundHandler _soundHandler;
+ ASound _soundHandler;
NamedHotspot _hotspot1;
NamedHotspot _hotspot2;
NamedHotspot _hotspot3;
@@ -482,7 +482,7 @@ class Scene9900 : public Scene {
};
public:
- SoundHandler _soundHandler;
+ ASound _soundHandler;
SequenceManager _sequenceManager;
SceneObject _object1;
SceneObject _object2;
diff --git a/engines/tsage/ringworld_scenes2.cpp b/engines/tsage/ringworld_scenes2.cpp
index 4378eac724..0154123c3d 100644
--- a/engines/tsage/ringworld_scenes2.cpp
+++ b/engines/tsage/ringworld_scenes2.cpp
@@ -117,6 +117,7 @@ void Scene1000::Action3::signal() {
// First time being played, so show the introduction
ConfMan.setBool(SEEN_INTRO, true);
ConfMan.flushToDisk();
+
setDelay(1);
} else {
// Prompt user for whether to start play or watch introduction
@@ -124,7 +125,7 @@ void Scene1000::Action3::signal() {
if (MessageDialog::show2(WATCH_INTRO_MSG, START_PLAY_BTN_STRING, INTRODUCTION_BTN_STRING) == 0) {
_actionIndex = 20;
- _globals->_soundHandler.proc1(this);
+ _globals->_soundHandler.fadeOut(this);
} else {
setDelay(1);
}
@@ -214,7 +215,7 @@ void Scene1000::Action3::signal() {
case 18:
zoom(false);
_globals->_scenePalette.clearListeners();
- _globals->_soundHandler.proc1(this);
+ _globals->_soundHandler.fadeOut(this);
break;
case 19:
_globals->_sceneManager.changeScene(10);
@@ -267,7 +268,7 @@ void Scene1000::postInit(SceneObjectList *OwnerList) {
_globals->_sceneManager._scene->_sceneBounds.contain(_globals->_sceneManager._scene->_backgroundBounds);
_globals->_sceneOffset.x = (_globals->_sceneManager._scene->_sceneBounds.left / 160) * 160;
- _globals->_soundHandler.startSound(114);
+ _globals->_soundHandler.play(114);
} else if (_globals->_sceneManager._previousScene == 2222) {
setZoomPercents(150, 10, 180, 100);
_object1.postInit();
@@ -283,7 +284,7 @@ void Scene1000::postInit(SceneObjectList *OwnerList) {
setAction(&_action1);
} else {
- _globals->_soundHandler.startSound(4);
+ _globals->_soundHandler.play(4);
setZoomPercents(0, 10, 30, 100);
_object3.postInit();
_object3.setVisage(1050);
@@ -429,7 +430,7 @@ void Scene1001::Action1::signal() {
setDelay(10);
break;
case 16: {
- scene->_soundHandler1.startSound(90);
+ scene->_soundHandler1.play(90);
scene->_object6.postInit();
scene->_object6.setVisage(16);
@@ -446,7 +447,7 @@ void Scene1001::Action1::signal() {
break;
}
case 17: {
- scene->_soundHandler1.startSound(90);
+ scene->_soundHandler1.play(90);
scene->_object6.remove();
scene->_object7.postInit();
@@ -475,7 +476,7 @@ void Scene1001::Action1::signal() {
setDelay(30);
break;
case 19: {
- _globals->_soundHandler.startSound(91);
+ _globals->_soundHandler.play(91);
byte adjustData[4] = {0xff, 0xff, 0xff, 0};
_globals->_scenePalette.fade(adjustData, false, 0);
@@ -496,7 +497,7 @@ void Scene1001::Action1::signal() {
scene->_object1.animate(ANIM_MODE_5, this);
break;
case 22:
- _globals->_soundHandler.startSound(92);
+ _globals->_soundHandler.play(92);
scene->_stripManager.start(111, this);
break;
case 23:
@@ -526,7 +527,7 @@ void Scene1001::postInit(SceneObjectList *OwnerList) {
_object3.setStrip2(4);
_object3.setPosition(Common::Point(61, 177));
- _globals->_soundHandler.startSound(85);
+ _globals->_soundHandler.play(85);
setAction(&_action1);
}
@@ -647,7 +648,7 @@ void Scene1250::postInit(SceneObjectList *OwnerList) {
setAction(&_action4);
} else {
setAction(&_action3);
- _globals->_soundHandler.startSound(114);
+ _globals->_soundHandler.play(114);
}
}
@@ -734,7 +735,7 @@ void Scene1400::Action1::signal() {
_globals->_sceneManager._scrollerRect = Rect(40, 20, 280, 180);
_globals->_sceneManager._fadeMode = FADEMODE_GRADUAL;
_globals->_stripNum = 1500;
- _globals->_soundHandler.proc3();
+ _globals->_soundHandler.stop();
_globals->_sceneManager.changeScene(1500);
break;
@@ -779,7 +780,7 @@ void Scene1400::postInit(SceneObjectList *OwnerList) {
_globals->_sceneOffset.y = (_globals->_sceneManager._scene->_sceneBounds.top / 100) * 100;
setAction(&_action1);
- _globals->_soundHandler.startSound(118);
+ _globals->_soundHandler.play(118);
}
/*--------------------------------------------------------------------------
@@ -842,7 +843,7 @@ void Scene1500::Action1::signal() {
setDelay(30);
break;
case 6:
- scene->_soundHandler.startSound(123);
+ scene->_soundHandler.play(123);
scene->_object1.setStrip2(4);
scene->_object1.setFrame(1);
scene->_object1.animate(ANIM_MODE_5, this);
@@ -850,13 +851,13 @@ void Scene1500::Action1::signal() {
case 7:
scene->_object1.setStrip2(5);
scene->_object1.animate(ANIM_MODE_2, NULL);
- scene->_soundHandler.startSound(124, this);
+ scene->_soundHandler.play(124, this);
break;
case 8:
- _globals->_soundHandler.startSound(126, this);
+ _globals->_soundHandler.play(126, this);
break;
case 9:
- _globals->_soundHandler.startSound(127);
+ _globals->_soundHandler.play(127);
_globals->_sceneManager.changeScene(2000);
break;
}
@@ -893,7 +894,7 @@ void Scene1500::Action2::signal() {
break;
}
case 3:
- scene->_soundHandler.proc4();
+ scene->_soundHandler.release();
_globals->_stripNum = 1505;
_globals->_sceneManager.changeScene(2400);
break;
@@ -907,7 +908,7 @@ void Scene1500::postInit(SceneObjectList *OwnerList) {
Scene::postInit();
if ((_globals->_stripNum == 1500) || ((_globals->_stripNum != 1504) && (_globals->_stripNum != 2751))) {
- _globals->_soundHandler.startSound(120);
+ _globals->_soundHandler.play(120);
setZoomPercents(105, 20, 145, 100);
setAction(&_action1);
diff --git a/engines/tsage/ringworld_scenes2.h b/engines/tsage/ringworld_scenes2.h
index 7731b45ae8..93a8f04fd4 100644
--- a/engines/tsage/ringworld_scenes2.h
+++ b/engines/tsage/ringworld_scenes2.h
@@ -72,7 +72,7 @@ public:
Action1 _action1;
SceneObject _object1, _object2, _object3, _object4;
SceneObject _object5, _object6, _object7;
- SoundHandler _soundHandler1, _soundHandler2;
+ ASound _soundHandler1, _soundHandler2;
virtual void postInit(SceneObjectList *OwnerList = NULL);
};
@@ -134,7 +134,7 @@ public:
virtual void signal();
};
public:
- SoundHandler _soundHandler;
+ ASound _soundHandler;
Action1 _action1;
Action2 _action2;
SceneObject _object1, _object2, _object3;
diff --git a/engines/tsage/ringworld_scenes3.cpp b/engines/tsage/ringworld_scenes3.cpp
index a19f15eca6..824a96a18b 100644
--- a/engines/tsage/ringworld_scenes3.cpp
+++ b/engines/tsage/ringworld_scenes3.cpp
@@ -129,11 +129,11 @@ void Scene2000::Action6::signal() {
setDelay(130);
break;
case 1:
- scene->_soundHandler2.startSound(79);
+ scene->_soundHandler2.play(79);
scene->_stripManager.start(2000, this);
break;
case 2:
- _globals->_soundHandler.startSound(81);
+ _globals->_soundHandler.play(81);
scene->_object6.postInit();
scene->_object6.setVisage(2003);
scene->_object6.setAction(NULL);
@@ -148,7 +148,7 @@ void Scene2000::Action6::signal() {
scene->_object6.animate(ANIM_MODE_6, this);
break;
case 5:
- _globals->_soundHandler.startSound(80);
+ _globals->_soundHandler.play(80);
scene->_object6.remove();
_globals->_sceneManager.changeScene(1001);
break;
@@ -308,12 +308,12 @@ void Scene2000::Action14::signal() {
setDelay(60);
break;
case 3:
- _globals->_soundHandler.startSound(99);
+ _globals->_soundHandler.play(99);
scene->_object8.show();
scene->_object8.animate(ANIM_MODE_5, this);
break;
case 4:
- _globals->_soundHandler.startSound(12);
+ _globals->_soundHandler.play(12);
scene->_object8.setStrip(2);
scene->_object8.setFrame(1);
scene->_object9.show();
@@ -324,7 +324,7 @@ void Scene2000::Action14::signal() {
scene->_stripManager.start(2001, this, scene);
break;
case 6:
- _globals->_soundHandler.proc1(0/* was false */);
+ _globals->_soundHandler.fadeOut(0/* was false */);
scene->_object8.setStrip(1);
scene->_object8.setFrame(scene->_object8.getFrameCount());
scene->_object8.animate(ANIM_MODE_6, this);
@@ -333,7 +333,7 @@ void Scene2000::Action14::signal() {
scene->_object10.remove();
break;
case 7:
- _globals->_soundHandler.startSound(111);
+ _globals->_soundHandler.play(111);
scene->_object8.remove();
setDelay(5);
break;
@@ -425,11 +425,11 @@ void Scene2000::postInit(SceneObjectList *OwnerList) {
setAction(&_action13);
break;
case 2200:
- _globals->_soundHandler.startSound(111);
+ _globals->_soundHandler.play(111);
setAction(&_action14);
break;
case 2222:
- _globals->_soundHandler.startSound(115);
+ _globals->_soundHandler.play(115);
setAction(&_action8);
break;
case 3500:
@@ -437,12 +437,12 @@ void Scene2000::postInit(SceneObjectList *OwnerList) {
break;
default:
_object6.remove();
- _globals->_soundHandler.startSound(80);
+ _globals->_soundHandler.play(80);
setAction(&_action6);
break;
}
- _soundHandler1.startSound(78);
+ _soundHandler1.play(78);
_globals->_sceneManager._scene->_sceneBounds.contain(_globals->_sceneManager._scene->_backgroundBounds);
_globals->_sceneOffset.x = (_globals->_sceneManager._scene->_sceneBounds.left / 160) * 160;
}
@@ -502,7 +502,7 @@ void Scene2100::Action1::signal() {
break;
}
case 2:
- scene->_soundHandler.startSound(162);
+ scene->_soundHandler.play(162);
scene->_object1.animate(ANIM_MODE_5, this);
break;
case 3: {
@@ -551,7 +551,7 @@ void Scene2100::Action1::signal() {
}
}
- scene->_soundHandler.startSound(161);
+ scene->_soundHandler.play(161);
scene->_area1.restore();
scene->_area2.restore();
scene->_area3.restore();
@@ -560,7 +560,7 @@ void Scene2100::Action1::signal() {
if (_state == 2100) {
setDelay(1);
} else {
- scene->_soundHandler.startSound(162);
+ scene->_soundHandler.play(162);
scene->_object1.animate(ANIM_MODE_6, this);
}
break;
@@ -576,7 +576,7 @@ void Scene2100::Action1::signal() {
break;
case 7:
_globals->_player.fixPriority(-1);
- scene->_soundHandler.startSound(162);
+ scene->_soundHandler.play(162);
scene->_object1.animate(ANIM_MODE_6, this);
break;
case 8:
@@ -776,17 +776,17 @@ void Scene2100::Action9::signal() {
scene->_stripManager.start(6050, this);
break;
case 2:
- scene->_soundHandler.startSound(99);
+ scene->_soundHandler.play(99);
scene->_object4.show();
scene->_object4.animate(ANIM_MODE_5, this);
break;
case 3:
- scene->_soundHandler.startSound(12);
+ scene->_soundHandler.play(12);
scene->_object4.setStrip(2);
scene->_stripManager.start(6051, this, scene);
break;
case 4:
- scene->_soundHandler.proc1(0/* was false */);
+ scene->_soundHandler.fadeOut(0/* was false */);
scene->_object4.setStrip(1);
scene->_object4.setFrame(scene->_object4.getFrameCount());
scene->_object4.animate(ANIM_MODE_6, this);
@@ -847,7 +847,7 @@ void Scene2100::Action10::signal() {
break;
}
case 5:
- scene->_soundHandler.startSound(162);
+ scene->_soundHandler.play(162);
scene->_object1.animate(ANIM_MODE_5, this);
break;
case 6: {
@@ -880,7 +880,7 @@ void Scene2100::Action10::signal() {
setDelay(45);
break;
case 9:
- scene->_soundHandler.startSound(162);
+ scene->_soundHandler.play(162);
scene->_object1.animate(ANIM_MODE_6, this);
break;
case 10:
@@ -924,7 +924,7 @@ void Scene2100::Action11::signal() {
break;
}
case 3:
- scene->_soundHandler.startSound(162);
+ scene->_soundHandler.play(162);
scene->_object1.animate(ANIM_MODE_5, this);
break;
case 4: {
@@ -945,7 +945,7 @@ void Scene2100::Action11::signal() {
setDelay(45);
break;
case 6:
- scene->_soundHandler.startSound(162);
+ scene->_soundHandler.play(162);
scene->_object1.animate(ANIM_MODE_6, this);
break;
case 7:
@@ -970,7 +970,7 @@ void Scene2100::Action12::signal() {
scene->_stripManager.start(6000, this);
break;
case 2:
- scene->_soundHandler.startSound(162);
+ scene->_soundHandler.play(162);
scene->_object1.animate(ANIM_MODE_5, this);
break;
case 3: {
@@ -984,7 +984,7 @@ void Scene2100::Action12::signal() {
break;
}
case 4: {
- scene->_soundHandler.startSound(162);
+ scene->_soundHandler.play(162);
scene->_object1.animate(ANIM_MODE_6, NULL);
_globals->_player.fixPriority(-1);
@@ -1096,7 +1096,7 @@ void Scene2100::Action14::signal() {
scene->_stripManager.start(6008, this);
break;
case 4:
- scene->_soundHandler.startSound(99);
+ scene->_soundHandler.play(99);
scene->_object4.show();
scene->_object4.animate(ANIM_MODE_5, this);
break;
@@ -1105,7 +1105,7 @@ void Scene2100::Action14::signal() {
scene->_stripManager.start(6009, this, scene);
break;
case 6:
- scene->_soundHandler.proc1(0/* was false */);
+ scene->_soundHandler.fadeOut(0/* was false */);
scene->_object4.setStrip(1);
scene->_object4.setFrame(scene->_object4.getFrameCount());
scene->_object4.animate(ANIM_MODE_6, this);
@@ -1136,7 +1136,7 @@ void Scene2100::Action14::signal() {
break;
}
case 10:
- scene->_soundHandler.startSound(162);
+ scene->_soundHandler.play(162);
scene->_object1.animate(ANIM_MODE_5, this);
break;
case 11: {
@@ -1151,7 +1151,7 @@ void Scene2100::Action14::signal() {
break;
case 13:
scene->_object3.fixPriority(1);
- scene->_soundHandler.startSound(162);
+ scene->_soundHandler.play(162);
scene->_object1.animate(ANIM_MODE_6, this);
break;
case 14:
@@ -1180,7 +1180,7 @@ void Scene2100::Action15::signal() {
scene->_object3.fixPriority(1);
scene->_object3.changeZoom(-1);
- scene->_soundHandler.startSound(162);
+ scene->_soundHandler.play(162);
scene->_object1.animate(ANIM_MODE_5, this);
break;
case 2: {
@@ -1191,7 +1191,7 @@ void Scene2100::Action15::signal() {
break;
}
case 3: {
- scene->_soundHandler.startSound(162);
+ scene->_soundHandler.play(162);
scene->_object1.animate(ANIM_MODE_6, this);
Common::Point pt(272, 140);
@@ -1251,7 +1251,7 @@ void Scene2100::Action16::signal() {
break;
}
case 5:
- scene->_soundHandler.startSound(162);
+ scene->_soundHandler.play(162);
scene->_object1.animate(ANIM_MODE_5, this);
break;
case 6: {
@@ -1266,7 +1266,7 @@ void Scene2100::Action16::signal() {
setDelay(45);
break;
case 8:
- scene->_soundHandler.startSound(162);
+ scene->_soundHandler.play(162);
scene->_object1.animate(ANIM_MODE_6, this);
break;
case 9:
@@ -1295,17 +1295,17 @@ void Scene2100::Action17::signal() {
scene->_stripManager.start(7070, this);
break;
case 4:
- scene->_soundHandler.startSound(99);
+ scene->_soundHandler.play(99);
scene->_object4.show();
scene->_object4.animate(ANIM_MODE_5, this);
break;
case 5:
- scene->_soundHandler.startSound(12);
+ scene->_soundHandler.play(12);
scene->_object4.setStrip(2);
scene->_stripManager.start(7071, this, scene);
break;
case 6:
- scene->_soundHandler.proc1(NULL);
+ scene->_soundHandler.fadeOut(NULL);
scene->_object4.setStrip(1);
scene->_object4.setFrame(scene->_object4.getFrameCount());
scene->_object4.animate(ANIM_MODE_6, this);
@@ -1690,8 +1690,8 @@ void Scene2100::postInit(SceneObjectList *OwnerList) {
switch (_globals->_sceneManager._previousScene) {
case 2120:
- _globals->_soundHandler.startSound(160);
- _globals->_soundHandler.proc5(true);
+ _globals->_soundHandler.play(160);
+ _globals->_soundHandler.holdAt(true);
_object1.fixPriority(-1);
_globals->_player.fixPriority(-1);
_globals->_player.setPosition(Common::Point(80, 66));
@@ -1759,8 +1759,8 @@ void Scene2100::postInit(SceneObjectList *OwnerList) {
}
break;
case 3700:
- _globals->_soundHandler.startSound(160);
- _globals->_soundHandler.proc5(true);
+ _globals->_soundHandler.play(160);
+ _globals->_soundHandler.holdAt(true);
Scene::setZoomPercents(80, 75, 100, 90);
if (_globals->_sceneObjects->contains(&_object2))
@@ -1778,8 +1778,8 @@ void Scene2100::postInit(SceneObjectList *OwnerList) {
setAction(&_sequenceManager, this, 2105, &_object3, NULL);
break;
case 4250:
- _globals->_soundHandler.startSound(160);
- _globals->_soundHandler.proc5(true);
+ _globals->_soundHandler.play(160);
+ _globals->_soundHandler.holdAt(true);
_globals->clearFlag(43);
_globals->_player.setVisage(2104);
@@ -1797,8 +1797,8 @@ void Scene2100::postInit(SceneObjectList *OwnerList) {
setAction(&_sequenceManager, this, 2107, &_object4, NULL);
break;
case 5000:
- _globals->_soundHandler.startSound(160);
- _globals->_soundHandler.proc5(true);
+ _globals->_soundHandler.play(160);
+ _globals->_soundHandler.holdAt(true);
if (_globals->_sceneObjects->contains(&_object2))
_object2.remove();
@@ -1814,8 +1814,8 @@ void Scene2100::postInit(SceneObjectList *OwnerList) {
setAction(&_action5);
break;
case 5100:
- _globals->_soundHandler.startSound(160);
- _globals->_soundHandler.proc5(true);
+ _globals->_soundHandler.play(160);
+ _globals->_soundHandler.holdAt(true);
_globals->_player.setVisage(2104);
_globals->_player.setFrame(1);
_globals->_player.setPosition(Common::Point(65, 149));
@@ -1833,8 +1833,8 @@ void Scene2100::postInit(SceneObjectList *OwnerList) {
setAction(&_action9);
break;
case 7000:
- _globals->_soundHandler.startSound(160);
- _globals->_soundHandler.proc5(true);
+ _globals->_soundHandler.play(160);
+ _globals->_soundHandler.holdAt(true);
if (RING_INVENTORY._stasisBox2._sceneNumber == 1) {
_globals->_player.fixPriority(1);
@@ -1861,8 +1861,8 @@ void Scene2100::postInit(SceneObjectList *OwnerList) {
}
break;
case 7600:
- _globals->_soundHandler.startSound(160);
- _globals->_soundHandler.proc5(true);
+ _globals->_soundHandler.play(160);
+ _globals->_soundHandler.holdAt(true);
if (_globals->_sceneObjects->contains(&_object2))
_object2.remove();
@@ -1873,8 +1873,8 @@ void Scene2100::postInit(SceneObjectList *OwnerList) {
setAction(&_action8);
break;
case 8100:
- _globals->_soundHandler.startSound(160);
- _globals->_soundHandler.proc5(true);
+ _globals->_soundHandler.play(160);
+ _globals->_soundHandler.holdAt(true);
_globals->_player.setVisage(2104);
_globals->_player.setFrame(1);
@@ -1886,8 +1886,8 @@ void Scene2100::postInit(SceneObjectList *OwnerList) {
setAction(&_sequenceManager, this, 2106, NULL);
break;
case 9750:
- _globals->_soundHandler.startSound(160);
- _globals->_soundHandler.proc5(true);
+ _globals->_soundHandler.play(160);
+ _globals->_soundHandler.holdAt(true);
_globals->_player.setVisage(2104);
_globals->_player.setFrame(1);
@@ -1904,8 +1904,8 @@ void Scene2100::postInit(SceneObjectList *OwnerList) {
setAction(&_sequenceManager, this, 2103, &_object4, NULL);
break;
default:
- _globals->_soundHandler.startSound(160);
- _globals->_soundHandler.proc5(true);
+ _globals->_soundHandler.play(160);
+ _globals->_soundHandler.holdAt(true);
_globals->_player._uiEnabled = true;
break;
@@ -1962,7 +1962,7 @@ void Scene2100::signal() {
void Scene2100::synchronize(Serializer &s) {
Scene::synchronize(s);
if (s.getVersion() >= 3)
- s.syncAsSint16LE(_sitFl);
+ s.syncAsSint16LE(_sitFl);
}
/*--------------------------------------------------------------------------
@@ -2074,7 +2074,7 @@ void Scene2120::Action1::dispatch() {
_actionIndex = !_entries[scene->_subjectIndex]._visage ? 4 : 3;
setDelay(30);
- scene->_soundHandler.startSound(159);
+ scene->_soundHandler.play(159);
}
// Next Page button handling
@@ -2105,7 +2105,7 @@ void Scene2120::Action1::dispatch() {
setDelay(30);
}
- scene->_soundHandler.startSound(159);
+ scene->_soundHandler.play(159);
}
// Previous Page button handling
@@ -2132,7 +2132,7 @@ void Scene2120::Action1::dispatch() {
break;
}
- scene->_soundHandler.startSound(159);
+ scene->_soundHandler.play(159);
}
// Exit button handling
@@ -2162,7 +2162,7 @@ void Scene2120::Action1::dispatch() {
setDelay(1);
}
- scene->_soundHandler.startSound(159);
+ scene->_soundHandler.play(159);
}
}
@@ -2232,7 +2232,7 @@ void Scene2150::Action1::signal() {
break;
}
case 1:
- scene->_soundHandler.startSound(162);
+ scene->_soundHandler.play(162);
scene->_hotspot1.animate(ANIM_MODE_5, this);
break;
case 2: {
@@ -2282,7 +2282,7 @@ void Scene2150::Action1::signal() {
}
}
- scene->_soundHandler.startSound(161);
+ scene->_soundHandler.play(161);
scene->_area1.restore();
scene->_area2.restore();
scene->_area3.restore();
@@ -2291,7 +2291,7 @@ void Scene2150::Action1::signal() {
if (_state == 2150) {
setDelay(1);
} else {
- scene->_soundHandler.startSound(162);
+ scene->_soundHandler.play(162);
scene->_hotspot1.animate(ANIM_MODE_6, this);
}
break;
@@ -2306,7 +2306,7 @@ void Scene2150::Action1::signal() {
}
break;
case 6:
- scene->_soundHandler.startSound(162);
+ scene->_soundHandler.play(162);
scene->_hotspot1.animate(ANIM_MODE_6, this);
break;
case 7:
@@ -2333,10 +2333,10 @@ void Scene2150::Action2::signal() {
_globals->_player.setStrip(8);
_globals->_player.animate(ANIM_MODE_8, 1, this);
- scene->_soundHandler.startSound(163);
+ scene->_soundHandler.play(163);
break;
case 2:
- scene->_soundHandler.startSound(164);
+ scene->_soundHandler.play(164);
scene->_hotspot10.animate(ANIM_MODE_5, this);
break;
case 3:
@@ -2361,7 +2361,7 @@ void Scene2150::Action2::signal() {
_globals->_player.animate(ANIM_MODE_5, this);
break;
case 5:
- scene->_soundHandler.startSound(164);
+ scene->_soundHandler.play(164);
scene->_hotspot10.animate(ANIM_MODE_6, NULL);
scene->_hotspot14.remove();
@@ -2559,8 +2559,8 @@ void Scene2150::postInit(SceneObjectList *OwnerList) {
switch (_globals->_sceneManager._previousScene) {
case 2120:
- _globals->_soundHandler.startSound(160);
- _globals->_soundHandler.proc5(true);
+ _globals->_soundHandler.play(160);
+ _globals->_soundHandler.holdAt(true);
_globals->_player.setPosition(Common::Point(108, 99));
break;
case 2200:
@@ -2709,7 +2709,7 @@ void Scene2200::Action3::signal() {
switch (_actionIndex++) {
case 0: {
- scene->_soundHandler2.startSound(103);
+ scene->_soundHandler2.play(103);
scene->_hotspot4.setStrip(4);
scene->_hotspot4.animate(ANIM_MODE_NONE, NULL);
@@ -2726,7 +2726,7 @@ void Scene2200::Action3::signal() {
break;
}
case 1:
- scene->_soundHandler2.startSound(104);
+ scene->_soundHandler2.play(104);
scene->_hotspot4.setStrip(2);
scene->_hotspot4.setFrame(2);
setDelay(120);
@@ -2882,7 +2882,7 @@ void Scene2200::Hotspot9::doAction(int action) {
break;
case OBJECT_INFODISK:
if (_globals->_sceneManager._previousScene == 2310) {
- scene->_soundHandler2.startSound(35);
+ scene->_soundHandler2.play(35);
_globals->_player.disableControl();
scene->setAction(&scene->_action3);
}
@@ -2943,8 +2943,8 @@ void Scene2200::postInit(SceneObjectList *OwnerList) {
_hotspot8.remove();
break;
case 4000:
- _globals->_soundHandler.startSound(100);
- _globals->_soundHandler.proc5(true);
+ _globals->_soundHandler.play(100);
+ _globals->_soundHandler.holdAt(true);
_globals->_player.remove();
_hotspot5.remove();
_hotspot8.remove();
@@ -2984,9 +2984,9 @@ void Scene2200::postInit(SceneObjectList *OwnerList) {
_hotspot4.fixPriority(255);
_globals->_sceneItems.push_back(&_hotspot4);
- _soundHandler1.startSound(101);
- _soundHandler2.startSound(100);
- _globals->_soundHandler.proc5(true);
+ _soundHandler1.play(101);
+ _soundHandler2.play(100);
+ _globals->_soundHandler.holdAt(true);
_globals->_sceneItems.push_back(&_hotspot5);
setAction(&_action2);
@@ -3139,7 +3139,7 @@ void Scene2222::postInit(SceneObjectList *OwnerList) {
setAction(&_action1);
}
- _soundHandler.startSound(116);
+ _soundHandler.play(116);
_globals->_sceneManager._scene->_sceneBounds.center(_hotspot1._position);
_globals->_sceneManager._scene->_sceneBounds.contain(_globals->_sceneManager._scene->_backgroundBounds);
@@ -3225,7 +3225,7 @@ void Scene2230::Action2::signal() {
_globals->_player.animate(ANIM_MODE_5, this);
break;
case 3:
- scene->_soundHandler.startSound(157);
+ scene->_soundHandler.play(157);
_globals->_player._moveDiff = Common::Point(1, 1);
_globals->_player.setAction(&scene->_action4);
_globals->_player._uiEnabled = true;
@@ -3249,7 +3249,7 @@ void Scene2230::Action3::signal() {
NpcMover *mover = new NpcMover();
_globals->_player.addMover(mover, &pt, this);
- scene->_soundHandler.proc3();
+ scene->_soundHandler.stop();
break;
}
case 1:
@@ -3368,7 +3368,7 @@ void Scene2230::Action7::signal() {
break;
}
case 2: {
- scene->_soundHandler.startSound(158);
+ scene->_soundHandler.play(158);
scene->_hotspot8.setStrip2(2);
Common::Point pt(scene->_hotspot8._position.x, 97);
@@ -3451,7 +3451,7 @@ void Scene2230::Action8::signal() {
scene->_hotspot2.animate(ANIM_MODE_6, this);
break;
case 4: {
- scene->_soundHandler.startSound(158);
+ scene->_soundHandler.play(158);
scene->_hotspot2.remove();
scene->_hotspot8._frame = 1;
@@ -3774,7 +3774,7 @@ void Scene2280::Action1::signal() {
break;
}
case 1:
- scene->_soundHandler.startSound(162);
+ scene->_soundHandler.play(162);
scene->_hotspot16.animate(ANIM_MODE_5, this);
break;
case 2: {
@@ -3789,7 +3789,7 @@ void Scene2280::Action1::signal() {
break;
case 4:
_globals->_player.fixPriority(1);
- scene->_soundHandler.startSound(162);
+ scene->_soundHandler.play(162);
scene->_hotspot16.animate(ANIM_MODE_6, this);
break;
case 5:
@@ -3810,7 +3810,7 @@ void Scene2280::Action2::signal() {
break;
}
case 1:
- scene->_soundHandler.startSound(265);
+ scene->_soundHandler.play(265);
_globals->_player.setVisage(2162);
_globals->_player._frame = 1;
@@ -3830,7 +3830,7 @@ void Scene2280::Action2::signal() {
scene->_hotspot12.remove();
break;
case 4:
- scene->_soundHandler.startSound(266);
+ scene->_soundHandler.play(266);
_globals->_player.setVisage(2170);
_globals->_player._frame = 1;
_globals->_player._strip = 4;
@@ -3858,7 +3858,7 @@ void Scene2280::Action3::signal() {
break;
}
case 1:
- scene->_soundHandler.startSound(265);
+ scene->_soundHandler.play(265);
_globals->_player.setVisage(2162);
_globals->_player._frame = 6;
@@ -4338,8 +4338,8 @@ void Scene2280::postInit(SceneObjectList *OwnerList) {
_sceneMode = 2281;
setAction(&_sequenceManager, this, 2281, &_globals->_player, &_hotspot16, NULL);
- _globals->_soundHandler.startSound(160);
- _globals->_soundHandler.proc5(true);
+ _globals->_soundHandler.play(160);
+ _globals->_soundHandler.holdAt(true);
}
_globals->_sceneItems.addItems(&_hotspot13, &_hotspot11, &_hotspot9, &_hotspot14, &_hotspot7,
@@ -4390,7 +4390,7 @@ void Scene2300::Action1::signal() {
}
case 2: {
scene->_hotspot8.setAction(&scene->_action4);
- scene->_soundHandler2.startSound(21);
+ scene->_soundHandler2.play(21);
Common::Point pt1(95, scene->_hotspot5._position.y);
NpcMover *mover1 = new NpcMover();
@@ -4428,7 +4428,7 @@ void Scene2300::Action1::signal() {
break;
}
case 6:
- scene->_soundHandler1.startSound(28);
+ scene->_soundHandler1.play(28);
_globals->_player.disableControl();
scene->_hotspot2.setVisage(40);
@@ -4442,7 +4442,7 @@ void Scene2300::Action1::signal() {
_globals->_player.animate(ANIM_MODE_5, this);
break;
case 7:
- _globals->_soundHandler.startSound(77, this);
+ _globals->_soundHandler.play(77, this);
break;
case 8:
_globals->_game->endGame(2300, 0);
@@ -4470,7 +4470,7 @@ void Scene2300::Action1::signal() {
_globals->_player.animate(ANIM_MODE_5, this);
break;
case 11:
- scene->_soundHandler1.startSound(28);
+ scene->_soundHandler1.play(28);
scene->_hotspot5._strip = 2;
scene->_hotspot6._strip = 2;
@@ -4487,7 +4487,7 @@ void Scene2300::Action1::signal() {
_globals->_player.animate(ANIM_MODE_6, this);
break;
case 12:
- scene->_soundHandler1.startSound(77);
+ scene->_soundHandler1.play(77);
_globals->_player.setVisage(0);
_globals->_player.animate(ANIM_MODE_1, NULL);
_globals->_player.setStrip(4);
@@ -4565,8 +4565,8 @@ void Scene2300::Action2::signal() {
scene->_hotspot2.setFrame(1);
scene->_hotspot2.animate(ANIM_MODE_5, this);
- scene->_soundHandler1.startSound(28);
- scene->_soundHandler2.startSound(97);
+ scene->_soundHandler1.play(28);
+ scene->_soundHandler2.play(97);
break;
case 7:
scene->_hotspot7._strip = 2;
@@ -4610,8 +4610,8 @@ void Scene2300::Action3::signal() {
_globals->_player.animate(ANIM_MODE_5, this);
break;
case 3:
- scene->_soundHandler1.startSound(97);
- scene->_soundHandler2.startSound(28);
+ scene->_soundHandler1.play(97);
+ scene->_soundHandler2.play(28);
scene->_hotspot7._strip = 2;
scene->_hotspot7._frame = 1;
@@ -4623,7 +4623,7 @@ void Scene2300::Action3::signal() {
_globals->_player.animate(ANIM_MODE_6, NULL);
break;
case 4:
- scene->_soundHandler2.startSound(97);
+ scene->_soundHandler2.play(97);
_globals->_player.setVisage(0);
_globals->_player.animate(ANIM_MODE_1, NULL);
_globals->_player.setStrip(1);
@@ -4645,7 +4645,7 @@ void Scene2300::Action4::signal() {
switch (_actionIndex++) {
case 0:
scene->_hotspot8.animate(ANIM_MODE_5, this);
- scene->_soundHandler1.startSound(11);
+ scene->_soundHandler1.play(11);
break;
case 1:
scene->_hotspot9.postInit();
@@ -4655,7 +4655,7 @@ void Scene2300::Action4::signal() {
scene->_hotspot9.setPosition(Common::Point(273, 199));
scene->_hotspot9.fixPriority(19);
scene->_hotspot9.animate(ANIM_MODE_5, this);
- scene->_soundHandler1.startSound(11);
+ scene->_soundHandler1.play(11);
break;
case 2:
scene->_hotspot8.remove();
@@ -4666,10 +4666,10 @@ void Scene2300::Action4::signal() {
scene->_hotspot10.setFrame(4);
scene->_hotspot10.setPosition(Common::Point(292, 113));
scene->_hotspot10.animate(ANIM_MODE_5, this);
- scene->_soundHandler1.startSound(11);
+ scene->_soundHandler1.play(11);
break;
case 3:
- scene->_soundHandler1.startSound(13);
+ scene->_soundHandler1.play(13);
remove();
break;
}
@@ -4747,7 +4747,7 @@ void Scene2300::postInit(SceneObjectList *OwnerList) {
_hotspot8.setVisage(2301);
_hotspot8.setPosition(Common::Point(288, 74));
- _globals->_soundHandler.startSound(96);
+ _globals->_soundHandler.play(96);
if (_globals->_sceneManager._previousScene == 2000) {
_hotspot8.remove();
@@ -4778,8 +4778,8 @@ void Scene2300::postInit(SceneObjectList *OwnerList) {
_hotspot7.setPosition(Common::Point(229, 125));
_hotspot7._numFrames = 5;
- _soundHandler1.startSound(95);
- _soundHandler2.startSound(96);
+ _soundHandler1.play(95);
+ _soundHandler2.play(96);
_globals->_sceneItems.push_back(&_hotspot7);
setAction(&_action2);
@@ -5062,7 +5062,7 @@ void Scene2320::Action2::signal() {
switch (_actionIndex++) {
case 0: {
- scene->_soundHandler.startSound(253);
+ scene->_soundHandler.play(253);
scene->_hotspot13.fixPriority(99);
Common::Point pt(scene->_hotspot13._position.x, 200);
@@ -5088,7 +5088,7 @@ void Scene2320::Action3::signal() {
break;
}
case 1:
- scene->_soundHandler.startSound(162);
+ scene->_soundHandler.play(162);
scene->_hotspot6.animate(ANIM_MODE_5, this);
break;
case 2: {
@@ -5137,7 +5137,7 @@ void Scene2320::Action3::signal() {
}
}
- scene->_soundHandler.startSound(161);
+ scene->_soundHandler.play(161);
scene->_area1.restore();
scene->_area2.restore();
scene->_area3.restore();
@@ -5146,7 +5146,7 @@ void Scene2320::Action3::signal() {
if (_state == 2320) {
setDelay(10);
} else {
- scene->_soundHandler.startSound(162);
+ scene->_soundHandler.play(162);
scene->_hotspot6.animate(ANIM_MODE_6, this);
}
break;
@@ -5162,7 +5162,7 @@ void Scene2320::Action3::signal() {
break;
}
case 6:
- scene->_soundHandler.startSound(162);
+ scene->_soundHandler.play(162);
scene->_hotspot6.animate(ANIM_MODE_6, this);
break;
case 7:
@@ -5250,8 +5250,8 @@ void Scene2320::Action4::signal() {
break;
case 10:
if (_globals->getFlag(109)) {
- _globals->_soundHandler.startSound(40);
- _globals->_soundHandler.proc5(true);
+ _globals->_soundHandler.play(40);
+ _globals->_soundHandler.holdAt(true);
Common::Point pt(303, 240);
NpcMover *mover = new NpcMover();
@@ -5311,7 +5311,7 @@ void Scene2320::Action4::signal() {
}
case 19: {
scene->_hotspot16.remove();
- scene->_soundHandler.startSound(253);
+ scene->_soundHandler.play(253);
scene->_hotspot13.show();
Common::Point pt(319, 157);
@@ -5462,7 +5462,7 @@ void Scene2320::Action7::signal() {
setDelay(30);
break;
case 1:
- _globals->_soundHandler.startSound(162);
+ _globals->_soundHandler.play(162);
scene->_hotspot6.animate(ANIM_MODE_5, this);
break;
case 2:
@@ -5889,8 +5889,8 @@ void Scene2320::postInit(SceneObjectList *OwnerList) {
switch (_globals->_sceneManager._previousScene) {
case 2120:
- _globals->_soundHandler.startSound(160);
- _globals->_soundHandler.proc5(true);
+ _globals->_soundHandler.play(160);
+ _globals->_soundHandler.holdAt(true);
_globals->_player.fixPriority(-1);
_globals->_player.setPosition(Common::Point(389, 72));
@@ -5907,8 +5907,8 @@ void Scene2320::postInit(SceneObjectList *OwnerList) {
case 4250:
case 5000:
case 7000:
- _globals->_soundHandler.startSound(160);
- _globals->_soundHandler.proc5(true);
+ _globals->_soundHandler.play(160);
+ _globals->_soundHandler.holdAt(true);
if ((_globals->_sceneManager._previousScene == 7000) && !_globals->getFlag(80))
_globals->setFlag(36);
@@ -5924,8 +5924,8 @@ void Scene2320::postInit(SceneObjectList *OwnerList) {
setAction(&_action6);
break;
case 6100:
- _globals->_soundHandler.startSound(160);
- _globals->_soundHandler.proc5(true);
+ _globals->_soundHandler.play(160);
+ _globals->_soundHandler.holdAt(true);
_hotspot8.postInit();
_hotspot8.setVisage(2345);
@@ -5936,9 +5936,9 @@ void Scene2320::postInit(SceneObjectList *OwnerList) {
setAction(&_sequenceManager1, this, 2325, &_globals->_player, &_hotspot6, &_hotspot8, &_hotspot7, NULL);
break;
case 7600:
- _globals->_soundHandler.startSound(160);
- _globals->_soundHandler.proc5(true);
- _soundHandler.startSound(21);
+ _globals->_soundHandler.play(160);
+ _globals->_soundHandler.holdAt(true);
+ _soundHandler.play(21);
_globals->_player.setVisage(2323);
_globals->_player.setStrip(2);
@@ -5995,8 +5995,8 @@ void Scene2320::postInit(SceneObjectList *OwnerList) {
setAction(&_sequenceManager1, this, 2325, &_globals->_player, &_hotspot6, &_hotspot8, &_hotspot7, NULL);
break;
default:
- _globals->_soundHandler.startSound(160);
- _globals->_soundHandler.proc5(true);
+ _globals->_soundHandler.play(160);
+ _globals->_soundHandler.holdAt(true);
_sceneMode = 2321;
_globals->_player.setStrip(3);
@@ -6127,7 +6127,7 @@ void Scene2400::postInit(SceneObjectList *OwnerList) {
_globals->_sceneManager._scene->_sceneBounds.contain(_globals->_sceneManager._scene->_backgroundBounds);
_globals->_sceneOffset.x = (_globals->_sceneManager._scene->_sceneBounds.left / 160) * 160;
- _globals->_soundHandler.startSound(153);
+ _globals->_soundHandler.play(153);
}
} // End of namespace tSage
diff --git a/engines/tsage/ringworld_scenes3.h b/engines/tsage/ringworld_scenes3.h
index cc237a1f91..711360c190 100644
--- a/engines/tsage/ringworld_scenes3.h
+++ b/engines/tsage/ringworld_scenes3.h
@@ -114,7 +114,7 @@ public:
Action14 _action14;
SceneObject _object1, _object2, _object3, _object4, _object5;
SceneObject _object6, _object7, _object8, _object9, _object10;
- SoundHandler _soundHandler1, _soundHandler2;
+ ASound _soundHandler1, _soundHandler2;
virtual void postInit(SceneObjectList *OwnerList = NULL);
virtual void stripCallback(int v);
@@ -232,7 +232,7 @@ class Scene2100 : public Scene {
};
public:
SequenceManager _sequenceManager;
- SoundHandler _soundHandler;
+ ASound _soundHandler;
SpeakerMText _speakerMText;
SpeakerMR _speakerMR;
SpeakerQL _speakerQL;
@@ -311,7 +311,7 @@ class Scene2120 : public Scene {
};
public:
- SoundHandler _soundHandler;
+ ASound _soundHandler;
SceneObject _topicArrowHotspot, _arrowHotspot, _visageHotspot;
SceneObject _subjectButton, _nextPageButton, _previousPageButton, _exitButton;
Action1 _action1;
@@ -359,7 +359,7 @@ class Scene2150 : public Scene {
virtual void doAction(int action);
};
public:
- SoundHandler _soundHandler;
+ ASound _soundHandler;
SequenceManager _sequenceManager;
SpeakerGameText _speakerGameText;
@@ -440,7 +440,7 @@ public:
DisplayHotspot _hotspot10;
SceneObject _hotspot2, _hotspot4;
SceneObject _hotspot6, _hotspot7, _hotspot8;
- SoundHandler _soundHandler1, _soundHandler2;
+ ASound _soundHandler1, _soundHandler2;
Scene2200();
virtual void postInit(SceneObjectList *OwnerList = NULL);
@@ -462,7 +462,7 @@ class Scene2222 : public Scene {
};
public:
- SoundHandler _soundHandler;
+ ASound _soundHandler;
SpeakerSText _speakerSText;
SpeakerMText _speakerMText;
SpeakerQText _speakerQText;
@@ -552,7 +552,7 @@ class Scene2230 : public Scene {
virtual void doAction(int action);
};
public:
- SoundHandler _soundHandler;
+ ASound _soundHandler;
Action1 _action1;
Action2 _action2;
Action3 _action3;
@@ -652,7 +652,7 @@ class Scene2280 : public Scene {
};
public:
- SoundHandler _soundHandler;
+ ASound _soundHandler;
SequenceManager _sequenceManager;
Rect _exitRect;
Action1 _action1;
@@ -712,7 +712,7 @@ class Scene2300 : public Scene {
virtual void doAction(int action);
};
public:
- SoundHandler _soundHandler1, _soundHandler2;
+ ASound _soundHandler1, _soundHandler2;
SpeakerSL _speakerSL;
SpeakerMText _speakerMText;
SpeakerQText _speakerQText;
@@ -834,7 +834,7 @@ class Scene2320 : public Scene {
virtual void doAction(int action);
};
public:
- SoundHandler _soundHandler;
+ ASound _soundHandler;
SequenceManager _sequenceManager1, _sequenceManager2;
SpeakerMText _speakerMText;
SpeakerMR _speakerMR;
diff --git a/engines/tsage/ringworld_scenes4.cpp b/engines/tsage/ringworld_scenes4.cpp
index 883da9b5b1..838769e4af 100644
--- a/engines/tsage/ringworld_scenes4.cpp
+++ b/engines/tsage/ringworld_scenes4.cpp
@@ -178,7 +178,7 @@ void Scene3700::Action1::signal() {
setDelay(90);
break;
case 3:
- scene->_soundHandler.startSound(196);
+ scene->_soundHandler.play(196);
scene->_viewer.hide();
scene->_hotspot1.postInit();
@@ -190,7 +190,7 @@ void Scene3700::Action1::signal() {
setDelay(90);
break;
case 4:
- scene->_soundHandler.startSound(197);
+ scene->_soundHandler.play(197);
scene->_hotspot1.hide();
scene->_hotspot2.postInit();
@@ -202,7 +202,7 @@ void Scene3700::Action1::signal() {
setDelay(30);
break;
case 5:
- scene->_soundHandler.startSound(198);
+ scene->_soundHandler.play(198);
scene->_hotspot2.hide();
scene->_hotspot1.show();
setDelay(90);
@@ -244,7 +244,7 @@ void Scene3700::postInit(tSage::SceneObjectList *OwnerList) {
_viewer.setPosition(Common::Point(195, 83));
setAction(&_action1);
- _globals->_soundHandler.startSound(195);
+ _globals->_soundHandler.play(195);
}
} // End of namespace tSage
diff --git a/engines/tsage/ringworld_scenes4.h b/engines/tsage/ringworld_scenes4.h
index 389c67b83a..0b575d02d3 100644
--- a/engines/tsage/ringworld_scenes4.h
+++ b/engines/tsage/ringworld_scenes4.h
@@ -82,7 +82,7 @@ public:
SpeakerSText _speakerSText;
SpeakerMText _speakerMText;
SpeakerMR _speakerMR;
- SoundHandler _soundHandler;
+ ASound _soundHandler;
virtual void postInit(SceneObjectList *OwnerList = NULL);
};
diff --git a/engines/tsage/ringworld_scenes5.cpp b/engines/tsage/ringworld_scenes5.cpp
index 8b95e40abe..fccc7e1b50 100644
--- a/engines/tsage/ringworld_scenes5.cpp
+++ b/engines/tsage/ringworld_scenes5.cpp
@@ -102,7 +102,7 @@ void Scene4000::Action1::signal() {
ADD_MOVER_NULL(scene->_hotspot5, -40, 86);
break;
case 5:
- _globals->_soundHandler.startSound(155);
+ _globals->_soundHandler.play(155);
_globals->setFlag(43);
_globals->setFlag(114);
scene->_stripManager.start(4430, this);
@@ -354,14 +354,14 @@ void Scene4000::Action8::signal() {
setDelay(60);
break;
case 3:
- _globals->_soundHandler.startSound(170);
+ _globals->_soundHandler.play(170);
scene->_smoke2.setVisage(4000);
scene->_smoke2.setStrip(6);
scene->_smoke2.animate(ANIM_MODE_2, NULL);
setDelay(60);
break;
case 4:
- _globals->_soundHandler.startSound(77, this);
+ _globals->_soundHandler.play(77, this);
break;
case 5:
_globals->_game->endGame(4000, 15);
@@ -429,7 +429,7 @@ void Scene4000::Action11::signal() {
scene->_olo.animate(ANIM_MODE_1, NULL);
break;
case 5:
- scene->_soundHandler1.proc3();
+ scene->_soundHandler1.stop();
scene->_forceField.remove();
ADD_MOVER(_globals->_player, 340, 163);
@@ -494,12 +494,12 @@ void Scene4000::Action13::signal() {
setDelay(3);
break;
case 1:
- scene->_soundHandler2.startSound(151);
- scene->_soundHandler2.proc5(true);
+ scene->_soundHandler2.play(151);
+ scene->_soundHandler2.holdAt(true);
ADD_MOVER(scene->_lander, -30, 70);
break;
case 2:
- scene->_soundHandler2.proc4();
+ scene->_soundHandler2.release();
_globals->_sceneManager.changeScene(4010);
break;
}
@@ -867,7 +867,7 @@ void Scene4000::postInit(SceneObjectList *OwnerList) {
_theTech.setPosition(Common::Point(281, 176));
if (_globals->getFlag(34)) {
- _soundHandler1.startSound(156);
+ _soundHandler1.play(156);
_forceField.postInit();
_forceField.setVisage(4000);
@@ -900,7 +900,7 @@ void Scene4000::postInit(SceneObjectList *OwnerList) {
switch (_globals->_sceneManager._previousScene) {
case 2320:
- _globals->_soundHandler.startSound(155);
+ _globals->_soundHandler.play(155);
if (RING_INVENTORY._ale._sceneNumber == 1) {
_guardRock.postInit();
@@ -962,7 +962,7 @@ void Scene4000::postInit(SceneObjectList *OwnerList) {
}
if (_globals->_stripNum == 4025) {
- _soundHandler1.startSound(182);
+ _soundHandler1.play(182);
_forceField.remove();
_hotspot5.postInit();
@@ -1043,7 +1043,7 @@ void Scene4000::postInit(SceneObjectList *OwnerList) {
break;
case 4050:
- _globals->_soundHandler.startSound(155);
+ _globals->_soundHandler.play(155);
_globals->_player.disableControl();
if (_globals->_stripNum == 4050) {
@@ -1080,7 +1080,7 @@ void Scene4000::postInit(SceneObjectList *OwnerList) {
break;
default:
- _globals->_soundHandler.startSound(155);
+ _globals->_soundHandler.play(155);
_lander.postInit();
_lander.setVisage(4002);
@@ -1104,7 +1104,7 @@ void Scene4000::postInit(SceneObjectList *OwnerList) {
RING_INVENTORY._ladder._sceneNumber = 4100;
RING_INVENTORY._rope._sceneNumber = 4150;
- _soundHandler1.startSound(156);
+ _soundHandler1.play(156);
_forceField.postInit();
_forceField.setVisage(4000);
@@ -1243,8 +1243,8 @@ void Scene4000::dispatch() {
if ((RING_INVENTORY._peg._sceneNumber == 1) && _globals->getFlag(34) &&
_globals->getFlag(37) && !_globals->getFlag(40)) {
_globals->_player.disableControl();
- _soundHandler1.startSound(177);
- _globals->_soundHandler.startSound(178);
+ _soundHandler1.play(177);
+ _globals->_soundHandler.play(178);
setAction(&_action1);
}
@@ -1892,7 +1892,7 @@ void Scene4045::postInit(SceneObjectList *OwnerList) {
_olloFace.fixPriority(152);
if(_globals->_sceneManager._previousScene == 4050) {
- _globals->_soundHandler.startSound(155);
+ _globals->_soundHandler.play(155);
_globals->_player.setPosition(Common::Point(72, 128));
_globals->_player.enableControl();
@@ -1921,7 +1921,7 @@ void Scene4045::postInit(SceneObjectList *OwnerList) {
_miranda.setStrip(3);
_miranda.setFrame(2);
_miranda.changeZoom(-1);
-
+
_miranda.setPosition(Common::Point(66, 209));
_globals->_sceneItems.push_back(&_miranda);
}
@@ -2273,7 +2273,7 @@ void Scene4050::postInit(SceneObjectList *OwnerList) {
_globals->_player.setStrip(2);
setAction(&_action2);
- _globals->_soundHandler.startSound(175);
+ _globals->_soundHandler.play(175);
} else {
// Without the rope
_globals->_player.setVisage(5315);
@@ -2284,7 +2284,7 @@ void Scene4050::postInit(SceneObjectList *OwnerList) {
_globals->_player.animate(ANIM_MODE_2, NULL);
setAction(&_action4);
- _globals->_soundHandler.startSound(176);
+ _globals->_soundHandler.play(176);
}
break;
case 4045:
@@ -2298,7 +2298,7 @@ void Scene4050::postInit(SceneObjectList *OwnerList) {
_globals->_player.setObjectWrapper(new SceneObjectWrapper());
_globals->_player.setPosition(Common::Point(193, 193));
- _globals->_soundHandler.startSound(175);
+ _globals->_soundHandler.play(175);
break;
default:
break;
@@ -2717,7 +2717,7 @@ void Scene4100::postInit(SceneObjectList *OwnerList) {
&_hotspot11, &_hotspot9, &_hotspot7, &_hotspot10, &_hotspot8, &_hotspot14, NULL);
if (_globals->_sceneManager._previousScene == 4150) {
- _globals->_soundHandler.startSound(155);
+ _globals->_soundHandler.play(155);
if (!_globals->getFlag(42)) {
_hotspot1.setVisage(4104);
@@ -3095,8 +3095,8 @@ void Scene4150::postInit(SceneObjectList *OwnerList) {
&_hotspot10, &_hotspot9, &_hotspot8, &_hotspot7, &_hotspot6, &_hotspot2,
&_hotspot5, NULL);
- _globals->_soundHandler.startSound(165);
- _soundHandler.startSound(311);
+ _globals->_soundHandler.play(165);
+ _soundHandler.play(311);
}
void Scene4150::signal() {
@@ -3110,8 +3110,8 @@ void Scene4150::dispatch() {
Scene::dispatch();
if (!_action && (_globals->_player._position.x >= 316)) {
- _globals->_soundHandler.proc1(NULL);
- _soundHandler.proc1(NULL);
+ _globals->_soundHandler.fadeOut(NULL);
+ _soundHandler.fadeOut(NULL);
_globals->_player.disableControl();
_sceneMode = 4152;
setAction(&_sequenceManager, this, 4152, &_globals->_player, NULL);
@@ -3414,7 +3414,7 @@ void Scene4250::Hotspot6::doAction(int action) {
SceneItem::display2(4250, (RING_INVENTORY._helmet._sceneNumber == 4250) ? 20 : 3);
break;
case OBJECT_HELMET:
- _globals->_soundHandler.startSound(354);
+ _globals->_soundHandler.play(354);
_globals->_player.disableControl();
RING_INVENTORY._helmet._sceneNumber = 4250;
@@ -3443,7 +3443,7 @@ void Scene4250::Hotspot6::doAction(int action) {
break;
case OBJECT_NULLIFIER:
if (RING_INVENTORY._helmet._sceneNumber == 4250) {
- _globals->_soundHandler.startSound(353);
+ _globals->_soundHandler.play(353);
_globals->_player.disableControl();
RING_INVENTORY._helmet._sceneNumber = 1;
@@ -3650,7 +3650,7 @@ void Scene4250::postInit(tSage::SceneObjectList *OwnerList) {
_hotspot7.setBounds(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT));
_globals->_sceneItems.push_back(&_hotspot7);
- _globals->_soundHandler.startSound(185);
+ _globals->_soundHandler.play(185);
}
void Scene4250::signal() {
@@ -3683,7 +3683,7 @@ void Scene4250::signal() {
_globals->_player.enableControl();
break;
case 4259:
- _globals->_soundHandler.startSound(360);
+ _globals->_soundHandler.play(360);
_globals->_sceneManager.changeScene(9900);
break;
case 4261:
@@ -3751,36 +3751,36 @@ void Scene4300::Action1::signal() {
_globals->setFlag(56);
_globals->_scenePalette.addRotation(240, 254, -1);
scene->_hotspot7.animate(ANIM_MODE_6, this);
- _globals->_soundHandler.startSound(164);
+ _globals->_soundHandler.play(164);
break;
case 1:
- _globals->_soundHandler.startSound(340);
- scene->_soundHandler1.startSound(341);
+ _globals->_soundHandler.play(340);
+ scene->_soundHandler1.play(341);
scene->_hotspot1.remove();
setDelay(3);
break;
case 2:
- scene->_soundHandler1.startSound(341);
+ scene->_soundHandler1.play(341);
scene->_hotspot2.remove();
setDelay(6);
break;
case 3:
- scene->_soundHandler1.startSound(341);
+ scene->_soundHandler1.play(341);
scene->_hotspot3.remove();
setDelay(6);
break;
case 4:
- scene->_soundHandler1.startSound(341);
+ scene->_soundHandler1.play(341);
scene->_hotspot4.remove();
setDelay(12);
break;
case 5:
- scene->_soundHandler1.startSound(341);
+ scene->_soundHandler1.play(341);
scene->_hotspot5.remove();
setDelay(12);
break;
case 6:
- scene->_soundHandler1.startSound(341);
+ scene->_soundHandler1.play(341);
scene->_hotspot6.remove();
setDelay(60);
break;
@@ -3793,7 +3793,7 @@ void Scene4300::Action1::signal() {
scene->_stripManager.start(8015, this, scene);
break;
case 9:
- _globals->_soundHandler.startSound(350);
+ _globals->_soundHandler.play(350);
_globals->_sceneManager._fadeMode = FADEMODE_GRADUAL;
_globals->_events.setCursor(CURSOR_USE);
_globals->_player.enableControl();
@@ -3916,7 +3916,7 @@ void Scene4300::Hotspot10::doAction(int action) {
void Scene4300::Hotspot15::signal() {
Scene4300 *scene = (Scene4300 *)_globals->_sceneManager._scene;
- scene->_soundHandler2.startSound(345);
+ scene->_soundHandler2.play(345);
_strip = (_globals->_randomSource.getRandomNumber(6) < 2) ? 2 : 1;
if ((RING_INVENTORY._stasisBox2._sceneNumber == 4300) ||
@@ -3982,7 +3982,7 @@ void Scene4300::Hotspot17::doAction(int action) {
SceneItem::display2(4300, 26);
break;
case OBJECT_STASIS_BOX2:
- scene->_soundHandler1.startSound(352);
+ scene->_soundHandler1.play(352);
_globals->_events.setCursor(CURSOR_USE);
scene->_sceneMode = 4303;
@@ -4241,11 +4241,11 @@ void Scene4301::Action1::signal() {
switch (_actionIndex++) {
case 0:
- scene->_soundHandler.startSound(164);
+ scene->_soundHandler.play(164);
scene->_hotspot1.animate(ANIM_MODE_5, this);
break;
case 1:
- _globals->_soundHandler.startSound(335);
+ _globals->_soundHandler.play(335);
_globals->_events.setCursor(CURSOR_USE);
scene->_hotspot2.postInit();
@@ -4268,9 +4268,9 @@ void Scene4301::Action1::signal() {
_actionIndex = 2;
break;
case 10:
- // Puzzle: Wrong code
+ // Puzzle: Wrong code
_globals->_events.setCursor(CURSOR_NONE);
- scene->_soundHandler.startSound(337);
+ scene->_soundHandler.play(337);
if (scene->_hotspot3._flags & OBJFLAG_HIDE)
scene->_hotspot3.show();
else
@@ -4285,7 +4285,7 @@ void Scene4301::Action1::signal() {
for (_state = 0; _state < 6; ++_state)
_buttonList[_state].remove();
- scene->_soundHandler.startSound(338);
+ scene->_soundHandler.play(338);
scene->_hotspot3.hide();
_actionIndex = 2;
@@ -4295,7 +4295,7 @@ void Scene4301::Action1::signal() {
case 20:
// Puzzle: Correct code
_globals->_player.disableControl();
- scene->_soundHandler.startSound(339);
+ scene->_soundHandler.play(339);
scene->_hotspot3._frame = 3;
if (scene->_hotspot3._flags & OBJFLAG_HIDE)
scene->_hotspot3.show();
@@ -4329,7 +4329,7 @@ void Scene4301::Action1::process(Event &event) {
if ((event.eventType == EVENT_BUTTON_DOWN) && buttonsRect.contains(event.mousePos)) {
event.handled = true;
- scene->_soundHandler.startSound(336);
+ scene->_soundHandler.play(336);
int buttonIndex = ((event.mousePos.y - buttonsRect.top) / 33) * 3 +
((event.mousePos.x - buttonsRect.left) / 33);
diff --git a/engines/tsage/ringworld_scenes5.h b/engines/tsage/ringworld_scenes5.h
index a2991c7283..c3ae9f4aa9 100644
--- a/engines/tsage/ringworld_scenes5.h
+++ b/engines/tsage/ringworld_scenes5.h
@@ -134,7 +134,7 @@ class Scene4000 : public Scene {
};
public:
SequenceManager _sequenceManager1, _sequenceManager2, _sequenceManager3;
- SoundHandler _soundHandler1, _soundHandler2;
+ ASound _soundHandler1, _soundHandler2;
SpeakerQR _speakerQR;
SpeakerML _speakerML;
SpeakerMR _speakerMR;
@@ -471,7 +471,7 @@ class Scene4150 : public Scene {
public:
SequenceManager _sequenceManager;
- SoundHandler _soundHandler;
+ ASound _soundHandler;
SpeakerQText _speakerQText;
SpeakerQR _speakerQR;
SpeakerCDL _speakerCDL;
@@ -541,7 +541,7 @@ class Scene4250 : public Scene {
public:
SequenceManager _sequenceManager;
- SoundHandler _soundHandler;
+ ASound _soundHandler;
SpeakerSR _speakerSR;
SpeakerSL _speakerSL;
SpeakerSText _speakerSText;
@@ -613,7 +613,7 @@ class Scene4300 : public Scene {
virtual void doAction(int action);
};
public:
- SoundHandler _soundHandler1, _soundHandler2;
+ ASound _soundHandler1, _soundHandler2;
SequenceManager _sequenceManager;
GfxButton _gfxButton;
SpeakerQText _speakerQText;
@@ -672,7 +672,7 @@ class Scene4301 : public Scene {
public:
Common::List<int> _list1;
SequenceManager _sequenceManager;
- SoundHandler _soundHandler;
+ ASound _soundHandler;
Action1 _action1;
SceneObject _hotspot1, _hotspot2, _hotspot3;
Hotspot4 _hotspot4;
diff --git a/engines/tsage/ringworld_scenes6.cpp b/engines/tsage/ringworld_scenes6.cpp
index 9e5766d656..68c184196c 100644
--- a/engines/tsage/ringworld_scenes6.cpp
+++ b/engines/tsage/ringworld_scenes6.cpp
@@ -41,8 +41,8 @@ void Scene5000::Action1::signal() {
setDelay(10);
break;
case 1:
- scene->_soundHandler.startSound(190);
- scene->_soundHandler.proc5(true);
+ scene->_soundHandler.play(190);
+ scene->_soundHandler.holdAt(true);
ADD_MOVER(scene->_hotspot1, 283, 12);
break;
case 2:
@@ -55,7 +55,7 @@ void Scene5000::Action1::signal() {
setDelay(15);
break;
case 4:
- scene->_soundHandler.proc4();
+ scene->_soundHandler.release();
ADD_MOVER(scene->_hotspot1, 233, 80);
break;
case 5:
@@ -561,7 +561,7 @@ void Scene5000::postInit(SceneObjectList *OwnerList) {
break;
}
- _globals->_soundHandler.startSound(190);
+ _globals->_soundHandler.play(190);
}
void Scene5000::signal() {
@@ -639,7 +639,7 @@ void Scene5100::Action1::signal() {
}
break;
case 4:
- scene->_soundHandler.startSound(206);
+ scene->_soundHandler.play(206);
scene->_hotspot5.postInit();
scene->_hotspot5.setVisage(5362);
@@ -740,7 +740,7 @@ void Scene5100::Action3::signal() {
_globals->_player.animate(ANIM_MODE_5, this);
break;
case 2:
- scene->_soundHandler.startSound(28);
+ scene->_soundHandler.play(28);
if (static_cast<SceneObject *>(_owner)->_position.x < _globals->_player._position.x) {
scene->_hotspot2.setVisage(5130);
scene->_hotspot2._strip = 1;
@@ -786,7 +786,7 @@ void Scene5100::Action4::signal() {
switch (_actionIndex++) {
case 0: {
_globals->_player.disableControl();
- scene->_soundHandler.startSound(208);
+ scene->_soundHandler.play(208);
SceneItem::display2(5100, 15);
ObjectMover3 *mover = new ObjectMover3();
@@ -1289,7 +1289,7 @@ void Scene5100::postInit(SceneObjectList *OwnerList) {
_globals->_sceneManager._scene->_sceneBounds.center(_globals->_player._position);
loadScene(5100);
- _globals->_soundHandler.startSound(205);
+ _globals->_soundHandler.play(205);
}
void Scene5100::signal() {
@@ -1385,7 +1385,7 @@ void Scene5100::dispatch() {
_globals->_player.disableControl();
_globals->_player.addMover(NULL);
- _soundHandler.startSound(207);
+ _soundHandler.play(207);
_sceneMode = 5103;
setAction(&_sequenceManager, this, (_globals->_player._position.x >= 966) ? 5104 : 5103,
&_globals->_player, &_hotspot15, NULL);
@@ -1396,7 +1396,7 @@ void Scene5100::dispatch() {
(_globals->_sceneManager._previousScene != 5200) && (_sceneMode != 5150)) {
setAction(NULL);
_sceneMode = 5150;
- _soundHandler.startSound(208);
+ _soundHandler.play(208);
if (RING_INVENTORY._vial._sceneNumber == 5100) {
_globals->_player.addMover(NULL);
@@ -1471,7 +1471,7 @@ void Scene5200::Action2::signal() {
_globals->_player.animate(ANIM_MODE_4, 3, 1, this);
break;
case 2:
- scene->_soundHandler.proc3();
+ scene->_soundHandler.stop();
scene->_hotspot14.remove();
RING_INVENTORY._stasisBox._sceneNumber = 1;
@@ -1486,7 +1486,7 @@ void Scene5200::Action2::signal() {
ADD_MOVER(scene->_hotspot8, 141, 77);
break;
case 4:
- scene->_soundHandler.startSound(303);
+ scene->_soundHandler.play(303);
scene->_hotspot8._strip = 2;
scene->_hotspot8._frame = 1;
@@ -1523,7 +1523,7 @@ void Scene5200::Action4::signal() {
setDelay(120);
break;
case 1:
- _globals->_soundHandler.startSound(209);
+ _globals->_soundHandler.play(209);
scene->_stripManager.start(5202, this, scene);
break;
case 2:
@@ -1622,8 +1622,8 @@ void Scene5200::postInit(SceneObjectList *OwnerList) {
_speakerQText._textPos.x = 20;
if (RING_INVENTORY._stasisBox._sceneNumber == 5200) {
- _soundHandler.startSound(216);
- _soundHandler.proc5(true);
+ _soundHandler.play(216);
+ _soundHandler.holdAt(true);
_hotspot14.postInit();
_hotspot14.setVisage(5202);
@@ -1643,7 +1643,7 @@ void Scene5200::postInit(SceneObjectList *OwnerList) {
// Happens when the player enters the throne room via the secret passage,
// after talking with the bat. No NPCs are around and the player can
// obtain the stasis box.
- _globals->_soundHandler.startSound(205);
+ _globals->_soundHandler.play(205);
_globals->_player.disableControl();
_globals->_player.postInit();
@@ -2131,7 +2131,7 @@ void Scene5300::postInit(SceneObjectList *OwnerList) {
_hotspot8._sceneRegionId = 8;
_globals->_sceneItems.addItems(&_hotspot8, &_hotspot2, &_hotspot6, &_hotspot3, &_hotspot7, NULL);
- _globals->_soundHandler.startSound(212);
+ _globals->_soundHandler.play(212);
}
void Scene5300::signal() {
@@ -2141,7 +2141,7 @@ void Scene5300::signal() {
_globals->_sceneManager.changeScene(5100);
break;
case 5307:
- _soundHandler.proc1(NULL);
+ _soundHandler.fadeOut(NULL);
// No break on purpose
case 5302:
case 5308:
diff --git a/engines/tsage/ringworld_scenes6.h b/engines/tsage/ringworld_scenes6.h
index 6ac73d4bff..2e99f5ab87 100644
--- a/engines/tsage/ringworld_scenes6.h
+++ b/engines/tsage/ringworld_scenes6.h
@@ -75,7 +75,7 @@ class Scene5000 : public Scene {
};
public:
SequenceManager _sequenceManager;
- SoundHandler _soundHandler;
+ ASound _soundHandler;
SpeakerSText _speakerSText;
SpeakerQText _speakerQText;
Action1 _action1;
@@ -163,7 +163,7 @@ class Scene5100 : public Scene {
};
public:
SequenceManager _sequenceManager;
- SoundHandler _soundHandler;
+ ASound _soundHandler;
SpeakerMText _speakerMText;
SpeakerQText _speakerQText;
SpeakerSText _speakerSText;
@@ -226,7 +226,7 @@ class Scene5200 : public Scene {
virtual void doAction(int action);
};
public:
- SoundHandler _soundHandler;
+ ASound _soundHandler;
SpeakerFLL _speakerFLL;
SpeakerFLText _speakerFLText;
SpeakerQL _speakerQL;
@@ -291,7 +291,7 @@ class Scene5300 : public Scene {
virtual void doAction(int action);
};
public:
- SoundHandler _soundHandler;
+ ASound _soundHandler;
SequenceManager _sequenceManager;
SpeakerQR _speakerQR;
SpeakerQL _speakerQL;
diff --git a/engines/tsage/ringworld_scenes8.cpp b/engines/tsage/ringworld_scenes8.cpp
index 934c7494fa..2b329b958a 100644
--- a/engines/tsage/ringworld_scenes8.cpp
+++ b/engines/tsage/ringworld_scenes8.cpp
@@ -60,7 +60,7 @@ void Scene7000::Action1::signal() {
setAction(&scene->_action6, this);
break;
case 2:
- scene->_soundHandler.startSound(252);
+ scene->_soundHandler.play(252);
scene->_object8.remove();
scene->_object1.postInit();
scene->_object1.setVisage(7003);
@@ -184,7 +184,7 @@ void Scene7000::Action4::signal() {
setDelay(300);
break;
case 2:
- _globals->_soundHandler.startSound(252);
+ _globals->_soundHandler.play(252);
scene->_object1.show();
scene->_object1.setStrip(3);
scene->_object1.setFrame(1);
@@ -214,7 +214,7 @@ void Scene7000::Action5::signal() {
}
case 1:
_globals->_player.checkAngle(&scene->_object1);
- _globals->_soundHandler.startSound(252);
+ _globals->_soundHandler.play(252);
scene->_object1.setStrip(2);
scene->_stripManager.start(7015, this);
break;
@@ -546,7 +546,7 @@ void Scene7000::postInit(SceneObjectList *OwnerList) {
_object1.animate(ANIM_MODE_8, 0, NULL);
_globals->_sceneItems.push_back(&_object1);
}
- _soundHandler.startSound(251);
+ _soundHandler.play(251);
if (_globals->_sceneManager._previousScene == 2100) {
if (_globals->getFlag(72)) {
_globals->_player.postInit();
@@ -565,7 +565,7 @@ void Scene7000::postInit(SceneObjectList *OwnerList) {
setAction(&_action1);
}
} else {
- _globals->_soundHandler.startSound(250);
+ _globals->_soundHandler.play(250);
_globals->setFlag(72);
_object3.postInit();
@@ -611,9 +611,9 @@ void Scene7000::postInit(SceneObjectList *OwnerList) {
_object3.setVisage(5001);
_object3.setStrip2(1);
_object3.setPosition(Common::Point(307, 0));
- _soundHandler.startSound(151);
- _soundHandler.proc5(1);
- _globals->_soundHandler.startSound(250);
+ _soundHandler.play(151);
+ _soundHandler.holdAt(true);
+ _globals->_soundHandler.play(250);
setAction(&_action3);
}
@@ -1135,9 +1135,9 @@ void Scene7100::postInit(SceneObjectList *OwnerList) {
_object1.setPosition(Common::Point(100, 100));
setAction(&_action11);
- _soundHandler1.startSound(270);
- _soundHandler2.startSound(275);
- _globals->_soundHandler.startSound(270);
+ _soundHandler1.play(270);
+ _soundHandler2.play(275);
+ _globals->_soundHandler.play(270);
}
/*--------------------------------------------------------------------------
* Scene 7200 - Underwater: Entering the cave
@@ -1302,7 +1302,7 @@ void Scene7200::postInit(SceneObjectList *OwnerList) {
_swimmer.setPosition(Common::Point(-8, 16));
setAction(&_action1);
- _soundHandler.startSound(271);
+ _soundHandler.play(271);
}
/*--------------------------------------------------------------------------
@@ -1344,7 +1344,7 @@ void Scene7300::Action1::signal() {
break;
case 7:
setDelay(3);
- _globals->_soundHandler.proc1(NULL);
+ _globals->_soundHandler.fadeOut(NULL);
break;
case 8:
_globals->_sceneManager.changeScene(2280);
@@ -1497,7 +1497,7 @@ void Scene7300::postInit(SceneObjectList *OwnerList) {
_object8._numFrames = 2;
setAction(&_action1);
- _globals->_soundHandler.startSound(272);
+ _globals->_soundHandler.play(272);
}
/*--------------------------------------------------------------------------
@@ -1601,8 +1601,8 @@ void Scene7600::postInit(SceneObjectList *OwnerList) {
}
_sceneBounds.center(_globals->_player._position.x, _globals->_player._position.y);
loadScene(7600);
- _soundHandler2.startSound(255);
- _soundHandler1.startSound(251);
+ _soundHandler2.play(255);
+ _soundHandler1.play(251);
}
/*--------------------------------------------------------------------------
@@ -1665,7 +1665,7 @@ void Scene7700::Action3::signal() {
setDelay(60);
// No break on purpose!
case 2:
- scene->_soundHandler.startSound(260);
+ scene->_soundHandler.play(260);
scene->_object8.setVisage(7703);
scene->_object8.setPosition(Common::Point(177, 97));
scene->_object8.setStrip2(3);
@@ -1874,7 +1874,7 @@ void Scene7700::SceneHotspot8::doAction(int action) {
break;
case CURSOR_USE:
scene->_sceneMode = 7709;
- scene->_soundHandler.startSound(259);
+ scene->_soundHandler.play(259);
scene->_object15.setFrame(scene->_object15.getFrameCount());
scene->_object15.animate(ANIM_MODE_6, scene);
if ((scene->_field977 == 2) && (scene->_field97B == 0)) {
@@ -1900,7 +1900,7 @@ void Scene7700::SceneHotspot9::doAction(int action) {
break;
case CURSOR_USE:
scene->_sceneMode = 7709;
- scene->_soundHandler.startSound(259);
+ scene->_soundHandler.play(259);
scene->_object15.setFrame(1);
scene->_object15.animate(ANIM_MODE_5, scene);
if (scene->_field977 > 2) {
@@ -2034,7 +2034,7 @@ void Scene7700::Object7::doAction(int action) {
break;
case OBJECT_STUNNER:
if (!_globals->getFlag(78)) {
- _globals->_soundHandler.proc3();
+ _globals->_soundHandler.stop();
_globals->setFlag(78);
setAction(NULL);
_globals->_player.disableControl();
@@ -2124,7 +2124,8 @@ void Scene7700::Object9::doAction(int action) {
_globals->_sceneItems.push_front(&scene->_object10);
scene->_object10.fixPriority(240);
}
- scene->_soundHandler.startSound(262);
+
+ scene->_soundHandler.play(262);
scene->_object14.animate(ANIM_MODE_5, NULL);
}
_globals->_events.setCursor(CURSOR_WALK);
@@ -2222,7 +2223,7 @@ void Scene7700::signal() {
}
break;
case 7702:
- _soundHandler.proc1(0);
+ _soundHandler.fadeOut(0);
_globals->_sceneManager.changeScene(7600);
break;
case 7703:
@@ -2233,7 +2234,7 @@ void Scene7700::signal() {
_globals->_player.enableControl();
break;
case 7704:
- _globals->_soundHandler.startSound(256);
+ _globals->_soundHandler.play(256);
_prof.setStrip2(4);
_prof.setFrame2(1);
_prof.setPosition(Common::Point(159, 87));
@@ -2520,7 +2521,7 @@ void Scene7700::postInit(SceneObjectList *OwnerList) {
_sceneMode = 7701;
setAction(&_sequenceManager, this, 7701, &_globals->_player, NULL);
- _soundHandler.startSound(256);
+ _soundHandler.play(256);
}
Scene7700::Scene7700() {
diff --git a/engines/tsage/ringworld_scenes8.h b/engines/tsage/ringworld_scenes8.h
index 8b183e895f..fe9560d9d8 100644
--- a/engines/tsage/ringworld_scenes8.h
+++ b/engines/tsage/ringworld_scenes8.h
@@ -94,7 +94,7 @@ class Scene7000 : public Scene {
};
public:
- SoundHandler _soundHandler;
+ ASound _soundHandler;
SequenceManager _sequenceManager;
SpeakerSKText _speakerSKText;
SpeakerSKL _speakerSKL;
@@ -165,8 +165,8 @@ class Scene7100 : public Scene {
};
public:
- SoundHandler _soundHandler1;
- SoundHandler _soundHandler2;
+ ASound _soundHandler1;
+ ASound _soundHandler2;
SceneObject _object1;
SceneObject _object2;
SceneObject _object3;
@@ -230,7 +230,7 @@ public:
SceneObject _object7;
SceneObject _object8;
SceneObject _object9;
- SoundHandler _soundHandler;
+ ASound _soundHandler;
virtual void postInit(SceneObjectList *OwnerList = NULL);
};
@@ -296,8 +296,8 @@ public:
SceneObject _object4;
SceneObject _object5;
SceneObject _object6;
- SoundHandler _soundHandler1;
- SoundHandler _soundHandler2;
+ ASound _soundHandler1;
+ ASound _soundHandler2;
virtual void postInit(SceneObjectList *OwnerList = NULL);
};
@@ -409,7 +409,7 @@ class Scene7700 : public Scene {
virtual void doAction(int action);
};
public:
- SoundHandler _soundHandler;
+ ASound _soundHandler;
SequenceManager _sequenceManager;
GfxButton _gfxButton;
SpeakerEText _speakerEText;
diff --git a/engines/tsage/scenes.cpp b/engines/tsage/scenes.cpp
index 4625661b62..6352918e39 100644
--- a/engines/tsage/scenes.cpp
+++ b/engines/tsage/scenes.cpp
@@ -55,7 +55,7 @@ void SceneManager::checkScene() {
_nextSceneNumber = -1;
}
- Common::for_each(_globals->_sceneListeners.begin(), _globals->_sceneListeners.end(), SceneHandler::dispatchObject);
+ _globals->dispatchSounds();
}
void SceneManager::sceneChange() {
@@ -105,8 +105,6 @@ void SceneManager::sceneChange() {
// Set the next scene to be active
_sceneNumber = _nextSceneNumber;
- // TODO: Unknown check of word_45CD3 / call to saver method
-
// Free any regions
disposeRegions();
@@ -208,7 +206,6 @@ void SceneManager::setBackSurface() {
}
void SceneManager::saveListener(int saveMode) {
- warning("TODO: SceneManager::saveLIstener");
}
void SceneManager::loadNotifier(bool postFlag) {
diff --git a/engines/tsage/scenes.h b/engines/tsage/scenes.h
index b3c009c4fe..5845efaec9 100644
--- a/engines/tsage/scenes.h
+++ b/engines/tsage/scenes.h
@@ -71,7 +71,9 @@ public:
class SceneManager : public GameHandler, public SaveListener {
private:
- void disposeRegions() { warning("TODO: disposeRegions()"); }
+ void disposeRegions() {
+ // No need to do anything, since regions will be freed automatically when the scene is
+ }
Scene *getNewScene();
public:
Scene *_scene;
diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp
index defec1cebd..dc7b6599ed 100644
--- a/engines/tsage/sound.cpp
+++ b/engines/tsage/sound.cpp
@@ -20,21 +20,457 @@
*
*/
+#include "common/config-manager.h"
#include "tsage/core.h"
#include "tsage/globals.h"
#include "tsage/debugger.h"
#include "tsage/graphics.h"
+#include "tsage/tsage.h"
namespace tSage {
+static SoundManager *_soundManager = NULL;
+
+/*--------------------------------------------------------------------------*/
+
+SoundManager::SoundManager() {
+ _soundManager = this;
+ __sndmgrReady = false;
+ _ourSndResVersion = 0x102;
+ _ourDrvResVersion = 0x10A;
+
+ for (int i = 0; i < SOUND_ARR_SIZE; ++i)
+ _voiceTypeStructPtrs[i] = NULL;
+
+ _groupsAvail = 0;
+ _newVolume = _masterVol = 127;
+ _suspendedCount = 0;
+ _driversDetected = false;
+ _needToRethink = false;
+
+ _soTimeIndexFlag = false;
+}
+
+SoundManager::~SoundManager() {
+ if (__sndmgrReady) {
+ for (Common::List<Sound *>::iterator i = _soundList.begin(); i != _soundList.end(); ) {
+ Sound *s = *i;
+ ++i;
+ s->stop();
+ }
+ for (Common::List<SoundDriver *>::iterator i = _installedDrivers.begin(); i != _installedDrivers.end(); ) {
+ SoundDriver *driver = *i;
+ ++i;
+ delete driver;
+ }
+ _sfTerminate();
+ }
+
+ _soundManager = NULL;
+}
+
void SoundManager::postInit() {
- _saver->addSaveNotifier(&SoundManager::saveNotifier);
- _saver->addLoadNotifier(&SoundManager::loadNotifier);
- _saver->addListener(this);
+ if (!__sndmgrReady) {
+ _saver->addSaveNotifier(&SoundManager::saveNotifier);
+ _saver->addLoadNotifier(&SoundManager::loadNotifier);
+ _saver->addListener(this);
+ __sndmgrReady = true;
+ }
+}
+
+/**
+ * Loops through all the loaded sounds, and stops any that have been flagged for stopping
+ */
+void SoundManager::dispatch() {
+ Common::List<Sound *>::iterator i = _soundList.begin();
+ while (i != _soundList.end()) {
+ Sound *sound = *i;
+ ++i;
+
+ // If the sound is flagged for stopping, then stop it
+ if (sound->_stoppedAsynchronously) {
+ sound->stop();
+ }
+ }
+}
+
+void SoundManager::syncSounds() {
+ bool mute = false;
+ if (ConfMan.hasKey("mute"))
+ mute = ConfMan.getBool("mute");
+
+ bool music_mute = mute;
+
+ if (!mute) {
+ music_mute = ConfMan.getBool("music_mute");
+ }
+
+ // Get the new music volume
+ int musicVolume = music_mute ? 0 : MIN(255, ConfMan.getInt("music_volume"));
+
+ this->setMasterVol(musicVolume / 2);
+}
+
+void SoundManager::update() {
+ _sfSoundServer();
+}
+
+Common::List<SoundDriverEntry> &SoundManager::buildDriverList(bool detectFlag) {
+ assert(__sndmgrReady);
+ _availableDrivers.clear();
+
+ // Build up a list of available drivers. Currently we only implement an Adlib driver
+ SoundDriverEntry sd;
+ sd.driverNum = ADLIB_DRIVER_NUM;
+ sd.status = detectFlag ? SNDSTATUS_DETECTED : SNDSTATUS_SKIPPED;
+ sd.field2 = 0;
+ sd.field6 = 15000;
+ sd.shortDescription = "Adlib or SoundBlaster";
+ sd.longDescription = "3812fm";
+ _availableDrivers.push_back(sd);
+
+ _driversDetected = true;
+ return _availableDrivers;
+}
+
+void SoundManager::installConfigDrivers() {
+ installDriver(ADLIB_DRIVER_NUM);
+}
+
+Common::List<SoundDriverEntry> &SoundManager::getDriverList(bool detectFlag) {
+ if (detectFlag)
+ return _availableDrivers;
+ else
+ return buildDriverList(false);
+}
+
+void SoundManager::dumpDriverList() {
+ _availableDrivers.clear();
+}
+
+/**
+ * Install the specified driver number
+ */
+void SoundManager::installDriver(int driverNum) {
+ // If driver is already installed, no need to install it
+ if (isInstalled(driverNum))
+ return;
+
+ // Instantiate the sound driver
+ SoundDriver *driver = instantiateDriver(driverNum);
+ if (!driver)
+ return;
+
+ assert((_ourDrvResVersion >= driver->_minVersion) && (_ourDrvResVersion <= driver->_maxVersion));
+
+ // Mute any loaded sounds
+ Common::StackLock slock(_serverDisabledMutex);
+
+ for (Common::List<Sound *>::iterator i = _playList.begin(); i != _playList.end(); ++i)
+ (*i)->mute(true);
+
+ // Install the driver
+ if (!_sfInstallDriver(driver))
+ error("Sound driver initialization failed");
+
+ switch (driverNum) {
+ case ROLAND_DRIVER_NUM:
+ case ADLIB_DRIVER_NUM: {
+ // Handle loading bank infomation
+ byte *bankData = _resourceManager->getResource(RES_BANK, driverNum, 0, true);
+ if (bankData) {
+ // Install the patch bank data
+ _sfInstallPatchBank(driver, bankData);
+ DEALLOCATE(bankData);
+ } else {
+ // Could not locate patch bank data, so unload the driver
+ _sfUnInstallDriver(driver);
+
+ // Unmute currently active sounds
+ for (Common::List<Sound *>::iterator i = _playList.begin(); i != _playList.end(); ++i)
+ (*i)->mute(false);
+ }
+ break;
+ }
+ }
+}
+
+/**
+ * Instantiate a driver class for the specified driver number
+ */
+SoundDriver *SoundManager::instantiateDriver(int driverNum) {
+ assert(driverNum == ADLIB_DRIVER_NUM);
+ return new AdlibSoundDriver();
+}
+
+/**
+ * Uninstall the specified driver
+ */
+void SoundManager::unInstallDriver(int driverNum) {
+ Common::List<SoundDriver *>::const_iterator i;
+ for (i = _installedDrivers.begin(); i != _installedDrivers.end(); ++i) {
+ if ((*i)->_driverResID == driverNum) {
+ // Found driver to remove
+
+ // Mute any loaded sounds
+ Common::StackLock slock(_serverDisabledMutex);
+
+ Common::List<Sound *>::iterator j;
+ for (j = _playList.begin(); j != _playList.end(); ++j)
+ (*j)->mute(true);
+
+ // Uninstall the driver
+ _sfUnInstallDriver(*i);
+
+ // Re-orient all the loaded sounds
+ for (j = _soundList.begin(); j != _soundList.end(); ++j)
+ (*j)->orientAfterDriverChange();
+
+ // Unmute currently active sounds
+ for (j = _playList.begin(); j != _playList.end(); ++j)
+ (*j)->mute(false);
+ }
+ }
+}
+
+/**
+ * Returns true if a specified driver number is currently installed
+ */
+bool SoundManager::isInstalled(int driverNum) const {
+ Common::List<SoundDriver *>::const_iterator i;
+ for (i = _installedDrivers.begin(); i != _installedDrivers.end(); ++i) {
+ if ((*i)->_driverResID == driverNum)
+ return true;
+ }
+
+ return false;
+}
+
+void SoundManager::setMasterVol(int volume) {
+ _newVolume = volume;
+}
+
+int SoundManager::getMasterVol() const {
+ return _masterVol;
+}
+
+void SoundManager::loadSound(int soundNum, bool showErrors) {
+ // This method preloaded the data associated with a given sound, so is now redundant
+}
+
+void SoundManager::unloadSound(int soundNum) {
+ // This method signalled the resource manager to unload the data for a sound, and is now redundant
+}
+
+int SoundManager::determineGroup(const byte *soundData) {
+ return _sfDetermineGroup(soundData);
+}
+
+void SoundManager::checkResVersion(const byte *soundData) {
+ int maxVersion = READ_LE_UINT16(soundData + 4);
+ int minVersion = READ_LE_UINT16(soundData + 6);
+
+ if (_soundManager->_ourSndResVersion < minVersion)
+ error("Attempt to play/prime sound resource that is too new");
+ if (_soundManager->_ourSndResVersion > maxVersion)
+ error("Attempt to play/prime sound resource that is too old");
+}
+
+int SoundManager::extractPriority(const byte *soundData) {
+ return READ_LE_UINT16(soundData + 12);
}
+int SoundManager::extractLoop(const byte *soundData) {
+ return READ_LE_UINT16(soundData + 14);
+}
+
+void SoundManager::extractTrackInfo(trackInfoStruct *trackInfo, const byte *soundData, int groupNum) {
+ _sfExtractTrackInfo(trackInfo, soundData, groupNum);
+}
+
+void SoundManager::addToSoundList(Sound *sound) {
+ if (!contains(_soundList, sound))
+ _soundList.push_back(sound);
+}
+
+void SoundManager::removeFromSoundList(Sound *sound) {
+ _soundList.remove(sound);
+}
+
+void SoundManager::addToPlayList(Sound *sound) {
+ _sfAddToPlayList(sound);
+}
+
+void SoundManager::removeFromPlayList(Sound *sound) {
+ if (_soundManager)
+ _sfRemoveFromPlayList(sound);
+}
+
+bool SoundManager::isOnPlayList(Sound *sound) {
+ return _sfIsOnPlayList(sound);
+}
+
+void SoundManager::updateSoundVol(Sound *sound) {
+ _sfUpdateVolume(sound);
+}
+
+void SoundManager::updateSoundPri(Sound *sound) {
+ _sfUpdatePriority(sound);
+}
+
+void SoundManager::updateSoundLoop(Sound *sound) {
+ _sfUpdateLoop(sound);
+}
+
+void SoundManager::rethinkVoiceTypes() {
+ Common::StackLock slock(sfManager()._serverSuspendedMutex);
+ _sfRethinkVoiceTypes();
+}
+
+void SoundManager::_sfSoundServer() {
+ Common::StackLock slock1(sfManager()._serverDisabledMutex);
+ Common::StackLock slock2(sfManager()._serverSuspendedMutex);
+
+ if (sfManager()._needToRethink) {
+ _sfRethinkVoiceTypes();
+ sfManager()._needToRethink = false;
+ } else {
+ _sfDereferenceAll();
+ }
+
+ // If the master volume has changed, update it
+ if (sfManager()._newVolume != sfManager()._masterVol)
+ _sfSetMasterVol(sfManager()._newVolume);
+
+ // Handle any fading if necessary
+ _sfProcessFading();
+
+ // Poll all sound drivers in case they need it
+ for (Common::List<SoundDriver *>::iterator i = sfManager()._installedDrivers.begin();
+ i != sfManager()._installedDrivers.end(); ++i) {
+ (*i)->poll();
+ }
+}
+
+void SoundManager::_sfProcessFading() {
+ // Loop through processing active sounds
+ bool removeFlag = false;
+ Common::List<Sound *>::iterator i = sfManager()._playList.begin();
+ while (i != sfManager()._playList.end()) {
+ Sound *s = *i;
+ ++i;
+
+ if (!s->_pausedCount)
+ removeFlag = s->_soServiceTracks();
+ if (removeFlag) {
+ _sfDoRemoveFromPlayList(s);
+ s->_stoppedAsynchronously = true;
+ sfManager()._needToRethink = true;
+ }
+
+ if (s->_fadeDest != -1) {
+ if (s->_fadeCounter != 0)
+ --s->_fadeCounter;
+ else {
+ if (s->_volume >= s->_fadeDest) {
+ s->_volume = ((s->_volume - s->_fadeDest) > s->_fadeSteps) ?
+ s->_volume - s->_fadeSteps : s->_fadeDest;
+ } else {
+ s->_volume = ((s->_fadeDest - s->_volume) > s->_fadeSteps) ?
+ s->_volume + s->_fadeSteps : s->_fadeDest;
+ }
+
+ _sfDoUpdateVolume(s);
+ if (s->_volume != s->_fadeDest)
+ s->_fadeCounter = s->_fadeTicks;
+ else {
+ s->_fadeDest = -1;
+ if (s->_stopAfterFadeFlag) {
+ _sfDoRemoveFromPlayList(s);
+ s->_stoppedAsynchronously = true;
+ sfManager()._needToRethink = true;
+ }
+ }
+ }
+ }
+ }
+
+ // Loop through the voiceType list
+ for (int voiceIndex = 0; voiceIndex < SOUND_ARR_SIZE; ++voiceIndex) {
+ VoiceTypeStruct *vtStruct = sfManager()._voiceTypeStructPtrs[voiceIndex];
+ if (!vtStruct)
+ continue;
+
+ if (vtStruct->_voiceType == VOICETYPE_1) {
+ for (uint idx = 0; idx < vtStruct->_entries.size(); ++idx) {
+ if (vtStruct->_entries[idx]._type1._field6 >= -1)
+ ++vtStruct->_entries[idx]._type1._field6;
+ }
+ }
+ }
+}
+
+void SoundManager::_sfUpdateVoiceStructs() {
+ for (int voiceIndex = 0; voiceIndex < SOUND_ARR_SIZE; ++voiceIndex) {
+ VoiceTypeStruct *vs = sfManager()._voiceTypeStructPtrs[voiceIndex];
+ if (!vs)
+ continue;
+
+ if (vs->_voiceType == VOICETYPE_0) {
+ for (uint idx = 0; idx < vs->_entries.size(); ++idx) {
+ VoiceStructEntry &vse = vs->_entries[idx];
+
+ vse._type0._sound = vse._type0._sound2;
+ vse._type0._channelNum = vse._type0._channelNum2;
+ vse._type0._priority = vse._type0._priority2;
+ vse._type0._fieldA = vse._type0._field12;
+ }
+ } else {
+ vs->_field3 = vs->_numVoices;
+
+ for (uint idx = 0; idx < vs->_entries.size(); ++idx) {
+ VoiceStructEntry &vse = vs->_entries[idx];
+
+ vse._type1._sound = vse._type1._sound2;
+ vse._type1._channelNum = vse._type1._channelNum2;
+ vse._type1._priority = vse._type1._priority2;
+ }
+ }
+ }
+}
+
+void SoundManager::_sfUpdateVoiceStructs2() {
+ for (int voiceIndex = 0; voiceIndex < SOUND_ARR_SIZE; ++voiceIndex) {
+ VoiceTypeStruct *vtStruct = sfManager()._voiceTypeStructPtrs[voiceIndex];
+ if (!vtStruct)
+ continue;
+
+ for (uint idx = 0; idx < vtStruct->_entries.size(); ++idx) {
+
+ if (vtStruct->_voiceType == VOICETYPE_0) {
+ VoiceStructEntryType0 &vse = vtStruct->_entries[idx]._type0;
+ vse._sound2 = vse._sound;
+ vse._channelNum2 = vse._channelNum;
+ vse._priority2 = vse._priority;
+ vse._field12 = vse._fieldA;
+ } else {
+ VoiceStructEntryType1 &vse = vtStruct->_entries[idx]._type1;
+ vse._sound2 = vse._sound;
+ vse._channelNum2 = vse._channelNum;
+ vse._priority2 = vse._priority;
+ }
+ }
+ }
+}
+
+void SoundManager::_sfUpdateCallback(void *ref) {
+ ((SoundManager *)ref)->update();
+}
+
+/*--------------------------------------------------------------------------*/
+
void SoundManager::saveNotifier(bool postFlag) {
- _globals->_soundManager.saveNotifierProc(postFlag);
+ _soundManager->saveNotifierProc(postFlag);
}
void SoundManager::saveNotifierProc(bool postFlag) {
@@ -42,7 +478,7 @@ void SoundManager::saveNotifierProc(bool postFlag) {
}
void SoundManager::loadNotifier(bool postFlag) {
- _globals->_soundManager.loadNotifierProc(postFlag);
+ _soundManager->loadNotifierProc(postFlag);
}
void SoundManager::loadNotifierProc(bool postFlag) {
@@ -51,7 +487,2170 @@ void SoundManager::loadNotifierProc(bool postFlag) {
void SoundManager::listenerSynchronize(Serializer &s) {
s.validate("SoundManager");
- warning("TODO: SoundManager listenerSynchronize");
+ warning("TODO: SoundManager listenerSynchronise");
+}
+
+/*--------------------------------------------------------------------------*/
+
+SoundManager &SoundManager::sfManager() {
+ assert(_soundManager);
+ return *_soundManager;
+}
+
+int SoundManager::_sfDetermineGroup(const byte *soundData) {
+ const byte *p = soundData + READ_LE_UINT16(soundData + 8);
+ uint32 v;
+ while ((v = READ_LE_UINT32(p)) != 0) {
+ if ((v & _soundManager->_groupsAvail) == v)
+ return v;
+
+ p += 6 + (READ_LE_UINT16(p + 4) * 4);
+ }
+
+ return 0;
+}
+
+void SoundManager::_sfAddToPlayList(Sound *sound) {
+ Common::StackLock slock(sfManager()._serverSuspendedMutex);
+
+ _sfDoAddToPlayList(sound);
+ sound->_stoppedAsynchronously = false;
+ _sfRethinkVoiceTypes();
+}
+
+void SoundManager::_sfRemoveFromPlayList(Sound *sound) {
+ Common::StackLock slock(sfManager()._serverSuspendedMutex);
+
+ if (_sfDoRemoveFromPlayList(sound))
+ _sfRethinkVoiceTypes();
+}
+
+bool SoundManager::_sfIsOnPlayList(Sound *sound) {
+ Common::StackLock slock(sfManager()._serverSuspendedMutex);
+
+ bool result = contains(_soundManager->_playList, sound);
+
+ return result;
+}
+
+void SoundManager::_sfRethinkSoundDrivers() {
+ // Free any existing entries
+ int idx;
+
+ for (idx = 0; idx < SOUND_ARR_SIZE; ++idx) {
+ if (sfManager()._voiceTypeStructPtrs[idx]) {
+ delete sfManager()._voiceTypeStructPtrs[idx];
+ sfManager()._voiceTypeStructPtrs[idx] = NULL;
+ }
+ }
+
+ for (idx = 0; idx < SOUND_ARR_SIZE; ++idx) {
+ byte flag = 0xff;
+ int total = 0;
+
+ // Loop through the sound drivers
+ for (Common::List<SoundDriver *>::iterator i = sfManager()._installedDrivers.begin();
+ i != sfManager()._installedDrivers.end(); ++i) {
+ // Process the group data for each sound driver
+ SoundDriver *driver = *i;
+ const byte *groupData = driver->_groupOffset->pData;
+
+ while (*groupData != 0xff) {
+ byte byteVal = *groupData++;
+
+ if (byteVal == idx) {
+ byte byteVal2 = *groupData++;
+ if (flag == 0xff)
+ flag = byteVal2;
+ else {
+ assert(flag == byteVal2);
+ }
+
+ if (!flag) {
+ while (*groupData++ != 0xff)
+ ++total;
+ } else {
+ total += *groupData;
+ groupData += 2;
+ }
+ } else if (*groupData++ == 0) {
+ while (*groupData != 0xff)
+ ++groupData;
+ ++groupData;
+ } else {
+ groupData += 2;
+ }
+ }
+ }
+
+ if (total) {
+ VoiceTypeStruct *vs = new VoiceTypeStruct();
+ sfManager()._voiceTypeStructPtrs[idx] = vs;
+
+ if (!flag) {
+ vs->_voiceType = VOICETYPE_0;
+ } else {
+ vs->_voiceType = VOICETYPE_1;
+ }
+
+ vs->_total = vs->_numVoices = total;
+ vs->_field3 = 0;
+
+ for (Common::List<SoundDriver *>::iterator i = sfManager()._installedDrivers.begin();
+ i != sfManager()._installedDrivers.end(); ++i) {
+ // Process the group data for each sound driver
+ SoundDriver *driver = *i;
+ const byte *groupData = driver->_groupOffset->pData;
+
+ while (*groupData != 0xff) {
+ byte byteVal = *groupData++;
+
+ if (byteVal == idx) {
+ ++groupData;
+
+ if (!flag) {
+ while ((byteVal = *groupData++) != 0xff) {
+ VoiceStructEntry ve;
+ memset(&ve, 0, sizeof(VoiceStructEntry));
+
+ ve._field1 = (byteVal & 0x80) ? 0 : 1;
+ ve._driver = driver;
+ ve._type0._sound = NULL;
+ ve._type0._channelNum = 0;
+ ve._type0._priority = 0;
+ ve._type0._fieldA = 0;
+
+ vs->_entries.push_back(ve);
+ }
+ } else {
+ byteVal = *groupData;
+ groupData += 2;
+
+ for (idx = 0; idx < byteVal; ++idx) {
+ VoiceStructEntry ve;
+ memset(&ve, 0, sizeof(VoiceStructEntry));
+
+ ve._voiceNum = idx;
+ ve._driver = driver;
+ ve._type1._field4 = -1;
+ ve._type1._field5 = 0;
+ ve._type1._field6 = 0;
+ ve._type1._sound = NULL;
+ ve._type1._channelNum = 0;
+ ve._type1._priority = 0;
+
+ vs->_entries.push_back(ve);
+ }
+ }
+ } else {
+ if (*groupData++ != 0) {
+ while (*groupData != 0xff)
+ ++groupData;
+ } else {
+ groupData += 2;
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+void SoundManager::_sfRethinkVoiceTypes() {
+ _sfDereferenceAll();
+
+ // Pre-processing
+ for (int voiceIndex = 0; voiceIndex < SOUND_ARR_SIZE; ++voiceIndex) {
+ VoiceTypeStruct *vs = sfManager()._voiceTypeStructPtrs[voiceIndex];
+ if (!vs)
+ continue;
+
+ if (vs->_voiceType == VOICETYPE_0) {
+ for (uint idx = 0; idx < vs->_entries.size(); ++idx) {
+ VoiceStructEntry &vse = vs->_entries[idx];
+ vse._type0._sound3 = vse._type0._sound;
+ vse._type0._channelNum3 = vse._type0._channelNum;
+ vse._type0._priority3 = vse._type0._priority;
+ vse._type0._field1A = vse._type0._fieldA;
+ vse._type0._sound = NULL;
+ vse._type0._channelNum = 0;
+ vse._type0._priority = 0;
+ vse._type0._fieldA = 0;
+ vse._type0._sound2 = NULL;
+ vse._type0._channelNum2 = 0;
+ vse._type0._priority2 = 0;
+ vse._type0._field12 = 0;
+ }
+ } else {
+ for (uint idx = 0; idx < vs->_entries.size(); ++idx) {
+ VoiceStructEntry &vse = vs->_entries[idx];
+ vse._type1._sound3 = vse._type1._sound;
+ vse._type1._channelNum3 = vse._type1._channelNum;
+ vse._type1._priority3 = vse._type1._priority;
+ vse._type1._sound = NULL;
+ vse._type1._channelNum = 0;
+ vse._type1._priority = 0;
+ vse._type1._sound2 = NULL;
+ vse._type1._channelNum2 = 0;
+ vse._type1._priority2 = 0;
+ }
+
+ // Reset the number of voices available
+ vs->_numVoices = vs->_total;
+ }
+ }
+
+ // Main processing loop
+ int priorityOffset = 0;
+ for (Common::List<Sound *>::iterator i = sfManager()._playList.begin(); i != sfManager()._playList.end(); ++i, priorityOffset += 16) {
+ Sound *sound = *i;
+ if ((sound->_mutedCount != 0) || (sound->_pausedCount != 0))
+ continue;
+
+ _sfUpdateVoiceStructs();
+ Common::set_to(sound->_chWork, sound->_chWork + SOUND_ARR_SIZE, false);
+
+ for (;;) {
+ // Scan for sub priority
+ int foundIndex = -1, foundPriority = 0;
+ for (int idx = 0; idx < SOUND_ARR_SIZE; ++idx) {
+ if (!(sound->_chFlags[idx] & 0x8000) & !sound->_chWork[idx]) {
+ int subPriority = sound->_chSubPriority[idx];
+ if (subPriority)
+ subPriority = 16 - subPriority + priorityOffset;
+
+ if (foundIndex != -1) {
+ if (subPriority < foundPriority) {
+ foundIndex = idx;
+ foundPriority = subPriority;
+ }
+ } else {
+ foundIndex = idx;
+ foundPriority = subPriority;
+ }
+ }
+ }
+ if (foundIndex == -1)
+ break;
+
+ int chNumVoices = sound->_chNumVoices[foundIndex];
+ sound->_chWork[foundIndex] = true;
+
+ VoiceTypeStruct *vtStruct = sfManager()._voiceTypeStructPtrs[sound->_chVoiceType[foundIndex]];
+ if (!vtStruct) {
+ if (foundPriority)
+ continue;
+
+ _sfUpdateVoiceStructs2();
+ break;
+ }
+
+ if (vtStruct->_voiceType != VOICETYPE_0) {
+ // Type 1
+ int numVoices = vtStruct->_numVoices;
+
+ if (numVoices >= chNumVoices) {
+ int channelCount = chNumVoices, idx = 0;
+ while (channelCount > 0) {
+ if (!vtStruct->_entries[idx]._type1._sound2) {
+ vtStruct->_entries[idx]._type1._sound2 = sound;
+ vtStruct->_entries[idx]._type1._channelNum2 = foundIndex;
+ vtStruct->_entries[idx]._type1._priority2 = foundPriority;
+ --channelCount;
+ }
+ ++idx;
+ }
+
+ vtStruct->_numVoices -= chNumVoices;
+ continue;
+ } else if (!foundPriority) {
+ do {
+ int maxPriority = 0;
+ for (uint idx = 0; idx < vtStruct->_entries.size(); ++idx)
+ maxPriority = MAX(maxPriority, vtStruct->_entries[idx]._type1._priority2);
+
+ if (!maxPriority) {
+ _sfUpdateVoiceStructs2();
+ break;
+ }
+
+ for (uint idx = 0; idx < vtStruct->_entries.size(); ++idx) {
+ if (vtStruct->_entries[idx]._type1._priority2 == maxPriority) {
+ vtStruct->_entries[idx]._type1._sound2 = NULL;
+ vtStruct->_entries[idx]._type1._channelNum2 = 0;
+ vtStruct->_entries[idx]._type1._priority2 = 0;
+ ++numVoices;
+ }
+ }
+ } while (chNumVoices > numVoices);
+
+ int voicesCtr = chNumVoices;
+ for (uint idx = 0; (idx < vtStruct->_entries.size()) && (voicesCtr > 0); ++idx) {
+ if (!vtStruct->_entries[idx]._type1._sound2) {
+ vtStruct->_entries[idx]._type1._sound2 = sound;
+ vtStruct->_entries[idx]._type1._channelNum2 = foundIndex;
+ vtStruct->_entries[idx]._type1._priority2 = foundPriority;
+ --voicesCtr;
+ }
+ }
+
+ numVoices -= chNumVoices;
+ vtStruct->_numVoices = numVoices;
+ continue;
+ } else if (!numVoices) {
+ break;
+ }
+ continue;
+ } else {
+ // Type 0
+ if (sound->_isEmpty) {
+ uint idx = 0;
+ while ((idx < vtStruct->_entries.size()) &&
+ (vtStruct->_entries[idx]._voiceNum == foundIndex))
+ ++idx;
+ if (idx == vtStruct->_entries.size())
+ continue;
+ }
+
+ int flagsVal = sound->_chFlags[foundIndex] & 3;
+ if (flagsVal != 1) {
+ // All modes except mode 1 (loc_23EDF)
+ int entryIndex = -1, maxVoiceNum = 0;
+
+ for (uint idx = 0; idx < vtStruct->_entries.size(); ++idx) {
+ if (!vtStruct->_entries[idx]._type0._sound2 && (vtStruct->_entries[idx]._field1 != 0) &&
+ (vtStruct->_entries[idx]._voiceNum > maxVoiceNum)) {
+ maxVoiceNum = vtStruct->_entries[idx]._voiceNum;
+ entryIndex = idx;
+ }
+ }
+
+ if (entryIndex != -1) {
+ vtStruct->_entries[entryIndex]._type0._sound2 = sound;
+ vtStruct->_entries[entryIndex]._type0._channelNum2 = foundIndex;
+ vtStruct->_entries[entryIndex]._type0._priority2 = foundPriority;
+ vtStruct->_entries[entryIndex]._type0._field12 = 0;
+ continue;
+ }
+
+ if (foundPriority != 0)
+ continue;
+
+ int maxPriority = 0;
+ entryIndex = -1;
+ for (uint idx = 0; idx < vtStruct->_entries.size(); ++idx) {
+ if ((vtStruct->_entries[idx]._field1 != 0) &&
+ (vtStruct->_entries[idx]._type0._priority2 > maxPriority)) {
+ maxPriority = vtStruct->_entries[idx]._type0._priority2;
+ entryIndex = idx;
+ }
+ }
+
+ if (entryIndex != -1) {
+ vtStruct->_entries[entryIndex]._type0._sound2 = sound;
+ vtStruct->_entries[entryIndex]._type0._channelNum2 = foundIndex;
+ vtStruct->_entries[entryIndex]._type0._priority2 = foundPriority;
+ vtStruct->_entries[entryIndex]._type0._field12 = 0;
+ continue;
+ }
+
+ _sfUpdateVoiceStructs2();
+ break;
+ } else {
+ // Channel mode 1 handling (loc_23FAC)
+
+ bool foundMatch = false;
+ int entryIndex = -1;
+ for (uint idx = 0; idx < vtStruct->_entries.size(); ++idx) {
+ if (vtStruct->_entries[idx]._voiceNum == foundIndex) {
+ foundIndex = true;
+ if (!vtStruct->_entries[idx]._type0._sound2) {
+ entryIndex = idx;
+ break;
+ }
+ }
+ }
+
+ if (entryIndex != -1) {
+ vtStruct->_entries[entryIndex]._type0._sound2 = sound;
+ vtStruct->_entries[entryIndex]._type0._channelNum2 = foundIndex;
+ vtStruct->_entries[entryIndex]._type0._priority2 = foundPriority;
+ vtStruct->_entries[entryIndex]._type0._field12 = 0;
+ continue;
+ }
+
+ if (!foundMatch) {
+ if (foundPriority)
+ continue;
+ if (entryIndex == -1) {
+ _sfUpdateVoiceStructs2();
+ break;
+ }
+ }
+
+ // Find the entry with the highest priority
+ int maxPriority = 0;
+ foundMatch = false;
+ entryIndex = -1;
+ for (uint idx = 0; idx < vtStruct->_entries.size(); ++idx) {
+ if (vtStruct->_entries[idx]._voiceNum != foundIndex)
+ continue;
+ if (!vtStruct->_entries[idx]._type0._field12) {
+ foundMatch = true;
+ break;
+ }
+
+ if (vtStruct->_entries[idx]._type0._priority2 > maxPriority) {
+ maxPriority = vtStruct->_entries[idx]._type0._priority2;
+ entryIndex = -1;
+ }
+ }
+
+ if (!foundMatch) {
+ if (foundPriority)
+ continue;
+
+ if (entryIndex != -1) {
+ vtStruct->_entries[entryIndex]._type0._sound2 = sound;
+ vtStruct->_entries[entryIndex]._type0._channelNum2 = foundIndex;
+ vtStruct->_entries[entryIndex]._type0._priority2 = foundPriority;
+ vtStruct->_entries[entryIndex]._type0._field12 = 1;
+ continue;
+ }
+
+ _sfUpdateVoiceStructs2();
+ break;
+ }
+
+ // Found a match (loc_24061)
+ maxPriority = 0;
+ int maxVoiceNum = 0;
+ int priorityIndex = -1, voiceIndex = -1;
+
+ for (uint idx = 0; idx < vtStruct->_entries.size(); ++idx) {
+ if (vtStruct->_entries[idx]._field1) {
+ if (!vtStruct->_entries[idx]._type0._sound2) {
+ if (vtStruct->_entries[idx]._voiceNum > maxVoiceNum) {
+ maxVoiceNum = vtStruct->_entries[idx]._voiceNum;
+ voiceIndex = idx;
+ }
+ } else {
+ if (vtStruct->_entries[idx]._type0._priority2 > maxPriority) {
+ maxPriority = vtStruct->_entries[idx]._type0._priority2;
+ priorityIndex = idx;
+ }
+ }
+ }
+ }
+
+ if (voiceIndex != -1) {
+ VoiceStructEntryType0 &vteSrc = vtStruct->_entries[foundIndex]._type0;
+ VoiceStructEntryType0 &vteDest = vtStruct->_entries[voiceIndex]._type0;
+
+ vteDest._sound2 = vteSrc._sound2;
+ vteDest._channelNum2 = vteSrc._channelNum2;
+ vteDest._priority2 = vteSrc._priority2;
+
+ vteSrc._sound2 = sound;
+ vteSrc._channelNum2 = foundIndex;
+ vteSrc._priority2 = foundPriority;
+ vteSrc._field12 = 1;
+ continue;
+ }
+
+ if (!foundPriority)
+ continue;
+ if (priorityIndex == -1) {
+ _sfUpdateVoiceStructs2();
+ break;
+ }
+
+ VoiceStructEntryType0 &vteSrc = vtStruct->_entries[foundIndex]._type0;
+ VoiceStructEntryType0 &vteDest = vtStruct->_entries[priorityIndex]._type0;
+
+ if (priorityIndex != foundIndex) {
+ vteDest._sound2 = vteSrc._sound2;
+ vteDest._channelNum2 = vteSrc._channelNum2;
+ vteDest._priority2 = vteSrc._priority2;
+ vteDest._field12 = vteSrc._field12;
+ }
+
+ vteSrc._sound2 = sound;
+ vteSrc._channelNum2 = foundIndex;
+ vteSrc._priority2 = foundPriority;
+ vteSrc._field12 = 1;
+ continue;
+ }
+ }
+ }
+ }
+
+ // Post-processing
+ for (int voiceIndex = 0; voiceIndex < SOUND_ARR_SIZE; ++voiceIndex) {
+ VoiceTypeStruct *vs = sfManager()._voiceTypeStructPtrs[voiceIndex];
+ if (!vs)
+ continue;
+
+ if (vs->_voiceType == VOICETYPE_0) {
+ // Type 0
+ for (uint idx = 0; idx < vs->_entries.size(); ++idx) {
+ VoiceStructEntryType0 &vse = vs->_entries[idx]._type0;
+ SoundDriver *driver = vs->_entries[idx]._driver;
+ assert(driver);
+
+ if (vse._field12) {
+ int total = 0;
+ vse._sound = vse._sound2;
+ if (vse._sound3 != vse._sound)
+ ++total;
+
+ vse._channelNum = vse._channelNum2;
+ if (vse._channelNum3 != vse._channelNum)
+ ++total;
+
+ vse._priority = vse._priority2;
+ vse._fieldA = 1;
+ vse._sound2 = NULL;
+
+ if (total) {
+ driver->proc24(vse._channelNum, idx, vse._sound, 123, 0);
+ driver->proc24(vse._channelNum, idx, vse._sound, 1, vse._sound->_chModulation[vse._channelNum]);
+ driver->proc24(vse._channelNum, idx, vse._sound, 7,
+ vse._sound->_chVolume[vse._channelNum] * vse._sound->_volume / 127);
+ driver->proc24(vse._channelNum, idx, vse._sound, 10, vse._sound->_chPan[vse._channelNum]);
+ driver->proc24(vse._channelNum, idx, vse._sound, 64, vse._sound->_chDamper[vse._channelNum]);
+
+ driver->setProgram(vse._channelNum, vse._sound->_chProgram[vse._channelNum]);
+ driver->setPitchBlend(vse._channelNum, vse._sound->_chPitchBlend[vse._channelNum]);
+
+ vse._sound3 = NULL;
+ }
+ } else {
+ vse._sound = NULL;
+ vse._channelNum = 0;
+ vse._priority = 0;
+ vse._fieldA = 0;
+ }
+ }
+
+ for (uint idx = 0; idx < vs->_entries.size(); ++idx) {
+ VoiceStructEntryType0 &vse = vs->_entries[idx]._type0;
+ Sound *sound = vse._sound2;
+ int channelNum = vse._channelNum2;
+
+ if (!sound)
+ continue;
+
+ for (uint entryIndex = 0; entryIndex < vs->_entries.size(); ++entryIndex) {
+ if ((vs->_entries[entryIndex]._type0._sound3 != sound) ||
+ (vs->_entries[entryIndex]._type0._channelNum3 != channelNum)) {
+ // Found match
+ vs->_entries[entryIndex]._type0._sound = sound;
+ vs->_entries[entryIndex]._type0._channelNum = channelNum;
+ vs->_entries[entryIndex]._type0._priority = vse._priority2;
+ vs->_entries[entryIndex]._type0._fieldA = 0;
+ vse._sound2 = NULL;
+ break;
+ }
+ }
+ }
+
+ for (uint idx = 0; idx < vs->_entries.size(); ++idx) {
+ VoiceStructEntryType0 &vse = vs->_entries[idx]._type0;
+ Sound *sound = vse._sound2;
+ if (!sound)
+ continue;
+
+ int voiceNum = 0, foundIndex = -1;
+ for (uint entryIndex = 0; entryIndex < vs->_entries.size(); ++entryIndex) {
+ if ((vs->_entries[entryIndex]._field1) && !vs->_entries[entryIndex]._type0._sound) {
+ int tempVoice = vs->_entries[entryIndex]._voiceNum;
+
+ if (voiceNum <= tempVoice) {
+ voiceNum = tempVoice;
+ foundIndex = entryIndex;
+ }
+ }
+ }
+ assert(foundIndex != -1);
+
+ VoiceStructEntryType0 &vseFound = vs->_entries[foundIndex]._type0;
+
+ vseFound._sound = vse._sound2;
+ vseFound._channelNum = vse._channelNum2;
+ vseFound._priority = vse._priority2;
+ vseFound._fieldA = 0;
+
+ SoundDriver *driver = vs->_entries[foundIndex]._driver;
+ assert(driver);
+
+ driver->proc24(vseFound._channelNum, voiceIndex, vseFound._sound, 123, 0);
+ driver->proc24(vseFound._channelNum, voiceIndex, vseFound._sound,
+ 1, vseFound._sound->_chModulation[vseFound._channelNum]);
+ driver->proc24(vseFound._channelNum, voiceIndex, vseFound._sound,
+ 7, vseFound._sound->_chVolume[vseFound._channelNum] * vseFound._sound->_volume / 127);
+ driver->proc24(vseFound._channelNum, voiceIndex, vseFound._sound,
+ 10, vseFound._sound->_chPan[vseFound._channelNum]);
+ driver->setProgram(vseFound._channelNum, vseFound._sound->_chProgram[vseFound._channelNum]);
+ driver->setPitchBlend(vseFound._channelNum, vseFound._sound->_chPitchBlend[vseFound._channelNum]);
+ }
+
+ // Final loop
+ for (uint idx = 0; idx < vs->_entries.size(); ++idx) {
+ VoiceStructEntryType0 &vse = vs->_entries[idx]._type0;
+
+ if (!vse._sound && (vse._sound3)) {
+ SoundDriver *driver = vs->_entries[idx]._driver;
+ assert(driver);
+ driver->proc24(vs->_entries[idx]._voiceNum, voiceIndex, vse._sound3, 123, 0);
+ }
+ }
+
+ } else {
+ // Type 1
+ for (uint idx = 0; idx < vs->_entries.size(); ++idx) {
+ VoiceStructEntry &vse = vs->_entries[idx];
+ vse._type1._sound = NULL;
+ vse._type1._channelNum = 0;
+ vse._type1._priority = 0;
+ }
+
+ for (uint idx = 0; idx < vs->_entries.size(); ++idx) {
+ VoiceStructEntryType1 &vse = vs->_entries[idx]._type1;
+ Sound *sound = vse._sound2;
+ int channelNum = vse._channelNum2;
+
+ if (!sound)
+ continue;
+
+ for (uint entryIndex = 0; entryIndex < vs->_entries.size(); ++entryIndex) {
+ VoiceStructEntryType1 &vse2 = vs->_entries[entryIndex]._type1;
+ if (!vse2._sound && (vse2._sound3 == sound) && (vse2._channelNum3 == channelNum)) {
+ vse2._sound = sound;
+ vse2._channelNum = channelNum;
+ vse._channelNum = vse2._channelNum2;
+ vse._priority = vse2._priority2;
+ vse._sound2 = NULL;
+ break;
+ }
+ }
+ }
+
+ uint idx2 = 0;
+ for (uint idx = 0; idx < vs->_entries.size(); ++idx) {
+ VoiceStructEntryType1 &vse = vs->_entries[idx]._type1;
+ Sound *sound = vse._sound2;
+ if (!sound)
+ continue;
+
+ while (vs->_entries[idx2]._type1._sound)
+ ++idx2;
+
+ VoiceStructEntryType1 &vse2 = vs->_entries[idx2]._type1;
+ vse2._sound = vse._sound2;
+ vse2._channelNum = vse._channelNum2;
+ vse2._priority = vse._priority2;
+ vse._field4 = -1;
+ vse2._field5 = 0;
+ vse2._field6 = 0;
+
+ SoundDriver *driver = vs->_entries[idx2]._driver;
+ assert(driver);
+
+ driver->updateVoice(vs->_entries[idx2]._voiceNum);
+ driver->proc38(vs->_entries[idx2]._voiceNum, 1, vse2._sound->_chModulation[vse2._channelNum]);
+ driver->proc38(vs->_entries[idx2]._voiceNum, 7,
+ vse2._sound->_chVolume[vse2._channelNum] * vse2._sound->_volume / 127);
+ driver->proc38(vs->_entries[idx2]._voiceNum, 10, vse2._sound->_chPan[vse2._channelNum]);
+ driver->setPitch(vs->_entries[idx2]._voiceNum, vse2._sound->_chPitchBlend[vse2._channelNum]);
+ }
+
+ for (uint idx = 0; idx < vs->_entries.size(); ++idx) {
+ VoiceStructEntryType1 &vse = vs->_entries[idx]._type1;
+
+ if (!vse._sound && (vse._sound3)) {
+ vse._field4 = -1;
+ vse._field5 = 0;
+ vse._field6 = 0;
+
+ SoundDriver *driver = vs->_entries[idx]._driver;
+ assert(driver);
+ driver->updateVoice(voiceIndex);
+ }
+ }
+ }
+ }
+}
+
+void SoundManager::_sfUpdateVolume(Sound *sound) {
+ _sfDereferenceAll();
+ _sfDoUpdateVolume(sound);
+}
+
+void SoundManager::_sfDereferenceAll() {
+ // Orignal used handles for both the driver list and voiceStructPtrs list. This method then refreshed
+ // pointer lists based on the handles. Since in ScummVM we're just using pointers directly, this
+ // method doesn't need any implementation
+}
+
+void SoundManager::_sfUpdatePriority(Sound *sound) {
+ Common::StackLock slock(sfManager()._serverSuspendedMutex);
+
+ int tempPriority = (sound->_fixedPriority == 255) ? sound->_sndResPriority : sound->_priority;
+ if (sound->_priority != tempPriority) {
+ sound->_priority = tempPriority;
+ if (_sfDoRemoveFromPlayList(sound)) {
+ _sfDoAddToPlayList(sound);
+ _sfRethinkVoiceTypes();
+ }
+ }
+}
+
+void SoundManager::_sfUpdateLoop(Sound *sound) {
+ if (sound->_fixedLoop)
+ sound->_loop = sound->_sndResLoop;
+ else
+ sound->_loop = sound->_fixedLoop;
+}
+
+void SoundManager::_sfSetMasterVol(int volume) {
+ if (volume > 127)
+ volume = 127;
+
+ if (volume != _soundManager->_masterVol) {
+ _soundManager->_masterVol = volume;
+
+ for (Common::List<SoundDriver *>::iterator i = _soundManager->_installedDrivers.begin();
+ i != _soundManager->_installedDrivers.end(); ++i) {
+ (*i)->setMasterVolume(volume);
+ }
+ }
+}
+
+void SoundManager::_sfExtractTrackInfo(trackInfoStruct *trackInfo, const byte *soundData, int groupNum) {
+ trackInfo->_numTracks = 0;
+
+ const byte *p = soundData + READ_LE_UINT16(soundData + 8);
+ uint32 v;
+ while ((v = READ_LE_UINT32(p)) != 0) {
+ if ((v == 0x80000000) || (v == (uint)groupNum)) {
+ // Found group to process
+ int count = READ_LE_UINT16(p + 4);
+ p += 6;
+
+ for (int idx = 0; idx < count; ++idx) {
+ if (trackInfo->_numTracks == 16) {
+ trackInfo->_numTracks = -1;
+ return;
+ }
+
+ trackInfo->_chunks[trackInfo->_numTracks] = READ_LE_UINT16(p);
+ trackInfo->_voiceTypes[trackInfo->_numTracks] = READ_LE_UINT16(p + 2);
+ ++trackInfo->_numTracks;
+ p += 4;
+ }
+ } else {
+ // Not correct group, so move to next one
+ p += 6 + (READ_LE_UINT16(p + 4) * 4);
+ }
+ }
+}
+
+void SoundManager::_sfTerminate() {
+
+}
+
+void SoundManager::_sfExtractGroupMask() {
+ uint32 mask = 0;
+
+ for (Common::List<SoundDriver *>::iterator i = sfManager()._installedDrivers.begin();
+ i != sfManager()._installedDrivers.end(); ++i)
+ mask |= (*i)->_groupMask;
+
+ _soundManager->_groupsAvail = mask;
+}
+
+bool SoundManager::_sfInstallDriver(SoundDriver *driver) {
+ if (!driver->open())
+ return false;
+
+ driver->setUpdateCallback(_sfUpdateCallback, (void *)&sfManager());
+ sfManager()._installedDrivers.push_back(driver);
+ driver->_groupOffset = driver->getGroupData();
+ driver->_groupMask = READ_LE_UINT32(driver->_groupOffset);
+
+ _sfExtractGroupMask();
+ _sfRethinkSoundDrivers();
+ driver->setMasterVolume(sfManager()._masterVol);
+
+ return true;
+}
+
+void SoundManager::_sfUnInstallDriver(SoundDriver *driver) {
+ sfManager()._installedDrivers.remove(driver);
+ delete driver;
+
+ _sfExtractGroupMask();
+ _sfRethinkSoundDrivers();
+}
+
+void SoundManager::_sfInstallPatchBank(SoundDriver *driver, const byte *bankData) {
+ driver->installPatch(bankData, _vm->_memoryManager.getSize(bankData));
+}
+
+/**
+ * Adds the specified sound in the playing sound list, inserting in order of priority
+ */
+void SoundManager::_sfDoAddToPlayList(Sound *sound) {
+ Common::StackLock slock2(sfManager()._serverSuspendedMutex);
+
+ Common::List<Sound *>::iterator i = sfManager()._playList.begin();
+ while ((i != sfManager()._playList.end()) && (sound->_priority > (*i)->_priority))
+ ++i;
+
+ sfManager()._playList.insert(i, sound);
+}
+
+/**
+ * Removes the specified sound from the play list
+ */
+bool SoundManager::_sfDoRemoveFromPlayList(Sound *sound) {
+ Common::StackLock slock(sfManager()._serverSuspendedMutex);
+
+ bool result = false;
+ for (Common::List<Sound *>::iterator i = sfManager()._playList.begin(); i != sfManager()._playList.end(); ++i) {
+ if (*i == sound) {
+ result = true;
+ sfManager()._playList.erase(i);
+ break;
+ }
+ }
+
+ return result;
+}
+
+void SoundManager::_sfDoUpdateVolume(Sound *sound) {
+ Common::StackLock slock(sfManager()._serverSuspendedMutex);
+
+ for (int voiceIndex = 0; voiceIndex < SOUND_ARR_SIZE; ++voiceIndex) {
+ VoiceTypeStruct *vs = sfManager()._voiceTypeStructPtrs[voiceIndex];
+ if (!vs)
+ continue;
+
+ for (uint idx = 0; idx < vs->_entries.size(); ++idx) {
+ VoiceStructEntry &vse = vs->_entries[idx];
+ SoundDriver *driver = vse._driver;
+
+ if (vs->_voiceType == VOICETYPE_0) {
+ if (vse._type0._sound) {
+ int vol = sound->_volume * sound->_chVolume[vse._type0._channelNum] / 127;
+ driver->proc24(voiceIndex, vse._voiceNum, sound, 7, vol);
+ }
+ } else {
+ if (vse._type1._sound) {
+ int vol = sound->_volume * sound->_chVolume[vse._type1._channelNum] / 127;
+ driver->proc38(vse._voiceNum, 7, vol);
+ }
+ }
+ }
+ }
+}
+
+/*--------------------------------------------------------------------------*/
+
+Sound::Sound() {
+ _stoppedAsynchronously = false;
+ _soundResID = 0;
+ _group = 0;
+ _sndResPriority = 0;
+ _fixedPriority = -1;
+ _sndResLoop = 1;
+ _fixedLoop = -1;
+ _priority = 0;
+ _volume = 127;
+ _loop = 0;
+ _pausedCount = 0;
+ _mutedCount = 0;
+ _hold = 0xff;
+ _cueValue = -1;
+ _fadeDest = -1;
+ _fadeSteps = 0;
+ _fadeTicks = 0;
+ _fadeCounter = 0;
+ _stopAfterFadeFlag = false;
+ _timer = 0;
+ _loopTimer = 0;
+ _trackInfo._numTracks = 0;
+ _primed = false;
+ _isEmpty = false;
+ _remoteReceiver = NULL;
+
+
+ memset(_chProgram, 0, SOUND_ARR_SIZE * sizeof(int));
+ memset(_chModulation, 0, SOUND_ARR_SIZE * sizeof(int));
+ memset(_chVolume, 0, SOUND_ARR_SIZE * sizeof(int));
+ memset(_chPan, 0, SOUND_ARR_SIZE * sizeof(int));
+ memset(_chDamper, 0, SOUND_ARR_SIZE * sizeof(int));
+ memset(_chPitchBlend, 0, SOUND_ARR_SIZE * sizeof(int));
+ memset(_chVoiceType, 0, SOUND_ARR_SIZE * sizeof(int));
+ memset(_chNumVoices, 0, SOUND_ARR_SIZE * sizeof(int));
+ memset(_chSubPriority, 0, SOUND_ARR_SIZE * sizeof(int));
+ memset(_chFlags, 0, SOUND_ARR_SIZE * sizeof(int));
+ Common::set_to(_chWork, _chWork + SOUND_ARR_SIZE, false);
+ memset(_channelData, 0, SOUND_ARR_SIZE * sizeof(byte *));
+ memset(_trkChannel, 0, SOUND_ARR_SIZE * sizeof(int));
+ memset(_trkState, 0, SOUND_ARR_SIZE * sizeof(int));
+ memset(_trkLoopState, 0, SOUND_ARR_SIZE * sizeof(int));
+ memset(_trkIndex, 0, SOUND_ARR_SIZE * sizeof(int));
+ memset(_trkLoopIndex, 0, SOUND_ARR_SIZE * sizeof(int));
+ memset(_trkRest, 0, SOUND_ARR_SIZE * sizeof(int));
+ memset(_trkLoopRest, 0, SOUND_ARR_SIZE * sizeof(int));
+}
+
+Sound::~Sound() {
+ stop();
+}
+
+void Sound::play(int soundNum) {
+ prime(soundNum);
+ _soundManager->addToPlayList(this);
+}
+
+void Sound::stop() {
+ _globals->_soundManager.removeFromPlayList(this);
+ _unPrime();
+}
+
+void Sound::prime(int soundResID) {
+ if (_soundResID != -1) {
+ stop();
+ _prime(soundResID, false);
+ }
+}
+
+void Sound::unPrime() {
+ stop();
+}
+
+void Sound::_prime(int soundResID, bool dontQueue) {
+ if (_primed)
+ unPrime();
+
+ if (_soundResID != -1) {
+ // Sound number specified
+ _isEmpty = false;
+ _remoteReceiver = NULL;
+ byte *soundData = _resourceManager->getResource(RES_SOUND, soundResID, 0);
+ _soundManager->checkResVersion(soundData);
+ _group = _soundManager->determineGroup(soundData);
+ _sndResPriority = _soundManager->extractPriority(soundData);
+ _sndResLoop = _soundManager->extractLoop(soundData);
+ _soundManager->extractTrackInfo(&_trackInfo, soundData, _group);
+
+ for (int idx = 0; idx < _trackInfo._numTracks; ++idx) {
+ _channelData[idx] = _resourceManager->getResource(RES_SOUND, soundResID, _trackInfo._chunks[idx]);
+ }
+
+ DEALLOCATE(soundData);
+ } else {
+ // No sound specified
+ _isEmpty = true;
+ _group = 0;
+ _sndResPriority = 0;
+ _sndResLoop = 0;
+ _trackInfo._numTracks = 0;
+ _channelData[0] = ALLOCATE(200);
+ _remoteReceiver = ALLOCATE(200);
+ }
+
+ _soPrimeSound(dontQueue);
+ if (!dontQueue)
+ _soundManager->addToSoundList(this);
+
+ _primed = true;
+}
+
+void Sound::_unPrime() {
+ if (_primed) {
+ if (_isEmpty) {
+ DEALLOCATE(_channelData[0]);
+ DEALLOCATE(_remoteReceiver);
+ _remoteReceiver = NULL;
+ } else {
+ for (int idx = 0; idx < _trackInfo._numTracks; ++idx) {
+ DEALLOCATE(_channelData[idx]);
+ }
+ }
+
+ _trackInfo._numTracks = 0;
+ if (_soundManager)
+ _soundManager->removeFromSoundList(this);
+
+ _primed = false;
+ _stoppedAsynchronously = false;
+ }
+}
+
+void Sound::orientAfterDriverChange() {
+ if (!_isEmpty) {
+ int timeIndex = getTimeIndex();
+
+ for (int idx = 0; idx < _trackInfo._numTracks; ++idx)
+ DEALLOCATE(_channelData[idx]);
+
+ _trackInfo._numTracks = 0;
+ _primed = false;
+ _prime(_soundResID, true);
+ setTimeIndex(timeIndex);
+ }
+}
+
+void Sound::orientAfterRestore() {
+ if (_isEmpty) {
+ int timeIndex = getTimeIndex();
+ _primed = false;
+ _prime(_soundResID, true);
+ setTimeIndex(timeIndex);
+ }
+}
+
+void Sound::go() {
+ if (!_primed)
+ error("Attempt to execute Sound::go() on an unprimed Sound");
+
+ _soundManager->addToPlayList(this);
+}
+
+void Sound::halt(void) {
+ _soundManager->removeFromPlayList(this);
+}
+
+int Sound::getSoundNum() const {
+ return _soundResID;
+}
+
+bool Sound::isPlaying() {
+ return _soundManager->isOnPlayList(this);
+}
+
+bool Sound::isPrimed() const {
+ return _primed;
+}
+
+bool Sound::isPaused() const {
+ return _pausedCount != 0;
+}
+
+bool Sound::isMuted() const {
+ return _mutedCount != 0;
+}
+
+void Sound::pause(bool flag) {
+ Common::StackLock slock(_globals->_soundManager._serverSuspendedMutex);
+
+ if (flag)
+ ++_pausedCount;
+ else if (_pausedCount > 0)
+ --_pausedCount;
+
+ _soundManager->rethinkVoiceTypes();
+}
+
+void Sound::mute(bool flag) {
+ Common::StackLock slock(_globals->_soundManager._serverSuspendedMutex);
+
+ if (flag)
+ ++_mutedCount;
+ else if (_mutedCount > 0)
+ --_mutedCount;
+
+ _soundManager->rethinkVoiceTypes();
+}
+
+void Sound::fade(int fadeDest, int fadeSteps, int fadeTicks, bool stopAfterFadeFlag) {
+ Common::StackLock slock(_globals->_soundManager._serverSuspendedMutex);
+
+ if (fadeDest > 127)
+ fadeDest = 127;
+ if (fadeTicks > 127)
+ fadeTicks = 127;
+ if (fadeSteps > 255)
+ fadeSteps = 255;
+
+ _fadeDest = fadeDest;
+ _fadeTicks = fadeTicks;
+ _fadeSteps = fadeSteps;
+ _fadeCounter = 0;
+ _stopAfterFadeFlag = stopAfterFadeFlag;
+}
+
+void Sound::setTimeIndex(uint32 timeIndex) {
+ if (_primed) {
+ mute(true);
+ _soSetTimeIndex(timeIndex);
+ mute(false);
+ }
+}
+
+uint32 Sound::getTimeIndex() const {
+ return _timer;
+}
+
+int Sound::getCueValue() const {
+ return _cueValue;
+}
+
+void Sound::setCueValue(int cueValue) {
+ _cueValue = cueValue;
+}
+
+void Sound::setVol(int volume) {
+ if (volume > 127)
+ volume = 127;
+
+ if (_volume != volume) {
+ _volume = volume;
+ if (isPlaying())
+ _soundManager->updateSoundVol(this);
+ }
+}
+
+int Sound::getVol() const {
+ return _volume;
+}
+
+void Sound::setPri(int priority) {
+ if (priority > 127)
+ priority = 127;
+ _fixedPriority = priority;
+ _soundManager->updateSoundPri(this);
+}
+
+void Sound::setLoop(int flag) {
+ _fixedLoop = flag;
+ _soundManager->updateSoundLoop(this);
+}
+
+int Sound::getPri() const {
+ return _priority;
+}
+
+int Sound::getLoop() {
+ return _loop;
+}
+
+void Sound::holdAt(int amount) {
+ if (amount > 127)
+ amount = 127;
+ _hold = amount;
+}
+
+void Sound::release() {
+ _hold = -1;
+}
+
+void Sound::_soPrimeSound(bool dontQueue) {
+ if (!dontQueue) {
+ _priority = (_fixedPriority != -1) ? _fixedPriority : _sndResPriority;
+ _loop = !_fixedLoop ? _fixedLoop : _sndResLoop;
+ _pausedCount = 0;
+ _mutedCount = 0;
+ _hold = -1;
+ _cueValue = -1;
+ _fadeDest = -1;
+ _fadeSteps = 0;
+ _fadeTicks = 0;
+ _fadeCounter = 0;
+ _stopAfterFadeFlag = false;
+ }
+
+ _timer = 0;
+ _loopTimer = 0;
+ _soPrimeChannelData();
+}
+
+void Sound::_soSetTimeIndex(uint timeIndex) {
+ Common::StackLock slock(_globals->_soundManager._serverSuspendedMutex);
+
+ if (timeIndex != _timer) {
+ _soundManager->_soTimeIndexFlag = true;
+ _timer = 0;
+ _loopTimer = 0;
+ _soPrimeChannelData();
+
+ while (timeIndex > 0) {
+ if (_soServiceTracks()) {
+ SoundManager::_sfDoRemoveFromPlayList(this);
+ _stoppedAsynchronously = true;
+ _soundManager->_needToRethink = true;
+ break;
+ }
+ }
+
+ _soundManager->_soTimeIndexFlag = false;
+ }
+}
+
+bool Sound::_soServiceTracks() {
+ if (_isEmpty) {
+ _soRemoteReceive();
+ return false;
+ }
+
+ bool flag = true;
+ for (int trackCtr = 0; trackCtr < _trackInfo._numTracks; ++trackCtr) {
+ int mode = *_channelData[trackCtr];
+
+ if (mode == 0) {
+ _soServiceTrackType0(trackCtr, _channelData[trackCtr]);
+ } else if (mode == 1) {
+ _soServiceTrackType1(trackCtr, _channelData[trackCtr]);
+ } else {
+ error("Unknown sound mode encountered");
+ }
+
+ if (_trkState[trackCtr])
+ flag = false;
+ }
+
+ ++_timer;
+ if (!flag)
+ return false;
+ else if ((_loop > 0) && (--_loop == 0))
+ return true;
+ else {
+ for (int trackCtr = 0; trackCtr < _trackInfo._numTracks; ++trackCtr) {
+ _trkState[trackCtr] = _trkLoopState[trackCtr];
+ _trkRest[trackCtr] = _trkLoopRest[trackCtr];
+ _trkIndex[trackCtr] = _trkLoopIndex[trackCtr];
+ }
+
+ _timer = _loopTimer;
+ return false;
+ }
+}
+
+void Sound::_soPrimeChannelData() {
+ if (_isEmpty) {
+ for (int idx = 0; idx < 16; ++idx) {
+ _chProgram[idx] = 0;
+ _chModulation[idx] = 0;
+ _chVolume[idx] = 127;
+ _chPan[idx] = 64;
+ _chDamper[idx] = 0;
+ _chVoiceType[idx] = VOICETYPE_0;
+ _chNumVoices[idx] = 0;
+ _chSubPriority[idx] = 0;
+ _chPitchBlend[idx] = 0x2000;
+ _chFlags[idx] = 1;
+ }
+
+ _trkChannel[0] = 0;
+ _trkState[0] = 1;
+ _trkLoopState[0] = 1;
+ _trkIndex[0] = 0;
+ _trkLoopIndex[0] = 0;
+ } else {
+ for (int idx = 0; idx < SOUND_ARR_SIZE; ++idx)
+ _chFlags[idx] = 0x8000;
+
+ for (int idx = 0; idx < _trackInfo._numTracks; ++idx) {
+ byte *d = _channelData[idx];
+ int mode = *d;
+ int channelNum = (int8)*(d + 1);
+
+ _trkChannel[idx] = channelNum;
+ assert((channelNum >= -1) && (channelNum < 16));
+
+ if (channelNum >= 0) {
+ _chProgram[channelNum] = *(d + 10);
+ _chModulation[channelNum] = 0;
+ _chVolume[channelNum] = *(d + 11);
+ _chPan[channelNum] = *(d + 12);
+ _chDamper[channelNum] = 0;
+ _chVoiceType[channelNum] = _trackInfo._voiceTypes[idx];
+ _chNumVoices[channelNum] = *(d + 6);
+ _chSubPriority[channelNum] = *(d + 7);
+ _chPitchBlend[channelNum] = 0x2000;
+ _chFlags[channelNum] = READ_LE_UINT16(d + 8);
+ }
+
+ if (mode == 0) {
+ _trkState[idx] = 1;
+ _trkLoopState[idx] = 1;
+ _trkIndex[idx] = 14;
+ _trkLoopIndex[idx] = 14;
+ _trkRest[idx] = 0;
+ _trkLoopRest[idx] = 0;
+ } else if (mode == 1) {
+ _trkState[idx] = 1;
+ _trkLoopState[idx] = 1;
+ _trkIndex[idx] = 0;
+ _trkLoopIndex[idx] = 0;
+ _trkRest[idx] = 0;
+ _trkLoopRest[idx] = 0;
+ } else {
+ error("Unknown sound mode encountered");
+ }
+ }
+ }
+}
+
+void Sound::_soRemoteReceive() {
+ error("_soRemoteReceive not implemented");
+}
+
+void Sound::_soServiceTrackType0(int trackIndex, const byte *channelData) {
+ if (_trkRest[trackIndex]) {
+ --_trkRest[trackIndex];
+ return;
+ }
+ if (!_trkState[trackIndex])
+ return;
+
+ int channelNum = _trkChannel[trackIndex];
+ assert((channelNum >= -1) && (channelNum < SOUND_ARR_SIZE));
+ int chFlags = (channelNum == -1) ? 0 : _chFlags[channelNum];
+ int voiceNum = -1;
+ SoundDriver *driver = NULL;
+
+ VoiceTypeStruct *vtStruct;
+ VoiceType voiceType = VOICETYPE_0, chVoiceType = VOICETYPE_0;
+
+ if ((channelNum == -1) || _soundManager->_soTimeIndexFlag) {
+ vtStruct = NULL;
+ voiceType = VOICETYPE_0;
+ } else {
+ chVoiceType = (VoiceType)_chVoiceType[channelNum];
+ vtStruct = _soundManager->_voiceTypeStructPtrs[(int)chVoiceType];
+
+ if (vtStruct) {
+ voiceType = vtStruct->_voiceType;
+ if (voiceType == VOICETYPE_0) {
+ for (uint idx = 0; idx < vtStruct->_entries.size(); ++idx) {
+ if (!vtStruct->_entries[idx]._type0._sound &&
+ (vtStruct->_entries[idx]._type0._channelNum != channelNum)) {
+ voiceNum = vtStruct->_entries[idx]._voiceNum;
+ driver = vtStruct->_entries[idx]._driver;
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ const byte *pData = channelData + _trkIndex[trackIndex];
+
+ for (;;) {
+ byte v = *pData++;
+ if (!(v & 0x80)) {
+ // Area #1
+ if (!_soundManager->_soTimeIndexFlag) {
+ // Only do processing if fast forwarding to a given time index
+ if (channelNum != -1) {
+ if (voiceType == VOICETYPE_1) {
+ _soUpdateDamper(vtStruct, channelNum, chVoiceType, v);
+ } else if (voiceNum != -1) {
+ assert(driver);
+ driver->proc18(voiceNum, chVoiceType);
+ }
+ }
+ }
+ } else if (!(v & 0x40)) {
+ // Area #2
+ if (!_soundManager->_soTimeIndexFlag) {
+ // Only do processing if fast forwarding to a given time index
+ byte b = *pData++;
+ v <<= 1;
+ if (b & 0x80)
+ v |= 1;
+
+ b &= 0x7f;
+
+ if (channelNum != -1) {
+ if (voiceType == VOICETYPE_1) {
+ if (chFlags & 0x10)
+ _soProc42(vtStruct, channelNum, chVoiceType, v);
+ else
+ _soProc32(vtStruct, channelNum, chVoiceType, v, b);
+ } else if (voiceNum != -1) {
+ assert(driver);
+ driver->proc20(voiceNum, chVoiceType);
+ }
+ }
+ } else {
+ ++pData;
+ }
+ } else if (!(v & 0x20)) {
+ // Area #3
+ v &= 0x1f;
+
+ // Gather up an extended number
+ int trkRest = v;
+ while ((*pData & 0xE0) == 0xC0) {
+ byte b = *pData++;
+ trkRest = (trkRest << 5) | (b & 0x1f);
+ }
+
+ _trkRest[trackIndex] = trkRest - 1;
+ _trkIndex[trackIndex] = pData - channelData;
+ return;
+ } else if (!(v & 0x10)) {
+ // Area #4
+ v = (v & 0xf) << 1;
+
+ byte b = *pData++;
+ if (b & 0x80)
+ v |= 1;
+ b &= 0x7f;
+
+ assert(v < 4);
+ int cmdList[32] = { 1, 7, 10, 64 };
+ int cmdVal = cmdList[v];
+
+ if (channelNum == -1) {
+ if (_soDoUpdateTracks(cmdVal, b))
+ return;
+ } else {
+ _soDoTrackCommand(_trkChannel[trackIndex], cmdVal, b);
+
+ if (!_soundManager->_soTimeIndexFlag) {
+ if (cmdVal == 7)
+ b = static_cast<byte>(_volume * (int)b / 127);
+
+ if (voiceType != VOICETYPE_0) {
+ _soProc38(vtStruct, channelNum, chVoiceType, cmdVal, b);
+ } else if (voiceNum != -1) {
+ assert(driver);
+ driver->proc24(voiceNum, chVoiceType, this, cmdVal, b);
+ }
+ }
+ }
+ } else if (!(v & 0x8)) {
+ // Area #5
+ if (!_soundManager->_soTimeIndexFlag) {
+ // Only do processing if fast forwarding to a given time index
+ int cx = READ_LE_UINT16(pData);
+ pData += 2;
+
+ if (channelNum != -1) {
+ assert(driver);
+ driver->proc22(voiceNum, chVoiceType, cx);
+ }
+ } else {
+ pData += 2;
+ }
+ } else if (!(v & 0x4)) {
+ // Area #6
+ int cmd = *pData++;
+ int value = *pData++;
+
+ if (channelNum != -1) {
+ _soDoTrackCommand(_trkChannel[trackIndex], cmd, value);
+
+ if (!_soundManager->_soTimeIndexFlag) {
+ if (voiceType != VOICETYPE_0) {
+ _soProc38(vtStruct, channelNum, chVoiceType, cmd, value);
+ } else if (voiceNum != -1) {
+ assert(driver);
+ driver->proc24(voiceNum, chVoiceType, this, cmd, value);
+ }
+ }
+ } else if (_soDoUpdateTracks(cmd, value)) {
+ return;
+ }
+ } else if (!(v & 0x2)) {
+ // Area #7
+ if (!_soundManager->_soTimeIndexFlag) {
+ int pitchBlend = READ_BE_UINT16(pData);
+ pData += 2;
+
+ if (channelNum != -1) {
+ int channel = _trkChannel[trackIndex];
+ _chPitchBlend[channel] = pitchBlend;
+
+ if (voiceType != VOICETYPE_0) {
+ _soProc40(vtStruct, channelNum, pitchBlend);
+ } else if (voiceNum != -1) {
+ assert(driver);
+ driver->setPitchBlend(channel, pitchBlend);
+ }
+ }
+ } else {
+ pData += 2;
+ }
+ } else if (!(v & 0x1)) {
+ // Area #8
+ int program = *pData++;
+
+ if (channelNum != -1) {
+ int channel = _trkChannel[trackIndex];
+ _chProgram[channel] = program;
+
+ if (!_soundManager->_soTimeIndexFlag) {
+ if ((voiceType == VOICETYPE_0) && (voiceNum != -1)) {
+ assert(driver);
+ driver->setProgram(voiceNum, program);
+ }
+ }
+ } else {
+ _soSetTrackPos(trackIndex, pData - channelData, program);
+ }
+
+ } else {
+ // Area #9
+ byte b = *pData++;
+
+ if (b & 0x80) {
+ _trkState[trackIndex] = 0;
+ _trkIndex[trackIndex] = pData - channelData;
+ return;
+ }
+
+ if (!_soundManager->_soTimeIndexFlag) {
+ if ((channelNum != -1) && (voiceType == VOICETYPE_0) && (voiceNum != -1)) {
+ assert(driver);
+ driver->setVolume1(voiceNum, chVoiceType, 0, b);
+ }
+
+ }
+ }
+ }
+}
+
+void Sound::_soUpdateDamper(VoiceTypeStruct *voiceType, int channelNum, VoiceType mode, int v0) {
+ bool hasDamper = _chDamper[channelNum] != 0;
+
+ for (uint idx = 0; idx < voiceType->_entries.size(); ++idx) {
+ VoiceStructEntryType1 &vte = voiceType->_entries[idx]._type1;
+
+ if ((vte._field4 == v0) && (vte._channelNum == channelNum) && (vte._sound == this)) {
+ if (hasDamper)
+ vte._field5 = 1;
+ else {
+ SoundDriver *driver = voiceType->_entries[idx]._driver;
+ assert(driver);
+
+ vte._field4 = -1;
+ vte._field5 = 0;
+ driver->updateVoice(voiceType->_entries[idx]._voiceNum);
+ }
+ return;
+ }
+ }
+}
+
+void Sound::_soProc32(VoiceTypeStruct *vtStruct, int channelNum, VoiceType voiceType, int v0, int v1) {
+ int entryIndex = _soFindSound(vtStruct, channelNum);
+ if (entryIndex != -1) {
+ SoundDriver *driver = vtStruct->_entries[entryIndex]._driver;
+ assert(driver);
+
+ vtStruct->_entries[entryIndex]._type1._field6 = 0;
+ vtStruct->_entries[entryIndex]._type1._field4 = v0;
+ vtStruct->_entries[entryIndex]._type1._field5 = 0;
+
+ driver->proc32(vtStruct->_entries[entryIndex]._voiceNum, _chProgram[channelNum], v0, v1);
+ }
+}
+
+void Sound::_soProc42(VoiceTypeStruct *vtStruct, int channelNum, VoiceType voiceType, int v0) {
+ for (int trackCtr = 0; trackCtr < _trackInfo._numTracks; ++trackCtr) {
+ const byte *instrument = _channelData[trackCtr];
+ if ((*(instrument + 13) == v0) && (*instrument == 1)) {
+ int entryIndex = _soFindSound(vtStruct, channelNum);
+
+ if (entryIndex != -1) {
+ SoundDriver *driver = vtStruct->_entries[entryIndex]._driver;
+ assert(driver);
+
+ vtStruct->_entries[entryIndex]._type1._field6 = 0;
+ vtStruct->_entries[entryIndex]._type1._field4 = v0;
+ vtStruct->_entries[entryIndex]._type1._field5 = 0;
+
+ driver->proc32(vtStruct->_entries[entryIndex]._voiceNum, -1, v0, 0x7F);
+ driver->proc42(vtStruct->_entries[entryIndex]._voiceNum, voiceType, 0);
+ }
+ break;
+ }
+ }
+}
+
+void Sound::_soProc38(VoiceTypeStruct *vtStruct, int channelNum, VoiceType voiceType, int cmd, int value) {
+ if (cmd == 64) {
+ if (value == 0) {
+ for (uint entryIndex = 0; entryIndex < vtStruct->_entries.size(); ++entryIndex) {
+ VoiceStructEntryType1 &vte = vtStruct->_entries[entryIndex]._type1;
+
+ if ((vte._sound == this) && (vte._channelNum == channelNum) && (vte._field5 != 0)) {
+ SoundDriver *driver = vtStruct->_entries[entryIndex]._driver;
+ assert(driver);
+
+ vte._field4 = -1;
+ vte._field5 = 0;
+ driver->updateVoice(vtStruct->_entries[entryIndex]._voiceNum);
+ }
+ }
+ }
+ } else if (cmd == 75) {
+ _soundManager->_needToRethink = true;
+ } else {
+ for (uint entryIndex = 0; entryIndex < vtStruct->_entries.size(); ++entryIndex) {
+ VoiceStructEntry &vte = vtStruct->_entries[entryIndex];
+
+ if ((vte._type1._sound == this) && (vte._type1._channelNum == channelNum)) {
+ SoundDriver *driver = vte._driver;
+ assert(driver);
+
+ driver->proc38(vte._voiceNum, cmd, value);
+ }
+ }
+ }
+}
+
+void Sound::_soProc40(VoiceTypeStruct *vtStruct, int channelNum, int pitchBlend) {
+ for (uint entryIndex = 0; entryIndex < vtStruct->_entries.size(); ++entryIndex) {
+ VoiceStructEntryType1 &vte = vtStruct->_entries[entryIndex]._type1;
+
+ if ((vte._sound == this) && (vte._channelNum == channelNum)) {
+ SoundDriver *driver = vtStruct->_entries[entryIndex]._driver;
+ assert(driver);
+
+ driver->setPitch(vtStruct->_entries[entryIndex]._voiceNum, pitchBlend);
+ }
+ }
+}
+
+void Sound::_soDoTrackCommand(int channelNum, int command, int value) {
+ switch (command) {
+ case 1:
+ _chModulation[channelNum] = value;
+ break;
+ case 7:
+ _chVolume[channelNum] = value;
+ break;
+ case 10:
+ _chPan[channelNum] = value;
+ break;
+ case 64:
+ _chDamper[channelNum] = value;
+ break;
+ case 75:
+ _chNumVoices[channelNum] = value;
+ break;
+ }
+}
+
+bool Sound::_soDoUpdateTracks(int command, int value) {
+ if ((command == 76) || (_hold != value))
+ return false;
+
+ for (int trackIndex = 0; trackIndex < _trackInfo._numTracks; ++trackIndex) {
+ _trkState[trackIndex] = _trkLoopState[trackIndex];
+ _trkRest[trackIndex] = _trkLoopRest[trackIndex];
+ _trkIndex[trackIndex] = _trkLoopIndex[trackIndex];
+ }
+
+ _timer = _loopTimer;
+ return true;
+}
+
+void Sound::_soSetTrackPos(int trackIndex, int trackPos, int cueValue) {
+ _trkIndex[trackIndex] = trackPos;
+ if (cueValue == 127) {
+ if (!_soundManager->_soTimeIndexFlag)
+ _cueValue = cueValue;
+ } else {
+ for (int idx = 0; idx < _trackInfo._numTracks; ++idx) {
+ _trkLoopState[idx] = _trkState[idx];
+ _trkLoopRest[idx] = _trkRest[idx];
+ _trkLoopIndex[idx] = _trkIndex[idx];
+ }
+
+ _loopTimer = _timer;
+ }
+}
+
+void Sound::_soServiceTrackType1(int trackIndex, const byte *channelData) {
+ if (_soundManager->_soTimeIndexFlag || !_trkState[trackIndex])
+ return;
+
+ int channel = _trkChannel[trackIndex];
+ if (channel == -1)
+ _trkState[trackIndex] = 0;
+ else {
+ int voiceType = _chVoiceType[channel];
+ VoiceTypeStruct *vtStruct = _soundManager->_voiceTypeStructPtrs[voiceType];
+
+ if (!vtStruct)
+ _trkState[trackIndex] = 0;
+ else {
+ if (vtStruct->_voiceType != VOICETYPE_0) {
+ if (_trkState[trackIndex] == 1) {
+ int entryIndex = _soFindSound(vtStruct, *(channelData + 1));
+ if (entryIndex != -1) {
+ SoundDriver *driver = vtStruct->_entries[entryIndex]._driver;
+ assert(driver);
+
+ vtStruct->_entries[entryIndex]._type1._field6 = 0;
+ vtStruct->_entries[entryIndex]._type1._field4 = *(channelData + 1);
+ vtStruct->_entries[entryIndex]._type1._field5 = 0;
+
+ driver->proc32(vtStruct->_entries[entryIndex]._voiceNum, -1, *(channelData + 1), 0x7f);
+ }
+ } else {
+
+ }
+ }
+ }
+ }
+}
+
+int Sound::_soFindSound(VoiceTypeStruct *vtStruct, int channelNum) {
+ int entryIndex = -1, entry2Index = -1;
+ int v6 = 0, v8 = 0;
+
+ for (uint idx = 0; idx < vtStruct->_entries.size(); ++idx) {
+ VoiceStructEntryType1 &vte = vtStruct->_entries[idx]._type1;
+ if ((vte._channelNum == channelNum) && (vte._sound == this)) {
+ int v = vte._field6;
+ if (vte._field4 != -1) {
+ if (v8 <= v) {
+ v8 = v;
+ entry2Index = idx;
+ }
+ } else {
+ if (v6 <= v) {
+ v6 = v;
+ entryIndex = idx;
+ }
+ }
+ }
+ }
+
+ if (entryIndex != -1)
+ return entryIndex;
+ else if ((entryIndex == -1) && (entry2Index == -1))
+ return -1;
+ else {
+ SoundDriver *driver = vtStruct->_entries[entry2Index]._driver;
+ assert(driver);
+ driver->updateVoice(vtStruct->_entries[entry2Index]._voiceNum);
+
+ return entry2Index;
+ }
+}
+
+/*--------------------------------------------------------------------------*/
+
+ASound::ASound(): EventHandler() {
+ _action = NULL;
+ _cueValue = -1;
+ if (_globals)
+ _globals->_sounds.push_back(this);
+}
+
+ASound::~ASound() {
+ if (_globals)
+ _globals->_sounds.remove(this);
+}
+
+void ASound::synchronize(Serializer &s) {
+ EventHandler::synchronize(s);
+
+ SYNC_POINTER(_action);
+ s.syncAsByte(_cueValue);
+
+}
+
+void ASound::dispatch() {
+ EventHandler::dispatch();
+
+ int cueValue = _sound.getCueValue();
+ if (cueValue != -1) {
+ _cueValue = cueValue;
+ _sound.setCueValue(-1);
+
+ if (_action)
+ _action->signal();
+ }
+
+ if (_cueValue != -1) {
+ if (!_sound.isPrimed()) {
+ _cueValue = -1;
+ if (_action) {
+ _action->signal();
+ _action = NULL;
+ }
+ }
+ }
+}
+
+void ASound::play(int soundNum, Action *action, int volume) {
+ _action = action;
+ _cueValue = 0;
+
+ setVol(volume);
+ _sound.play(soundNum);
+}
+
+void ASound::stop() {
+ _sound.stop();
+ _action = NULL;
+}
+
+void ASound::prime(int soundResID, Action *action) {
+ _action = action;
+ _cueValue = 0;
+ _sound.prime(soundResID);
+}
+
+void ASound::unPrime() {
+ _sound.unPrime();
+ _action = NULL;
+}
+
+void ASound::fade(int fadeDest, int fadeSteps, int fadeTicks, bool stopAfterFadeFlag, Action *action) {
+ if (action)
+ _action = action;
+
+ _sound.fade(fadeDest, fadeSteps, fadeTicks, stopAfterFadeFlag);
+}
+
+
+/*--------------------------------------------------------------------------*/
+
+SoundDriver::SoundDriver() {
+ _driverResID = 0;
+ _minVersion = _maxVersion = 0;
+ _groupMask = 0;
+}
+
+/*--------------------------------------------------------------------------*/
+
+const byte adlib_group_data[] = { 1, 1, 9, 1, 0xff };
+
+const byte v440B0[9] = { 0, 1, 2, 6, 7, 8, 12, 13, 14 };
+
+const byte v440B9[9] = { 3, 4, 5, 9, 10, 11, 15, 16, 17 };
+
+const byte v440C2[18] = {
+ 0, 1, 2, 3, 4, 5, 8, 9, 10, 11, 12, 13, 16, 17, 18, 19, 20, 21
+};
+
+const byte v44134[64] = {
+ 0, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
+ 33, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
+ 46, 47, 47, 48, 49, 50, 50, 51, 52, 52, 53, 54, 54, 55,
+ 56, 56, 57, 57, 58, 58, 59, 59, 59, 60, 60, 60, 61, 61,
+ 61, 62, 62, 62, 62, 63, 63, 63
+};
+
+const int v440D4[48] = {
+ 343, 348, 353, 358, 363, 369, 374, 379, 385, 391, 396,
+ 402, 408, 414, 420, 426, 432, 438, 445, 451, 458, 465,
+ 471, 478, 485, 492, 499, 507, 514, 521, 529, 537, 544,
+ 552, 560, 569, 577, 585, 594, 602, 611, 620, 629, 638,
+ 647, 657, 666, 676
+};
+
+AdlibSoundDriver::AdlibSoundDriver(): SoundDriver() {
+ _upCb = NULL;
+ _upRef = NULL;
+ _minVersion = 0x102;
+ _maxVersion = 0x10A;
+ _masterVolume = 0;
+
+ _groupData.groupMask = 9;
+ _groupData.v1 = 0x46;
+ _groupData.v2 = 0;
+ _groupData.pData = &adlib_group_data[0];
+
+ _mixer = _vm->_mixer;
+ _sampleRate = _mixer->getOutputRate();
+ _opl = makeAdLibOPL(_sampleRate);
+ _mixer->playStream(Audio::Mixer::kPlainSoundType, &_soundHandle, this, -1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::NO, true);
+
+ Common::set_to(_channelVoiced, _channelVoiced + ADLIB_CHANNEL_COUNT, false);
+ memset(_channelVolume, 0, ADLIB_CHANNEL_COUNT * sizeof(int));
+ memset(_v4405E, 0, ADLIB_CHANNEL_COUNT * sizeof(int));
+ memset(_v44067, 0, ADLIB_CHANNEL_COUNT * sizeof(int));
+ memset(_v44070, 0, ADLIB_CHANNEL_COUNT * sizeof(int));
+ memset(_v44079, 0, ADLIB_CHANNEL_COUNT * sizeof(int));
+ memset(_v44082, 0, ADLIB_CHANNEL_COUNT * sizeof(int));
+ _v44082[ADLIB_CHANNEL_COUNT] = 0x90;
+ Common::set_to(_pitchBlend, _pitchBlend + ADLIB_CHANNEL_COUNT, 0x2000);
+ memset(_v4409E, 0, ADLIB_CHANNEL_COUNT * sizeof(int));
+ _patchData = NULL;
+}
+
+AdlibSoundDriver::~AdlibSoundDriver() {
+ DEALLOCATE(_patchData);
+ _mixer->stopHandle(_soundHandle);
+ OPLDestroy(_opl);
+}
+
+bool AdlibSoundDriver::open() {
+ write(1, 0x20);
+ if (!reset())
+ return false;
+
+ write(8, 0);
+ for (int idx = 0x20; idx < 0xF6; ++idx)
+ write(idx, 0);
+
+ write(0xBD, 0);
+ return true;
+}
+
+void AdlibSoundDriver::close() {
+ for (int idx = 0xB0; idx < 0xB8; ++idx)
+ write(idx, _portContents[idx] & 0xDF);
+ for (int idx = 0x40; idx < 0x55; ++idx)
+ write(idx, 0x3F);
+ reset();
+}
+
+bool AdlibSoundDriver::reset() {
+ write(1, 0x20);
+ write(4, 0x80);
+
+ write(2, 1);
+ write(4, 1);
+
+ return true;
+}
+
+const GroupData *AdlibSoundDriver::getGroupData() {
+ return &_groupData;
+}
+
+void AdlibSoundDriver::installPatch(const byte *data, int size) {
+ byte *patchData = ALLOCATE(size);
+ Common::copy(data, data + size, patchData);
+ _patchData = patchData;
+}
+
+int AdlibSoundDriver::setMasterVolume(int volume) {
+ int oldVolume = _masterVolume;
+ _masterVolume = volume;
+
+ for (int channelNum = 0; channelNum < ADLIB_CHANNEL_COUNT; ++channelNum)
+ updateChannelVolume(channelNum);
+
+ return oldVolume;
+}
+
+void AdlibSoundDriver::proc32(int channel, int program, int v0, int v1) {
+ if (program == -1)
+ return;
+
+ int offset = READ_LE_UINT16(_patchData + program * 2);
+ if (offset) {
+ const byte *dataP = _patchData + offset;
+ int id;
+
+ for (offset = 2, id = 0; id != READ_LE_UINT16(dataP); offset += 30, ++id) {
+ if ((dataP[offset] <= v0) && (dataP[offset + 1] >= v0)) {
+ if (dataP[offset + 2] != 0xff)
+ v0 = dataP[offset + 2];
+
+ _v4409E[channel] = dataP + offset - _patchData;
+
+ // Set sustain/release
+ int portNum = v440C2[v440B0[channel]] + 0x80;
+ write(portNum, (_portContents[portNum] & 0xF0) | 0xF);
+
+ portNum = v440C2[v440B9[channel]] + 0x80;
+ write(portNum, (_portContents[portNum] & 0xF0) | 0xF);
+
+ if (_channelVoiced[channel])
+ clearVoice(channel);
+
+ _v44067[channel] = v0;
+ _v4405E[channel] = v1;
+
+ updateChannel(channel);
+ setFrequency(channel);
+ updateChannelVolume(channel);
+ setVoice(channel);
+ break;
+ }
+ }
+ }
+}
+
+void AdlibSoundDriver::updateVoice(int channel) {
+ if (_channelVoiced[channel])
+ clearVoice(channel);
+}
+
+void AdlibSoundDriver::proc38(int channel, int cmd, int value) {
+ if (cmd == 7) {
+ // Set channel volume
+ _channelVolume[channel] = value;
+ updateChannelVolume(channel);
+ }
+}
+
+void AdlibSoundDriver::setPitch(int channel, int pitchBlend) {
+ _pitchBlend[channel] = pitchBlend;
+ setFrequency(channel);
+}
+
+void AdlibSoundDriver::write(byte reg, byte value) {
+ _portContents[reg] = value;
+ OPLWriteReg(_opl, reg, value);
+}
+
+void AdlibSoundDriver::updateChannelVolume(int channelNum) {
+ int volume = (_masterVolume * _channelVolume[channelNum] / 127 * _v4405E[channelNum] / 127) / 2;
+ int level2 = 63 - v44134[volume * _v44079[channelNum] / 63];
+ int level1 = !_v44082[channelNum] ? 63 - _v44070[channelNum] :
+ 63 - v44134[volume * _v44070[channelNum] / 63];
+
+ int portNum = v440C2[v440B0[channelNum]] + 0x40;
+ write(portNum, (_portContents[portNum] & 0x80) | level1);
+
+ portNum = v440C2[v440B9[channelNum]] + 0x40;
+ write(portNum, (_portContents[portNum] & 0x80) | level2);
+}
+
+void AdlibSoundDriver::setVoice(int channel) {
+ int portNum = 0xB0 + channel;
+ write(portNum, _portContents[portNum] | 0x20);
+ _channelVoiced[channel] = true;
+}
+
+void AdlibSoundDriver::clearVoice(int channel) {
+ write(0xB0 + channel, _portContents[0xB0 + channel] & ~0x20);
+ _channelVoiced[channel] = false;
+}
+
+void AdlibSoundDriver::updateChannel(int channel) {
+ const byte *dataP = _patchData + _v4409E[channel];
+ int portOffset = v440C2[v440B0[channel]];
+
+ int portNum = portOffset + 0x20;
+ int portValue = 0;
+ if (*(dataP + 4))
+ portValue |= 0x80;
+ if (*(dataP + 5))
+ portValue |= 0x40;
+ if (*(dataP + 8))
+ portValue |= 0x20;
+ if (*(dataP + 6))
+ portValue |= 0x10;
+ portValue |= *(dataP + 7);
+ write(portNum, portValue);
+
+ portValue = (_portContents[0x40 + portOffset] & 0x3F) | (*(dataP + 9) << 6);
+ write(0x40 + portOffset, portValue);
+
+ _v44070[channel] = 63 - *(dataP + 10);
+ write(0x60 + portOffset, *(dataP + 12) | (*(dataP + 11) << 4));
+ write(0x80 + portOffset, *(dataP + 14) | (*(dataP + 13) << 4));
+ write(0xE0 + portOffset, (_portContents[0xE0 + portOffset] & 0xFC) | *(dataP + 15));
+
+ portOffset = v440C2[v440B9[channel]];
+ portNum = portOffset + 0x20;
+ portValue = 0;
+ if (*(dataP + 17))
+ portValue |= 0x80;
+ if (*(dataP + 18))
+ portValue |= 0x40;
+ if (*(dataP + 21))
+ portValue |= 0x20;
+ if (*(dataP + 19))
+ portValue |= 0x10;
+ portValue |= *(dataP + 20);
+ write(portNum, portValue);
+
+ write(0x40 + portOffset, (_portContents[0x40 + portOffset] & 0x3f) | (*(dataP + 22) << 6));
+ _v44079[channel] = 0x3F - *(dataP + 23);
+ write(0x60 + portOffset, *(dataP + 25) | (*(dataP + 24) << 4));
+ write(0x80 + portOffset, *(dataP + 27) | (*(dataP + 26) << 4));
+ write(0xE0 + portOffset, (_portContents[0xE0 + portOffset] & 0xFC) | *(dataP + 28));
+
+ write(0xC0 + channel, (_portContents[0xC0 + channel] & 0xF0)
+ | (*(dataP + 16) << 1) | *(dataP + 3));
+
+ _v44082[channel] = *(dataP + 3);
+}
+
+void AdlibSoundDriver::setFrequency(int channel) {
+ int offset, ch;
+
+ int v = _pitchBlend[channel];
+ if (v == 0x2000) {
+ offset = 0;
+ ch = _v44067[channel];
+ } else if (v > 0x2000) {
+ ch = _v44067[channel];
+ v -= 0x2000;
+ if (v == 0x1fff)
+ v = 0x2000;
+
+ offset = (v / 170) & 3;
+ ch += (v / 170) >> 2;
+
+ if (ch >= 128)
+ ch = 127;
+ } else {
+ ch = _v44067[channel];
+ int tempVal = (0x2000 - v) / 170;
+ int tempVal2 = 4 - (tempVal & 3);
+
+ if (tempVal2 == 4)
+ offset = 0;
+ else {
+ offset = tempVal2;
+ --ch;
+ }
+
+ ch -= tempVal >> 2;
+ if (ch < 0)
+ ch = 0;
+ }
+
+ int var2 = ch / 12;
+ if (var2)
+ --var2;
+
+ int dataWord = v440D4[((ch % 12) << 2) + offset];
+ write(0xA0 + channel, dataWord & 0xff);
+ write(0xB0 + channel, (_portContents[0xB0 + channel] & 0xE0) |
+ ((dataWord >> 8) & 3) | (var2 << 2));
+}
+
+int AdlibSoundDriver::readBuffer(int16 *buffer, const int numSamples) {
+ update(buffer, numSamples);
+ return numSamples;
+}
+
+void AdlibSoundDriver::update(int16 *buf, int len) {
+ static int samplesLeft = 0;
+ while (len != 0) {
+ int count = samplesLeft;
+ if (count > len) {
+ count = len;
+ }
+ samplesLeft -= count;
+ len -= count;
+ YM3812UpdateOne(_opl, buf, count);
+ if (samplesLeft == 0) {
+ if (_upCb) {
+ (*_upCb)(_upRef);
+ }
+ samplesLeft = _sampleRate / 50;
+ }
+ buf += count;
+ }
+}
+
+void AdlibSoundDriver::setUpdateCallback(UpdateCallback upCb, void *ref) {
+ _upCb = upCb;
+ _upRef = ref;
}
} // End of namespace tSage
diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h
index 03ae77b703..9a8cfb3cfc 100644
--- a/engines/tsage/sound.h
+++ b/engines/tsage/sound.h
@@ -24,21 +24,427 @@
#define TSAGE_SOUND_H
#include "common/scummsys.h"
+#include "common/mutex.h"
+#include "audio/audiostream.h"
+#include "audio/fmopl.h"
+#include "audio/mixer.h"
+#include "common/list.h"
#include "tsage/saveload.h"
+#include "tsage/core.h"
namespace tSage {
+class Sound;
+
+#define SOUND_ARR_SIZE 16
+#define ROLAND_DRIVER_NUM 2
+#define ADLIB_DRIVER_NUM 3
+
+struct trackInfoStruct {
+ int _numTracks;
+ int _chunks[SOUND_ARR_SIZE];
+ int _voiceTypes[SOUND_ARR_SIZE];
+};
+
+enum SoundDriverStatus {SNDSTATUS_FAILED = 0, SNDSTATUS_DETECTED = 1, SNDSTATUS_SKIPPED = 2};
+enum VoiceType {VOICETYPE_0 = 0, VOICETYPE_1 = 1};
+
+class SoundDriverEntry {
+public:
+ int driverNum;
+ SoundDriverStatus status;
+ int field2, field6;
+ Common::String shortDescription;
+ Common::String longDescription;
+};
+
+struct GroupData {
+ uint32 groupMask;
+ byte v1;
+ byte v2;
+ const byte *pData;
+};
+
+class SoundDriver {
+public:
+ Common::String _shortDescription, _longDescription;
+ int _minVersion, _maxVersion;
+ // The following fields were originally held in separate arrays in the SoundManager class
+ uint32 _groupMask;
+ const GroupData *_groupOffset;
+ int _driverResID;
+
+ typedef void (*UpdateCallback)(void *);
+ UpdateCallback _upCb;
+ void *_upRef;
+public:
+ SoundDriver();
+ virtual ~SoundDriver() {};
+
+ const Common::String &getShortDriverDescription() { return _shortDescription; }
+ const Common::String &getLongDriverDescription() { return _longDescription; }
+
+ virtual bool open() { return true; } // Method #0
+ virtual void close() {} // Method #1
+ virtual bool reset() { return true; } // Method #2
+ virtual const GroupData *getGroupData() { return NULL; } // Method #3
+ virtual void installPatch(const byte *data, int size) {} // Method #4
+ virtual void poll() {} // Method #5
+ virtual void proc12() {} // Method #6
+ virtual int setMasterVolume(int volume) { return 0; } // Method #7
+ virtual void proc16() {} // Method #8
+ virtual void proc18(int al, VoiceType voiceType) {} // Method #9
+ virtual void proc20(int al, VoiceType voiceType) {} // Method #10
+ virtual void proc22(int al, VoiceType voiceType, int v3) {} // Method #11
+ virtual void proc24(int channel, int voiceIndex, Sound *sound, int v1, int v2) {}
+ virtual void setProgram(int channel, int program) {} // Method #13
+ virtual void setVolume1(int channel, int v2, int v3, int volume) {}
+ virtual void setPitchBlend(int channel, int pitchBlend) {} // Method #15
+ virtual void proc32(int channel, int program, int v0, int v1) {}// Method #16
+ virtual void updateVoice(int channel) {} // Method #17
+ virtual void proc36() {} // Method #18
+ virtual void proc38(int channel, int cmd, int value) {} // Method #19
+ virtual void setPitch(int channel, int pitchBlend) {} // Method #20
+ virtual void proc42(int channel, int v0, int v1) {} // Method #21
+
+ virtual void setUpdateCallback(UpdateCallback upCb, void *ref) {}
+};
+
+struct VoiceStructEntryType0 {
+ Sound *_sound;
+ int _channelNum;
+ int _priority;
+ int _fieldA;
+ Sound *_sound2;
+ int _channelNum2;
+ int _priority2;
+ int _field12;
+ Sound *_sound3;
+ int _channelNum3;
+ int _priority3;
+ int _field1A;
+ int _field1B;
+};
+
+struct VoiceStructEntryType1 {
+ int _field4;
+ int _field5;
+ int _field6;
+ Sound *_sound;
+ int _channelNum;
+ int _priority;
+ Sound *_sound2;
+ int _channelNum2;
+ int _priority2;
+ Sound *_sound3;
+ int _channelNum3;
+ int _priority3;
+};
+
+struct VoiceStructEntry {
+ int _voiceNum;
+ int _field1;
+ SoundDriver *_driver;
+
+ VoiceStructEntryType0 _type0;
+ VoiceStructEntryType1 _type1;
+};
+
+class VoiceTypeStruct {
+public:
+ VoiceType _voiceType;
+ int _total;
+ int _numVoices;
+ int _field3;
+
+ Common::Array<VoiceStructEntry> _entries;
+};
+
class SoundManager : public SaveListener {
+private:
+ SoundDriver *instantiateDriver(int driverNum);
+public:
+ bool __sndmgrReady;
+ int _ourSndResVersion, _ourDrvResVersion;
+ Common::List<Sound *> _playList;
+ Common::List<SoundDriver *> _installedDrivers;
+ VoiceTypeStruct *_voiceTypeStructPtrs[SOUND_ARR_SIZE];
+ uint32 _groupsAvail;
+ int _masterVol;
+ int _newVolume;
+ Common::Mutex _serverDisabledMutex;
+ Common::Mutex _serverSuspendedMutex;
+ int _suspendedCount;
+ bool _driversDetected;
+ Common::List<Sound *> _soundList;
+ Common::List<SoundDriverEntry> _availableDrivers;
+ bool _needToRethink;
+ // Misc flags
+ bool _soTimeIndexFlag;
public:
- void dispatch() {}
+ SoundManager();
+ ~SoundManager();
+
+ void dispatch();
virtual void listenerSynchronize(Serializer &s);
virtual void postInit();
+ void syncSounds();
+ void update();
- void proc2() {}
static void saveNotifier(bool postFlag);
void saveNotifierProc(bool postFlag);
static void loadNotifier(bool postFlag);
void loadNotifierProc(bool postFlag);
+
+ void installConfigDrivers();
+ Common::List<SoundDriverEntry> &buildDriverList(bool detectFlag);
+ Common::List<SoundDriverEntry> &getDriverList(bool detectFlag);
+ void dumpDriverList();
+ void installDriver(int driverNum);
+ bool isInstalled(int driverNum) const;
+ void unInstallDriver(int driverNum);
+ void checkResVersion(const byte *soundData);
+ int determineGroup(const byte *soundData);
+ int extractPriority(const byte *soundData);
+ int extractLoop(const byte *soundData);
+ bool isOnPlayList(Sound *sound);
+ void extractTrackInfo(trackInfoStruct *trackInfo, const byte *soundData, int groupNum);
+ void addToSoundList(Sound *sound);
+ void removeFromSoundList(Sound *sound);
+ void addToPlayList(Sound *sound);
+ void removeFromPlayList(Sound *sound);
+ void rethinkVoiceTypes();
+ void updateSoundVol(Sound *sound);
+ void updateSoundPri(Sound *sound);
+ void updateSoundLoop(Sound *sound);
+ void setMasterVol(int volume);
+ int getMasterVol() const;
+ void loadSound(int soundNum, bool showErrors);
+ void unloadSound(int soundNum);
+
+ // _sf methods
+ static SoundManager &sfManager();
+ static void _sfTerminate();
+ static int _sfDetermineGroup(const byte *soundData);
+ static void _sfAddToPlayList(Sound *sound);
+ static void _sfRemoveFromPlayList(Sound *sound);
+ static bool _sfIsOnPlayList(Sound *sound);
+ static void _sfRethinkSoundDrivers();
+ static void _sfRethinkVoiceTypes();
+ static void _sfUpdateVolume(Sound *sound);
+ static void _sfDereferenceAll();
+ static void _sfUpdatePriority(Sound *sound);
+ static void _sfUpdateLoop(Sound *sound);
+ static void _sfSetMasterVol(int volume);
+ static void _sfExtractTrackInfo(trackInfoStruct *trackInfo, const byte *soundData, int groupNum);
+ static void _sfExtractGroupMask();
+ static bool _sfInstallDriver(SoundDriver *driver);
+ static void _sfUnInstallDriver(SoundDriver *driver);
+ static void _sfInstallPatchBank(SoundDriver *driver, const byte *bankData);
+ static void _sfDoAddToPlayList(Sound *sound);
+ static bool _sfDoRemoveFromPlayList(Sound *sound);
+ static void _sfDoUpdateVolume(Sound *sound);
+ static void _sfSoundServer();
+ static void _sfProcessFading();
+ static void _sfUpdateVoiceStructs();
+ static void _sfUpdateVoiceStructs2();
+ static void _sfUpdateCallback(void *ref);
+};
+
+class Sound: public EventHandler {
+private:
+ void _prime(int soundResID, bool dontQueue);
+ void _unPrime();
+ void orientAfterRestore();
+public:
+ bool _stoppedAsynchronously;
+ int _soundResID;
+ int _group;
+ int _sndResPriority;
+ int _fixedPriority;
+ int _sndResLoop;
+ int _fixedLoop;
+ int _priority;
+ int _volume;
+ int _loop;
+ int _pausedCount;
+ int _mutedCount;
+ int _hold;
+ int _cueValue;
+ int _fadeDest;
+ int _fadeSteps;
+ int _fadeTicks;
+ int _fadeCounter;
+ bool _stopAfterFadeFlag;
+ uint _timer;
+ int _loopTimer;
+ int _chProgram[SOUND_ARR_SIZE];
+ int _chModulation[SOUND_ARR_SIZE];
+ int _chVolume[SOUND_ARR_SIZE];
+ int _chPan[SOUND_ARR_SIZE];
+ int _chDamper[SOUND_ARR_SIZE];
+ int _chPitchBlend[SOUND_ARR_SIZE];
+ int _chVoiceType[SOUND_ARR_SIZE];
+ int _chNumVoices[SOUND_ARR_SIZE];
+ int _chSubPriority[SOUND_ARR_SIZE];
+ int _chFlags[SOUND_ARR_SIZE];
+ bool _chWork[SOUND_ARR_SIZE];
+ trackInfoStruct _trackInfo;
+ byte *_channelData[SOUND_ARR_SIZE];
+ int _trkChannel[SOUND_ARR_SIZE];
+ int _trkState[SOUND_ARR_SIZE];
+ int _trkLoopState[SOUND_ARR_SIZE];
+ int _trkIndex[SOUND_ARR_SIZE];
+ int _trkLoopIndex[SOUND_ARR_SIZE];
+ int _trkRest[SOUND_ARR_SIZE];
+ int _trkLoopRest[SOUND_ARR_SIZE];
+
+ bool _primed;
+ bool _isEmpty;
+ byte *_remoteReceiver;
+public:
+ Sound();
+ ~Sound();
+
+ void play(int soundResID);
+ void stop();
+ void prime(int soundResID);
+ void unPrime();
+ void go();
+ void halt(void);
+ bool isPlaying();
+ int getSoundNum() const;
+ bool isPrimed() const;
+ bool isPaused() const;
+ bool isMuted() const;
+ void pause(bool flag);
+ void mute(bool flag);
+ void fade(int fadeDest, int fadeSteps, int fadeTicks, bool stopAfterFadeFlag);
+ void setTimeIndex(uint32 timeIndex);
+ uint32 getTimeIndex() const;
+ int getCueValue() const;
+ void setCueValue(int cueValue);
+ void setVol(int volume);
+ int getVol() const;
+ void setPri(int priority);
+ void setLoop(int flag);
+ int getPri() const;
+ int getLoop();
+ void holdAt(int amount);
+ void release();
+ void orientAfterDriverChange();
+
+ // _so methods
+ void _soPrimeSound(bool dontQueue);
+ void _soSetTimeIndex(uint timeIndex);
+ bool _soServiceTracks();
+ void _soPrimeChannelData();
+ void _soRemoteReceive();
+ void _soServiceTrackType0(int trackIndex, const byte *channelData);
+ void _soUpdateDamper(VoiceTypeStruct *voiceType, int channelNum, VoiceType mode, int v0);
+ void _soProc32(VoiceTypeStruct *vtStruct, int channelNum, VoiceType voiceType, int v0, int v1);
+ void _soProc42(VoiceTypeStruct *vtStruct, int channelNum, VoiceType voiceType, int v0);
+ void _soProc38(VoiceTypeStruct *vtStruct, int channelNum, VoiceType voiceType, int cmd, int value);
+ void _soProc40(VoiceTypeStruct *vtStruct, int channelNum, int pitchBlend);
+ void _soDoTrackCommand(int channelNum, int command, int value);
+ bool _soDoUpdateTracks(int command, int value);
+ void _soSetTrackPos(int trackIndex, int trackPos, int cueValue);
+
+ void _soServiceTrackType1(int trackIndex, const byte *channelData);
+ int _soFindSound(VoiceTypeStruct *vtStruct, int channelNum);
+};
+
+class ASound: public EventHandler {
+public:
+ Sound _sound;
+ Action *_action;
+ int _cueValue;
+
+ ASound();
+ ~ASound();
+ virtual void synchronize(Serializer &s);
+ virtual void dispatch();
+
+ void play(int soundNum, Action *action = NULL, int volume = 127);
+ void stop();
+ void prime(int soundNum, Action *action = NULL);
+ void unPrime();
+ void go() { _sound.go(); }
+ void hault(void) { _sound.halt(); }
+ bool isPlaying() { return _sound.isPlaying(); }
+ int getSoundNum() const { return _sound.getSoundNum(); }
+ bool isPaused() const { return _sound.isPaused(); }
+ bool isMuted() const { return _sound.isMuted(); }
+ void pause(bool flag) { _sound.pause(flag); }
+ void mute(bool flag) { _sound.mute(flag); }
+ void fade(int fadeDest, int fadeSteps, int fadeTicks, bool stopAfterFadeFlag, Action *action);
+ void fadeIn() { fade(127, 5, 10, false, NULL); }
+ void fadeOut(Action *action) { fade(0, 5, 10, true, action); }
+ void setTimeIndex(uint32 timeIndex) { _sound.setTimeIndex(timeIndex); }
+ uint32 getTimeIndex() const { return _sound.getTimeIndex(); }
+ void setPri(int v) { _sound.setPri(v); }
+ void setLoop(int total) { _sound.setLoop(total); }
+ int getPri() const { return _sound.getPri(); }
+ int getLoop() { return _sound.getLoop(); }
+ void setVol(int volume) { _sound.setVol(volume); }
+ int getVol() const { return _sound.getVol(); }
+ void holdAt(int v) { _sound.holdAt(v); }
+ void release() { _sound.release(); }
+};
+
+#define ADLIB_CHANNEL_COUNT 9
+
+class AdlibSoundDriver: public SoundDriver, Audio::AudioStream {
+private:
+ GroupData _groupData;
+ Audio::Mixer *_mixer;
+ FM_OPL *_opl;
+ Audio::SoundHandle _soundHandle;
+ int _sampleRate;
+ byte _portContents[256];
+ const byte *_patchData;
+ int _masterVolume;
+
+ bool _channelVoiced[ADLIB_CHANNEL_COUNT];
+ int _channelVolume[ADLIB_CHANNEL_COUNT];
+ int _v4405E[ADLIB_CHANNEL_COUNT];
+ int _v44067[ADLIB_CHANNEL_COUNT];
+ int _v44070[ADLIB_CHANNEL_COUNT];
+ int _v44079[ADLIB_CHANNEL_COUNT];
+ int _v44082[ADLIB_CHANNEL_COUNT + 1];
+ int _pitchBlend[ADLIB_CHANNEL_COUNT];
+ int _v4409E[ADLIB_CHANNEL_COUNT];
+
+
+ void write(byte reg, byte value);
+ void updateChannelVolume(int channel);
+ void setVoice(int channel);
+ void clearVoice(int channel);
+ void updateChannel(int channel);
+ void setFrequency(int channel);
+public:
+ AdlibSoundDriver();
+ virtual ~AdlibSoundDriver();
+
+ virtual bool open();
+ virtual void close();
+ virtual bool reset();
+ virtual const GroupData *getGroupData();
+ virtual void installPatch(const byte *data, int size);
+ virtual int setMasterVolume(int volume);
+ virtual void proc32(int channel, int program, int v0, int v1);
+ virtual void updateVoice(int channel);
+ virtual void proc38(int channel, int cmd, int value);
+ virtual void setPitch(int channel, int pitchBlend);
+ virtual void setUpdateCallback(UpdateCallback upCb, void *ref);
+
+ // AudioStream interface
+ virtual int readBuffer(int16 *buffer, const int numSamples);
+ virtual bool isStereo() const { return false; }
+ virtual bool endOfData() const { return false; }
+ virtual int getRate() const { return _sampleRate; }
+
+ void update(int16 *buf, int len);
};
} // End of namespace tSage
diff --git a/engines/tsage/tsage.cpp b/engines/tsage/tsage.cpp
index 50ce0ce4be..41f3d58897 100644
--- a/engines/tsage/tsage.cpp
+++ b/engines/tsage/tsage.cpp
@@ -81,12 +81,17 @@ void TSageEngine::initialize() {
_globals = new Globals();
_globals->gfxManager().setDefaults();
+
+ // Setup sound settings
+ syncSoundSettings();
}
void TSageEngine::deinitialize() {
delete _globals;
delete _resourceManager;
delete _saver;
+ _resourceManager = NULL;
+ _saver = NULL;
}
Common::Error TSageEngine::run() {
@@ -136,4 +141,10 @@ Common::String TSageEngine::generateSaveName(int slot) {
return Common::String::format("%s.%03d", _targetName.c_str(), slot);
}
+void TSageEngine::syncSoundSettings() {
+ Engine::syncSoundSettings();
+
+ _globals->_soundManager.syncSounds();
+}
+
} // End of namespace tSage
diff --git a/engines/tsage/tsage.h b/engines/tsage/tsage.h
index 5db45f24ab..f004c7f625 100644
--- a/engines/tsage/tsage.h
+++ b/engines/tsage/tsage.h
@@ -51,7 +51,9 @@ enum {
};
enum {
- kRingDebugScripts = 1 << 0
+ kRingDebugScripts = 1 << 0,
+ ktSageSound = 1 << 1,
+ ktSageCore = 1 << 2
};
struct tSageGameDescription;
@@ -83,6 +85,7 @@ public:
virtual bool canSaveGameStateCurrently();
virtual Common::Error loadGameState(int slot);
virtual Common::Error saveGameState(int slot, const Common::String &desc);
+ virtual void syncSoundSettings();
Common::String generateSaveName(int slot);
void initialize();
diff --git a/graphics/fonts/winfont.cpp b/graphics/fonts/winfont.cpp
index 0e87769f2f..8b60f8aa6b 100644
--- a/graphics/fonts/winfont.cpp
+++ b/graphics/fonts/winfont.cpp
@@ -81,7 +81,7 @@ bool WinFont::loadFromFON(const Common::String &fileName, const WinFontDirEntry
return true;
// Then try loading via the PE code
- return loadFromPE(fileName, dirEntry);
+ return loadFromPE(fileName, dirEntry);
}
bool WinFont::loadFromNE(const Common::String &fileName, const WinFontDirEntry &dirEntry) {
@@ -98,7 +98,7 @@ bool WinFont::loadFromNE(const Common::String &fileName, const WinFontDirEntry &
}
uint32 fontId = getFontIndex(*fontDirectory, dirEntry);
-
+
delete fontDirectory;
// Couldn't match the face name
@@ -133,7 +133,7 @@ bool WinFont::loadFromPE(const Common::String &fileName, const WinFontDirEntry &
}
uint32 fontId = getFontIndex(*fontDirectory, dirEntry);
-
+
delete fontDirectory;
// Couldn't match the face name
diff --git a/graphics/fonts/winfont.h b/graphics/fonts/winfont.h
index b6c1be7064..4382d7ed6b 100644
--- a/graphics/fonts/winfont.h
+++ b/graphics/fonts/winfont.h
@@ -88,7 +88,7 @@ private:
uint16 charWidth;
uint32 offset;
byte *bitmap;
- } *_glyphs;
+ } *_glyphs;
};
} // End of namespace Graphics
diff --git a/graphics/jpeg.h b/graphics/jpeg.h
index bda0c08240..27b91e8777 100644
--- a/graphics/jpeg.h
+++ b/graphics/jpeg.h
@@ -72,7 +72,7 @@ private:
// Result image for this component
Surface surface;
};
-
+
Component *_components;
// Scan components
diff --git a/graphics/png.cpp b/graphics/png.cpp
index e6dceab3fa..6ffc53bd92 100644
--- a/graphics/png.cpp
+++ b/graphics/png.cpp
@@ -100,7 +100,7 @@ enum PNGFilters {
kFilterPaeth = 4
};
-PNG::PNG() : _compressedBuffer(0), _compressedBufferSize(0),
+PNG::PNG() : _compressedBuffer(0), _compressedBufferSize(0),
_unfilteredSurface(0), _transparentColorSpecified(false) {
}
@@ -116,59 +116,52 @@ Graphics::Surface *PNG::getSurface(const PixelFormat &format) {
output->create(_unfilteredSurface->w, _unfilteredSurface->h, format);
byte *src = (byte *)_unfilteredSurface->pixels;
byte a = 0xFF;
+ byte bpp = _unfilteredSurface->format.bytesPerPixel;
if (_header.colorType != kIndexed) {
- if (_header.colorType == kTrueColor || _header.colorType == kTrueColorWithAlpha) {
- if (_unfilteredSurface->format.bytesPerPixel != 3 && _unfilteredSurface->format.bytesPerPixel != 4)
+ if (_header.colorType == kTrueColor ||
+ _header.colorType == kTrueColorWithAlpha) {
+ if (bpp != 3 && bpp != 4)
error("Unsupported truecolor PNG format");
- } else if (_header.colorType == kGrayScale || _header.colorType == kGrayScaleWithAlpha) {
- if (_unfilteredSurface->format.bytesPerPixel != 1 && _unfilteredSurface->format.bytesPerPixel != 2)
+ } else if (_header.colorType == kGrayScale ||
+ _header.colorType == kGrayScaleWithAlpha) {
+ if (bpp != 1 && bpp != 2)
error("Unsupported grayscale PNG format");
}
for (uint16 i = 0; i < output->h; i++) {
for (uint16 j = 0; j < output->w; j++) {
- if (format.bytesPerPixel == 2) { // 2bpp
- uint16 *dest = ((uint16 *)output->getBasePtr(j, i));
- if (_unfilteredSurface->format.bytesPerPixel == 1) { // Grayscale
- if (_transparentColorSpecified)
- a = (src[0] == _transparentColor[0]) ? 0 : 0xFF;
- *dest = format.ARGBToColor( a, src[0], src[0], src[0]);
- } else if (_unfilteredSurface->format.bytesPerPixel == 2) { // Grayscale + alpha
- *dest = format.ARGBToColor(src[1], src[0], src[0], src[0]);
- } else if (_unfilteredSurface->format.bytesPerPixel == 3) { // RGB
- if (_transparentColorSpecified) {
- bool isTransparentColor = (src[0] == _transparentColor[0] &&
- src[1] == _transparentColor[1] &&
- src[2] == _transparentColor[2]);
- a = isTransparentColor ? 0 : 0xFF;
- }
- *dest = format.ARGBToColor( a, src[0], src[1], src[2]);
- } else if (_unfilteredSurface->format.bytesPerPixel == 4) { // RGBA
- *dest = format.ARGBToColor(src[3], src[0], src[1], src[2]);
- }
- } else { // 4bpp
- uint32 *dest = ((uint32 *)output->getBasePtr(j, i));
- if (_unfilteredSurface->format.bytesPerPixel == 1) { // Grayscale
- if (_transparentColorSpecified)
- a = (src[0] == _transparentColor[0]) ? 0 : 0xFF;
- *dest = format.ARGBToColor( a, src[0], src[0], src[0]);
- } else if (_unfilteredSurface->format.bytesPerPixel == 2) { // Grayscale + alpha
- *dest = format.ARGBToColor(src[1], src[0], src[0], src[0]);
- } else if (_unfilteredSurface->format.bytesPerPixel == 3) { // RGB
- if (_transparentColorSpecified) {
- bool isTransparentColor = (src[0] == _transparentColor[0] &&
- src[1] == _transparentColor[1] &&
- src[2] == _transparentColor[2]);
- a = isTransparentColor ? 0 : 0xFF;
- }
- *dest = format.ARGBToColor( a, src[0], src[1], src[2]);
- } else if (_unfilteredSurface->format.bytesPerPixel == 4) { // RGBA
- *dest = format.ARGBToColor(src[3], src[0], src[1], src[2]);
+ uint32 result = 0;
+
+ switch (bpp) {
+ case 1: // Grayscale
+ if (_transparentColorSpecified)
+ a = (src[0] == _transparentColor[0]) ? 0 : 0xFF;
+ result = format.ARGBToColor( a, src[0], src[0], src[0]);
+ break;
+ case 2: // Grayscale + alpha
+ result = format.ARGBToColor(src[1], src[0], src[0], src[0]);
+ break;
+ case 3: // RGB
+ if (_transparentColorSpecified) {
+ bool isTransparentColor = (src[0] == _transparentColor[0] &&
+ src[1] == _transparentColor[1] &&
+ src[2] == _transparentColor[2]);
+ a = isTransparentColor ? 0 : 0xFF;
}
+ result = format.ARGBToColor( a, src[0], src[1], src[2]);
+ break;
+ case 4: // RGBA
+ result = format.ARGBToColor(src[3], src[0], src[1], src[2]);
+ break;
}
- src += _unfilteredSurface->format.bytesPerPixel;
+ if (format.bytesPerPixel == 2) // 2bpp
+ *((uint16 *)output->getBasePtr(j, i)) = (uint16)result;
+ else // 4bpp
+ *((uint32 *)output->getBasePtr(j, i)) = result;
+
+ src += bpp;
}
}
} else {
@@ -202,7 +195,7 @@ Graphics::Surface *PNG::getSurface(const PixelFormat &format) {
}
// The surface is a whole scanline wide, skip the rest of it.
if (_header.bitDepth == 4)
- src += output->w / 2;
+ src += output->w / 2 + output->w % 2;
}
}
@@ -236,7 +229,7 @@ bool PNG::read(Common::SeekableReadStream *str) {
case kChunkIDAT:
if (_compressedBufferSize == 0) {
_compressedBufferSize += chunkLength;
- _compressedBuffer = new byte[_compressedBufferSize];
+ _compressedBuffer = (byte *)malloc(_compressedBufferSize);
_stream->read(_compressedBuffer, chunkLength);
} else {
// Expand the buffer
@@ -244,8 +237,8 @@ bool PNG::read(Common::SeekableReadStream *str) {
_compressedBufferSize += chunkLength;
byte *tmp = new byte[prevSize];
memcpy(tmp, _compressedBuffer, prevSize);
- delete[] _compressedBuffer;
- _compressedBuffer = new byte[_compressedBufferSize];
+ free(_compressedBuffer);
+ _compressedBuffer = (byte *)malloc(_compressedBufferSize);
memcpy(_compressedBuffer, tmp, prevSize);
delete[] tmp;
_stream->read(_compressedBuffer + prevSize, chunkLength);
@@ -282,7 +275,7 @@ bool PNG::read(Common::SeekableReadStream *str) {
// Unpack the compressed buffer
Common::MemoryReadStream *compData = new Common::MemoryReadStream(_compressedBuffer, _compressedBufferSize, DisposeAfterUse::YES);
_imageData = Common::wrapCompressedReadStream(compData);
-
+
// Construct the final image
constructImage();
@@ -306,7 +299,7 @@ byte PNG::paethPredictor(int16 a, int16 b, int16 c) {
int16 pa = ABS<int16>(b - c);
int16 pb = ABS<int16>(a - c);
int16 pc = ABS<int16>(a + b - c - c);
-
+
if (pa <= MIN<int16>(pb, pc))
return (byte)a;
else if (pb <= pc)
diff --git a/graphics/sjis.cpp b/graphics/sjis.cpp
index 660abf556c..09e1746df4 100644
--- a/graphics/sjis.cpp
+++ b/graphics/sjis.cpp
@@ -161,7 +161,7 @@ void FontSJISBase::drawChar(void *dst, uint16 ch, int pitch, int bpp, uint32 c1,
outlineExtraWidth = 0;
outlineXOffset = 1;
}
-
+
if (maxH != -1 && maxH < height) {
height = maxH;
outlineExtraHeight = 0;
@@ -191,7 +191,7 @@ void FontSJISBase::drawChar(void *dst, uint16 ch, int pitch, int bpp, uint32 c1,
if (_drawMode == kOutlineMode) {
blitCharacter<uint8>(outline, width + outlineExtraWidth, height + outlineExtraHeight, (uint8 *)dst, pitch, c2);
blitCharacter<uint8>(glyphSource, width - outlineXOffset, height - outlineYOffset, (uint8 *)dst + pitch + 1, pitch, c1);
- } else {
+ } else {
if (_drawMode != kDefaultMode) {
blitCharacter<uint8>(glyphSource, width - outlineXOffset, height, ((uint8*)dst) + 1, pitch, c2);
blitCharacter<uint8>(glyphSource, width, height - outlineYOffset, ((uint8*)dst) + pitch, pitch, c2);
diff --git a/graphics/sjis.h b/graphics/sjis.h
index 21ced62b1d..0c3b057cc4 100644
--- a/graphics/sjis.h
+++ b/graphics/sjis.h
@@ -141,7 +141,7 @@ public:
void toggleFlippedMode(bool enable) { _flippedMode = enable; }
uint getFontHeight() const { return (_drawMode == kOutlineMode) ? 18 : (_drawMode == kDefaultMode ? 16 : 17); }
-
+
uint getMaxFontWidth() const { return (_drawMode == kOutlineMode) ? 18 : (_drawMode == kDefaultMode ? 16 : 17); }
uint getCharWidth(uint16 ch) const;
diff --git a/graphics/surface.cpp b/graphics/surface.cpp
index cee8e61438..0fad25734c 100644
--- a/graphics/surface.cpp
+++ b/graphics/surface.cpp
@@ -127,7 +127,7 @@ void Surface::vLine(int x, int y, int y2, uint32 color) {
*ptr = (uint16)color;
ptr += pitch / 2;
}
-
+
} else if (format.bytesPerPixel == 4) {
uint32 *ptr = (uint32 *)getBasePtr(x, y);
while (y++ <= y2) {
diff --git a/graphics/surface.h b/graphics/surface.h
index 2a0f71955a..018a283aad 100644
--- a/graphics/surface.h
+++ b/graphics/surface.h
@@ -189,7 +189,7 @@ struct Surface {
/**
* A deleter for Surface objects which can be used with SharedPtr.
- *
+ *
* This deleter assures Surface::free is called on deletion.
*/
struct SharedPtrSurfaceDeleter {
diff --git a/gui/ThemeParser.cpp b/gui/ThemeParser.cpp
index 5b1faa4075..db45b5a995 100644
--- a/gui/ThemeParser.cpp
+++ b/gui/ThemeParser.cpp
@@ -352,11 +352,8 @@ bool ThemeParser::parserCallback_drawdata(ParserNode *node) {
}
if (node->values.contains("cache")) {
- if (node->values["cache"] == "true")
- cached = true;
- else if (node->values["cache"] == "false")
- cached = false;
- else return parserError("'Parsed' value must be either true or false.");
+ if (!Common::parseBool(node->values["cache"], cached))
+ return parserError("'Parsed' value must be either true or false.");
}
if (_theme->addDrawData(node->values["id"], cached) == false)
@@ -595,9 +592,7 @@ bool ThemeParser::parserCallback_widget(ParserNode *node) {
bool enabled = true;
if (node->values.contains("enabled")) {
- if (node->values["enabled"] == "false")
- enabled = false;
- else if (node->values["enabled"] != "true")
+ if (!Common::parseBool(node->values["enabled"], enabled))
return parserError("Invalid value for Widget enabling (expecting true/false)");
}
@@ -641,9 +636,7 @@ bool ThemeParser::parserCallback_dialog(ParserNode *node) {
}
if (node->values.contains("enabled")) {
- if (node->values["enabled"] == "false")
- enabled = false;
- else if (node->values["enabled"] != "true")
+ if (!Common::parseBool(node->values["enabled"], enabled))
return parserError("Invalid value for Dialog enabling (expecting true/false)");
}
@@ -677,16 +670,19 @@ bool ThemeParser::parserCallback_import(ParserNode *node) {
bool ThemeParser::parserCallback_layout(ParserNode *node) {
int spacing = -1;
+ bool center = false;
if (node->values.contains("spacing")) {
if (!parseIntegerKey(node->values["spacing"], 1, &spacing))
return false;
}
+ Common::parseBool(node->values["center"], center);
+
if (node->values["type"] == "vertical")
- _theme->getEvaluator()->addLayout(GUI::ThemeLayout::kLayoutVertical, spacing, node->values["center"] == "true");
+ _theme->getEvaluator()->addLayout(GUI::ThemeLayout::kLayoutVertical, spacing, center);
else if (node->values["type"] == "horizontal")
- _theme->getEvaluator()->addLayout(GUI::ThemeLayout::kLayoutHorizontal, spacing, node->values["center"] == "true");
+ _theme->getEvaluator()->addLayout(GUI::ThemeLayout::kLayoutHorizontal, spacing, center);
else
return parserError("Invalid layout type. Only 'horizontal' and 'vertical' layouts allowed.");
diff --git a/gui/credits.h b/gui/credits.h
index ba679c433c..5bc6d56ff4 100644
--- a/gui/credits.h
+++ b/gui/credits.h
@@ -3,13 +3,13 @@ static const char *credits[] = {
"C1""ScummVM Team",
"",
"C1""Project Leaders",
-"C0""Max Horn",
"C0""Eugene Sandulenko",
"",
"C1""Retired Project Leaders",
"C0""James Brown",
"C0""Vincent Hamm",
"C2""ScummVM co-founder, Original Cruise/CinE author",
+"C0""Max Horn",
"C0""Ludvig Strigeus",
"C2""Original ScummVM and SimonVM author",
"",
@@ -23,6 +23,7 @@ static const char *credits[] = {
"C0""Vincent Hamm",
"C2""(retired)",
"C0""Max Horn",
+"C2""(retired)",
"C0""Travis Howell",
"C2""(retired)",
"C0""Pawel Kolodziejski",
@@ -156,6 +157,7 @@ static const char *credits[] = {
"C0""Greg Frieger",
"C0""Paul Gilbert",
"C0""Max Horn",
+"C2""(retired)",
"C0""Filippos Karapetis",
"C0""Martin Kiewitz",
"C0""Walter van Niftrik",
@@ -189,6 +191,7 @@ static const char *credits[] = {
"C0""Eugene Sandulenko",
"C0""Filippos Karapetis",
"C0""Max Horn",
+"C2""(retired)",
"C0""Paul Gilbert",
"C0""Torbj\366rn Andersson",
"",
@@ -204,6 +207,7 @@ static const char *credits[] = {
"C0""Paul Gilbert",
"C0""Sven Hesse",
"C0""Max Horn",
+"C2""(retired)",
"C0""Filippos Karapetis",
"C0""Joost Peters",
"",
@@ -268,6 +272,7 @@ static const char *credits[] = {
"",
"C1""SDL (Win/Linux/OS X/etc.)",
"C0""Max Horn",
+"C2""(retired)",
"C0""Eugene Sandulenko",
"C2""Asm routines, GFX layers",
"",
@@ -285,7 +290,7 @@ static const char *credits[] = {
"C1""Other subsystems",
"C1""Infrastructure",
"C0""Max Horn",
-"C2""Backend & Engine APIs, file API, sound mixer, audiostreams, data structures, etc.",
+"C2""Backend & Engine APIs, file API, sound mixer, audiostreams, data structures, etc. (retired)",
"C0""Eugene Sandulenko",
"C0""Johannes Schickel",
"",
@@ -320,8 +325,6 @@ static const char *credits[] = {
"C2""Wiki maintainer",
"C0""Andre Heider",
"C2""Buildbot maintainer",
-"C0""Max Horn",
-"C2""Forum, IRC channel and Mailing list maintainer",
"C0""Joost Peters",
"C2""Doxygen Project Documentation maintainer",
"C0""Jordi Vilalta Prat",
@@ -390,6 +393,7 @@ static const char *credits[] = {
"",
"C1""Mac OS X",
"C0""Max Horn",
+"C2""(retired)",
"C0""Oystein Eftevaag",
"",
"C1""Mandriva",
diff --git a/gui/options.cpp b/gui/options.cpp
index b0b9fe6c90..3cc2eea6b9 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -343,12 +343,12 @@ void OptionsDialog::close() {
ConfMan.removeKey("render_mode", _domain);
}
}
-
+
// Setup graphics again if needed
if (_domain == Common::ConfigManager::kApplicationDomain && graphicsModeChanged) {
g_system->beginGFXTransaction();
g_system->setGraphicsMode(ConfMan.get("gfx_mode", _domain).c_str());
-
+
if (ConfMan.hasKey("aspect_ratio"))
g_system->setFeatureState(OSystem::kFeatureAspectRatioCorrection, ConfMan.getBool("aspect_ratio", _domain));
if (ConfMan.hasKey("fullscreen"))
@@ -383,7 +383,7 @@ void OptionsDialog::close() {
message += "\n";
message += _("the video mode could not be changed.");
}
-
+
if (gfxError & OSystem::kTransactionAspectRatioFailed) {
ConfMan.setBool("aspect_ratio", g_system->getFeatureState(OSystem::kFeatureAspectRatioCorrection), _domain);
message += "\n";
@@ -808,7 +808,7 @@ void OptionsDialog::addMIDIControls(GuiObject *boss, const Common::String &prefi
_gmDevicePopUp->appendEntry(d->getCompleteName(), d->getHandle());
} else if (d->getMusicDriverId() == "auto") {
_gmDevicePopUp->appendEntry(_("Use first available device"), d->getHandle());
- }
+ }
}
}
@@ -855,7 +855,7 @@ void OptionsDialog::addMT32Controls(GuiObject *boss, const Common::String &prefi
// Make sure the null device is the first one in the list to avoid undesired
// auto detection for users who don't have a saved setting yet.
for (MusicPlugin::List::const_iterator m = p.begin(); m != p.end(); ++m) {
- MusicDevices i = (**m)->getDevices();
+ MusicDevices i = (**m)->getDevices();
for (MusicDevices::iterator d = i.begin(); d != i.end(); ++d) {
if (d->getMusicDriverId() == "null")
_mt32DevicePopUp->appendEntry(_("Don't use Roland MT-32 music"), d->getHandle());
diff --git a/gui/themes/translations.dat b/gui/themes/translations.dat
index 9e5c0465d9..83155bba1b 100644
--- a/gui/themes/translations.dat
+++ b/gui/themes/translations.dat
Binary files differ
diff --git a/po/POTFILES b/po/POTFILES
index 323e50e8e4..3ffb587f01 100644
--- a/po/POTFILES
+++ b/po/POTFILES
@@ -63,7 +63,7 @@ backends/keymapper/remap-dialog.cpp
backends/midi/windows.cpp
backends/platform/ds/arm9/source/dsoptions.cpp
backends/platform/iphone/osys_events.cpp
-backends/graphics/sdl/sdl-graphics.cpp
+backends/graphics/surfacesdl/surfacesdl-graphics.cpp
backends/graphics/opengl/opengl-graphics.cpp
backends/graphics/openglsdl/openglsdl-graphics.cpp
backends/platform/symbian/src/SymbianActions.cpp
diff --git a/po/ca_ES.po b/po/ca_ES.po
index ce4c1db140..d837be093f 100644
--- a/po/ca_ES.po
+++ b/po/ca_ES.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.3.0svn\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2011-06-13 22:20+0100\n"
+"POT-Creation-Date: 2011-06-20 23:09+0100\n"
"PO-Revision-Date: 2010-09-21 23:12+0100\n"
"Last-Translator: Jordi Vilalta Prat <jvprat@jvprat.com>\n"
"Language-Team: Catalan <scummvm-devel@lists.sf.net>\n"
@@ -45,8 +45,8 @@ msgstr "Amunt"
#: gui/browser.cpp:69 gui/chooser.cpp:45 gui/KeysDialog.cpp:43
#: gui/launcher.cpp:312 gui/massadd.cpp:92 gui/options.cpp:1178
#: gui/saveload.cpp:63 gui/saveload.cpp:155 gui/themebrowser.cpp:54
-#: engines/sword1/control.cpp:865 engines/parallaction/saveload.cpp:281
-#: backends/platform/wii/options.cpp:48
+#: engines/engine.cpp:408 engines/sword1/control.cpp:865
+#: engines/parallaction/saveload.cpp:281 backends/platform/wii/options.cpp:48
#: backends/events/default/default-events.cpp:222
#: backends/events/default/default-events.cpp:244
msgid "Cancel"
@@ -85,7 +85,7 @@ msgstr "Mapeja"
#: gui/KeysDialog.cpp:42 gui/launcher.cpp:313 gui/launcher.cpp:936
#: gui/launcher.cpp:940 gui/massadd.cpp:89 gui/options.cpp:1179
-#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1772
+#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1796
#: engines/agos/animation.cpp:545 engines/groovie/script.cpp:417
#: engines/sky/compact.cpp:131 engines/sky/compact.cpp:141
#: engines/sword1/animation.cpp:344 engines/sword1/animation.cpp:354
@@ -607,8 +607,9 @@ msgstr "Mode de pintat:"
msgid "Special dithering modes supported by some games"
msgstr "Modes de dispersiѓ especials suportats per alguns jocs"
-#: gui/options.cpp:726 backends/graphics/sdl/sdl-graphics.cpp:2252
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:456
+#: gui/options.cpp:726
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2252
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:460
msgid "Fullscreen mode"
msgstr "Mode pantalla completa"
@@ -1096,7 +1097,11 @@ msgstr ""
msgid "Engine plugin does not support save states"
msgstr "El motor no suporta el nivell de depuraciѓ '%s'"
-#: common/error.cpp:72
+#: common/error.cpp:71
+msgid "User canceled"
+msgstr ""
+
+#: common/error.cpp:75
#, fuzzy
msgid "Unknown error"
msgstr "Error desconegut"
@@ -1119,34 +1124,19 @@ msgctxt "lowres"
msgid "Hercules Amber"
msgstr "Hercules Рmbar"
-#: engines/advancedDetector.cpp:323
+#: engines/advancedDetector.cpp:296
#, c-format
msgid "The game in '%s' seems to be unknown."
msgstr ""
-#: engines/advancedDetector.cpp:324
+#: engines/advancedDetector.cpp:297
msgid "Please, report the following data to the ScummVM team along with name"
msgstr ""
-#: engines/advancedDetector.cpp:326
+#: engines/advancedDetector.cpp:299
msgid "of the game you tried to add and its version/language/etc.:"
msgstr ""
-#: engines/advancedDetector.cpp:574
-#, c-format
-msgid ""
-"Your game version has been detected using filename matching as a variant of %"
-"s."
-msgstr ""
-
-#: engines/advancedDetector.cpp:577
-msgid "If this is an original and unmodified version, please report any"
-msgstr ""
-
-#: engines/advancedDetector.cpp:579
-msgid "information previously printed by ScummVM to the team."
-msgstr ""
-
#: engines/dialogs.cpp:84
msgid "~R~esume"
msgstr "~C~ontinua"
@@ -1252,6 +1242,17 @@ msgid ""
"See the README file for details."
msgstr ""
+#: engines/engine.cpp:405
+msgid ""
+"WARNING: The game you are about to start is not yet fully supported by "
+"ScummVM. As such, it is likely to be unstable, and any saves you make might "
+"not work in future versions of ScummVM."
+msgstr ""
+
+#: engines/engine.cpp:408
+msgid "Start anyway"
+msgstr ""
+
#: engines/scumm/dialogs.cpp:281
msgid "~P~revious"
msgstr "~A~nterior"
@@ -1804,14 +1805,14 @@ msgstr ""
msgid "Fly to lower right"
msgstr ""
-#: engines/scumm/scumm.cpp:1770
+#: engines/scumm/scumm.cpp:1794
#, c-format
msgid ""
"Native MIDI support requires the Roland Upgrade from LucasArts,\n"
"but %s is missing. Using AdLib instead."
msgstr ""
-#: engines/scumm/scumm.cpp:2256 engines/agos/saveload.cpp:190
+#: engines/scumm/scumm.cpp:2280 engines/agos/saveload.cpp:190
#, c-format
msgid ""
"Failed to save game state to file:\n"
@@ -1822,7 +1823,7 @@ msgstr ""
"\n"
"%s"
-#: engines/scumm/scumm.cpp:2263 engines/agos/saveload.cpp:155
+#: engines/scumm/scumm.cpp:2287 engines/agos/saveload.cpp:155
#, c-format
msgid ""
"Failed to load game state from file:\n"
@@ -1833,7 +1834,7 @@ msgstr ""
"\n"
"%s"
-#: engines/scumm/scumm.cpp:2275 engines/agos/saveload.cpp:198
+#: engines/scumm/scumm.cpp:2299 engines/agos/saveload.cpp:198
#, c-format
msgid ""
"Successfully saved game state in file:\n"
@@ -1844,7 +1845,7 @@ msgstr ""
"\n"
"%s"
-#: engines/scumm/scumm.cpp:2490
+#: engines/scumm/scumm.cpp:2514
msgid ""
"Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To "
"play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' "
@@ -2208,33 +2209,33 @@ msgstr "Mode Touchpad activat."
msgid "Touchpad mode disabled."
msgstr "Mode Touchpad desactivat."
-#: backends/graphics/sdl/sdl-graphics.cpp:45
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:45
msgid "Normal (no scaling)"
msgstr "Normal (sense escalar)"
-#: backends/graphics/sdl/sdl-graphics.cpp:64
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:64
msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr "Normal (no escalat)"
-#: backends/graphics/sdl/sdl-graphics.cpp:2137
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:517
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2137
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:521
#, fuzzy
msgid "Enabled aspect ratio correction"
msgstr "Correcciѓ de la relaciѓ d'aspecte"
-#: backends/graphics/sdl/sdl-graphics.cpp:2143
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:522
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2143
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:526
#, fuzzy
msgid "Disabled aspect ratio correction"
msgstr "Correcciѓ de la relaciѓ d'aspecte"
-#: backends/graphics/sdl/sdl-graphics.cpp:2198
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2198
msgid "Active graphics filter:"
msgstr ""
-#: backends/graphics/sdl/sdl-graphics.cpp:2254
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:461
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2254
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:465
#, fuzzy
msgid "Windowed mode"
msgstr "Mode de pintat:"
@@ -2251,20 +2252,20 @@ msgstr ""
msgid "OpenGL Original"
msgstr ""
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:399
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:403
#, fuzzy
msgid "Current display mode"
msgstr "Mode de vэdeo actual:"
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:412
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:416
msgid "Current scale"
msgstr ""
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:542
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:546
msgid "Active filter mode: Linear"
msgstr ""
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:544
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:548
msgid "Active filter mode: Nearest"
msgstr ""
diff --git a/po/cs_CZ.po b/po/cs_CZ.po
index 6a570b81c2..aad7110daf 100644
--- a/po/cs_CZ.po
+++ b/po/cs_CZ.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.3.0svn\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2011-06-13 22:20+0100\n"
+"POT-Creation-Date: 2011-06-20 23:09+0100\n"
"PO-Revision-Date: 2011-06-14 15:04+0100\n"
"Last-Translator: Zbynьk Schwarz <zbynek.schwarz@gmail.com>\n"
"Language-Team: \n"
@@ -49,8 +49,8 @@ msgstr "Jэt nahoru"
#: gui/browser.cpp:69 gui/chooser.cpp:45 gui/KeysDialog.cpp:43
#: gui/launcher.cpp:312 gui/massadd.cpp:92 gui/options.cpp:1178
#: gui/saveload.cpp:63 gui/saveload.cpp:155 gui/themebrowser.cpp:54
-#: engines/sword1/control.cpp:865 engines/parallaction/saveload.cpp:281
-#: backends/platform/wii/options.cpp:48
+#: engines/engine.cpp:408 engines/sword1/control.cpp:865
+#: engines/parallaction/saveload.cpp:281 backends/platform/wii/options.cpp:48
#: backends/events/default/default-events.cpp:222
#: backends/events/default/default-events.cpp:244
msgid "Cancel"
@@ -89,7 +89,7 @@ msgstr "Mapovat"
#: gui/KeysDialog.cpp:42 gui/launcher.cpp:313 gui/launcher.cpp:936
#: gui/launcher.cpp:940 gui/massadd.cpp:89 gui/options.cpp:1179
-#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1772
+#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1796
#: engines/agos/animation.cpp:545 engines/groovie/script.cpp:417
#: engines/sky/compact.cpp:131 engines/sky/compact.cpp:141
#: engines/sword1/animation.cpp:344 engines/sword1/animation.cpp:354
@@ -605,8 +605,9 @@ msgstr "ReОim vykreslenэ:"
msgid "Special dithering modes supported by some games"
msgstr "Speciсlnэ reОimy chvьnэ podporovanщ nьkter§mi hrami"
-#: gui/options.cpp:726 backends/graphics/sdl/sdl-graphics.cpp:2252
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:456
+#: gui/options.cpp:726
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2252
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:460
msgid "Fullscreen mode"
msgstr "ReОim celщ obrazovky"
@@ -1079,7 +1080,11 @@ msgstr "Nelze nalщzt vhodn§ zсs. modul jсdra"
msgid "Engine plugin does not support save states"
msgstr "Zсs. modul jсdra nepodporuje uloОenщ stavy"
-#: common/error.cpp:72
+#: common/error.cpp:71
+msgid "User canceled"
+msgstr ""
+
+#: common/error.cpp:75
msgid "Unknown error"
msgstr "Neznсmс chyba"
@@ -1101,36 +1106,19 @@ msgctxt "lowres"
msgid "Hercules Amber"
msgstr "Hercules Jantarovс"
-#: engines/advancedDetector.cpp:323
+#: engines/advancedDetector.cpp:296
#, c-format
msgid "The game in '%s' seems to be unknown."
msgstr "Hra v '%s' se zdс b§t neznсmс."
-#: engines/advancedDetector.cpp:324
+#: engines/advancedDetector.cpp:297
msgid "Please, report the following data to the ScummVM team along with name"
msgstr "Prosэm nahlaste nсsledujэcэ data t§mu ScummVM spolu se jmщnem"
-#: engines/advancedDetector.cpp:326
+#: engines/advancedDetector.cpp:299
msgid "of the game you tried to add and its version/language/etc.:"
msgstr "hry, kterou jste se pokusili pјidat a jejэ verzi/jazyk/atd.:"
-#: engines/advancedDetector.cpp:574
-#, c-format
-msgid ""
-"Your game version has been detected using filename matching as a variant of %"
-"s."
-msgstr ""
-"Bylo zjiЙtьno, Оe VaЙe verze hry pouОэvс jmщno souboru shodujэcэ se s "
-"variantou %s."
-
-#: engines/advancedDetector.cpp:577
-msgid "If this is an original and unmodified version, please report any"
-msgstr "Pokud je toto pљvodnэ a nezmьnьnс verze, ohlaste prosэm jakщkoli"
-
-#: engines/advancedDetector.cpp:579
-msgid "information previously printed by ScummVM to the team."
-msgstr "pјedeЙle vypsanщ informace od ScummVM zpсtky t§mu."
-
#: engines/dialogs.cpp:84
msgid "~R~esume"
msgstr "~P~okraшovat"
@@ -1247,6 +1235,17 @@ msgstr ""
"abyste mohli poslouchat hudbu ve hјe.\n"
"Pro podrobnosti si pјeшtьte README."
+#: engines/engine.cpp:405
+msgid ""
+"WARNING: The game you are about to start is not yet fully supported by "
+"ScummVM. As such, it is likely to be unstable, and any saves you make might "
+"not work in future versions of ScummVM."
+msgstr ""
+
+#: engines/engine.cpp:408
+msgid "Start anyway"
+msgstr ""
+
#: engines/scumm/dialogs.cpp:281
msgid "~P~revious"
msgstr "~P~јedchozэ"
@@ -1779,7 +1778,7 @@ msgstr "Letьt doprava"
msgid "Fly to lower right"
msgstr "Letьt doprava dolљ"
-#: engines/scumm/scumm.cpp:1770
+#: engines/scumm/scumm.cpp:1794
#, c-format
msgid ""
"Native MIDI support requires the Roland Upgrade from LucasArts,\n"
@@ -1788,7 +1787,7 @@ msgstr ""
"Pјirozenс podpora MIDI vyОaduje Aktualizaci Roland od LucasArts,\n"
"ale %s chybэ. Mэsto toho je pouОit AdLib."
-#: engines/scumm/scumm.cpp:2256 engines/agos/saveload.cpp:190
+#: engines/scumm/scumm.cpp:2280 engines/agos/saveload.cpp:190
#, c-format
msgid ""
"Failed to save game state to file:\n"
@@ -1799,7 +1798,7 @@ msgstr ""
"\n"
"%s"
-#: engines/scumm/scumm.cpp:2263 engines/agos/saveload.cpp:155
+#: engines/scumm/scumm.cpp:2287 engines/agos/saveload.cpp:155
#, c-format
msgid ""
"Failed to load game state from file:\n"
@@ -1810,7 +1809,7 @@ msgstr ""
"\n"
"%s"
-#: engines/scumm/scumm.cpp:2275 engines/agos/saveload.cpp:198
+#: engines/scumm/scumm.cpp:2299 engines/agos/saveload.cpp:198
#, c-format
msgid ""
"Successfully saved game state in file:\n"
@@ -1821,7 +1820,7 @@ msgstr ""
"\n"
"%s"
-#: engines/scumm/scumm.cpp:2490
+#: engines/scumm/scumm.cpp:2514
msgid ""
"Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To "
"play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' "
@@ -2204,31 +2203,31 @@ msgstr "Touchpad reОim zapnut"
msgid "Touchpad mode disabled."
msgstr "Touchpad reОim vypnut"
-#: backends/graphics/sdl/sdl-graphics.cpp:45
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:45
msgid "Normal (no scaling)"
msgstr "Normсlnэ (bez zmьny velikosti)"
-#: backends/graphics/sdl/sdl-graphics.cpp:64
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:64
msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr "Normсlnэ (bez zmьny velikosti)"
-#: backends/graphics/sdl/sdl-graphics.cpp:2137
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:517
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2137
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:521
msgid "Enabled aspect ratio correction"
msgstr "Povolena korekce pomьru stran"
-#: backends/graphics/sdl/sdl-graphics.cpp:2143
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:522
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2143
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:526
msgid "Disabled aspect ratio correction"
msgstr "Zakсzсna korekce pomьru stran"
-#: backends/graphics/sdl/sdl-graphics.cpp:2198
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2198
msgid "Active graphics filter:"
msgstr "Aktivnэ grafick§ filtr:"
-#: backends/graphics/sdl/sdl-graphics.cpp:2254
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:461
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2254
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:465
msgid "Windowed mode"
msgstr "ReОim do okna"
@@ -2244,19 +2243,19 @@ msgstr "OpenGL Zachovсvajэcэ"
msgid "OpenGL Original"
msgstr "OpenGL Pљvodnэ"
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:399
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:403
msgid "Current display mode"
msgstr "Souшasn§ reОim obrazu"
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:412
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:416
msgid "Current scale"
msgstr "Souшasnс velikost"
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:542
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:546
msgid "Active filter mode: Linear"
msgstr "Aktivnэ reОim filtru: Lineсrnэ"
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:544
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:548
msgid "Active filter mode: Nearest"
msgstr "Aktivnэ reОim filtru: NejbliОЙэ"
@@ -2627,6 +2626,19 @@ msgstr "Minimсlnэ Hlasitost"
msgid "Decreasing Volume"
msgstr "SniОuji Hlasitost"
+#~ msgid ""
+#~ "Your game version has been detected using filename matching as a variant "
+#~ "of %s."
+#~ msgstr ""
+#~ "Bylo zjiЙtьno, Оe VaЙe verze hry pouОэvс jmщno souboru shodujэcэ se s "
+#~ "variantou %s."
+
+#~ msgid "If this is an original and unmodified version, please report any"
+#~ msgstr "Pokud je toto pљvodnэ a nezmьnьnс verze, ohlaste prosэm jakщkoli"
+
+#~ msgid "information previously printed by ScummVM to the team."
+#~ msgstr "pјedeЙle vypsanщ informace od ScummVM zpсtky t§mu."
+
#~ msgid "Discovered %d new games."
#~ msgstr "Objeveno %d nov§ch her."
diff --git a/po/da_DA.po b/po/da_DA.po
index 1d9acf76f5..9bb43f7784 100644
--- a/po/da_DA.po
+++ b/po/da_DA.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.3.0svn\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2011-06-13 22:20+0100\n"
+"POT-Creation-Date: 2011-06-20 23:09+0100\n"
"PO-Revision-Date: 2011-01-08 22:53+0100\n"
"Last-Translator: Steffen Nyeland <steffen@nyeland.dk>\n"
"Language-Team: Steffen Nyeland <steffen@nyeland.dk>\n"
@@ -45,8 +45,8 @@ msgstr "Gх op"
#: gui/browser.cpp:69 gui/chooser.cpp:45 gui/KeysDialog.cpp:43
#: gui/launcher.cpp:312 gui/massadd.cpp:92 gui/options.cpp:1178
#: gui/saveload.cpp:63 gui/saveload.cpp:155 gui/themebrowser.cpp:54
-#: engines/sword1/control.cpp:865 engines/parallaction/saveload.cpp:281
-#: backends/platform/wii/options.cpp:48
+#: engines/engine.cpp:408 engines/sword1/control.cpp:865
+#: engines/parallaction/saveload.cpp:281 backends/platform/wii/options.cpp:48
#: backends/events/default/default-events.cpp:222
#: backends/events/default/default-events.cpp:244
msgid "Cancel"
@@ -85,7 +85,7 @@ msgstr "Kortlцg"
#: gui/KeysDialog.cpp:42 gui/launcher.cpp:313 gui/launcher.cpp:936
#: gui/launcher.cpp:940 gui/massadd.cpp:89 gui/options.cpp:1179
-#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1772
+#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1796
#: engines/agos/animation.cpp:545 engines/groovie/script.cpp:417
#: engines/sky/compact.cpp:131 engines/sky/compact.cpp:141
#: engines/sword1/animation.cpp:344 engines/sword1/animation.cpp:354
@@ -604,8 +604,9 @@ msgstr "Rendere tilstand:"
msgid "Special dithering modes supported by some games"
msgstr "Speciel farvereduceringstilstand understјttet a nogle spil"
-#: gui/options.cpp:726 backends/graphics/sdl/sdl-graphics.cpp:2252
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:456
+#: gui/options.cpp:726
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2252
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:460
msgid "Fullscreen mode"
msgstr "Fuldskцrms tilstand"
@@ -1083,7 +1084,11 @@ msgstr ""
msgid "Engine plugin does not support save states"
msgstr "Motor understјtter ikke fejlfindingsniveau '%s'"
-#: common/error.cpp:72
+#: common/error.cpp:71
+msgid "User canceled"
+msgstr ""
+
+#: common/error.cpp:75
#, fuzzy
msgid "Unknown error"
msgstr "Ukendt fejl"
@@ -1106,34 +1111,19 @@ msgctxt "lowres"
msgid "Hercules Amber"
msgstr "Hercules brun"
-#: engines/advancedDetector.cpp:323
+#: engines/advancedDetector.cpp:296
#, c-format
msgid "The game in '%s' seems to be unknown."
msgstr ""
-#: engines/advancedDetector.cpp:324
+#: engines/advancedDetector.cpp:297
msgid "Please, report the following data to the ScummVM team along with name"
msgstr ""
-#: engines/advancedDetector.cpp:326
+#: engines/advancedDetector.cpp:299
msgid "of the game you tried to add and its version/language/etc.:"
msgstr ""
-#: engines/advancedDetector.cpp:574
-#, c-format
-msgid ""
-"Your game version has been detected using filename matching as a variant of %"
-"s."
-msgstr ""
-
-#: engines/advancedDetector.cpp:577
-msgid "If this is an original and unmodified version, please report any"
-msgstr ""
-
-#: engines/advancedDetector.cpp:579
-msgid "information previously printed by ScummVM to the team."
-msgstr ""
-
#: engines/dialogs.cpp:84
msgid "~R~esume"
msgstr "Gen~o~ptag"
@@ -1239,6 +1229,17 @@ msgid ""
"See the README file for details."
msgstr ""
+#: engines/engine.cpp:405
+msgid ""
+"WARNING: The game you are about to start is not yet fully supported by "
+"ScummVM. As such, it is likely to be unstable, and any saves you make might "
+"not work in future versions of ScummVM."
+msgstr ""
+
+#: engines/engine.cpp:408
+msgid "Start anyway"
+msgstr ""
+
#: engines/scumm/dialogs.cpp:281
msgid "~P~revious"
msgstr "Fo~r~rige"
@@ -1772,14 +1773,14 @@ msgstr "Flyv til hјjre"
msgid "Fly to lower right"
msgstr "Flyv nederst til hјjre"
-#: engines/scumm/scumm.cpp:1770
+#: engines/scumm/scumm.cpp:1794
#, c-format
msgid ""
"Native MIDI support requires the Roland Upgrade from LucasArts,\n"
"but %s is missing. Using AdLib instead."
msgstr ""
-#: engines/scumm/scumm.cpp:2256 engines/agos/saveload.cpp:190
+#: engines/scumm/scumm.cpp:2280 engines/agos/saveload.cpp:190
#, c-format
msgid ""
"Failed to save game state to file:\n"
@@ -1790,7 +1791,7 @@ msgstr ""
"\n"
"%s"
-#: engines/scumm/scumm.cpp:2263 engines/agos/saveload.cpp:155
+#: engines/scumm/scumm.cpp:2287 engines/agos/saveload.cpp:155
#, c-format
msgid ""
"Failed to load game state from file:\n"
@@ -1801,7 +1802,7 @@ msgstr ""
"\n"
"%s"
-#: engines/scumm/scumm.cpp:2275 engines/agos/saveload.cpp:198
+#: engines/scumm/scumm.cpp:2299 engines/agos/saveload.cpp:198
#, c-format
msgid ""
"Successfully saved game state in file:\n"
@@ -1812,7 +1813,7 @@ msgstr ""
"\n"
"%s"
-#: engines/scumm/scumm.cpp:2490
+#: engines/scumm/scumm.cpp:2514
msgid ""
"Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To "
"play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' "
@@ -2176,34 +2177,34 @@ msgstr "Pegeplade tilstand aktiveret."
msgid "Touchpad mode disabled."
msgstr "Pegeplade tilstand deaktiveret."
-#: backends/graphics/sdl/sdl-graphics.cpp:45
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:45
msgid "Normal (no scaling)"
msgstr "Normal (ingen skalering)"
-#: backends/graphics/sdl/sdl-graphics.cpp:64
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:64
msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr "Normal (ingen skalering)"
-#: backends/graphics/sdl/sdl-graphics.cpp:2137
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:517
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2137
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:521
#, fuzzy
msgid "Enabled aspect ratio correction"
msgstr "Skift billedformat korrektion"
-#: backends/graphics/sdl/sdl-graphics.cpp:2143
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:522
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2143
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:526
#, fuzzy
msgid "Disabled aspect ratio correction"
msgstr "Skift billedformat korrektion"
-#: backends/graphics/sdl/sdl-graphics.cpp:2198
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2198
#, fuzzy
msgid "Active graphics filter:"
msgstr "Skift mellem grafik filtre"
-#: backends/graphics/sdl/sdl-graphics.cpp:2254
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:461
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2254
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:465
#, fuzzy
msgid "Windowed mode"
msgstr "Rendere tilstand:"
@@ -2220,20 +2221,20 @@ msgstr "OpenGL Bevar"
msgid "OpenGL Original"
msgstr "OpenGL Original"
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:399
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:403
#, fuzzy
msgid "Current display mode"
msgstr "Aktuel videotilstand:"
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:412
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:416
msgid "Current scale"
msgstr ""
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:542
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:546
msgid "Active filter mode: Linear"
msgstr ""
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:544
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:548
msgid "Active filter mode: Nearest"
msgstr ""
diff --git a/po/de_DE.po b/po/de_DE.po
index 154c529984..d823212316 100644
--- a/po/de_DE.po
+++ b/po/de_DE.po
@@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.3.0svn\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2011-06-13 22:20+0100\n"
-"PO-Revision-Date: 2011-04-24 12:35+0100\n"
+"POT-Creation-Date: 2011-06-20 23:09+0100\n"
+"PO-Revision-Date: 2011-06-20 09:45+0100\n"
"Last-Translator: Simon Sawatzki <SimSaw@gmx.de>\n"
"Language-Team: Lothar Serra Mari <Lothar@Windowsbase.de> & Simon Sawatzki "
"<SimSaw@gmx.de>\n"
@@ -47,8 +47,8 @@ msgstr "Pfad hoch"
#: gui/browser.cpp:69 gui/chooser.cpp:45 gui/KeysDialog.cpp:43
#: gui/launcher.cpp:312 gui/massadd.cpp:92 gui/options.cpp:1178
#: gui/saveload.cpp:63 gui/saveload.cpp:155 gui/themebrowser.cpp:54
-#: engines/sword1/control.cpp:865 engines/parallaction/saveload.cpp:281
-#: backends/platform/wii/options.cpp:48
+#: engines/engine.cpp:408 engines/sword1/control.cpp:865
+#: engines/parallaction/saveload.cpp:281 backends/platform/wii/options.cpp:48
#: backends/events/default/default-events.cpp:222
#: backends/events/default/default-events.cpp:244
msgid "Cancel"
@@ -87,7 +87,7 @@ msgstr "Zuweisen"
#: gui/KeysDialog.cpp:42 gui/launcher.cpp:313 gui/launcher.cpp:936
#: gui/launcher.cpp:940 gui/massadd.cpp:89 gui/options.cpp:1179
-#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1772
+#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1796
#: engines/agos/animation.cpp:545 engines/groovie/script.cpp:417
#: engines/sky/compact.cpp:131 engines/sky/compact.cpp:141
#: engines/sword1/animation.cpp:344 engines/sword1/animation.cpp:354
@@ -522,7 +522,7 @@ msgstr "Suchlauf abgeschlossen!"
#: gui/massadd.cpp:246
#, c-format
msgid "Discovered %d new games, ignored %d previously added games."
-msgstr ""
+msgstr "%d neue Spiele gefunden, %d bereits hinzugefќgte Spiele ignoriert."
#: gui/massadd.cpp:250
#, c-format
@@ -530,9 +530,9 @@ msgid "Scanned %d directories ..."
msgstr "%d Ordner durchsucht..."
#: gui/massadd.cpp:253
-#, fuzzy, c-format
+#, c-format
msgid "Discovered %d new games, ignored %d previously added games ..."
-msgstr "%d neue Spiele gefunden..."
+msgstr "%d neue Spiele gefunden, %d bereits hinzugefќgte Spiele ignoriert..."
#: gui/options.cpp:72
msgid "Never"
@@ -582,19 +582,20 @@ msgstr "-"
#: gui/options.cpp:372
msgid "Failed to apply some of the graphic options changes:"
-msgstr ""
+msgstr "Fehler bei einigen Фnderungen in Grafikoptionen:"
#: gui/options.cpp:384
msgid "the video mode could not be changed."
-msgstr ""
+msgstr "Grafikmodus konnte nicht geфndert werden."
#: gui/options.cpp:390
msgid "the fullscreen setting could not be changed"
-msgstr ""
+msgstr "Vollbildeinstellung konnte nicht geфndert werden."
#: gui/options.cpp:396
msgid "the aspect ratio setting could not be changed"
msgstr ""
+"Einstellung fќr Seitenverhфltniskorrektur konnte nicht geфndert werden."
#: gui/options.cpp:705
msgid "Graphics mode:"
@@ -609,8 +610,9 @@ msgid "Special dithering modes supported by some games"
msgstr ""
"Spezielle Farbmischungsmethoden werden von manchen Spielen unterstќtzt."
-#: gui/options.cpp:726 backends/graphics/sdl/sdl-graphics.cpp:2252
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:456
+#: gui/options.cpp:726
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2252
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:460
msgid "Fullscreen mode"
msgstr "Vollbildmodus"
@@ -908,9 +910,8 @@ msgid "Language of ScummVM GUI"
msgstr "Sprache der ScummVM-Oberflфche"
#: gui/options.cpp:1295
-#, fuzzy
msgid "You have to restart ScummVM before your changes will take effect."
-msgstr "Sie mќssen ScummVM neu starten, um die Einstellungen zu ќbernehmen."
+msgstr "Sie mќssen ScummVM neu starten, damit die Фnderungen wirksam werden."
#: gui/options.cpp:1308
msgid "Select directory for savegames"
@@ -1094,7 +1095,11 @@ msgstr "Konnte kein passendes Engine-Plugin finden."
msgid "Engine plugin does not support save states"
msgstr "Engine-Plugin unterstќtzt keine Speicherstфnde."
-#: common/error.cpp:72
+#: common/error.cpp:71
+msgid "User canceled"
+msgstr ""
+
+#: common/error.cpp:75
msgid "Unknown error"
msgstr "Unbekannter Fehler"
@@ -1116,33 +1121,22 @@ msgctxt "lowres"
msgid "Hercules Amber"
msgstr "Hercules-Gelb"
-#: engines/advancedDetector.cpp:323
+#: engines/advancedDetector.cpp:296
#, c-format
msgid "The game in '%s' seems to be unknown."
-msgstr ""
+msgstr "Das Spiel im Verzeichnis \"%s\" scheint nicht bekannt zu sein."
-#: engines/advancedDetector.cpp:324
+#: engines/advancedDetector.cpp:297
msgid "Please, report the following data to the ScummVM team along with name"
msgstr ""
+"Bitte berichten Sie die folgenden Daten auf Englisch an das ScummVM-Team "
+"sowie"
-#: engines/advancedDetector.cpp:326
+#: engines/advancedDetector.cpp:299
msgid "of the game you tried to add and its version/language/etc.:"
msgstr ""
-
-#: engines/advancedDetector.cpp:574
-#, c-format
-msgid ""
-"Your game version has been detected using filename matching as a variant of %"
-"s."
-msgstr ""
-
-#: engines/advancedDetector.cpp:577
-msgid "If this is an original and unmodified version, please report any"
-msgstr ""
-
-#: engines/advancedDetector.cpp:579
-msgid "information previously printed by ScummVM to the team."
-msgstr ""
+"den Namen des Spiels, das Sie hinzufќgen wollten, als auch die Version/"
+"Sprache/usw.:"
#: engines/dialogs.cpp:84
msgid "~R~esume"
@@ -1198,6 +1192,9 @@ msgid ""
"the README for basic information, and for instructions on how to obtain "
"further assistance."
msgstr ""
+"Leider bietet diese Engine keine Spielhilfe. Bitte lesen Sie die LIESMICH-"
+"Datei fќr grundlegende Informationen und Anweisungen dazu, wie man an "
+"weitere Hilfe gelangt."
#: engines/dialogs.cpp:312 engines/mohawk/dialogs.cpp:100
#: engines/mohawk/dialogs.cpp:152
@@ -1215,21 +1212,19 @@ msgstr "~T~asten"
#: engines/engine.cpp:220
msgid "Could not initialize color format."
-msgstr ""
+msgstr "Konnte Farbenformat nicht initialisieren."
#: engines/engine.cpp:228
-#, fuzzy
msgid "Could not switch to video mode: '"
-msgstr "Aktueller Videomodus:"
+msgstr "Konnte nicht zu Grafikmodus wechseln: '"
#: engines/engine.cpp:237
-#, fuzzy
msgid "Could not apply aspect ratio setting."
-msgstr "Seitenverhфltnis anpassen: an/aus"
+msgstr "Konnte Einstellung fќr Seitenverhфltniskorrektur nicht anwenden."
#: engines/engine.cpp:242
msgid "Could not apply fullscreen setting."
-msgstr ""
+msgstr "Konnte Einstellung fќr Vollbildmodus nicht anwenden."
#: engines/engine.cpp:342
msgid ""
@@ -1239,6 +1234,13 @@ msgid ""
"the data files to your hard disk instead.\n"
"See the README file for details."
msgstr ""
+"Sie scheinen dieses Spiel direkt von CD zu\n"
+"spielen. Dies kann bekanntermaпen zu Problemen\n"
+"fќhren und es wird deshalb empfohlen, die\n"
+"Dateien des Spiels auf die Festplatte zu\n"
+"kopieren und von dort aus zu spielen.\n"
+"Lesen Sie die LIESMICH-Datei fќr\n"
+"weitere Informationen."
#: engines/engine.cpp:353
msgid ""
@@ -1248,6 +1250,23 @@ msgid ""
"order to listen to the game's music.\n"
"See the README file for details."
msgstr ""
+"Dieses Spiel hat Audio-Titel auf seiner CD.\n"
+"Diese Titel mќssen von der CD mittels eines\n"
+"geeigneten Extrahierungsprogramms fќr\n"
+"Audio-CDs beschafft werden, um diese im\n"
+"Spiel hіren zu kіnnen. Lesen Sie die\n"
+"LIESMICH-Datei fќr weitere Informationen."
+
+#: engines/engine.cpp:405
+msgid ""
+"WARNING: The game you are about to start is not yet fully supported by "
+"ScummVM. As such, it is likely to be unstable, and any saves you make might "
+"not work in future versions of ScummVM."
+msgstr ""
+
+#: engines/engine.cpp:408
+msgid "Start anyway"
+msgstr ""
#: engines/scumm/dialogs.cpp:281
msgid "~P~revious"
@@ -1401,7 +1420,6 @@ msgid " since they may cause crashes"
msgstr " da dies Abstќrze oder fehlerhaftes"
#: engines/scumm/help.cpp:110
-#, fuzzy
msgid " or incorrect game behavior."
msgstr " Spielverhalten verursachen kann."
@@ -1782,14 +1800,16 @@ msgstr "Nach rechts fliegen"
msgid "Fly to lower right"
msgstr "Nach unten rechts fliegen"
-#: engines/scumm/scumm.cpp:1770
+#: engines/scumm/scumm.cpp:1794
#, c-format
msgid ""
"Native MIDI support requires the Roland Upgrade from LucasArts,\n"
"but %s is missing. Using AdLib instead."
msgstr ""
+"Systemeigene MIDI-мnterstќtzung erfordert das Roland-Upgrade von LucasArts,\n"
+"aber %s fehlt. Stattdessen wird AdLib verwendet."
-#: engines/scumm/scumm.cpp:2256 engines/agos/saveload.cpp:190
+#: engines/scumm/scumm.cpp:2280 engines/agos/saveload.cpp:190
#, c-format
msgid ""
"Failed to save game state to file:\n"
@@ -1800,7 +1820,7 @@ msgstr ""
"\n"
"%s"
-#: engines/scumm/scumm.cpp:2263 engines/agos/saveload.cpp:155
+#: engines/scumm/scumm.cpp:2287 engines/agos/saveload.cpp:155
#, c-format
msgid ""
"Failed to load game state from file:\n"
@@ -1811,7 +1831,7 @@ msgstr ""
"\n"
"%s"
-#: engines/scumm/scumm.cpp:2275 engines/agos/saveload.cpp:198
+#: engines/scumm/scumm.cpp:2299 engines/agos/saveload.cpp:198
#, c-format
msgid ""
"Successfully saved game state in file:\n"
@@ -1822,7 +1842,7 @@ msgstr ""
"\n"
"%s"
-#: engines/scumm/scumm.cpp:2490
+#: engines/scumm/scumm.cpp:2514
msgid ""
"Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To "
"play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' "
@@ -1864,40 +1884,24 @@ msgstr "Laden"
#: engines/agos/animation.cpp:544
#, c-format
msgid "Cutscene file '%s' not found!"
-msgstr ""
+msgstr "Zwischensequenz \"%s\" nicht gefunden!"
#: engines/gob/inter_playtoons.cpp:256 engines/gob/inter_v2.cpp:1283
#: engines/tinsel/saveload.cpp:468
-#, fuzzy
msgid "Failed to load game state from file."
-msgstr ""
-"Konnte Spielstand nicht aus folgender Datei laden:\n"
-"\n"
-"%s"
+msgstr "Konnte Spielstand aus Datei nicht laden."
#: engines/gob/inter_v2.cpp:1353 engines/tinsel/saveload.cpp:546
-#, fuzzy
msgid "Failed to save game state to file."
-msgstr ""
-"Konnte Spielstand nicht in folgender Datei speichern:\n"
-"\n"
-"%s"
+msgstr "Konnte Spielstand nicht in Datei speichern."
#: engines/gob/inter_v5.cpp:107
-#, fuzzy
msgid "Failed to delete file."
-msgstr ""
-"Konnte Spielstand nicht in folgender Datei speichern:\n"
-"\n"
-"%s"
+msgstr "Konnte Datei nicht lіschen."
#: engines/groovie/script.cpp:417
-#, fuzzy
msgid "Failed to save game"
-msgstr ""
-"Konnte Spielstand nicht in folgender Datei speichern:\n"
-"\n"
-"%s"
+msgstr "Konnte Spielstand nicht speichern."
#: engines/kyra/sound_midi.cpp:475
msgid ""
@@ -1907,36 +1911,49 @@ msgid ""
"General MIDI ones. After all it might happen\n"
"that a few tracks will not be correctly played."
msgstr ""
+"Sie scheinen ein General-MIDI-Gerфt zu\n"
+"verwenden, aber das Spiel unterstќtzt nur\n"
+"Roland MT-32 MIDI. Es wird versucht, die\n"
+"Roland-MT-32-Instrumente denen von General MIDI\n"
+"zuzuordnen. Es kann jedoch vorkommen, dass ein\n"
+"paar Musikstќcke nicht richtig abgespielt werden."
#: engines/m4/m4_menus.cpp:138
-#, fuzzy
msgid "Save game failed!"
-msgstr "Speichern:"
+msgstr "Konnte Spielstand nicht speichern!"
#: engines/sky/compact.cpp:130
msgid ""
"Unable to find \"sky.cpt\" file!\n"
"Please download it from www.scummvm.org"
msgstr ""
+"Konnte \"sky.cpt\" nicht finden!\n"
+"Bitte laden Sie die Datei von\n"
+"www.scummvm.org herunter."
#: engines/sky/compact.cpp:141
msgid ""
"The \"sky.cpt\" file has an incorrect size.\n"
"Please (re)download it from www.scummvm.org"
msgstr ""
+"Die Datei \"sky.cpt\" hat eine ungќltige Grіпe.\n"
+"Bitte laden Sie diese Datei (erneut) von\n"
+"www.scummvm.org herunter."
#: engines/sword1/animation.cpp:344 engines/sword2/animation.cpp:379
msgid "DXA cutscenes found but ScummVM has been built without zlib support"
msgstr ""
+"DXA-Zwischensequenzen gefunden, aber ScummVM wurde ohne Zlib-Unterstќtzung "
+"erstellt."
#: engines/sword1/animation.cpp:354 engines/sword2/animation.cpp:389
msgid "MPEG2 cutscenes are no longer supported"
-msgstr ""
+msgstr "MPEG2-Zwischensequenzen werden nicht mehr unterstќtzt."
#: engines/sword1/animation.cpp:359 engines/sword2/animation.cpp:397
#, c-format
msgid "Cutscene '%s' not found"
-msgstr ""
+msgstr "Zwischensequenz \"%s\" gefunden"
#: engines/sword1/control.cpp:863
msgid ""
@@ -1948,6 +1965,13 @@ msgid ""
"Press OK to convert them now, otherwise you will be asked again the next "
"time you start the game.\n"
msgstr ""
+"ScummVM hat erkannt, dass Sie alte Speicherstфnde von Baphomets Fluch 1 "
+"haben, die umgewandelt werden sollten.\n"
+"Das alte Spielstandsformat wird nicht mehr unterstќtzt, also kіnnen Sie "
+"diese Speicherstфnde nicht laden, wenn Sie diese nicht konvertieren.\n"
+"\n"
+"Klicken Sie auf OK, um diese jetzt umzuwandeln, ansonsten werden Sie erneut "
+"gefragt, wenn Sie das nфchste Mal dieses Spiel starten.\n"
#: engines/sword1/control.cpp:1232
#, c-format
@@ -1955,18 +1979,20 @@ msgid ""
"Target new save game already exists!\n"
"Would you like to keep the old save game (%s) or the new one (%s)?\n"
msgstr ""
+"Die fќr den neuen Spielstand vorgesehene Datei existiert bereits!\n"
+"Mіchten Sie den alten Speicherstand (%s) oder den neuen (%s) behalten?\n"
#: engines/sword1/control.cpp:1235
msgid "Keep the old one"
-msgstr ""
+msgstr "Den alten behalten"
#: engines/sword1/control.cpp:1235
msgid "Keep the new one"
-msgstr ""
+msgstr "Den neuen behalten"
#: engines/sword1/logic.cpp:1633
msgid "This is the end of the Broken Sword 1 Demo"
-msgstr ""
+msgstr "Das ist das Ende der Demo von Broken Sword 1 (Baphomets Fluch 1)."
#: engines/parallaction/saveload.cpp:133
#, c-format
@@ -1974,16 +2000,16 @@ msgid ""
"Can't save game in slot %i\n"
"\n"
msgstr ""
+"Kann Spiel nicht speichern auf Speicherplatz %i\n"
+"\n"
#: engines/parallaction/saveload.cpp:211
-#, fuzzy
msgid "Loading game..."
-msgstr "Spiel laden:"
+msgstr "Spiel wird geladen..."
#: engines/parallaction/saveload.cpp:226
-#, fuzzy
msgid "Saving game..."
-msgstr "Speichern:"
+msgstr "Spiel wird gespeichert..."
#: engines/parallaction/saveload.cpp:279
msgid ""
@@ -1994,10 +2020,17 @@ msgid ""
"\n"
"Press OK to convert them now, otherwise you will be asked next time.\n"
msgstr ""
+"ScummVM hat erkannt, dass Sie alte Speicherstфnde von Nippon Safes haben, "
+"die umbenannt werden sollten.\n"
+"Die alten Dateinamen werden nicht mehr unterstќtzt, also kіnnen Sie diese "
+"Speicherstфnde nicht laden, wenn Sie diese nicht konvertieren.\n"
+"\n"
+"Klicken Sie auf OK, um diese jetzt umzuwandeln, ansonsten werden Sie erneut "
+"gefragt, wenn Sie das nфchste Mal dieses Spiel starten.\n"
#: engines/parallaction/saveload.cpp:326
msgid "ScummVM successfully converted all your savefiles."
-msgstr ""
+msgstr "ScummVM hat alle Speicherstфnde erfolgreich umgewandelt."
#: engines/parallaction/saveload.cpp:328
msgid ""
@@ -2006,6 +2039,9 @@ msgid ""
"\n"
"Please report to the team."
msgstr ""
+"ScummVM hat ein paar Warnungen im Konsolenfenster ausgegeben und kann nicht "
+"gewфhrleisten, dass alle Speicherstфnde umgewandelt wurden.\n"
+"\n"
#: audio/fmopl.cpp:49
msgid "MAME OPL emulator"
@@ -2021,6 +2057,9 @@ msgid ""
"The selected audio device '%s' was not found (e.g. might be turned off or "
"disconnected). Attempting to fall back to the next available device..."
msgstr ""
+"Das ausgewфhlte Audiogerфt \"%s\" wurde nicht gefunden (kіnnte "
+"beispielsweise ausgeschaltet oder nicht angeschlossen sein). Es wird "
+"versucht, auf das nфchste verfќgbare Gerфt zurќckzugreifen."
#: audio/mididrv.cpp:216
#, c-format
@@ -2028,6 +2067,9 @@ msgid ""
"The selected audio device '%s' cannot be used. See log file for more "
"information. Attempting to fall back to the next available device..."
msgstr ""
+"Das ausgewфhlte Audiogerфt \"%s\" kann nicht verwendet werden. Schauen Sie "
+"fќr weitere Informationen in der Log-Datei nach. Es wird versucht, auf das "
+"nфchste verfќgbare Gerфt zurќckzugreifen."
#: audio/mididrv.cpp:250
#, c-format
@@ -2035,6 +2077,9 @@ msgid ""
"The preferred audio device '%s' was not found (e.g. might be turned off or "
"disconnected). Attempting to fall back to the next available device..."
msgstr ""
+"Das bevorzugte Audiogerфt \"%s\" wurde nicht gefunden (kіnnte beispielsweise "
+"ausgeschaltet oder nicht angeschlossen sein). Es wird versucht, auf das "
+"nфchste verfќgbare Gerфt zurќckzugreifen."
#: audio/mididrv.cpp:265
#, c-format
@@ -2042,6 +2087,9 @@ msgid ""
"The preferred audio device '%s' cannot be used. See log file for more "
"information. Attempting to fall back to the next available device..."
msgstr ""
+"Das bevorzugte Audiogerфt \"%s\" kann nicht verwendet werden. Schauen Sie "
+"fќr weitere Informationen in der Log-Datei nach. Es wird versucht, auf das "
+"nфchste verfќgbare Gerфt zurќckzugreifen."
#: audio/null.h:43
msgid "No music"
@@ -2064,9 +2112,8 @@ msgid "C64 Audio Emulator"
msgstr "C64-Audio-Emulator"
#: audio/softsynth/mt32.cpp:329
-#, fuzzy
msgid "Initializing MT-32 Emulator"
-msgstr "MT-32-Emulator wird gestartet..."
+msgstr "MT-32-Emulator wird gestartet"
#: audio/softsynth/mt32.cpp:543
msgid "MT-32 Emulator"
@@ -2173,14 +2220,12 @@ msgid "Disable power off"
msgstr "Stromsparmodus abschalten"
#: backends/platform/iphone/osys_events.cpp:338
-#, fuzzy
msgid "Mouse-click-and-drag mode enabled."
-msgstr "Touchpad-Modus aktiviert."
+msgstr "Maus-klick-und-zieh-Modus aktiviert."
#: backends/platform/iphone/osys_events.cpp:340
-#, fuzzy
msgid "Mouse-click-and-drag mode disabled."
-msgstr "Touchpad-Modus ausgeschaltet."
+msgstr "Maus-klick-und-zieh-Modus ausgeschaltet."
#: backends/platform/iphone/osys_events.cpp:351
msgid "Touchpad mode enabled."
@@ -2190,37 +2235,33 @@ msgstr "Touchpad-Modus aktiviert."
msgid "Touchpad mode disabled."
msgstr "Touchpad-Modus ausgeschaltet."
-#: backends/graphics/sdl/sdl-graphics.cpp:45
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:45
msgid "Normal (no scaling)"
msgstr "Normal (keine Skalierung)"
-#: backends/graphics/sdl/sdl-graphics.cpp:64
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:64
msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr "Normal ohn.Skalieren"
-#: backends/graphics/sdl/sdl-graphics.cpp:2137
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:517
-#, fuzzy
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2137
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:521
msgid "Enabled aspect ratio correction"
-msgstr "Seitenverhфltnis anpassen: an/aus"
+msgstr "Seitenverhфltniskorrektur an"
-#: backends/graphics/sdl/sdl-graphics.cpp:2143
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:522
-#, fuzzy
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2143
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:526
msgid "Disabled aspect ratio correction"
-msgstr "Seitenverhфltnis anpassen: an/aus"
+msgstr "Seitenverhфltniskorrektur aus"
-#: backends/graphics/sdl/sdl-graphics.cpp:2198
-#, fuzzy
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2198
msgid "Active graphics filter:"
-msgstr "Zwischen Grafikfiltern wechseln"
+msgstr "Aktiver Grafikfilter:"
-#: backends/graphics/sdl/sdl-graphics.cpp:2254
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:461
-#, fuzzy
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2254
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:465
msgid "Windowed mode"
-msgstr "Render-Modus:"
+msgstr "Fenstermodus"
#: backends/graphics/opengl/opengl-graphics.cpp:139
msgid "OpenGL Normal"
@@ -2234,22 +2275,21 @@ msgstr ""
msgid "OpenGL Original"
msgstr ""
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:399
-#, fuzzy
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:403
msgid "Current display mode"
-msgstr "Aktueller Videomodus:"
+msgstr "Aktueller Grafikmodus"
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:412
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:416
msgid "Current scale"
-msgstr ""
+msgstr "Aktueller Vergrіпerungsfaktor"
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:542
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:546
msgid "Active filter mode: Linear"
-msgstr ""
+msgstr "Aktiver Filtermodus: linear"
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:544
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:548
msgid "Active filter mode: Nearest"
-msgstr ""
+msgstr "Aktiver Filtermodus: nфchste Nachbarn"
#: backends/platform/symbian/src/SymbianActions.cpp:38
#: backends/platform/wince/CEActionsSmartphone.cpp:39
@@ -2331,7 +2371,7 @@ msgstr "Video"
#: backends/platform/wii/options.cpp:54
msgid "Current video mode:"
-msgstr "Aktueller Videomodus:"
+msgstr "Aktueller Grafikmodus:"
#: backends/platform/wii/options.cpp:56
msgid "Double-strike"
@@ -2442,17 +2482,15 @@ msgid "Network down"
msgstr "Netzwerk ist aus."
#: backends/platform/wii/options.cpp:178
-#, fuzzy
msgid "Initializing network"
-msgstr "Netzwerk wird gestartet..."
+msgstr "Netzwerk wird gestartet"
#: backends/platform/wii/options.cpp:182
-#, fuzzy
msgid "Timeout while initializing network"
msgstr "Zeitќberschreitung beim Starten des Netzwerks"
#: backends/platform/wii/options.cpp:186
-#, fuzzy, c-format
+#, c-format
msgid "Network not initialized (%d)"
msgstr "Netzwerk nicht gestartet (%d)"
@@ -2575,58 +2613,66 @@ msgstr ""
"zuzuweisen, um das ganze Inventar sehen zu kіnnen."
#: backends/events/default/default-events.cpp:222
-#, fuzzy
msgid "Do you really want to return to the Launcher?"
-msgstr "Diesen Spielstand wirklich lіschen?"
+msgstr "Mіchten Sie wirklich zur Spieleliste zurќckkehren?"
#: backends/events/default/default-events.cpp:222
-#, fuzzy
msgid "Launcher"
-msgstr "Schlage"
+msgstr "Spieleliste"
#: backends/events/default/default-events.cpp:244
-#, fuzzy
msgid "Do you really want to quit?"
-msgstr "Mіchten Sie beenden?"
+msgstr "Mіchten Sie wirklich beenden?"
#: backends/events/gph/gph-events.cpp:366
#: backends/events/gph/gph-events.cpp:409
#: backends/events/openpandora/op-events.cpp:141
msgid "Touchscreen 'Tap Mode' - Left Click"
-msgstr ""
+msgstr "Berќhrungsbildschirm-Tipp-Modus - Linksklick"
#: backends/events/gph/gph-events.cpp:368
#: backends/events/gph/gph-events.cpp:411
#: backends/events/openpandora/op-events.cpp:143
msgid "Touchscreen 'Tap Mode' - Right Click"
-msgstr ""
+msgstr "Berќhrungsbildschirm-Tipp-Modus - Rechtsklick"
#: backends/events/gph/gph-events.cpp:370
#: backends/events/gph/gph-events.cpp:413
#: backends/events/openpandora/op-events.cpp:145
msgid "Touchscreen 'Tap Mode' - Hover (No Click)"
-msgstr ""
+msgstr "Berќhrungsbildschirm-Tipp-Modus - schweben (kein Klick)"
#: backends/events/gph/gph-events.cpp:390
-#, fuzzy
msgid "Maximum Volume"
-msgstr "Lautstфrke"
+msgstr "Hіchste Lautstфrke"
#: backends/events/gph/gph-events.cpp:392
msgid "Increasing Volume"
-msgstr ""
+msgstr "Lautstфrke hіher"
#: backends/events/gph/gph-events.cpp:398
-#, fuzzy
msgid "Minimal Volume"
-msgstr "Lautstфrke"
+msgstr "Niedrigste Lautstфrke"
#: backends/events/gph/gph-events.cpp:400
msgid "Decreasing Volume"
-msgstr ""
-
-#~ msgid "Discovered %d new games."
-#~ msgstr "%d neue Spiele gefunden."
+msgstr "Lautstфrke niedriger"
+
+#~ msgid ""
+#~ "Your game version has been detected using filename matching as a variant "
+#~ "of %s."
+#~ msgstr ""
+#~ "Ihre Spielversion wurde durch Dateinamen-мbereinstimmung als Variante von "
+#~ "%s erkannt."
+
+#~ msgid "If this is an original and unmodified version, please report any"
+#~ msgstr ""
+#~ "Sollte es sich hierbei um eine unmodifizierte Originalversion handeln,"
+
+#~ msgid "information previously printed by ScummVM to the team."
+#~ msgstr ""
+#~ "so teilen Sie bitte dem Team die von ScummVM zuvor ausgegebenen Daten auf "
+#~ "Englisch mit."
#~ msgid "Command line argument not processed"
#~ msgstr "Argument in Kommandozeile nicht verarbeitet"
diff --git a/po/es_ES.po b/po/es_ES.po
index 0f76d38917..730b8d48b0 100644
--- a/po/es_ES.po
+++ b/po/es_ES.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.3.0svn\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2011-06-13 22:20+0100\n"
+"POT-Creation-Date: 2011-06-20 23:09+0100\n"
"PO-Revision-Date: 2011-05-08 13:31+0100\n"
"Last-Translator: Tomсs Maidagan\n"
"Language-Team: \n"
@@ -45,8 +45,8 @@ msgstr "Arriba"
#: gui/browser.cpp:69 gui/chooser.cpp:45 gui/KeysDialog.cpp:43
#: gui/launcher.cpp:312 gui/massadd.cpp:92 gui/options.cpp:1178
#: gui/saveload.cpp:63 gui/saveload.cpp:155 gui/themebrowser.cpp:54
-#: engines/sword1/control.cpp:865 engines/parallaction/saveload.cpp:281
-#: backends/platform/wii/options.cpp:48
+#: engines/engine.cpp:408 engines/sword1/control.cpp:865
+#: engines/parallaction/saveload.cpp:281 backends/platform/wii/options.cpp:48
#: backends/events/default/default-events.cpp:222
#: backends/events/default/default-events.cpp:244
msgid "Cancel"
@@ -85,7 +85,7 @@ msgstr "Asignar"
#: gui/KeysDialog.cpp:42 gui/launcher.cpp:313 gui/launcher.cpp:936
#: gui/launcher.cpp:940 gui/massadd.cpp:89 gui/options.cpp:1179
-#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1772
+#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1796
#: engines/agos/animation.cpp:545 engines/groovie/script.cpp:417
#: engines/sky/compact.cpp:131 engines/sky/compact.cpp:141
#: engines/sword1/animation.cpp:344 engines/sword1/animation.cpp:354
@@ -604,8 +604,9 @@ msgstr "Renderizado:"
msgid "Special dithering modes supported by some games"
msgstr "Modos especiales de expansiѓn soportados por algunos juegos"
-#: gui/options.cpp:726 backends/graphics/sdl/sdl-graphics.cpp:2252
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:456
+#: gui/options.cpp:726
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2252
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:460
msgid "Fullscreen mode"
msgstr "Pantalla completa"
@@ -1085,7 +1086,11 @@ msgstr "No se ha encontrado un plugin adecuado"
msgid "Engine plugin does not support save states"
msgstr "El plugin del motor no es compatible con partidas guardadas"
-#: common/error.cpp:72
+#: common/error.cpp:71
+msgid "User canceled"
+msgstr ""
+
+#: common/error.cpp:75
msgid "Unknown error"
msgstr "Error desconocido"
@@ -1107,34 +1112,19 @@ msgctxt "lowres"
msgid "Hercules Amber"
msgstr "Hercules сmbar"
-#: engines/advancedDetector.cpp:323
+#: engines/advancedDetector.cpp:296
#, c-format
msgid "The game in '%s' seems to be unknown."
msgstr ""
-#: engines/advancedDetector.cpp:324
+#: engines/advancedDetector.cpp:297
msgid "Please, report the following data to the ScummVM team along with name"
msgstr ""
-#: engines/advancedDetector.cpp:326
+#: engines/advancedDetector.cpp:299
msgid "of the game you tried to add and its version/language/etc.:"
msgstr ""
-#: engines/advancedDetector.cpp:574
-#, c-format
-msgid ""
-"Your game version has been detected using filename matching as a variant of %"
-"s."
-msgstr ""
-
-#: engines/advancedDetector.cpp:577
-msgid "If this is an original and unmodified version, please report any"
-msgstr ""
-
-#: engines/advancedDetector.cpp:579
-msgid "information previously printed by ScummVM to the team."
-msgstr ""
-
#: engines/dialogs.cpp:84
msgid "~R~esume"
msgstr "~R~eanudar"
@@ -1240,6 +1230,17 @@ msgid ""
"See the README file for details."
msgstr ""
+#: engines/engine.cpp:405
+msgid ""
+"WARNING: The game you are about to start is not yet fully supported by "
+"ScummVM. As such, it is likely to be unstable, and any saves you make might "
+"not work in future versions of ScummVM."
+msgstr ""
+
+#: engines/engine.cpp:408
+msgid "Start anyway"
+msgstr ""
+
#: engines/scumm/dialogs.cpp:281
msgid "~P~revious"
msgstr "~A~nterior"
@@ -1773,14 +1774,14 @@ msgstr "Volar a la derecha"
msgid "Fly to lower right"
msgstr "Volar abajo y a la derecha"
-#: engines/scumm/scumm.cpp:1770
+#: engines/scumm/scumm.cpp:1794
#, c-format
msgid ""
"Native MIDI support requires the Roland Upgrade from LucasArts,\n"
"but %s is missing. Using AdLib instead."
msgstr ""
-#: engines/scumm/scumm.cpp:2256 engines/agos/saveload.cpp:190
+#: engines/scumm/scumm.cpp:2280 engines/agos/saveload.cpp:190
#, c-format
msgid ""
"Failed to save game state to file:\n"
@@ -1791,7 +1792,7 @@ msgstr ""
"\n"
"%s"
-#: engines/scumm/scumm.cpp:2263 engines/agos/saveload.cpp:155
+#: engines/scumm/scumm.cpp:2287 engines/agos/saveload.cpp:155
#, c-format
msgid ""
"Failed to load game state from file:\n"
@@ -1802,7 +1803,7 @@ msgstr ""
"\n"
"%s"
-#: engines/scumm/scumm.cpp:2275 engines/agos/saveload.cpp:198
+#: engines/scumm/scumm.cpp:2299 engines/agos/saveload.cpp:198
#, c-format
msgid ""
"Successfully saved game state in file:\n"
@@ -1813,7 +1814,7 @@ msgstr ""
"\n"
"%s"
-#: engines/scumm/scumm.cpp:2490
+#: engines/scumm/scumm.cpp:2514
msgid ""
"Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To "
"play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' "
@@ -2180,34 +2181,34 @@ msgstr "Modo Touchpad activado."
msgid "Touchpad mode disabled."
msgstr "Modo Touchpad desactivado."
-#: backends/graphics/sdl/sdl-graphics.cpp:45
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:45
msgid "Normal (no scaling)"
msgstr "Normal (sin reescalado)"
-#: backends/graphics/sdl/sdl-graphics.cpp:64
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:64
msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr "Normal"
-#: backends/graphics/sdl/sdl-graphics.cpp:2137
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:517
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2137
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:521
#, fuzzy
msgid "Enabled aspect ratio correction"
msgstr "Correcciѓn de aspecto"
-#: backends/graphics/sdl/sdl-graphics.cpp:2143
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:522
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2143
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:526
#, fuzzy
msgid "Disabled aspect ratio correction"
msgstr "Correcciѓn de aspecto"
-#: backends/graphics/sdl/sdl-graphics.cpp:2198
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2198
#, fuzzy
msgid "Active graphics filter:"
msgstr "Alternar entre filtros grсficos"
-#: backends/graphics/sdl/sdl-graphics.cpp:2254
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:461
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2254
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:465
#, fuzzy
msgid "Windowed mode"
msgstr "Renderizado:"
@@ -2224,20 +2225,20 @@ msgstr "OpenGL Conservar"
msgid "OpenGL Original"
msgstr "OpenGL Original"
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:399
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:403
#, fuzzy
msgid "Current display mode"
msgstr "Modo de vэdeo actual:"
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:412
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:416
msgid "Current scale"
msgstr ""
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:542
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:546
msgid "Active filter mode: Linear"
msgstr ""
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:544
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:548
msgid "Active filter mode: Nearest"
msgstr ""
diff --git a/po/fr_FR.po b/po/fr_FR.po
index 1dca127df8..cfb0c0a45b 100644
--- a/po/fr_FR.po
+++ b/po/fr_FR.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.3.0svn\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2011-06-13 22:20+0100\n"
+"POT-Creation-Date: 2011-06-20 23:09+0100\n"
"PO-Revision-Date: 2011-05-02 19:50+0100\n"
"Last-Translator: Thierry Crozat <criezy@scummvm.org>\n"
"Language-Team: French <scummvm-devel@lists.sf.net>\n"
@@ -46,8 +46,8 @@ msgstr "Remonter"
#: gui/browser.cpp:69 gui/chooser.cpp:45 gui/KeysDialog.cpp:43
#: gui/launcher.cpp:312 gui/massadd.cpp:92 gui/options.cpp:1178
#: gui/saveload.cpp:63 gui/saveload.cpp:155 gui/themebrowser.cpp:54
-#: engines/sword1/control.cpp:865 engines/parallaction/saveload.cpp:281
-#: backends/platform/wii/options.cpp:48
+#: engines/engine.cpp:408 engines/sword1/control.cpp:865
+#: engines/parallaction/saveload.cpp:281 backends/platform/wii/options.cpp:48
#: backends/events/default/default-events.cpp:222
#: backends/events/default/default-events.cpp:244
msgid "Cancel"
@@ -86,7 +86,7 @@ msgstr "Affecter"
#: gui/KeysDialog.cpp:42 gui/launcher.cpp:313 gui/launcher.cpp:936
#: gui/launcher.cpp:940 gui/massadd.cpp:89 gui/options.cpp:1179
-#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1772
+#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1796
#: engines/agos/animation.cpp:545 engines/groovie/script.cpp:417
#: engines/sky/compact.cpp:131 engines/sky/compact.cpp:141
#: engines/sword1/animation.cpp:344 engines/sword1/animation.cpp:354
@@ -606,8 +606,9 @@ msgstr "Mode de rendu:"
msgid "Special dithering modes supported by some games"
msgstr "Mode spщcial de tramage supportщ par certains jeux"
-#: gui/options.cpp:726 backends/graphics/sdl/sdl-graphics.cpp:2252
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:456
+#: gui/options.cpp:726
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2252
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:460
msgid "Fullscreen mode"
msgstr "Plein щcran"
@@ -1090,7 +1091,11 @@ msgstr "Aucun plugin n'a pu ъtre trouvщ pour ce jeu"
msgid "Engine plugin does not support save states"
msgstr "Ce moteur de jeu ne supporte pas les sauvegardes"
-#: common/error.cpp:72
+#: common/error.cpp:71
+msgid "User canceled"
+msgstr ""
+
+#: common/error.cpp:75
msgid "Unknown error"
msgstr "Erreur inconnue"
@@ -1112,34 +1117,19 @@ msgctxt "lowres"
msgid "Hercules Amber"
msgstr "Hercules Ambre"
-#: engines/advancedDetector.cpp:323
+#: engines/advancedDetector.cpp:296
#, c-format
msgid "The game in '%s' seems to be unknown."
msgstr ""
-#: engines/advancedDetector.cpp:324
+#: engines/advancedDetector.cpp:297
msgid "Please, report the following data to the ScummVM team along with name"
msgstr ""
-#: engines/advancedDetector.cpp:326
+#: engines/advancedDetector.cpp:299
msgid "of the game you tried to add and its version/language/etc.:"
msgstr ""
-#: engines/advancedDetector.cpp:574
-#, c-format
-msgid ""
-"Your game version has been detected using filename matching as a variant of %"
-"s."
-msgstr ""
-
-#: engines/advancedDetector.cpp:577
-msgid "If this is an original and unmodified version, please report any"
-msgstr ""
-
-#: engines/advancedDetector.cpp:579
-msgid "information previously printed by ScummVM to the team."
-msgstr ""
-
#: engines/dialogs.cpp:84
msgid "~R~esume"
msgstr "~R~eprendre"
@@ -1245,6 +1235,17 @@ msgid ""
"See the README file for details."
msgstr ""
+#: engines/engine.cpp:405
+msgid ""
+"WARNING: The game you are about to start is not yet fully supported by "
+"ScummVM. As such, it is likely to be unstable, and any saves you make might "
+"not work in future versions of ScummVM."
+msgstr ""
+
+#: engines/engine.cpp:408
+msgid "Start anyway"
+msgstr ""
+
#: engines/scumm/dialogs.cpp:281
msgid "~P~revious"
msgstr "~P~rщcщdent"
@@ -1778,14 +1779,14 @@ msgstr "Voler vers la droite"
msgid "Fly to lower right"
msgstr "Voler vers la bas р droite"
-#: engines/scumm/scumm.cpp:1770
+#: engines/scumm/scumm.cpp:1794
#, c-format
msgid ""
"Native MIDI support requires the Roland Upgrade from LucasArts,\n"
"but %s is missing. Using AdLib instead."
msgstr ""
-#: engines/scumm/scumm.cpp:2256 engines/agos/saveload.cpp:190
+#: engines/scumm/scumm.cpp:2280 engines/agos/saveload.cpp:190
#, c-format
msgid ""
"Failed to save game state to file:\n"
@@ -1796,7 +1797,7 @@ msgstr ""
"\n"
"%s"
-#: engines/scumm/scumm.cpp:2263 engines/agos/saveload.cpp:155
+#: engines/scumm/scumm.cpp:2287 engines/agos/saveload.cpp:155
#, c-format
msgid ""
"Failed to load game state from file:\n"
@@ -1807,7 +1808,7 @@ msgstr ""
"\n"
"%s"
-#: engines/scumm/scumm.cpp:2275 engines/agos/saveload.cpp:198
+#: engines/scumm/scumm.cpp:2299 engines/agos/saveload.cpp:198
#, c-format
msgid ""
"Successfully saved game state in file:\n"
@@ -1818,7 +1819,7 @@ msgstr ""
"\n"
"%s"
-#: engines/scumm/scumm.cpp:2490
+#: engines/scumm/scumm.cpp:2514
msgid ""
"Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To "
"play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' "
@@ -2186,34 +2187,34 @@ msgstr "Mode touchpad activщ"
msgid "Touchpad mode disabled."
msgstr "Mode touchpad dщsactivщ"
-#: backends/graphics/sdl/sdl-graphics.cpp:45
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:45
msgid "Normal (no scaling)"
msgstr "Normal (щchelle d'origine)"
-#: backends/graphics/sdl/sdl-graphics.cpp:64
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:64
msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr "Normal"
-#: backends/graphics/sdl/sdl-graphics.cpp:2137
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:517
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2137
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:521
#, fuzzy
msgid "Enabled aspect ratio correction"
msgstr "Changer correction du rapport d'aspect"
-#: backends/graphics/sdl/sdl-graphics.cpp:2143
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:522
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2143
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:526
#, fuzzy
msgid "Disabled aspect ratio correction"
msgstr "Changer correction du rapport d'aspect"
-#: backends/graphics/sdl/sdl-graphics.cpp:2198
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2198
#, fuzzy
msgid "Active graphics filter:"
msgstr "Changer de filtre graphique"
-#: backends/graphics/sdl/sdl-graphics.cpp:2254
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:461
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2254
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:465
#, fuzzy
msgid "Windowed mode"
msgstr "Mode de rendu:"
@@ -2230,20 +2231,20 @@ msgstr "OpenGL Prщserve"
msgid "OpenGL Original"
msgstr "OpenGL Originel"
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:399
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:403
#, fuzzy
msgid "Current display mode"
msgstr "Mode vidщo actuel"
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:412
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:416
msgid "Current scale"
msgstr ""
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:542
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:546
msgid "Active filter mode: Linear"
msgstr ""
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:544
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:548
msgid "Active filter mode: Nearest"
msgstr ""
diff --git a/po/hu_HU.po b/po/hu_HU.po
index d392369220..78062e9d41 100644
--- a/po/hu_HU.po
+++ b/po/hu_HU.po
@@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.3.0svn\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2011-06-13 22:20+0100\n"
-"PO-Revision-Date: 2011-06-12 07:17+0100\n"
+"POT-Creation-Date: 2011-06-20 23:09+0100\n"
+"PO-Revision-Date: 2011-06-15 07:42+0100\n"
"Last-Translator: Gruby <grubycza@hotmail.com>\n"
"Language-Team: Hungarian\n"
"MIME-Version: 1.0\n"
@@ -49,8 +49,8 @@ msgstr "Feljebb"
#: gui/browser.cpp:69 gui/chooser.cpp:45 gui/KeysDialog.cpp:43
#: gui/launcher.cpp:312 gui/massadd.cpp:92 gui/options.cpp:1178
#: gui/saveload.cpp:63 gui/saveload.cpp:155 gui/themebrowser.cpp:54
-#: engines/sword1/control.cpp:865 engines/parallaction/saveload.cpp:281
-#: backends/platform/wii/options.cpp:48
+#: engines/engine.cpp:408 engines/sword1/control.cpp:865
+#: engines/parallaction/saveload.cpp:281 backends/platform/wii/options.cpp:48
#: backends/events/default/default-events.cpp:222
#: backends/events/default/default-events.cpp:244
msgid "Cancel"
@@ -89,7 +89,7 @@ msgstr "Kiosztсs"
#: gui/KeysDialog.cpp:42 gui/launcher.cpp:313 gui/launcher.cpp:936
#: gui/launcher.cpp:940 gui/massadd.cpp:89 gui/options.cpp:1179
-#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1772
+#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1796
#: engines/agos/animation.cpp:545 engines/groovie/script.cpp:417
#: engines/sky/compact.cpp:131 engines/sky/compact.cpp:141
#: engines/sword1/animation.cpp:344 engines/sword1/animation.cpp:354
@@ -606,8 +606,9 @@ msgstr "Kirajzolсs mѓd:"
msgid "Special dithering modes supported by some games"
msgstr "Nщhсny jсtщk tсmogatja a speciсlis сrnyalсsi mѓdokat"
-#: gui/options.cpp:726 backends/graphics/sdl/sdl-graphics.cpp:2252
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:456
+#: gui/options.cpp:726
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2252
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:460
msgid "Fullscreen mode"
msgstr "Teljeskщpernyѕs mѓd:"
@@ -1078,7 +1079,11 @@ msgstr "Nem talсlhatѓ alkalmas motor plugin"
msgid "Engine plugin does not support save states"
msgstr "A motor nem tсmogatja a jсtщkсllсs mentщsщt"
-#: common/error.cpp:72
+#: common/error.cpp:71
+msgid "User canceled"
+msgstr ""
+
+#: common/error.cpp:75
msgid "Unknown error"
msgstr "Ismeretlen hiba"
@@ -1100,34 +1105,19 @@ msgctxt "lowres"
msgid "Hercules Amber"
msgstr "Hercules Sсrga"
-#: engines/advancedDetector.cpp:323
+#: engines/advancedDetector.cpp:296
#, c-format
msgid "The game in '%s' seems to be unknown."
msgstr "A '%s' jсtщk ismeretlennek tћnik."
-#: engines/advancedDetector.cpp:324
+#: engines/advancedDetector.cpp:297
msgid "Please, report the following data to the ScummVM team along with name"
msgstr "Kщrlek jelezd a ScummVM csapatnak a kіvetkezѕ adatokat, egyќtt a jсtщk"
-#: engines/advancedDetector.cpp:326
+#: engines/advancedDetector.cpp:299
msgid "of the game you tried to add and its version/language/etc.:"
msgstr "cэmщvel щs megbэzhatѓ adataival jсtщkverziѓ/nyelv(ek)/stb.:"
-#: engines/advancedDetector.cpp:574
-#, c-format
-msgid ""
-"Your game version has been detected using filename matching as a variant of %"
-"s."
-msgstr "A felismert jсtщkverziѓd a hasznсlt fсjlnщvvel a %s egy vсltozata."
-
-#: engines/advancedDetector.cpp:577
-msgid "If this is an original and unmodified version, please report any"
-msgstr "Ha ez egy eredeti nem vсltoztatott verziѓ, kщrlek jelezd minden"
-
-#: engines/advancedDetector.cpp:579
-msgid "information previously printed by ScummVM to the team."
-msgstr "elѕzѕleg kiэrt informсciѓt a ScummVM csapatnak."
-
#: engines/dialogs.cpp:84
msgid "~R~esume"
msgstr "Folytatсs"
@@ -1182,6 +1172,8 @@ msgid ""
"the README for basic information, and for instructions on how to obtain "
"further assistance."
msgstr ""
+"Sajnсlom, a motor jelenleg nem tartalmaz jсtщk kіzbeni sњgѓt. Olvassd el a "
+"README-t az alap informсciѓkrѓl, щs hogy hogyan segэthetsz a kщsѕbbiekben."
#: engines/dialogs.cpp:312 engines/mohawk/dialogs.cpp:100
#: engines/mohawk/dialogs.cpp:152
@@ -1199,21 +1191,19 @@ msgstr "Billentyќk"
#: engines/engine.cpp:220
msgid "Could not initialize color format."
-msgstr ""
+msgstr "Szэn formсtum nincs alkalmazva"
#: engines/engine.cpp:228
-#, fuzzy
msgid "Could not switch to video mode: '"
-msgstr "Jelenlegi videѓmѓd:"
+msgstr "Videѓmѓd nincs сtсllэtva: ' "
#: engines/engine.cpp:237
-#, fuzzy
msgid "Could not apply aspect ratio setting."
-msgstr "Mщretarсny korrekciѓ engedщlyezve"
+msgstr "Mщretarсny korrekciѓ nem vсltozott."
#: engines/engine.cpp:242
msgid "Could not apply fullscreen setting."
-msgstr ""
+msgstr "Teljeskщpernyѕs beсllэtсs nincs alkalmazva"
#: engines/engine.cpp:342
msgid ""
@@ -1223,6 +1213,11 @@ msgid ""
"the data files to your hard disk instead.\n"
"See the README file for details."
msgstr ""
+"кgy nщz ki, ezt a jсtщkot CD-rѕl futtatod\n"
+"Ez ismert problщmсkat okoz, ezщrt\n"
+"ajсnlatos сtmсsolni a jсtщk\n"
+"adatfсjljait a merevlemezedre.\n"
+"Nщzd meg a README fсjlt a rщszletekщrt."
#: engines/engine.cpp:353
msgid ""
@@ -1232,6 +1227,22 @@ msgid ""
"order to listen to the game's music.\n"
"See the README file for details."
msgstr ""
+"A jсtщkhoz audiѓsсvok tartoznak a lemezen\n"
+"ezeket a sсvokat mсsold ki egy megfelelѕ\n"
+"CD audiѓ kitіmіrэtѕ programmal\n"
+"hogy a jсtщk zenщje hallhatѓ legyen.\n"
+"Nщzd meg a README fсjlt a rщszletekщrt."
+
+#: engines/engine.cpp:405
+msgid ""
+"WARNING: The game you are about to start is not yet fully supported by "
+"ScummVM. As such, it is likely to be unstable, and any saves you make might "
+"not work in future versions of ScummVM."
+msgstr ""
+
+#: engines/engine.cpp:408
+msgid "Start anyway"
+msgstr ""
#: engines/scumm/dialogs.cpp:281
msgid "~P~revious"
@@ -1765,14 +1776,16 @@ msgstr "Jobbra repќlщs"
msgid "Fly to lower right"
msgstr "Jobbra le repќlщs"
-#: engines/scumm/scumm.cpp:1770
+#: engines/scumm/scumm.cpp:1794
#, c-format
msgid ""
"Native MIDI support requires the Roland Upgrade from LucasArts,\n"
"but %s is missing. Using AdLib instead."
msgstr ""
+"Native MIDI tсmogatсshoz kell a Roland Upgrade a LucasArts-tѓl,\n"
+"a %s hiсnyzik. AdLib-ot hasznсlok helyette."
-#: engines/scumm/scumm.cpp:2256 engines/agos/saveload.cpp:190
+#: engines/scumm/scumm.cpp:2280 engines/agos/saveload.cpp:190
#, c-format
msgid ""
"Failed to save game state to file:\n"
@@ -1783,7 +1796,7 @@ msgstr ""
"\n"
"%s fсjlba nem sikerќlt"
-#: engines/scumm/scumm.cpp:2263 engines/agos/saveload.cpp:155
+#: engines/scumm/scumm.cpp:2287 engines/agos/saveload.cpp:155
#, c-format
msgid ""
"Failed to load game state from file:\n"
@@ -1794,7 +1807,7 @@ msgstr ""
"\n"
"%s fсjlbѓl nem sikerќlt"
-#: engines/scumm/scumm.cpp:2275 engines/agos/saveload.cpp:198
+#: engines/scumm/scumm.cpp:2299 engines/agos/saveload.cpp:198
#, c-format
msgid ""
"Successfully saved game state in file:\n"
@@ -1805,7 +1818,7 @@ msgstr ""
"\n"
"%s fсjlba elkщszќlt"
-#: engines/scumm/scumm.cpp:2490
+#: engines/scumm/scumm.cpp:2514
msgid ""
"Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To "
"play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' "
@@ -1846,40 +1859,24 @@ msgstr "Visszaсllэtсs"
#: engines/agos/animation.cpp:544
#, c-format
msgid "Cutscene file '%s' not found!"
-msgstr ""
+msgstr "'%s' сtvezetѕ fсjl nem talсlhatѓ"
#: engines/gob/inter_playtoons.cpp:256 engines/gob/inter_v2.cpp:1283
#: engines/tinsel/saveload.cpp:468
-#, fuzzy
msgid "Failed to load game state from file."
-msgstr ""
-"Jсtщkсllсs betіltщse:\n"
-"\n"
-"%s fсjlbѓl nem sikerќlt"
+msgstr "Jсtщkсllсs betіltщse fсjlbѓl nem sikerќlt."
#: engines/gob/inter_v2.cpp:1353 engines/tinsel/saveload.cpp:546
-#, fuzzy
msgid "Failed to save game state to file."
-msgstr ""
-"Jсtщkсllсs mentщse:\n"
-"\n"
-"%s fсjlba nem sikerќlt"
+msgstr "Jсtщkсllсs mentщse fсjlba nem sikerќlt."
#: engines/gob/inter_v5.cpp:107
-#, fuzzy
msgid "Failed to delete file."
-msgstr ""
-"Jсtщkсllсs mentщse:\n"
-"\n"
-"%s fсjlba nem sikerќlt"
+msgstr "Fсjl tіrlщs sikertelen."
#: engines/groovie/script.cpp:417
-#, fuzzy
msgid "Failed to save game"
-msgstr ""
-"Jсtщkсllсs mentщse:\n"
-"\n"
-"%s fсjlba nem sikerќlt"
+msgstr "Jсtщk mentщs nem sikerќlt"
#: engines/kyra/sound_midi.cpp:475
msgid ""
@@ -1889,36 +1886,44 @@ msgid ""
"General MIDI ones. After all it might happen\n"
"that a few tracks will not be correctly played."
msgstr ""
+"кgy nщz ki egy General MIDI eszkіzt hasznсlsz,\n"
+"a jсtщk csak Roland MT32 MIDI eszkіzt tсmogat.\n"
+"Cserщld ki Roland MT32 hangszerekre\n"
+"a General MIDI-t. Kќlіnben nщhсny\n"
+"sсvot nem lehet rendesen lejсtszani."
#: engines/m4/m4_menus.cpp:138
-#, fuzzy
msgid "Save game failed!"
-msgstr "Jсtщk mentщse:"
+msgstr "Jсtщk mentщse nem sikerќlt!"
#: engines/sky/compact.cpp:130
msgid ""
"Unable to find \"sky.cpt\" file!\n"
"Please download it from www.scummvm.org"
msgstr ""
+"A \"sky.cpt\" fсjl nem talсlhatѓ!\n"
+"Tіltsd le a www.scummvm.org oldalсrѓl"
#: engines/sky/compact.cpp:141
msgid ""
"The \"sky.cpt\" file has an incorrect size.\n"
"Please (re)download it from www.scummvm.org"
msgstr ""
+"A \"sky.cpt\" fсjl mщrete nem megfelelѕ.\n"
+"Tіltsd le a www.scummvm.org oldalсrѓl"
#: engines/sword1/animation.cpp:344 engines/sword2/animation.cpp:379
msgid "DXA cutscenes found but ScummVM has been built without zlib support"
-msgstr ""
+msgstr "DXA сtvezetѕ elщrhetѕ, de a ScummVM zlib tсmogatсs nincs lefordэtva"
#: engines/sword1/animation.cpp:354 engines/sword2/animation.cpp:389
msgid "MPEG2 cutscenes are no longer supported"
-msgstr ""
+msgstr "MPEG2 сtvezetѕk mсr nem tсmogatottak"
#: engines/sword1/animation.cpp:359 engines/sword2/animation.cpp:397
#, c-format
msgid "Cutscene '%s' not found"
-msgstr ""
+msgstr "'%s' сtvezetѕ nem talсlhatѓ"
#: engines/sword1/control.cpp:863
msgid ""
@@ -1930,6 +1935,13 @@ msgid ""
"Press OK to convert them now, otherwise you will be asked again the next "
"time you start the game.\n"
msgstr ""
+"ScummVM rщgi jсtщkmentщst talсlt a Broken Sword 1 hez, ezt сt kell "
+"alakэtani.\n"
+"A rщgi jсtщkmentщs nem tсmogatott, ezщrt a jсtщk nem tіltѕdik be сtalakэtсs "
+"nщlkќl.\n"
+"\n"
+"Nyomj OK-t az сtalakэtсshoz, vagy rсkщrdezzek ha legkіzelebb elindэtod a "
+"jсtщkot.\n"
#: engines/sword1/control.cpp:1232
#, c-format
@@ -1937,18 +1949,20 @@ msgid ""
"Target new save game already exists!\n"
"Would you like to keep the old save game (%s) or the new one (%s)?\n"
msgstr ""
+"A vсlasztott jсtщkmentщs mсr lщtezik!\n"
+"Megtartod a rщgi jсtщkmentщst (%s) vagy kicserщled az њjra (%s)?\n"
#: engines/sword1/control.cpp:1235
msgid "Keep the old one"
-msgstr ""
+msgstr "A rщgit megtartom"
#: engines/sword1/control.cpp:1235
msgid "Keep the new one"
-msgstr ""
+msgstr "Az њjat megtartom"
#: engines/sword1/logic.cpp:1633
msgid "This is the end of the Broken Sword 1 Demo"
-msgstr ""
+msgstr "Ez a Broken Sword 1 Demo vщge"
#: engines/parallaction/saveload.cpp:133
#, c-format
@@ -1956,16 +1970,16 @@ msgid ""
"Can't save game in slot %i\n"
"\n"
msgstr ""
+"Jсtщkсllсs nem menthetѕ %i slotba\n"
+"\n"
#: engines/parallaction/saveload.cpp:211
-#, fuzzy
msgid "Loading game..."
-msgstr "Jсtщk betіltщse:"
+msgstr "Jсtщk betіltщs..."
#: engines/parallaction/saveload.cpp:226
-#, fuzzy
msgid "Saving game..."
-msgstr "Jсtщk mentщse:"
+msgstr "Jсtщk mentщs..."
#: engines/parallaction/saveload.cpp:279
msgid ""
@@ -1976,10 +1990,16 @@ msgid ""
"\n"
"Press OK to convert them now, otherwise you will be asked next time.\n"
msgstr ""
+"ScummVM rщgi jсtщkmentщst talсlt a Nippon Safes hez ezt сt kell nevezni.\n"
+"A rщgi jсtщkmentщs nem tсmogatott, ezщrt a jсtщk nem tіltѕdik be сtnevezщs "
+"nщlkќl..\n"
+"\n"
+"Nyomj OK-t az сtalakэtсshoz, vagy rсkщrdezzek ha legkіzelebb elindэtod a "
+"jсtщkot.\n"
#: engines/parallaction/saveload.cpp:326
msgid "ScummVM successfully converted all your savefiles."
-msgstr ""
+msgstr "ScummVM konvertсlta az іsszes jсtщkсllсsodat."
#: engines/parallaction/saveload.cpp:328
msgid ""
@@ -1988,6 +2008,10 @@ msgid ""
"\n"
"Please report to the team."
msgstr ""
+"ScummVM kiэrt nщhсny figyelmeztetщst a konzolablakba щs nem biztos hogy az "
+"іsszes fсjlod сt lett alakэtva.\n"
+"\n"
+"Lщgyszэves jelentsd a csapatnak."
#: audio/fmopl.cpp:49
msgid "MAME OPL emulator"
@@ -1998,40 +2022,40 @@ msgid "DOSBox OPL emulator"
msgstr "DOSBox OPL emulсtor"
#: audio/mididrv.cpp:204
-#, fuzzy, c-format
+#, c-format
msgid ""
"The selected audio device '%s' was not found (e.g. might be turned off or "
"disconnected). Attempting to fall back to the next available device..."
msgstr ""
-"A '%s' kivсlasztott hangeszkіz nem elщrhetѕ. Bѕvebb informсciѓ a "
-"naplѓfсjlban. Kіvetkezѕ elщrhetѕ eszkіz keresщse..."
+"A kivсlasztott '%s' hangeszkіz nem talсlhatѓ. (Lekapcsoltad, vagy kihњztad). "
+"A kіvetkezѕ elщrhetѕ eszkіz keresщse..."
#: audio/mididrv.cpp:216
-#, fuzzy, c-format
+#, c-format
msgid ""
"The selected audio device '%s' cannot be used. See log file for more "
"information. Attempting to fall back to the next available device..."
msgstr ""
-"A '%s' kivсlasztott hangeszkіz nem elщrhetѕ. Bѕvebb informсciѓ a "
-"naplѓfсjlban. Kіvetkezѕ elщrhetѕ eszkіz keresщse..."
+"A kivсlasztott '%s' hangeszkіz nem hasznсlhatѓ. Bѕvebb informсciѓ a "
+"naplѓfсjlban. A kіvetkezѕ elщrhetѕ eszkіz keresщse..."
#: audio/mididrv.cpp:250
-#, fuzzy, c-format
+#, c-format
msgid ""
"The preferred audio device '%s' was not found (e.g. might be turned off or "
"disconnected). Attempting to fall back to the next available device..."
msgstr ""
-"A '%s' elsѕdleges hangeszkіz nem elщrhetѕ. Bѕvebb informсciѓ a naplѓfсjlban. "
-"Kіvetkezѕ elщrhetѕ eszkіz keresщse..."
+"Az elsѕdleges '%s' hangeszkіz nem talсlhatѓ. (Lekapcsoltad, vagy kihњztad). "
+"A kіvetkezѕ elщrhetѕ eszkіz keresщse..."
#: audio/mididrv.cpp:265
-#, fuzzy, c-format
+#, c-format
msgid ""
"The preferred audio device '%s' cannot be used. See log file for more "
"information. Attempting to fall back to the next available device..."
msgstr ""
-"A '%s' elsѕdleges hangeszkіz nem elщrhetѕ. Bѕvebb informсciѓ a naplѓfсjlban. "
-"Kіvetkezѕ elщrhetѕ eszkіz keresщse..."
+"Az elsѕdleges '%s' hangeszkіz nem hasznсlhatѓ. Bѕvebb informсciѓ a "
+"naplѓfсjlban. A kіvetkezѕ elщrhetѕ eszkіz keresщse..."
#: audio/null.h:43
msgid "No music"
@@ -2162,14 +2186,12 @@ msgid "Disable power off"
msgstr "Leсllэtсs tiltva"
#: backends/platform/iphone/osys_events.cpp:338
-#, fuzzy
msgid "Mouse-click-and-drag mode enabled."
-msgstr "Touchpad mѓd engedщlyezve."
+msgstr "Egщr kattint-щs-hњz mѓd engedщlyezve."
#: backends/platform/iphone/osys_events.cpp:340
-#, fuzzy
msgid "Mouse-click-and-drag mode disabled."
-msgstr "Touchpad mѓd letiltva."
+msgstr "Egщr kattint-щs-hњz mѓd letiltva."
#: backends/platform/iphone/osys_events.cpp:351
msgid "Touchpad mode enabled."
@@ -2179,31 +2201,31 @@ msgstr "Touchpad mѓd engedщlyezve."
msgid "Touchpad mode disabled."
msgstr "Touchpad mѓd letiltva."
-#: backends/graphics/sdl/sdl-graphics.cpp:45
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:45
msgid "Normal (no scaling)"
msgstr "Normсl (nincs сtmщretezщs)"
-#: backends/graphics/sdl/sdl-graphics.cpp:64
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:64
msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr "Normсl (nincs сtmщretezщs)"
-#: backends/graphics/sdl/sdl-graphics.cpp:2137
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:517
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2137
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:521
msgid "Enabled aspect ratio correction"
msgstr "Mщretarсny korrekciѓ engedщlyezve"
-#: backends/graphics/sdl/sdl-graphics.cpp:2143
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:522
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2143
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:526
msgid "Disabled aspect ratio correction"
msgstr "Mщretarсny korrekciѓ letiltva"
-#: backends/graphics/sdl/sdl-graphics.cpp:2198
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2198
msgid "Active graphics filter:"
msgstr "Aktэv grafikus szћrѕk:"
-#: backends/graphics/sdl/sdl-graphics.cpp:2254
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:461
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2254
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:465
msgid "Windowed mode"
msgstr "Ablakos mѓd"
@@ -2219,19 +2241,19 @@ msgstr "OpenGL Megtartott"
msgid "OpenGL Original"
msgstr "OpenGL Eredeti"
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:399
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:403
msgid "Current display mode"
msgstr "Jelenlegi videѓmѓd"
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:412
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:416
msgid "Current scale"
msgstr "Aktuсlis mщretezщs"
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:542
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:546
msgid "Active filter mode: Linear"
msgstr "Aktэv filter mѓd: Lineсris"
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:544
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:548
msgid "Active filter mode: Nearest"
msgstr "Aktэv filter mѓd: Kіzelэtѕ"
@@ -2553,19 +2575,16 @@ msgstr ""
"a teljes listсt"
#: backends/events/default/default-events.cpp:222
-#, fuzzy
msgid "Do you really want to return to the Launcher?"
-msgstr "Biztos hogy tіrіlni akarod ezt a jсtщkсllсst?"
+msgstr "Biztos hogy visszatщrsz az indэtѓpulthoz?"
#: backends/events/default/default-events.cpp:222
-#, fuzzy
msgid "Launcher"
-msgstr "Megќt"
+msgstr "Indэtѓpult"
#: backends/events/default/default-events.cpp:244
-#, fuzzy
msgid "Do you really want to quit?"
-msgstr "Ki akarsz lщpni ?"
+msgstr "Biztos hogy ki akarsz lщpni ?"
#: backends/events/gph/gph-events.cpp:366
#: backends/events/gph/gph-events.cpp:409
@@ -2601,6 +2620,17 @@ msgstr "Minimum Hangerѕ"
msgid "Decreasing Volume"
msgstr "Hangerѕ csіkkentщse"
+#~ msgid ""
+#~ "Your game version has been detected using filename matching as a variant "
+#~ "of %s."
+#~ msgstr "A felismert jсtщkverziѓd a hasznсlt fсjlnщvvel a %s egy vсltozata."
+
+#~ msgid "If this is an original and unmodified version, please report any"
+#~ msgstr "Ha ez egy eredeti nem vсltoztatott verziѓ, kщrlek jelezd minden"
+
+#~ msgid "information previously printed by ScummVM to the team."
+#~ msgstr "elѕzѕleg kiэrt informсciѓt a ScummVM csapatnak."
+
#~ msgid "Discovered %d new games."
#~ msgstr "%d кj jсtщkot talсltam."
diff --git a/po/it_IT.po b/po/it_IT.po
index 24f09e349f..1386e41973 100644
--- a/po/it_IT.po
+++ b/po/it_IT.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.3.0svn\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2011-06-13 22:20+0100\n"
+"POT-Creation-Date: 2011-06-20 23:09+0100\n"
"PO-Revision-Date: 2011-04-24 14:46+0100\n"
"Last-Translator: Matteo 'Maff' Angelino <matteo.maff at gmail dot com>\n"
"Language-Team: Italian\n"
@@ -45,8 +45,8 @@ msgstr "Su"
#: gui/browser.cpp:69 gui/chooser.cpp:45 gui/KeysDialog.cpp:43
#: gui/launcher.cpp:312 gui/massadd.cpp:92 gui/options.cpp:1178
#: gui/saveload.cpp:63 gui/saveload.cpp:155 gui/themebrowser.cpp:54
-#: engines/sword1/control.cpp:865 engines/parallaction/saveload.cpp:281
-#: backends/platform/wii/options.cpp:48
+#: engines/engine.cpp:408 engines/sword1/control.cpp:865
+#: engines/parallaction/saveload.cpp:281 backends/platform/wii/options.cpp:48
#: backends/events/default/default-events.cpp:222
#: backends/events/default/default-events.cpp:244
msgid "Cancel"
@@ -85,7 +85,7 @@ msgstr "Mappa"
#: gui/KeysDialog.cpp:42 gui/launcher.cpp:313 gui/launcher.cpp:936
#: gui/launcher.cpp:940 gui/massadd.cpp:89 gui/options.cpp:1179
-#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1772
+#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1796
#: engines/agos/animation.cpp:545 engines/groovie/script.cpp:417
#: engines/sky/compact.cpp:131 engines/sky/compact.cpp:141
#: engines/sword1/animation.cpp:344 engines/sword1/animation.cpp:354
@@ -606,8 +606,9 @@ msgstr "Resa grafica:"
msgid "Special dithering modes supported by some games"
msgstr "Modalitр di resa grafica speciali supportate da alcuni giochi"
-#: gui/options.cpp:726 backends/graphics/sdl/sdl-graphics.cpp:2252
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:456
+#: gui/options.cpp:726
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2252
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:460
msgid "Fullscreen mode"
msgstr "Modalitр a schermo intero"
@@ -1086,7 +1087,11 @@ msgstr "Impossibile trovare un plugin idoneo"
msgid "Engine plugin does not support save states"
msgstr "Il plugin del motore non supporta i salvataggi"
-#: common/error.cpp:72
+#: common/error.cpp:71
+msgid "User canceled"
+msgstr ""
+
+#: common/error.cpp:75
msgid "Unknown error"
msgstr "Errore sconosciuto"
@@ -1108,34 +1113,19 @@ msgctxt "lowres"
msgid "Hercules Amber"
msgstr "Hercules ambra"
-#: engines/advancedDetector.cpp:323
+#: engines/advancedDetector.cpp:296
#, c-format
msgid "The game in '%s' seems to be unknown."
msgstr ""
-#: engines/advancedDetector.cpp:324
+#: engines/advancedDetector.cpp:297
msgid "Please, report the following data to the ScummVM team along with name"
msgstr ""
-#: engines/advancedDetector.cpp:326
+#: engines/advancedDetector.cpp:299
msgid "of the game you tried to add and its version/language/etc.:"
msgstr ""
-#: engines/advancedDetector.cpp:574
-#, c-format
-msgid ""
-"Your game version has been detected using filename matching as a variant of %"
-"s."
-msgstr ""
-
-#: engines/advancedDetector.cpp:577
-msgid "If this is an original and unmodified version, please report any"
-msgstr ""
-
-#: engines/advancedDetector.cpp:579
-msgid "information previously printed by ScummVM to the team."
-msgstr ""
-
#: engines/dialogs.cpp:84
msgid "~R~esume"
msgstr "~R~ipristina"
@@ -1241,6 +1231,17 @@ msgid ""
"See the README file for details."
msgstr ""
+#: engines/engine.cpp:405
+msgid ""
+"WARNING: The game you are about to start is not yet fully supported by "
+"ScummVM. As such, it is likely to be unstable, and any saves you make might "
+"not work in future versions of ScummVM."
+msgstr ""
+
+#: engines/engine.cpp:408
+msgid "Start anyway"
+msgstr ""
+
#: engines/scumm/dialogs.cpp:281
msgid "~P~revious"
msgstr "~P~recedenti"
@@ -1774,14 +1775,14 @@ msgstr "Vola a destra"
msgid "Fly to lower right"
msgstr "Vola in basso a destra"
-#: engines/scumm/scumm.cpp:1770
+#: engines/scumm/scumm.cpp:1794
#, c-format
msgid ""
"Native MIDI support requires the Roland Upgrade from LucasArts,\n"
"but %s is missing. Using AdLib instead."
msgstr ""
-#: engines/scumm/scumm.cpp:2256 engines/agos/saveload.cpp:190
+#: engines/scumm/scumm.cpp:2280 engines/agos/saveload.cpp:190
#, c-format
msgid ""
"Failed to save game state to file:\n"
@@ -1792,7 +1793,7 @@ msgstr ""
"\n"
"%s"
-#: engines/scumm/scumm.cpp:2263 engines/agos/saveload.cpp:155
+#: engines/scumm/scumm.cpp:2287 engines/agos/saveload.cpp:155
#, c-format
msgid ""
"Failed to load game state from file:\n"
@@ -1803,7 +1804,7 @@ msgstr ""
"\n"
"%s"
-#: engines/scumm/scumm.cpp:2275 engines/agos/saveload.cpp:198
+#: engines/scumm/scumm.cpp:2299 engines/agos/saveload.cpp:198
#, c-format
msgid ""
"Successfully saved game state in file:\n"
@@ -1814,7 +1815,7 @@ msgstr ""
"\n"
"%s"
-#: engines/scumm/scumm.cpp:2490
+#: engines/scumm/scumm.cpp:2514
msgid ""
"Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To "
"play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' "
@@ -2182,34 +2183,34 @@ msgstr "Modalitр touchpad attivata."
msgid "Touchpad mode disabled."
msgstr "Modalitр touchpad disattivata."
-#: backends/graphics/sdl/sdl-graphics.cpp:45
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:45
msgid "Normal (no scaling)"
msgstr "Normale (nessun ridimensionamento)"
-#: backends/graphics/sdl/sdl-graphics.cpp:64
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:64
msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr "Normale (no ridim.)"
-#: backends/graphics/sdl/sdl-graphics.cpp:2137
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:517
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2137
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:521
#, fuzzy
msgid "Enabled aspect ratio correction"
msgstr "Cambia correzione proporzioni"
-#: backends/graphics/sdl/sdl-graphics.cpp:2143
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:522
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2143
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:526
#, fuzzy
msgid "Disabled aspect ratio correction"
msgstr "Cambia correzione proporzioni"
-#: backends/graphics/sdl/sdl-graphics.cpp:2198
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2198
#, fuzzy
msgid "Active graphics filter:"
msgstr "Cambia filtro grafico"
-#: backends/graphics/sdl/sdl-graphics.cpp:2254
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:461
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2254
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:465
#, fuzzy
msgid "Windowed mode"
msgstr "Resa grafica:"
@@ -2226,20 +2227,20 @@ msgstr "OpenGL Conserve"
msgid "OpenGL Original"
msgstr "OpenGL Original"
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:399
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:403
#, fuzzy
msgid "Current display mode"
msgstr "Modalitр video attuale:"
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:412
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:416
msgid "Current scale"
msgstr ""
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:542
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:546
msgid "Active filter mode: Linear"
msgstr ""
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:544
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:548
msgid "Active filter mode: Nearest"
msgstr ""
diff --git a/po/nb_NO.po b/po/nb_NO.po
index 3afebc96d9..eb895ed8c4 100644
--- a/po/nb_NO.po
+++ b/po/nb_NO.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.3.0svn\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2011-06-13 22:20+0100\n"
+"POT-Creation-Date: 2011-06-20 23:09+0100\n"
"PO-Revision-Date: 2011-04-25 22:56+0100\n"
"Last-Translator: Einar Johan T. Sјmхen <einarjohants@gmail.com>\n"
"Language-Team: somaen <einarjohants@gmail.com>\n"
@@ -49,8 +49,8 @@ msgstr "Gх tilbake"
#: gui/browser.cpp:69 gui/chooser.cpp:45 gui/KeysDialog.cpp:43
#: gui/launcher.cpp:312 gui/massadd.cpp:92 gui/options.cpp:1178
#: gui/saveload.cpp:63 gui/saveload.cpp:155 gui/themebrowser.cpp:54
-#: engines/sword1/control.cpp:865 engines/parallaction/saveload.cpp:281
-#: backends/platform/wii/options.cpp:48
+#: engines/engine.cpp:408 engines/sword1/control.cpp:865
+#: engines/parallaction/saveload.cpp:281 backends/platform/wii/options.cpp:48
#: backends/events/default/default-events.cpp:222
#: backends/events/default/default-events.cpp:244
msgid "Cancel"
@@ -89,7 +89,7 @@ msgstr "Koble"
#: gui/KeysDialog.cpp:42 gui/launcher.cpp:313 gui/launcher.cpp:936
#: gui/launcher.cpp:940 gui/massadd.cpp:89 gui/options.cpp:1179
-#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1772
+#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1796
#: engines/agos/animation.cpp:545 engines/groovie/script.cpp:417
#: engines/sky/compact.cpp:131 engines/sky/compact.cpp:141
#: engines/sword1/animation.cpp:344 engines/sword1/animation.cpp:354
@@ -608,8 +608,9 @@ msgstr "Tegnemodus:"
msgid "Special dithering modes supported by some games"
msgstr "Spesiel dithering-modus stјttet av enkelte spill"
-#: gui/options.cpp:726 backends/graphics/sdl/sdl-graphics.cpp:2252
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:456
+#: gui/options.cpp:726
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2252
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:460
msgid "Fullscreen mode"
msgstr "Fullskjermsmodus"
@@ -1081,7 +1082,11 @@ msgstr "Kunne ikke finne en passende engine-plugin"
msgid "Engine plugin does not support save states"
msgstr "Spillmotor-plugin stјtter ikke lagrede tilstander"
-#: common/error.cpp:72
+#: common/error.cpp:71
+msgid "User canceled"
+msgstr ""
+
+#: common/error.cpp:75
msgid "Unknown error"
msgstr "Ukjent feil"
@@ -1103,34 +1108,19 @@ msgctxt "lowres"
msgid "Hercules Amber"
msgstr "Hercules Oransje"
-#: engines/advancedDetector.cpp:323
+#: engines/advancedDetector.cpp:296
#, c-format
msgid "The game in '%s' seems to be unknown."
msgstr ""
-#: engines/advancedDetector.cpp:324
+#: engines/advancedDetector.cpp:297
msgid "Please, report the following data to the ScummVM team along with name"
msgstr ""
-#: engines/advancedDetector.cpp:326
+#: engines/advancedDetector.cpp:299
msgid "of the game you tried to add and its version/language/etc.:"
msgstr ""
-#: engines/advancedDetector.cpp:574
-#, c-format
-msgid ""
-"Your game version has been detected using filename matching as a variant of %"
-"s."
-msgstr ""
-
-#: engines/advancedDetector.cpp:577
-msgid "If this is an original and unmodified version, please report any"
-msgstr ""
-
-#: engines/advancedDetector.cpp:579
-msgid "information previously printed by ScummVM to the team."
-msgstr ""
-
#: engines/dialogs.cpp:84
msgid "~R~esume"
msgstr "~F~ortsett"
@@ -1236,6 +1226,17 @@ msgid ""
"See the README file for details."
msgstr ""
+#: engines/engine.cpp:405
+msgid ""
+"WARNING: The game you are about to start is not yet fully supported by "
+"ScummVM. As such, it is likely to be unstable, and any saves you make might "
+"not work in future versions of ScummVM."
+msgstr ""
+
+#: engines/engine.cpp:408
+msgid "Start anyway"
+msgstr ""
+
#: engines/scumm/dialogs.cpp:281
msgid "~P~revious"
msgstr "~F~orrige"
@@ -1769,14 +1770,14 @@ msgstr "Fly til hјyre"
msgid "Fly to lower right"
msgstr "Fly til nedre hјyre"
-#: engines/scumm/scumm.cpp:1770
+#: engines/scumm/scumm.cpp:1794
#, c-format
msgid ""
"Native MIDI support requires the Roland Upgrade from LucasArts,\n"
"but %s is missing. Using AdLib instead."
msgstr ""
-#: engines/scumm/scumm.cpp:2256 engines/agos/saveload.cpp:190
+#: engines/scumm/scumm.cpp:2280 engines/agos/saveload.cpp:190
#, c-format
msgid ""
"Failed to save game state to file:\n"
@@ -1787,7 +1788,7 @@ msgstr ""
"\n"
"%s"
-#: engines/scumm/scumm.cpp:2263 engines/agos/saveload.cpp:155
+#: engines/scumm/scumm.cpp:2287 engines/agos/saveload.cpp:155
#, c-format
msgid ""
"Failed to load game state from file:\n"
@@ -1798,7 +1799,7 @@ msgstr ""
"\n"
"%s"
-#: engines/scumm/scumm.cpp:2275 engines/agos/saveload.cpp:198
+#: engines/scumm/scumm.cpp:2299 engines/agos/saveload.cpp:198
#, c-format
msgid ""
"Successfully saved game state in file:\n"
@@ -1809,7 +1810,7 @@ msgstr ""
"\n"
"%s"
-#: engines/scumm/scumm.cpp:2490
+#: engines/scumm/scumm.cpp:2514
msgid ""
"Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To "
"play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' "
@@ -2176,34 +2177,34 @@ msgstr "Touchpad-modus aktivert."
msgid "Touchpad mode disabled."
msgstr "Touchpad-modus deaktivert."
-#: backends/graphics/sdl/sdl-graphics.cpp:45
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:45
msgid "Normal (no scaling)"
msgstr "Normal (ingen skalering)"
-#: backends/graphics/sdl/sdl-graphics.cpp:64
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:64
msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr "Normal (ingen skalering)"
-#: backends/graphics/sdl/sdl-graphics.cpp:2137
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:517
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2137
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:521
#, fuzzy
msgid "Enabled aspect ratio correction"
msgstr "Veksle aspekt-rate korrigering"
-#: backends/graphics/sdl/sdl-graphics.cpp:2143
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:522
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2143
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:526
#, fuzzy
msgid "Disabled aspect ratio correction"
msgstr "Veksle aspekt-rate korrigering"
-#: backends/graphics/sdl/sdl-graphics.cpp:2198
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2198
#, fuzzy
msgid "Active graphics filter:"
msgstr "Bytt grafikkfiltre"
-#: backends/graphics/sdl/sdl-graphics.cpp:2254
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:461
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2254
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:465
#, fuzzy
msgid "Windowed mode"
msgstr "Tegnemodus:"
@@ -2220,20 +2221,20 @@ msgstr "OpenGL Bevar"
msgid "OpenGL Original"
msgstr "OpenGL Original"
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:399
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:403
#, fuzzy
msgid "Current display mode"
msgstr "Nхvцrende videomodus:"
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:412
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:416
msgid "Current scale"
msgstr ""
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:542
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:546
msgid "Active filter mode: Linear"
msgstr ""
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:544
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:548
msgid "Active filter mode: Nearest"
msgstr ""
diff --git a/po/nn_NO.po b/po/nn_NO.po
index 9eecf8b6b5..ff43eb2a17 100644
--- a/po/nn_NO.po
+++ b/po/nn_NO.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.3.0svn\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2011-06-13 22:20+0100\n"
+"POT-Creation-Date: 2011-06-20 23:09+0100\n"
"PO-Revision-Date: 2011-04-25 23:07+0100\n"
"Last-Translator: Einar Johan T. Sјmхen <einarjohants@gmail.com>\n"
"Language-Team: somaen <einarjohants@gmail.com>\n"
@@ -49,8 +49,8 @@ msgstr "Gх tilbake"
#: gui/browser.cpp:69 gui/chooser.cpp:45 gui/KeysDialog.cpp:43
#: gui/launcher.cpp:312 gui/massadd.cpp:92 gui/options.cpp:1178
#: gui/saveload.cpp:63 gui/saveload.cpp:155 gui/themebrowser.cpp:54
-#: engines/sword1/control.cpp:865 engines/parallaction/saveload.cpp:281
-#: backends/platform/wii/options.cpp:48
+#: engines/engine.cpp:408 engines/sword1/control.cpp:865
+#: engines/parallaction/saveload.cpp:281 backends/platform/wii/options.cpp:48
#: backends/events/default/default-events.cpp:222
#: backends/events/default/default-events.cpp:244
msgid "Cancel"
@@ -89,7 +89,7 @@ msgstr "Kople"
#: gui/KeysDialog.cpp:42 gui/launcher.cpp:313 gui/launcher.cpp:936
#: gui/launcher.cpp:940 gui/massadd.cpp:89 gui/options.cpp:1179
-#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1772
+#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1796
#: engines/agos/animation.cpp:545 engines/groovie/script.cpp:417
#: engines/sky/compact.cpp:131 engines/sky/compact.cpp:141
#: engines/sword1/animation.cpp:344 engines/sword1/animation.cpp:354
@@ -607,8 +607,9 @@ msgstr "Teiknemodus:"
msgid "Special dithering modes supported by some games"
msgstr "Spesielle dithering-modus som stјttast av nokre spel"
-#: gui/options.cpp:726 backends/graphics/sdl/sdl-graphics.cpp:2252
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:456
+#: gui/options.cpp:726
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2252
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:460
msgid "Fullscreen mode"
msgstr "Fullskjermsmodus"
@@ -1079,7 +1080,11 @@ msgstr "Kunne ikkje finne ein passande spelmotor-plugin"
msgid "Engine plugin does not support save states"
msgstr "Spelmotor-plugin stјttar ikkje lagra tilstandar."
-#: common/error.cpp:72
+#: common/error.cpp:71
+msgid "User canceled"
+msgstr ""
+
+#: common/error.cpp:75
msgid "Unknown error"
msgstr "Ukjend feil"
@@ -1101,34 +1106,19 @@ msgctxt "lowres"
msgid "Hercules Amber"
msgstr "Hercules Raudgul"
-#: engines/advancedDetector.cpp:323
+#: engines/advancedDetector.cpp:296
#, c-format
msgid "The game in '%s' seems to be unknown."
msgstr ""
-#: engines/advancedDetector.cpp:324
+#: engines/advancedDetector.cpp:297
msgid "Please, report the following data to the ScummVM team along with name"
msgstr ""
-#: engines/advancedDetector.cpp:326
+#: engines/advancedDetector.cpp:299
msgid "of the game you tried to add and its version/language/etc.:"
msgstr ""
-#: engines/advancedDetector.cpp:574
-#, c-format
-msgid ""
-"Your game version has been detected using filename matching as a variant of %"
-"s."
-msgstr ""
-
-#: engines/advancedDetector.cpp:577
-msgid "If this is an original and unmodified version, please report any"
-msgstr ""
-
-#: engines/advancedDetector.cpp:579
-msgid "information previously printed by ScummVM to the team."
-msgstr ""
-
#: engines/dialogs.cpp:84
msgid "~R~esume"
msgstr "~F~ortsett"
@@ -1236,6 +1226,17 @@ msgid ""
"See the README file for details."
msgstr ""
+#: engines/engine.cpp:405
+msgid ""
+"WARNING: The game you are about to start is not yet fully supported by "
+"ScummVM. As such, it is likely to be unstable, and any saves you make might "
+"not work in future versions of ScummVM."
+msgstr ""
+
+#: engines/engine.cpp:408
+msgid "Start anyway"
+msgstr ""
+
#: engines/scumm/dialogs.cpp:281
msgid "~P~revious"
msgstr "~F~orrige"
@@ -1769,14 +1770,14 @@ msgstr "Fly til hјgre"
msgid "Fly to lower right"
msgstr "Fly til nedre hјgre"
-#: engines/scumm/scumm.cpp:1770
+#: engines/scumm/scumm.cpp:1794
#, c-format
msgid ""
"Native MIDI support requires the Roland Upgrade from LucasArts,\n"
"but %s is missing. Using AdLib instead."
msgstr ""
-#: engines/scumm/scumm.cpp:2256 engines/agos/saveload.cpp:190
+#: engines/scumm/scumm.cpp:2280 engines/agos/saveload.cpp:190
#, c-format
msgid ""
"Failed to save game state to file:\n"
@@ -1784,7 +1785,7 @@ msgid ""
"%s"
msgstr ""
-#: engines/scumm/scumm.cpp:2263 engines/agos/saveload.cpp:155
+#: engines/scumm/scumm.cpp:2287 engines/agos/saveload.cpp:155
#, c-format
msgid ""
"Failed to load game state from file:\n"
@@ -1792,7 +1793,7 @@ msgid ""
"%s"
msgstr ""
-#: engines/scumm/scumm.cpp:2275 engines/agos/saveload.cpp:198
+#: engines/scumm/scumm.cpp:2299 engines/agos/saveload.cpp:198
#, c-format
msgid ""
"Successfully saved game state in file:\n"
@@ -1800,7 +1801,7 @@ msgid ""
"%s"
msgstr ""
-#: engines/scumm/scumm.cpp:2490
+#: engines/scumm/scumm.cpp:2514
msgid ""
"Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To "
"play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' "
@@ -2150,34 +2151,34 @@ msgstr ""
msgid "Touchpad mode disabled."
msgstr ""
-#: backends/graphics/sdl/sdl-graphics.cpp:45
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:45
msgid "Normal (no scaling)"
msgstr "Normal (inga skalering)"
-#: backends/graphics/sdl/sdl-graphics.cpp:64
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:64
msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr "Normal (inga skalering)"
-#: backends/graphics/sdl/sdl-graphics.cpp:2137
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:517
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2137
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:521
#, fuzzy
msgid "Enabled aspect ratio correction"
msgstr "Veksle aspekt-korrigering"
-#: backends/graphics/sdl/sdl-graphics.cpp:2143
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:522
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2143
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:526
#, fuzzy
msgid "Disabled aspect ratio correction"
msgstr "Veksle aspekt-korrigering"
-#: backends/graphics/sdl/sdl-graphics.cpp:2198
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2198
#, fuzzy
msgid "Active graphics filter:"
msgstr "Veksle grafikkfiltre"
-#: backends/graphics/sdl/sdl-graphics.cpp:2254
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:461
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2254
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:465
#, fuzzy
msgid "Windowed mode"
msgstr "Teiknemodus:"
@@ -2194,20 +2195,20 @@ msgstr "OpenGL Bevar"
msgid "OpenGL Original"
msgstr "OpenGL Original"
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:399
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:403
#, fuzzy
msgid "Current display mode"
msgstr "Gjeldende videomodus:"
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:412
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:416
msgid "Current scale"
msgstr ""
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:542
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:546
msgid "Active filter mode: Linear"
msgstr ""
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:544
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:548
msgid "Active filter mode: Nearest"
msgstr ""
diff --git a/po/pl_PL.po b/po/pl_PL.po
index f591d0065a..12d53847f5 100644
--- a/po/pl_PL.po
+++ b/po/pl_PL.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.3.0\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2011-06-13 22:20+0100\n"
+"POT-Creation-Date: 2011-06-20 23:09+0100\n"
"PO-Revision-Date: 2011-05-02 12:09+0100\n"
"Last-Translator: \n"
"Language-Team: Grajpopolsku.pl <grajpopolsku@gmail.com>\n"
@@ -49,8 +49,8 @@ msgstr "W gѓrъ"
#: gui/browser.cpp:69 gui/chooser.cpp:45 gui/KeysDialog.cpp:43
#: gui/launcher.cpp:312 gui/massadd.cpp:92 gui/options.cpp:1178
#: gui/saveload.cpp:63 gui/saveload.cpp:155 gui/themebrowser.cpp:54
-#: engines/sword1/control.cpp:865 engines/parallaction/saveload.cpp:281
-#: backends/platform/wii/options.cpp:48
+#: engines/engine.cpp:408 engines/sword1/control.cpp:865
+#: engines/parallaction/saveload.cpp:281 backends/platform/wii/options.cpp:48
#: backends/events/default/default-events.cpp:222
#: backends/events/default/default-events.cpp:244
msgid "Cancel"
@@ -89,7 +89,7 @@ msgstr "Przypisz"
#: gui/KeysDialog.cpp:42 gui/launcher.cpp:313 gui/launcher.cpp:936
#: gui/launcher.cpp:940 gui/massadd.cpp:89 gui/options.cpp:1179
-#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1772
+#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1796
#: engines/agos/animation.cpp:545 engines/groovie/script.cpp:417
#: engines/sky/compact.cpp:131 engines/sky/compact.cpp:141
#: engines/sword1/animation.cpp:344 engines/sword1/animation.cpp:354
@@ -604,8 +604,9 @@ msgstr "Renderer:"
msgid "Special dithering modes supported by some games"
msgstr "Specjalne tryby ditheringu wspierane przez niektѓre gry"
-#: gui/options.cpp:726 backends/graphics/sdl/sdl-graphics.cpp:2252
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:456
+#: gui/options.cpp:726
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2252
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:460
msgid "Fullscreen mode"
msgstr "Tryb peГnoekranowy"
@@ -1081,7 +1082,11 @@ msgstr "Nie udaГo siъ znaleМц odpowiedniej wtyczki silnika"
msgid "Engine plugin does not support save states"
msgstr "Silnik nie wspiera zapisu stanu gry"
-#: common/error.cpp:72
+#: common/error.cpp:71
+msgid "User canceled"
+msgstr ""
+
+#: common/error.cpp:75
msgid "Unknown error"
msgstr "Nieznany bГБd"
@@ -1103,34 +1108,19 @@ msgctxt "lowres"
msgid "Hercules Amber"
msgstr "Bursztynowy Hercules"
-#: engines/advancedDetector.cpp:323
+#: engines/advancedDetector.cpp:296
#, c-format
msgid "The game in '%s' seems to be unknown."
msgstr ""
-#: engines/advancedDetector.cpp:324
+#: engines/advancedDetector.cpp:297
msgid "Please, report the following data to the ScummVM team along with name"
msgstr ""
-#: engines/advancedDetector.cpp:326
+#: engines/advancedDetector.cpp:299
msgid "of the game you tried to add and its version/language/etc.:"
msgstr ""
-#: engines/advancedDetector.cpp:574
-#, c-format
-msgid ""
-"Your game version has been detected using filename matching as a variant of %"
-"s."
-msgstr ""
-
-#: engines/advancedDetector.cpp:577
-msgid "If this is an original and unmodified version, please report any"
-msgstr ""
-
-#: engines/advancedDetector.cpp:579
-msgid "information previously printed by ScummVM to the team."
-msgstr ""
-
#: engines/dialogs.cpp:84
msgid "~R~esume"
msgstr "~W~znѓw"
@@ -1236,6 +1226,17 @@ msgid ""
"See the README file for details."
msgstr ""
+#: engines/engine.cpp:405
+msgid ""
+"WARNING: The game you are about to start is not yet fully supported by "
+"ScummVM. As such, it is likely to be unstable, and any saves you make might "
+"not work in future versions of ScummVM."
+msgstr ""
+
+#: engines/engine.cpp:408
+msgid "Start anyway"
+msgstr ""
+
#: engines/scumm/dialogs.cpp:281
msgid "~P~revious"
msgstr "~P~oprzedni"
@@ -1769,14 +1770,14 @@ msgstr "Leц w prawo"
msgid "Fly to lower right"
msgstr "Leц w dѓГ, w prawo"
-#: engines/scumm/scumm.cpp:1770
+#: engines/scumm/scumm.cpp:1794
#, c-format
msgid ""
"Native MIDI support requires the Roland Upgrade from LucasArts,\n"
"but %s is missing. Using AdLib instead."
msgstr ""
-#: engines/scumm/scumm.cpp:2256 engines/agos/saveload.cpp:190
+#: engines/scumm/scumm.cpp:2280 engines/agos/saveload.cpp:190
#, c-format
msgid ""
"Failed to save game state to file:\n"
@@ -1787,7 +1788,7 @@ msgstr ""
"\n"
"%s"
-#: engines/scumm/scumm.cpp:2263 engines/agos/saveload.cpp:155
+#: engines/scumm/scumm.cpp:2287 engines/agos/saveload.cpp:155
#, c-format
msgid ""
"Failed to load game state from file:\n"
@@ -1798,7 +1799,7 @@ msgstr ""
"\n"
"%s"
-#: engines/scumm/scumm.cpp:2275 engines/agos/saveload.cpp:198
+#: engines/scumm/scumm.cpp:2299 engines/agos/saveload.cpp:198
#, c-format
msgid ""
"Successfully saved game state in file:\n"
@@ -1809,7 +1810,7 @@ msgstr ""
"\n"
"%s"
-#: engines/scumm/scumm.cpp:2490
+#: engines/scumm/scumm.cpp:2514
msgid ""
"Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To "
"play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' "
@@ -2176,34 +2177,34 @@ msgstr "Tryb touchpada wГБczony."
msgid "Touchpad mode disabled."
msgstr "Tryb touchpada wyГБczony."
-#: backends/graphics/sdl/sdl-graphics.cpp:45
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:45
msgid "Normal (no scaling)"
msgstr "ZwykГy (bez skalowania)"
-#: backends/graphics/sdl/sdl-graphics.cpp:64
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:64
msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr "ZwykГy (bez skalowania)"
-#: backends/graphics/sdl/sdl-graphics.cpp:2137
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:517
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2137
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:521
#, fuzzy
msgid "Enabled aspect ratio correction"
msgstr "WГБcz/wyГБcz korekcjъ formatu obrazu"
-#: backends/graphics/sdl/sdl-graphics.cpp:2143
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:522
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2143
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:526
#, fuzzy
msgid "Disabled aspect ratio correction"
msgstr "WГБcz/wyГБcz korekcjъ formatu obrazu"
-#: backends/graphics/sdl/sdl-graphics.cpp:2198
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2198
#, fuzzy
msgid "Active graphics filter:"
msgstr "PrzeГБczaj pomiъdzy filtrami grafiki"
-#: backends/graphics/sdl/sdl-graphics.cpp:2254
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:461
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2254
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:465
#, fuzzy
msgid "Windowed mode"
msgstr "Renderer:"
@@ -2220,20 +2221,20 @@ msgstr "OpenGL - zachow."
msgid "OpenGL Original"
msgstr "OpenGL - pierw."
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:399
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:403
#, fuzzy
msgid "Current display mode"
msgstr "Obecny tryb wideo:"
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:412
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:416
msgid "Current scale"
msgstr ""
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:542
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:546
msgid "Active filter mode: Linear"
msgstr ""
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:544
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:548
msgid "Active filter mode: Nearest"
msgstr ""
diff --git a/po/pt_BR.po b/po/pt_BR.po
index a9a0d1412d..2ea8bfe237 100644
--- a/po/pt_BR.po
+++ b/po/pt_BR.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.3.0svn\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2011-06-13 22:20+0100\n"
+"POT-Creation-Date: 2011-06-20 23:09+0100\n"
"PO-Revision-Date: 2011-05-03 19:11-0300\n"
"Last-Translator: Saulo Benigno <saulobenigno@gmail.com>\n"
"Language-Team: ScummBR (www.scummbr.com) <scummbr@yahoo.com.br>\n"
@@ -49,8 +49,8 @@ msgstr "Acima"
#: gui/browser.cpp:69 gui/chooser.cpp:45 gui/KeysDialog.cpp:43
#: gui/launcher.cpp:312 gui/massadd.cpp:92 gui/options.cpp:1178
#: gui/saveload.cpp:63 gui/saveload.cpp:155 gui/themebrowser.cpp:54
-#: engines/sword1/control.cpp:865 engines/parallaction/saveload.cpp:281
-#: backends/platform/wii/options.cpp:48
+#: engines/engine.cpp:408 engines/sword1/control.cpp:865
+#: engines/parallaction/saveload.cpp:281 backends/platform/wii/options.cpp:48
#: backends/events/default/default-events.cpp:222
#: backends/events/default/default-events.cpp:244
msgid "Cancel"
@@ -89,7 +89,7 @@ msgstr "Mapear"
#: gui/KeysDialog.cpp:42 gui/launcher.cpp:313 gui/launcher.cpp:936
#: gui/launcher.cpp:940 gui/massadd.cpp:89 gui/options.cpp:1179
-#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1772
+#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1796
#: engines/agos/animation.cpp:545 engines/groovie/script.cpp:417
#: engines/sky/compact.cpp:131 engines/sky/compact.cpp:141
#: engines/sword1/animation.cpp:344 engines/sword1/animation.cpp:354
@@ -608,8 +608,9 @@ msgstr "Renderizaчуo"
msgid "Special dithering modes supported by some games"
msgstr "Modos especiais de dithering suportados por alguns jogos"
-#: gui/options.cpp:726 backends/graphics/sdl/sdl-graphics.cpp:2252
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:456
+#: gui/options.cpp:726
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2252
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:460
msgid "Fullscreen mode"
msgstr "Modo Tela Cheia"
@@ -1088,7 +1089,11 @@ msgstr "Nуo foi possэvel encontrar engine adequada"
msgid "Engine plugin does not support save states"
msgstr "A engine atual nуo suporta salvar o progresso do jogo"
-#: common/error.cpp:72
+#: common/error.cpp:71
+msgid "User canceled"
+msgstr ""
+
+#: common/error.cpp:75
msgid "Unknown error"
msgstr "Erro desconhecido"
@@ -1110,34 +1115,19 @@ msgctxt "lowres"
msgid "Hercules Amber"
msgstr "Hercules Amber"
-#: engines/advancedDetector.cpp:323
+#: engines/advancedDetector.cpp:296
#, c-format
msgid "The game in '%s' seems to be unknown."
msgstr ""
-#: engines/advancedDetector.cpp:324
+#: engines/advancedDetector.cpp:297
msgid "Please, report the following data to the ScummVM team along with name"
msgstr ""
-#: engines/advancedDetector.cpp:326
+#: engines/advancedDetector.cpp:299
msgid "of the game you tried to add and its version/language/etc.:"
msgstr ""
-#: engines/advancedDetector.cpp:574
-#, c-format
-msgid ""
-"Your game version has been detected using filename matching as a variant of %"
-"s."
-msgstr ""
-
-#: engines/advancedDetector.cpp:577
-msgid "If this is an original and unmodified version, please report any"
-msgstr ""
-
-#: engines/advancedDetector.cpp:579
-msgid "information previously printed by ScummVM to the team."
-msgstr ""
-
#: engines/dialogs.cpp:84
msgid "~R~esume"
msgstr "~V~oltar ao jogo"
@@ -1243,6 +1233,17 @@ msgid ""
"See the README file for details."
msgstr ""
+#: engines/engine.cpp:405
+msgid ""
+"WARNING: The game you are about to start is not yet fully supported by "
+"ScummVM. As such, it is likely to be unstable, and any saves you make might "
+"not work in future versions of ScummVM."
+msgstr ""
+
+#: engines/engine.cpp:408
+msgid "Start anyway"
+msgstr ""
+
#: engines/scumm/dialogs.cpp:281
msgid "~P~revious"
msgstr "~A~nterior"
@@ -1776,14 +1777,14 @@ msgstr "Voar para direita"
msgid "Fly to lower right"
msgstr "Voar para direita inferior"
-#: engines/scumm/scumm.cpp:1770
+#: engines/scumm/scumm.cpp:1794
#, c-format
msgid ""
"Native MIDI support requires the Roland Upgrade from LucasArts,\n"
"but %s is missing. Using AdLib instead."
msgstr ""
-#: engines/scumm/scumm.cpp:2256 engines/agos/saveload.cpp:190
+#: engines/scumm/scumm.cpp:2280 engines/agos/saveload.cpp:190
#, c-format
msgid ""
"Failed to save game state to file:\n"
@@ -1794,7 +1795,7 @@ msgstr ""
"\n"
"%s"
-#: engines/scumm/scumm.cpp:2263 engines/agos/saveload.cpp:155
+#: engines/scumm/scumm.cpp:2287 engines/agos/saveload.cpp:155
#, c-format
msgid ""
"Failed to load game state from file:\n"
@@ -1805,7 +1806,7 @@ msgstr ""
"\n"
"%s"
-#: engines/scumm/scumm.cpp:2275 engines/agos/saveload.cpp:198
+#: engines/scumm/scumm.cpp:2299 engines/agos/saveload.cpp:198
#, c-format
msgid ""
"Successfully saved game state in file:\n"
@@ -1816,7 +1817,7 @@ msgstr ""
"\n"
"%s"
-#: engines/scumm/scumm.cpp:2490
+#: engines/scumm/scumm.cpp:2514
msgid ""
"Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To "
"play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' "
@@ -2184,34 +2185,34 @@ msgstr "Modo Touchpad ligado."
msgid "Touchpad mode disabled."
msgstr "Modo Touchpad desligado."
-#: backends/graphics/sdl/sdl-graphics.cpp:45
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:45
msgid "Normal (no scaling)"
msgstr "Normal (sem escala)"
-#: backends/graphics/sdl/sdl-graphics.cpp:64
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:64
msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr "Normal (sem escala)"
-#: backends/graphics/sdl/sdl-graphics.cpp:2137
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:517
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2137
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:521
#, fuzzy
msgid "Enabled aspect ratio correction"
msgstr "Habilita correчуo de proporчуo"
-#: backends/graphics/sdl/sdl-graphics.cpp:2143
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:522
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2143
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:526
#, fuzzy
msgid "Disabled aspect ratio correction"
msgstr "Habilita correчуo de proporчуo"
-#: backends/graphics/sdl/sdl-graphics.cpp:2198
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2198
#, fuzzy
msgid "Active graphics filter:"
msgstr "Alterna entre os filtros grсficos"
-#: backends/graphics/sdl/sdl-graphics.cpp:2254
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:461
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2254
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:465
#, fuzzy
msgid "Windowed mode"
msgstr "Renderizaчуo"
@@ -2228,20 +2229,20 @@ msgstr "OpenGL Conserve"
msgid "OpenGL Original"
msgstr "OpenGL Original"
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:399
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:403
#, fuzzy
msgid "Current display mode"
msgstr "Modo de vэdeo atual:"
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:412
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:416
msgid "Current scale"
msgstr ""
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:542
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:546
msgid "Active filter mode: Linear"
msgstr ""
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:544
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:548
msgid "Active filter mode: Nearest"
msgstr ""
diff --git a/po/ru_RU.po b/po/ru_RU.po
index 9600a810ea..ae5bbdb448 100644
--- a/po/ru_RU.po
+++ b/po/ru_RU.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.3.0svn\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2011-06-13 22:20+0100\n"
+"POT-Creation-Date: 2011-06-20 23:09+0100\n"
"PO-Revision-Date: 2010-06-13 20:55+0300\n"
"Last-Translator: Eugene Sandulenko <sev@scummvm.org>\n"
"Language-Team: Russian\n"
@@ -47,8 +47,8 @@ msgstr "Вверх"
#: gui/browser.cpp:69 gui/chooser.cpp:45 gui/KeysDialog.cpp:43
#: gui/launcher.cpp:312 gui/massadd.cpp:92 gui/options.cpp:1178
#: gui/saveload.cpp:63 gui/saveload.cpp:155 gui/themebrowser.cpp:54
-#: engines/sword1/control.cpp:865 engines/parallaction/saveload.cpp:281
-#: backends/platform/wii/options.cpp:48
+#: engines/engine.cpp:408 engines/sword1/control.cpp:865
+#: engines/parallaction/saveload.cpp:281 backends/platform/wii/options.cpp:48
#: backends/events/default/default-events.cpp:222
#: backends/events/default/default-events.cpp:244
msgid "Cancel"
@@ -87,7 +87,7 @@ msgstr "Назначить"
#: gui/KeysDialog.cpp:42 gui/launcher.cpp:313 gui/launcher.cpp:936
#: gui/launcher.cpp:940 gui/massadd.cpp:89 gui/options.cpp:1179
-#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1772
+#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1796
#: engines/agos/animation.cpp:545 engines/groovie/script.cpp:417
#: engines/sky/compact.cpp:131 engines/sky/compact.cpp:141
#: engines/sword1/animation.cpp:344 engines/sword1/animation.cpp:354
@@ -605,8 +605,9 @@ msgstr "Режим растра:"
msgid "Special dithering modes supported by some games"
msgstr "Специальные режимы рендеринга, поддерживаемые некоторыми играми"
-#: gui/options.cpp:726 backends/graphics/sdl/sdl-graphics.cpp:2252
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:456
+#: gui/options.cpp:726
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2252
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:460
msgid "Fullscreen mode"
msgstr "Полноэкранный режим"
@@ -1088,7 +1089,11 @@ msgstr "Не могу найти подходящий плагин для движка"
msgid "Engine plugin does not support save states"
msgstr "Движок не поддерживает сохранения"
-#: common/error.cpp:72
+#: common/error.cpp:71
+msgid "User canceled"
+msgstr ""
+
+#: common/error.cpp:75
msgid "Unknown error"
msgstr "Неизвестная ошибка"
@@ -1110,34 +1115,19 @@ msgctxt "lowres"
msgid "Hercules Amber"
msgstr "Hercules Янтарный"
-#: engines/advancedDetector.cpp:323
+#: engines/advancedDetector.cpp:296
#, c-format
msgid "The game in '%s' seems to be unknown."
msgstr ""
-#: engines/advancedDetector.cpp:324
+#: engines/advancedDetector.cpp:297
msgid "Please, report the following data to the ScummVM team along with name"
msgstr ""
-#: engines/advancedDetector.cpp:326
+#: engines/advancedDetector.cpp:299
msgid "of the game you tried to add and its version/language/etc.:"
msgstr ""
-#: engines/advancedDetector.cpp:574
-#, c-format
-msgid ""
-"Your game version has been detected using filename matching as a variant of %"
-"s."
-msgstr ""
-
-#: engines/advancedDetector.cpp:577
-msgid "If this is an original and unmodified version, please report any"
-msgstr ""
-
-#: engines/advancedDetector.cpp:579
-msgid "information previously printed by ScummVM to the team."
-msgstr ""
-
#: engines/dialogs.cpp:84
msgid "~R~esume"
msgstr "Продол~ж~ить"
@@ -1243,6 +1233,17 @@ msgid ""
"See the README file for details."
msgstr ""
+#: engines/engine.cpp:405
+msgid ""
+"WARNING: The game you are about to start is not yet fully supported by "
+"ScummVM. As such, it is likely to be unstable, and any saves you make might "
+"not work in future versions of ScummVM."
+msgstr ""
+
+#: engines/engine.cpp:408
+msgid "Start anyway"
+msgstr ""
+
#: engines/scumm/dialogs.cpp:281
msgid "~P~revious"
msgstr "~П~ред"
@@ -1776,14 +1777,14 @@ msgstr "Лететь вправо"
msgid "Fly to lower right"
msgstr "Лететь вправо-вниз"
-#: engines/scumm/scumm.cpp:1770
+#: engines/scumm/scumm.cpp:1794
#, c-format
msgid ""
"Native MIDI support requires the Roland Upgrade from LucasArts,\n"
"but %s is missing. Using AdLib instead."
msgstr ""
-#: engines/scumm/scumm.cpp:2256 engines/agos/saveload.cpp:190
+#: engines/scumm/scumm.cpp:2280 engines/agos/saveload.cpp:190
#, c-format
msgid ""
"Failed to save game state to file:\n"
@@ -1794,7 +1795,7 @@ msgstr ""
"\n"
"%s"
-#: engines/scumm/scumm.cpp:2263 engines/agos/saveload.cpp:155
+#: engines/scumm/scumm.cpp:2287 engines/agos/saveload.cpp:155
#, c-format
msgid ""
"Failed to load game state from file:\n"
@@ -1805,7 +1806,7 @@ msgstr ""
"\n"
"%s"
-#: engines/scumm/scumm.cpp:2275 engines/agos/saveload.cpp:198
+#: engines/scumm/scumm.cpp:2299 engines/agos/saveload.cpp:198
#, c-format
msgid ""
"Successfully saved game state in file:\n"
@@ -1816,7 +1817,7 @@ msgstr ""
"\n"
"%s"
-#: engines/scumm/scumm.cpp:2490
+#: engines/scumm/scumm.cpp:2514
msgid ""
"Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To "
"play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' "
@@ -2183,34 +2184,34 @@ msgstr "Режим тачпада включен."
msgid "Touchpad mode disabled."
msgstr "Режим тачпада выключен."
-#: backends/graphics/sdl/sdl-graphics.cpp:45
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:45
msgid "Normal (no scaling)"
msgstr "Без увеличения"
-#: backends/graphics/sdl/sdl-graphics.cpp:64
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:64
msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr "Без увеличения"
-#: backends/graphics/sdl/sdl-graphics.cpp:2137
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:517
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2137
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:521
#, fuzzy
msgid "Enabled aspect ratio correction"
msgstr "Переключение коррекции соотношения сторон"
-#: backends/graphics/sdl/sdl-graphics.cpp:2143
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:522
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2143
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:526
#, fuzzy
msgid "Disabled aspect ratio correction"
msgstr "Переключение коррекции соотношения сторон"
-#: backends/graphics/sdl/sdl-graphics.cpp:2198
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2198
#, fuzzy
msgid "Active graphics filter:"
msgstr "Переключение между графическими фильтрами"
-#: backends/graphics/sdl/sdl-graphics.cpp:2254
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:461
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2254
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:465
#, fuzzy
msgid "Windowed mode"
msgstr "Режим растра:"
@@ -2227,20 +2228,20 @@ msgstr "OpenGL с сохранением"
msgid "OpenGL Original"
msgstr "OpenGL изначальный"
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:399
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:403
#, fuzzy
msgid "Current display mode"
msgstr "Текущий видеорежим:"
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:412
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:416
msgid "Current scale"
msgstr ""
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:542
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:546
msgid "Active filter mode: Linear"
msgstr ""
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:544
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:548
msgid "Active filter mode: Nearest"
msgstr ""
diff --git a/po/scummvm.pot b/po/scummvm.pot
index 39c80538d8..7abb933cb1 100644
--- a/po/scummvm.pot
+++ b/po/scummvm.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.4.0git\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2011-06-13 22:20+0100\n"
+"POT-Creation-Date: 2011-06-20 23:09+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -45,8 +45,8 @@ msgstr ""
#: gui/browser.cpp:69 gui/chooser.cpp:45 gui/KeysDialog.cpp:43
#: gui/launcher.cpp:312 gui/massadd.cpp:92 gui/options.cpp:1178
#: gui/saveload.cpp:63 gui/saveload.cpp:155 gui/themebrowser.cpp:54
-#: engines/sword1/control.cpp:865 engines/parallaction/saveload.cpp:281
-#: backends/platform/wii/options.cpp:48
+#: engines/engine.cpp:408 engines/sword1/control.cpp:865
+#: engines/parallaction/saveload.cpp:281 backends/platform/wii/options.cpp:48
#: backends/events/default/default-events.cpp:222
#: backends/events/default/default-events.cpp:244
msgid "Cancel"
@@ -85,7 +85,7 @@ msgstr ""
#: gui/KeysDialog.cpp:42 gui/launcher.cpp:313 gui/launcher.cpp:936
#: gui/launcher.cpp:940 gui/massadd.cpp:89 gui/options.cpp:1179
-#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1772
+#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1796
#: engines/agos/animation.cpp:545 engines/groovie/script.cpp:417
#: engines/sky/compact.cpp:131 engines/sky/compact.cpp:141
#: engines/sword1/animation.cpp:344 engines/sword1/animation.cpp:354
@@ -597,8 +597,9 @@ msgstr ""
msgid "Special dithering modes supported by some games"
msgstr ""
-#: gui/options.cpp:726 backends/graphics/sdl/sdl-graphics.cpp:2252
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:456
+#: gui/options.cpp:726
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2252
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:460
msgid "Fullscreen mode"
msgstr ""
@@ -1063,7 +1064,11 @@ msgstr ""
msgid "Engine plugin does not support save states"
msgstr ""
-#: common/error.cpp:72
+#: common/error.cpp:71
+msgid "User canceled"
+msgstr ""
+
+#: common/error.cpp:75
msgid "Unknown error"
msgstr ""
@@ -1085,34 +1090,19 @@ msgctxt "lowres"
msgid "Hercules Amber"
msgstr ""
-#: engines/advancedDetector.cpp:323
+#: engines/advancedDetector.cpp:296
#, c-format
msgid "The game in '%s' seems to be unknown."
msgstr ""
-#: engines/advancedDetector.cpp:324
+#: engines/advancedDetector.cpp:297
msgid "Please, report the following data to the ScummVM team along with name"
msgstr ""
-#: engines/advancedDetector.cpp:326
+#: engines/advancedDetector.cpp:299
msgid "of the game you tried to add and its version/language/etc.:"
msgstr ""
-#: engines/advancedDetector.cpp:574
-#, c-format
-msgid ""
-"Your game version has been detected using filename matching as a variant of %"
-"s."
-msgstr ""
-
-#: engines/advancedDetector.cpp:577
-msgid "If this is an original and unmodified version, please report any"
-msgstr ""
-
-#: engines/advancedDetector.cpp:579
-msgid "information previously printed by ScummVM to the team."
-msgstr ""
-
#: engines/dialogs.cpp:84
msgid "~R~esume"
msgstr ""
@@ -1216,6 +1206,17 @@ msgid ""
"See the README file for details."
msgstr ""
+#: engines/engine.cpp:405
+msgid ""
+"WARNING: The game you are about to start is not yet fully supported by "
+"ScummVM. As such, it is likely to be unstable, and any saves you make might "
+"not work in future versions of ScummVM."
+msgstr ""
+
+#: engines/engine.cpp:408
+msgid "Start anyway"
+msgstr ""
+
#: engines/scumm/dialogs.cpp:281
msgid "~P~revious"
msgstr ""
@@ -1748,14 +1749,14 @@ msgstr ""
msgid "Fly to lower right"
msgstr ""
-#: engines/scumm/scumm.cpp:1770
+#: engines/scumm/scumm.cpp:1794
#, c-format
msgid ""
"Native MIDI support requires the Roland Upgrade from LucasArts,\n"
"but %s is missing. Using AdLib instead."
msgstr ""
-#: engines/scumm/scumm.cpp:2256 engines/agos/saveload.cpp:190
+#: engines/scumm/scumm.cpp:2280 engines/agos/saveload.cpp:190
#, c-format
msgid ""
"Failed to save game state to file:\n"
@@ -1763,7 +1764,7 @@ msgid ""
"%s"
msgstr ""
-#: engines/scumm/scumm.cpp:2263 engines/agos/saveload.cpp:155
+#: engines/scumm/scumm.cpp:2287 engines/agos/saveload.cpp:155
#, c-format
msgid ""
"Failed to load game state from file:\n"
@@ -1771,7 +1772,7 @@ msgid ""
"%s"
msgstr ""
-#: engines/scumm/scumm.cpp:2275 engines/agos/saveload.cpp:198
+#: engines/scumm/scumm.cpp:2299 engines/agos/saveload.cpp:198
#, c-format
msgid ""
"Successfully saved game state in file:\n"
@@ -1779,7 +1780,7 @@ msgid ""
"%s"
msgstr ""
-#: engines/scumm/scumm.cpp:2490
+#: engines/scumm/scumm.cpp:2514
msgid ""
"Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To "
"play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' "
@@ -2121,31 +2122,31 @@ msgstr ""
msgid "Touchpad mode disabled."
msgstr ""
-#: backends/graphics/sdl/sdl-graphics.cpp:45
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:45
msgid "Normal (no scaling)"
msgstr ""
-#: backends/graphics/sdl/sdl-graphics.cpp:64
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:64
msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr ""
-#: backends/graphics/sdl/sdl-graphics.cpp:2137
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:517
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2137
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:521
msgid "Enabled aspect ratio correction"
msgstr ""
-#: backends/graphics/sdl/sdl-graphics.cpp:2143
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:522
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2143
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:526
msgid "Disabled aspect ratio correction"
msgstr ""
-#: backends/graphics/sdl/sdl-graphics.cpp:2198
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2198
msgid "Active graphics filter:"
msgstr ""
-#: backends/graphics/sdl/sdl-graphics.cpp:2254
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:461
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2254
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:465
msgid "Windowed mode"
msgstr ""
@@ -2161,19 +2162,19 @@ msgstr ""
msgid "OpenGL Original"
msgstr ""
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:399
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:403
msgid "Current display mode"
msgstr ""
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:412
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:416
msgid "Current scale"
msgstr ""
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:542
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:546
msgid "Active filter mode: Linear"
msgstr ""
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:544
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:548
msgid "Active filter mode: Nearest"
msgstr ""
diff --git a/po/se_SE.po b/po/se_SE.po
index ccb12b159f..7301fd52d1 100644
--- a/po/se_SE.po
+++ b/po/se_SE.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.3.0svn\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2011-06-13 22:20+0100\n"
+"POT-Creation-Date: 2011-06-20 23:09+0100\n"
"PO-Revision-Date: 2011-05-02 13:07+0100\n"
"Last-Translator: Hampus Flink <hampus.flink@gmail.com>\n"
"Language-Team: \n"
@@ -50,8 +50,8 @@ msgstr "Uppхt"
#: gui/browser.cpp:69 gui/chooser.cpp:45 gui/KeysDialog.cpp:43
#: gui/launcher.cpp:312 gui/massadd.cpp:92 gui/options.cpp:1178
#: gui/saveload.cpp:63 gui/saveload.cpp:155 gui/themebrowser.cpp:54
-#: engines/sword1/control.cpp:865 engines/parallaction/saveload.cpp:281
-#: backends/platform/wii/options.cpp:48
+#: engines/engine.cpp:408 engines/sword1/control.cpp:865
+#: engines/parallaction/saveload.cpp:281 backends/platform/wii/options.cpp:48
#: backends/events/default/default-events.cpp:222
#: backends/events/default/default-events.cpp:244
msgid "Cancel"
@@ -90,7 +90,7 @@ msgstr "Stфll in"
#: gui/KeysDialog.cpp:42 gui/launcher.cpp:313 gui/launcher.cpp:936
#: gui/launcher.cpp:940 gui/massadd.cpp:89 gui/options.cpp:1179
-#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1772
+#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1796
#: engines/agos/animation.cpp:545 engines/groovie/script.cpp:417
#: engines/sky/compact.cpp:131 engines/sky/compact.cpp:141
#: engines/sword1/animation.cpp:344 engines/sword1/animation.cpp:354
@@ -609,8 +609,9 @@ msgstr "Renderingslфge:"
msgid "Special dithering modes supported by some games"
msgstr "Speciella gitterlфgen stіdda av vissa spel"
-#: gui/options.cpp:726 backends/graphics/sdl/sdl-graphics.cpp:2252
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:456
+#: gui/options.cpp:726
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2252
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:460
msgid "Fullscreen mode"
msgstr "Fullskфrmslфge"
@@ -1089,7 +1090,11 @@ msgstr "Kunde inte hitta lфmpligt motortillфgg"
msgid "Engine plugin does not support save states"
msgstr "Motorn stіder inte debug-nivх '%s'"
-#: common/error.cpp:72
+#: common/error.cpp:71
+msgid "User canceled"
+msgstr ""
+
+#: common/error.cpp:75
msgid "Unknown error"
msgstr "Okфnt fel"
@@ -1111,34 +1116,19 @@ msgctxt "lowres"
msgid "Hercules Amber"
msgstr "Herkules bфrnsten"
-#: engines/advancedDetector.cpp:323
+#: engines/advancedDetector.cpp:296
#, c-format
msgid "The game in '%s' seems to be unknown."
msgstr ""
-#: engines/advancedDetector.cpp:324
+#: engines/advancedDetector.cpp:297
msgid "Please, report the following data to the ScummVM team along with name"
msgstr ""
-#: engines/advancedDetector.cpp:326
+#: engines/advancedDetector.cpp:299
msgid "of the game you tried to add and its version/language/etc.:"
msgstr ""
-#: engines/advancedDetector.cpp:574
-#, c-format
-msgid ""
-"Your game version has been detected using filename matching as a variant of %"
-"s."
-msgstr ""
-
-#: engines/advancedDetector.cpp:577
-msgid "If this is an original and unmodified version, please report any"
-msgstr ""
-
-#: engines/advancedDetector.cpp:579
-msgid "information previously printed by ScummVM to the team."
-msgstr ""
-
#: engines/dialogs.cpp:84
msgid "~R~esume"
msgstr "~F~ortsфtt"
@@ -1244,6 +1234,17 @@ msgid ""
"See the README file for details."
msgstr ""
+#: engines/engine.cpp:405
+msgid ""
+"WARNING: The game you are about to start is not yet fully supported by "
+"ScummVM. As such, it is likely to be unstable, and any saves you make might "
+"not work in future versions of ScummVM."
+msgstr ""
+
+#: engines/engine.cpp:408
+msgid "Start anyway"
+msgstr ""
+
#: engines/scumm/dialogs.cpp:281
msgid "~P~revious"
msgstr "~F~іregхende"
@@ -1777,14 +1778,14 @@ msgstr "Flyg хt hіger"
msgid "Fly to lower right"
msgstr "Flyg хt nedre hіger"
-#: engines/scumm/scumm.cpp:1770
+#: engines/scumm/scumm.cpp:1794
#, c-format
msgid ""
"Native MIDI support requires the Roland Upgrade from LucasArts,\n"
"but %s is missing. Using AdLib instead."
msgstr ""
-#: engines/scumm/scumm.cpp:2256 engines/agos/saveload.cpp:190
+#: engines/scumm/scumm.cpp:2280 engines/agos/saveload.cpp:190
#, c-format
msgid ""
"Failed to save game state to file:\n"
@@ -1795,7 +1796,7 @@ msgstr ""
"\n"
"%s"
-#: engines/scumm/scumm.cpp:2263 engines/agos/saveload.cpp:155
+#: engines/scumm/scumm.cpp:2287 engines/agos/saveload.cpp:155
#, c-format
msgid ""
"Failed to load game state from file:\n"
@@ -1806,7 +1807,7 @@ msgstr ""
"\n"
"%s"
-#: engines/scumm/scumm.cpp:2275 engines/agos/saveload.cpp:198
+#: engines/scumm/scumm.cpp:2299 engines/agos/saveload.cpp:198
#, c-format
msgid ""
"Successfully saved game state in file:\n"
@@ -1817,7 +1818,7 @@ msgstr ""
"\n"
"%s"
-#: engines/scumm/scumm.cpp:2490
+#: engines/scumm/scumm.cpp:2514
msgid ""
"Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To "
"play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' "
@@ -2184,34 +2185,34 @@ msgstr "Touchpad-lфge aktiverat."
msgid "Touchpad mode disabled."
msgstr "Touchpad-lфge inaktiverat."
-#: backends/graphics/sdl/sdl-graphics.cpp:45
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:45
msgid "Normal (no scaling)"
msgstr "Normalt (ingen skalning)"
-#: backends/graphics/sdl/sdl-graphics.cpp:64
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:64
msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr "Normalt (ingen skalning)"
-#: backends/graphics/sdl/sdl-graphics.cpp:2137
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:517
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2137
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:521
#, fuzzy
msgid "Enabled aspect ratio correction"
msgstr "Korrektion av bildfіrhхllande pх/av"
-#: backends/graphics/sdl/sdl-graphics.cpp:2143
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:522
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2143
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:526
#, fuzzy
msgid "Disabled aspect ratio correction"
msgstr "Korrektion av bildfіrhхllande pх/av"
-#: backends/graphics/sdl/sdl-graphics.cpp:2198
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2198
#, fuzzy
msgid "Active graphics filter:"
msgstr "Vфxla grafikfilter"
-#: backends/graphics/sdl/sdl-graphics.cpp:2254
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:461
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2254
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:465
#, fuzzy
msgid "Windowed mode"
msgstr "Renderingslфge:"
@@ -2228,20 +2229,20 @@ msgstr "OpenGL konservation"
msgid "OpenGL Original"
msgstr "OpenGL original"
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:399
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:403
#, fuzzy
msgid "Current display mode"
msgstr "Aktivt videolфge:"
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:412
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:416
msgid "Current scale"
msgstr ""
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:542
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:546
msgid "Active filter mode: Linear"
msgstr ""
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:544
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:548
msgid "Active filter mode: Nearest"
msgstr ""
diff --git a/po/uk_UA.po b/po/uk_UA.po
index dfacf84fa7..0d94a6320f 100644
--- a/po/uk_UA.po
+++ b/po/uk_UA.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.3.0svn\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2011-06-13 22:20+0100\n"
+"POT-Creation-Date: 2011-06-20 23:09+0100\n"
"PO-Revision-Date: 2011-03-26 22:38+0200\n"
"Last-Translator: Lubomyr Lisen\n"
"Language-Team: Ukrainian\n"
@@ -47,8 +47,8 @@ msgstr "Вверх"
#: gui/browser.cpp:69 gui/chooser.cpp:45 gui/KeysDialog.cpp:43
#: gui/launcher.cpp:312 gui/massadd.cpp:92 gui/options.cpp:1178
#: gui/saveload.cpp:63 gui/saveload.cpp:155 gui/themebrowser.cpp:54
-#: engines/sword1/control.cpp:865 engines/parallaction/saveload.cpp:281
-#: backends/platform/wii/options.cpp:48
+#: engines/engine.cpp:408 engines/sword1/control.cpp:865
+#: engines/parallaction/saveload.cpp:281 backends/platform/wii/options.cpp:48
#: backends/events/default/default-events.cpp:222
#: backends/events/default/default-events.cpp:244
msgid "Cancel"
@@ -87,7 +87,7 @@ msgstr "Призначити"
#: gui/KeysDialog.cpp:42 gui/launcher.cpp:313 gui/launcher.cpp:936
#: gui/launcher.cpp:940 gui/massadd.cpp:89 gui/options.cpp:1179
-#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1772
+#: engines/engine.cpp:346 engines/engine.cpp:357 engines/scumm/scumm.cpp:1796
#: engines/agos/animation.cpp:545 engines/groovie/script.cpp:417
#: engines/sky/compact.cpp:131 engines/sky/compact.cpp:141
#: engines/sword1/animation.cpp:344 engines/sword1/animation.cpp:354
@@ -604,8 +604,9 @@ msgstr "Режим раструв.:"
msgid "Special dithering modes supported by some games"
msgstr "Спеціальні режими растрування, які підтримують деякі ігри"
-#: gui/options.cpp:726 backends/graphics/sdl/sdl-graphics.cpp:2252
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:456
+#: gui/options.cpp:726
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2252
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:460
msgid "Fullscreen mode"
msgstr "Повноекранний режим"
@@ -1083,7 +1084,11 @@ msgstr "Не можу знайти необхідеого втулка для движка."
msgid "Engine plugin does not support save states"
msgstr "Движок не підтримує рівень відладки '%s'"
-#: common/error.cpp:72
+#: common/error.cpp:71
+msgid "User canceled"
+msgstr ""
+
+#: common/error.cpp:75
msgid "Unknown error"
msgstr "Невідома помилка"
@@ -1105,34 +1110,19 @@ msgctxt "lowres"
msgid "Hercules Amber"
msgstr "Hercules Янтарний"
-#: engines/advancedDetector.cpp:323
+#: engines/advancedDetector.cpp:296
#, c-format
msgid "The game in '%s' seems to be unknown."
msgstr ""
-#: engines/advancedDetector.cpp:324
+#: engines/advancedDetector.cpp:297
msgid "Please, report the following data to the ScummVM team along with name"
msgstr ""
-#: engines/advancedDetector.cpp:326
+#: engines/advancedDetector.cpp:299
msgid "of the game you tried to add and its version/language/etc.:"
msgstr ""
-#: engines/advancedDetector.cpp:574
-#, c-format
-msgid ""
-"Your game version has been detected using filename matching as a variant of %"
-"s."
-msgstr ""
-
-#: engines/advancedDetector.cpp:577
-msgid "If this is an original and unmodified version, please report any"
-msgstr ""
-
-#: engines/advancedDetector.cpp:579
-msgid "information previously printed by ScummVM to the team."
-msgstr ""
-
#: engines/dialogs.cpp:84
msgid "~R~esume"
msgstr "Продов~ж~ити"
@@ -1238,6 +1228,17 @@ msgid ""
"See the README file for details."
msgstr ""
+#: engines/engine.cpp:405
+msgid ""
+"WARNING: The game you are about to start is not yet fully supported by "
+"ScummVM. As such, it is likely to be unstable, and any saves you make might "
+"not work in future versions of ScummVM."
+msgstr ""
+
+#: engines/engine.cpp:408
+msgid "Start anyway"
+msgstr ""
+
#: engines/scumm/dialogs.cpp:281
msgid "~P~revious"
msgstr "~П~опер"
@@ -1771,14 +1772,14 @@ msgstr "Летіти направо"
msgid "Fly to lower right"
msgstr "Летіти донизу направо"
-#: engines/scumm/scumm.cpp:1770
+#: engines/scumm/scumm.cpp:1794
#, c-format
msgid ""
"Native MIDI support requires the Roland Upgrade from LucasArts,\n"
"but %s is missing. Using AdLib instead."
msgstr ""
-#: engines/scumm/scumm.cpp:2256 engines/agos/saveload.cpp:190
+#: engines/scumm/scumm.cpp:2280 engines/agos/saveload.cpp:190
#, c-format
msgid ""
"Failed to save game state to file:\n"
@@ -1789,7 +1790,7 @@ msgstr ""
"\n"
"%s"
-#: engines/scumm/scumm.cpp:2263 engines/agos/saveload.cpp:155
+#: engines/scumm/scumm.cpp:2287 engines/agos/saveload.cpp:155
#, c-format
msgid ""
"Failed to load game state from file:\n"
@@ -1800,7 +1801,7 @@ msgstr ""
"\n"
"%s"
-#: engines/scumm/scumm.cpp:2275 engines/agos/saveload.cpp:198
+#: engines/scumm/scumm.cpp:2299 engines/agos/saveload.cpp:198
#, c-format
msgid ""
"Successfully saved game state in file:\n"
@@ -1811,7 +1812,7 @@ msgstr ""
"\n"
"%s"
-#: engines/scumm/scumm.cpp:2490
+#: engines/scumm/scumm.cpp:2514
msgid ""
"Usually, Maniac Mansion would start now. But ScummVM doesn't do that yet. To "
"play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' "
@@ -2178,34 +2179,34 @@ msgstr "Режим тачпаду увімкнено."
msgid "Touchpad mode disabled."
msgstr "Режим тачпаду вимкнено."
-#: backends/graphics/sdl/sdl-graphics.cpp:45
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:45
msgid "Normal (no scaling)"
msgstr "Без збільшення"
-#: backends/graphics/sdl/sdl-graphics.cpp:64
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:64
msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr "Без збільшення"
-#: backends/graphics/sdl/sdl-graphics.cpp:2137
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:517
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2137
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:521
#, fuzzy
msgid "Enabled aspect ratio correction"
msgstr "Корекція співвідношення сторін"
-#: backends/graphics/sdl/sdl-graphics.cpp:2143
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:522
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2143
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:526
#, fuzzy
msgid "Disabled aspect ratio correction"
msgstr "Корекція співвідношення сторін"
-#: backends/graphics/sdl/sdl-graphics.cpp:2198
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2198
#, fuzzy
msgid "Active graphics filter:"
msgstr "Переключення між графічними фільтрами"
-#: backends/graphics/sdl/sdl-graphics.cpp:2254
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:461
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2254
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:465
#, fuzzy
msgid "Windowed mode"
msgstr "Режим раструв.:"
@@ -2222,20 +2223,20 @@ msgstr "OpenGL збережений"
msgid "OpenGL Original"
msgstr "OpenGL оригінальний"
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:399
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:403
#, fuzzy
msgid "Current display mode"
msgstr "Поточний відеорежим:"
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:412
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:416
msgid "Current scale"
msgstr ""
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:542
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:546
msgid "Active filter mode: Linear"
msgstr ""
-#: backends/graphics/openglsdl/openglsdl-graphics.cpp:544
+#: backends/graphics/openglsdl/openglsdl-graphics.cpp:548
msgid "Active filter mode: Nearest"
msgstr ""
diff --git a/video/codecs/truemotion1.cpp b/video/codecs/truemotion1.cpp
index b8a3c0ab37..e475c8426c 100644
--- a/video/codecs/truemotion1.cpp
+++ b/video/codecs/truemotion1.cpp
@@ -112,7 +112,7 @@ TrueMotion1Decoder::~TrueMotion1Decoder() {
void TrueMotion1Decoder::selectDeltaTables(int deltaTableIndex) {
if (deltaTableIndex > 3)
return;
-
+
for (byte i = 0; i < 8; i++) {
_ydt[i] = ydts[deltaTableIndex][i];
_cdt[i] = cdts[deltaTableIndex][i];
diff --git a/video/codecs/truemotion1.h b/video/codecs/truemotion1.h
index 33fbedca93..628cfa4584 100644
--- a/video/codecs/truemotion1.h
+++ b/video/codecs/truemotion1.h
@@ -27,7 +27,7 @@
#ifndef VIDEO_CODECS_TRUEMOTION1_H
#define VIDEO_CODECS_TRUEMOTION1_H
-
+
#include "video/codecs/codec.h"
namespace Video {
@@ -51,7 +51,7 @@ private:
uint16 _width, _height;
int _flags;
-
+
struct PredictorTableEntry {
uint32 color;
bool getNextIndex;
diff --git a/video/qt_decoder.cpp b/video/qt_decoder.cpp
index 9575845cd3..f93f0d616e 100644
--- a/video/qt_decoder.cpp
+++ b/video/qt_decoder.cpp
@@ -134,7 +134,7 @@ uint32 QuickTimeDecoder::findKeyFrame(uint32 frame) const {
for (int i = _tracks[_videoTrackIndex]->keyframeCount - 1; i >= 0; i--)
if (_tracks[_videoTrackIndex]->keyframes[i] <= frame)
return _tracks[_videoTrackIndex]->keyframes[i];
-
+
// If none found, we'll assume the requested frame is a key frame
return frame;
}