What follows is technical information for users who want to know more about the emulator or want to develop support programs for the emulator or new software for the TRS-80 running on the emulator. Nothing contained here is required to use the emulator.
Technical info - DMK type virtual disks:
This information on what has become known as the DMK virtual disk format is provided for users wanting to better understand the operation of the emulator and for programmers writing their own emulators wanting to add support for this format and/or the creation of PC utilities to work with the DMK virtual disk format.
This virtual disk format is as close to the way data on a real disk is stored as possible. There is very little added overhead and the data is easily examined and edited using PC based hex editors. The actual design is really quite simple and enables support of ALL the WD-1771 and WD-19xx controller functions and formats. While the design is simple however the programming requirements for this format are much more extensive then for the JV1/JV3 formats.
Disk header:
Virtual disks have a 16 byte disk header which is initialized when the user creates a new virtual disk. This header may be modified before or after a virtual disk has been formatted to change some of its characteristics.
Byte 0 | If this byte is set to FFH the disk is `write protected', 00H allows writing. |
Byte 1 | Number of tracks on virtual disk. Since
tracks start at 0 this value will be one greater than the
highest track written to the disk. So a disk with 40
tracks will have a value of 40 (28H) in this field after
formatting while the highest track written would be 39.
This field is updated after a track is formatted if the
track formatted is greater than or equal to the current
number of tracks. Re-formatting a disk with fewer tracks
will NOT reduce the number of tracks on the virtual disk.
Once a virtual disk has allocated space for a track it
will NEVER release it. Formatting a virtual disk with 80
tracks then re-formatting it with 40 tracks would waste
space just like formatting only 40 tracks on an 80 track
drive. The emulator and TRS-80 operating system don't
care. To re-format a virtual disk with fewer tracks use
the /I option at start-up to delete and re-create the
virtual disk first, then re-format to save space. Note: This field should NEVER be modified. Changing this number will cause TRS-80 operating system disk errors. (Like reading an 80 track disk in a 40 track drive) |
Byte 2 & 3 | This is the track length for the virtual
disk. By default the value is 1900H, 80H bytes more than
the actual track length, this gives a track length of
6272 bytes. A real double density track length is aprox.
6250 bytes. This is the default value when a virtual disk
is created. Values for other disk and format types are
0CC0H for single density 5.25" floppies, 14E0H for
single density 8" floppies and 2940H for double
density 8" floppies. The max value is 2940H. For
normal formatting of disks the values of 1900H and 2940H
for 5.25" and 8" are used. The emulator will
write two bytes and read every second byte when in
single density to maintain proper sector spacing,
allowing mixed density disks. Setting the track length
must be done before a virtual disk is formatted or the
disk will have to be re-formatted and since the space for
the disk has already been allocated no space will be
saved. WARNING: Bytes are entered in reverse
order (ex. 2940H would be entered, byte 2=40, byte
3=29). |
Byte 4 | Virtual disk option flags. Bit 4 of this byte, if set, means this is a single sided ONLY disk. This bit is set if the user selects single sided during disk creation and should not require modification. This flag is used only to save PC hard disk space and is never required. Bit 6 of this byte, if set, means this disk is to be single density size and the emulator will access one byte instead of two when doing I/O in single density. Double density can still be written to a single density disk but with half the track length only 10 256 byte sectors can be written in either density. Mixed density is also possible but sector timing may be off so protected disks may not work, a maximum of 10 256 byte sectors of mixed density can be written to a single density disk. A program like "Spook House" which has a mixed density track 0 with 1 SD sector and 1 DD sector and the rest of the disk consisting of 10 SD sectors/track will work with this flag set and save half the PC hard disk space. The protected disk "Super Utility + 3.0" however has 6 SD and 6 DD sectors/track for a total of 12 256 byte sectors/track. This disk cannot be single density. This bit is set if the user selects single density during disk creation and should not require modification. This flag is used only to save PC hard disk space and is never required. Bit 7 of this byte, if set, means density is to be ignored when accessing this disk. The disk MUST be formatted in double density but the emulator will then read and write the sectors in either density. The emulator will access one byte instead of two when doing I/O in single density. This flag was an early way to support mixed density disks it is no longer needed for this purpose. It is now used for compatibility with old virtual disks created without the double byte now used when in single density. This bit can be set manually in a hex editor to access old virtual disks written in single density. |
Byte 5-B | reserved for future options |
Byte C-F | Must be zero if virtual disk is in
emulator's native format. Must be 12345678h if virtual disk is a REAL disk specification file used to access REAL TRS-80 floppies in compatible PC drives. |
Track Header | Each track has a 128 (80H) byte header
which contains an offset to each IDAM in the track. This
is created during format and should NEVER require
modification. The actual track data follows this header
and can be viewed with a hex editor showing the raw data
on the track. Modification should not be done as each
IDAM and sector has a CRC, this is just like a real disk,
and modifying the sector data without updating the CRC
value will cause CRC errors when accessing the virtual
disk within the emulator. Note: Modification within MSDOS could however be done to emulate a protected disk in the TRS-80 emulator. |
Track header:
Each side of each track has a 128 (80H) byte header which contains an offset pointer to each IDAM in the track. This allows a maximum of 64 sector IDAMs/track. This is more than twice what an 8 inch disk would require and 3.5 times that of a normal TRS-80 5 inch DD disk. This should more than enough for any protected disk also.
These IDAM pointers MUST adhere to the following rules.
Each IDAM pointer has two flags. Bit 15 is set if the sector is double density. Bit 14 is currently undefined. These bits must be masked to get the actual sector offset. For example, an offset to an IDAM at byte 90h would be 0090h if single density and 8090h if double density.
Track data:
The actual track data follows the header and can be viewed with a hex editor showing the raw data on the track. If the virtual disk doesn't have bits 6 or 7 set of byte 4 of the disk header then each single density data byte is written twice, this includes IDAMs and CRCs (the CRCs are calculated as if only 1 byte was written however). The IDAM and sector data each have CRCs, this is just like on a real disk.
Modification should not be done since doing so without updating the CRCs would cause data errors. Modification could be done however to create protected tracks for importing protected disks to virtual disk format. Examples of disks created using this technique are "Super Utility+ 3.0" and "Forbidden City".
Technical info - JV1/JV3 type virtual disks:
This emulator is capable of reading and writing to JV1 and JV3 type virtual disks. Support for this type of virtual disk is limited by both the limits of the format type and this emulators support of it.
The emulator supports read sector, read address and write sector commands to the JV1 type virtual disk. JV1 disks are single density only and can be up to 254 tracks long and always have a protected directory track at track 17. Read track and write track commands are not supported for this disk type. This disk type can be write protected from the "virtual floppy disk selection screen" but the write protect status will always default to off when ever a JV1 disk is opened.
The emulator supports read sector, read address and write sector commands to the JV3 type virtual disk. JV3 disks are single/double density and can be up to 96 tracks long. Read track and write track commands are not supported for this disk type. This disk type can be write protected from the "virtual floppy disk selection screen" but the write protect status will always default to what ever status is in the the JV3 virtual disk file (byte 21FFh) when the disk is opened, the write protect status is not updated. The density and CRC error flags are also supported but not updated. DAM types FB/F9 report FB and F8/FA report F8. Sector writes that change the DAM type from what is in the virtual disk file are not supported. This will not cause problems unless you try to change the protection status of a directory track. Standard IBM sector sizes are supported of 128, 256, 512 & 1024 bytes. A second sector header block is not supported.
Technical info - REAL TRS-80 floppy disks:
This emulator is capable of reading, writing and formatting REAL TRS-80 floppy disks in compatible PC floppy drives. Support for this is limited by both the limits of the NEC type floppy disk controller and this emulators support of it.
Depending on compatibility of your PC you should be able to read/write single density & double density 5.25" and 3.5" disks in 360k and 720k PC floppy drives (commonly known as low/double density drives, DD). You should be able to read/write double density 5.25" and 3.5" disks in 1.2meg and 1.44meg PC floppy drives (commonly known as high density drives, HD).
Eight fixed sector length REAL floppy specification virtual disks are supplied to read/write 256 byte/sector floppies in a PC's A: and B: drives.
FDD0_360.DSK | Reads 40 track disks on a PC A: 360k (DD) drive. |
FDD1_360.DSK | Reads 40 track disks on a PC B: 360k (DD) drive |
FHD0_360.DSK | Reads 40 track disks on a PC A: 1.2meg (HD) drive. (double steps head) |
FHD1_360.DSK | Reads 40 track disks on a PC B: 1.2meg (HD) drive. (double steps head) |
FHD0_720.DSK | Reads 80 track disks on a PC A: 1.2meg (HD) drive. |
FHD1_720.DSK | Reads 80 track disks on a PC B: 1.2meg (HD) drive. |
F350_720.DSK | Reads 80 track 3.5" disks on a PC A: 1.44meg (HD) drive. |
F351_720.DSK | Reads 80 track 3.5" disks on a PC B: 1.44meg (HD) drive. |
Eight variable sector length REAL floppy specification virtual disks are supplied to read/write 128-1024 byte/sector floppies in a PC's A: and B: drives. These specification disks are slower than the fixed length ones and should only be used on disks un-readable with the fixed length specification disks.
VDD0_360.DSK | Reads 40 track disks on a PC A: 360k (DD) drive. |
VDD1_360.DSK | Reads 40 track disks on a PC B: 360k (DD) drive |
VHD0_360.DSK | Reads 40 track disks on a PC A: 1.2meg (HD) drive. (double steps head) |
VHD1_360.DSK | Reads 40 track disks on a PC B: 1.2meg (HD) drive. (double steps head) |
VHD0_720.DSK | Reads 80 track disks on a PC A: 1.2meg (HD) drive. |
VHD1_720.DSK | Reads 80 track disks on a PC B: 1.2meg (HD) drive. |
V350_720.DSK | Reads 80 track 3.5" disks on a PC A: 1.44meg (HD) drive. |
V351_720.DSK | Reads 80 track 3.5" disks on a PC B: 1.44meg (HD) drive. |
Because of the limitations of the PC's NEC type floppy disk controller the PC cannot read most protected disks. The emulator does not support the track read commands with REAL floppies. Because of limitations of the PC's controller most disk zap utilities (like Hyperzap and Super Utility) cannot work with REAL floppies. Also the write track command has to translate format data to the PC's controller form and is therefore unable to format anything but standard sectors. Because of the translation for PC disk I/O, access to real TRS-80 disks is apt to be slow, formatting in some cases can take as long as 8 seconds/track. This is unavoidable and should not present problems since REAL disk support is mainly for importing your existing TRS-80 disks and transferring data and programs to the TRS-80. If your PC has a hard time reading your TRS-80 disks then use the emulator to format a disk on the PC and then copy the disk on the TRS-80 to the PC formatted disk, this should correct most problems.
Some PC's cannot read SD TRS-80 disks and still others cannot read any TRS-80 disks without errors. This is a compatibility problem with different PC controllers and not a problem with the emulator. Try using a different brand of PC or an older model PC. If you are still unable to read your disks and really need the data converted, e-mail me and maybe I can convert the disk for you (my PC has been able to read every disk I've tried so far).
Technical info - Virtual hard disks:
This information on what are known as the HDV virtual hard disks is provided for users wanting to better understand the operation of the emulator and for programmers writing their own emulators wanting to add support for this format and/or the creation of PC utilities to work with the HDV virtual disk format.
These emulators support the existing HDV format and have extended the format to support 1024 cylinder hard drives using the WD1010 hard drive controller emulation.
Disk header:
Virtual hard disks have a 256 byte disk header which is initialized when the user creates a new virtual disk. This header may be modified before or after a virtual disk has been formatted to change some of its characteristics.
Byte 0 & 1 | Identifier 56h & CBh |
Byte 2 | Version: set to 11h when file created (version 1.1) |
Byte 3 | Checksum of bytes 0-31 (excepting byte 3) XORed with 4Ch |
Byte 4 | Number of 256 byte blocks in header: should be 1 (anything other than 1 is not supported by this emulator) |
Byte 5 | -unused- Currently set to 4 for compatibility |
Byte 6 | Media type: 0 for hard disk |
Byte 7 | Bit 7 set if hard disk is write protected, all other bits -unused- |
Byte 8 & 9 | -unused- |
Byte 10 | FFh = created with this emulator |
Byte 11 | -unused- (DOS type) |
Byte 12 | Creation month |
Byte 13 | Creation day |
Byte 14 | Creation year (offset from 1900) |
Byte 15-26 | -unused- |
Byte 27 | If 'byte 10' = FFh then bits 0-1 contains high bits
of cylinder count (max value 1024) else -unused- |
Byte 28 | If 'byte 10' = FFh then contains low byte of cylinder
count else contains total number of cylinders on disk |
Byte 29 | Number of sectors per cylinder This value must be divisible by 32. A value of 00h = 256 sectors |
Byte 30 | -unused- but is set to 'byte 29' divided by 16 when file created (granules per cylinder) |
Byte 31 | -unused- but is set to 1 when file created (directory cylinder) |
Byte 32-63 | Volume label, set to TRS80 when file is created (31 bytes terminated by 00h) |
Byte 64-71 | -unused- (Creation filename) |
Byte 72-255 | -unused- |
Technical Info - Enhanced Z80 instructions
The emulator has a set of enhanced Z80 instructions. These instructions allow TRS-80 programs to interface with the PC's disk drives, ports, memory and other hardware. These instructions also add high level math functions to the Z80 instruction set.
NOTE: These instructions are only available in the emulators.
The following links contain a list of the enhanced instructions and documentation for each instruction.
Enhanced Instruction Documentation (on-line)
Enhanced Instruction Documentation (Microsoft Word 123k)
Technical Info - Port mapped PC I/O commands
In addition to the enhanced Z80 instructions described above the emulator can also interface with the PC using port mapped commands. These commands provide an easier to use interface when writing programs in BASIC or other high level language eliminating the need for machine language calls.
The port mapped I/O commands allow access to the 13 I/O functions between 30h and 3Fh as defined in the Enhanced Instruction Documentation. These port mapped I/O commands also allow access to the PC's I/O ports. The Z80 ports 50h to 57h can be mapped to any of the PC's I/O ports.
Port 70h is used execute commands, define which data register or PC port, port 71h points to and read the status of the previous command.
Outputting a value of 30h to 3Fh to port 70h executes the corresponding enhanced Z80 instruction. The status of the command can be checked by a read to port 70h. In most cases a non-zero value indicates an error condition.
Outputting a value of 40h to 43h to port 70h defines which register port 71h points to. The registers are:
40h = DE register
41h = HL register
42h = BC register
43h = AF register
After outputting a value to port 70h the LSB of the register is available at port 71h, the value can be read or written. After accessing port 71h the MSB of the value will be available and can be read or written. After a second I/O to port 71h the LSB value will be available again. The data available at port 71h toggles between the LSB & MSB values of the defined register each time you access it. For example, to load a register HL with 3C00h you could use the following BASIC program:
10 OUT 112,65 : REM DEFINE HL
REGISTER, BASIC WANTS DECIMAL NUMBERS
20 OUT 113,0 : REM LOAD L WITH 00H
30 OUT 113,60 : REM LOAD H WITH 3CH
Reading the register is done the same way except using INP(113) instead. Once the registers required by the desired 30h to 3Fh command are loaded, an output of that command to port 70h is done. The returned data, if any, is then available in the same registers.
Outputting a value of 80h to 87h to port 70h defines which PC port, Z80 ports 50h to 57h point to. After outputting a value to port 70h the LSB of the PC port number is available at port 71h, the value can be read or written. The data available at port 71h toggles between the LSB & MSB values of the defined port each time you access it. For example, to point Z80 port 53h to the PC game port at 201h and then read port 201h you could use the following BASIC program:
10 OUT 112,131 : REM DEFINE PORT
53H, BASIC WANTS DECIMAL NUMBERS
20 OUT 113,1 : REM LOAD LSB WITH 01H
30 OUT 113,2 : REM LOAD MSB WITH 02H
40 A=INP(83) : REM READ Z80 PORT 53H WHICH
POINTS TO PC PORT 201H
50 PRINT A : REM A CONTAINS THE
JOYSTICK STATUS FROM PC PORT 201H
Some program listings of BASIC programs are available as examples of using the port mapped I/O commands:
Technical info - Keyboard maps:
The TRS-80 emulators support two keyboard maps. These files determine the relationship between the PC keyboard and the TRS-80 keyboard. Each key on the PC keyboard can be mapped to a key on the TRS-80 keyboard. More than one PC key can be mapped to the same TRS-80 key (ex. Backspace & left arrow are both mapped to left arrow on the TRS-80 keyboard).
Each keyboard map file contains 512 bytes which are organized in pairs. The first 128 byte pairs are unshifted keys the last 128 are the same keys shifted. The PC communicates with its keyboard using scancodes. Each PC key has a scancode and each scancode has a matching 2 byte value in the keyboard map. For example the 'ENTER' key has a scancode of 28, therefore the 2 keyboard map values at 2 times 28 plus 1 (57), contains the TRS-80 keyboard value for an unshifted 'ENTER' key. The map values 2 times 28 plus 257 (313), contains the TRS-80 keyboard value for a shifted 'ENTER' key.
Below is a graphic of a standard PC keyboard layout showing the scancodes for each key. All the scancodes shown correspond to a keyboard map entry. The PC key's table entry can be found by multiplying the scancode by 2 and adding 1 for unshifted values or adding 257 for shifted values.
Note: The scancodes for the cursor keys are not the actual scancodes but the scancode plus 32 because the actual scancodes are the same as for the number pad. The PC prefixes these keys with a special code. The emulator adds 32 to these prefixed scancodes so they can have their own keyboard map entries.
As said before each scancode points to a two byte pair. The second byte is the entry type, it has the following values:
0 | Unshifted TRS-80 key When this key is pushed a value corresponding to the first byte of this map entry will be stored in the TRS-80 keyboard memory matrix. |
1 | Shifted TRS-80 key When this key is pushed a value corresponding to the first byte of this map entry will be stored in the TRS-80 keyboard memory matrix. A shift will also be stored in the matrix. |
128 | No function Pushing this key does nothing in the emulator |
129 | Command function These keys execute emulator command functions like rebooting the emulator (F10). These map entries should not be modified. Incorect entries to this type of entry can result in emulator functions not working, emulator lockups and system crashes. |
130 | Shift Key Whenever this key is pushed and held the emulator will use the second half of the keyboard map. The first byte of this type of entry contains the type of shift key. For the Model 1 this value should always be 1. For the Model III, 4 & 4P a value of 1 means a left shift and a value of 2 means a right shift. |
The following table is to be used to find the first byte of the keyboard map value for entry type 0. The values in this table are in hex.
For example. If you look at the PC scancode graphic you will see that the 'ESC' key has a scan code of 1. If you look at the 3rd byte of the PC80, PC81 or PC83 keyboard map file you will see a value of 38 (26 hex). Looking at the able above shows a value of 26H represents the TRS-80 'BREAK' key. The 'BREAK' key is in row 6 column 2 for the TRS-80 keyboard matrix.
The 4th byte of the keyboard map file is a zero. This means the key is unshifted. If this value was 1 then anytime 'BREAK' was pushed the emulator would also push the TRS-80's shift key. This features allows keys that are not shifted on a PC keyboard to be shifted on the TRS-80 keyboard (like '=') or shifted keys to be unshifted (like "@").
The following table is to be used to find the first byte of the keyboard map value for entry type 1. The values in this table are in hex.
For example. If you look at the PC scancode graphic you will see that the '= +' key has a scan code of 13. If you look at the 27th byte of the PC80, PC81 or PC83 keyboard map file you will see a value of 85 (55 hex). Looking at the able above shows a value of 55H represents the TRS-80 '- =' key. The '- =' key is in row 5 column 5 for the TRS-80 keyboard matrix.
The 4th byte of the keyboard map file is a one. This means the key is shifted. When this key is pushed the TRS-80 will be sent the '- =' key along with a shift key.
Most of the PC keys mapped to the TRS-80 layout in the first half of the keyboard map will have an entry type of 0 since this section is used when neither of the PC shift keys are pushed. Most of the PC keys mapped to the TRS-80 layout in the second half of the keyboard map will have an entry type of 1 since this section is used when either of the PC shift keys are pushed. Also, in most cases the first byte of a key entry in the first half of the map will be the same as the one in the second part of the map since it is just the shifted value of the other. Some of the PC keys however will have very different values in each half of the map (like' = +') for example because of the differences between the PC and TRS-80 keyboard layouts.
I hope this documentation will give users the information needed to create custom keyboard layouts.
I want to thank Knut Roll-Lund (from Norway) for his help in documenting the keyboard map files. You can see how he made his own keyboard layout and download it at: http://home.online.no/~kr-lund/emul-kbd.htm
Technical Info - Emulator port/memory maps:
The Model 1 emulator memory map is as follows:
Memory range | Read | Write |
37E0 | Interrupt type (RTC or disk) | -unused- |
37E1 | -unused- | FDC select register |
37E8 & 37E9 | Read printer status | Output to printer |
37EC | FDC status register | FDC command register |
37ED | FDC track register | FDC track register |
37EE | FDC sector register | FDC sector register |
37EF | FDC data register | FDC data register |
The Model 1 emulator port map is as follows:
Port range | Read | Write |
FC, FD & FF | Cassette data | cassette data cassette motor control Video mode (64/16 or 32/16) |
FE | Cassette data | CPU speed control Bit0=0 & bit1=0 = 1.774mhz Bit0=1 & bit1=0 = 4mhz Bit0=1 & bit1=1 = 8mhz Bit0=0 & bit1=1 = 1mhz |
EB | RS-232 Receiver holding register | RS-232 Transmitter holding register |
EA | RS-232 UART status | RS-232 UART & modem control |
E9 | RS-232 Configuration sense switches | RS-232 Baud rate load |
E8 | RS-232 Modem status register | RS-232 Master reset |
CF | HDC Status Register | HDC Command Register |
CE | HDC Sector Size/Drive#/Head# Bits 0-2: Head Number (0-7) Bits 3-4: Drive Number (0-3) Bits 5-6: Sector Size (only 256 byte sectors supported) |
HDC Sector Size/Drive#/Head# |
CD | HDC Cylinder Number MSB (bits 0-1 only) | HDC Cylinder Number MSB (bits 0-1 only) |
CC | HDC Cylinder Number LSB | HDC Cylinder Number LSB |
CB | HDC Sector Number | HDC Sector Number |
CA | HDC Sector Count register (unsupported) | HDC Sector Count register (unsupported) |
C9 | HDC Error Status Register | HDC Write Precomp Cylinder |
C8 | HDC Data Port | HDC Data Port |
C1 | HDC Control Register Bit 3 : If set, enables controller Bit 4 : If set, resets controller |
HDC Control Register |
C0 | HDC Write Protect Port Bit 0 : INTRQ Bit 1 : HWPL (set if any drive WPed) Bit 4-7: Drive 3-0 WPed |
-unused- |
B9 | -unused- | Orchestra-85 left channel |
B5 | -unused- | Orchestra-85 right channel |
0B | VS-100 status bit 7 (set if not-busy) | VS-100 phoneme data |
The Model III/4 emulator supports the TRS-80 Model 4 port map as follows:
Port range | Read | Write |
FC-FF | mode output latch & 500/1500 baud cassette data | cassette data MicroLabs Model 3 Hi-Res graphics |
F8-FB | read printer status (also mapped at 37E8-37E9) | output to printer (also mapped at 37E8-37E9) |
F4-F7 | -unused- | drive select |
F3 | FDC data register | FDC data register |
F2 | FDC sector register | FDC sector register |
F1 | FDC track register | FDC track register |
F0 | FDC status register | FDC command register |
EC-EF | resets RTC interrupt | mode output latch |
EB | RS-232 Receiver holding register | RS-232 Transmitter holding register |
EA | RS-232 UART status | RS-232 UART & modem control |
E9 | RS-232 Current baud rate & UART configuration | RS-232 Baud rate load |
E8 | RS-232 Modem status register | RS-232 Master reset |
E4-E7 | read NMI status | write NMI mask register |
E0-E3 | read MI status | write MI mask register |
CF | HDC Status Register | HDC Command Register |
CE | HDC Sector Size/Drive#/Head# Bits 0-2: Head Number (0-7) Bits 3-4: Drive Number (0-3) Bits 5-6: Sector Size (only 256 byte sectors supported) |
HDC Sector Size/Drive#/Head# |
CD | HDC Cylinder Number MSB (bits 0-1 only) | HDC Cylinder Number MSB (bits 0-1 only) |
CC | HDC Cylinder Number LSB | HDC Cylinder Number LSB |
CB | HDC Sector Number | HDC Sector Number |
CA | HDC Sector Count register (unsupported) | HDC Sector Count register (unsupported) |
C9 | HDC Error Status Register | HDC Write Precomp Cylinder |
C8 | HDC Data Port | HDC Data Port |
C1 | HDC Control Register Bit 3 : If set, enables controller Bit 4 : If set, resets controller |
HDC Control Register |
C0 | HDC Write Protect Port Bit 0 : INTRQ Bit 1 : HWPL (set if any drive WPed) Bit 4-7: Drive 3-0 WPed |
-unused- |
9C-9F | -unused- | Model 4P boot ROM enable |
90-93 | -unused- | sound option |
8E | hi-res graphics - display mode register | display mode register |
8D | hi-res graphics - Y display offset | Y display offset |
8C | hi-res graphics - X display offset | X display offset |
84-87 | -unused- | options register |
83 | hi-res graphics - control register | control register |
82 | hi-res graphics - data port | data port |
81 | hi-res graphics - Y address | Y address |
80 | hi-res graphics - X address | X address |
79 | -unused- | Orchestra-90 left channel |
75 | -unused- | Orchestra-90 right channel |
0B | VS-100 status bit 7 (set if not-busy) | VS-100 phoneme data |
Special EC-EF: Bit 7 of port enhances the CPU fast bit 6. If bit 7 is set and bit 6 clear then speed is 1mhz. If bit 7 is set and bit 6 set then speed is 8mhz. If the user has selected turbo speed this port has no effect on speed. |
Both the Model 1 and Model III/4 emulators support a TRS-80 enhanced port map as follows:
Port range | Read | Write |
71 | I/O data register | I/O data register |
70 | I/O status register | I/O command register |
6F | -unused- | re-calibrate joystick |
6D | month in BCD format | joystick-keyboard map |
6C | day in BCD format | joystick-keyboard map |
6B | year in BCD format | joystick-keyboard map |
6A | hours in BCD format | joystick-keyboard map |
69 | minutes in BCD format | joystick-keyboard map |
68 | seconds in BCD format Reading this port loads the ports 67-6C with the PC's system date and time. |
joystick-keyboard map |
66 | -unused- | joystick-keyboard map |
65 | -unused- | joystick-keyboard map |
64 | Axis 2 Y coordinate of joystick | joystick-keyboard map |
63 | Axis 2 X coordinate of joystick | joystick-keyboard map |
62 | Axis 1 Y coordinate of joystick | joystick-keyboard map |
61 | Axis 1 X coordinate of joystick | joystick-keyboard map |
60 | buttons pushed and locked axis | map options and locked axis |
5F | get mouse sensitivity (0-15) | set mouse sensitivity (0-15) |
5E | -unused- | set mouse max Y coordinate |
5D | -unused- | set mouse max X coordinate |
5C | -unused- | set mouse min Y coordinate |
5B | -unused- | set mouse min X coordinate |
5A | get mouse current Y coordinate | set mouse current Y coordinate |
59 | get mouse current X coordinate | set mouse current X coordinate |
58 | get mouse buttons | set mouse buttons |
50-57 | input from PC I/O port (as defined by port 70 commands) |
output to PC I/O port (as defined by port 70 commands) |