├── asm ├── original │ ├── LICENSE │ ├── font.png │ ├── charset.png │ ├── sprites.png │ ├── font.png.clr │ ├── charset.png.chr │ ├── charset.png.clr │ ├── sprites.png.spr │ ├── font.png.chr │ ├── pyramids.asm │ └── rooms.asm ├── enhanced │ ├── font.png │ ├── charset.png │ ├── sprites.png │ ├── charset_0.png │ ├── font.png.chr │ ├── font.png.clr │ ├── sprites4d.png │ ├── charset.png.chr │ ├── charset.png.clr │ ├── sprites.png.spr │ ├── charset_0.png.chr │ ├── charset_0.png.clr │ ├── sprites4d.png.spr │ └── LICENSE ├── LICENSE ├── enhancedplus │ ├── init.bin │ ├── test.afb │ ├── init.bin.zx0 │ ├── sprites.png │ ├── charset.png.chr │ ├── charset.png.clr │ ├── charset_extra.png │ ├── charset_font.png │ ├── sfx │ │ ├── PW_Dead2.pt3 │ │ ├── PW_Dead2.pt3.hl │ │ ├── PW_NewGame.pt3 │ │ ├── PW_Sphinx_IN.pt3 │ │ ├── PW_level1_A.pt3 │ │ ├── PW_level1_B.pt3 │ │ ├── PW_level1_C.pt3 │ │ ├── PW_level2_A.pt3 │ │ ├── PW_level2_B.pt3 │ │ ├── PW_level2_C.pt3 │ │ ├── PW_level3_A.pt3 │ │ ├── PW_level3_B.pt3 │ │ ├── PW_level3_C.pt3 │ │ ├── PW_NewGame.pt3.hl │ │ ├── PW_Sphinx_IN2.pt3 │ │ ├── PW_Sphinx_OUT.pt3 │ │ ├── PW_level1_A.pt3.hl │ │ ├── PW_level1_B.pt3.hl │ │ ├── PW_level1_C.pt3.hl │ │ ├── PW_level2_A.pt3.hl │ │ ├── PW_level2_B.pt3.hl │ │ ├── PW_level2_C.pt3.hl │ │ ├── PW_level3_A.pt3.hl │ │ ├── PW_level3_B.pt3.hl │ │ ├── PW_level3_C.pt3.hl │ │ ├── PW_Dead2.pt3.hl.zx0 │ │ ├── PW_LevelFinished.pt3 │ │ ├── PW_NewGame.pt3.hl.zx0 │ │ ├── PW_Sphinx_IN.pt3.hl │ │ ├── PW_Sphinx_IN2.pt3.hl │ │ ├── PW_Sphinx_OUT.pt3.hl │ │ ├── PW_LevelFinished.pt3.hl │ │ ├── PW_Sphinx_IN.pt3.hl.zx0 │ │ ├── PW_level1_A.pt3.hl.zx0 │ │ ├── PW_level1_B.pt3.hl.zx0 │ │ ├── PW_level1_C.pt3.hl.zx0 │ │ ├── PW_level2_A.pt3.hl.zx0 │ │ ├── PW_level2_B.pt3.hl.zx0 │ │ ├── PW_level2_C.pt3.hl.zx0 │ │ ├── PW_level3_A.pt3.hl.zx0 │ │ ├── PW_level3_B.pt3.hl.zx0 │ │ ├── PW_level3_C.pt3.hl.zx0 │ │ ├── PW_Sphinx_IN2.pt3.hl.zx0 │ │ ├── PW_Sphinx_OUT.pt3.hl.zx0 │ │ ├── PW_LevelFinished.pt3.hl.zx0 │ │ ├── PW_level1_ONLY_FIRST_TIME.pt3 │ │ ├── PW_level1_ONLY_FIRST_TIME.pt3.hl │ │ ├── PW_level1_ONLY_FIRST_TIME.pt3.hl.zx0 │ │ ├── LICENSE │ │ └── headerless.asm │ ├── charset.png.chr.zx0 │ ├── charset.png.clr.zx0 │ ├── charset_font.png.chr │ ├── charset_font.png.clr │ ├── charset_ingame.png │ ├── screen_charset.png │ ├── sprites.png.spr.zx0 │ ├── charset_extra.png.chr │ ├── charset_extra.png.clr │ ├── charset_ingame.png.chr │ ├── charset_ingame.png.clr │ ├── mapper │ │ ├── tileset_map.png │ │ ├── pyramidwarpEXmapper.exe │ │ ├── LICENSE │ │ ├── rooms_original.asm │ │ └── rooms.asm │ ├── screen_ingame.tmx.bin.zx0 │ ├── screen_title.tmx.bin.zx0 │ ├── etc │ │ └── pyramidwarpEX_wall_desc.xlsx │ ├── LICENSE │ ├── pyramids.asm │ ├── init.asm │ ├── screen_title.tmx │ └── screen_ingame.tmx ├── libext │ ├── vt.bin │ ├── ayFX-RAM.tniasm.ASM │ ├── PT3-RAM.tniasm.ASM │ ├── dzx0_standard.asm │ ├── readme.txt │ ├── ayFX-ROM.tniasm.ASM │ └── PT3-ROM.tniasm.ASM └── symbols.asm ├── .gitignore ├── rom ├── PyramidWarp.yazd ├── PyramidWarp.enhanced.rom ├── PyramidWarp.enhancedplus.rom └── PyramidWarp.rom.md5 ├── bin ├── pcxtools.md ├── yazd.md └── tniasm.txt ├── reassemble.bat ├── disassemble.bat ├── .vscode ├── extensions.json ├── settings.json └── tasks.json ├── README.md └── makefile /asm/original/LICENSE: -------------------------------------------------------------------------------- 1 | Pyramid Warp (C) 1983 by T&E SOFT 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | tniasm.out 2 | tniasm.sym 3 | tniasm.tmp 4 | rom/PyramidWarp.original.rom 5 | -------------------------------------------------------------------------------- /rom/PyramidWarp.yazd: -------------------------------------------------------------------------------- 1 | --addr:0x8000 --entry:0x8010 --lowercase --xref --markwordrefs 2 | -------------------------------------------------------------------------------- /bin/pcxtools.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/bin/pcxtools.md -------------------------------------------------------------------------------- /asm/enhanced/font.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhanced/font.png -------------------------------------------------------------------------------- /asm/original/font.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/original/font.png -------------------------------------------------------------------------------- /asm/enhanced/charset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhanced/charset.png -------------------------------------------------------------------------------- /asm/enhanced/sprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhanced/sprites.png -------------------------------------------------------------------------------- /asm/original/charset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/original/charset.png -------------------------------------------------------------------------------- /asm/original/sprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/original/sprites.png -------------------------------------------------------------------------------- /asm/LICENSE: -------------------------------------------------------------------------------- 1 | Pyramid Warp Enhanced/Enhanced+ code © 2021 by Nenefranz & theNestruo is licensed under CC BY-NC-SA 4.0 -------------------------------------------------------------------------------- /asm/enhanced/charset_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhanced/charset_0.png -------------------------------------------------------------------------------- /asm/enhanced/font.png.chr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhanced/font.png.chr -------------------------------------------------------------------------------- /asm/enhanced/font.png.clr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhanced/font.png.clr -------------------------------------------------------------------------------- /asm/enhanced/sprites4d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhanced/sprites4d.png -------------------------------------------------------------------------------- /asm/enhancedplus/init.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/init.bin -------------------------------------------------------------------------------- /asm/enhancedplus/test.afb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/test.afb -------------------------------------------------------------------------------- /asm/original/font.png.clr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/original/font.png.clr -------------------------------------------------------------------------------- /asm/enhanced/charset.png.chr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhanced/charset.png.chr -------------------------------------------------------------------------------- /asm/enhanced/charset.png.clr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhanced/charset.png.clr -------------------------------------------------------------------------------- /asm/enhanced/sprites.png.spr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhanced/sprites.png.spr -------------------------------------------------------------------------------- /asm/enhancedplus/init.bin.zx0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/init.bin.zx0 -------------------------------------------------------------------------------- /asm/enhancedplus/sprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/sprites.png -------------------------------------------------------------------------------- /asm/original/charset.png.chr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/original/charset.png.chr -------------------------------------------------------------------------------- /asm/original/charset.png.clr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/original/charset.png.clr -------------------------------------------------------------------------------- /asm/original/sprites.png.spr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/original/sprites.png.spr -------------------------------------------------------------------------------- /rom/PyramidWarp.enhanced.rom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/rom/PyramidWarp.enhanced.rom -------------------------------------------------------------------------------- /asm/enhanced/charset_0.png.chr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhanced/charset_0.png.chr -------------------------------------------------------------------------------- /asm/enhanced/charset_0.png.clr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhanced/charset_0.png.clr -------------------------------------------------------------------------------- /asm/enhanced/sprites4d.png.spr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhanced/sprites4d.png.spr -------------------------------------------------------------------------------- /asm/enhancedplus/charset.png.chr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/charset.png.chr -------------------------------------------------------------------------------- /asm/enhancedplus/charset.png.clr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/charset.png.clr -------------------------------------------------------------------------------- /rom/PyramidWarp.enhancedplus.rom: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/rom/PyramidWarp.enhancedplus.rom -------------------------------------------------------------------------------- /asm/enhancedplus/charset_extra.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/charset_extra.png -------------------------------------------------------------------------------- /asm/enhancedplus/charset_font.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/charset_font.png -------------------------------------------------------------------------------- /asm/enhancedplus/sfx/PW_Dead2.pt3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/sfx/PW_Dead2.pt3 -------------------------------------------------------------------------------- /asm/enhancedplus/charset.png.chr.zx0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/charset.png.chr.zx0 -------------------------------------------------------------------------------- /asm/enhancedplus/charset.png.clr.zx0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/charset.png.clr.zx0 -------------------------------------------------------------------------------- /asm/enhancedplus/charset_font.png.chr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/charset_font.png.chr -------------------------------------------------------------------------------- /asm/enhancedplus/charset_font.png.clr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/charset_font.png.clr -------------------------------------------------------------------------------- /asm/enhancedplus/charset_ingame.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/charset_ingame.png -------------------------------------------------------------------------------- /asm/enhancedplus/screen_charset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/screen_charset.png -------------------------------------------------------------------------------- /asm/enhancedplus/sfx/PW_Dead2.pt3.hl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/sfx/PW_Dead2.pt3.hl -------------------------------------------------------------------------------- /asm/enhancedplus/sfx/PW_NewGame.pt3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/sfx/PW_NewGame.pt3 -------------------------------------------------------------------------------- /asm/enhancedplus/sfx/PW_Sphinx_IN.pt3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/sfx/PW_Sphinx_IN.pt3 -------------------------------------------------------------------------------- /asm/enhancedplus/sfx/PW_level1_A.pt3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/sfx/PW_level1_A.pt3 -------------------------------------------------------------------------------- /asm/enhancedplus/sfx/PW_level1_B.pt3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/sfx/PW_level1_B.pt3 -------------------------------------------------------------------------------- /asm/enhancedplus/sfx/PW_level1_C.pt3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/sfx/PW_level1_C.pt3 -------------------------------------------------------------------------------- /asm/enhancedplus/sfx/PW_level2_A.pt3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/sfx/PW_level2_A.pt3 -------------------------------------------------------------------------------- /asm/enhancedplus/sfx/PW_level2_B.pt3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/sfx/PW_level2_B.pt3 -------------------------------------------------------------------------------- /asm/enhancedplus/sfx/PW_level2_C.pt3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/sfx/PW_level2_C.pt3 -------------------------------------------------------------------------------- /asm/enhancedplus/sfx/PW_level3_A.pt3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/sfx/PW_level3_A.pt3 -------------------------------------------------------------------------------- /asm/enhancedplus/sfx/PW_level3_B.pt3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/sfx/PW_level3_B.pt3 -------------------------------------------------------------------------------- /asm/enhancedplus/sfx/PW_level3_C.pt3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/sfx/PW_level3_C.pt3 -------------------------------------------------------------------------------- /asm/enhancedplus/sprites.png.spr.zx0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/sprites.png.spr.zx0 -------------------------------------------------------------------------------- /rom/PyramidWarp.rom.md5: -------------------------------------------------------------------------------- 1 | MD5 hash of file Pyramid Warp (1983) (T&E Soft) (J).rom: 2 | 6b 9f 3f 0c 3a 6d 1d 6a bd 3d 4a 45 89 cc dd 1f 3 | -------------------------------------------------------------------------------- /asm/enhancedplus/charset_extra.png.chr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/charset_extra.png.chr -------------------------------------------------------------------------------- /asm/enhancedplus/charset_extra.png.clr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/charset_extra.png.clr -------------------------------------------------------------------------------- /asm/enhancedplus/charset_ingame.png.chr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/charset_ingame.png.chr -------------------------------------------------------------------------------- /asm/enhancedplus/charset_ingame.png.clr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/charset_ingame.png.clr -------------------------------------------------------------------------------- /asm/enhancedplus/mapper/tileset_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/mapper/tileset_map.png -------------------------------------------------------------------------------- /asm/enhancedplus/sfx/PW_NewGame.pt3.hl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/sfx/PW_NewGame.pt3.hl -------------------------------------------------------------------------------- /asm/enhancedplus/sfx/PW_Sphinx_IN2.pt3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/sfx/PW_Sphinx_IN2.pt3 -------------------------------------------------------------------------------- /asm/enhancedplus/sfx/PW_Sphinx_OUT.pt3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/sfx/PW_Sphinx_OUT.pt3 -------------------------------------------------------------------------------- /asm/enhancedplus/sfx/PW_level1_A.pt3.hl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/sfx/PW_level1_A.pt3.hl -------------------------------------------------------------------------------- /asm/enhancedplus/sfx/PW_level1_B.pt3.hl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/sfx/PW_level1_B.pt3.hl -------------------------------------------------------------------------------- /asm/enhancedplus/sfx/PW_level1_C.pt3.hl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/sfx/PW_level1_C.pt3.hl -------------------------------------------------------------------------------- /asm/enhancedplus/sfx/PW_level2_A.pt3.hl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/sfx/PW_level2_A.pt3.hl -------------------------------------------------------------------------------- /asm/enhancedplus/sfx/PW_level2_B.pt3.hl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/sfx/PW_level2_B.pt3.hl -------------------------------------------------------------------------------- /asm/enhancedplus/sfx/PW_level2_C.pt3.hl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/sfx/PW_level2_C.pt3.hl -------------------------------------------------------------------------------- /asm/enhancedplus/sfx/PW_level3_A.pt3.hl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/sfx/PW_level3_A.pt3.hl -------------------------------------------------------------------------------- /asm/enhancedplus/sfx/PW_level3_B.pt3.hl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/sfx/PW_level3_B.pt3.hl -------------------------------------------------------------------------------- /asm/enhancedplus/sfx/PW_level3_C.pt3.hl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/sfx/PW_level3_C.pt3.hl -------------------------------------------------------------------------------- /asm/enhancedplus/screen_ingame.tmx.bin.zx0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/screen_ingame.tmx.bin.zx0 -------------------------------------------------------------------------------- /asm/enhancedplus/screen_title.tmx.bin.zx0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/screen_title.tmx.bin.zx0 -------------------------------------------------------------------------------- /asm/enhancedplus/sfx/PW_Dead2.pt3.hl.zx0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/sfx/PW_Dead2.pt3.hl.zx0 -------------------------------------------------------------------------------- /asm/enhancedplus/sfx/PW_LevelFinished.pt3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/sfx/PW_LevelFinished.pt3 -------------------------------------------------------------------------------- /asm/enhancedplus/sfx/PW_NewGame.pt3.hl.zx0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/sfx/PW_NewGame.pt3.hl.zx0 -------------------------------------------------------------------------------- /asm/enhancedplus/sfx/PW_Sphinx_IN.pt3.hl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/sfx/PW_Sphinx_IN.pt3.hl -------------------------------------------------------------------------------- /asm/enhancedplus/sfx/PW_Sphinx_IN2.pt3.hl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/sfx/PW_Sphinx_IN2.pt3.hl -------------------------------------------------------------------------------- /asm/enhancedplus/sfx/PW_Sphinx_OUT.pt3.hl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/sfx/PW_Sphinx_OUT.pt3.hl -------------------------------------------------------------------------------- /asm/enhancedplus/sfx/PW_LevelFinished.pt3.hl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/sfx/PW_LevelFinished.pt3.hl -------------------------------------------------------------------------------- /asm/enhancedplus/sfx/PW_Sphinx_IN.pt3.hl.zx0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/sfx/PW_Sphinx_IN.pt3.hl.zx0 -------------------------------------------------------------------------------- /asm/enhancedplus/sfx/PW_level1_A.pt3.hl.zx0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/sfx/PW_level1_A.pt3.hl.zx0 -------------------------------------------------------------------------------- /asm/enhancedplus/sfx/PW_level1_B.pt3.hl.zx0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/sfx/PW_level1_B.pt3.hl.zx0 -------------------------------------------------------------------------------- /asm/enhancedplus/sfx/PW_level1_C.pt3.hl.zx0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/sfx/PW_level1_C.pt3.hl.zx0 -------------------------------------------------------------------------------- /asm/enhancedplus/sfx/PW_level2_A.pt3.hl.zx0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/sfx/PW_level2_A.pt3.hl.zx0 -------------------------------------------------------------------------------- /asm/enhancedplus/sfx/PW_level2_B.pt3.hl.zx0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/sfx/PW_level2_B.pt3.hl.zx0 -------------------------------------------------------------------------------- /asm/enhancedplus/sfx/PW_level2_C.pt3.hl.zx0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/sfx/PW_level2_C.pt3.hl.zx0 -------------------------------------------------------------------------------- /asm/enhancedplus/sfx/PW_level3_A.pt3.hl.zx0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/sfx/PW_level3_A.pt3.hl.zx0 -------------------------------------------------------------------------------- /asm/enhancedplus/sfx/PW_level3_B.pt3.hl.zx0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/sfx/PW_level3_B.pt3.hl.zx0 -------------------------------------------------------------------------------- /asm/enhancedplus/sfx/PW_level3_C.pt3.hl.zx0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/sfx/PW_level3_C.pt3.hl.zx0 -------------------------------------------------------------------------------- /asm/enhancedplus/mapper/pyramidwarpEXmapper.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/mapper/pyramidwarpEXmapper.exe -------------------------------------------------------------------------------- /asm/enhancedplus/sfx/PW_Sphinx_IN2.pt3.hl.zx0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/sfx/PW_Sphinx_IN2.pt3.hl.zx0 -------------------------------------------------------------------------------- /asm/enhancedplus/sfx/PW_Sphinx_OUT.pt3.hl.zx0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/sfx/PW_Sphinx_OUT.pt3.hl.zx0 -------------------------------------------------------------------------------- /asm/enhancedplus/etc/pyramidwarpEX_wall_desc.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/etc/pyramidwarpEX_wall_desc.xlsx -------------------------------------------------------------------------------- /asm/enhancedplus/sfx/PW_LevelFinished.pt3.hl.zx0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/sfx/PW_LevelFinished.pt3.hl.zx0 -------------------------------------------------------------------------------- /asm/enhancedplus/sfx/PW_level1_ONLY_FIRST_TIME.pt3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/sfx/PW_level1_ONLY_FIRST_TIME.pt3 -------------------------------------------------------------------------------- /asm/enhancedplus/sfx/PW_level1_ONLY_FIRST_TIME.pt3.hl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/sfx/PW_level1_ONLY_FIRST_TIME.pt3.hl -------------------------------------------------------------------------------- /asm/enhancedplus/sfx/PW_level1_ONLY_FIRST_TIME.pt3.hl.zx0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theNestruo/msx-pyramidwarpex/HEAD/asm/enhancedplus/sfx/PW_level1_ONLY_FIRST_TIME.pt3.hl.zx0 -------------------------------------------------------------------------------- /asm/enhanced/LICENSE: -------------------------------------------------------------------------------- 1 | Pyramid Warp Enhanced graphics © 2021 by Nenefranz is licensed under CC BY-NC-ND 4.0. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/ 2 | -------------------------------------------------------------------------------- /asm/enhancedplus/LICENSE: -------------------------------------------------------------------------------- 1 | Pyramid Warp Enhanced+ graphics © 2021 by Nenefranz is licensed under CC BY-NC-ND 4.0. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/ 2 | -------------------------------------------------------------------------------- /asm/enhancedplus/sfx/LICENSE: -------------------------------------------------------------------------------- 1 | Pyramid Warp Enhanced+ music © 2021 by Bitcaffe is licensed under CC BY-NC-ND 4.0. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/ -------------------------------------------------------------------------------- /asm/enhancedplus/mapper/LICENSE: -------------------------------------------------------------------------------- 1 | Pyramid Warp EX map editor © 2021 by Nenefranz is licensed under CC BY-NC-ND 4.0. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/ 2 | -------------------------------------------------------------------------------- /reassemble.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | REM 4 | REM Reassembles the annotated disassembly 5 | REM 6 | tniasm.exe "asm\PyramidWarp.annotated.asm" ".\annotated.rom" 7 | fc /b "rom\PyramidWarp.rom" ".\annotated.rom" 8 | del tniasm.sym tniasm.tmp 9 | -------------------------------------------------------------------------------- /asm/libext/vt.bin: -------------------------------------------------------------------------------- 1 |   2 |  3 | 4 |  5 | 6 |  7 | 8 |  9 |  10 |  -------------------------------------------------------------------------------- /asm/original/font.png.chr: -------------------------------------------------------------------------------- 1 | 8$B~BBB|""<""|"@@@"x$"""$x~@@x@@~~@@x@@@"@@N"BBB~BBBD8BDHpHDB@@@@@@~BfZZBBBBbRJFBBBBBBBB<BBB$$BBBZZfBBB$$BB"""~ @~0HH0JD:~  >@<| 2 | 3 | 4 | 5 | 6 | 7 | 8 | 43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43, 9 | 43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43, 10 | 43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43, 11 | 43,43,43,43,43,43,43,43,43,43,43,43,43,43,23,29,34,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43, 12 | 43,43,43,43,43,43,43,43,184,140,141,142,143,144,145,146,140,141,142,143,144,143,145,147,43,43,43,43,43,43,43,43, 13 | 43,43,43,43,43,43,43,43,185,150,166,167,168,169,170,171,172,173,174,169,168,166,155,156,43,43,43,43,43,43,43,43, 14 | 43,43,43,43,43,43,43,43,185,151,175,176,177,178,179,180,181,182,183,178,177,175,149,156,43,43,43,43,43,43,43,43, 15 | 43,43,43,43,43,43,43,43,186,158,159,160,161,162,163,164,158,159,160,161,162,163,164,165,43,43,43,43,43,43,43,43, 16 | 43,43,43,43,43,43,41,13,42,43,2,10,9,4,43,12,35,43,30,37,15,43,29,25,16,30,43,43,43,43,43,43, 17 | 43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43, 18 | 43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43, 19 | 43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43, 20 | 43,43,43,43,14,19,16,16,19,13,31,22,30,35,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43, 21 | 43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43, 22 | 43,43,43,43,43,23,19,28,28,25,28,19,24,17,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43, 23 | 43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43, 24 | 43,43,43,43,43,43,26,35,28,11,23,19,14,29,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43, 25 | 43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43, 26 | 43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43, 27 | 43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43, 28 | 43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43, 29 | 43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43, 30 | 43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43, 31 | 43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43,43 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /asm/enhancedplus/screen_ingame.tmx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,139,140,141,142,143,144,145,146,147, 9 | 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,148,166,167,168,169,170,171,172,156, 10 | 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,148,175,176,177,178,179,180,181,156, 11 | 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,148,150,149,173,174,169,168,166,156, 12 | 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,148,151,149,182,183,178,177,175,156, 13 | 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,157,158,159,160,161,162,163,164,165, 14 | 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,96,43,43,43,43,43,43,43,43, 15 | 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,96,43,18,19,17,18,43,43,43, 16 | 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,96,43,43,1,1,1,1,1,1, 17 | 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,96,43,43,43,43,43,43,43,43, 18 | 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,96,43,29,13,25,28,15,43,43, 19 | 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,96,43,43,1,1,1,1,1,1, 20 | 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,96,43,43,43,43,43,43,43,43, 21 | 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,96,43,11,19,28,43,43,43,43, 22 | 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,96,43,43,43,43,1,1,1,1, 23 | 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,96,43,43,43,43,43,43,43,43, 24 | 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,96,43,28,25,25,23,43,1,1, 25 | 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,139,140,141,142,188,144,145,189,190, 26 | 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,148,152,149,84,83,154,155,191,192, 27 | 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,148,153,84,84,84,84,154,149,156, 28 | 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,148,84,84,84,84,84,84,154,156, 29 | 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,187,84,84,84,84,84,84,84,156, 30 | 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,157,162,159,160,161,162,163,164,165, 31 | 95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,96,43,43,43,43,43,43,43,43 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # msx-pyramidwarpex 2 | 3 | Disassembly, reverse engineering, and possible enhancement of the MSX game cartridge "Pyramid Warp (1983)" 4 | 5 | 6 | ## Versions: 7 | 8 | * `PyramidWarp.annotated.asm`: 9 | * The annotated disassembly of Pyramid Warp (1983). 10 | * Assembles to the original ROM, verbatim. 11 | 12 | * `PyramidWarp.enhanced.asm`: 13 | * The original source code, once disassembled, was easy to understand and easy to improve because it used no compression, did no clever tricks, and underused some resources (e.g.: the game looked like SCREEN 1 despite being SCREEN2 already). 14 | * This is a patcheable version of the original source code that allows several of those enhancements. 15 | * This version keeps most of the original source code untouched and, actually, a pixel-perfect clone of the original game can be assembled from this! 16 | 17 | * `PyramidWarp.enhanced+.asm`: 18 | * This version break ties with the original source code wherever necessary to accomodate not-so-easy-to-fit enhancements (such as a proper music replayer or a sprite flickering routine) 19 | 20 | 21 | ## Enhancements 22 | 23 | ### Original enhancements by theNestruo 24 | 25 | * Moved RAM start from $C000 to $E000 (RAM requirement is now 8KB) 26 | * Unused data removed. Data realigned to simplify routines and to free space (+512 bytes freed) 27 | * Disabled keyboard click sound 28 | * Player starts looking down instead of up (simply because it looks better) 29 | * Numbers in scoreboard aligned right to improve readability 30 | * Patcheable colors (symbolic constants in assembly code) 31 | * Patcheable graphics (external binaries for font, charset and sprites) 32 | * Patcheable room definitions (external assembly code) 33 | * 5th and 6th enemy slots can be enabled 34 | 35 | ### Additional enhancements by Nenefranz 36 | 37 | * Completely new graphic set 38 | * Enemies can look in 4 directions 39 | * Enemies sprites can be replaced by player sprites 40 | * A floor tile can be used instead of transparent character 41 | * Numbers in scoreboard in a different color (to improve readability) 42 | * Fixes the first draw of the playground 43 | 44 | ### Additional enhancements 45 | 46 | * Sprite flickering routine 47 | * Proper title charset 48 | * Proper music and sounds! (by Bitcaffe) 49 | * More randomness! Rooms can be mirrored and flipped 50 | * More room definitions! (room editor by Nenefranz) 51 | * Difficulty option! Choose between: easier (3 enemies), original (4 enemies), enhanced (progressive and adaptative number of enemies), and harder (6 enemies). 52 | 53 | 54 | ## Credits 55 | 56 | ### Original game 57 | 58 | * **Pyramid Warp** © 1983 by T&E SOFT 59 | 60 | ### Enhanced versions 61 | 62 | Enhanced versions by Bitcaffe (music), Nenefranz (code & graphics), and theNestruo (code) 63 | 64 | * **Pyramid Warp Enhanced/Enhanced+ code** © 2021 by Nenefranz & theNestruo is licensed under [CC BY-NC-SA 4.0](http://creativecommons.org/licenses/by-nc-sa/4.0/) 65 | 66 | * **Pyramid Warp Enhanced/Enhanced+ graphics** © 2021 by Nenefranz is licensed under [CC BY-NC-ND 4.0](http://creativecommons.org/licenses/by-nc-nd/4.0/) 67 | 68 | * **Pyramid Warp Enhanced+ music** © 2021 by Bitcaffe is licensed under [CC BY-NC-ND 4.0](http://creativecommons.org/licenses/by-nc-nd/4.0/) 69 | 70 | * **Pyramid Warp EX map editor** © 2021 by Nenefranz is licensed under [CC BY-NC-ND 4.0](http://creativecommons.org/licenses/by-nc-nd/4.0/) 71 | 72 | ### External libraries 73 | 74 | * [ayFX Replayer v1.31](http://www.z80st.es/downloads/code/) by SapphiRe 75 | * [PT3 Replayer](http://www.z80st.es/downloads/code/) by Dioniso, MSX-KUN (ROM version), SapphiRe (asMSX version) 76 | * [ZX0](https://github.com/einar-saukas/ZX0) by Einar Saukas 77 | 78 | ### External tools 79 | 80 | * [PCXTOOLS v2.2](https://github.com/theNestruo/pcxtools) coded by theNestruo 81 | * [tniASM v0.45](http://tniasm.tni.nl/) is written by Patriek Lesparre, © 2000-2013 by The New Image 82 | * [Tiled](http://www.mapeditor.org/) © 2008-2020 Thorbjørn Lindeijer 83 | * [ZX0](https://github.com/einar-saukas/ZX0) by Einar Saukas -------------------------------------------------------------------------------- /asm/original/rooms.asm: -------------------------------------------------------------------------------- 1 | ; ----------------------------------------------------------------------------- 2 | ; 00 ; XXXXXXXXXXXXX 3 | DB 0D1h, 040h ; XBX^X___X_X_X 4 | DB 004h, 000h ; X_____X_____X 5 | DB 0B5h, 0A0h ; XX_XX_X_XX_XX 6 | DB 080h, 000h ; XX__________X 7 | DB 02Eh, 0C0h ; X__X_HHH_XX_X 8 | DB 060h, 080h ; X_XB_____X__X 9 | DB 06Eh, 0A0h ; X_XX_HHH_X_XX 10 | DB 000h, 020h ; X__________BX 11 | DB 075h, 0A0h ; X_XXX_X_XX_XX 12 | DB 040h, 080h ; X_X______X_NX 13 | DB 05Ah, 020h ; X_X_XXvX___XX 14 | ; XXXXXXXXXXXXX 15 | DB 00h, 00h ; box1 16 | DB 02h, 05h ; box2 17 | DB 0Ah, 07h ; box3 18 | DB 0Ah, 0Ah ; nest 19 | DB 82h, 00h ; door (^) 20 | DB 05h, 0Ah ; door (v) 21 | 22 | ; 01 23 | DB 0AEh, 0A0h ; walls 24 | DB 08h, 00h 25 | DB 0BAh, 0C0h 26 | DB 00h, 80h 27 | DB 0EEh, 0A0h 28 | DB 80h, 00h 29 | DB 0AEh, 0A0h 30 | DB 88h, 20h 31 | DB 0ABh, 0A0h 32 | DB 80h, 00h 33 | DB 0AEh, 0A0h 34 | DB 05h, 00h ; boxes 35 | DB 00h, 07h 36 | DB 0Ah, 07h 37 | DB 00h, 00h ; nest 38 | DB 01h, 0Ah ; doors 39 | DB 89h, 00h 40 | 41 | ; 02 42 | DB 0EEh, 0E0h ; walls 43 | DB 0AAh, 0A0h 44 | DB 00h, 00h 45 | DB 0AAh, 0A0h 46 | DB 0Eh, 00h 47 | DB 0A0h, 0A0h 48 | DB 0Eh, 00h 49 | DB 0AAh, 0A0h 50 | DB 80h, 20h 51 | DB 0EAh, 0E0h 52 | DB 0Ah, 00h 53 | DB 01h, 00h ; boxes 54 | DB 05h, 00h 55 | DB 09h, 00h 56 | DB 08h, 04h ; nest 57 | DB 05h, 0Ah ; doors 58 | DB 87h, 00h 59 | 60 | ; 03 61 | DB 6Ah, 0C0h ; walls 62 | DB 00h, 00h 63 | DB 0BBh, 0A0h 64 | DB 00h, 00h 65 | DB 6Eh , 0C0h 66 | DB 00h, 00h 67 | DB 6Eh , 0C0h 68 | DB 00h, 00h 69 | DB 0BBh, 0A0h 70 | DB 00h, 00h 71 | DB 6Ah , 0C0h 72 | DB 01h, 02h ; boxes 73 | DB 09h, 02h 74 | DB 09h, 08h 75 | DB 00h, 08h ; nest 76 | DB 85h, 00h ; doors 77 | DB 05h, 0Ah 78 | 79 | ; 04 80 | DB 8Bh, 40h ; walls 81 | DB 0A8h, 00h 82 | DB 0A2h, 0C0h 83 | DB 0Ah, 00h 84 | DB 0DEh, 0C0h 85 | DB 00h, 80h 86 | DB 5Eh , 20h 87 | DB 02h, 80h 88 | DB 6Bh , 0E0h 89 | DB 08h, 80h 90 | DB 62h , 20h 91 | DB 05h, 00h ; boxes 92 | DB 07h, 08h 93 | DB 0Ah, 08h 94 | DB 00h, 01h ; nest 95 | DB 00h, 0Ah ; doors 96 | DB 8Ah, 00h 97 | 98 | ; 05 99 | DB 85h, 00h ; walls 100 | DB 0DDh, 0C0h 101 | DB 84h, 00h 102 | DB 0B1h, 60h 103 | DB 1Eh, 00h 104 | DB 40h , 0C0h 105 | DB 0EEh, 0C0h 106 | DB 24h , 00h 107 | DB 0ADh, 60h 108 | DB 04h, 00h 109 | DB 0F1h, 0C0h 110 | DB 00h, 00h ; boxes 111 | DB 01h, 0Ah 112 | DB 08h, 0Ah 113 | DB 01h, 06h ; nest 114 | DB 0Ah, 0Ah ; doors 115 | DB 86h, 00h 116 | 117 | ; 06 118 | DB 0AAh, 0A0h ; walls 119 | DB 88h, 80h 120 | DB 0AAh, 0A0h 121 | DB 22h , 20h 122 | DB 0AEh, 80h 123 | DB 80h, 40h 124 | DB 0AEh, 80h 125 | DB 22h , 20h 126 | DB 0EBh, 0A0h 127 | DB 88h, 80h 128 | DB 0AAh, 0A0h 129 | DB 00h, 0Ah ; boxes 130 | DB 04h, 01h 131 | DB 07h, 08h 132 | DB 08h, 05h ; nest 133 | DB 81h, 00h ; doors 134 | DB 09h, 0Ah 135 | 136 | ; 07 137 | DB 0DEh, 0C0h ; walls 138 | DB 42h , 00h 139 | DB 58h , 0A0h 140 | DB 02h, 0A0h 141 | DB 5Eh , 00h 142 | DB 00h, 0C0h 143 | DB 5Fh , 0C0h 144 | DB 00h, 00h 145 | DB 0ADh, 40h 146 | DB 05h, 40h 147 | DB 0D4h, 60h 148 | DB 00h, 00h ; boxes 149 | DB 00h, 0Ah 150 | DB 09h, 09h 151 | DB 05h, 00h ; nest 152 | DB 8Ah, 00h ; doors 153 | DB 04h, 0Ah 154 | 155 | ; 08 156 | DB 0BBh, 0A0h ; walls 157 | DB 08h, 00h 158 | DB 63h , 0C0h 159 | DB 4Ah , 00h 160 | DB 7Eh , 0A0h 161 | DB 00h, 00h 162 | DB 0AEh, 0E0h 163 | DB 0EAh, 20h 164 | DB 8Ah, 0A0h 165 | DB 20h , 80h 166 | DB 0EAh, 0A0h 167 | DB 01h, 0Ah ; boxes 168 | DB 0Ah, 07h 169 | DB 07h, 00h 170 | DB 01h, 03h ; nest 171 | DB 85h, 00h ; doors 172 | DB 05h, 0Ah 173 | 174 | ; 09 175 | DB 74h, 60h ; walls 176 | DB 15h, 00h 177 | DB 0D5h, 0C0h 178 | DB 04h, 20h 179 | DB 7Fh , 60h 180 | DB 00h, 00h 181 | DB 0DFh, 60h 182 | DB 10h, 40h 183 | DB 7Bh , 0C0h 184 | DB 10h, 40h 185 | DB 0DFh, 00h 186 | DB 02h, 00h ; boxes 187 | DB 03h, 09h 188 | DB 0Ah, 00h 189 | DB 0Ah, 05h ; nest 190 | DB 0Ah, 02h ; doors 191 | DB 8Ah, 07h 192 | 193 | ; 0A 194 | DB 15h, 00h ; walls 195 | DB 44h , 40h 196 | DB 51h , 40h 197 | DB 44h , 40h 198 | DB 7Fh , 0C0h 199 | DB 00h, 00h 200 | DB 7Fh , 0C0h 201 | DB 51h , 0C0h 202 | DB 44h , 40h 203 | DB 51h , 40h 204 | DB 54h , 00h 205 | DB 01h, 02h ; boxes 206 | DB 01h, 09h 207 | DB 09h, 02h 208 | DB 05h, 03h ; nest 209 | DB 04h, 0Ah ; doors 210 | DB 84h, 00h 211 | 212 | ; 0B 213 | DB 2Ah , 80h ; walls 214 | DB 0A0h, 0C0h 215 | DB 2Ah , 80h 216 | DB 7Fh , 0A0h 217 | DB 1Fh, 00h 218 | DB 0C0h, 40h 219 | DB 1Fh, 00h 220 | DB 44h , 40h 221 | DB 6Fh , 00h 222 | DB 41h , 40h 223 | DB 14h, 00h 224 | DB 03h, 03h ; boxes 225 | DB 05h, 03h 226 | DB 07h, 03h 227 | DB 05h, 08h ; nest 228 | DB 85h, 00h ; doors 229 | DB 04h, 0Ah 230 | 231 | ; 0C 232 | DB 0E0h, 0E0h ; walls 233 | DB 8Ah, 20h 234 | DB 2Ah , 80h 235 | DB 64h , 0C0h 236 | DB 0Eh, 00h 237 | DB 0A0h, 0E0h 238 | DB 0Eh, 00h 239 | DB 64h , 0C0h 240 | DB 2Eh , 80h 241 | DB 8Ah, 20h 242 | DB 0E0h, 0E0h 243 | DB 01h, 00h ; boxes 244 | DB 01h, 0Ah 245 | DB 0Ah, 05h 246 | DB 05h, 07h ; nest 247 | DB 05h, 02h ; doors 248 | DB 85h, 09h 249 | 250 | ; 0D 251 | DB 50h , 0E0h ; walls 252 | DB 56h , 0C0h 253 | DB 06h, 00h 254 | DB 50h, 0A0h 255 | DB 1Eh, 20h 256 | DB 0E0h, 0A0h 257 | DB 8Eh, 00h 258 | DB 6Ch, 0C0h 259 | DB 0Ah, 00h 260 | DB 60h, 0A0h 261 | DB 0Eh, 0A0h 262 | DB 00h, 05h ; boxes 263 | DB 0Ah, 04h 264 | DB 05h, 0Ah 265 | DB 0Ah, 00h ; nest 266 | DB 80h, 00h ; doors 267 | DB 07h, 0Ah 268 | 269 | ; 0E 270 | DB 0FBh, 0E0h ; walls 271 | DB 0A0h, 80h 272 | DB 0AAh, 0A0h 273 | DB 8Ah, 20h 274 | DB 2Eh, 0A0h 275 | DB 60h, 80h 276 | DB 2Eh, 0C0h 277 | DB 8Ah, 00h 278 | DB 0A0h, 0A0h 279 | DB 2Dh, 80h 280 | DB 0A0h, 0A0h 281 | DB 01h, 00h ; box 282 | DB 02h, 05h 283 | DB 0Ah, 03h 284 | DB 00h, 0Ah ; nest 285 | DB 05h, 03h ; doors 286 | DB 85h, 07h 287 | 288 | ; 0F (sphynx room) 289 | DB 20h, 80h ; walls 290 | DB 20h, 80h 291 | DB 20h, 80h 292 | DB 20h, 80h 293 | DB 3Bh, 80h 294 | DB 0Ah, 00h 295 | DB 00h, 00h 296 | DB 55h, 40h 297 | DB 00h, 00h 298 | DB 00h, 00h 299 | DB 00h, 00h 300 | ; ----------------------------------------------------------------------------- 301 | 302 | ; EOF 303 | -------------------------------------------------------------------------------- /asm/libext/readme.txt: -------------------------------------------------------------------------------- 1 | ayFX replayer using asMSX syntax 2 | 3 | code: SapphiRe 4 | source: http://z80st.auic.es 5 | 6 | many thanks to AR for testing v1.0 and for suggestions about explicit priority 7 | and relative volume 8 | 9 | thanks to k0ga for their suggestions about using ayFX multisound banks 10 | instead of single ayFX samples 11 | 12 | thanks to Imanok for detecting bug on v1.3 13 | 14 | Version History 15 | --------------- 16 | 29-06-2013 v1.31 Fixed bug on previous version, only PSG channel C worked 17 | 22-03-2012 v1.3 Fixed volume and Relative volume versions on the same file, conditional compilation 18 | Support for dynamic or fixed channel allocation 19 | 12-02-2009 v1.2f/r The replayer uses ayFX multisound banks instead of ayFX samples. 20 | 22-01-2009 v1.11f/r Some routines relocated to compact the code. 21 | When ayFX volume is zero, ayFX values are not copied in to AYREGS. 22 | 19-01-2009 v1.1f All samples are played allways at maximum volume. 23 | v1.1r The priority controls also the relative volume of the sample. 24 | 17-01-2009 v1.1 Explicit priority (as suggested by AR). Internal release only. 25 | 15-01-2009 v1.0f Bugfix release (corrected a bug when using noise channel). 26 | 09-06-2008 v1.0 Initial release. 27 | 28 | 29 | What is it? 30 | ----------- 31 | This replayer allows to use ayFX samples on your MSX games. Also it interacts 32 | with your favourite music replayer (for instance PT3) and overwrites the PSG 33 | registers output generated by the music replayer, so you can write the correct 34 | values to PSG registers for music and FX at the same time. 35 | 36 | By default, the replayer plays all the frames of a sample on the same channel, 37 | but it also includes a switching channel routine that mixes the ayFX sample in 38 | a different PSG channel each frame. This way the music played is less affected 39 | by the FX samples. When the sample volume is zero no ayFX values are copied in 40 | to PSG registers. To activate the switching channel routine, the bit 0 of the 41 | ayFX_MODE variable must be 1. 42 | 43 | Also each sample can be played with a different priority (from 0 to 15). Higher 44 | values result in less priority. The playing of a sample can be interrupted if a 45 | new sample with higher priority is tried to be played. 46 | 47 | There are two different versions of the replayer: 48 | 49 | -Fixed volume version: all samples are played at their own volume (defined on 50 | the samples). To compile this version, define AYFXRELATIVE as 0. 51 | -Relative volume version: the priority also sets the relative volume of the 52 | sample. To compile this version, define AYFXRELATIVE as 1. 53 | 54 | 55 | How can I write ayFX samples? 56 | ----------------------------- 57 | You can use the ayFX editor made by shiru for Windows. Download it from: 58 | 59 | http://shiru.untergrund.net 60 | 61 | Since version 1.2, you must save the samples as a bank, using the "Save bank" 62 | or "Save bank w/o names" options to save a multisound bank. The only difference 63 | between these two options is that "Save bank" will also save the names of the 64 | samples. 65 | 66 | A bank can contain up to 256 ayFX samples. 67 | 68 | 69 | How to use (both fixed and relative volume versions) 70 | ---------------------------------------------------- 71 | 72 | There are three main routines on this player: setup a bank, init a sample and 73 | play a frame of a sample. 74 | 75 | -Bank setup: 76 | 77 | First of all, you need to call the ayFX_SETUP procedure to initialize the 78 | correct values of the replayer. When calling ayFX_SETUP you must set on hl the 79 | address of the sound bank you want to use. 80 | 81 | -Init a sample: 82 | 83 | When you want to play an ayFX sample, you need to put on register A (from 0 to 84 | 255) the index of the sample in the bank, and in register C the priority of the 85 | sample, and call to ayFX_INIT procedure. Legal sample priorities are from 0 86 | (highest priority) to 15 (lowest priority). Higher values may cause wrong 87 | results. 88 | 89 | The ayFX_INIT procedure returns a value on register A for debugging purposes: 90 | 91 | 0: no errors, the new sample has been correctly initialized 92 | 1: priority error, there's a sample with higher priority being played 93 | 2: index error, the current bank don't have a sample with such index 94 | 95 | -Play a frame of a sample: 96 | 97 | To play a frame of the stream, just call to ayFX_PLAY after a music replayer 98 | changed the ram copy of PSG registers (located under AYREGS label). If the ayFX 99 | frame produces no sound output, the aproppriate registers will remain unchanged. 100 | 101 | The suggested calling sequence is: 102 | 103 | HALT (vblank sinchronization) 104 | ... 105 | call PT3_ROUT (or a similar routine that copy AYREGS ram zone on PSG registers) 106 | ... 107 | call PT3_PLAY (or a similar routine that play a frame of the main music) 108 | ... 109 | call ayFX_PLAY 110 | ... 111 | 112 | 113 | Additional comments about relative volume version 114 | ------------------------------------------------- 115 | When using the relative volume version, the replayer uses priority as relative 116 | volume. So 0 (highest priority) results on relative volume 15 (highest volume) 117 | and 15 (lowest priority) results on relative volume 0 (silence). This comes from 118 | an idea of AR, which can be resumed in the following sentence: 119 | 120 | "Closer FX have to sound louder, 121 | and they must have a higher priority than far sounds" 122 | 123 | As the PSG volumes are not linear, the replayer uses the same volume table that 124 | PT3 replayer. So, if you use this ayFX replayer with the PT3 one, you don't need 125 | to explicitly put the table on your code, because the ayFX replayer looks for it 126 | on the same label (VT_) than PT3 replayer. 127 | 128 | If you're not using PT3 replayer, just uncomment the VT_ label at the end of the 129 | ayFX-ROM.asm file, and the volume table will be automatically loaded from vt.bin 130 | file. 131 | 132 | 133 | Contact 134 | ------- 135 | For any comments, bugs or suggestions, send an email to 136 | 137 | z80st.software@gmail.com 138 | -------------------------------------------------------------------------------- /makefile: -------------------------------------------------------------------------------- 1 | 2 | # 3 | # tools 4 | # 5 | 6 | ASM=tniasm 7 | EMULATOR=cmd /c start 8 | PNG2MSX=png2msx 9 | PNG2SPR=png2spr 10 | TMX2BIN=tmx2bin 11 | ZX0=zx0.exe 12 | 13 | # 14 | # commands 15 | # 16 | 17 | COPY=cmd /c copy 18 | MKDIR=cmd /c mkdir 19 | MOVE=cmd /c move 20 | REMOVE=cmd /c del 21 | RENAME=cmd /c ren 22 | 23 | # 24 | # paths and file lists 25 | # 26 | 27 | ORIGINAL_DATAS=\ 28 | asm\original\charset.png.chr \ 29 | asm\original\charset.png.clr \ 30 | asm\original\font.png.chr \ 31 | asm\original\font.png.clr \ 32 | asm\original\sprites.png.spr 33 | 34 | ENHANCED_DATAS=\ 35 | asm\enhanced\charset.png.chr \ 36 | asm\enhanced\charset.png.clr \ 37 | asm\enhanced\charset_0.png.chr \ 38 | asm\enhanced\charset_0.png.clr \ 39 | asm\enhanced\font.png.chr \ 40 | asm\enhanced\font.png.clr \ 41 | asm\enhanced\sprites.png.spr \ 42 | asm\enhanced\sprites4d.png.spr 43 | 44 | ENHANCEDPLUS_DATAS=\ 45 | asm\enhancedplus\charset.png.chr.zx0 \ 46 | asm\enhancedplus\charset.png.clr.zx0 \ 47 | asm\enhancedplus\sprites.png.spr.zx0 \ 48 | asm\enhancedplus\screen_title.tmx.bin.zx0 \ 49 | asm\enhancedplus\screen_ingame.tmx.bin.zx0 \ 50 | asm\enhancedplus\init.bin.zx0 \ 51 | asm\enhancedplus\sfx\PW_Dead2.pt3.hl.zx0 \ 52 | asm\enhancedplus\sfx\PW_level1_A.pt3.hl.zx0 \ 53 | asm\enhancedplus\sfx\PW_level1_B.pt3.hl.zx0 \ 54 | asm\enhancedplus\sfx\PW_level1_C.pt3.hl.zx0 \ 55 | asm\enhancedplus\sfx\PW_level1_ONLY_FIRST_TIME.pt3.hl.zx0 \ 56 | asm\enhancedplus\sfx\PW_level2_A.pt3.hl.zx0 \ 57 | asm\enhancedplus\sfx\PW_level2_B.pt3.hl.zx0 \ 58 | asm\enhancedplus\sfx\PW_level2_C.pt3.hl.zx0 \ 59 | asm\enhancedplus\sfx\PW_level3_A.pt3.hl.zx0 \ 60 | asm\enhancedplus\sfx\PW_level3_B.pt3.hl.zx0 \ 61 | asm\enhancedplus\sfx\PW_level3_C.pt3.hl.zx0 \ 62 | asm\enhancedplus\sfx\PW_LevelFinished.pt3.hl.zx0 \ 63 | asm\enhancedplus\sfx\PW_NewGame.pt3.hl.zx0 \ 64 | asm\enhancedplus\sfx\PW_Sphinx_IN.pt3.hl.zx0 \ 65 | asm\enhancedplus\sfx\PW_Sphinx_IN2.pt3.hl.zx0 \ 66 | asm\enhancedplus\sfx\PW_Sphinx_OUT.pt3.hl.zx0 67 | 68 | ENHANCEDPLUS_STATIC_DATAS=\ 69 | asm\enhancedplus\mapper\rooms_original.asm \ 70 | asm\enhancedplus\mapper\rooms.asm \ 71 | asm\enhancedplus\test.afb 72 | 73 | # 74 | # phony targets 75 | # 76 | 77 | # default target (just the enhancedplus version) 78 | default: rom\PyramidWarp.enhancedplus.rom 79 | 80 | clean: 81 | $(REMOVE) rom\PyramidWarp.enhancedplus.rom $(ENHANCEDPLUS_DATAS) 82 | $(REMOVE) $(SYMS) tniasm.sym tniasm.tmp 83 | 84 | cleanall: 85 | $(REMOVE) rom\PyramidWarp.original.rom 86 | $(REMOVE) rom\PyramidWarp.enhanced.rom $(ORIGINAL_DATAS) $(ENHANCED_DATAS) 87 | $(REMOVE) rom\PyramidWarp.enhancedplus.rom $(ENHANCEDPLUS_DATAS) 88 | $(REMOVE) $(SYMS) tniasm.sym tniasm.tmp 89 | 90 | compileall: rom\PyramidWarp.original.rom rom\PyramidWarp.enhanced.rom rom\PyramidWarp.enhancedplus.rom 91 | 92 | test: rom\PyramidWarp.enhancedplus.rom 93 | $(EMULATOR) $< 94 | 95 | # 96 | # main targets 97 | # 98 | 99 | rom\PyramidWarp.original.rom: asm\PyramidWarp.annotated.asm 100 | $(ASM) $< $@ 101 | cmd /c findstr /b /i "debug_" tniasm.sym | sort 102 | 103 | rom\PyramidWarp.enhanced.rom: asm\PyramidWarp.enhanced.asm $(ORIGINAL_DATAS) $(ENHANCED_DATAS) 104 | $(ASM) $< $@ 105 | cmd /c findstr /b /i "debug_" tniasm.sym | sort 106 | 107 | rom\PyramidWarp.enhancedplus.rom: asm\PyramidWarp.enhancedplus.asm asm\symbols.asm $(ENHANCEDPLUS_DATAS) $(ENHANCEDPLUS_STATIC_DATAS) 108 | $(ASM) $< $@ 109 | cmd /c findstr /b /i "debug_" tniasm.sym | sort 110 | 111 | asm\enhancedplus\init.bin: asm\enhancedplus\init.asm 112 | $(ASM) $< $@ 113 | 114 | asm\enhancedplus\sfx\PW_Dead2.pt3.hl \ 115 | asm\enhancedplus\sfx\PW_level1_A.pt3.hl \ 116 | asm\enhancedplus\sfx\PW_level1_B.pt3.hl \ 117 | asm\enhancedplus\sfx\PW_level1_C.pt3.hl \ 118 | asm\enhancedplus\sfx\PW_level1_ONLY_FIRST_TIME.pt3.hl \ 119 | asm\enhancedplus\sfx\PW_level2_A.pt3.hl \ 120 | asm\enhancedplus\sfx\PW_level2_B.pt3.hl \ 121 | asm\enhancedplus\sfx\PW_level2_C.pt3.hl \ 122 | asm\enhancedplus\sfx\PW_level3_A.pt3.hl \ 123 | asm\enhancedplus\sfx\PW_level3_B.pt3.hl \ 124 | asm\enhancedplus\sfx\PW_level3_C.pt3.hl \ 125 | asm\enhancedplus\sfx\PW_LevelFinished.pt3.hl \ 126 | asm\enhancedplus\sfx\PW_NewGame.pt3.hl \ 127 | asm\enhancedplus\sfx\PW_Sphinx_IN.pt3.hl \ 128 | asm\enhancedplus\sfx\PW_Sphinx_IN2.pt3.hl \ 129 | asm\enhancedplus\sfx\PW_Sphinx_OUT.pt3.hl: \ 130 | asm\enhancedplus\sfx\headerless.asm \ 131 | asm\enhancedplus\sfx\PW_Dead2.pt3 \ 132 | asm\enhancedplus\sfx\PW_level1_A.pt3 \ 133 | asm\enhancedplus\sfx\PW_level1_B.pt3 \ 134 | asm\enhancedplus\sfx\PW_level1_C.pt3 \ 135 | asm\enhancedplus\sfx\PW_level1_ONLY_FIRST_TIME.pt3 \ 136 | asm\enhancedplus\sfx\PW_level2_A.pt3 \ 137 | asm\enhancedplus\sfx\PW_level2_B.pt3 \ 138 | asm\enhancedplus\sfx\PW_level2_C.pt3 \ 139 | asm\enhancedplus\sfx\PW_level3_A.pt3 \ 140 | asm\enhancedplus\sfx\PW_level3_B.pt3 \ 141 | asm\enhancedplus\sfx\PW_level3_C.pt3 \ 142 | asm\enhancedplus\sfx\PW_LevelFinished.pt3 \ 143 | asm\enhancedplus\sfx\PW_NewGame.pt3 \ 144 | asm\enhancedplus\sfx\PW_Sphinx_IN.pt3 \ 145 | asm\enhancedplus\sfx\PW_Sphinx_IN2.pt3 \ 146 | asm\enhancedplus\sfx\PW_Sphinx_OUT.pt3 147 | $(ASM) $< 148 | 149 | # 150 | # GFXs targets 151 | # 152 | 153 | asm\enhancedplus\charset.png.chr: \ 154 | asm\enhancedplus\charset_font.png.chr \ 155 | asm\enhancedplus\charset_ingame.png.chr \ 156 | asm\enhancedplus\charset_extra.png.chr 157 | $(COPY) /b \ 158 | asm\enhancedplus\charset_font.png.chr \ 159 | + asm\enhancedplus\charset_ingame.png.chr \ 160 | + asm\enhancedplus\charset_extra.png.chr \ 161 | $@ 162 | 163 | asm\enhancedplus\charset.png.clr: \ 164 | asm\enhancedplus\charset_font.png.clr \ 165 | asm\enhancedplus\charset_ingame.png.clr \ 166 | asm\enhancedplus\charset_extra.png.clr 167 | $(COPY) /b \ 168 | asm\enhancedplus\charset_font.png.clr \ 169 | + asm\enhancedplus\charset_ingame.png.clr \ 170 | + asm\enhancedplus\charset_extra.png.clr \ 171 | $@ 172 | 173 | %.png.chr %.png.clr: %.png 174 | $(PNG2MSX) -hl $< 175 | 176 | %.png.spr: %.png 177 | $(PNG2SPR) $< 178 | 179 | %.tmx.bin: %.tmx 180 | $(TMX2BIN) $< $@ 181 | 182 | # 183 | # Packed targets 184 | # 185 | 186 | %.chr.zx0: %.chr 187 | $(REMOVE) $@ 188 | $(ZX0) $< 189 | 190 | %.clr.zx0: %.clr 191 | $(REMOVE) $@ 192 | $(ZX0) $< 193 | 194 | %.spr.zx0: %.spr 195 | $(REMOVE) $@ 196 | $(ZX0) $< 197 | 198 | %.hl.zx0: %.hl 199 | $(REMOVE) $@ 200 | $(ZX0) $< 201 | 202 | %.bin.zx0: %.bin 203 | $(REMOVE) $@ 204 | $(ZX0) $< 205 | -------------------------------------------------------------------------------- /bin/yazd.md: -------------------------------------------------------------------------------- 1 | # YAZD - Yet Another Z80 Disassembler 2 | 3 | YAZD is a simple command line disassembler for Z80 binary code files. It's based on the disassembler in [z80ex](http://z80ex.sourceforge.net/), ported to C#. 4 | 5 | YAZD supports the following: 6 | 7 | * Disassembly of all Z80 instructions, as supported by z80ex. 8 | * Code path analysis can usually tell the difference between code and data. 9 | * Generates labelled assembly language listings. 10 | * Can also generate more detailed listing files with byte code and assembly source. 11 | * Can detect procedure boundaries and generate call graphs 12 | * Can generate reference listings to all external addresses and I/O ports. 13 | * Can highlight all word literals (use to help find other memory address references). 14 | * Can generate plain text, or hyperlinked HTML output files. 15 | * Handles references to addresses not aligned with instruction (eg: self modifying code) 16 | * Data segments are listed 1 DB byte per line with ASCII character in comments. 17 | 18 | 19 | ## Download 20 | 21 | Download here: 22 | 23 | * 24 | 25 | Requires: 26 | 27 | * Windows and .NET 4.0 or later 28 | * Linux/OSX with Mono 2.8 or later (not tested, should work) 29 | 30 | ## Usage 31 | 32 | yazd source.bin [destination.asm] [options] [@responsefile] 33 | 34 | Options: 35 | 36 | --addr:N Z-80 base address of first byte after header, default=0x0000 37 | --start:N Z-80 address to disassemble from, default=addr 38 | --end:N Z-80 address to stop at, default=eof 39 | --len:N Number of bytes to disassemble (instead of --end) 40 | --entry:N Specifies an entry point (see below) 41 | --xref Include referenced locations of labels 42 | --lst Generate a listing file (more detail, can't be assembled) 43 | --html Generates a HTML file, with hyperlinked references 44 | --open Automatically opens the generated file with default associated app 45 | --lowercase|lc Render in lowercase 46 | --markwordrefs|mwr Highlight with a comment literal word values (as they may be addresses) 47 | --reloffs Show the offset of relative address mode instructions 48 | --header:N Skip N header bytes at start of file 49 | --help Show these help instruction 50 | --v Show version information 51 | 52 | Numeric arguments can be in decimal (no prefix) or hex if prefixed with '0x'. 53 | 54 | If one or more `--entry` arguments are specified (recommended), the file is disassembled by 55 | following the code paths from those entry points. All unvisited regions will be rendered 56 | as 'DB' directives. 57 | 58 | If the `--entry` argument is not specified, the file is disassembled from top to bottom. 59 | 60 | Output is sent to stdout if no destination file specified. 61 | 62 | Response file containing arguments can be specified using the @ prefix 63 | 64 | Example: 65 | 66 | yazd --addr:0x0400 --entry:0x1983 -lst robotf.bin robotf.lst 67 | 68 | ## Example Output 69 | 70 | Typical source mode output. Note that YAZD is normally smart enough to tell the 71 | difference between local labels and procedure boundaries. This helps divide up 72 | the listing making it easier to understand. 73 | 74 | ORG 0900h 75 | 76 | ; Entry Point 77 | ; --- START PROC L0900 --- 78 | L0900: LD A,0Ah 79 | OUT (0Ch),A 80 | LD A,2Fh ; '/' 81 | OUT (0Dh),A 82 | LD HL,0F800h 83 | LD C,80h 84 | L090D: LD E,C 85 | LD D,03h 86 | L0910: XOR A 87 | BIT 0,E 88 | JR Z,L0917 89 | OR 0F0h 90 | L0917: BIT 1,E 91 | JR Z,L091D 92 | OR 0Fh 93 | L091D: LD B,05h 94 | LD (HL),A 95 | INC HL 96 | DJNZ L091F 97 | RRC E 98 | RRC E 99 | DEC D 100 | JR NZ,L0910 101 | LD (HL),A 102 | INC HL 103 | INC C 104 | JR NZ,L090D 105 | JP L1042 106 | 107 | ; --- START PROC L0932 --- 108 | L0932: PUSH BC 109 | LD C,A 110 | LD B,A 111 | LD A,12h 112 | OUT (0Ch),A 113 | LD A,B 114 | RRCA 115 | RRCA 116 | RRCA 117 | RRCA 118 | 119 | Unreachable addresses are automatically detected and rendered as DB directives when the `--entry` argument 120 | is used. If something is incorrectly detected as data instead of code, just add an extra `--entry` parameter; 121 | 122 | L0A46: DEC HL 123 | CALL L0FB2 124 | DEC A 125 | AND 03h 126 | DJNZ L0A3D 127 | RET 128 | 129 | L0A50: DB 00h 130 | 131 | ; --- START PROC L0A51 --- 132 | L0A51: LD A,(L0A5F) 133 | OR A 134 | 135 | The `--xref` option, causes the referencing locations of any label to also be included: 136 | 137 | 138 | ; Referenced from 09BEh 139 | L09C4: LD (HL),8Ch 140 | JR L09CE 141 | 142 | ; Referenced from 09BAh 143 | L09C8: LD (HL),0B0h 144 | JR L09CE 145 | 146 | ; Referenced from 09B6h 147 | L09CC: LD (HL),80h 148 | 149 | ; Referenced from 09C2h, 09CAh, 09C6h 150 | L09CE: INC A 151 | CALL L0FB2 152 | AND 03h 153 | ADD HL,DE 154 | DJNZ L09B5 155 | LD A,(L0A50) 156 | LD B,40h ; '@' 157 | CP 03h 158 | 159 | If an instruction references a memory address that not aligned with the start of an instruction, its 160 | disassembly is updated to use the instruction's label with an offset. This usually occurs with self 161 | modifying code and helps to produce a listing that can be directly re-assembled. 162 | 163 | LD (L0BED+1),A ; reference not aligned to instruction 164 | L0BED: SET 3,(HL) 165 | 166 | 167 | In listing mode (`--lst`), the address and byte code is included on the left: 168 | 169 | ; Entry Point 170 | ; --- START PROC L0900 --- 171 | 0900: 3E 0A L0900: LD A,0Ah 172 | 0902: D3 0C OUT (0Ch),A 173 | 0904: 3E 2F LD A,2Fh ; '/' 174 | 0906: D3 0D OUT (0Dh),A 175 | 0908: 21 00 F8 LD HL,0F800h 176 | 090B: 0E 80 LD C,80h 177 | 090D: 59 L090D: LD E,C 178 | 090E: 16 03 LD D,03h 179 | 0910: AF L0910: XOR A 180 | 181 | Listing mode also causes the generation of reference information, including references to external memory addresses: 182 | 183 | references to external address 8009: 184 | 0F18 CALL 8009h 185 | 0F43 CALL 8009h 186 | 0F66 CALL 8009h 187 | 21E7 CALL 8009h 188 | 236E CALL 8009h 189 | 2373 CALL 8009h 190 | 191 | references to external address F0E2: 192 | 2354 LD (0F0E2h),A 193 | 194 | Possible address references are also listed. This includes any instruction that uses a literal word value. 195 | 196 | possible references to internal address 0900: 197 | 200E LD BC,0900h 198 | 201E LD BC,0900h 199 | 2037 LD BC,0900h 200 | 204F LD BC,0900h 201 | 202 | possible references to internal address 0A5F: 203 | 0A60 LD HL,0A5Fh 204 | ---------- 205 | 0A51 LD A,(L0A5F) 206 | 105B LD A,(L0A5F) 207 | 208 | *(Note the instructions after the dashed separator are references to the same literal value, but instances where it's known to be an address.)* 209 | 210 | Possible references to external addresses are listed separately since they're less likely to need patching to make a source file for assembly: 211 | 212 | possible references to external address CC00: 213 | 0DCF LD BC,0CC00h 214 | 215 | possible references to external address F000: 216 | 096F LD HL,0F000h 217 | 0A8D LD HL,0F000h 218 | 0AA2 LD DE,0F000h 219 | 0BDD LD DE,0F000h 220 | 0C9C LD HL,0F000h 221 | 0E17 LD DE,0F000h 222 | 1485 LD HL,0F000h 223 | 224 | Port references are also listed: 225 | 226 | references to port 02h 227 | 0C83 IN A,(02h) 228 | 0C95 IN A,(02h) 229 | 0FCA IN A,(02h) 230 | 0FDA IN A,(02h) 231 | 0C87 OUT (02h),A 232 | 0C99 OUT (02h),A 233 | 0FCE OUT (02h),A 234 | 0FDE OUT (02h),A 235 | 236 | references to port 0Bh 237 | 094F OUT (0Bh),A 238 | 096A OUT (0Bh),A 239 | 240 | The listing file also includes a few metrics on all the located procedures: 241 | 242 | Procedures (96): 243 | Proc Length References Dependants 244 | L0900 0032 0 1 245 | L0932 003D 5 0 246 | L096F 0032 2 0 247 | L09A1 00AF 6 1 248 | L0A51 000E 6 3 249 | L0A60 000E 1 0 250 | 251 | and a call graph. Entry points, external routines and recursive routines are highighted: 252 | 253 | Call Graph: 254 | L0900 - Entry Point 255 | L1042 256 | L0BF0 257 | L0A6E 258 | 8009h - External 259 | L0A51 260 | L0AB4 261 | L102E 262 | L1000 263 | L0A51 - Recusive 264 | L0FB2 265 | L0B93 266 | -------------------------------------------------------------------------------- /asm/libext/ayFX-ROM.tniasm.ASM: -------------------------------------------------------------------------------- 1 | ; --- ayFX REPLAYER v1.31 --- 2 | 3 | CFG_REPLAYER_AYFX: equ 1 4 | 5 | ; --- v1.31 Fixed bug on previous version, only PSG channel C worked 6 | ; --- v1.3 Fixed volume and Relative volume versions on the same file, conditional compilation 7 | ; --- Support for dynamic or fixed channel allocation 8 | ; --- v1.2f/r ayFX bank support 9 | ; --- v1.11f/r If a frame volume is zero then no AYREGS update 10 | ; --- v1.1f/r Fixed volume for all ayFX streams 11 | ; --- v1.1 Explicit priority (as suggested by AR) 12 | ; --- v1.0f Bug fixed (error when using noise) 13 | ; --- v1.0 Initial release 14 | 15 | ayFX_SETUP: ; --- ayFX replayer setup --- 16 | ; --- INPUT: HL -> pointer to the ayFX bank --- 17 | ld [ayFX_BANK],hl ; Current ayFX bank 18 | xor a ; a:=0 19 | ld [ayFX_MODE],a ; Initial mode: fixed channel 20 | inc a ; Starting channel (=1) 21 | ld [ayFX_CHANNEL],a ; Updated 22 | ayFX_END: ; --- End of an ayFX stream --- 23 | ld a,255 ; Lowest ayFX priority 24 | ld [ayFX_PRIORITY],a ; Priority saved (not playing ayFX stream) 25 | ret ; Return 26 | 27 | ayFX_INIT: ; --- INIT A NEW ayFX STREAM --- 28 | ; --- INPUT: A -> sound to be played --- 29 | ; --- C -> sound priority --- 30 | push bc ; Store bc in stack 31 | push de ; Store de in stack 32 | push hl ; Store hl in stack 33 | ; --- Check if the index is in the bank --- 34 | ld b,a ; b:=a (new ayFX stream index) 35 | ld hl,[ayFX_BANK] ; Current ayFX BANK 36 | ld a,[hl] ; Number of samples in the bank 37 | or a ; If zero (means 256 samples)... 38 | jr z,@@CHECK_PRI ; ...goto @@CHECK_PRI 39 | ; The bank has less than 256 samples 40 | ld a,b ; a:=b (new ayFX stream index) 41 | cp [hl] ; If new index is not in the bank... 42 | ld a,2 ; a:=2 (error 2: Sample not in the bank) 43 | jr nc,@@INIT_END ; ...we can't init it 44 | @@CHECK_PRI: ; --- Check if the new priority is lower than the current one --- 45 | ; --- Remember: 0 = highest priority, 15 = lowest priority --- 46 | ; ld a,b ; a:=b (new ayFX stream index) ; (unnecessary? removed) 47 | ld a,[ayFX_PRIORITY] ; a:=Current ayFX stream priority 48 | cp c ; If new ayFX stream priority is lower than current one... 49 | ld a,1 ; a:=1 (error 1: A sample with higher priority is being played) 50 | jr c,@@INIT_END ; ...we don't start the new ayFX stream 51 | ; --- Set new priority --- 52 | ld a,c ; a:=New priority 53 | and $0F ; We mask the priority 54 | ld [ayFX_PRIORITY],a ; new ayFX stream priority saved in RAM 55 | 56 | IFDEF CFG_AYFX_RELATIVE 57 | ; --- Volume adjust using PT3 volume table --- 58 | ld c,a ; c:=New priority (fixed) 59 | ld a,15 ; a:=15 60 | sub c ; a:=15-New priority = relative volume 61 | jr z,@@INIT_NOSOUND ; If priority is 15 -> no sound output (volume is zero) 62 | add a,a ; a:=a*2 63 | add a,a ; a:=a*4 64 | add a,a ; a:=a*8 65 | add a,a ; a:=a*16 66 | ld e,a ; e:=a 67 | ld d,0 ; de:=a 68 | ld hl,VT_ ; hl:=PT3 volume table 69 | add hl,de ; hl is a pointer to the relative volume table 70 | ld [ayFX_VT],hl ; Save pointer 71 | ENDIF ; IFDEF CFG_AYFX_RELATIVE 72 | 73 | ; --- Calculate the pointer to the new ayFX stream --- 74 | ld de,[ayFX_BANK] ; de:=Current ayFX bank 75 | inc de ; de points to the increments table of the bank 76 | ld l,b ; l:=b (new ayFX stream index) 77 | ld h,0 ; hl:=b (new ayFX stream index) 78 | add hl,hl ; hl:=hl*2 79 | add hl,de ; hl:=hl+de (hl points to the correct increment) 80 | ld e,[hl] ; e:=lower byte of the increment 81 | inc hl ; hl points to the higher byte of the correct increment 82 | ld d,[hl] ; de:=increment 83 | add hl,de ; hl:=hl+de (hl points to the new ayFX stream) 84 | ld [ayFX_POINTER],hl ; Pointer saved in RAM 85 | xor a ; a:=0 (no errors) 86 | @@INIT_END: pop hl ; Retrieve hl from stack 87 | pop de ; Retrieve de from stack 88 | pop bc ; Retrieve bc from stack 89 | ret ; Return 90 | 91 | IFDEF CFG_AYFX_RELATIVE 92 | @@INIT_NOSOUND: ; --- Init a sample with relative volume zero -> no sound output --- 93 | ld a,255 ; Lowest ayFX priority 94 | ld [ayFX_PRIORITY],a ; Priority saved (not playing ayFX stream) 95 | jr @@INIT_END ; Jumps to @@INIT_END 96 | ENDIF ; IFDEF CFG_AYFX_RELATIVE 97 | 98 | ayFX_PLAY: ; --- PLAY A FRAME OF AN ayFX STREAM --- 99 | ld a,[ayFX_PRIORITY] ; a:=Current ayFX stream priority 100 | or a ; If priority has bit 7 on... 101 | ret m ; ...return 102 | ; --- Calculate next ayFX channel (if needed) --- 103 | ld a,[ayFX_MODE] ; ayFX mode 104 | and 1 ; If bit0=0 (fixed channel)... 105 | jr z,@@TAKECB ; ...skip channel changing 106 | ld hl,ayFX_CHANNEL ; Old ayFX playing channel 107 | dec [hl] ; New ayFX playing channel 108 | jr nz,@@TAKECB ; If not zero jump to @@TAKECB 109 | ld [hl],3 ; If zero -> set channel 3 110 | @@TAKECB: ; --- Extract control byte from stream --- 111 | ld hl,[ayFX_POINTER] ; Pointer to the current ayFX stream 112 | ld c,[hl] ; c:=Control byte 113 | inc hl ; Increment pointer 114 | ; --- Check if there's new tone on stream --- 115 | bit 5,c ; If bit 5 c is off... 116 | jr z,@@CHECK_NN ; ...jump to @@CHECK_NN (no new tone) 117 | ; --- Extract new tone from stream --- 118 | ld e,[hl] ; e:=lower byte of new tone 119 | inc hl ; Increment pointer 120 | ld d,[hl] ; d:=higher byte of new tone 121 | inc hl ; Increment pointer 122 | ld [ayFX_TONE],de ; ayFX tone updated 123 | @@CHECK_NN: ; --- Check if there's new noise on stream --- 124 | bit 6,c ; if bit 6 c is off... 125 | jr z,@@SETPOINTER ; ...jump to @@SETPOINTER (no new noise) 126 | ; --- Extract new noise from stream --- 127 | ld a,[hl] ; a:=New noise 128 | inc hl ; Increment pointer 129 | cp $20 ; If it's an illegal value of noise (used to mark end of stream)... 130 | jr z,ayFX_END ; ...jump to ayFX_END 131 | ld [ayFX_NOISE],a ; ayFX noise updated 132 | @@SETPOINTER: ; --- Update ayFX pointer --- 133 | ld [ayFX_POINTER],hl ; Update ayFX stream pointer 134 | ; --- Extract volume --- 135 | ld a,c ; a:=Control byte 136 | and $0F ; lower nibble 137 | 138 | IFDEF CFG_AYFX_RELATIVE 139 | ; --- Fix the volume using PT3 Volume Table --- 140 | ld hl,[ayFX_VT] ; hl:=Pointer to relative volume table 141 | ld e,a ; e:=a (ayFX volume) 142 | ld d,0 ; d:=0 143 | add hl,de ; hl:=hl+de (hl points to the relative volume of this frame 144 | ld a,[hl] ; a:=ayFX relative volume 145 | or a ; If relative volume is zero... 146 | ENDIF ; IFDEF CFG_AYFX_RELATIVE 147 | 148 | ld [ayFX_VOLUME],a ; ayFX volume updated 149 | ret z ; ...return (don't copy ayFX values in to AYREGS) 150 | ; ------------------------------------- 151 | ; --- COPY ayFX VALUES IN TO AYREGS --- 152 | ; ------------------------------------- 153 | ; --- Set noise channel --- 154 | bit 7,c ; If noise is off... 155 | jr nz,@@SETMASKS ; ...jump to @@SETMASKS 156 | ld a,[ayFX_NOISE] ; ayFX noise value 157 | ld [AYREGS+6],a ; copied in to AYREGS (noise channel) 158 | @@SETMASKS: ; --- Set mixer masks --- 159 | ld a,c ; a:=Control byte 160 | and $90 ; Only bits 7 and 4 (noise and tone mask for psg reg 7) 161 | cp $90 ; If no noise and no tone... 162 | ret z ; ...return (don't copy ayFX values in to AYREGS) 163 | ; --- Copy ayFX values in to ARYREGS --- 164 | rrca ; Rotate a to the right (1 TIME) 165 | rrca ; Rotate a to the right (2 TIMES) (OR mask) 166 | ld d,$DB ; d:=Mask for psg mixer (AND mask) 167 | ; --- Dump to correct channel --- 168 | ld hl,ayFX_CHANNEL ; Next ayFX playing channel 169 | ld b,[hl] ; Channel counter 170 | @@CHK1: ; --- Check if playing channel was 1 --- 171 | djnz @@CHK2 ; Decrement and jump if channel was not 1 172 | @@PLAY_C: ; --- Play ayFX stream on channel C --- 173 | call @@SETMIXER ; Set PSG mixer value (returning a=ayFX volume and hl=ayFX tone) 174 | ld [AYREGS+10],a ; Volume copied in to AYREGS (channel C volume) 175 | bit 2,c ; If tone is off... 176 | ret nz ; ...return 177 | ld [AYREGS+4],hl ; copied in to AYREGS (channel C tone) 178 | ret ; Return 179 | @@CHK2: ; --- Check if playing channel was 2 --- 180 | rrc d ; Rotate right AND mask 181 | rrca ; Rotate right OR mask 182 | djnz @@CHK3 ; Decrement and jump if channel was not 2 183 | @@PLAY_B: ; --- Play ayFX stream on channel B --- 184 | call @@SETMIXER ; Set PSG mixer value (returning a=ayFX volume and hl=ayFX tone) 185 | ld [AYREGS+9],a ; Volume copied in to AYREGS (channel B volume) 186 | bit 1,c ; If tone is off... 187 | ret nz ; ...return 188 | ld [AYREGS+2],hl ; copied in to AYREGS (channel B tone) 189 | ret ; Return 190 | @@CHK3: ; --- Check if playing channel was 3 --- 191 | rrc d ; Rotate right AND mask 192 | rrca ; Rotate right OR mask 193 | @@PLAY_A: ; --- Play ayFX stream on channel A --- 194 | call @@SETMIXER ; Set PSG mixer value (returning a=ayFX volume and hl=ayFX tone) 195 | ld [AYREGS+8],a ; Volume copied in to AYREGS (channel A volume) 196 | bit 0,c ; If tone is off... 197 | ret nz ; ...return 198 | ld [AYREGS+0],hl ; copied in to AYREGS (channel A tone) 199 | ret ; Return 200 | @@SETMIXER: ; --- Set PSG mixer value --- 201 | ld c,a ; c:=OR mask 202 | ld a,[AYREGS+7] ; a:=PSG mixer value 203 | and d ; AND mask 204 | or c ; OR mask 205 | ld [AYREGS+7],a ; PSG mixer value updated 206 | ld a,[ayFX_VOLUME] ; a:=ayFX volume value 207 | ld hl,[ayFX_TONE] ; ayFX tone value 208 | ret ; Return 209 | 210 | IFDEF CFG_AYFX_RELATIVE 211 | ; --- UNCOMMENT THIS IF YOU DON'T USE THIS REPLAYER WITH PT3 REPLAYER --- 212 | ;VT_: .INCBIN "VT.BIN" 213 | ; --- UNCOMMENT THIS IF YOU DON'T USE THIS REPLAYER WITH PT3 REPLAYER --- 214 | ENDIF ; IFDEF CFG_AYFX_RELATIVE 215 | -------------------------------------------------------------------------------- /asm/enhancedplus/mapper/rooms_original.asm: -------------------------------------------------------------------------------- 1 | ; ------------------------------ 2 | ; room 00 3 | ; walls ; XXXXXXXXXXXXX 4 | DB 051h, 040h ; XBX^X___X_X_X 5 | DB 004h, 000h ; X_____X_____X 6 | DB 0B5h, 0A0h ; XX_XX_X_XX_XX 7 | DB 080h, 000h ; XX__________X 8 | DB 02Eh, 0C0h ; X__X_HHH_XX_X 9 | DB 040h, 080h ; X_XB_____X__X 10 | DB 06Eh, 0A0h ; X_XX_HHH_X_XX 11 | DB 000h, 000h ; X__________BX 12 | DB 075h, 0A0h ; X_XXX_X_XX_XX 13 | DB 040h, 080h ; X_X______X__X 14 | DB 05Ah, 000h ; X_X_XXvX___NX 15 | ; objects ; XXXXXXXXXXXXX 16 | DB 000h, 000h ; box1 17 | DB 002h, 005h ; box2 18 | DB 00Ah, 007h ; box3 19 | DB 00Ah, 00Ah ; nest 20 | DB 082h, 000h ; door (^) 21 | DB 005h, 00Ah ; door (v) 22 | ; ------------------------------ 23 | 24 | ; ------------------------------ 25 | ; room 01 26 | ; walls ; XXXXXXXXXXXXX 27 | DB 02Ah, 0A0h ; XN_X_XBX_X^XX 28 | DB 008h, 000h ; X____X______X 29 | DB 0BAh, 0C0h ; XX_XXX_X_XX_X 30 | DB 000h, 080h ; X________X__X 31 | DB 0EEh, 0A0h ; XXXX_HHH_X_XX 32 | DB 080h, 000h ; XX__________X 33 | DB 0AEh, 0A0h ; XX_X_HHH_X_XX 34 | DB 008h, 000h ; XB___X_____BX 35 | DB 0ABh, 0A0h ; XX_X_X_XXX_XX 36 | DB 080h, 000h ; XX__________X 37 | DB 0AEh, 0A0h ; XXvX_XXX_X_XX 38 | ; objects ; XXXXXXXXXXXXX 39 | DB 005h, 000h ; box1 40 | DB 000h, 007h ; box2 41 | DB 00Ah, 007h ; box3 42 | DB 000h, 000h ; nest 43 | DB 089h, 000h ; door (^) 44 | DB 001h, 00Ah ; door (v) 45 | ; ------------------------------ 46 | 47 | ; ------------------------------ 48 | ; room 02 49 | ; walls ; XXXXXXXXXXXXX 50 | DB 0AAh, 0A0h ; XXBX_XBX^XBXX 51 | DB 0AAh, 0A0h ; XX_X_X_X_X_XX 52 | DB 000h, 000h ; X___________X 53 | DB 0AAh, 0A0h ; XX_X_X_X_X_XX 54 | DB 00Eh, 000h ; X____HHH_N__X 55 | DB 0A0h, 0A0h ; XX_X_____X_XX 56 | DB 00Eh, 000h ; X____HHH____X 57 | DB 0AAh, 0A0h ; XX_X_X_X_X_XX 58 | DB 080h, 020h ; XX_________XX 59 | DB 0EAh, 0E0h ; XXXX_X_X_XXXX 60 | DB 00Ah, 000h ; X____XvX____X 61 | ; objects ; XXXXXXXXXXXXX 62 | DB 001h, 000h ; box1 63 | DB 005h, 000h ; box2 64 | DB 009h, 000h ; box3 65 | DB 008h, 004h ; nest 66 | DB 087h, 000h ; door (^) 67 | DB 005h, 00Ah ; door (v) 68 | ; ------------------------------ 69 | 70 | ; ------------------------------ 71 | ; room 03 72 | ; walls ; XXXXXXXXXXXXX 73 | DB 06Ah, 0C0h ; X_XX_X^X_XX_X 74 | DB 000h, 000h ; X___________X 75 | DB 0BBh, 0A0h ; XXBXXX_XXXBXX 76 | DB 000h, 000h ; X___________X 77 | DB 06Eh, 0C0h ; X_XX_HHH_XX_X 78 | DB 000h, 000h ; X___________X 79 | DB 06Eh, 0C0h ; X_XX_HHH_XX_X 80 | DB 000h, 000h ; X___________X 81 | DB 03Bh, 0A0h ; XN_XXX_XXXBXX 82 | DB 000h, 000h ; X___________X 83 | DB 06Ah, 0C0h ; X_XX_XvX_XX_X 84 | ; objects ; XXXXXXXXXXXXX 85 | DB 001h, 002h ; box1 86 | DB 009h, 002h ; box2 87 | DB 009h, 008h ; box3 88 | DB 000h, 008h ; nest 89 | DB 085h, 000h ; door (^) 90 | DB 005h, 00Ah ; door (v) 91 | ; ------------------------------ 92 | 93 | ; ------------------------------ 94 | ; room 04 95 | ; walls ; XXXXXXXXXXXXX 96 | DB 08Bh, 040h ; XX___XBXX_X^X 97 | DB 028h, 000h ; XN_X_X______X 98 | DB 0A2h, 0C0h ; XX_X___X_XX_X 99 | DB 00Ah, 000h ; X____X_X____X 100 | DB 0DEh, 0C0h ; XXX_XHHH_XX_X 101 | DB 000h, 080h ; X________X__X 102 | DB 05Eh, 020h ; X_X_XHHH___XX 103 | DB 002h, 080h ; X______X_X__X 104 | DB 06Ah, 0C0h ; X_XX_X_XBXXBX 105 | DB 008h, 080h ; X____X___X__X 106 | DB 062h, 020h ; XvXX___X___XX 107 | ; objects ; XXXXXXXXXXXXX 108 | DB 005h, 000h ; box1 109 | DB 007h, 008h ; box2 110 | DB 00Ah, 008h ; box3 111 | DB 000h, 001h ; nest 112 | DB 08Ah, 000h ; door (^) 113 | DB 000h, 00Ah ; door (v) 114 | ; ------------------------------ 115 | 116 | ; ------------------------------ 117 | ; room 05 118 | ; walls ; XXXXXXXXXXXXX 119 | DB 005h, 000h ; XB____X^X___X 120 | DB 0DDh, 0C0h ; XXX_XXX_XXX_X 121 | DB 084h, 000h ; XX____X_____X 122 | DB 0B1h, 060h ; XX_XX___X_XXX 123 | DB 01Eh, 000h ; X___XHHH____X 124 | DB 040h, 0C0h ; X_X______XX_X 125 | DB 0AEh, 0C0h ; XXNX_HHH_XX_X 126 | DB 024h, 000h ; X__X__X_____X 127 | DB 0ADh, 060h ; XX_X_XX_X_XXX 128 | DB 004h, 000h ; X_____X_____X 129 | DB 0B1h, 040h ; XXBXX___XBXvX 130 | ; objects ; XXXXXXXXXXXXX 131 | DB 000h, 000h ; box1 132 | DB 001h, 00Ah ; box2 133 | DB 008h, 00Ah ; box3 134 | DB 001h, 006h ; nest 135 | DB 086h, 000h ; door (^) 136 | DB 00Ah, 00Ah ; door (v) 137 | ; ------------------------------ 138 | 139 | ; ------------------------------ 140 | ; room 06 141 | ; walls ; XXXXXXXXXXXXX 142 | DB 0AAh, 0A0h ; XX^X_X_X_X_XX 143 | DB 080h, 080h ; XX___B___X__X 144 | DB 0AAh, 0A0h ; XX_X_X_X_X_XX 145 | DB 022h, 020h ; X__X___X___XX 146 | DB 0AEh, 080h ; XX_X_HHH_X__X 147 | DB 080h, 040h ; XX_______NX_X 148 | DB 0AEh, 080h ; XX_X_HHH_X__X 149 | DB 022h, 020h ; X__X___X___XX 150 | DB 0EAh, 0A0h ; XXXX_X_XBX_XX 151 | DB 088h, 080h ; XX___X___X__X 152 | DB 02Ah, 0A0h ; XB_X_X_X_XvXX 153 | ; objects ; XXXXXXXXXXXXX 154 | DB 004h, 001h ; box1 155 | DB 007h, 008h ; box2 156 | DB 000h, 00Ah ; box3 157 | DB 008h, 005h ; nest 158 | DB 081h, 000h ; door (^) 159 | DB 009h, 00Ah ; door (v) 160 | ; ------------------------------ 161 | 162 | ; ------------------------------ 163 | ; room 07 164 | ; walls ; XXXXXXXXXXXXX 165 | DB 05Ah, 0C0h ; XBX_XXNX_XX^X 166 | DB 042h, 000h ; X_X____X____X 167 | DB 058h, 0A0h ; X_X_XX___X_XX 168 | DB 002h, 0A0h ; X______X_X_XX 169 | DB 05Eh, 000h ; X_X_XHHH____X 170 | DB 000h, 0C0h ; X________XX_X 171 | DB 05Fh, 0C0h ; X_X_XHHHXXX_X 172 | DB 000h, 000h ; X___________X 173 | DB 0ADh, 040h ; XX_X_XX_X_X_X 174 | DB 005h, 000h ; X_____X_X_B_X 175 | DB 054h, 060h ; XBX_XvX___XXX 176 | ; objects ; XXXXXXXXXXXXX 177 | DB 000h, 000h ; box1 178 | DB 009h, 009h ; box2 179 | DB 000h, 00Ah ; box3 180 | DB 005h, 000h ; nest 181 | DB 08Ah, 000h ; door (^) 182 | DB 004h, 00Ah ; door (v) 183 | ; ------------------------------ 184 | 185 | ; ------------------------------ 186 | ; room 08 187 | ; walls ; XXXXXXXXXXXXX 188 | DB 0BAh, 0A0h ; XX_XXX^XBX_XX 189 | DB 008h, 000h ; X____X______X 190 | DB 063h, 0C0h ; X_XX___XXXX_X 191 | DB 00Ah, 000h ; X_N__X_X____X 192 | DB 07Eh, 0A0h ; X_XXXHHH_X_XX 193 | DB 000h, 000h ; X___________X 194 | DB 0AEh, 0E0h ; XX_X_HHH_XXXX 195 | DB 0EAh, 000h ; XXXX_X_X___BX 196 | DB 08Ah, 0A0h ; XX___X_X_X_XX 197 | DB 020h, 080h ; X__X_____X__X 198 | DB 0AAh, 0A0h ; XXBX_XvX_X_XX 199 | ; objects ; XXXXXXXXXXXXX 200 | DB 007h, 000h ; box1 201 | DB 00Ah, 007h ; box2 202 | DB 001h, 00Ah ; box3 203 | DB 001h, 003h ; nest 204 | DB 085h, 000h ; door (^) 205 | DB 005h, 00Ah ; door (v) 206 | ; ------------------------------ 207 | 208 | ; ------------------------------ 209 | ; room 09 210 | ; walls ; XXXXXXXXXXXXX 211 | DB 054h, 040h ; X_XBX_X___XBX 212 | DB 015h, 000h ; X___X_X_X___X 213 | DB 0D5h, 0C0h ; XXX_X_X_XXXvX 214 | DB 004h, 020h ; X_____X____XX 215 | DB 07Fh, 060h ; X_XXXHHHX_XXX 216 | DB 000h, 000h ; X__________NX 217 | DB 0DFh, 060h ; XXX_XHHHX_XXX 218 | DB 010h, 040h ; X___X_____X^X 219 | DB 07Bh, 0C0h ; X_XXXX_XXXX_X 220 | DB 000h, 040h ; X___B_____X_X 221 | DB 0DFh, 000h ; XXX_XXXXX___X 222 | ; objects ; XXXXXXXXXXXXX 223 | DB 002h, 000h ; box1 224 | DB 00Ah, 000h ; box2 225 | DB 003h, 009h ; box3 226 | DB 00Ah, 005h ; nest 227 | DB 08Ah, 007h ; door (^) 228 | DB 00Ah, 002h ; door (v) 229 | ; ------------------------------ 230 | 231 | ; ------------------------------ 232 | ; room 10 233 | ; walls ; XXXXXXXXXXXXX 234 | DB 015h, 000h ; X___X^X_X___X 235 | DB 044h, 040h ; X_X___X___X_X 236 | DB 011h, 000h ; X_B_X___X_B_X 237 | DB 040h, 040h ; X_X___N___X_X 238 | DB 07Fh, 0C0h ; X_XXXHHHXXX_X 239 | DB 000h, 000h ; X___________X 240 | DB 07Fh, 0C0h ; X_XXXHHHXXX_X 241 | DB 051h, 0C0h ; X_X_X___XXX_X 242 | DB 044h, 040h ; X_X___X___X_X 243 | DB 011h, 040h ; X_B_X___X_X_X 244 | DB 054h, 000h ; X_X_XvX_____X 245 | ; objects ; XXXXXXXXXXXXX 246 | DB 001h, 002h ; box1 247 | DB 009h, 002h ; box2 248 | DB 001h, 009h ; box3 249 | DB 005h, 003h ; nest 250 | DB 084h, 000h ; door (^) 251 | DB 004h, 00Ah ; door (v) 252 | ; ------------------------------ 253 | 254 | ; ------------------------------ 255 | ; room 11 256 | ; walls ; XXXXXXXXXXXXX 257 | DB 02Ah, 080h ; X__X_X^X_X__X 258 | DB 0A0h, 0C0h ; XX_X_____XX_X 259 | DB 02Ah, 080h ; X__X_X_X_X__X 260 | DB 06Ah, 0A0h ; X_XXBXBXBX_XX 261 | DB 01Fh, 000h ; X___XHHHX___X 262 | DB 0C0h, 040h ; XXX_______X_X 263 | DB 01Fh, 000h ; X___XHHHX___X 264 | DB 044h, 040h ; X_X___X___X_X 265 | DB 06Bh, 000h ; X_XX_XNXX___X 266 | DB 041h, 040h ; X_X_____X_X_X 267 | DB 014h, 000h ; X___XvX_____X 268 | ; objects ; XXXXXXXXXXXXX 269 | DB 003h, 003h ; box1 270 | DB 005h, 003h ; box2 271 | DB 007h, 003h ; box3 272 | DB 005h, 008h ; nest 273 | DB 085h, 000h ; door (^) 274 | DB 004h, 00Ah ; door (v) 275 | ; ------------------------------ 276 | 277 | ; ------------------------------ 278 | ; room 12 279 | ; walls ; XXXXXXXXXXXXX 280 | DB 0A0h, 0E0h ; XXBX_____XXXX 281 | DB 08Ah, 020h ; XX___X_X___XX 282 | DB 02Ah, 080h ; X__X_XvX_X__X 283 | DB 064h, 0C0h ; X_XX__X__XX_X 284 | DB 00Eh, 000h ; X____HHH____X 285 | DB 0A0h, 0C0h ; XX_X_____XXBX 286 | DB 00Eh, 000h ; X____HHH____X 287 | DB 060h, 0C0h ; X_XX__N__XX_X 288 | DB 02Eh, 080h ; X__X_XXX_X__X 289 | DB 08Ah, 020h ; XX___X^X___XX 290 | DB 0A0h, 0E0h ; XXBX_____XXXX 291 | ; objects ; XXXXXXXXXXXXX 292 | DB 001h, 000h ; box1 293 | DB 00Ah, 005h ; box2 294 | DB 001h, 00Ah ; box3 295 | DB 005h, 007h ; nest 296 | DB 085h, 009h ; door (^) 297 | DB 005h, 002h ; door (v) 298 | ; ------------------------------ 299 | 300 | ; ------------------------------ 301 | ; room 13 302 | ; walls ; XXXXXXXXXXXXX 303 | DB 050h, 0C0h ; X^X_X____XXNX 304 | DB 056h, 0C0h ; X_X_X_XX_XX_X 305 | DB 006h, 000h ; X_____XX____X 306 | DB 050h, 0A0h ; X_X_X____X_XX 307 | DB 01Eh, 000h ; X___XHHH___BX 308 | DB 060h, 0A0h ; XBXX_____X_XX 309 | DB 08Eh, 000h ; XX___HHH____X 310 | DB 06Ch, 0C0h ; X_XX_XX__XX_X 311 | DB 00Ah, 000h ; X____X_X____X 312 | DB 060h, 0A0h ; X_XX_____X_XX 313 | DB 00Ah, 0A0h ; X____XBXvX_XX 314 | ; objects ; XXXXXXXXXXXXX 315 | DB 00Ah, 004h ; box1 316 | DB 000h, 005h ; box2 317 | DB 005h, 00Ah ; box3 318 | DB 00Ah, 000h ; nest 319 | DB 080h, 000h ; door (^) 320 | DB 007h, 00Ah ; door (v) 321 | ; ------------------------------ 322 | 323 | ; ------------------------------ 324 | ; room 14 325 | ; walls ; XXXXXXXXXXXXX 326 | DB 0BBh, 0E0h ; XXBXXX_XXXXXX 327 | DB 0A0h, 080h ; XX_X_____X__X 328 | DB 0AAh, 0A0h ; XX_X_X_X_X_XX 329 | DB 08Ah, 000h ; XX___XvX___BX 330 | DB 02Eh, 0A0h ; X__X_HHH_X_XX 331 | DB 040h, 080h ; X_XB_____X__X 332 | DB 02Eh, 0C0h ; X__X_HHH_XX_X 333 | DB 08Ah, 000h ; XX___X^X____X 334 | DB 0A0h, 0A0h ; XX_X_____X_XX 335 | DB 02Dh, 080h ; X__X_XX_XX__X 336 | DB 020h, 0A0h ; XN_X_____X_XX 337 | ; objects ; XXXXXXXXXXXXX 338 | DB 001h, 000h ; box1 339 | DB 00Ah, 003h ; box2 340 | DB 002h, 005h ; box3 341 | DB 000h, 00Ah ; nest 342 | DB 085h, 007h ; door (^) 343 | DB 005h, 003h ; door (v) 344 | ; ------------------------------ 345 | 346 | ; ------------------------------ 347 | ; room 15 348 | ; walls ; XXXXXXXXXXXXX 349 | DB 020h, 080h ; X__X_____X__X 350 | DB 020h, 080h ; X__X_____X__X 351 | DB 020h, 080h ; X__X_____X__X 352 | DB 020h, 080h ; X__X_____X__X 353 | DB 03Bh, 080h ; X__XXX_XXX__X 354 | DB 00Ah, 000h ; X____X_X____X 355 | DB 000h, 000h ; X___________X 356 | DB 055h, 040h ; X_X_X_X_X_X_X 357 | DB 000h, 000h ; X___________X 358 | DB 000h, 000h ; X___________X 359 | DB 000h, 000h ; X___________X 360 | ; objects ; XXXXXXXXXXXXX 361 | DB 00Fh, 00Fh ; box1 362 | DB 00Fh, 00Fh ; box2 363 | DB 00Fh, 00Fh ; box3 364 | DB 00Fh, 00Fh ; nest 365 | DB 08Fh, 00Fh ; door (^) 366 | DB 00Fh, 00Fh ; door (v) 367 | ; ------------------------------ 368 | 369 | -------------------------------------------------------------------------------- /asm/enhancedplus/mapper/rooms.asm: -------------------------------------------------------------------------------- 1 | ; ------------------------------ 2 | ; room 00 3 | ; walls ; XXXXXXXXXXXXX 4 | DB 01Dh, 000h ; X___XXX^X___X 5 | DB 040h, 040h ; X_X___N___X_X 6 | DB 05Fh, 040h ; X_X_XXXXX_X_X 7 | DB 000h, 000h ; X_____B_____X 8 | DB 06Eh, 0A0h ; X_XX_HHH_X_XX 9 | DB 020h, 0A0h ; X__X_____X_XX 10 | DB 08Eh, 000h ; XX___HHH____X 11 | DB 020h, 0C0h ; X__X__B__XX_X 12 | DB 06Eh, 0C0h ; X_XX_XXX_XXvX 13 | DB 040h, 060h ; X_X___B___XXX 14 | DB 01Fh, 000h ; X___XXXXX___X 15 | ; objects ; XXXXXXXXXXXXX 16 | DB 005h, 003h ; box1 17 | DB 005h, 007h ; box2 18 | DB 005h, 009h ; box3 19 | DB 005h, 001h ; nest 20 | DB 086h, 000h ; door (^) 21 | DB 00Ah, 008h ; door (v) 22 | ; ------------------------------ 23 | 24 | ; ------------------------------ 25 | ; room 01 26 | ; walls ; XXXXXXXXXXXXX 27 | DB 0EAh, 000h ; XXXX^X_X____X 28 | DB 088h, 0C0h ; XX___X___XX_X 29 | DB 0BAh, 0C0h ; XX_XXX_X_XX_X 30 | DB 002h, 000h ; XB_____X____X 31 | DB 0EEh, 0A0h ; XXXX_HHH_XBXX 32 | DB 000h, 000h ; XN__________X 33 | DB 0AEh, 0E0h ; XX_X_HHH_XXXX 34 | DB 008h, 000h ; X____X_____BX 35 | DB 06Bh, 0A0h ; X_XX_X_XXX_XX 36 | DB 062h, 020h ; X_XX___X___XX 37 | DB 00Ah, 0E0h ; X____XvX_XXXX 38 | ; objects ; XXXXXXXXXXXXX 39 | DB 000h, 003h ; box1 40 | DB 009h, 004h ; box2 41 | DB 00Ah, 007h ; box3 42 | DB 000h, 005h ; nest 43 | DB 083h, 000h ; door (^) 44 | DB 005h, 00Ah ; door (v) 45 | ; ------------------------------ 46 | 47 | ; ------------------------------ 48 | ; room 02 49 | ; walls ; XXXXXXXXXXXXX 50 | DB 000h, 040h ; X_____B___X_X 51 | DB 06Fh, 000h ; X_XX_XXXX___X 52 | DB 000h, 040h ; X_________X_X 53 | DB 07Ah, 080h ; X_XXXXvX_X__X 54 | DB 00Eh, 020h ; X____HHH___XX 55 | DB 0A0h, 080h ; XX_X_____X_BX 56 | DB 02Eh, 0A0h ; XN_X_HHH_X_XX 57 | DB 0A8h, 020h ; XX_X_X_____XX 58 | DB 003h, 080h ; X______XXX__X 59 | DB 076h, 0C0h ; X_XXX_XX^XX_X 60 | DB 000h, 000h ; X__B________X 61 | ; objects ; XXXXXXXXXXXXX 62 | DB 005h, 000h ; box1 63 | DB 00Ah, 005h ; box2 64 | DB 002h, 00Ah ; box3 65 | DB 000h, 006h ; nest 66 | DB 087h, 009h ; door (^) 67 | DB 005h, 003h ; door (v) 68 | ; ------------------------------ 69 | 70 | ; ------------------------------ 71 | ; room 03 72 | ; walls ; XXXXXXXXXXXXX 73 | DB 05Fh, 000h ; XBX_XXXXX_B_X 74 | DB 00Ah, 040h ; X____X^X__X_X 75 | DB 06Ah, 0C0h ; X_XX_X_X_XX_X 76 | DB 000h, 000h ; X___________X 77 | DB 05Eh, 0E0h ; X_X_XHHH_XXXX 78 | DB 000h, 000h ; X___________X 79 | DB 0BFh, 040h ; XX_XXHHHX_X_X 80 | DB 000h, 000h ; X___________X 81 | DB 06Ah, 0C0h ; X_XX_X_X_XX_X 82 | DB 02Ah, 000h ; X__X_XvX____X 83 | DB 08Eh, 0A0h ; XX_N_XXX_XBXX 84 | ; objects ; XXXXXXXXXXXXX 85 | DB 000h, 000h ; box1 86 | DB 009h, 000h ; box2 87 | DB 009h, 00Ah ; box3 88 | DB 002h, 00Ah ; nest 89 | DB 085h, 001h ; door (^) 90 | DB 005h, 009h ; door (v) 91 | ; ------------------------------ 92 | 93 | ; ------------------------------ 94 | ; room 04 95 | ; walls ; XXXXXXXXXXXXX 96 | DB 08Ah, 020h ; XX___X^X___XX 97 | DB 028h, 080h ; X__X_X___X__X 98 | DB 062h, 0C0h ; X_XX___X_XXBX 99 | DB 02Ah, 080h ; X__X_X_X_X__X 100 | DB 08Eh, 020h ; XX___HHH___XX 101 | DB 020h, 0E0h ; XN_X_____XXXX 102 | DB 08Eh, 020h ; XX___HHH___XX 103 | DB 02Ah, 080h ; X__X_X_X_X__X 104 | DB 062h, 0C0h ; XBXX___X_XXBX 105 | DB 028h, 080h ; X__X_X___X__X 106 | DB 08Ah, 020h ; XX___XvX___XX 107 | ; objects ; XXXXXXXXXXXXX 108 | DB 00Ah, 002h ; box1 109 | DB 000h, 008h ; box2 110 | DB 00Ah, 008h ; box3 111 | DB 000h, 005h ; nest 112 | DB 085h, 000h ; door (^) 113 | DB 005h, 00Ah ; door (v) 114 | ; ------------------------------ 115 | 116 | ; ------------------------------ 117 | ; room 05 118 | ; walls ; XXXXXXXXXXXXX 119 | DB 0AAh, 0A0h ; XX_X^X_XBX_XX 120 | DB 000h, 000h ; X___________X 121 | DB 0BBh, 0A0h ; XX_XXX_XXX_XX 122 | DB 000h, 000h ; XN__________X 123 | DB 0EEh, 0E0h ; XXXX_HHH_XXXX 124 | DB 000h, 000h ; X___________X 125 | DB 0EEh, 0E0h ; XXXX_HHH_XXXX 126 | DB 000h, 000h ; X__________BX 127 | DB 0BBh, 0A0h ; XX_XXX_XXX_XX 128 | DB 000h, 000h ; X___________X 129 | DB 0AAh, 0A0h ; XX_XBX_XvX_XX 130 | ; objects ; XXXXXXXXXXXXX 131 | DB 007h, 000h ; box1 132 | DB 00Ah, 007h ; box2 133 | DB 003h, 00Ah ; box3 134 | DB 000h, 003h ; nest 135 | DB 083h, 000h ; door (^) 136 | DB 007h, 00Ah ; door (v) 137 | ; ------------------------------ 138 | 139 | ; ------------------------------ 140 | ; room 06 141 | ; walls ; XXXXXXXXXXXXX 142 | DB 0AAh, 0A0h ; XX_X_X_XBX^XX 143 | DB 082h, 0A0h ; XX_____X_X_XX 144 | DB 0AAh, 0A0h ; XX_X_X_X_X_XX 145 | DB 028h, 000h ; XB_X_X______X 146 | DB 0AEh, 0A0h ; XX_X_HHH_X_XX 147 | DB 080h, 080h ; XX_______X_NX 148 | DB 0AEh, 0A0h ; XX_X_HHH_X_XX 149 | DB 022h, 020h ; X__X___X___XX 150 | DB 0AAh, 0A0h ; XX_X_X_X_X_XX 151 | DB 088h, 080h ; XX___X___X__X 152 | DB 0AAh, 0A0h ; XX_XvX_XBX_XX 153 | ; objects ; XXXXXXXXXXXXX 154 | DB 007h, 000h ; box1 155 | DB 000h, 003h ; box2 156 | DB 007h, 00Ah ; box3 157 | DB 00Ah, 005h ; nest 158 | DB 089h, 000h ; door (^) 159 | DB 003h, 00Ah ; door (v) 160 | ; ------------------------------ 161 | 162 | ; ------------------------------ 163 | ; room 07 164 | ; walls ; XXXXXXXXXXXXX 165 | DB 021h, 0A0h ; X_BX____XX^XX 166 | DB 06Ch, 000h ; X_XX_XX_____X 167 | DB 00Dh, 0A0h ; X____XX_XX_XX 168 | DB 061h, 0A0h ; X_XX____XX_XX 169 | DB 06Eh, 000h ; X_XX_HHH____X 170 | DB 000h, 0C0h ; X________XX_X 171 | DB 0BEh, 0C0h ; XX_XXHHH_XX_X 172 | DB 0B0h, 000h ; XX_XXN______X 173 | DB 003h, 060h ; X______XX_XXX 174 | DB 05Bh, 040h ; XBX_XX_XX_XBX 175 | DB 0D8h, 000h ; XXXvXX______X 176 | ; objects ; XXXXXXXXXXXXX 177 | DB 001h, 000h ; box1 178 | DB 000h, 009h ; box2 179 | DB 00Ah, 009h ; box3 180 | DB 004h, 007h ; nest 181 | DB 089h, 000h ; door (^) 182 | DB 002h, 00Ah ; door (v) 183 | ; ------------------------------ 184 | 185 | ; ------------------------------ 186 | ; room 08 187 | ; walls ; XXXXXXXXXXXXX 188 | DB 0BAh, 0A0h ; XX_XXX^XBX_XX 189 | DB 008h, 000h ; X____X______X 190 | DB 063h, 0C0h ; X_XX___XXXX_X 191 | DB 00Ah, 000h ; X_N__X_X____X 192 | DB 07Eh, 0A0h ; X_XXXHHH_X_XX 193 | DB 000h, 000h ; X___________X 194 | DB 0AEh, 0E0h ; XX_X_HHH_XXXX 195 | DB 0EAh, 000h ; XXXX_X_X___BX 196 | DB 08Ah, 0A0h ; XX___X_X_X_XX 197 | DB 020h, 080h ; X__X_____X__X 198 | DB 0AAh, 0A0h ; XXBX_XvX_X_XX 199 | ; objects ; XXXXXXXXXXXXX 200 | DB 007h, 000h ; box1 201 | DB 00Ah, 007h ; box2 202 | DB 001h, 00Ah ; box3 203 | DB 001h, 003h ; nest 204 | DB 085h, 000h ; door (^) 205 | DB 005h, 00Ah ; door (v) 206 | ; ------------------------------ 207 | 208 | ; ------------------------------ 209 | ; room 09 210 | ; walls ; XXXXXXXXXXXXX 211 | DB 050h, 000h ; X_XBX______BX 212 | DB 015h, 040h ; X___X_X_X_X_X 213 | DB 054h, 040h ; X_X_X_X___X_X 214 | DB 001h, 000h ; X_______X___X 215 | DB 07Fh, 0A0h ; X_XXXHHHXXNXX 216 | DB 040h, 000h ; XvX_________X 217 | DB 0EEh, 0E0h ; XXXX_HHH_XXXX 218 | DB 000h, 040h ; X_________X^X 219 | DB 0DBh, 040h ; XXX_XX_XX_X_X 220 | DB 008h, 040h ; XB___X____X_X 221 | DB 0A3h, 000h ; XX_X___XX___X 222 | ; objects ; XXXXXXXXXXXXX 223 | DB 002h, 000h ; box1 224 | DB 00Ah, 000h ; box2 225 | DB 000h, 009h ; box3 226 | DB 009h, 004h ; nest 227 | DB 08Ah, 007h ; door (^) 228 | DB 000h, 005h ; door (v) 229 | ; ------------------------------ 230 | 231 | ; ------------------------------ 232 | ; room 10 233 | ; walls ; XXXXXXXXXXXXX 234 | DB 010h, 020h ; X___X______XX 235 | DB 046h, 080h ; X_X___XX_XB_X 236 | DB 06Ah, 0C0h ; X_XX_X^X_XX_X 237 | DB 000h, 040h ; X_________X_X 238 | DB 0BFh, 000h ; XX_XXHHHX___X 239 | DB 0A0h, 0A0h ; XXBX_____XNXX 240 | DB 00Eh, 000h ; X____HHH____X 241 | DB 060h, 0A0h ; X_XX_____X_XX 242 | DB 04Ah, 080h ; X_X__XvX_X__X 243 | DB 02Eh, 0C0h ; X__X_XXX_XX_X 244 | DB 080h, 000h ; XX_______B__X 245 | ; objects ; XXXXXXXXXXXXX 246 | DB 009h, 001h ; box1 247 | DB 001h, 005h ; box2 248 | DB 008h, 00Ah ; box3 249 | DB 009h, 005h ; nest 250 | DB 085h, 002h ; door (^) 251 | DB 005h, 008h ; door (v) 252 | ; ------------------------------ 253 | 254 | ; ------------------------------ 255 | ; room 11 256 | ; walls ; XXXXXXXXXXXXX 257 | DB 02Ah, 080h ; X__X_XBX_X__X 258 | DB 060h, 0C0h ; X_XX_____XX_X 259 | DB 02Ah, 040h ; X__XBX_X_BX_X 260 | DB 0BBh, 0C0h ; XX_XXXvXXXX_X 261 | DB 01Fh, 000h ; X___XHHHX___X 262 | DB 040h, 040h ; X_X_______X_X 263 | DB 01Fh, 040h ; X___XHHHX_X_X 264 | DB 055h, 040h ; X_X_XNX^X_X_X 265 | DB 040h, 000h ; X_X_________X 266 | DB 05Dh, 040h ; X_X_XXX_X_X_X 267 | DB 000h, 000h ; X___________X 268 | ; objects ; XXXXXXXXXXXXX 269 | DB 005h, 000h ; box1 270 | DB 003h, 002h ; box2 271 | DB 008h, 002h ; box3 272 | DB 004h, 007h ; nest 273 | DB 086h, 007h ; door (^) 274 | DB 005h, 003h ; door (v) 275 | ; ------------------------------ 276 | 277 | ; ------------------------------ 278 | ; room 12 279 | ; walls ; XXXXXXXXXXXXX 280 | DB 060h, 0C0h ; XBXX_____XXBX 281 | DB 04Eh, 040h ; X_X__XXX__X_X 282 | DB 01Bh, 000h ; X___XX^XX___X 283 | DB 040h, 040h ; X_X_______X_X 284 | DB 06Eh, 0C0h ; X_XX_HHH_XX_X 285 | DB 000h, 000h ; X___________X 286 | DB 06Eh, 0C0h ; X_XX_HHH_XX_X 287 | DB 040h, 040h ; X_X_______X_X 288 | DB 01Bh, 000h ; X___XXNXX___X 289 | DB 04Eh, 040h ; X_X__XXX__X_X 290 | DB 060h, 0C0h ; XBXX_____XXvX 291 | ; objects ; XXXXXXXXXXXXX 292 | DB 000h, 000h ; box1 293 | DB 00Ah, 000h ; box2 294 | DB 000h, 00Ah ; box3 295 | DB 005h, 008h ; nest 296 | DB 085h, 002h ; door (^) 297 | DB 00Ah, 00Ah ; door (v) 298 | ; ------------------------------ 299 | 300 | ; ------------------------------ 301 | ; room 13 302 | ; walls ; XXXXXXXXXXXXX 303 | DB 003h, 040h ; X______XX_X^X 304 | DB 078h, 040h ; XvXXXX____X_X 305 | DB 0C2h, 0C0h ; XXX____X_XX_X 306 | DB 028h, 000h ; XN_X_X______X 307 | DB 0AEh, 0E0h ; XX_X_HHH_XXXX 308 | DB 000h, 000h ; X__________BX 309 | DB 0EEh, 0E0h ; XXXX_HHH_XXXX 310 | DB 044h, 000h ; XBX___X_____X 311 | DB 015h, 0A0h ; X___X_X_XX_XX 312 | DB 071h, 000h ; X_XXX___X___X 313 | DB 004h, 040h ; X_____X___XBX 314 | ; objects ; XXXXXXXXXXXXX 315 | DB 00Ah, 005h ; box1 316 | DB 000h, 007h ; box2 317 | DB 00Ah, 00Ah ; box3 318 | DB 000h, 003h ; nest 319 | DB 08Ah, 000h ; door (^) 320 | DB 000h, 001h ; door (v) 321 | ; ------------------------------ 322 | 323 | ; ------------------------------ 324 | ; room 14 325 | ; walls ; XXXXXXXXXXXXX 326 | DB 0BBh, 0E0h ; XXBXXX_XXXXXX 327 | DB 0A0h, 080h ; XX_X_____X__X 328 | DB 0AAh, 0A0h ; XX_X_X_X_X_XX 329 | DB 08Ah, 000h ; XX___XvX___BX 330 | DB 02Eh, 0A0h ; X__X_HHH_X_XX 331 | DB 040h, 080h ; X_XB_____X__X 332 | DB 02Eh, 0C0h ; X__X_HHH_XX_X 333 | DB 08Ah, 000h ; XX___X^X____X 334 | DB 0A0h, 0A0h ; XX_X_____X_XX 335 | DB 02Dh, 080h ; X__X_XX_XX__X 336 | DB 020h, 0A0h ; XN_X_____X_XX 337 | ; objects ; XXXXXXXXXXXXX 338 | DB 001h, 000h ; box1 339 | DB 00Ah, 003h ; box2 340 | DB 002h, 005h ; box3 341 | DB 000h, 00Ah ; nest 342 | DB 085h, 007h ; door (^) 343 | DB 005h, 003h ; door (v) 344 | ; ------------------------------ 345 | 346 | ; ------------------------------ 347 | ; room 15 348 | ; walls ; XXXXXXXXXXXXX 349 | DB 000h, 000h ; X___________X 350 | DB 000h, 000h ; X___________X 351 | DB 000h, 000h ; X___________X 352 | DB 000h, 000h ; X___________X 353 | DB 0FBh, 0E0h ; XXXXXX_XXXXXX 354 | DB 01Bh, 000h ; X___XX_XX___X 355 | DB 040h, 040h ; X_X_______X_X 356 | DB 075h, 0C0h ; X_XXX_X_XXX_X 357 | DB 000h, 000h ; X___________X 358 | DB 000h, 000h ; X___________X 359 | DB 000h, 000h ; X___________X 360 | ; objects ; XXXXXXXXXXXXX 361 | DB 00Fh, 00Fh ; box1 362 | DB 00Fh, 00Fh ; box2 363 | DB 00Fh, 00Fh ; box3 364 | DB 00Fh, 00Fh ; nest 365 | DB 08Fh, 00Fh ; door (^) 366 | DB 00Fh, 00Fh ; door (v) 367 | ; ------------------------------ 368 | 369 | -------------------------------------------------------------------------------- /asm/symbols.asm: -------------------------------------------------------------------------------- 1 | 2 | ; ============================================================================= 3 | ; MSX symbolic constants 4 | ; ============================================================================= 5 | 6 | ; ----------------------------------------------------------------------------- 7 | ; MSX BIOS entry points and constants 8 | 9 | ; MSX BIOS 10 | CHKRAM: equ $0000 ; Power-up, check RAM 11 | CGTABL: equ $0004 ; Two bytes, address of ROM character set 12 | VDP_DR: equ $0006 ; One byte, VDP Data Port number (read) 13 | VDP_DW: equ $0007 ; One byte, VDP Data Port number (write) 14 | SYNCHR: equ $0008 ; Check BASIC program character 15 | RDSLT: equ $000c ; Read RAM in any slot 16 | CHRGTR: equ $0010 ; Get next BASIC program character 17 | WRSLT: equ $0014 ; Write to RAM in any slot 18 | OUTDO: equ $0018 ; Output to current device 19 | CALSLT: equ $001c ; Call routine in any slot 20 | DCOMPR: equ $0020 ; Compare register pairs HL and DE 21 | ENASLT: equ $0024 ; Enable any slot permanently 22 | GETYPR: equ $0028 ; Get BASIC operand type 23 | MSXID1: equ $002b ; Frecuency (1b), date format (3b) and charset (4b) 24 | ; Default interrupt frequency: 0 = 60Hz, 1 = 50Hz 25 | ; Date format: 0 = Y-M-D, 1 = M-D-Y, 2 = D-M-Y 26 | ; Character set: 0 = Japanese, 1 = International, 2=Korean 27 | MSXID2: equ $002c ; Basic version (4b) and Keybaord type (4b) 28 | ; Basic version: 0 = Japanese, 1 = International 29 | ; Keyboard type: 0 = Japanese, 1 = International, 2 = French (AZERTY), 3 = UK, 4 = German (DIN) 30 | MSXID3: equ $002d ; MSX version number 31 | ; 0 = MSX 1 32 | ; 1 = MSX 2 33 | ; 2 = MSX 2+ 34 | ; 3 = MSX turbo R 35 | MSXID4: equ $002e ; Bit 0: if 1 then MSX-MIDI is present internally (MSX turbo R only) 36 | MSXID5: equ $002f ; Reserved 37 | CALLF: equ $0030 ; Call routine in any slot 38 | KEYINT: equ $0038 ; Interrupt handler, keyboard scan 39 | INITIO: equ $003b ; Initialize I/O devices 40 | INIFNK: equ $003e ; Initialize function key strings 41 | DISSCR: equ $0041 ; Disable screen 42 | ENASCR: equ $0044 ; Enable screen 43 | WRTVDP: equ $0047 ; Write to any VDP register 44 | RDVRM: equ $004a ; Read byte from VRAM 45 | WRTVRM: equ $004d ; Write byte to VRAM 46 | SETRD: equ $0050 ; Set up VDP for read 47 | SETWRT: equ $0053 ; Set up VDP for write 48 | FILVRM: equ $0056 ; Fill block of VRAM with data byte 49 | LDIRMV: equ $0059 ; Copy block to memory from VRAM 50 | LDIRVM: equ $005c ; Copy block to VRAM, from memory 51 | CHGMOD: equ $005f ; Change VDP mode 52 | CHGCLR: equ $0062 ; Change VDP colours 53 | NMI: equ $0066 ; Non Maskable Interrupt handler 54 | CLRSPR: equ $0069 ; Clear all sprites 55 | INITXT: equ $006c ; Initialize VDP to 40x24 Text Mode 56 | INIT32: equ $006f ; Initialize VDP to 32x24 Text Mode 57 | INIGRP: equ $0072 ; Initialize VDP to Graphics Mode 58 | INIMLT: equ $0075 ; Initialize VDP to Multicolour Mode 59 | SETTXT: equ $0078 ; Set VDP to 40x24 Text Mode 60 | SETT32: equ $007b ; Set VDP to 32x24 Text Mode 61 | SETGRP: equ $007e ; Set VDP to Graphics Mode 62 | SETMLT: equ $0081 ; Set VDP to Multicolour Mode 63 | CALPAT: equ $0084 ; Calculate address of sprite pattern 64 | CALATR: equ $0087 ; Calculate address of sprite attribute 65 | GSPSIZ: equ $008a ; Get sprite size 66 | GRPPRT: equ $008d ; Print character on graphic screen 67 | GICINI: equ $0090 ; Initialize PSG (GI Chip) 68 | WRTPSG: equ $0093 ; Write to any PSG register 69 | RDPSG: equ $0096 ; Read from any PSG register 70 | STRTMS: equ $0099 ; Start music dequeueing 71 | CHSNS: equ $009c ; Sense keyboard buffer for character 72 | CHGET: equ $009f ; Get character from keyboard buffer (wait) 73 | CHPUT: equ $00a2 ; Screen character output 74 | LPTOUT: equ $00a5 ; Line printer character output 75 | LPTSTT: equ $00a8 ; Line printer status test 76 | CNVCHR: equ $00ab ; Convert character with graphic header 77 | PINLIN: equ $00ae ; Get line from console (editor) 78 | INLIN: equ $00b1 ; Get line from console (editor) 79 | QINLIN: equ $00b4 ; Display "?", get line from console (editor) 80 | BREAKX: equ $00b7 ; Check CTRL-STOP key directly 81 | ISCNTC: equ $00ba ; Check CRTL-STOP key 82 | CKCNTC: equ $00bd ; Check CTRL-STOP key 83 | BEEP: equ $00c0 ; Go beep 84 | CLS: equ $00c3 ; Clear screen 85 | POSIT: equ $00c6 ; Set cursor position 86 | FNKSB: equ $00c9 ; Check if function key display on 87 | ERAFNK: equ $00cc ; Erase function key display 88 | DSPFNK: equ $00cf ; Display function keys 89 | TOTEXT: equ $00d2 ; Return VDP to text mode 90 | GTSTCK: equ $00d5 ; Get joystick status 91 | GTTRIG: equ $00d8 ; Get trigger status 92 | GTPAD: equ $00db ; Get touch pad status 93 | GTPDL: equ $00de ; Get paddle status 94 | TAPION: equ $00e1 ; Tape input ON 95 | TAPIN: equ $00e4 ; Tape input 96 | TAPIOF: equ $00e7 ; Tape input OFF 97 | TAPOON: equ $00ea ; Tape output ON 98 | TAPOUT: equ $00ed ; Tape output 99 | TAPOOF: equ $00f0 ; Tape output OFF 100 | STMOTR: equ $00f3 ; Turn motor ON/OFF 101 | LFTQ: equ $00f6 ; Space left in music queue 102 | PUTQ: equ $00f9 ; Put byte in music queue 103 | RIGHTC: equ $00fc ; Move current pixel physical address right 104 | LEFTC: equ $00ff ; Move current pixel physical address left 105 | UPC: equ $0102 ; Move current pixel physical address up 106 | TUPC: equ $0105 ; Test then UPC if legal 107 | DOWNC: equ $0108 ; Move current pixel physical address down 108 | TDOWNC: equ $010b ; Test then DOWNC if legal 109 | SCALXY: equ $010e ; Scale graphics coordinates 110 | MAPXYC: equ $0111 ; Map graphic coordinates to physical address 111 | FETCHC: equ $0114 ; Fetch current pixel physical address 112 | STOREC: equ $0117 ; Store current pixel physical address 113 | SETATR: equ $011a ; Set attribute byte 114 | READC: equ $011d ; Read attribute of current pixel 115 | SETC: equ $0120 ; Set attribute of current pixel 116 | NSETCX: equ $0123 ; Set attribute of number of pixels 117 | GTASPC: equ $0126 ; Get aspect ratio 118 | PNTINI: equ $0129 ; Paint initialize 119 | SCANR: equ $012c ; Scan pixels to right 120 | SCANL: equ $012f ; Scan pixels to left 121 | CHGCAP: equ $0132 ; Change Caps Lock LED 122 | CHGSND: equ $0135 ; Change Key Click sound output 123 | RSLREG: equ $0138 ; Read Primary Slot Register 124 | WSLREG: equ $013b ; Write to Primary Slot Register 125 | RDVDP: equ $013e ; Read VDP Status Register 126 | SNSMAT: equ $0141 ; Read row of keyboard matrix 127 | ; a = $00 ; 7 6 5 4 3 2 1 0 128 | ; a = $01 ; ; ] [ \ = - 9 8 129 | ; a = $02 ; B A pound / . , ` ' 130 | ; a = $03 ; J I H G F E D C 131 | ; a = $04 ; R Q P O N M L K 132 | ; a = $05 ; Z Y X W V U T S 133 | ; a = $06 ; F3 F2 F1 CODE CAP GRAPH CTRL SHIFT 134 | ; a = $07 ; CR SEL BS STOP TAB ESC F5 F4 135 | ; a = $08 ; RIGHT DOWN UP LEFT DEL INS HOME SPACE 136 | ; a = $09 ; 4 3 2 1 0 none none none 137 | ; a = $0a ; . , - 9 8 7 6 5 138 | PHYDIO: equ $0144 ; Disk, no action 139 | FORMAT: equ $0147 ; Disk, no action 140 | ISFLIO: equ $014a ; Check for file I/O 141 | OUTDLP: equ $014d ; Formatted output to line printer 142 | GETVCP: equ $0150 ; Get music voice pointer 143 | GETVC2: equ $0153 ; Get music voice pointer 144 | KILBUF: equ $0156 ; Clear keyboard buffer 145 | CALBAS: equ $0159 ; Call to BASIC from any slot 146 | 147 | ; MSX 2 BIOS 148 | SUBROM: equ $015c ; Calls a routine in SUB-ROM 149 | EXTROM: equ $015f ; Calls a routine in SUB-ROM. Most common way 150 | CHKSLZ: equ $0162 ; Search slots for SUB-ROM 151 | CHKNEW: equ $0165 152 | EOL: equ $0168 153 | BIGFIL: equ $016b 154 | NSETRD: equ $016e 155 | NSTWRT: equ $0171 156 | NRDVRM: equ $0174 157 | NWRVRM: equ $0177 158 | 159 | ; MSX 2+ BIOS 160 | RDBTST: equ $017a 161 | WRBTST: equ $017d 162 | 163 | ; MSX turbo R BIOS 164 | CHGCPU: equ $0180 ; Changes CPU mode 165 | GETCPU: equ $0183 ; Returns current CPU mode 166 | PCMPLY: equ $0186 ; Plays specified memory area through the PCM chip 167 | PCMREC: equ $0189 ; Records audio using the PCM chip into the specified memory area 168 | ; ----------------------------------------------------------------------------- 169 | 170 | ; ----------------------------------------------------------------------------- 171 | ; Stack pointer initialization 172 | STACK_POINTER_INIT: equ $f380 ; As suggested by the MSX2 Technical Handbook 173 | 174 | ; MSX system variables 175 | RDPRIM: equ $f380 ; Routine that reads from a primary slot 176 | WRPRIM: equ $f385 ; Routine that writes to a primary slot 177 | LINL40: equ $f3ae ; Width for SCREEN 0 (default 37) 178 | LINL32: equ $f3af ; Width for SCREEN 1 (default 29) 179 | LINLEN: equ $f3b0 ; Width for the current text mode 180 | CLIKSW: equ $f3db ; Keyboard click sound 181 | RG0SAV: equ $f3df ; Content of VDP(0) register (R#0) 182 | RG1SAV: equ $f3e0 ; Content of VDP(1) register (R#1) 183 | RG2SAV: equ $f3e1 ; Content of VDP(2) register (R#2) 184 | RG3SAV: equ $f3e2 ; Content of VDP(3) register (R#3) 185 | RG4SAV: equ $f3e3 ; Content of VDP(4) register (R#4) 186 | RG5SAV: equ $f3e4 ; Content of VDP(5) register (R#5) 187 | RG6SAV: equ $f3e5 ; Content of VDP(6) register (R#6) 188 | RG7SAV: equ $f3e6 ; Content of VDP(7) register (R#7) 189 | STATFL: equ $f3e7 ; Content of VDP status register (S#0) 190 | TRGFLG: equ $f3e8 ; State of the four joystick trigger inputs and the space key 191 | FORCLR: equ $f3e9 ; Foreground colour 192 | BAKCLR: equ $f3ea ; Background colour 193 | BDRCLR: equ $f3eb ; Border colour 194 | SCNCNT: equ $f3f6 ; Key scan timing 195 | OLDKEY: equ $fbda ; Previous state of the keyboard matrix (11b) 196 | NEWKEY: equ $fbe5 ; Current state of the keyboard matrix (11b) 197 | ; $fbda, $fbe5 ; 7 6 5 4 3 2 1 0 198 | ; $fbdb, $fbe6 ; ; ] [ \ = - 9 8 199 | ; $fbdc, $fbe7 ; B A pound / . , ` ' 200 | ; $fbdd, $fbe8 ; J I H G F E D C 201 | ; $fbde, $fbe9 ; R Q P O N M L K 202 | ; $fbdf, $fbea ; Z Y X W V U T S 203 | ; $fbe0, $fbeb ; F3 F2 F1 CODE CAP GRAPH CTRL SHIFT 204 | ; $fbe1, $fbec ; CR SEL BS STOP TAB ESC F5 F4 205 | ; $fbe2, $fbed ; RIGHT DOWN UP LEFT DEL INS HOME SPACE 206 | ; $fbe3, $fbee ; 4 3 2 1 0 none none none 207 | ; $fbe4, $fbef ; . , - 9 8 7 6 5 208 | BOTTOM: equ $fc48 ; Address of the beginning of the available RAM area 209 | HIMEM: equ $fc4a ; High free RAM address available (init stack with) 210 | INTFLG: equ $fc9b ; STOP flag (0 = none, 3 = CTRL+STOP, 4 = STOP) 211 | JIFFY: equ $fc9e ; Software clock; each VDP interrupt gets increased by 1 212 | INTCNT: equ $fca2 ; ON INTERVAL counter (counts backwards) 213 | SCRMOD: equ $fcaf ; Screen mode 214 | EXPTBL: equ $fcc1 ; Set to $80 during power-up if Primary Slot is expanded (4b) 215 | MNROM: equ $fcc1 ; The first EXPTBL variable is also the Main ROM (BIOS) slot ID 216 | SLTTBL: equ $fcc5 ; Mirror of the four possible Secondary Slot Registers (4b) 217 | 218 | ; MSX system hooks 219 | HKEYI: equ $fd9a ; Interrupt handler 220 | HTIMI: equ $fd9f ; Interrupt handler 221 | 222 | HOOK_SIZE: equ HTIMI - HKEYI 223 | ; ----------------------------------------------------------------------------- 224 | 225 | ; ----------------------------------------------------------------------------- 226 | ; VDP 227 | 228 | ; VRAM addresses 229 | CHRTBL: equ $0000 ; Pattern table 230 | .BANK_0: equ CHRTBL + 0 *CHRTBL_SIZE 231 | .BANK_1: equ CHRTBL + 1 *CHRTBL_SIZE 232 | .BANK_2: equ CHRTBL + 2 *CHRTBL_SIZE 233 | NAMTBL: equ $1800 ; Name table 234 | CLRTBL: equ $2000 ; Color table 235 | .BANK_0: equ CLRTBL + 0 *CLRTBL_SIZE 236 | .BANK_1: equ CLRTBL + 1 *CLRTBL_SIZE 237 | .BANK_2: equ CLRTBL + 2 *CLRTBL_SIZE 238 | SPRATR: equ $1B00 ; Sprite attributes table 239 | SPRTBL: equ $3800 ; Sprite pattern table 240 | 241 | ; VDP symbolic constants 242 | CHRTBL_SIZE: equ 256 * 8 243 | NAMTBL_SIZE: equ 32 * 24 244 | CLRTBL_SIZE: equ 256 * 8 245 | SPRATR_SIZE: equ 32 * 4 246 | SPRTBL_SIZE: equ 32 * 64 247 | 248 | SCR_WIDTH: equ 32 249 | SCR_HEIGHT: equ 24 250 | 251 | SPRITE_WIDTH: equ 16 252 | SPRITE_HEIGHT: equ 16 253 | 254 | SPAT_END: equ $d0 ; Sprite attribute table end marker 255 | SPAT_OB: equ $d1 ; Sprite out of bounds marker (not standard) 256 | SPAT_EC: equ $80 ; Early clock bit (32 pixels) 257 | ; ----------------------------------------------------------------------------- 258 | 259 | ; ----------------------------------------------------------------------------- 260 | ; PPI (Programmable Peripheral Interface) 261 | PPI.A: equ $a8 ; PPI port A: primary slot selection register 262 | ; 33221100: number of slot to select on page n 263 | PPI.B: equ $a9 ; PPI port B: read the keyboard matrix row specified via the PPI port C ($AA) 264 | PPI.C: equ $aa ; PPI port C: control keyboard CAP LED, data recorder signals, and keyboard matrix row 265 | ; bits 0-3: Row number of specified keyboard matrix to read via port B 266 | ; bit 4: Data recorder motor (reset to turn on) 267 | ; bit 5: Set to write on tape 268 | ; bit 6: Keyboard LED CAPS (reset to turn on) 269 | ; bit 7: 1, then 0 shortly thereafter to make a clicking sound (used for the keyboard) 270 | PPI.R: equ $ab ; PPI ports control register (write only) 271 | ; bit 0 = Bit status to change 272 | ; bit 1-3 = Number of the bit to change at port C of the PPI 273 | ; bit 4-6 = Unused 274 | ; bit 7 = Must be always reset on MSX 275 | ; ----------------------------------------------------------------------------- 276 | 277 | ; ----------------------------------------------------------------------------- 278 | ; ASCII 279 | ASCII_NUL: equ $00 ; NUL (null) 280 | ASCII_EOT: equ $04 ; EOT (End of transmission) 281 | ASCII_BEL: equ $07 ; BEL (bell) 282 | ASCII_BS: equ $08 ; BS (Backspace) 283 | ASCII_HT: equ $09 ; HT (Horizontal tab) 284 | ASCII_LF: equ $0a ; LF (Line feed) 285 | ASCII_CR: equ $0d ; CR (Carriage return) 286 | ASCII_SYN: equ $16 ; SYN (Synchronous idle) 287 | ASCII_SUB: equ $1a ; SUB (Substitute) (see ASCII_EOF) 288 | ASCII_EOF: equ $1a ; EOF (End of file, Control-Z) (see ASCII_SUB) 289 | ASCII_ESC: equ $1b ; ESC (Escape) 290 | ASCII_DEL: equ $7f ; DEL (Delete) 291 | ; ----------------------------------------------------------------------------- 292 | 293 | ; EOF 294 | -------------------------------------------------------------------------------- /asm/libext/PT3-ROM.tniasm.ASM: -------------------------------------------------------------------------------- 1 | ; --- PT3 REPLAYER WORKING ON ROM --- 2 | ; --- Can be assembled with asMSX --- 3 | ; --- ROM version: MSX-KUN --- 4 | ; --- asMSX version: SapphiRe --- 5 | ; --- tniasm version: theNestruo --- 6 | 7 | ; Based on MSX version of PT3 by Dioniso 8 | ; 9 | ; This version of the replayer uses a fixed volume and note table, if you need a 10 | ; different note table you can copy it from TABLES.TXT file, distributed with the 11 | ; original PT3 distribution. This version also allows the use of PT3 commands. 12 | ; 13 | ; PLAY and PSG WRITE routines seperated to allow independent calls 14 | ; 15 | ; ROM LENGTH: 1528 bytes 16 | ; RAM LENGTH: 382 bytes 17 | 18 | ; --- CONSTANT VALUES DEFINITION --- 19 | 20 | ;ChannelsVars 21 | ;struc CHNPRM 22 | ;reset group 23 | CHNPRM_PsInOr: equ 0 ;RESB 1 24 | CHNPRM_PsInSm: equ 1 ;RESB 1 25 | CHNPRM_CrAmSl: equ 2 ;RESB 1 26 | CHNPRM_CrNsSl: equ 3 ;RESB 1 27 | CHNPRM_CrEnSl: equ 4 ;RESB 1 28 | CHNPRM_TSlCnt: equ 5 ;RESB 1 29 | CHNPRM_CrTnSl: equ 6 ;RESW 1 30 | CHNPRM_TnAcc: equ 8 ;RESW 1 31 | CHNPRM_COnOff: equ 10 ;RESB 1 32 | ;reset group 33 | 34 | CHNPRM_OnOffD: equ 11 ;RESB 1 35 | 36 | ;IX for PTDECOD here [+12] 37 | CHNPRM_OffOnD: equ 12 ;RESB 1 38 | CHNPRM_OrnPtr: equ 13 ;RESW 1 39 | CHNPRM_SamPtr: equ 15 ;RESW 1 40 | CHNPRM_NNtSkp: equ 17 ;RESB 1 41 | CHNPRM_Note: equ 18 ;RESB 1 42 | CHNPRM_SlToNt: equ 19 ;RESB 1 43 | CHNPRM_Env_En: equ 20 ;RESB 1 44 | CHNPRM_Flags: equ 21 ;RESB 1 45 | ;Enabled - 0,SimpleGliss - 2 46 | CHNPRM_TnSlDl: equ 22 ;RESB 1 47 | CHNPRM_TSlStp: equ 23 ;RESW 1 48 | CHNPRM_TnDelt: equ 25 ;RESW 1 49 | CHNPRM_NtSkCn: equ 27 ;RESB 1 50 | CHNPRM_Volume: equ 28 ;RESB 1 51 | CHNPRM_Size: equ 29 ;RESB 1 52 | ;endstruc 53 | 54 | ;struc AR 55 | AR_TonA: equ 0 ;RESW 1 56 | AR_TonB: equ 2 ;RESW 1 57 | AR_TonC: equ 4 ;RESW 1 58 | AR_Noise: equ 6 ;RESB 1 59 | AR_Mixer: equ 7 ;RESB 1 60 | AR_AmplA: equ 8 ;RESB 1 61 | AR_AmplB: equ 9 ;RESB 1 62 | AR_AmplC: equ 10 ;RESB 1 63 | AR_Env: equ 11 ;RESW 1 64 | AR_EnvTp: equ 13 ;RESB 1 65 | ;endstruc 66 | 67 | ; --- CODE STARTS HERE --- 68 | 69 | CHECKLP: LD HL,PT3_SETUP 70 | SET 7,[HL] 71 | BIT 0,[HL] 72 | RET Z 73 | POP HL 74 | LD HL,DelyCnt 75 | INC [HL] 76 | LD HL,ChanA+CHNPRM_NtSkCn 77 | INC [HL] 78 | PT3_MUTE: XOR A 79 | LD H,A 80 | LD L,A 81 | LD [AYREGS+AR_AmplA],A 82 | LD [AYREGS+AR_AmplB],HL 83 | JP ROUT_A0 84 | 85 | PT3_INIT: ;HL - AddressOfModule - 100 86 | LD [PT3_MODADDR],HL 87 | PUSH HL 88 | LD DE,100 89 | ADD HL,DE 90 | LD A,[HL] 91 | LD [PT3_Delay],A 92 | PUSH HL 93 | POP IX 94 | ADD HL,DE 95 | LD [PT3_CrPsPtr],HL 96 | LD E,[IX+102-100] 97 | ADD HL,DE 98 | INC HL 99 | LD [PT3_LPosPtr],HL 100 | POP DE 101 | LD L,[IX+103-100] 102 | LD H,[IX+104-100] 103 | ADD HL,DE 104 | LD [PT3_PatsPtr],HL 105 | LD HL,169 106 | ADD HL,DE 107 | LD [PT3_OrnPtrs],HL 108 | LD HL,105 109 | ADD HL,DE 110 | LD [PT3_SAMPTRS],HL 111 | LD HL,PT3_SETUP 112 | RES 7,[HL] 113 | 114 | ; --- CREATE PT3 VOLUME TABLE (c) Ivan Roshin, adapted by SapphiRe --- 115 | ld hl,$11 116 | ld d,h 117 | ld e,h 118 | ld IX,VT_+16 119 | ld b,15 120 | @@INITV1: push hl 121 | add hl,de 122 | ex de,hl 123 | sbc hl,hl 124 | ld c,b 125 | ld b,16 126 | @@INITV2: ld a,l 127 | rla 128 | ld a,h 129 | adc a,0 130 | ld [ix],a 131 | inc ix 132 | add hl,de 133 | djnz @@INITV2 134 | pop hl 135 | ld a,e 136 | cp $77 137 | jr nz,@@INITV3 138 | inc e 139 | @@INITV3: ld b,c 140 | djnz @@INITV1 141 | 142 | ; --- INITIALIZE PT3 VARIABLES --- 143 | XOR A 144 | LD HL,VARS 145 | LD [HL],A 146 | LD DE,VARS+1 147 | LD BC,VAR0END-VARS-1 148 | LDIR 149 | 150 | INC A 151 | LD [DelyCnt],A 152 | LD HL,$F001 ;H - CHNPRM_Volume, L - CHNPRM_NtSkCn 153 | LD [ChanA+CHNPRM_NtSkCn],HL 154 | LD [ChanB+CHNPRM_NtSkCn],HL 155 | LD [ChanC+CHNPRM_NtSkCn],HL 156 | 157 | LD HL,EMPTYSAMORN 158 | LD [PT3_AdInPtA],HL ;ptr to zero 159 | LD [ChanA+CHNPRM_OrnPtr],HL ;ornament 0 is "0,1,0" 160 | LD [ChanB+CHNPRM_OrnPtr],HL ;in all versions from 161 | LD [ChanC+CHNPRM_OrnPtr],HL ;3.xx to 3.6x and VTII 162 | 163 | LD [ChanA+CHNPRM_SamPtr],HL ;S1 There is no default 164 | LD [ChanB+CHNPRM_SamPtr],HL ;S2 sample in PT3, so, you 165 | LD [ChanC+CHNPRM_SamPtr],HL ;S3 can comment S1,2,3; see 166 | ;also EMPTYSAMORN comment 167 | RET 168 | 169 | ;pattern decoder 170 | PD_OrSm: LD [IX+(CHNPRM_Env_En-12)],0 171 | CALL SETORN 172 | LD A,[BC] 173 | INC BC 174 | RRCA 175 | 176 | PD_SAM: ADD A,A 177 | PD_SAM_: LD E,A 178 | LD D,0 179 | LD HL,[PT3_SAMPTRS] 180 | ADD HL,DE 181 | LD E,[HL] 182 | INC HL 183 | LD D,[HL] 184 | LD HL,[PT3_MODADDR] 185 | ADD HL,DE 186 | LD [IX+(CHNPRM_SamPtr-12)],L 187 | LD [IX+(CHNPRM_SamPtr+1-12)],H 188 | JR PD_LOOP 189 | 190 | PD_VOL: RLCA 191 | RLCA 192 | RLCA 193 | RLCA 194 | LD [IX+(CHNPRM_Volume-12)],A 195 | JR PD_LP2 196 | 197 | PD_EOff: LD [IX+(CHNPRM_Env_En-12)],A 198 | LD [IX+(CHNPRM_PsInOr-12)],A 199 | JR PD_LP2 200 | 201 | PD_SorE: DEC A 202 | JR NZ,PD_ENV 203 | LD A,[BC] 204 | INC BC 205 | LD [IX+(CHNPRM_NNtSkp-12)],A 206 | JR PD_LP2 207 | 208 | PD_ENV: CALL SETENV 209 | JR PD_LP2 210 | 211 | PD_ORN: CALL SETORN 212 | JR PD_LOOP 213 | 214 | PD_ESAM: LD [IX+(CHNPRM_Env_En-12)],A 215 | LD [IX+(CHNPRM_PsInOr-12)],A 216 | CALL NZ,SETENV 217 | LD A,[BC] 218 | INC BC 219 | JR PD_SAM_ 220 | 221 | PTDECOD: LD A,[IX+(CHNPRM_Note-12)] 222 | LD [PT3_PrNote],A 223 | LD L,[IX+(CHNPRM_CrTnSl-12)] 224 | LD H,[IX+(CHNPRM_CrTnSl+1-12)] 225 | LD [PT3_PrSlide],HL 226 | 227 | PD_LOOP: LD DE,$2010 228 | PD_LP2: LD A,[BC] 229 | INC BC 230 | ADD A,E 231 | JR C,PD_OrSm 232 | ADD A,D 233 | JR Z,PD_FIN 234 | JR C,PD_SAM 235 | ADD A,E 236 | JR Z,PD_REL 237 | JR C,PD_VOL 238 | ADD A,E 239 | JR Z,PD_EOff 240 | JR C,PD_SorE 241 | ADD A,96 242 | JR C,PD_NOTE 243 | ADD A,E 244 | JR C,PD_ORN 245 | ADD A,D 246 | JR C,PD_NOIS 247 | ADD A,E 248 | JR C,PD_ESAM 249 | ADD A,A 250 | LD E,A 251 | LD HL,SPCCOMS.HL_VALUE 252 | ADD HL,DE 253 | LD E,[HL] 254 | INC HL 255 | LD D,[HL] 256 | PUSH DE 257 | JR PD_LOOP 258 | 259 | PD_NOIS: LD [Ns_Base],A 260 | JR PD_LP2 261 | 262 | PD_REL: RES 0,[IX+(CHNPRM_Flags-12)] 263 | JR PD_RES 264 | 265 | PD_NOTE: LD [IX+(CHNPRM_Note-12)],A 266 | SET 0,[IX+(CHNPRM_Flags-12)] 267 | XOR A 268 | 269 | PD_RES: LD [PT3_PDSP],SP 270 | LD SP,IX 271 | LD H,A 272 | LD L,A 273 | PUSH HL 274 | PUSH HL 275 | PUSH HL 276 | PUSH HL 277 | PUSH HL 278 | PUSH HL 279 | LD SP,[PT3_PDSP] 280 | 281 | PD_FIN: LD A,[IX+(CHNPRM_NNtSkp-12)] 282 | LD [IX+(CHNPRM_NtSkCn-12)],A 283 | RET 284 | 285 | C_PORTM: RES 2,[IX+(CHNPRM_Flags-12)] 286 | LD A,[BC] 287 | INC BC 288 | ;SKIP PRECALCULATED TONE DELTA [BECAUSE 289 | ;CANNOT BE RIGHT AFTER PT3 COMPILATION] 290 | INC BC 291 | INC BC 292 | LD [IX+(CHNPRM_TnSlDl-12)],A 293 | LD [IX+(CHNPRM_TSlCnt-12)],A 294 | LD DE,NT_ 295 | LD A,[IX+(CHNPRM_Note-12)] 296 | LD [IX+(CHNPRM_SlToNt-12)],A 297 | ADD A,A 298 | LD L,A 299 | LD H,0 300 | ADD HL,DE 301 | LD A,[HL] 302 | INC HL 303 | LD H,[HL] 304 | LD L,A 305 | PUSH HL 306 | LD A,[PT3_PrNote] 307 | LD [IX+(CHNPRM_Note-12)],A 308 | ADD A,A 309 | LD L,A 310 | LD H,0 311 | ADD HL,DE 312 | LD E,[HL] 313 | INC HL 314 | LD D,[HL] 315 | POP HL 316 | SBC HL,DE 317 | LD [IX+(CHNPRM_TnDelt-12)],L 318 | LD [IX+(CHNPRM_TnDelt+1-12)],H 319 | LD DE,[PT3_PrSlide] 320 | LD [IX+(CHNPRM_CrTnSl-12)],E 321 | LD [IX+(CHNPRM_CrTnSl+1-12)],D 322 | LD A,[BC] ;SIGNED TONE STEP 323 | INC BC 324 | EX AF,AF' 325 | LD A,[BC] 326 | INC BC 327 | AND A 328 | JR Z,@@NOSIG 329 | EX DE,HL 330 | @@NOSIG: SBC HL,DE 331 | JP P,SET_STP 332 | CPL 333 | EX AF,AF' 334 | NEG 335 | EX AF,AF' 336 | SET_STP: LD [IX+(CHNPRM_TSlStp+1-12)],A 337 | EX AF,AF' 338 | LD [IX+(CHNPRM_TSlStp-12)],A 339 | LD [IX+(CHNPRM_COnOff-12)],0 340 | RET 341 | 342 | C_GLISS: SET 2,[IX+(CHNPRM_Flags-12)] 343 | LD A,[BC] 344 | INC BC 345 | LD [IX+(CHNPRM_TnSlDl-12)],A 346 | LD [IX+(CHNPRM_TSlCnt-12)],A 347 | LD A,[BC] 348 | INC BC 349 | EX AF,AF' 350 | LD A,[BC] 351 | INC BC 352 | JR SET_STP 353 | 354 | C_SMPOS: LD A,[BC] 355 | INC BC 356 | LD [IX+(CHNPRM_PsInSm-12)],A 357 | RET 358 | 359 | C_ORPOS: LD A,[BC] 360 | INC BC 361 | LD [IX+(CHNPRM_PsInOr-12)],A 362 | RET 363 | 364 | C_VIBRT: LD A,[BC] 365 | INC BC 366 | LD [IX+(CHNPRM_OnOffD-12)],A 367 | LD [IX+(CHNPRM_COnOff-12)],A 368 | LD A,[BC] 369 | INC BC 370 | LD [IX+(CHNPRM_OffOnD-12)],A 371 | XOR A 372 | LD [IX+(CHNPRM_TSlCnt-12)],A 373 | LD [IX+(CHNPRM_CrTnSl-12)],A 374 | LD [IX+(CHNPRM_CrTnSl+1-12)],A 375 | RET 376 | 377 | C_ENGLS: LD A,[BC] 378 | INC BC 379 | LD [PT3_Env_Del],A 380 | LD [CurEDel],A 381 | LD A,[BC] 382 | INC BC 383 | LD L,A 384 | LD A,[BC] 385 | INC BC 386 | LD H,A 387 | LD [PT3_ESldAdd],HL 388 | RET 389 | 390 | C_DELAY: LD A,[BC] 391 | INC BC 392 | LD [PT3_Delay],A 393 | RET 394 | 395 | SETENV: LD [IX+(CHNPRM_Env_En-12)],E 396 | LD [AYREGS+AR_EnvTp],A 397 | LD A,[BC] 398 | INC BC 399 | LD H,A 400 | LD A,[BC] 401 | INC BC 402 | LD L,A 403 | LD [EnvBase],HL 404 | XOR A 405 | LD [IX+(CHNPRM_PsInOr-12)],A 406 | LD [CurEDel],A 407 | LD H,A 408 | LD L,A 409 | LD [CurESld],HL 410 | C_NOP: RET 411 | 412 | SETORN: ADD A,A 413 | LD E,A 414 | LD D,0 415 | LD [IX+(CHNPRM_PsInOr-12)],D 416 | LD HL,[PT3_OrnPtrs] 417 | ADD HL,DE 418 | LD E,[HL] 419 | INC HL 420 | LD D,[HL] 421 | LD HL,[PT3_MODADDR] 422 | ADD HL,DE 423 | LD [IX+(CHNPRM_OrnPtr-12)],L 424 | LD [IX+(CHNPRM_OrnPtr+1-12)],H 425 | RET 426 | 427 | ;ALL 16 ADDRESSES TO PROTECT FROM BROKEN PT3 MODULES 428 | SPCCOMS: dw C_NOP 429 | dw C_GLISS 430 | dw C_PORTM 431 | dw C_SMPOS 432 | dw C_ORPOS 433 | dw C_VIBRT 434 | dw C_NOP 435 | dw C_NOP 436 | dw C_ENGLS 437 | dw C_DELAY 438 | dw C_NOP 439 | dw C_NOP 440 | dw C_NOP 441 | dw C_NOP 442 | dw C_NOP 443 | dw C_NOP 444 | .HL_VALUE: equ (SPCCOMS+$DF20) MOD 65536; Adapted from original Speccy version (saves 6 bytes) 445 | 446 | CHREGS: XOR A 447 | LD [AYREGS+AR_AmplC],A 448 | BIT 0,[IX+CHNPRM_Flags] 449 | PUSH HL 450 | JP Z,@@CH_EXIT 451 | LD [PT3_CSP],SP 452 | LD L,[IX+CHNPRM_OrnPtr] 453 | LD H,[IX+CHNPRM_OrnPtr+1] 454 | LD SP,HL 455 | POP DE 456 | LD H,A 457 | LD A,[IX+CHNPRM_PsInOr] 458 | LD L,A 459 | ADD HL,SP 460 | INC A 461 | CP D 462 | JR C,@@CH_ORPS 463 | LD A,E 464 | @@CH_ORPS: LD [IX+CHNPRM_PsInOr],A 465 | LD A,[IX+CHNPRM_Note] 466 | ADD A,[HL] 467 | JP P,@@CH_NTP 468 | XOR A 469 | @@CH_NTP: CP 96 470 | JR C,@@CH_NOK 471 | LD A,95 472 | @@CH_NOK: ADD A,A 473 | EX AF,AF' 474 | LD L,[IX+CHNPRM_SamPtr] 475 | LD H,[IX+CHNPRM_SamPtr+1] 476 | LD SP,HL 477 | POP DE 478 | LD H,0 479 | LD A,[IX+CHNPRM_PsInSm] 480 | LD B,A 481 | ADD A,A 482 | ADD A,A 483 | LD L,A 484 | ADD HL,SP 485 | LD SP,HL 486 | LD A,B 487 | INC A 488 | CP D 489 | JR C,@@CH_SMPS 490 | LD A,E 491 | @@CH_SMPS: LD [IX+CHNPRM_PsInSm],A 492 | POP BC 493 | POP HL 494 | LD E,[IX+CHNPRM_TnAcc] 495 | LD D,[IX+CHNPRM_TnAcc+1] 496 | ADD HL,DE 497 | BIT 6,B 498 | JR Z,@@CH_NOAC 499 | LD [IX+CHNPRM_TnAcc],L 500 | LD [IX+CHNPRM_TnAcc+1],H 501 | @@CH_NOAC: EX DE,HL 502 | EX AF,AF' 503 | LD L,A 504 | LD H,0 505 | LD SP,NT_ 506 | ADD HL,SP 507 | LD SP,HL 508 | POP HL 509 | ADD HL,DE 510 | LD E,[IX+CHNPRM_CrTnSl] 511 | LD D,[IX+CHNPRM_CrTnSl+1] 512 | ADD HL,DE 513 | LD SP,[PT3_CSP] 514 | EX [SP],HL 515 | XOR A 516 | OR [IX+CHNPRM_TSlCnt] 517 | JR Z,@@CH_AMP 518 | DEC [IX+CHNPRM_TSlCnt] 519 | JR NZ,@@CH_AMP 520 | LD A,[IX+CHNPRM_TnSlDl] 521 | LD [IX+CHNPRM_TSlCnt],A 522 | LD L,[IX+CHNPRM_TSlStp] 523 | LD H,[IX+CHNPRM_TSlStp+1] 524 | LD A,H 525 | ADD HL,DE 526 | LD [IX+CHNPRM_CrTnSl],L 527 | LD [IX+CHNPRM_CrTnSl+1],H 528 | BIT 2,[IX+CHNPRM_Flags] 529 | JR NZ,@@CH_AMP 530 | LD E,[IX+CHNPRM_TnDelt] 531 | LD D,[IX+CHNPRM_TnDelt+1] 532 | AND A 533 | JR Z,@@CH_STPP 534 | EX DE,HL 535 | @@CH_STPP: SBC HL,DE 536 | JP M,@@CH_AMP 537 | LD A,[IX+CHNPRM_SlToNt] 538 | LD [IX+CHNPRM_Note],A 539 | XOR A 540 | LD [IX+CHNPRM_TSlCnt],A 541 | LD [IX+CHNPRM_CrTnSl],A 542 | LD [IX+CHNPRM_CrTnSl+1],A 543 | @@CH_AMP: LD A,[IX+CHNPRM_CrAmSl] 544 | BIT 7,C 545 | JR Z,@@CH_NOAM 546 | BIT 6,C 547 | JR Z,@@CH_AMIN 548 | CP 15 549 | JR Z,@@CH_NOAM 550 | INC A 551 | JR @@CH_SVAM 552 | @@CH_AMIN: CP -15 553 | JR Z,@@CH_NOAM 554 | DEC A 555 | @@CH_SVAM: LD [IX+CHNPRM_CrAmSl],A 556 | @@CH_NOAM: LD L,A 557 | LD A,B 558 | AND 15 559 | ADD A,L 560 | JP P,@@CH_APOS 561 | XOR A 562 | @@CH_APOS: CP 16 563 | JR C,@@CH_VOL 564 | LD A,15 565 | @@CH_VOL: OR [IX+CHNPRM_Volume] 566 | LD L,A 567 | LD H,0 568 | LD DE,VT_ 569 | ADD HL,DE 570 | LD A,[HL] 571 | @@CH_ENV: BIT 0,C 572 | JR NZ,@@CH_NOEN 573 | OR [IX+CHNPRM_Env_En] 574 | @@CH_NOEN: LD [AYREGS+AR_AmplC],A 575 | BIT 7,B 576 | LD A,C 577 | JR Z,@@NO_ENSL 578 | RLA 579 | RLA 580 | SRA A 581 | SRA A 582 | SRA A 583 | ADD A,[IX+CHNPRM_CrEnSl] ;SEE COMMENT BELOW 584 | BIT 5,B 585 | JR Z,@@NO_ENAC 586 | LD [IX+CHNPRM_CrEnSl],A 587 | @@NO_ENAC: LD HL,PT3_AddToEn 588 | ADD A,[HL] ;BUG IN PT3 - NEED WORD HERE. 589 | ;FIX IT IN NEXT VERSION? 590 | LD [HL],A 591 | JR @@CH_MIX 592 | @@NO_ENSL: RRA 593 | ADD A,[IX+CHNPRM_CrNsSl] 594 | LD [AddToNs],A 595 | BIT 5,B 596 | JR Z,@@CH_MIX 597 | LD [IX+CHNPRM_CrNsSl],A 598 | @@CH_MIX: LD A,B 599 | RRA 600 | AND $48 601 | @@CH_EXIT: LD HL,AYREGS+AR_Mixer 602 | OR [HL] 603 | RRCA 604 | LD [HL],A 605 | POP HL 606 | XOR A 607 | OR [IX+CHNPRM_COnOff] 608 | RET Z 609 | DEC [IX+CHNPRM_COnOff] 610 | RET NZ 611 | XOR [IX+CHNPRM_Flags] 612 | LD [IX+CHNPRM_Flags],A 613 | RRA 614 | LD A,[IX+CHNPRM_OnOffD] 615 | JR C,@@CH_ONDL 616 | LD A,[IX+CHNPRM_OffOnD] 617 | @@CH_ONDL: LD [IX+CHNPRM_COnOff],A 618 | RET 619 | 620 | PT3_PLAY: XOR A 621 | LD [PT3_AddToEn],A 622 | LD [AYREGS+AR_Mixer],A 623 | DEC A 624 | LD [AYREGS+AR_EnvTp],A 625 | LD HL,DelyCnt 626 | DEC [HL] 627 | JP NZ,@@PL2 628 | LD HL,ChanA+CHNPRM_NtSkCn 629 | DEC [HL] 630 | JR NZ,@@PL1B 631 | LD BC,[PT3_AdInPtA] 632 | LD A,[BC] 633 | AND A 634 | JR NZ,@@PL1A 635 | LD D,A 636 | LD [Ns_Base],A 637 | LD HL,[PT3_CrPsPtr] 638 | INC HL 639 | LD A,[HL] 640 | INC A 641 | JR NZ,@@PLNLP 642 | CALL CHECKLP 643 | LD HL,[PT3_LPosPtr] 644 | LD A,[HL] 645 | INC A 646 | @@PLNLP: LD [PT3_CrPsPtr],HL 647 | DEC A 648 | ADD A,A 649 | LD E,A 650 | RL D 651 | LD HL,[PT3_PatsPtr] 652 | ADD HL,DE 653 | LD DE,[PT3_MODADDR] 654 | LD [PT3_PSP],SP 655 | LD SP,HL 656 | POP HL 657 | ADD HL,DE 658 | LD B,H 659 | LD C,L 660 | POP HL 661 | ADD HL,DE 662 | LD [PT3_AdInPtB],HL 663 | POP HL 664 | ADD HL,DE 665 | LD [PT3_AdInPtC],HL 666 | LD SP,[PT3_PSP] 667 | 668 | @@PL1A: LD IX,ChanA+12 669 | CALL PTDECOD 670 | LD [PT3_AdInPtA],BC 671 | 672 | @@PL1B: LD HL,ChanB+CHNPRM_NtSkCn 673 | DEC [HL] 674 | JR NZ,@@PL1C 675 | LD IX,ChanB+12 676 | LD BC,[PT3_AdInPtB] 677 | CALL PTDECOD 678 | LD [PT3_AdInPtB],BC 679 | 680 | @@PL1C: LD HL,ChanC+CHNPRM_NtSkCn 681 | DEC [HL] 682 | JR NZ,@@PL1D 683 | LD IX,ChanC+12 684 | LD BC,[PT3_AdInPtC] 685 | CALL PTDECOD 686 | LD [PT3_AdInPtC],BC 687 | 688 | @@PL1D: LD A,[PT3_Delay] 689 | LD [DelyCnt],A 690 | 691 | @@PL2: LD IX,ChanA 692 | LD HL,[AYREGS+AR_TonA] 693 | CALL CHREGS 694 | LD [AYREGS+AR_TonA],HL 695 | LD A,[AYREGS+AR_AmplC] 696 | LD [AYREGS+AR_AmplA],A 697 | LD IX,ChanB 698 | LD HL,[AYREGS+AR_TonB] 699 | CALL CHREGS 700 | LD [AYREGS+AR_TonB],HL 701 | LD A,[AYREGS+AR_AmplC] 702 | LD [AYREGS+AR_AmplB],A 703 | LD IX,ChanC 704 | LD HL,[AYREGS+AR_TonC] 705 | CALL CHREGS 706 | LD [AYREGS+AR_TonC],HL 707 | 708 | LD HL,[Ns_Base_AddToNs] 709 | LD A,H 710 | ADD A,L 711 | LD [AYREGS+AR_Noise],A 712 | 713 | LD A,[PT3_AddToEn] 714 | LD E,A 715 | ADD A,A 716 | SBC A,A 717 | LD D,A 718 | LD HL,[EnvBase] 719 | ADD HL,DE 720 | LD DE,[CurESld] 721 | ADD HL,DE 722 | LD [AYREGS+AR_Env],HL 723 | 724 | XOR A 725 | LD HL,CurEDel 726 | OR [HL] 727 | RET Z 728 | DEC [HL] 729 | RET NZ 730 | LD A,[PT3_Env_Del] 731 | LD [HL],A 732 | LD HL,[PT3_ESldAdd] 733 | ADD HL,DE 734 | LD [CurESld],HL 735 | RET 736 | 737 | PT3_ROUT: XOR A 738 | 739 | ROUT_A0: ; --- FIXES BITS 6 AND 7 OF MIXER --- 740 | LD HL,AYREGS+AR_Mixer 741 | set 7,[hl] 742 | res 6,[hl] 743 | 744 | LD C,$A0 745 | LD HL,AYREGS 746 | @@LOUT: OUT [C],A 747 | INC C 748 | OUTI 749 | DEC C 750 | INC A 751 | CP 13 752 | JR NZ,@@LOUT 753 | OUT [C],A 754 | LD A,[HL] 755 | AND A 756 | RET M 757 | INC C 758 | OUT [C],A 759 | RET 760 | 761 | EMPTYSAMORN: db 0,1,0,$90 ;delete $90 if you don't need default sample 762 | 763 | NT_: ;Note table 2 [if you use another in Vortex Tracker II copy it and paste 764 | ;it from TABLES.TXT] 765 | 766 | dw $0D10,$0C55,$0BA4,$0AFC,$0A5F,$09CA,$093D,$08B8,$083B,$07C5,$0755,$06EC 767 | dw $0688,$062A,$05D2,$057E,$052F,$04E5,$049E,$045C,$041D,$03E2,$03AB,$0376 768 | dw $0344,$0315,$02E9,$02BF,$0298,$0272,$024F,$022E,$020F,$01F1,$01D5,$01BB 769 | dw $01A2,$018B,$0174,$0160,$014C,$0139,$0128,$0117,$0107,$00F9,$00EB,$00DD 770 | dw $00D1,$00C5,$00BA,$00B0,$00A6,$009D,$0094,$008C,$0084,$007C,$0075,$006F 771 | dw $0069,$0063,$005D,$0058,$0053,$004E,$004A,$0046,$0042,$003E,$003B,$0037 772 | dw $0034,$0031,$002F,$002C,$0029,$0027,$0025,$0023,$0021,$001F,$001D,$001C 773 | dw $001A,$0019,$0017,$0016,$0015,$0014,$0012,$0011,$0010,$000F,$000E,$000D 774 | -------------------------------------------------------------------------------- /bin/tniasm.txt: -------------------------------------------------------------------------------- 1 | --------------------------------------------------------------------------- 2 | tniASM v0.45 3 | (c) 2000-2011 by The New Image 4 | 5 | Programmed by Patriek Lesparre 6 | 7 | http://tniasm.tni.nl/ 8 | e-mail: tniasm@tni.nl 9 | --------------------------------------------------------------------------- 10 | 11 | Chapter 1: Introduction 12 | ----------------------- 13 | 14 | 1.1 What is it? 15 | 16 | tniASM is a cross assembler for Z80, R800 and GBZ80. Some of its 17 | features are: 18 | 19 | - Multi-pass design 20 | - Conditional assembly 21 | - Local label mechanism 22 | - Extensive 32 bit expression parser with precedence levels 23 | - Source and binary file inclusion 24 | - Nestable block comments 25 | - Multi file output and file patching 26 | 27 | 1.2 Why? 28 | 29 | Why would anyone write another assembler? Good question! First, 30 | I needed to learn C and there's no better way to learn a new 31 | language than to write a program in it you need. That brings me to 32 | the second reason I wrote tniASM, which is that none of the other 33 | cross assemblers I know had the features I wanted/needed. 34 | 35 | Because of that, and perhaps the fact that I've never written a 36 | assembler/compiler before, tniASM is not like other assemblers. It 37 | has many peculiarities and frankly, you might find it a bit weird. 38 | Nevertheless, it suits my purposes perfectly and I hope it does 39 | yours too. 40 | 41 | 1.3 tniASM and Passes 42 | 43 | Most assemblers have 2 passes, one to gather information on labels 44 | and another to handle forward references and generate the output. 45 | 46 | tniASM goes about it differently. The output generation is a pass 47 | by itself, and before that tniASM will do as many passes as is 48 | needed to evaluate all expressions. 49 | 50 | Basically it means that tniASM will make 2 passes PLUS an extra 51 | pass for every level of forward referencing, up to 5 passes total. 52 | 53 | 1.4 tniASM Assembler Syntax 54 | 55 | tniASM has its own assembler syntax for the processors it supports. 56 | Don't be alarmed though, the changes are minimal. See chapters 57 | 2.7 and on for differences between standard rules. 58 | 59 | 1.5 Using tniASM 60 | 61 | tniASM is very easy to use. Just type: 62 | 63 | tniasm filename 64 | 65 | tniASM will then try to assemble 'filename' and output the 66 | generated machine code to 'tniasm.out'. 67 | 68 | If a filename without extension is given and there's an error, 69 | tniASM will add a ".asm" extension and try again. 70 | 71 | If you want to use a different output filename than 'tniasm.out' 72 | and you don't want to use the FNAME pseudo instruction, you can 73 | add a second filename to the command line and tniASM will use that 74 | as output. 75 | 76 | 1.5.1 tniASM Output 77 | 78 | As said in chapter 1.5, tniASM will normally output machine code to 79 | a file called 'tniasm.out'. You can change this by using the FNAME 80 | instruction (see chapter 2.5.5). 81 | 82 | tniASM will also output a symbol table file, called 'tniasm.sym', 83 | which contains the value of all labels in your program. It's in the 84 | form 'label: EQU value' so it can be INCLUDEd in external files 85 | directly. 86 | 87 | Besides these files, tniASM also creates a temporary file called 88 | 'tniasm.tmp' strictly for internal use. 89 | 90 | Chapter 2: The tniASM Language 91 | ------------------------------ 92 | 93 | 2.1 Case-sensitivity 94 | 95 | In short, there is none. 'LabelA' and 'labela' are exactly the same 96 | to tniASM, as are 'ldir' and 'LdiR'. 97 | 98 | 2.2 Layout of a tniASM Source Line 99 | 100 | This is a point where tniASM differs a lot from most assemblers. 101 | Usually a source line is layed out like this: 102 | 103 | [label:] [instruction [operands]] [;comment] 104 | 105 | Which means it allows any combination of the 3 fields 'label', 106 | 'instruction' and 'comment'. 107 | 108 | In a way tniASM uses the same layout, but it allows any number of 109 | label definitions and instructions on a single line. Only the 110 | comment field can exist only once. The layout is best described: 111 | 112 | [ [label:] | [instruction [operands]] ]* [;comment] 113 | 114 | This means that tniASM is perfectly happy to assemble a line like: 115 | 116 | start: JP begin exit: LD BC,0042h CALL dos begin: LD DE,text 117 | 118 | In addition to this freedom, tniASM places no restrictions on white 119 | space within a line. For example, labels may have white space 120 | before them and instructions may have no space before them, which 121 | also means instructions can directly follow a label definition. 122 | The same counts for comments. 123 | 124 | 2.2.1 More on Labels 125 | 126 | A label definition must end in a colon (':'). The length of a label 127 | is practically unlimited. Valid characters in labels are letters, 128 | numbers, '_', '.', '?', '!', '~', '@', and '#'. The first character 129 | of a label may not be a number. 130 | 131 | It is allowed to define reserved words (like 'pop', 'ld' or 'hl') 132 | as labels, but they must be prefixed with '&' when used. 133 | So you can code: 134 | 135 | call &pop 136 | {...} 137 | pop: pop hl 138 | pop de 139 | pop bc 140 | jp [hl] 141 | 142 | tniASM also supports local labels. A local label is always local to 143 | the previous non-local label in the source code. A label is local 144 | when the first character is a '.'. 145 | 146 | An example will clarify: 147 | 148 | main: ld b,8 149 | .loop: call doSomething 150 | djnz .loop 151 | 152 | sub: ld b,8 153 | .loop: call doSomething 154 | djnz .loop 155 | 156 | In the above code four seperate labels are defined: "main", 157 | "main.loop", "sub", "sub.loop". 158 | Because of this behaviour, you can also access local labels outside 159 | the scope of the current non-local label. Like so: 160 | 161 | main: {...} 162 | .end: ret 163 | 164 | sub: {...} 165 | jp main.end 166 | .end: ret 167 | 168 | Or the other way around, create labels that are local outside of 169 | the scope of the current non-local label: 170 | 171 | main: ld a,[.value] 172 | {...} 173 | 174 | sub: {...} 175 | 176 | main.value: db 0 177 | 178 | 2.2.2 The Line-seperator 179 | 180 | The '|' character is used as a line seperator. You can use it to 181 | have more than one instruction on a line. In fact the line- 182 | seperator is not needed most of the time, since tniASM can figure 183 | out by itself that the line "add a,a call jump ret" are actually 3 184 | different instructions. Seperating the instructions with '|' is 185 | just nicer to look at and perhaps better to understand. However, in 186 | a line like "add a,34 and 3 xor 255" tniASM assumes you mean 187 | "add a,253" and not 3 seperate instructions. To make sure tniASM 188 | generates the code you want, use the line-seperator. 189 | 190 | 2.2.3 More on Comments 191 | 192 | As usual the semi-colon (';') is used as the comment-character. It 193 | can be placed anywhere on a line and everthing behind it is ignored 194 | until a new line. 195 | 196 | Besides the normal comments, tniASM also supports comment blocks. 197 | The '{' and '}' characters respectively mark the beginning and the 198 | end of a comment-block. They can be placed anywhere in a file, and 199 | everthing between them is ignored. Comment-blocks are nestable with 200 | a practically infinite nesting depth. 201 | 202 | 2.3 Constants 203 | 204 | There are 3 different kinds of constants in tniASM: numeric, 205 | character and string. Since tniASM is a 32 bit assembler, constants 206 | are 32 bit signed integer values, ranging from -2147483648 207 | (80000000h) to 2147483647 (7FFFFFFFh). 208 | 209 | 2.3.1 Numeric Constants 210 | 211 | Numeric constants can be represented in decimal, hexadecimal, 212 | binary or octal. The supported forms are as follows: 213 | 214 | Decimal : 123 215 | 123d 216 | Hexadecimal: 1234h (cannot start with a letter, use '0ABCDh' etc.) 217 | $1234 218 | 0x1234 219 | Binary : 11100100b (may contain white space, ie. '1110 0100 b') 220 | %11100100 ( " " " " " '% 1110 0100') 221 | Octal : 123o 222 | 123q 223 | 224 | 2.3.2 String Constants 225 | 226 | A string constant is anything between single or double qoutes 227 | larger than 4 characters. They're used in commands like DB/DW, 228 | INCLUDE and FNAME. String constants can not be used in regular 229 | expressions. 230 | 231 | example: 232 | DB "a 'double-qouted' string can contain single qoutes" 233 | DB 'and a "single-qouted" string can contain double qoutes' 234 | 235 | 2.3.3 Character Constants 236 | 237 | Character constants follow the same rules as strings, except that 238 | they can be used in expressions. They can be up to 4 characters in 239 | size, and are stored low-byte first. The constant 'A' is thus 240 | handled as 41h, 'AB' as 4241h (or 41h,42h), 'ABC' as 434241h 241 | (41h,42h,43h) and 'ABCD' as 44434241h (41h,42h,43h,44h). 242 | In DB/DW, character constants are always considered to be a string 243 | constant, except inside an expression. 244 | 245 | example: 246 | DB 'abcd' ; is 'a','b','c','d'. 247 | DB +"abcd",1+'a' ; is 'a','b'. Since both strings are inside 248 | ; of an expression, they're treated as a 249 | ; character constant. 250 | DB 'a'+1 ; is an error, because 'a' is not considered 251 | ; to be inside the expression. 252 | DB ('abcd' >> 8) ; is 'b' 253 | 254 | 2.4 Expressions 255 | 256 | Expressions are evaluated in 32 bit signed integer arithmetic. An 257 | expression consists of one or more constants, combined with zero or 258 | more operators. Two special tokens can be used in expressions: '$' 259 | and '$$'. They are the assembly position (program counter) and file 260 | position respectively, at the beginning of the current instruction. 261 | 262 | One could code: 263 | 264 | nop 265 | nop 266 | jr $-2 ; jump to the first nop 267 | 268 | All supported operators are listed below, starting with the lowest 269 | precedence-level. Operators with equal precedence are evaluated 270 | from left to right. 271 | 272 | Ofcourse any precedence can be overridden with the parenthesis '(' 273 | and ')'. 274 | 275 | 2.4.1 Precedence Level 0 - Relational Operators 276 | 277 | The relational operators are: 278 | 279 | x = y equals 280 | x <> y not equals 281 | x >< y " " 282 | x != y " " 283 | x < y less than 284 | x > y more than 285 | x <= y less than or equals 286 | x =< y " " " " 287 | x >= y more than or equals 288 | x => y " " " " 289 | 290 | Unlike in the C-language, the relational operators use -1 for 'true' 291 | and 0 for 'false' (in stead of 1 and 0). This way there's no need 292 | for boolean versions of the AND, OR and XOR operators, since they 293 | work in exactly the same way as the bitwise ones. 294 | 295 | The relational operators allow for complex expressions such as: 296 | 297 | x*(1+2*(x<0)) 298 | 299 | which gives the absolute value of 'x'. 300 | 301 | 2.4.2 Precedence Level 1 - Additive and (X)OR Operators 302 | 303 | These should speak for themselves. tniASM chooses to use 'OR' and 304 | 'XOR' keywords (as in BASIC) in stead of '|' and '^' characters (as 305 | in C). 306 | 307 | x + y Addition 308 | x - y Subtraction 309 | 310 | x OR y Bitwise OR 311 | x XOR y Bitwise XOR 312 | 313 | 2.4.3 Precedence Level 2 - Multiplicative and AND Operators 314 | 315 | x ^ y Exponentiation 316 | x * y Multiplication 317 | x / y Division 318 | x MOD y Modulo 319 | 320 | x << y Shift Left 321 | x >> y Shift Right (unsigned) 322 | 323 | x AND y Bitwise AND 324 | 325 | 2.4.4 Precedence Level 3 - Unary Operators 326 | 327 | + x unary plus 328 | - x unary minus 329 | NOT x one's complement 330 | 331 | 2.5 Pseudo Instructions 332 | 333 | 2.5.1 DB/DW 334 | 335 | Define a (string of) byte(s)/word(s). 336 | 337 | DB 255 338 | DB "bla",13,10 339 | DW 'AB',4000h 340 | DW "string may be odd" ; odd strings are 0-padded 341 | 342 | 2.5.2 DC 343 | 344 | Defines a string terminated by bit 7 being set. 345 | 346 | DC "TOKEN" ; same as DB "TOKE","N" OR 128 347 | DC "LIST","STOP" ; defines 2 strings, both bit 7 terminated. 348 | 349 | 2.5.3 DS 350 | 351 | Define space (in bytes). 352 | 353 | DS 10 ; defines 10 bytes of 0 354 | DS 10,255 ; defines 10 bytes of 255 355 | DS 4000h-$ ; pad with 0 until address 4000h 356 | DS 0 ; doesn't do anything 357 | DS -1 ; the same goes for negative values 358 | 359 | 2.5.4 EQU 360 | 361 | Assign a value to a label. An EQU must follow a label on the same 362 | line. 363 | 364 | bankstart: EQU 4000h 365 | ORG bankstart ; same as org 4000h 366 | 367 | 2.5.5 FNAME 368 | 369 | Specify output file. Use FNAME to make tniASM output to a file 370 | other than 'tniasm.out'. You can use FNAME as much as you like 371 | throughout your source code in order to output different parts to 372 | different files. 373 | FNAME also sets FORG to 0. 374 | 375 | FNAME "output.bin" ; output file is now 'output.bin' 376 | {...} 377 | 378 | In stead of creating a new file, you can also instruct tniASM to 379 | output to an existing file by specifying a second parameter to 380 | FNAME. This second parameter is the file position where tniASM will 381 | output to, and FORG is automatically set with this value. 382 | 383 | FNAME "output.bin",1024 ; output starts at position 1024 in the 384 | ; existing file 'output.bin' 385 | FNAME "output.bin",0 ; output starts at position 0, like normal, 386 | ; but in an existing 'output.bin' 387 | 388 | 2.5.6 FORG 389 | 390 | Set output file position. You can use FORG to cause tniASM to 391 | output at a certain file position. If the position is larger than 392 | the file it will be padded with 0's. 393 | When no FORG is given, the starting file position will be 0. 394 | 395 | 2.5.7 INCBIN 396 | 397 | Include binary file. The INCBIN instruction includes a binary file 398 | in the current machine code output. It's particularly useful for 399 | embedding graphics or large tables that you wouldn't want to have 400 | in huge DB lists. 401 | 402 | music1: INCBIN "music1.bin" 403 | .end: 404 | 405 | INCBIN optionally takes 1 or 2 more parameters. The first is the 406 | offset in the file to be included. The second is the total length 407 | of data to be included. 408 | 409 | INCBIN "basic.bin",7 ; include from offset 7 410 | INCBIN "cutout.bin",1024,512 ; include 512 bytes from 411 | ; offset 1024 412 | 413 | 2.5.8 INCLUDE 414 | 415 | The INCLUDE instruction includes another file in the current source 416 | file, in nesting levels as deep as memory permits. 417 | 418 | {...} 419 | INCLUDE "incthis.asm" 420 | {...} 421 | 422 | 2.5.9 ORG 423 | 424 | ORG allows one or two arguments. The first sets the assembly 425 | position (program counter) to an address, while the second argument 426 | gives the maximum allowable address for this 'section'. If the 427 | address is exceeded, tniASM will issue a warning. This warning 428 | ignores any PHASE'ing. 429 | When no ORG is given, the starting assembly position will be 0. 430 | 431 | ORG 0c000h ; following code starts as if from 0c000h 432 | ORG 0c000h,0 ; same as above 433 | ORG 4000h,7FFFh ; start from 4000h, warn if exceeding 7FFFh 434 | 435 | 2.5.10 PHASE/DEPHASE 436 | 437 | PHASE 'phases' the assembly position to the address specified. This 438 | is particularly useful for code that gets relocated later. DEPHASE 439 | phases back to the normal assembly position. 440 | A new PHASE or ORG command DEPHASE's any previous PHASE'ing. 441 | 442 | ; this example relocates the routine SetS#0 from its current 443 | ; address to 0C000h. Because of the PHASE/DEPHASE its label 444 | ; 'SetS#0' already points to 0C000h. 445 | 446 | ORG 8000h 447 | 448 | ld hl,start 449 | ld de,SetS#0 450 | ld bc,SetS#0.end-SetS#0.start 451 | ldir 452 | 453 | {...} 454 | 455 | SetS#0.start: 456 | PHASE 0C000h 457 | SetS#0: xor a ; set V9938 S#0 458 | out [99h],a 459 | ld a,15+128 460 | out [99h],a 461 | ret 462 | DEPHASE 463 | .end: 464 | 465 | 2.5.11 RB/RW 466 | 467 | Reserve a (number of) byte(s)/word(s) as uninitialised data. This 468 | is basically the same as DS, but does not update the file position, 469 | neither does it output anything. It merely updates the assembly 470 | position. RB and RW are useful when declaring variables in RAM. 471 | 472 | ORG 0C000h 473 | Var1: RB 2 ; Var1 = 0C000h 474 | Var2: RW 1 ; Var2 = 0C002h 475 | Var3: RB 0 ; Var3 = 0C004h 476 | Var4: RW -1 ; Var4 = 0C004h because zero and 477 | ; negative values are ignored 478 | 479 | 2.6 Conditional Assembly 480 | 481 | Sometimes it's useful to have a certain piece of code assemble only 482 | when certain conditions are met. For instance when writing code for 483 | multiple platforms at the same time (Z80 and R800 for example), or 484 | for including/excluding debug code. 485 | 486 | tniASM provides this functionality through the IF-construct. Its 487 | basic form is: 488 | 489 | IF {operand} [{...}] [ELSE [{...}]] ENDIF 490 | 491 | Note that due to the multi-pass nature of tniASM, it's allowed to 492 | use forward references in IF-constructs. They may also be used 493 | accross source file boundaries. Ofcourse IF's can be nested with a 494 | practically infinite depth. 495 | 496 | 2.6.1 IF {expression} 497 | 498 | The expression is evaluated and is considered 'false' when zero, 499 | while any non-zero result is considered 'true'. 500 | 501 | loop: {...} 502 | 503 | IF $-loop < 128 504 | djnz loop 505 | ELSE 506 | dec b 507 | jp nz,loop 508 | ENDIF 509 | 510 | 2.6.2 IFDEF {label} 511 | 512 | Check if a label was previously declared this pass. 513 | 514 | R800: ; comment away for Z80 version 515 | 516 | IFDEF R800 mulub a,b ELSE call mulub_a_b ENDIF 517 | 518 | IFDEF R800 ELSE 519 | mulub_a_b: {...} 520 | ret 521 | ENDIF 522 | 523 | 2.6.3 IFEXIST {string} 524 | 525 | Check if a file exists. Look at the second example for a nice 526 | trick, which works with any IF-instruction. 527 | 528 | IFEXIST "test" {...} ENDIF ; do {...} if "test" exists 529 | IFEXIST "test" ELSE {...} ENDIF ; do {...} if "test" does not exist 530 | 531 | 2.6.4 IFEXIST {label} 532 | 533 | Similar to IFDEF, but checks if a label exists regardless of where 534 | or when it is declared. You can use this to check if a label is 535 | declared further on in the source code. 536 | 537 | 2.7 Multi CPU support 538 | 539 | tniASM can assembly code for several CPU's, namely Z80, R800 and 540 | the processor commonly known as GBZ80. By default, tniASM assumes 541 | it is working in R800/MSX mode. 542 | Using the "CPU" instruction, one can switch between the following 543 | modes. This can be done anywhere in your code and as often as you 544 | wish. 545 | 546 | The modes are called "Z80", "R800" (plus the alias "MSX") and 547 | "GBZ80". 548 | 549 | CPU Z80 ; switch to Z80 mode 550 | CPU R800 ; switch to R800 mode 551 | CPU MSX ; equivalent to R800 mode 552 | CPU GBZ80 ; switch to GBZ80 mode 553 | 554 | 2.7.1 Z80 mode 555 | 556 | This mode does not accept the R800 MULUB/MULUW opcodes, but 557 | otherwise is the same as R800/MSX mode. 558 | 559 | Differences with standard Z80 syntax rules are: 560 | 561 | - [ and ] is supported for indirection, in addition to ( and ). 562 | So if you want to read a word from memory address 4000h, you 563 | can code LD HL,[4000h] as equivalent of LD HL,(4000h). 564 | 565 | - For ADD, ADC, SUB, SBC, AND, XOR, OR and CP, the accumulator is 566 | optional. 567 | So CP A,B and CP B are equivalent. 568 | 569 | - IN [C] or IN F,[C] can be used. (Z80 undocumented) 570 | 571 | - IX and IY can be split up in IXH, IXL, IYH, IYL respectively. 572 | (Z80 undocumented) 573 | 574 | - SLL (including alias SLI) is supported. (Z80 undocumented) 575 | 576 | - PUSH and POP take a register list, evaluated from left to right. 577 | 578 | PUSH AF,BC,DE,HL ; pushes AF, BC, DE and HL in that order. 579 | POP HL,BC ; pops HL and then BC. 580 | 581 | 2.7.2 R800 or MSX mode 582 | 583 | All Z80 and R800 opcodes are accepted. 584 | 585 | Differences with standard R800 syntax rules are: 586 | 587 | - Z80 opcode and register names. 588 | 589 | - tniASM Z80 rules. (Chapter 2.7.1) 590 | 591 | - Note that SLL has a different (undocumented) function on R800. 592 | 593 | 2.7.3 GBZ80 594 | 595 | Only GBZ80 opcodes and extensions are accepted. 596 | 597 | Differences with standard GBZ80 syntax rules are: 598 | 599 | - LD A,(HLI) and LD A,(HLD) (and vice versa) are written LDI A,[HL] 600 | and LDD A,[HL]. 601 | 602 | - LD A,(n) and LD A,(C) (and vice versa) are written LDH A,[n] and 603 | LDH A,[C]. Furthermore they have aliases IN A,[x] and OUT [x],A. 604 | The LDH A,[n] and LDH [n],A can take values between 0-FF and 605 | FF00-FFFF hex. 606 | 607 | - ADD SP,d is written LD SP,SP+d. 608 | 609 | - LDHL SP,d is written LD HL,SP+d. 610 | 611 | - tniASM Z80 rules. (Chapter 2.7.1) 612 | 613 | Chapter 3: Other Stuff 614 | ---------------------- 615 | 616 | 3.1 Tips and Tricks 617 | 618 | The best tip I can give you when working with tniASM is to keep one 619 | file in which you include every other file. Sort of like a makefile 620 | without dependencies and object stuff. 621 | 622 | ; "example.asm" 623 | ; this is an example 'makefile' 624 | 625 | fname "example.com" 626 | org 100h 627 | include "frontend.asm" 628 | include "main.asm" 629 | include "backend.asm" 630 | 631 | fname "example.dat" 632 | org 0 633 | incbin "stuff.dat" 634 | include "somesubs.asm" 635 | 636 | 3.2 History 637 | 638 | 2 November 2011, v0.45 Magnum mercy shot 639 | - Fixed: Generate error for LD L,IXL (or similar) instead of simply 640 | outputting LD IXL,IXL. 641 | - Now supports using expressions for the fixed numeric operands in 642 | IM, RST, BIT, RES and SET instructions. Previously generated an 643 | error or wrong result! 644 | - Officially the last version of the v0.x series. See Chapter 3.3 645 | for information about tniASM v1.0. 646 | 647 | 2 March 2005, v0.44 648 | - Fixed: $ during PHASE 649 | 650 | 22 January 2005, v0.43 651 | - The operator != is now supported as an alias for <>. 652 | - Fixed: A bug concerning IF-ELSE sometimes caused errors. 653 | - Updates in the manual (Chapter 2.7.2, 3.3) 654 | 655 | 14 November 2004, v0.42 656 | - Fixed: A nested IF in an IF block that resolved as false caused 657 | an infinite loop. 658 | - Fixed: Defining a local label without a parent label now returns 659 | an error message. 660 | 661 | 17 September 2004, v0.41 662 | - tniASM now handles source files using extended ASCII characters. 663 | 664 | 4 October 2003, v0.4 Special #msxdev Edition 665 | - Second command parameter now specifies initial output filename. 666 | (Same as using fname directive.) 667 | - Now allows spaces surrounding registers in indirect accesses. 668 | - PUSH and POP allow a list of registers, evaluated from left to 669 | right. 670 | - DC pseudo instruction added, see Chapter 2.5.2 671 | - Updated the manual to reflect the changes in v0.35 and v0.4. 672 | 673 | 2 October 2003, v0.35 674 | - Due to popular demand, hacked up a version that allows () for 675 | indirection, [] and () are now identical. 676 | 677 | 24 December 2002, v0.3 678 | - About 2.5 times faster assembly. 679 | - Fixed things: 680 | * File error on INCBIN displayed wrong filename. 681 | * GBZ80 'LDI/LDD A,[HL]' caused an error. 682 | * ORG without warning argument didn't reset warning. 683 | * Local labels could change scope between passes. 684 | * 'INCLUDE' and 'CPU' parsing is more robust. 685 | * Minor manual corrections. 686 | 687 | 16 September 2000, v0.2 MSX Fair Bussum Edition 688 | - Conditional assembly, see chapter 2.6 689 | - Practically unlimited label length, see chapter 2.2.1 690 | - Octal numeric constants, see chapter 2.3.1 691 | - Multi CPU support (added GBZ80), see chapter 2.7 692 | - Uninitialised data declarations, see chapter 2.5.11 693 | 694 | 14 August 2000, v0.1 Initial Release 695 | 696 | 3.3 tniASM v1.0 697 | 698 | tniASM v1.0 is a completely rewritten version of tniASM. It is 699 | really a whole different program. Completely processor-agnostic, 700 | even assembly-agnostic, it is ideal for custom processors and even 701 | non-assembly work like file manipulation. Continuing tniASM 702 | tradition, great care has been taken in remaining very easy to use 703 | while providing powerful features. 704 | 705 | The most important feature, the base of everything, is the powerful 706 | macro processor. It provides: 707 | - multiple CPU support, even within the same source file 708 | - customized assembly, use the (pseudo-)instructions YOU like 709 | - ability to be compatible with other assemblers 710 | 711 | tniASM v1.0 comes in versions for 32-bit Windows and 64-bit Linux, 712 | and macro definitions for: 713 | - Z80, R800, GBZ80 and Z380 processors 714 | - code, data and reserved data sections 715 | - tniASM v0.45 compatibility 716 | 717 | tniASM v1.0 is in production use for all projects by, among others, 718 | The New Image and Infinite. You too can participate in the private 719 | beta test by making a donation of at least 15 Euro to bank account 720 | BIC:INGBNL2A, IBAN:NL42INGB0006268083, of Patriek Lesparre in 721 | Almere, The Netherlands. Don't forget to indicate your e-mail 722 | address! If you prefer to use Paypal, donate to paypal@tni.nl. 723 | 724 | Beta testers will receive the latest development versions and can 725 | give their input on the development of the program. Once considered 726 | fit for the public, tniASM v1.0 is expected to be sold for 25 Euro, 727 | but beta testers will receive it for free. 728 | 729 | 3.4 Disclaimer 730 | 731 | - All trademarks are property of their respective owners. 732 | - tniASM v0.45 is freeware and can be distributed freely as long as 733 | it is not modified, this file is included in the archive, and it 734 | is not part of a commercial product. 735 | - Use it at your own risk. The author is not responsible for any 736 | loss or damage resulting from the use or misuse of this software. 737 | 738 | --------------------------------------------------------------------------- 739 | --------------------------------------------------------------------------------