The Unicard's behaviour is can be influenced using text configuration files, located on the SD card in the \unicard\ folder. There are four types of configuration files:
If it exists and contains the path and name of an existing file with the floppy disk image, it is mounted into the emulated floppy dics drive. If not, the drive will appear empty. The range of the emulated floppy disk drive ports fd<0..3>.cfg is 0xD8-0xDF, the booting drive is fd0.
Using an empty file fd0disabled.cfg we can prohibit the emulated disk drive fd0([A]:), even though the file fd0.cfg exists with correct path to the folder with the floppy disk image.
If it exists and contains a path and a name of an existing file with a Quick disk image, this image is mounted into the emulated QD drive. If the file does not exist, the QD drive wil not be emulated. The current firmware version also emulates recording.
Quick disk can also be used in BASIC:
Used ports:
RW 0x74/0xF4 - SIO channel A data RW 0x75/0xF5 - SIO channel B data RW 0x76/0xF6 - SIO channel A control RW 0x77/0xF7 - SIO channel B control
The numbers of ports used for working with Quick disk are changed for Sharp MZ-1500 from default values used for Sharp MZ-700 and Sharp MZ-800 0xF4-0xF7 to new values 0x74-0x77. For working with emulated Quck disk on Sharp MZ-1500 it is necessary to have a modified ROM for programs using QD routines from ROM and modified BASIC for working with BASIC. In the case of a disconnected QD SIO, firmware will be available with standard port numbers, even for Sharp MZ-1500.
An emulated QD drive also allows running programs and games on multiple disks. If the file of the mounted Quick disk image has the name filename_A.mzq or filename-1.mzq (the character '_' or '-' is before the last position in the file name), then the Unicard will, after finishing reading from the emulated QD drive, which results in switching off the motor, increment after 3 seconds the last character of the file name ('A'→'B','B'→'C','1'→'2','2'→'3'…) and if a Quick disk image with this name exists, it will be mounted instead of the previous Quick disk image. Multiple images can be chained this way. If there are no more Quick disk images with appropriate file names, the image marked in file qd.cfg will be used again. After being asked to change the Quick disk in the emulated QD drive, it is therefore necessary to wait for at least 3 seconds, so the Unicard can mount the next image of the emulated Quick disk and then confirm the changing of the Quick disk.
If it exists and contains a path and a name of an existing file with the RAM (SROM/SRAM) disk image, the emulation is working. Unicard supports emulation on files of these sizes: 64k,128k,256k,512k,1M,2M,4M,8M,16M. If the file's image is smaller than 64kb, the Unicard will stop emulating.
RAM disk can also be used in BASIC:
Used ports for the individual emulation modes:
RD mode: ========= -W 0xE9 - set bank (0x00-0xFF) for MZ-700 or MZ-800 (not for MZ-1500!) RW 0xEA - I/O data, addr++ -W 0xEB - set addr, Data(D0-7) = LoBYTE, Addr(8-15) = HiBYTE (on Unicard LoBYTE only) R- 0xF8 - reset addr and page -W 0xF8 - set HiBYTE addr SROM/SRAM mode: ================ R- 0xF8/0xA8 - reset addr R- 0xF9/0xA9 - read data, addr++ -W 0xFA - write data, addr++
Using a file with size 640kB emulates a 640kB PIO-3034 EMM disk drive, which supports HuBASIC for MZ-700 (also works on MZ-800 and MZ-1500), PIO EMM uses ports 0x00-0x03, Unicard supports up to 1 EMM drive.
EMM disk can also be used in BASIC:
Used ports:
RW 0x00 - read/set LowBYTE addr RW 0x01 - read/set MidBYTE addr RW 0x02 - read/set HiBYTE addr RW 0x03 - read/write data, addr++
Contains in text form the settings of the parameters used to configure the network for accessing the HTTP Server, the pre-set values are mentioned in brackets:
HWADDR
IPADDR
NETMASK
GATEWAY
= <addr>
= <addr>
= <addr>
= <addr>
(hash from a UniqueID processor in range 00:1C:EE:XX:XX:XX)
(192.168.1.10)
(255.255.255.0)
(192.168.1.20)
The network parameters can be reviewed through HTTP Server interface or USARTShell interface, using the program UniUSARTShell. DHCP is not supported.
Configuration of the file network.cfg
IPADDR=192.168.1.111 NETMASK=255.255.255.0 GATEWAY=192.168.1.1
If it exists in file location /unicard/ushelldisabled.cfg, then USB is available for SHARP as emulated SIO channel B ports 0xB0-0xB3, if not, the communication interface USARTShell is running.
RW 0xB0 - Z80SIO channel A data RW 0xB1 - Z80SIO channel A control RW 0xB2 - Z80SIO channel B data RW 0xB3 - Z80SIO channel B control
The configuratuin file containing the path to MZF, which is run by MZFLoader - usually contains path and a name of the file with the Unicard Manager. MZFloader is generally run from an emulated SRAM disk or Quick disk. Unicard will, after a reset, temporarily set up on the computer its own SRAM disk with the MZFloader, which is then downloaded and run. MZFloader will then search the mzfloader.cfg file and run a program mentioned in it (usually the Unicard manager). Only then will it set up the RAM (SRAM) disk according to the contents of the appropriate configuration file. This function works relatively well on MZ-1500, but is not completely reliable on MZ-800. Sometimes it can help to enter the monitor using the M key (or M+Reset) and to run MZFloader from the SRAM disk using the command EB. If you do not need to actively use the RAM disk, you can put mzfloader.ram in it directly, which works better, but watch out for overwriting the RAM disk by, for example, running BASIC or CP/M. If you do not need to actively use Quick disk, it is best to start the MZFloader from it - copy mzfloader.mzq into the QD device. Running MZFloader from QD is reliable on all platforms. If all you need is to run MZF programs and games, it is the recommended solution for now. At the same time, if you have a floppy disk mounted in of the virtual drives, use Q+Reset to directly load QD instead of running FD, which otherwise has higher priority.
Configuring the configuration file for Sharp MZ-800 and UniManager mgr800.mzf
/unicard/mgr800.mzf
Configuring the configuration file for Sharp MZ-1500 and UniManager mgr1500.mzf
/unicard/mgr1500.mzf
The existence of this file turns on PS/2 mouse emulation on port 0x71. Normally, programs with mouse support use the second JoyPort on port 0xF1. Because it is impossible to turn it off and a Unicard emulation would interfere with it, the Unicard emulation is moved to port 0x71. If you want to use this emulation, you have to have the default port modified to the emulated one for programs and games.
Unicard also emulates peripherals that do not need configuration and are not activated by the contents of or the existence of a CFG file. These are peripherals, whose emulation is activated by the presence of binary ROM images in the \unicard\ folder
If we copy file mz1r23.rom (mz1r23b.rom), containing a binary image of a ROM KANJI MZ-1R23 card into the \unicard\ folder, the Unicard will emulate this card on ports 0xB8-0xB9.
If we copy file mz1r24.rom, containing a binary ROM image of a dictionary card MZ-1R24 into the \unicard\ folder, the Unicard will emulate it on ports 0xB8-0xB9, same as with MZ-1R23.
As of 08/2018, the Unicard emulates 3 types of math coprocessors. AM9511(I8231,CI8231..), AM9512(I8232,CI8232..) and a coprocessor for calculations in SHARP BASIC numerical representation internally called SHARP ALU. When a command is entered, ALU will activate bit BUSY, which returns to zero after it is finished. The data reading routine therefore has to wait for ALU to not be BUSY. It is not necessary to block wait or anytihng like that. The communication and supported math functions and operations are similar for all types of coprocessors.
AM9511, AM9512, SHARP ALU
AM9511
* 0x00 NOP - No Operation * 32-Bit Floating Point Instructions * 0x01 SQRT - Square Root of A * 0x02 SIN - Sine of A (radians) * 0x03 COS - Cosine of A (radians) * 0x04 TAN - Tangent of A (radians) * 0x05 ASIN - Inverse Sine of A * 0x06 ACOS - Inverse Cosine of A * 0x07 ATAN - Inverse Tangent of A * 0x08 LOG - Common Logarithm (base 10) of A * 0x09 LN - Natural Logarithm of A * 0x0a EXP - eA Function * 0x0b PWR - B^A Power Function * 0x10 FADD - Add A and B * 0x11 FSUB - Substract A from B * 0x12 FMUL - Multiply A and B * 0x13 FDIV - Divide B by A * 0x15 CHSF - Sign Change of A * 0x17 PTOF, PTOD - Stack Push * 0x18 POPF, POPD - Stack Pop * 0x19 XCHF, XCHD - Exchange A and B * 0x1a PUPI - Push PI onto Stack * 0x1C FLTD - 32-Bit Integer to Floating Point Conversion * 0x1D FLTS - 16-Bit Integer to Floating Point Conversion * 0x1E FIXD - Floating Point to 32-Bit Integer Conversion * 0x1F FIXS - Floating Point to 16-Bit Integer Conversion * 32-Bit Integer Instructions * 0x2C DADD - 32-bit fixed point add * 0x2D DSUB - 32-bit fixed point substract * 0x2E DMUL - 32-bit fixed point multiply, lower * 0x2F DDIV - 32-bit fixed point divide * 0x34 CHSD - 32-bit fixed-point sign change * 0x36 DMUU - 32-bit fixed point multiply, upper * 16-Bit Integer Instructions * 0x6C SADD - Add Au and Al * 0x6D SSUB - Substract Au from Al * 0x6E SMUL - Multiply Al and Au (R=lower 32-bits) * 0x6F SDIV - Divide Au and Al * 0x74 CHSS - 16-bit fixed-point sign change * 0x76 SMMU - Multiply Al and Au (R=upper 32-bits) * 0x77 PTOS - Stack Push * 0x78 POPS - Stack Pop * 0x79 XCHS - Exchange A and B * 0x7f - Push ALU1 signature '9511' onto stack
AM9512
* 0x00 CLR - CLR status * 32-Bit Floating Point Instructions * 0x01 SADD - Add A and B * 0x02 SSUB - Substract A from B * 0x03 SMUL - Multiply A by B * 0x04 SDIV - Divide B by A. if exponent = 0 then R = B * 0x05 CHSS - Change sign of A * 0x06 PTOS - Push stack * 0x07 POPS - Pop stack * 0x08 XCHS - Exchange * 64-Bit Double Floating Point Instructions * 0x29 DADD - Add A and B * 0x2A DSUB - Substract A from B * 0x2B DMUL - Multiply A by B * 0x2C DDIV - Divide B by A, If A = 0, then R = B * 0x2D CHSD - Change sign of A * 0x2E PTOD - Push stack * 0x2F POPD - Pop stack * 0x7f - Push ALU2 signature '8232' onto stack
SHARP ALU - BASIC 5-Byte numbering format
* 0x00 NOP - No Operation * 0x01 SADD - Add A and B * 0x02 SSUB - Substract A from B * 0x03 SMUL - Multiply A by B * 0x04 SDIV - Divide B by A. if exponent = 0 then R = B * 0x05 CHSS - Change sign of A * 0x06 PTOS - Push stack * 0x07 POPS - Pop stack * 0x08 XCHS - Exchange * 0x10 SQRT - Square Root of A * 0x12 SIN - Sine of A (radians) * 0x13 COS - Cosine of A (radians) * 0x14 TAN - Tangent of A (radians) * 0x15 ASIN - Inverse Sine of A * 0x16 ACOS - Inverse Cosine of A * 0x17 ATAN - Inverse Tangent of A * 0x18 LOG - Common Logarithm (base 10) of A * 0x19 LN - Natural Logarithm of A * 0x1a EXP - eA Function * 0x1b PWR - B^A Power Function * 0x2a PUPI - Push PI onto Stack * 0x7f - Push ALU3 signature 'M801' onto stack
BASIC is modified to calculate these function through SHARP ALU:
SQR EXP LOG LN SIN (COS) TAN ATN x ^ y x * y x / y x + y x - y
The Unicard takes in all the communication with GDG and a video memory and emululates a graphics output, which outputs to VGA in full resolution.
The Unicard contains a real time clock maintained by a battery. If you do not need or want the clock, you do not have to install the battery. The clock is used by the Unicard file system when creating or modifying files and are controllable through MZFrepo interface. This can then be used by some applications. For example, UNIUTIL can read the time from the Unicard and set it into CP/M. It is best done automatically when starting CP/M.
Emulating sound on the audio output, mono output is split into stereo. Currently, only PSG output is emulated, and not i8253, the output is line only, it will not handle headphones. SV2 jumpers switch the connection of two pins of the four point jack on Samsung × Apple standard - the ground is either closest to the cable or second closest, and the input is the other one, for a three pole connector it should not matter, the ground is over both of them.