# Functions
BdosSysCallAuxRead reads a single character from the auxiliary input.
BdosSysCallAuxWrite writes the single character in the C register auxiliary / punch output.
BdosSysCallBDOSVersion returns version details.
BdosSysCallConsoleStatus tests if we have pending console (character) input.
BdosSysCallDeleteFile deletes the filename(s) matching the pattern specified by the FCB in DE.
BdosSysCallDirectScreenFunctions receives a pointer in DE to a parameter block, which specifies which function to run.
BdosSysCallDriveAlloc will return the address of the allocation bitmap (which blocks are used and which are free) in HL.
BdosSysCallDriveAllReset resets the drives.
BdosSysCallDriveGet returns the number of the active drive.
BdosSysCallDriveReset allows resetting specific drives, via the bits in DE Bit 7 of D corresponds to P: while bit 0 of E corresponds to A:.
BdosSysCallDriveROVec will return a bitfield describing which drives are read-only.
BdosSysCallDriveSet updates the current drive number.
BdosSysCallDriveSetRO will mark the current drive as being read-only.
BdosSysCallErrorMode implements a NOP version of F_ERRMODE.
BdosSysCallExit implements the Exit syscall.
BdosSysCallFileClose closes the filename that matches the pattern on the FCB supplied in DE.
BdosSysCallFileOpen opens the filename that matches the pattern on the FCB supplied in DE.
BdosSysCallFileSize updates the Random Record bytes of the given FCB to the number of records in the file.
BdosSysCallFindFirst finds the first filename, on disk, that matches the glob in the FCB supplied in DE.
BdosSysCallFindNext finds the next filename that matches the glob set in the FCB in DE.
BdosSysCallGetDriveDPB returns the address of the DPB, which is faked.
BdosSysCallGetIOByte gets the IOByte, which is used to describe which devices are used for I/O.
BdosSysCallLoginVec returns the list of logged in drives.
BdosSysCallMakeFile creates the file named in the FCB given in DE.
BdosSysCallPrinterWrite should send a single character to the printer, we fake that by writing to a file instead.
BdosSysCallRandRecord Sets the random record count bytes of the FCB to the number of the last record read/written by the sequential I/O calls.
BdosSysCallRawIO handles both simple character output, and input.
BdosSysCallRead reads a record from the file named in the FCB given in DE.
BdosSysCallReadChar reads a single character from the console.
BdosSysCallReadRand reads a random block from the FCB pointed to by DE into the DMA area.
BdosSysCallReadString reads a string from the console, into the buffer pointed to by DE.
BdosSysCallRenameFile will handle a rename operation.
BdosSysCallSetDMA updates the address of the DMA area, which is used for block I/O.
BdosSysCallSetFileAttributes should update the attributes of the given file, but it fakes it.
BdosSysCallSetIOByte sets the IOByte, which is used to describe which devices are used for I/O.
BdosSysCallTime implements a NOP version of T_GET.
BdosSysCallUserNumber gets, or sets, the user-number.
BdosSysCallWrite writes a record to the file named in the FCB given in DE.
BdosSysCallWriteChar writes the single character in the E register to STDOUT.
BdosSysCallWriteRand writes a random block from DMA area to the FCB pointed to by DE.
BdosSysCallWriteString writes the $-terminated string pointed to by DE to STDOUT.
BiosSysCallAuxInputStatus returns status of current auxiliary input device.
BiosSysCallAuxOutputStatus returns status of current auxiliary output device.
BiosSysCallColdBoot handles a cold boot.
BiosSysCallConsoleInput should block for a single character of input, and return the character pressed in the A-register.
BiosSysCallConsoleOutput should write a single character, in the C-register, to the console.
BiosSysCallConsoleStatus should return 0x00 if there is no input pending, otherwise 0xFF.
BiosSysCallPrintChar should print the specified character, in the C-register, to the printer.
BiosSysCallPrinterStatus returns status of current printer device.
BiosSysCallReserved1 is a helper to get/set the values of the CPM interpreter from within the system.
BiosSysCallScreenOutputStatus returns status of current screen output device.
BiosSysCallWarmBoot handles a warm boot.
New returns a new emulation object.
WithCCP lets the default CCP to be changed in our constructor.
WithConsoleDriver allows the console driver to be created in our constructor.
WithPrinterPath allows the printer output to changed in our constructor.
# Variables
ErrBoot will be used to note that the Z80 emulator executed code at 0x0000 - i.e.
ErrExit will be used to handle a CP/M binary calling Exit.
ErrHalt will be used to note that the Z80 emulator executed a HALT operation, and that terminated the execution of code.
ErrUnimplemented will be used to handle a CP/M binary calling an unimplemented syscall.
# Structs
CPM is the object that holds our emulator state.
CPMHandler contains details of a specific call we implement.
FileCache is used to cache filehandles on the host-side of the system, which have been opened by the CP/M binary/CCP.
# Type aliases
CPMHandlerType contains the signature of a function we use to emulate a CP/M BIOS or BDOS function.