cbios-0.28/0000755000000000000000000000000013141335361011240 5ustar rootrootcbios-0.28/tools/0000755000000000000000000000000013141335361012400 5ustar rootrootcbios-0.28/tools/subst_sha1.sed0000644000000000000000000000010713137376076015164 0ustar rootroots/^\([^ ]*\)[ ]*[^ ]*\/\([^ ]*\)$/s%%\1<\/sha1>%/p cbios-0.28/tools/tniasm-compat.asm0000644000000000000000000000031413137376076015671 0ustar rootroot%include "z80r800.inc" %include "z80().inc" %include "tniasm.inc" %macro if\%if\%endmacro %macro else\%else\ %endmacro %macro endif\%endif\ %endmacro %if #0 = 3 %symfile #3 %outfile #2 %include #1 %endif cbios-0.28/tools/convert_font.py0000644000000000000000000000147713137376076015506 0ustar rootroot# Converts a 256x64 image to assembly (db) font data. import sys # Python Imaging Library # http://www.pythonware.com/products/pil/ import Image if len(sys.argv) != 2: print >>sys.stderr, 'Usage: python convert_font.py ' sys.exit(2) else: fileName = sys.argv[1] image = Image.open(fileName) # Check size. assert image.size == (256, 64) # Convert to monochrome. image = image.convert('L').point(lambda i: i >= 128 and 255) # Output assembly. print 'B_Font:' for char in range(256): bx = (char % 32) * 8 by = (char / 32) * 8 pattern = [] for y in range(by, by + 8): byte = 0 for x in range(bx, bx + 8): byte <<= 1 if image.getpixel( (x, y) ): byte |= 1 pattern.append(byte) print ' ' * 16 + 'db' + ' ' * 6 + ','.join([ '$%02X' % byte for byte in pattern ]) + ' ' * 9 + '; ' + str(char) cbios-0.28/tools/convert_logo.py0000644000000000000000000000622013137376076015467 0ustar rootroot# User editable settings: fileName = 'cbios-logo.png' logoArea = (40, 40, 216, 104) # Python Imaging Library # http://www.pythonware.com/products/pil/ import Image image = Image.open(fileName) # Limit to area of interest. logo = image.crop(logoArea) # Check remaining size. assert logo.size[0] <= 256 assert logo.size[1] <= 192 assert logo.size[0] % 8 == 0 assert logo.size[1] % 8 == 0 # Get R/G/B bands. if logo.mode != 'RGB': logo = logo.convert('RGB') redBand, greenBand, blueBand = logo.split() # Create monochrome image from blue band. # Note: This just happens to be valid for our current logo. logo = blueBand.point(lambda i: i >= 128 and 255) # Convert pixels to blocks. blocks = {} patternTable = [] nameTable = [] for blockY in range(logo.size[1] / 8): for blockX in range(logo.size[0] / 8): block = [] for y in range(blockY * 8, (blockY + 1) * 8): pattern = 0 for x in range(blockX * 8, (blockX + 1) * 8): pattern <<= 1 if logo.getpixel( (x, y) ): pattern |= 1 block.append(pattern) block = tuple(block) blockNr = blocks.get(block) if blockNr is None: blockNr = len(blocks) blocks[block] = blockNr patternTable.append(block) nameTable.append(blockNr) patternOffset = 131 assert patternOffset + len(patternTable) < 256 print 'logo_patoffset: equ %d' % patternOffset print 'logo_npatterns: equ %d' % len(patternTable) print 'logo_patterns:' for block in patternTable: print ' ' * 16 + 'db' + ' ' * 6 + ','.join([ '$%02X' % line for line in block ]) print print 'logo_namwidth: equ %d' % (logo.size[0] / 8) print 'logo_namheight: equ %d' % (logo.size[1] / 8) print 'logo_namoffset: equ %d' % ( (logoArea[0] / 8) + 32 * (logoArea[1] / 8) ) print 'logo_names:' nameIndex = 0 for blockY in range(logo.size[1] / 8): row = [] for blockX in range(logo.size[0] / 8): row.append(nameTable[nameIndex]) nameIndex += 1 print ' ' * 16 + 'db' + ' ' * 6 + ','.join([ '$%02X' % (patternOffset + item) for item in row ]) print blackness = Image.new('L', redBand.size) sprite = Image.composite(blackness, redBand, blueBand) sprite = sprite.point(lambda i: i >= 128 and 255) spriteBox = sprite.getbbox() sprite1 = Image.composite(blackness, greenBand, blueBand) sprite1 = sprite1.point(lambda i: i >= 128 and 255) sprite1Box = sprite1.getbbox() sprite = sprite.crop(spriteBox) assert sprite.size[0] < 16 assert sprite.size[1] < 16 spritePattern = [] for col in range(2): for y in range(16): pattern = 0 for colX in range(8): pattern <<= 1 x = col * 8 + colX if x < sprite.size[0] and y < sprite.size[1] \ and sprite.getpixel( (x, y) ): pattern |= 1 spritePattern.append(pattern) print 'logo_spritepat:' for line in range(0, len(spritePattern), 16): print ' ' * 16 + 'db' + ' ' * 6 + ','.join([ '$%02X' % pattern for pattern in spritePattern[line : line + 16] ]) print spriteAttr = [ logoArea[1] + spriteBox[1], # Y logoArea[0] + spriteBox[0], # X 0, # pattern 8, # colour: red logoArea[1] + sprite1Box[1], # Y logoArea[0] + sprite1Box[0], # X 0, # pattern 2, # colour: green ] print 'logo_spriteattr:' print ' ' * 16 + 'db' + ' ' * 6 + ','.join([ '$%02X' % byte for byte in spriteAttr ]) cbios-0.28/doc/0000755000000000000000000000000013141335361012005 5ustar rootrootcbios-0.28/doc/cbios.txt0000644000000000000000000002364413137376076013673 0ustar rootrootC-BIOS 0.28 =========== This software is a substitute BIOS which is can be used for running MSX emulators. It currently supports only execution of cartridge image ("ROMs"). Before you use it, you should read and accept the license (see below). On the C-BIOS web site, you can download newer versions, download the source code, and report bugs. http://cbios.sourceforge.net/ License ------- Copyright (c) 2002-2005 BouKiCHi. All rights reserved. Copyright (c) 2003 Reikan. All rights reserved. Copyright (c) 2004-2006,2008-2010 Maarten ter Huurne. All rights reserved. Copyright (c) 2004-2006,2008-2011 Albert Beevendorp. All rights reserved. Copyright (c) 2004-2005 Patrick van Arkel. All rights reserved. Copyright (c) 2004,2010-2011 Manuel Bilderbeek. All rights reserved. Copyright (c) 2004-2006 Joost Yervante Damad. All rights reserved. Copyright (c) 2004-2006 Jussi Pitkänen. All rights reserved. Copyright (c) 2004-2007 Eric Boon. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. History ------- ver 0.01 Initial ver 0.02 2002-08-15(JST) * Added original font and drawing screen. * Added dump-mode. * Changed recognition method of cartridges to recognize cartridges taking priority. ver 0.03 2002-08-19(JST) * Based on a suggestion from Ms.Okei, wrote 20h of BIOS(compare HL and DE). In the result, shooting game of a certain company became runnable more correctly. Thank Ms.Okei!! ver 0.04 2002-08-20(JST) * Added initialize of FCC2h-FCC4h. * Added function of GTSTCK and GTTRIG temporarily. * Divided msxb.bin to halfs. doing combining/copying with setb.bat now. ver 0.05 2002-08-27(JST) * Added INITGRP(only screen2), CHGMOD(graphic mode change routine), a routine calls H.STKE. * Rewrite memory recognition routine. * Some bug fixes. * Added sound test function. ver 0.06 2002-09-01(JST) * Fixed around of color. ver 0.07 2002-09-09(JST) * Added some sorts of keyboard routines. * Added joystich function to GTSTCK and GTTRIG. ver 0.08 2002-09-12(JST) * Restructured memory initialize routine. * Added error display routine. * Fixed routine of finding kinds of cartridges. * Fixed using method of EXPTBL. * Added initialize of from RG8SAV to RG23SA. * Now return within disabled interrupt from ENASLT routine. ver 0.09 2002-09-19(JST) * Made the rest half of font. * Improved key input routine. * Added CHPUT. With it, rewrote display routine. * Fixed init_grp. * Changed filenames to CBIOS.ROM, CBIOS_SUB.ROM. ver 0.10 2002-09-20(JST) * Fixed indent. * and so on... ver 0.10a 2002-09-22(JST) * Fixed license. * Added support of ROMs in page3. ver 0.11 2002-09-22(JST) * Small fix in init_sc5. ver 0.12beta 2002-09-25(JST) * Added test routine for disk access. need DISK.ROM. * Added init_sc7. * Improved ENASLT. now finding cartridge uses ENASLT. * Improved RAM detection. ver 0.12 2002-09-27(JST) * Changed finding cartridge again. * Changed screen mode of cartridge running time. * Fixed keyboard routine. * Fixed stick routine against to interrupt. ver 0.13 2002-10-02(JST) * Based on info from Mr.Maarten (a member of openMSX developers), fixed around of SCREEN 5. For detail, switching line numbers, temporary treatment for a bug of reading from VDP status register, and so on. ver 0.14 2002-10-10(JST) * Rewrote comments in source within Japanese. ver 0.15 2003-02-26(JST) * Rewrote some of comments back to English again. * Fixed non-assemblable condition becauseof lack of font file. * Changed filename, some of label name, strings and so on. ver 0.16 2003-04-16(JST) * Separated sound test from source. (Disabled) ver 0.16a 2003-06-01(JST) * CHGMOD: When screen0/1, now load font to VRAM. * CHPUT: Now support also screen1 not only screen0. ver 0.16b 2003-08-10(JST) * Added entry: INITXT, INIT32. These were exist only as internal routine of CHGMOD. * INITXT, INIT32: Fixed screen clear failure. * CHPUT: Fixed scroll failure. ver 0.17 2003-08-10(JST) * Changed LICENSE. New LICENSE will be suitable in various situations. e.g. use as a firmware for hand-made hardware. ver 0.18 2004-12-18(CET) * First release since moving to SourceForge. * Much improved support for MSX2 games. * Graphical boot logo. * Included machine config files for several MSX emulators. * Various bug fixes. ver 0.19 2004-12-24(CET) * Added support for SCREEN4 and SCREEN8. * Added support for clock chip. * Added support for palette. This fixes a lot of wrong colours. * Stubbed many calls: non-implemented calls print their name on the openMSX debugdevice (if present). * Various bug fixes. ver 0.20 2005-02-09(CET) * Added an MSX2+ configuration, which includes V9958 and MSX MUSIC. * Separate main ROMs for MSX1/MSX2/MSX2+. * Implemented several MSX2 specific routines, including BLT*. * Display is disabled when switching to a different screen mode. * Improved CHPUT a lot; implemented control and escape codes. * Rewrote key buffering; fixes bug of keys being repeated. * New boot logo, even cooler than the previous one. * New font, placed at a fixed address so all games can find it. * Started work on a disk ROM, but it is not functional yet, so it is not enabled in the configurations. * Stubbed all non-implemented calls. * Various bug fixes. ver 0.21 2005-06-07(CET) * Fixed RuMSX configuration files, thanks to Rudolf Lechleitner. * Rewrote ROM search code; now all ROMs are recognized. Also a clear error message is printed for BASIC ROMs. * New boot logo for MSX2 and MSX2+. * Changed boot sequence: Show logo, switch to SCREEN 1 and search for ROMs. * Improved video code; fixes several games. * Various bug fixes. ver 0.22 2008-12-27(CET) * Use separate logo ROM to save space in the main ROM. * Set lower bits of PSG reg 15 before reading joystick trigger status. * Improved RAM search. * Many new routines implemented and existing implementations made more complete, especially character I/O and bitmap graphics. * Added lots of documentation to system variables. * Added support for GNU assembler. * Various bug fixes. ver 0.23 2009-01-04(CET) * Updated blueMSX configuration files, thanks to Benoît Delvaux. * Fixed version reported by MSX1 logo ROM. * Fixed several video routines so they work on MSX1 VDPs (TMS99xx). * A couple of other bug fixes. ver 0.24 2010-05-24(CET) * VRAM size is now properly checked, fixing R-Type's V9938 detection. * C-BIOS doesn't lie anymore about the interrupt frequency. * Don't di; halt when no ROM is found, the warning in openMSX may be confusing * A few minor bug fixes and tweaks. ver 0.25 2011-02-01(CET) * C-BIOS now offers localized versions in the flavours INT (default), JP and BR. * Bug fixes for compatibility with Mirai, Family Billiards. * A couple of other bug fixes. * This version only compiles with Pasmo 0.5.3, due to lack of standards in assembler directives... ver 0.26 2014-11-02(CET) * Restored support to compile with tniASM (v1.0 Beta 17 or higher) * Moved to git, which means a.o.: archived changelog.txt, use git log from now on * Fixed VDP VRAM access timing for MSX1 VDP's * Update openMSX configurations to the new structure * Fixed bug blueMSX configurations * Fixed build on Mac OS X and add support for "make dist" ver 0.27 2014-11-05(CET) * Fixed bug (regression) in filvrm on non-MSX1-VDP's * Fixed some small bugs in openMSX configs * Fixed line endings of this file ver 0.28 2017-07-30(CEST) * Fixed bug that prevented brackets and a few other keys from generating characters when pressed Special Thanks -------------- People uploading MSX information to the internet. People developing any kind of emulators. All users. Font edit tool: Gameboy Tile Designer version 2.2 Copyright H. Mulder 1999 cbios-0.28/doc/building.txt0000644000000000000000000000160313137376076014360 0ustar rootrootBuilding C-BIOS From Source =========================== First, get a Z80 assembler. Currently, only the following assembler can build C-BIOS without requiring modifications to the source code: * Pasmo 0.5.3 - http://pasmo.speccy.org/ It is available for Windows, Linux and probably on other Unix-like systems as well. Building with Pasmo: On Unix-like systems: Run "make". You should have GNU Make or something similar enough installed on your machine. On Windows: Run "make.bat" like this: "make pasmo". The produced ROM files are located in the directory "derived/bin", which will be automatically created. You can find symbol listings in "derived/lst", they are useful for debugging. To test C-BIOS, you can use the supplied emulator configurations in the "configs" directory. If you have made interesting improvements to C-BIOS, please tell us about them. http://cbios.sourceforge.net/ cbios-0.28/doc/chkram.txt0000644000000000000000000000466013137376076014036 0ustar rootrootWhat a BIOS does when CHKRAM is called -------------------------------------- - disable interrupts - init memory mapper - init light pen (not needed) - init PPI commando register - init PPI-A select 4x slot 0 - init PPI-C caps off, motor off - init VDP set reg 9 with value 2 - wait quite some time (more then $a000 x 4 instructions) - init PPI-A select 4x slot 0 (again) - select subslot for 8000 & C000 - try to see if it is really RAM by writing to it, and test RAM - remove RAM from page 3 ? - try to write to page 3 ? - more slot trickery ??? - even more slot trickery - fill f380 - fff7 with 0 - and more slot trickery - init SP on F376 - fill hook area with C9 - init HIMEM with F380 - find highest ROM area and init BOTTOM - copy initial values to f380-f410 - call INIFNK - init ENDBUF, NLONLY, BUFMIN, KBFMIN, CGPNT, PRMDRV, STKTOP, MEMSIZ, VARTAB - calculate MAXFIL, FILTAB, adjust MEMSIZ, STKTOP, calc NULBUF - init TEMPST - reset PRTFLG, try CR/LF to printer, update LPTPOS - init VLZADR, VLZDAT, ERRLIN = CURLIN, init DOT - some VDP write?? - call H_FINP; reset PRTFLG - init PTRFIL (0) - init at 0: PRMLEN NOFUNS PRMLN2 FUNACT PRMSTK SUBFLG - round BOTTOM - call CHKSLZ: search slots for subrom and search slots for AB extensions * search for subrom (CD) - call INIT via interslot call if not zero * for each slot: - check for AB in 4000, then 8000, then 0000 in order of slots, also look at expanded slots in order !! please note that if in 8000 AB is found it no longer looks at 0000 - call INIT via interslot call ( at vblank ) if not zero - write purpose of slots in SLTADR - if it's a BASIC rom, start it - init TXTTAB - reset TRCFLG, AUTFLG, PTRFLG - write 2 zeros to start of TXTTAB - init VARTAB - call H_RUNC - call H_CLEA - init ONGSBF - call H_LOPD - init DEFTBL with $08 - init RNDX 00 40 64 96 51 37 23 58 - init ONEFLG (0) - init ONELIN (0) OLDTXT (0) - FRETOP = MEMSIZ - calculate DATPTR from TXTTAB - ARYTAB = VARTAB, STREND = VARTAB - call INITIO - call CHKSLZ - write 0 at BOTTOM - TXTTAB = bOTTOM + 1 - call SETSCR in subrom - adapt SLTWRK ? - init DSCTMP (how?) - DAC+2 = TEMPPT ? - VALTYP = 3 - DAC+2 = DSCTMP ? - adjust TEMPPT ? - adjust TEMPPT ? - adjust FRETOP - TOTEXT - FLBMEM = 0 - at (PTRFIL)+9 fill 256 bytes with 0 (initializing FCB?) - call H_READ - call PROMPT in subrom - main basic loop: * call H_MAIN * CURLIN = FFFF * SAVTXT = F40F * check for AUTFLG * check for ISFLIO * call PINLIN List NOT yet complete! cbios-0.28/doc/changelog-old.txt0000644000000000000000000007332113137376076015274 0ustar rootrootThis file is no longer being updated; consult the git log instead. 2010-05-23 Manuel Bilderbeek * Preparations for releasing C-BIOS 0.24. 2009-01-05 Albert Beevendorp * added VRAM size check 2009-01-04 Maarten ter Huurne * Added support for carriage return ($0D) in GRPPRT in SCREEN2. Fixes title screen of Bokosuka Wars. * Released C-BIOS 0.23. 2008-12-30 Maarten ter Huurne * Have a single file (version.txt) that contains the version number. * Keep interrupt enabled during data transfer phase of FILVRM. Fixes startup problems of Penguin Adventure. * Initialize MSX1 VRAM mapping bit (bit7 of VDP R#1) to 1. Fixes title screen of Zaider - Battle of Peguss. 2008-12-30 Albert Beevendorp * Modified MSX1 logo data so it easier to insert the version number. * Added ret on address EXTROM on MSX1. Fixes Nemesis 3 reset. 2008-12-27 Maarten ter Huurne * Released C-BIOS 0.22. 2008-07-22 Maarten ter Huurne * Set lower bits of PSG reg 15 before reading joystick trigger status. If the lower bits are 0, the trigger status read will also be 0, no matter whether the trigger is pressed. Fixes MJTT in meisei; thanks to "enen" for reporting this. 2007-12-13 Arnold Metselaar * logo.asm: Move org directive ... * logo_msx1.asm,logo_msx2.asmlogo_msx2+.asm: ... to here, helps the program 'make' pass the right options to GNU ld. 2007-11-19 Arnold Metselaar * video.asm (cls_text): move cursor (CSRY,CSRX) to top left corner. * chput.asm (chput_ctrl_ff,chput_esc_e,chput_esc_j): equate to cls; the updated cls ends with chput_ctrl_home now. 2007-02-03 Eric Boon * Split off INLIN from main * Initial implementation of INLIN 2006-09-30 Arnold Metselaar * Makefile: Remove the unnecessary workaround for tniasm, fix SEDSCR for z80-as. 2006-09-09 Arnold Metselaar * src/main.asm, Makefile: Move version.asm from derived/src to derived/asm. * Makefile: Copy all source files to derived/asm if tniasm is used, because tniasm cannot handle paths in include and incbin. 2006-09-08 Joost Yervante Damad * add more documentation to systemvars * convert some source file from ISO-8859-1 to UTF8 2006-09-07 Joost Yervante Damad * add more documentation to systemvars * add list_stub target to Makefile 2006-07-22 Albert Beevendorp * removed the page 0 detection for cartidges to make it compliant to the original version again. 2006-05-07 Albert Beevendorp * made preparations for ChangeLog version number to the default bootscreen using make.bat 2006-05-07 Eric Boon * Added Changelog version number to default bootup screen * Implemented EOL 2006-05-02 Maarten ter Huurne * Use 14-bit addressing in FILVRM for SCREEN 0..4. Fixes Konami's Ping Pong on MSX2/2+. 2006-04-09 Albert Beevendorp * added printer output routines 2006-03-18 Eric Boon * completed CHPUT with update of LINTTB 2006-03-12 Eric Boon * Rewrote CHPUT and separated it from main.asm 2006-03-12 Arnold Metselaar * Makefile: add support for GNU assembler * src/main.asm: use single quotes for character constants 2005-12-06 Jussi Pitkänen * Added international scan code table. * Added numpad (rows 9 and 10) to scan code tables. 2005-11-25 Jussi Pitkänen * Improved the RAM search routine: - check each memory slot configuration - find the start of the longest contiguous memory area and set the BOTTOM variable accordingly 2005-10-27 Maarten ter Huurne * Improved support for tniASM: - added support in Makefile - fixed C-BASIC code so tniASM accepts it * Added C-BASIC to Makefile and make.bat. 2005-10-26 Maarten ter Huurne * Added C-BASIC (minibas) by BouKiCHi. Right now it is built as a separate ROM, so you have to insert it into your emulator as a cartridge. 2005-10-14 Albert Beevendorp * inverted $F4 reset flag which is more common on MSX2+ machines * removed obsolete [Audio] section from blueMSX machine configs 2005-10-13 BouKiCHi * Added dummy routines for FM Music Macro( seems to call BASIC routines ) 2005-10-09 BouKiCHi * Improved GRPPRT to call GRPPRT in sub.asm when screen mode is 5 or above. 2005-10-09 Albert Beevendorp * fixed a few bugs in GRPPRT in sub.asm FORCLR writes ATRBYT GRPACX / GRPACY should be used in stead of GXPOS / GYPOS * initiated V9958 support in logo.asm updated V9938 logo according to the fixes in GRPPRT * updated openMSX and blueMSX machine configs with $F4 reset flag 2005-08-14 Jussi Pitkänen * Initialise font also in subrom video routines. * Scan the keyboard only every three interrupts. * Implement keyboard auto-repetition. 2005-07-17 Albert Beevendorp (yes, I know it looks strange this way) * Added machine specific conditional BIOS entry compilation, added CHKSLZ and EOL entries and subbed EOL in main.asm * Added the only 2 MSX2+ entries in main.asm 2005-07-18 BouKiCHi * Splited video routines by condition of model. TODO : investigate the effect of this fix 2005-07-02 BouKiCHi * Merged a part of NSET?? routines of able to merge. * Removed disk test routine and strings which displays directory. 2005-07-02 Albert Beevendorp * Swapped video.asm with slot.asm includes. fixes compile warnings with Pasmo and Sjasm 2005-07-02 BouKiCHi * Changed GRPPRT to work Y MOD 8 and double printing 2005-06-27 BouKiCHi * Changed CLRSPR's color table to use ATRBAS 2005-06-26 BouKiCHi * Changed LDIRVM/LDIRMV routine don't change IM. * Improved SETPAG routine to work fine on SCREEN7. * Changed GETPLT to preserve HL. 2005-06-25 BouKiCHi * Improved Reg.R is not fixing at odd or even when call key_int. * Changed the way of timing adjustment. 2005-06-22 BouKiCHi * Fixed GTTRIG to get status of space when Reg.A is above 5. * Implemented multiply of BASIC statements temporarily. 2005-06-21 Albert Beevendorp * fixed a bug in the clock chip access routines fixes clock chip storage in Palette Editor (and all other titles using it) 2005-06-20 BouKiCHi * Changed BLTVM's behavior in SCREEN 8 to check zero before djnz. 2005-06-19 BouKiCHi * Splited MAPXYC routine from GRPPRT routine * Fixed MAPXYC's position Y is rounded down TODO : investigate more detail * Implemented FETCHC * Implemented dummy BASIC statements * Improved BREAKX returns value * Changed around $0d02 to actual instructions(not jump) 2005-06-18 Albert Beevendorp * adjusted blueMSX configs to include the logo rom * adjusted NLMSX configs to include the logo rom 2005-06-18 BouKiCHi * Removed extrom's debug print for address check. 2005-06-16 Albert Beevendorp * seperated logo.asm from main.asm - added 3 logo compilation sources like main has - hardcoded BIOS entries in logo.asm as they're not accessible using names anymore - adjusted openMSX configs to include the logo rom - adjusted make.bat and Makefile to compile the logo TODO: review and test Makefile - adjusted structure.bat to copy the logo roms to the correct paths as well - the default screen when the logo isn't found could be better 2005-06-16 BouKiCHi * Added recognize function key in keychk * Changed OUTDO calls H_OUTD. * Added updating sprite attribute table to SETPAG. 2005-06-15 BouKiCHi * Improved GRPPRT changes attribute correctly. * Fixed PUTQ and LFTQ's address calculation. * Added jump instruction before H_TIMI. * Added haywire to GTPAD(doesn't return without $00 now). * Added locale condition define and Japanese localized font 2005-06-13 BouKiCHi * Changed LDIRMV to save HL. * Changed GRPPRT's output position to be correctly. 2005-06-12 BouKiCHi * Changed GTSTCK to use DE register * Implimented GRPPRT on SCREEN 2 2005-06-10 BouKiCHi * Changed GTSTCK returns DE = 0 * Changed CHSNS returns EI and A = 0 if ZF = 1 * Changed build.bat to display processing file when using pasmo 2005-06-09 BouKiCHi * Improved init_ram to fill up $F300-$F380 with ret instruction. 2005-06-08 BouKiCHi * Changed SNSCNT is flipping. * Removed EI from end of calslt and Added EI to EXTROM. * Changed EXTROM's alternative registers to save. * Changed CHGMOD's interrupt to be enable when it is SCREEN 5. - TODO: investigate needs enable interrupt or not when the case of other screenmode. 2005-06-07 Jussi Pitkänen * Implemented CHRGTR. 2005-06-07 Jussi Pitkänen * Implemented LFTQ and PUTQ. * Initialise music queue variables. 2005-06-07 Maarten ter Huurne * Added NVBXFL implementation by BouKiCHi, with a minor bugfix by me. * Released C-BIOS 0.21. 2005-06-07 BouKiCHi * Fixed Space bar works correctly when uses GTTRIG * Changed some comments to English * Implemented NVBXLN 2005-06-04 BouKiCHi * Changed Reg.C will be slot number when boots a cartridge. * Added a ret instruction before chkram routine this will fix Bifamu 2005-06-02 Maarten ter Huurne * Changed register saving in WRTVDP implementation: - do not save regs >= 24 on V9938 - save regs 25, 26, 27 on V9958 in correct location * Contrary to what the documentation says, EXTROM does not change IY. 2005-05-31 Jussi Pitkänen * Check for and initialise cartridges that are located at $0000. 2005-05-30 Maarten ter Huurne * Fixed the exit (pop) part of the interrupt routine to $0D02. The game "Hacker" jumps directly to this address. 2005-05-29 Maarten ter Huurne * Removed leftover code from the debugger. * Changed boot sequence: 1. Show logo 2. Switch to SCREEN1 3. Initialise ROMs This should solve the problems we had with non-standard palettes and confusing messages about cartridges that were (not) found. 2005-05-19 Albert Beevendorp * fixed 1 palette color. Thanks to BouKiCHi for spotting it * BouKiCHi has made a fix to restore the palette when booting a game but it doesn't print the 'not found' text on the intro screen anymore like the TMS99X8 version does 2005-05-17 Albert Beevendorp * Added V9938 version of the logo - moved some portions of the TMS99x8 logo from main.asm to logo.asm - made prn_text in main.asm multi-screenmode ready - fixed a bug in grpprt_sub in sub.asm - main texts are printed in both pattern mode and graphical mode - TODO: get rid of the "Cartridge found in slot: 3.3" when there is no cart inserted in graphical mode. - TODO: find a decent place to restore the palette when booting an MSX1 game on MSX2 2005-05-16 Maarten ter Huurne * Committed RuMSX configs with some fixes from Rudolf Lechleitner. * Reset vertical scroll register in CHGMOD. Fixes problem in "The Cockpit" when you start the game before the title scroll is finished. * Refactored code for setting the number of lines (192/212) and for turning off page blinking: now this code is always executed on V9938/58, even for MSX1 modes. 2005-05-16 Jussi Pitkänen * Rewrote the cartridge search code. It isn't finished yet and may break things, please test. 2005-03-26 Albert Beevendorp * Reset initial HIMEM value to $F380. Fixes Young Sherlock. The disk ROM should alter HIMEM itself 2005-03-19 Jussi Pitkänen * Disable interrupts around VRAM writes. Fixes intro screen in `Zaider - Battle of Peguss'. 2005-02-24 BouKiCHi * calslt_restore(some rouines uses it) routine returns with EI * rewritten make.bat and build.bat 2005-02-19 Maarten ter Huurne * Select RAM in page 2 already on first boot attempt. Fixes one particular variant of Boulder Dash. 2005-02-15 BouKiCHi * Translate main.asm to English 2005-02-14 Albert Beevendorp / BouKiCHi * implemented code to boot games in PAGE0. Thank you, BouKiCHi 2005-02-09 Maarten ter Huurne * Released C-BIOS 0.20. 2005-02-06 Maarten ter Huurne * Call FILVRM instead of BIGFIL on MSX1 in CLRSPR. Fixes sprites of The Fantasm Soldier Valis on MSX1. * Wait until VDP command is done before returning from CLS. 2005-02-06 Albert Beevendorp * added some more version specific compilation * moved the font to the default address if $1BBF as games depend on it being there * removed font from subrom 2005-02-05 Maarten ter Huurne * Workaround for buggy cartridge boot code: HALT just before calling the cart, so it will have a long time before the first interrupt. Fixes hang of Koronis Rift. * Rewrite VDP control registers in CHGMOD. Fixes title screen garbage sprites of Hole in One Special. * Corrected the value written to the VDP regs for sprite attribute and pattern base addresses in SCREEN 7 and 8. 2005-01-20 Albert Beevendorp * moved logo plot code from main.asm to logo.asm enables easy implementation of adjusted logo's for MSX1, MSX2 and MSX2+ * replaced the logo by one made by Eric Boon * added initialization for CGPNT * fixed GRPPRT in the subrom, mainrom still needs implementation preparing for MSX2 and MSX2+ boot screens 2005-01-15 Jussi Pitkänen * Implemented GETVCP and GETVC2. 2005-01-14 Jussi Pitkänen * Fixed init_sc4 to set the sprite pattern base address correctly. 2005-01-13 Albert Beevendorp * moved slot routines to seperate source: slot.asm routines are used by both main and sub rom * made GETPAT fully functional now in both main and sub rom * implemented handler for maskable interrupt to sub rom fixes slowdowns with BLTVM * cleaned up subrom detection source and BLTVM source * CLRSPR now calls NSETWR on MSX2 and SETWRT on MSX1 fixes a few games with garbled lines 2005-01-11 Maarten ter Huurne * Rewrote key buffering code: - it uses a ring buffer now (more efficient, more like MSX BIOS) - made sure the new buffering code is harmless when interacting with a bug in Ashguine 2 - KILBUF only empties buffer; it does not mess with NEWKEY and OLDKEY (this fixes some issues we misdiagnosed as too fast key repeat) 2005-01-10 Maarten ter Huurne * Fixed sub ROM version of CLS. T&E logo of Ashguine 2 is now shown on a black background. 2005-01-09 Albert Beevendorp * fixed BLTVM. It wasn't tested yet as games using it were unknown at that time. * sped up BLTVM. Fixes issues with several games that were broken with the previous. 2005-01-08 Maarten ter Huurne * Added support for loading to page 1. * Initialise F341-F344 (RAM slot for each page). * Initialise DRVINF table. * Partial implementation of DSKRST and CURDRV BDOS functions. * Partial implementation of CONOUT BDOS function. * Implemented STROUT BDOS function. * Implemented VERIFY BDOS function by doing nothing: according to the DOS2 docs, the verify feature is optional, so we just ignore the verify flag. 2005-01-08 Albert Beevendorp * turned a few relative jumps into absolute jumps in CHPUT to fix compilation errors 2005-01-08 Jussi Pitkänen * Implemented control codes in CHPUT. * Implemented ESC-B, ESC-C and ESC-D (cursor down, right and left) in CHPUT. * Implemented ESC-E, ESC-j and ESC-H (clear screen and cursor home). * Implemented ESC-K, ESC-J and ESC-l (erase to end of line, erase to end of screen and erase line). * Rewrote character output part of CHPUT. 2005-01-07 Maarten ter Huurne * First implementation steps towards a disk ROM. Uses a disk image appended to the ROM, placed in a Konami4 mapper. Succesfully reads the boot sector, but not much else. 2005-01-07 Jussi Pitkänen * Added stubs for control and escape codes in CHPUT. 2005-01-06 Jussi Pitkänen * Implemented INIMLT and SETMLT. * Implemented CLS for SCREEN 3. 2005-01-05 Albert Beevendorp * Added GRPPRT, GETPAT * Added RST calls to subrom * Added simple CHRGTR to subrom * Added DOCOMPR to subrom 2005-01-05 Jussi Pitkänen * Rewrote adr_sft, renamed to set_base_address. * Fixed SETTXT to set the base address registers correctly. * Modified SETT32, SETGRP and init_sc4 to use set_base_address. * Disable screen at the start of initialization routines. 2005-01-04 Albert Beevendorp * Fixed TOTEXT * Added CHGCAP * Added STMOTR * Added BLTMV 2005-01-04 Maarten ter Huurne * Recognise escape sequences in CHPUT. This eliminates the garbage printed on DOS prompts. Note that the escape sequences are all ignored at the moment. * Implemented ESC-A (cursor up) in CHPUT. * Fixed POSIT: row and column were swapped. * Implemented BREAKX. 2005-01-03 Albert Beevendorp * Added conditional compilation for subrom search * Completed GTSTCK direction tables * Added VDP dependent compilation for LDIRMV, LDIRVM, CHGMOD, INITXT, INIT32, INIGRP and CLS * Removed the init from the music ROM 2005-01-03 Maarten ter Huurne * Implemented SCREEN0 in 80 columns mode (TEXT2). * Implemented centering if WIDTH is less than maximum allowed by the VDP. * Rewrote curs2de, renamed to curs2hl. * Rewrote VRAM copy part of text scrolling routine. 2005-01-03 Jussi Pitkänen * Fixed a text scrolling bug in CHPUT. 2005-01-02 Jussi Pitkänen * Added stubs for `Graphic routines'. All MSX1 BIOS routines are now either implemented or stubbed. 2005-01-02 Joost Yervante Damad * model dependant romid in main.asm 2005-01-02 Albert Beevendorp * adjusted make.bat to compile the version dependent ROMs * updated blueMSX, NLMSX and RuMSX configurations 2005-01-02 Patrick van Arkel * Came up with an initial plan to auto make configs for different emu's 2005-01-01 Maarten ter Huurne * Create different ROMs for MSX1, MSX2 and MSX2+. * Added openMSX configuration for MSX2+ (thanks to Manuel). 2005-01-01 Jussi Pitkänen * Added stubs for some missing entries in main.asm. 2004-12-31 Albert Beevendorp * Reset DPPAGE and ACPAGE on every CHGMOD Fixes graphical bug in A-Class Mahjong * CLS on bitmap screens now uses HMMV * Added necessary code to SETRD and SETWRT for V99x8 * Fixed FILVRM to use 16-bits range for some reason Fixes Contra graphical glitches 2004-12-30 Maarten ter Huurne * Fixed dependency checking: it now checks dependencies recursively, so includes from included sources are checked properly. * Fixed boot sequence: Konami games which use disk saves work again (they were broken by the hacks to make the NMS8250 disk ROM boot). 2004-12-30 Joost Yervante Damad * fix inconsistent naming * replace calls to dcompr with rst $20 * stubbed INIFNK * SNSMAT stores BC, it's only allowed to change AF * some missing entries in sub.asm + some stubs * fixed SUBROM 2004-12-29 Manuel Bilderbeek * Replaced the font with a new font donated by Eric Boon. Thanks a lot! 2004-12-29 Maarten ter Huurne * Fixed register trashing by RDSLT and WRSLT. * Added enough hacks to make the NMS8250 disk ROM run on top of C-BIOS. When debugging our own disk ROM we can now test whether problems we encounter are caused by the disk ROM or by the main/sub ROM. 2004-12-29 Albert Beevendorp * Changed detection order of NSETRD and NSETWR Fixes graphical glitches in 1942 * Added SCREEN 6 Fixes graphical glitches in Arkanoid 2 VS modes 2004-12-29 Jussi Pitkänen * Select 8x8 sprites before running a ROM. Fixes American Truck. 2004-12-29 Joost Yervante Damad * add more hooks to hooks.asm and document them * add some commented hooks to some subroutines in main.asm * implement ISFLIO; with call to H_ISFL in comments * implement FORMAT stub; with call to H_FORM in comments * stubs for LPTOUT and LPTSTT with commented hooks * implemented CNVCHR * stubs for PINLIN, INLIN, QINLIN with commented hooks * stubs for BREAKX, ISCNTC * implemented CKCNTC * document GETYPR 2004-12-28 Albert Beevendorp * Added clipping to BLTVV and BLTVM 2004-12-28 Joost Yervante Damad * add documentation to some BIOS calls in video.asm * fix TOTEXT 2004-12-28 Albert Beevendorp * Implemented BLTVM routine 2004-12-28 Maarten ter Huurne * Found (and fixed) real reason for Girly Block startup problem: interrupts should be disabled when cartridge init routine is called. * Call BEEP if character 7 is printed by CHPUT. * Fixed bug in CALLLF: return address was not properly updated. 2004-12-28 Albert Beevendorp * Added stubs for SDFSCR, SETSCR and bitblit routines * Implemented BLTVV routine * Added bitblit related system variables to systemvars.asm the bitblit ARG has been renamed to ARG_ due to duplicate names 2004-12-28 Jussi Pitkänen * Implemented SETTXT, SETT32 and SETGRP routines. * Added an incomplete TOTEXT implementation. 2004-12-26 Maarten ter Huurne * Added MUSIC ROM stub, which was made by BiFi and BouKiCHi. 2004-12-26 Albert Beevendorp * Added compiling of MUSIC-ROM and the DISKROM to the scripts * Initial diskrom implemented 2004-12-25 Albert Beevendorp * Added CLS routines 2004-12-25 Jussi Pitkänen * Fixed CHGMOD to clear only the sprite attribute table instead of calling CLRSPR. 2004-12-25 Maarten ter Huurne * Added stubs for FNKSB, ERAFNK, DSPFNK and TOTEXT. * Added stubs for tape routines and implemented those which can fail to fail always (carry flag set). 2004-12-25 Jussi Pitkänen * Implemented CALPAT, CALATR and GSPSIZ routines. 2004-12-23 Maarten ter Huurne * Workaround for Girly Block startup problem. * Released C-BIOS 0.19. 2004-12-22 Maarten ter Huurne * Added main rom entry points for INIMLT and GRPPRT. * Added sub rom entry points for INITXT, INIT32, INIGRP, INIMLT, CHGCLR and WRTVDP. * Added stubs for SETTXT, SETT32, SETGRP, SETMLT, CALPAT, CALATR and GSPSIZ. Note: the old SETGRP code implemented the wrong interface. * Moved GRPPRT stub from "sub.asm" to "video.asm". * Implemented SCREEN4. 2004-12-22 Albert Beevendorp * Implemented REDCLK and WRTCLK routines * fixed minor bug in INIPLT and RSTPLT 2004-12-22 Joost Yervante Damad * fill in missing systemvars and documentation for systemvars - finished, but alot of variables are still undocumented * stubbed BEEP, CLS and STRTMS 2004-12-21 Joost Yervante Damad * order systemvars in systemvars.asm by address 2004-12-21 Albert Beevendorp * Implemented INIPLT, RSTPLT and GETPLT routines * Added INIPLT to CHGMDP 2004-12-21 Albert Beevendorp * Added VRAM save to SETPLT which fixes about all wrong palette issues 2004-12-20 Maarten ter Huurne * Implemented CHGSND: writing the 1-bit sound port. Fixes samples in Ikari. * Implemented SCREEN8. * Cleaned up SCREEN5 and SCREEN7 code. * Moved VDPSTA from "sub.asm" to "video.asm". 2004-12-20 Joost Yervante Damad * documentation additions and added 002B and 002C 2004-12-19 Maarten ter Huurne * Implemented VDPSTA: VDP status register reading. Fixes games that are polling S#2 to see if command finished. * Implemented SETPLT: set palette. Fixes wrong colours in some games. 2004-12-19 Manuel Bilderbeek * Stubbed the functions that were already in the jump table, but only did a ret * Now also for subrom 2004-12-18 Joost Yervante Damad * add debian/ directory, provides debian packaging 2004-12-18 Albert Beevendorp * fixed a bug in CHGCLR which resulted in a different bordercolor in Famicle Parodic. 2004-12-18 Maarten ter Huurne * Added support for Pasmo to make.bat/build.bat: "make pasmo" selects Pasmo instead of tniASM. Patch provided by BouKiCHi. * Keep Kana LED in off state. * Released C-BIOS 0.18. 2004-12-17 Maarten ter Huurne * Refactored subslot selection code from "cal_slt" into reusable subroutines. * Implemented subslot support for RDSLT and WRSLT. * Implemented CLRSPR (clear sprites) and also call it when switching screen mode. 2004-12-12 Maarten ter Huurne * Added "dist" target to Makefile. 2004-12-11 Maarten ter Huurne * Added support for Pasmo in the Makefile. You can select an assembler by setting "Z80_ASSEMBLER" to "pasmo" or "sjasm". * Added graphical logo to splash screen. Thanks to Patrick van Arkel (Vampier) for drawing the logo. 2004-12-10 Maarten ter Huurne * Made the MSX1 VRAM transfer routines faster. 2004-12-09 Maarten ter Huurne * Introduced debug.asm, which contains routines useful for debugging. * Added MSX2 routines for reading and writing VRAM. 2004-12-07 Maarten ter Huurne * Make CHGMOD routine available from subrom ($00D1). * Implemented CHKNEW routine. 2004-12-07 Albert Beevendorp * fixed order of memory mapper blocks. * Implemented subrom search routine. 2004-12-05 Maarten ter Huurne * Implemented searching for expanded slots. EXPTBL is now filled correctly. 2004-12-04 Maarten ter Huurne * Split off system variable and hook declarations into separate sources. * Implemented inter-slot call. * Split off hardware related declarations into separate source. * Split off video routines into separate source. * Started subrom implementation: - Implemented SETPAG (only for SCREEN5). - Implemented CHGMDP by calling CHGMOD (incomplete). 2004-11-27 Maarten ter Huurne * Put C-BIOS code into CVS, with the following changes compared to 0.17: - Changed assembly syntax such that MSX-style assemblers like SjASM and tniASM accept it. - Assemble main ROM file from main source, instead of in two halves. - Renamed source files. - Added Makefile. - Moved change log from main source file to this file. 2003-08-10 BouKiCHi * fixed clear problem in init_txt, init_txt32. * fixed scroll in CHPUT on txt40/graphic1 modes. 2003-06-01 BouKiCHi * fixed chgmod related. (init_txt, init_txt32 font load added) * fixed curs2de, de2curs (screen1 support added) 2003-04-16 BouKiCHi * divided sound routine from main kernel. 2002-10-02 BouKiCHi * improved init_sc5. 2002-09-26 BouKiCHi * fixed keyboard routine. 2002-09-25 BouKiCHi * rewrite ENASLT. * added init_sc7. 2002-09-23 BouKiCHi * added disk routine. 2002-09-22 BouKiCHi * fixed init_sc5. 2002-09-19 BouKiCHi * improved stroke speed of keyboard input. * added scroll routines. * fixed init_grp. 2002-09-18 BouKiCHi * added CHPUT routine. * rewrite curs2de and de2curs routine again. 2002-09-16 BouKiCHi * added half of system font. 2002-09-12 BouKiCHi * initilize from RG8SAV to RG23 * ENASLT returns state of disable interrupt. 2002-09-11 BouKiCHi * added print_error function. * added ROM searching and fixed usage of EXPTBL. 2002-09-10 BouKiCHi * improved clearing memory routine. * added memory saving trap. 2002-09-08 BouKiCHi * fixed WRSLT. * added keyboard routine. * added GTSTCK and GTTRIG. 2002-08-27 BouKiCHi * added sound mode. * syntax adjust for other assemblers. * fixed RDPRIM. 2002-08-26 BouKiCHi * added initialize value of GRP??? and MLT???. * re-adjust memory ack function. * added calling H.STKE function. * re-adjust routines. 2002-08-24 BouKiCHi * added INITGRP,CHGMOD and sound_init. 2002-08-21 BouKiCHi * name of this project was changed. 2002-08-20 BouKiCHi * added initilize table of $fcc2-$fcc4 * added in_joy and in_trig * filesize reduced from 32KB to 16KB. * set.bat can be restoring for only 32kb readable emulators. 2002-08-19 BouKiCHi * added DCOMPR function and adjusted wait. 2002-08-15 BouKiCHi * improved cartridge knowledge. 2002-08-13 BouKiCHi * added fonts and key input routine,displayed infomation. 2002-08-09 BouKiCHi * it's my birthday,this version was playable games. 2002-08-07 BouKiCHi * start development. # vim:ts=4:expandtab cbios-0.28/roms/0000755000000000000000000000000013141335361012220 5ustar rootrootcbios-0.28/roms/cbios_main_msx2_jp.rom0000644000000000000000000010000013137376076016510 0ustar rootroot Ò#ä$G$Æ$Ú".QW_qÅä5ÔÝæïø?r!4YÍ÷ )/ASCö fyËÝð-PbsÂÒãõ  2 C S e w É Ú [!$'6:>gy}Ó$,;2GQÍÓO #(##N#fi:G.:@G.˹xәyә!y80!x w_ۘqӘә>ә}ә|?әә>ә}ә|?@ә:0qQ xAO Ә :0_G xA<= :0qQ xA<= !:(:=:o:G.:!* qӘ x :G.:_:8*(%%:2*&2:8*(Q:W {Ә>ӘyӘ 0 zӘ!!!!:)0(:G.:G .ͣ ͣ:G.:G .">ͣ ͣ:G.:G .ͣͣͣͣͣ:G.:G .ͣ>ͣ>ͣͣͣ:G.:G .ͣͣͣͣͣ! F~#fo)GG.   &o)))0))[&ɇ*(_:>> 8 :(+0 * "!"!.[K:2**K @:O t :/Ot* "::(:,/2, :,/2, WXK O:GQ( /z(WWAә}әGۘQӘә>әۙә>әۙ......>22Z>!ͅ>!  ͅ.!.;..![$: !9KZvv:(8*"> ͅ>!w*$oͅ:*Å:G*$Å:G!):G!:G!:!%,(!*!$:g.&>->.%} |әyә>͛8K o&))) @:##![ͫ RIGHTC!mͫ LEFTC!~ͫ UPC!ͫ TUPC!ͫ DOWNC!ͫ TDOWNCK[SCALXYCS*))))).>2,y( G>2,yO "*MAPXY:,**FETCHC! ͫ STOREC!+ ͫ SETATR!= ͫ READC!N ͫ SETC!^ ͫ NSETCX!p ͫ GTASPC! ͫ PNTINI! ͫ SCANR! ͫ SCANL>#.ͷ >.~#/ 00/7/Ϳ Ϳ | } >ӫ>PӪ<<w /w %$|(ټ8( .gxGyOyO0xG0}(%LxӨy2!S͗ͯO!:# #!*G$>22͝!i%3>ә>әә@ә>vӘә!әۘv(֯ә>әx/Ϳ#>2>2>2>2͝!A!i%3^=>22)!&3C-BIOS Logo ROM!?6!!@̲ͥ!̲ͥ(g(#< G##x##W_x͕!ABx!%3G0Yxx(>.Yx0Y> Y> Y##4(OۙG$4(4(4(G _x0_|!_qx͕zx!@~(!%3#>!w} >!w>!wM>!w>!w'>!w>2>2!"""H!"J"t!N%!"!"!"! "!"!"!8"!"! "!"!"!8"!"!"!"!8"!Y"!u"]!"c!u"i>2\2b2h>'2> 2:2>2>2>2>2>2:2*" >!Y"2!ۨW?OӨ:/_2G:/ {P2G:/ {{/2zӨp#y@O0!y  # 2 O2!&C #&Dy7ȷy#v:0 ~Y#~!# :(:)PP:D!ͫ INIFNK!ͫ STRTMS*[> *[ v~#} !"ͤ:0͸:2a(:b 8*ʪbW*:$8"&w* !<> ͗: *:,0 5-"!"*:!0">2>2:!0<:!<2:= :=2:2:=2:!<2G< 2!`4(5(.y2(y2"22> > >>2:!<2:=2!:_w: bÅ*E:2G:b=2bs"&:W=O!bk+*E:G:b<2bs"&:=OT]#:O)8 (͐:(O͐ͤ! :> ͗7:::bW::bQ2_! **ͤ: !!~/w#!b>W 7    * 7LUj*E*KJlLM5YALBUCDHxyͶ8ͷ( > ͪ27ӑ>Ӑ/Ӑͻې>0/!w  w@8 `0@P7:>2? !3*"&}w4ʘ 0!22:?͸*"> 2bQ (*: &~(:bW*"> :27ɯ۪Ӫ۩۪Ӫ۩7!ͫ ISCNTC!ͫ BEEP"!)ͫ FNKSB!:ͫ ERAFNK!Lͫ DSPFNK::ͽʔÝ!rͫ 7TAPION!ͫ 7TAPIN!ͫ TAPIOF!ͫ 7TAPOON!ͫ 7TAPOUT!ͫ TAPOOFG۪( ( ˧(Ӫ><<<>Ӡ{ӡӠۢɷ>(<ӫۨӨۙO۪Ӫ۩ͧͬ:d >'/!_~=(>濳_>>/!O ~>0 >'<=G(L>濳_>x( >Ѡ(>ɯ!ͫ GTPAD!ͫ GTPDLNF#~##o&N~2Ͷ/2*[ :=2 ! q#>2E۪O !yӪ۩w# !:!&8!& ݾh/ݦw8## y !(>2y((x >! > 5>x > $>!_( ~(V*w#} !["W:G$&L!4ͫ %LCALBAS["Sۙ!F( Ә x !~Ә# x >ә>@ә!%~Ә#~ Ә |D|D|D 0H8T|8T8T8T||DD|DD|@||P (D|$DH$UbD| |D|D|p@@|D|((HHB$$B|(H|T|TT0ll$$~$~$$>TT>>"T(%B8DD(2J|`` T88T|`` ~`` @8LTTd8088D8@|x8xDDD||@xx8@xDD8|D8D8DD88DD<8 @ ||  8D $_E $GۨẀ{z-%Wէ$|oG> $_Ez $GۨWYͅz-%W$zG(= !z$ۨÌz-%oG>U$W|gG>$_/OzG}$G>U$GzgۨoӨ:/O2}Ө!zo|gywۨӨW_oۨO?Ө{o|&))@0|/g:/_2oyӨzO}! wzGۨO?Ө{2yӨzO! sӨ^ӨszӨӨ͘ӨC-BIOS 0.28 cbios.sf.net Localization: JP Init ROM in slot: Cannot execute a BASIC ROM. ERROR:MEMORY NOT FOUND.CALLED NON EXISTING BASIC.STACK ERROR. No cartridge found. This version of C-BIOS can only start cartridges. Please restart your MSX (emulator) with a cartridge inserted.0123456789-^\@[;:],./_abcdefghijklmnopqrstuvwxyz0!"#$%&'()=~|`{+*}<>?_ABCDEFGHIJKLMNOPQRSTUVWXYZ          쑓᚟ꗘ̱Ͱڹʷ׾Ķû†  *+/0123456789-,.p@{( !1ͫ > .z/{/ROMBAS>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:!I:ͫ BASIC statements are not implemented yet3!"}ͫ unknown@7D179}!!!~ͫ unknown@7E14cbios-0.28/roms/cbios_basic.rom0000644000000000000000000004000013137376076015206 0ustar rootrootAB@>_3B!$0@!IbB!JbBE@!">w!-J!IbB!_@!-A!͖@͟( (͢w#͢> ͢wɯ(+>͢> ͢>͢A(!IbBͦ@!J~ #~+@(##!J(## ~#fo~#fo@ɯ( #>ɯ(=($( #>!IbB!oA~0(890>ɯ~a(8z0 w#~#foeA(~#fo#F#N#xAA> ͢~# ҢAҿAAAWO!nB ~#fo z͢ÇAbBÇA͢ÇAAAÇA!JbBoAn#f#A!JbB*BB*BB*BB*BB}0͢ɷ(B0â <8B=8O! _~(_####~ {~mB͢#nFrFvF{FFFFFFFFFFFFFFFFFFFFFFFFFFGG GGGG!G'G.G5G:G@GGGNGUG\GaGfGlGpGtGzGGGGGGGGGGGGGGGGGGGGGGGGHH HHHH H%H*H.H3H7H>HAHFHKHPHTHWH\H`HdHhHpHvH|HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHII IIIIII#I'I+I0I5I;IBIGILIQIVI[I`IeIiIoIuIyI}IIIIIIIIIIIENDFORNEXTDATAINPUTDIMREADLETGOTORUNIFRESTOREGOSUBRETURNSTOPPRINTCLEARLISTNEWONWAITDEFPOKECONTCSAVECLOADOUTLPRINTLLISTCLSWIDTHTRONTROFFSWAPERASEERRORRESUMEDELETEAUTORENUMDEFSTRDEFINTDEFSNGDEFDBLLINEOPENFIELDGETPUTCLOSELOADMERGEFILESLSETRSETSAVELFILESCIRCLECOLORDRAWPAINTBEEPPLAYPSETPRESETSOUNDSCREENVPOKESPRITEVDPBASECALLTIMEKEYMAXMOTORBLOADBSAVEDSKO$SETNAMEKILLIPLCOPYCMDLOCATETOTHENTAB(STEPUSRFNSPC(NOTERLERRSTRING$USINGINSTRVARPTRCSRLINATTR$DSKI$OFFINKEY$POINT>=<+-*/^ANDORXOREQVIMPMOD\LEFT$RIGHT$MID$SGNINTABSSQRRNDSINLOGEXPCOSTANATNREMINPPOSLENSTR$VALASCCHR$PEEKVPEEKSPACE$OCT$HEX$LPOSBIN$CINTCSNGCDBLFIXSTICKSTRIGPDLPADDSKFFPOSCVICVSCVDEOFLOCLOFMKI$MKS$MKD$C-BASIC ver 0.02 (050607) Copyright (C) BouKiCHi Ok recognized Line num Not implemented yet "J'JA ALISTVLIST III Icbios-0.28/roms/cbios_main_msx2+_jp.rom0000644000000000000000000010000013137376076016563 0ustar rootroot Ò#ä$G$Æ$Ú".Z`hzÎí>ÝæïøH{!4YÍ÷ 2/ASCö fyËÝð-Yk|ËÛìþ  ) ; L \ n À Ò ã [!$'6:>gy}Ó$5;;PZÖÜLPO #(##N#fi:G.:@G.˹xәyә!y8!8 ( 0!x whۘzӘә>ә}ә|?әә>ә}ә|?@ә:0zZ xAO Ә :0hP xA<= :0zZ xA<= !:(:=:o:G.:!* zӘ x :G.:h:8*(%%:;*&;:8*(Z:W {Ә>ӘyӘ 0 zӘ!!!!:)0(:G.:G .ͬ ͬ:G.:G .">ͬ ͬ:G.:G .ͬͬͬͬͬ:G.:G .ͬ>ͬ>ͬͬͬ:G.:G .ͬͬͬͬͬ! F~#fo)GG.   &o)))0))[&ɇ*(_:>> 8 :(+0 * "!"!7[K:2**K @:O } :/O}* "::(:,/2, :,/2, WXK O:GZ( /z(``Aә}әPۘZӘә>әۙә>әۙ......>22c>!͎>!  ͎.!.;..![$: !BTc:(8*"> ͎>!w*$o͎:*Î:G*$Î:G!):G!:G!:!.,$(!*!$:g.&>-$>.$.}$ |әyә>ͤ8K o&))) @:##!dʹ RIGHTC!vʹ LEFTC!ʹ UPC!ʹ TUPC!ʹ DOWNC!ʹ TDOWNCK[SCALXYCS*))))).>2,y( G>2,yO "*MAPXY:,**FETCHC!" ʹ STOREC!4 ʹ SETATR!F ʹ READC!W ʹ SETC!g ʹ NSETCX!y ʹ GTASPC! ʹ PNTINI! ʹ SCANR! ʹ SCANL>#. >.~#/ 00/7/ | } >ӫ>PӪ<<w /w %$|(ټ8( .gxGyOyO0xG0}(%TxӨy2!S͗͸O!:# #!*G$>22ͦ!i%3>ә>әә@ә>vӘә!әۘv(֯ә>әx/Ϳ#>2>2>2>2ͦ!A!i%3^=>22)!&3C-BIOS Logo ROM!?6!!@̲ͥ!̲ͥ(g(#< G##x##W_x͕!ABx!%3G0Yxx(>.Yx0Y> Y> Y##4(OۙG$4(4(4(G _x0_|!_qx͕zx!@~(!%3#>!w} >!w>!wM>!w>!w'>!w>2>2!"""H!"J"t!N%!"!"!"! "!"!"!8"!"! "!"!"!8"!"!"!"!8"!Y"!u"]!"c!u"i>2\2b2h>'2> 2:2>2>2>2>2>2:2*" >!Y"2!ۨW?OӨ:/_2G:/ {P2G:/ {{/2zӨp#y@O0!y  # 2 O2!&C #&Dy7ȷy#v:0 ~Y#~!# :(:)PP:D!ʹ INIFNK!ʹ STRTMS*[> *[ v~#} !"ͤ:0͸:2a(:b 8*ʪb`*:$8"&w* !<> ͗: *:,0 5-"!"*:!0">2>2:!0<:!<2:= :=2:2:=2:!<2G< 2!`4(5(.y2(y2"22> > >>2:!<2:=2!:_w: bÎ*E:2G:b=2bs"&:W=O!bk+*E:G:b<2bs"&:=OT]#:O)8 (͐:(O͐ͭ! :> ͗7:::b`::bZ2_! **ͭ: !!~/w#!b>` 7    3 7LUj3E3KJlLM5YALBUCDHxyͶ8ͷ( > ͪ27ӑ>Ӑ/Ӑͻې>0/!w  w@8 `0@P7:>2? !3*"&}w4ʘ 0!22:?͸*"> 2bZ (*: &~(:b`*"> :27ɯ۪Ӫ۩۪Ӫ۩7!ʹ ISCNTC!ʹ BEEP"!)ʹ FNKSB!:ʹ ERAFNK!Lʹ DSPFNK::ͽʝæ!rʹ 7TAPION!ʹ 7TAPIN!ʹ TAPIOF!ʹ 7TAPOON!ʹ 7TAPOUT!ʹ TAPOOFG۪( ( ˧(Ӫ><<<>Ӡ{ӡӠۢɷ>(<ӫۨӨۙO۪Ӫ۩ͧͬ:d >'/!_~=(>濳_>>/!O ~>0 >'<=G(L>濳_>x( >Ѡ(>ɯ!ʹ GTPAD!ʹ GTPDLNF#~##o&N~2Ͷ/2*[ :=2 ! q#>2E۪O !yӪ۩w# !:!&8!& ݾh/ݦw8## y !(>2y((x >! > 5>x > $>!_( ~(V*w#} !["W:G$&T!4ʹ %TCALBAS["S//ۙ!F( Ә x !~Ә# x >ә>@ә!%~Ә#~ Ә |D|D|D 0H8T|8T8T8T||DD|DD|@||P (D|$DH$UbD| |D|D|p@@|D|((HHB$$B|(H|T|TT0ll$$~$~$$>TT>>"T(%B8DD(2J|`` T88T|`` ~`` @8LTTd8088D8@|x8xDDD||@xx8@xDD8|D8D8DD88DD<8 @ ||  8D $_E $GۨẀ{z-%Wէ$|oG> $_Ez $GۨWYͅz-%W$zG(= !z$ۨÌz-%oG>U$W|gG>$_/OzG}$G>U$GzgۨoӨ:/O2}Ө!zo|gywۨӨW_oۨO?Ө{o|&))@0|/g:/_2oyӨzO}! wzGۨO?Ө{2yӨzO! sӨ^ӨszӨӨ͘ӨC-BIOS 0.28 cbios.sf.net Localization: JP Init ROM in slot: Cannot execute a BASIC ROM. ERROR:MEMORY NOT FOUND.CALLED NON EXISTING BASIC.STACK ERROR. No cartridge found. This version of C-BIOS can only start cartridges. Please restart your MSX (emulator) with a cartridge inserted.0123456789-^\@[;:],./_abcdefghijklmnopqrstuvwxyz0!"#$%&'()=~|`{+*}<>?_ABCDEFGHIJKLMNOPQRSTUVWXYZ          쑓᚟ꗘ̱Ͱڹʷ׾Ķû†  *+/0123456789-,.p@{( !1ʹ > .z/{/ROMBAS>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:!I:ʹ BASIC statements are not implemented yet3!"}ʹ unknown@7D179}!!!~ʹ unknown@7E14cbios-0.28/roms/cbios_main_msx2.rom0000644000000000000000000010000013137376076016017 0ustar rootroot Ò#ä$G$Æ$Ú".QW_qÅä5ÔÝæïø?r!4YÍ÷ )/ASCö fyËÝð-PbsÂÒãõ  2 C S e w É Ú [!$'6:>gy}Ó$,;2GQÍÓO #(##N#fi:G.:@G.˹xәyә!y80!x w_ۘqӘә>ә}ә|?әә>ә}ә|?@ә:0qQ xAO Ә :0_G xA<= :0qQ xA<= !:(:=:o:G.:!* qӘ x :G.:_:8*(%%:2*&2:8*(Q:W {Ә>ӘyӘ 0 zӘ!!!!:)0(:G.:G .ͣ ͣ:G.:G .">ͣ ͣ:G.:G .ͣͣͣͣͣ:G.:G .ͣ>ͣ>ͣͣͣ:G.:G .ͣͣͣͣͣ! F~#fo)GG.   &o)))0))[&ɇ*(_:>> 8 :(+0 * "!"!.[K:2**K @:O t :/Ot* "::(:,/2, :,/2, WXK O:GQ( /z(WWAә}әGۘQӘә>әۙә>әۙ......>22Z>!ͅ>!  ͅ.!.;..![$: !9KZvv:(8*"> ͅ>!w*$oͅ:*Å:G*$Å:G!):G!:G!:!%,(!*!$:g.&>->.%} |әyә>͛8K o&))) @:##![ͫ RIGHTC!mͫ LEFTC!~ͫ UPC!ͫ TUPC!ͫ DOWNC!ͫ TDOWNCK[SCALXYCS*))))).>2,y( G>2,yO "*MAPXY:,**FETCHC! ͫ STOREC!+ ͫ SETATR!= ͫ READC!N ͫ SETC!^ ͫ NSETCX!p ͫ GTASPC! ͫ PNTINI! ͫ SCANR! ͫ SCANL>#.ͷ >.~#/ 00/7/Ϳ Ϳ | } >ӫ>PӪ<<w /w %$|(ټ8( .gxGyOyO0xG0}(%LxӨy2!S͗ͯO!:# #!*G$>22͝!i%3>ә>әә@ә>vӘә!әۘv(֯ә>әx/Ϳ#>2>2>2>2͝!A!i%3^=>22)!&3C-BIOS Logo ROM!?6!!@̲ͥ!̲ͥ(g(#< G##x##W_x͕!ABx!%3G0Yxx(>.Yx0Y> Y> Y##4(OۙG$4(4(4(G _x0_|!_qx͕zx!@~(!%3#>!w} >!w>!wM>!w>!w'>!w>2>2!"""H!"J"t!N%!"!"!"! "!"!"!8"!"! "!"!"!8"!"!"!"!8"!Y"!u"]!"c!u"i>2\2b2h>'2> 2:2>2>2>2>2>2:2*" >!Y"2!ۨW?OӨ:/_2G:/ {P2G:/ {{/2zӨp#y@O0!y  # 2 O2!&C #&Dy7ȷy#v:0 ~Y#~!# :(:)PP:D!ͫ INIFNK!ͫ STRTMS*[> *[ v~#} !"ͤ:0͸:2a(:b 8*ʪbW*:$8"&w* !<> ͗: *:,0 5-"!"*:!0">2>2:!0<:!<2:= :=2:2:=2:!<2G< 2!`4(5(.y2(y2"22> > >>2:!<2:=2!:_w: bÅ*E:2G:b=2bs"&:W=O!bk+*E:G:b<2bs"&:=OT]#:O)8 (͐:(O͐ͤ! :> ͗7:::bW::bQ2_! **ͤ: !!~/w#!b>W 7    * 7LUj*E*KJlLM5YALBUCDHxyͶ8ͷ( > ͪ27ӑ>Ӑ/Ӑͻې>0/!w  w@8 `0@P7:>2? !3*"&}w4ʘ 0!22:?͸*"> 2bQ (*: &~(:bW*"> :27ɯ۪Ӫ۩۪Ӫ۩7!ͫ ISCNTC!ͫ BEEP"!)ͫ FNKSB!:ͫ ERAFNK!Lͫ DSPFNK::ͽʔÝ!rͫ 7TAPION!ͫ 7TAPIN!ͫ TAPIOF!ͫ 7TAPOON!ͫ 7TAPOUT!ͫ TAPOOFG۪( ( ˧(Ӫ><<<>Ӡ{ӡӠۢɷ>(<ӫۨӨۙO۪Ӫ۩ͧͬ:d >'/!_~=(>濳_>>/!O ~>0 >'<=G(L>濳_>x( >Ѡ(>ɯ!ͫ GTPAD!ͫ GTPDLNF#~##o&N~2Ͷ/2*[ :=2 ! q#>2E۪O !yӪ۩w# !:!&8!& ݾh/ݦw8## y !'>2y((x >! > 5>x > $>!_( ~(V*w#} !["W:G$&L!4ͫ %LCALBAS["Sۙ!' Ә x !~Ә# x >ә>@ә!%~Ә#~ Ә  $_E $GۨẀ{z-%Wէ$|oG> $_Ez $GۨWYͅz-%W$zG(= !z$ۨÌz-%oG>U$W|gG>$_/OzG}$G>U$GzgۨoӨ:/O2}Ө!zo|gywۨӨW_oۨO?Ө{o|&))@0|/g:/_2oyӨzO}! wzGۨO?Ө{2yӨzO! sӨ^ӨszӨӨ͘ӨC-BIOS 0.28 cbios.sf.net Localization: EU/INT Init ROM in slot: Cannot execute a BASIC ROM. ERROR:MEMORY NOT FOUND.CALLED NON EXISTING BASIC.STACK ERROR. No cartridge found. This version of C-BIOS can only start cartridges. Please restart your MSX (emulator) with a cartridge inserted.0123456789-=\[];'`,./abcdefghijklmnopqrstuvwxyz)!@#$%^&*(_+|{}:"~<>?ABCDEFGHIJKLMNOPQRSTUVWXYZ     ˩ٿڷ冦椢ح궸  *+/0123456789-,.p@{( !1ͫ > .z/{/ROMBAS>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:!I:ͫ BASIC statements are not implemented yet3!"}ͫ unknown@7D179}!!!~ͫ unknown@7E14cbios-0.28/roms/cbios_logo_msx2.rom0000644000000000000000000004000013137376076016036 0ustar rootrootC-BIOS Logo ROM!H΂!">_!v;A!"b:G G>!1_G !g w> ә>ә!g>ә>ә>!1_G( !v!"!a">2>2!ȂJ2D!O~(0O~wO~(0<=O~w#O~(0<=w#!;v ! # !^#V#;vvә>ә :0 ~͢#~!_#U''''''''''''''''3Uwtcsrrrpp'3Uwtcsrrrpw'3Uwtcsrrrwp'3Uwtcsrrwpp'3Uwtcsrwrpp'3Uwtcswrrpp'3Uwtcwrrrpp'3Uwwcsrrrpp'3Uwtwsrrrppց6VvV0.28$8~#(0_P0$$$$8˻1bkB0bk+!~#O! !$0$j#~3@Cy64}c:j$a~?~~Y~g~}[~j+~CrWcPzfٶa 8M9<ҩ7_ ~&9l戗8_wcfA1|W9~ɓ|+fN|6!WwvN5?|Vg<(3|fGUVdCwc93?:3k/yĊw ΰ:z?c!8Dw{gKWQ\#v'C>Rg~xfǀY+#ySzYgeUn8vc9FV#f+zU8CVgsfEޏHgf-=f_of1'< ۭi;Yfc#C=K^fNfҙ7z;S 8;cߨ8~f)Gf_f6{܏WVviDN>se >sVޠJOӡ}):.G583ҔZ|4ΞSfEfCi*dODFd~C| 6Wv>-wfHe|%EVS.̭~4FPpD'VUf?2)S|rheG)4UTC~3e6̀uS{|[e7UeDUgUe|o*eU$eUSUgGD8rS(ɀ6%gDÔNVgbD~Rd͉ U0"qUbĀEf ~?8_ͺ9Cg~73߀7ۀkm8?R:k>:?~~dS9|QJj>~^(/e~/$~)? })8c΃$|4"~3>A3@"D>_~c?30~#^}C34~8K#~ȀLcD~ȀS4D~~-@c/cbios-0.28/roms/cbios_sub.rom0000644000000000000000000004000013137376076014716 0ustar rootrootCD~|}!8*ME sygÊÅ× ×é ú é ó`åPòf%u n M aü|ÌÞðÒ%6HOa~O #(##N#fi>#.">.~#/ 00/7/**|:}:Wo|oG>͉_E͉GۨẀ{zīWէo|oG>͉_Ez͉GۨWYͅzīWozG(= !ۨÌzīoG>U W|gG>_/OzG}gG>U6GzgۨoӨ:/O2}Ө!zo|gywۨӨW_oۨO?Ө{o|&))@0|/g:/_2oyӨzO}! wzGۨO?Ө{2yӨzO! sӨ^ӨszӨӨ͘Ө:G:@G˹xәyә!y80!x w0ۘBӘә>ә}ә|?әә>ә}ә|?@ә:0B͈ xAO Ә :00~ xA<= :0B͈ xA<= !`s [  !:0˾22!xQ >ә>ә!###>ә>ә:(:=:o:G:!* BӘ x :G:͐:8*(%%:i *&i :8*(͈ :W {Ә>ӘyӘ %0 zӘ>2222:2>22*""*:)8!"$*"(*"&\ ͏ >22>22*""*"$*"&*"(\ :222P͛͞ >2*""BӘ< *"$*"(*"&22͛ͽ >2*""B Ә< *"$*"(*"&22Ͳ͛ :)0(:G:G  :G:G "> :G:G :G:G >>:G:G ! F~#fo)GG   &o)))%0))[&ɇ*(_:>> 8 :("0 * "!"u [K :2**K @:O ͫ :/Oͫ* ":4 :(:,/2, 4 :,/2, WXK O:G"( /z(((Aә}ә~ ͈ۘ Әә>әۙә>әۙ>22͞ >!V>!  V!*!\;![$*!\>2*""BӘ< *"$*"(*"&:G:G >> >!6#6͛ͽ >2:G: G !""!x"&!v"(22 ͗ >2:G:G !""!x"&!v"(22 ͗ >2: G:G !""!"&!"(22 ͗ >2:G:G !""!"&!"(22 ͗ : !} ɏ  :(8*"> V!"}!wɯ*$oV:*V:G*$V:G!):G!:G!:!l ,b (\ !*\ !$\ :g.&\ >-b >.b l }b |әyә> 8K o&))) @:P#! RIGHTC! LEFTC! UPC! TUPC! DOWNC! TDOWNCK[SCALXYCS*))))).>2,y( G>2,yO "*MAPXY:,**FETCHC!`STOREC!rSETATR!READC!SETC!NSETCX!GTASPC!PNTINI!SCANR!SCANL!DOGRPHu :2*"f ":*g"hCjCl!@:8:2n:y>ә>ә!@:8:ӛ #!~MAPXYC!TRIGHT!TRIGHT:WCfSh*B"j!"l2o:2n*:g"hSh>2o:2j*"f:py*0R#"l:WSh*0R#"jSf2o:2n:y!Zn CLRTXT*":G: :G:G:O: !*()o>GE '͈  !\~Ә#Ӛ'~  ۘӚ'O ~ ۘGۘO'zO ͈ BӚӘ{ӚӘ:> 8> ә>ә!bx7z7!:: $B!RKj[l~y*bN#F#Cj^#V#Sl( (NC2nB~y>ә>ә> G(x(ůCӛyO#NB*fKj[lq#p#s#r#( (~>yB>  G > COq#> 8!BLTVD!BLTDV!BLTMD!0BLTDM!ANEWPADͳͼ!ZKNJPRT> ӴyG۵ӵyӴ۵G> ӴyG۵ӵyӴxӵcbios-0.28/roms/cbios_main_msx1.rom0000644000000000000000000010000013137376076016016 0ustar rootroot ÿ#$4$!s$'9NX".EMU`mÁ×í^ÂCÏ÷oÂÌ×:R\j|Ïô6TK%ASVõfj{ÍßÏGYò!jyDVgvÆ×éù  & 7 G Y k } Î çajmpsÂÆÊópO #(##N#fi:G.:@G.˹xәyә!x wUۘ`Ә}ә|?ә}ә|?@ә` xAO Ә U xA<= ` xA<£= !C!xQ ":(:=:o:G.:!* `Ә x :G.:H:8*(%%:m*&m:8*(`:W {Ә>ӘyӘ ͌0 zӘ>22:2>22*""*"$*"(*"&͏ͨþ>22>22*""*"$*"&*"(ͨ:2ͷSþ>2*""`Ә< *"$*"(*"&Sþ>2*""` Ә< *"$*"(*"&Sþ:G.:G .J J:G.:G .JJJJJ:G.:G .J>J>JJJ:G.:G .JJJJJ!h F~#fo)GG.   &o)))͌0))[&ɇ*(_:>> 8 :("0 * "!""[K͹:2**K @:O  :/O* ":͛:(:,/2, ͛:,/2, WXK O:GE( /z(MMAә}әۘӘә>әۙә>әۙ......>22>!m>!  m.!͗![$×:!:(8*"> m>!wE*$om:*m:G*$mK o&))) @:Ϳ##!O͟ RIGHTC!a͟ LEFTC!r͟ UPC!͟ TUPC!͟ DOWNC!͟ TDOWNCK[SCALXYCS*))))).>2,y( G>2,yO "*MAPXY:,**FETCHC! ͟ STOREC! ͟ SETATR!1 ͟ READC!B ͟ SETC!R ͟ NSETCX!d ͟ GTASPC!v ͟ PNTINI! ͟ SCANR! ͟ SCANL>#.ͫ >.~#/ 00/7/ͳ ͳ | } >ӫ>PӪ<<w /w %$|(ټ8( .gxGyOyO0xG0}(%ÇxӨy2!CMN!:Ϳ# #!*4$>22!V%͎x͊>2>2>2>2!V%͎">22)!&͎eC-BIOS Logo ROM!?6!!@iv!iv(g(#< GͿ##xͿ##W_xY!AB!x!%͎G0ʹxx(>.ʹx0ʹ> ʹ> ʹ##(Oۙ4$(((G _x0_|!_qxYzx!@~(!%͎#>!w} >!w>!wM>!w>!w'!"""H!"J"t!;%!"!"!"! "!"!"!8"!"! "!"!"!8"!"!"!"!8"!Y"!u"]!"c!u"i>2\2b2h>'2> 2:2>2>2>2>2>2:2*" >!"2!ۨW?OӨ:/_2G:/ {P2G:/ {{/2zӨp#y@O0v:0 ~ʹ#~!?# :(:)Pͫ:DR:!c͟ INIFNK!u͟ STRTMS*[> *[ v~#} !"ͤ:0:2a(:½ 8*ͽM*:$8"&w*l. !> : *:,0 E͐-"!".*l:!0..">2>2:!0<:!<2:= :=2:2:=2:!<2G< 2!4(5(.y2(y2"22> > >>2:!<2:=2l!:_w: ͽml*E:2G:ͽ=2ͽ"&:W=O!bk+.l*E:G:ͽ<2ͽ."&:=OT]#:Ó!͗ :> Ò:::ͽM::ͽE2_! **́: !!~/w#!͗ͽ>MV  . E  lrxjEK.JLl+LLMY ABCD"HExyͶ%8( > 27ӑ>Ӑ/Ӑͻې>0/!w  w@8 `0@P7:T>2T? !H͎*"&}w͏ 0!22:ċ*"> 2ͽE (*: &~(:ͽM*"> :27ɯ۪Ӫ۩۪Ӫ۩7!L͟ ISCNTCA!a͟ BEEP"!u͟ FNKSB!͟ ERAFNK!͟ DSPFNK::ͽʂ!͟ 7TAPION!͟ 7TAPIN!͟ TAPIOF!͟ 7TAPOON!͟ 7TAPOUT!͟ TAPOOFG۪( ( ˧(Ӫ>RRӠ{ӡӠۢɷ>(<ӫۨӨۙO۪Ӫ۩ͧͬ:d >s/!_~=(>\濳_>R>\/!O ~>0 >s<=G(L>\濳_>Rx( >\Ѡ(>ɯ!S͟ GTPAD!d͟ GTPDL͚F#~##o&͚~2/2c*[ :=2 ! q#c>2E۪O !yӪ۩w# !:!&8!& ݾĴ/ݦw8## y !'>2y((x >! > 5>x > $>!_(  ~( â*w#} !["?W:4$^%Ç!͟ %ÇCALBASۙ!' Ә x !~Ә# x >ә>@ә!%~Ә#~ Ә e#_E#GۨẀ{z%Wէ$|oG>#_Ez#GۨWYͅz%W$zG(= !g$ۨÌz%oG>U{$W|gG>$_/OzG}$G>U$GzgۨoӨ:/O2}Ө!zo|gywۨӨW_oۨO?Ө{o|&))@0|/g:/_2oyӨzO}! wzGۨO?Ө{2yӨzO! sӨ^ӨszӨӨ͘ӨC-BIOS 0.28 cbios.sf.net Localization: EU/INT Init ROM in slot: Cannot execute a BASIC ROM. ERROR:MEMORY NOT FOUND.CALLED NON EXISTING BASIC.STACK ERROR. No cartridge found. This version of C-BIOS can only start cartridges. Please restart your MSX (emulator) with a cartridge inserted.0123456789-=\[];'`,./abcdefghijklmnopqrstuvwxyz)!@#$%^&*(_+|{}:"~<>?ABCDEFGHIJKLMNOPQRSTUVWXYZ     ˩ٿڷ冦椢ح궸  *+/0123456789-,.p@{( !1͟ > .z/{/ROMBAS>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:!I:͟ BASIC statements are not implemented yet͎!"}͟ unknown@7D179}!?!?!~͟ unknown@7E14cbios-0.28/roms/cbios_logo_msx2+.rom0000644000000000000000000004000013137376076016111 0ustar rootrootC-BIOS Logo ROMz>}!R؂!">_!EA!"b:G G>!1_G !q w> ә>ә!q>ә>ә>!1_G( !!"!a">2>2!҂T2D!O~(0O~wO~(0<=O~w#O~(0<=w#!Ev ! # !^#V#Evvә>ә :0 ~͢#~!_#U''''''''''''''''3Uwtcsrrrpp'3Uwtcsrrrpw'3Uwtcsrrrwp'3Uwtcsrrwpp'3Uwtcsrwrpp'3Uwtcswrrpp'3Uwtcwrrrpp'3Uwwcsrrrpp'3Uwtwsrrrpp @`V0.28.8~#(0_P0....8˻;bkB:bk+!~#O! !.0.j#~3@Cy64}c:j$a~?~~Y~g~}[~j+~CrWcPzfٶa 8M9<ҩ7_ ~&9l戗8_wcfA1|W9~ɓ|+fN|6!WwvN5?|Vg<(3|fGUVdCwc93?:3k/yĊw ΰ:z?c!8Dw{gKWQ\#v'C>Rg~xfǀY+#ySzYgeUn8vc9FV#f+zU8CVgsfEޏHgf-=f_of1'< ۭi;Yfc#C=K^fNfҙ7z;S 8;cߨ8~f)Gf_f6{܏WVviDN>se >sVޠJOӡ}):.G583ҔZ|4ΞSfEfCi*dODFd~C| 6Wv>-wfHe|%EVS.̭~4FPpD'VUf?2)S|rheG)4UTC~3e6̀uS{|[e7UeDUgUe|o*eU$eUSUgGD8rS(ɀ6%gDÔNVgbD~Rd͉ U0"qUbĀEf ~?8_ͺ9Cg~73߀7ۀkm8?R:k>:?~~dS9|QJj>~^(/e~/$~)? })8c΃$|4"~3>A3@"D>_~c?30~#^}C34~8K#~ȀLcD~ȀS4D~~-@c/cbios-0.28/roms/cbios_main_msx2+_br.rom0000644000000000000000000010000013137376076016555 0ustar rootroot Ò#ä$G$Æ$!Ú".Z`hzÎí>ÝæïøH{!4YÍ÷ 2/ASCö fyËÝð-Yk|ËÛìþ  ) ; L \ n À Ò ã [!$'6:>gy}Ó$5;;PZÖÜLPO #(##N#fi:G.:@G.˹xәyә!y8!8 ( 0!x whۘzӘә>ә}ә|?әә>ә}ә|?@ә:0zZ xAO Ә :0hP xA<= :0zZ xA<= !:(:=:o:G.:!* zӘ x :G.:h:8*(%%:;*&;:8*(Z:W {Ә>ӘyӘ 0 zӘ!!!!:)0(:G.:G .ͬ ͬ:G.:G .">ͬ ͬ:G.:G .ͬͬͬͬͬ:G.:G .ͬ>ͬ>ͬͬͬ:G.:G .ͬͬͬͬͬ! F~#fo)GG.   &o)))0))[&ɇ*(_:>> 8 :(+0 * "!"!7[K:2**K @:O } :/O}* "::(:,/2, :,/2, WXK O:GZ( /z(``Aә}әPۘZӘә>әۙә>әۙ......>22c>!͎>!  ͎.!.;..![$: !BTc:(8*"> ͎>!w*$o͎:*Î:G*$Î:G!):G!:G!:!.,$(!*!$:g.&>-$>.$.}$ |әyә>ͤ8K o&))) @:##!dʹ RIGHTC!vʹ LEFTC!ʹ UPC!ʹ TUPC!ʹ DOWNC!ʹ TDOWNCK[SCALXYCS*))))).>2,y( G>2,yO "*MAPXY:,**FETCHC!" ʹ STOREC!4 ʹ SETATR!F ʹ READC!W ʹ SETC!g ʹ NSETCX!y ʹ GTASPC! ʹ PNTINI! ʹ SCANR! ʹ SCANL>#. >.~#/ 00/7/ | } >ӫ>PӪ<<w /w %$|(ټ8( .gxGyOyO0xG0}(%TxӨy2!S͗͸O!:# #!*G$>22ͦ!i%3>ә>әә@ә>vӘә!әۘv(֯ә>әx/Ϳ#>2>2>2>2ͦ!A!i%3^=>22)!&3C-BIOS Logo ROM!?6!!@̲ͥ!̲ͥ(g(#< G##x##W_x͕!ABx!%3G0Yxx(>.Yx0Y> Y> Y##4(OۙG$4(4(4(G _x0_|!_qx͕zx!@~(!%3#>!w} >!w>!wM>!w>!w'>!w>2>2!"""H!"J"t!N%!"!"!"! "!"!"!8"!"! "!"!"!8"!"!"!"!8"!Y"!u"]!"c!u"i>2\2b2h>'2> 2:2>2>2>2>2>2:2*" >!Y"2!ۨW?OӨ:/_2G:/ {P2G:/ {{/2zӨp#y@O0!y  # 2 O2!&C #&Dy7ȷy#v:0 ~Y#~!# :(:)PP:D!ʹ INIFNK!ʹ STRTMS*[> *[ v~#} !"ͤ:0͸:2a(:b 8*ʪb`*:$8"&w* !<> ͗: *:,0 5-"!"*:!0">2>2:!0<:!<2:= :=2:2:=2:!<2G< 2!`4(5(.y2(y2"22> > >>2:!<2:=2!:_w: bÎ*E:2G:b=2bs"&:W=O!bk+*E:G:b<2bs"&:=OT]#:O)8 (͐:(O͐ͭ! :> ͗7:::b`::bZ2_! **ͭ: !!~/w#!b>` 7    3 7LUj3E3KJlLM5YALBUCDHxyͶ8ͷ( > ͪ27ӑ>Ӑ/Ӑͻې>0/!w  w@8 `0@P7:>2? !3*"&}w4ʘ 0!22:?͸*"> 2bZ (*: &~(:b`*"> :27ɯ۪Ӫ۩۪Ӫ۩7!ʹ ISCNTC!ʹ BEEP"!)ʹ FNKSB!:ʹ ERAFNK!Lʹ DSPFNK::ͽʝæ!rʹ 7TAPION!ʹ 7TAPIN!ʹ TAPIOF!ʹ 7TAPOON!ʹ 7TAPOUT!ʹ TAPOOFG۪( ( ˧(Ӫ><<<>Ӡ{ӡӠۢɷ>(<ӫۨӨۙO۪Ӫ۩ͧͬ:d >'/!_~=(>濳_>>/!O ~>0 >'<=G(L>濳_>x( >Ѡ(>ɯ!ʹ GTPAD!ʹ GTPDLNF#~##o&N~2Ͷ/2*[ :=2 ! q#>2E۪O !yӪ۩w# !:!&8!& ݾh/ݦw8## y !'>2y((x >! > 5>x > $>!_( ~(V*w#} !["W:G$&T!4ʹ %TCALBAS["S//ۙ!' Ә x !~Ә# x >ә>@ә!%~Ә#~ Ә  $_E $GۨẀ{z-%Wէ$|oG> $_Ez $GۨWYͅz-%W$zG(= !z$ۨÌz-%oG>U$W|gG>$_/OzG}$G>U$GzgۨoӨ:/O2}Ө!zo|gywۨӨW_oۨO?Ө{o|&))@0|/g:/_2oyӨzO}! wzGۨO?Ө{2yӨzO! sӨ^ӨszӨӨ͘ӨC-BIOS 0.28 cbios.sf.net Localization: BR Init ROM in slot: Cannot execute a BASIC ROM. ERROR:MEMORY NOT FOUND.CALLED NON EXISTING BASIC.STACK ERROR. No cartridge found. This version of C-BIOS can only start cartridges. Please restart your MSX (emulator) with a cartridge inserted.0123456789-=\[];'`,./abcdefghijklmnopqrstuvwxyz)!@#$%^&*(_+|{}:"~<>?ABCDEFGHIJKLMNOPQRSTUVWXYZ     ˩ٿڷ冦椢ح궸  *+/0123456789-,.p@{( !1ʹ > .z/{/ROMBAS>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:!I:ʹ BASIC statements are not implemented yet3!"}ʹ unknown@7D179}!!!~ʹ unknown@7E14cbios-0.28/roms/cbios_main_msx2+.rom0000644000000000000000000010000013137376076016072 0ustar rootroot Ò#ä$G$Æ$Ú".Z`hzÎí>ÝæïøH{!4YÍ÷ 2/ASCö fyËÝð-Yk|ËÛìþ  ) ; L \ n À Ò ã [!$'6:>gy}Ó$5;;PZÖÜLPO #(##N#fi:G.:@G.˹xәyә!y8!8 ( 0!x whۘzӘә>ә}ә|?әә>ә}ә|?@ә:0zZ xAO Ә :0hP xA<= :0zZ xA<= !:(:=:o:G.:!* zӘ x :G.:h:8*(%%:;*&;:8*(Z:W {Ә>ӘyӘ 0 zӘ!!!!:)0(:G.:G .ͬ ͬ:G.:G .">ͬ ͬ:G.:G .ͬͬͬͬͬ:G.:G .ͬ>ͬ>ͬͬͬ:G.:G .ͬͬͬͬͬ! F~#fo)GG.   &o)))0))[&ɇ*(_:>> 8 :(+0 * "!"!7[K:2**K @:O } :/O}* "::(:,/2, :,/2, WXK O:GZ( /z(``Aә}әPۘZӘә>әۙә>әۙ......>22c>!͎>!  ͎.!.;..![$: !BTc:(8*"> ͎>!w*$o͎:*Î:G*$Î:G!):G!:G!:!.,$(!*!$:g.&>-$>.$.}$ |әyә>ͤ8K o&))) @:##!dʹ RIGHTC!vʹ LEFTC!ʹ UPC!ʹ TUPC!ʹ DOWNC!ʹ TDOWNCK[SCALXYCS*))))).>2,y( G>2,yO "*MAPXY:,**FETCHC!" ʹ STOREC!4 ʹ SETATR!F ʹ READC!W ʹ SETC!g ʹ NSETCX!y ʹ GTASPC! ʹ PNTINI! ʹ SCANR! ʹ SCANL>#. >.~#/ 00/7/ | } >ӫ>PӪ<<w /w %$|(ټ8( .gxGyOyO0xG0}(%TxӨy2!S͗͸O!:# #!*G$>22ͦ!i%3>ә>әә@ә>vӘә!әۘv(֯ә>әx/Ϳ#>2>2>2>2ͦ!A!i%3^=>22)!&3C-BIOS Logo ROM!?6!!@̲ͥ!̲ͥ(g(#< G##x##W_x͕!ABx!%3G0Yxx(>.Yx0Y> Y> Y##4(OۙG$4(4(4(G _x0_|!_qx͕zx!@~(!%3#>!w} >!w>!wM>!w>!w'>!w>2>2!"""H!"J"t!N%!"!"!"! "!"!"!8"!"! "!"!"!8"!"!"!"!8"!Y"!u"]!"c!u"i>2\2b2h>'2> 2:2>2>2>2>2>2:2*" >!Y"2!ۨW?OӨ:/_2G:/ {P2G:/ {{/2zӨp#y@O0!y  # 2 O2!&C #&Dy7ȷy#v:0 ~Y#~!# :(:)PP:D!ʹ INIFNK!ʹ STRTMS*[> *[ v~#} !"ͤ:0͸:2a(:b 8*ʪb`*:$8"&w* !<> ͗: *:,0 5-"!"*:!0">2>2:!0<:!<2:= :=2:2:=2:!<2G< 2!`4(5(.y2(y2"22> > >>2:!<2:=2!:_w: bÎ*E:2G:b=2bs"&:W=O!bk+*E:G:b<2bs"&:=OT]#:O)8 (͐:(O͐ͭ! :> ͗7:::b`::bZ2_! **ͭ: !!~/w#!b>` 7    3 7LUj3E3KJlLM5YALBUCDHxyͶ8ͷ( > ͪ27ӑ>Ӑ/Ӑͻې>0/!w  w@8 `0@P7:>2? !3*"&}w4ʘ 0!22:?͸*"> 2bZ (*: &~(:b`*"> :27ɯ۪Ӫ۩۪Ӫ۩7!ʹ ISCNTC!ʹ BEEP"!)ʹ FNKSB!:ʹ ERAFNK!Lʹ DSPFNK::ͽʝæ!rʹ 7TAPION!ʹ 7TAPIN!ʹ TAPIOF!ʹ 7TAPOON!ʹ 7TAPOUT!ʹ TAPOOFG۪( ( ˧(Ӫ><<<>Ӡ{ӡӠۢɷ>(<ӫۨӨۙO۪Ӫ۩ͧͬ:d >'/!_~=(>濳_>>/!O ~>0 >'<=G(L>濳_>x( >Ѡ(>ɯ!ʹ GTPAD!ʹ GTPDLNF#~##o&N~2Ͷ/2*[ :=2 ! q#>2E۪O !yӪ۩w# !:!&8!& ݾh/ݦw8## y !'>2y((x >! > 5>x > $>!_( ~(V*w#} !["W:G$&T!4ʹ %TCALBAS["S//ۙ!' Ә x !~Ә# x >ә>@ә!%~Ә#~ Ә  $_E $GۨẀ{z-%Wէ$|oG> $_Ez $GۨWYͅz-%W$zG(= !z$ۨÌz-%oG>U$W|gG>$_/OzG}$G>U$GzgۨoӨ:/O2}Ө!zo|gywۨӨW_oۨO?Ө{o|&))@0|/g:/_2oyӨzO}! wzGۨO?Ө{2yӨzO! sӨ^ӨszӨӨ͘ӨC-BIOS 0.28 cbios.sf.net Localization: EU/INT Init ROM in slot: Cannot execute a BASIC ROM. ERROR:MEMORY NOT FOUND.CALLED NON EXISTING BASIC.STACK ERROR. No cartridge found. This version of C-BIOS can only start cartridges. Please restart your MSX (emulator) with a cartridge inserted.0123456789-=\[];'`,./abcdefghijklmnopqrstuvwxyz)!@#$%^&*(_+|{}:"~<>?ABCDEFGHIJKLMNOPQRSTUVWXYZ     ˩ٿڷ冦椢ح궸  *+/0123456789-,.p@{( !1ʹ > .z/{/ROMBAS>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:!I:ʹ BASIC statements are not implemented yet3!"}ʹ unknown@7D179}!!!~ʹ unknown@7E14cbios-0.28/roms/cbios_main_msx1_jp.rom0000644000000000000000000010000013137376076016507 0ustar rootroot ÿ#$4$!s$'9NX".EMU`mÁ×í^ÂCÏ÷oÂÌ×:R\j|Ïô6TK%ASVõfj{ÍßÏGYò!jyDVgvÆ×éù  & 7 G Y k } Î çajmpsÂÆÊópO #(##N#fi:G.:@G.˹xәyә!x wUۘ`Ә}ә|?ә}ә|?@ә` xAO Ә U xA<= ` xA<£= !C!xQ ":(:=:o:G.:!* `Ә x :G.:H:8*(%%:m*&m:8*(`:W {Ә>ӘyӘ ͌0 zӘ>22:2>22*""*"$*"(*"&͏ͨþ>22>22*""*"$*"&*"(ͨ:2ͷSþ>2*""`Ә< *"$*"(*"&Sþ>2*""` Ә< *"$*"(*"&Sþ:G.:G .J J:G.:G .JJJJJ:G.:G .J>J>JJJ:G.:G .JJJJJ!h F~#fo)GG.   &o)))͌0))[&ɇ*(_:>> 8 :("0 * "!""[K͹:2**K @:O  :/O* ":͛:(:,/2, ͛:,/2, WXK O:GE( /z(MMAә}әۘӘә>әۙә>әۙ......>22>!m>!  m.!͗![$×:!:(8*"> m>!wE*$om:*m:G*$mK o&))) @:Ϳ##!O͟ RIGHTC!a͟ LEFTC!r͟ UPC!͟ TUPC!͟ DOWNC!͟ TDOWNCK[SCALXYCS*))))).>2,y( G>2,yO "*MAPXY:,**FETCHC! ͟ STOREC! ͟ SETATR!1 ͟ READC!B ͟ SETC!R ͟ NSETCX!d ͟ GTASPC!v ͟ PNTINI! ͟ SCANR! ͟ SCANL>#.ͫ >.~#/ 00/7/ͳ ͳ | } >ӫ>PӪ<<w /w %$|(ټ8( .gxGyOyO0xG0}(%ÇxӨy2!CMN!:Ϳ# #!*4$>22!V%͎x͊>2>2>2>2!V%͎">22)!%͎eC-BIOS Logo ROM!?6!!@iv!iv(g(#< GͿ##xͿ##W_xY!AB!x!%͎G0ʹxx(>.ʹx0ʹ> ʹ> ʹ##(Oۙ4$(((G _x0_|!_qxYzx!@~(!%͎#>!w} >!w>!wM>!w>!w'!"""H!"J"t!;%!"!"!"! "!"!"!8"!"! "!"!"!8"!"!"!"!8"!Y"!u"]!"c!u"i>2\2b2h>'2> 2:2>2>2>2>2>2:2*" >!"2!ۨW?OӨ:/_2G:/ {P2G:/ {{/2zӨp#y@O0v:0 ~ʹ#~!?# :(:)Pͫ:DR:!c͟ INIFNK!u͟ STRTMS*[> *[ v~#} !"ͤ:0:2a(:½ 8*ͽM*:$8"&w*l. !> : *:,0 E͐-"!".*l:!0..">2>2:!0<:!<2:= :=2:2:=2:!<2G< 2!4(5(.y2(y2"22> > >>2:!<2:=2l!:_w: ͽml*E:2G:ͽ=2ͽ"&:W=O!bk+.l*E:G:ͽ<2ͽ."&:=OT]#:Ó!͗ :> Ò:::ͽM::ͽE2_! **́: !!~/w#!͗ͽ>MV  . E  lrxjEK.JLl+LLMY ABCD"HExyͶ%8( > 27ӑ>Ӑ/Ӑͻې>0/!w  w@8 `0@P7:T>2T? !H͎*"&}w͏ 0!22:ċ*"> 2ͽE (*: &~(:ͽM*"> :27ɯ۪Ӫ۩۪Ӫ۩7!L͟ ISCNTCA!a͟ BEEP"!u͟ FNKSB!͟ ERAFNK!͟ DSPFNK::ͽʂ!͟ 7TAPION!͟ 7TAPIN!͟ TAPIOF!͟ 7TAPOON!͟ 7TAPOUT!͟ TAPOOFG۪( ( ˧(Ӫ>RRӠ{ӡӠۢɷ>(<ӫۨӨۙO۪Ӫ۩ͧͬ:d >s/!_~=(>\濳_>R>\/!O ~>0 >s<=G(L>\濳_>Rx( >\Ѡ(>ɯ!S͟ GTPAD!d͟ GTPDL͚F#~##o&͚~2/2c*[ :=2 ! q#c>2E۪O !yӪ۩w# !:!&8!& ݾĴ/ݦw8## y ! (>2y((x >! > 5>x > $>!_(  ~( â*w#} !["?W:4$^%Ç!͟ %ÇCALBASۙ!3( Ә x !~Ә# x >ә>@ә!%~Ә#~ Ә e|D|D|D 0H8T|8T8T8T||DD|DD|@||P (D|$DH$UbD| |D|D|p@@|D|((HHB$$B|(H|T|TT0ll$$~$~$$>TT>>"T(%B8DD(2J|`` T88T|`` ~`` @8LTTd8088D8@|x8xDDD||@xx8@xDD8|D8D8DD88DD<8 @ ||  8D#_E#GۨẀ{z%Wէ$|oG>#_Ez#GۨWYͅz%W$zG(= !g$ۨÌz%oG>U{$W|gG>$_/OzG}$G>U$GzgۨoӨ:/O2}Ө!zo|gywۨӨW_oۨO?Ө{o|&))@0|/g:/_2oyӨzO}! wzGۨO?Ө{2yӨzO! sӨ^ӨszӨӨ͘ӨC-BIOS 0.28 cbios.sf.net Localization: JP Init ROM in slot: Cannot execute a BASIC ROM. ERROR:MEMORY NOT FOUND.CALLED NON EXISTING BASIC.STACK ERROR. No cartridge found. This version of C-BIOS can only start cartridges. Please restart your MSX (emulator) with a cartridge inserted.0123456789-^\@[;:],./_abcdefghijklmnopqrstuvwxyz0!"#$%&'()=~|`{+*}<>?_ABCDEFGHIJKLMNOPQRSTUVWXYZ          쑓᚟ꗘ̱Ͱڹʷ׾Ķû†  *+/0123456789-,.p@{( !1͟ > .z/{/ROMBAS>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:!I:͟ BASIC statements are not implemented yet͎!"}͟ unknown@7D179}!?!?!~͟ unknown@7E14cbios-0.28/roms/cbios_logo_msx1.rom0000644000000000000000000004000013137376076016035 0ustar rootrootC-BIOS Logo ROMo>22b*">VGGG:G:*V*$ 0!\*$ * \* 0!\*>V*" ! \  ????????????|??|?????????|<<<????????~~~~?~xxx|??????|||||????~~~~<🟟|~~>???>??ӘyӘ ͌0 zӘ>22:2>22*""*"$*"(*"&͏ͨþ>22>22*""*"$*"&*"(ͨ:2ͷSþ>2*""`Ә< *"$*"(*"&Sþ>2*""` Ә< *"$*"(*"&Sþ:G.:G .J J:G.:G .JJJJJ:G.:G .J>J>JJJ:G.:G .JJJJJ!h F~#fo)GG.   &o)))͌0))[&ɇ*(_:>> 8 :("0 * "!""[K͹:2**K @:O  :/O* ":͛:(:,/2, ͛:,/2, WXK O:GE( /z(MMAә}әۘӘә>әۙә>әۙ......>22>!m>!  m.!͗![$×:!:(8*"> m>!wE*$om:*m:G*$mK o&))) @:Ϳ##!O͟ RIGHTC!a͟ LEFTC!r͟ UPC!͟ TUPC!͟ DOWNC!͟ TDOWNCK[SCALXYCS*))))).>2,y( G>2,yO "*MAPXY:,**FETCHC! ͟ STOREC! ͟ SETATR!1 ͟ READC!B ͟ SETC!R ͟ NSETCX!d ͟ GTASPC!v ͟ PNTINI! ͟ SCANR! ͟ SCANL>#.ͫ >.~#/ 00/7/ͳ ͳ | } >ӫ>PӪ<<w /w %$|(ټ8( .gxGyOyO0xG0}(%ÇxӨy2!CMN!:Ϳ# #!*4$>22!V%͎x͊>2>2>2>2!V%͎">22)!%͎eC-BIOS Logo ROM!?6!!@iv!iv(g(#< GͿ##xͿ##W_xY!AB!x!%͎G0ʹxx(>.ʹx0ʹ> ʹ> ʹ##(Oۙ4$(((G _x0_|!_qxYzx!@~(!%͎#>!w} >!w>!wM>!w>!w'!"""H!"J"t!;%!"!"!"! "!"!"!8"!"! "!"!"!8"!"!"!"!8"!Y"!u"]!"c!u"i>2\2b2h>'2> 2:2>2>2>2>2>2:2*" >!"2!ۨW?OӨ:/_2G:/ {P2G:/ {{/2zӨp#y@O0v:0 ~ʹ#~!?# :(:)Pͫ:DR:!c͟ INIFNK!u͟ STRTMS*[> *[ v~#} !"ͤ:0:2a(:½ 8*ͽM*:$8"&w*l. !> : *:,0 E͐-"!".*l:!0..">2>2:!0<:!<2:= :=2:2:=2:!<2G< 2!4(5(.y2(y2"22> > >>2:!<2:=2l!:_w: ͽml*E:2G:ͽ=2ͽ"&:W=O!bk+.l*E:G:ͽ<2ͽ."&:=OT]#:Ó!͗ :> Ò:::ͽM::ͽE2_! **́: !!~/w#!͗ͽ>MV  . E  lrxjEK.JLl+LLMY ABCD"HExyͶ%8( > 27ӑ>Ӑ/Ӑͻې>0/!w  w@8 `0@P7:T>2T? !H͎*"&}w͏ 0!22:ċ*"> 2ͽE (*: &~(:ͽM*"> :27ɯ۪Ӫ۩۪Ӫ۩7!L͟ ISCNTCA!a͟ BEEP"!u͟ FNKSB!͟ ERAFNK!͟ DSPFNK::ͽʂ!͟ 7TAPION!͟ 7TAPIN!͟ TAPIOF!͟ 7TAPOON!͟ 7TAPOUT!͟ TAPOOFG۪( ( ˧(Ӫ>RRӠ{ӡӠۢɷ>(<ӫۨӨۙO۪Ӫ۩ͧͬ:d >s/!_~=(>\濳_>R>\/!O ~>0 >s<=G(L>\濳_>Rx( >\Ѡ(>ɯ!S͟ GTPAD!d͟ GTPDL͚F#~##o&͚~2/2c*[ :=2 ! q#c>2E۪O !yӪ۩w# !:!&8!& ݾĴ/ݦw8## y !'>2y((x >! > 5>x > $>!_(  ~( â*w#} !["?W:4$^%Ç!͟ %ÇCALBASۙ!' Ә x !~Ә# x >ә>@ә!%~Ә#~ Ә e#_E#GۨẀ{z%Wէ$|oG>#_Ez#GۨWYͅz%W$zG(= !g$ۨÌz%oG>U{$W|gG>$_/OzG}$G>U$GzgۨoӨ:/O2}Ө!zo|gywۨӨW_oۨO?Ө{o|&))@0|/g:/_2oyӨzO}! wzGۨO?Ө{2yӨzO! sӨ^ӨszӨӨ͘ӨC-BIOS 0.28 cbios.sf.net Localization: BR Init ROM in slot: Cannot execute a BASIC ROM. ERROR:MEMORY NOT FOUND.CALLED NON EXISTING BASIC.STACK ERROR. No cartridge found. This version of C-BIOS can only start cartridges. Please restart your MSX (emulator) with a cartridge inserted.0123456789-=\[];'`,./abcdefghijklmnopqrstuvwxyz)!@#$%^&*(_+|{}:"~<>?ABCDEFGHIJKLMNOPQRSTUVWXYZ     ˩ٿڷ冦椢ح궸  *+/0123456789-,.p@{( !1͟ > .z/{/ROMBAS>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:!I:͟ BASIC statements are not implemented yet͎!"}͟ unknown@7D179}!?!?!~͟ unknown@7E14cbios-0.28/roms/cbios_disk.rom0000644000000000000000000004000013137376076015057 0ustar rootrootAB0@@)BRByBúBB C7/CVC}C!@́DۨO:/! !Aw#w#w#w!!6#}CwgD}CC!1͠@C!͠@/C!͠@@!͠@>!12}"~>2`6#w#s#r#6C-DISK is initializing!@́D!@!>7C-DISK booting͠A8> 7ښAA|@88")E)))|2`xG!` >2`:C}C&$2<2d&$:B&@$)E)))|2xG! >2&@$ɯ7>#.!A͍D!A8!A͍D!A͍DkbͲD!B͍DxͥD!B͍DͲD!B͍DyͥD>.disk: READWRITE sectors: first $, num $, to $, media $!6B́Ddisk: DSKCHG ($4013) called!]B́Ddisk: GETDPB ($4016) called!}B 1 - Single sided, 80 tracks 2 - Double sided, 80 tracks !B́D7disk: DSKFMT ($401C) called!B́Ddisk: LOC_DS ($401F) called!ĆDdisk: BASIC ($4022) called!:ĆDdisk: FORMAT ($4026) called!aĆDdisk: DSKSTP ($4029) called>@y10!Co>g~#fo>oCC>DCCCCCCSDCCC`DCCCCCCCCCCCdDjDCCCCCCCCCCCCCCCCCCCoDpDC>#.!D͍DyͥD>.disk: BDOS ($F37D/$0005) called, function $!*{$_>DgDɯoS=}D*=̀C8<>#.͍D>.~#/ 00/7/͕D͕D|ͥD}ͥDcbios-0.28/roms/cbios_main_msx2_br.rom0000644000000000000000000010000013137376076016502 0ustar rootroot Ò#ä$G$Æ$!Ú".QW_qÅä5ÔÝæïø?r!4YÍ÷ )/ASCö fyËÝð-PbsÂÒãõ  2 C S e w É Ú [!$'6:>gy}Ó$,;2GQÍÓO #(##N#fi:G.:@G.˹xәyә!y80!x w_ۘqӘә>ә}ә|?әә>ә}ә|?@ә:0qQ xAO Ә :0_G xA<= :0qQ xA<= !:(:=:o:G.:!* qӘ x :G.:_:8*(%%:2*&2:8*(Q:W {Ә>ӘyӘ 0 zӘ!!!!:)0(:G.:G .ͣ ͣ:G.:G .">ͣ ͣ:G.:G .ͣͣͣͣͣ:G.:G .ͣ>ͣ>ͣͣͣ:G.:G .ͣͣͣͣͣ! F~#fo)GG.   &o)))0))[&ɇ*(_:>> 8 :(+0 * "!"!.[K:2**K @:O t :/Ot* "::(:,/2, :,/2, WXK O:GQ( /z(WWAә}әGۘQӘә>әۙә>әۙ......>22Z>!ͅ>!  ͅ.!.;..![$: !9KZvv:(8*"> ͅ>!w*$oͅ:*Å:G*$Å:G!):G!:G!:!%,(!*!$:g.&>->.%} |әyә>͛8K o&))) @:##![ͫ RIGHTC!mͫ LEFTC!~ͫ UPC!ͫ TUPC!ͫ DOWNC!ͫ TDOWNCK[SCALXYCS*))))).>2,y( G>2,yO "*MAPXY:,**FETCHC! ͫ STOREC!+ ͫ SETATR!= ͫ READC!N ͫ SETC!^ ͫ NSETCX!p ͫ GTASPC! ͫ PNTINI! ͫ SCANR! ͫ SCANL>#.ͷ >.~#/ 00/7/Ϳ Ϳ | } >ӫ>PӪ<<w /w %$|(ټ8( .gxGyOyO0xG0}(%LxӨy2!S͗ͯO!:# #!*G$>22͝!i%3>ә>әә@ә>vӘә!әۘv(֯ә>әx/Ϳ#>2>2>2>2͝!A!i%3^=>22)!&3C-BIOS Logo ROM!?6!!@̲ͥ!̲ͥ(g(#< G##x##W_x͕!ABx!%3G0Yxx(>.Yx0Y> Y> Y##4(OۙG$4(4(4(G _x0_|!_qx͕zx!@~(!%3#>!w} >!w>!wM>!w>!w'>!w>2>2!"""H!"J"t!N%!"!"!"! "!"!"!8"!"! "!"!"!8"!"!"!"!8"!Y"!u"]!"c!u"i>2\2b2h>'2> 2:2>2>2>2>2>2:2*" >!Y"2!ۨW?OӨ:/_2G:/ {P2G:/ {{/2zӨp#y@O0!y  # 2 O2!&C #&Dy7ȷy#v:0 ~Y#~!# :(:)PP:D!ͫ INIFNK!ͫ STRTMS*[> *[ v~#} !"ͤ:0͸:2a(:b 8*ʪbW*:$8"&w* !<> ͗: *:,0 5-"!"*:!0">2>2:!0<:!<2:= :=2:2:=2:!<2G< 2!`4(5(.y2(y2"22> > >>2:!<2:=2!:_w: bÅ*E:2G:b=2bs"&:W=O!bk+*E:G:b<2bs"&:=OT]#:O)8 (͐:(O͐ͤ! :> ͗7:::bW::bQ2_! **ͤ: !!~/w#!b>W 7    * 7LUj*E*KJlLM5YALBUCDHxyͶ8ͷ( > ͪ27ӑ>Ӑ/Ӑͻې>0/!w  w@8 `0@P7:>2? !3*"&}w4ʘ 0!22:?͸*"> 2bQ (*: &~(:bW*"> :27ɯ۪Ӫ۩۪Ӫ۩7!ͫ ISCNTC!ͫ BEEP"!)ͫ FNKSB!:ͫ ERAFNK!Lͫ DSPFNK::ͽʔÝ!rͫ 7TAPION!ͫ 7TAPIN!ͫ TAPIOF!ͫ 7TAPOON!ͫ 7TAPOUT!ͫ TAPOOFG۪( ( ˧(Ӫ><<<>Ӡ{ӡӠۢɷ>(<ӫۨӨۙO۪Ӫ۩ͧͬ:d >'/!_~=(>濳_>>/!O ~>0 >'<=G(L>濳_>x( >Ѡ(>ɯ!ͫ GTPAD!ͫ GTPDLNF#~##o&N~2Ͷ/2*[ :=2 ! q#>2E۪O !yӪ۩w# !:!&8!& ݾh/ݦw8## y !'>2y((x >! > 5>x > $>!_( ~(V*w#} !["W:G$&L!4ͫ %LCALBAS["Sۙ!' Ә x !~Ә# x >ә>@ә!%~Ә#~ Ә  $_E $GۨẀ{z-%Wէ$|oG> $_Ez $GۨWYͅz-%W$zG(= !z$ۨÌz-%oG>U$W|gG>$_/OzG}$G>U$GzgۨoӨ:/O2}Ө!zo|gywۨӨW_oۨO?Ө{o|&))@0|/g:/_2oyӨzO}! wzGۨO?Ө{2yӨzO! sӨ^ӨszӨӨ͘ӨC-BIOS 0.28 cbios.sf.net Localization: BR Init ROM in slot: Cannot execute a BASIC ROM. ERROR:MEMORY NOT FOUND.CALLED NON EXISTING BASIC.STACK ERROR. No cartridge found. This version of C-BIOS can only start cartridges. Please restart your MSX (emulator) with a cartridge inserted.0123456789-=\[];'`,./abcdefghijklmnopqrstuvwxyz)!@#$%^&*(_+|{}:"~<>?ABCDEFGHIJKLMNOPQRSTUVWXYZ     ˩ٿڷ冦椢ح궸  *+/0123456789-,.p@{( !1ͫ > .z/{/ROMBAS>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:>:!I:ͫ BASIC statements are not implemented yet3!"}ͫ unknown@7D179}!!!~ͫ unknown@7E14cbios-0.28/roms/cbios_music.rom0000644000000000000000000004000013137376076015245 0ustar rootrootABAPRLOPLL%AMAuAÝAAAB!0A#.HB>.~#/ 00/7/PBPB|`B}`Bcbios-0.28/build.bat0000644000000000000000000000070313137376076013044 0ustar rootroot@echo off IF %2.==. GOTO NOOPT echo Assembling %1.asm goto %2 :NOOPT echo Error! build.bat should be called from make.bat, please run make.bat goto no_error :tniasm tniasm ..\tools\tniasm-compat %1.asm ..\derived\bin\cbios_%1.rom ..\derived\lst\cbios_%1.sym 1> NUL if errorlevel 1 goto error GOTO no_error :pasmo pasmo -d %1.asm ..\derived\bin\cbios_%1.rom > ..\derived\lst\cbios_%1.sym if errorlevel 1 goto error goto no_error :error pause :no_error cbios-0.28/version.txt0000644000000000000000000000000413137376076013475 0ustar rootroot0.28cbios-0.28/make.bat0000644000000000000000000000144313137376076012664 0ustar rootroot@echo off mkdir derived\bin 2> NUL mkdir derived\lst 2> NUL IF %1.==. GOTO NOOPT rem -- TODO: get the SVN version of Changelog into version.asm mkdir derived\asm 2> NUL del derived\asm\version.asm 2> NUL echo db "C-BIOS "> derived\asm\version.asm echo incbin "../version.txt">> derived\asm\version.asm echo db " cbios.sf.net">> derived\asm\version.asm cd src IF %1.==pasmo. GOTO ASM IF %1.==tniasm. GOTO ASM :NOOPT echo usage make.bat [pasmo or tniasm] GOTO QUIT :ASM FOR %%i IN (main_msx1;main_msx2;main_msx2+) DO call ..\build %%i %1 FOR %%i IN (basic;sub;music;disk;logo_msx1;logo_msx2;logo_msx2+) DO call ..\build %%i %1 FOR %%i IN (main_msx1_jp;main_msx2_jp;main_msx2+_jp) DO call ..\build %%i %1 FOR %%i IN (main_msx1_br;main_msx2_br;main_msx2+_br) DO call ..\build %%i %1 :END cd .. :QUIT cbios-0.28/configs/0000755000000000000000000000000013141335361012670 5ustar rootrootcbios-0.28/configs/blueMSX/0000755000000000000000000000000013141335361014207 5ustar rootrootcbios-0.28/configs/blueMSX/MSX2 - C-BIOS - JP/0000755000000000000000000000000013141335361016361 5ustar rootrootcbios-0.28/configs/blueMSX/MSX2 - C-BIOS - JP/config.ini0000644000000000000000000000075213137376076020350 0ustar rootroot[Video] version=V9938 vram size=128kB [CMOS] Enable CMOS=1 Battery Backed=1 [Subslotted Slots] slot 0=0 slot 1=0 slot 2=0 slot 3=1 [External Slots] slot A=1 0 slot B=2 0 [FDC] Count=2 [CPU] Z80 Frequency=3579545Hz [Board] type=MSX-S1985 [Slots] 0 0 0 0 84 "" "" 0 0 0 0 32 "" "" 0 0 0 4 20 "Machines/MSX2 - C-BIOS - JP/cbios_main_msx2_jp.rom" "" 0 0 4 2 20 "Machines/MSX2 - C-BIOS - JP/cbios_logo_msx2.rom" "" 3 0 0 2 20 "Machines/MSX2 - C-BIOS - JP/cbios_sub.rom" "" 3 2 0 64 22 "" "" cbios-0.28/configs/blueMSX/MSX2+ - C-BIOS - BR/0000755000000000000000000000000013141335361016426 5ustar rootrootcbios-0.28/configs/blueMSX/MSX2+ - C-BIOS - BR/config.ini0000644000000000000000000000105513137376076020412 0ustar rootroot[Video] version=V9958 vram size=128kB [CMOS] Enable CMOS=1 Battery Backed=1 [Subslotted Slots] slot 0=0 slot 1=0 slot 2=0 slot 3=1 [External Slots] slot A=1 0 slot B=2 0 [FDC] Count=2 [CPU] Z80 Frequency=3579545Hz [Board] type=MSX-T9769B [Slots] 0 0 0 0 34 "" "" 0 0 0 0 84 "" "" 0 0 0 4 20 "Machines\MSX2+ - C-BIOS - BR\cbios_main_msx2+_br.rom" "" 0 0 4 2 20 "Machines\MSX2+ - C-BIOS - BR\cbios_logo_msx2+.rom" "" 3 0 0 2 20 "Machines\MSX2+ - C-BIOS - BR\cbios_sub.rom" "" 3 1 2 2 78 "Machines\MSX2+ - C-BIOS - BR\cbios_music.rom" "" 3 2 0 64 22 "" "" cbios-0.28/configs/blueMSX/MSX2 - C-BIOS - BR/0000755000000000000000000000000013141335361016353 5ustar rootrootcbios-0.28/configs/blueMSX/MSX2 - C-BIOS - BR/config.ini0000644000000000000000000000075213137376076020342 0ustar rootroot[Video] version=V9938 vram size=128kB [CMOS] Enable CMOS=1 Battery Backed=1 [Subslotted Slots] slot 0=0 slot 1=0 slot 2=0 slot 3=1 [External Slots] slot A=1 0 slot B=2 0 [FDC] Count=2 [CPU] Z80 Frequency=3579545Hz [Board] type=MSX-S1985 [Slots] 0 0 0 0 84 "" "" 0 0 0 0 32 "" "" 0 0 0 4 20 "Machines/MSX2 - C-BIOS - BR/cbios_main_msx2_br.rom" "" 0 0 4 2 20 "Machines/MSX2 - C-BIOS - BR/cbios_logo_msx2.rom" "" 3 0 0 2 20 "Machines/MSX2 - C-BIOS - BR/cbios_sub.rom" "" 3 2 0 64 22 "" "" cbios-0.28/configs/blueMSX/MSX - C-BIOS - JP/0000755000000000000000000000000013141335361016277 5ustar rootrootcbios-0.28/configs/blueMSX/MSX - C-BIOS - JP/config.ini0000644000000000000000000000063013137376076020261 0ustar rootroot[Video] version=TMS99x8A vram size=16kB [CMOS] Enable CMOS=0 Battery Backed=0 [Subslotted Slots] slot 0=0 slot 1=0 slot 2=0 slot 3=0 [External Slots] slot A=1 0 slot B=2 0 [FDC] Count=2 [CPU] Z80 Frequency=3579545Hz [Board] type=MSX [Slots] 0 0 0 0 84 "" "" 0 0 0 4 20 "Machines\MSX - C-BIOS - JP\cbios_main_msx1_jp.rom" "" 0 0 4 2 20 "Machines\MSX - C-BIOS - JP\cbios_logo_msx1.rom" "" 3 0 0 8 23 "" "" cbios-0.28/configs/blueMSX/MSX2+ - C-BIOS - JP/0000755000000000000000000000000013141335361016434 5ustar rootrootcbios-0.28/configs/blueMSX/MSX2+ - C-BIOS - JP/config.ini0000644000000000000000000000105513137376076020420 0ustar rootroot[Video] version=V9958 vram size=128kB [CMOS] Enable CMOS=1 Battery Backed=1 [Subslotted Slots] slot 0=0 slot 1=0 slot 2=0 slot 3=1 [External Slots] slot A=1 0 slot B=2 0 [FDC] Count=2 [CPU] Z80 Frequency=3579545Hz [Board] type=MSX-T9769B [Slots] 0 0 0 0 34 "" "" 0 0 0 0 84 "" "" 0 0 0 4 20 "Machines\MSX2+ - C-BIOS - JP\cbios_main_msx2+_jp.rom" "" 0 0 4 2 20 "Machines\MSX2+ - C-BIOS - JP\cbios_logo_msx2+.rom" "" 3 0 0 2 20 "Machines\MSX2+ - C-BIOS - JP\cbios_sub.rom" "" 3 1 2 2 78 "Machines\MSX2+ - C-BIOS - JP\cbios_music.rom" "" 3 2 0 64 22 "" "" cbios-0.28/configs/blueMSX/README.txt0000644000000000000000000000266013137376076015726 0ustar rootrootC-BIOS machine configurations for blueMSX ========================================= Installation instructions: 1. Copy "MSX - C-BIOS", "MSX2 - C-BIOS", "MSX2+ - C-BIOS", "MSX - C-BIOS - JP", "MSX2 - C-BIOS - JP" and "MSX2+ - C-BIOS - JP", "MSX - C-BIOS - BR", "MSX2 - C-BIOS - BR" and "MSX2+ - C-BIOS - BR", subdirectories to "Machines" in the blueMSX installation directory. 2. Copy "cbios_main_msx1.rom" and "cbios_logo_msx1.rom" into the "MSX - C-BIOS" directory. 3. Copy "cbios_main_msx1_jp.rom" and "cbios_logo_msx1.rom" into the "MSX - C-BIOS - JP" directory. 4. Copy "cbios_main_msx1_br.rom" and "cbios_logo_msx1.rom" into the "MSX - C-BIOS - BR" directory. 5. Copy "cbios_main_msx2.rom", "cbios_logo_msx2.rom" and "cbios_sub.rom" into the "MSX2 - C-BIOS" directory. 6. Copy "cbios_main_msx2_jp.rom", "cbios_logo_msx2.rom" and "cbios_sub.rom" into the "MSX2 - C-BIOS - JP" directory. 7. Copy "cbios_main_msx2_br.rom", "cbios_logo_msx2.rom" and "cbios_sub.rom" into the "MSX2 - C-BIOS - BR" directory. 8. Copy "cbios_main_msx2+.rom", "cbios_logo_msx2+.rom", "cbios_sub.rom" and "cbios_music.rom" into the "MSX2+ - C-BIOS" directory. 9. Copy "cbios_main_msx2+_jp.rom", "cbios_logo_msx2+.rom", "cbios_sub.rom" and "cbios_music.rom" into the "MSX2+ - C-BIOS - JP" directory. 10. Copy "cbios_main_msx2+_br.rom", "cbios_logo_msx2+.rom", "cbios_sub.rom" and "cbios_music.rom" into the "MSX2+ - C-BIOS - BR" directory. cbios-0.28/configs/blueMSX/MSX2 - C-BIOS/0000755000000000000000000000000013141335361015752 5ustar rootrootcbios-0.28/configs/blueMSX/MSX2 - C-BIOS/config.ini0000644000000000000000000000073013137376076017735 0ustar rootroot[Video] version=V9938 vram size=128kB [CMOS] Enable CMOS=1 Battery Backed=1 [Subslotted Slots] slot 0=0 slot 1=0 slot 2=0 slot 3=1 [External Slots] slot A=1 0 slot B=2 0 [FDC] Count=2 [CPU] Z80 Frequency=3579545Hz [Board] type=MSX-S1985 [Slots] 0 0 0 0 84 "" "" 0 0 0 0 32 "" "" 0 0 0 4 20 "Machines/MSX2 - C-BIOS/cbios_main_msx2.rom" "" 0 0 4 2 20 "Machines/MSX2 - C-BIOS/cbios_logo_msx2.rom" "" 3 0 0 2 20 "Machines/MSX2 - C-BIOS/cbios_sub.rom" "" 3 2 0 64 22 "" "" cbios-0.28/configs/blueMSX/MSX - C-BIOS - BR/0000755000000000000000000000000013141335361016271 5ustar rootrootcbios-0.28/configs/blueMSX/MSX - C-BIOS - BR/config.ini0000644000000000000000000000063013137376076020253 0ustar rootroot[Video] version=TMS99x8A vram size=16kB [CMOS] Enable CMOS=0 Battery Backed=0 [Subslotted Slots] slot 0=0 slot 1=0 slot 2=0 slot 3=0 [External Slots] slot A=1 0 slot B=2 0 [FDC] Count=2 [CPU] Z80 Frequency=3579545Hz [Board] type=MSX [Slots] 0 0 0 0 84 "" "" 0 0 0 4 20 "Machines\MSX - C-BIOS - BR\cbios_main_msx1_br.rom" "" 0 0 4 2 20 "Machines\MSX - C-BIOS - BR\cbios_logo_msx1.rom" "" 3 0 0 8 23 "" "" cbios-0.28/configs/blueMSX/MSX - C-BIOS/0000755000000000000000000000000013141335361015670 5ustar rootrootcbios-0.28/configs/blueMSX/MSX - C-BIOS/config.ini0000644000000000000000000000061313137376076017653 0ustar rootroot[Video] version=TMS99x8A vram size=16kB [CMOS] Enable CMOS=0 Battery Backed=0 [Subslotted Slots] slot 0=0 slot 1=0 slot 2=0 slot 3=0 [External Slots] slot A=1 0 slot B=2 0 [FDC] Count=2 [CPU] Z80 Frequency=3579545Hz [Board] type=MSX [Slots] 0 0 0 0 84 "" "" 0 0 0 4 20 "Machines\MSX - C-BIOS\cbios_main_msx1.rom" "" 0 0 4 2 20 "Machines\MSX - C-BIOS\cbios_logo_msx1.rom" "" 3 0 0 8 23 "" "" cbios-0.28/configs/blueMSX/MSX2+ - C-BIOS/0000755000000000000000000000000013141335361016025 5ustar rootrootcbios-0.28/configs/blueMSX/MSX2+ - C-BIOS/config.ini0000644000000000000000000000102613137376076020007 0ustar rootroot[Video] version=V9958 vram size=128kB [CMOS] Enable CMOS=1 Battery Backed=1 [Subslotted Slots] slot 0=0 slot 1=0 slot 2=0 slot 3=1 [External Slots] slot A=1 0 slot B=2 0 [FDC] Count=2 [CPU] Z80 Frequency=3579545Hz [Board] type=MSX-T9769B [Slots] 0 0 0 0 34 "" "" 0 0 0 0 84 "" "" 0 0 0 4 20 "Machines\MSX2+ - C-BIOS\cbios_main_msx2+.rom" "" 0 0 4 2 20 "Machines\MSX2+ - C-BIOS\cbios_logo_msx2+.rom" "" 3 0 0 2 20 "Machines\MSX2+ - C-BIOS\cbios_sub.rom" "" 3 1 2 2 78 "Machines\MSX2+ - C-BIOS\cbios_music.rom" "" 3 2 0 64 22 "" "" cbios-0.28/configs/NLMSX/0000755000000000000000000000000013141335361013571 5ustar rootrootcbios-0.28/configs/NLMSX/Config/0000755000000000000000000000000013141335361014776 5ustar rootrootcbios-0.28/configs/NLMSX/Config/_Default/0000755000000000000000000000000013141335361016521 5ustar rootrootcbios-0.28/configs/NLMSX/Config/_Default/C-BIOS MSX2+/0000755000000000000000000000000013141335361020222 5ustar rootrootcbios-0.28/configs/NLMSX/Config/_Default/C-BIOS MSX2+/config.ini0000644000000000000000000000052713137376076022211 0ustar rootroot[Keyboard] File=Keyboard_english.ini [CPU] Frequency=3579545 [Video] Type=2 [R800] Frequency=28636360 [Slots] 0 0 ff 1 "ROMS\cbios_main_msx2+.rom" 0 8000 0 0 0 ff 1 "roms\cbios_logo_msx2+.rom" 0 4000 8000 1 1 ff 0 1 2 ff 0 0 3 0 1 "ROMS\cbios_sub.rom" 0 4000 0 0 3 0 1 "ROMS\cbios_music.rom" 0 4000 4000 0 3 2 3 3 cbios-0.28/configs/NLMSX/Config/_Default/C-BIOS MSX/0000755000000000000000000000000013141335361020065 5ustar rootrootcbios-0.28/configs/NLMSX/Config/_Default/C-BIOS MSX/config.ini0000644000000000000000000000040213137376076022044 0ustar rootroot[Keyboard] File=Keyboard_english.ini [CPU] Frequency=3579545 [Video] Type=0 [R800] Frequency=28636360 [Slots] 0 0 ff 1 "ROMS\cbios_main_msx1.rom" 0 8000 0 0 0 ff 1 "roms\cbios_logo_msx1.rom" 0 4000 8000 1 1 ff 0 1 2 ff 0 0 3 ff 2 0 10000 cbios-0.28/configs/NLMSX/Config/_Default/C-BIOS MSX2/0000755000000000000000000000000013141335361020147 5ustar rootrootcbios-0.28/configs/NLMSX/Config/_Default/C-BIOS MSX2/config.ini0000644000000000000000000000044613137376076022136 0ustar rootroot[Keyboard] File=Keyboard_english.ini [CPU] Frequency=3579545 [Video] Type=2 [R800] Frequency=28636360 [Slots] 0 0 ff 1 "ROMS\cbios_main_msx2.rom" 0 8000 0 0 0 ff 1 "roms\cbios_logo_msx2.rom" 0 4000 8000 1 1 ff 0 1 2 ff 0 0 3 0 1 "ROMS\cbios_sub.rom" 0 4000 0 0 3 2 3 3 cbios-0.28/configs/NLMSX/README.txt0000644000000000000000000000053113137376076015303 0ustar rootrootC-BIOS machine configurations for NLMSX ========================================= Installation instructions: 1. Copy "C-BIOS - MSX", "C-BIOS - MSX2" and "C-BIOS - MSX2" subdirectories to "Config\_Default" in the NLMSX installation directory. 2. Copy "cbios_main_msx*.rom", "cbios_sub.rom" and "cbios_music.rom" into the "ROMS" directory. cbios-0.28/configs/openMSX/0000755000000000000000000000000013141335361014221 5ustar rootrootcbios-0.28/configs/openMSX/C-BIOS_MSX2+_JP.xml0000644000000000000000000000610613137376076017154 0ustar rootroot C-BIOS MSX2+ JP 2010 An MSX2+ machine using C-BIOS, with MSX-MUSIC, a Japanese keyboard layout and 60Hz interrupt frequency. MSX2+ largest 9489d48e9618e480aa6082ebfce9b6dc2f543bca cbios_main_msx2+_jp.rom 2fcb40413e7d373f0f2dbdc815ce18746ddf3684 cbios_sub.rom 5c5eb001e6a1fe29edb7abd428a3967bb388e5db cbios_music.rom 9000 512 16000 false jp_ansi true true false V9958 128 YM2149 50on 21000 cbios-msx2+_jp.cmos true cbios-0.28/configs/openMSX/C-BIOS_MSX2_BR.xml0000644000000000000000000000471213137376076017074 0ustar rootroot C-BIOS MSX2 BR 2010 An MSX2 machine using C-BIOS, with Brazillian settings, like 60Hz interrupt frequency. MSX2 largest 5ac97614abd0044c9cbf0a8bf7101959f5865b4d cbios_main_msx2_br.rom 2fcb40413e7d373f0f2dbdc815ce18746ddf3684 cbios_sub.rom 512 16000 false int true false false V9938 128 YM2149 21000 cbios-msx2_br.cmos cbios-0.28/configs/openMSX/C-BIOS_MSX2_JP.xml0000644000000000000000000000500113137376076017072 0ustar rootroot C-BIOS MSX2 JP 2010 An MSX2 machine using C-BIOS, with a Japanese keyboard layout and 60Hz interrupt frequency. MSX2 largest e8ab07d341539c40bd97666fad63e7bda8961eff cbios_main_msx2_jp.rom 2fcb40413e7d373f0f2dbdc815ce18746ddf3684 cbios_sub.rom 512 16000 false jp_ansi true true false V9938 128 YM2149 50on 21000 cbios-msx2_jp.cmos cbios-0.28/configs/openMSX/C-BIOS_MSX1.xml0000644000000000000000000000356013137376076016510 0ustar rootroot C-BIOS MSX1 2003 An MSX1 machine using C-BIOS, with an international keyboard layout and 50Hz interrupt frequency. MSX 61be882d690ac0ba9d6067fcf33f6f40287bf52e cbios_main_msx1.rom 16000 false int false false false TMS9929A 16 YM2149 21000 cbios-0.28/configs/openMSX/C-BIOS_MSX2+_BR.xml0000644000000000000000000000603013137376076017142 0ustar rootroot C-BIOS MSX2+ BR 2010 An MSX2+ machine using C-BIOS, with MSX-MUSIC, and Brazillian style settings like 60Hz interrupt frequency. MSX2+ largest 6f7bb07d04c22beacc04f55405af72272d85e905 cbios_main_msx2+_br.rom 2fcb40413e7d373f0f2dbdc815ce18746ddf3684 cbios_sub.rom 5c5eb001e6a1fe29edb7abd428a3967bb388e5db cbios_music.rom 9000 512 16000 false int true false false V9958 128 YM2149 21000 cbios-msx2+_br.cmos true cbios-0.28/configs/openMSX/README.txt0000644000000000000000000000055713137376076015743 0ustar rootrootC-BIOS machine configurations for openMSX ========================================= Note: these configurations will only work in openMSX 0.9.2 or later. Installation instructions: 1. Copy "C-BIOS_*" files to "share/machines" in the openMSX installation directory or the openMSX user directory. 2. Copy "cbios_*.rom" to the openMSX ROM pool ("share/systemroms"). cbios-0.28/configs/openMSX/C-BIOS_MSX2+.xml0000644000000000000000000000602113137376076016557 0ustar rootroot C-BIOS MSX2+ 2005 An MSX2+ machine using C-BIOS, with MSX-MUSIC, an international keyboard layout and 50Hz interrupt frequency. MSX2+ largest 12ebcebc65de0e8927c75d7b9b38e53ade65ce7c cbios_main_msx2+.rom 2fcb40413e7d373f0f2dbdc815ce18746ddf3684 cbios_sub.rom 5c5eb001e6a1fe29edb7abd428a3967bb388e5db cbios_music.rom 9000 512 16000 false int true false false V9958 128 YM2149 21000 cbios-msx2+.cmos true cbios-0.28/configs/openMSX/C-BIOS_MSX2.xml0000644000000000000000000000471413137376076016513 0ustar rootroot C-BIOS MSX2 2003 An MSX2 machine using C-BIOS, with an international keyboard layout and 50Hz interrupt frequency. MSX2 largest 8339f5f2be69a166af128ceb0c9c7799f25a6f35 cbios_main_msx2.rom 2fcb40413e7d373f0f2dbdc815ce18746ddf3684 cbios_sub.rom 512 16000 false int true false false V9938 128 YM2149 21000 cbios-msx2.cmos cbios-0.28/configs/openMSX/C-BIOS_MSX1_JP.xml0000644000000000000000000000364313137376076017103 0ustar rootroot C-BIOS MSX1 JP 2010 An MSX1 machine using C-BIOS, with an Japanese keyboard layout and 60Hz interrupt frequency. MSX 6a2868faf6c3de590fa86a911dbc6e051680cf3a cbios_main_msx1_jp.rom 16000 false jp_ansi false true false TMS99X8A 16 50on YM2149 21000 cbios-0.28/configs/openMSX/C-BIOS_MSX1_BR.xml0000644000000000000000000000355513137376076017077 0ustar rootroot C-BIOS MSX1 BR 2010 An MSX1 machine using C-BIOS, with Brazillian settings, like 60Hz interrupt frequency. MSX 2d2df4a7cba89805c80315125d3ac0c0bd7488a4 cbios_main_msx1_br.rom 16000 false int true false false TMS99X8A 16 YM2149 21000 cbios-0.28/configs/RuMSX/0000755000000000000000000000000013141335361013646 5ustar rootrootcbios-0.28/configs/RuMSX/CONFIG/0000755000000000000000000000000013141335361014613 5ustar rootrootcbios-0.28/configs/RuMSX/CONFIG/CBIOS-MSX.CFG0000644000000000000000000000037513137376076016462 0ustar rootroot [Layout] Target=0 SlotExpander=0000 Locale=1 [Settings] VideoVersion=0 VideoMemory=1 VdpFrequency=0 ScanLinesZ80=3 ScanLinesR800=0 CmosRom=0 KanjiRom=0 KanjiFile= VideoComputer=0 AdvancedVideo=0 [Slots] 0002=163,cbios_main_msx1.rom 1000=-1 3004=160 cbios-0.28/configs/RuMSX/CONFIG/CBIOS-MSX2.CFG0000644000000000000000000000044013137376076016535 0ustar rootroot [Layout] Target=1 SlotExpander=0001 Locale=1 [Settings] VideoVersion=1 VideoMemory=8 VdpFrequency=0 ScanLinesZ80=3 ScanLinesR800=0 CmosRom=1 KanjiRom=0 KanjiFile= VideoComputer=0 AdvancedVideo=0 [Slots] 0002=163,cbios_main_msx2.rom 1000=-1 2000=-1 3001=128,cbios_sub.rom 3200=161,512 cbios-0.28/configs/RuMSX/CONFIG/CBIOS-MSX2+.CFG0000644000000000000000000000050213137376076016607 0ustar rootroot [Layout] Target=1 SlotExpander=0001 Locale=1 [Settings] VideoVersion=2 VideoMemory=8 VdpFrequency=0 ScanLinesZ80=3 ScanLinesR800=0 CmosRom=1 KanjiRom=0 KanjiFile= VideoComputer=0 AdvancedVideo=0 [Slots] 0000=0, 0002=163,cbios_main_msx2+.rom 1000=-1 2000=-1 3001=128,cbios_sub.rom 3111=128,cbios_music.rom 3200=161,512 cbios-0.28/configs/RuMSX/README.txt0000644000000000000000000000042613137376076015363 0ustar rootrootC-BIOS machine configurations for RuMSX ========================================= Installation instructions: 1. Copy "CONFIG" subdirectory in the RuMSX installation directory. 2. Copy "cbios_main_msx*.rom", "cbios_sub.rom" and "cbios_music.rom" into the "SYSTEM" directory. cbios-0.28/src/0000755000000000000000000000000013141335361012027 5ustar rootrootcbios-0.28/src/logo_msx2+.asm0000644000000000000000000000312013137376076014526 0ustar rootroot; C-BIOS main ROM for MSX2+ machines ; ; Copyright (c) 2005 Maarten ter Huurne. All rights reserved. ; Copyright (c) 2005 Albert Beevendorp. All rights reserved. ; ; Redistribution and use in source and binary forms, with or without ; modification, are permitted provided that the following conditions ; are met: ; 1. Redistributions of source code must retain the above copyright ; notice, this list of conditions and the following disclaimer. ; 2. Redistributions in binary form must reproduce the above copyright ; notice, this list of conditions and the following disclaimer in the ; documentation and/or other materials provided with the distribution. ; ; THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ; OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ; IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ; NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ; include "hardware.asm" VDP: equ V9958 MODEL_MSX: equ MODEL_MSX2P org $8000 include "logo.asm" ; vim:ts=8:expandtab:filetype=z8a:syntax=z8a: cbios-0.28/src/util.asm0000644000000000000000000000466513137376076013536 0ustar rootroot; C-BIOS utility routines ; ; Copyright (c) 2004 Maarten ter Huurne. All rights reserved. ; ; Redistribution and use in source and binary forms, with or without ; modification, are permitted provided that the following conditions ; are met: ; 1. Redistributions of source code must retain the above copyright ; notice, this list of conditions and the following disclaimer. ; 2. Redistributions in binary form must reproduce the above copyright ; notice, this list of conditions and the following disclaimer in the ; documentation and/or other materials provided with the distribution. ; ; THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ; OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ; IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ; NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ; ;---------------------------------- ; Generic routine that implements a jump table. ; Input: HL = address of jump table ; A = index in table ; Changes: F, HL, BC (these are changed *before* jumping) jump_table: ld c,a ld b,0 add hl,bc add hl,bc jp table_jump ;---------------------------------- ; Generic routine that implements a search & jump table ; Entries in the table consist of (character, jump address) pairs. ; If the entry is not found, the routine will just RETurn. ; ; Input: HL = address of search table ; A = item to search for ; B = number of entries in the table ; Changes: F, BC, HL search_table: cp (hl) inc hl jr z,table_jump inc hl inc hl djnz search_table ret table_jump: ld c,(hl) inc hl ld h,(hl) ld l,c jp (hl) ; vim:ts=8:expandtab:filetype=z8a:syntax=z8a: cbios-0.28/src/scancodes_jp.asm0000644000000000000000000001100213137376076015173 0ustar rootroot; Scan code tables JIS (japanese) keybaord for C-BIOS ; ; Copyright (c) 2008 Eric Boon. All rights reserved. ; ; Redistribution and use in source and binary forms, with or without ; modification, are permitted provided that the following conditions ; are met: ; 1. Redistributions of source code must retain the above copyright ; notice, this list of conditions and the following disclaimer. ; 2. Redistributions in binary form must reproduce the above copyright ; notice, this list of conditions and the following disclaimer in the ; documentation and/or other materials provided with the distribution. ; ; THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ; OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ; IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ; NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ; ; ------------------------------------- ; scan code tableS scode_tbl: ; Japanese db "01234567" ;00 db "89-^",$5C,"@[;" ;01 ($5C = yen) db ":],./_ab" ;02 db "cdefghij" ;03 db "klmnopqr" ;04 db "stuvwxyz" ;05 scode_tbl_shift: db "0!",$22,"#$%&'" ;00 ($22 = quote) db "()=~|`{+" ;01 db "*}<>?_AB" ;02 db "CDEFGHIJ" ;03 db "KLMNOPQR" ;04 db "STUVWXYZ" ;05 scode_tbl_graph: db $0F,$07,$01,$02,$03,$04,$05,$06 ;00 db $0D,$E0,$17,$00,$09,$00,$84,$82 ;01 db $81,$85,$1F,$1D,$80,$83,$00,$1B ;02 db $1A,$14,$18,$15,$13,$0A,$16,$00 ;03 db $00,$1E,$0B,$00,$00,$10,$00,$12 ;04 db $0C,$19,$00,$11,$00,$1C,$08,$00 ;05 ; TODO SHIFT + GRAPH is undefined in the red book. Same keycodes ; as with shift or no key entered? (all $00) scode_tbl_shift_graph: db $0F,$07,$01,$02,$03,$04,$05,$06 ;00 db $0D,$E0,$17,$00,$09,$00,$84,$82 ;01 db $81,$85,$1F,$1D,$80,$83,$00,$1B ;02 db $1A,$14,$18,$15,$13,$0A,$16,$00 ;03 db $00,$1E,$0B,$00,$00,$10,$00,$12 ;04 db $0C,$19,$00,$11,$00,$1C,$08,$00 ;05 scode_tbl_kana: db $FC,$E7,$EC,$91,$93,$94,$95,$F4 ;00 db $F5,$F6,$EE,$ED,$B0,$DE,$DF,$FA ;01 db $99,$F1,$E8,$F9,$F2,$FB,$E1,$9A ;02 db $9F,$9C,$92,$EA,$97,$98,$E6,$EF ;03 db $E9,$F8,$F3,$F0,$F7,$9E,$E0,$9D ;04 db $E4,$96,$E5,$EB,$E3,$9B,$FD,$E2 ;05 scode_tbl_caps_kana: db $DC,$C7,$CC,$B1,$B3,$B4,$B5,$D4 ;00 db $D5,$D6,$CE,$CD,$B0,$DE,$DF,$DA ;01 db $B9,$D1,$C8,$D9,$D2,$DB,$C1,$BA ;02 db $BF,$BC,$B2,$CA,$B7,$B8,$C6,$CF ;03 db $C9,$D8,$D3,$D0,$D7,$BE,$C0,$BD ;04 db $C4,$B6,$C5,$CB,$C3,$BB,$DD,$C2 ;05 scode_tbl_shift_kana: db $86,$00,$00,$87,$89,$8A,$8B,$8C ;00 db $8D,$8E,$00,$00,$00,$00,$A2,$00 ;01 db $00,$83,$84,$81,$85,$00,$00,$00 ;02 db $00,$00,$88,$00,$00,$00,$00,$00 ;03 db $00,$00,$00,$00,$00,$00,$00,$00 ;04 db $00,$00,$00,$00,$00,$00,$00,$8F ;05 scode_tbl_shift_caps_kana: db $A6,$00,$00,$A7,$A9,$AA,$AB,$AC ;00 db $AD,$AE,$00,$00,$00,$00,$A2,$00 ;01 db $00,$A3,$A4,$A1,$A5,$00,$00,$00 ;02 db $00,$00,$A8,$00,$00,$00,$00,$00 ;03 db $00,$00,$00,$00,$00,$00,$00,$00 ;04 db $00,$00,$00,$00,$00,$00,$00,$AF ;05 ; vim:ts=8:expandtab:filetype=z8a:syntax=z8a:cbios-0.28/src/systemvars.asm0000644000000000000000000011642313137376076014775 0ustar rootroot; ; C-BIOS system variable declarations ; ; Copyright (c) 2002-2003 BouKiCHi. All rights reserved. ; Copyright (c) 2003 Reikan. All rights reserved. ; Copyright (c) 2004-2005 Maarten ter Huurne. All rights reserved. ; Copyright (c) 2004 Manuel Bilderbeek. All rights reserved. ; Copyright (c) 2004-2006 Joost Yervante Damad. All rights reserved. ; Copyright (c) 2004-2005 Albert Beevendorp. All rights reserved. ; Copyright (c) 2005 Jussi Pitkänen. All rights reserved. ; ; Redistribution and use in source and binary forms, with or without ; modification, are permitted provided that the following conditions ; are met: ; 1. Redistributions of source code must retain the above copyright ; notice, this list of conditions and the following disclaimer. ; 2. Redistributions in binary form must reproduce the above copyright ; notice, this list of conditions and the following disclaimer in the ; documentation and/or other materials provided with the distribution. ; ; THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ; OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ; IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ; NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ; ;------------------- ; help function area ;------------------- ; Note: Functions defined in "main.asm" are disabled here. ; F380-F384: interslot read ;RDPRIM: equ $F380 ; F385-F38B: interslot read ;WRPRIM: equ $F385 ; F38C-F399: interslot call ;CLPRIM: equ $F38C ; F39A-F3AD: workarea for the DEF USR statement ; this area is initialized with the 10 times the value $475A, which gives ; the error 'Syntax Error' USRTAB: equ $F39A ;---------------------- ; screen parameter area ;---------------------- ; F3AE: # of positions on a line in SCREEN 0 (ini:39) LINL40: equ $F3AE ; F3AF: # of positions on a line in SCREEN 1 (ini:29) LINL32: equ $F3AF ; F3B0: # of actually used positions in the current screenmodus (ini:39) LINLEN: equ $F3B0 ; F3B1: # of used lines on screen (ini:24) CRTCNT: equ $F3B1 ; F3B2: # of positions within a tabulator-column (ini:14) CLMLST: equ $F3B2 ; F3B3-F3B4: BASE(0): name table address for SCREEN 0 (ini:$0000) ; used to initialize NAMBAS when SCREEN 0 is activated TXTNAM: equ $F3B3 ; F3B5-F3B6: BASE(1): color table address for SCREEN 0, unused? (ini:$0000) TXTCOL: equ $F3B5 ; F3B7-F3B8: BASE(2): pattern table address for SCREEN 0 (ini:$0800) ; used to initialize CGPBAS when SCREEN 0 is activated TXTCGP: equ $F3B7 ; F3B9-F3BA: BASE(3): sprite attribute table address for SCREEN 0, unused (ini:$0000) ; used to initialize ATRBAS when SCREEN 0 is activated TXTATR: equ $F3B9 ; F3BB-F3BC: BASE(4): sprite pattern table address for SCREEN 0, unused (ini:$0000) ; used to initialize PATBAS when SCREEN 0 is activated TXTPAT: equ $F3BB ; F3BD-F3BE: BASE(5): nametable address for SCREEN 1 (ini:$1800) ; used to initialize NAMBAS when SCREEN 1 is activated T32NAM: equ $F3BD ; F3BF-F3C0: BASE(6): color table address for SCREEN 1 (ini:$2000) T32COL: equ $F3BF ; F3C1-F3C2: BASE(7): pattern table address for SCREEN 1 (ini:$0000) ; used to initialize CGPBAS when SCREEN 1 is activated T32CGP: equ $F3C1 ; F3C3-F3C4: BASE(8): sprite attribute table address for SCREEN 1 (ini:$1B00) ; used to initialize ATRBAS when SCREEN 1 is activated T32ATR: equ $F3C3 ; F3C5-F3C6: BASE(9): sprite pattern table address for SCREEN 1 (ini:$0800) ; used to initialize PATBAS when SCREEN 1 is activated T32PAT: equ $F3C5 ; F3C7-F3C8: BASE(10): name table address for SCREEN 2 (ini:$1800) ; used to initialize NAMBAS when SCREEN 2 is activated GRPNAM: equ $F3C7 ; F3C9-F3CA: BASE(11): color table address for SCREEN 2 (ini:$2000) GRPCOL: equ $F3C9 ; Screen2 Color ; F3CB-F3CC: BASE(12): pattern table address for SCREEN 2 (ini:$0000) ; used to initialize CGPBAS when SCREEN 2 is activated GRPCGP: equ $F3CB ; F3CD-F3CE: BASE(13): sprite attribute table address for SCREEN 2 (ini:$1B00) ; used to initialize ATRBAS when SCREEN 2 is activated GRPATR: equ $F3CD ; F3CF-F3D0: BASE(14): sprite pattern table address for SCREEN 2 (ini:$3800) ; used to initialize PATBAS when SCREEN 2 is activated GRPPAT: equ $F3CF ; F3D1-F3D2: BASE(15): name table address for SCREEN 3 (ini:$0800) ; used to initialize NAMBAS when SCREEN 3 is activated MLTNAM: equ $F3D1 ; F3D3-F3D4: BASE(16): color table address for SCREEN 3 (ini:$0000) ; the color table is unused in SCREEN 3 MLTCOL: equ $F3D3 ; F3D5-F3D6: BASE(17): pattern table address for SCREEN 3 (ini:$0000) ; used to initialize CGPBAS when SCREEN 3 is activated MLTCGP: equ $F3D5 ; F3D7-F3D8: BASE(18): sprite attribute table address for SCREEN 3 (ini:$1B00) ; used to initialize ATRBAS when SCREEN 3 is activated MLTATR: equ $F3D7 ; F3D9-F3DA: BASE(19): sprite pattern table address for SCREEN 3 (ini:$3800) ; used to initialize PATBAS when SCREEN 3 is activated MLTPAT: equ $F3D9 ; F3DB: keyclick when a key is pressed: 0: no, 1: yes (ini: 1) ; SCREEN ,,n will write to this address CLIKSW: equ $F3DB ; F3DC: line where the cursor is located ; starts to count at 1 for the topmost line CSRY: equ $F3DC ; F3DD: column where the cursor is located ; starts to count at 1 for the leftmost column CSRX: equ $F3DD ; F3DE: function key definition shown: 0: no, -1: yes ; Note: MSX BIOS will mess up end-of-screen if this variable contains ; something other than $00 or $FF. CNSDFG: equ $F3DE ; F3DF-D3E6: storage for the last written value towards VDP registers 0 till 7 ; this is needed because these registers are write only RG0SAV: equ $F3DF RG1SAV: equ $F3E0 RG2SAV: equ $F3E1 RG3SAV: equ $F3E2 RG4SAV: equ $F3E3 RG5SAV: equ $F3E4 RG6SAV: equ $F3E5 RG7SAV: equ $F3E6 ; F3E7: last read value of VDP register 8 STATFL: equ $F3E7 ; F3E8: information about the joystick and space bar ; 7 6 5 4 3 2 1 0 ; | | | | +-- Space bar, trig(0) (0 = pressed) ; | | | +---------- Stick 1, Trigger 1 (0 = pressed) ; | | +------------ Stick 1, Trigger 2 (0 = pressed) ; | +-------------- Stick 2, Trigger 1 (0 = pressed) ; +---------------- Stick 2, Trigger 2 (0 = pressed) TRGFLG: equ $F3E8 ; F3E9: code for the standard foreground color (ini:15) FORCLR: equ $F3E9 ; F3EA: code for the standard background color (ini:4) BAKCLR: equ $F3EA ; F3EB: code for the standard border color (ini:7) BDRCLR: equ $F3EB ; F3EC-F3EE: Jump instruction used by Basic LINE command. ; The routines used are: RIGHTC, LEFTC, UPC and DOWNC MAXUPD: equ $F3EC ; F3EF-F3F1: Jump instruction used by Basic LINE command. ; The routines used are: RIGHTC, LEFTC, UPC and DOWNC MINUPD: equ $F3EF ; F3F2: working color, as used for graphical operations ; normally equals to the foreground color (ini:15) ATRBYT: equ $F3F2 ; F3F3-F3F4: starting value of the address of the queue-table ; the queue-table contains 4 queue's: 3 for sound and one for RS232 ; (ini: QUETAB ($F959)) QUEUES: equ $F3F3 ; F3F5: CLOAD flag =0 when CLOAD =255 when CLOAD? FRCNEW: equ $F3F5 ; F3F6: VDP-interupt counter that counts from 3 to 0, when it reaches zero, the ; keyboard matrix is scanned, and the counters is reset at 3 SCNCNT: equ $F3F6 ; F3F7: key repeat counter. Runs from 13 to 0, and is changed when SCNCNT is changed ; if the key remained the same. If it reaches 0, keyrepetition starts. If another key ; is pressed the value is reset at 13. REPCNT: equ $F3F7 ; F3F8-F3F9: first free space in the inputbuffer of the keyboard ; everytime a key is added to the inputbuffer, this address is incremented, ; when it equals to GETPNT, the buffer is full ; the buffer is located at KEYBUF PUTPNT: equ $F3F8 ; F3FA-F3FB: address in inputbuffer of first character that is not yet read ; everytime a key is read from the buffer it is incremented ; the buffer is located at KEYBUF GETPNT: equ $F3FA ; F3FC-F400: memory area for tape system parameters for 1200 baud ; F3FC: length of low signal for 0 (ini:83) ; F3FD: length of high signal for 0 (ini:92) ; F3FE: length of low signal for 1 (ini:38) ; F3FF: length of high signal for 1 (ini:45) ; F400: length of synchronization block (ini:15) CS120: equ $F3FC ; F401-F405: memory area for tape system parameters for 1200 baud ; F401: length of low signal for 0 (ini:37) ; F402: length of high signal for 0 (ini:45) ; F403: length of low signal for 1 (ini:14) ; F404: length of high signal for 1 (ini:22) ; F405: length of synchronization block (ini:31) CS240: equ $F401 ; F406-F407: lenghts of signal for 0 for the current speed of the tape system ; either equal to the content of F3FC-F3FD or the content of F401-F402 ; (ini: 83, 92) LOW_: equ $F406 ; real name: LOW, but doesn't compile? ; F408-F409: lenghts of signal for 1 for the current speed of the tape system ; either equal to the content of F3FE-F3FF or the content of F403-F404 ; (ini: 38, 45) HIGH_: equ $F408 ; real name: HIGH, but doesn't compile? ; F40A: lenghts of synchronization block for the current speed of the tape system ; either equal to the content of F400 or the content of F405 (ini: 15) HEADER: equ $F40A ; F40B-F40C: standard setting for the height/width aspect of the ; BASIC statement CIRCLE; only the byte in F40B is actually used ; If ASPECT2 is larger then 255, the value of F40B is the number of horizontal ; dots per 256 verical dots of the radius (ini:$0100) ; ! not verified :) ASPCT1: equ $F40B ; F40D-F40E: standard setting for the height/width aspect of the ; BASIC statement CIRCLE; If ASPCT2 is smaller then 512, then ASPCT2 is the ; number of vertical dots per 256 horizontal dots of the radius (ini:$0100) ; ! not verified :) ASPCT2: equ $F40D ; F40F-F413: work area for the BASIC statement RESUME NEXT ; contains a fake end of basic program ; (ini: 58, 0, 0, 0, 0) ENDPRG: equ $F40F ; F414: errornumber of last error that happened while executing a BASIC program ; (ini:0) ERRFLG: equ $F414 ; F415: number of characters in the writebuffer of the printer that still ; need printing LPTPOS: equ $F415 ; F416: switch indicating if output should be screen or printer ; (think LIST vs LLIST) (ini:0) values: 0: screen, 1: printer PRTFLG: equ $F416 ; F417: switch indicating if hooked up printer is an MSX printer or not ; values: 0: MSX-Printer, 1: no MSX-Printer ; if the printer is no MSX-Printer, non-ASCII (>=128) characters are replaced ; by spaces before sending them to the printer (ini: 0) NTMSXP: equ $F417 ; F418: switch indicating of printing routines should use raw-mode or ; should convert: ; =0 to convert tabs and unknown characters to spaces and remove graphical headers ; =1 to send data just like it gets it (ini: 0) ; if RAWPRT is 1, the value if NTMSXP is ignored RAWPRT: equ $F418 ; --------------------------- ; basic interpreter work area ; --------------------------- ; F419-F41A: work area for the BASIC command VAL: contains address of character that ; has temporarely been replaced by O by VAL VLZADR: equ $F419 ; F41B: work area for the BASIC command VAL: contains the character originally at ; the location of VLZADR VLZDAT: equ $F41B ; F41C-F41D: line number of current BASIC line being executed, in direct modus this ; contains $FFFF (ini:$FFFF) CURLIN: equ $F41C ; F41E: error detection prefix for KBUF, always contains ":" ; originally undocumented :) KBFMIN: equ $F41E ; F41F-F55C: workarea for coding basic rules that have been typed in direct modus ; this are contains the code for the line interpreted in direct modus KBUF: equ $F41F ; F55D: byte used as first byte of BUF for input statements, giving them always ; an extra ',' (ini:44 == ',') BUFMIN: equ $F55D ; F55E-F65F: used in direct modus to store the ASCII codes of the line, or simulary ; for INPUT or LINE INPUT BASIC statements BUF: equ $F55E ; F562-F570: used by bitblit routines to store the register data SX: equ $F562 SY: equ $F564 DX: equ $F566 DY: equ $F568 NX: equ $F56A NY: equ $F56C CDUMMY: equ $F56E ARG_: equ $F56F L_OP: equ $F570 ; F660: last usable byte of BUF ENDBUF: equ $F660 ; F661: number of column of last written character on the screen TTYPOS: equ $F661 ; F662: switch indicating during variable lookup for arrays, if this has not already ; been done for a DIM BASIC statement DIMFLG: equ $F662 ; F663: workarea for evaluation of expressions; contains type of last evaluated ; expression; the value of the expression is in DAC, possible values of VALTYP: ; 2: integer ; 3: string ; 4: normal real ; 8: double real VALTYP: equ $F663 ; F664: workarea for coding of BASIC statements. switch indicating if keywords have ; to be encoded or not. E.g. in DATA fields they should not be encoded ; 0: encoding on, 1: encoding off DORES: equ $F664 ; F665: workarea for coding of BASIC statements. swithc indication of numbers have to be ; encoded; values: $0: encode as const, $1: encode as line number, $FF: do not encode DONUM: equ $F665 ; F666-F667: work area for evaluation of expressions: contains address of first character ; after the code of the last evaluated expression CONTXT: equ $F666 ; F668: work area for evaluation of expressions: contains information byte about the ; encoding of the last evaluated constant number; value of this constant is in CONLO ; values: ; $0B: octal (2 bytes) ; $0C: hexadecimal (2 bytes) ; $0F: decimal 0<=value<256 (1 byte) ; $11-$1B: short encoding for 0->10 ; $1C: decimal (2bytes, 2s-compliment) ; $26: $42 binary as ASCII ; $0E: line number ; $0D: line pointer ; $1D: normal real (1 byte exp, 3 bytes BCD) ; $1F: double real (1 byte exp, 7 bytes BCD) CONSAV: equ $F668 ; F669: work area for evaluation of expressions: contains type of last evaluated number ; constant; the value is in CONLO, for values of CONTYP, see VALTYP ; Strings are never contant in BASIC! CONTYP: equ $F669 ; F66A-F671: work area for evaluation of expressions: contains the value of the last ; evaluated number contant; value starts at F66A, and takes bytes as needed for the type CONLO: equ $F66A ; F672-F673: upper limit of memory area reserved for strings, contains the upper address ; that is allowed to be used MEMSIZ: equ $F672 ; F674-F675: top of stack; also first byte below string area STKTOP: equ $F674 ; F676-F677: start address of current basic program, set at initialization, and ; not changed by OS (ini:$8001) TXTTAB: equ $F676 ; F678-F679: address of first unused string-descriptor in TEMPST ; (ini:value of TEMPST) TEMPPT: equ $F678 ; F67A-F697: work area for evaluation of string expressions; this area has space ; for 10 string descriptors of 3 bytes; these can be used for temporarely results ; of string arythmetics TEMPST: equ $F67A ; F698-F69A: work area for evaluation of string expressions; this contains the ; string descriptor of the intermediate result DSCTMP: equ $F698 ; F69B-F69C: first address within the string memory area that is still free ; the string area is filled backwards, soo the lower the value, the less space ; remains (ini: value of MEMSIZ) FRETOP: equ $F69B ; F69D-F69E: temporarely storage for adminstration of the basic interpreter TEMP3: equ $F69D ; F69F-F6A0: temporarely storage for garbage collection TEMP8: equ $F69F ; F6A1-F6A2: address of first byte in BASIC-code after last FOR statement ENDFOR: equ $F6A1 ; F6A3-F6A4: line number of last used line of DATA statements DATLIN: equ $F6A3 ; F6A5: switch indicating if a variable is allowed to be an array variable. ; This is e.g. not allowed for the loop variable of a FOR statement ; 0 = allowed, 1 = not allowed SUBFLG: equ $F6A5 ; F6A6: switch indicating if currently a READ or INPUT statement is being executed FLKINP: equ $F6A6 ; F6A7-F6A8: temporarely storage for adminstration of the basic interpreter TEMP: equ $F6A7 ; F6A9: switch indicating if there are still linenumber constants in the BASIC code ; that are encoded as pointers? PTRFLG: equ $F6A9 ; F6AA: switch indication if currently an AUTO statement is active ; 0 = no auto, 1 = auto AUTFLG: equ $F6AA ; F6AB-F6AC: last generated AUTO line number AUTLIN: equ $F6AB ; F6AD-F6AE: last used AUTO increment AUTINC: equ $F6AD ; F6AF-F6B0: work area of the error system; contains address of first byte ; of statement currently being executed SAVTXT: equ $F6AF ; F6B1-F6B2: work area of the error system; contains address of the stack ; before executing of the current statement started SAVSTK: equ $F6B1 ; F6B3-F6B4: line number of last failed line ERRLIN: equ $F6B3 ; F6B5-F6B6: line number of last used (changed, listed, added) line DOT: equ $F6B5 ; F6B7-F5B8: work area of the error system; contains the address of the first ; byte of the statement that last failed; on failure it is stored with the ; content of SAVTXT ERRTXT: equ $F6B7 ; F6B9-F6BA: work area of the error system; contains the line number where ; execution should go to on error (as in basic: ON ERROR GOTO x) ONELIN: equ $F6B9 ; F6BB-F6BC: work area of the error system; indication if the interpreter is ; currently executing an error catch routine ; 0 = no, FF = yes ONEFLG: equ $F6BB ; F6BC-F6BD: temporarely storage for the interpreter TEMP2: equ $F6BC ; F6BE-F6BF: line number of last program break, reset at 0 at any program change OLDLIN: equ $F6BE ; F6C0-F6C1: address of first statement that is not executed due to a break OLDTXT: equ $F6C0 ; F6C2-F6C3: begin address of storage of basic variables and function descriptors; ; possibly adjusted when program changes in size VARTAB: equ $F6C2 ; F6C4-F6C5: begin address of array variables; possibly adjusted when program ; changes size or more variables are allocated ARYTAB: equ $F6C4 ; F6C6-F6C7: address of first free byte not used for storage of code or variables ; (ini: $8003) STREND: equ $F6C6 ; F6C8-F6C9: address where data needs to be searched at next READ statement DATPTR: equ $F6C8 ; F6CA-F6E3: table with variable types, one for each letter in the alphabet ; possible values: ; 2 = integer 3 = string 4 = single 8 = double DEFTBL: equ $F6CA ; F6E4-F7B4: work area for execution of self defined functions ; F6E4-F6E5: contains address ; of previous parameter block on the stack; ; needed for garbage collection PRMSTK: equ $F6E4 ; F6E6-F6E7: amount of valid bytes in PARM1 PRMLEN: equ $F6E6 ; F6E8-F74B: contains definitions of the variables in the parameter lists ; of self defined functions PARM1: equ $F6E8 ; F74C-F74D: previous value of PRMSTK PRMDRV: equ $F74C ; F74E-F74F: number of valid bytes in PARM2 PRMLN2: equ $F74E ; F750-F7B3: area used for calculation of values that end up in PARM1 PARM2: equ $F750 ; F7B4: switch indicating of while searching a variable name PARM1 has ; been looked at; 0 = no, 1 = yes PRMFLG: equ $F7B4 ; F7B5-F7B6: address of first byte where it is no longer needed to search ; for a variable name; it is equal to ARYTAB when the normal variable area ; is searched, and equal to PARM1+PRMLEN when PARM1 is searched ARYTA2: equ $F7B5 ; F7B7-F7B8: switch indicating iif PARM1 contains a valid parameter block ; 0 = no, 1 = yes NOFUNS: equ $F7B7 ; F7B8-F7B9: temporarely memory used while searching parameter blocks on ; the stack TEMP9: equ $F7B8 ; F7BA-F7BB: counter of the nesting-dept of the function being evaluated FUNACT: equ $F7BA ; F7BC-F7C3: work area when executing the SWAP statement; the first variable ; is stored here SWPTMP: equ $F7BC ; F7C4: switch indicating if TRON is on; 0 = off, >0 = on TRCFLG: equ $F7C4 ; F7C5-F7F4: workarea when executing numeric operators FBUFFR: equ $F7C5 DECTMP: equ $F7F0 DECTM2: equ $F7F2 DECCNT: equ $F7F4 ; F7F6-F805: workarea when executing numeric operators; intermediate ; results are stored here; also used for parameter transfer when using ; the USR functions; VALTYPE then contains the type, and the value is ; stored like this: ; typename type where ; integer 2 F7F8-F7F9 ; string 3 F7F8-F7F9 (address descriptor) ; single 4 F7F6-F7F9 ; double 8 F7F6-F7FD DAC: equ $F7F6 ; F806-F856: workarea when executing numeric operators HOLD8: equ $F806 HOLD2: equ $F836 HOLD: equ $F83E ARG: equ $F847 ; F857-F85E: last calculated random double RNDX: equ $F857 ; -------------------- ; filesystem work area ; -------------------- ; F85F: # of filedescriptors reserved minus 1 ; this is also the maximum number of open files possible MAXFIL: equ $F85F ; F860-F861: start address of the file information table FILTAB: equ $F860 ; F862-F863: start address of the first file-buffer NULBUF: equ $F862 ; F864-F865: during file I/O the start address of the active file-buffer PTRFIL: equ $F864 ; F866: flag indicating if the file that is being loaded have to be started ; immediately; 0 = no, FF = yes RUNFLG: equ $F866 ; note that RUNFLG and FILNAM overlap! ; F866-F870: filename of last file that has been active; ; first 8 chars are name, last 3 are extension FILNAM: equ $F866 ; F871-F87B: second filename if needed, e.g. the NAME command FILNM2: equ $F871 ; F87C: switch indicating if currently a BASIC program is being loaded ; 0 = no, 1 = yes NLONLY: equ $F87C ; F87D-F87E: workarea for BLOAD and BSAVE; when a part of normal memory ; is written, it contains the end address of the written memory region ; if video memory is written it contains $4BE5 + start address of the ; written memory region ?? SAVEND: equ $F87D ; F87F-F91E: storage area for the text of the function keys 10x16 bytes, ; but strings need to be zero-terminated, soo maximum length of command is ; 15 characters FNKSTR: equ $F87F ; ------------------------ ; screen routine work area ; ------------------------ ; F91F-F921: start address of the standard ASCII pattern table ; at every change towards a text mode it is copied in the pattern table ; of the VDP ; F91F: slot indication (ini: 0) ; F920-F921: address (ini: 1BBF) ; TODO: make CBIOS use this value instead of hardcoded value CGPNT: equ $F91F ; F922-F923: start address of the nametable in the VRAM NAMBAS: equ $F922 ; F924-F925: start address of the pattern table in the VRAM CGPBAS: equ $F924 ; F926-F927: start address of the sprite pattern table in the VRAM PATBAS: equ $F926 ; F928-F929: start address of the sprite location table in the VRAM ATRBAS: equ $F928 ; F92A-F92B: address in VRAM of the pattern of the current position ; on screen CLOC: equ $F92A ; F92C: mask for CLOC selecting the right bits that correspond with ; the current position CMASK: equ $F92C ; F92D-F930: work area for graphical calculations MINDEL: equ $F92D MAXDEL: equ $F92F ; ---------------------------------------------- ; F931-F941: work area for calculation of CIRCLE ; ---------------------------------------------- ; F931-F932: ratio of # of dots in the horizontal and vertical direction ; if = $0100 then ASPCT1 and ASPCT2 are used ; if < $0100 then it is the # of dots in one direction for each ; $0100 # of dots in the other direction; the direction is indicated ; by CSCLXY ASPECT: equ $F931 ; F933:F934: ; distance, in # of dots from the center of the most ; distant point of the circle CENCNT: equ $F933 ; F935: switch indication if the start and/or end point need to be ; connected to the center ; bit 7: connect end point; 1 = yes ; bit 0: connect start point; 1 = yes CLINEF: equ $F935 ; F936-F937: used during calculation of CIRCLE CNPNTS: equ $F936 ; F938: direction of drawing of circle: ; 00 = from CSTCNT towards CENCNT ; FF = from CENCNT towards CSTCNT CPLOTF: equ $F938 ; F939-F93A: used during calculation of CIRCLE CPCNT: equ $F939 ; F93B-F93C: ; contains the total # of dots of the full circle, ; even when only a part is drawn CPCNT8: equ $F93B ; F93D-F93E: used during calculation of CIRCLE CRCSUM: equ $F93D ; F93F-F940: ; distance in dots from the center towards the closest ; circle point CSTCNT: equ $F93F ; F941: switch indicating if the X or Y direction needs to be streched: ; 0 = X, 1 = Y CSCLXY: equ $F941 ; F942-F943: store of CLOC, also used for PAINT CSAVEA: equ $F942 ; F944: storage of CMASK; also used for PAINT CSAVEM: equ $F944 ; F945-F946: horizontal distance towards the center CXOFF: equ $F945 ; F947-F948: vertical distance towards the center CYOFF: equ $F947 ; ------------------------------------------- ; work area for executing the PAINT statement ; ------------------------------------------- ; F949: leftmost position of protrusion towards the left LOHMSK: equ $F949 ; F94A: new workdirection for protrusion towards the left LOHDIR: equ $F94A ;F94B-F94C: leftmost position of protrusion towards the left LOHADR: equ $F94B ; F94D: size of protrusion towards the left LOHCNT: equ $F94D ; F94F-F950: # of pixels that may be skipped SKPCNT: equ $F94F ; F951-F952: # of movements MOVCNT: equ $F951 ; F953: current direction; $40 = \/, $C0 = /\, $00 = stop PDIREC: equ $F953 ; F954: indicate if paint towards the left worked LFPROG: equ $F954 ; F955: indicate of a paint towards the right worked RTPROG: equ $F955 ; F956-F957: start address of a jumptable for subcommands ; contained in a string variable, used for both PLAY and DRAW ; where this systemvar points to either the PLAY or the DRAW ; table MCLTAB: equ $F956 ; F958: switch indication if MCLTAB is for PLAY or DRAW ; $0 = DRAW, $FF = PLAY MCLFLG: equ $F958 ; ------------------------------------------ ; work area for sound and queueing and RS232 ; ------------------------------------------ ; F959-F971: Variables for three music queues and one RS232 queue ; F959: VOICAQ put position ; F95A: VOICAQ get position ; F95B: VOICAQ putback flag ; F95C: VOICAQ size ; F95D: VOICAQ address ; F95F-F964: VOICBQ ; F965-F96A: VOICCQ ; F96B-F970: RS2IQ QUETAB: equ $F959 ; Putback characters for queues. TODO: what purpose do these have exactly? QUEBAK: equ $F971 ; Buffers for queues. VOICAQ: equ $F975 ; Voice A queue VOICBQ: equ $F9F5 ; Voice B queue VOICCQ: equ $FA75 ; Voice C queue RS2IQ: equ $FAF5 ; RS232 queue ; in MSX2 the content of RS2IQ is used differently: DPPAGE: equ $FAF5 ; Display page (SCR5+) ACPAGE: equ $FAF6 ; Active page (SCR5+) ; FAF7: AV control port value storage AVCSAV: equ $FAF7 ; FAF8: extended BASIC ROM slot address EXBRSA: equ $FAF8 ; FAF9: character count for ROMA-KANA CHRCNT: equ $FAF9 ; FAFA-FAFB: character save for ROMA-KANA ROMA: equ $FAFA ; ROMA-KANA extension mode switch or VRAM size?? MODE: equ $FAFC ;Reserved equ $FAFD ; FAFE-FAFF: x position for mouse or lightpen XSAVE: equ $FAFE ; FB00-FB01: y position for mouse or lightpen YSAVE: equ $FB00 LOGOPR: equ $FB02 ; FB21-FB28: Table which contains info for up to 4 disk ROMs, 2 bytes each: ; - first byte: number of drives connected to this interface ; - second byte: slot ID of the disk ROM DRVINF: equ $FB21 ; end of MSX2 only usage of RS2IQ ; -------------------------------- ; work area for the PLAY statement ; -------------------------------- ; FB35: status about the parsing of a PLAY string ; bit 7: only one time parsed; 1 = yes ; bit 1-0: number of parsed strings (0-3) PRSCNT: equ $FB35 ; FB36-FB37: storage of stack SAVSP: equ $FB36 ; FB38: # of voice currently being parsed (0-2) VOICEN: equ $FB38 ; FB39-FB3A: storage of volume of a muted voice SAVVOL: equ $FB39 ; FB3B: size of string being parsed (also used by DRAW) MCLLEN: equ $FB3B ; FB3C-FB3D: address of string being parsed (also used by DRAW) MCLPTR: equ $FB3C ; FB3E: temporarely storage of active queue # (0-2) QUEUEN: equ $FB3E ; FB3F: flag indicating which queues are active ; bit 2 = queue 2; 1 = active ; bit 1 = queue 1; 1 = active ; bit 0 = queue 0; 1 = active MUSICF: equ $FB3F ; FB40: count of the # of PLAY statements parsed, but not executed yet PLYCNT: equ $FB40 ; FB41-FB65: Voice Control Block for voice A (queue 0) VCBA: equ $FB41 ; FB66-FB8A: Voice Control Block for voice B (queue 1) VCBB: equ $FB66 ; FB8B-FBAF: Voice Control Block for voice C (queue 2) VCBC: equ $FB8B ; each VCB has the following structure: ; name offset length purpose METREX: equ 0 ; 2 interrupt counter VCXLEN: equ 2 ; 1 MCLLEN for voice VCXPTR: equ 3 ; 2 MCLPTR for voice VCXSTP: equ 5 ; 2 stack pointer QLENGX: equ 7 ; 1 # bytes in queue NTICSX: equ 8 ; 2 new counter ? TONPRX: equ 10; 2 pitch AMPLTX: equ 12; 1 amplitude ENVPRX: equ 13; 2 envelope speed OCTAVX: equ 15; 1 octave NOTELX: equ 16; 1 tone length TEMPOX: equ 17; 1 tempo VOLUMX: equ 18; 1 volume ENVLPX: equ 19; 1 envelope shape MCLSTX: equ 33; space for stack storage MCLSEX: equ 36; start of stack ; the stack mentioned above is used to store bytevalues ; that are readied to be put on the voice queue ; ----------------------------------------------- ; settings for screen editor and interrupt system ; ----------------------------------------------- ; FBB0: switch indicating if software reset is enabled ; 0 = n, 1 = yes; can be used to reset BASIC by pressing ; SHIFT-CODE-GRAPH; does not erase the existing program ; (ini: 0) ENSTOP: equ $FBB0 ; FBB1: switch indicating if the current BASIC program is in a ROM ; 0 = no; 1 = yes BASROM: equ $FBB1 ; FBB2-FBC9: table containing for each line if it continues on the ; next line; 0 = yes, >0 = no LINTTB: equ $FBB2 ; FBCA-FBCB storage of location of cursor for INLIN and QINLIN ; FBCA: CSRY , FBCB: CSRX FSTPOS: equ $FBCA ; ASCII code of the character currently covered by the cursor ; TODO: is the name CURSAV or CODSAV ? CURSAV: equ $FBCC ; FBCD: switch indicating which function keys are to be displayed ; on the screen; 0 = F6-F10, 1 = F1-F5 FNKSWI: equ $FBCD ; FBCE-FBD7: for each function key, a flag indicating if it has ; interrupt facility enabled; 0 = disabled, 1 = enabled FNKFLG: equ $FBCE ; FBD8: counter of # of interrupts that still have a pending ON .. GOSUB ONGSBF: equ $FBD8 ; FBD9: flag indicating if a keyclick has already been generated, to avoid ; keyclicks for a key that generates two ASCII codes ; $00 = no click, $0F = click CLIKFL: equ $FBD9 ; FBDA-FBE4: storage of keyboard matrix, used for detection key repetition OLDKEY: equ $FBDA ; FBE5-FBEF: current state of the keyboard matrix NEWKEY: equ $FBE5 ; keyboard buffer; each char entered via the keyboard ends up here KEYBUF: equ $FBF0 ; LIMPNT: something about "key buffer pointer" LIMPNT: equ $FC17 ; FC18-FC3F: work area for processing the last typed line LINWRK: equ $FC18 ; FC40-FC47: storage for the patter of an ASCII character ; used when writing an ASCII character in a graphical mode PATWRK: equ $FC40 ; FC48-FC49: lowest address of the RAM memory; initialized at startup ; and not changed normally BOTTOM: equ $FC48 ; FC4A-FC4B: highest address of the RAM memory that is not reserved by ; the OS; string area, filebuffers and stack are below this address ; initialized at startup and not changed normally HIMEM: equ $FC4A ; FC4C-FC99: table for interrupt facilities of MSX BASIC ; each 3 bytes are used like this: ; byte 1 is a flag: ; bit 2: interrupt happened; 1 = yes ; bit 1: interrupt stop; 1 = yes ; bit 0: interrupt off; 1 = no ; byte 2-3 is the adress of the line in BASIC where should be ; jumped too ; the offsets in the table are: ; offset address interrupt ; 0 FC4C F1 ; 3 FC4F F2 ; 6 FC52 F3 ; 9 FC55 F4 ; 12 FC58 F5 ; 15 FC5B F6 ; 18 FC5E F7 ; 21 FC61 F8 ; 24 FC64 F9 ; 27 FC67 F10 ; 30 FC6A STOP ; 33 FC6D sprite collision ; 36 FC70 SPACE (trigger 0) ; 39 FC73 joystick 1 button 1 (trigger 1) ; 39 FC76 joystick 2 button 1 (trigger 2) ; 39 FC79 joystick 1 button 2 (trigger 3) ; 39 FC7C joystick 2 button 2 (trigger 4) ; 39 FC7F interval TRPTBL: equ $FC4C ; FC9A: usage unknown RTYCNT: equ $FC9A ; FC9B: STOP indication ; 0 = nothing; 3 = CTRL+STOP, 4 = STOP INTFLG: equ $FC9B ; FC9C: last read Y-position of a touchpad PADY: equ $FC9C ; FC9D: last read X-position of a touchpad PADX: equ $FC9D ; FC9E-FC9F: software clock, updated at each VDP interrupt JIFFY: equ $FC9E ; timer counter ; FCA0-FCA1: initial value of INTCNT, used when INTCNT ; reaches 0; used for ON INTERVAL GOSUB INTVAL: equ $FCA0 ; FCA2-FCA3: interrupt counter; lowered at each VDP interrupt; ; reset with value of INTVAL when it reaches zero; if interval ; interrupt is needed, it is generated INTCNT: equ $FCA2 ; FCA4-FCA5: parameter used at tap input, given a value during ; reading of a headerblock from tape LOWLIM: equ $FCA4 WINWID: equ $FCA5 ; FCA6: flag indicating if the previous character written ; to the screen was an extension character for graphical signs ; (ASCII 1); 0 = no, 1 = yes GRPHED: equ $FCA6 ; FCA7 ESCCNT State of a state machine that handles the printing of escape ; sequences. A subset of the VT52 escape sequences is supported. ; values: ; $00: not inside an escape sequence ; $01: seen x ; $02: seen y ; $03: seen Y ; $04: seen Y ; $FF: seen ESCCNT: equ $FCA7 ; FCA8: switch indicating insert or overwrite mode ; $00 = overwrite; $FF = insert ; the value of INSFLG is changed each time the INS key is pressed INSFLG: equ $FCA8 ; FCA9: show cursor; 0 = no, 1 = yes ; can be changed with escape sequences x5 and y5 CSRSW: equ $FCA9 ; FCAA: shape of cursor; 0 = block; 1 = insert ; pressing the INS key changes the value of CSTYLE ; can be changed with escape sequences x4 and y4 CSTYLE: equ $FCAA ; switch indicating if the CAPS-LOCK is on ; $00 = off, $FF = on (unofficial: $80 = perma-on) CAPST: equ $FCAB ; FCAC: dead key control in non-japanese MSX models ; adds a mark on the next char pressed, if applicable ; 0 = no dead key ; 1 = dead key => accent grave ; 2 = SHIFT + dead key => accent aigu ; 3 = CODE + dead key => accent circumflex ; 4 = SHIFT + CODE + dead key => trema ; in japanese models it controls the charset used KANAST: equ $FCAC ; FCAD: only used in japanese MSX models; it defines ; the used typeset (ini: $40) KANAMD: equ $FCAD ; ---- ; misc ; ---- FLBMEM: equ $FCAE SCRMOD: equ $FCAF OLDSCR: equ $FCB0 CASPRV: equ $FCB1 BRDATR: equ $FCB2 GXPOS: equ $FCB3 GYPOS: equ $FCB5 GRPACX: equ $FCB7 GRPACY: equ $FCB9 DRWFLG: equ $FCBB DRWANG: equ $FCBD RUNBNF: equ $FCBE SAVENT: equ $FCBF ; --------------------------- ; storage of slot information ; --------------------------- ; FCC1-FCC4: Information for each primary slot. The most significant bit is ; set if the primary slot is found to be expanded. EXPTBL: equ $FCC1 ; FCC5-FCC8: Duplicate the contents of the four possible secondary slot ; registers. SLTTBL: equ $FCC5 ; FCC9-FD08: Information for any extension ROMs found during the power-up ; ROM search. ; FCC9-FCCC: primary slot 0, secondary slot 0 ; FCCD-FCD0: primary slot 0, secondary slot 1 ; FCD1-FCD4: primary slot 0, secondary slot 2 ; FCD5-FCD8: primary slot 0, secondary slot 3 ; FCD9-FCE8: primary slot 1 ; FCE9-FCF8: primary slot 2 ; FCF9-FD08: primary slot 3 ; The information is stored as below. ; bit 7 (set): BASIC program ; bit 6 (set): device handler ; bit 5 (set): statement handler SLTATR: equ $FCC9 SLTWRK: equ $FD09 ; ------------------------------ ; storage of ROM-page parameters ; ------------------------------ PROCNM: equ $FD89 DEVICE: equ $FD99 ; ------------ ; system hooks ; ------------ ; system hooks are defined in hooks.asm ; ------------------ ; storage of VDP8-23 ; ------------------ ; FFE7-FFF6: storage of VDP 8-23 RG8SAV: equ $FFE7 ; ---------------------- ; extra slot information ; ---------------------- ; FFF7: slot address of main-rom ;?????: equ $FFF7 ; ------------------ ; storage of VDP25-27 ; ------------------ ; FFFA-FFFC: storage of VDP 25-27 RG25SAV: equ $FFFA ; --------------------------- ; subslot switching addresses ; --------------------------- ; FFFF: subslot switching address ; This is not actually a system variable, it is a hardware register: ; SSL_REGS (see hardware.asm). ; ------- ; the end ; ------- ; vim:ts=8:expandtab:filetype=z8a:syntax=z8a: cbios-0.28/src/statements.asm0000644000000000000000000001226413137376076014742 0ustar rootroot; C-BASIC statements ; ; Copyright (c) 2005 BouKiCHi. All rights reserved. ; ; ; Redistribution and use in source and binary forms, with or without ; modification, are permitted provided that the following conditions ; are met: ; 1. Redistributions of source code must retain the above copyright ; notice, this list of conditions and the following disclaimer. ; 2. Redistributions in binary form must reproduce the above copyright ; notice, this list of conditions and the following disclaimer in the ; documentation and/or other materials provided with the distribution. ; ; THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ; OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ; IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ; NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ; ; ; part of ROM Basic ds $3193 - $ ;----------------------------- ;$3193 - Multiply ; In : HL,DE ; Out : HL and DAC ; Regs : unknown ; Note : this routine is not correctly yet multiple: push bc push hl pop bc multiple_lp: dec de ld a,e or d jr z,multiple_fin add hl,bc jr multiple_lp multiple_fin: pop bc ret rombas: push hl push af ld hl,rombas_text call print_debug ld a,$20 out ($2e),a ld a,d out ($2f),a ld a,e out ($2f),a pop af pop hl ret rombas_text: db "ROMBAS",0 ds $392e - $ ; runloop table dw rombas_niy,rombas_niy,rombas_niy dw rombas_niy,rombas_niy,rombas_niy dw rombas_niy,rombas_niy,rombas_niy dw rombas_niy,rombas_niy,rombas_niy dw rombas_niy,rombas_niy,rombas_niy dw rombas_niy,rombas_niy,rombas_niy dw rombas_niy,rombas_niy,rombas_niy dw rombas_niy,rombas_niy,rombas_niy dw rombas_niy,rombas_niy,rombas_niy dw rombas_niy,rombas_niy,rombas_niy dw rombas_niy,rombas_niy,rombas_niy dw rombas_niy,rombas_niy,rombas_niy dw rombas_niy,rombas_niy,rombas_niy dw rombas_niy,rombas_niy,rombas_niy dw rombas_niy,rombas_niy,rombas_niy dw rombas_niy,rombas_niy,rombas_niy dw rombas_niy,rombas_niy,rombas_niy dw rombas_niy,rombas_niy,rombas_niy dw rombas_niy,rombas_niy,rombas_niy dw rombas_niy,rombas_niy,rombas_niy dw rombas_niy,rombas_niy,rombas_niy dw rombas_niy,rombas_niy,rombas_niy dw rombas_niy,rombas_niy,rombas_niy dw rombas_niy,rombas_niy,rombas_niy dw rombas_niy,rombas_niy,rombas_niy dw rombas_niy,rombas_niy,rombas_niy dw rombas_niy,rombas_niy,rombas_niy dw rombas_niy,rombas_niy,rombas_niy dw rombas_niy,rombas_niy,rombas_niy dw rombas_niy ; statement table ds $39de - $ dw rombas_niy,rombas_niy,rombas_niy dw rombas_niy,rombas_niy,rombas_niy dw rombas_niy,rombas_niy,rombas_niy dw rombas_niy,rombas_niy,rombas_niy dw rombas_niy,rombas_niy,rombas_niy dw rombas_niy,rombas_niy,rombas_niy dw rombas_niy,rombas_niy,rombas_niy dw rombas_niy,rombas_niy,rombas_niy dw rombas_niy,rombas_niy,rombas_niy dw rombas_niy,rombas_niy,rombas_niy dw rombas_niy,rombas_niy,rombas_niy dw rombas_niy,rombas_niy,rombas_niy dw rombas_niy,rombas_niy,rombas_niy dw rombas_niy,rombas_niy,rombas_niy dw rombas_niy,rombas_niy,rombas_niy dw rombas_niy,rombas_niy,rombas_niy rombas_niy: push hl push af ld hl,rombas_niy_text call print_debug pop af pop hl ret rombas_niy_text: db "BASIC statements are not implemented yet",0 cbios-0.28/src/sub.asm0000644000000000000000000012023613137376076013343 0ustar rootroot; C-BIOS subrom file... ; ; Copyright (c) 2002-2005 BouKiCHi. All rights reserved. ; Copyright (c) 2004-2005 Maarten ter Huurne. All rights reserved. ; Copyright (c) 2004-2005 Albert Beevendorp. All rights reserved. ; Copyright (c) 2004 Manuel Bilderbeek. All rights reserved. ; Copyright (c) 2004 Joost Yervante Damad. All rights reserved. ; Copyright (c) 2004-2005 Jussi Pitkänen. All rights reserved. ; ; Redistribution and use in source and binary forms, with or without ; modification, are permitted provided that the following conditions ; are met: ; 1. Redistributions of source code must retain the above copyright ; notice, this list of conditions and the following disclaimer. ; 2. Redistributions in binary form must reproduce the above copyright ; notice, this list of conditions and the following disclaimer in the ; documentation and/or other materials provided with the distribution. ; ; THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ; OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ; IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ; NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ; include "hardware.asm" ; Note: VDP could also be V9958, but for the subrom there is no difference. VDP: equ V9938 COMPILE_FONT: equ YES CALL_SUB: equ NO MODEL_MSX: equ MODEL_SUBROM include "systemvars.asm" include "hooks.asm" org $0000 db "CD" dw 0 ; Initialisation routine. dw 0 ; Statement handler. dw 0 ; Device handler. ; $0008 ds $0008 - $,$C9 ; $0010 CHRGTR ds $0010 - $,0 ; Simple implementation ld a,(hl) or a ret ; $0014 WRSLT ds $0014 - $,0 ret ; $0018 ds $0018 - $,0 ret ; $001C CALSLT ds $001C - $,0 ret ; $0020 DCOMPR ds $0020 - $,0 ld a,h cp d ret nz ld a,l cp e ret ; $0028 ds $0028 - $,0 ret ; $0030 CALLF ds $0030 - $,0 ret ; $0038 Handler for maskable interrupt. ds $0038 - $,$C9 push af push bc push de push hl ex af,af' exx push af push bc push de push hl push ix push iy ld ix,$38 ld iy,($fcc0) call calslt pop iy pop ix pop hl pop de pop bc pop af ex af,af' exx pop hl pop de pop bc pop af reti ; $0066 Handler for non-maskable interrupt (not used on MSX). ds $0066 - $,$C9 call H_NMI retn ; $0069 PAINT (BASIC) ; $006D PSET (BASIC) ; $0071 ATRSCN (BASIC) ; $0075 GLINE (BASIC) ; $0079 DOBOXF (BASIC) ; $0081 BOXLIN (BASIC) ; $0085 DOGRPH Draws a line ds $0085 - $,$C9 ei jp dogrph ; $0089 GRPPRT ds $0089 - $,$C9 ei jp grpprt_sub ; $008D SCALXY ds $008D - $,$C9 ei jp scalxy ; $0091 MAPXYC ds $0091 - $,$C9 ei jp mapxyc ; $0095 READC ds $0095 - $,$C9 ei jp readc ; $0099 SETATR ds $0099 - $,$C9 ei jp setatr ; $009D SETC ds $009D - $,$C9 ei jp setc ; $00A1 TRIGHT ds $00A1 - $,$C9 ei jp tright ; $00A5 RIGHTC ds $00A5 - $,$C9 ei jp rightc ; $00A9 TLEFTC ds $00A9 - $,$C9 ei jp tleftc ; $00AD LEFTC ds $00AD - $,$C9 ei jp leftc ; $00B1 TDOWNC ds $00B1 - $,$C9 ei jp tdownc ; $00B5 DOWNC ds $00B5 - $,$C9 ei jp downc ; $00B9 TUPC ds $00B9 - $,$C9 ei jp tupc ; $00BD UPC ds $00BD - $,$C9 ei jp upc ; $00C1 SCANR ds $00C1 - $,$C9 ei jp scanr ; $00C5 SCANL ds $00C5 - $,$C9 ei jp scanl ; $00C9 NVBXLN ds $00C9 - $,$C9 ei jp nvbxln ; $00CD NVBXFL ds $00CD - $,$C9 ei jp nvbxfl ; $00D1 CHGMOD Set screen mode. ds $00D1 - $,$C9 ei jp chgmod ; $00D5 INITXT Set VDP for 40x24 text mode (SCREEN0). ds $00D5 - $,$C9 ei jp initxt ; $00D9 INIT32 Set VDP for 32x24 text mode (SCREEN1). ds $00D9 - $,$C9 ei jp init32 ; $00DD INIGRP Set VDP for graphics mode (SCREEN2). ds $00DD - $,$C9 ei jp inigrp ; $00E1 INIMLT Set VDP for multicolour mode (SCREEN3). ds $00E1 - $,$C9 ei jp inimlt ; $00E5 SETTXT Set VDP for 40x24 text mode (SCREEN0). ds $00E5 - $,$C9 ei jp settxt ; $00E9 SETT32 Set VDP for 32x24 text mode (SCREEN1). ds $00E9 - $,$C9 ei jp sett32 ; $00ED SETGRP Set VDP for graphics mode (SCREEN2). ds $00ED - $,$C9 ei jp setgrp ; $00F1 SETMLT Set VDP for multicolour mode (SCREEN3). ds $00F1 - $,$C9 ei jp setmlt ; $00F5 CLRSPR Clear sprites. ds $00F5 - $,$C9 ei jp clrspr ; $00F9 CALPAT Returns address of sprite pattern-table. ds $00F9 - $,$C9 ei jp calpat ; $00FD CALATR Returns address of sprite attribute-table. ds $00FD - $,$C9 ei jp calatr ; $0101 GSPSIZ Returns current sprite-size. ds $0101 - $,$C9 ei jp gspsiz ; $0105 GETPAT ds $0105 - $,$C9 ei jp getpat ; $0109 WRTVRM ds $0109 - $,$C9 ei jp nwrvrm ; call 16 bit version ; $010D RDVRM ds $010D - $,$C9 ei jp nrdvrm ; call 16 bit version ; $0111 CHGCLR Change colours. ds $0111 - $,$C9 ei jp chgclr ; $0115 CLS ds $0115 - $,$C9 ei jp cls ; $0119 CLRTXT ds $0119 - $,$C9 ei jp clrtxt ; $011D DSPFNK ; $0121 DELLNO ; $0125 INSLNO ; $0129 PUTVRM ; $012D WRTVDP Write to VDP register. ds $012D - $,$C9 ei jp wrtvdp ; $0131 VDPSTA Read VDP status register. ds $0131 - $,$C9 ei jp vdpsta ; $0135 KYKLOK ; $0139 PUTCHR ; $013D SETPAG Switches display page. ds $013D - $,$C9 ei jp setpag ; $0141 INIPLT ds $0141 - $,$C9 ei jp iniplt ; $0145 RSTPLT ds $0145 - $,$C9 ei jp rstplt ; $0149 GETPLT ds $0149 - $,$C9 ei jp getplt ; $014D SETPLT ds $014D - $,$C9 ei jp setplt ; $0151 PUTSPRT (BASIC) ; $0155 COLOR (BASIC) ; $0159 SCREEN (BASIC) ; $015D WIDTHS (BASIC) ; $0161 VDP (BASIC) ; $0165 VDPF (BASIC) ; $0169 BASE (BASIC) ; $016D BASEF (BASIC) ; $0171 VPOKE (BASIC) ; $0175 VPEEK (BASIC) ; $0179 SETS (BASIC) ; $017D BEEP ds $017D - $,$C9 ei jp beep ; $0181 PROMPT ds $0181 - $,$C9 ei jp prompt ; $0185 SDFSCR Restore screen parameters from RTC ds $0185 - $,$C9 ei jp sdfscr ; $0189 SETSCR Restore screen parameters from RTC and print welcome message ds $0189 - $,$C9 ei jp setscr ; $018D SCOPY (BASIC) ; $0191 BLTVV Copy from VRAM to VRAM ds $0191 - $,$C9 ei jp bltvv ; $0195 BLTVM Copy from Memory to VRAM ds $0195 - $,$C9 ei jp bltvm ; $0199 BLTMV Copy from VRAM to Memory ds $0199 - $,$C9 ei jp bltmv ; $019D BLTVD Copy from Diskfile to VRAM ds $019D - $,$C9 ei jp bltvd ; $01A1 BLTDV Copy from VRAM to Diskfile ds $01A1 - $,$C9 ei jp bltdv ; $01A5 BLTMD Copy from Diskfile to Memory ds $01A5 - $,$C9 ei jp bltmd ; $01A9 BLTDM Copy from Memory to Diskfile ds $01A9 - $,$C9 ei jp bltdm ; $01AD NEWPAD ds $01AD - $,$C9 ei jp newpad ; $01B1 GETPUT (BASIC) ; $01B5 CHGMDP Set screen mode, initialise palette. ds $01B5 - $,$C9 ei jp chgmdp ; $01BD KNJPRT ds $01BD - $,$C9 ei jp knjprt ; $01F5 REDCLK ds $01F5 - $,$C9 ei jp redclk ; $01F9 WRTCLK ds $01F9 - $,$C9 ei jp wrtclk ; End of entry points, catch non-implemented calls. ds $0200 - $,$C9 include "util.asm" include "debug.asm" include "slot.asm" include "video.asm" ;------------------------------------- ; $0085h DOGRPH ; Function: Draws a line ; Input: BC, HL are start coordinates ; GXPOS, GYPOS are end-coordinates ; ATRBYT for attribute ; LOGOPR for logical operator ; Registers: AF ; NOTE: this implementation is still a stub! dogrph: push hl push af ld hl,dogrph_text call print_debug pop af pop hl ret dogrph_text: db "DOGRPH",0 ;------------------------------ ; $0089 GRPPRT ; Function: Places a character on graphic screen ; Input: A - Character ; ATRBYT for attribute ; LOGOPR for logical operator ; NOTE: Currently MSX2 Graphical screens only ; NOTE: It still lacks any clipping check grpprt_sub: push bc push de push hl call getpat ld a,(FORCLR) ld (ATRBYT),a ld hl,(GRPACX) ld (DX),HL ld bc,8 add hl,bc ld (GRPACX),hl ld a,(ACPAGE) ld hl,(GRPACY) ld h,a ld (DY),hl ld (NX),bc ld (NY),bc ld hl,PATWRK rlc (hl) ld a,(ATRBYT) jr c,grpprt_init ld a,(BAKCLR) grpprt_init: ld (CDUMMY),a call exec_cmd ld a,(LOGOPR) and 15 or $b0 out (c),a ld a,128+ 44 out (VDP_ADDR),a ld a,128+ 17 out (VDP_ADDR),a ei ld b,8 ; number of lines ld c,7 ; number of pixels ld hl,PATWRK grpprt_loop: rlc (hl) ld a,(ATRBYT) jr c,grpprt_out ld a,(BAKCLR) grpprt_out: out (VDP_REGS),a ; write pixel color dec c jr nz,grpprt_loop inc hl ld c,8 ; number of pixels djnz grpprt_loop pop hl pop de pop bc ret ;------------------------------------- ; $0091 MAPXYC ; Function : Converts an X,Y position to an address: and mask in CLOC and ; CMASK ; Input : BC - X-position ; DE - Y-position ; Output : HL - VRAM address: In SCREEN 3 (in CLOC too) ; A - Mask In SCREEN 3 (in CMASK too) ; HL - X-position In SCREEN 5->8 (in CLOC too) ; A - Y-position In SCREEN 5->8 (in CMASK too) ; Registers: F mapxyc: push hl push af ld hl,mapxyc_text call print_debug pop af pop hl ret mapxyc_text: db "MAPXYC",0 ;------------------------------------- ; $00A1 TRIGHT ; Function : Moves pixel to the right ; Input : X-position in CLOC ; Yposition in CMASK ; Output : New X-position in CLOC ; New Y-position in CMASK ; C-flag set if border of screen is reached ; Registers: AF ; Remark : SCREEN 3 only tright: push hl push af ld hl,tright_text call print_debug pop af pop hl ret tright_text: db "TRIGHT",0 ;------------------------------------- ; $00A9 TLEFTC ; Function : Moves pixel to the left ; Input : See TRIGHT ; Output : See TRIGHT ; Registers: AF tleftc: push hl push af ld hl,tleftc_text call print_debug pop af pop hl ret tleftc_text: db "TRIGHT",0 ;------------------------------------- ; $00C9 NVBXLN ; Function : Draws an open rectangle. ; Input : BC = start x ; DE = start y ; GXPOS = end x (inclusive) ; GYPOS = end y (inclusive) ; ATRBYT = attribute ; LOGOPR = logic operation ; Changes : all ; Notes : use only in SCREEN 5-8 nvbxln: ld a,(ACPAGE) ld d,a push de ; (BC,DE)-(GXPOS,DE) ld (DX),bc ld (DY),de ld hl,(GXPOS) and a sbc hl,bc ld (NX),hl ld hl,$0000 ld (NY),hl xor a ld (ARG_),a ld a,(ATRBYT) ld (CDUMMY),a call exec_line ; (BC,GYPOS)-(GXPOS,GYPOS) ld hl,(GYPOS) ld a,(ACPAGE) ld h,a ld (DY),hl call exec_line ; (BC,DE)-(BC,GYPOS) pop de ld (DY),de ld a,1 ld (ARG_),a ld a,(GYPOS) sub e ld (NX),a call exec_line ; (GXPOS,DE)-(GSPOS,GYPOS) ld hl,(GXPOS) ld (DX),hl call exec_line ret exec_line: call exec_cmd ld a,(LOGOPR) and $0f or $70 ; LINE out (c),a ei ret ;------------------------------------- ; $00CD NVBXFL ; Function : Draws a filled rectangle. ; Input : BC = start x ; DE = start y ; GXPOS = end x (inclusive) ; GYPOS = end y (inclusive) ; ATRBYT = attribute ; LOGOPR = logic operation ; Changes : all ; Notes : use only in SCREEN 5-8 nvbxfl: ld hl,(GYPOS) rst $20 jr nc,nvbxfl_lty ex de,hl nvbxfl_lty: and a sbc hl,de inc hl ld (NY),hl ld a,(ACPAGE) ld d,a ld (DY),de push bc pop de ld hl,(GXPOS) rst $20 jr nc,nvbxfl_ltx ex de,hl nvbxfl_ltx: and a sbc hl,de inc hl ld (NX),hl ld (DX),de xor a ld (ARG_),a ld a,(ATRBYT) ld (CDUMMY),a call exec_cmd ld a,(LOGOPR) and $0F or $80 ; LMMV out (c),a ei ret ;------------------------------------- ; $0119 CLRTXT ; Function : Clear Text-screen ; Registers: All ; NOTE: this implementation is still a stub! clrtxt: push hl push af ld hl,clrtxt_text call print_debug pop af pop hl jp cls clrtxt_text: db "CLRTXT",0 ;------------------------------------- ; $013D SETPAG ; Input: DPPAGE ; Changes: AF ; TODO: Does it do more? Maybe something involving ACPAGE? setpag: ; TODO: This is valid for SCREEN5, but what about other modes? ; TODO: Change many register used ATRBAS,PATBAS push hl push de push bc ld hl,(NAMBAS) rlc h rlc h ld a,(DPPAGE) rrca rrca rrca add a,h or $1f ld b,a ; B = R#2 data ld c,2 call wrtvdp ; write VDP R#2 ld a,(SCRMOD) cp 7 jr nz,setpag_skip_setrg6 ld a,(RG6SAV) and $1f ld b,a ld a,(DPPAGE) rrca rrca rrca or b ld b,a ld c,6 call wrtvdp ; write VDP R#6 setpag_skip_setrg6: ld a,(DPPAGE) ; DP = A16 A15(SC5) A16 (SC7) ?? ld c,a ld a,(SCRMOD) cp 7 jr nz,setpag_skip_shift sla c setpag_skip_shift: xor a ld hl,(ATRBAS) add hl,hl adc a,a or c ld l,a ld a,$03 or h ld b,a ; VDP Reg $05 data ld c,$05 call wrtvdp ld b,l ; VDP Reg $0B data ld c,$0b call wrtvdp pop bc pop de pop hl ret ;------------------------------------- ; $0141 INIPLT ; Function: Initialises the palette (current palette is saved in VRAM) ; Registers: AF, BC, DE iniplt: push hl call palette_vram call nsetwr ld bc,16 call wrtvdp ; set palette index ld b,32 ld hl,palette_vram_init iniplt_loop: ld a,(hl) out (VDP_DATA),a inc hl out (VDP_PALT),a djnz iniplt_loop pop hl ret ;------------------------------------- ; $0145 RSTPLT ; Function: Restore palette from VRAM ; Registers: AF, BC, DE rstplt: push hl call palette_vram call nsetrd pop hl ld bc,16 call wrtvdp ; set palette index ld b,32 rstplt_loop: in a,(VDP_DATA) out (VDP_PALT),a djnz rstplt_loop ret ;------------------------------------- ; $0149 GETPLT ; Function: Obtains the colorcodes from the palette ; Input: A - Colorcode ; Output: B - RRRRBBBB ; C - xxxxGGGG ; Registers: AF,BC,DE getplt: push hl push af call palette_vram pop af add a,a ld c,a ld b,0 add hl,bc call nsetrd in a,(VDP_DATA) ld b,a in a,(VDP_DATA) ld c,a pop hl ret ;------------------------------------- ; $014D SETPLT ; Sets a palette index to a given RGB value. ; Input: D = palette index ; E = xxxxxGGG ; A = xRRRxBBB ; Changes: AF setplt: push af push bc push hl call palette_vram ld a,d add a,a ld c,a ld b,0 add hl,bc call nsetwr pop hl ld b,d ld c,16 call wrtvdp ; set palette index pop bc pop af out (VDP_PALT),a ; set red and blue out (VDP_DATA),a ld a,e out (VDP_PALT),a ; set green out (VDP_DATA),a ret ; ; internal - get palette base address from screen mode ; in : SCRMOD ; out: HL = base address ; palette_vram: ld a,(SCRMOD) or a call z,palette_width inc a ld hl,palette_vram_table add a,a add a,l ld l,a ld a,h adc a,0 ld h,a ld a,(hl) inc hl ld h,(hl) ld l,a ret palette_width: ld h,a ld a,(LINLEN) cp 40 ld a,h ret nc dec a ret palette_vram_table: dw $0400 ; SCREEN 0 - WIDTH 40 dw $0f00 ; SCREEN 0 - WIDTH 80 dw $2020 ; SCREEN 1 dw $1b80 ; SCREEN 2 dw $2020 ; SCREEN 3 dw $1b80 ; SCREEN 4 dw $7680 ; SCREEN 5 dw $7680 ; SCREEN 6 dw $fa80 ; SCREEN 7 dw $fa80 ; SCREEN 8 palette_vram_init: dw $000,$000,$611,$733,$117,$327,$151,$627 dw $171,$373,$661,$664,$411,$265,$555,$777 ;------------------------------------- ; $017D BEEP ; Function : Generates beep ; Registers: All ; NOTE: this implementation is still a stub! beep: push hl push af ld hl,beep_text call print_debug pop af pop hl ret beep_text: db "BEEP",0 ;------------------------------------- ; $0181 PROMPT ; Function: Shows prompt (normally "Ok") ; Registers: All ; NOTE: this implementation is still a stub! prompt: push hl push af ld hl,prompt_text call print_debug pop af pop hl ret prompt_text: db "PROMPT",0 ;------------------------------------- ; $0185 SDFSCR ; Function: Recovers screen-parameters from RTC. ; Input: F = NC when called from MSX-DOS ; C to display function keys ; Registers: All ; NOTE: this implementation is still a stub! sdfscr: push hl push af ld hl,sdfscr_text call print_debug pop af pop hl ret sdfscr_text: db "SDFSCR",0 ;------------------------------------- ; $0189 SETSCR ; Function: Recovers screen parameters from RTC and display welcome message ; Registers: All ; NOTE: this implementation is still a stub! setscr: push hl push af ld hl,setscr_text call print_debug pop af pop hl ret setscr_text: db "SETSCR",0 ; ; internal, wait for VDP command to end and execute the next one ; exec_cmd: ld a,2 call vdpsta rra jr c,exec_cmd di ld a,32 out (VDP_ADDR),a ld a,128+ 17 out (VDP_ADDR),a ld bc,14 *256+ VDP_REGS ld hl,SX otir ret blt_clip: ld a,b or c scf ret z ld a,d or e scf ret z push hl ld hl,256 ld a,(SCRMOD) and 6 ; SCREEN 6 or 7 cp 6 ld a,(SCRMOD) jr nz,blt_clip_x ; SCREEN 5 or 8 => X-max = 256 inc h ; x-max = 512 blt_clip_x: or a sbc hl,bc pop hl ret c push hl ld hl,212 or a sbc hl,de pop hl ret ;------------------------------------- ; $0191 BLTVV ; Function: Copy from VRAM to VRAM ; Input: SX, SY, DX, DY, NX, NY, ARG_, L_OP ; Registers: All bltvv: ld bc,(NX) ld de,(NY) call blt_clip ret c call exec_cmd ld a,(hl) and 15 or $90 ; LMMM out (c),a ei or a ret ;------------------------------------- ; $0195 BLTVM ; Function: Copy from RAM to VRAM ; Input: SX = address of screen data in RAM ; DX, DY, NX, NY, ARG_, L_OP ; NX and NY are required in screen data in RAM ; Registers: All bltvm: ld hl,(SX) ld c,(hl) ; read NX from screen data to BC inc hl ld b,(hl) inc hl ld (NX),bc ; store NX ld e,(hl) ; read NY from screen data to DE inc hl ld d,(hl) inc hl ld (NY),de ; store NY call blt_clip ret c cp 8 ld de,1 *256+ 4 ; D = number of pixels in a byte jr z,bltvm_cont ; E = number of 2-bits per pixel (shift) cp 6 ld de,4 *256+ 1 jr z,bltvm_cont ld de,2 *256+ 2 bltvm_cont: ld c,(hl) ; read first value to write xor a ld b,e ; number of bits per pixel bltvm_1stcol: rl c ; shift bits into A rla rl c rla djnz bltvm_1stcol ld (CDUMMY),a ; store first byte ld b,d ; number of pixels dec b ; first color was just done push bc push hl call exec_cmd ld a,(hl) and 15 or $b0 ; LMMC out (c),a ld a,128+ 44 out (VDP_ADDR),a ld a,128+ 17 out (VDP_ADDR),a ei pop hl pop bc bltvm_loop: ld a,2 call vdpsta bit 0,a ; end of command? ret z bit 7,a ; transmit ready? jr z,bltvm_loop ld a,b and a ; zero check (for SC8) jr z,bltvm_next bltvm_byte: push bc xor a ld b,e ; number of bits per pixel bltvm_pixel: rl c ; shift bits into A rla rl c rla djnz bltvm_pixel out (VDP_REGS),a ; write pixel color ld a,c pop bc ld c,a djnz bltvm_byte ; until the complete byte is done bltvm_next: inc hl ld c,(hl) ; get the next byte ld b,d ; number of pixels jr bltvm_loop ;------------------------------------- ; $0199 BLTMV ; Function: Copy from VRAM to RAM ; Input: SX, SY, NX, NY, ARG_, L_OP ; DX = address of screen data in RAM ; NX and NY are written to screen data in RAM ; Registers: All bltmv: ld hl,(DX) ld bc,(NX) ld de,(NY) ld (hl),c ; write NX to screen data inc hl ld (hl),b inc hl ld (hl),e ; write NY to screen data inc hl ld (hl),d inc hl call blt_clip ret c ; A = (SCRMOD), set by blt_clip cp 8 ld de,1 *256+ 1 ; actually 8, but 1 works too jr z,bltmv_cont cp 6 ld de,4 *256+ 2 jr z,bltmv_cont ld de,2 *256+ 4 bltmv_cont: ; D = number of pixels in a byte ; E = number of bits per pixel (shift) push hl call exec_cmd ld a,(hl) and $0F ld a,$A0 ; LMCM out (c),a ei pop hl bltmv_byte: ld b,d ld c,0 bltmv_pixel: ld a,2 call vdpsta bit 7,a ; transmit ready? jr nz,bltmv_do bit 0,a jr nz,bltmv_pixel bltmv_do: push bc ld a,7 call vdpsta ld b,e bltmv_bit: rlc c djnz bltmv_bit or c pop bc ld c,a djnz bltmv_pixel ld (hl),c inc hl ld a,2 call vdpsta bltmv_end: rra ; end of command? jr c,bltmv_byte ret ;------------------------------------- ; $019D BLTVD ; Function: Copy from diskfile to VRAM ; Input: SX = address to diskfile name ; DX, DY, NX, NY, ARG_, L_OP ; NX and NY are required in diskfile ; Registers: All ; NOTE: this implementation is still a stub! bltvd: push hl push af ld hl,bltvd_text call print_debug pop af pop hl ret bltvd_text: db "BLTVD",0 ;------------------------------------- ; $01A1 BLTDV ; Function: Copy from VRAM to diskfile ; Input: SX, SY, DX, NX, NY, ARG_, L_OP ; DX = address to diskfile name ; NX and NY are written to diskfile ; Registers: All ; NOTE: this implementation is still a stub! bltdv: push hl push af ld hl,bltdv_text call print_debug pop af pop hl ret bltdv_text: db "BLTDV",0 ;------------------------------------- ; $01A5 BLTMD ; Function: Copy from diskfile to RAM ; Input: SX = address to diskfile name ; DX = base address in RAM ; DY = end address in RAM ; Registers: All ; NOTE: this implementation is still a stub! bltmd: push hl push af ld hl,bltmd_text call print_debug pop af pop hl ret bltmd_text: db "BLTMD",0 ;------------------------------------- ; $01A9 BLTDM ; Function: Copy from RAM to diskfile ; Input: SX = base address in RAM ; SY = end address in RAM ; DX = address to diskfile name ; Registers: All ; NOTE: this implementation is still a stub! bltdm: push hl push af ld hl,bltdm_text call print_debug pop af pop hl ret bltdm_text: db "BLTDM",0 ;------------------------------------- ; $01AD NEWPAD ; Function: Read lightpen, mouse and trackball ; Input: Access via GETPAD in MSX1BIOS, will be linked to this call ; Procedure: read device, after that X and Y. ; A - 8 tot 19 ; [ 8] Read lightpen (#FF if available) ; [ 9] Read X-position ; [10] Read Y-position ; [11] Read lightpen-status (#FF if pressed) ; ; [12] Read mouse/trackball in port 1 ; [13] Read X-offset ; [14] Read Y-offset ; [15] No function (always #00) ; ; [16] Read mouse/trackball in port 2 ; [17] Read X-offset ; [18] Read Y-offset ; [19] No function (always #00) ; ; Output: A - Read value ; Registers: All ; NOTE: this implementation is still a stub! newpad: push hl push af ld hl,newpad_text call print_debug pop af pop hl ret newpad_text: db "NEWPAD",0 ;------------------------------------- ; $01B5 CHGMDP ; Input: A = screen mode ; Changes: all chgmdp: call chgmod call iniplt ret ;------------------------------------- ; $01BD KNJPRT ; Function: Puts Kanji-character on graphical screen (5-8) ; Input: BC - JIS Kanji-character code ; A - Display-mode (0=full, 1=even, 2=odd) ; Registers: AF ; NOTE: this implementation is still a stub! knjprt: push hl push af ld hl,knjprt_text call print_debug pop af pop hl ret knjprt_text: db "KNJPRT",0 ;------------------------------------- ; $01F5 REDCLK ; Function: Read clock-RAM ; Input: C - clock-RAM address ; xxBBAAAA ; ||++++-- address ; ++------ Block-number ; Output: A - Read value in lowest four bits ; Registers: F redclk: push bc ld a,13 out (RTC_ADDR),a ld a,c rrca rrca rrca rrca and 3 ld b,a in a,(RTC_DATA) or b pop bc out (RTC_DATA),a ld a,c and 15 out (RTC_ADDR),a in a,(RTC_DATA) and 15 ret ;------------------------------------- ; $01F9 WRTCLK ; Function: Write clock-RAM ; Input: C - clock-RAM address ; xxBBAAAA ; ||++++-- address ; ++------ Block-number ; A - Value to write ; Registers: F wrtclk: push bc ld b,a push bc ld a,13 out (RTC_ADDR),a ld a,c rrca rrca rrca rrca and 3 ld b,a in a,(RTC_DATA) or b pop bc out (RTC_DATA),a ld a,c and 15 out (RTC_ADDR),a ld a,b and 15 out (RTC_DATA),a pop bc ret ; Empty space until end of page. ds $4000 - $ ; vim:ts=8:expandtab:filetype=z8a:syntax=z8a: cbios-0.28/src/font_br.asm0000644000000000000000000004677713137376076014224 0ustar rootroot; Font data for C-BIOS. Font designed by Eric Boon. ; Modified for BR by FRS ; ; ; Copyright (c) 2004 Eric Boon. All rights reserved. ; Copyright (c) 2010 FRS. All rights reserved. ; ; Redistribution and use in source and binary forms, with or without ; modification, are permitted provided that the following conditions ; are met: ; 1. Redistributions of source code must retain the above copyright ; notice, this list of conditions and the following disclaimer. ; 2. Redistributions in binary form must reproduce the above copyright ; notice, this list of conditions and the following disclaimer in the ; documentation and/or other materials provided with the distribution. ; ; THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ; OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ; IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ; NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ; Brazilian version ; This NBR-9614:1986 (aka "BRASCII") charset is to the MSX-EN charset what the ; DOS CP850 is to CP437. Nearly the same characters change when comparing the ; two sets ; The MSX-EN charset followed the DOS CP437 closely, changing only the ; characters used to draw borders probably for copyright reasons. ; The Brazilian charset applied the same formula to the DOS CP850, so it ; changes the MSX-EN charset to try to get it as close as possible to the ; DOS CP850 db $00,$00,$00,$00,$00,$00,$00,$00 ; 0 db $3C,$42,$A5,$A5,$C3,$BD,$42,$3C ; 1 db $3C,$7E,$DB,$DB,$BD,$C3,$7E,$3C ; 2 db $6C,$FE,$FE,$7C,$7C,$38,$10,$00 ; 3 db $10,$38,$7C,$FE,$7C,$38,$10,$00 ; 4 db $10,$38,$38,$D6,$FE,$D6,$38,$00 ; 5 db $10,$38,$7C,$7C,$FE,$D6,$38,$00 ; 6 db $00,$00,$00,$18,$18,$00,$00,$00 ; 7 db $FF,$FF,$FF,$E7,$E7,$FF,$FF,$FF ; 8 db $3C,$42,$81,$81,$81,$81,$42,$3C ; 9 db $C3,$BD,$7E,$7E,$7E,$7E,$BD,$C3 ; 10 db $0E,$06,$0A,$70,$88,$88,$70,$00 ; 11 db $70,$88,$88,$70,$20,$70,$20,$00 ; 12 db $20,$30,$28,$28,$20,$E0,$C0,$00 ; 13 db $38,$3C,$24,$24,$E4,$DC,$18,$00 ; 14 db $10,$44,$38,$AA,$38,$44,$10,$00 ; 15 db $10,$10,$10,$38,$10,$10,$10,$10 ; 16 db $10,$10,$10,$EF,$00,$00,$00,$00 ; 17 db $00,$00,$00,$EF,$10,$10,$10,$10 ; 18 db $10,$10,$10,$E0,$10,$10,$10,$10 ; 19 db $10,$10,$10,$0F,$10,$10,$10,$10 ; 20 db $10,$10,$10,$EF,$10,$10,$10,$10 ; 21 db $10,$10,$10,$10,$10,$10,$10,$10 ; 22 db $00,$00,$00,$FF,$00,$00,$00,$00 ; 23 db $00,$00,$00,$0F,$10,$10,$10,$10 ; 24 db $00,$00,$00,$E0,$10,$10,$10,$10 ; 25 db $10,$10,$10,$0F,$00,$00,$00,$00 ; 26 db $10,$10,$10,$E0,$00,$00,$00,$00 ; 27 db $81,$42,$24,$18,$18,$24,$42,$81 ; 28 db $01,$02,$04,$08,$10,$20,$40,$80 ; 29 db $80,$40,$20,$10,$08,$04,$02,$01 ; 30 db $00,$00,$10,$FF,$10,$00,$00,$00 ; 31 db $00,$00,$00,$00,$00,$00,$00,$00 ; 32 db $00,$20,$20,$20,$20,$00,$20,$00 ; 33 db $00,$50,$50,$00,$00,$00,$00,$00 ; 34 db $00,$00,$50,$F8,$50,$F8,$50,$00 ; 35 db $20,$70,$A0,$70,$28,$70,$20,$00 ; 36 db $00,$00,$88,$10,$20,$40,$88,$00 ; 37 db $00,$60,$90,$60,$A8,$98,$60,$00 ; 38 db $00,$20,$40,$00,$00,$00,$00,$00 ; 39 db $00,$20,$40,$40,$40,$40,$20,$00 ; 40 db $00,$20,$10,$10,$10,$10,$20,$00 ; 41 db $00,$00,$20,$A8,$70,$50,$88,$00 ; 42 db $00,$00,$20,$20,$F8,$20,$20,$00 ; 43 db $00,$00,$00,$00,$00,$00,$40,$40 ; 44 db $00,$00,$00,$00,$F8,$00,$00,$00 ; 45 db $00,$00,$00,$00,$00,$00,$40,$00 ; 46 db $08,$10,$10,$20,$40,$40,$80,$00 ; 47 db $00,$70,$88,$A8,$A8,$88,$70,$00 ; 48 db $00,$20,$60,$20,$20,$20,$70,$00 ; 49 db $00,$70,$88,$08,$70,$80,$F8,$00 ; 50 db $00,$F8,$08,$30,$08,$88,$70,$00 ; 51 db $00,$10,$30,$50,$F8,$10,$10,$00 ; 52 db $00,$F8,$80,$70,$08,$88,$70,$00 ; 53 db $00,$30,$40,$70,$88,$88,$70,$00 ; 54 db $00,$F8,$88,$10,$20,$20,$20,$00 ; 55 db $00,$70,$88,$70,$88,$88,$70,$00 ; 56 db $00,$70,$88,$88,$78,$08,$70,$00 ; 57 db $00,$00,$00,$40,$00,$00,$40,$00 ; 58 db $00,$00,$00,$40,$00,$00,$40,$40 ; 59 db $00,$00,$18,$60,$80,$60,$18,$00 ; 60 db $00,$00,$00,$F8,$00,$F8,$00,$00 ; 61 db $00,$00,$C0,$30,$08,$30,$C0,$00 ; 62 db $70,$88,$08,$30,$20,$00,$20,$00 ; 63 db $70,$88,$98,$A8,$A8,$98,$40,$00 ; 64 db $00,$70,$88,$88,$F8,$88,$88,$00 ; 65 db $00,$E0,$90,$E0,$90,$88,$F0,$00 ; 66 db $00,$70,$88,$80,$80,$88,$70,$00 ; 67 db $00,$F0,$88,$88,$88,$88,$F0,$00 ; 68 db $00,$F8,$80,$E0,$80,$80,$F8,$00 ; 69 db $00,$F8,$80,$80,$E0,$80,$80,$00 ; 70 db $00,$70,$88,$80,$B8,$88,$70,$00 ; 71 db $00,$88,$88,$F8,$88,$88,$88,$00 ; 72 db $00,$70,$20,$20,$20,$20,$70,$00 ; 73 db $00,$38,$08,$08,$08,$88,$70,$00 ; 74 db $00,$88,$90,$A0,$E0,$90,$88,$00 ; 75 db $00,$80,$80,$80,$80,$80,$F8,$00 ; 76 db $00,$D8,$A8,$A8,$88,$88,$88,$00 ; 77 db $00,$C8,$A8,$A8,$98,$98,$88,$00 ; 78 db $00,$70,$88,$88,$88,$88,$70,$00 ; 79 db $00,$F0,$88,$88,$F0,$80,$80,$00 ; 80 db $00,$70,$88,$88,$A8,$90,$78,$00 ; 81 db $00,$F0,$88,$88,$F0,$A0,$98,$00 ; 82 db $00,$70,$80,$70,$08,$08,$F0,$00 ; 83 db $00,$F8,$20,$20,$20,$20,$20,$00 ; 84 db $00,$88,$88,$88,$88,$88,$78,$00 ; 85 db $00,$88,$88,$88,$50,$50,$20,$00 ; 86 db $00,$88,$88,$A8,$A8,$A8,$D8,$00 ; 87 db $00,$88,$50,$20,$50,$88,$88,$00 ; 88 db $00,$88,$88,$50,$20,$20,$20,$00 ; 89 db $00,$F8,$10,$20,$40,$80,$F8,$00 ; 90 db $70,$40,$40,$40,$40,$40,$70,$00 ; 91 db $80,$40,$40,$20,$10,$10,$08,$00 ; 92 db $70,$10,$10,$10,$10,$10,$70,$00 ; 93 db $20,$50,$00,$00,$00,$00,$00,$00 ; 94 db $00,$00,$00,$00,$00,$00,$F8,$00 ; 95 db $20,$10,$00,$00,$00,$00,$00,$00 ; 96 db $00,$00,$00,$78,$88,$98,$68,$00 ; 97 db $00,$80,$80,$F0,$88,$88,$F0,$00 ; 98 db $00,$00,$00,$78,$80,$80,$78,$00 ; 99 db $00,$08,$08,$78,$88,$88,$78,$00 ; 100 db $00,$00,$00,$70,$98,$E0,$78,$00 ; 101 db $30,$48,$40,$40,$E0,$40,$40,$40 ; 102 db $00,$00,$00,$78,$88,$78,$08,$70 ; 103 db $00,$80,$80,$F0,$88,$88,$88,$00 ; 104 db $00,$20,$00,$60,$20,$20,$70,$00 ; 105 db $10,$00,$30,$10,$10,$10,$10,$60 ; 106 db $00,$80,$80,$98,$A0,$E0,$98,$00 ; 107 db $00,$C0,$40,$40,$40,$40,$70,$00 ; 108 db $00,$00,$00,$F0,$A8,$A8,$A8,$00 ; 109 db $00,$00,$00,$F0,$88,$88,$88,$00 ; 110 db $00,$00,$00,$70,$88,$88,$70,$00 ; 111 db $00,$00,$00,$F0,$88,$F0,$80,$80 ; 112 db $00,$00,$00,$78,$88,$78,$08,$08 ; 113 db $00,$00,$00,$B8,$C0,$80,$80,$00 ; 114 db $00,$00,$00,$78,$F0,$08,$F0,$00 ; 115 db $00,$40,$40,$F0,$40,$40,$30,$00 ; 116 db $00,$00,$00,$88,$88,$88,$78,$00 ; 117 db $00,$00,$00,$88,$88,$50,$20,$00 ; 118 db $00,$00,$00,$88,$A8,$A8,$D8,$00 ; 119 db $00,$00,$00,$C8,$30,$60,$98,$00 ; 120 db $00,$00,$00,$88,$88,$78,$08,$70 ; 121 db $00,$00,$00,$F8,$30,$40,$F8,$00 ; 122 db $10,$20,$20,$40,$20,$20,$10,$00 ; 123 db $20,$20,$20,$20,$20,$20,$20,$00 ; 124 db $40,$20,$20,$10,$20,$20,$40,$00 ; 125 db $68,$90,$00,$00,$00,$00,$00,$00 ; 126 db $00,$20,$50,$50,$F8,$00,$00,$00 ; 127 db $00,$70,$88,$80,$80,$78,$20,$40 ; 128 db $50,$00,$88,$88,$88,$78,$00,$00 ; 129 db $10,$20,$00,$70,$98,$E0,$78,$00 ; 130 db $20,$50,$00,$78,$88,$98,$68,$00 ; 131 db $10,$20,$00,$70,$88,$F8,$88,$00 ; 132 db $40,$20,$00,$78,$88,$98,$68,$00 ; 133 db $00,$50,$00,$00,$00,$00,$00,$00 ; 134 db $00,$00,$78,$80,$80,$78,$20,$60 ; 135 db $20,$50,$00,$70,$98,$E0,$78,$00 ; 136 db $10,$20,$00,$70,$20,$20,$70,$00 ; 137 db $08,$10,$70,$88,$88,$88,$70,$00 ; 138 db $10,$20,$88,$88,$88,$88,$70,$00 ; 139 db $20,$50,$00,$70,$88,$F8,$88,$00 ; 140 db $20,$50,$F8,$80,$C0,$80,$F8,$00 ; 141 db $30,$48,$00,$70,$88,$88,$70,$00 ; 142 db $20,$10,$00,$70,$88,$F8,$88,$00 ; 143 db $08,$10,$F8,$80,$C0,$80,$F8,$00 ; 144 db $00,$00,$00,$D0,$68,$B0,$D8,$00 ; 145 db $00,$78,$A0,$B0,$E0,$A0,$B8,$00 ; 146 db $20,$50,$00,$70,$88,$88,$70,$00 ; 147 db $00,$50,$00,$70,$88,$88,$70,$00 ; 148 db $40,$20,$00,$70,$88,$88,$70,$00 ; 149 db $20,$50,$00,$88,$88,$88,$78,$00 ; 150 db $00,$40,$20,$88,$88,$88,$78,$00 ; 151 db $50,$00,$88,$88,$88,$78,$08,$70 ; 152 db $50,$00,$70,$88,$88,$88,$70,$00 ; 153 db $00,$50,$00,$88,$88,$88,$70,$00 ; 154 db $20,$20,$78,$A0,$A0,$78,$20,$20 ; 155 db $20,$50,$40,$E0,$40,$48,$B0,$00 ; 156 db $88,$88,$50,$F8,$20,$70,$20,$00 ; 157 db $80,$D0,$B0,$B0,$B8,$D0,$88,$80 ; 158 db $38,$40,$F0,$40,$F0,$40,$38,$00 ; 159 db $08,$10,$00,$78,$88,$98,$68,$00 ; 160 db $10,$20,$00,$60,$20,$20,$70,$00 ; 161 db $10,$20,$00,$70,$88,$88,$70,$00 ; 162 db $00,$10,$20,$88,$88,$88,$78,$00 ; 163 db $68,$90,$00,$F0,$88,$88,$88,$00 ; 164 db $68,$90,$00,$88,$C8,$A8,$98,$00 ; 165 db $00,$00,$78,$88,$98,$68,$00,$70 ; 166 db $00,$00,$70,$88,$88,$70,$00,$70 ; 167 db $20,$00,$20,$60,$80,$88,$70,$00 ; 168 db $00,$00,$00,$E0,$80,$00,$00,$00 ; 169 db $00,$00,$00,$E0,$20,$00,$00,$00 ; 170 db $40,$48,$50,$30,$48,$90,$38,$00 ; 171 db $40,$48,$50,$28,$58,$B8,$08,$00 ; 172 db $20,$00,$20,$20,$20,$20,$00,$00 ; 173 db $00,$00,$00,$48,$90,$48,$00,$00 ; 174 db $00,$00,$00,$90,$48,$90,$00,$00 ; 175 db $68,$90,$00,$70,$88,$F8,$88,$00 ; 176 db $68,$90,$00,$78,$88,$98,$68,$00 ; 177 db $68,$90,$00,$70,$20,$20,$70,$00 ; 178 db $68,$90,$00,$60,$20,$20,$70,$00 ; 179 db $68,$90,$00,$70,$88,$88,$70,$00 ; 180 db $68,$90,$00,$60,$90,$90,$60,$00 ; 181 db $68,$90,$00,$88,$88,$88,$70,$00 ; 182 db $68,$90,$00,$88,$88,$88,$78,$00 ; 183 db $FC,$48,$48,$48,$48,$E8,$08,$30 ; 184 db $48,$00,$D8,$48,$48,$E8,$08,$30 ; 185 db $E0,$68,$30,$E8,$58,$B8,$08,$00 ; 186 db $B0,$48,$00,$00,$00,$00,$00,$00 ; 187 db $00,$20,$50,$88,$50,$20,$00,$00 ; 188 db $00,$00,$90,$20,$40,$80,$28,$00 ; 189 db $7C,$A8,$A8,$A8,$68,$28,$28,$44 ; 190 db $70,$80,$70,$88,$70,$08,$88,$70 ; 191 db $00,$00,$00,$00,$00,$00,$FF,$FF ; 192 db $F0,$F0,$F0,$F0,$0F,$0F,$0F,$0F ; 193 db $00,$00,$FF,$FF,$FF,$FF,$FF,$FF ; 194 db $FF,$FF,$00,$00,$00,$00,$00,$00 ; 195 db $00,$00,$00,$3C,$3C,$00,$00,$00 ; 196 db $FF,$FF,$FF,$FF,$FF,$FF,$00,$00 ; 197 db $C0,$C0,$C0,$C0,$C0,$C0,$C0,$C0 ; 198 db $0F,$0F,$0F,$0F,$F0,$F0,$F0,$F0 ; 199 db $FC,$FC,$FC,$FC,$FC,$FC,$FC,$FC ; 200 db $03,$03,$03,$03,$03,$03,$03,$03 ; 201 db $3F,$3F,$3F,$3F,$3F,$3F,$3F,$3F ; 202 db $11,$22,$44,$88,$11,$22,$44,$88 ; 203 db $88,$44,$22,$11,$88,$44,$22,$11 ; 204 db $FE,$7C,$38,$10,$00,$00,$00,$00 ; 205 db $00,$00,$00,$00,$10,$38,$7C,$FE ; 206 db $80,$C0,$E0,$F0,$E0,$C0,$80,$00 ; 207 db $01,$03,$07,$0F,$07,$03,$01,$00 ; 208 db $FF,$7E,$3C,$18,$18,$3C,$7E,$FF ; 209 db $81,$C3,$E7,$FF,$FF,$E7,$C3,$81 ; 210 db $F0,$F0,$F0,$F0,$00,$00,$00,$00 ; 211 db $00,$00,$00,$00,$0F,$0F,$0F,$0F ; 212 db $0F,$0F,$0F,$0F,$00,$00,$00,$00 ; 213 db $00,$00,$00,$00,$F0,$F0,$F0,$F0 ; 214 db $33,$33,$CC,$CC,$33,$33,$CC,$CC ; 215 db $00,$10,$28,$28,$7C,$00,$00,$00 ; 216 db $10,$10,$38,$10,$38,$10,$10,$00 ; 217 db $00,$00,$50,$88,$A8,$50,$00,$00 ; 218 db $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF ; 219 db $00,$00,$00,$00,$FF,$FF,$FF,$FF ; 220 db $F0,$F0,$F0,$F0,$F0,$F0,$F0,$F0 ; 221 db $0F,$0F,$0F,$0F,$0F,$0F,$0F,$0F ; 222 db $FF,$FF,$FF,$FF,$00,$00,$00,$00 ; 223 db $00,$00,$68,$90,$90,$68,$00,$00 ; 224 db $60,$90,$E0,$90,$90,$E0,$80,$00 ; 225 db $F8,$88,$80,$80,$80,$80,$00,$00 ; 226 db $F8,$50,$50,$50,$50,$48,$80,$00 ; 227 db $F8,$48,$20,$40,$88,$F8,$00,$00 ; 228 db $00,$00,$78,$90,$88,$70,$00,$00 ; 229 db $00,$00,$88,$88,$C8,$B0,$80,$80 ; 230 db $00,$00,$50,$A0,$20,$20,$20,$00 ; 231 db $70,$20,$70,$A8,$A8,$70,$20,$70 ; 232 db $70,$88,$F8,$88,$88,$70,$00,$00 ; 233 db $70,$88,$88,$88,$50,$D8,$00,$00 ; 234 db $30,$40,$30,$48,$48,$30,$00,$00 ; 235 db $00,$00,$50,$A8,$A8,$50,$00,$00 ; 236 db $00,$10,$70,$A8,$A8,$70,$40,$00 ; 237 db $00,$70,$80,$E0,$80,$70,$00,$00 ; 238 db $70,$88,$88,$88,$88,$88,$00,$00 ; 239 db $00,$F8,$00,$F8,$00,$F8,$00,$00 ; 240 db $00,$20,$70,$20,$00,$70,$00,$00 ; 241 db $40,$20,$10,$20,$40,$00,$F8,$00 ; 242 db $10,$20,$40,$20,$10,$00,$F8,$00 ; 243 db $00,$18,$20,$20,$20,$20,$20,$20 ; 244 db $20,$20,$20,$20,$20,$20,$C0,$00 ; 245 db $00,$20,$00,$F8,$00,$20,$00,$00 ; 246 db $00,$68,$90,$00,$68,$90,$00,$00 ; 247 db $00,$30,$48,$48,$30,$00,$00,$00 ; 248 db $00,$30,$78,$78,$30,$00,$00,$00 ; 249 db $00,$00,$00,$00,$30,$00,$00,$00 ; 250 db $1C,$10,$10,$90,$50,$30,$10,$00 ; 251 db $E0,$90,$90,$00,$00,$00,$00,$00 ; 252 db $60,$10,$60,$F0,$00,$00,$00,$00 ; 253 db $00,$70,$70,$70,$70,$70,$70,$00 ; 254 db $AA,$55,$AA,$55,$AA,$55,$AA,$55 ; 255 cbios-0.28/src/main_msx2_br.asm0000644000000000000000000000412013137376076015123 0ustar rootroot; C-BIOS main ROM for a Brazillian MSX2 machine ; ; Copyright (c) 2005 Maarten ter Huurne. All rights reserved. ; Copyright (c) 2005 Joost Yervante Damad. All rights reserved. ; Copyright (C) 2005 BouKiCHi. All rights reserved. ; Copyright (C) 2008 Eric Boon. All rights reserved. ; ; Redistribution and use in source and binary forms, with or without ; modification, are permitted provided that the following conditions ; are met: ; 1. Redistributions of source code must retain the above copyright ; notice, this list of conditions and the following disclaimer. ; 2. Redistributions in binary form must reproduce the above copyright ; notice, this list of conditions and the following disclaimer in the ; documentation and/or other materials provided with the distribution. ; ; THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ; OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ; IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ; NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ; include "hardware.asm" VDP: equ V9938 MODEL_MSX: equ MODEL_MSX2 ; -- generic brazillian config (60Hz, US keyboard layout, BR variant charset) LOCALE_CHSET: equ LOCAL_CHSET_US LOCALE_CHSET_VAR: equ LOCAL_CHSET_VAR_BR LOCALE_DATE: equ LOCAL_DATE_DMY LOCALE_INT: equ LOCAL_INT_60HZ LOCALE_KBD: equ LOCAL_KBD_US LOCALE_BASIC: equ LOCAL_BASIC_US COLOR_FORE: equ 15 COLOR_BACK: equ 4 COLOR_BORDER: equ 4 CALL_SUB: equ YES include "main.asm" ; vim:ts=8:expandtab:filetype=z8a:syntax=z8a: cbios-0.28/src/font.png0000644000000000000000000000223513137376076013522 0ustar rootrootPNG  IHDR@ϓ;PLTEٟRIDATx-I&8qDli1p2e@d'l,NsЬ&0&"bUX%%z6]8jwc ˛_tk@\x\.UER.W3_i(t:^`//Uk}5,¼0#>*o5)H#,>%1_d'1pfX.) $N+̙#a&Qd&ɇZު*=FmȚ>[(e'Hg)b-"w&V٫Q4ФkYْ"X &Gd"dQT*wd/j($P{Ul|ߧ'185֛-QDHLqk!xt臂9xe26ȇ͍wइpN;(<.*XN2X`20dȄχ7U?Ì2@pj|9h @Xҹ?IS@_=.'s]54t K} YG ~>g^#fc-wܪW-Fhnҹuh|%z`W.}h]*(>nr#((L08Eo\#_"IENDB`cbios-0.28/src/hooks.asm0000644000000000000000000002325313137376076013676 0ustar rootroot; C-BIOS hook declarations ; ; Copyright (c) 2002-2003 BouKiCHi. All rights reserved. ; Copyright (c) 2003 Reikan. All rights reserved. ; Copyright (c) 2004 Maarten ter Huurne. All rights reserved. ; Copyright (c) 2004 Manuel Bilderbeek. All rights reserved. ; Copyright (c) 2004-2006 Joost Yervante Damad. All rights reserved. ; ; Redistribution and use in source and binary forms, with or without ; modification, are permitted provided that the following conditions ; are met: ; 1. Redistributions of source code must retain the above copyright ; notice, this list of conditions and the following disclaimer. ; 2. Redistributions in binary form must reproduce the above copyright ; notice, this list of conditions and the following disclaimer in the ; documentation and/or other materials provided with the distribution. ; ; THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ; OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ; IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ; NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ; ; called at start of interrupt subroutine, before it has been checked if ; the interrupt was from VDP; used by e.g. RS232 H_KEYI: equ $FD9A ; called at start of interrupt subroutine, when it is clear that ; the interrupt is from the VDP H_TIMI: equ $FD9F ; called at start of CHPUT(00A2) H_CHPU: equ $FDA4 ; called at start of the subroutine drawing the cursor H_DSPC: equ $FDA9 ; called at start of the subroutine that removes the cursor H_ERAC: equ $FDAE ; called at start of DSPFNK(00CF) H_DSPF: equ $FDB3 ; called at start of ERAFNK(00CC) H_ERAF: equ $FDB8 ; called at start of TOTEXT(00D2) H_TOTE: equ $FDBD ; called at start of CHGET(009F) H_CHGE: equ $FDC2 ; called at start of the subroutine that fills the pattern-table ; can be used to override the default ASCII patterns H_INIP: equ $FDC7 ; called at part of subroutine that decodes combined keystrokes ; like with CTRL/CODE/GRAPH/SHIFT to an ASCII code; can be used ; to override the working of the keyboard H_KEYC: equ $FDCC ; called at start of the subroutine that decodes single keystrokes; ; can be used to override the working of the keyboard H_KYEA: equ $FDD1 ; called at start of NMI interrupt subroutine H_NMI: equ $FDD6 ; called at start of PINLIN(00AE) H_PINL: equ $FDDB ; called at start of QINLIN(00B4) H_QINL: equ $FDE0 ; called at start of INLIN(00B1) H_INLI: equ $FDE5 ; BASIC interpreter hook H_ONGO: equ $FDEA ; implementation hook for DSKO$ H_DSKO: equ $FDEF ; implementation hook for SET H_SETS: equ $FDF4 ; implementation hook for NAME H_NAME: equ $FDF9 ; implementation hook for KILL H_KILL: equ $FDFE ; implementation hook for IPL H_IPL: equ $FE03 ; implementation hook for COPY H_COPY: equ $FE08 ; implementation hook for CMD H_CMD: equ $FE0D ; implementation hook for DSKF H_DSKF: equ $FE12 ; implementation hook for DSKI$ H_DSKI: equ $FE17 ; implementation hook for ATTR$ H_ATTR: equ $FE1C ; implementation hook for LSET H_LSET: equ $FE21 ; implementation hook for RSET H_RSET: equ $FE26 ; implementation hook for FIELD H_FIEL: equ $FE2B ; implementation hook for MKI$ H_MKIS: equ $FE30 ; implementation hook for MKS$ H_MKSS: equ $FE35 ; implementation hook for MKD$ H_MKDS: equ $FE3A ; implementation hook for CVI H_CVI: equ $FE3F ; implementation hook for CVS H_CVS: equ $FE44 ; implementation hook for CVD H_CVD: equ $FE49 ; called when looking up the value of PTRFIL(F864) for DISKBASIC H_GETP: equ $FE4E ; called when PTRFIL(F864) is being given a new value H_SETF: equ $FE53 ; called when an OPEN statement was issued without a FOR-part ; part of DISKBASIC H_NOFO: equ $FE58 ; called for an operation for file-buffer 0, in DISKBASIC H_NULO: equ $FE5D ; called from DISKBASIC for a call with file-buffer not 0 H_NTFL: equ $FE62 ; called when doing a MERGE command for disks H_MERG: equ $FE67 ; called when doing a SAVE commands for disks H_SAVE: equ $FE6C ; called when doing a BSAVE command for disks H_BINS: equ $FE71 ; called when doing a BLOAD command for disks H_BINL: equ $FE76 ; implementation hook for FILES H_FILE: equ $FE7B ; DISKBASIC hook H_DGET: equ $FE80 ; DISKBASIC hook H_FILO: equ $FE85 ; DISKBASIC hook H_INDS: equ $FE8A ; DISKBASIC entry for selecting the previous disk station for disk IO H_RSLF: equ $FE8F ; DISKBASIC entry for remembering the current disk station H_SAVD: equ $FE94 ; implementation hook for LOC H_LOC: equ $FE99 ; implementation hook for LOF G_LOF: equ $FE9E ; called when doing EOF for a disk in DISKBASIC H_EOF: equ $FEA3 ; implementation hook for FPOS H_FPOS: equ $FEA8 ; DISKBASIC hook H_BAKU: equ $FEAD ; called when BASIC interpreter is decoding the device part of a filename H_PARD: equ $FEB2 ; called when BASIC interpreter finds a file without a device part H_NODE: equ $FEB7 ; DISKBASIC hook H_POSD: equ $FEBC ; called when searching a device by name H_DEVN: equ $FEC1 ; BASIC interpreter hook H_GEND: equ $FEC6 ; Called when clearing variables during the preparation of a RUN statement. ; Also used by the disk ROM to start boot sequence. H_RUNC: equ $FECB ; called when doing CLEAR H_CLEA: equ $FED0 ; BASIC interpreter hook H_LOPD: equ $FED5 ; BASIC interpreter hook; called at stack error H_STKE: equ $FEDA ; called at the start of ISFLIO(014A) H_ISFL: equ $FEDF ; called at the start of OUTDO(0018) H_OUTD: equ $FEE4 ; BASIC interpreter hook H_CRDO: equ $FEE9 ; BASIC interpreter hook H_DSKC: equ $FEEE ; called at the end of a BASIC program H_PRGE: equ $FEF8 ; BASIC interpreter hook H_ERRP: equ $FEFD ; BASIC interpreter hook H_ERRF: equ $FF02 ; BASIC interpreter hook H_READ: equ $FF07 ; BASIC interpreter hook H_MAIN: equ $FF0C ; called when executing a BASIC statement in direct mode H_DIRD: equ $FF11 ; BASIC interpreter hook H_FINI: equ $FF16 ; BASIC interpreter hook H_FINE: equ $FF1B ; called while encoding a just typed BASIC statement H_CRUN: equ $FF20 ; called while encoding a just typed BASIC statement H_CRUS: equ $FF25 ; called when a keyword has been found while encoding a just typed ; BASIC statement H_ISRE: equ $FF2A ; called when a function has been found while encoding a just typed ; BASIC statement H_NTFN: equ $FF2F ; called when a non-keyword has been found while encoding a just ; typed BASIC statement H_NOTR: equ $FF34 ; BASIC interpreter hook H_SNGF: equ $FF39 ; BASIC interpreter hook H_NEWS: equ $FF3E ; BASIC interpreter hook H_GONE: equ $FF43 ; called at start of CHRGTR(0010) H_CHRG: equ $FF48 ; BASIC interpreter hook H_RETU: equ $FF4D ; BASIC interpreter hook H_PRTF: equ $FF52 ; BASIC interpreter hook H_COMP: equ $FF57 ; BASIC interpreter hook H_FINP: equ $FF5C ; BASIC interpreter hook H_TRMN: equ $FF61 ; BASIC interpreter hook H_FRME: equ $FF66 ; BASIC interpreter hook H_NTPL: equ $FF6B ; called when calculating the value of an expression in BASIC H_EVAL: equ $FF70 ; BASIC interpreter hook H_OKNO: equ $FF75 ; BASIC interpreter hook H_FING: equ $FF7A ; called when setting a value to a substring with MID$ H_ISMI: equ $FF7F ; called when executing the WIDTH statement H_WIDT: equ $FF84 ; called when executing the LIST statement H_LIST: equ $FF89 ; BASIC interpreter hook H_BUFL: equ $FF8E ; BASIC interpreter hook H_FRQI: equ $FF93 ; BASIC interpreter hook H_SCNE: equ $FF98 ; BASIC interpreter hook H_FRET: equ $FF9D ; called when looking up a variable in BASIC H_PTRG: equ $FFA2 ; called from within PHYDIO(0144), to allow its implementation H_PHYD: equ $FFA7 ; called from within FORMAT(147), to allow its implementation H_FORM: equ $FFAC ; called form the error-handling routine of the BASIC interpreter H_ERRO: equ $FFB1 ; called at start of LPTOUT(00A5) H_LPTO: equ $FFB6 ; called at start of LPTSTT(00A8) H_LPTS: equ $FFBB ; called when executing SCREEN H_SCRE: equ $FFC0 ; called when executing PLAY H_PLAY: equ $FFC5 ; allows for installation of expansion devices that contain extra OS subroutines H_BEXT: equ $FFCA ; vim:ts=8:expandtab:filetype=z8a:syntax=z8a: cbios-0.28/src/scancodes_uk.asm0000644000000000000000000000714213137376076015213 0ustar rootroot; Scan code tables UK keyboard for C-BIOS ; ; Copyright (c) 2008 Eric Boon. All rights reserved. ; ; Redistribution and use in source and binary forms, with or without ; modification, are permitted provided that the following conditions ; are met: ; 1. Redistributions of source code must retain the above copyright ; notice, this list of conditions and the following disclaimer. ; 2. Redistributions in binary form must reproduce the above copyright ; notice, this list of conditions and the following disclaimer in the ; documentation and/or other materials provided with the distribution. ; ; THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ; OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ; IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ; NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ; ; ------------------------------------- ; scan code tables scode_tbl: db "01234567" ;00 db "89-=",$5C,"[];" ;01 db "'",$9C,",./",$00,"ab" ;02 db "cdefghij" ;03 db "klmnopqr" ;04 db "stuvwxyz" ;05 scode_tbl_shift: db ")!@#$%^&" ;00 db "*(_+|{}:" ;01 db $22,"~<>?",$00,"AB" ;02 db "CDEFGHIJ" ;03 db "KLMNOPQR" ;04 db "STUVWXYZ" ;05 scode_tbl_graph: db $09,$AC,$AB,$BA,$EF,$BD,$F4,$FB ;00 db $EC,$07,$17,$F1,$1E,$01,$0D,$06 ;01 db $05,$BB,$F3,$F2,$1D,$00,$C4,$11 ;02 db $BC,$C7,$CD,$14,$15,$13,$DC,$C6 ;03 db $DD,$C8,$0B,$1B,$C2,$DB,$CC,$18 ;04 db $D2,$12,$C0,$1A,$CF,$1C,$19,$0F ;05 scode_tbl_shift_graph: db $0A,$00,$FD,$FC,$00,$00,$F5,$00 ;00 db $00,$08,$1F,$F0,$16,$02,$0E,$04 ;01 db $03,$F7,$AE,$AF,$F6,$00,$FE,$00 ;02 db $FA,$C1,$CE,$D4,$10,$D6,$DF,$CA ;03 db $DE,$C9,$0C,$D3,$C3,$D7,$CB,$A9 ;04 db $D1,$00,$C5,$D5,$D0,$F9,$AA,$F8 ;05 scode_tbl_code: db $EB,$9F,$D9,$BF,$9B,$98,$E0,$E1 ;00 db $E7,$87,$EE,$E9,$60,$ED,$DA,$B7 ;01 db $B9,$E5,$86,$A6,$A7,$00,$84,$97 ;02 db $8D,$8B,$8C,$94,$81,$B1,$A1,$91 ;03 db $B3,$B5,$E6,$A4,$A2,$A3,$83,$93 ;04 db $89,$96,$82,$95,$88,$8A,$A0,$85 ;05 scode_tbl_shift_code: db $D8,$AD,$9E,$BE,$9C,$9D,$00,$00 ;00 db $E2,$80,$00,$00,$00,$E8,$EA,$B6 ;01 db $B8,$E4,$8F,$00,$A8,$00,$8E,$00 ;02 db $00,$00,$00,$99,$9A,$B0,$00,$92 ;03 db $B2,$B4,$00,$A5,$00,$E3,$00,$00 ;04 db $00,$00,$90,$00,$00,$00,$00,$00 ;05 ; vim:ts=8:expandtab:filetype=z8a:syntax=z8a:cbios-0.28/src/slot.asm0000644000000000000000000003440113137376076013531 0ustar rootroot;------------------------------------- ; 000Ch RDSLT ; Reads a value from an address in another slot. ; Input: A = slot ID: E000SSPP ; HL = address to read ; Output: A = value read ; Interrupts disabled. ; Changes: F, C, DE rdslt: push bc push hl push af ld d,a ; init D in case call is not made and a ; expanded slot? di call m,select_subslot pop af pop hl push hl ; HL = address push de ; D = slot ID, E = saved SSL push hl ; HL = address push af ; A = slot ID ld a,h rlca rlca and $03 ld l,a ; L = page number ld b,a ld a,$FC call rdsft ld e,a ; E = mask (shifted) ld b,l ; B = page number pop af ; A = slot ID and $03 call rdsft ld b,a ; B = primary slot (shifted) in a,(PSL_STAT) ld d,a ; D = primary slot select for restore and e or b ; A = primary slot select for read pop hl ; HL = address call rdprim ld a,e pop de ; D = slot ID, E = saved SSL push af ; A = value read bit 7,d ; expanded slot? call nz,restore_subslot pop af ; A = value read pop hl ; HL = address pop bc ret rdsft: inc b dec b ret z rdsft_lp: rlca rlca djnz rdsft_lp ret ;------------------------------------- ; $0014 WRSLT ; Writes a value to an address in another slot. ; Input: A = slot ID: E000SSPP ; HL = address to write ; E = value to write ; Output: Interrupts disabled. ; Changes: AF, BC, D wrslt: push hl ld d,a ; D = slot ID push de and a ; expanded slot? di call m,select_subslot pop bc ; B = slot ID, C = data pop hl push de ; D = slot ID, E = saved SSL push hl ; HL = address ld a,h rlca rlca and $03 ld l,a ; L = page number ld b,a ; B = page number ld a,$FC call rdsft ld e,a ; E = mask (shifted) ld b,l ; B = page number ld a,d and $03 ; A = 000000PP call rdsft ld b,a ; B = primary slot (shifted) in a,(PSL_STAT) ld d,a ; D = primary slot select for restore and e or b ; A = primary slot select for write pop hl ; HL = address ld e,c ; E = data call wrprim pop de ; D = slot ID, E = saved SSL push hl ; HL = address bit 7,d ; expanded slot? call nz,restore_subslot pop hl ret ;------------------------------------- ; $001C CALSLT ; Function : Executes inter-slot call. ; Input : IY - High byte with input for A in RDSLT ; IX - The address that will be called ; Remark : Variables can never be given in alternative registers ; of the Z-80 or IX and IY calslt: ex af,af' exx ; Select secondary slot of target: ; Note: This approach fails if target is in page 0 of slot 0.1, 0.2 or 0.3. ; TODO: Put slot 0 specific routine in page 3, on the stack if necessary. di push iy pop af ; A = slot ID: E000SSPP push ix pop hl ; HL = address to call ld d,a ; init D in case call is not made and a ; expanded slot? call m,select_subslot push de ; D = slot ID, E = saved SSL ; Calculate primary slot select value: ld a,d ; A = slot ID: E000SSPP and $03 ld b,a ; B = primary slot ld c,$FC ; C = mask ; Calculate page that contains call address. push ix pop af ; A = high byte call address rlca rlca and $03 ; A = page ; Shift B and C page*2 positions to the left. add a,a jr z,calslt_sh2 calslt_sh1: rlc b rlc c dec a jr nz,calslt_sh1 calslt_sh2: ; Select primary slot of target and perform call: ld hl,calslt_restore push hl in a,(PSL_STAT) push af and c ; C = mask (shifted) or b ; B = primary slot (shifted) exx jp clprim calslt_restore: ex af,af' exx ; Restore secondary slot: di pop de ; D = slot ID, E = saved SSL bit 7,d ; expanded slot? call nz,restore_subslot ; Done: ex af,af' exx ret ;------------------------------------- ; $0024 ENASLT ; Selects a slot in the page specified by an address. ; Input: A = slot ID: ExxxSSPP ; E = expanded flag ; SS = secondary slot number (only if expanded) ; PP = primary slot number ; HL = address inside the page to change ; Output: Interrupts disabled. ; Changes: AF, BC, DE enaslt: ; A=(A >> 6)&0x3 di push hl ld l,a ; L = ExxxSSPP and $03 ; A = 000000PP ld b,a ld a,$AB psl_dup_lp: add a,$55 dec b jp p,psl_dup_lp ld d,a ; D = PP PP PP PP ld a,h rlca rlca and $03 ld h,a ; H = page number (0-3) ld b,a ld a,$C0 page_msk_lp: rlca rlca dec b jp p,page_msk_lp ld e,a ; E = page mask (00 00 00 11 << page) cpl ld c,a ; C = page mask complement ld a,d and e ld b,a ; B = 00 00 00 PP << page ld a,l and a jp p,chg_psl ;SSL-Change rrca rrca and $03 ; A = 000000SS push hl push bc ld b,a ld a,$AB ssl_dup_lp: add a,$55 dec b jp p,ssl_dup_lp and e ld b,a ; B = 00 00 00 SS << page ld a,d and $C0 ld h,a in a,(PSL_STAT) ld l,a and $C0 or h out (PSL_STAT),a ld a,(SSL_REGS) cpl and c ; preserve other pages or b ld c,a ld (SSL_REGS),a ld a,l out (PSL_STAT),a ; (SLTTBL + PP) <- RegC ld hl,SLTTBL ld a,d and $03 ; A = 000000PP add a,l ld l,a ; L = L + A ld a,h adc a,0 ld h,a ; H = H + Cy ld a,c ld (hl),a pop bc pop hl chg_psl: in a,(PSL_STAT) and c or b out (PSL_STAT),a pop hl ret ;-------------------------------- ; Select subslot. ; Input: A = slot ID: E000SSPP ; HL = address which specifies page to select ; (actually, only the highest 2 bits of H are relevant) ; Output: D = slot ID (same as input) ; E = original value of secondary slot select register ; SLTTBL[slot] = new value of secondary slot select register ; Changes: AF, HL, BC ; Note: Interrupts must be disabled before calling this routine. select_subslot: ; Select primary slot of target in page 3. ; Note: Stack is unavailable until primary slot is restored. ld d,a ; D = E000SSPP rrca rrca ld e,a ; E = PPE000SS and $C0 ld l,a ; L = PP000000 in a,(PSL_STAT) ld c,a ; C = saved PSL and $3F or l out (PSL_STAT),a ; Shift mask and subslot according to page. ld a,e ; A = PPE000SS and $03 ld l,a ; L = subslot ld a,h ; A = high byte of address ld h,$03 ; H = mask jr select_subslot_next select_subslot_lp: add hl,hl ; Shift 2 bits to the left. add hl,hl select_subslot_next: sub $40 ; Subtract 1 page. jr nc,select_subslot_lp ld a,h cpl ld h,a ; Select secondary slot of target. ld a,(SSL_REGS) cpl ld e,a ; E = saved SSL and h ; H = mask (shifted) or l ; L = subslot (shifted) ld (SSL_REGS),a ld l,a ; L = value written to SSL_REGS ; Restore original primary slot in page 3. ld a,c out (PSL_STAT),a ; Update SLTTBL. ld a,d and $03 ; A = 000000SS ld c,a ld b,0 ld a,l ; A = value written to SSL_REGS ld hl,SLTTBL add hl,bc ld (hl),a ret ;-------------------------------- ; Restore subslot, companion routine to select_subslot. ; Input: D = slot ID: E000SSPP ; E = original value of secondary slot select register ; Output: SLTTBL[slot] = original value of secondary slot select register ; Changes: AF, HL, BC ; Note: Interrupts must be disabled before calling this routine. restore_subslot: ; Select primary slot of target in page 3. ; Note: Stack is unavailable until primary slot is restored. ld a,d rrca rrca and $C0 ld b,a ; B = PP000000 in a,(PSL_STAT) ld c,a ; C = saved PSL and $3F or b out (PSL_STAT),a ; Restore secondary slot. ld a,e ld (SSL_REGS),a ; Restore original primary slot in page 3. ld a,c out (PSL_STAT),a ; Update SLTTBL. ld a,d and $03 ; A = 000000SS ld c,a ld b,0 ld hl,SLTTBL add hl,bc ld (hl),e ret ;-------------------------------- m_rdprim: out (PSL_STAT),a ld e,(hl) jr m_wrprm1 m_wrprim: out (PSL_STAT),a ld (hl),e m_wrprm1: ld a,d out (PSL_STAT),a ret m_clprim: out (PSL_STAT),a ex af,af' call cl_jp ex af,af' pop af out (PSL_STAT),a ex af,af' ret m_cl_jp: jp (ix) m_prim_end: nop rdprim: equ $F380 wrprim: equ rdprim+(m_wrprim-m_rdprim) clprim: equ rdprim+(m_clprim-m_rdprim) cl_jp: equ rdprim+(m_cl_jp-m_rdprim) ; vim:ts=8:expandtab:filetype=z8a:syntax=z8a: cbios-0.28/src/scancodes_fr.asm0000644000000000000000000000715313137376076015205 0ustar rootroot; Scan code tables FR (french) keyboard for C-BIOS ; ; Copyright (c) 2008 Eric Boon. All rights reserved. ; ; Redistribution and use in source and binary forms, with or without ; modification, are permitted provided that the following conditions ; are met: ; 1. Redistributions of source code must retain the above copyright ; notice, this list of conditions and the following disclaimer. ; 2. Redistributions in binary form must reproduce the above copyright ; notice, this list of conditions and the following disclaimer in the ; documentation and/or other materials provided with the distribution. ; ; THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ; OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ; IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ; NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ; ; ------------------------------------- ; scan code tables scode_tbl: db $85,"&",$82,$22,"'(",$BF,$8A ;00 db "!",$87,")-<",$00,"$m" ;01 db $97,"#;:=",$00,"qb" ;02 db "cdefghij" ;03 db "kl,nopar" ;04 db "stuvzxyw" ;05 scode_tbl_shift: db "01234567" ;00 db "89",$F8,"_>",$00,"*M" ;01 db "%",$9C,"./+",$00,"QB" ;02 db "CDEFGHIJ" ;03 db "KL?NOPAR" ;04 db "STUVZXYW" ;05 scode_tbl_graph: db $09,$AC,$AB,$BA,$BB,$EF,$F4,$FB ;00 db $EC,$07,$01,$17,$AE,$00,$0D,$06 ;01 db $05,$BB,$F6,$1E,$F1,$00,$C4,$11 ;02 db $BC,$C7,$CD,$14,$15,$13,$DC,$C6 ;03 db $DD,$C8,$0B,$1B,$C2,$DB,$CC,$18 ;04 db $D2,$12,$C0,$1A,$CF,$1C,$19,$0F ;05 scode_tbl_shift_graph: db $0A,$16,$FD,$FC,$F7,$00,$F5,$00 ;00 db $00,$08,$02,$1F,$AF,$00,$0E,$04 ;01 db $03,$00,$00,$1D,$F0,$00,$FE,$00 ;02 db $FA,$C1,$CE,$D4,$10,$D6,$DF,$CA ;03 db $DE,$C9,$0C,$D3,$C3,$D7,$CB,$A9 ;04 db $D1,$D9,$C5,$D5,$D0,$F9,$AA,$00 ;05 scode_tbl_code: db $EB,$7C,$40,$E0,$60,$7B,$5E,$EE ;00 db $E7,$E9,$7D,$ED,$F3,$00,$9B,$B7 ;01 db $B9,$E5,$86,$A6,$A7,$00,$84,$E1 ;02 db $8D,$8B,$8C,$94,$81,$B1,$A1,$91 ;03 db $B3,$B5,$E6,$A4,$A2,$A3,$83,$93 ;04 db $89,$96,$98,$95,$88,$9F,$A0,$DA ;05 scode_tbl_shift_code: db $D8,$AD,$90,$9E,$00,$5B,$BE,$7E ;00 db $E2,$80,$5D,$E8,$F2,$00,$00,$B6 ;01 db $B8,$E4,$8F,$5C,$00,$00,$8E,$00 ;02 db $00,$00,$00,$99,$9A,$B0,$00,$92 ;03 db $B2,$B4,$A8,$A5,$00,$E3,$00,$00 ;04 db $00,$00,$00,$00,$00,$00,$9D,$EA ;05 ; vim:ts=8:expandtab:filetype=z8a:syntax=z8a:cbios-0.28/src/main_msx1.asm0000644000000000000000000000407313137376076014446 0ustar rootroot; C-BIOS main ROM for a European MSX1 machine ; ; Copyright (c) 2005 Maarten ter Huurne. All rights reserved. ; Copyright (c) 2005 Joost Yervante Damad. All rights reserved. ; Copyright (C) 2005 BouKiCHi. All rights reserved. ; Copyright (C) 2008 Eric Boon. All rights reserved. ; ; Redistribution and use in source and binary forms, with or without ; modification, are permitted provided that the following conditions ; are met: ; 1. Redistributions of source code must retain the above copyright ; notice, this list of conditions and the following disclaimer. ; 2. Redistributions in binary form must reproduce the above copyright ; notice, this list of conditions and the following disclaimer in the ; documentation and/or other materials provided with the distribution. ; ; THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ; OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ; IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ; NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ; include "hardware.asm" VDP: equ TMS99X8 MODEL_MSX: equ MODEL_MSX1 ; -- generic european config (50Hz, US keyboard layout) LOCALE_CHSET: equ LOCAL_CHSET_US LOCALE_CHSET_VAR: equ LOCAL_CHSET_VAR_NONE LOCALE_DATE: equ LOCAL_DATE_DMY LOCALE_INT: equ LOCAL_INT_50HZ LOCALE_KBD: equ LOCAL_KBD_US LOCALE_BASIC: equ LOCAL_BASIC_US COLOR_FORE: equ 15 COLOR_BACK: equ 4 COLOR_BORDER: equ 4 CALL_SUB: equ NO include "main.asm" ; vim:ts=8:expandtab:filetype=z8a:syntax=z8a: cbios-0.28/src/test.bas0000644000000000000000000000003513137376076013510 0ustar rootroot III Icbios-0.28/src/main_msx2_jp.asm0000644000000000000000000000402713137376076015137 0ustar rootroot; C-BIOS main ROM for a Japanese MSX2 machine ; ; Copyright (c) 2005 Maarten ter Huurne. All rights reserved. ; Copyright (c) 2005 Joost Yervante Damad. All rights reserved. ; Copyright (C) 2005 BouKiCHi. All rights reserved. ; Copyright (C) 2008 Eric Boon. All rights reserved. ; ; Redistribution and use in source and binary forms, with or without ; modification, are permitted provided that the following conditions ; are met: ; 1. Redistributions of source code must retain the above copyright ; notice, this list of conditions and the following disclaimer. ; 2. Redistributions in binary form must reproduce the above copyright ; notice, this list of conditions and the following disclaimer in the ; documentation and/or other materials provided with the distribution. ; ; THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ; OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ; IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ; NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ; include "hardware.asm" VDP: equ V9938 MODEL_MSX: equ MODEL_MSX2 ; -- japanese config LOCALE_CHSET: equ LOCAL_CHSET_JP LOCALE_CHSET_VAR: equ LOCAL_CHSET_VAR_NONE LOCALE_DATE: equ LOCAL_DATE_YMD LOCALE_INT: equ LOCAL_INT_60HZ LOCALE_KBD: equ LOCAL_KBD_JP LOCALE_BASIC: equ LOCAL_BASIC_JP COLOR_FORE: equ 15 COLOR_BACK: equ 4 COLOR_BORDER: equ 7 CALL_SUB: equ YES include "main.asm" ; vim:ts=8:expandtab:filetype=z8a:syntax=z8a: cbios-0.28/src/logo.png0000644000000000000000000000234713137376076013520 0ustar rootrootPNG  IHDRd*1IDATxR:Q57WwX55U˻q ily>&H_@O & h & h & h & h & h & h & h & h & h ߮~|_;@4MD@A,o?]} qW|h7ƸP=&N;@yвƿ7/*yRj`sv@NW]fK9?J ưՍ*y.iQ@*p:'@nvը ]ˇƇ\ UVy4N; o~*[T[}e8Eѫc~C Eǿe.X]i6(G R|=Lݳ1,D=KoUZf!em^~?oGcGF<؅mb CX5t:Ͻ,H7c<:"q_=Ge/d}=.~b=6Ճh:mj yXl :.?w h & h & h & h & h & h & h & h & h & h & h & h & h & h & h & h & h & h & h & h & h & h okIENDB`cbios-0.28/src/inlin.asm0000644000000000000000000002141513137376076013662 0ustar rootroot; INLIN/PINLIN/QINLIN routines for C-BIOS ; ; Copyright (c) 2007 Eric Boon. All rights reserved. ; ; Redistribution and use in source and binary forms, with or without ; modification, are permitted provided that the following conditions ; are met: ; 1. Redistributions of source code must retain the above copyright ; notice, this list of conditions and the following disclaimer. ; 2. Redistributions in binary form must reproduce the above copyright ; notice, this list of conditions and the following disclaimer in the ; documentation and/or other materials provided with the distribution. ; ; THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ; OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ; IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ; NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ; ;-------------------------------- ; $00AE PINLIN ; Function : Stores in the specified buffer the character codes input ; until the return key or STOP key is pressed ; Output : HL - for the starting address of the buffer -1 ; C-flag set when it ends with the STOP key ; Registers: All ; TODO: call H_PINL pinlin: call H_PINL ld a,(AUTFLG) ; If AUTO is active and a jp z,inlin ; then start line input ld a,1 ; else set cursor ld (CSRX),a ; to left border first jp inlin ; and then start line input ;-------------------------------- ; $00B4 QINLIN ; Function : Prints a questionmark and one space and continues with INLIN ; Output : HL - for the starting address of the buffer -1 ; C-flag set when it ends with the STOP key ; Registers: All qinlin_prompt: db "? ",0 qinlin: call H_QINL ld hl,qinlin_prompt call prn_text ; continue with inlin ;-------------------------------- ; $00B1 INLIN ; Function : Main line input routine ; Output : HL - for the starting address of the buffer -1 ; C-flag set when it ends with the STOP key ; Registers: All inlin: ld hl,(CSRX) ; loads CSRX and CSRY ld (FSTPOS),hl ; save in FSTPOS ld de,LINTTB-2 ; break logical line ld h,0 ; above cursor pos ld a,l add hl,de ld (hl),a inlin_loop: call chget ; get a character from the kbd cp $7F jp z,inlin_del cp $20 jr nc,inlin_printable ld b,20 ld hl,inlin_table call jump_table xor a ; we just put out a ctrl char ld (INSFLG),a ; switch insert mode off ld (CSTYLE),a jr inlin_loop inlin_printable: ; else... push af ld a,(INSFLG) and a call nz,inlin_insert pop af rst $18 jr inlin ; ---------------------------------------------- inlin_insert: call chput_remove_cursor ld hl,(CSRY) ; save cursorpos ld (TEMP2),hl ld a,' ' ; oldchar = space ld (TEMP),a inlin_insert_loop: ; REPEAT call curs2hl ; get char under curpos call rdvrm cp ' ' ; IF is space jr nz,inlin_insert_cont ld hl,(CSRY) ; AND at end of line ld a,(LINLEN) cp h jr nz,inlin_insert_cont1 ld h,0 ; AND logical line does ld de,LINTTB-1 ; not continue add hl,de ld a,(hl) or a jr z,inlin_insert_cont1 ld a,(TEMP) ; THEN call curs2hl call wrtvrm ; put old char ld hl,(TEMP2) ; restore cursor pos ld (CSRY),hl ret jp chput_restore_cursor ; and exit inlin_insert_cont1: ld a,' ' inlin_insert_cont: push af ; ELSE ld a,(TEMP) ; put old char rst $18 pop af ld (TEMP),a ; oldchar = character read jr inlin_insert_loop ; ENDREP ; ---------------------------------------------- inlin_wback: ret ; ---------------------------------------------- inlin_break: scf ; C pop hl ; do not return to INLIN ret ; but to caller of INLIN ; ---------------------------------------------- inlin_clear: ret ; ---------------------------------------------- inlin_wfwd: ret ; ---------------------------------------------- inlin_bs: ret ; ---------------------------------------------- inlin_cr: ret ; ---------------------------------------------- inlin_end: xor a ; NZ, NC pop hl ; do not return to INLIN ret ; but to caller of INLIN ; ---------------------------------------------- inlin_ins: ret ; ---------------------------------------------- inlin_clrlin: ret ; -- ESCAPE inlin_esc: ret ; Do nothing ; -- DELETE inlin_del: ret ; -- Jump table. Control chars not handled in one of the routines above ; are simply forwarded to OUTDO inlin_table: dw $0018 ; @ dw $0018 ; A - dw inlin_wback ; B word back dw inlin_break ; C stop, abort, quit dw $0018 ; D dw inlin_clear ; E: clear to end of line dw inlin_wfwd ; F: word fwd dw $0018 ; G dw inlin_bs ; H BACKSP: erase char left dw $0018 ; I dw $0018 ; J dw $0018 ; K dw $0018 ; L dw inlin_cr ; M ENTER : confirm, yes, ok dw inlin_end ; N to end of line dw $0018 ; O dw $0018 ; P dw $0018 ; Q dw inlin_ins ; R INSERT: toggle insert mode dw $0018 ; S dw $0018 ; T dw inlin_clrlin ; U clear line dw $0018 ; V dw $0018 ; W dw $0018 ; X dw $0018 ; Y dw $0018 ; Z dw inlin_esc ; ESCAPE: ignore dw $0018 ; (28) dw $0018 ; (29) dw $0018 ; (30) dw $0018 ; (31) ; vim:ts=8:expandtab:filetype=z8a:syntax=z8a: cbios-0.28/src/scancodes_us.asm0000644000000000000000000000716013137376076015223 0ustar rootroot; Scan code tables US International keyboard for C-BIOS ; ; Copyright (c) 2008 Eric Boon. All rights reserved. ; ; Redistribution and use in source and binary forms, with or without ; modification, are permitted provided that the following conditions ; are met: ; 1. Redistributions of source code must retain the above copyright ; notice, this list of conditions and the following disclaimer. ; 2. Redistributions in binary form must reproduce the above copyright ; notice, this list of conditions and the following disclaimer in the ; documentation and/or other materials provided with the distribution. ; ; THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ; OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ; IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ; NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ; ; ------------------------------------- ; scan code tables scode_tbl: db "01234567" ;00 db "89-=",$5C,"[];" ;01 db "'`,./",$00,"ab" ;02 db "cdefghij" ;03 db "klmnopqr" ;04 db "stuvwxyz" ;05 scode_tbl_shift: db ")!@#$%^&" ;00 db "*(_+|{}:" ;01 db $22,"~<>?",$00,"AB" ;02 db "CDEFGHIJ" ;03 db "KLMNOPQR" ;04 db "STUVWXYZ" ;05 scode_tbl_graph: db $09,$AC,$AB,$BA,$EF,$BD,$F4,$FB ;00 db $EC,$07,$17,$F1,$1E,$01,$0D,$06 ;01 db $05,$BB,$F3,$F2,$1D,$00,$C4,$11 ;02 db $BC,$C7,$CD,$14,$15,$13,$DC,$C6 ;03 db $DD,$C8,$0B,$1B,$C2,$DB,$CC,$18 ;04 db $D2,$12,$C0,$1A,$CF,$1C,$19,$0F ;05 scode_tbl_shift_graph: db $0A,$00,$FD,$FC,$00,$00,$F5,$00 ;00 db $00,$08,$1F,$F0,$16,$02,$0E,$04 ;01 db $03,$F7,$AE,$AF,$F6,$00,$FE,$00 ;02 db $FA,$C1,$CE,$D4,$10,$D6,$DF,$CA ;03 db $DE,$C9,$0C,$D3,$C3,$D7,$CB,$A9 ;04 db $D1,$00,$C5,$D5,$D0,$F9,$AA,$F8 ;05 scode_tbl_code: db $EB,$9F,$D9,$BF,$9B,$98,$E0,$E1 ;00 db $E7,$87,$EE,$E9,$00,$ED,$DA,$B7 ;01 db $B9,$E5,$86,$A6,$A7,$00,$84,$97 ;02 db $8D,$8B,$8C,$94,$81,$B1,$A1,$91 ;03 db $B3,$B5,$E6,$A4,$A2,$A3,$83,$93 ;04 db $89,$96,$82,$95,$88,$8A,$A0,$85 ;05 scode_tbl_shift_code: db $D8,$AD,$9E,$BE,$9C,$9D,$00,$00 ;00 db $E2,$80,$00,$00,$00,$E8,$EA,$B6 ;01 db $B8,$E4,$8F,$00,$A8,$00,$8E,$00 ;02 db $00,$00,$00,$99,$9A,$B0,$00,$92 ;03 db $B2,$B4,$00,$A5,$00,$E3,$00,$00 ;04 db $00,$00,$90,$00,$00,$00,$00,$00 ;05 ; vim:ts=8:expandtab:filetype=z8a:syntax=z8a:cbios-0.28/src/logo.asm0000644000000000000000000015617313137376076013523 0ustar rootroot; C-BIOS logo ROM ; ; Copyright (c) 2004-2005 Maarten ter Huurne. All rights reserved. ; Copyright (c) 2004-2005 Albert Beevendorp. All rights reserved. ; ; Redistribution and use in source and binary forms, with or without ; modification, are permitted provided that the following conditions ; are met: ; 1. Redistributions of source code must retain the above copyright ; notice, this list of conditions and the following disclaimer. ; 2. Redistributions in binary form must reproduce the above copyright ; notice, this list of conditions and the following disclaimer in the ; documentation and/or other materials provided with the distribution. ; ; THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ; OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ; IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ; NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ; include "systemvars.asm" ; logo_ident: db "C-BIOS Logo ROM",$FF logo_show: IF VDP = TMS99X8 call $6f ld a,5 ld (BAKCLR),a ld (BDRCLR),a call $62 ld hl,(NAMBAS) ld bc,768 ld a,$00 call $56 ; Set up SCREEN 2 mirrored ld bc,0 +256* 2 call $47 ld bc,3 +256* 159 call $47 ld bc,4 +256* 0 call $47 ; Fill the color table ld a,(FORCLR) and 15 rlca rlca rlca rlca ld b,a ld a,(BAKCLR) and 15 or b ld bc,2048 ld hl,(GRPCOL) call $56 ld hl,(CGPBAS) ld bc,8 * logo_patoffset add hl,bc ex de,hl ld bc,8 * logo_npatterns ld hl,logo_patterns call $5c ld hl,(CGPBAS) ld bc,8 * 32 add hl,bc ex de,hl ld hl,(4) add hl,bc ld bc,8 * 96 call $5c ld hl,(GRPCOL) ld bc,8 * logo_patoffset add hl,bc ex de,hl ld bc,8 * logo_ncolors ld hl,logo_colors call $5c ld hl,(GRPCOL) ld de,8 * 32 add hl,de ld bc,8 * 96 ld a,$f1 call $56 ld hl,(NAMBAS) ld bc,logo_namoffset add hl,bc ex de,hl ld hl,logo_names ld b,logo_height plot_logo_nam: push bc push hl push de ld bc,logo_width call $5c pop hl ; value of DE ld bc,32 add hl,bc ex de,hl pop hl ; value of HL ld bc,logo_width add hl,bc pop bc djnz plot_logo_nam ret ; logo_patoffset: equ 128 logo_namoffset: equ 4 *32+ 4 ; Y *32+ 4 ; logo_patterns: db $00,$00,$00,$00,$00,$00,$00,$00 logo_patlength: equ $ - logo_patterns db $00,$00,$00,$00,$00,$00,$FE,$F8 db $00,$00,$FE,$F8,$1F,$7F,$00,$00 db $FE,$3F,$00,$00,$00,$00,$00,$00 db $00,$00,$00,$00,$00,$00,$00,$00 db $1F,$00,$00,$00,$00,$00,$00,$00 db $00,$00,$1F,$F8,$FE,$00,$00,$00 db $00,$00,$00,$00,$00,$7F,$1F,$F0 db $00,$00,$00,$00,$FE,$FC,$F8,$F0 db $1F,$3F,$7F,$00,$00,$00,$00,$00 db $00,$00,$00,$00,$FE,$FC,$F8,$F0 db $00,$F8,$1F,$7F,$00,$00,$00,$00 db $00,$00,$00,$00,$00,$00,$00,$00 db $00,$1F,$F8,$FE,$00,$00,$00,$00 db $00,$00,$00,$00,$00,$7F,$3F,$1F db $F8,$FC,$FE,$00,$00,$00,$00,$00 db $00,$00,$00,$00,$7F,$3F,$1F,$F0 db $00,$00,$00,$00,$00,$00,$FE,$FE db $1F,$3F,$7F,$7F,$00,$00,$00,$00 db $00,$00,$00,$00,$00,$FE,$FE,$FC db $1F,$3F,$7F,$00,$00,$00,$00,$00 db $F8,$F8,$F8,$F8,$F0,$F0,$F0,$F0 db $1F,$1F,$1F,$1F,$3F,$3F,$3F,$3F db $F8,$F8,$F8,$F8,$00,$00,$00,$00 db $F8,$F8,$F0,$F0,$F0,$1F,$1F,$1F db $00,$00,$00,$00,$00,$00,$00,$00 db $F8,$F8,$F0,$F0,$F0,$1F,$1F,$1F db $F0,$F0,$F0,$F0,$1F,$1F,$1F,$1F db $3F,$C7,$DF,$00,$00,$F8,$F0,$1F db $00,$00,$00,$00,$00,$00,$00,$00 db $00,$00,$00,$00,$F8,$00,$00,$00 db $00,$1F,$F8,$FC,$FE,$00,$7F,$3F db $FE,$FE,$FE,$FE,$FC,$FC,$FC,$7C db $F0,$F0,$F0,$F0,$1F,$1F,$1F,$1F db $00,$00,$FC,$F8,$1F,$3F,$7F,$FE db $1F,$00,$00,$00,$F0,$7F,$00,$00 db $1F,$FC,$00,$00,$00,$1F,$F0,$F8 db $00,$00,$00,$7F,$3F,$1F,$1F,$F0 db $FE,$F8,$F0,$1F,$7F,$7C,$FC,$F8 db $3F,$3F,$7F,$7F,$7F,$7F,$7F,$7F db $00,$00,$00,$00,$00,$00,$00,$00 db $3F,$3F,$7F,$7F,$7F,$7F,$7F,$7F db $1F,$1F,$1F,$1F,$3F,$3F,$3F,$3F db $3F,$7F,$7F,$7F,$00,$00,$00,$00 db $1F,$F0,$F8,$F8,$F8,$F8,$F8,$F8 db $7C,$3C,$3C,$3C,$C7,$C7,$C7,$C7 db $1F,$1E,$E3,$E3,$C7,$C7,$C7,$C7 db $FC,$F8,$F0,$F0,$1F,$3F,$3F,$3F db $FC,$FE,$00,$00,$00,$00,$00,$00 db $F0,$F8,$F8,$F8,$F8,$F8,$F8,$F8 db $F8,$F8,$F8,$F8,$F8,$FE,$7F,$3F db $00,$00,$00,$00,$00,$00,$00,$00 db $00,$00,$00,$00,$00,$00,$7F,$1F db $00,$00,$00,$00,$00,$00,$00,$00 db $3F,$3F,$3F,$3F,$7E,$7E,$7E,$7E db $F8,$F8,$F8,$F0,$1F,$1F,$3F,$7E db $C7,$C7,$C7,$C7,$F0,$F0,$F0,$F0 db $C7,$C7,$C7,$C7,$78,$78,$78,$7C db $3F,$3F,$3F,$3F,$3F,$3F,$1F,$F0 db $00,$00,$00,$FE,$FC,$FC,$F8,$F0 db $F8,$F8,$F8,$F8,$F0,$F0,$1F,$1F db $1F,$F8,$00,$00,$00,$00,$00,$00 db $00,$00,$00,$00,$00,$00,$00,$00 db $00,$00,$FE,$00,$00,$00,$00,$00 db $F0,$F8,$FC,$7C,$7C,$7C,$7C,$7C db $00,$00,$00,$7F,$7F,$7F,$3F,$3F db $00,$00,$00,$00,$00,$00,$00,$00 db $00,$00,$00,$7F,$7F,$7F,$3F,$3F db $7E,$7E,$7E,$7E,$00,$00,$00,$00 db $00,$00,$00,$00,$00,$00,$00,$00 db $00,$FE,$FC,$1F,$00,$00,$FE,$F0 db $FE,$FC,$F8,$F0,$3C,$8F,$1F,$7F db $F0,$F0,$F0,$F0,$9F,$9F,$9F,$9F db $7C,$7E,$7E,$7F,$E3,$3E,$3F,$3F db $F8,$FC,$FE,$00,$7F,$3F,$F0,$3E db $00,$00,$00,$3F,$00,$00,$00,$00 db $00,$00,$00,$FC,$00,$00,$00,$FE db $1F,$3F,$7F,$FE,$F8,$F1,$3C,$F0 db $3F,$7F,$00,$00,$7F,$00,$00,$00 db $00,$00,$00,$FC,$00,$00,$00,$FE db $7C,$FC,$F8,$F8,$1F,$3F,$7F,$00 db $3F,$3F,$1F,$1F,$F0,$F0,$F8,$FC db $3F,$1F,$1F,$F0,$F8,$F8,$FC,$FE db $FC,$FE,$00,$00,$00,$00,$00,$00 db $00,$00,$00,$7F,$3F,$1F,$F0,$F8 db $FE,$00,$00,$00,$00,$00,$00,$00 db $00,$00,$7F,$3F,$1F,$F8,$FE,$00 db $00,$00,$00,$00,$00,$00,$00,$3F db $00,$00,$00,$00,$00,$FE,$F8,$3F db $F0,$1F,$3F,$7F,$00,$00,$00,$00 db $00,$00,$00,$00,$00,$00,$FE,$FC db $F8,$F0,$1F,$3F,$7F,$00,$00,$00 db $FC,$FE,$00,$00,$00,$00,$00,$00 db $00,$00,$7F,$1F,$F8,$FE,$00,$00 db $00,$00,$00,$00,$00,$00,$3F,$FE db $00,$00,$00,$00,$00,$00,$00,$1F db $00,$00,$00,$FE,$F8,$1F,$00,$00 db $F0,$1F,$7F,$00,$00,$00,$00,$00 db $00,$00,$00,$00,$00,$00,$00,$00 db $00,$7F,$7F,$7F,$7F,$7F,$7F,$7F db $7F,$7F,$7F,$7F,$7F,$7F,$7F,$7F db $7F,$00,$00,$00,$00,$00,$00,$00 logo_npatterns: equ ($ - logo_patterns) / logo_patlength ; logo_colors: db $00,$00,$00,$00,$00,$00,$00,$00 logo_collength: equ $ - logo_colors db $00,$00,$00,$00,$00,$00,$09,$09 db $00,$00,$09,$09,$90,$90,$09,$09 db $09,$90,$09,$09,$09,$09,$09,$09 db $09,$09,$09,$09,$09,$09,$09,$09 db $09,$09,$09,$09,$09,$09,$09,$09 db $00,$00,$09,$90,$90,$09,$09,$09 db $00,$00,$00,$00,$00,$09,$09,$90 db $01,$01,$01,$01,$19,$19,$19,$19 db $91,$91,$91,$09,$09,$09,$09,$09 db $09,$09,$09,$09,$91,$91,$91,$91 db $09,$91,$19,$19,$01,$01,$01,$01 db $01,$01,$01,$01,$01,$01,$01,$01 db $09,$91,$19,$19,$01,$01,$01,$01 db $09,$09,$09,$09,$09,$91,$91,$91 db $91,$91,$91,$09,$09,$09,$09,$09 db $01,$01,$01,$01,$19,$19,$19,$91 db $00,$00,$00,$00,$00,$00,$09,$09 db $91,$91,$91,$91,$09,$09,$09,$09 db $09,$09,$09,$09,$09,$91,$91,$91 db $19,$19,$19,$01,$01,$01,$01,$01 db $1F,$1F,$1F,$1F,$1F,$1F,$1F,$1F db $1F,$1F,$1F,$1F,$1F,$1F,$1F,$1F db $F1,$F1,$F1,$F1,$01,$01,$01,$01 db $08,$09,$09,$09,$08,$90,$90,$90 db $08,$09,$09,$09,$08,$09,$09,$09 db $81,$91,$91,$91,$81,$19,$19,$19 db $1F,$1F,$1F,$1F,$F1,$F1,$F1,$F1 db $1F,$F1,$F1,$0F,$0F,$F1,$F1,$1F db $0F,$0F,$0F,$0F,$01,$01,$01,$01 db $0F,$0F,$0F,$0F,$1F,$01,$01,$01 db $01,$1F,$F1,$F1,$F1,$0F,$F1,$F1 db $1F,$1F,$1F,$1F,$1F,$1F,$1F,$1F db $F1,$F1,$F1,$F1,$1F,$1F,$1F,$1F db $01,$01,$1F,$1F,$F1,$F1,$F1,$F1 db $F1,$0F,$0F,$0F,$F1,$1F,$01,$01 db $1F,$F1,$0F,$0F,$0F,$F1,$1F,$1F db $01,$01,$01,$1F,$1F,$1F,$1F,$F1 db $1F,$1F,$1F,$F1,$F1,$F1,$F1,$F1 db $80,$90,$90,$80,$90,$80,$80,$90 db $08,$09,$09,$08,$09,$08,$08,$09 db $18,$19,$19,$18,$19,$18,$18,$19 db $F1,$F1,$F1,$F1,$F1,$F1,$F1,$F1 db $1F,$1F,$1F,$1F,$01,$01,$01,$01 db $F1,$1F,$1F,$1F,$1F,$1F,$1F,$1F db $1F,$1F,$1F,$1F,$F1,$F1,$F1,$F1 db $1F,$1F,$F1,$F1,$F1,$F1,$F1,$F1 db $F1,$F1,$F1,$F1,$1F,$1F,$1F,$1F db $1F,$1F,$01,$01,$01,$01,$01,$01 db $F1,$F1,$F1,$F1,$F1,$F1,$F1,$F1 db $F1,$F1,$F1,$F1,$F1,$F1,$F1,$F1 db $01,$01,$01,$01,$01,$01,$0F,$0F db $01,$01,$01,$01,$01,$01,$1F,$1F db $08,$08,$08,$09,$08,$08,$08,$09 db $F1,$F1,$E1,$F1,$F1,$E1,$E1,$F1 db $1F,$1F,$1E,$1F,$F1,$E1,$E1,$F1 db $F1,$F1,$E1,$F1,$1F,$1E,$1E,$1F db $F1,$F1,$E1,$F1,$1F,$1E,$1E,$1F db $1F,$1F,$1E,$1F,$1F,$1E,$1E,$F1 db $01,$01,$01,$1F,$1F,$1E,$1E,$1F db $F1,$F1,$E1,$F1,$F1,$E1,$1E,$1F db $F1,$1F,$01,$01,$01,$01,$01,$01 db $0F,$0F,$01,$01,$01,$01,$01,$01 db $0F,$0F,$1E,$01,$01,$01,$01,$01 db $F1,$F1,$E1,$F1,$F1,$E1,$E1,$F1 db $08,$08,$08,$80,$80,$80,$80,$80 db $08,$08,$08,$08,$08,$08,$08,$08 db $01,$01,$01,$18,$18,$18,$18,$18 db $E1,$E1,$E1,$E1,$0E,$0E,$0E,$0E db $01,$01,$01,$01,$0E,$0E,$0E,$0E db $01,$1E,$1E,$E1,$0E,$0E,$E1,$E1 db $E1,$E1,$E1,$E1,$1E,$E1,$E1,$E1 db $1E,$1E,$1E,$1E,$E1,$E1,$E1,$E1 db $1E,$1E,$1E,$1E,$1E,$E1,$E1,$E1 db $E1,$E1,$E1,$0E,$E1,$E1,$1E,$1E db $01,$01,$01,$1E,$0E,$0E,$0E,$0E db $01,$01,$01,$1E,$0E,$0E,$0E,$E1 db $E1,$E1,$E1,$E1,$E1,$E1,$1E,$1E db $1E,$1E,$01,$01,$E1,$0E,$0E,$0E db $01,$01,$01,$1E,$0E,$0E,$0E,$E1 db $E1,$E1,$E1,$E1,$1E,$1E,$1E,$01 db $80,$80,$80,$80,$08,$08,$08,$08 db $18,$18,$18,$81,$81,$81,$81,$81 db $08,$08,$00,$00,$00,$00,$00,$00 db $08,$08,$08,$81,$81,$81,$18,$18 db $81,$08,$08,$08,$08,$08,$08,$08 db $01,$01,$18,$18,$18,$81,$81,$08 db $01,$01,$01,$01,$01,$01,$01,$18 db $01,$01,$01,$01,$01,$18,$18,$81 db $18,$81,$81,$81,$08,$08,$08,$08 db $08,$08,$08,$08,$08,$08,$81,$81 db $81,$81,$18,$18,$18,$01,$01,$01 db $08,$08,$00,$00,$00,$00,$00,$00 db $08,$08,$80,$80,$08,$08,$00,$00 db $08,$08,$08,$08,$08,$08,$80,$08 db $08,$08,$08,$08,$08,$08,$08,$08 db $08,$08,$08,$80,$80,$08,$00,$00 db $84,$08,$08,$00,$00,$00,$00,$00 db $04,$00,$00,$00,$00,$00,$00,$00 db $00,$04,$04,$04,$04,$04,$04,$04 db $04,$04,$04,$04,$04,$04,$04,$04 db $04,$00,$00,$00,$00,$00,$00,$00 logo_ncolors: equ ($ - logo_colors) / logo_collength ; logo_names: db $80,$80,$81,$82,$83,$84,$85,$86,$87,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80 logo_width: equ $ - logo_names db $80,$88,$89,$8A,$8B,$8C,$8D,$8E,$8F,$90,$8C,$8C,$8C,$8C,$8C,$8C,$8C,$8C,$8C,$8C,$8C,$8C,$8C,$E3 db $91,$92,$93,$94,$8C,$95,$96,$8C,$8C,$8C,$8C,$97,$8C,$8C,$8C,$8C,$8C,$8C,$8C,$8C,$8C,$8C,$8C,$E4 db $98,$99,$9A,$8C,$8C,$9B,$9C,$9D,$9E,$9F,$A0,$A1,$A2,$A3,$9D,$A4,$A5,$A6,$9D,$9D,$9D,$9D,$8C,$E4 db $A7,$A8,$A9,$8C,$8C,$AA,$AB,$8C,$8C,$AC,$AD,$AE,$AF,$8C,$8C,$B0,$B1,$B2,$B3,$B3,$B3,$B4,$8C,$E4 db $B5,$B5,$8C,$8C,$8C,$B6,$8C,$8C,$8C,$B7,$B8,$B9,$BA,$8C,$8C,$BB,$BC,$BD,$BE,$BE,$BF,$C0,$8C,$E4 db $C1,$C2,$C3,$8C,$8C,$C4,$C5,$C5,$C6,$C7,$C8,$C9,$CA,$CB,$CC,$CD,$CE,$C5,$C5,$C5,$CF,$D0,$8C,$E4 db $D1,$C2,$D2,$8C,$8C,$8C,$8C,$8C,$8C,$8C,$8C,$8C,$8C,$8C,$8C,$8C,$8C,$8C,$8C,$8C,$8C,$8C,$8C,$E4 db $D3,$D4,$D5,$D6,$D7,$D8,$D9,$DA,$DB,$8C,$8C,$8C,$8C,$8C,$8C,$8C,$8C,$8C db "V" incbin "../version.txt" db $E4 db $80,$DC,$DD,$DE,$C2,$DF,$E0,$E1,$E2,$E2,$E2,$E2,$E2,$E2,$E2,$E2,$E2,$E2,$E2,$E2,$E2,$E2,$E2,$E5 logo_height: equ ($ - logo_names) / logo_width ; ENDIF ; IF VDP = V9938 ld de,$c000 ld hl,msx2logodata call unPack ld hl,0 ld (BAKCLR),hl ld a,5 call $5f ld hl,palette1 call setpalette call $41 ld hl,256 ld (BAKCLR),hl call $62 ld a,(RG8SAV+1) and 127 ld b,a ld c,9 call $47 wait_ce_logo: ld a,2 ld ix,$131 call $15f bit 0,a jr nz,wait_ce_logo push de ld bc,15 ld hl,logo_hmmc ldir pop hl ld bc,13 add hl,bc ld de,$c000 ld a,(de) inc de ld (hl),a ex de,hl di ld a,32 out ($99),a ld a,128+ 17 out ($99),a push hl ld bc,15 *256+ $9b ld hl,logo_hmmc otir pop hl ld a,128+ 44 out ($99),a ld a,128+ 17 out ($99),a ei ld b,255 otir loop_logo: ld a,2 ld ix,$131 call $15f bit 0,a jr z,done_logo otir jr loop_logo done_logo: ld bc,32 ld de,$c000 ld hl,palette1 ldir ld hl,22 *8 ld (GRPACX),hl ld hl,12 *8 +1 ld (GRPACY),hl ld a,7 ld (FORCLR),a ld a,8 ld (LOGOPR),a ld hl,logo_ver call prn_text ld (LOGOPR),a call $44 palette_loop: ld b,16 ld de,palette2 ld hl,$c000 palette_color: ld a,(de) ; change red and 240 ld c,a ld a,(hl) and 240 cp c jr z,palette_red_done jr nc,palette_red_down add a,16 jr palette_red_done palette_red_down: sub 16 palette_red_done: ld c,a ld a,(hl) and 15 or c ld (hl),a ld a,(de) and 15 ld c,a ld a,(hl) and 15 cp c jr z,palette_blue_done jr nc,palette_blue_down inc a jr palette_blue_done palette_blue_down: dec a palette_blue_done: ld c,a ld a,(hl) and 240 or c ld (hl),a inc de inc hl ld a,(de) ld c,a ld a,(hl) cp c jr z,palette_green_done jr nc,palette_green_down inc a jr palette_green_done palette_green_down: dec a palette_green_done: ld (hl),a inc de inc hl djnz palette_color ld hl,$c000 call setpalette ld b,6 palette_wait: halt djnz palette_wait ld b,32 ld de,palette2 ld hl,$c000 palette_check: ld a,(de) cp (hl) jr nz,palette_loop inc de inc hl djnz palette_check ld b,9 ld hl,glare glare_loop: ld e,(hl) inc hl ld d,(hl) inc hl push bc push hl ex de,hl call setpalette pop hl pop bc halt halt djnz glare_loop ret setpalette: di xor a out ($99),a ld a,128+ 16 out ($99),a ld bc,32 *256+ $9a otir ei ret prn_text: ld a,(SCRMOD) cp 5 jr nc,prn_text_graph prn_text_char: ld a,(hl) or a ret z call $a2 inc hl jr prn_text_char prn_text_graph: ld a,(hl) or a ret z ld ix,$0089 call $15f inc hl jr prn_text_graph logo_hmmc: dw 0 dw 0 dw 0 dw 31 dw 256 dw 85 col: db 0 db 0 db $f0 palette1: dw $000,$327,$327,$327,$327,$327,$327,$327 dw $327,$327,$327,$327,$327,$327,$327,$327 palette2: dw $000,$327,$117,$000,$111,$333,$555,$777 dw $674,$563,$573,$572,$672,$772,$470,$270 palette3: dw $000,$327,$117,$000,$111,$333,$555,$777 dw $674,$563,$573,$572,$672,$772,$470,$777 palette4: dw $000,$327,$117,$000,$111,$333,$555,$777 dw $674,$563,$573,$572,$672,$772,$777,$270 palette5: dw $000,$327,$117,$000,$111,$333,$555,$777 dw $674,$563,$573,$572,$672,$777,$470,$270 palette6: dw $000,$327,$117,$000,$111,$333,$555,$777 dw $674,$563,$573,$572,$777,$772,$470,$270 palette7: dw $000,$327,$117,$000,$111,$333,$555,$777 dw $674,$563,$573,$777,$672,$772,$470,$270 palette8: dw $000,$327,$117,$000,$111,$333,$555,$777 dw $674,$563,$777,$572,$672,$772,$470,$270 palette9: dw $000,$327,$117,$000,$111,$333,$555,$777 dw $777,$563,$573,$572,$672,$772,$470,$270 palette10: dw $000,$327,$117,$000,$111,$333,$555,$777 dw $674,$777,$573,$572,$672,$772,$470,$270 glare: dw palette3,palette4,palette5,palette6 dw palette7,palette8,palette9,palette10,palette2 ; logo_ver: db "V" incbin "../version.txt" db 0 ; ; Bitbuster by Team Bomba ; ; ; In: HL = source ; DE = destination ; unPack: exx ld bc,128 ; b' = 0 (register loading optimize) ; c' = bits from bitstream exx unPack_loop: exx call getBit exx jr c,unPack_outCompress ; if set, we got LZ77 compression unPack_outLiteral: ldi ; copy byte from compressed data to destination jr unPack_loop ; handle more compressed data unPack_outCompress: ld a,(hl) ; get lowest 7 bits of offset, plus the offset ; extension bit inc hl or a jr z,unPack_outRle ; offset = 0, RLE compression used unPack_outMatch: exx ld e,a ld d,b ; b' should be always clear when entering this part rlca ; offset extension bit set? jr nc,unPack_outMatch1 ; no need to get extra bits if carry not set call getBit ; get offset bit 10 rl d call getBit ; get offset bit 9 rl d call getBit ; get offset bit 8 rl d call getBit ; get offset bit 7 jr c,unPack_outMatch1 ; since extension mark already makes bit 7 set res 7,e ; only clear it if the bit should be cleared unPack_outMatch1: inc de call getGammaValue_0 ; get the match length ; HL' = length push hl ; save compressed data pointer exx push hl ; save match length push de ; save match offset exx ld h,d ; destination in HL ld l,e pop bc ; load match offset length sbc hl,bc ; calculate source address pop bc ; load match length ldir pop hl ; load compressed data pointer jr unPack_loop unPack_outRle: call getGammaValue ret c ; HL' = repeat length push hl ; save compressed data pointer exx push hl ; save repeat length exx pop bc ; load repeat length ld h,d ; source = destination - 1 ld l,e dec hl ldir pop hl ; load compressed data pointer jr unPack_loop ; getBit: sla c ; shift out new bit ret nz ; if remaining value != 0, we're done exx ld a,(hl) ; get 8 bits from the compressed stream inc hl exx ld c,a ; 8 bits in C' sla c ; shift out new bit inc c ; set bit 0 so C' will be zero after shifting 8 times ret ; getGammaValue: exx ; get number of bits used to encode value getGammaValue_0: ld hl,1 ; initial length ld b,1 ; bitcount getGammaValue_size: call getBit ; get more bits jr nc,getGammaValue_sizeEnd ; if bit is not set, bit length is known inc b ; increase bitcount jr getGammaValue_size getGammaValue_bits: call getBit ; get next bit of value from the compressed stream adc hl,hl ; insert new bit in HL getGammaValue_sizeEnd: djnz getGammaValue_bits ; repeat if more bits to go getGammaValue_end: inc hl ; correct HL (was stored as length - 2) exx ret ; msx2logodata: db $7E,$00,$00,$01,$04,$33,$00,$C1,$40,$00,$00,$FD,$A2,$43,$79,$36 db $A9,$99,$00,$07,$7F,$34,$7D,$63,$FB,$10,$3A,$99,$9A,$6A,$BB,$00 db $BA,$85,$24,$93,$83,$BF,$61,$7E,$0F,$AA,$AA,$BB,$00,$02,$AA,$A9 db $80,$3F,$AE,$C7,$7E,$AB,$7E,$8C,$83,$AC,$80,$7F,$59,$7E,$EF,$80 db $1F,$D7,$67,$7E,$7D,$AC,$80,$7F,$5B,$7E,$E2,$AA,$D9,$00,$89,$6A db $80,$2B,$85,$7E,$98,$05,$43,$E8,$72,$BA,$AA,$B5,$FD,$57,$89,$88 db $63,$BA,$93,$50,$7A,$F9,$FC,$EF,$66,$F6,$D9,$B6,$F7,$61,$0D,$38 db $98,$9A,$80,$1D,$4D,$81,$00,$FB,$1F,$7F,$96,$39,$BF,$F6,$0E,$3C db $91,$88,$80,$D2,$A9,$8E,$37,$01,$F5,$5F,$20,$7F,$94,$99,$F6,$7E db $8D,$80,$9E,$90,$26,$8E,$FE,$7F,$8C,$39,$9B,$E1,$7F,$B9,$6C,$E6 db $88,$97,$80,$DF,$FC,$7F,$A4,$99,$EC,$F3,$EB,$1E,$82,$38,$8A,$BB db $80,$5F,$77,$7F,$F2,$63,$FE,$B8,$EA,$F5,$96,$80,$66,$93,$7F,$93 db $7F,$41,$FE,$1F,$1C,$80,$AE,$8A,$31,$16,$EF,$7F,$FC,$8C,$FE,$7C db $B3,$01,$89,$89,$F8,$9F,$01,$93,$7F,$CF,$1C,$99,$CC,$00,$57,$E9 db $EC,$FE,$7F,$E9,$39,$9C,$7E,$C1,$C9,$93,$7F,$FD,$B4,$FE,$7C,$2B db $66,$00,$4E,$E1,$7C,$36,$14,$7F,$7F,$C1,$B9,$9C,$7F,$8F,$FE,$21 db $57,$77,$76,$4E,$F0,$BE,$35,$14,$3F,$7F,$E0,$A5,$FE,$E2,$7C,$56 db $7F,$8F,$67,$7F,$E5,$07,$04,$3C,$CC,$7F,$28,$33,$FF,$F3,$7C,$66 db $7F,$47,$55,$56,$7F,$F2,$64,$43,$CC,$FE,$FC,$11,$E9,$14,$77,$63 db $FF,$FD,$39,$04,$33,$FE,$1D,$3F,$93,$7F,$B5,$3A,$03,$EE,$00,$7F db $33,$7F,$6B,$FE,$2F,$17,$7F,$F5,$94,$FD,$D5,$FD,$B9,$F5,$7F,$EF db $79,$01,$C4,$8A,$77,$09,$E7,$01,$CE,$B0,$3A,$7A,$01,$3F,$63,$7F db $21,$38,$7F,$F3,$CE,$44,$77,$00,$7B,$67,$4B,$57,$94,$51,$97,$5C db $1E,$18,$23,$76,$90,$C7,$11,$AF,$01,$0F,$7F,$C8,$27,$43,$3E,$FE db $A7,$E3,$7F,$B7,$52,$95,$67,$7F,$E7,$7E,$78,$66,$C7,$80,$59,$2B db $23,$79,$00,$FE,$7F,$53,$DD,$00,$96,$D9,$E9,$7A,$C8,$59,$67,$02 db $65,$55,$DC,$00,$6E,$38,$76,$63,$7F,$E7,$06,$0F,$39,$19,$46,$56 db $A1,$23,$66,$91,$8C,$2B,$7A,$55,$00,$FE,$7F,$38,$04,$43,$8D,$F8 db $7F,$92,$56,$DC,$E7,$67,$73,$66,$FE,$9D,$45,$98,$19,$DE,$8F,$48 db $67,$99,$E5,$66,$87,$2D,$D3,$FF,$E8,$DD,$FD,$FF,$1D,$3D,$C9,$7F db $D2,$66,$8D,$E3,$5F,$6F,$66,$7F,$31,$EB,$BE,$27,$3C,$0C,$DB,$AD db $CF,$7F,$F8,$69,$3B,$FE,$F8,$B6,$7F,$EB,$59,$F0,$66,$F0,$7F,$8E db $8B,$63,$99,$CB,$18,$8F,$7F,$D8,$23,$43,$3D,$FE,$97,$DC,$FB,$FA db $4B,$F1,$5E,$66,$4E,$66,$7F,$A3,$FE,$D2,$99,$37,$7A,$3B,$97,$E8 db $53,$20,$FE,$E4,$BD,$DC,$38,$3B,$FE,$1E,$63,$0F,$DD,$7F,$FA,$19 db $DF,$A8,$1F,$7F,$B8,$AE,$D7,$FD,$86,$FF,$38,$F7,$F9,$7E,$66,$A5 db $89,$8F,$29,$47,$66,$7F,$ED,$D7,$FE,$CB,$7F,$F0,$5F,$FA,$1A,$66 db $36,$A7,$EA,$7B,$A9,$AF,$14,$7F,$DC,$8F,$FF,$91,$57,$7F,$EE,$56 db $D8,$7F,$EA,$C9,$FE,$76,$9E,$94,$7F,$7F,$69,$44,$7F,$F2,$4E,$D5 db $3E,$73,$7F,$1E,$03,$65,$FE,$D7,$7F,$F8,$0B,$FE,$F9,$3E,$7F,$B7 db $73,$7F,$C4,$56,$DE,$A0,$BF,$7F,$4A,$FE,$FE,$4F,$7F,$CE,$D3,$A1 db $FD,$7D,$BF,$7F,$29,$3A,$7F,$FC,$1C,$80,$9D,$FB,$E9,$8D,$2E,$1F db $7F,$D3,$F2,$A2,$47,$FD,$97,$94,$35,$7F,$F8,$A9,$38,$FF,$E9,$93 db $7F,$FB,$8E,$33,$FB,$F4,$D2,$94,$80,$5A,$FC,$7F,$04,$04,$FF,$7C db $A8,$34,$CE,$9E,$53,$66,$A3,$45,$66,$43,$03,$AF,$18,$69,$2A,$64 db $F6,$4F,$00,$44,$46,$64,$7E,$43,$7F,$E4,$FF,$7C,$0C,$36,$FF,$D2 db $57,$76,$FF,$3E,$2D,$8F,$77,$97,$AD,$0F,$7F,$DB,$CF,$FE,$81,$66 db $E5,$9D,$FB,$7F,$EB,$8F,$C1,$7F,$F9,$F3,$FF,$F2,$48,$E5,$65,$97 db $FE,$7C,$A8,$25,$E9,$81,$45,$56,$53,$FE,$2E,$F2,$EA,$CC,$AD,$FC db $11,$FF,$FB,$7E,$7F,$E6,$34,$46,$50,$70,$7F,$44,$27,$56,$55,$EA db $D5,$66,$FE,$3F,$0F,$7F,$F0,$32,$FF,$EF,$FE,$29,$FE,$DD,$53,$99 db $B4,$FE,$A6,$F9,$7C,$72,$FF,$F9,$68,$AE,$FF,$FC,$18,$FE,$92,$65 db $FE,$47,$FF,$29,$34,$1A,$55,$FE,$1E,$84,$54,$43,$FF,$7E,$E9,$33 db $8E,$FF,$CF,$17,$7F,$B7,$65,$36,$E9,$CD,$80,$04,$75,$53,$98,$7B db $7C,$01,$11,$A4,$5B,$FF,$E4,$F7,$FF,$C9,$7F,$EB,$65,$37,$55,$65 db $7F,$90,$44,$55,$67,$55,$8F,$98,$14,$65,$FE,$7C,$98,$93,$E1,$7F db $F8,$6F,$8A,$7F,$BF,$CF,$2A,$FC,$B6,$65,$55,$8E,$85,$24,$80,$18 db $65,$55,$53,$A5,$CA,$55,$67,$8F,$FE,$92,$AF,$47,$44,$7F,$E4,$AB db $38,$80,$E2,$CD,$7F,$CD,$72,$95,$FD,$A7,$53,$85,$28,$06,$88,$C9 db $80,$36,$E1,$EA,$19,$25,$C7,$67,$44,$00,$C3,$94,$4E,$1B,$FF,$F8 db $56,$80,$F2,$67,$62,$01,$8C,$E3,$8C,$44,$7E,$52,$64,$D4,$CD,$89 db $0A,$BC,$EC,$E0,$55,$8D,$8E,$BB,$9A,$00,$E0,$CF,$30,$7F,$DE,$F3 db $00,$A7,$22,$F5,$71,$7F,$55,$7F,$62,$ED,$C4,$80,$45,$E6,$18,$66 db $CE,$0C,$0B,$BC,$01,$FC,$7E,$3F,$7F,$11,$38,$80,$5F,$14,$CD,$BA db $39,$43,$0F,$CB,$04,$7F,$0E,$C7,$00,$67,$EA,$7E,$00,$37,$33,$7F db $E4,$DF,$80,$CD,$01,$FC,$37,$7F,$E1,$DB,$80,$83,$E3,$7F,$FB,$6B db $80,$6D,$EE,$7F,$FD,$AD,$80,$38,$3F,$EF,$7F,$B3,$52,$00,$AD,$3A db $8A,$7F,$7F,$F3,$7F,$6B,$80,$3E,$0F,$FF,$7F,$EC,$E7,$80,$E9,$3A db $3F,$FF,$00,$FE,$7F,$7E,$80,$7E,$64,$FF,$96,$FF,$03,$7F,$F8,$53 db $80,$A4,$39,$9F,$E9,$7C,$51,$FE,$FC,$17,$7F,$E2,$4A,$80,$BA,$99 db $6A,$8F,$EA,$3E,$7E,$EB,$95,$F6,$FF,$7F,$1E,$80,$5E,$28,$FE,$FE db $0F,$7F,$F1,$2F,$81,$65,$80,$C1,$FF,$FE,$1F,$C6,$7E,$7F,$2F,$82 db $24,$80,$B8,$BD,$FF,$7E,$96,$FF,$FF,$FC,$FC,$80,$AE,$29,$11,$9A db $FF,$F0,$E6,$3F,$F4,$0D,$FE,$7F,$7D,$04,$29,$83,$38,$AF,$FF,$00 db $E3,$63,$F4,$FF,$F4,$14,$81,$CE,$83,$24,$80,$7C,$87,$34,$22,$00 db $EE,$7E,$7F,$33,$04,$83,$12,$80,$3E,$41,$33,$40,$00,$00,$FD,$22 db $44,$80,$3E,$5F,$7E,$E9,$E5,$80,$63,$80,$E2,$3F,$33,$30,$7E,$A6 db $96,$80,$23,$80,$5E,$AA,$7D,$43,$AF,$33,$34,$7E,$FA,$88,$80,$EC db $38,$AA,$4B,$AA,$83,$23,$FA,$AA,$F3,$7E,$FA,$C8,$80,$E7,$88,$16 db $83,$4C,$00,$63,$AF,$08,$44,$7E,$FA,$C8,$80,$EA,$83,$53,$00,$83 db $34,$44,$7E,$FA,$F8,$80,$EF,$01,$BF,$7E,$EC,$2D,$85,$9E,$01,$8F db $40,$00,$00,$ED,$63,$FB,$FA,$2F,$00,$FF,$F8 ; ENDIF ; IF VDP = V9958 call $17a rla ret c ld a,$80 call $17d ; MSX2+ logo version ld de,$c000 ld hl,msx2logodata_1 call unPack_1 ld hl,0 ld (BAKCLR),hl ld a,5 call $5f ld hl,palette1_1 call setpalette_1 call $41 ld hl,256 ld (BAKCLR),hl call $62 ld a,(RG8SAV+1) and 127 ld b,a ld c,9 call $47 wait_ce_logo_1: ld a,2 ld ix,$131 call $15f bit 0,a jr nz,wait_ce_logo_1 push de ld bc,15 ld hl,logo_hmmc_1 ldir pop hl ld bc,13 add hl,bc ld de,$c000 ld a,(de) inc de ld (hl),a ex de,hl di ld a,32 out ($99),a ld a,128+ 17 out ($99),a push hl ld bc,15 *256+ $9b ld hl,logo_hmmc_1 otir pop hl ld a,128+ 44 out ($99),a ld a,128+ 17 out ($99),a ei ld b,255 otir loop_logo_1: ld a,2 ld ix,$131 call $15f bit 0,a jr z,done_logo_1 otir jr loop_logo_1 done_logo_1: ld bc,32 ld de,$c000 ld hl,palette1_1 ldir ld hl,22 *8 ld (GRPACX),hl ld hl,12 *8 +1 ld (GRPACY),hl ld a,7 ld (FORCLR),a ld a,8 ld (LOGOPR),a ld hl,logo_ver_1 call prn_text_1 ld (LOGOPR),a call $44 palette_loop_1: ld b,16 ld de,palette2_1 ld hl,$c000 palette_color_1: ld a,(de) ; change red and 240 ld c,a ld a,(hl) and 240 cp c jr z,palette_red_done_1 jr nc,palette_red_down_1 add a,16 jr palette_red_done_1 palette_red_down_1: sub 16 palette_red_done_1: ld c,a ld a,(hl) and 15 or c ld (hl),a ld a,(de) and 15 ld c,a ld a,(hl) and 15 cp c jr z,palette_blue_done_1 jr nc,palette_blue_down_1 inc a jr palette_blue_done_1 palette_blue_down_1: dec a palette_blue_done_1: ld c,a ld a,(hl) and 240 or c ld (hl),a inc de inc hl ld a,(de) ld c,a ld a,(hl) cp c jr z,palette_green_done_1 jr nc,palette_green_down_1 inc a jr palette_green_done_1 palette_green_down_1: dec a palette_green_done_1: ld (hl),a inc de inc hl djnz palette_color_1 ld hl,$c000 call setpalette_1 ld b,6 palette_wait_1: halt djnz palette_wait_1 ld b,32 ld de,palette2_1 ld hl,$c000 palette_check_1: ld a,(de) cp (hl) jr nz,palette_loop_1 inc de inc hl djnz palette_check_1 ld b,9 ld hl,glare_1 glare_loop_1: ld e,(hl) inc hl ld d,(hl) inc hl push bc push hl ex de,hl call setpalette_1 pop hl pop bc halt halt djnz glare_loop_1 ret setpalette_1: di xor a out ($99),a ld a,128+ 16 out ($99),a ld bc,32 *256+ $9a otir ei ret prn_text_1: ld a,(SCRMOD) cp 5 jr nc,prn_text_graph_1 prn_text_char_1: ld a,(hl) or a ret z call $a2 inc hl jr prn_text_char_1 prn_text_graph_1: ld a,(hl) or a ret z ld ix,$0089 call $15f inc hl jr prn_text_graph_1 logo_hmmc_1: dw 0 dw 0 dw 0 dw 31 dw 256 dw 85 col_1: db 0 db 0 db $f0 palette1_1: dw $000,$327,$327,$327,$327,$327,$327,$327 dw $327,$327,$327,$327,$327,$327,$327,$327 palette2_1: dw $000,$327,$117,$000,$111,$333,$555,$777 dw $674,$563,$573,$572,$672,$772,$470,$270 palette3_1: dw $000,$327,$117,$000,$111,$333,$555,$777 dw $674,$563,$573,$572,$672,$772,$470,$777 palette4_1: dw $000,$327,$117,$000,$111,$333,$555,$777 dw $674,$563,$573,$572,$672,$772,$777,$270 palette5_1: dw $000,$327,$117,$000,$111,$333,$555,$777 dw $674,$563,$573,$572,$672,$777,$470,$270 palette6_1: dw $000,$327,$117,$000,$111,$333,$555,$777 dw $674,$563,$573,$572,$777,$772,$470,$270 palette7_1: dw $000,$327,$117,$000,$111,$333,$555,$777 dw $674,$563,$573,$777,$672,$772,$470,$270 palette8_1: dw $000,$327,$117,$000,$111,$333,$555,$777 dw $674,$563,$777,$572,$672,$772,$470,$270 palette9_1: dw $000,$327,$117,$000,$111,$333,$555,$777 dw $777,$563,$573,$572,$672,$772,$470,$270 palette10_1: dw $000,$327,$117,$000,$111,$333,$555,$777 dw $674,$777,$573,$572,$672,$772,$470,$270 glare_1: dw palette3_1,palette4_1,palette5_1,palette6_1 dw palette7_1,palette8_1,palette9_1,palette10_1,palette2_1 ; logo_ver_1: db "V" incbin "../version.txt" db 0 ; ; Bitbuster by Team Bomba ; ; ; In: HL = source ; DE = destination ; unPack_1: exx ld bc,128 ; b' = 0 (register loading optimize) ; c' = bits from bitstream exx unPack_loop_1: exx call getBit_1 exx jr c,unPack_outCompress_1 ; if set, we got LZ77 compression unPack_outLiteral_1: ldi ; copy byte from compressed data to destination jr unPack_loop_1 ; handle more compressed data unPack_outCompress_1: ld a,(hl) ; get lowest 7 bits of offset, plus the offset ; extension bit inc hl or a jr z,unPack_outRle_1 ; offset = 0, RLE compression used unPack_outMatch_1: exx ld e,a ld d,b ; b' should be always clear when entering this part rlca ; offset extension bit set? jr nc,unPack_outMatch1_1 ; no need to get extra bits if carry not set call getBit_1 ; get offset bit 10 rl d call getBit_1 ; get offset bit 9 rl d call getBit_1 ; get offset bit 8 rl d call getBit_1 ; get offset bit 7 jr c,unPack_outMatch1_1 ; since extension mark already makes bit 7 set res 7,e ; only clear it if the bit should be cleared unPack_outMatch1_1: inc de call getGammaValue_0_1 ; get the match length ; HL' = length push hl ; save compressed data pointer exx push hl ; save match length push de ; save match offset exx ld h,d ; destination in HL ld l,e pop bc ; load match offset length sbc hl,bc ; calculate source address pop bc ; load match length ldir pop hl ; load compressed data pointer jr unPack_loop_1 unPack_outRle_1: call getGammaValue_1 ret c ; HL' = repeat length push hl ; save compressed data pointer exx push hl ; save repeat length exx pop bc ; load repeat length ld h,d ; source = destination - 1 ld l,e dec hl ldir pop hl ; load compressed data pointer jr unPack_loop_1 ; getBit_1: sla c ; shift out new bit ret nz ; if remaining value != 0, we're done exx ld a,(hl) ; get 8 bits from the compressed stream inc hl exx ld c,a ; 8 bits in C' sla c ; shift out new bit inc c ; set bit 0 so C' will be zero after shifting 8 times ret ; getGammaValue_1: exx ; get number of bits used to encode value getGammaValue_0_1: ld hl,1 ; initial length ld b,1 ; bitcount getGammaValue_size_1: call getBit_1 ; get more bits jr nc,getGammaValue_sizeEnd_1 ; if bit is not set, bit length is known inc b ; increase bitcount jr getGammaValue_size_1 getGammaValue_bits_1: call getBit_1 ; get next bit of value from the compressed stream adc hl,hl ; insert new bit in HL getGammaValue_sizeEnd_1: djnz getGammaValue_bits_1 ; repeat if more bits to go getGammaValue_end_1: inc hl ; correct HL (was stored as length - 2) exx ret ; msx2logodata_1: db $7E,$00,$00,$01,$04,$33,$00,$C1,$40,$00,$00,$FD,$A2,$43,$79,$36 db $A9,$99,$00,$07,$7F,$34,$7D,$63,$FB,$10,$3A,$99,$9A,$6A,$BB,$00 db $BA,$85,$24,$93,$83,$BF,$61,$7E,$0F,$AA,$AA,$BB,$00,$02,$AA,$A9 db $80,$3F,$AE,$C7,$7E,$AB,$7E,$8C,$83,$AC,$80,$7F,$59,$7E,$EF,$80 db $1F,$D7,$67,$7E,$7D,$AC,$80,$7F,$5B,$7E,$E2,$AA,$D9,$00,$89,$6A db $80,$2B,$85,$7E,$98,$05,$43,$E8,$72,$BA,$AA,$B5,$FD,$57,$89,$88 db $63,$BA,$93,$50,$7A,$F9,$FC,$EF,$66,$F6,$D9,$B6,$F7,$61,$0D,$38 db $98,$9A,$80,$1D,$4D,$81,$00,$FB,$1F,$7F,$96,$39,$BF,$F6,$0E,$3C db $91,$88,$80,$D2,$A9,$8E,$37,$01,$F5,$5F,$20,$7F,$94,$99,$F6,$7E db $8D,$80,$9E,$90,$26,$8E,$FE,$7F,$8C,$39,$9B,$E1,$7F,$B9,$6C,$E6 db $88,$97,$80,$DF,$FC,$7F,$A4,$99,$EC,$F3,$EB,$1E,$82,$38,$8A,$BB db $80,$5F,$77,$7F,$F2,$63,$FE,$B8,$EA,$F5,$96,$80,$66,$93,$7F,$93 db $7F,$41,$FE,$1F,$1C,$80,$AE,$8A,$31,$16,$EF,$7F,$FC,$8C,$FE,$7C db $B3,$01,$89,$89,$F8,$9F,$01,$93,$7F,$CF,$1C,$99,$CC,$00,$57,$E9 db $EC,$FE,$7F,$E9,$39,$9C,$7E,$C1,$C9,$93,$7F,$FD,$B4,$FE,$7C,$2B db $66,$00,$4E,$E1,$7C,$36,$14,$7F,$7F,$C1,$B9,$9C,$7F,$8F,$FE,$21 db $57,$77,$76,$4E,$F0,$BE,$35,$14,$3F,$7F,$E0,$A5,$FE,$E2,$7C,$56 db $7F,$8F,$67,$7F,$E5,$07,$04,$3C,$CC,$7F,$28,$33,$FF,$F3,$7C,$66 db $7F,$47,$55,$56,$7F,$F2,$64,$43,$CC,$FE,$FC,$11,$E9,$14,$77,$63 db $FF,$FD,$39,$04,$33,$FE,$1D,$3F,$93,$7F,$B5,$3A,$03,$EE,$00,$7F db $33,$7F,$6B,$FE,$2F,$17,$7F,$F5,$94,$FD,$D5,$FD,$B9,$F5,$7F,$EF db $79,$01,$C4,$8A,$77,$09,$E7,$01,$CE,$B0,$3A,$7A,$01,$3F,$63,$7F db $21,$38,$7F,$F3,$CE,$44,$77,$00,$7B,$67,$4B,$57,$94,$51,$97,$5C db $1E,$18,$23,$76,$90,$C7,$11,$AF,$01,$0F,$7F,$C8,$27,$43,$3E,$FE db $A7,$E3,$7F,$B7,$52,$95,$67,$7F,$E7,$7E,$78,$66,$C7,$80,$59,$2B db $23,$79,$00,$FE,$7F,$53,$DD,$00,$96,$D9,$E9,$7A,$C8,$59,$67,$02 db $65,$55,$DC,$00,$6E,$38,$76,$63,$7F,$E7,$06,$0F,$39,$19,$46,$56 db $A1,$23,$66,$91,$8C,$2B,$7A,$55,$00,$FE,$7F,$38,$04,$43,$8D,$F8 db $7F,$92,$56,$DC,$E7,$67,$73,$66,$FE,$9D,$45,$98,$19,$DE,$8F,$48 db $67,$99,$E5,$66,$87,$2D,$D3,$FF,$E8,$DD,$FD,$FF,$1D,$3D,$C9,$7F db $D2,$66,$8D,$E3,$5F,$6F,$66,$7F,$31,$EB,$BE,$27,$3C,$0C,$DB,$AD db $CF,$7F,$F8,$69,$3B,$FE,$F8,$B6,$7F,$EB,$59,$F0,$66,$F0,$7F,$8E db $8B,$63,$99,$CB,$18,$8F,$7F,$D8,$23,$43,$3D,$FE,$97,$DC,$FB,$FA db $4B,$F1,$5E,$66,$4E,$66,$7F,$A3,$FE,$D2,$99,$37,$7A,$3B,$97,$E8 db $53,$20,$FE,$E4,$BD,$DC,$38,$3B,$FE,$1E,$63,$0F,$DD,$7F,$FA,$19 db $DF,$A8,$1F,$7F,$B8,$AE,$D7,$FD,$86,$FF,$38,$F7,$F9,$7E,$66,$A5 db $89,$8F,$29,$47,$66,$7F,$ED,$D7,$FE,$CB,$7F,$F0,$5F,$FA,$1A,$66 db $36,$A7,$EA,$7B,$A9,$AF,$14,$7F,$DC,$8F,$FF,$91,$57,$7F,$EE,$56 db $D8,$7F,$EA,$C9,$FE,$76,$9E,$94,$7F,$7F,$69,$44,$7F,$F2,$4E,$D5 db $3E,$73,$7F,$1E,$03,$65,$FE,$D7,$7F,$F8,$0B,$FE,$F9,$3E,$7F,$B7 db $73,$7F,$C4,$56,$DE,$A0,$BF,$7F,$4A,$FE,$FE,$4F,$7F,$CE,$D3,$A1 db $FD,$7D,$BF,$7F,$29,$3A,$7F,$FC,$1C,$80,$9D,$FB,$E9,$8D,$2E,$1F db $7F,$D3,$F2,$A2,$47,$FD,$97,$94,$35,$7F,$F8,$A9,$38,$FF,$E9,$93 db $7F,$FB,$8E,$33,$FB,$F4,$D2,$94,$80,$5A,$FC,$7F,$04,$04,$FF,$7C db $A8,$34,$CE,$9E,$53,$66,$A3,$45,$66,$43,$03,$AF,$18,$69,$2A,$64 db $F6,$4F,$00,$44,$46,$64,$7E,$43,$7F,$E4,$FF,$7C,$0C,$36,$FF,$D2 db $57,$76,$FF,$3E,$2D,$8F,$77,$97,$AD,$0F,$7F,$DB,$CF,$FE,$81,$66 db $E5,$9D,$FB,$7F,$EB,$8F,$C1,$7F,$F9,$F3,$FF,$F2,$48,$E5,$65,$97 db $FE,$7C,$A8,$25,$E9,$81,$45,$56,$53,$FE,$2E,$F2,$EA,$CC,$AD,$FC db $11,$FF,$FB,$7E,$7F,$E6,$34,$46,$50,$70,$7F,$44,$27,$56,$55,$EA db $D5,$66,$FE,$3F,$0F,$7F,$F0,$32,$FF,$EF,$FE,$29,$FE,$DD,$53,$99 db $B4,$FE,$A6,$F9,$7C,$72,$FF,$F9,$68,$AE,$FF,$FC,$18,$FE,$92,$65 db $FE,$47,$FF,$29,$34,$1A,$55,$FE,$1E,$84,$54,$43,$FF,$7E,$E9,$33 db $8E,$FF,$CF,$17,$7F,$B7,$65,$36,$E9,$CD,$80,$04,$75,$53,$98,$7B db $7C,$01,$11,$A4,$5B,$FF,$E4,$F7,$FF,$C9,$7F,$EB,$65,$37,$55,$65 db $7F,$90,$44,$55,$67,$55,$8F,$98,$14,$65,$FE,$7C,$98,$93,$E1,$7F db $F8,$6F,$8A,$7F,$BF,$CF,$2A,$FC,$B6,$65,$55,$8E,$85,$24,$80,$18 db $65,$55,$53,$A5,$CA,$55,$67,$8F,$FE,$92,$AF,$47,$44,$7F,$E4,$AB db $38,$80,$E2,$CD,$7F,$CD,$72,$95,$FD,$A7,$53,$85,$28,$06,$88,$C9 db $80,$36,$E1,$EA,$19,$25,$C7,$67,$44,$00,$C3,$94,$4E,$1B,$FF,$F8 db $56,$80,$F2,$67,$62,$01,$8C,$E3,$8C,$44,$7E,$52,$64,$D4,$CD,$89 db $0A,$BC,$EC,$E0,$55,$8D,$8E,$BB,$9A,$00,$E0,$CF,$30,$7F,$DE,$F3 db $00,$A7,$22,$F5,$71,$7F,$55,$7F,$62,$ED,$C4,$80,$45,$E6,$18,$66 db $CE,$0C,$0B,$BC,$01,$FC,$7E,$3F,$7F,$11,$38,$80,$5F,$14,$CD,$BA db $39,$43,$0F,$CB,$04,$7F,$0E,$C7,$00,$67,$EA,$7E,$00,$37,$33,$7F db $E4,$DF,$80,$CD,$01,$FC,$37,$7F,$E1,$DB,$80,$83,$E3,$7F,$FB,$6B db $80,$6D,$EE,$7F,$FD,$AD,$80,$38,$3F,$EF,$7F,$B3,$52,$00,$AD,$3A db $8A,$7F,$7F,$F3,$7F,$6B,$80,$3E,$0F,$FF,$7F,$EC,$E7,$80,$E9,$3A db $3F,$FF,$00,$FE,$7F,$7E,$80,$7E,$64,$FF,$96,$FF,$03,$7F,$F8,$53 db $80,$A4,$39,$9F,$E9,$7C,$51,$FE,$FC,$17,$7F,$E2,$4A,$80,$BA,$99 db $6A,$8F,$EA,$3E,$7E,$EB,$95,$F6,$FF,$7F,$1E,$80,$5E,$28,$FE,$FE db $0F,$7F,$F1,$2F,$81,$65,$80,$C1,$FF,$FE,$1F,$C6,$7E,$7F,$2F,$82 db $24,$80,$B8,$BD,$FF,$7E,$96,$FF,$FF,$FC,$FC,$80,$AE,$29,$11,$9A db $FF,$F0,$E6,$3F,$F4,$0D,$FE,$7F,$7D,$04,$29,$83,$38,$AF,$FF,$00 db $E3,$63,$F4,$FF,$F4,$14,$81,$CE,$83,$24,$80,$7C,$87,$34,$22,$00 db $EE,$7E,$7F,$33,$04,$83,$12,$80,$3E,$41,$33,$40,$00,$00,$FD,$22 db $44,$80,$3E,$5F,$7E,$E9,$E5,$80,$63,$80,$E2,$3F,$33,$30,$7E,$A6 db $96,$80,$23,$80,$5E,$AA,$7D,$43,$AF,$33,$34,$7E,$FA,$88,$80,$EC db $38,$AA,$4B,$AA,$83,$23,$FA,$AA,$F3,$7E,$FA,$C8,$80,$E7,$88,$16 db $83,$4C,$00,$63,$AF,$08,$44,$7E,$FA,$C8,$80,$EA,$83,$53,$00,$83 db $34,$44,$7E,$FA,$F8,$80,$EF,$01,$BF,$7E,$EC,$2D,$85,$9E,$01,$8F db $40,$00,$00,$ED,$63,$FB,$FA,$2F,$00,$FF,$F8 ; ENDIF ; ds $c000 - $,$ff cbios-0.28/src/main_msx2+_br.asm0000644000000000000000000000412213137376076015200 0ustar rootroot; C-BIOS main ROM for a Brazillian MSX2+ machine ; ; Copyright (c) 2005 Maarten ter Huurne. All rights reserved. ; Copyright (c) 2005 Joost Yervante Damad. All rights reserved. ; Copyright (C) 2005 BouKiCHi. All rights reserved. ; Copyright (C) 2008 Eric Boon. All rights reserved. ; ; Redistribution and use in source and binary forms, with or without ; modification, are permitted provided that the following conditions ; are met: ; 1. Redistributions of source code must retain the above copyright ; notice, this list of conditions and the following disclaimer. ; 2. Redistributions in binary form must reproduce the above copyright ; notice, this list of conditions and the following disclaimer in the ; documentation and/or other materials provided with the distribution. ; ; THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ; OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ; IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ; NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ; include "hardware.asm" VDP: equ V9958 MODEL_MSX: equ MODEL_MSX2P ; -- generic brazillian config (60Hz, US keyboard layout, BR variant charset) LOCALE_CHSET: equ LOCAL_CHSET_US LOCALE_CHSET_VAR: equ LOCAL_CHSET_VAR_BR LOCALE_DATE: equ LOCAL_DATE_DMY LOCALE_INT: equ LOCAL_INT_60HZ LOCALE_KBD: equ LOCAL_KBD_US LOCALE_BASIC: equ LOCAL_BASIC_US COLOR_FORE: equ 15 COLOR_BACK: equ 4 COLOR_BORDER: equ 4 CALL_SUB: equ YES include "main.asm" ; vim:ts=8:expandtab:filetype=z8a:syntax=z8a: cbios-0.28/src/font_us.asm0000644000000000000000000004534513137376076014236 0ustar rootroot; Font data for C-BIOS. Font designed by Eric Boon. ; ; Copyright (c) 2004 Eric Boon. All rights reserved. ; ; Redistribution and use in source and binary forms, with or without ; modification, are permitted provided that the following conditions ; are met: ; 1. Redistributions of source code must retain the above copyright ; notice, this list of conditions and the following disclaimer. ; 2. Redistributions in binary form must reproduce the above copyright ; notice, this list of conditions and the following disclaimer in the ; documentation and/or other materials provided with the distribution. ; ; THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ; OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ; IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ; NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ; International version db $00,$00,$00,$00,$00,$00,$00,$00 ; 0 db $3C,$42,$A5,$A5,$C3,$BD,$42,$3C ; 1 db $3C,$7E,$DB,$DB,$BD,$C3,$7E,$3C ; 2 db $6C,$AA,$92,$44,$44,$28,$10,$00 ; 3 db $10,$28,$44,$82,$44,$28,$10,$00 ; 4 db $10,$38,$38,$D6,$FE,$D6,$38,$00 ; 5 db $10,$38,$7C,$7C,$FE,$D6,$38,$00 ; 6 db $00,$00,$00,$18,$18,$00,$00,$00 ; 7 db $FF,$FF,$FF,$E7,$E7,$FF,$FF,$FF ; 8 db $3C,$42,$81,$81,$81,$81,$42,$3C ; 9 db $C3,$BD,$7E,$7E,$7E,$7E,$BD,$C3 ; 10 db $0C,$04,$08,$70,$88,$88,$70,$00 ; 11 db $00,$70,$88,$88,$70,$20,$70,$20 ; 12 db $20,$30,$28,$28,$20,$E0,$C0,$00 ; 13 db $38,$3C,$24,$24,$E4,$DC,$18,$00 ; 14 db $10,$44,$38,$AA,$38,$44,$10,$00 ; 15 db $10,$10,$10,$38,$10,$10,$10,$10 ; 16 db $10,$10,$10,$EF,$00,$00,$00,$00 ; 17 db $00,$00,$00,$EF,$10,$10,$10,$10 ; 18 db $10,$10,$10,$E0,$10,$10,$10,$10 ; 19 db $10,$10,$10,$0F,$10,$10,$10,$10 ; 20 db $10,$10,$10,$EF,$10,$10,$10,$10 ; 21 db $10,$10,$10,$10,$10,$10,$10,$10 ; 22 db $00,$00,$00,$FF,$00,$00,$00,$00 ; 23 db $00,$00,$00,$0F,$10,$10,$10,$10 ; 24 db $00,$00,$00,$E0,$10,$10,$10,$10 ; 25 db $10,$10,$10,$0F,$00,$00,$00,$00 ; 26 db $10,$10,$10,$E0,$00,$00,$00,$00 ; 27 db $81,$42,$24,$18,$18,$24,$42,$81 ; 28 db $01,$02,$04,$08,$10,$20,$40,$80 ; 29 db $80,$40,$20,$10,$08,$04,$02,$01 ; 30 db $00,$00,$10,$FF,$10,$00,$00,$00 ; 31 db $00,$00,$00,$00,$00,$00,$00,$00 ; 32 db $20,$20,$20,$20,$00,$20,$00,$00 ; 33 db $50,$50,$00,$00,$00,$00,$00,$00 ; 34 db $00,$50,$F8,$50,$F8,$50,$00,$00 ; 35 db $20,$70,$A0,$70,$28,$70,$20,$00 ; 36 db $00,$C8,$D0,$20,$58,$98,$00,$00 ; 37 db $60,$90,$60,$A8,$98,$60,$00,$00 ; 38 db $40,$40,$00,$00,$00,$00,$00,$00 ; 39 db $20,$40,$40,$40,$40,$20,$00,$00 ; 40 db $20,$10,$10,$10,$10,$20,$00,$00 ; 41 db $00,$20,$A8,$70,$50,$88,$00,$00 ; 42 db $00,$20,$20,$F8,$20,$20,$00,$00 ; 43 db $00,$00,$00,$00,$00,$40,$40,$00 ; 44 db $00,$00,$00,$F8,$00,$00,$00,$00 ; 45 db $00,$00,$00,$00,$00,$40,$00,$00 ; 46 db $00,$08,$10,$20,$40,$80,$00,$00 ; 47 db $70,$88,$A8,$A8,$88,$70,$00,$00 ; 48 db $20,$60,$20,$20,$20,$70,$00,$00 ; 49 db $70,$88,$08,$70,$80,$F8,$00,$00 ; 50 db $F8,$08,$30,$08,$88,$70,$00,$00 ; 51 db $10,$30,$50,$F8,$10,$10,$00,$00 ; 52 db $F8,$80,$70,$08,$88,$70,$00,$00 ; 53 db $30,$40,$70,$88,$88,$70,$00,$00 ; 54 db $F8,$88,$10,$20,$20,$20,$00,$00 ; 55 db $70,$88,$70,$88,$88,$70,$00,$00 ; 56 db $70,$88,$88,$78,$08,$70,$00,$00 ; 57 db $00,$00,$40,$00,$00,$40,$00,$00 ; 58 db $00,$00,$40,$00,$00,$40,$40,$00 ; 59 db $00,$18,$60,$80,$60,$18,$00,$00 ; 60 db $00,$00,$F8,$00,$F8,$00,$00,$00 ; 61 db $00,$C0,$30,$08,$30,$C0,$00,$00 ; 62 db $70,$88,$30,$20,$00,$20,$00,$00 ; 63 db $70,$88,$98,$A8,$A8,$98,$40,$00 ; 64 db $70,$88,$88,$F8,$88,$88,$00,$00 ; 65 db $E0,$90,$E0,$90,$88,$F0,$00,$00 ; 66 db $70,$88,$80,$80,$88,$70,$00,$00 ; 67 db $F0,$48,$48,$48,$48,$F0,$00,$00 ; 68 db $F8,$80,$E0,$80,$80,$F8,$00,$00 ; 69 db $F8,$80,$80,$E0,$80,$80,$00,$00 ; 70 db $70,$88,$80,$B8,$88,$70,$00,$00 ; 71 db $88,$88,$F8,$88,$88,$88,$00,$00 ; 72 db $70,$20,$20,$20,$20,$70,$00,$00 ; 73 db $38,$08,$08,$08,$88,$70,$00,$00 ; 74 db $88,$90,$A0,$E0,$90,$88,$00,$00 ; 75 db $80,$80,$80,$80,$80,$F8,$00,$00 ; 76 db $D8,$A8,$A8,$88,$88,$88,$00,$00 ; 77 db $C8,$A8,$A8,$98,$98,$88,$00,$00 ; 78 db $70,$88,$88,$88,$88,$70,$00,$00 ; 79 db $F0,$88,$88,$F0,$80,$80,$00,$00 ; 80 db $70,$88,$88,$A8,$90,$68,$00,$00 ; 81 db $F0,$88,$88,$F0,$A0,$98,$00,$00 ; 82 db $70,$80,$70,$08,$08,$F0,$00,$00 ; 83 db $F8,$20,$20,$20,$20,$20,$00,$00 ; 84 db $88,$88,$88,$88,$88,$78,$00,$00 ; 85 db $88,$88,$88,$50,$50,$20,$00,$00 ; 86 db $88,$88,$A8,$A8,$A8,$D8,$00,$00 ; 87 db $88,$50,$20,$50,$88,$88,$00,$00 ; 88 db $88,$88,$70,$20,$20,$20,$00,$00 ; 89 db $F8,$10,$20,$40,$80,$F8,$00,$00 ; 90 db $70,$40,$40,$40,$40,$70,$00,$00 ; 91 db $00,$80,$40,$20,$10,$08,$00,$00 ; 92 db $70,$10,$10,$10,$10,$70,$00,$00 ; 93 db $40,$A0,$00,$00,$00,$00,$00,$00 ; 94 db $00,$00,$00,$00,$00,$00,$F8,$00 ; 95 db $20,$10,$00,$00,$00,$00,$00,$00 ; 96 db $00,$00,$78,$88,$98,$68,$00,$00 ; 97 db $80,$80,$F0,$88,$88,$F0,$00,$00 ; 98 db $00,$00,$78,$80,$80,$78,$00,$00 ; 99 db $08,$08,$78,$88,$88,$78,$00,$00 ; 100 db $00,$00,$70,$98,$E0,$78,$00,$00 ; 101 db $30,$48,$40,$40,$E0,$40,$40,$40 ; 102 db $00,$00,$78,$88,$88,$78,$08,$70 ; 103 db $80,$80,$F0,$88,$88,$88,$00,$00 ; 104 db $20,$00,$60,$20,$20,$70,$00,$00 ; 105 db $10,$00,$30,$10,$10,$10,$10,$60 ; 106 db $80,$80,$98,$A0,$E0,$98,$00,$00 ; 107 db $C0,$40,$40,$40,$40,$70,$00,$00 ; 108 db $00,$00,$F0,$A8,$A8,$A8,$00,$00 ; 109 db $00,$00,$F0,$88,$88,$88,$00,$00 ; 110 db $00,$00,$70,$88,$88,$70,$00,$00 ; 111 db $00,$00,$F0,$88,$88,$F0,$80,$80 ; 112 db $00,$00,$78,$88,$88,$78,$08,$08 ; 113 db $00,$00,$B8,$C0,$80,$80,$00,$00 ; 114 db $00,$00,$78,$F0,$08,$F0,$00,$00 ; 115 db $40,$40,$F0,$40,$48,$30,$00,$00 ; 116 db $00,$00,$88,$88,$88,$78,$00,$00 ; 117 db $00,$00,$88,$88,$50,$20,$00,$00 ; 118 db $00,$00,$88,$A8,$A8,$D8,$00,$00 ; 119 db $00,$00,$C8,$30,$60,$98,$00,$00 ; 120 db $00,$00,$88,$88,$88,$78,$08,$70 ; 121 db $00,$00,$F8,$30,$40,$F8,$00,$00 ; 122 db $10,$20,$20,$40,$20,$20,$10,$00 ; 123 db $20,$20,$20,$20,$20,$20,$20,$00 ; 124 db $40,$20,$20,$10,$20,$20,$40,$00 ; 125 db $50,$A0,$00,$00,$00,$00,$00,$00 ; 126 db $00,$20,$50,$50,$F8,$00,$00,$00 ; 127 db $70,$88,$80,$80,$88,$70,$20,$40 ; 128 db $50,$00,$88,$88,$88,$78,$00,$00 ; 129 db $08,$10,$70,$98,$E0,$78,$00,$00 ; 130 db $20,$50,$78,$88,$98,$68,$00,$00 ; 131 db $50,$00,$78,$88,$98,$68,$00,$00 ; 132 db $40,$20,$78,$88,$98,$68,$00,$00 ; 133 db $20,$00,$78,$88,$98,$68,$00,$00 ; 134 db $00,$00,$78,$80,$80,$78,$20,$40 ; 135 db $20,$50,$70,$98,$E0,$78,$00,$00 ; 136 db $50,$00,$70,$98,$E0,$78,$00,$00 ; 137 db $40,$20,$70,$98,$E0,$78,$00,$00 ; 138 db $50,$00,$60,$20,$20,$70,$00,$00 ; 139 db $20,$50,$60,$20,$20,$70,$00,$00 ; 140 db $40,$20,$60,$20,$20,$70,$00,$00 ; 141 db $50,$70,$88,$88,$F8,$88,$00,$00 ; 142 db $20,$70,$88,$88,$F8,$88,$00,$00 ; 143 db $18,$F8,$80,$E0,$80,$F8,$00,$00 ; 144 db $00,$00,$D0,$68,$B0,$D8,$00,$00 ; 145 db $78,$A0,$B0,$E0,$A0,$B8,$00,$00 ; 146 db $20,$50,$70,$88,$88,$70,$00,$00 ; 147 db $50,$00,$70,$88,$88,$70,$00,$00 ; 148 db $40,$20,$70,$88,$88,$70,$00,$00 ; 149 db $20,$50,$88,$88,$88,$78,$00,$00 ; 150 db $40,$20,$88,$88,$88,$78,$00,$00 ; 151 db $50,$00,$88,$88,$88,$78,$08,$70 ; 152 db $50,$70,$88,$88,$88,$70,$00,$00 ; 153 db $50,$88,$88,$88,$88,$70,$00,$00 ; 154 db $20,$20,$78,$80,$80,$78,$20,$20 ; 155 db $20,$50,$40,$E0,$40,$48,$B0,$00 ; 156 db $88,$88,$50,$F8,$20,$70,$20,$00 ; 157 db $80,$D0,$B0,$B0,$B8,$D0,$88,$80 ; 158 db $38,$40,$F0,$40,$F0,$40,$38,$00 ; 159 db $08,$10,$78,$88,$98,$68,$00,$00 ; 160 db $10,$20,$60,$20,$20,$70,$00,$00 ; 161 db $10,$20,$70,$88,$88,$70,$00,$00 ; 162 db $10,$20,$88,$88,$88,$78,$00,$00 ; 163 db $28,$50,$F0,$88,$88,$88,$00,$00 ; 164 db $28,$D0,$A8,$A8,$98,$88,$00,$00 ; 165 db $00,$00,$78,$88,$98,$68,$00,$70 ; 166 db $00,$00,$70,$88,$88,$70,$00,$70 ; 167 db $20,$00,$20,$60,$88,$70,$00,$00 ; 168 db $00,$00,$00,$E0,$80,$00,$00,$00 ; 169 db $00,$00,$00,$E0,$20,$00,$00,$00 ; 170 db $40,$48,$50,$30,$48,$90,$38,$00 ; 171 db $40,$48,$50,$28,$58,$B8,$08,$00 ; 172 db $20,$00,$20,$20,$20,$20,$00,$00 ; 173 db $00,$00,$00,$48,$90,$48,$00,$00 ; 174 db $00,$00,$00,$90,$48,$90,$00,$00 ; 175 db $28,$50,$70,$88,$F8,$88,$00,$00 ; 176 db $28,$50,$78,$88,$98,$68,$00,$00 ; 177 db $28,$50,$70,$20,$20,$70,$00,$00 ; 178 db $28,$50,$60,$20,$20,$70,$00,$00 ; 179 db $28,$70,$88,$88,$88,$70,$00,$00 ; 180 db $28,$50,$70,$88,$88,$70,$00,$00 ; 181 db $28,$50,$88,$88,$88,$78,$00,$00 ; 182 db $28,$50,$00,$88,$88,$78,$00,$00 ; 183 db $FC,$48,$48,$48,$48,$E8,$08,$30 ; 184 db $48,$00,$D8,$48,$48,$E8,$08,$30 ; 185 db $E0,$68,$30,$E8,$58,$B8,$08,$00 ; 186 db $50,$28,$00,$00,$00,$00,$00,$00 ; 187 db $00,$20,$50,$88,$50,$20,$00,$00 ; 188 db $00,$48,$50,$20,$68,$A8,$00,$00 ; 189 db $7C,$A8,$A8,$A8,$68,$28,$28,$44 ; 190 db $70,$80,$70,$88,$70,$08,$88,$70 ; 191 db $00,$00,$00,$00,$00,$00,$FF,$FF ; 192 db $F0,$F0,$F0,$F0,$0F,$0F,$0F,$0F ; 193 db $00,$00,$FF,$FF,$FF,$FF,$FF,$FF ; 194 db $FF,$FF,$00,$00,$00,$00,$00,$00 ; 195 db $00,$00,$00,$3C,$3C,$00,$00,$00 ; 196 db $FF,$FF,$FF,$FF,$FF,$FF,$00,$00 ; 197 db $C0,$C0,$C0,$C0,$C0,$C0,$C0,$C0 ; 198 db $0F,$0F,$0F,$0F,$F0,$F0,$F0,$F0 ; 199 db $FC,$FC,$FC,$FC,$FC,$FC,$FC,$FC ; 200 db $03,$03,$03,$03,$03,$03,$03,$03 ; 201 db $3F,$3F,$3F,$3F,$3F,$3F,$3F,$3F ; 202 db $11,$22,$44,$88,$11,$22,$44,$88 ; 203 db $88,$44,$22,$11,$88,$44,$22,$11 ; 204 db $FE,$7C,$38,$10,$00,$00,$00,$00 ; 205 db $00,$00,$00,$00,$10,$38,$7C,$FE ; 206 db $80,$C0,$E0,$F0,$E0,$C0,$80,$00 ; 207 db $01,$03,$07,$0F,$07,$03,$01,$00 ; 208 db $FF,$7E,$3C,$18,$18,$3C,$7E,$FF ; 209 db $81,$C3,$E7,$FF,$FF,$E7,$C3,$81 ; 210 db $F0,$F0,$F0,$F0,$00,$00,$00,$00 ; 211 db $00,$00,$00,$00,$0F,$0F,$0F,$0F ; 212 db $0F,$0F,$0F,$0F,$00,$00,$00,$00 ; 213 db $00,$00,$00,$00,$F0,$F0,$F0,$F0 ; 214 db $33,$33,$CC,$CC,$33,$33,$CC,$CC ; 215 db $00,$10,$28,$28,$7C,$00,$00,$00 ; 216 db $10,$10,$38,$10,$38,$10,$10,$00 ; 217 db $00,$00,$50,$88,$A8,$50,$00,$00 ; 218 db $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF ; 219 db $00,$00,$00,$00,$FF,$FF,$FF,$FF ; 220 db $F0,$F0,$F0,$F0,$F0,$F0,$F0,$F0 ; 221 db $0F,$0F,$0F,$0F,$0F,$0F,$0F,$0F ; 222 db $FF,$FF,$FF,$FF,$00,$00,$00,$00 ; 223 db $00,$00,$68,$90,$90,$68,$00,$00 ; 224 db $60,$90,$E0,$90,$90,$E0,$80,$00 ; 225 db $F8,$88,$80,$80,$80,$80,$00,$00 ; 226 db $F8,$50,$50,$50,$50,$48,$80,$00 ; 227 db $F8,$48,$20,$40,$88,$F8,$00,$00 ; 228 db $00,$00,$78,$90,$88,$70,$00,$00 ; 229 db $00,$00,$88,$88,$C8,$B0,$80,$80 ; 230 db $00,$00,$50,$50,$20,$50,$50,$20 ; 231 db $70,$20,$70,$A8,$A8,$70,$20,$70 ; 232 db $70,$88,$F8,$88,$88,$70,$00,$00 ; 233 db $70,$88,$88,$88,$50,$D8,$00,$00 ; 234 db $30,$40,$30,$48,$48,$30,$00,$00 ; 235 db $00,$00,$50,$A8,$A8,$50,$00,$00 ; 236 db $00,$10,$70,$A8,$A8,$70,$40,$00 ; 237 db $00,$70,$80,$E0,$80,$70,$00,$00 ; 238 db $70,$88,$88,$88,$88,$88,$00,$00 ; 239 db $00,$F8,$00,$F8,$00,$F8,$00,$00 ; 240 db $00,$20,$20,$F8,$20,$20,$F8,$00 ; 241 db $00,$C0,$30,$08,$30,$C0,$F8,$00 ; 242 db $00,$18,$60,$80,$60,$18,$F8,$00 ; 243 db $00,$18,$20,$20,$20,$20,$20,$20 ; 244 db $20,$20,$20,$20,$20,$20,$C0,$00 ; 245 db $00,$20,$00,$F8,$00,$20,$00,$00 ; 246 db $00,$68,$B0,$00,$68,$B0,$00,$00 ; 247 db $00,$30,$48,$48,$30,$00,$00,$00 ; 248 db $00,$30,$78,$78,$30,$00,$00,$00 ; 249 db $00,$00,$00,$00,$30,$00,$00,$00 ; 250 db $1C,$10,$10,$90,$50,$30,$10,$00 ; 251 db $E0,$90,$90,$00,$00,$00,$00,$00 ; 252 db $60,$10,$60,$F0,$00,$00,$00,$00 ; 253 db $00,$70,$70,$70,$70,$70,$70,$00 ; 254 db $AA,$55,$AA,$55,$AA,$55,$AA,$55 ; 255 cbios-0.28/src/debug.asm0000644000000000000000000000657113137376076013645 0ustar rootroot; C-BIOS debug routines ; These routines should not be used in release builds of C-BIOS, but they can ; be useful for developers and testers. ; ; Copyright (c) 2004 Maarten ter Huurne. All rights reserved. ; ; Redistribution and use in source and binary forms, with or without ; modification, are permitted provided that the following conditions ; are met: ; 1. Redistributions of source code must retain the above copyright ; notice, this list of conditions and the following disclaimer. ; 2. Redistributions in binary form must reproduce the above copyright ; notice, this list of conditions and the following disclaimer in the ; documentation and/or other materials provided with the distribution. ; ; THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ; OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ; IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ; NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ; ;-------------------------------- ; Print string to openMSX debug device as a separate line. ; Input: HL = address of zero-terminated string ; Changes: HL, AF print_debug: ld a,$23 out (DBG_CTRL),a call print_debug_asciiz ld a,$00 out (DBG_CTRL),a ret ;-------------------------------- ; Print string to openMSX debug device as part of an existing line. ; Input: HL = address of zero-terminated string ; Changes: HL, AF print_debug_asciiz: ld a,(hl) inc hl or a ret z out (DBG_DATA),a jr print_debug_asciiz ;-------------------------------- ; Print nibble in hexidecimal format as part of an existing line. ; Input: A = nibble to print (bit 7-4 are ignored) ; Changes: AF print_debug_hexnibble: and $0F cp 10 jr nc,print_debug_hexnibble_letter add a,'0' out (DBG_DATA),a ret print_debug_hexnibble_letter: add a,'A' - 10 out (DBG_DATA),a ret ;-------------------------------- ; Print byte in hexidecimal format as part of an existing line. ; Input: A = byte to print ; Changes: AF print_debug_hexbyte: push af rrca rrca rrca rrca call print_debug_hexnibble pop af call print_debug_hexnibble ret ;-------------------------------- ; Print word in hexidecimal format as part of an existing line. ; Input: HL = word to print ; Changes: HL, AF print_debug_hexword: ld a,h call print_debug_hexbyte ld a,l call print_debug_hexbyte ret cbios-0.28/src/font.asm0000644000000000000000000000306113137376076013514 0ustar rootroot; Font data for C-BIOS. ; ; Copyright (c) 2010 Manuel Bilderbeek. All rights reserved. ; ; Redistribution and use in source and binary forms, with or without ; modification, are permitted provided that the following conditions ; are met: ; 1. Redistributions of source code must retain the above copyright ; notice, this list of conditions and the following disclaimer. ; 2. Redistributions in binary form must reproduce the above copyright ; notice, this list of conditions and the following disclaimer in the ; documentation and/or other materials provided with the distribution. ; ; THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ; OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ; IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ; NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. B_Font: IF LOCALE_CHSET = LOCAL_CHSET_JP include "font_jp.asm" ELSE IF LOCALE_CHSET_VAR = LOCAL_CHSET_VAR_BR include "font_br.asm" ELSE include "font_us.asm" ENDIF ENDIF cbios-0.28/src/main.asm0000644000000000000000000026664013137376076013510 0ustar rootroot; C-BIOS main ROM ; ; Copyright (c) 2002-2005 BouKiCHi. All rights reserved. ; Copyright (c) 2003 Reikan. All rights reserved. ; Copyright (c) 2004-2005 Maarten ter Huurne. All rights reserved. ; Copyright (c) 2004-2009 Albert Beevendorp. All rights reserved. ; Copyright (c) 2004 Manuel Bilderbeek. All rights reserved. ; Copyright (c) 2004-2005 Joost Yervante Damad. All rights reserved. ; Copyright (c) 2004-2005 Jussi Pitkänen. All rights reserved. ; Copyright (c) 2006-2007 Eric Boon. All rights reserved. ; ; Redistribution and use in source and binary forms, with or without ; modification, are permitted provided that the following conditions ; are met: ; 1. Redistributions of source code must retain the above copyright ; notice, this list of conditions and the following disclaimer. ; 2. Redistributions in binary form must reproduce the above copyright ; notice, this list of conditions and the following disclaimer in the ; documentation and/or other materials provided with the distribution. ; ; THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ; OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ; IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ; NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ; include "systemvars.asm" include "hooks.asm" ;----------------- ; A memory address for debug ;----------------- DISPADDR: equ $E010 ; Memory for dump routine LASTSTAC: equ $E000 SP_REGS: equ $E002 COMPILE_FONT: equ YES ;--------------------- ; Jump table ;--------------------- ; $0000 CHKRAM org $0000 di jp chkram ; Pointer to font ; $0004 CGTABL Base address of the MSX character set in ROM ds $0004 - $ dw B_Font ds $0006 - $ ; $0006 VDP.DR Base port address for VDP data read vdp_dr: db VDP_DATA ; VDP read port ; $0007 VDP.WR Base port address for VDP data write vdp_dw: db VDP_DATA ; VDP write port ; $0008 SYNCHR ds $0008 - $ jp synchr ; $000C RDSLT Read memory from an optional slot ds $000C - $ jp rdslt ; $0010 CHRGTR ds $0010 - $ jp chrgtr ; $0014 WRSLT Write memory to an optional slot ds $0014 - $ jp wrslt ; $0018 OUTDO ds $0018 - $ jp outdo ; $001C CALSLT inter slot call routine ds $001C - $ jp calslt ; $0020 DCOMPR Compare HL to DE ds $0020 - $ jp dcompr ; $0024 ENASLT Change slot ds $0024 - $ jp enaslt ; $0028 GETYPR ds $0028 - $ jp getypr ; $002B IDBYT1 ds $002B - $ idbyt1: ; Basic ROM version ; 7 6 5 4 3 2 1 0 ; | | | | +-+-+-+-- Character set ; | | | | 0 = Japanese, 1 = International (ASCII), 2=Korean ; | +-+-+---------- Date format ; | 0 = Y-M-D, 1 = M-D-Y, 2 = D-M-Y ; +---------------- Default interrupt frequency ; 0 = 60Hz, 1 = 50Hz db LOCALE_CHSET + LOCALE_DATE + LOCALE_INT ; $002C IDBYT2 idbyt2: ; Basic ROM version ; 7 6 5 4 3 2 1 0 ; | | | | +-+-+-+-- Keyboard type ; | | | | 0 = Japanese, 1 = International (QWERTY) ; | | | | 2 = French (AZERTY), 3 = UK, 4 = German (DIN) ; +-+-+-+---------- Basic version ; 0 = Japanese, 1 = International db LOCALE_KBD + LOCALE_BASIC ; $002D Version ID romid: ds $002D - $ ; version ID ; MSX version number ; 0 = MSX 1 ; 1 = MSX 2 ; 2 = MSX 2+ ; 3 = MSX turbo R db MODEL_MSX ; Bit 0: if 1 then MSX-MIDI is present internally (MSX turbo R only) IF MODEL_MSX = MODEL_MSXTR db 1 ELSE db 0 ENDIF ; Reserved db 0 ; $0030 CALLF Call interslot routine(RST30h version) ds $0030 - $ jp callf ; $0038 KEYINT Interrupt routines(RST38,VBlank,Timer...) ds $0038 - $ jp keyint ; $003B INITIO Initialize I/O ds $003B - $ jp initio ; $003E INIFNK ds $003E - $ jp inifnk ; $0041 DISSCR Disable screen display ds $0041 - $ jp disscr ; $0044 ENASCR Enable screen display ds $0044 - $ jp enascr ;--------------- ;VDP routines ;--------------- ; $0047 WRTVDP ds $0047 - $ jp wrtvdp ; $004A RDVRM ds $004A - $ jp rdvrm ; $004D WRTVRM ds $004D - $ jp wrtvrm ; $0050 SETRD ds $0050 - $ jp setrd ; $0053 SETWRT Set VRAM Write Address ds $0053 - $ jp setwrt ; $0056 FILVRM Fill VRAM ds $0056 - $ jp filvrm ; $0059 LDIRMV Copy VRAM to RAM ds $0059 - $ jp ldirmv ; $005C LDIRVM Copy RAM to VRAM ds $005C - $ jp ldirvm ; $005F CHGMOD Change VDP screen mode ds $005F - $ jp chgmod ; $0062 CHGCLR ds $0062 - $ jp chgclr ; $0066 NMI Non-maskable interrupt ds $0066 - $ jp nmi ; $0069 CLRSPR Clear sprites ds $0069 - $ jp clrspr ; $006C INITXT Initialize display to mode TEXT1 (SCREEN 0) ds $006C - $ jp initxt ; $006F INIT32 Initialize display to mode GRAPHIC1 (SCREEN 1) ds $006F - $ jp init32 ; $0072 INITGRP Initialize display to mode GRAPHIC2 (SCREEN 2) ds $0072 - $ jp inigrp ; $0075 INIMLT Initialize display to mode MULTI (SCREEN 3) ds $0075 - $ jp inimlt ; $0078 SETTXT ds $0078 - $ jp settxt ; $007B SETT32 ds $007B - $ jp sett32 ; $007E SETGRP ds $007E - $ jp setgrp ; $0081 SETMLT ds $0081 - $ jp setmlt ; $0084 CALPAT ds $0084 - $ jp calpat ; $0087 CALATR ds $0087 - $ jp calatr ; $008A GSPSIZ ds $008A - $ jp gspsiz ; $008D GRPPRT ds $008D - $ jp grpprt ; $0090 GICINI initialize sound IC ds $0090 - $ jp gicini ; $0093 WRTPSG ds $0093 - $ jp wrtpsg ; $0096 RDPSG ds $0096 - $ jp rdpsg ; $0099 STRTMS ds $0099 - $ jp strtms ; $009C CHSNS .. check key buffer ds $009C - $ jp chsns ; $009F CHGET .. Get data from keyboard buffer ds $009F - $ jp chget ; $00A2 CHPUT .. Output charactor to display ds $00A2 - $ jp chput ; $00A5 LPTOUT ds $00A5 - $ jp lptout ; $00A8 LPTSTT ds $00A8 - $ jp lptstt ; $00AB CNVCHR ds $00AB - $ jp cnvchr ; $00AE PINLIN ds $00AE - $ jp pinlin ; $00B1 INLIN ds $00B1 - $ jp inlin ; $00B4 QINLIN ds $00B4 - $ jp qinlin ; $00B7 BREAKX ds $00B7 - $ jp breakx ; $00BA ISCNTC ds $00BA - $ jp iscntc ; $00BD CKCNTC ds $00BD - $ jp ckcntc ; $00C0 BEEP ds $00C0 - $ jp beep ; $00C3 CLS ds $00C3 - $ jp cls_z ; $00C6 POSIT ds $00C6 - $ jp posit ; $00C9 FNKSB ds $00C9 - $ jp fnksb ; $00CC ERAFNK ds $00CC - $ jp erafnk ; $00CF DSPFNK ds $00CF - $ jp dspfnk ; $00D2 TOTEXT ds $00D2 - $ jp totext ; $00D5 GTSTCK .. Get joystick infomation ds $00D5 - $ jp gtstck ; $00D8 GTTRIG .. Get trigger infomation ds $00D8 - $ jp gttrig ; $00DB GTPAD ds $00DB - $ jp gtpad ; $00DE GTPDL ds $00DE - $ jp gtpdl ; $00E1 TAPION ds $00E1 - $ jp tapion ; $00E4 TAPIN ds $00E4 - $ jp tapin ; $00E7 TAPIOF ds $00E7 - $ jp tapiof ; $00EA TAPOON ds $00EA - $ jp tapoon ; $00ED TAPOUT ds $00ED - $ jp tapout ; $00F0 TAPOOF ds $00F0 - $ jp tapoof ; $00F3 STMOTR ds $00F3 - $ jp stmotr ; $00F6 LFTQ ds $00F6 - $ jp lftq ; $00F9 PUTQ ds $00F9 - $ jp putq ; $00FC RIGHTC ds $00FC - $ jp rightc ; $00FF LEFTC ds $00FF - $ jp leftc ; $0102 UPC ds $0102 - $ jp upc ; $0105 TUPC ds $0105 - $ jp tupc ; $0108 DOWNC ds $0108 - $ jp downc ; $010B TDOWNC ds $010B - $ jp tdownc ; $010E SCALXY ds $010E - $ jp scalxy ; $0111 MAPXY ds $0111 - $ jp mapxy ; $0114 FETCHC ds $0114 - $ jp fetchc ; $0117 STOREC ds $0117 - $ jp storec ; $011A SETATR ds $011A - $ jp setatr ; $011D READC ds $011D - $ jp readc ; $0120 SETC ds $0120 - $ jp setc ; $0123 NSETCX ds $0123 - $ jp nsetcx ; $0126 GTASPC ds $0126 - $ jp gtaspc ; $0129 PNTINI ds $0129 - $ jp pntini ; $012C SCANR ds $012C - $ jp scanr ; $012F SCANL ds $012F - $ jp scanl ; $0132 CHGCAP ds $0132 - $ jp chgcap ; $0135 CHGSND ds $0135 - $ jp chgsnd ; $0138 RSLREG Read infomation of primary slot ds $0138 - $ jp rslreg ; $013B WSLREG Write infomation to primary slot ds $013B - $ jp wslreg ; $013E RDVDP Read VDP status ds $013E - $ jp rdvdp ; $0141 SNSMAT Get key matrix ds $0141 - $ jp snsmat ; $0144 PHYDIO ds $0144 - $ jp phydio ; $0147 FORMAT ds $0147 - $ jp format ; $014A ISFLIO ds $014A - $ jp isflio ; $014D OUTDLP ds $014D - $ jp outdlp ; $0150 GETVCP ds $0150 - $ jp getvcp ; $0153 GETVC2 ds $0153 - $ jp getvc2 ; $0156 KILBUF Clear keyboard buffer ds $0156 - $ jp kilbuf ; $0159 CALBAS Call BASIC interpreter ds $0159 - $ jp calbas IF VDP = TMS99X8 ; fake EXTROM call, fixes Nemesis 3 reset bug ds $015f - $ ret ELSE ; --------------- ; MSX2 BIOS calls ; --------------- ; $015C SUBROM Calls a routine in the subrom. ds $015C - $ jp subrom ; $015F EXTROM Calls a routine in the subrom. ds $015F - $ jp extrom ; $0162 CHKSLZ Search slots for the subrom ds $0162 - $ jp chkslz ; $0165 CHKNEW Is the current screen mode a bitmap mode? ds $0165 - $ jp chknew ; $0168 EOL Deletes to the end of the line ds $0168 - $ jp eol ; $016B BIGFIL Like FILVRM, but supports 128K of VRAM. ds $016B - $ jp bigfil ; $016E NSETRD Like SETRD, but supports 128K of VRAM. ds $016E - $ jp nsetrd ; $0171 NSETWR Like SETWRT, but supports 128K of VRAM. ds $0171 - $ jp nsetwr ; $0174 NRDVRM Like RDVRM, but supports 128K of VRAM. ds $0174 - $ jp nrdvrm ; $0177 NWRVRM Like WRTVRM, but supports 128K of VRAM. ds $0177 - $ jp nwrvrm ENDIF IF VDP = V9958 ; ---------------- ; MSX2+ BIOS calls ; ---------------- ; $017A RDRES ds $017A - $ jp rdres ; $017D WRRES ds $017D - $ jp wrres ENDIF ; --------------------- ; MSX TurboR BIOS calls ; --------------------- ; $0180 CHGCPU ; $0183 GETCPU ; $0186 PCMPLY ; $0189 PCMREC ; ------------------- ds $0200 - $ include "util.asm" ;include "slot.asm" include "video.asm" include "debug.asm" ; The game "Hacker" jumps directly to this location($0D02). ; Star force calls $0D0E. ds $0D01 - $ ; for all wrong jumper,put RET instruction there ret pop ix ; $0D02 pop iy pop af pop bc pop de pop hl exx ex af,af' pop af pop bc pop de pop hl ei ret ; $0000 CHKRAM ; Function : Tests RAM and sets RAM slot for the system ; Registers: All ; Remark : After this, a jump must be made to INIT, for further initialisation. chkram: ; Initialize interface ld a,$82 out (PPI_REGS),a ld a,$50 out (GIO_REGS),a ; Initialize memory bank xor a out (MAP_REG4),a inc a out (MAP_REG3),a inc a out (MAP_REG2),a inc a out (MAP_REG1),a ; Select the longest contiguous memory area for pages 3 and 2. ld hl,$FFFF ; Keep the current best values in the exx ; alternative register set (HL and BC). ; For each primary slot: in a,(PSL_STAT) or $F0 ld b,a chkram_pslot: ; Select primary slot. ld a,b out (PSL_STAT),a ; For each secondary slot: ; Note that we do not check if the secondary slot is actually ; available: in case there is no secondary slot, we do the same ; test four times for the same primary slot. ld a,(SSL_REGS) cpl or $F0 ld c,a chkram_sslot: ld a,c ld (SSL_REGS),a ; Find the longest contiguous memory area for this slot ; configuration. Note that there is always ROM in pages ; 1 and 0. ld hl,$FF00 chkram_find: ld a,$0F ld (hl),a cp (hl) jr nz,chkram_find_end cpl ld (hl),a cp (hl) jr nz,chkram_find_end dec h jr chkram_find chkram_find_end: inc h ; Update the best values. ld a,h or a jr z,chkram_sslot_end exx cp h jr c,chkram_update jr z,chkram_update exx jr chkram_sslot_end chkram_update: ld l,0 ; Fix the L register to indicate that ld h,a ; RAM is found. exx ld a,b exx ld b,a exx ld a,c exx ld c,a exx chkram_sslot_end: ld a,c sub $10 ld c,a jr nc,chkram_sslot chkram_pslot_end: ld a,b sub $10 ld b,a jr nc,chkram_pslot ; Select the longest contiguous memory area. exx ld a,l or a jr z,chkram_select ld de,str_memory_err jp print_error chkram_select: ld a,b out (PSL_STAT),a ld a,c ld (SSL_REGS),a ; HL contains the start of the memory area (for BOTTOM variable). exx ;---------------------- ; User interface ;---------------------- ld hl,$F300 ld sp,hl ; set $F300 to stack pointer call init_ram call check_expanded IF VDP != TMS99X8 call chksubpos ENDIF call init_vdp ei call initio ld b,15 ld de,logo_ident ld hl,$8000 logo_check: push bc push hl push de ld a,(EXPTBL) call rdslt pop hl pop de pop bc cp (hl) jr nz,logo_none ex de,hl inc de inc hl djnz logo_check ld ix,$8010 ld iy,(EXPTBL -1) call calslt jr logo_done logo_none: ld a,5 ld (BAKCLR),a ld (BDRCLR),a call init32 ld hl,str_proginfo call prn_text logo_done: IF VDP != TMS99X8 di ld a,4 out (VDP_ADDR),a ld a,$8E out (VDP_ADDR),a xor a out (VDP_ADDR),a or $40 out (VDP_ADDR),a ld a,$76 out (VDP_DATA),a xor a out (VDP_ADDR),a ld hl,MODE out (VDP_ADDR),a in a,(VDP_DATA) cp $76 jr z,vramsize_128K set 1,(hl) jr vramsize_done vramsize_128K: set 2,(hl) vramsize_done: xor a out (VDP_ADDR),a ld a,$8E out (VDP_ADDR),a ENDIF ei ld b,120 call wait_b IF VDP != TMS99X8 call vram_clear ENDIF ld a,COLOR_BORDER ld (BDRCLR),a ld a,COLOR_BACK ld (BAKCLR),a ld a,COLOR_FORE ld (FORCLR),a ld a,29 ld (LINL32),a call init32 IF VDP != TMS99X8 ld ix,$0141 ; call INIPLT call extrom ENDIF ld hl,str_proginfo call prn_text call search_roms call H_STKE call run_basic_roms ; Set up hooks and system vars so NMS8250 disk ROM will try ; to load and execute the boot sector. ld a,1 ld (DEVICE),a xor a ; TODO: Find out or invent name for $FB29. ld ($FB29),a ; This is the hook the disk ROM uses for booting. call H_RUNC ; We couldn't boot anything, instead show disk contents. ; TODO: This breaks boot of MG2, so disabled for now. ; jp disk_intr ; ret ; goto stack_error ld hl,str_nocart call prn_text jp hang_up_mode logo_ident: db "C-BIOS Logo ROM" ;---------------------- ; Search for any extension ROMs and initialize them. search_roms: ; Clear SLTATR. ld hl,SLTATR ld de,SLTATR+1 ld bc,4*4*4-1 ld (hl),0 ldir ; Search for ROMs. ld hl,EXPTBL xor a ; A = input for RDSLT search_roms_lp: push hl or (hl) search_roms_lp_sub: ld hl,$4000 call search_roms_check call z,search_roms_init ld hl,$8000 call search_roms_check call z,search_roms_init search_roms_no: bit 7,a jr z,search_roms_next_slot add a,4 ; Select next subslot. bit 4,a jr z,search_roms_lp_sub search_roms_next_slot: pop hl ; Select next slot. inc hl inc a and $03 jr nz,search_roms_lp ret ; Helper routine to read two bytes from a given slot. search_roms_read: ld b,a ; Save the input for RDSLT in B. call rdslt inc hl push af ld a,b call rdslt inc hl ld d,a pop af ld e,a ld a,b ret ; Check whether the ROM is present or not. search_roms_check: push hl call search_roms_read ld hl,$4241 ; "AB" call dcompr ; ZF is set if the ROM is present. ld a,b pop hl ret ; Initialize the ROM and set up the related system variables. search_roms_init: ; Output a message to show that a ROM is found. push hl push af ld hl,str_slot call prn_text pop af push af ld b,a and $03 add a,'0' call chput ld a,b bit 7,b jr z,search_roms_init_skip ld a,'.' call chput ld a,b rrca rrca and $03 add a,'0' call chput search_roms_init_skip: ld a,$0D call chput ld a,$0A call chput pop af pop hl ; Read the initialization address and initialize the ROM. inc hl inc hl call search_roms_address jr z,search_roms_init_statement ; Reg.C is using some games for slot number ld c,a push de pop ix push af pop iy ; Some cartridges have buggy initialisation code. ; By postponing the interrupt as long as possible, ; there is a better chance they will boot correctly. ; For example the game "Koronis Rift" depends on this. search_roms_init_waitv: in a,($99) or a jp m,search_roms_init_waitv push af push hl call calslt di pop hl pop af ; Check if the addresses are valid. search_roms_init_statement: ld c,0 call search_roms_address jr z,search_roms_init_device set 5,c search_roms_init_device: call search_roms_address jr z,search_roms_init_basic set 6,c search_roms_init_basic: call search_roms_address jr z,search_roms_init_variables set 7,c ; Set up the related system variables. search_roms_init_variables: ld b,a ; A = x000sspp and $0C ld e,a ld a,b rlca rlca rlca rlca and $30 or e ; A = 00ppss00 ld e,a ld a,h rlca rlca and $03 or e ; A = 00ppssPP ld hl,SLTATR ld d,0 ld e,a add hl,de ld (hl),c ld a,b ret ; Read an address and check whether it is valid or not. search_roms_address: push bc call search_roms_read ld a,d or e ; ZF is not set if the address is ld a,b ; correct. pop bc ret ;---------------------- ; Run any BASIC roms found. run_basic_roms: ld hl,SLTATR ld b,64 run_basic_roms_lp: ld a,(hl) bit 7,a jr z,run_basic_roms_next push hl ld hl,str_basic call prn_text pop hl run_basic_roms_next: inc hl djnz run_basic_roms_lp ret ;------------------------ ; Initialize RAM init_ram: ; Initialize workarea ld a,$00 ld hl,$F380 ld (hl),a ld de,$F381 ld bc,$0C7D ldir ; Initialize Disk work ld a,$C9 ld hl,$F300 ld (hl),a ld de,$F301 ld bc,$007F ldir ; initialize hook area with $C9 (assembler code for ret) ld a,$C9 ; ret code ld hl,H_KEYI ld (hl),a ld de,H_KEYI+1 ld bc,$024D ; shouldn't this be $0235 ? ldir ; Initialize key matrix ld a,$FF ld hl,OLDKEY ld (hl),a ld de,OLDKEY+1 ld bc,21 ldir ; Initialize Key buffer ld a,$00 ld hl,KEYBUF ld (hl),a ld de,KEYBUF+1 ld bc,39 ldir IF VDP != TMS99X8 ld a,$00 ld hl,RG8SAV ld (hl),a ld de,RG8SAV + 1 ld bc,15 ldir ld a,$08 ld (RG8SAV),a ld a,LOCALE_INT >> 6 ld (RG8SAV + 1),a ENDIF ; Set address pointer ld hl,KEYBUF ld (PUTPNT),hl ld (GETPNT),hl ; ld hl,$8000 exx ld (BOTTOM),hl ; Page1 and 2 is ROM,Page3 and 4 is RAM. exx ; I don't know exactly what is stored between $F168 and $F380, ; but the disk ROM needs some space there, so I'll just ; reserve all of it. ld hl,$F380 ; was $F168, but needs to be changed by disk ROM ld (HIMEM),hl ; limit of usable memory ld (STKTOP),hl ; position of BASIC stack ;Transmit RDPRIM to RAM. ld hl,m_rdprim ld de,$F380 ld bc,m_prim_end-m_rdprim ldir ; Initialize table of screen 0 ld hl,$0000 ld (TXTNAM),hl ld hl,$0800 ld (TXTCGP),hl ; Initialize table of screen 1 ld hl,$1800 ld (T32NAM),hl ld hl,$2000 ld (T32COL),hl ld hl,$0000 ld (T32CGP),hl ld hl,$1B00 ld (T32ATR),hl ld hl,$3800 ld (T32PAT),hl ; Initialize table of screen 2 ld hl,$1800 ld (GRPNAM),hl ld hl,$2000 ld (GRPCOL),hl ld hl,$0000 ld (GRPCGP),hl ld hl,$1B00 ld (GRPATR),hl ld hl,$3800 ld (GRPPAT),hl ; Initialize table fo screen 3 ld hl,$0800 ld (MLTNAM),hl ld hl,$0000 ld (MLTCGP),hl ld hl,$1B00 ld (MLTATR),hl ld hl,$3800 ld (MLTPAT),hl ; Initialise QUETAB. ld hl,QUETAB ld (QUEUES),hl ld hl,VOICAQ ld (QUETAB+0*6+4),hl ld hl,VOICBQ ld (QUETAB+1*6+4),hl ld hl,VOICCQ ld (QUETAB+2*6+4),hl ld a,$7F ld (QUETAB+0*6+3),a ld (QUETAB+1*6+3),a ld (QUETAB+2*6+3),a ; other settings ld a,39 ld (LINL40),a ld a,32 ; Set to 29 after splash screen. ld (LINL32),a ;TODO: Rely on call to INIT32 instead. ld a,(LINL32) ld (LINLEN),a ld a,24 ld (CRTCNT),a ld a,COLOR_BORDER ld (BDRCLR),a ld a,COLOR_BACK ld (BAKCLR),a ld a,COLOR_FORE ld (FORCLR),a ld a,$A0 ld (RG1SAV),a ld a,(EXPTBL) ld (CGPNT),a ld hl,(4) ld (CGPNT+1),hl ; set up hook ld a,$c3 ld hl,chput ld (H_OUTD+1),hl ld (H_OUTD),a ret ;---------------------- ; Check which slots are expanded. ; Initialises EXPTBL for all 4 slots. check_expanded: ; Prepare to iterate over slots [0..3]. di ld hl,EXPTBL in a,(PSL_STAT) ld d,a ; D = saved value from port $A8 and $3F ld c,a check_expanded_lp: out (PSL_STAT),a ld a,(SSL_REGS) cpl ld e,a ; E = saved SSL value ; Test whether $0x is read back as complement. and $0F ld (SSL_REGS),a ld b,a ld a,(SSL_REGS) cpl cp b jr nz,check_expanded_not ; Test whether $5x is read back as complement. ld a,e and $0F or $50 ld (SSL_REGS),a ld b,a ld a,(SSL_REGS) cpl cp b jr nz,check_expanded_not ; SSL register present -> slot expanded. ld b,$80 ld a,e jr check_expanded_next check_expanded_not: ; SSL register present -> slot expanded. ld b,$00 ld a,e ; E = saved SSL value cpl ; not SSL -> back to original check_expanded_next: ld (SSL_REGS),a ld a,d ; D = saved value from port $A8 out (PSL_STAT),a ld (hl),b inc hl ; Next slot. ld a,c add a,$40 ld c,a jr nc,check_expanded_lp ei ret IF VDP != TMS99X8 ;---------------------- ;Detect position of subrom chkslz: chksubpos: ld bc,$0400 ld hl,EXPTBL pri_subpos_loop: push bc push hl ld a,c or (hl) bit 7,a jr nz,pri_subpos_call call chk_subpos jr pri_subpos_next pri_subpos_call: call sub_subpos pri_subpos_next: pop hl pop bc ret c inc hl inc c djnz pri_subpos_loop xor a ld (EXBRSA),a ret sub_subpos: ld b,4 sub_subpos_loop: push bc call chk_subpos pop bc ret c add a,4 djnz sub_subpos_loop ret chk_subpos: ld c,a ld (EXBRSA),a ld hl,0 call rd_subpos cp 'C' jr nz,chk_subpos_notfound inc hl call rd_subpos cp 'D' chk_subpos_notfound: ld a,c scf ret z or a ret rd_subpos: ld a,c push bc push hl call rdslt pop hl pop bc ret ENDIF ;------------------------ ; wait routine ; caution,already EI when call the rouine ; B = frequency of loop wait_b: halt djnz wait_b ret ;------------------------ ;prn_text ; HL = string with null termination prn_text: ld a,(SCRMOD) cp 5 jr nc,prn_text_graph prn_text_char: ld a,(hl) or a ret z call chput inc hl jr prn_text_char prn_text_graph: ld a,(hl) or a ret z ld ix,$0089 call extrom inc hl jr prn_text_graph ;-------------------------------- ; Determine bytes per line in the current text mode. ; Input: SCRMOD, LINLEN ; Output: C = number of bytes per line ; Changes: AF text_bytes_per_line: ld c,32 ; text32 ld a,(SCRMOD) or a ret nz ld c,40 ; text40 ld a,(LINLEN) cp 41 ret c ld c,80 ; text80 ret ;-------------------------------- ; Calculate the VRAM address that corresponds to the current cursor position. ; Input: CSRX, CSRY ; Output: HL = VRAM address ; Changes: none curs2hl: push bc push af call text_bytes_per_line ; Calculate left border. ld a,(LINLEN) neg add a,c ; A = bytes_per_line - LINLEN inc a ; round up srl a ; A = A / 2 ld l,a ; L = size of left border ; Add X coordinate. ld a,(CSRX) dec a ; from 1-based to 0-based add a,l ; add border size ld l,a ; Convert to 16-bits counters. ld h,0 ld b,h ; Add Y * bytes_per_line. ld a,(CSRY) dec a ; from 1-based to 0-based curs2hl_mult_loop: srl a jr nc,curs2hl_mult_skip add hl,bc curs2hl_mult_skip: sla c ; BC = BC * 2 rl b or a jr nz,curs2hl_mult_loop ; Add base address. ld bc,(NAMBAS) add hl,bc pop af pop bc ret ;--------------------------- ; Subroutines ;--------------------------- ; the extensive descriptions were taken with permission from http://map.tni.nl/ ;------------------------------------- ;0008h SYNCHR ;Function: tests whether the character of [HL] is the specified character ; if not, it generates SYNTAX ERROR, otherwise it goes to CHRGTR ; (#0010) ;Input: set the character to be tested in [HL] and the character to be ; compared next to RST instruction which calls this routine (inline ; parameter) ;Output: HL is increased by one and A receives [HL], When the tested character ; is numerical, the CY flag is set the end of the statement (00h or ; 3Ah) causes the Z flag to be set ;Registers: AF, HL ;NOTE: this implementation is still a stub! synchr: push hl push af ld hl,synchr_text call print_debug pop af pop hl ret synchr_text: db "SYNCHR",0 ;------------------------------------- ; $0010 CHRGTR ; Read the next program character. ; In: HL = pointer to the program text ; Out: A = the next program character ; HL = pointer to the next program character ; ZF = set if it's the end of statement ; CF = set if it's a number ; Changes: AF, HL chrgtr: call H_CHRG chrgtr_lp: ld a,(hl) inc hl ; Check for the end of statement. cp $00 ; end of line ret z cp $3A ; statement separator ret z ; Check for digits. cp '0' jr c,chrgtr_no_digit cp '9'+1 ret c chrgtr_no_digit: ; Skip whitespace. cp $20 ; space jr z,chrgtr_lp cp $09 ; tab jr z,chrgtr_lp ; Otherwise it's a normal program character. or a ; Clear CF and ZF. ret ;------------------------------------- ; $0018 OUTDO ; Function : Output to current outputchannel (printer, diskfile, etc.) ; Input : A - PRTFIL, PRTFLG ; Remark : Used in basic, in ML it's pretty difficult. outdo: push af call H_OUTD ; H_OUTD does the real outputting pop af ret ;-------------------------------- ; $0020 DCOMPR ; Function : Compared HL to DE ; Output : flags influenced like CP instruction ; Registers: A dcompr: ld a,h cp d ret nz ld a,l cp e ret ;-------------------------------- ; $0028 GETYPR ; Function : Returns Type of DAC ; Input : VALTYP(F663) ; Output : C, Z, S ; C Z S Type VALTYP ; low - - double 8 ; high high low string 3 ; high low high integer 2 ; high low low float 4 ; Registers: AF ;NOTE: this implementation is still a stub! getypr: push hl push af ld hl,getypr_text call print_debug pop af pop hl ret getypr_text: db "GETYPR",0 ;-------------------------------- ; $0030 CALLF callf: ex af,af' exx pop hl ; Get data from return address. ld a,(hl) inc hl ld e,(hl) inc hl ld d,(hl) inc hl push de ; IX = call address pop ix push af ; IY = slot pop iy push hl ; Update return address. ex af,af' exx jp calslt ; Perform inter-slot call. ;-------------------------------- ; $003B INITIO ;Function: Initialises the device ;Registers: All initio: ld e,$8F ; strobe off, triggers on ld a,$0F call wrtpsg ; TODO: What else must be initialized here? jp gicini ;-------------------------------- ; $003E INIFNK ; Function : Initialises the contents of the function keys ; Registers: All ;NOTE: this implementation is still a stub! inifnk: push hl push af ld hl,inifnk_text call print_debug pop af pop hl ret inifnk_text: db "INIFNK",0 ;-------------------------------- ; $0099 STRTMS ; Function : Tests whether the PLAY statement is being executed as a background ; task. If not, begins to execute the PLAY statement ; Registers: All ;NOTE: this implementation is still a stub! strtms: push hl push af ld hl,strtms_text call print_debug pop af pop hl ret strtms_text: db "STRTMS",0 ;-------------------------------- ; $009C CHSNS ; Function : Tests the status of the keyboard buffer ; Output : Z-flag set if buffer is filled ; Registers: AF chsns: ei push hl push de ld hl,(GETPNT) ld de,(PUTPNT) rst $20 ld a,$ff jr nz,chsns_inbuf xor a chsns_inbuf: pop de pop hl ret ;-------------------------------- ; $009F CHGET ; Function : One character input (waiting) ; Output : A - ASCII-code of the input character ; Registers: AF chget: call H_CHGE push hl push de chget_wait: ld hl,(GETPNT) ld de,(PUTPNT) rst $20 jr nz,chget_char ei halt jr chget_wait chget_char: ld a,(hl) ; HL = (GETPNT) push af inc hl ; See comment in keyint (below label key_store). ld a,l ; Currently, tniASM doesn't support "&" and SjASM doesn't ; support "AND", so we have to hardcode the result. ; cp $00FF & (KEYBUF + 40) cp $18 jr nz,chget_nowrap ld hl,KEYBUF chget_nowrap: ld (GETPNT),hl pop af pop de pop hl ret ;-------------------------------- ; $00A2 CHPUT ; Input: A = character code ; Changes: none include "chput.asm" ;-------------------------------- ; $00A5 LPTOUT ; Function : Sends one character to printer ; Input : A - ASCII-code of character to send ; Output : C-flag set if failed ; Registers: F lptout: call H_LPTO push af lptout_wait: call breakx jr c,lptout_abort call lptstt jr z,lptout_wait pop af jr lptout_write lptout_abort: ld a,13 call lptout_write xor a ld (LPTPOS),a pop af scf ret lptout_write: push af out (PRN_DATA),a ld a,0 out (PRN_STAT),a cpl out (PRN_STAT),a pop af and a ret ;-------------------------------- ; $00A8 LPTSTT ; Function : Tests printer status ; Output : A - #FF and Z-flag reset if printer is ready ; #00 and Z-flag set if not ready ; Registers: AF lptstt: call H_LPTS in a,(PRN_STAT) rra rra ld a,$FF jr nc,lptstt_end cpl lptstt_end: and a ret ;-------------------------------- ; $00AB CNVCHR ; Function : tests for the graphic header and transforms the code ; Input : A - charactercode ; GRPHED(FCA6): indicates if previous char was an extension code ; Output: C-flag Z-flag A ; if byte is extension byte low high 1 ; if byte is normal ASCII high low ASCII code ; if byte is graphical extension high high extension code ; GRPHED is updated ; Registers: AF cnvchr: push hl push af ld hl,GRPHED xor a cp (hl) ld (hl),a ; reset GRPHED in advance jr nz,cnvchr_handlegfx pop af ; we're not in graphic mode cp 1 ; graphic header? jr nz,cnvchr_normal ld (hl),a ; yes! -> Set GRPHED jr cnvchr_normal_exit ; we've got NC and Z - perfect! cnvchr_handlegfx: pop af cp $40 jr c,cnvchr_nogfx cp $60 jr nc,cnvchr_nogfx sub $40 ; graphic char cp a ; set Z (and NC) jr cnvchr_normal cnvchr_nogfx: cp $50 ; A is definitely not #50 ; so this sets NZ :-) cnvchr_normal: scf ; NZ/Z already ok, now set C cnvchr_normal_exit: pop hl ret include "inlin.asm" ;-------------------------------- ; $00B7 BREAKX ; Tests status of CTRL-STOP. ; This routine reads the keyboard status from the hardware, so its result ; will be accurate even if interrupts have been disabled for a while. ; Output: CF set if CTRL-STOP is pressed ; Changes: AF breakx: in a,(GIO_REGS) and $F0 or $07 out (GIO_REGS),a in a,(KBD_STAT) and $10 ; check STOP, also resets CF ret nz ; some programs like to return with $10 in a,(GIO_REGS) and $F0 or $06 out (GIO_REGS),a in a,(KBD_STAT) and $02 ; check CTRL, also resets CF ret nz scf ret ;-------------------------------- ; $00BA ISCNTC ; Function: Test status of STOP or CTRL-STOP; if BASIC is in a ROM (see BASROM), ; then check for STOP or CTRL-STOP is not done. Otherways: ; INTLFLG: 0 => no action ; INTLFLG: 3 => CTRL-STOP pressed => break program, if "STOP-interrupts not on"?? ; INTLFLG: 4 => STOP pressed => wait in ISCNTC till stop pressed again ; Input: INTFLG, BASROM ; Registers: AF ; NOTE: this implementation is still a stub! iscntc: push hl push af ld hl,iscntc_text call print_debug pop af pop hl ret iscntc_text: db "ISCNTC",0 ;-------------------------------- ; $00BD CKCNTC ; Function : Same as ISCNTC. used in Basic ckcntc: jp iscntc ;-------------------------------- ; $00C0 BEEP ; Function : play a short beep, and reset sound system via GICINI ; Registers: All ; NOTE: this implementation is still a stub! beep: ; Note: Called by CHPUT; if you need to change more regs than AF, HL, DE, BC ; then update CHPUT. push hl push af ld hl,beep_text call print_debug pop af pop hl ret beep_text: db "BEEP",0 ;-------------------------------- ; $00C6 POSIT ; Sets cursor position. ; Input: H = column ; L = row ; Changes: AF posit: ; Note: this works because CSRX == CSRY + 1 ld (CSRY),hl ret ;-------------------------------- ; $00C9 FNKSB ; Tests whether the function key display is active (FNKFLG), ; if so, displays them, otherwise erases them. ; Input: FNKFLG (#FBCE) ; Changes: all ; NOTE: This implementation is still a stub! fnksb: push hl push af ld hl,fnksb_text call print_debug pop af pop hl ret fnksb_text: db "FNKSB",0 ;-------------------------------- ; $00CC ERAFNK ; Erase function key display. ; Changes: all ; NOTE: This implementation is still a stub! ; TODO: call H_ERAF erafnk: ; call H_ERAF push hl push af ld hl,erafnk_text call print_debug pop af pop hl ret erafnk_text: db "ERAFNK",0 ;-------------------------------- ; $00CF DSPFNK ; Display function keys. ; Changes: all ; NOTE: This implementation is still a stub! ; TODO: call H_DSPF dspfnk: ; call H_DSPF push hl push af ld hl,dspfnk_text call print_debug pop af pop hl ret dspfnk_text: db "DSPFNK",0 ;-------------------------------- ; $00D2 TOTEXT ; Forces the screen to be in the text mode. ; Input: SCRMOD, OLDSCR ; Changes: all totext: ld a,(SCRMOD) cp 2 ret c ld a,(OLDSCR) call H_TOTE or a jp z,initxt jp init32 ;-------------------------------- ; $00E1 TAPION ; Reads the header block after turning the cassette motor on. ; Output: CF = set if failed ; Changes: all ; NOTE: This implementation is still a stub! tapion: push hl push af ld hl,tapion_text call print_debug pop af pop hl ; TODO: not implemented -> always fail scf ret tapion_text: db "TAPION",0 ;-------------------------------- ; $00E4 TAPIN ; Read data from the tape. ; Output: A = data read ; Changes: all ; NOTE: This implementation is still a stub! tapin: push hl push af ld hl,tapin_text call print_debug pop af pop hl ; TODO: not implemented -> always fail scf ret tapin_text: db "TAPIN",0 ;-------------------------------- ; $00E7 TAPIOF ; Stops reading from the tape. ; NOTE: This implementation is still a stub! tapiof: push hl push af ld hl,tapiof_text call print_debug pop af pop hl ret tapiof_text: db "TAPIOF",0 ;-------------------------------- ; $00EA TAPOON ; Turns on the cassette motor and writes the header. ; Input: A = zero for short header, non-zero for long header ; Output: CF = set if failed ; Changes: all ; NOTE: This implementation is still a stub! tapoon: push hl push af ld hl,tapoon_text call print_debug pop af pop hl ; TODO: not implemented -> always fail scf ret tapoon_text: db "TAPOON",0 ;-------------------------------- ; $00ED TAPOUT ; Writes data to the tape. ; Input: A = data to write ; Output: CF = set if failed ; Changes: all ; NOTE: This implementation is still a stub! tapout: push hl push af ld hl,tapout_text call print_debug pop af pop hl ; TODO: not implemented -> always fail scf ret tapout_text: db "TAPOUT",0 ;-------------------------------- ; $00F0 TAPOOF ; Stops writing on the tape. ; NOTE: This implementation is still a stub! tapoof: push hl push af ld hl,tapoof_text call print_debug pop af pop hl ret tapoof_text: db "TAPOOF",0 ;-------------------------------- ; $00F3 STMOTR ; Changes the cassette motor state. ; Input: A = action: #00 stops motor, #01 starts motor, ; #FF inverts current state ; Changes: AF stmotr: push bc ld b,a in a,(GIO_REGS) inc b jr z,stmotr_inv set 4,a dec b jr z,stmotr_set res 4,a dec b jr z,stmotr_set pop bc ret stmotr_inv: xor 16 stmotr_set: out (GIO_REGS),a pop bc ret ;-------------------------------- ; $0090 GICINI Initialize Sound IC ; Function : Initialises PSG and sets initial value for the PLAY statement ; Registers: All gicini: ld e,$00 ld a,$08 call wrtpsg inc a call wrtpsg inc a call wrtpsg inc a ld e,$B8 ld a,$07 call wrtpsg ret ;-------------------------------- ; $0093 WRTPSG ; Function : Writes data to PSG-register ; Input : A - PSG register number ; E - data write wrtpsg: di out (PSG_REGS),a push af ld a,e out (PSG_DATA),a ei pop af ret ;-------------------------------- ; $0096 RDPSG ; Function : Reads value from PSG-register ; Input : A - PSG-register read ; Output : A - value read rdpsg: out (PSG_REGS),a in a,(PSG_STAT) ret ;-------------------------------- ; $0135 CHGSND ; Write to the 1-bit sound port. ; Input: A = zero to set sound state to 0, non-zero to set sound state to 1 ; Changes: AF chgsnd: or a ld a,$0E ; $0E = command to reset bit 7 jr z,chgsnd_write inc a ; $0F = command to set bit 7 chgsnd_write: out (PPI_REGS),a ; set/reset bit of port C ret ;-------------------------------- ; $0138 RSLREG ; Function : Reads the primary slot register ; Output : A - for the value which was read ; 33221100 ; ||||||- Pagina 0 (#0000-#3FFF) ; ||||--- Pagina 1 (#4000-#7FFF) ; ||----- Pagina 2 (#8000-#BFFF) ; ------- Pagina 3 (#C000-#FFFF) ; Registers: A rslreg: in a,(PSL_STAT) ret ;-------------------------------- ; $013B WSLREG ; Function : Writes value to the primary slot register ; Input : A - value value to (see RSLREG) wslreg: out (PSL_STAT),a ret ;-------------------------------- ; $013E RDVDP ; Function : Reads VDP status register ; Output : A - Value which was read ; Registers: A rdvdp: in a,(VDP_STAT) ret ;-------------------------------- ;0141h SNSMAT ; Function : Returns the value of the specified line from the keyboard matrix ; Input : A - for the specified line ; Output : A - for data (the bit corresponding to the pressed key will be 0) ; Registers: AF snsmat: di push bc ld c,a in a,(GIO_REGS) and $F0 or c out (GIO_REGS),a in a,(KBD_STAT) pop bc ei ret ;-------------------------------- ; $0144 PHYDIO ; Executes I/O for mass-storage media like diskettes. ; All this routine does is call H_PHYD, which should be installed by the main ; disk ROM. ; Input: B = number of sectors to save/load ; C = media ID of the disk ; DE = begin sector ; HL = begin address in memory ; Changes: all ; Remark: Before the call is called, the Z-flag must be reset, and the ; execution address which was in HL must be at the last stack address phydio: call H_PHYD ret ;-------------------------------- ; $0147 FORMAT ; Initialises mass-storage media like formatting of diskettes. ; All this routine does is call H_FORM, which should be installed by the main ; disk ROM. ; Changes: all format: call H_FORM ret ;-------------------------------- ; $014A ISFLIO ; Function : Tests if I/O to device is taking place ; Output : A - #00 if not taking place ; not #00 if taking place ; Registers: AF ; TODO: call H_ISFL isflio: ; call H_ISFL ld a,(PTRFIL) and a ; adjust flags ret ;-------------------------------- ; $00D5 GTSTCK ; Function : Returns the joystick status ; Input : A - Joystick number to test (0 = cursors, 1 = port 1, 2 = port 2) ; Output : A - Direction,D = $00(when A=0) ; Registers: All gtstck: push bc cp $00 jr nz,joy_stc1 ld a,$08 call snsmat rrca rrca rrca rrca cpl and $0F ; 0000RDUL push hl ld hl,joypos_kbd_tbl ld d,0 ld e,a add hl,de ld a,(hl) pop hl pop bc and a ret joy_stc1: ;PSG reg 15h ;0J001111 ;PSG reg 14h ;00BARLDU push hl push de ld e,$00 dec a jr z,sel_stc1 set 6,e ; select stick 2 sel_stc1: ld a,$0F di call rdpsg ei and $BF or e ld e,a ld a,$0F call wrtpsg ld a,$0E di call rdpsg ei cpl and $0F ; 0000RLDU ld hl,joypos_joy_tbl ld b,0 ld c,a add hl,bc ld a,(hl) pop de pop hl pop bc and a ret joy_end: ld a,$00 pop bc and a ret joypos_joy_tbl: ; 0 1 2 3 4 5 6 7 db $00,$01,$05,$00,$07,$08,$06,$07 ; 8 9 A B C D E F db $03,$02,$04,$03,$00,$01,$05,$00 joypos_kbd_tbl: ; 0 1 2 3 4 5 6 7 db $00,$07,$01,$08,$05,$06,$00,$07 ; 8 9 A B C D E F db $03,$00,$02,$01,$04,$05,$03,$00 ;-------------------------------- ; $00D8 GTTRIG ; Function : Returns current trigger status ; Input : A - trigger button to test ; 0 = spacebar(included A-1 = minus) ; 1 = port 1, button A ; 2 = port 2, button A ; 3 = port 1, button B ; 4 = port 2, button B ; Output : A - #00 trigger button not pressed ; #FF trigger button pressed ; Note : Some programs rely on ZF to be set according to the value in A. ; Registers: All gttrig: cp 5 jr nc,gttrig_space ; if value of A is above 5,go space routine or a jr nz,joy_trig gttrig_space: ; Keyboard (spacebar) ld a,$08 call snsmat ; bit0 = 0 -> space pressed or $FE ; FE -> pressed, FF -> not pressed inc a ; FF -> pressed, 00 -> not pressed ret ; Joystick triggers joy_trig: di dec a push de ld e,$03 ; enable trig A+B of stick 1 ld b,a and $01 jr z,sel_trig1 ld e,$4C ; enable trig A+B of stick 2 and select stick 2 sel_trig1: ld a,$0F call rdpsg and $BF or e ld e,a ld a,$0F call wrtpsg ld a,b ld b,$10 and $02 jr z,istrg_a ld b,$20 istrg_a: ld a,$0E di call rdpsg ei pop de and b jr z,trig_on jr trig_off trig_on: ld a,$FF ret trig_off: xor a ret ;-------------------------------- ; $00DB GTPAD ; Function : Returns current touch pad status ; Input : A - Touchpad number to test ; Output : A - Value ; Registers: All ; NOTE : This implementation is still a stub! gtpad: push hl push af ld hl,gtpad_text call print_debug pop af pop hl xor a ; haywire ret gtpad_text: db "GTPAD",0 ;-------------------------------- ; $00DE GTPDL ; Function : Returns currenct value of paddle ; Input : A - Paddle number ; Output : A - Value ; Registers: All ; NOTE : This implementation is still a stub! gtpdl: push hl push af ld hl,gtpdl_text call print_debug pop af pop hl ret gtpdl_text: db "GTPDL",0 ;-------------------------------- ; $00F6 LFTQ ; Give the number of bytes left in a queue. ; In: A = queue number ; Out: HL = number of bytes left ; Changes: AF, BC, HL lftq: call calc_queue_address ld b,(hl) ; B = put position inc b inc hl ld a,(hl) ; A = get position sub b ; (getpos - putpos) & size inc hl inc hl and (hl) ld l,a ld h,$00 ; Queues are smaller than 256 bytes. ret ;-------------------------------- ; $00F9 PUTQ ; Put a byte in a queue. ; In: A = queue number ; E = data ; Out: ZF = set if the queue is full ; Changes: AF, BC, HL putq: ; Check whether the queue is full. call calc_queue_address ld a,(hl) inc a ld b,a ; B = put position + 1 inc hl sub (hl) ret z ; Save the new put position. ld a,b inc hl inc hl push hl and (hl) ; (putpos + 1) & size dec hl dec hl dec hl ld (hl),a ; Put the data byte in the queue. pop hl inc hl ld a,(hl) ; Get the buffer address. inc hl ld h,(hl) ld l,a dec b ; Add putpos. ld c,b ld b,0 add hl,bc ld (hl),e or 1 ret ; Calculate the address to the start of queue control block. ; A = queue number calc_queue_address: ld hl,(QUEUES) ; See QUETAB in systemvars.asm. ld b,a ; (queue number * 6) rlca rlca add a,b add a,b ld c,a ld b,0 add hl,bc ret ;-------------------------------- ; $0132 CHGCAP ; Function : Alternates the CAP lamp status ; Input : A - #00 is lamp on ; not #00 is lamp off ; Registers: AF chgcap: or a in a,(GIO_REGS) res 6,a jr nz,chgcap_on set 6,a chgcap_on: out (GIO_REGS),a ret ;-------------------------------- ; $014D OUTDLP ; Function : Printer output ; Input : A - code to print ; Registers: F ; Remark : Differences with LPTOUT: ; 1. TAB is expanded to spaces ; 2. For non-MSX printers, Hiragana is transformed to katakana ; and graphic characters are transformed to 1-byte characters ; 3. If failed, device I/O error occurs ; TODO : This implementation is still a stub! outdlp: push hl push af ld hl,outdlp_text call print_debug pop af pop hl ret outdlp_text: db "OUTDLP",0 ;-------------------------------- ; $0150 GETVCP ; Returns pointer to a variable at offset 2 in a voice structure. ; TODO: find out the purpose of this variable. ; Address : #0150 ; Function : Returns pointer to play queue ; Input : A - Channel number ; Output : HL - Pointer ; Registers: AF ; Remark : Only used to play music in background getvcp: ld l,2 jr getvc2_a ;-------------------------------- ; $0153 GETVC2 ; Returns pointer to a given variable in a voice structure. ; Input : L - Pointer in play buffer ; (VOICEN) - Voice structure number ; Output : HL - Pointer ; Registers: AF getvc2: ld a,(VOICEN) getvc2_a: push de ld d,0 ld e,l ld hl,VCBA add hl,de ld e,37 ; Size of a structure getvc2_loop: or a jr z,getvc2_exit add hl,de dec a jr getvc2_loop getvc2_exit: pop de ret ;-------------------------------- ; $0156 KILBUF ; Empties the keyboard buffer. ; Changes: HL kilbuf: ld hl,(GETPNT) ld (PUTPNT),hl ret ;-------------------------------- ; Interrupt routine ($0038h) ;-------------------------------- ; some games uses Reg.R and the routine affects the register's value. ; if you want to add something to the routine,please try the following first ; ; Riseout , Replicart keyint: push hl push de push bc push af exx ex af,af' push hl push de push bc push af push iy push ix call H_KEYI in a,(VDP_STAT) or a ld (STATFL),a ; save status jp p,int_end ; exit if this is not the VDP int call H_TIMI ; TODO: (BASIC related stuff) ; Check sprite collision ; Update INTCNT ld hl,(JIFFY) inc hl ld (JIFFY),hl ; TODO: MUSICF ; TODO: It seems unsafe to me to already allow interrupts ; while this one is still busy: possible interference ; between two interrupts and also the amount of stack ; space claimed is a lot. ;ei ; Riseout needs that count of RegR in the routine is not ; even number ; nop xor a ld (CLIKFL),a ; Scan the keyboard every three interrupts. ld a,(SCNCNT) dec a ld (SCNCNT),a jr nz,int_end ld a,3 ld (SCNCNT),a ; TODO read joystick triggers and space for TRGFLG xor a call gttrig cpl and $01 ld (TRGFLG),a call key_in ; Check whether KEYBUF is empty and if so, decrement REPCNT to ; see if auto-repeating should be started. The user program ; needs to continuously read characters to allow repetition. ld hl,(PUTPNT) ld de,(GETPNT) rst $20 jr nz,int_end ld a,(REPCNT) dec a ld (REPCNT),a jr nz,int_end ld hl,OLDKEY ld bc,$0BFF clear_oldkey: ld (hl),c inc hl djnz clear_oldkey call key_in ld a,1 ld (REPCNT),a int_end: pop ix pop iy pop af pop bc pop de pop hl exx ex af,af' pop af pop bc pop de pop hl ei ret ;-------------------------------- ; 0066h NMI interrupt nmi: call H_NMI retn ;-------------------------------- ; Get buffer from keyboard input key_in: in a,(GIO_REGS) and $F0 ld c,a ld b,11 ld hl,NEWKEY key_in_lp: ld a,c out (GIO_REGS),a in a,(KBD_STAT) ld (hl),a inc hl inc c djnz key_in_lp ld ix,OLDKEY ld de,NEWKEY ; Use plain or SHIFT version of rows 0-5? ; Note that while we have tables for GRAPH and CODE variants, ; those are not used yet by this routine. ld a,(NEWKEY + 6) rrca ld hl,scode_tbl jr c,scan_start ld hl,scode_tbl_shift scan_start: ld c,11 key_chk_lp: ld a,(de) cp (ix+0) call nz,key_set_delay cpl and (ix+0) ex af,af' ; Update OLDKEY. ld a,(de) ld (ix+0),a ex af,af' ; TODO: Optimise scanning if no keys are pressed. ; That's the most common case by far. ld b,$08 key_bit_lp: rrca jr c,key_store key_bit_next: inc hl djnz key_bit_lp inc ix inc de dec c ret z ld a,c cp 5 jr nz,key_chk_lp ; Switch to new table for rows 6-11. ; These rows produce the same characters regardless of which ; modifier keys are held. ld hl,scode_tbl_otherkeys jr key_chk_lp key_set_delay: ; Set the auto-repeat delay. push af ld a,5 ld (REPCNT),a pop af ret key_store: push af ld a,c cp $05 jr z,key_chk_fnk1 cp $04 jr z,key_chk_fnk2 jp key_ascii ; Put function string into buffer key_chk_fnk1: ; F1-F3 ld a,b cp $03 ; F1 jr nz,key_chk_f2 ld a,$00 jr put_key_fnk key_chk_f2: cp $02 ; F2 jr nz,key_chk_f3 ld a,$01 jr put_key_fnk key_chk_f3: cp $01 ; F3 jr nz,key_ascii ; return to normal process ld a,$02 jr put_key_fnk key_chk_fnk2: ; F4-F5 ld a,b cp $08 ; F4 jr nz,key_chk_f5 ld a,$03 jr put_key_fnk key_chk_f5: cp $07 ; F5 jr nz,key_ascii ld a,$04 jr put_key_fnk put_key_fnk: push hl push bc push de rlca rlca rlca rlca ld hl,FNKSTR ld d,$00 ld e,a add hl,de ex de,hl put_key_fnk_lp: ld a,(de) and a jr z,put_key_fnk_nul push de call key_put_into_buf pop de inc de jr put_key_fnk_lp put_key_fnk_nul: pop de pop bc pop hl jr key_store_end2 ; Check scan table key_ascii: ld a,(hl) ; get ASCII value and a ; dead key? jr z,key_store_end2 ; Store ASCII value in key buffer. ; Since a full buffer is indicated by PUTPNT == GETPNT - 1, ; it is always safe to store a character, but if the buffer ; is full, PUTPNT cannot be increased. push hl call key_put_into_buf pop hl key_store_end2: pop af jp key_bit_next ;-------------------------------- key_put_into_buf: ld hl,(PUTPNT) ld (hl),a ; Note: Ashguine 2 has a bug: it puts KEYBUF at FDF0 iso FBF0 ; in the name input routine. This writes keys in memory ; reserved for hooks, but since those hooks are only used ; by BASIC, the game doesn't suffer. When PUTPNT reaches ; FE18, it wraps back to FBF0. inc hl ld a,l ; cp $00FF & (KEYBUF + 40) cp $18 jr nz,key_store_nowrap ld hl,KEYBUF key_store_nowrap: ; Check whether the buffer is full. push de ld de,(GETPNT) rst $20 pop de ret z ld (PUTPNT),hl ret ;-------------------------------- ; $015C SUBROM ; Function : Calls a routine in SUB-ROM ; Input : IX - Address of routine in SUB-ROM ; Output : Depends on the routine ; Registers: Alternative registers, IY ; Remark : Use of EXTROM or CALSLT is more convenient. ; You have to use this routine like this: ; push ix ; jp subrom ; The purpose is unclear subrom: call extrom pop ix ret ;-------------------------------- ; $015F EXTROM ; Function : Calls a routine in SUB-ROM. Most common way ; Input : IX - Address of routine in SUB-ROM ; Output : Depends on the routine ; Registers: Alternative registers, IY ; Remark : Use: LD IX,address ; CALL EXTROM extrom: ; EXTROM needs to save alternative registers ; and when call with certain status, returns with EI ex af,af' exx push af push bc push de push hl ld a,i push af exx push iy ld a,(EXBRSA) push af pop iy ; IYH = slot ID ex af,af' call calslt ; Perform inter-slot call. pop iy ex af,af' exx pop af jp po,extrom_skip_ei ei extrom_skip_ei: pop hl pop de pop bc pop af exx ex af,af' ret ;------------------------------------ hang_up_mode: jr $ ;------------------------------------ ; Called if the stack underflows. stack_error: call H_STKE ld de,str_stack_error jp print_error ;------------------------------------ ; $0159 CALBAS ; Function : Executes inter-slot call to the routine in BASIC interpreter ; Input : IX - for the calling address ; Output : Depends on the called routine ; Registers: Depends on the called routine calbas: push hl push af ld hl,calbas_text call print_debug pop af pop hl ld de,str_no_basic_intr jp print_error calbas_text: db "CALBAS",0 IF MODEL_MSX != MODEL_MSX1 ;-------------------------------- ; $0168 EOL ; Function : Deletes to the end of the line ; Input : H - x-coordinate of cursor ; L - y-coordinate of cursor ; Registers: All eol: ld de,(CSRY) push de ld (CSRY),hl call chput_esc_k ; clear till EOL pop de ld (CSRY),de ret ENDIF IF VDP = V9958 ;-------------------------------- ; $017A RDRES ; Function : Read value of $F4 I/O port ; Input : None ; Output : A = value read (inverted) ; Registers: AF rdres: in a,($f4) cpl ret ;-------------------------------- ; $017D WRRES ; Function : Read value of $F4 I/O port ; Input : A = value to write read (will be inverted) ; Bit 7 shows the MSX2+ startup screen when reset, ; otherwise it's skipped ; Output : None ; Registers: None wrres: cpl out ($f4),a ret ENDIF ;------------------------------------ ;Display error ;in DE= message address print_error: in a,(VDP_STAT) ; reset Latch ld hl,vdp_bios ld b,$0C ld c,VDP_ADDR otir ld bc,$0800 lp_clearmem: xor a out (VDP_DATA),a dec bc ld a,b or c jr nz,lp_clearmem ld hl,B_Font ld bc,$0800 lp_fontset: ld a,(hl) out (VDP_DATA),a inc hl dec bc ld a,b or c jr nz,lp_fontset ;set cursor to (0,0) ld a,$00 out (VDP_ADDR),a ld a,$40 out (VDP_ADDR),a ld hl,str_error_prompt ld a,(hl) lp_errprn: out (VDP_DATA),a inc hl ld a,(hl) and a jr nz,lp_errprn ld a,(de) lp_strprn: out (VDP_DATA),a inc de ld a,(de) and a jr nz,lp_strprn jp hang_up_mode ds $1bbf - $ include "font.asm" ; ; This routine is called just after displaying the logo. ; This fixes the Mirai sprite garbage bug. ; IF VDP != TMS99X8 vram_clear: xor a out (VDP_ADDR),a or $40 out (VDP_ADDR),a ld bc,$4000 vram_clear_lp: xor a out (VDP_DATA),a dec bc ld a,b or c jr nz,vram_clear_lp ret ENDIF include "slot.asm" ;--------------------------------- ; system messages ;--------------------------------- str_proginfo: ; [01234567890123456789012345678] ;db "C-BIOS 1.23 cbios.sf.net" include "../derived/asm/version.asm" db $0D,$0A db "Localization: " include "locale.asm" db $0D,$0A,$0D,$0A,$00 str_proginfo_length: equ $ - str_proginfo str_slot: ; [01234567890123456789012345678] db "Init ROM in slot: ",$00 str_basic: ; [01234567890123456789012345678] db "Cannot execute a BASIC ROM.",$0D,$0A,$00 ;------------------------------------- ; error messages str_error_prompt: db "ERROR:",$00 str_memory_err: db "MEMORY NOT FOUND.",$00 str_no_basic_intr: db "CALLED NON EXISTING BASIC.",$00 str_stack_error: db "STACK ERROR.",$00 str_nocart: ; [01234567890123456789012345678] db $0D,$0A,$0D,$0A db "No cartridge found.",$0D,$0A db $0D,$0A db "This version of C-BIOS can",$0D,$0A db "only start cartridges.",$0D,$0A db "Please restart your MSX",$0D,$0A db "(emulator) with a cartridge",$0D,$0A db "inserted.",$00 ;------------------------------------- ; scan code tables IF LOCALE_KBD = LOCAL_KBD_US include "scancodes_us.asm" ENDIF IF LOCALE_KBD = LOCAL_KBD_UK include "scancodes_uk.asm" ENDIF IF LOCALE_KBD = LOCAL_KBD_FR include "scancodes_fr.asm" ENDIF IF LOCALE_KBD = LOCAL_KBD_DE include "scancodes_de.asm" ENDIF IF LOCALE_KBD = LOCAL_KBD_JP include "scancodes_jp.asm" ENDIF ; the last rows are not locale specific scode_tbl_otherkeys: db $00,$00,$00,$00,$00,$00,$00,$00 ;06 db $00,$00,$1B,$09,$00,$08,$00,$0D ;07 db $20,$0C,$00,$00,$1D,$1E,$1F,$1C ;08 db "*+/01234" ;09 db "56789-,." ;0a ;------------------------------------- vdp_bios: db $00,$80,$70,$81,$00,$82,$01,$84 db $F5,$87,$00,$40 include "statements.asm" ; FM Music Macro is calling the routine(seems to display message). ; in : HL(an address of string with null termination) ds $6678 - $ call prn_text ; as a substitution ; ???? ds $77CD - $ ret ; Note: Below are a bunch of routines which do not adhere to any API that ; I know of. They are called directly by the NMS8250 disk ROM. ; For comparing the behaviour of the C-BIOS disk ROM which is under ; development with the known working NMS8250 disk ROM it is useful ; to be able to run either disk ROM in a C-BIOS machine. Therefore we ; have stubs for the routines that the NMS8250 disk ROM may call. ; NMS8250 disk ROM can call to this address. ds $7D17 - $ push hl push af ld hl,unk7D17_text call print_debug pop af pop hl ret unk7D17_text: db "unknown@7D17",0 ; NMS8250 disk ROM retrieves a pointer from this address. ds $7D2F - $ dw call_sdfscr ; NMS8250 disk ROM can call to this address. ds $7D31 - $ ; Restore screen parameters from RTC and print welcome message. ld ix,$0189 ; SETSCR call extrom ; Print BASIC copyright message. ret ; NMS8250 disk ROM calls to this address. ; Restore screen parameters from RTC. call_sdfscr: ld ix,$0185 ; SDFSCR jp extrom ; NMS8250 disk ROM can call to this address. ds $7E14 - $ push hl push af ld hl,unk7E14_text call print_debug pop af pop hl ret unk7E14_text: db "unknown@7E14",0 ; FM Music Macro is calling this unknown routine. ds $7E6B - $ ret ds $8000 - $ ; vim:ts=8:expandtab:filetype=z8a:syntax=z8a: cbios-0.28/src/main_msx2.asm0000644000000000000000000000407213137376076014446 0ustar rootroot; C-BIOS main ROM for a European MSX2 machine ; ; Copyright (c) 2005 Maarten ter Huurne. All rights reserved. ; Copyright (c) 2005 Joost Yervante Damad. All rights reserved. ; Copyright (C) 2005 BouKiCHi. All rights reserved. ; Copyright (C) 2008 Eric Boon. All rights reserved. ; ; Redistribution and use in source and binary forms, with or without ; modification, are permitted provided that the following conditions ; are met: ; 1. Redistributions of source code must retain the above copyright ; notice, this list of conditions and the following disclaimer. ; 2. Redistributions in binary form must reproduce the above copyright ; notice, this list of conditions and the following disclaimer in the ; documentation and/or other materials provided with the distribution. ; ; THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ; OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ; IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ; NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ; include "hardware.asm" VDP: equ V9938 MODEL_MSX: equ MODEL_MSX2 ; -- generic european config (50Hz, US keyboard layout) LOCALE_CHSET: equ LOCAL_CHSET_US LOCALE_CHSET_VAR: equ LOCAL_CHSET_VAR_NONE LOCALE_DATE: equ LOCAL_DATE_DMY LOCALE_INT: equ LOCAL_INT_50HZ LOCALE_KBD: equ LOCAL_KBD_US LOCALE_BASIC: equ LOCAL_BASIC_US COLOR_FORE: equ 15 COLOR_BACK: equ 4 COLOR_BORDER: equ 4 CALL_SUB: equ YES include "main.asm" ; vim:ts=8:expandtab:filetype=z8a:syntax=z8a: cbios-0.28/src/logo_msx1.asm0000644000000000000000000000312313137376076014455 0ustar rootroot; C-BIOS main ROM for MSX1 machines ; ; Copyright (c) 2005 Maarten ter Huurne. All rights reserved. ; Copyright (c) 2005 Joost Yervante Damad. All rights reserved. ; ; Redistribution and use in source and binary forms, with or without ; modification, are permitted provided that the following conditions ; are met: ; 1. Redistributions of source code must retain the above copyright ; notice, this list of conditions and the following disclaimer. ; 2. Redistributions in binary form must reproduce the above copyright ; notice, this list of conditions and the following disclaimer in the ; documentation and/or other materials provided with the distribution. ; ; THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ; OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ; IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ; NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ; include "hardware.asm" VDP: equ TMS99X8 MODEL_MSX: equ MODEL_MSX1 org $8000 include "logo.asm" ; vim:ts=8:expandtab:filetype=z8a:syntax=z8a: cbios-0.28/src/video.asm0000644000000000000000000021136613137376076013665 0ustar rootroot; C-BIOS video routines ; ; Copyright (c) 2002-2005 BouKiCHi. All rights reserved. ; Copyright (c) 2003 Reikan. All rights reserved. ; Copyright (c) 2004-2006 Maarten ter Huurne. All rights reserved. ; Copyright (c) 2004-2005 Albert Beevendorp. All rights reserved. ; Copyright (c) 2004 Manuel Bilderbeek. All rights reserved. ; Copyright (c) 2004 Joost Yervante Damad. All rights reserved. ; Copyright (c) 2004-2005 Jussi Pitkänen. All rights reserved. ; ; Redistribution and use in source and binary forms, with or without ; modification, are permitted provided that the following conditions ; are met: ; 1. Redistributions of source code must retain the above copyright ; notice, this list of conditions and the following disclaimer. ; 2. Redistributions in binary form must reproduce the above copyright ; notice, this list of conditions and the following disclaimer in the ; documentation and/or other materials provided with the distribution. ; ; THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ; OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ; IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ; NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ; ;-------------------------------- ; $0041 DISSCR ; Function : inhibits the screen display ; Registers: AF, BC disscr: ld a,(RG1SAV) and $BF ld b,a ld c,1 call wrtvdp ret ;-------------------------------- ; $0044 ENASCR ; Function : displays the screen ; Registers: AF, BC enascr: ld a,(RG1SAV) or $40 ld b,a ld c,1 call wrtvdp ret ;-------------------------------- ; 0047$ WRTVDP ; Function : write data in the VDP-register ; Input : B - data to write ; C - number of the register ; Output : RG0SAV(F3DF)-RG7SAV(F3E6) ; Registers: AF, BC wrtvdp: di res 7,c ; fixes High Way Star ld a,b out (VDP_ADDR),a ld a,c or $80 out (VDP_ADDR),a ei push hl ld hl,RG0SAV IF VDP != TMS99X8 ld a,c cp 8 jr c,wrtvdp_sav ENDIF IF VDP = V9938 cp 24 jr nc,wrtvdp_nosav ld hl,RG8SAV - 8 ENDIF IF VDP = V9958 ld hl,RG8SAV - 8 cp 24 jr c,wrtvdp_sav jr z,wrtvdp_nosav cp 28 jr nc,wrtvdp_nosav ld hl,RG25SAV - 25 ENDIF wrtvdp_sav: ld a,b ld b,0 add hl,bc ld (hl),a wrtvdp_nosav: pop hl ret ;-------------------------------- ; $004A RDVRM ; Function : Reads the content of VRAM ; Input : HL - address read ; Output : A - value which was read ; Registers: AF rdvrm: call setrd IF VDP = TMS99X8 ; wait (at least) 29 t-states between VRAM accesses or 0 ENDIF in a,(VDP_DATA) ret ;-------------------------------- ; $004D WRTVRM ; Function : Writes data in VRAM ; Input : HL - address write ; A - value write ; Registers: AF wrtvrm: push af call setwrt pop af out (VDP_DATA),a ret ;-------------------------------- ; $0050 SETRD ; Function : Enable VDP to read ; Input : HL - for VRAM-address ; Registers: AF setrd: di IF VDP != TMS99X8 xor a out (VDP_ADDR),a ld a,128+14 out (VDP_ADDR),a ENDIF ld a,l out (VDP_ADDR),a ld a,h and $3F out (VDP_ADDR),a ei ret ;-------------------------------- ; $0053 SETWRT ; Function : Enable VDP to write ; Input : HL - Address ; Registers: AF setwrt: di IF VDP != TMS99X8 xor a out (VDP_ADDR),a ld a,128+14 out (VDP_ADDR),a ENDIF ld a,l out (VDP_ADDR),a ld a,h and $3F or $40 out (VDP_ADDR),a ei ret ;-------------------------------- ; $0056 FILVRM ; Function : fill VRAM with value ; Input : A - data byte ; BC - length of the area to be written ; HL - start address: ; * SCREEN 0..4 -> 14-bit address ; * SCREEN 5+ -> 17-bit address (uses ACPAGE) ; Using 14-bit address for SCREEN4 doesn't really make sense, ; but that's what we have to follow to be compatible. ; Registers: AF, BC filvrm: push af IF VDP = TMS99X8 call setwrt ELSE ld a,(SCRMOD) cp 5 jr nc,filvrm_new call setwrt jr filvrm_cont filvrm_new: call nsetwr filvrm_cont: ENDIF dec bc inc c ld a,b ld b,c ld c,a inc c pop af ; Note: Interrupts should be enabled here. ; Penguin Adventure can hang on boot if the interrupt ; comes just after our RET, which is certain if the ; memory block written is large enough. filvrm_lp: out (VDP_DATA),a IF VDP = TMS99X8 ; wait (at least) 29 t-states between VRAM accesses dec b jr nz,filvrm_lp ELSE djnz filvrm_lp ENDIF dec c jr nz,filvrm_lp ret ;-------------------------------- ; $0059 LDIRMV ; Function : Block transfer from VRAM to memory ; Input : BC - blocklength ; DE - Start address of memory ; HL - Start address of VRAM ; Registers: AF BC DE ; Note : the function doesn't destroy HL ; Note : the routine doesn't change IM ldirmv: IF VDP = TMS99X8 call setrd ELSE ld a,(SCRMOD) cp 4 jr nc,ldirmv_new call setrd jr ldirmv_cont ldirmv_new: call nsetrd ldirmv_cont: ENDIF push hl ex de,hl dec bc inc c ld a,b ld b,c inc a ld c,VDP_DATA ldirmv_lp: IF VDP = TMS99X8 ; wait (at least) 29 t-states between VRAM accesses ini jp nz, ldirmv_lp ELSE inir ENDIF dec a jr nz,ldirmv_lp pop hl ret ;-------------------------------- ; $005C LDIRVM ; Function : Block transfer from memory to VRAM ; Input : BC - blocklength ; DE - Start address of VRAM ; HL - Start address of memory ; Note : the routine doesn't change IM ; Registers: All ldirvm: ex de,hl IF VDP = TMS99X8 call setwrt ELSE ld a,(SCRMOD) cp 4 jr nc,ldirvm_new call setwrt jr ldirvm_cont ldirvm_new: call nsetwr ldirvm_cont: ENDIF ex de,hl dec bc inc c ld a,b ld b,c inc a ld c,VDP_DATA ldirvm_lp: IF VDP = TMS99X8 ; wait (at least) 29 t-states between VRAM accesses outi jp nz, ldirvm_lp ELSE otir ENDIF dec a jr nz,ldirvm_lp ; Note: Without this, Quinpl shows glitches. ; TODO: Investigate why. ex de,hl ret ;---------------------------------- ; $005F CHGMOD Changes screen mode ; Function : Switches to given screenmode ; Input : A - screen mode ; Registers: All chgmod: IF CALL_SUB = YES push ix ld ix,$00d1 jp subrom ELSE ; Guard against non-existing screen mode. IF VDP = TMS99X8 cp 4 ELSE cp 9 ENDIF ret nc ; Redirect to initialisation routine. ld hl,chgmod_tbl jp jump_table chgmod_tbl: dw initxt ; SCREEN0 dw init32 ; SCREEN1 dw inigrp ; SCREEN2 dw inimlt ; SCREEN3 IF VDP != TMS99X8 dw init_sc4 ; SCREEN4 dw init_sc5 ; SCREEN5 dw init_sc6 ; SCREEN6 dw init_sc7 ; SCREEN7 dw init_sc8 ; SCREEN8 ENDIF ; TODO: Now that we rewrite most regs at the end of CHGMOD, ; the ini* routines can just update RG?SAV instead of calling wrtvdp. chgmod_finish: ; Generic state resets. IF VDP != TMS99X8 ld hl,RG8SAV+9-8 ld a,(SCRMOD) cp 5 jr nc,chgmod_finish_lines_212 res 7,(hl) ; 192 lines mode jr chgmod_finish_lines_end chgmod_finish_lines_212: set 7,(hl) ; 212 lines mode chgmod_finish_lines_end: ; Turn off page blinking. xor a ld (RG8SAV+13-8),a ; Reset vertical scrolling. xor a ld (RG8SAV+23-8),a ENDIF ; Write new values from system RAM to the VDP. di ; Write R#0 - R#7. ld hl,RG0SAV ld bc,8 * $100 + VDP_ADDR ld d,$80 chgmod_finish_lp: outi ld a,b out (c),d inc d or a jr nz,chgmod_finish_lp IF VDP != TMS99X8 ; Setup indirect access to R#8, auto-increment. ld a,8 out (VDP_ADDR),a ld a,$80 + 17 out (VDP_ADDR),a ; Write R#8 - R#14. ld hl,RG8SAV ld bc,7 * $100 + VDP_REGS otir ; Skip these registers: inc hl ; R#15: status register selection inc hl ; R#16: palette index register inc hl ; R#17: indirect register access ; Setup indirect access to R#18, auto-increment. ld a,18 out (VDP_ADDR),a ld a,$80 + 17 out (VDP_ADDR),a ; Write R#18 - R#23. ld bc,6 * $100 + VDP_REGS otir ENDIF ei jp enascr ENDIF ;-------------------------------- ; $0062 CHGCLR ; Function : Changes the screencolors ; Input : Foregroundcolor in FORCLR ; Backgroundcolor in BAKCLR ; Bordercolor in BDRCLR ; Registers: All chgclr: ld a,(SCRMOD) cp 8 jr z,chgclr_sc8 dec a push af ld a,(FORCLR) rlca rlca rlca rlca and $F0 ld l,a ld a,(BDRCLR) or l ld b,a ld c,7 call wrtvdp pop af ret nz ; SCREEN1 ld a,(FORCLR) rlca rlca rlca rlca and $F0 ld hl,BAKCLR or (hl) ld hl,(T32COL) ld bc,$0020 push af call setwrt cclr_lp: pop af out (VDP_DATA),a push af dec bc ld a,b or c jr nz,cclr_lp pop af ret chgclr_sc8: ; SCREEN8 ld a,(BDRCLR) ld b,a ld c,7 jp wrtvdp ;-------------------------------- ; $0069 CLRSPR ; Function : Initialises all sprites ; Input : SCRMOD ; Registers: All clrspr: ; Check screen mode. ld a,(SCRMOD) or a ret z ; no sprites in SCREEN0 ; Clear sprite attribute table. call clrspr_attr ; Clear sprite colour table. ld a,(SCRMOD) cp 4 ; sprite mode 1? jr c,clrspr_col_skip ld hl,(ATRBAS) dec h dec h ; HL = (ATRBAS) - $200 ld bc,32 * 16 ld a,(FORCLR) and $0F IF VDP = TMS99X8 call filvrm ELSE call bigfil ENDIF clrspr_col_skip: ; Clear sprite pattern generator table. ld hl,(PATBAS) ld bc,256 * 8 xor a IF VDP = TMS99X8 call filvrm ELSE call bigfil ENDIF ret ;-------------------------------- ; Clear sprite attribute table. clrspr_attr: ld a,(SCRMOD) cp 4 jr c,clrspr_attr_spritemode1 ; Note: This label is called directly by external routines. clrspr_attr_spritemode2: ld e,217 ; Y coordinate jr clrspr_attr_spritemode_start ; Note: This label is called directly by external routines. clrspr_attr_spritemode1: ld e,209 ; Y coordinate clrspr_attr_spritemode_start: ld hl,(ATRBAS) IF VDP = TMS99X8 call setwrt ELSE call nsetwr ENDIF ld a,(FORCLR) ld d,a ld bc,$2000 ; B = 32 = counter, C = pattern index di clrspr_attr_lp: ld a,e out (VDP_DATA),a ; Y coordinate ld a,0 IF VDP = TMS99X8 nop ; wait (at least) 29 t-states between VRAM accesses nop ; only 2 nops, as ld a,0 is slow ENDIF out (VDP_DATA),a ; X coordinate ld a,c IF VDP = TMS99X8 nop ; wait (at least) 29 t-states between VRAM accesses nop nop ENDIF out (VDP_DATA),a ; pattern number inc c call gspsiz jr nc,clrspr_attr_8 inc c inc c inc c clrspr_attr_8: ld a,d out (VDP_DATA),a ; color djnz clrspr_attr_lp ei ret ;-------------------------------- ; $006C INITXT ; Function : Switch to SCREEN 0 ; Input : TXTNAM, TXTCGP ; Output : NAMBAS, CGPBAS, LINLEN, SCRMOD, OLDSCR ; Registers: All initxt: IF CALL_SUB = YES push ix ld ix,$00d5 ; INIT jp subrom ELSE ; Disable video output. call disscr ; New screen mode. ld a,$00 ld (SCRMOD),a ld (OLDSCR),a IF VDP != TMS99X8 ; No VRAM pages. xor a ld (DPPAGE),a ld (ACPAGE),a ENDIF ; Line length. ld a,(LINL40) ld (LINLEN),a ; Cursor position: top-left. ld a,1 ld (CSRY),a ld (CSRX),a ; Table base addresses. ld hl,(TXTNAM) ; name table ld (NAMBAS),hl ld hl,(TXTCGP) ; pattern table IF VDP != TMS99X8 ld a,(LINLEN) cp 41 jr c,initxt_width40 ld hl,$1000 initxt_width40: ENDIF ld (CGPBAS),hl ld hl,(TXTATR) ; sprite attribute table (unused) ld (ATRBAS),hl ld hl,(TXTPAT) ; sprite pattern table (unused) ld (PATBAS),hl ; Update VDP regs and VRAM. call chgclr call settxt IF COMPILE_FONT != NO call init_font ENDIF call cls_screen0 jp chgmod_finish ENDIF ;-------------------------------- ; $006F INIT32 ; Function : Switches to SCREEN 1 (text screen with 32*24 characters) ; Input : T32NAM, T32CGP, T32COL, T32ATR, T32PAT ; Output : NAMBAS, CGPBAS, LINLEN, SCRMOD, OLDSCR ; Registers: All init32: IF CALL_SUB = YES push ix ld ix,$00d9 jp subrom ELSE ; Disable video output. call disscr ld a,$01 ; SCREEN1 ld (SCRMOD),a ld (OLDSCR),a ld a,1 ld (CSRY),a ld (CSRX),a call chgclr ld hl,(T32NAM) ld (NAMBAS),hl ld hl,(T32CGP) ld (CGPBAS),hl ld hl,(T32PAT) ld (PATBAS),hl ld hl,(T32ATR) ld (ATRBAS),hl IF COMPILE_FONT != NO call init_font ENDIF ld a,(LINL32) ld (LINLEN),a IF VDP != TMS99X8 xor a ld (DPPAGE),a ld (ACPAGE),a ENDIF call sett32 call clrspr_attr_spritemode1 call cls_screen1 jp chgmod_finish ENDIF ;-------------------------------- ; $0072 INIGRP ; Function : Switches to SCREEN 2 (high resolution screen with 256*192 pixels) ; Input : GRPNAM, GRPCGP, GRPCOL, GRPATR, GRPPAT ; Output : NAMBAS-ATRBAS, SCRMOD ; Registers: All inigrp: IF CALL_SUB = YES push ix ld ix,$00dd jp subrom ELSE ; Disable video output. call disscr ld a,$02 ld (SCRMOD),a call chgclr ld hl,(GRPNAM) ld (NAMBAS),hl call setwrt ld b,3 xor a di inigrp_lp: out (VDP_DATA),a inc a jr nz,inigrp_lp djnz inigrp_lp ei ld hl,(GRPCGP) ld (CGPBAS),hl ld hl,(GRPATR) ld (ATRBAS),hl ld hl,(GRPPAT) ld (PATBAS),hl IF VDP != TMS99X8 xor a ld (DPPAGE),a ld (ACPAGE),a ENDIF call setgrp call clrspr_attr_spritemode1 call cls_screen2 jp chgmod_finish ENDIF ;------------------------------ ; $0075 INIMLT ; Function : Switches to SCREEN 3 (multi-color screen 64*48 pixels) ; Input : MLTNAM, MLTCGP, MLTCOL, MLTATR, MLTPAT ; Output : NAMBAS-ATRBAS, SCRMOD ; Registers: All inimlt: IF CALL_SUB = YES push ix ld ix,$00e1 jp subrom ELSE ; Disable video output. call disscr ld a,$03 ld (SCRMOD),a call chgclr ld hl,(MLTNAM) ld (NAMBAS),hl call setwrt xor a ld c,6 di inimlt_loop1: push af ld e,4 inimlt_loop2: push af ld b,32 inimlt_loop3: out (VDP_DATA),a inc a djnz inimlt_loop3 pop af dec e jr nz,inimlt_loop2 pop af add a,32 dec c jr nz,inimlt_loop1 ei ld hl,(MLTCGP) ld (CGPBAS),hl ld hl,(MLTATR) ld (ATRBAS),hl ld hl,(MLTPAT) ld (PATBAS),hl IF VDP != TMS99X8 xor a ld (DPPAGE),a ld (ACPAGE),a ENDIF call setmlt call clrspr_attr_spritemode1 call cls_screen3 jp chgmod_finish ENDIF ;------------------------------ ; $0078 SETTXT ; Function : Switches to VDP in SCREEN 0 mode ; Input : TXTNAM, TXTCGP ; Registers: All settxt: IF VDP != TMS99X8 ld a,(LINLEN) cp 41 jr nc,settxt80 ENDIF ld a,(RG0SAV) and $F1 ; MASK 11110001 ld b,a ld c,0 call wrtvdp ; write VDP R#0 ld a,(RG1SAV) and $E7 ; MASK 11100111 or $10 ld b,a inc c call wrtvdp ; write VDP R#1 ; Set the VDP base address registers. This works because ; TXTNAM, TXTCOL and TXTCGP are in same order as the VDP ; base address registers. ld de,TXTNAM ld c,2 xor a call set_base_address inc de ; Skip TXTCOL. inc de inc c xor a call set_base_address ret ; Switches VDP to TEXT2 mode (SCREEN 0, WIDTH 80). IF VDP != TMS99X8 settxt80: ld a,(RG0SAV) and $F1 ; MASK 11110001 or $04 ld b,a ld c,0 call wrtvdp ; write VDP R#0 ld a,(RG1SAV) and $E7 ; MASK 11100111 or $10 ld b,a inc c call wrtvdp ; write VDP R#1 ; TODO: Use TXT??? or ???BAS for base addresses. ; Set the VDP base address registers. ld de,NAMBAS ld c,2 ld a,$03 call set_base_address inc c xor a call set_base_address ret ENDIF ;------------------------------ ; $007B SETT32 ; Function : Switches VDP to SCREEN 1 mode ; Input : T32NAM, T32COL, T32CGP, T32ATR, T32PAT ; Registers: All sett32: ld a,(RG0SAV) and $F1 ; MASK 11110001 ld b,a ld c,0 call wrtvdp ; write VDP R#0 ld a,(RG1SAV) and $E7 ; MASK 11100111 ld b,a inc c call wrtvdp ; write VDP R#1 ; Set the base address registers. This works because T32NAM, ; T32COL, T32CGP, T32ATR and T32PAT are in same order as the ; VDP base address registers. ld de,T32NAM ld c,2 xor a call set_base_address xor a call set_base_address xor a call set_base_address xor a call set_base_address xor a call set_base_address ret ;------------------------------ ; $007E SETGRP ; Function : Switches VDP to SCREEN 2 mode ; Input: GRPNAM, GRPCOL, GRPCGP, GRPATR, GRPPAT ; Registers: All setgrp: ld a,(RG0SAV) and $F1 ; MASK 11110001 or $02 ; M3 = 1 ld b,a ld c,0 call wrtvdp ; write VDP R#0 ld a,(RG1SAV) and $E7 ; MASK 11100111 ld b,a inc c call wrtvdp ; write VDP R#1 ; Set the base address registers. This works because GRPNAM, ; GRPCOL, GRPCGP, GRPATR and GRPPAT are in same order as the ; VDP base address registers. ld de,GRPNAM ld c,2 xor a call set_base_address ld a,$7F call set_base_address ld a,$03 call set_base_address xor a call set_base_address xor a call set_base_address ret ;------------------------------ ; $0081 SETMLT ; Function : Switches VDP to SCREEN 3 mode ; Input : MLTNAM, MLTCGP, MLTCOL, MLTATR, MLTPAT ; Registers: All setmlt: ld a,(RG0SAV) and $F1 ld b,a ld c,0 call wrtvdp ld a,(RG1SAV) and $E7 or $08 ; M2 = 1 ld b,a inc c call wrtvdp ; Set the base address registers. This works because MLTNAM, ; MLTCOL, MLTCGP, MLTATR and MLTPAT are in same order as the ; VDP base address registers. ld de,MLTNAM ld c,2 xor a call set_base_address xor a call set_base_address; TODO: Should we ignore MLTCOL? xor a call set_base_address xor a call set_base_address xor a call set_base_address ret ;------------------------------ ; Get an address from a base address table, convert it into a register value, ; and set the corresponding VDP base address register. ; Input: DE = pointer to a base address table ; C = VDP base address register ; A = OR-mask over the converted address ; Output: DE = DE + 2 ; C = C + 1 ; Changes: AF, B, HL set_base_address: push de push af ; Get the shift value. ld hl,set_base_address_table ld b,0 add hl,bc ld b,(hl) ; Get the address from (HL) to HL. ex de,hl ld a,(hl) inc hl ld h,(hl) ld l,a ; Shift it to left in register A. After this A contains the ; converted address. set_base_address_loop: add hl,hl adc a,a djnz set_base_address_loop ld b,a ; Set the base address register. pop af or b ld b,a call wrtvdp ; Increase pointer and register number. pop de inc de inc de inc c ret set_base_address_table: db $00,$00,$06,$0A,$05,$09,$05 ;------------------------------ ; $0084 CALPAT ; Returns the address of a sprite pattern in the sprite pattern table. ; Input: A = pattern number ; Output: HL = address ; Changes: AF, DE, HL calpat: ld h,0 ld l,a add hl,hl add hl,hl add hl,hl call gspsiz jr nc,calpat_8 add hl,hl add hl,hl calpat_8: ld de,(PATBAS) add hl,de ret ;------------------------------ ; $0087 CALATR ; Returns the address of a sprite in the sprite attribute table. ; Input: A = sprite number ; Output: HL = address ; Changes: AF, DE, HL calatr: add a,a add a,a ld hl,(ATRBAS) ld d,0 ld e,a add hl,de ret ;------------------------------ ; $008A GSPSIZ ; Returns the current sprite-size in bytes. ; Output: A = sprite-size in bytes ; CF = set when size is 16x16, otherwise reset ; Changes: AF gspsiz: ld a,(RG1SAV) rrca rrca ld a,8 ret nc ld a,32 ret ;------------------------------ ; $008D GRPPRT ; Function: Places a character on graphic screen ; Input: A - Character ; GRPACX , GRPACY : X, Y coordinate ; FORCLR ; Input (SCREEN 5 and above) : ; LOGOPR for logical operator ; NOTE : the function doesn't support without SCREEN 2 ; and also slower yet. ; Register : AF ??? grpprt: push af ; Printable character or control character? cp $20 jr c,grpprt_control ; Different implementation depending on screen mode. ld a,(SCRMOD) cp 2 jr z,grpprt_sc2 cp 5 jr nc,grpprt_sc5 ; SCRMOD >= 5 grpprt_end: pop af ret grpprt_control: ; Ignore everything except carriage return ($0D). cp $0D jr nz,grpprt_end pop af ; Handle carriage return. push hl push bc ld hl,(GRPACY) ld bc,$0008 add hl,bc ld (GRPACY),hl ld hl,$0000 ld (GRPACX),hl pop bc pop hl ret grpprt_sc5: pop af ; TODO: should these routines be merged? IF CALL_SUB = YES push ix ld ix,$0089 jp subrom ENDIF ret grpprt_sc2: pop af push hl push de push bc push af call getpat ld de,(GRPACY) ld bc,(GRPACX) call mapxy ld a,(FORCLR) ld (ATRBYT),a ld hl,(CLOC) ld bc,(GRPCGP) add hl,bc ld de,PATWRK ld a,(GRPACY) and $07 ld b,$00 ld c,a add hl,bc call grpprt_chr_x ld bc,$00F0 add hl,bc ld a,(GRPACY) cpl and $07 ld c,a call grpprt_chr_x ld hl,(GRPACX) ld bc,$0008 add hl,bc ld (GRPACX),hl pop af pop bc pop de pop hl ret grpprt_chr_x: ld a,(GRPACX) and $07 push af push bc push de push hl call grpprt_chr ; half left ld a,(GRPACX) and $07 jr z,grpprt_skip_hr ld a,(CMASK) cpl ld (CMASK),a pop hl ld bc,$0008 add hl,bc pop de pop bc pop af call grpprt_chr ; half right ld a,(CMASK) cpl ld (CMASK),a ret grpprt_skip_hr: pop bc ; HL = the result of last grpprt_chr ld bc,$0008 add hl,bc pop bc ; DE = the result of last grpprt_chr pop bc pop af ret ; A = Pattern , B = Pattern in VRAM grpprt_attr: push af push hl push bc push de ld d,a ; D = Pattern of charactor ld e,b ; E = Pattern in VRAM ld bc,(GRPCOL) add hl,bc ld c,a ld a,(ATRBYT) and $0f ld b,a call rdvrm push af ; A = an attribute in VRAM and $0f cp b jr z,grpprt_attr_black pop af push af rrca rrca rrca rrca and $0f cp b jr nz,grpprt_attr_nomatch pop af grpprt_attr_end: pop de pop bc pop hl pop af ret grpprt_attr_black: pop af grpprt_attr_blk_end: pop de pop bc pop hl pop af cpl ret grpprt_attr_nomatch: ld a,d or e cp $ff jr z,grpprt_attr_make_black pop af rlc b rlc b rlc b rlc b and $0f or b call wrtvrm jr grpprt_attr_end grpprt_attr_make_black: pop af and $f0 or b call wrtvrm jr grpprt_attr_blk_end ; A = X MOD 8,C = Y MOD 8, HL = CLOC grpprt_chr: ld b,c inc a ld c,a ld a,$07 xor b inc a ld b,a grpprt_lp: push bc call rdvrm ld b,a ld a,(de) call grpprt_attr grpprt_sft_lp: dec c jr z,grpprt_sft_ed rrca jr grpprt_sft_lp grpprt_sft_ed: ld c,a ld a,(CMASK) and c ld c,a ; charactor with mask ld a,b ; B = pattern in VRAM or c call wrtvrm inc hl inc de pop bc djnz grpprt_lp ret grpprt_text: db "GRPPRT",0 ;-------------------------------- ; 0165h CHKNEW ; Is the current screen mode a bitmap mode? ; Output: Carry flag set if current screen mode is SCREEN 5 or higher. ; Changes: AF chknew: ld a,(SCRMOD) cp 5 ret ;-------------------------------- ; 016Bh BIGFIL ; Fills VRAM with a fixed value. ; Like FILVRM, but supports 128K of VRAM. ; Input: HL = VRAM start address ; (ACPAGE) = active VRAM page ; BC = number of bytes to fill ; A = value to fill VRAM with ; Changes: AF, BC bigfil: push af call nsetwr dec bc inc c ld a,b ld b,c ld c,a inc c pop af di bigfil_lp: out (VDP_DATA),a djnz bigfil_lp dec c jr nz,bigfil_lp ei ret ;-------------------------------- ; 016Eh NSETRD ; Set VRAM address and read mode. ; Like SETRD, but supports 128K of VRAM. ; Input: HL = VRAM address ; (ACPAGE) = active VRAM page ; Changes: AF ; Note: If an odd-numbered 32K page is active and HL >= $8000, ; 16-bit wrap around occurs. nsetrd: call nset_addr ld a,h and $3F out (VDP_ADDR),a ; A13..A8 ei ret ;-------------------------------- ; 0171h NSETWR ; Set VRAM address and write mode. ; Like SETWRT, but supports 128K of VRAM. ; Input: HL = VRAM address ; (ACPAGE) = active VRAM page ; Changes: AF ; Note: If an odd-numbered 32K page is active and HL >= $8000, ; 16-bit wrap around occurs. nsetwr: call nset_addr ld a,h and $3F or $40 out (VDP_ADDR),a ; A13..A8 ei ret nset_addr: ld a,(ACPAGE) or a jr z,nset_32k ld a,(SCRMOD) cp 5 jp c,setwrt cp 7 ld a,(ACPAGE) jr c,nset_32k ; SCREEN5/6 -> 32K pages add a,a ; SCREEN7/8 -> 64K pages nset_32k: push hl and $03 ; A = 0 0 0 0 0 0 P1 P0 rrca ld l,a ; L = P0 0 0 0 0 0 0 P1 and $80 ; A = P0 0 0 0 0 0 0 0 xor h ; A = A15 A14 A13 A12 A11 A10 A9 A8 rla ; CF = A15 rl l ; L = 0 0 0 0 0 0 P1 A15 rla ; CF = A14 ld a,l rla ; A = 0 0 0 0 0 P1 A15 A14 di out (VDP_ADDR),a ; A16..A14 ld a,$8E out (VDP_ADDR),a ; R#14 pop hl ld a,l out (VDP_ADDR),a ; A7..A0 ret ;-------------------------------- ; 0174h NRDVRM ; Read a byte from VRAM. ; Leaves the VRAM in read mode at the byte after the one read. ; Like RDVRM, but supports 128K of VRAM. ; Input: HL = VRAM address ; (ACPAGE) = active VRAM page ; Output: A = the byte read nrdvrm: call nsetrd in a,(VDP_DATA) ret ;-------------------------------- ; 0177h NWRVRM ; Write a byte to VRAM. ; Leaves the VRAM in write mode at the byte after the one written. ; Like WRTVRM, but supports 128K of VRAM. ; Input: HL = VRAM address ; (ACPAGE) = active VRAM page ; A = the byte to write nwrvrm: push af call nsetwr pop af out (VDP_DATA),a ret ; VDP routines which only exist in sub rom, but are useful for C-BIOS internal ; use as well: ;------------------------------------- ; $0131(sub) VDPSTA ; Read VDP status register. ; Input: A = number of status register ; Output: A = value read ; Changes: F vdpsta: di ; Select desired status register. out (VDP_ADDR),a ld a,$80 + 15 out (VDP_ADDR),a ; Read status register. in a,(VDP_STAT) push af ; Restore status register 0. xor a out (VDP_ADDR),a ld a,$80 + 15 out (VDP_ADDR),a ei pop af ret ;-------------------- ;Initializes VDP routine ;-------------------- init_vdp: in a,(VDP_STAT) ; reset latch ld bc,$0000 ; R#0 call wrtvdp ld bc,$E001 ; R#1 call wrtvdp ld bc,$0002 ; R#2 call wrtvdp ld bc,$8003 ; R#3 call wrtvdp ld bc,$0104 ; R#4 call wrtvdp ld bc,$0808 ; R#8 call wrtvdp ld a,1 ld (CSRY),a ld (CSRX),a call cls_screen1 ld a ,$00 ld hl,$0800 ld bc,$0800 call filvrm ; for screen 1 color table ld a ,$F5 ld hl,$2000 ld bc,$0020 call filvrm ; PatGenTbl ; 76543210 76543210 ; 00000100 00000000 ; 04h 00h ld bc,$F507 ; R#7 call wrtvdp IF COMPILE_FONT != NO IF MODEL_MSX != MODEL_SUBROM ld hl,B_Font ld de,$0800 ld bc,$0800 call ldirvm ELSE ld hl,$1BBF ld de,$0800 ld bc,$0800 ld iy,(EXPTBL-1) ld ix,$005C call calslt ei ENDIF ENDIF ret ; TODO: Is it safe to enable this on MSX1 machines? ; Or can we autodetect the VDP? IF VDP != TMS99X8 ; Write colour burst settings. ld bc,$0014 ; B = $00, C = 20 call wrtvdp ; VDP R#20 ld bc,$3B15 ; B = $3B, C = 21 call wrtvdp ; VDP R#21 ld bc,$0516 ; B = $05, C = 22 call wrtvdp ; VDP R#22 ENDIF ret IF COMPILE_FONT != NO ;------------------------------ ; Initialise font. ; Uploads font to VRAM address specified by CGPBAS. init_font: IF MODEL_MSX != MODEL_SUBROM ld hl,B_Font ld de,(CGPBAS) ld bc,$0800 jp ldirvm ELSE ld hl,$1BBF ; == B_Font ld de,(CGPBAS) ld bc,$0800 ld iy,(EXPTBL-1) ld ix,$005C call calslt ei ret ENDIF ENDIF IF CALL_SUB = NO IF VDP != TMS99X8 ;------------------------------ ; Initialise SCREEN4 (graphic 3). init_sc4: ; TODO: Try to reduce code duplication from inigrp. ; Disable video output. call disscr ld a,$04 ld (SCRMOD),a call chgclr ld hl,(GRPNAM) ld (NAMBAS),hl call setwrt ld b,3 xor a di init_sc4_lp: out (VDP_DATA),a inc a jr nz,init_sc4_lp djnz init_sc4_lp ei ld hl,(GRPCGP) ld (CGPBAS),hl ld hl,(GRPATR) ld (ATRBAS),hl ld hl,(GRPPAT) ld (PATBAS),hl ld a,(RG0SAV) and $F1 ; MASK 11110001 or $04 ; M4 = 1 ld b,a ld c,0 call wrtvdp ; write VDP R#0 ld a,(RG1SAV) and $E7 ; MASK 11100111 ld b,a inc c call wrtvdp ; write VDP R#1 ; TODO: This should be done for SCREEN2 as well, ; but on MSX1 this reg doesn't exist. ld bc,$000E ; B = $00, C = 14 call wrtvdp ; VDP R#14 ; Set the VDP base address registers. ld de,GRPNAM ld c,2 xor a call set_base_address ld a,$7F call set_base_address ld a,$03 call set_base_address ld de,sc4atr ld a,$03 call set_base_address ld de,GRPPAT xor a call set_base_address ; TODO: This should be done for SCREEN2 as well, ; but on MSX1 these regs don't exist. ld hl,RG8SAV+10-8 ld (hl),0 ; VDP R#10 inc hl ld (hl),0 ; VDP R#11 call clrspr_attr_spritemode1 ld bc,$000E ; B = $00, C = 14 call wrtvdp ; VDP R#14 call cls_screen2 jp chgmod_finish sc4atr: dw $1E00 ;------------------------------ ;Initializes SCREEN 5 init_sc5: ; Disable video output. call disscr ld a,$05 ld (SCRMOD),a call chgclr ld a,(RG0SAV) and $F1 ; MASK 11110001 or $06 ; M4,M3 = 1 ld b,a ; B = R#0 data ld c,0 call wrtvdp ; VDP R#0 ld a,(RG1SAV) and $E7 ; MASK 11100111 or $20 ; doesn't stop interrupt ld b,a inc c call wrtvdp ; VDP R#1 ld hl,$0000 ld (NAMBAS),hl ld hl,$7800 ld (PATBAS),hl ld hl,$7600 ld (ATRBAS),hl xor a ld (DPPAGE),a ld (ACPAGE),a ld bc,$1F02 ; B = $1F, C = 2 call wrtvdp ; VDP R#2 ; Set sprite attribute table base. ld bc,$EF05 ; B = $EF, C = 5 call wrtvdp ; VDP R#5 ld bc,$000B ; B = $00, C = 11 call wrtvdp ; VDP R#11 ; Set sprite pattern table base. ld bc,$0F06 ; B = $0F, C = 6 call wrtvdp ; VDP R#6 call clrspr_attr_spritemode2 call cls_screen5 jp chgmod_finish ;------------------------------ ; Initialise SCREEN6 (graphic 5). init_sc6: ; Disable video output. call disscr ld a,$06 ld (SCRMOD),a call chgclr ld a,(RG0SAV) and $F1 ; MASK 11110001 or $08 ; M5 = 1 ld b,a ; B = R#0 data ld c,0 call wrtvdp ; VDP R#0 ld a,(RG1SAV) and $E7 ; MASK 11100111 ld b,a inc c call wrtvdp ; VDP R#1 ld hl,$0000 ld (NAMBAS),hl ld hl,$7800 ld (PATBAS),hl ld hl,$7600 ld (ATRBAS),hl xor a ld (DPPAGE),a ld (ACPAGE),a ld bc,$1F02 ; B = $1F, C = 2 call wrtvdp ; VDP R#2 ; Set sprite attribute table base. ld bc,$EF05 ; B = $EF, C = 5 call wrtvdp ; VDP R#5 ld bc,$000B ; B = $00, C = 11 call wrtvdp ; VDP R#11 ; Set sprite pattern table base. ld bc,$0F06 ; B = $0F, C = 6 call wrtvdp ; VDP R#6 call clrspr_attr_spritemode2 call cls_screen6 jp chgmod_finish ;------------------------------ ; Initialise SCREEN7 (graphic 6). init_sc7: ; Disable video output. call disscr ld a,$07 ld (SCRMOD),a call chgclr ld a,(RG0SAV) and $F1 ; MASK 11110001 or $0A ; M5,M3 = 1 ld b,a ; B = R#0 data ld c,0 call wrtvdp ; VDP R#0 ld a,(RG1SAV) and $E7 ; MASK 11100111 ld b,a ; B = R#1 data inc c call wrtvdp ; VDP R#1 ld hl,$0000 ld (NAMBAS),hl ld hl,$F000 ld (PATBAS),hl ld hl,$FA00 ld (ATRBAS),hl xor a ld (DPPAGE),a ld (ACPAGE),a ld bc,$1F02 ; B = $1F, C = 2 call wrtvdp ; write VDP R#2 ; Set sprite attribute table base. ld bc,$F705 ; B = $F7, C = 5 call wrtvdp ; write VDP R#5 ld bc,$010B ; B = $01, C = 11 call wrtvdp ; write VDP R#11 ; Set sprite pattern table base. ld bc,$1E06 ; B = $1E, C = 6 call wrtvdp ; write VDP R#6 call clrspr_attr_spritemode2 call cls_screen7 jp chgmod_finish ;------------------------------ ; Initialise SCREEN8 (graphic 7). init_sc8: ; Disable video output. call disscr ld a,$08 ld (SCRMOD),a call chgclr ld a,(RG0SAV) or $0E ; M5,M4,M3 = 1 ld b,a ; B = R#0 data ld c,0 call wrtvdp ; VDP R#0 ld a,(RG1SAV) and $E7 ; MASK 11100111 ld b,a ; B = R#1 data inc c call wrtvdp ; VDP R#1 ld hl,$0000 ld (NAMBAS),hl ld hl,$F000 ld (PATBAS),hl ld hl,$FA00 ld (ATRBAS),hl xor a ld (DPPAGE),a ld (ACPAGE),a ld bc,$1F02 ; B = $1F, C = 2 call wrtvdp ; write VDP R#2 ; Set sprite attribute table base. ld bc,$F705 ; B = $F7, C = 5 call wrtvdp ; write VDP R#5 ld bc,$010B ; B = $01, C = 11 call wrtvdp ; write VDP R#11 ; Set sprite pattern table base. ld bc,$1E06 ; B = $1E, C = 6 call wrtvdp ; write VDP R#6 call clrspr_attr_spritemode2 call cls_screen8 jp chgmod_finish ENDIF ENDIF ;-------------------------------- ; $00C3 CLS ; Clears the screen. ; Input: BAKCLR, ; Z-Flag has to be low if the main ROM version of CLS is called; ; in the sub ROM version of CVS the Z-Flag is ignored. ; Changes: AF, BC, DE ;TODO: add optional borders to text based screens ; -> Should that happen in CLS? cls_z: ret nz cls: ld a,(SCRMOD) IF VDP = TMS99X8 cp 4 ELSE cp 9 ENDIF ret nc ; Out of range? push hl ld hl,cls_table call jump_table pop hl ret cls_table: dw cls_screen0 dw cls_screen1 dw cls_screen2 dw cls_screen3 IF VDP != TMS99X8 dw cls_screen2 ; SCREEN 4 = SCREEN 2 dw cls_screen5 dw cls_screen6 dw cls_screen7 dw cls_screen8 ENDIF cls_screen0: ld a,(LINLEN) cp 40 ld bc,40*24 jr c,cls_text ld bc,80*24 jr cls_text cls_screen1: ld bc,32*24 cls_text: ld hl,(NAMBAS) ld a,$20 call filvrm IF MODEL_MSX = MODEL_SUBROM ld hl,$0101 ld (CSRY),hl ld a,l ; l == 1 ELSE ld a,1 ENDIF ld hl,LINTTB ld (hl),a ld de,LINTTB+1 ld bc,23 ldir IF MODEL_MSX = MODEL_SUBROM ret ELSE jp chput_ctrl_home ENDIF cls_screen2: xor a ld bc,$1800 ld hl,(CGPBAS) ld l,a push bc call filvrm pop bc ld a,(BAKCLR) ld hl,(GRPCOL) jp filvrm cls_screen3: ld a,(BAKCLR) and $0F ld b,a rlca rlca rlca rlca or b ld bc,$800 ld hl,(CGPBAS) jp filvrm IF VDP != TMS99X8 cls_screen5: ld a,(BAKCLR) and 15 ld b,a rlca rlca rlca rlca or b ld hl,256 jr cls_bitmap cls_screen6: ld a,(BAKCLR) and 3 ld b,a rlca rlca or b rlca rlca rlca rlca or b ld hl,512 jr cls_bitmap cls_screen7: ld a,(BAKCLR) and 15 ld b,a rlca rlca rlca rlca or b ld hl,512 jr cls_bitmap cls_screen8: ld a,(BAKCLR) ld hl,256 cls_bitmap: push af call wait_ce pop af ld c,44 call cls_wrtvdp ld c,40 call cls_wrtvdp_hl ld hl,212 ld c,42 call cls_wrtvdp_hl ld hl,0 ld c,36 call cls_wrtvdp_hl ld a,(ACPAGE) ld h,a ld l,0 ld c,38 call cls_wrtvdp_hl ld a,0 ld c,45 call cls_wrtvdp ld a,$C0 ld c,46 call cls_wrtvdp ; Although it's not good performance wise to wait here, ; it seems programs depend on it. ; For example, Lucasarts logo in Koronis Rift. call wait_ce ret cls_wrtvdp_hl: ld a,l call cls_wrtvdp inc c ld a,h cls_wrtvdp: di out (VDP_ADDR),a ld a,c or $80 out (VDP_ADDR),a ei ret wait_ce: ld a,2 call vdpsta rra jr c,wait_ce ret ENDIF ; $0105 GETPAT ; Function : Returns current pattern of a character ; Input : A - ASCII code of character ; Output : Pattern in PATWRK starting from address #FC40 ; Registers: All ; Remark : Same as routine in MSX1-BIOS, but there it doesn't exist as ; a BIOS-call getpat: ld bc,(CGPNT+1) ld l,a ld h,0 add hl,hl add hl,hl add hl,hl add hl,bc ld b,8 ld de,PATWRK getpat_loop: push bc push de push hl ld a,(CGPNT) call rdslt pop hl pop de pop bc ld (de),a inc de inc hl djnz getpat_loop ret ;-------------------------------- ; $00FC RIGHTC ; Function : Shifts screenpixel to the right ; Registers: AF ; NOTE : This implementation is still a stub! rightc: push hl push af ld hl,rightc_text call print_debug pop af pop hl ret rightc_text: db "RIGHTC",0 ;-------------------------------- ; $00FF LEFTC ; Function : Shifts screenpixel to the left ; Registers: AF ; NOTE : This implementation is still a stub! leftc: push hl push af ld hl,leftc_text call print_debug pop af pop hl ret leftc_text: db "LEFTC",0 ;-------------------------------- ; $0102 UPC ; Function : Shifts screenpixel up ; Registers: AF ; NOTE : This implementation is still a stub! upc: push hl push af ld hl,upc_text call print_debug pop af pop hl ret upc_text: db "UPC",0 ;-------------------------------- ; $0105 TUPC ; Function : Tests whether UPC is possible, if possible, execute UPC ; Output : C-flag set if operation would end outside the screen ; Registers: AF ; NOTE : This implementation is still a stub! tupc: push hl push af ld hl,tupc_text call print_debug pop af pop hl ret tupc_text: db "TUPC",0 ;-------------------------------- ; $0108 DOWNC ; Function : Shifts screenpixel down ; Registers: AF ; NOTE : This implementation is still a stub! downc: push hl push af ld hl,downc_text call print_debug pop af pop hl ret downc_text: db "DOWNC",0 ;-------------------------------- ; $010B TDOWNC ; Function : Tests whether DOWNC is possible, if possible, execute DOWNC ; Output : C-flag set if operation would end outside the screen ; Registers: AF ; NOTE : This implementation is still a stub! tdownc: push hl push af ld hl,tdownc_text call print_debug pop af pop hl ret tdownc_text: db "TDOWNC",0 ;-------------------------------- ; $010E SCALXY ; Function : Scales X and Y coordinates ; NOTE : This implementation is still a stub! scalxy: ld bc,(GRPACX) ld de,(GRPACY) ret scalxy_text: db "SCALXY",0 ;-------------------------------- ; $0111 MAPXYC ; Function : Places cursor at current cursor address ; Input : BC = X coordinate,DE=Y coordinate ; Register : AF,D,HL ; NOTE : This is a test version mapxy: push bc ld (GRPACX),bc ld (GRPACY),de ld hl,(GRPACY) add hl,hl add hl,hl add hl,hl add hl,hl add hl,hl ld l,$00 ld b,$00 ld a,$ff ld (CMASK),a ld a,c and $07 jr z,mapxy_mask_ed ld b,a ld a,$ff mapxy_mask_lp: and a rra djnz mapxy_mask_lp ld (CMASK),a mapxy_mask_ed: ld a,c and $F8 ld c,a ld b,$00 add hl,bc ld (CLOC),hl pop bc ret mapxy_text: db "MAPXY",0 ;-------------------------------- ; $0114 FETCHC ; Function : Gets current cursor addresses mask pattern ; Output : HL - Cursor address ; A - Mask pattern fetchc: ld a,(CMASK) ld hl,(CLOC) ret fetchc_text: db "FETCHC",0 ;-------------------------------- ; $0117 STOREC ; Function : Record current cursor addresses mask pattern ; Input : HL - Cursor address ; A - Mask pattern ; NOTE : This implementation is still a stub! storec: push hl push af ld hl,storec_text call print_debug pop af pop hl ret storec_text: db "STOREC",0 ;-------------------------------- ; $011A SETATR ; Function : Set attribute byte ; NOTE : This implementation is still a stub! setatr: push hl push af ld hl,setatr_text call print_debug pop af pop hl ret setatr_text: db "SETATR",0 ;-------------------------------- ; $011D READC ; Function : Reads attribute byte of current screenpixel ; NOTE : This implementation is still a stub! readc: push hl push af ld hl,readc_text call print_debug pop af pop hl ret readc_text: db "READC",0 ;-------------------------------- ; $0120 SETC ; Function : Returns currenct screenpixel of specificed attribute byte ; NOTE : This implementation is still a stub! setc: push hl push af ld hl,setc_text call print_debug pop af pop hl ret setc_text: db "SETC",0 ;-------------------------------- ; $0123 NSETCX ; Function : Set horizontal screenpixels ; NOTE : This implementation is still a stub! nsetcx: push hl push af ld hl,nsetcx_text call print_debug pop af pop hl ret nsetcx_text: db "NSETCX",0 ;-------------------------------- ; $0126 GTASPC ; Function : Gets screen relations ; Output : DE, HL ; Registers: DE, HL ; NOTE : This implementation is still a stub! gtaspc: push hl push af ld hl,gtaspc_text call print_debug pop af pop hl ret gtaspc_text: db "GTASPC",0 ;-------------------------------- ; $0129 PNTINI ; Function : Initalises the PAINT instruction ; NOTE : This implementation is still a stub! pntini: push hl push af ld hl,pntini_text call print_debug pop af pop hl ret pntini_text: db "PNTINI",0 ;-------------------------------- ; $012C SCANR ; Function : Scans screenpixels to the right ; NOTE : This implementation is still a stub! scanr: push hl push af ld hl,scanr_text call print_debug pop af pop hl ret scanr_text: db "SCANR",0 ;-------------------------------- ; $012F SCANL ; Function : Scans screenpixels to the left ; NOTE : This implementation is still a stub! scanl: push hl push af ld hl,scanl_text call print_debug pop af pop hl ret scanl_text: db "SCANL",0 ; vim:ts=8:expandtab:filetype=z8a:syntax=z8a: cbios-0.28/src/music.asm0000644000000000000000000001125213137376076013667 0ustar rootroot; C-BIOS MSX-MUSIC ROM ; ; Copyright (c) 2004 Albert Beevendorp. All rights reserved. ; Copyright (c) 2004 BouKiCHi. All rights reserved. ; ; Redistribution and use in source and binary forms, with or without ; modification, are permitted provided that the following conditions ; are met: ; 1. Redistributions of source code must retain the above copyright ; notice, this list of conditions and the following disclaimer. ; 2. Redistributions in binary form must reproduce the above copyright ; notice, this list of conditions and the following disclaimer in the ; documentation and/or other materials provided with the distribution. ; ; THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ; OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ; IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ; NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ; org $4000 db "AB" dw 0 ; init dw 0 ; statement dw 0 ; device dw 0 ; basic text dw 0,0,0 ds 8,0 db "APRLOPLL" ;-------------------------------- ; FM BIOS ; $4110 WRTOPL ds $4110 - $ jp wrtopl ; $4113 INIOPL ds $4113 - $ jp iniopl ; $4116 MSTART ds $4116 - $ jp mstart ; $4119 MSTOP ds $4119 - $ jp mstop ; $411C RDDATA ds $411C - $ jp rddata ; $411F OPLDRV ds $411F - $ jp opldrv ; $4122 TSTBGM ds $4122 - $ jp tstbgm ;-------------------------------- ; $4110 WRTOPL ; Writes data to OPLL register. wrtopl: push hl push af ld hl,wrtopl_text call print_debug pop af pop hl ret wrtopl_text: db "music: WRTOPL ($4410) called",0 ;-------------------------------- ; $4113 INIOPL iniopl: push hl push af ld hl,iniopl_text call print_debug pop af pop hl ret iniopl_text: db "music: INIOPL ($4113) called",0 ;-------------------------------- ; $4116 MSTART mstart: push hl push af ld hl,mstart_text call print_debug pop af pop hl ret mstart_text: db "music: MSTART ($4116) called",0 ;-------------------------------- ; $4119 MSTOP mstop: push hl push af ld hl,mstop_text call print_debug pop af pop hl ret mstop_text: db "music: MSTOP ($4119) called",0 ;-------------------------------- ; $411C RDDATA rddata: push hl push af ld hl,rddata_text call print_debug pop af pop hl ret rddata_text: db "music: RDDATA ($411C) called",0 ;-------------------------------- ; $411F OPLDRV opldrv: push hl push af ld hl,opldrv_text call print_debug pop af pop hl ret opldrv_text: db "music: OPLDRV ($411F) called",0 ;-------------------------------- ; $4122 TSTBGM tstbgm: push hl push af ld hl,tstbgm_text call print_debug pop af pop hl ret tstbgm_text: db "music: TSTBGM ($4122) called",0 ;-------------------------------- include "hardware.asm" include "debug.asm" ;-------------------------------- ds $8000 - $,$FF cbios-0.28/src/basic_tables.asm0000644000000000000000000005503213137376076015166 0ustar rootroot; C-BASIC(minibas) gen_code.asm (a table for parsing) ; ; Copyright (c) 2005 BouKiCHi. All rights reserved. ; ; Redistribution and use in source and binary forms, with or without ; modification, are permitted provided that the following conditions ; are met: ; 1. Redistributions of source code must retain the above copyright ; notice, this list of conditions and the following disclaimer. ; 2. Redistributions in binary form must reproduce the above copyright ; notice, this list of conditions and the following disclaimer in the ; documentation and/or other materials provided with the distribution. ; ; THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ; OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ; IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ; NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ; table_code: dw $0000 ; $0 dw $0000 ; $1 dw $0000 ; $2 dw $0000 ; $3 dw $0000 ; $4 dw $0000 ; $5 dw $0000 ; $6 dw $0000 ; $7 dw $0000 ; $8 dw $0000 ; $9 dw $0000 ; $A dw $0000 ; $B dw $0000 ; $C dw $0000 ; $D dw $0000 ; $E dw $0000 ; $F dw $0000 ; $10 dw $0000 ; $11 dw $0000 ; $12 dw $0000 ; $13 dw $0000 ; $14 dw $0000 ; $15 dw $0000 ; $16 dw $0000 ; $17 dw $0000 ; $18 dw $0000 ; $19 dw $0000 ; $1A dw $0000 ; $1B dw $0000 ; $1C dw $0000 ; $1D dw $0000 ; $1E dw $0000 ; $1F dw $0000 ; $20 dw $0000 ; $21 dw $0000 ; $22 dw $0000 ; $23 dw $0000 ; $24 dw $0000 ; $25 dw $0000 ; $26 dw $0000 ; $27 dw $0000 ; $28 dw $0000 ; $29 dw $0000 ; $2A dw $0000 ; $2B dw $0000 ; $2C dw $0000 ; $2D dw $0000 ; $2E dw $0000 ; $2F dw $0000 ; $30 dw $0000 ; $31 dw $0000 ; $32 dw $0000 ; $33 dw $0000 ; $34 dw $0000 ; $35 dw $0000 ; $36 dw $0000 ; $37 dw $0000 ; $38 dw $0000 ; $39 dw $0000 ; $3A dw $0000 ; $3B dw $0000 ; $3C dw $0000 ; $3D dw $0000 ; $3E dw $0000 ; $3F dw $0000 ; $40 dw $0000 ; $41 dw $0000 ; $42 dw $0000 ; $43 dw $0000 ; $44 dw $0000 ; $45 dw $0000 ; $46 dw $0000 ; $47 dw $0000 ; $48 dw $0000 ; $49 dw $0000 ; $4A dw $0000 ; $4B dw $0000 ; $4C dw $0000 ; $4D dw $0000 ; $4E dw $0000 ; $4F dw $0000 ; $50 dw $0000 ; $51 dw $0000 ; $52 dw $0000 ; $53 dw $0000 ; $54 dw $0000 ; $55 dw $0000 ; $56 dw $0000 ; $57 dw $0000 ; $58 dw $0000 ; $59 dw $0000 ; $5A dw $0000 ; $5B dw $0000 ; $5C dw $0000 ; $5D dw $0000 ; $5E dw $0000 ; $5F dw $0000 ; $60 dw $0000 ; $61 dw $0000 ; $62 dw $0000 ; $63 dw $0000 ; $64 dw $0000 ; $65 dw $0000 ; $66 dw $0000 ; $67 dw $0000 ; $68 dw $0000 ; $69 dw $0000 ; $6A dw $0000 ; $6B dw $0000 ; $6C dw $0000 ; $6D dw $0000 ; $6E dw $0000 ; $6F dw $0000 ; $70 dw $0000 ; $71 dw $0000 ; $72 dw $0000 ; $73 dw $0000 ; $74 dw $0000 ; $75 dw $0000 ; $76 dw $0000 ; $77 dw $0000 ; $78 dw $0000 ; $79 dw $0000 ; $7A dw $0000 ; $7B dw $0000 ; $7C dw $0000 ; $7D dw $0000 ; $7E dw $0000 ; $7F dw $0000 ; $80 dw code_str129 ; $81 dw code_str130 ; $82 dw code_str131 ; $83 dw code_str132 ; $84 dw code_str133 ; $85 dw code_str134 ; $86 dw code_str135 ; $87 dw code_str136 ; $88 dw code_str137 ; $89 dw code_str138 ; $8A dw code_str139 ; $8B dw code_str140 ; $8C dw code_str141 ; $8D dw code_str142 ; $8E dw $0000 ; $8F dw code_str144 ; $90 dw code_str145 ; $91 dw code_str146 ; $92 dw code_str147 ; $93 dw code_str148 ; $94 dw code_str149 ; $95 dw code_str150 ; $96 dw code_str151 ; $97 dw code_str152 ; $98 dw code_str153 ; $99 dw code_str154 ; $9A dw code_str155 ; $9B dw code_str156 ; $9C dw code_str157 ; $9D dw code_str158 ; $9E dw code_str159 ; $9F dw code_str160 ; $A0 dw $0000 ; $A1 dw code_str162 ; $A2 dw code_str163 ; $A3 dw code_str164 ; $A4 dw code_str165 ; $A5 dw code_str166 ; $A6 dw code_str167 ; $A7 dw code_str168 ; $A8 dw code_str169 ; $A9 dw code_str170 ; $AA dw code_str171 ; $AB dw code_str172 ; $AC dw code_str173 ; $AD dw code_str174 ; $AE dw code_str175 ; $AF dw code_str176 ; $B0 dw code_str177 ; $B1 dw code_str178 ; $B2 dw code_str179 ; $B3 dw code_str180 ; $B4 dw code_str181 ; $B5 dw code_str182 ; $B6 dw code_str183 ; $B7 dw code_str184 ; $B8 dw code_str185 ; $B9 dw code_str186 ; $BA dw code_str187 ; $BB dw code_str188 ; $BC dw code_str189 ; $BD dw code_str190 ; $BE dw code_str191 ; $BF dw code_str192 ; $C0 dw code_str193 ; $C1 dw code_str194 ; $C2 dw code_str195 ; $C3 dw code_str196 ; $C4 dw code_str197 ; $C5 dw code_str198 ; $C6 dw code_str199 ; $C7 dw code_str200 ; $C8 dw code_str201 ; $C9 dw code_str202 ; $CA dw code_str203 ; $CB dw code_str204 ; $CC dw code_str205 ; $CD dw code_str206 ; $CE dw code_str207 ; $CF dw code_str208 ; $D0 dw code_str209 ; $D1 dw code_str210 ; $D2 dw code_str211 ; $D3 dw code_str212 ; $D4 dw code_str213 ; $D5 dw code_str214 ; $D6 dw code_str215 ; $D7 dw code_str216 ; $D8 dw code_str217 ; $D9 dw code_str218 ; $DA dw code_str219 ; $DB dw code_str220 ; $DC dw code_str221 ; $DD dw code_str222 ; $DE dw code_str223 ; $DF dw code_str224 ; $E0 dw code_str225 ; $E1 dw code_str226 ; $E2 dw code_str227 ; $E3 dw code_str228 ; $E4 dw code_str229 ; $E5 dw $0000 ; $E6 dw code_str231 ; $E7 dw code_str232 ; $E8 dw code_str233 ; $E9 dw code_str234 ; $EA dw code_str235 ; $EB dw code_str236 ; $EC dw code_str237 ; $ED dw code_str238 ; $EE dw code_str239 ; $EF dw code_str240 ; $F0 dw code_str241 ; $F1 dw code_str242 ; $F2 dw code_str243 ; $F3 dw code_str244 ; $F4 dw code_str245 ; $F5 dw code_str246 ; $F6 dw code_str247 ; $F7 dw code_str248 ; $F8 dw code_str249 ; $F9 dw code_str250 ; $FA dw code_str251 ; $FB dw code_str252 ; $FC dw $0000 ; $FD dw $0000 ; $FE dw $0000 ; $FF table_extcode: dw $0000 ; $0 dw $0000 ; $1 dw $0000 ; $2 dw $0000 ; $3 dw $0000 ; $4 dw $0000 ; $5 dw $0000 ; $6 dw $0000 ; $7 dw $0000 ; $8 dw $0000 ; $9 dw $0000 ; $A dw $0000 ; $B dw $0000 ; $C dw $0000 ; $D dw $0000 ; $E dw $0000 ; $F dw $0000 ; $10 dw $0000 ; $11 dw $0000 ; $12 dw $0000 ; $13 dw $0000 ; $14 dw $0000 ; $15 dw $0000 ; $16 dw $0000 ; $17 dw $0000 ; $18 dw $0000 ; $19 dw $0000 ; $1A dw $0000 ; $1B dw $0000 ; $1C dw $0000 ; $1D dw $0000 ; $1E dw $0000 ; $1F dw $0000 ; $20 dw $0000 ; $21 dw $0000 ; $22 dw $0000 ; $23 dw $0000 ; $24 dw $0000 ; $25 dw $0000 ; $26 dw $0000 ; $27 dw $0000 ; $28 dw $0000 ; $29 dw $0000 ; $2A dw $0000 ; $2B dw $0000 ; $2C dw $0000 ; $2D dw $0000 ; $2E dw $0000 ; $2F dw $0000 ; $30 dw $0000 ; $31 dw $0000 ; $32 dw $0000 ; $33 dw $0000 ; $34 dw $0000 ; $35 dw $0000 ; $36 dw $0000 ; $37 dw $0000 ; $38 dw $0000 ; $39 dw $0000 ; $3A dw $0000 ; $3B dw $0000 ; $3C dw $0000 ; $3D dw $0000 ; $3E dw $0000 ; $3F dw $0000 ; $40 dw $0000 ; $41 dw $0000 ; $42 dw $0000 ; $43 dw $0000 ; $44 dw $0000 ; $45 dw $0000 ; $46 dw $0000 ; $47 dw $0000 ; $48 dw $0000 ; $49 dw $0000 ; $4A dw $0000 ; $4B dw $0000 ; $4C dw $0000 ; $4D dw $0000 ; $4E dw $0000 ; $4F dw $0000 ; $50 dw $0000 ; $51 dw $0000 ; $52 dw $0000 ; $53 dw $0000 ; $54 dw $0000 ; $55 dw $0000 ; $56 dw $0000 ; $57 dw $0000 ; $58 dw $0000 ; $59 dw $0000 ; $5A dw $0000 ; $5B dw $0000 ; $5C dw $0000 ; $5D dw $0000 ; $5E dw $0000 ; $5F dw $0000 ; $60 dw $0000 ; $61 dw $0000 ; $62 dw $0000 ; $63 dw $0000 ; $64 dw $0000 ; $65 dw $0000 ; $66 dw $0000 ; $67 dw $0000 ; $68 dw $0000 ; $69 dw $0000 ; $6A dw $0000 ; $6B dw $0000 ; $6C dw $0000 ; $6D dw $0000 ; $6E dw $0000 ; $6F dw $0000 ; $70 dw $0000 ; $71 dw $0000 ; $72 dw $0000 ; $73 dw $0000 ; $74 dw $0000 ; $75 dw $0000 ; $76 dw $0000 ; $77 dw $0000 ; $78 dw $0000 ; $79 dw $0000 ; $7A dw $0000 ; $7B dw $0000 ; $7C dw $0000 ; $7D dw $0000 ; $7E dw $0000 ; $7F dw $0000 ; $80 dw code_str_ex129 ; $81 dw code_str_ex130 ; $82 dw code_str_ex131 ; $83 dw code_str_ex132 ; $84 dw code_str_ex133 ; $85 dw code_str_ex134 ; $86 dw code_str_ex135 ; $87 dw code_str_ex136 ; $88 dw code_str_ex137 ; $89 dw code_str_ex138 ; $8A dw code_str_ex139 ; $8B dw code_str_ex140 ; $8C dw code_str_ex141 ; $8D dw code_str_ex142 ; $8E dw code_str_ex143 ; $8F dw code_str_ex144 ; $90 dw code_str_ex145 ; $91 dw code_str_ex146 ; $92 dw code_str_ex147 ; $93 dw code_str_ex148 ; $94 dw code_str_ex149 ; $95 dw code_str_ex150 ; $96 dw code_str_ex151 ; $97 dw code_str_ex152 ; $98 dw code_str_ex153 ; $99 dw code_str_ex154 ; $9A dw code_str_ex155 ; $9B dw code_str_ex156 ; $9C dw code_str_ex157 ; $9D dw code_str_ex158 ; $9E dw code_str_ex159 ; $9F dw code_str_ex160 ; $A0 dw code_str_ex161 ; $A1 dw code_str_ex162 ; $A2 dw code_str_ex163 ; $A3 dw code_str_ex164 ; $A4 dw code_str_ex165 ; $A5 dw code_str_ex166 ; $A6 dw code_str_ex167 ; $A7 dw code_str_ex168 ; $A8 dw code_str_ex169 ; $A9 dw code_str_ex170 ; $AA dw code_str_ex171 ; $AB dw code_str_ex172 ; $AC dw code_str_ex173 ; $AD dw code_str_ex174 ; $AE dw code_str_ex175 ; $AF dw code_str_ex176 ; $B0 dw $0000 ; $B1 dw $0000 ; $B2 dw $0000 ; $B3 dw $0000 ; $B4 dw $0000 ; $B5 dw $0000 ; $B6 dw $0000 ; $B7 dw $0000 ; $B8 dw $0000 ; $B9 dw $0000 ; $BA dw $0000 ; $BB dw $0000 ; $BC dw $0000 ; $BD dw $0000 ; $BE dw $0000 ; $BF dw $0000 ; $C0 dw $0000 ; $C1 dw $0000 ; $C2 dw $0000 ; $C3 dw $0000 ; $C4 dw $0000 ; $C5 dw $0000 ; $C6 dw $0000 ; $C7 dw $0000 ; $C8 dw $0000 ; $C9 dw $0000 ; $CA dw $0000 ; $CB dw $0000 ; $CC dw $0000 ; $CD dw $0000 ; $CE dw $0000 ; $CF dw $0000 ; $D0 dw $0000 ; $D1 dw $0000 ; $D2 dw $0000 ; $D3 dw $0000 ; $D4 dw $0000 ; $D5 dw $0000 ; $D6 dw $0000 ; $D7 dw $0000 ; $D8 dw $0000 ; $D9 dw $0000 ; $DA dw $0000 ; $DB dw $0000 ; $DC dw $0000 ; $DD dw $0000 ; $DE dw $0000 ; $DF dw $0000 ; $E0 dw $0000 ; $E1 dw $0000 ; $E2 dw $0000 ; $E3 dw $0000 ; $E4 dw $0000 ; $E5 dw $0000 ; $E6 dw $0000 ; $E7 dw $0000 ; $E8 dw $0000 ; $E9 dw $0000 ; $EA dw $0000 ; $EB dw $0000 ; $EC dw $0000 ; $ED dw $0000 ; $EE dw $0000 ; $EF dw $0000 ; $F0 dw $0000 ; $F1 dw $0000 ; $F2 dw $0000 ; $F3 dw $0000 ; $F4 dw $0000 ; $F5 dw $0000 ; $F6 dw $0000 ; $F7 dw $0000 ; $F8 dw $0000 ; $F9 dw $0000 ; $FA dw $0000 ; $FB dw $0000 ; $FC dw $0000 ; $FD dw $0000 ; $FE dw $0000 ; $FF ;------------------------ code_str129: ; $81 db "END",$00 code_str130: ; $82 db "FOR",$00 code_str131: ; $83 db "NEXT",$00 code_str132: ; $84 db "DATA",$00 code_str133: ; $85 db "INPUT",$00 code_str134: ; $86 db "DIM",$00 code_str135: ; $87 db "READ",$00 code_str136: ; $88 db "LET",$00 code_str137: ; $89 db "GOTO",$00 code_str138: ; $8A db "RUN",$00 code_str139: ; $8B db "IF",$00 code_str140: ; $8C db "RESTORE",$00 code_str141: ; $8D db "GOSUB",$00 code_str142: ; $8E db "RETURN",$00 code_str144: ; $90 db "STOP",$00 code_str145: ; $91 db "PRINT",$00 code_str146: ; $92 db "CLEAR",$00 code_str147: ; $93 db "LIST",$00 code_str148: ; $94 db "NEW",$00 code_str149: ; $95 db "ON",$00 code_str150: ; $96 db "WAIT",$00 code_str151: ; $97 db "DEF",$00 code_str152: ; $98 db "POKE",$00 code_str153: ; $99 db "CONT",$00 code_str154: ; $9A db "CSAVE",$00 code_str155: ; $9B db "CLOAD",$00 code_str156: ; $9C db "OUT",$00 code_str157: ; $9D db "LPRINT",$00 code_str158: ; $9E db "LLIST",$00 code_str159: ; $9F db "CLS",$00 code_str160: ; $A0 db "WIDTH",$00 code_str162: ; $A2 db "TRON",$00 code_str163: ; $A3 db "TROFF",$00 code_str164: ; $A4 db "SWAP",$00 code_str165: ; $A5 db "ERASE",$00 code_str166: ; $A6 db "ERROR",$00 code_str167: ; $A7 db "RESUME",$00 code_str168: ; $A8 db "DELETE",$00 code_str169: ; $A9 db "AUTO",$00 code_str170: ; $AA db "RENUM",$00 code_str171: ; $AB db "DEFSTR",$00 code_str172: ; $AC db "DEFINT",$00 code_str173: ; $AD db "DEFSNG",$00 code_str174: ; $AE db "DEFDBL",$00 code_str175: ; $AF db "LINE",$00 code_str176: ; $B0 db "OPEN",$00 code_str177: ; $B1 db "FIELD",$00 code_str178: ; $B2 db "GET",$00 code_str179: ; $B3 db "PUT",$00 code_str180: ; $B4 db "CLOSE",$00 code_str181: ; $B5 db "LOAD",$00 code_str182: ; $B6 db "MERGE",$00 code_str183: ; $B7 db "FILES",$00 code_str184: ; $B8 db "LSET",$00 code_str185: ; $B9 db "RSET",$00 code_str186: ; $BA db "SAVE",$00 code_str187: ; $BB db "LFILES",$00 code_str188: ; $BC db "CIRCLE",$00 code_str189: ; $BD db "COLOR",$00 code_str190: ; $BE db "DRAW",$00 code_str191: ; $BF db "PAINT",$00 code_str192: ; $C0 db "BEEP",$00 code_str193: ; $C1 db "PLAY",$00 code_str194: ; $C2 db "PSET",$00 code_str195: ; $C3 db "PRESET",$00 code_str196: ; $C4 db "SOUND",$00 code_str197: ; $C5 db "SCREEN",$00 code_str198: ; $C6 db "VPOKE",$00 code_str199: ; $C7 db "SPRITE",$00 code_str200: ; $C8 db "VDP",$00 code_str201: ; $C9 db "BASE",$00 code_str202: ; $CA db "CALL",$00 code_str203: ; $CB db "TIME",$00 code_str204: ; $CC db "KEY",$00 code_str205: ; $CD db "MAX",$00 code_str206: ; $CE db "MOTOR",$00 code_str207: ; $CF db "BLOAD",$00 code_str208: ; $D0 db "BSAVE",$00 code_str209: ; $D1 db "DSKO$",$00 code_str210: ; $D2 db "SET",$00 code_str211: ; $D3 db "NAME",$00 code_str212: ; $D4 db "KILL",$00 code_str213: ; $D5 db "IPL",$00 code_str214: ; $D6 db "COPY",$00 code_str215: ; $D7 db "CMD",$00 code_str216: ; $D8 db "LOCATE",$00 code_str217: ; $D9 db "TO",$00 code_str218: ; $DA db "THEN",$00 code_str219: ; $DB db "TAB(",$00 code_str220: ; $DC db "STEP",$00 code_str221: ; $DD db "USR",$00 code_str222: ; $DE db "FN",$00 code_str223: ; $DF db "SPC(",$00 code_str224: ; $E0 db "NOT",$00 code_str225: ; $E1 db "ERL",$00 code_str226: ; $E2 db "ERR",$00 code_str227: ; $E3 db "STRING$",$00 code_str228: ; $E4 db "USING",$00 code_str229: ; $E5 db "INSTR",$00 code_str231: ; $E7 db "VARPTR",$00 code_str232: ; $E8 db "CSRLIN",$00 code_str233: ; $E9 db "ATTR$",$00 code_str234: ; $EA db "DSKI$",$00 code_str235: ; $EB db "OFF",$00 code_str236: ; $EC db "INKEY$",$00 code_str237: ; $ED db "POINT",$00 code_str238: ; $EE db ">",$00 code_str239: ; $EF db "=",$00 code_str240: ; $F0 db "<",$00 code_str241: ; $F1 db "+",$00 code_str242: ; $F2 db "-",$00 code_str243: ; $F3 db "*",$00 code_str244: ; $F4 db "/",$00 code_str245: ; $F5 db "^",$00 code_str246: ; $F6 db "AND",$00 code_str247: ; $F7 db "OR",$00 code_str248: ; $F8 db "XOR",$00 code_str249: ; $F9 db "EQV",$00 code_str250: ; $FA db "IMP",$00 code_str251: ; $FB db "MOD",$00 code_str252: ; $FC db "\\",$00 ;------------------------ code_str_ex129: ; $81 db "LEFT$",$00 code_str_ex130: ; $82 db "RIGHT$",$00 code_str_ex131: ; $83 db "MID$",$00 code_str_ex132: ; $84 db "SGN",$00 code_str_ex133: ; $85 db "INT",$00 code_str_ex134: ; $86 db "ABS",$00 code_str_ex135: ; $87 db "SQR",$00 code_str_ex136: ; $88 db "RND",$00 code_str_ex137: ; $89 db "SIN",$00 code_str_ex138: ; $8A db "LOG",$00 code_str_ex139: ; $8B db "EXP",$00 code_str_ex140: ; $8C db "COS",$00 code_str_ex141: ; $8D db "TAN",$00 code_str_ex142: ; $8E db "ATN",$00 code_str_ex143: ; $8F db "REM",$00 code_str_ex144: ; $90 db "INP",$00 code_str_ex145: ; $91 db "POS",$00 code_str_ex146: ; $92 db "LEN",$00 code_str_ex147: ; $93 db "STR$",$00 code_str_ex148: ; $94 db "VAL",$00 code_str_ex149: ; $95 db "ASC",$00 code_str_ex150: ; $96 db "CHR$",$00 code_str_ex151: ; $97 db "PEEK",$00 code_str_ex152: ; $98 db "VPEEK",$00 code_str_ex153: ; $99 db "SPACE$",$00 code_str_ex154: ; $9A db "OCT$",$00 code_str_ex155: ; $9B db "HEX$",$00 code_str_ex156: ; $9C db "LPOS",$00 code_str_ex157: ; $9D db "BIN$",$00 code_str_ex158: ; $9E db "CINT",$00 code_str_ex159: ; $9F db "CSNG",$00 code_str_ex160: ; $A0 db "CDBL",$00 code_str_ex161: ; $A1 db "FIX",$00 code_str_ex162: ; $A2 db "STICK",$00 code_str_ex163: ; $A3 db "STRIG",$00 code_str_ex164: ; $A4 db "PDL",$00 code_str_ex165: ; $A5 db "PAD",$00 code_str_ex166: ; $A6 db "DSKF",$00 code_str_ex167: ; $A7 db "FPOS",$00 code_str_ex168: ; $A8 db "CVI",$00 code_str_ex169: ; $A9 db "CVS",$00 code_str_ex170: ; $AA db "CVD",$00 code_str_ex171: ; $AB db "EOF",$00 code_str_ex172: ; $AC db "LOC",$00 code_str_ex173: ; $AD db "LOF",$00 code_str_ex174: ; $AE db "MKI$",$00 code_str_ex175: ; $AF db "MKS$",$00 code_str_ex176: ; $B0 db "MKD$",$00 cbios-0.28/src/hardware.asm0000644000000000000000000001125213137376076014344 0ustar rootroot; C-BIOS hardware related declarations ; ; Copyright (c) 2002-2005 BouKiCHi. All rights reserved. ; Copyright (c) 2003 Reikan. All rights reserved. ; Copyright (c) 2004-2005 Maarten ter Huurne. All rights reserved. ; Copyright (c) 2004 Manuel Bilderbeek. All rights reserved. ; Copyright (c) 2004-2006 Albert Beevendorp. All rights reserved. ; Copyright (c) 2004-2005 Joost Yervante Damad. All rights reserved. ; ; Redistribution and use in source and binary forms, with or without ; modification, are permitted provided that the following conditions ; are met: ; 1. Redistributions of source code must retain the above copyright ; notice, this list of conditions and the following disclaimer. ; 2. Redistributions in binary form must reproduce the above copyright ; notice, this list of conditions and the following disclaimer in the ; documentation and/or other materials provided with the distribution. ; ; THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ; OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ; IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ; NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ; ;--------------------------------------------------- ; I/O ports DBG_CTRL: equ $2E ; openMSX debugdevice control (mode) DBG_DATA: equ $2F ; openMSX debugdevice data PRN_STAT: equ $90 ; printer status PRN_DATA: equ $91 ; printer data VDP_DATA: equ $98 ; VDP data port (VRAM read/write) VDP_ADDR: equ $99 ; VDP address (write only) VDP_STAT: equ $99 ; VDP status (read only) VDP_PALT: equ $9A ; VDP palette latch (write only) VDP_REGS: equ $9B ; VDP register access (write only) PSG_REGS: equ $A0 ; PSG register write port PSG_DATA: equ $A1 ; PSG value write port PSG_STAT: equ $A2 ; PSG value read port PSL_STAT: equ $A8 ; slot status KBD_STAT: equ $A9 ; keyboard status GIO_REGS: equ $AA ; General IO Register PPI_REGS: equ $AB ; PPI register RTC_ADDR: equ $B4 ; RTC address RTC_DATA: equ $B5 ; RTC data SYSFLAGS: equ $F4 ; MSX2+ System flags, ; preserved after reset ; bit 5: CPU boot mode (1=R800) ; bit 7: Boot method ; (1=soft boot, no logo) MAP_REG1: equ $FC ; memory mapper: bank in $0000-$3FFF MAP_REG2: equ $FD ; memory mapper: bank in $4000-$7FFF MAP_REG3: equ $FE ; memory mapper: bank in $8000-$BFFF MAP_REG4: equ $FF ; memory mapper: bank in $C000-$FFFF ;--------------------------------------------------- ; memory mapped I/O SSL_REGS: equ $FFFF ; secondary slot select registers ;--------------------------------------------------- ; Constants used to define which hardware the BIOS will run on. ; Used by the main_.asm sources. ; VDP models: TMS99X8: equ $9918 V9938: equ $9938 V9958: equ $9958 ; MSX models: MODEL_MSX1: equ 0 MODEL_MSX2: equ 1 MODEL_MSX2P: equ 2 MODEL_MSXTR: equ 3 MODEL_SUBROM: equ 4 ; Locales: ; -- ID byte 0 LOCAL_CHSET_JP equ $00 LOCAL_CHSET_US equ $01 LOCAL_CHSET_KO equ $02 ; There are charsets which pretend to be INT, but are not... For now only BR: LOCAL_CHSET_VAR_NONE equ $00 LOCAL_CHSET_VAR_BR equ $01 LOCAL_DATE_YMD equ $00 LOCAL_DATE_MDY equ $10 LOCAL_DATE_DMY equ $20 LOCAL_INT_60HZ equ $00 LOCAL_INT_50HZ equ $80 ; -- ID byte 1 LOCAL_KBD_JP equ $00 LOCAL_KBD_US equ $01 LOCAL_KBD_FR equ $02 LOCAL_KBD_UK equ $03 LOCAL_KBD_DE equ $04 LOCAL_BASIC_JP equ $00 LOCAL_BASIC_US equ $01 ; BOOLEAN VALUES YES: equ 1 NO: equ 0 ; vim:ts=8:expandtab:filetype=z8a:syntax=z8a: cbios-0.28/src/basic.asm0000644000000000000000000003710413137376076013634 0ustar rootroot; C-BASIC(minibas) main ROM ; ; Copyright (c) 2005 BouKiCHi. All rights reserved. ; ; Redistribution and use in source and binary forms, with or without ; modification, are permitted provided that the following conditions ; are met: ; 1. Redistributions of source code must retain the above copyright ; notice, this list of conditions and the following disclaimer. ; 2. Redistributions in binary form must reproduce the above copyright ; notice, this list of conditions and the following disclaimer in the ; documentation and/or other materials provided with the distribution. ; ; THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ; OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ; IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ; NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ; CHGMOD: equ $005f CHPUT: equ $00A2 CHGET: equ $009F ENASLT: equ $0024 EXPTBL: equ $FCC1 RSLREG: equ $0138 WORK: equ $E000 MEMPTR: equ WORK INCMD: equ WORK+$100 MEMMGR: equ WORK+$800 ;------------------------ ; Memory structure info ; MEMMGR+0h : type id ; MEMMGR+1h : a pointer to string ; MEMMGR+3h : an address of value ; ----------------------- ; ROM Header org $4000 db "AB" dw bas_main dw $0000 dw $0000 dw $0000 dw $0000 dw $0000 dw $0000 ; The start point of the code bas_main: ld a,1 call CHGMOD ; change to screen 1 call make_ramslot ; make a value to RAM ld hl,$8000 call ENASLT ; form here : Page0 = BIOS ,Page 1 = THIS, Page 2,3 = RAM call init_bas ld hl,str_startmsg call prn_text ld hl,str_lf call prn_text jp bas_loop ;------------------------ ; init_bas ; The routine initialises all parameters ; Changes : ALL init_bas: ld hl,MEMMGR ld (MEMPTR),hl ld a,$80 ld (hl),a ld hl,bas_code ld de,$8000 ld bc,bas_code_end - bas_code ldir ; transmit to ram ret ;------------------------ ; bas_loop ; The routine does loop mainly ; Changes : ALL bas_loop: ld hl,str_okprompt call prn_text ld hl,INCMD call get_string ld hl,INCMD call strupr ld hl,INCMD call parser jr bas_loop ;------------------------ ; get_string ; The routine is for getting string a line ; Changes : AF,HL ; get_string: ld b,$00 gs_lp: call CHGET cp $08 jr z,gs_get_back cp $0d jr z,gs_end call CHPUT ld (hl),a inc hl inc b jr gs_lp gs_end: call CHPUT ld a,$0a call CHPUT xor a ld (hl),a ret gs_get_back: xor a cp b jr z,gs_lp dec hl dec b ld a,$08 call CHPUT ld a,$20 call CHPUT ld a,$08 call CHPUT jr gs_lp ;----------------------- ; parser ; The routine is parser of the BASIC ; Changes: unknown parser: call isdigit jr z,single_cmd ld hl,str_linecmd call prn_text ret single_cmd: call search_cmd ret ;----------------------- ; search_cmd ; The routine searches command to execute and executes actually ; Changes: unknown search_cmd: ld hl,data_icmd ld b,$00 scmd_lp: ld de,INCMD ld a,(hl) cp $00 jr nz,scmd_chk inc hl ld a,(hl) cp $00 ret z dec hl scmd_chk: call scmd_get_sl jr z,scmd_eql inc hl inc hl inc b jr scmd_lp scmd_eql: ld hl,data_cmdexe xor a or b jr z,scmd_jmp scmd_eql_lp: inc hl inc hl dec b jr nz,scmd_eql_lp scmd_jmp: ld a,(hl) inc hl ld h,(hl) ld l,a push hl ret scmd_get_sl: push hl ld a,(hl) inc hl ld h,(hl) ld l,a call strcmp pop hl ret ;----------------------- ; strcmp ; Compares string HL with DE until HL is NUL ; Out : ZF = 1 when it is equal ; Changes: AF,HL,DE strcmp: xor a cp (hl) jr z,scmp_eq ld a,(de) cp (hl) jr nz,scmp_neq cp $00 ret z inc hl inc de jr strcmp scmp_neq: ld a,$ff or a scmp_eq: ret ;----------------------- ; ifasval ; Checks the input is action of assigning the value ; In : DE = head of input string , HL = the name of the value ; Out : AF = operand or token, AF == 0xff when it failed ; Changes: AF,HL,DE ifasval: xor a cp (hl) jr z,ifas_eq ld a,(de) cp '=' jr z,ifas_eq cp '$' jr z,ifas_eq cp (hl) jr nz,scmp_neq cp $00 ret z inc hl inc de jr ifasval ifas_neq: ld a,$ff or a ifas_eq: ret ;----------------------- ; disp_niy ; The routine says "not implemented yet" ; Changes: unknown disp_niy: ld hl,str_niy call prn_text ret ;----------------------- ; disp_list ; The routine displays BASIC list ; Changes: unknown disp_list: ld ix,$8001 call list_bas ret ;----------------------- ; isdigit ; Checks digit or not ; In : HL = pointer to character to check ; Out: ZF = 1 when (HL) is digit ; Changes: unknown isdigit: ld a,(HL) cp '0' jr z,isdigit_true jr c,isdigit_false cp '9' jr nc,isdigit_false isdigit_true: ld a,$ff or a ret isdigit_false: xor a ret ;----------------------- ; strupr ; Changes string to upper case ; In : HL = a pointer to string ; Changes: unknown strupr: ld a,(HL) cp 'a' jr z,supr_toupr jr c,supr_skip cp 'z' jr nc,supr_skip supr_toupr: sub $20 ld (HL),a supr_skip: cp $00 ret z inc hl jr strupr ;----------------------- ; get_value ; The routine gets a value from memory managed area ; In : HL = a pointer of string ; Out: DE = a pointer to value, status = A ; Changes : Unknown get_value: ld de,MEMMGR loop_get_value: ld a,(de) cp $80 ret z inc de push hl push de ex de,hl ld a,(hl) inc hl ld h,(hl) ld l,a call str_compr jr z,read_value pop de pop hl inc de inc de inc de inc de jr loop_get_value read_value: pop hl ; a simple trick pop de ld a,(hl) inc hl ld h,(hl) ld l,a xor a ret ;----------------------- ; str_compr ; The routine compares string HL with DE ; The strings have to be terminated by NUL($00) ; In : HL,DE = string ; Out: Z -> the same : NZ -> not the same ; Changes : HL,DE str_compr: ld a,(de) cp (hl) ret nz cp $00 ret z inc hl inc de jr str_compr ;------------------------ ; list_bas ; for displaying internal code as a list ; Changes : ALL list_bas: ld b,(ix) ; ptr of next_line inc ix ld c,(ix) inc ix ld a,b or c ret z line_start: call read_num ; line number call disp_dec_nz ld a,' ' call CHPUT line_loop: ld a,(ix) inc ix cp $20 jp nc,put_code ; special code (A < $20) cp $11 jp nc,disp_num1 cp $0f jp z,disp_num2 cp $00 jp z,line_end jr line_loop put_code: ld d,a ld c,a ld b,0 ld hl,table_code add hl,bc add hl,bc ld a,(hl) inc hl ld h,(hl) ld l,a or h jr nz,prn_code ld a,d call CHPUT jp line_loop prn_code: call prn_text jp line_loop disp_num1: add a,'0'-$11 call CHPUT jp line_loop disp_num2: call read_num call disp_dec_nz jp line_loop line_end: ld hl,str_lf call prn_text jp list_bas read_num: ld l,(ix) inc ix ld h,(ix) inc ix ret ;----------------------------- dispdec_lf: ld d,0 call disp_dec ld hl,str_lf call prn_text ret ;--------------------------- ;disp_dec_nz ; The routine displays decimal without zero ; This is a wrapper of disp_dec disp_dec_nz: ld d,0 ;--------------------------- ; display decimal ; The routine displays decimal ; In : HL = value , D = zero flag ; Changes: unknown disp_dec: ld bc,$d8f0 ; -10000 call nega_hl call put_dec ld bc,$fc18 ; -1000 call nega_hl call put_dec ld bc,$ff9c ; -100 call nega_hl call put_dec ld bc,$fff6 ; -10 call nega_hl call put_dec ld a,l add a,'0' call CHPUT ret put_dec: or a jr z,skip_flag ld d,1 skip_flag: bit 0,d ret z add a,'0' jp CHPUT nega_hl: xor a nega_lp: add hl,bc inc a jr c,nega_lp sbc hl,bc dec a ret ;table_dec_neg ; dw $d8f0 ; -10000 ; dw $fc18 ; -1000 ; dw $ff9c ; -100 ; dw $fff6 ; -10 ;------------------------ ;make_ramslot ;The routine makes a value of RAM slot make_ramslot: call RSLREG rlca rlca and $03 ld c,a ld b,0 ld ix,EXPTBL add ix,bc ld e,a ld a,(ix) and $80 jr z,no_exp or e ld e,a inc ix inc ix inc ix inc ix ld a,(ix) rrca rrca rrca rrca and $0c or e ret no_exp: ld a,e ret ;------------------------ prn_text: prn_str_disp: ld a,(hl) or a jp z,nul_term call CHPUT inc hl jr prn_str_disp nul_term: ret ; internal code table include "basic_tables.asm" str_startmsg: db "C-BASIC ver 0.02 (050607)",$0d,$0a db "Copyright (C) BouKiCHi",$0d,$0a,$00 str_okprompt: db "Ok",$0d,$0a,$00 str_linecmd: db "recognized Line num",$0d,$0a,$00 str_niy: db "Not implemented yet",$0d,$0a,$00 str_lf: db $0d,$0a,$00 ; Internal command table data_icmd: dw icmd_list dw icmd_vlist dw $0000 data_cmdexe: dw disp_list dw disp_niy dw $0000 ;--------------------------- ; list of internal commands icmd_list: db "LIST",$00 icmd_vlist: db "VLIST",$00 ;--------------------------- ; test.bas(for test) ; bas_code: incbin "test.bas" bas_code_end: ;end ds $8000-$ cbios-0.28/src/chput.asm0000644000000000000000000004777213137376076013712 0ustar rootroot; CHPUT routine for C-BIOS ; ; Copyright (c) 2006 Eric Boon. All rights reserved. ; ; Redistribution and use in source and binary forms, with or without ; modification, are permitted provided that the following conditions ; are met: ; 1. Redistributions of source code must retain the above copyright ; notice, this list of conditions and the following disclaimer. ; 2. Redistributions in binary form must reproduce the above copyright ; notice, this list of conditions and the following disclaimer in the ; documentation and/or other materials provided with the distribution. ; ; THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ; OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ; IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ; NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ; ; ------------------------------------- ; $00A2 CHPUT ; Function : Output character in A to screen ; Input : A = character code ; Output : - ; Changes : - chput: push hl ; save all regs push de push bc push af call H_CHPU ; call hook ld a,(SCRMOD) ; this only works in cp 2 ; screen modes 0 and 1 jr nc,chput_exit pop af ; restore char to put in A push af call chput_remove_cursor pop af ; restore char to put in A push af call chput_decode_char call chput_restore_cursor ld a,(CSRX) ; CSRX -> TTYPOS ld (TTYPOS),a chput_exit: pop af pop bc pop de pop hl ret ; -- decode character in A chput_decode_char: call cnvchr ; Graphic character? ret nc ; NC -> graphic extension hdr jr z,chput_putchar ; C,Z -> graphic character push af ; (C,NZ -> normal char) ld a,(ESCCNT) ; ESC sequence? or a jp nz,chput_escape pop af cp $20 ; Control code? jr c,chput_ctrl_search cp 127 ; DEL? jp z,chput_erase ; -- print a normal character and move cursor to next position chput_putchar: call curs2hl ; output character to screen call wrtvrm ld hl,(CSRY) ; h = (CSRX), l = (CSRY) ld a,(LINLEN) inc h cp h jr c,chput_continue_line ld (CSRY),hl ret chput_continue_line: ld de,LINTTB-1 ; make logical line continue ld h,0 add hl,de xor a ld (hl),a ld hl,(CSRY) ; move cursor to start of call chput_ctrl_cr ; new line jp chput_ctrl_lf ; -- Handle control code chput_ctrl_search: ld b,12 ld hl,chput_ctrl_table jp search_table ; -- Fill with spaces until next TAB stop chput_ctrl_tab: ld a,$20 call chput_putchar ld a,(CSRX) and 7 cp 1 jr nz,chput_ctrl_tab ret ; -- Line Feed. chput_ctrl_lf: ld hl,(CSRY) ld a,(CRTCNT) inc l cp l jr nc,chput_ctrl_lf_done push hl call chput_ctrl_home ; home cursor call chput_esc_m ; delete top line (scroll!) pop hl dec l chput_ctrl_lf_done: ld (CSRY),hl ret ; -- Home cursor chput_ctrl_home: chput_esc_h: ld hl,$0101 ld (CSRY),hl ret ; -- Form Feed / Cls chput_ctrl_ff: equ cls chput_esc_e: equ cls chput_esc_j: equ cls ; -- Clear till end of screen chput_esc_jj: call chput_esc_k ; clear till end of line ld hl,(CSRY) ; save current cursor pos push hl call chput_ctrl_cr ; move to line start chput_esc_jj_loop: ld a,(CSRY) ; while no at end of screen ld hl,CRTCNT cp (hl) jr nc,chput_esc_jj_done call chput_ctrl_lf ; move to next line call chput_esc_k ; clear till end of line jr chput_esc_jj_loop ; loop chput_esc_jj_done: pop hl ; restore cursor pos ld (CSRY),hl ret ; -- Carriage return chput_ctrl_cr: ld a,1 ld (CSRX),a ret ; -- Escape chput_ctrl_esc: ld a,$FF ld (ESCCNT),a ret ; -- Cursor right chput_ctrl_right: ld a,(CSRX) ld hl,LINLEN cp (hl) jr nc,chput_ctrl_right_next inc a jr chput_right_left_ok chput_ctrl_right_next: ld a,(CSRY) ld hl,CRTCNT cp (hl) ret nc inc a ld (CSRY),a jr chput_ctrl_cr ; -- Cursor left chput_ctrl_bs: chput_ctrl_left: ld a,(CSRX) dec a jr nz,chput_right_left_ok ld a,(CSRY) dec a ret z ld (CSRY),a ld a,(LINLEN) chput_right_left_ok: ld (CSRX),a ret ; -- Cursor up chput_ctrl_up: chput_esc_a: ld a,(CSRY) dec a ret z ld (CSRY),a ret ; -- Cursor down chput_ctrl_down: chput_esc_b: ld a,(CSRY) ld hl,CRTCNT cp (hl) ret nc inc a ld (CSRY),a ret ; -- Handle ESC mode (ESCCNT in A and != 0) chput_escape: ld b,a ; b := (ESCCNT) inc a ; (ESCCNT) == -1 ? jr nz,chput_escape_1 ld (ESCCNT),a pop af ; restore character in A ld b,15 ; search in table ld hl,chput_esc_table jp search_table chput_escape_1: ; ---------------------------- pop af djnz chput_escape_2 ; -- ESCCNT == 1: 'ESC x ' ld c,0 ; CSTYLE/CSRSW := 0 jr chput_esc_xy chput_escape_2: ; ---------------------------- djnz chput_escape_3 ; -- ESCCNT == 2: 'ESC y ' ld c,1 ; CSTYLE/CSRSW := 1 chput_esc_xy: cp '4' jr z,chput_esc_xy_4 cp '5' jr z,chput_esc_xy_5 jr chput_escape_reset chput_esc_xy_4: ld a,c ld (CSTYLE),a jr chput_escape_reset chput_esc_xy_5: ld a,c ld (CSRSW),a jr chput_escape_reset chput_escape_3: ; ---------------------------- djnz chput_escape_4 ; -- ESCCNT == 3: 'ESC Y ' ld b,$1F sub b ld (CSRX),a jr chput_escape_reset chput_escape_4: ; ---------------------------- djnz chput_escape_reset ; -- ESCCNT == 4: 'ESC Y ' ld b,$1F sub b ld (CSRY),a ld a,3 jr chput_escape_set ; -- ESCCNT := 1 chput_esc_x: ld a,1 jr chput_escape_set ; -- ESCCNT := 2 chput_esc_y: ld a,2 jr chput_escape_set ; -- ESCCNT := 4 chput_esc_yy: ld a,4 jr chput_escape_set chput_escape_reset: xor a chput_escape_set: ld (ESCCNT),a ret ; -- Cursor right, no wrap chput_esc_c: ld a,(CSRX) ld hl,LINLEN cp (hl) ret nc inc a ld (CSRX),a ret ; -- Cursor left, no wrap chput_esc_d: ld a,(CSRX) dec a ret z ld (CSRX),a ret ; -- clear line chput_esc_l: call chput_ctrl_cr ; -- Clear till end of line chput_esc_k: ld hl,LINTTB-1 ; update LINTTB ld a,(CSRY) ld e,a ld d,0 add hl,de ; a != 0, which is OK ld (hl),a ld a,(LINLEN) inc a ; because CSRX is 1-based ld hl,CSRX sub (hl) ld c,a ld b,0 ld a,32 call curs2hl jp filvrm ; -- Insert line chput_esc_ll: call chput_ctrl_cr ; move to start of line ld hl,(CSRY) ; save current cursor pos push hl ld b,l ld a,(CRTCNT) ld (CSRY),a sub b ld b,a inc b ld a,(CSRY) jr chput_esc_ll_loop_end chput_esc_ll_loop: call curs2hl ex de,hl dec a ld (CSRY),a call curs2hl call chput_copy_line chput_esc_ll_loop_end: djnz chput_esc_ll_loop pop hl ; restore cursor position ld (CSRY),hl ld h,0 ld a,(CRTCNT) ; update LINTTB ld d,a ; DE := (CRTCNT) ld e,0 sub l ; BC := (CRTCNT) - (CSRY) - 1 dec a ld c,a ld b,0 ld hl,LINTTB-1 ; DE := LINTTB + (CRTCNT) add hl,de ex de,hl ld h,d ; HL := DE - 1 ld l,e dec hl lddr jp chput_esc_k ; -- Delete line (and scroll rest up) chput_esc_m: call chput_ctrl_cr ; move to start of line ld hl,(CSRY) push hl ; save cursor pos ld b,l ld a,(CRTCNT) sub b ld b,a inc b ld a,(CSRY) jr chput_esc_m_loop_end chput_esc_m_loop: call curs2hl ; Copy 1 line: ex de,hl ; de = dest in VRAM inc a ; next line ld (CSRY),a call curs2hl ; hl = src in VRAM call chput_copy_line chput_esc_m_loop_end: djnz chput_esc_m_loop ; endloop call chput_esc_k ; clear till end of line pop hl ; restore cursor position ld (CSRY),hl ld h,0 ; update LINTTB ld a,(CRTCNT) ; BC := (CRTCNT) - (CRSY) - 1 sub l dec a ld c,a ld b,0 ld de,LINTTB-1 ; DE := LINTTB + (CSRY) add hl,de ld d,h ld e,l inc hl ; HL := DE + 1 ldir ret ; -- Copy line: from HL to DE chput_copy_line: push af push bc ld b,0 ld a,(LINLEN) ld c,a IF MODEL_MSX != MODEL_MSX1 cp 41 jr c,chput_copy_line_2 ld c,40 call chput_copy_line_copy ld a,(LINLEN) sub 40 ld c,a chput_copy_line_2: ENDIF call chput_copy_line_copy pop bc pop af ret chput_copy_line_copy: push hl push de push bc ld de,LINWRK call ldirmv pop bc pop de push de push bc ld hl,LINWRK call ldirvm pop bc pop hl add hl,bc ex de,hl pop hl add hl,bc ret ; -- Erase chput_erase: ld a,(CSRX) cp 1 ret z ld a,32 call chput_putchar jp chput_ctrl_left ; -- disable cursor chput_remove_cursor: ld a,(CSRSW) ; Cursor visible? cp 1 ret nz ld a,(SCRMOD) ; Are we in text mode? cp 2 ret nc ld a,(CURSAV) ; get saved character call curs2hl ; and drop it at the jp wrtvrm ; -- enable cursor chput_restore_cursor: ld a,(CSRSW) ; Cursor visible? cp 1 ret nz ld a,(SCRMOD) cp 2 ret nc call curs2hl ; get character at cursor call rdvrm ; and store at CURSAV ld (CURSAV),a and a ; reset carry ld d,0 ; de := 8 * a ld e,a rl e rl d rl e rl d rl e rl d xor a ; get pattern table address ld hl,SCRMOD cp (hl) jr nz,chput_restore_cursor_t32 ld hl,(TXTCGP) jr chput_restore_cursor_getpattern chput_restore_cursor_t32: ld hl,(T32CGP) chput_restore_cursor_getpattern: push hl add hl,de ; add offset of character ld de,LINWRK ; copy pattern to LINWRK ld bc,8 call ldirmv ld a,(CSTYLE) ; depending on CSTYLE cp 0 jr nz,chput_restore_cursor_ins ld hl,LINWRK ; invert the complete pattern ld b,8 jr chput_restore_cursor_invert chput_restore_cursor_ins: ld hl,LINWRK+6 ; or only the lower 2 lines ld b,2 chput_restore_cursor_invert: ld a,(hl) ; invert! cpl ld (hl),a inc hl djnz chput_restore_cursor_invert pop hl ; copy inverted pattern to ld de,255*8 ; pattern 255 add hl,de ex de,hl ld hl,LINWRK ld bc,8 call ldirvm call curs2hl ; place char 255 at cursor pos ld a,255 jp wrtvrm ; -- Control character search table chput_ctrl_table: db 7 dw beep ; chput_ctrl_beep db 8 dw chput_ctrl_bs db 9 dw chput_ctrl_tab db 10 dw chput_ctrl_lf db 11 dw chput_ctrl_home db 12 dw chput_ctrl_ff db 13 dw chput_ctrl_cr db 27 dw chput_ctrl_esc db 28 dw chput_ctrl_right db 29 dw chput_ctrl_left db 30 dw chput_ctrl_up db 31 dw chput_ctrl_down ; -- Escape character search table chput_esc_table: db 'j' dw chput_esc_j db 'E' dw chput_esc_e db 'K' dw chput_esc_k db 'J' dw chput_esc_jj db 'l' dw chput_esc_l db 'L' dw chput_esc_ll db 'M' dw chput_esc_m db 'Y' dw chput_esc_yy db 'A' dw chput_esc_a db 'B' dw chput_esc_b db 'C' dw chput_esc_c db 'D' dw chput_esc_d db 'H' dw chput_esc_h db 'x' dw chput_esc_x db 'y' dw chput_esc_y ; vim:ts=8:expandtab:filetype=z8a:syntax=z8a: cbios-0.28/src/scancodes_de.asm0000644000000000000000000000715413137376076015167 0ustar rootroot; Scan code tables DIN (German) keyboard for C-BIOS ; ; Copyright (c) 2008 Eric Boon. All rights reserved. ; ; Redistribution and use in source and binary forms, with or without ; modification, are permitted provided that the following conditions ; are met: ; 1. Redistributions of source code must retain the above copyright ; notice, this list of conditions and the following disclaimer. ; 2. Redistributions in binary form must reproduce the above copyright ; notice, this list of conditions and the following disclaimer in the ; documentation and/or other materials provided with the distribution. ; ; THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ; OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ; IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ; NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ; ; ------------------------------------- ; scan code tables scode_tbl: db "01234567" ;00 db "89",$E1,$00,"<",$81,"+",$94 ;01 db $84,"#,.-",$00,"ab" ;02 db "cdefghij" ;03 db "klmnopqr" ;04 db "stuvwxzy" ;05 scode_tbl_shift: db "=!",$22,$BF,"$%&/" ;00 db "()?",$00,">",$9A,"*",$99 ;01 db $8E,"^;:_",$00,"AB" ;02 db "CDEFGHIJ" ;03 db "KLMNOPQR" ;04 db "STUVWXZY" ;05 scode_tbl_graph: db $09,$AC,$AB,$BA,$EF,$BD,$F4,$1D ;00 db $EC,$07,$0D,$60,$AE,$01,$F1,$06 ;01 db $05,$7E,$FB,$16,$17,$00,$C4,$11 ;02 db $BC,$C7,$CD,$14,$15,$13,$DC,$C6 ;03 db $DD,$C8,$0B,$1B,$C2,$DB,$CC,$18 ;04 db $D2,$12,$C0,$1A,$CF,$1C,$19,$0F ;05 scode_tbl_shift_graph: db $0A,$00,$FD,$FC,$00,$F6,$F5,$1E ;00 db $00,$08,$0E,$27,$AF,$02,$1F,$04 ;01 db $03,$BB,$F7,$00,$F0,$00,$FE,$00 ;02 db $FA,$C1,$CE,$D4,$10,$D6,$DF,$CA ;03 db $DE,$C9,$0C,$D3,$C3,$D7,$CB,$A9 ;04 db $D1,$D9,$C5,$D5,$D0,$F9,$AA,$F8 ;05 scode_tbl_code: db $EB,$7C,$40,$EE,$87,$9B,$E7,$5C ;00 db $5B,$5D,$E9,$00,$F3,$ED,$DA,$B7 ;01 db $B9,$E5,$86,$A6,$A7,$00,$E0,$97 ;02 db $8D,$8B,$8C,$9F,$98,$B1,$A1,$91 ;03 db $B3,$B5,$E6,$A4,$A2,$A3,$83,$93 ;04 db $89,$96,$82,$95,$88,$8A,$A0,$85 ;05 scode_tbl_shift_code: db $D8,$AD,$9E,$BE,$80,$9C,$E2,$00 ;00 db $7B,$7D,$A8,$00,$F2,$E8,$EA,$B6 ;01 db $B8,$E4,$8F,$00,$00,$00,$00,$00 ;02 db $00,$00,$00,$00,$00,$B0,$00,$92 ;03 db $B2,$B4,$00,$A5,$00,$E3,$00,$00 ;04 db $00,$00,$90,$00,$00,$00,$00,$9D ;05 ; vim:ts=8:expandtab:filetype=z8a:syntax=z8a:cbios-0.28/src/main_msx2+_jp.asm0000644000000000000000000000403113137376076015205 0ustar rootroot; C-BIOS main ROM for a Japanese MSX2+ machine ; ; Copyright (c) 2005 Maarten ter Huurne. All rights reserved. ; Copyright (c) 2005 Joost Yervante Damad. All rights reserved. ; Copyright (C) 2005 BouKiCHi. All rights reserved. ; Copyright (C) 2008 Eric Boon. All rights reserved. ; ; Redistribution and use in source and binary forms, with or without ; modification, are permitted provided that the following conditions ; are met: ; 1. Redistributions of source code must retain the above copyright ; notice, this list of conditions and the following disclaimer. ; 2. Redistributions in binary form must reproduce the above copyright ; notice, this list of conditions and the following disclaimer in the ; documentation and/or other materials provided with the distribution. ; ; THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ; OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ; IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ; NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ; include "hardware.asm" VDP: equ V9958 MODEL_MSX: equ MODEL_MSX2P ; -- japanese config LOCALE_CHSET: equ LOCAL_CHSET_JP LOCALE_CHSET_VAR: equ LOCAL_CHSET_VAR_NONE LOCALE_DATE: equ LOCAL_DATE_YMD LOCALE_INT: equ LOCAL_INT_60HZ LOCALE_KBD: equ LOCAL_KBD_JP LOCALE_BASIC: equ LOCAL_BASIC_JP COLOR_FORE: equ 15 COLOR_BACK: equ 4 COLOR_BORDER: equ 7 CALL_SUB: equ YES include "main.asm" ; vim:ts=8:expandtab:filetype=z8a:syntax=z8a: cbios-0.28/src/font_jp.asm0000644000000000000000000004634113137376076014215 0ustar rootroot; JP version font designed by BouKiCHi. ; ; Copyright (c) 2002-2005 BouKiCHi. All rights reserved. ; ; Redistribution and use in source and binary forms, with or without ; modification, are permitted provided that the following conditions ; are met: ; 1. Redistributions of source code must retain the above copyright ; notice, this list of conditions and the following disclaimer. ; 2. Redistributions in binary form must reproduce the above copyright ; notice, this list of conditions and the following disclaimer in the ; documentation and/or other materials provided with the distribution. ; ; THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ; OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ; IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ; NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ; Japanese Localized font db $00,$00,$00,$00,$00,$00,$00,$00 ;1 db $00,$7C,$44,$7C,$44,$7C,$44,$8C ;2 db $00,$20,$A4,$A4,$20,$30,$48,$84 ;3 db $00,$12,$14,$F8,$38,$54,$92,$10 ;4 db $00,$10,$7C,$10,$38,$54,$92,$10 ;5 db $00,$38,$54,$BA,$10,$38,$54,$FE ;6 db $00,$10,$10,$7C,$10,$10,$10,$FE ;7 db $00,$7C,$44,$44,$7C,$44,$44,$7C ;8 db $00,$40,$7C,$90,$7C,$50,$FC,$10 ;9 db $00,$FC,$A4,$A4,$FC,$84,$84,$84 ;10 db $00,$04,$EE,$A4,$FE,$AC,$E4,$0C ;11 db $00,$28,$44,$82,$7C,$24,$44,$48 ;12 db $00,$24,$CE,$55,$EC,$62,$D2,$44 ;13 db $00,$7C,$20,$7C,$44,$7C,$44,$7C ;14 db $00,$1C,$70,$10,$FE,$10,$10,$10 ;15 db $00,$FC,$40,$40,$7C,$44,$84,$88 ;16 db $00,$00,$7C,$28,$28,$48,$48,$8C ;17 db $10,$10,$10,$10,$FF,$00,$00,$00 ;18 db $00,$00,$00,$00,$FF,$10,$10,$10 ;19 db $10,$10,$10,$10,$F0,$10,$10,$10 ;20 db $10,$10,$10,$10,$1F,$10,$10,$10 ;21 db $10,$10,$10,$10,$FF,$10,$10,$10 ;22 db $10,$10,$10,$10,$10,$10,$10,$10 ;23 db $00,$00,$00,$00,$FF,$00,$00,$00 ;24 db $00,$00,$00,$00,$1F,$10,$10,$10 ;25 db $00,$00,$00,$00,$F0,$10,$10,$10 ;26 db $10,$10,$10,$10,$1F,$00,$00,$00 ;27 db $10,$10,$10,$10,$F0,$00,$00,$00 ;28 db $81,$42,$24,$18,$18,$24,$42,$81 ;29 db $00,$10,$7C,$10,$10,$28,$48,$84 ;30 db $00,$10,$7C,$54,$7C,$10,$10,$10 ;31 db $00,$10,$10,$54,$54,$94,$10,$30 ;32 db $00,$00,$00,$00,$00,$00,$00,$00 ;33 db $00,$18,$18,$18,$18,$18,$00,$18 ;34 db $00,$6C,$6C,$24,$00,$00,$00,$00 ;35 db $00,$24,$7E,$24,$7E,$24,$24,$00 ;36 db $14,$3E,$54,$54,$3E,$15,$15,$3E ;37 db $00,$22,$54,$28,$12,$25,$42,$00 ;38 db $38,$44,$44,$28,$32,$4A,$7C,$00 ;39 db $00,$60,$60,$20,$00,$00,$00,$00 ;40 db $00,$08,$10,$10,$10,$10,$08,$00 ;41 db $00,$10,$08,$08,$08,$08,$10,$00 ;42 db $00,$10,$54,$38,$10,$38,$54,$00 ;43 db $00,$00,$10,$10,$7C,$10,$10,$00 ;44 db $00,$00,$00,$00,$60,$60,$20,$00 ;45 db $00,$00,$00,$7E,$00,$00,$00,$00 ;46 db $00,$00,$00,$00,$00,$60,$60,$00 ;47 db $00,$02,$04,$08,$10,$20,$40,$00 ;48 db $00,$38,$4C,$54,$54,$64,$38,$00 ;49 db $00,$10,$30,$10,$10,$10,$38,$00 ;50 db $00,$38,$44,$04,$38,$40,$7C,$00 ;51 db $00,$78,$04,$38,$04,$04,$78,$00 ;52 db $00,$44,$44,$44,$7C,$04,$04,$00 ;53 db $00,$7C,$40,$78,$04,$04,$78,$00 ;54 db $00,$38,$40,$78,$44,$44,$38,$00 ;55 db $00,$7C,$44,$08,$08,$10,$10,$00 ;56 db $00,$38,$44,$38,$44,$44,$38,$00 ;57 db $00,$38,$44,$44,$3C,$04,$38,$00 ;58 db $00,$18,$18,$00,$00,$18,$18,$00 ;59 db $00,$18,$18,$00,$00,$18,$18,$08 ;60 db $00,$08,$10,$20,$40,$20,$10,$08 ;61 db $00,$00,$7C,$00,$7C,$00,$00,$00 ;62 db $00,$20,$10,$08,$04,$08,$10,$20 ;63 db $00,$38,$44,$04,$18,$10,$00,$10 ;64 db $00,$3C,$5A,$6A,$5A,$46,$3C,$00 ;65 db $00,$10,$28,$28,$7C,$44,$44,$00 ;66 db $00,$78,$44,$78,$44,$44,$78,$00 ;67 db $00,$38,$44,$40,$40,$44,$38,$00 ;68 db $00,$78,$44,$44,$44,$44,$78,$00 ;69 db $00,$7C,$40,$7C,$40,$40,$7C,$00 ;70 db $00,$7C,$40,$40,$78,$40,$40,$00 ;71 db $00,$38,$44,$40,$4E,$44,$38,$00 ;72 db $00,$44,$44,$7C,$44,$44,$44,$00 ;73 db $00,$38,$10,$10,$10,$10,$38,$00 ;74 db $00,$1C,$08,$08,$08,$48,$30,$00 ;75 db $00,$44,$48,$50,$68,$44,$44,$00 ;76 db $00,$40,$40,$40,$40,$40,$7C,$00 ;77 db $00,$44,$6C,$54,$44,$44,$44,$00 ;78 db $00,$44,$64,$54,$54,$4C,$44,$00 ;79 db $00,$38,$44,$44,$44,$44,$38,$00 ;80 db $00,$78,$44,$44,$78,$40,$40,$00 ;81 db $00,$38,$44,$44,$54,$4C,$3C,$06 ;82 db $00,$78,$44,$44,$78,$44,$44,$00 ;83 db $00,$3C,$40,$38,$04,$44,$38,$00 ;84 db $00,$7C,$10,$10,$10,$10,$10,$00 ;85 db $00,$44,$44,$44,$44,$44,$38,$00 ;86 db $00,$44,$44,$28,$28,$10,$10,$00 ;87 db $00,$54,$54,$54,$54,$28,$28,$00 ;88 db $00,$44,$28,$10,$10,$28,$44,$00 ;89 db $00,$44,$44,$28,$10,$10,$10,$00 ;90 db $00,$7C,$04,$08,$10,$20,$7C,$00 ;91 db $00,$38,$20,$20,$20,$20,$38,$00 ;92 db $00,$44,$28,$7C,$10,$7C,$10,$00 ;93 db $00,$38,$08,$08,$08,$08,$38,$00 ;94 db $00,$10,$28,$44,$00,$00,$00,$00 ;95 db $00,$00,$00,$00,$00,$00,$7C,$00 ;96 db $00,$30,$30,$10,$00,$00,$00,$00 ;97 db $00,$00,$38,$04,$3C,$44,$3C,$00 ;98 db $00,$40,$40,$78,$44,$44,$78,$00 ;99 db $00,$00,$38,$44,$40,$44,$38,$00 ;100 db $00,$04,$04,$3C,$44,$44,$3C,$00 ;101 db $00,$00,$38,$44,$7C,$40,$3C,$00 ;102 db $00,$08,$10,$38,$10,$10,$10,$00 ;103 db $00,$00,$3C,$44,$3C,$44,$38,$00 ;104 db $00,$40,$40,$78,$44,$44,$44,$00 ;105 db $00,$10,$00,$30,$10,$10,$38,$00 ;106 db $00,$10,$00,$10,$10,$10,$60,$00 ;107 db $00,$20,$24,$28,$30,$28,$24,$00 ;108 db $00,$10,$10,$10,$10,$10,$10,$00 ;109 db $00,$00,$78,$54,$54,$54,$54,$00 ;110 db $00,$00,$78,$44,$44,$44,$44,$00 ;111 db $00,$00,$38,$44,$44,$44,$38,$00 ;112 db $00,$00,$78,$44,$78,$40,$40,$00 ;113 db $00,$04,$3C,$44,$3C,$04,$04,$00 ;114 db $00,$00,$5C,$60,$40,$40,$40,$00 ;115 db $00,$00,$3C,$40,$38,$04,$78,$00 ;116 db $00,$20,$78,$20,$20,$20,$18,$00 ;117 db $00,$00,$48,$48,$48,$48,$34,$00 ;118 db $00,$00,$44,$44,$44,$28,$10,$00 ;119 db $00,$00,$54,$54,$54,$54,$28,$00 ;120 db $00,$00,$44,$28,$10,$28,$44,$00 ;121 db $00,$00,$44,$28,$10,$10,$20,$00 ;122 db $00,$00,$7C,$08,$10,$20,$7C,$00 ;123 db $00,$08,$10,$10,$20,$10,$10,$08 ;124 db $00,$10,$10,$10,$10,$10,$10,$00 ;125 db $00,$10,$08,$08,$04,$08,$08,$10 ;126 db $00,$32,$4C,$00,$00,$00,$00,$00 ;127 db $00,$00,$00,$00,$00,$00,$00,$00 ;128 db $00,$18,$3C,$7E,$7E,$18,$3C,$00 ;129 db $00,$24,$7E,$7E,$7E,$3C,$18,$00 ;130 db $00,$18,$18,$7E,$7E,$18,$3C,$00 ;131 db $00,$18,$3C,$7E,$7E,$3C,$18,$00 ;132 db $00,$3C,$42,$42,$42,$42,$3C,$00 ;133 db $00,$3C,$7E,$7E,$7E,$7E,$3C,$00 ;134 db $00,$10,$7C,$20,$78,$54,$28,$3C ;135 db $00,$00,$10,$7C,$10,$7C,$5C,$74 ;136 db $00,$00,$00,$00,$48,$44,$44,$24 ;137 db $00,$00,$20,$10,$78,$08,$08,$10 ;138 db $00,$00,$20,$10,$78,$08,$30,$48 ;139 db $00,$00,$10,$7C,$14,$78,$54,$34 ;140 db $00,$00,$00,$50,$F8,$54,$48,$20 ;141 db $00,$00,$00,$50,$7C,$54,$18,$20 ;142 db $00,$00,$00,$10,$1C,$30,$58,$34 ;143 db $00,$00,$00,$00,$78,$04,$04,$38 ;144 db $00,$00,$00,$00,$00,$00,$00,$00 ;145 db $00,$20,$F8,$20,$7C,$AC,$B4,$74 ;146 db $00,$00,$88,$88,$84,$84,$A4,$40 ;147 db $00,$60,$00,$70,$88,$08,$10,$60 ;148 db $00,$60,$10,$F8,$20,$60,$50,$98 ;149 db $00,$24,$F4,$20,$78,$A4,$A4,$68 ;150 db $00,$48,$E4,$54,$50,$90,$10,$60 ;151 db $00,$40,$F8,$20,$F8,$10,$80,$70 ;152 db $00,$20,$20,$40,$80,$40,$20,$20 ;153 db $00,$88,$88,$BC,$88,$88,$88,$50 ;154 db $00,$00,$F8,$08,$00,$00,$80,$78 ;155 db $00,$20,$F8,$20,$20,$00,$80,$70 ;156 db $00,$80,$80,$80,$80,$80,$88,$70 ;157 db $00,$10,$FC,$30,$50,$30,$10,$60 ;158 db $00,$48,$FC,$48,$48,$48,$40,$38 ;159 db $00,$44,$28,$FC,$30,$40,$40,$38 ;160 db $00,$00,$00,$00,$00,$00,$00,$00 ;161 db $00,$00,$00,$00,$08,$14,$08,$00 ;162 db $00,$60,$40,$40,$00,$00,$00,$00 ;163 db $00,$00,$00,$00,$04,$04,$0C,$00 ;164 db $00,$00,$00,$00,$10,$08,$08,$00 ;165 db $00,$00,$00,$30,$30,$00,$00,$00 ;166 db $00,$00,$00,$7C,$04,$7C,$04,$38 ;167 db $00,$00,$00,$7C,$04,$14,$10,$20 ;168 db $00,$00,$00,$08,$18,$70,$10,$10 ;169 db $00,$00,$00,$10,$7C,$44,$04,$18 ;170 db $00,$00,$00,$00,$38,$10,$10,$7C ;171 db $00,$00,$00,$08,$7C,$18,$28,$48 ;172 db $00,$00,$00,$20,$7C,$24,$24,$20 ;173 db $00,$00,$00,$00,$38,$08,$08,$7C ;174 db $00,$00,$00,$7C,$04,$7C,$04,$7C ;175 db $00,$00,$00,$54,$54,$04,$04,$18 ;176 db $00,$00,$00,$40,$3C,$00,$00,$00 ;177 db $00,$7C,$04,$14,$14,$14,$20,$40 ;178 db $00,$04,$08,$18,$30,$50,$10,$10 ;179 db $00,$10,$7C,$44,$44,$04,$08,$10 ;180 db $00,$00,$7C,$10,$10,$10,$10,$7C ;181 db $00,$08,$7C,$08,$18,$28,$48,$18 ;182 db $00,$10,$7C,$14,$24,$24,$44,$08 ;183 db $00,$10,$7C,$10,$7C,$10,$10,$10 ;184 db $00,$20,$3C,$24,$44,$08,$08,$30 ;185 db $00,$20,$3C,$28,$48,$08,$10,$20 ;186 db $00,$00,$7C,$04,$04,$04,$04,$7C ;187 db $00,$28,$7C,$28,$28,$08,$08,$30 ;188 db $00,$64,$04,$64,$04,$04,$08,$70 ;189 db $00,$7C,$04,$04,$08,$10,$28,$44 ;190 db $00,$20,$7C,$24,$20,$20,$20,$1C ;191 db $00,$44,$44,$44,$04,$04,$08,$30 ;192 db $00,$1C,$24,$24,$7C,$04,$08,$10 ;193 db $00,$04,$78,$10,$7C,$10,$10,$20 ;194 db $00,$54,$54,$54,$04,$04,$08,$30 ;195 db $00,$38,$00,$7C,$10,$10,$10,$20 ;196 db $00,$20,$20,$20,$38,$24,$20,$20 ;197 db $00,$10,$7C,$10,$10,$10,$10,$20 ;198 db $00,$00,$38,$00,$00,$00,$00,$7C ;199 db $00,$7C,$04,$48,$30,$10,$28,$44 ;200 db $00,$10,$7C,$08,$38,$54,$54,$10 ;201 db $00,$08,$08,$08,$08,$10,$10,$60 ;202 db $00,$08,$08,$48,$44,$44,$44,$44 ;203 db $00,$40,$78,$40,$40,$40,$40,$3C ;204 db $00,$00,$7C,$04,$04,$08,$08,$30 ;205 db $00,$00,$20,$50,$48,$04,$04,$00 ;206 db $00,$10,$7C,$10,$10,$54,$54,$10 ;207 db $00,$00,$7C,$04,$48,$30,$10,$08 ;208 db $00,$60,$1C,$60,$1C,$00,$60,$1C ;209 db $00,$10,$20,$28,$48,$44,$7C,$04 ;210 db $00,$04,$04,$28,$10,$18,$24,$40 ;211 db $00,$7C,$20,$20,$7C,$20,$20,$1C ;212 db $00,$20,$FC,$24,$24,$10,$10,$10 ;213 db $00,$78,$08,$08,$08,$08,$08,$7C ;214 db $00,$7C,$04,$04,$7C,$04,$04,$7C ;215 db $00,$38,$00,$7C,$04,$04,$04,$38 ;216 db $00,$48,$48,$48,$48,$08,$08,$30 ;217 db $00,$48,$48,$48,$48,$48,$48,$8C ;218 db $00,$40,$40,$40,$40,$44,$48,$70 ;219 db $00,$7C,$44,$44,$44,$44,$44,$7C ;220 db $00,$7C,$44,$44,$04,$04,$04,$38 ;221 db $00,$64,$04,$04,$04,$08,$08,$70 ;222 db $00,$00,$50,$28,$00,$00,$00,$00 ;223 db $00,$20,$50,$20,$00,$00,$00,$00 ;224 db $00,$20,$78,$20,$5C,$40,$40,$9C ;225 db $00,$20,$7C,$20,$78,$84,$04,$18 ;226 db $00,$00,$38,$C4,$04,$04,$04,$78 ;227 db $00,$00,$3C,$C8,$10,$20,$20,$18 ;228 db $00,$84,$48,$30,$20,$40,$40,$3C ;229 db $00,$88,$64,$60,$90,$38,$50,$30 ;230 db $00,$40,$5C,$80,$80,$80,$80,$5C ;231 db $00,$80,$44,$78,$D8,$A8,$BC,$58 ;232 db $00,$48,$D8,$68,$48,$D8,$EC,$58 ;233 db $00,$00,$38,$54,$94,$A4,$A4,$68 ;234 db $00,$08,$BC,$88,$88,$B8,$AC,$B4 ;235 db $00,$00,$6C,$A8,$48,$48,$48,$30 ;236 db $00,$00,$70,$00,$20,$10,$94,$A4 ;237 db $00,$00,$00,$30,$48,$88,$84,$04 ;238 db $00,$00,$9C,$88,$BC,$98,$AC,$58 ;239 db $00,$20,$FC,$20,$FC,$70,$A8,$64 ;240 db $00,$00,$E0,$28,$78,$AC,$A8,$50 ;241 db $00,$28,$F4,$20,$60,$A4,$64,$38 ;242 db $00,$84,$74,$48,$B4,$94,$AC,$48 ;243 db $00,$20,$F8,$40,$FC,$40,$40,$38 ;244 db $00,$90,$5C,$74,$D4,$48,$40,$20 ;245 db $00,$90,$B8,$D4,$94,$1C,$10,$20 ;246 db $00,$20,$38,$20,$70,$A8,$A8,$60 ;247 db $00,$40,$20,$80,$B8,$C8,$08,$30 ;248 db $00,$90,$88,$88,$88,$08,$10,$20 ;249 db $00,$78,$10,$30,$C8,$38,$48,$30 ;250 db $00,$40,$E8,$58,$68,$48,$C8,$4C ;251 db $00,$78,$08,$30,$48,$84,$04,$38 ;252 db $00,$40,$E0,$58,$64,$44,$C4,$58 ;253 db $00,$10,$10,$20,$30,$50,$68,$CC ;254 db $00,$00,$00,$00,$00,$00,$00,$00 ;255 db $00,$00,$00,$00,$00,$00,$00,$00 ;256 cbios-0.28/src/locale.asm0000644000000000000000000000062613137376076014011 0ustar rootroot IF LOCALE_CHSET = LOCAL_CHSET_JP db "JP" ENDIF IF LOCALE_CHSET = LOCAL_CHSET_US IF LOCALE_CHSET_VAR = LOCAL_CHSET_VAR_NONE db "EU/INT" ELSE IF LOCALE_CHSET_VAR = LOCAL_CHSET_VAR_BR db "BR" ENDIF ENDIF ENDIF cbios-0.28/src/main_msx2+.asm0000644000000000000000000000407413137376076014523 0ustar rootroot; C-BIOS main ROM for a European MSX2+ machine ; ; Copyright (c) 2005 Maarten ter Huurne. All rights reserved. ; Copyright (c) 2005 Joost Yervante Damad. All rights reserved. ; Copyright (C) 2005 BouKiCHi. All rights reserved. ; Copyright (C) 2008 Eric Boon. All rights reserved. ; ; Redistribution and use in source and binary forms, with or without ; modification, are permitted provided that the following conditions ; are met: ; 1. Redistributions of source code must retain the above copyright ; notice, this list of conditions and the following disclaimer. ; 2. Redistributions in binary form must reproduce the above copyright ; notice, this list of conditions and the following disclaimer in the ; documentation and/or other materials provided with the distribution. ; ; THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ; OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ; IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ; NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ; include "hardware.asm" VDP: equ V9958 MODEL_MSX: equ MODEL_MSX2P ; -- generic european config (50Hz, US keyboard layout) LOCALE_CHSET: equ LOCAL_CHSET_US LOCALE_CHSET_VAR: equ LOCAL_CHSET_VAR_NONE LOCALE_DATE: equ LOCAL_DATE_DMY LOCALE_INT: equ LOCAL_INT_50HZ LOCALE_KBD: equ LOCAL_KBD_US LOCALE_BASIC: equ LOCAL_BASIC_US COLOR_FORE: equ 15 COLOR_BACK: equ 4 COLOR_BORDER: equ 4 CALL_SUB: equ YES include "main.asm" ; vim:ts=8:expandtab:filetype=z8a:syntax=z8a: cbios-0.28/src/disk.asm0000644000000000000000000006757313137376076013522 0ustar rootroot; C-BIOS Disk ROM - based on WD2793 FDC ; ; Copyright (c) 2004 Albert Beevendorp. All rights reserved. ; Copyright (c) 2005 Maarten ter Huurne. All rights reserved. ; ; Redistribution and use in source and binary forms, with or without ; modification, are permitted provided that the following conditions ; are met: ; 1. Redistributions of source code must retain the above copyright ; notice, this list of conditions and the following disclaimer. ; 2. Redistributions in binary form must reproduce the above copyright ; notice, this list of conditions and the following disclaimer in the ; documentation and/or other materials provided with the distribution. ; ; THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ; OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ; IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ; NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ; include "hooks.asm" include "systemvars.asm" include "hardware.asm" calslt: equ $001C enaslt: equ $0024 chput: equ $00A2 ; Disk Transfer Area. DTA_ADDR: equ $F23D ; For each page, the slot in which RAM is located. RAM_PAGE0: equ $F341 RAM_PAGE1: equ $F342 RAM_PAGE2: equ $F343 RAM_PAGE3: equ $F344 ; BDOS entry point. BDOS_ENTRY: equ $F37D ; Actual place where the BDOS inter slot call is made. ; The entry point is just 3 bytes, inter slot call requires 5. H_BDOS: equ $F331 ; Number of drives on interface. NUM_DRIVES: equ 1 org $4000 db "AB" dw init ; init dw 0 ; statement dw 0 ; device dw 0 ; basic text dw 0,0,0 ; $4010 DSKIO ds $4010 - $,$FF jp dskio ; $4013 DSKCHG ds $4013 - $ jp dskchg ; $4016 GETDPB ds $4016 - $ jp getdpb ; $4019 CHOICE ds $4019 - $ jp choice ; $401C DSKFMT ds $401C - $ jp dskfmt ; $401F LOC_DS - stop motor of drives connected to this interface ds $401F - $ jp loc_ds ; $4022 BASIC ds $4022 - $ jp basic scf ; $4026 FORMAT ds $4026 - $ jp format ; $4029 DSKSTP - stop motor of drives on all interfaces ds $4029 - $ jp dskstp ; $402D DSKSLT ds $402D - $,$00 jp dskslt ;-------------------------------- init: ld hl,init_text call print_debug ; Init variables: ; Init RAM_PAGEx. ; Note: Should this happen in disk ROM or main ROM? ; We assume that the same slot that is chosen by the main ROM ; to hold the system vars provides RAM in all pages. ; This is not true for all MSX models, but it is for most. ; TODO: Search for RAM for each page separately. in a,(PSL_STAT) and $C0 rlca rlca ld c,a ; C = 000000PP ld a,(SSL_REGS) cpl and $C0 rrca rrca rrca rrca ; A = 0000SS00 or c ; A = 0000SSPP ld b,0 ld hl,EXPTBL add hl,bc or (hl) ; A = E000SSPP ld hl,RAM_PAGE0 ld (hl),a inc hl ld (hl),a inc hl ld (hl),a inc hl ld (hl),a ; Init DRVINF. ; TODO: Cooperate with other disk ROMs. ld hl,DRVINF ld (hl),NUM_DRIVES inc hl push hl call dskslt pop hl ld (hl),a ; Init DTA. call resetdta ; Setup hooks: call dskslt ; BDOS ld de,bdos ld hl,H_BDOS call init_sethook ; PHYDIO ld de,phydio ld hl,H_PHYD call init_sethook ; FORMAT ld de,format ld hl,H_FORM call init_sethook ; boot loader ld de,boot ld hl,H_RUNC call init_sethook ; Setup BDOS entry point. ld a,$C3 ; jp ld hl,H_BDOS ld (BDOS_ENTRY),a ld (BDOS_ENTRY + 1),hl ; Init megarom mapper. ld a,1 ld ($6000),a ret init_sethook: ld (hl),$F7 ; rst $30 inc hl ld (hl),a ; slot ID inc hl ld (hl),e ; addr low inc hl ld (hl),d ; addr high inc hl ld (hl),$C9 ; ret ret init_text: db "C-DISK is initializing",0 ;-------------------------------- boot: ld hl,boot_text call print_debug ld hl,$C000 ; address to load to ld de,$0000 ; boot sector ld bc,$01F9 ; 1 sector, 720K disk xor a ; drive 0, read (NC) call dskio ret c ; error -> abort boot ; TODO: Perform sanity checks on boot sector contents? ; TODO: Put RAM in page 0 and set up minimal call environment. ; TODO: Since the bootsector routine checks CF, I assume it is ; called two times: first time with CF reset, second ; time with CF set. But I don't know the difference ; between the two. ;and a ;call $C01E ld hl,0 ; a pointer will be written here ld de,0 ; ??? ld a,0 ; ??? scf call $C01E ret boot_text: db "C-DISK booting",0 ;-------------------------------- ; DSKIO ; Input: F = NC to read, C to write ; A = Drive number (0=A:) ; B = Number of sectors to transfer ; C = Media descriptor ; DE = Logical sector number ; HL = Transfer address ; ; Output: F = NC if successful, C if error ; A = Error code if error ; 0 = Write protected ; 2 = Not ready ; 4 = Data (CRC) error ; 6 = Seek error ; 8 = Record not found ; 10 = Write fault ; 12 = Other errors ; B = Always the number of sectors transferred ; NOTE: This routine is still stubbed dskio: call dskio_debug ; Check whether the drive exists. push af cp NUM_DRIVES jr c,dskio_drive_ok pop af ld a,12 scf ret dskio_drive_ok: pop af ; Read or write? jp c,dskio_write dskio_read_loop: push de push bc call load_sector pop bc pop de inc de ; next sector djnz dskio_read_loop and a ; CF = 0 call dskio_done ret ; Load 1 sector. ; Input: HL = address to load to ; DE = sector number ; Output: HL = updated address to load to ; Changes: AF, DE, BC ; TODO: Loading will fail if a sector is loaded across a page boundary. ; Probably the only decent way to fix this is loading to a RAM buffer ; and LDIR-ing in two steps. load_sector: ld a,h cp $40 jr c,load_sector_skip cp $80 jr c,load_sector_page1 load_sector_skip: ex de,hl ; DE = address to load to add hl,hl ; HL = sectornr * 2 ld b,l add hl,hl add hl,hl add hl,hl ld a,h add a,2 ld ($6000),a ; page nr ld a,b and $1F ld b,a ld c,0 ; BC = offset in page ld hl,$6000 add hl,bc ld bc,$0200 ; 512 bytes per sector ldir ex de,hl ; HL = updated address to load to ld a,1 ld ($6000),a ret ; Load 1 sector to an address in page 1. load_sector_page1: ; TODO: Determine slot currently active in page 2. ld a,(RAM_PAGE2) ; RAM slot push af ; Select disk ROM in page 2. push hl push de call dskslt push af ld h,$80 call enaslt ; MegaROM bank 0 and 1. xor a ld ($8000),a inc a ld ($A000),a pop af pop de pop hl ; Call routine which runs in page 2. call load_sector_page1_high + $4000 ; Restore slot in page 2. pop af push hl ld h,$80 call enaslt pop hl ret load_sector_page1_high: push af ; A = disk ROM slot push hl push de ; Select RAM in page 1. ; Note that this will only allow loading into the primary ; mapper; does the MSX disk ROM have the same limitation? ; If not, how does it know which slot to load to? ld a,(RAM_PAGE1) ld h,$40 call enaslt pop hl ; HL = sector number pop de ; DE = address to load to add hl,hl ; HL = sectornr * 2 ld b,l add hl,hl add hl,hl add hl,hl ld a,h add a,2 ld ($A000),a ; page nr ld a,b and $1F ld b,a ld c,0 ; BC = offset in page ld hl,$A000 add hl,bc ld bc,$0200 ; 512 bytes per sector ldir ex de,hl ; HL = updated address to load to ld a,1 ld ($A000),a ; Restore disk ROM in page 1. pop af push hl ld h,$40 call enaslt pop hl ret dskio_write: ; write protect error xor a scf call dskio_done ret dskio_debug: push hl push af ld a,$23 ; ASCII mode out (DBG_CTRL),a ld hl,dskio_text_1 call print_debug_asciiz pop af push af ld hl,dskio_text_wr jr c,dskio_debug_write ld hl,dskio_text_rd dskio_debug_write: call print_debug_asciiz ld hl,dskio_text_2 call print_debug_asciiz ld l,e ld h,d call print_debug_hexword ld hl,dskio_text_3 call print_debug_asciiz ld a,b call print_debug_hexbyte ld hl,dskio_text_4 call print_debug_asciiz pop af pop hl push hl push af call print_debug_hexword ld hl,dskio_text_5 call print_debug_asciiz ld a,c call print_debug_hexbyte ld a,$00 ; flush out (DBG_CTRL),a pop af pop hl ret dskio_text_1: db "disk: ",0 dskio_text_rd: db "READ",0 dskio_text_wr: db "WRITE",0 dskio_text_2: db " sectors: first $",0 dskio_text_3: db ", num $",0 dskio_text_4: db ", to $",0 dskio_text_5: db ", media $",0 ;-------------------------------- ; DSKCHG ; Input: A = Drive number (0=A:) ; B = Media Descriptor ; C = Media Descriptor ; HL = Base address of DPB ; ; Output: F = NC if successful, C if error ; A = Error code if error ; 0 = Write protected ; 2 = Not ready ; 4 = Data (CRC) error ; 6 = Seek error ; 8 = Record not found ; 10 = Write fault ; 12 = Other errors ; B = Disk Change state if successful ; -1 = Disk changed ; 0 = Unknown ; 1 = Disk unchanged ; Note: If the disk has been changed or may have been changed (unknown) ; read the bootsector or the first FAT sectoe for a disk media ; descriptor and transfer a new DPB as with GETDPB. ; NOTE: This routine is still stubbed dskchg: push hl push af ld hl,dskchg_text call print_debug pop af pop hl ld b,0 ; unknown whether changed or not ret dskchg_text: db "disk: DSKCHG ($4013) called",0 ;-------------------------------- ; GETDPB ; Input: A = Drive number (0=A:) ; B = First byte of FAT (media descriptor) ; C = Media descriptor ; HL = Base address of DPB ; ; Output: HL = DPB filled in ; Note: DPB consists of: ; Name Offset Size Description ; -------------------------------------------------- ; MEDIA $00 1 Media type ($F8 - $FF) ; SECSIZE $01 2 Sector size (must be 2^n) ; DIRMSK $03 1 (SECSIZ / 32 - 1) ; DIRSHFT $04 1 Number of one bits in DIRMSK ; CLUSMSK $05 1 (Sectors per cluster - 1) ; CLUSSHFT $06 1 (Number of one bits in CLUSMSK) - 1 ; FIRFAT $07 2 Logical sector number of first FAT ; FATCNT $09 1 Number of FATs ; MAXENT $0A 1 Number of root directory entries ; FIRREC $0B 2 Logical sector number of first data ; MAXCLUS $0D 2 (Number of clusters) + 1 ; This excludes the number of reserved, ; FAT and root directory sectors. ; FATSIZ $0F 1 Number of sectors used for FAT ; FIRDIR $10 2 Logical sector number of first directory ; NOTE: This routine is still stubbed getdpb: push hl push af ld hl,getdpb_text call print_debug pop af pop hl ret getdpb_text: db "disk: GETDPB ($4016) called",0 ;-------------------------------- ; CHOICE ; Output: HL = Address of ASCIIz string containing the text with choices ; for DSKFMT. If there are no choices (only one format sup- ; ported) HL=0 choice: ld hl,choice_text ret choice_text: db 13,10,"1 - Single sided, 80 tracks" db 13,10,"2 - Double sided, 80 tracks" db 13,10,0 ;-------------------------------- ; DSKFMT ; Input: A = Choice specified by user: 1-9. See CHOICE ; D = Drive number (0=A:) ; BC = Length of work area ; HL = Base address of work area ; ; Output: F = NC if successful, C if error ; A = Error code if error ; 0 = Write protected ; 2 = Not ready ; 4 = Data (CRC) error ; 6 = Seek error ; 8 = Record not found ; 10 = Write fault ; 12 = Bad parameter ; 14 = Insufficient memory ; 16 = Other errors ; Note: Also write MSX bootsector at sector 0, clears all FATs (media ; descriptor ar first byte, $FF at the second/third byte and ; rest filled with $00) and clears the root directory (full $00). ; NOTE: This routine is still stubbed dskfmt: push hl push af ld hl,dskfmt_text call print_debug pop af pop hl scf ; error, because we didn't format ret dskfmt_text: db "disk: DSKFMT ($401C) called",0 ;-------------------------------- ; LOC_DS ; Note: Stop motor for all drives on THIS interface. loc_ds: push hl push af ld hl,loc_ds_text call print_debug pop af pop hl ret loc_ds_text: db "disk: LOC_DS ($401F) called",0 ;-------------------------------- ; BASIC ; Note: Warmboots to BASIC. ; NOTE: This routine is still stubbed basic: push hl push af ld hl,basic_text call print_debug pop af pop hl ret basic_text: db "disk: BASIC ($4022) called",0 ;-------------------------------- ; FORMAT ; Note: Like CALL FORMAT, FORMAT (DOS) and BIOS routine $0147. ; Display CHOICE, wait for input and do DSKFMT. ; NOTE: This routine is still stubbed format: push hl push af ld hl,format_text call print_debug pop af pop hl ret format_text: db "disk: FORMAT ($4026) called",0 ;-------------------------------- ; DSKSTP ; Note: Stop motor for all drives on all interfaces. Interslot-calls ; LOC_DS for all detected interfaces. ; NOTE: This routine is still stubbed dskstp: push hl push af ld hl,dskstp_text call print_debug pop af pop hl ret dskstp_text: db "disk: DSKSTP ($4029) called",0 ;-------------------------------- ; $402D DSKSLT ; Calculate slot ID for disk ROM slot. ; Output: A = slot ID ; Changes: F, HL, BC ; TODO: Old description said this: ; Output: Address $F348 keeps the slot where the DISK-ROM is found. dskslt: ; TODO: Calculate this dynamically. ld a,$8F ; slot 3.3 ret ;-------------------------------- ; PHYDIO phydio: ; TODO: Support multiple disk ROMs. jp dskio ;-------------------------------- ; BDOS bdos: ; Note: none of the BDOS functions uses A as an input. ld a,c cp $31 jr nc,bdos_illfunc push hl ld hl,bdos_table add a,a add a,l ld l,a ld a,0 adc a,h ld h,a ld a,(hl) inc hl ld h,(hl) ld l,a ex (sp),hl ret ; jump to address from table bdos_illfunc: ; Invalid function number. ; Note: I couldn't find a specification anywhere of the proper ; behaviour in this case, so I'll return a typical error ; value. ld a,$FF ld l,a ret bdos_table: dw bdos_print ; $00 dw bdos_print ; $01 dw bdos_conout ; $02 dw bdos_print ; $03 dw bdos_print ; $04 dw bdos_print ; $05 dw bdos_print ; $06 dw bdos_print ; $07 dw bdos_print ; $08 dw bdos_strout ; $09 dw bdos_print ; $0A dw bdos_print ; $0B dw bdos_print ; $0C dw bdos_dskrst ; $0D dw bdos_print ; $0E dw bdos_print ; $0F dw bdos_print ; $10 dw bdos_print ; $11 dw bdos_print ; $12 dw bdos_print ; $13 dw bdos_print ; $14 dw bdos_print ; $15 dw bdos_print ; $16 dw bdos_print ; $17 dw bdos_print ; $18 dw bdos_curdrv ; $19 dw bdos_setdta ; $1A dw bdos_print ; $1B dw bdos_print ; $1C dw bdos_print ; $1D dw bdos_print ; $1E dw bdos_print ; $1F dw bdos_print ; $20 dw bdos_print ; $21 dw bdos_print ; $22 dw bdos_print ; $23 dw bdos_print ; $24 dw bdos_print ; $25 dw bdos_print ; $26 dw bdos_print ; $27 dw bdos_print ; $28 dw bdos_print ; $29 dw bdos_print ; $2A dw bdos_print ; $2B dw bdos_print ; $2C dw bdos_print ; $2D dw bdos_verify ; $2E dw bdos_rdabs ; $2F dw bdos_print ; $30 bdos_print: ld a,$23 ; ASCII mode out (DBG_CTRL),a ld hl,bdos_text call print_debug_asciiz ld a,c call print_debug_hexbyte ld a,$00 ; flush out (DBG_CTRL),a ret bdos_text: db "disk: BDOS ($F37D/$0005) called, function $",0 ;-------------------------------- ; BDOS $02: CONOUT ; Print character on stdout. ; TODO: Support printer echo. ; TODO: Check CTRL-C and other key combos (see function $0B in DOS2 docs). ; Input: E = character to print bdos_conout: push iy push ix ld ix,chput ld iy,(EXPTBL - 1) ld a,e call calslt pop ix pop iy ret ;-------------------------------- ; BDOS $09: STROUT ; Print string on stdout. ; Input: DE = address of string, string is terminated by "$" character bdos_strout: ld a,(de) cp '$' ret z push de ld e,a call bdos_conout pop de inc de jr bdos_strout ;-------------------------------- ; BDOS $0D: DSKRST ; Flush internal buffers and reset DTA. bdos_dskrst: ; TODO: Flush internal buffers. ; (we don't have any buffers yet) call resetdta ret ;-------------------------------- ; BDOS $19: CURDRV ; Gets the current drive. ; Output: drive (0=A) bdos_curdrv: ; TODO: Keep the current drive in a sysvar. xor a ld l,a ret ;-------------------------------- ; BDOS $1A: SETDTA ; Set Disk Transfer Area. ; Input: DE = new DTA address resetdta: ld de,$0080 bdos_setdta: ld (DTA_ADDR),de ret ;-------------------------------- ; BDOS $2E: VERIFY ; Set/reset verify flag. ; The DOS2 docs say it is optional to implement the verify feature. ; That means we will not implement it, because: ; - most people will be using C-BIOS with disk images rather than real disks ; - verification is very slow ; - verification doesn't really add a lot of protection ; Input: E = new flag state (E=0: disabled, E!=0: enabled) bdos_verify: ret ;-------------------------------- ; BDOS $2F: RDABS ; Read sectors. ; Input: DE = number of first sector to read ; L = drive (0=A) ; H = number of sectors to read ; Output: A = error code (0=OK) bdos_rdabs: ld a,l ld b,h ld c,$F9 ; TODO: Retrieve media ID from disk. ld hl,(DTA_ADDR) and a ; CF = 0 call phydio jr c,bdos_rdabs_error xor a ret bdos_rdabs_error: ; TODO: Find out how to translate PHYDIO errors to BDOS errors. inc a ret ; Input: F = NC to read, C to write ; A = Drive number (0=A:) ; B = Number of sectors to transfer ; C = Media descriptor ; DE = Logical sector number ; HL = Transfer address ;-------------------------------- include "debug.asm" ;-------------------------------- ; The purpose of this routine is having a fixed address to put breakpoints on. ; I expect that having a break point just after loading will be very useful ; when debugging the disk ROM. ds $7F00 - $,$FF dskio_done: nop ret ds $8000 - $,$FF cbios-0.28/src/main_msx1_br.asm0000644000000000000000000000412113137376076015123 0ustar rootroot; C-BIOS main ROM for a Brazillian MSX1 machine ; ; Copyright (c) 2005 Maarten ter Huurne. All rights reserved. ; Copyright (c) 2005 Joost Yervante Damad. All rights reserved. ; Copyright (C) 2005 BouKiCHi. All rights reserved. ; Copyright (C) 2008 Eric Boon. All rights reserved. ; ; Redistribution and use in source and binary forms, with or without ; modification, are permitted provided that the following conditions ; are met: ; 1. Redistributions of source code must retain the above copyright ; notice, this list of conditions and the following disclaimer. ; 2. Redistributions in binary form must reproduce the above copyright ; notice, this list of conditions and the following disclaimer in the ; documentation and/or other materials provided with the distribution. ; ; THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ; OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ; IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ; NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ; include "hardware.asm" VDP: equ TMS99X8 MODEL_MSX: equ MODEL_MSX1 ; -- generic brazillian config (60Hz, US keyboard layout, BR variant charset) LOCALE_CHSET: equ LOCAL_CHSET_US LOCALE_CHSET_VAR: equ LOCAL_CHSET_VAR_BR LOCALE_DATE: equ LOCAL_DATE_DMY LOCALE_INT: equ LOCAL_INT_60HZ LOCALE_KBD: equ LOCAL_KBD_US LOCALE_BASIC: equ LOCAL_BASIC_US COLOR_FORE: equ 15 COLOR_BACK: equ 4 COLOR_BORDER: equ 4 CALL_SUB: equ NO include "main.asm" ; vim:ts=8:expandtab:filetype=z8a:syntax=z8a: cbios-0.28/src/main_msx1_jp.asm0000644000000000000000000000403013137376076015130 0ustar rootroot; C-BIOS main ROM for a Japanese MSX1 machine ; ; Copyright (c) 2005 Maarten ter Huurne. All rights reserved. ; Copyright (c) 2005 Joost Yervante Damad. All rights reserved. ; Copyright (C) 2005 BouKiCHi. All rights reserved. ; Copyright (C) 2008 Eric Boon. All rights reserved. ; ; Redistribution and use in source and binary forms, with or without ; modification, are permitted provided that the following conditions ; are met: ; 1. Redistributions of source code must retain the above copyright ; notice, this list of conditions and the following disclaimer. ; 2. Redistributions in binary form must reproduce the above copyright ; notice, this list of conditions and the following disclaimer in the ; documentation and/or other materials provided with the distribution. ; ; THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ; OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ; IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ; NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ; include "hardware.asm" VDP: equ TMS99X8 MODEL_MSX: equ MODEL_MSX1 ; -- japanese config LOCALE_CHSET: equ LOCAL_CHSET_JP LOCALE_CHSET_VAR: equ LOCAL_CHSET_VAR_NONE LOCALE_DATE: equ LOCAL_DATE_YMD LOCALE_INT: equ LOCAL_INT_60HZ LOCALE_KBD: equ LOCAL_KBD_JP LOCALE_BASIC: equ LOCAL_BASIC_JP COLOR_FORE: equ 15 COLOR_BACK: equ 4 COLOR_BORDER: equ 7 CALL_SUB: equ NO include "main.asm" ; vim:ts=8:expandtab:filetype=z8a:syntax=z8a: cbios-0.28/src/logo_msx2.asm0000644000000000000000000000311613137376076014460 0ustar rootroot; C-BIOS main ROM for MSX2 machines ; ; Copyright (c) 2005 Maarten ter Huurne. All rights reserved. ; Copyright (c) 2005 Albert Beevendorp. All rights reserved. ; ; Redistribution and use in source and binary forms, with or without ; modification, are permitted provided that the following conditions ; are met: ; 1. Redistributions of source code must retain the above copyright ; notice, this list of conditions and the following disclaimer. ; 2. Redistributions in binary form must reproduce the above copyright ; notice, this list of conditions and the following disclaimer in the ; documentation and/or other materials provided with the distribution. ; ; THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ; OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ; IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ; NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ; include "hardware.asm" VDP: equ V9938 MODEL_MSX: equ MODEL_MSX2 org $8000 include "logo.asm" ; vim:ts=8:expandtab:filetype=z8a:syntax=z8a: cbios-0.28/Makefile0000644000000000000000000001141713137376076012721 0ustar rootroot# Select your assembler: Z80_ASSEMBLER?=pasmo #Z80_ASSEMBLER?=z80-as #Z80_ASSEMBLER?=sjasm #Z80_ASSEMBLER?=tniasm PACKAGE_NAME:=cbios VERSION:=$(shell cat version.txt) PACKAGE_FULL:=$(PACKAGE_NAME)-$(VERSION) TITLE:="C-BIOS $(VERSION) cbios.sf.net" VERSION_FILE:=derived/asm/version.asm ROMS:=main_msx1 main_msx1_jp main_msx1_br main_msx2 main_msx2_jp main_msx2_br \ main_msx2+ main_msx2+_jp main_msx2+_br sub logo_msx1 logo_msx2 \ logo_msx2+ music disk basic ROMS_FULLPATH:=$(ROMS:%=derived/bin/cbios_%.rom) # If needed override location of pasmo. PASMO=pasmo # Mark all logical targets as such. .PHONY: all dist clean list_stub all: $(ROMS_FULLPATH) ifeq ($(Z80_ASSEMBLER),sjasm) # Workaround for SjASM producing output file even if assembly failed. .DELETE_ON_ERROR: $(ROMS_FULLPATH) endif ifeq ($(Z80_ASSEMBLER),z80-as) # Z80-as can only place code into relocatable sections, we preprocess the sections and use # z80-ld to produce the final .rom files ASMDIR=derived/asm SEDSCR = -e 's/ds[ \t]\+\(\$$[0-9a-fA-F]\+[ \t]*-[ \t]*\$$\)/ds\tABS0+\1/' \ -e 's/[ \t]\+org[ \t]\+\(\$$[0-9a-fA-F]\+\|[0-9]\+\)/\ ;\0\nABS0: equ \$$-\1\n;;;-Ttext \1 --entry \1/' \ -e 's:\.\./derived/asm/::' else ASMDIR=src endif $(VERSION_FILE): version.txt @echo "Creating: $@" @mkdir -p $(@D) @echo ' db $(TITLE)' > $@ $(ROMS_FULLPATH): derived/bin/cbios_%.rom: vdep/%.asm @echo "Assembling: $(<:vdep/%=$(ASMDIR)/%)" @mkdir -p $(@D) @mkdir -p derived/lst ifeq ($(Z80_ASSEMBLER),sjasm) @sjasm -iderived/asm -l $(<:vdep/%=src/%) $@ $(@:derived/bin/%.rom=derived/lst/%.lst) endif ifeq ($(Z80_ASSEMBLER),pasmo) @$(PASMO) -I src -I derived/asm $(<:vdep/%=src/%) \ $@ $(@:derived/bin/%.rom=derived/lst/%.lst) endif ifeq ($(Z80_ASSEMBLER),tniasm) @cd src && tniasm ../tools/tniasm-compat $(<:vdep/%=%) ../$@ $(@:derived/bin/%.rom=derived/lst/%.sym) endif ifeq ($(Z80_ASSEMBLER),z80-as) @mkdir -p derived/obj @z80-as -I derived/asm -I src $(<:vdep/%=$(ASMDIR)/%) -Wall \ -o $(@:derived/bin/%.rom=derived/obj/%.o) \ -as=$(@:derived/bin/%.rom=derived/lst/%.lst) @z80-ld -n --oformat binary $(@:derived/bin/%.rom=derived/obj/%.o) `\ grep "^;;;-Ttext" $(<:vdep/%=$(ASMDIR)/%) | \ sed -e "s/;//g" -e 's/\\$$/0x/g'` -o $@ endif ifeq ($(filter clean,$(MAKECMDGOALS)),) # Include main dependency files. -include $(ROMS:%=derived/dep/%.dep) GENERATED_FILES:=$(VERSION_FILE) GENERATED_DEPS:=$(GENERATED_FILES:derived/asm/%.asm=derived/dep/%.dep) # Note: The dependency generation code is here twice. # That's not great, but the alternatives are worse. $(GENERATED_DEPS): derived/dep/%.dep: derived/asm/%.asm @echo "Depending: $<" @mkdir -p $(@D) @echo "INCLUDES:=" > $@ @sed -n '/include/s/^[\t ]*include[\t ]*"\(\.\.\/derived\/asm\/\)\{0,1\}\(.*\)".*$$/INCLUDES+=\2/p' \ < $< >> $@ @echo "INCBINS:=" >> $@ @sed -n '/incbin/s/^[\t ]*incbin[\t ]*"\(\.\.\/derived\/asm\/\)\{0,1\}\(.*\)".*$$/INCBINS+=\2/p' \ < $< >> $@ @echo ".SECONDARY: $(<:derived/asm/%=vdep/%)" >> $@ @echo "$(<:derived/asm/%=vdep/%): $<" >> $@ @echo "$(<:derived/asm/%=vdep/%): \$$(INCLUDES:%=vdep/%) \$$(INCBINS:%=src/%)" >> $@ @echo "ifneq (\$$(INCLUDES),)" >> $@ @echo "-include \$$(INCLUDES:%.asm=derived/dep/%.dep)" >> $@ @echo "endif" >> $@ derived/dep/%.dep: src/%.asm @echo "Depending: $<" @mkdir -p $(@D) @echo "INCLUDES:=" > $@ @sed -n '/include/s/^[\t ]*include[\t ]*"\(\.\.\/derived\/asm\/\)\{0,1\}\(.*\)".*$$/INCLUDES+=\2/p' \ < $< >> $@ @echo "INCBINS:=" >> $@ @sed -n '/incbin/s/^[\t ]*incbin[\t ]*"\(\.\.\/derived\/asm\/\)\{0,1\}\(.*\)".*$$/INCBINS+=\2/p' \ < $< >> $@ @echo ".SECONDARY: $(<:src/%=vdep/%)" >> $@ @echo "$(<:src/%=vdep/%): $(<:src/%=$(ASMDIR)/%)" >> $@ @echo "$(<:src/%=vdep/%): \$$(INCLUDES:%=vdep/%) \$$(INCBINS:%=src/%)" >> $@ @echo "ifneq (\$$(INCLUDES),)" >> $@ @echo "-include \$$(INCLUDES:%.asm=derived/dep/%.dep)" >> $@ @echo "endif" >> $@ else # Clean build -> treat all dependencies as outdated. .PHONY: $(ROMS:%=vdep/%.asm) endif ifneq ($(ASMDIR),src) $(ASMDIR)/%.asm: src/%.asm @echo "Preprocessing: $<" @mkdir -p $(@D) @sed $(SEDSCR) \ < $< > $@ endif clean: @rm -rf derived dist: all @rm -rf derived/dist @mkdir -p derived/dist/$(PACKAGE_FULL) @cp Makefile version.txt *.bat derived/dist/$(PACKAGE_FULL) @cp -R configs doc src tools derived/dist/$(PACKAGE_FULL) @SCRIPT=derived/dist/inject_sha1.sed \ && shasum -a1 $(ROMS_FULLPATH) | sed -nf tools/subst_sha1.sed > $$SCRIPT \ && sed -i'~' -f $$SCRIPT \ derived/dist/$(PACKAGE_FULL)/configs/openMSX/*.xml \ && rm $$SCRIPT derived/dist/$(PACKAGE_FULL)/configs/openMSX/*~ @mkdir -p derived/dist/$(PACKAGE_FULL)/roms @cp $(ROMS_FULLPATH) derived/dist/$(PACKAGE_FULL)/roms @cd derived/dist ; zip -9 -X -D -r $(PACKAGE_FULL).zip $(PACKAGE_FULL) list_stub: cd src && grep -n _text *.asm | grep ',0$$' | awk '{print $$1}' | sed -e 's/_text://' cbios-0.28/structure.bat0000644000000000000000000001321613137376076014010 0ustar rootroot@echo off echo Setting up openMSX configs mkdir derived\configs\openMSX\share\machines 2>nul xcopy configs\openMSX\*.* derived\configs\openMSX\share\machines /y >nul del derived\configs\openMSX\share\machines\README.TXT echo Setting up blueMSX configs mkdir derived\configs\blueMSX\Machines 2>nul xcopy configs\blueMSX\*.* derived\configs\blueMSX\Machines /s /e /y >nul del derived\configs\blueMSX\Machines\README.TXT echo Setting up NLMSX configs mkdir derived\configs\NLMSX\ROMS 2>nul xcopy configs\NLMSX\*.* derived\configs\NLMSX /s /e /y >nul del derived\configs\NLMSX\README.TXT echo Setting up RuMSX configs mkdir derived\configs\RuMSX\SYSTEM 2>nul xcopy configs\RuMSX\*.* derived\configs\RuMSX /s /e /y >nul del derived\configs\RuMSX\README.TXT echo ------------------------ echo Copying system files echo ------------------------ echo - openMSX rem MSX1 copy "derived\bin\cbios_logo_msx1.rom" "derived\configs\openMSX\share\machines" /y >nul copy "derived\bin\cbios_main_msx1.rom" "derived\configs\openMSX\share\machines" /y >nul copy "derived\bin\cbios_main_msx1_jp.rom" "derived\configs\openMSX\share\machines" /y >nul copy "derived\bin\cbios_main_msx1_br.rom" "derived\configs\openMSX\share\machines" /y >nul rem MSX2 copy "derived\bin\cbios_logo_msx2.rom" "derived\configs\openMSX\share\machines" /y >nul copy "derived\bin\cbios_main_msx2.rom" "derived\configs\openMSX\share\machines" /y >nul copy "derived\bin\cbios_main_msx2_jp.rom" "derived\configs\openMSX\share\machines" /y >nul copy "derived\bin\cbios_main_msx2_br.rom" "derived\configs\openMSX\share\machines" /y >nul copy "derived\bin\cbios_sub.rom" "derived\configs\openMSX\share\machines" /y >nul rem copy "derived\bin\cbios_disk.rom derived\configs\openMSX\share\machines" /y >nul rem MSX2+ copy "derived\bin\cbios_logo_msx2+.rom" "derived\configs\openMSX\share\machines" /y >nul copy "derived\bin\cbios_main_msx2+.rom" "derived\configs\openMSX\share\machines" /y >nul copy "derived\bin\cbios_main_msx2+_jp.rom" "derived\configs\openMSX\share\machines" /y >nul copy "derived\bin\cbios_main_msx2+_br.rom" "derived\configs\openMSX\share\machines" /y >nul copy "derived\bin\cbios_music.rom" "derived\configs\openMSX\share\machines" /y >nul echo - BlueMSX rem MSX1 copy "derived\bin\cbios_logo_msx1.rom" "derived\configs\blueMSX\Machines\MSX - C-BIOS" /y >nul copy "derived\bin\cbios_main_msx1.rom" "derived\configs\blueMSX\Machines\MSX - C-BIOS" /y >nul copy "derived\bin\cbios_logo_msx1.rom" "derived\configs\blueMSX\Machines\MSX - C-BIOS - JP" /y >nul copy "derived\bin\cbios_main_msx1_jp.rom" "derived\configs\blueMSX\Machines\MSX - C-BIOS - JP" /y >nul copy "derived\bin\cbios_logo_msx1.rom" "derived\configs\blueMSX\Machines\MSX - C-BIOS - BR" /y >nul copy "derived\bin\cbios_main_msx1_br.rom" "derived\configs\blueMSX\Machines\MSX - C-BIOS - BR" /y >nul rem MSX2 copy "derived\bin\cbios_logo_msx2.rom" "derived\configs\blueMSX\Machines\MSX2 - C-BIOS" /y >nul copy "derived\bin\cbios_main_msx2.rom" "derived\configs\blueMSX\Machines\MSX2 - C-BIOS" /y >nul copy "derived\bin\cbios_sub.rom" "derived\configs\blueMSX\Machines\MSX2 - C-BIOS" /y >nul rem copy "derived\bin\cbios_disk.rom" "derived\configs\blueMSX\Machines\MSX2 - C-BIOS" /y >nul copy "derived\bin\cbios_logo_msx2.rom" "derived\configs\blueMSX\Machines\MSX2 - C-BIOS - JP" /y >nul copy "derived\bin\cbios_main_msx2_jp.rom" "derived\configs\blueMSX\Machines\MSX2 - C-BIOS - JP" /y >nul copy "derived\bin\cbios_sub.rom" "derived\configs\blueMSX\Machines\MSX2 - C-BIOS - JP" /y >nul rem copy derived\bin\cbios_disk.rom "derived\configs\blueMSX\Machines\MSX2 - C-BIOS - JP" /y >nul copy "derived\bin\cbios_logo_msx2.rom" "derived\configs\blueMSX\Machines\MSX2 - C-BIOS - BR" /y >nul copy "derived\bin\cbios_main_msx2_br.rom" "derived\configs\blueMSX\Machines\MSX2 - C-BIOS - BR" /y >nul copy "derived\bin\cbios_sub.rom" "derived\configs\blueMSX\Machines\MSX2 - C-BIOS - BR" /y >nul rem copy "derived\bin\cbios_disk.rom" "derived\configs\blueMSX\Machines\MSX2 - C-BIOS" /y >nul rem MSX2+ copy "derived\bin\cbios_logo_msx2+.rom" "derived\configs\blueMSX\Machines\MSX2+ - C-BIOS" /y >nul copy "derived\bin\cbios_main_msx2+.rom" "derived\configs\blueMSX\Machines\MSX2+ - C-BIOS" /y >nul copy "derived\bin\cbios_sub.rom" "derived\configs\blueMSX\Machines\MSX2+ - C-BIOS" /y >nul copy "derived\bin\cbios_music.rom" "derived\configs\blueMSX\Machines\MSX2+ - C-BIOS" /y >nul rem copy "derived\bin\cbios_disk.rom" "derived\configs\blueMSX\Machines\MSX2 - C-BIOS" /y >nul copy "derived\bin\cbios_logo_msx2+.rom" "derived\configs\blueMSX\Machines\MSX2+ - C-BIOS - JP" /y >nul copy "derived\bin\cbios_main_msx2+_jp.rom" "derived\configs\blueMSX\Machines\MSX2+ - C-BIOS - JP" /y >nul copy "derived\bin\cbios_sub.rom" "derived\configs\blueMSX\Machines\MSX2+ - C-BIOS - JP" /y >nul copy "derived\bin\cbios_music.rom" "derived\configs\blueMSX\Machines\MSX2+ - C-BIOS - JP" /y >nul rem copy "derived\bin\cbios_disk.rom" "derived\configs\blueMSX\Machines\MSX2 - C-BIOS" /y >nul copy "derived\bin\cbios_logo_msx2+.rom" "derived\configs\blueMSX\Machines\MSX2+ - C-BIOS - BR" /y >nul copy "derived\bin\cbios_main_msx2+_br.rom" "derived\configs\blueMSX\Machines\MSX2+ - C-BIOS - BR" /y >nul copy "derived\bin\cbios_sub.rom" "derived\configs\blueMSX\Machines\MSX2+ - C-BIOS - BR" /y >nul copy "derived\bin\cbios_music.rom" "derived\configs\blueMSX\Machines\MSX2+ - C-BIOS - BR" /y >nul rem copy "derived\bin\cbios_disk.rom" "derived\configs\blueMSX\Machines\MSX2 - C-BIOS" /y >nul echo - NLMSX rem copy derived\bin\cbios_disk.rom "derived\configs\blueMSX\Machines\MSX2+ - C-BIOS" /y >nul copy "derived\bin\cbios_*.rom" "derived\configs\NLMSX\ROMS" /y >nul echo - RuMSX copy "derived\bin\cbios_*.rom" "derived\configs\RuMSX\SYSTEM" /y >nul echo Done... pause