Compare commits

...

27 Commits

Author SHA1 Message Date
Wayne Warthen
8f5cc510ee Missing Files 2023-06-16 15:18:49 -07:00
Wayne Warthen
0475f5e853 Minor Cleanup
- Update FPLED port values for some configs
- Fix Linux/MacOS build for new disk images
2023-06-16 14:56:20 -07:00
Wayne Warthen
5b7dee0689 Merge pull request #348 from rprouse/issue/347
Adds programming and games disk images
2023-06-16 13:37:25 -07:00
Rob Prouse
6532f61747 Remove DELBR.COM 2023-06-16 10:51:20 -04:00
Rob Prouse
4bdae4eccb Remove USQ.COM 2023-06-16 10:47:55 -04:00
Rob Prouse
efb9840b86 Remove MBASIC85 2023-06-16 08:57:19 -04:00
Wayne Warthen
308a11cb32 Merge pull request #350 from wwarthen/master
Update pull_request_template.md
2023-06-15 12:51:55 -07:00
Wayne Warthen
3a7421de33 Update pull_request_template.md 2023-06-15 12:50:51 -07:00
Wayne Warthen
21a58397b6 Merge pull request #349 from wwarthen/master
Create pull_request_template.md
2023-06-15 12:16:59 -07:00
Wayne Warthen
9ae61806dc Create pull_request_template.md 2023-06-15 12:15:37 -07:00
Rob Prouse
87ac6f07f8 Fix spelling mistake, Tory -> Tony 2023-06-15 13:37:17 -04:00
Rob Prouse
1cd5313259 Remove all HLP files that I added 2023-06-15 13:28:44 -04:00
Rob Prouse
04c1ff04ac Remove CPM2.HLP 2023-06-15 13:19:55 -04:00
Rob Prouse
0e1a0afa2c Replace HI-TECH C with latest version from https://github.com/agn453/HI-TECH-Z80-C 2023-06-15 13:16:52 -04:00
Rob Prouse
5227bb68b5 Added documentation for the new disk images 2023-06-14 14:10:15 -04:00
Rob Prouse
fb68941768 Adds programming and games disk images 2023-06-14 12:45:41 -04:00
Wayne Warthen
8747ec8d02 Clean-up of ATAPI Support
- Improved media handling and error reporting.
2023-06-13 17:02:13 -07:00
Wayne Warthen
abd939625f Support ATAPI in IDE and PPIDE Drivers
- Support is limited to 512 byte sectors.  So, devices such as ATAPI Zip Drives will work.  CD-ROM devices will not because they use a larger sector size.
2023-06-12 15:56:36 -07:00
Wayne Warthen
69716abb25 Regen Doc 2023-06-08 12:34:42 -07:00
Wayne Warthen
1f526d440a Add WDATE Command, Final PPA/IMM/SYQ Driver Cleanup
- Added WDATE command courtesy Kevin Boone.  See https://github.com/kevinboone/wdate-cpm for more information.
- Final cleanup of PPA/IMM/SYQ drivers including CPU speed compensated timeouts.
2023-06-08 11:59:07 -07:00
Wayne Warthen
84374c86e6 Cleanup and Optimizations for PPA/IMM/SYQ Drivers 2023-06-06 16:21:56 -07:00
Wayne Warthen
45ea46b105 Small Bug Fix for PPA/IMM/SYQ Drivers
Credit to Mark Elkin for testing and finding this issue.
2023-06-03 14:27:33 -07:00
Wayne Warthen
1333d6a491 Functional PPA Driver 2023-06-02 15:30:10 -07:00
Wayne Warthen
b7e865dbf1 Preliminary SyQuest Driver 2023-06-01 16:13:26 -07:00
Wayne Warthen
1c411f5552 Add IBM Standard Parallel Port Support to IMM Driver 2023-05-27 16:45:21 -07:00
Wayne Warthen
364e48a5d3 IMM Driver Cleanup, PPA Driver Skeleton
IMM Driver has rational timeouts now.  It also lights the MG014 LED during activity.
The PPA skeleton just attempts to determine if the PPA interface is present.  It does not attempt any I/O.
2023-05-26 16:48:13 -07:00
Wayne Warthen
63cb89dcfc Preliminary IMM Driver (Zip Drive)
Thanks to Alan Cox for inspiring this.  Much of the code was usurped from Fuzix.
2023-05-23 18:35:18 -07:00
253 changed files with 88411 additions and 442 deletions

11
.github/pull_request_template.md vendored Normal file
View File

@@ -0,0 +1,11 @@
<!--
BEFORE YOU CREATE A PULL REQUEST:
- Please base all pull requests against the dev branch
- Include a clear description of your change
- Reference related Issue(s) (e.g., "Resolves Issue #123")
Thank you for contributing to RomWBW! I will review your pull request as soon as possible.
DELETE EVERYTHING IN THIS COMMENT BLOCK AND REPLACE WITH YOUR COMMENTS
-->

Binary file not shown.

View File

@@ -7,6 +7,11 @@ Version 3.3
- WBW: Support per-drive floppy configuration
- WBW: Support for Bill Shen's VGARC
- WBW: Support for MG014 Parallel Port module + printer
- WBW: Support for EMM Zip Drive on PPI interface (much inspiration from Alan Cox)
- WBW: Support for PPA Zip Drive on PPI interface (much inspiration from Alan Cox)
- WBW: Support for SyQuest SparQ Drive on PPI interface (much inspiration from Alan Cox)
- WBW: Support for ATAPI Disk Drives (not CD-ROMs) on IDE and PPIDE interfaces
- R?P: Added new disk images: Aztec C, MS BASIC Compiler, MS Fortran, Games, HiTech-C, Turbo Pascal, SLR Z80ASM
Version 3.2.1
-------------

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -6,8 +6,8 @@
*** ***
***********************************************************************
This directory ("Doc") is part of the RomWBW System Software
distribution archive. It contains documentation for components of
This directory ("Doc") is part of the RomWBW System Software
distribution archive. It contains documentation for components of
the system.
ChangeLog.txt
@@ -34,9 +34,9 @@ ROM Applications documents.
CPM Manual ("CPM Manual.pdf")
-----------------------------
The original DRI CP/M 2.x Operating System Manual. This should be
considered the primary reference for system operation. The section
on CP/M 2 Alteration can be ignored since this work has already been
The original DRI CP/M 2.x Operating System Manual. This should be
considered the primary reference for system operation. The section
on CP/M 2 Alteration can be ignored since this work has already been
completed as part of the RomWBW distribution.
@@ -59,7 +59,7 @@ Manual for the DDTZ v2.7 debug tool included on the ROM drive.
FDisk Manual ("FDisk Manual.pdf")
---------------------------------
The operational manual for John Coffman's hard disk partitioning
The operational manual for John Coffman's hard disk partitioning
program. This program is included in RomWBW as FDISK80.
@@ -78,9 +78,9 @@ NZCOM operating system operation manual.
ZCPR Manual ("ZCPR Manual.pdf")
-------------------------------
ZCPR is the command proccessor portion of Z-System. This is the
manual for ZCPR 1.x as included in RomWBW. The installation
instructions can be ignored since that work has already been
ZCPR is the command proccessor portion of Z-System. This is the
manual for ZCPR 1.x as included in RomWBW. The installation
instructions can be ignored since that work has already been
completed as part of the RomWBW distribution.
ZCPR D&J Manual ("ZCPR-DJ.doc")
@@ -92,9 +92,9 @@ ZCPR D&J User Manual. This manual supplements the ZCPR Manual.
ZSDOS Manual ("ZSDOS Manual.pdf")
---------------------------------
ZSDOS is the DOS portion of Z-System. This is the manual for ZSDOS
1.x as included in RomWBW. The installation instructions can be
ignored since that work has already been completed as part of the
ZSDOS is the DOS portion of Z-System. This is the manual for ZSDOS
1.x as included in RomWBW. The installation instructions can be
ignored since that work has already been completed as part of the
RomWBW distribution.
Microsoft Basic-80 Reference Manual v5.0 (Microsoft Basic-80 Reference Manual v5.0.pdf)
@@ -110,7 +110,6 @@ QP/M 2.7 Features and Facilities ("qcp27.pdf")
Official documentation set for QP/M 2.7 from original QP/M distribution.
SIO+CTC Baud Rate Options (SIO+CTC Baud Rate Options.pdf)
---------------------------------------------------------
@@ -133,4 +132,37 @@ UCSD p-System Users Manual ("UCSD p-System Users Manual.pdf")
Official user manual for p-System operating system included with
RomWBW.
--WBW 5:18 PM 3/16/2023
Z80 Assembler User Manual (z80asm (SLR Systems).pdf)
----------------------------------------------------
Official user manual for the Z80 Macro Assembler by SLR Systems
included in the z80asm disk image.
HI-TECH C Compiler User Manual (HI-TECH Z80 C Compiler Manual.txt)
------------------------------------------------------------------
Official user manual for the HI-TECH C Compiler included in the
hitechc disk image.
Borland TurboPascal User Manual (Turbo_Pascal_Version_3.0_Reference_Manual_1986.pdf)
------------------------------------------------------------------------------------
Official user manual Borland TurboPascal included in the pascal disk image.
Aztec C Compiler User Manual (Aztec_C_1.06_User_Manual_Mar84.pdf)
-----------------------------------------------------------------
Official user manual for the Aztec C Compiler included in the aztecc disk image.
FORTRAN-80 User Manual (Microsoft_FORTRAN-80_Users_Manual_1977.pdf)
---------------------------------------------------------------
Official user manual for Microsoft's FORTRAN-80 compiler included in the fortran
disk image.
--WBW 5:18 PM 6/14/2023

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

View File

@@ -3,7 +3,7 @@
**RomWBW ReadMe** \
Version 3.3 \
Wayne Warthen ([wwarthen@gmail.com](mailto:wwarthen@gmail.com)) \
03 May 2023
06 Jun 2023
# Overview

View File

@@ -1,6 +1,6 @@
RomWBW ReadMe
Wayne Warthen (wwarthen@gmail.com)
03 May 2023
06 Jun 2023

View File

@@ -1918,9 +1918,9 @@ dev06 .db "SD",0
dev07 .db "PRPSD",0
dev08 .db "PPPSD",0
dev09 .db "HDSK",0
dev10 .equ devunk
dev11 .equ devunk
dev12 .equ devunk
dev10 .db "PPA",0
dev11 .db "IMM",0
dev12 .db "SYQ",0
dev13 .equ devunk
dev14 .equ devunk
dev15 .equ devunk

View File

@@ -2929,6 +2929,14 @@ DRV_INIT3:
RET
;
DRV_INIT3A:
; CHECK FOR HARD DISK REMOVABLE CARTRIDGE DRIVES
CP DIODEV_PPA ; PPA (ZIP DRIVE) IS REMOVABLE
JR Z,DRV_INIT3B ; IF SO, SKIP MEDIA CHECK
CP DIODEV_IMM ; IMM (ZIP DRIVE) IS REMOVABLE
JR Z,DRV_INIT3B ; IF SO, SKIP MEDIA CHECK
CP DIODEV_SYQ ; IMM (ZIP DRIVE) IS REMOVABLE
JR Z,DRV_INIT3B ; IF SO, SKIP MEDIA CHECK
; CHECK FOR ACTIVE AND RETURN IF NOT
PUSH DE ; SAVE DE (HARD DISK VOLUME COUNTER)
PUSH HL ; SAVE DRIVE LIST PTR
@@ -2944,6 +2952,7 @@ DRV_INIT3A:
RET NZ ; IF NO MEDIA, JUST RETURN
DRV_INIT3B:
; IF ACTIVE...
LD (HL),C ; SAVE UNIT NUM IN LIST
INC HL ; BUMP PTR
@@ -3392,9 +3401,9 @@ DEV06 .DB "SD$"
DEV07 .DB "PRPSD$"
DEV08 .DB "PPPSD$"
DEV09 .DB "HDSK$"
DEV10 .EQU DEVUNK
DEV11 .EQU DEVUNK
DEV12 .EQU DEVUNK
DEV10 .DB "PPA$"
DEV11 .DB "IMM$"
DEV12 .DB "SYQ$"
DEV13 .EQU DEVUNK
DEV14 .EQU DEVUNK
DEV15 .EQU DEVUNK

View File

@@ -181,6 +181,14 @@ dinit3:
ret
;
dinit3a:
; check for hard disk removable cartridge drives
cp 0A0h ; ppa (zip drive) is removable
jr z,dinit3b ; if so, skip media check
cp 0B0h ; imm (zip drive) is removable
jr z,dinit3b ; if so, skip media check
cp 0C0h ; syq (syquest drive) is removable
jr z,dinit3b ; if so, skip media check
; check for active and return if not
push de ; save de (hard disk volume counter)
push hl ; save drive list ptr
@@ -195,7 +203,8 @@ dinit3a:
pop de ; restore de
ret nz ; if no media, just return
dinit3b:
; if active...
ld (hl),c ; save unit num in list
inc hl ; bump ptr

View File

@@ -51,6 +51,7 @@ found:
| INTTEST | No | Yes | Yes |
| FAT | No | Yes | Yes |
| TUNE | No | Yes | Yes |
| WDATE | No | Yes | Yes |
`\clearpage`{=latex}
@@ -889,6 +890,28 @@ written in C and requires SDCC to compile. As such it is not part of
the RomWBW build process. However, the full project and source code is
found in the [FAT GitHub Repository](https://github.com/wwarthen/FAT).
## Known Issues
CP/M (and workalike) OSes have significant restrictions on filename
characters. The FAT application will block any attempt to create a
file on the CP/M filesystem containing any of these prohibited
characters:
| `< > . , ; : = ? * [ ] _ % | ( ) / \`
The operation will be aborted with "`Error: Invalid Path Name`" if such
a filename character is encountered.
Since MS-DOS does allow some of these characters, you can have
issues when copying files from MS-DOS to CP/M if the MS-DOS filenames
use these characters. Unfortunately, FAT is not yet smart enough to
substitute illegal characters with legal ones. So, you will need to
clean the filenames before trying to copy them to CP/M.
The FAT application does try to detect the scenario where you are
copying a file to itself. However, this detection is not perfect and
can corrupt a file if it occurs. Be careful to avoid this.
`\clearpage`{=latex}
# TUNE
@@ -1106,3 +1129,85 @@ can be used to reduce your processor speed.
VGMPLAY is still under development. The source code is provided in the
RomWBW distribution.
`\clearpage`{=latex}
# WDATE
`wdate` is a utility for CP/M systems that have Wayne Warthen's
ROMWBW firmware. It reads or sets the real-time clock, using function
calls in the BIOS. It should work on any RTC device that is supported by
ROMWBW, including the internal interrupt-driven timer that is is available
on some systems.
`wdate` differs from the `rtc.com` utility that is provided with the
ROMWBW version of CP/M in that it only gets and sets the date/time.
`rtc.com` can also manipulate the nonvolatile RAM in certain clock
devices, and modify the charge controller. However, `wdate` is (I would
argue) easier to use, as it takes its input from the command line, which
can be edited, and it's less fussy about the format. It doesn't require
the date to be set if you only want to change the time, for example.
In addition, `wdate` has at least some error checking.
`wdate` displays the day-of-week and month as English text, not
numbers. It calculates the day-of-week from the year, month, and day.
RTC chips usually store a day-of-week value, but it's useless in this
application for two reasons: first, the BIOS does not expose it. Second,
there is no universally-accepted way to interpret it (which day does
the week start on? Is '0' a valid day of the week?)
## Syntax
| `WDATE`
| `WDATE ` *`<hr> <min>`*
| `WDATE ` *`<hr> <min> <sec>`*
| `WDATE ` *`<year> <month> <day> <hr> <min> <sec>`*
## Usage
A> wdate
Saturday 27 May 13:14:39 2023
With no arguments, displays the current date and time.
A> wdate hr min
With two arguments, sets the time in hours and minutes, without changing date
or seconds
A> wdate hr min sec
With three arguments, sets the time in hours, minutes, and seconds, without
changing date
A> wdate year month day hr min sec
With six arguments, sets date and time. All numbers are one or two digits. The
two-digit year starts at 2000.
A> wdate /?
Show a summary of the command-line usage.
## Notes
I've tested this utility with the DS1302 clock board designed by Ed
Brindly, and on the interrupt-driven timer built into my Z180 board.
However, it does not interact with hardware, only BIOS; I would expect
it to work with other hardware.
wdate checks for the non-existence of ROMWBW, and also for failing
operations on the RTC. It will display the terse "No RTC" message in
both cases.
The ROMWBW functions that manipulate the date and time operate on BCD
numbers, as RTC chips themselves usually do. wdate works in decimal, so
that it can check that the user input makes sense. A substantial part of
the program's code is taken up by number format conversion and range
checking.
## Etymology
The `WDATE` application was written and contributed by Kevin Boone.
The source code is available on GitHub at
[https://github.com/kevinboone/wdate-cpm/blob/main/README.md](https://github.com/kevinboone/wdate-cpm/blob/main/README.md).

View File

@@ -3896,10 +3896,12 @@ may be discovered by RomWBW in your system.
| DSKY | System | Keypad & Display |
| DSRTC | RTC | Maxim DS1302 Real-Time Clock w/ NVRAM |
| DUART | Char | SCC2681 or compatible Dual UART |
| FD | Disk | 8272 of compatible Floppy Disk Controller |
| EMM | Disk | Disk drive on Parallel Port emm interface (Zip Drive) |
| FD | Disk | 8272 or compatible Floppy Disk Controller |
| GDC | Video | uPD7220 Video Display Controller |
| HDSK | Disk | SIMH Simulator Hard Disk |
| IDE | Disk | IDE/ATA Hard Disk Interface |
| IMM | Disk | IMM Zip Drive on PPI |
| INTRTC | RTC | Interrupt-based Real Time Clock |
| KBD | Kbd | 8242 PS/2 Keyboard Controller |
| KIO | System | Zilog Serial/ Parallel Counter/Timer |
@@ -3909,6 +3911,7 @@ may be discovered by RomWBW in your system.
| I2C | System | I2C Interface |
| PIO | Char | Zilog Parallel Interface Controller |
| PPIDE | Disk | 8255 IDE/ATA Hard Disk Interface |
| PPA | Disk | PPA Zip Drive on PPI |
| PPK | Kbd | Matrix Keyboard |
| PPPSD | Disk | ParPortProp SD Card Interface |
| PPPCON | Serial | ParPortProp Serial Console Interface |
@@ -3921,6 +3924,7 @@ may be discovered by RomWBW in your system.
| SIO | Char | Zilog Serial Port Interface |
| SN76489 | Sound | SN76489 Programmable Sound Generator |
| SPK | Sound | Bit-bang Speaker |
| SYQ | Disk | Iomega SparQ Drive on PPI |
| TMS | Video | TMS9918/38/58 Video Display Controller |
| UART | Char | 16C550 Family Serial Interface |
| USB-FIFO | Char | FT232H-based ECB USB FIFO |

View File

@@ -75,5 +75,6 @@ IDEENABLE .SET TRUE ; IDE: ENABLE IDE DISK DRIVER (IDE.ASM)
PPIDEENABLE .SET TRUE ; PPIDE: ENABLE PARALLEL PORT IDE DISK DRIVER (PPIDE.ASM)
SDENABLE .SET FALSE ; SD: ENABLE SD CARD DISK DRIVER (SD.ASM)
SDCNT .SET 1 ; SD: NUMBER OF SD CARD DEVICES (1-2), FOR DSD/SC/MT SC ONLY
IMMENABLE .SET FALSE ; IMM: ENABLE IMM DISK DRIVER (IMM.ASM)
;
PRPENABLE .SET FALSE ; PRP: ENABLE ECB PROPELLER IO BOARD DRIVER (PRP.ASM)

View File

@@ -72,5 +72,6 @@ IDEENABLE .SET TRUE ; IDE: ENABLE IDE DISK DRIVER (IDE.ASM)
PPIDEENABLE .SET TRUE ; PPIDE: ENABLE PARALLEL PORT IDE DISK DRIVER (PPIDE.ASM)
SDENABLE .SET FALSE ; SD: ENABLE SD CARD DISK DRIVER (SD.ASM)
SDCNT .SET 1 ; SD: NUMBER OF SD CARD DEVICES (1-2), FOR DSD/SC/MT SC ONLY
IMMENABLE .SET FALSE ; IMM: ENABLE IMM DISK DRIVER (IMM.ASM)
;
PRPENABLE .SET FALSE ; PRP: ENABLE ECB PROPELLER IO BOARD DRIVER (PRP.ASM)

View File

@@ -67,5 +67,6 @@ IDEENABLE .SET TRUE ; IDE: ENABLE IDE DISK DRIVER (IDE.ASM)
PPIDEENABLE .SET TRUE ; PPIDE: ENABLE PARALLEL PORT IDE DISK DRIVER (PPIDE.ASM)
SDENABLE .SET FALSE ; SD: ENABLE SD CARD DISK DRIVER (SD.ASM)
SDCNT .SET 1 ; SD: NUMBER OF SD CARD DEVICES (1-2), FOR DSD/SC/MT SC ONLY
IMMENABLE .SET FALSE ; IMM: ENABLE IMM DISK DRIVER (IMM.ASM)
;
PRPENABLE .SET FALSE ; PRP: ENABLE ECB PROPELLER IO BOARD DRIVER (PRP.ASM)

View File

@@ -61,5 +61,6 @@ PPIDEENABLE .SET TRUE ; PPIDE: ENABLE PARALLEL PORT IDE DISK DRIVER (PPIDE.ASM)
SDENABLE .SET FALSE ; SD: ENABLE SD CARD DISK DRIVER (SD.ASM)
SDMODE .SET SDMODE_PIO ; SD: DRIVER MODE: SDMODE_[JUHA|N8|CSIO|PPI|UART|DSD|MK4|SC|MT|PIO|USR]
SDCNT .SET 1 ; SD: NUMBER OF SD CARD DEVICES (1-2), FOR DSD/SC/MT SC ONLY
IMMENABLE .SET FALSE ; IMM: ENABLE IMM DISK DRIVER (IMM.ASM)
;
PRPENABLE .SET FALSE ; PRP: ENABLE ECB PROPELLER IO BOARD DRIVER (PRP.ASM)

View File

@@ -82,5 +82,6 @@ IDE0BASE .SET $90 ; IDE 0: IO BASE ADDRESS
PPIDEENABLE .SET TRUE ; PPIDE: ENABLE PARALLEL PORT IDE DISK DRIVER (PPIDE.ASM)
SDENABLE .SET FALSE ; SD: ENABLE SD CARD DISK DRIVER (SD.ASM)
SDCNT .SET 1 ; SD: NUMBER OF SD CARD DEVICES (1-2), FOR DSD/SC/MT SC ONLY
IMMENABLE .SET FALSE ; IMM: ENABLE IMM DISK DRIVER (IMM.ASM)
;
PRPENABLE .SET FALSE ; PRP: ENABLE ECB PROPELLER IO BOARD DRIVER (PRP.ASM)

View File

@@ -59,5 +59,6 @@ IDEENABLE .SET TRUE ; IDE: ENABLE IDE DISK DRIVER (IDE.ASM)
PPIDEENABLE .SET TRUE ; PPIDE: ENABLE PARALLEL PORT IDE DISK DRIVER (PPIDE.ASM)
SDENABLE .SET FALSE ; SD: ENABLE SD CARD DISK DRIVER (SD.ASM)
SDCNT .SET 1 ; SD: NUMBER OF SD CARD DEVICES (1-2), FOR DSD/SC/MT SC ONLY
IMMENABLE .SET FALSE ; IMM: ENABLE IMM DISK DRIVER (IMM.ASM)
;
PRPENABLE .SET FALSE ; PRP: ENABLE ECB PROPELLER IO BOARD DRIVER (PRP.ASM)

View File

@@ -63,5 +63,6 @@ IDEENABLE .SET TRUE ; IDE: ENABLE IDE DISK DRIVER (IDE.ASM)
PPIDEENABLE .SET TRUE ; PPIDE: ENABLE PARALLEL PORT IDE DISK DRIVER (PPIDE.ASM)
SDENABLE .SET FALSE ; SD: ENABLE SD CARD DISK DRIVER (SD.ASM)
SDCNT .SET 1 ; SD: NUMBER OF SD CARD DEVICES (1-2), FOR DSD/SC/MT SC ONLY
IMMENABLE .SET FALSE ; IMM: ENABLE IMM DISK DRIVER (IMM.ASM)
;
PRPENABLE .SET FALSE ; PRP: ENABLE ECB PROPELLER IO BOARD DRIVER (PRP.ASM)

View File

@@ -34,8 +34,10 @@ Z180_CLKDIV .SET 1 ; Z180: CHK DIV: 0=OSC/2, 1=OSC, 2=OSC*2
Z180_MEMWAIT .SET 0 ; Z180: MEMORY WAIT STATES (0-3)
Z180_IOWAIT .SET 1 ; Z180: I/O WAIT STATES TO ADD ABOVE 1 W/S BUILT-IN (0-3)
;
FPLED_ENABLE .SET FALSE ; FP: ENABLES FRONT PANEL LEDS
FPSW_ENABLE .SET FALSE ; FP: ENABLES FRONT PANEL SWITCHES
FPLED_ENABLE .SET TRUE ; FP: ENABLES FRONT PANEL LEDS
FPLED_IO .SET $A0 ; FP: PORT ADDRESS FOR FP LEDS
FPSW_ENABLE .SET TRUE ; FP: ENABLES FRONT PANEL SWITCHES
FPSW_IO .SET $A0 ; FP: PORT ADDRESS FOR FP SWITCHES
;
LEDENABLE .SET TRUE ; ENABLE STATUS LED (SINGLE LED)
;

View File

@@ -35,7 +35,9 @@ Z180_MEMWAIT .SET 0 ; Z180: MEMORY WAIT STATES (0-3)
Z180_IOWAIT .SET 1 ; Z180: I/O WAIT STATES TO ADD ABOVE 1 W/S BUILT-IN (0-3)
;
FPLED_ENABLE .SET TRUE ; FP: ENABLES FRONT PANEL LEDS
FPLED_IO .SET $A0 ; FP: PORT ADDRESS FOR FP LEDS
FPSW_ENABLE .SET TRUE ; FP: ENABLES FRONT PANEL SWITCHES
FPSW_IO .SET $A0 ; FP: PORT ADDRESS FOR FP SWITCHES
;
LEDENABLE .SET TRUE ; ENABLE STATUS LED (SINGLE LED)
;

View File

@@ -252,6 +252,12 @@ PIO1BASE .EQU $BC ; PIO 1: REGISTERS BASE ADR
;
LPTENABLE .EQU FALSE ; LPT: ENABLE CENTRONICS PRINTER DRIVER (LPT.ASM)
;
PPAENABLE .EQU FALSE ; PPA: ENABLE PPA DISK DRIVER (PPA.ASM)
;
IMMENABLE .EQU FALSE ; IMM: ENABLE IMM DISK DRIVER (IMM.ASM)
;
SYQENABLE .EQU FALSE ; SYQ: ENABLE IMM DISK DRIVER (SYQ.ASM)
;
PIO_4P .EQU FALSE ; PIO: ENABLE PARALLEL PORT DRIVER FOR ECB 4P BOARD
PIO_ZP .EQU FALSE ; PIO: ENABLE PARALLEL PORT DRIVER FOR ECB ZILOG PERIPHERALS BOARD (PIO.ASM)
PIO_SBC .EQU FALSE ; PIO: ENABLE PARALLEL PORT DRIVER FOR 8255 CHIP

View File

@@ -311,12 +311,33 @@ PIO0BASE .EQU $B8 ; PIO 0: REGISTERS BASE ADR
PIO1BASE .EQU $BC ; PIO 1: REGISTERS BASE ADR
;
LPTENABLE .EQU FALSE ; LPT: ENABLE CENTRONICS PRINTER DRIVER (LPT.ASM)
LPTMODE .EQU LPTMODE_NONE ; LPT: DRIVER MODE: LPTMODE_[NONE|IBM|MG014]
LPTMODE .EQU LPTMODE_NONE ; LPT: DRIVER MODE: LPTMODE_[NONE|SPP|MG014]
LPTCNT .EQU 1 ; LPT: NUMBER OF CHIPS TO DETECT (1-2)
LPTTRACE .EQU 1 ; LPT: TRACE LEVEL (0=NO,1=ERRORS,2=ALL)
LPT0BASE .EQU $E8 ; LPT 0: REGISTERS BASE ADR
LPT1BASE .EQU $EC ; LPT 1: REGISTERS BASE ADR
;
PPAENABLE .EQU FALSE ; PPA: ENABLE PPA DISK DRIVER (PPA.ASM)
PPACNT .EQU 1 ; PPA: NUMBER OF PPA DEVICES (1-2)
PPATRACE .EQU 1 ; PPA: TRACE LEVEL (0=NO,1=ERRORS,2=ALL)
PPAMODE .EQU PPAMODE_SPP ; PPA: DRIVER MODE: PPAMODE_[NONE|SPP|MG014]
PPA0BASE .EQU LPT0BASE ; PPA 0: BASE I/O ADDRESS OF PPI FOR PPA
PPA1BASE .EQU LPT1BASE ; PPA 1: BASE I/O ADDRESS OF PPI FOR PPA
;
IMMENABLE .EQU FALSE ; IMM: ENABLE IMM DISK DRIVER (IMM.ASM)
IMMCNT .EQU 1 ; IMM: NUMBER OF IMM DEVICES (1-2)
IMMTRACE .EQU 1 ; IMM: TRACE LEVEL (0=NO,1=ERRORS,2=ALL)
IMMMODE .EQU IMMMODE_SPP ; IMM: DRIVER MODE: IMMMODE_[NONE|SPP|MG014]
IMM0BASE .EQU LPT0BASE ; IMM 0: BASE I/O ADDRESS OF PPI FOR IMM
IMM1BASE .EQU LPT1BASE ; IMM 1: BASE I/O ADDRESS OF PPI FOR IMM
;
SYQENABLE .EQU FALSE ; SYQ: ENABLE IMM DISK DRIVER (SYQ.ASM)
SYQCNT .EQU 1 ; SYQ: NUMBER OF SYQ DEVICES (1-2)
SYQTRACE .EQU 1 ; SYQ: TRACE LEVEL (0=NO,1=ERRORS,2=ALL)
SYQMODE .EQU IMMMODE_SPP ; SYQ: DRIVER MODE: SYQMODE_[NONE|SPP|MG014]
SYQ0BASE .EQU LPT0BASE ; SYQ 0: BASE I/O ADDRESS OF PPI FOR SYQ
SYQ1BASE .EQU LPT1BASE ; SYQ 1: BASE I/O ADDRESS OF PPI FOR SYQ
;
PIO_4P .EQU FALSE ; PIO: ENABLE PARALLEL PORT DRIVER FOR ECB 4P BOARD
PIO4BASE .EQU $90 ; PIO: PIO REGISTERS BASE ADR FOR ECB 4P BOARD
PIO_ZP .EQU FALSE ; PIO: ENABLE PARALLEL PORT DRIVER FOR ECB ZILOG PERIPHERALS BOARD (PIO.ASM)

View File

@@ -235,12 +235,33 @@ PIO0BASE .EQU $B8 ; PIO 0: REGISTERS BASE ADR
PIO1BASE .EQU $BC ; PIO 1: REGISTERS BASE ADR
;
LPTENABLE .EQU FALSE ; LPT: ENABLE CENTRONICS PRINTER DRIVER (LPT.ASM)
LPTMODE .EQU LPTMODE_IBM ; LPT: DRIVER MODE: LPTMODE_[NONE|IBM|MG014]
LPTMODE .EQU LPTMODE_SPP ; LPT: DRIVER MODE: LPTMODE_[NONE|SPP|MG014]
LPTCNT .EQU 1 ; LPT: NUMBER OF CHIPS TO DETECT (1-2)
LPTTRACE .EQU 1 ; LPT: TRACE LEVEL (0=NO,1=ERRORS,2=ALL)
LPT0BASE .EQU $E8 ; LPT 0: REGISTERS BASE ADR
LPT1BASE .EQU $EC ; LPT 1: REGISTERS BASE ADR
;
PPAENABLE .EQU FALSE ; PPA: ENABLE PPA DISK DRIVER (PPA.ASM)
PPACNT .EQU 1 ; PPA: NUMBER OF PPA DEVICES (1-2)
PPATRACE .EQU 1 ; PPA: TRACE LEVEL (0=NO,1=ERRORS,2=ALL)
PPAMODE .EQU PPAMODE_SPP ; PPA: DRIVER MODE: PPAMODE_[NONE|MG014]
PPA0BASE .EQU LPT0BASE ; PPA 0: BASE I/O ADDRESS OF PPI FOR PPA
PPA1BASE .EQU LPT1BASE ; PPA 1: BASE I/O ADDRESS OF PPI FOR PPA
;
IMMENABLE .EQU FALSE ; IMM: ENABLE IMM DISK DRIVER (IMM.ASM)
IMMCNT .EQU 1 ; IMM: NUMBER OF IMM DEVICES (1-2)
IMMTRACE .EQU 1 ; IMM: TRACE LEVEL (0=NO,1=ERRORS,2=ALL)
IMMMODE .EQU IMMMODE_SPP ; IMM: DRIVER MODE: IMMMODE_[NONE|SPP|MG014]
IMM0BASE .EQU LPT0BASE ; IMM 0: BASE I/O ADDRESS OF PPI FOR IMM
IMM1BASE .EQU LPT1BASE ; IMM 1: BASE I/O ADDRESS OF PPI FOR IMM
;
SYQENABLE .EQU FALSE ; SYQ: ENABLE IMM DISK DRIVER (SYQ.ASM)
SYQCNT .EQU 1 ; SYQ: NUMBER OF SYQ DEVICES (1-2)
SYQTRACE .EQU 1 ; SYQ: TRACE LEVEL (0=NO,1=ERRORS,2=ALL)
SYQMODE .EQU IMMMODE_SPP ; SYQ: DRIVER MODE: SYQMODE_[NONE|SPP|MG014]
SYQ0BASE .EQU LPT0BASE ; SYQ 0: BASE I/O ADDRESS OF PPI FOR SYQ
SYQ1BASE .EQU LPT1BASE ; SYQ 1: BASE I/O ADDRESS OF PPI FOR SYQ
;
PIO_4P .EQU FALSE ; PIO: ENABLE PARALLEL PORT DRIVER FOR ECB 4P BOARD
PIO4BASE .EQU $90 ; PIO: PIO REGISTERS BASE ADR FOR ECB 4P BOARD
PIO_ZP .EQU FALSE ; PIO: ENABLE PARALLEL PORT DRIVER FOR ECB ZILOG PERIPHERALS BOARD (PIO.ASM)

View File

@@ -248,12 +248,18 @@ PIO0BASE .EQU $B8 ; PIO 0: REGISTERS BASE ADR
PIO1BASE .EQU $BC ; PIO 1: REGISTERS BASE ADR
;
LPTENABLE .EQU FALSE ; LPT: ENABLE CENTRONICS PRINTER DRIVER (LPT.ASM)
LPTMODE .EQU LPTMODE_NONE ; LPT: DRIVER MODE: LPTMODE_[NONE|IBM|MG014]
LPTMODE .EQU LPTMODE_NONE ; LPT: DRIVER MODE: LPTMODE_[NONE|SPP|MG014]
LPTCNT .EQU 1 ; LPT: NUMBER OF CHIPS TO DETECT (1-2)
LPTTRACE .EQU 1 ; LPT: TRACE LEVEL (0=NO,1=ERRORS,2=ALL)
LPT0BASE .EQU $E8 ; LPT 0: REGISTERS BASE ADR
LPT1BASE .EQU $EC ; LPT 1: REGISTERS BASE ADR
;
PPAENABLE .EQU FALSE ; PPA: ENABLE PPA DISK DRIVER (PPA.ASM)
;
IMMENABLE .EQU FALSE ; IMM: ENABLE IMM DISK DRIVER (IMM.ASM)
;
SYQENABLE .EQU FALSE ; SYQ: ENABLE IMM DISK DRIVER (SYQ.ASM)
;
PIO_4P .EQU FALSE ; PIO: ENABLE PARALLEL PORT DRIVER FOR ECB 4P BOARD
PIO4BASE .EQU $90 ; PIO: PIO REGISTERS BASE ADR FOR ECB 4P BOARD
PIO_ZP .EQU FALSE ; PIO: ENABLE PARALLEL PORT DRIVER FOR ECB ZILOG PERIPHERALS BOARD (PIO.ASM)

View File

@@ -247,6 +247,12 @@ PIO1BASE .EQU $BC ; PIO 1: REGISTERS BASE ADR
;
LPTENABLE .EQU FALSE ; LPT: ENABLE CENTRONICS PRINTER DRIVER (LPT.ASM)
;
PPAENABLE .EQU FALSE ; PPA: ENABLE PPA DISK DRIVER (PPA.ASM)
;
IMMENABLE .EQU FALSE ; IMM: ENABLE IMM DISK DRIVER (IMM.ASM)
;
SYQENABLE .EQU FALSE ; SYQ: ENABLE IMM DISK DRIVER (SYQ.ASM)
;
PIO_4P .EQU FALSE ; PIO: ENABLE PARALLEL PORT DRIVER FOR ECB 4P BOARD
PIO4BASE .EQU $90 ; PIO: PIO REGISTERS BASE ADR FOR ECB 4P BOARD
PIO_ZP .EQU FALSE ; PIO: ENABLE PARALLEL PORT DRIVER FOR ECB ZILOG PERIPHERALS BOARD (PIO.ASM)

View File

@@ -257,12 +257,33 @@ PIO0BASE .EQU $B8 ; PIO 0: REGISTERS BASE ADR
PIO1BASE .EQU $BC ; PIO 1: REGISTERS BASE ADR
;
LPTENABLE .EQU FALSE ; LPT: ENABLE CENTRONICS PRINTER DRIVER (LPT.ASM)
LPTMODE .EQU LPTMODE_MG014 ; LPT: DRIVER MODE: LPTMODE_[NONE|IBM|MG014]
LPTMODE .EQU LPTMODE_MG014 ; LPT: DRIVER MODE: LPTMODE_[NONE|SPP|MG014]
LPTCNT .EQU 1 ; LPT: NUMBER OF CHIPS TO DETECT (1-2)
LPTTRACE .EQU 1 ; LPT: TRACE LEVEL (0=NO,1=ERRORS,2=ALL)
LPT0BASE .EQU $18 ; LPT 0: REGISTERS BASE ADR
LPT0BASE .EQU $0C ; LPT 0: REGISTERS BASE ADR
LPT1BASE .EQU $00 ; LPT 1: REGISTERS BASE ADR
;
PPAENABLE .EQU FALSE ; PPA: ENABLE PPA DISK DRIVER (PPA.ASM)
PPACNT .EQU 1 ; PPA: NUMBER OF PPA DEVICES (1-2)
PPATRACE .EQU 1 ; PPA: TRACE LEVEL (0=NO,1=ERRORS,2=ALL)
PPAMODE .EQU PPAMODE_MG014 ; PPA: DRIVER MODE: PPAMODE_[NONE|SPP|MG014]
PPA0BASE .EQU LPT0BASE ; PPA 0: BASE I/O ADDRESS OF PPI FOR PPA
PPA1BASE .EQU LPT1BASE ; PPA 1: BASE I/O ADDRESS OF PPI FOR PPA
;
IMMENABLE .EQU FALSE ; IMM: ENABLE IMM DISK DRIVER (IMM.ASM)
IMMCNT .EQU 1 ; IMM: NUMBER OF IMM DEVICES (1-2)
IMMTRACE .EQU 1 ; IMM: TRACE LEVEL (0=NO,1=ERRORS,2=ALL)
IMMMODE .EQU IMMMODE_MG014 ; IMM: DRIVER MODE: IMMMODE_[NONE|SPP|MG014]
IMM0BASE .EQU LPT0BASE ; IMM 0: BASE I/O ADDRESS OF PPI FOR IMM
IMM1BASE .EQU LPT1BASE ; IMM 1: BASE I/O ADDRESS OF PPI FOR IMM
;
SYQENABLE .EQU FALSE ; SYQ: ENABLE IMM DISK DRIVER (SYQ.ASM)
SYQCNT .EQU 1 ; SYQ: NUMBER OF SYQ DEVICES (1-2)
SYQTRACE .EQU 1 ; SYQ: TRACE LEVEL (0=NO,1=ERRORS,2=ALL)
SYQMODE .EQU IMMMODE_MG014 ; SYQ: DRIVER MODE: SYQMODE_[NONE|SPP|MG014]
SYQ0BASE .EQU LPT0BASE ; SYQ 0: BASE I/O ADDRESS OF PPI FOR SYQ
SYQ1BASE .EQU LPT1BASE ; SYQ 1: BASE I/O ADDRESS OF PPI FOR SYQ
;
PIO_4P .EQU FALSE ; PIO: ENABLE PARALLEL PORT DRIVER FOR ECB 4P BOARD
PIO_ZP .EQU FALSE ; PIO: ENABLE PARALLEL PORT DRIVER FOR ECB ZILOG PERIPHERALS BOARD (PIO.ASM)
PIO_SBC .EQU FALSE ; PIO: ENABLE PARALLEL PORT DRIVER FOR 8255 CHIP

View File

@@ -261,12 +261,33 @@ PIO0BASE .EQU $B8 ; PIO 0: REGISTERS BASE ADR
PIO1BASE .EQU $BC ; PIO 1: REGISTERS BASE ADR
;
LPTENABLE .EQU FALSE ; LPT: ENABLE CENTRONICS PRINTER DRIVER (LPT.ASM)
LPTMODE .EQU LPTMODE_MG014 ; LPT: DRIVER MODE: LPTMODE_[NONE|IBM|MG014]
LPTMODE .EQU LPTMODE_MG014 ; LPT: DRIVER MODE: LPTMODE_[NONE|SPP|MG014]
LPTCNT .EQU 1 ; LPT: NUMBER OF CHIPS TO DETECT (1-2)
LPTTRACE .EQU 1 ; LPT: TRACE LEVEL (0=NO,1=ERRORS,2=ALL)
LPT0BASE .EQU $18 ; LPT 0: REGISTERS BASE ADR
LPT0BASE .EQU $0C ; LPT 0: REGISTERS BASE ADR
LPT1BASE .EQU $00 ; LPT 1: REGISTERS BASE ADR
;
PPAENABLE .EQU FALSE ; PPA: ENABLE PPA DISK DRIVER (PPA.ASM)
PPACNT .EQU 1 ; PPA: NUMBER OF PPA DEVICES (1-2)
PPATRACE .EQU 1 ; PPA: TRACE LEVEL (0=NO,1=ERRORS,2=ALL)
PPAMODE .EQU PPAMODE_MG014 ; PPA: DRIVER MODE: PPAMODE_[NONE|SPP|MG014]
PPA0BASE .EQU LPT0BASE ; PPA 0: BASE I/O ADDRESS OF PPI FOR PPA
PPA1BASE .EQU LPT1BASE ; PPA 1: BASE I/O ADDRESS OF PPI FOR PPA
;
IMMENABLE .EQU FALSE ; IMM: ENABLE IMM DISK DRIVER (IMM.ASM)
IMMCNT .EQU 1 ; IMM: NUMBER OF IMM DEVICES (1-2)
IMMTRACE .EQU 1 ; IMM: TRACE LEVEL (0=NO,1=ERRORS,2=ALL)
IMMMODE .EQU IMMMODE_MG014 ; IMM: DRIVER MODE: IMMMODE_[NONE|SPP|MG014]
IMM0BASE .EQU LPT0BASE ; IMM 0: BASE I/O ADDRESS OF PPI FOR IMM
IMM1BASE .EQU LPT1BASE ; IMM 1: BASE I/O ADDRESS OF PPI FOR IMM
;
SYQENABLE .EQU FALSE ; SYQ: ENABLE IMM DISK DRIVER (SYQ.ASM)
SYQCNT .EQU 1 ; SYQ: NUMBER OF SYQ DEVICES (1-2)
SYQTRACE .EQU 1 ; SYQ: TRACE LEVEL (0=NO,1=ERRORS,2=ALL)
SYQMODE .EQU IMMMODE_MG014 ; SYQ: DRIVER MODE: SYQMODE_[NONE|SPP|MG014]
SYQ0BASE .EQU LPT0BASE ; SYQ 0: BASE I/O ADDRESS OF PPI FOR SYQ
SYQ1BASE .EQU LPT1BASE ; SYQ 1: BASE I/O ADDRESS OF PPI FOR SYQ
;
PIO_4P .EQU FALSE ; PIO: ENABLE PARALLEL PORT DRIVER FOR ECB 4P BOARD
PIO_ZP .EQU FALSE ; PIO: ENABLE PARALLEL PORT DRIVER FOR ECB ZILOG PERIPHERALS BOARD (PIO.ASM)
PIO_SBC .EQU FALSE ; PIO: ENABLE PARALLEL PORT DRIVER FOR 8255 CHIP

View File

@@ -255,12 +255,33 @@ PIO0BASE .EQU $B8 ; PIO 0: REGISTERS BASE ADR
PIO1BASE .EQU $BC ; PIO 1: REGISTERS BASE ADR
;
LPTENABLE .EQU FALSE ; LPT: ENABLE CENTRONICS PRINTER DRIVER (LPT.ASM)
LPTMODE .EQU LPTMODE_MG014 ; LPT: DRIVER MODE: LPTMODE_[NONE|IBM|MG014]
LPTMODE .EQU LPTMODE_MG014 ; LPT: DRIVER MODE: LPTMODE_[NONE|SPP|MG014]
LPTCNT .EQU 1 ; LPT: NUMBER OF CHIPS TO DETECT (1-2)
LPTTRACE .EQU 1 ; LPT: TRACE LEVEL (0=NO,1=ERRORS,2=ALL)
LPT0BASE .EQU $18 ; LPT 0: REGISTERS BASE ADR
LPT0BASE .EQU $0C ; LPT 0: REGISTERS BASE ADR
LPT1BASE .EQU $00 ; LPT 1: REGISTERS BASE ADR
;
PPAENABLE .EQU FALSE ; PPA: ENABLE PPA DISK DRIVER (PPA.ASM)
PPACNT .EQU 1 ; PPA: NUMBER OF PPA DEVICES (1-2)
PPATRACE .EQU 1 ; PPA: TRACE LEVEL (0=NO,1=ERRORS,2=ALL)
PPAMODE .EQU PPAMODE_MG014 ; PPA: DRIVER MODE: PPAMODE_[NONE|SPP|MG014]
PPA0BASE .EQU LPT0BASE ; PPA 0: BASE I/O ADDRESS OF PPI FOR PPA
PPA1BASE .EQU LPT1BASE ; PPA 1: BASE I/O ADDRESS OF PPI FOR PPA
;
IMMENABLE .EQU FALSE ; IMM: ENABLE IMM DISK DRIVER (IMM.ASM)
IMMCNT .EQU 1 ; IMM: NUMBER OF IMM DEVICES (1-2)
IMMTRACE .EQU 1 ; IMM: TRACE LEVEL (0=NO,1=ERRORS,2=ALL)
IMMMODE .EQU IMMMODE_MG014 ; IMM: DRIVER MODE: IMMMODE_[NONE|SPP|MG014]
IMM0BASE .EQU LPT0BASE ; IMM 0: BASE I/O ADDRESS OF PPI FOR IMM
IMM1BASE .EQU LPT1BASE ; IMM 1: BASE I/O ADDRESS OF PPI FOR IMM
;
SYQENABLE .EQU FALSE ; SYQ: ENABLE IMM DISK DRIVER (SYQ.ASM)
SYQCNT .EQU 1 ; SYQ: NUMBER OF SYQ DEVICES (1-2)
SYQTRACE .EQU 1 ; SYQ: TRACE LEVEL (0=NO,1=ERRORS,2=ALL)
SYQMODE .EQU IMMMODE_MG014 ; SYQ: DRIVER MODE: SYQMODE_[NONE|SPP|MG014]
SYQ0BASE .EQU LPT0BASE ; SYQ 0: BASE I/O ADDRESS OF PPI FOR SYQ
SYQ1BASE .EQU LPT1BASE ; SYQ 1: BASE I/O ADDRESS OF PPI FOR SYQ
;
PIO_4P .EQU FALSE ; PIO: ENABLE PARALLEL PORT DRIVER FOR ECB 4P BOARD
PIO_ZP .EQU FALSE ; PIO: ENABLE PARALLEL PORT DRIVER FOR ECB ZILOG PERIPHERALS BOARD (PIO.ASM)
PIO_SBC .EQU FALSE ; PIO: ENABLE PARALLEL PORT DRIVER FOR 8255 CHIP

View File

@@ -236,6 +236,12 @@ PIO1BASE .EQU $BC ; PIO 1: REGISTERS BASE ADR
;
LPTENABLE .EQU FALSE ; LPT: ENABLE CENTRONICS PRINTER DRIVER (LPT.ASM)
;
PPAENABLE .EQU FALSE ; PPA: ENABLE PPA DISK DRIVER (PPA.ASM)
;
IMMENABLE .EQU FALSE ; IMM: ENABLE IMM DISK DRIVER (IMM.ASM)
;
SYQENABLE .EQU FALSE ; SYQ: ENABLE IMM DISK DRIVER (SYQ.ASM)
;
PIO_4P .EQU FALSE ; PIO: ENABLE PARALLEL PORT DRIVER FOR ECB 4P BOARD
PIO4BASE .EQU $90 ; PIO: PIO REGISTERS BASE ADR FOR ECB 4P BOARD
PIO_ZP .EQU FALSE ; PIO: ENABLE PARALLEL PORT DRIVER FOR ECB ZILOG PERIPHERALS BOARD (PIO.ASM)

View File

@@ -234,11 +234,12 @@ PIO0BASE .EQU $B8 ; PIO 0: REGISTERS BASE ADR
PIO1BASE .EQU $BC ; PIO 1: REGISTERS BASE ADR
;
LPTENABLE .EQU FALSE ; LPT: ENABLE CENTRONICS PRINTER DRIVER (LPT.ASM)
LPTMODE .EQU LPTMODE_NONE ; LPT: DRIVER MODE: LPTMODE_[NONE|IBM|MG014]
LPTCNT .EQU 1 ; LPT: NUMBER OF CHIPS TO DETECT (1-2)
LPTTRACE .EQU 1 ; LPT: TRACE LEVEL (0=NO,1=ERRORS,2=ALL)
LPT0BASE .EQU $E8 ; LPT 0: REGISTERS BASE ADR
LPT1BASE .EQU $EC ; LPT 1: REGISTERS BASE ADR
;
PPAENABLE .EQU FALSE ; PPA: ENABLE PPA DISK DRIVER (PPA.ASM)
;
IMMENABLE .EQU FALSE ; IMM: ENABLE IMM DISK DRIVER (IMM.ASM)
;
SYQENABLE .EQU FALSE ; SYQ: ENABLE IMM DISK DRIVER (SYQ.ASM)
;
PIO_4P .EQU FALSE ; PIO: ENABLE PARALLEL PORT DRIVER FOR ECB 4P BOARD
PIO4BASE .EQU $90 ; PIO: PIO REGISTERS BASE ADR FOR ECB 4P BOARD

View File

@@ -67,7 +67,7 @@ SKZENABLE .EQU FALSE ; ENABLE SERGEY'S Z80-512K FEATURES
WDOGMODE .EQU WDOG_NONE ; WATCHDOG MODE: WDOG_[NONE|EZZ80|SKZ]
;
FPLED_ENABLE .EQU TRUE ; FP: ENABLES FRONT PANEL LEDS
FPLED_IO .EQU $0D ; FP: PORT ADDRESS FOR FP LEDS
FPLED_IO .EQU $00 ; FP: PORT ADDRESS FOR FP LEDS
FPLED_DSKACT .EQU TRUE ; FP: ENABLES DISK I/O ACTIVITY ON FP LEDS
FPSW_ENABLE .EQU FALSE ; FP: ENABLES FRONT PANEL SWITCHES
FPSW_IO .EQU $00 ; FP: PORT ADDRESS FOR FP SWITCHES
@@ -251,12 +251,33 @@ PIO0BASE .EQU $B8 ; PIO 0: REGISTERS BASE ADR
PIO1BASE .EQU $BC ; PIO 1: REGISTERS BASE ADR
;
LPTENABLE .EQU FALSE ; LPT: ENABLE CENTRONICS PRINTER DRIVER (LPT.ASM)
LPTMODE .EQU LPTMODE_MG014 ; LPT: DRIVER MODE: LPTMODE_[NONE|IBM|MG014]
LPTMODE .EQU LPTMODE_MG014 ; LPT: DRIVER MODE: LPTMODE_[NONE|SPP|MG014]
LPTCNT .EQU 1 ; LPT: NUMBER OF CHIPS TO DETECT (1-2)
LPTTRACE .EQU 1 ; LPT: TRACE LEVEL (0=NO,1=ERRORS,2=ALL)
LPT0BASE .EQU $18 ; LPT 0: REGISTERS BASE ADR
LPT1BASE .EQU $00 ; LPT 1: REGISTERS BASE ADR
;
PPAENABLE .EQU FALSE ; PPA: ENABLE PPA DISK DRIVER (PPA.ASM)
PPACNT .EQU 1 ; PPA: NUMBER OF PPA DEVICES (1-2)
PPATRACE .EQU 1 ; PPA: TRACE LEVEL (0=NO,1=ERRORS,2=ALL)
PPAMODE .EQU PPAMODE_MG014 ; PPA: DRIVER MODE: PPAMODE_[NONE|SPP|MG014]
PPA0BASE .EQU LPT0BASE ; PPA 0: BASE I/O ADDRESS OF PPI FOR PPA
PPA1BASE .EQU LPT1BASE ; PPA 1: BASE I/O ADDRESS OF PPI FOR PPA
;
IMMENABLE .EQU FALSE ; IMM: ENABLE IMM DISK DRIVER (IMM.ASM)
IMMCNT .EQU 1 ; IMM: NUMBER OF IMM DEVICES (1-2)
IMMTRACE .EQU 1 ; IMM: TRACE LEVEL (0=NO,1=ERRORS,2=ALL)
IMMMODE .EQU IMMMODE_MG014 ; IMM: DRIVER MODE: IMMMODE_[NONE|SPP|MG014]
IMM0BASE .EQU LPT0BASE ; IMM 0: BASE I/O ADDRESS OF PPI FOR IMM
IMM1BASE .EQU LPT1BASE ; IMM 1: BASE I/O ADDRESS OF PPI FOR IMM
;
SYQENABLE .EQU FALSE ; SYQ: ENABLE IMM DISK DRIVER (SYQ.ASM)
SYQCNT .EQU 1 ; SYQ: NUMBER OF SYQ DEVICES (1-2)
SYQTRACE .EQU 1 ; SYQ: TRACE LEVEL (0=NO,1=ERRORS,2=ALL)
SYQMODE .EQU IMMMODE_MG014 ; SYQ: DRIVER MODE: SYQMODE_[NONE|SPP|MG014]
SYQ0BASE .EQU LPT0BASE ; SYQ 0: BASE I/O ADDRESS OF PPI FOR SYQ
SYQ1BASE .EQU LPT1BASE ; SYQ 1: BASE I/O ADDRESS OF PPI FOR SYQ
;
PIO_4P .EQU FALSE ; PIO: ENABLE PARALLEL PORT DRIVER FOR ECB 4P BOARD
PIO_ZP .EQU FALSE ; PIO: ENABLE PARALLEL PORT DRIVER FOR ECB ZILOG PERIPHERALS BOARD (PIO.ASM)
PIO_SBC .EQU FALSE ; PIO: ENABLE PARALLEL PORT DRIVER FOR 8255 CHIP

View File

@@ -206,6 +206,12 @@ PIOENABLE .EQU FALSE ; PIO: ENABLE ZILOG PIO DRIVER (PIO.ASM)
;
LPTENABLE .EQU FALSE ; LPT: ENABLE CENTRONICS PRINTER DRIVER (LPT.ASM)
;
PPAENABLE .EQU FALSE ; PPA: ENABLE PPA DISK DRIVER (PPA.ASM)
;
IMMENABLE .EQU FALSE ; IMM: ENABLE IMM DISK DRIVER (IMM.ASM)
;
SYQENABLE .EQU FALSE ; SYQ: ENABLE IMM DISK DRIVER (SYQ.ASM)
;
PIO_4P .EQU FALSE ; PIO: ENABLE PARALLEL PORT DRIVER FOR ECB 4P BOARD
PIO_ZP .EQU FALSE ; PIO: ENABLE PARALLEL PORT DRIVER FOR ECB ZILOG PERIPHERALS BOARD (PIO.ASM)
PIO_SBC .EQU FALSE ; PIO: ENABLE PARALLEL PORT DRIVER FOR 8255 CHIP

View File

@@ -177,6 +177,12 @@ PIOENABLE .EQU FALSE ; PIO: ENABLE ZILOG PIO DRIVER (PIO.ASM)
;
LPTENABLE .EQU FALSE ; LPT: ENABLE CENTRONICS PRINTER DRIVER (LPT.ASM)
;
PPAENABLE .EQU FALSE ; PPA: ENABLE PPA DISK DRIVER (PPA.ASM)
;
IMMENABLE .EQU FALSE ; IMM: ENABLE IMM DISK DRIVER (IMM.ASM)
;
SYQENABLE .EQU FALSE ; SYQ: ENABLE IMM DISK DRIVER (SYQ.ASM)
;
PIO_4P .EQU FALSE ; PIO: ENABLE PARALLEL PORT DRIVER FOR ECB 4P BOARD
PIO_ZP .EQU FALSE ; PIO: ENABLE PARALLEL PORT DRIVER FOR ECB ZILOG PERIPHERALS BOARD (PIO.ASM)
PIO_SBC .EQU FALSE ; PIO: ENABLE PARALLEL PORT DRIVER FOR 8255 CHIP

View File

@@ -188,6 +188,12 @@ PIOENABLE .EQU FALSE ; PIO: ENABLE ZILOG PIO DRIVER (PIO.ASM)
;
LPTENABLE .EQU FALSE ; LPT: ENABLE CENTRONICS PRINTER DRIVER (LPT.ASM)
;
PPAENABLE .EQU FALSE ; PPA: ENABLE PPA DISK DRIVER (PPA.ASM)
;
IMMENABLE .EQU FALSE ; IMM: ENABLE IMM DISK DRIVER (IMM.ASM)
;
SYQENABLE .EQU FALSE ; SYQ: ENABLE IMM DISK DRIVER (SYQ.ASM)
;
PIO_4P .EQU FALSE ; PIO: ENABLE PARALLEL PORT DRIVER FOR ECB 4P BOARD
PIO_ZP .EQU FALSE ; PIO: ENABLE PARALLEL PORT DRIVER FOR ECB ZILOG PERIPHERALS BOARD (PIO.ASM)
PIO_SBC .EQU FALSE ; PIO: ENABLE PARALLEL PORT DRIVER FOR 8255 CHIP

View File

@@ -1261,11 +1261,11 @@ Z280_INITZ:
; SET DEFAULT CPU CLOCK MULTIPLIERS (XTAL / 2)
;
; IT HAS BEEN REPORTED THAT CMR NEEDS TO BE SET PRIOR TO CCR
; WHEN USING AN INPUT FREQUENCY THAT IS XTAL / 2.
; I NEVER EXPERIENCED A PROBLEM RELATED TO ORDER, BUT JUST
; BILL MCMULLEN REPORTED THAT CMR NEEDS TO BE SET PRIOR TO CCR
; WHEN USING A CPU FREQUENCY (PHI) THAT IS XTAL * 2.
; HERE WE ARE SETTING CPU FREQUENCY TO XTAL / 2, BUT JUST
; FOR GOOD MEASURE, CMR IS SET PRIOR TO CCR BELOW.
; https://www.retrobrewcomputers.org/forum/index.php?t=msg&th=316&#msg_5045
; https://www.retrobrewcomputers.org/forum/index.php?t=msg&th=316&goto=5045&#msg_5045
XOR A
OUT0 (Z180_CMR),A
OUT0 (Z180_CCR),A
@@ -3239,6 +3239,15 @@ HB_INITTBL:
#IF (HDSKENABLE)
.DW HDSK_INIT
#ENDIF
#IF (PPAENABLE)
.DW PPA_INIT
#ENDIF
#IF (IMMENABLE)
.DW IMM_INIT
#ENDIF
#IF (SYQENABLE)
.DW SYQ_INIT
#ENDIF
#IF (PRPENABLE)
.DW PRP_INIT
#ENDIF
@@ -6348,6 +6357,33 @@ SIZ_HDSK .EQU $ - ORG_HDSK
.ECHO " bytes.\n"
#ENDIF
;
#IF (PPAENABLE)
ORG_PPA .EQU $
#INCLUDE "ppa.asm"
SIZ_PPA .EQU $ - ORG_PPA
.ECHO "PPA occupies "
.ECHO SIZ_PPA
.ECHO " bytes.\n"
#ENDIF
;
#IF (IMMENABLE)
ORG_IMM .EQU $
#INCLUDE "imm.asm"
SIZ_IMM .EQU $ - ORG_IMM
.ECHO "IMM occupies "
.ECHO SIZ_IMM
.ECHO " bytes.\n"
#ENDIF
;
#IF (SYQENABLE)
ORG_SYQ .EQU $
#INCLUDE "syq.asm"
SIZ_SYQ .EQU $ - ORG_SYQ
.ECHO "SYQ occupies "
.ECHO SIZ_SYQ
.ECHO " bytes.\n"
#ENDIF
;
#IF (TERMENABLE)
ORG_TERM .EQU $
#INCLUDE "term.asm"
@@ -6762,7 +6798,6 @@ PS_PRTDC:
RES 7,D ; CLEAR LBA BIT
LD B,11 ; 11 BIT SHIFT TO CONVERT BLOCKS --> MB
CALL SRL32 ; RIGHT SHIFT
;CALL PRTDEC ; PRINT LOW WORD IN DECIMAL (HIGH WORD DISCARDED)
CALL PRTDEC32 ; PRINT DWORD IN DECIMAL
PRTS("MB$") ; PRINT SUFFIX
CALL PC_COMMA
@@ -6777,7 +6812,6 @@ PS_PRTDC1:
RES 7,D ; CLEAR LBA BIT
LD B,1 ; 11 BIT SHIFT TO CONVERT BLOCKS --> MB
CALL SRL32 ; RIGHT SHIFT
;CALL PRTDEC ; PRINT LOW WORD IN DECIMAL (HIGH WORD DISCARDED)
CALL PRTDEC32 ; PRINT DWORD IN DECIMAL
PRTS("KB$") ; PRINT SUFFIX
CALL PC_COMMA
@@ -7134,6 +7168,9 @@ PS_DDSD .TEXT "SD$"
PS_DDPRPSD .TEXT "PRPSD$"
PS_DDPPPSD .TEXT "PPPSD$"
PS_DDHDSK .TEXT "HDSK$"
PS_DDPPA .TEXT "PPA$"
PS_DDIMM .TEXT "IMM$"
PS_DDSYQ .TEXT "SYQ$"
;
; DISK TYPE STRINGS
;
@@ -7546,6 +7583,52 @@ HB_HASFP .DB 0 ; NON-ZERO MEANS FP EXISTS
;
HB_WRKBUF .FILL 512,0 ; INTERNAL DISK BUFFER
;
;
;
#IFDEF MG014_MAP
;
.FILL 32 - ($ & (32 - 1)) ; ALIGN TO 32 BYTE BOUNDARY
MG014_STATMAPLO:
; LOWER NIBBLE
.DB $08 ; 00
.DB $0C ; 01
.DB $00 ; 02
.DB $04 ; 03
.DB $0A ; 04
.DB $0E ; 05
.DB $02 ; 06
.DB $06 ; 07
.DB $09 ; 08
.DB $0D ; 09
.DB $01 ; 0A
.DB $05 ; 0B
.DB $0B ; 0C
.DB $0F ; 0D
.DB $03 ; 0E
.DB $07 ; 0F
;
MG014_STATMAPHI:
; UPPER NIBBLE
.DB $80 ; 00
.DB $C0 ; 01
.DB $00 ; 02
.DB $40 ; 03
.DB $A0 ; 04
.DB $E0 ; 05
.DB $20 ; 06
.DB $60 ; 07
.DB $90 ; 08
.DB $D0 ; 09
.DB $10 ; 0A
.DB $50 ; 0B
.DB $B0 ; 0C
.DB $F0 ; 0D
.DB $30 ; 0E
.DB $70 ; 0F
;
#ENDIF
;
HB_END .EQU $
;
SLACK .EQU BNKTOP - $

View File

@@ -321,6 +321,9 @@ DIODEV_SD .EQU $60
DIODEV_PRPSD .EQU $70
DIODEV_PPPSD .EQU $80
DIODEV_HDSK .EQU $90
DIODEV_PPA .EQU $A0
DIODEV_IMM .EQU $B0
DIODEV_SYQ .EQU $C0
;
; RTC DEVICE IDS
;

File diff suppressed because it is too large Load Diff

1543
Source/HBIOS/imm.asm Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -10,9 +10,10 @@
;
;==================================================================================================
;
; IBM STYLE INTERFACE (USED BY NHYODYNE PRINT MODULE):
; IBM PC STANDARD PARALLEL PORT (SPP):
; - NHYODYNE PRINT MODULE
;
; PORT 0 (INPUT/OUTPUT):
; PORT 0 (OUTPUT):
;
; D7 D6 D5 D4 D3 D2 D1 D0
; +-------+-------+-------+-------+-------+-------+-------+-------+
@@ -26,7 +27,7 @@
; | /BUSY | /ACK | POUT | SEL | /ERR | 0 | 0 | 0 |
; +-------+-------+-------+-------+-------+-------+-------+-------+
;
; PORT 2 (INPUT/OUTPUT):
; PORT 2 (OUTPUT):
;
; D7 D6 D5 D4 D3 D2 D1 D0
; +-------+-------+-------+-------+-------+-------+-------+-------+
@@ -35,9 +36,10 @@
;
;==================================================================================================
;
; MG014 STYLE INTERFACE (USED BY RCBUS MG014 MODULE):
; MG014 STYLE INTERFACE:
; - RCBUS MG014 MODULE
;
; PORT 0 (INPUT/OUTPUT):
; PORT 0 (OUTPUT):
;
; D7 D6 D5 D4 D3 D2 D1 D0
; +-------+-------+-------+-------+-------+-------+-------+-------+
@@ -51,7 +53,7 @@
; | | | | /ERR | SEL | POUT | BUSY | /ACK |
; +-------+-------+-------+-------+-------+-------+-------+-------+
;
; PORT 2 (INPUT/OUTPUT):
; PORT 2 (OUTPUT):
;
; D7 D6 D5 D4 D3 D2 D1 D0
; +-------+-------+-------+-------+-------+-------+-------+-------+
@@ -165,7 +167,7 @@ LPT_OUT:
JR Z,LPT_OUT ; LOOP IF NOT
LD C,(IY+3) ; PORT 0 (DATA)
OUT (C),E ; OUTPUT DATA TO PORT
#IF (LPTMODE == LPTMODE_IBM)
#IF (LPTMODE == LPTMODE_SPP)
LD A,%00001101 ; SELECT & STROBE, LEDS OFF
#ENDIF
#IF (LPTMODE == LPTMODE_MG014)
@@ -175,7 +177,7 @@ LPT_OUT:
INC C
OUT (C),A ; OUTPUT DATA TO PORT
CALL DELAY
#IF (LPTMODE == LPTMODE_IBM)
#IF (LPTMODE == LPTMODE_SPP)
LD A,%00001100 ; SELECT, LEDS OFF
#ENDIF
#IF (LPTMODE == LPTMODE_MG014)
@@ -199,7 +201,7 @@ LPT_OST:
LD C,(IY+3) ; BASE PORT
INC C ; SELECT STATUS PORT
IN A,(C) ; GET STATUS INFO
#IF (LPTMODE == LPTMODE_IBM)
#IF (LPTMODE == LPTMODE_SPP)
AND %10000000 ; ISOLATE /BUSY
#ENDIF
#IF (LPTMODE == LPTMODE_MG014)
@@ -221,7 +223,7 @@ LPT_INITDEV:
;
LPT_INITDEVX:
;
#IF (LPTMODE == LPTMODE_IBM)
#IF (LPTMODE == LPTMODE_SPP)
;
LD C,(IY+3) ; PORT 0 (DATA)
XOR A ; CLEAR ACCUM
@@ -283,7 +285,7 @@ LPT_DETECT:
;
#ENDIF
;
#IF (LPTMODE == LPTMODE_IBM)
#IF (LPTMODE == LPTMODE_SPP)
;
LPT_DETECT:
LD C,(IY+3) ; BASE PORT ADDRESS
@@ -294,7 +296,7 @@ LPT_DETECT:
;
LPT_DETECT1:
; LPT FOUND, RECORD IT
LD A,LPTMODE_IBM ; RETURN CHIP TYPE
LD A,LPTMODE_SPP ; RETURN CHIP TYPE
RET ; DONE
;
LPT_DETECT2:
@@ -372,7 +374,7 @@ LPT_PRTCFG:
CALL PRTHEXBYTE ; PRINT BASE PORT
; PRINT THE LPT TYPE
CALL PC_SPACE ; FORMATTING
PRTS(" MODE=$") ; FORMATTING
LD A,(IY+1) ; GET LPT TYPE BYTE
RLCA ; MAKE IT A WORD OFFSET
LD HL,LPT_TYPE_MAP ; POINT HL TO TYPE MAP TABLE
@@ -396,11 +398,11 @@ LPT_PRTCFG:
;
LPT_TYPE_MAP:
.DW LPT_STR_NONE
.DW LPT_STR_IBM
.DW LPT_STR_SPP
.DW LPT_STR_MG014
;
LPT_STR_NONE .DB "<NOT PRESENT>$"
LPT_STR_IBM .DB "IBM$"
LPT_STR_SPP .DB "SPP$"
LPT_STR_MG014 .DB "MG014$"
;
; WORKING VARIABLES

1403
Source/HBIOS/ppa.asm Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -5,6 +5,7 @@
;
; TODO:
; - GOPARTNER NEEDS TO HANDLE "NO PARTNER" CONDITION
; - DATA TRANSFERS LIMITED TO 512 BYTES WHICH IS INSUFFICIENT FOR CD=ROM MEDIA
;
; NOTES:
; - WELL KNOWN PPIDE PORT ADDRESSES:
@@ -135,6 +136,8 @@ PPIDE_REG_LBA0 .EQU PPIDE_CTL_CS1 | $03 ; LBA BYTE 0 (BITS 0-7) (R/W)
PPIDE_REG_LBA1 .EQU PPIDE_CTL_CS1 | $04 ; LBA BYTE 1 (BITS 8-15) (R/W)
PPIDE_REG_LBA2 .EQU PPIDE_CTL_CS1 | $05 ; LBA BYTE 2 (BITS 16-23) (R/W)
PPIDE_REG_LBA3 .EQU PPIDE_CTL_CS1 | $06 ; LBA BYTE 3 (BITS 24-27) (R/W)
PPIDE_REG_BCL .EQU PPIDE_CTL_CS1 | $04 ; PKT BYTE COUNT LOW (BITS 0-7) (R/W)
PPIDE_REG_BCH .EQU PPIDE_CTL_CS1 | $05 ; PKT BYTE COUNT HIGH (BITS 8-15) (R/W)
PPIDE_REG_STAT .EQU PPIDE_CTL_CS1 | $07 ; STATUS REGISTER (R)
PPIDE_REG_CMD .EQU PPIDE_CTL_CS1 | $07 ; COMMAND REGISTER (EXECUTE) (W)
PPIDE_REG_ALTSTAT .EQU PPIDE_CTL_CS3 | $06 ; ALTERNATE STATUS REGISTER (R)
@@ -143,13 +146,14 @@ PPIDE_REG_DRVADR .EQU PPIDE_CTL_CS3 | $07 ; DRIVE ADDRESS REGISTER (R)
;
; COMMAND BYTES
;
PPIDE_CIDE_NOP .EQU $00
PPIDE_CIDE_DEVRES .EQU $08
PPIDE_CMD_NOP .EQU $00
PPIDE_CMD_DEVRES .EQU $08
PPIDE_CMD_RECAL .EQU $10
PPIDE_CMD_READ .EQU $20
PPIDE_CMD_WRITE .EQU $30
PPIDE_CIDE_DEVDIAG .EQU $90
PPIDE_CIDE_IDPKTDEV .EQU $A1
PPIDE_CMD_DEVDIAG .EQU $90
PPIDE_CMD_PACKET .EQU $A0
PPIDE_CMD_IDPKTDEV .EQU $A1
PPIDE_CMD_IDDEV .EQU $EC
PPIDE_CMD_SETFEAT .EQU $EF
;
@@ -175,6 +179,7 @@ PPIDE_STRDYTO .EQU -5
PPIDE_STDRQTO .EQU -6
PPIDE_STBSYTO .EQU -7
PPIDE_STNOTSUP .EQU -8
PPIDE_STNOTRDY .EQU -9
;
; DRIVE SELECTION BYTES (FOR USE IN DRIVE/HEAD REGISTER)
;
@@ -407,10 +412,6 @@ PPIDE_INIT5:
JP NZ,PPIDE_PRTSTATSTR ; EXIT VIA PRINT STATUS STRING
;
PPIDE_INIT6:
LD A,(IY+PPIDE_TYPE) ; GET DEVICE TYPE
CP PPIDE_TYPEATA ; ATA?
RET NZ ; IF NOT, THEN DONE
;
LD DE,PPIDE_STR_8BIT
BIT 1,(IY+PPIDE_ACC) ; 8 BIT ACCESS?
CALL NZ,WRITESTR
@@ -526,12 +527,12 @@ PPIDE_IO:
PUSH HL ; ... TO FILTER ALL EXITS
#ENDIF
PUSH BC ; SAVE COUNTERS
CALL PPIDE_SELUNIT ; HARDWARE SELECTION OF TARGET UNIT
CALL PPIDE_CHKERR ; CHECK FOR ERR STATUS AND RESET IF SO
POP BC ; RESTORE COUNTERS
JR NZ,PPIDE_IO3 ; BAIL OUT ON ERROR
PPIDE_IO1:
PUSH BC ; SAVE COUNTERS
CALL PPIDE_SELUNIT ; HARDWARE SELECTION OF TARGET UNIT
LD HL,(PPIDE_IOFNADR) ; GET PENDING IO FUNCTION ADDRESS
CALL JPHL ; ... AND CALL IT
JR NZ,PPIDE_IO2 ; IF ERROR, SKIP INCREMENT
@@ -644,8 +645,6 @@ PPIDE_GEOM:
; FUNCTION SUPPORT ROUTINES
;=============================================================================
;
;
;
PPIDE_SETFEAT:
PUSH AF
#IF (PPIDETRACE >= 3)
@@ -674,32 +673,6 @@ PPIDE_SETFEAT:
;
;
;
PPIDE_NOP:
#IF (PPIDETRACE >= 3)
CALL PPIDE_PRTPREFIX
PRTS(" NOP$")
#ENDIF
LD A,(PPIDE_DRVHD)
;OUT (PPIDE_IO_DRVHD),A
CALL PPIDE_OUT
.DB PPIDE_REG_DRVHD
#IF (PPIDETRACE >= 3)
CALL PC_SPACE
CALL PRTHEXBYTE
#ENDIF
;
; EXECUTE THE NOP COMMAND, BUT DON'T WAIT FOR DRDY, JUST
; MAKE SURE BUSY IS CLEAR. THIS COMMAND IS USED DURING
; DEVICE DETECTION/INITIALIZATION AND ATAPI DEVICES WILL
; NOT ASSERT DRDY AFTER RESET.
LD A,PPIDE_CIDE_NOP ; CMD = NOP
LD (PPIDE_CMD),A ; SAVE IT
CALL PPIDE_WAITBSY
RET NZ
JP PPIDE_RUNCMD1 ; RUN COMMAND AND EXIT
;
;
;
PPIDE_IDENTIFY:
#IF (PPIDETRACE >= 3)
CALL PPIDE_PRTPREFIX
@@ -715,8 +688,13 @@ PPIDE_IDENTIFY:
#ENDIF
LD A,PPIDE_CMD_IDDEV
LD (PPIDE_CMD),A
CALL PPIDE_RUNCMD
CALL PPIDE_RUNCMD_ND
RET NZ
;
CALL PPIDE_IN
.DB PPIDE_REG_STAT
BIT 3,A ; IS DRQ SET?
JP Z,PPIDE_NOMEDIA
;
LD HL,HB_WRKBUF
JP PPIDE_GETBUF ; EXIT THRU BUFRD
@@ -729,21 +707,21 @@ PPIDE_IDENTIFYPACKET:
PRTS(" IDPKTDEV$")
#ENDIF
LD A,(PPIDE_DRVHD)
;OUT (PPIDE_IO_DRVHD),A
;OUT (PPIDE_REG_DRVHD),A
CALL PPIDE_OUT
.DB PPIDE_REG_DRVHD
#IF (PPIDETRACE >= 3)
CALL PC_SPACE
CALL PRTHEXBYTE
#ENDIF
LD A,PPIDE_CIDE_IDPKTDEV
LD A,PPIDE_CMD_IDPKTDEV
LD (PPIDE_CMD),A
CALL PPIDE_RUNCMD
CALL PPIDE_RUNCMD_ND
RET NZ
;
CALL PPIDE_IN
.DB PPIDE_REG_STAT
BIT 6,A ; IS DRQ SET?
BIT 3,A ; IS DRQ SET?
JP Z,PPIDE_NOMEDIA
;
LD HL,HB_WRKBUF
@@ -751,6 +729,33 @@ PPIDE_IDENTIFYPACKET:
;
;
;
PPIDE_PACKET:
#IF (PPIDETRACE >= 3)
CALL PPIDE_PRTPREFIX
PRTS(" PACKET$")
#ENDIF
LD A,(PPIDE_DRVHD)
;OUT (PPIDE_REG_DRVHD),A
CALL PPIDE_OUT
.DB PPIDE_REG_DRVHD
#IF (PPIDETRACE >= 3)
CALL PC_SPACE
CALL PRTHEXBYTE
#ENDIF
XOR A ; ZERO
CALL PPIDE_OUT
.DB PPIDE_REG_FEAT ; FEATURE REG = 0
CALL PPIDE_OUT
.DB PPIDE_REG_BCL
LD A,8
CALL PPIDE_OUT
.DB PPIDE_REG_BCH ; BYTE COUNT = 512????
LD A,PPIDE_CMD_PACKET
LD (PPIDE_CMD),A
JP PPIDE_RUNCMD_ND
;
;
;
PPIDE_RDSEC:
;
#IF (PPIDETRACE >= 3)
@@ -764,6 +769,17 @@ PPIDE_RDSEC:
#IF (PPIDETRACE >= 3)
CALL PC_SPACE
CALL PRTHEXBYTE
#ENDIF
LD A,(IY+PPIDE_TYPE)
CP PPIDE_TYPEATA
JR Z,PPIDE_ATA_RDSEC
CP PPIDE_TYPEATAPI
JR Z,PPIDE_PKT_RDSEC
JP PPIDE_CMDERR
;
PPIDE_ATA_RDSEC:
#IF (PPIDETRACE >= 3)
PRTS(" ATA$")
#ENDIF
CALL PPIDE_SETADDR ; SETUP CYL, TRK, HEAD
LD A,PPIDE_CMD_READ
@@ -773,6 +789,31 @@ PPIDE_RDSEC:
LD HL,(PPIDE_DSKBUF)
JP PPIDE_GETBUF
;
PPIDE_PKT_RDSEC:
#IF (PPIDETRACE >= 3)
PRTS(" PKT$")
#ENDIF
; SETUP LBA
; 3 BYTES, LITTLE ENDIAN -> BIG ENDIAN
LD HL,PPIDE_PKTCMD_RW10+3 ; START OF LBA FIELD IN CDB (MSB)
LD A,(IY+PPIDE_LBA+2) ; THIRD BYTE OF LBA FIELD IN CFG (MSB)
LD (HL),A
INC HL
LD A,(IY+PPIDE_LBA+1)
LD (HL),A
INC HL
LD A,(IY+PPIDE_LBA+0)
LD (HL),A
INC HL
LD HL,PPIDE_PKTCMD_RW10
LD A,SCSI_CMD_READ10
LD (HL),A
XOR A ; READ DIRECTION
LD (PPIDE_XFRDIR),A ; SAVE IT
CALL PPIDE_RUNPCMD
JP NZ,PPIDE_CHKPCMD
RET
;
;
;
PPIDE_WRSEC:
@@ -788,6 +829,17 @@ PPIDE_WRSEC:
#IF (PPIDETRACE >= 3)
CALL PC_SPACE
CALL PRTHEXBYTE
#ENDIF
LD A,(IY+PPIDE_TYPE)
CP PPIDE_TYPEATA
JR Z,PPIDE_ATA_WRSEC
CP PPIDE_TYPEATAPI
JR Z,PPIDE_PKT_WRSEC
JP PPIDE_CMDERR
;
PPIDE_ATA_WRSEC:
#IF (PPIDETRACE >= 3)
PRTS(" ATA$")
#ENDIF
CALL PPIDE_SETADDR ; SETUP CYL, TRK, HEAD
LD A,PPIDE_CMD_WRITE
@@ -797,6 +849,31 @@ PPIDE_WRSEC:
LD HL,(PPIDE_DSKBUF)
JP PPIDE_PUTBUF
;
PPIDE_PKT_WRSEC:
#IF (PPIDETRACE >= 3)
PRTS(" PKT$")
#ENDIF
; SETUP LBA
; 3 BYTES, LITTLE ENDIAN -> BIG ENDIAN
LD HL,PPIDE_PKTCMD_RW10+3 ; START OF LBA FIELD IN CDB (MSB)
LD A,(IY+PPIDE_LBA+2) ; THIRD BYTE OF LBA FIELD IN CFG (MSB)
LD (HL),A
INC HL
LD A,(IY+PPIDE_LBA+1)
LD (HL),A
INC HL
LD A,(IY+PPIDE_LBA+0)
LD (HL),A
INC HL
LD HL,PPIDE_PKTCMD_RW10
LD A,SCSI_CMD_WRITE10
LD (HL),A
OR $FF ; WRITE DIRECTION
LD (PPIDE_XFRDIR),A ; SAVE IT
CALL PPIDE_RUNPCMD
JP NZ,PPIDE_CHKPCMD
RET
;
;
;
PPIDE_SETADDR:
@@ -807,8 +884,8 @@ PPIDE_SETADDR:
CALL HB_DSKACT ; SHOW ACTIVITY
#ENDIF
; SEND 3 LOWEST BYTES OF LBA IN REVERSE ORDER
; IDE_IO_LBA3 HAS ALREADY BEEN SET
; HSTLBA2-0 --> IDE_IO_LBA2-0
; IDE_REG_LBA3 HAS ALREADY BEEN SET
; HSTLBA2-0 --> IDE_REG_LBA2-0
LD A,(IY+PPIDE_LBA+2)
#IF (PPIDETRACE >= 3)
CALL PC_SPACE
@@ -847,6 +924,16 @@ PPIDE_SETADDR:
; COMMAND PROCESSING
;=============================================================================
;
; RUN AN ATA COMMAND. THERE ARE TWO ENTRY POINTS. THE NORMAL ENTRY
; POINT WILL WAIT FOR DRIVE READY. THE _ND ENTRY POINT ONLY WAITS
; FOR THE DEVICE TO BE NOT BUSY. THE CORRECT ENTRY POINT DEPENDS ON
; THE COMMAND.
;
PPIDE_RUNCMD_ND:
CALL PPIDE_WAITBSY ; WAIT WHILE DEVICE BUSY
RET NZ ; BAIL OUT ON TIMEOUT
JR PPIDE_RUNCMD1 ; CONTINUE
PPIDE_RUNCMD:
CALL PPIDE_WAITRDY ; WAIT FOR DRIVE READY
RET NZ ; BAIL OUT ON TIMEOUT
@@ -871,54 +958,153 @@ PPIDE_RUNCMD1:
JP NZ,PPIDE_CMDERR
RET
;
; PACKET COMMAND PROCESSOR
; HL: ADDRESS OF PACKET COMMAND BUFFER
;
PPIDE_RUNPCMD:
PUSH HL
CALL PPIDE_PACKET
POP HL
RET NZ ; BAIL OUT ON ERROR
;
#IF (PPIDETRACE >= 3)
PRTS("\r\nPKTCMD:$")
PUSH HL
POP DE
LD A,12
CALL PRTHEXBUF
#ENDIF
;
; IF ZIP DRIVE HAS FALLEN ASLEEP, THEN IT WILL NEED EXTRA
; TIME HERE TO WAKE UP BEFORE ACCEPTING THE COMMAND. USE
; LONG TIMEOUT TO ACCOMMODATE THIS.
LD DE,(PPIDE_TIMEOUT) ; GET CURRENT TIMEOUT
PUSH DE ; SAVE IT
LD DE,PPIDE_TOSLOW ; SLOW TIMEOUT FOR THIS
LD (PPIDE_TIMEOUT),DE ; SET IT
LD B,6 ; 6 WORDS ALWAYS
CALL PPIDE_PUT
POP DE ; RECOVER TIMEOUT
LD (PPIDE_TIMEOUT),DE ; SET IT
RET NZ
;
CALL PPIDE_IN
.DB PPIDE_REG_STAT
BIT 3,A ; IS DRQ SET?
RET Z ; IF NOT, ALL DONE
;
CALL PPIDE_IN
.DB PPIDE_REG_BCL
LD C,A
CALL PPIDE_IN
.DB PPIDE_REG_BCH
LD B,A
;
; BELOW ASSUMES MAX TRANSFER OF 512 BYTES!!!
PUSH BC ; SAVE BYTE COUNT
SRL B ; CONVERT
RR C ; ... TO WORDS
LD B,C
;LD HL,HB_WRKBUF ; SET XFR BUFFER
LD HL,(PPIDE_DSKBUF) ; SET XFR BUFFER
LD A,(PPIDE_XFRDIR)
OR A
JR NZ,PPIDE_RUNPCMD2 ; NZ = WRITE
CALL PPIDE_GET ; GET SOME DATA
JR PPIDE_RUNPCMD3
PPIDE_RUNPCMD2:
CALL PPIDE_PUT ; PUT SOME DATA
PPIDE_RUNPCMD3:
POP BC ; RESTORE BYTE COUNT
RET NZ ; BAIL OUT ON ERRORS
;
XOR A
RET
;
; THE FOLLOWING IS USED TO ASSESS ANY ERROR THAT OCCURS DURING
; RUNCMD AND SET AN APPROPRIATE ERROR CODE.
;
PPIDE_CHKPCMD:
;
LD HL,HB_WRKBUF
LD (PPIDE_DSKBUF),HL
LD HL,PPIDE_PKTCMD_SENSE
CALL PPIDE_RUNPCMD
RET NZ
;
CALL PPIDE_IN
.DB PPIDE_REG_BCL
;
#IF (PPIDETRACE >= 3)
CALL NEWLINE
LD DE,HB_WRKBUF
CALL PRTHEXBUF
#ENDIF
;
; ASSESS SENSE DATA AND SET APPROPRIATE ERROR
LD A,(HB_WRKBUF+12)
CP $3A
JP Z,PPIDE_NOMEDIA
CP $04
JP Z,PPIDE_NOTRDY
;
JP PPIDE_CMDERR
;
; HL=BUFFER
;
PPIDE_GETBUF:
LD B,0
; FALL THRU!!!
;
; HL=BUFFER
; B=WORD COUNT, 0=256
;
PPIDE_GET:
#IF (PPIDETRACE >= 3)
PRTS(" GETBUF$")
PRTS(" GET$")
#ENDIF
;
; WAIT FOR BUFFER
PUSH BC
PUSH HL
CALL PPIDE_WAITDRQ ; WAIT FOR BUFFER READY
POP HL
POP BC
RET NZ ; BAIL OUT IF TIMEOUT
;
; SETUP PPI TO READ
LD A,PPIDE_DIR_READ ; SET DATA BUS DIRECTION TO READ
;OUT (PPIDE_IO_PPI),A ; DO IT
;OUT (PPIDE_REG_PPI),A ; DO IT
LD C,(IY+PPIDE_PPI) ; PPI CONTROL WORD
OUT (C),A ; WRITE IT
;
; SELECT READ/WRITE IDE REGISTER
LD A,PPIDE_REG_DATA ; DATA REGISTER
;OUT (PPIDE_IO_CTL),A ; DO IT
;OUT (PPIDE_REG_CTL),A ; DO IT
LD C,(IY+PPIDE_CTL) ; SET IDE ADDRESS
OUT (C),A ; DO IT
LD E,A ; E := READ UNASSERTED
XOR PPIDE_CTL_DIOR ; SWAP THE READ LINE BIT
LD D,A ; D := READ ASSERTED
;
; LOOP SETUP
XOR A ; IMPORTANT, NEEDED FOR LOOP END COMPARISON
LD B,0 ; 256 ITERATIONS
LD A,B ; LOOP COUNTER IN A
LD C,(IY+PPIDE_CTL) ; SET IDE ADDRESS
;
BIT 1,(IY+PPIDE_ACC) ; 8 BIT?
JR Z,PPIDE_GETBUF1 ; IF NOT, DO 16 BIT
CALL PPIDE_GETBUF8 ; FIRST PASS (FIRST 256 BYTES)
CALL PPIDE_GETBUF8 ; SECOND PASS (LAST 256 BYTES)
JR PPIDE_GETBUF2 ; CONTINUE
PPIDE_GETBUF1:
CALL PPIDE_GETBUF16 ; FIRST PASS (FIRST 256 BYTES)
CALL PPIDE_GETBUF16 ; SECOND PASS (LAST 256 BYTES)
PPIDE_GETBUF2:
JR Z,PPIDE_GET1 ; IF NOT, DO 16 BIT
CALL PPIDE_GET8 ; 8-BIT READ
JR PPIDE_GET2 ; CONTINUE
PPIDE_GET1:
CALL PPIDE_GET16 ; 16-0BIT READ
PPIDE_GET2:
CALL PPIDE_WAITRDY ; PROBLEMS IF THIS IS REMOVED!
RET NZ
CALL PPIDE_GETRES
JP NZ,PPIDE_IOERR
RET
;
PPIDE_GETBUF8: ; 8 BIT WIDE READ LOOP
; ENTER W/ C = PPIDE_IO_CTL
PPIDE_GET8: ; 8 BIT WIDE READ LOOP
; ENTER W/ C = PPIDE_REG_CTL
OUT (C),D ; ASSERT READ
DEC C ; CTL -> MSB
DEC C ; MSB -> LSB
@@ -926,12 +1112,19 @@ PPIDE_GETBUF8: ; 8 BIT WIDE READ LOOP
INC C ; LSB -> MSB
INC C ; MSB -> CTL
OUT (C),E ; DEASSERT READ
CP B ; B == A == 0?
JR NZ,PPIDE_GETBUF8 ; LOOP UNTIL DONE
OUT (C),D ; ASSERT READ
DEC C ; CTL -> MSB
DEC C ; MSB -> LSB
INI ; READ FROM LSB
INC C ; LSB -> MSB
INC C ; MSB -> CTL
OUT (C),E ; DEASSERT READ
DEC A
JR NZ,PPIDE_GET8 ; LOOP UNTIL DONE
RET
;
PPIDE_GETBUF16: ; 16 BIT WIDE READ LOOP
; ENTER W/ C = PPIDE_IO_CTL
PPIDE_GET16: ; 16 BIT WIDE READ LOOP
; ENTER W/ C = PPIDE_REG_CTL
OUT (C),D ; ASSERT READ
DEC C ; CTL -> MSB
DEC C ; MSB -> LSB
@@ -940,30 +1133,41 @@ PPIDE_GETBUF16: ; 16 BIT WIDE READ LOOP
INI ; READ MSB FOR 16 BIT
INC C ; MSB -> CTL
OUT (C),E ; DEASSERT READ
CP B ; B == A == 0?
JR NZ,PPIDE_GETBUF16 ; LOOP UNTIL DONE
DEC A
JR NZ,PPIDE_GET16 ; LOOP UNTIL DONE
RET
;
;
; HL=BUFFER
;
PPIDE_PUTBUF:
LD B,0
; FALL THRU!!!
;
; HL=BUFFER
; B=WORD COUNT, 0=256
;
PPIDE_PUT:
#IF (PPIDETRACE >= 3)
PRTS(" PUTBUF$")
PRTS(" PUT$")
#ENDIF
;
; WAIT FOR BUFFER
PUSH BC
PUSH HL
CALL PPIDE_WAITDRQ ; WAIT FOR BUFFER READY
POP HL
POP BC
RET NZ ; BAIL OUT IF TIMEOUT
;
; SETUP PPI TO WRITE
LD A,PPIDE_DIR_WRITE ; SET DATA BUS DIRECTION TO WRITE
;OUT (PPIDE_IO_PPI),A ; DO IT
;OUT (PPIDE_REG_PPI),A ; DO IT
LD C,(IY+PPIDE_PPI) ; PPI CONTROL WORD
OUT (C),A ; WRITE IT
;
; SELECT READ/WRITE IDE REGISTER
LD A,PPIDE_REG_DATA ; DATA REGISTER
;OUT (PPIDE_IO_CTL),A ; DO IT
;OUT (PPIDE_REG_CTL),A ; DO IT
LD C,(IY+PPIDE_CTL) ; SET IDE ADDRESS
OUT (C),A ; DO IT
LD E,A ; E := WRITE UNASSERTED
@@ -971,26 +1175,22 @@ PPIDE_PUTBUF:
LD D,A ; D := WRITE ASSERTED
;
; LOOP SETUP
XOR A ; IMPORTANT, NEEDED FOR LOOP END COMPARISON
LD B,0 ; 256 ITERATIONS
LD A,B ; LOOP COUNTER IN A
LD C,(IY+PPIDE_CTL) ; SET IDE ADDRESS
;
BIT 1,(IY+PPIDE_ACC) ; 8 BIT?
JR Z,PPIDE_PUTBUF1 ; IF NOT, DO 16 BIT
CALL PPIDE_PUTBUF8 ; FIRST PASS (FIRST 256 BYTES)
CALL PPIDE_PUTBUF8 ; SECOND PASS (LAST 256 BYTES)
JR PPIDE_PUTBUF2 ; CONTINUE
PPIDE_PUTBUF1:
CALL PPIDE_PUTBUF16 ; FIRST PASS (FIRST 256 BYTES)
CALL PPIDE_PUTBUF16 ; SECOND PASS (LAST 256 BYTES)
PPIDE_PUTBUF2:
JR Z,PPIDE_PUT1 ; IF NOT, DO 16 BIT
CALL PPIDE_PUT8 ; SECOND PASS (LAST 256 BYTES)
JR PPIDE_PUT2 ; CONTINUE
PPIDE_PUT1:
CALL PPIDE_PUT16 ; FIRST PASS (FIRST 256 BYTES)
PPIDE_PUT2:
CALL PPIDE_WAITRDY ; PROBLEMS IF THIS IS REMOVED!
RET NZ
CALL PPIDE_GETRES
JP NZ,PPIDE_IOERR
RET
;
PPIDE_PUTBUF8: ; 8 BIT WIDE WRITE LOOP
PPIDE_PUT8: ; 8 BIT WIDE WRITE LOOP
DEC C ; CTL -> MSB
DEC C ; MSB -> LSB
OUTI ; WRITE NEXT BYTE (LSB)
@@ -998,11 +1198,18 @@ PPIDE_PUTBUF8: ; 8 BIT WIDE WRITE LOOP
INC C ; MSB -> CTL
OUT (C),D ; ASSERT WRITE
OUT (C),E ; DEASSERT WRITE
CP B ; B == A == 0?
JR NZ,PPIDE_PUTBUF8 ; LOOP UNTIL DONE
DEC C ; CTL -> MSB
DEC C ; MSB -> LSB
OUTI ; WRITE NEXT BYTE (LSB)
INC C ; LSB -> MSB
INC C ; MSB -> CTL
OUT (C),D ; ASSERT WRITE
OUT (C),E ; DEASSERT WRITE
DEC A
JR NZ,PPIDE_PUT8 ; LOOP UNTIL DONE
RET
;
PPIDE_PUTBUF16: ; 16 BIT WIDE WRITE LOOP
PPIDE_PUT16: ; 16 BIT WIDE WRITE LOOP
DEC C ; CTL -> MSB
DEC C ; MSB -> LSB
OUTI ; WRITE NEXT BYTE (LSB)
@@ -1011,8 +1218,8 @@ PPIDE_PUTBUF16: ; 16 BIT WIDE WRITE LOOP
INC C ; MSB -> CTL
OUT (C),D ; ASSERT WRITE
OUT (C),E ; DEASSERT WRITE
CP B ; B == A == 0?
JR NZ,PPIDE_PUTBUF16 ; LOOP UNTIL DONE
DEC A
JR NZ,PPIDE_PUT16 ; LOOP UNTIL DONE
RET
;
;
@@ -1057,7 +1264,7 @@ PPIDE_RESET:
;
; SETUP PPI TO READ
LD A,PPIDE_DIR_READ ; SET DATA BUS DIRECTION TO READ
;OUT (PPIDE_IO_PPI),A ; DO IT
;OUT (PPIDE_REG_PPI),A ; DO IT
LD C,(IY+PPIDE_PPI) ; PPI CONTROL WORD
OUT (C),A ; WRITE IT
;
@@ -1082,13 +1289,13 @@ PPIDE_RESET:
PRTS(" HARD$")
#ENDIF
LD A,PPIDE_CTL_RESET
;OUT (PPIDE_IO_CTL),A
;OUT (PPIDE_REG_CTL),A
LD C,(IY+PPIDE_CTL) ; SET IDE ADDRESS
OUT (C),A
LD DE,20 ; DELAY 320US (SPEC IS >= 25US)
CALL VDELAY
XOR A
;OUT (PPIDE_IO_CTL),A
;OUT (PPIDE_REG_CTL),A
OUT (C),A
LD DE,20
CALL VDELAY
@@ -1125,7 +1332,7 @@ PPIDE_RESET2:
PRTS(" SOFT$")
#ENDIF
LD A,%00001110 ; ASSERT RESET, NO INTERRUPTS
;OUT (PPIDE_IO_CTRL),A
;OUT (PPIDE_REG_CTRL),A
CALL PPIDE_OUT
.DB PPIDE_REG_CTRL
LD DE,20 ; DELAY 320US (SPEC IS >= 25US)
@@ -1224,7 +1431,7 @@ PPIDE_PROBE:
;
; SELECT DEVICE (MASTER/SLAVE)
LD A,(PPIDE_DRVHD)
;OUT (IDE_IO_DRVHD),A
;OUT (IDE_REG_DRVHD),A
CALL PPIDE_OUT
.DB PPIDE_REG_DRVHD
#IF (PPIDETRACE >= 3)
@@ -1275,7 +1482,7 @@ PPIDE_PROBE:
;
; TEST FOR PRESENCE OF IDE REGISTERS. USE LBA0/1 TO SEE
; IF VALUE CAN BE PERSISTED. THE USE OF BOTH LBA0 AND LBA1
; IS TO MAINTAIN CONSISTENCY WITH TGHE THE PPIDE DRIVER BECAUSE
; IS TO MAINTAIN CONSISTENCY WITH THE THE PPIDE DRIVER BECAUSE
; PPI ITSELF WILL PERSIST THE LAST VALUE WRITTEN, SO WE USE
; MULTIPLE REGISTERS TO WORK AROUND THIS FALSE POSITIVE.
;
@@ -1326,22 +1533,26 @@ PPIDE_INITDEV:
PRTS(" INITDEV$") ; LABEL FOR IO ADDRESS
#ENDIF
;
; IF THE IDE STATUS BYTE IS $00, WE HAVE EITHER A NON-PRESENT SLAVE
; OR AN ATAPI DEVICE. TO DIFFERENTIATE THESE POSSIBILITIES, WE RUN
; A NOP COMMAND. IF WE HAVE AN ATAPI DEVICE, THIS WILL CAUSE THE
; STATUS BYTE TO BE "NORMAL" (NON-ZERO). IF THE STATUS IS STILL
; ZERO, WE ABORT WITH A NO MEDIA STATUS. NOTE THAT THE NOP COMMAND
; RETURNS A COMMAND ERROR BY DESIGN. WE JUST IGNORE THE ERROR.
#IF (PPIDETRACE >= 3)
CALL PPIDE_REGDUMP
#ENDIF
;
; ON ENTRY, WE HAVE ALREADY CHECKED THAT THE BUSY BIT IS CLEARED AND
; DRDY SHOULD BE SET. IF DRDY IS NOT SET, IF COULD MEAN EITHER A
; NON-EXISTENT SLAVE DEVICE OR AN ATAPI DEVICE. TO AVOID UNNECESSARY
; TIMEOUTS, WE CHECK FOR DRDY. IF IT IS NOT SET, THEN WE ASSUME THIS
; MUST BE AN ATAPI DEVICE AND GO TRY TO DO THE ATAPI INITIALIZATION.
; IF THIS WAS ACTUALLY A NON-EXISTENT SLAVE, THE ATAPI INITIALIZATION
; WILL HANDLE THIS PRETTY WELL.
;
CALL PPIDE_NOP
CALL PPIDE_IN
.DB PPIDE_REG_STAT
OR A
JP Z,PPIDE_NOMEDIA
BIT 6,A ; DRDY?
JR Z,PPIDE_INITPDEV ; ODD, MIGHT BE ATAPI
;
; WE NEED TO SETUP 8-BIT MODE BEFORE DOING ANYTHING ELSE
;
PPIDE_INITDEV0A:
BIT 1,(IY+PPIDE_ACC) ; 8 BIT ACCESS?
JR Z,PPIDE_INITDEV0 ; NO, DO 16 BIT INIT
LD A,PPIDE_FEAT_ENABLE8BIT ; FEATURE VALUE = ENABLE 8-BIT PIO
@@ -1358,8 +1569,12 @@ PPIDE_INITDEV0:
;
PPIDE_INITDEV00:
;
; WE NOW USE AN IDENTIFY DEVICE COMMAND TO CONFIRM THE
; DEVICE IS REALLY THERE AND GET SOME ATTRIBUTES. IF THE
; COMMAND FAILS, IT MAY BE THAT WE HAVE AN ATAPI DEVICE AND
; SO WE GO TO THE ATAPI INITIALIZATION ON FAILURE.
CALL PPIDE_IDENTIFY ; EXECUTE PPIDENTIFY COMMAND
JR NZ,PPIDE_INITDEVP ; ON ERROR, TRY PACKET DEVICE
JR NZ,PPIDE_INITPDEV ; TRY ATAPI ON FAILURE
;
; DECLARE WE ARE ATA
LD A,PPIDE_TYPEATA ; OTHERWISE TYPE=ATA
@@ -1371,13 +1586,6 @@ PPIDE_INITDEV00:
#ENDIF
;
LD (IY+PPIDE_MED),0 ; CLEAR MEDIA FLAGS
;
; DETERMINE IF CF DEVICE BY TESTING FOR CF CARD SIGNATURES
; IN THEORY, THERE ARE SOME OTHER POSSIBLE VARIATIONS, BUT
; THEY ARE NOT RECOMMENDED BY THE CF CARD SPEC AND MIGHT
; OVERLAP WITH "REAL" HARD DISK SIGNATURES. I HAVE NEVER
; SEEN A CF CARD THAT DID NOT USE ONE OF THE BELOW.
; CREDIT TO LASZLO SZOLNOKI
;
#IF (PPIDETRACE >= 3)
CALL PPIDE_PRTPREFIX
@@ -1417,9 +1625,15 @@ PPIDE_INITDEV2:
;
RET ; RETURN, A=0, Z SET
;
; (RE)INITIALIZE PACKET DEVICE
;
PPIDE_INITPDEV:
;
#IF (PPIDETRACE >= 3)
CALL PPIDE_PRTPREFIX
PRTS(" INITPDEV$") ; LABEL FOR IO ADDRESS
#ENDIF
;
PPIDE_INITDEVP:
CALL PPIDE_IDENTIFYPACKET ; EXECUTE IDENTIFY COMMAND
RET NZ ; BAIL OUT ON ERROR
;
@@ -1432,17 +1646,98 @@ PPIDE_INITDEVP:
CALL DUMP_BUFFER ; DUMP IT IF DEBUGGING
#ENDIF
;
LD (IY+PPIDE_MED),0 ; CLEAR FLAGS
LD (IY+PPIDE_MED),0 ; CLEAR FLAGS
SET 1,(IY+PPIDE_MED) ; SET FLAGS BIT FOR LBA (ASSUMED)
;
; DONE FOR NOW, ATAPI NOT INPLEMENTED
; WAIT FOR UNIT READY
LD B,0 ; MAX LOOPS
LD C,4 ; MAX ERRORS
PPIDE_INITPDEV1:
DEC B ; CHECK LOOP COUNTER EXCEEDED
JP Z,PPIDE_NOMEDIA ; TREAT AS NO MEDIA
PUSH BC ; SAVE LOOP CONTROL
LD HL,PPIDE_PKTCMD_TSTRDY ; TEST UNIT READY
XOR A ; READ DIRECTION
LD (PPIDE_XFRDIR),A ; SAVE IT
CALL PPIDE_RUNPCMD ; ISSUE PACKET COMMAND
CALL NZ,PPIDE_CHKPCMD ; IF ERROR, DIAGNOSE IT
POP BC ; RESTORE LOOP CONTROL
JR Z,PPIDE_INITPDEV2 ; IF NO ERROR, CONTINUE
CP PPIDE_STNOMEDIA ; EXPLICIT NO MEDIA RESULT?
RET Z ; EXIT REPORTING NO MEDIA
CP PPIDE_STNOTRDY ; BECOMING READY?
JR Z,PPIDE_INITDEVP1A ; IF SO, NOT AN ERROR, LOOP
DEC C ; DEC ERROR LIMIT
RET Z ; BAIL OUT, ERR LIMIT EXCEEDED
JR PPIDE_INITPDEV1 ; LOOP
PPIDE_INITDEVP1A:
LD DE,100000/16 ; WAIT 1/10 SECOND
CALL VDELAY ; DO IT
JR PPIDE_INITPDEV1 ; AND LOOP
;
; RETURN NOT SUPPORTED STATUS
JP PPIDE_NOTSUP ; NOT SUPPORTED
PPIDE_INITPDEV2:
#IF (PPIDETRACE >= 3)
LD A,B
NEG
PRTS("\r\nLOOPS=$")
CALL PRTHEXBYTE
#ENDIF
;
; ; RECORD STATUS OK
; XOR A ; A := 0 (STATUS = OK)
; LD (IY+PPIDE_STAT),A ; SAVE IT
; RET
; GET AND RECORD CAPACITY
LD HL,HB_WRKBUF
LD (PPIDE_DSKBUF),HL
LD HL,PPIDE_PKTCMD_RDCAP
XOR A ; READ DIRECTION
LD (PPIDE_XFRDIR),A ; SAVE IT
CALL PPIDE_RUNPCMD
JP NZ,PPIDE_CHKPCMD
;
#IF (PPIDETRACE >= 3)
PRTS("\r\nRDCAP:$")
LD A,8
LD DE,HB_WRKBUF
CALL PRTHEXBUF
#ENDIF
;
; CAPACITY IS RETURNED IN A 4 BYTE, BIG ENDIAN FIELD AND
; INDICATES THE LAST LBA VALUE. WE NEED TO CONVERT THIS TO
; LITTLE ENDIAN AND INCREMENT THE VALUE TO MAKE IT A CAPACITY
; COUNT INSTEAD OF A LAST LBA VALUE.
LD A,PPIDE_MEDCAP ; OFFSET IN CFG FOR CAPACITY
CALL LDHLIYA ; POINTER TO HL
PUSH HL ; SAVE IT
LD HL,HB_WRKBUF ; POINT TO VALUE IN CMD RESULT
CALL LD32 ; LOAD IT TO DE:HL
LD A,L ; FLIP BYTES
LD L,D ; ... BIG ENDIAN
LD D,A ; ... TO LITTLE ENDIAN
LD A,H
LD H,E
LD E,A
CALL INC32 ; INCREMENT TO FINAL VALUE
POP BC ; RECOVER SAVE LOCATION
CALL ST32 ; STORE VALUE
;
; CHECK BLOCK LENGTH. WE CURRENTLY ONLY SUPPORT 512 BYTE
; BLOCKS. CD-ROM DEVICES (WHICH USE 2k BLOCKS) WILL FAIL
; HERE AS NOT SUPPORTED.
LD HL,HB_WRKBUF+4 ; POINT TO BLK SIZE IN RESULT
CALL LD32 ; LOAD IT TO DE:HL
; VALUE IS BIG ENDIAN, SO LH:ED MUST BE EXACTLY 0000:0200
LD A,L ; CHECK THAT LH
OR H ; ... IS ZERO
JP NZ,PPIDE_NOTSUP ; IF NOT, FAIL AS NOT SUP
LD A,D ; LOAD D
OR A ; SET FLAGS
JP NZ,PPIDE_NOTSUP ; IF NOT ZERO, FAIL AS NOT SUP
LD A,E ; LOAD E
CP 2 ; CHECK IT IF IS 2
JP NZ,PPIDE_NOTSUP ; IF NOT, FAIL AS NOT SUP
;
; RECORD STATUS OK
XOR A ; A := 0 (STATUS = OK)
LD (IY+PPIDE_STAT),A ; SAVE IT
RET
;
; SWITCH IY POINTER FROM CURRENT UNIT CFG TO PARTNER UNIT CFG
;
@@ -1535,19 +1830,19 @@ PPIDE_IN:
EX (SP),HL ; GET PARM POINTER ; 19TS
PUSH BC ; SAVE INCOMING BC ; 11TS
LD A,PPIDE_DIR_READ ; SET DATA BUS DIRECTION TO READ ; 7TS
;OUT (PPIDE_IO_PPI),A ; DO IT
;OUT (PPIDE_REG_PPI),A ; DO IT
LD C,(IY+PPIDE_PPI) ; PPI CONTROL WORD ; 19TS
OUT (C),A ; WRITE IT ; 12TS
;
LD B,(HL) ; GET CTL PORT VALUE ; 7TS
;LD C,PPIDE_IO_CTL ; SETUP PORT TO WRITE
;LD C,PPIDE_REG_CTL ; SETUP PORT TO WRITE
;LD C,(IY+PPIDE_CTL) ; SET IDE ADDRESS
DEC C ; SET IDE ADDRESS ; 4TS
OUT (C),B ; SET ADDRESS LINES ; 12TS
SET 6,B ; TURN ON READ BIT ; 8TS
OUT (C),B ; ASSERT READ LINE ; 12TS
;
;IN A,(PPIDE_IO_DATALO) ; GET DATA VALUE FROM DEVICE
;IN A,(PPIDE_REG_DATALO) ; GET DATA VALUE FROM DEVICE
DEC C ; 4TS
DEC C ; 4TS
IN A,(C) ; GET DATA VALUE FROM DEVICE ; 12
@@ -1569,13 +1864,13 @@ PPIDE_OUT:
PUSH BC ; SAVE INCOMING BC
PUSH AF ; PRESERVE INCOMING VALUE
LD A,PPIDE_DIR_WRITE ; SET DATA BUS DIRECTION TO WRITE
;OUT (PPIDE_IO_PPI),A ; DO IT
;OUT (PPIDE_REG_PPI),A ; DO IT
LD C,(IY+PPIDE_PPI) ; PPI CONTROL WORD
OUT (C),A ; WRITE IT
POP AF ; RECOVER VALUE TO WRITE
;
LD B,(HL) ; GET IDE ADDRESS VALUE
;LD C,PPIDE_IO_CTL ; SETUP PORT TO WRITE
;LD C,PPIDE_REG_CTL ; SETUP PORT TO WRITE
;LD C,(IY+PPIDE_CTL) ; SET IDE ADDRESS
DEC C ; SET IDE ADDRESS
OUT (C),B ; SET ADDRESS LINES
@@ -1584,7 +1879,7 @@ PPIDE_OUT:
;
DEC C
DEC C
;OUT (PPIDE_IO_DATALO),A ; SEND DATA VALUE TO DEVICE
;OUT (PPIDE_REG_DATALO),A ; SEND DATA VALUE TO DEVICE
OUT (C),A ; SEND DATA VALUE TO DEVICE
INC C
INC C
@@ -1634,6 +1929,10 @@ PPIDE_NOTSUP:
LD A,PPIDE_STNOTSUP
JR PPIDE_ERR
;
PPIDE_NOTRDY:
LD A,PPIDE_STNOTRDY
JR PPIDE_ERR
;
PPIDE_ERR:
LD (IY+PPIDE_STAT),A ; SAVE NEW STATUS
;
@@ -1706,6 +2005,9 @@ PPIDE_PRTSTATSTR:
INC A
LD DE,PPIDE_STR_STNOTSUP
JR Z,PPIDE_PRTSTATSTR1
INC A
LD DE,PPIDE_STR_STNOTRDY
JR Z,PPIDE_PRTSTATSTR1
LD DE,PPIDE_STR_STUNK
PPIDE_PRTSTATSTR1:
CALL WRITESTR
@@ -1723,7 +2025,7 @@ PPIDE_REGDUMP:
CALL PC_SPACE
CALL PC_LBKT
LD A,PPIDE_DIR_READ ; SET DATA BUS DIRECTION TO READ
;OUT (PPIDE_IO_PPI),A ; DO IT
;OUT (PPIDE_REG_PPI),A ; DO IT
LD C,(IY+PPIDE_PPI) ; PPI CONTROL WORD
OUT (C),A ; WRITE IT
LD C,(IY+PPIDE_CTL) ; SET IDE ADDRESS
@@ -1731,12 +2033,12 @@ PPIDE_REGDUMP:
LD B,7
PPIDE_REGDUMP1:
LD A,E ; REGISTER ADDRESS
;OUT (PPIDE_IO_CTL),A ; SET IT
;OUT (PPIDE_REG_CTL),A ; SET IT
OUT (C),A ; REGISTER ADDRESS
XOR PPIDE_CTL_DIOR ; SET BIT TO ASSERT READ LINE
;OUT (PPIDE_IO_CTL),A ; ASSERT READ
;OUT (PPIDE_REG_CTL),A ; ASSERT READ
OUT (C),A ; ASSERT READ
;IN A,(PPIDE_IO_DATALO) ; GET VALUE
;IN A,(PPIDE_REG_DATALO) ; GET VALUE
DEC C ; CTL -> MSB
DEC C ; MSB -> LSB
IN A,(C) ; GET VALUE
@@ -1744,7 +2046,7 @@ PPIDE_REGDUMP1:
INC C ; MSB -> CTL
CALL PRTHEXBYTE ; DISPLAY IT
;LD A,C ; RELOAD ADDRESS W/ READ UNASSERTED
;OUT (PPIDE_IO_CTL),A ; AND SET IT
;OUT (PPIDE_REG_CTL),A ; AND SET IT
OUT (C),E ; RELOAD ADDRESS W/ READ UNASSERTED
;DEC C ; NEXT LOWER REGISTER
DEC E ; NEXT LOWER REGISTER
@@ -1785,6 +2087,7 @@ PPIDE_STR_STRDYTO .TEXT "READY TIMEOUT$"
PPIDE_STR_STDRQTO .TEXT "DRQ TIMEOUT$"
PPIDE_STR_STBSYTO .TEXT "BUSY TIMEOUT$"
PPIDE_STR_STNOTSUP .TEXT "NOT SUPPORTED$"
PPIDE_STR_STNOTRDY .TEXT "NOT READY$"
PPIDE_STR_STUNK .TEXT "UNKNOWN ERROR$"
;
PPIDE_STR_NO .TEXT "NO$"
@@ -1806,5 +2109,14 @@ PPIDE_IOFNADR .DW 0 ; PENDING IO FUNCTION ADDRESS
PPIDE_DRVHD .DB 0 ; CURRENT DRIVE/HEAD MASK
;
PPIDE_DSKBUF .DW 0 ; ACTIVE DISK BUFFER
PPIDE_XFRDIR .DB 0 ; 0=READ, NON-0=WRITE
;
PPIDE_DEVNUM .DB 0 ; TEMP DEVICE NUM USED DURING INIT
;
; SCSI COMMAND TEMPLATES (ALWAYS 12 BYTES FOR ATAPI)
;
PPIDE_PKTCMD_RW .DB $00, $00, $00, $00, $01, $00, $00, $00, $00, $00, $00, $00 ; READ/WRITE SECTOR
PPIDE_PKTCMD_SENSE .DB $03, $00, $00, $00, $FF, $00, $00, $00, $00, $00, $00, $00 ; REQUEST SENSE DATA
PPIDE_PKTCMD_RDCAP .DB $25, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 ; READ CAPACITY
PPIDE_PKTCMD_RW10 .DB $28, $00, $00, $00, $00, $00, $00, $00, $01, $00, $00, $00 ; READ/WRITE SECTOR
PPIDE_PKTCMD_TSTRDY .DB $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 ; TEST UNIT READY

View File

@@ -904,7 +904,7 @@ PPPSD_GETCSD:
CALL PPP_SNDCMD ; SEND COMMAND
RET NZ ; ABORT ON ERROR
LD B,16 ; GET 4 BYTES
LD B,16 ; GET 16 BYTES
LD HL,PPPSD_CSDBUF
PPPSD_GETCSD1:
CALL PPP_GETBYTE

View File

@@ -180,7 +180,7 @@ start1:
call pstr ; do it
call clrbuf ; zero fill the cmd buffer
;
#if (BIOS == BIOS_WBW)
#if ((BIOS == BIOS_WBW) & FPSW_ENABLE)
;
ld b,BF_SYSGET ; HBIOS SysGet
ld c,BF_SYSGET_PANEL ; ... Panel swiches value
@@ -390,7 +390,7 @@ runcmd2:
ld (bootslice),a ; save boot slice
jp diskboot ; boot the disk unit/slice
;
#if (BIOS == BIOS_WBW)
#if ((BIOS == BIOS_WBW) & FPSW_ENABLE)
;
;=======================================================================
; Process Front Panel switches

View File

@@ -245,9 +245,27 @@ GDCMODE_RPH .EQU 2 ; RPH GDC
; LPT DRIVER MODE SELECTIONS
;
LPTMODE_NONE .EQU 0 ; NONE
LPTMODE_IBM .EQU 1 ; IBM STYLE INTERFACE
LPTMODE_SPP .EQU 1 ; IBM PC STANDARD PAR PORT (SPP)
LPTMODE_MG014 .EQU 2 ; RCBUS MG014 STYLE INTERFACE
;
; PPA DRIVER MODE SELECTIONS
;
PPAMODE_NONE .EQU 0 ; NONE
PPAMODE_SPP .EQU 1 ; IBM PC STANDARD PAR PORT (SPP)
PPAMODE_MG014 .EQU 2 ; RCBUS MG014 STYLE INTERFACE
;
; IMM DRIVER MODE SELECTIONS
;
IMMMODE_NONE .EQU 0 ; NONE
IMMMODE_SPP .EQU 1 ; IBM PC STANDARD PAR PORT (SPP)
IMMMODE_MG014 .EQU 2 ; RCBUS MG014 STYLE INTERFACE
;
; SYQ DRIVER MODE SELECTIONS
;
SYQMODE_NONE .EQU 0 ; NONE
SYQMODE_SPP .EQU 1 ; IBM PC STANDARD PAR PORT (SPP)
SYQMODE_MG014 .EQU 2 ; RCBUS MG014 STYLE INTERFACE
;
; GDC MONITOR SELECTIONS
;
GDCMON_NONE .EQU 0
@@ -437,6 +455,18 @@ SPD_UNSUP .EQU 0 ; PLATFORM CAN CHANGE SPEEDS BUT IS UNSUPPORTED
SPD_HIGH .EQU 1 ; PLATFORM CAN CHANGE SPEED, STARTS HIGH
SPD_LOW .EQU 2 ; PLATFORM CAN CHANGE SPEED, STARTS LOW
;
; SCSI COMMAND CODES (SHOULD BE IT IT'S OWN FILE)
;
SCSI_CMD_TSTRDY .EQU $00
SCSI_CMD_SENSE .EQU $03
SCSI_CMD_READ .EQU $08
SCSI_CMD_WRITE .EQU $0A
SCSI_CMD_INQ .EQU $12
SCSI_CMD_START .EQU $1B
SCSI_CMD_RDCAP .EQU $25
SCSI_CMD_READ10 .EQU $28
SCSI_CMD_WRITE10 .EQU $2A
;
#INCLUDE "build.inc" ; INCLUDE USER CONFIG, ADD VARIANT, TIMESTAMP, & ROMSIZE
;
; INCLUDE Z180 REGISTER DEFINITIONS

1464
Source/HBIOS/syq.asm Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -14,6 +14,13 @@ call BuildDisk.cmd cpm3 fd wbw_fd144 ..\cpm3\cpmldr.sys || exit /b
call BuildDisk.cmd zpm3 fd wbw_fd144 ..\zpm3\zpmldr.sys || exit /b
call BuildDisk.cmd ws4 fd wbw_fd144 || exit /b
call BuildDisk.cmd qpm fd wbw_fd144 d_qpm\u0\qpm.sys || exit /b
call BuildDisk.cmd z80asm hd wbw_fd144 || exit /b
call BuildDisk.cmd aztecc hd wbw_fd144 || exit /b
call BuildDisk.cmd hitechc hd wbw_fd144 || exit /b
call BuildDisk.cmd tpascal hd wbw_fd144 || exit /b
call BuildDisk.cmd bascomp hd wbw_fd144 || exit /b
call BuildDisk.cmd fortran hd wbw_fd144 || exit /b
call BuildDisk.cmd games hd wbw_fd144 || exit /b
echo.
echo Building Hard Disk Images (512 directory entry format)...
@@ -26,6 +33,13 @@ call BuildDisk.cmd zpm3 hd wbw_hd512 ..\zpm3\zpmldr.sys || exit /b
call BuildDisk.cmd ws4 hd wbw_hd512 || exit /b
call BuildDisk.cmd dos65 hd wbw_hd512 ..\zsdos\zsys_wbw.sys || exit /b
call BuildDisk.cmd qpm hd wbw_hd512 d_qpm\u0\qpm.sys || exit /b
call BuildDisk.cmd z80asm hd wbw_hd512 || exit /b
call BuildDisk.cmd aztecc hd wbw_hd512 || exit /b
call BuildDisk.cmd hitechc hd wbw_hd512 || exit /b
call BuildDisk.cmd tpascal hd wbw_hd512 || exit /b
call BuildDisk.cmd bascomp hd wbw_hd512 || exit /b
call BuildDisk.cmd fortran hd wbw_hd512 || exit /b
call BuildDisk.cmd games hd wbw_hd512 || exit /b
if exist ..\BPBIOS\bpbio-ww.rel call BuildDisk.cmd bp hd wbw_hd512 || exit /b
@@ -43,6 +57,13 @@ call BuildDisk.cmd cpm3 hd wbw_hd1k ..\cpm3\cpmldr.sys || exit /b
call BuildDisk.cmd zpm3 hd wbw_hd1k ..\zpm3\zpmldr.sys || exit /b
call BuildDisk.cmd ws4 hd wbw_hd1k || exit /b
call BuildDisk.cmd qpm hd wbw_hd1k d_qpm\u0\qpm.sys || exit /b
call BuildDisk.cmd z80asm hd wbw_hd1k || exit /b
call BuildDisk.cmd aztecc hd wbw_hd1k || exit /b
call BuildDisk.cmd hitechc hd wbw_hd1k || exit /b
call BuildDisk.cmd tpascal hd wbw_hd1k || exit /b
call BuildDisk.cmd bascomp hd wbw_hd1k || exit /b
call BuildDisk.cmd fortran hd wbw_hd1k || exit /b
call BuildDisk.cmd games hd wbw_hd1k || exit /b
if exist ..\BPBIOS\bpbio-ww.rel call BuildDisk.cmd bp hd wbw_hd1k || exit /b

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,369 @@
BBC BASIC (Z80)
Generic CP/M Version 3.00
(C) Copyright R.T.Russell 1982-1999
1. INTRODUCTION
BBC BASIC (Z80) has been designed to be as compatible as possible with
Version 4 of the 6502 BBC BASIC resident in the BBC Micro Master series.
The language syntax is not always identical to that of the 6502 version,
but in most cases the Z80 version is more tolerant.
BBC BASIC (Z80) is as machine independent as possible and, as supplied,
it will run on any CP/M 2.2 (or later) system using a Z80 processor
(checks are carried out to ensure that the processor is a Z80 and that
the version of CP/M is at least 2.2). It is minimally configured for an
ADM3a-compatible VDU.
Few CP/M systems offer colour graphics of the quality provided as
standard on the BBC Microcomputer, and no software can provide colour
high-resolution graphics from a monochrome character-orientated computer.
However, many CP/M system users are interested in the advanced program
structures available from BBC BASIC and, within the limitations of the
host computer, BBC BASIC (Z80) provides the programming structures and
the non-graphic commands and functions specified for BBC BASIC.
In order to make full use of the facilities available in BBC BASIC (Z80)
it is necessary to install a small patch to adapt it to the capabilities
of the host computer. The source code of the patch present in the
distribution version is supplied as BBCDIST.MAC.
This documentation should be read in conjunction with a standard BBC
BASIC manual. Only those features which differ from the standard Acorn
versions are documented here.
2. MEMORY UTILISATION
BBC BASIC (Z80) requires about 16 Kbytes of code space, resulting in a
value of PAGE of about &3E00. The remainder of the user memory is
available for BASIC programs, variables (heap) and stack. Depending on
the system configuration, HIMEM can have a value up to &FE00.
3. COMMANDS, STATEMENTS AND FUNCTIONS
The syntax of BASIC commands, statements and functions is in most cases
identical to that of the BBC Micro version (BASIC 4). The few
differences are documented here:
ADVAL
This function is not implemented.
CALL
CALL sets up a table in RAM containing details of the parameters; the
processor's IX register is set to the address of this parameter table.
The other processor registers are initialised as follows:
A is initialised to the least significant byte of A%
B is initialised to the least significant byte of B%
C is initialised to the least significant byte of C%
D is initialised to the least significant byte of D%
E is initialised to the least significant byte of E%
F is initialised to the least significant byte of F%
H is initialised to the least significant byte of H%
L is initialised to the least significant byte of L%
The parameter types are:
Code No. Parameter Type Example
0 Byte (8 bits) ?A%
4 Word (32 bits) !A% or A%
5 Real (40 bits) A
128 Fixed string $A%
129 Movable string A$
On entry to the subroutine the parameter table contains the following
values:
Number of parameters 1 byte (at IX)
Parameter type 1 byte (at IX+1)
Parameter address 2 bytes (at IX+2, IX+3, LSB first)
Parameter type ) repeated as often as necessary
Parameter address )
Except in the case of a movable string (normal string variable), the
parameter address given is the absolute address at which the item is
stored. In the case of movable strings (type 129) it is the address of a
4-byte parameter block containing the current length, the maximum length
and the start address of the string (LSB first) in that order.
Integer variables are stored in twos complement form with their least
significant byte first.
Fixed strings are stored as the characters of the string followed by a
carriage return (&0D).
Floating point variables are stored in binary floating point format with
their least significant byte first; the fifth byte is the exponent. The
mantissa is stored as a binary fraction in sign and magnitude format.
Bit 7 of the most significant byte is the sign bit and, for the purposes
of calculating the magnitude of the number, this bit is assumed to be set
to one. The exponent is stored as an integer in excess 127 format (to
find the exponent subtract 127 from the value in the fifth byte).
If the exponent byte of a floating point number is zero, the number is an
integer stored in integer format in the mantissa bytes. Thus an integer
can be represented in two different ways in a real variable. For example
the value +5 can be stored as:
05 00 00 00 00 Integer 5
00 00 00 20 82 (0.5 + 0.125) * 2^3
COLOUR (COLOR)
This statement is not implemented.
DRAW
This statement is not implemented.
EDIT
A command to edit or concatenate and edit the specified program line(s).
The specified lines (including their line numbers) are listed as a single
line. By changing only the line number you can use EDIT to duplicate a
line.
EDIT 230
EDIT 200,230
The following control functions are active both in the EDIT mode and in
the immediate entry mode (i.e. at the BASIC prompt):
Move the cursor one character position to the left
Move the cursor one character position to the right
Move the cursor to the start of the line
Move the cursor to the end of the line
Insert a space at the current cursor position
Delete the character at the current cursor position
Backspace and delete the character to the left of the cursor
Delete all characters to the left of the cursor
Delete all characters from the cursor to the end of the line
The choice of which keys activate these functions is made when BBC BASIC
is configured for a particular system. The distribution version uses ^H,
^I, ^K, ^J, ^A, ^E, DEL (&7F), ^L and ^X.
To exit EDIT mode and replace the edited line, type RETURN (ENTER).
To abort the edit and leave the line unchanged, type ESCape.
ENVELOPE
This statement is not implemented.
GET
This function waits for a character to be typed at the keyboard, and
returns the ASCII code.
GET can also be used to read data from a processor I/O port; full 16-bit
port addressing is available:
N% = GET(X%) : REM input from port X%
INKEY
This function waits for a specified maximum number of centiseconds for a
character to be typed at the keyboard. If no character is typed in that
time, the value -1 is returned. In the distribution version the delay is
determined by a simple software timing loop, and may be very inaccurate.
The customisation patch allows this to be adjusted to suit the system in
use.
INPUT#
The format of data files is different from that used by the BBC Micro, in
part to improve compatibility with standard CP/M files. Numeric values
are stored as five bytes in the format documented under CALL; if the
fifth byte is zero the value is an integer. Strings are stored as the
characters of the string (in the correct order!) followed by a carriage
return (&0D).
MODE
This statement is not implemented.
MOVE
This statement is not implemented.
PLOT
This statement is not implemented.
POINT
This function is not implemented.
PRINT#
The format of data files is different from that used by the BBC Micro, in
part to improve compatibility with standard CP/M files. Numeric values
are stored as five bytes in the format documented under CALL; if the
fifth byte is zero the value is an integer. Strings are stored as the
characters of the string (in the correct order!) followed by a carriage
return (&0D).
PUT
A statement to output data to a processor port. Full 16-bit addressing
is available.
PUT A%,N% : REM Output N% to port A%
SOUND
This statement is not implemented.
TIME
This pseudo-variable is not implemented in the distribution version, but
can be supported by means of the customisation patch. See BBCDIST.MAC.
USR
As with CALL, the processor's registers are initialised as follows:
A is initialised to the least significant byte of A%
B is initialised to the least significant byte of B%
C is initialised to the least significant byte of C%
D is initialised to the least significant byte of D%
E is initialised to the least significant byte of E%
F is initialised to the least significant byte of F%
H is initialised to the least significant byte of H%
L is initialised to the least significant byte of L%
USR returns a 32-bit integer result composed of the processor's H, L, H'
and L' registers, with H being the most significant.
4. RESIDENT Z80 ASSEMBLER
The in-line assembler is accessed in exactly the same way as the 6502
assembler in the BBC Micro version of BBC BASIC. That is, '[' enters
assembler mode and ']' exits assembler mode.
All standard Zilog mnemonics are accepted: ADD, ADC and SBC must be
followed by A or HL. For example, ADD A,C is accepted but ADD C is not.
However, the brackets around the port number in IN and OUT are optional.
Thus both OUT (5),A and OUT 5,A are accepted. The instruction IN F,(C)
is not accepted, but the equivalent code is produced from IN (HL),C
The pseudo-ops DEFB, DEFW and DEFM are included. DEFM works like EQUS in
the 6502 version.
5. OPERATING SYSTEM INTERFACE
The following resident Operating System ("star") commands are
implemented. They may be accessed directly (e.g. *BYE) or via the OSCLI
statement (OSCLI "BYE").
Control characters, lower-case characters, DEL and quotation marks may be
incorporated in filenames by using the 'escape' character '|'. However,
there is no equivalent to the BBC Microcomputer's '|!' to set bit 7.
*BYE
Returns control to the operating system (CP/M).
*CPM
Same as *BYE.
*. [filespec]
*DIR [filespec]
List the files which match the (optional) ambiguous filespec. If the
filespec is omitted, all .BBC files are listed:
*DIR List all .BBC files on the disk
*DIR B:*.* List all files on disk B:
*.*.* List all files on the current disk
*DRIVE d:
Select drive d as the default drive for subsequent disk operations.
*ERA filespec
Erase (delete) the specified disk file or files. The extension defaults
to .BBC if omitted.
*ESC [ON|OFF]
*ESC OFF disables the abort action of the ESCape key; after *ESC OFF the
ESCape key simply returns the ASCII code ESC (27). *ESC ON, or *ESC,
restores the normal action of the ESCape key.
*EXEC filespec
Accept console input from the specified file instead of from the
keyboard. If the extension is omitted, .BBC is assumed.
*LOAD filespec aaaa
Loads the specified file into memory at address aaaa. The load address
must be specified. If the extension is omitted, .BBC is assumed.
*OPT [n]
Select the destination for console output characters. The value n is in
the range 0 to 2, as follows:
0 Send characters to the console output
1 Send characters to the auxiliary output
2 Send characters to the printer (list) output
*REN newfile=oldfile
*RENAME newfile=oldfile
Renames 'oldfile' as 'newfile'. If the extension is omitted, .BBC is
assumed.
*RESET
Rest the disk system (CP/M function 13). This command does not close any
files nor does it perform any other housekeeping function. You should
use *RESET after you have changed a disk.
*SAVE filespec aaaa bbbb
*SAVE filespec aaaa +llll
This command saves a specified range of memory to disk. The address range
is specified either as start (aaaa) and end+1 (bbbb) or as start (aaaa)
and length (llll). If the extension is omitted, .BBC is assumed.
*SPOOL [filespec]
Copy all subsequent console output to the specified file. If the filename
is omitted, any current spool file is closed and spooling is terminated.
If the extension is omitted, .BBC is assumed.
*TYPE filespec
Type the specified file to the screen. If the extension is omitted, .BBC
is assumed.
*| comment
This is a comment line. Anything following the | is ignored.
6. ERROR MESSAGES AND CODES
Untrappable:
No room RENUMBER space
Silly LINE space
Sorry Bad program
Trappable - BASIC:
1 Out of range 24 Exp range
2 25
3 26 No such variable
4 Mistake 27 Missing )
5 Missing , 28 Bad HEX
6 Type mismatch 29 No such FN/PROC
7 No FN 30 Bad call
8 31 Arguments
9 Missing " 32 No FOR
10 Bad DIM 33 Can't match FOR
11 DIM space 34 FOR variable
12 Not LOCAL 35
13 No PROC 36 No TO
14 Array 37
15 Subscript 38 No GOSUB
16 Syntax error 39 ON syntax
17 Escape 40 ON range
18 Division by zero 41 No such line
19 String too long 42 Out of DATA
20 Too big 43 No REPEAT
21 -ve root 44
22 Log range 45 Missing #
23 Accuracy lost
Trappable - OS:
190 Directory full 214 File not found
192 Too many open files 222 Channel
196 File exists 253 Bad string
198 Disk full 254 Bad command
200 Close error 255 CP/M error
204 Bad name


View File

@@ -0,0 +1,225 @@
TITLE BBCDIST.Z80 (C) R.T.RUSSELL 1982
;
;BBC BASIC (Z80) - CP/M VERSION 2.30 & 3.00
;(C) COPYRIGHT R.T.RUSSELL, 1982.
;ALL RIGHTS RESERVED.
;
;THIS PROGRAM ALLOWS THE USER TO ADAPT BBC BASIC TO THE
;PARTICULAR CHARACTERISTICS OF HIS SYSTEM HARDWARE ETC.
;
;THE PROGRAM RESIDES AT 100H FOR EASE OF LOADING.
;*** IT MUST NOT EXCEED 256 BYTES IN TOTAL LENGTH ***
;
;PLEASE NOTE THAT A Z80 PROCESSOR AND CP/M VERSION 2.2
;OR LATER ARE REQUIRED.
;
;R.T.RUSSELL, 11-03-1984, 03-05-1989
;ALTERNATE REGISTERS SAVED FOR BDOS CALL, 04-06-2000
;
CPM EQU 5
COLD EQU 200H
;
GLOBAL CLRSCN
GLOBAL PUTCSR
GLOBAL GETCSR
GLOBAL PUTIME
GLOBAL GETIME
GLOBAL GETKEY
GLOBAL BYE
;
ASEG
ORG 100H
;
;JUMP TABLE - BASIC makes calls to hardware-dependent
;features via this table:
;
JP INIT
CLRSCN: JP CLS ;CLEAR SCREEN
PUTCSR: JP PCSR ;SET CURSOR POSN.
GETCSR: JP GCSR ;READ CURSOR POSN.
PUTIME: JP PTIME ;SET ELAPSED TIME
GETIME: JP GTIME ;READ ELAPSED TIME
GETKEY: JP INKEY ;READ KEY (TIME LIMIT)
BYE: JP REBOOT ;RETURN TO CP/M
;
;THE CODE WHICH FOLLOWS IS A SKELETON VERSION SUITABLE
;FOR ANY CP/M SYSTEM. IT HAS BEEN CONFIGURED FOR A VT100 TO SOME DEGREE
;BY PETER SCHORN.
;
PRSTR EQU 9
;INIT - Perform hardware initialisation (if any).
;
INIT: LD A,2
INC A
LD DE,NOTZ80
JP PE,FAIL
LD C,12
CALL BDOS
OR A
LD DE,NOTV2
JP NZ,COLD
FAIL: LD C,PRSTR
CALL BDOS
RST 0
;
NOTZ80: DEFB 'Wrong processor$'
NOTV2: DEFB 'Wrong CP/M version$'
;
;REBOOT - Switch off interrupts and return to CP/M
;
REBOOT: RST 0
;
;GTIME - Read elapsed-time clock.
; Outputs: DEHL = elapsed time (centiseconds)
; Destroys: A,D,E,H,L,F
;
GTIME: LD DE,0
LD HL,0
RET
;
;PTIME - Load elapsed-time clock.
; Inputs: DEHL = time to load (centiseconds)
; Destroys: A,D,E,H,L,F
;
PTIME: RET
;
;CLS - Clear screen for VT100.
; Destroys: A,D,E,H,L,F
;
CLS: PUSH BC ; save BC
LD C,PRSTR ; command for output string
LD DE,CLSSTR ; start address of string
CALL BDOS ; output to terminal
POP BC ; restore BC
RET
CLSSTR: DEFB 27,'[2J$' ; VT100 string for clear screen
;
;INKEY - Sample keyboard with specified wait.
; This version uses a simple software timing loop.
; Modify to use hardware/interrupt timer if available.
; Inputs: HL = Time to wait (centiseconds)
; Outputs: Carry reset indicates time-out.
; If carry set, A = character typed.
; Destroys: A,D,E,H,L,F
;
INKEY: PUSH BC
PUSH HL
LD C,6
LD E,0FFH
CALL BDOS ;CONSOLE INPUT
POP HL
POP BC
OR A
SCF
RET NZ ;KEY PRESSED
OR H
OR L
RET Z ;TIME-OUT
PUSH BC
LD A,-1
LD BC,1250 ;DELAY CONSTANT
WAIT: DEC BC
CP B
JP NZ,WAIT ;WAIT FOR APPROX 10ms
POP BC
DEC HL
JR INKEY
;
;PCSR - Move cursor to specified position.
; Inputs: DE = horizontal position (LHS=0)
; HL = vertical position (TOP=0)
; called by TAB(column, row)
PCSR: LD B,L ; vertical = line (row)
CALL CONV ; normalized and convert to decimal
LD (LIN),HL ; and store into string
LD B,E ; horizontal = column
CALL CONV ; normalized and convert to decimal
LD (COL),HL ; and store into string
LD C,PRSTR ; output string command
LD DE,CURS ; start of string
JR BDOS ; output string to terminal
; VT100 sequence for cursor positioning
CURS: DEFB 27, '['
LIN: DEFW 0 ; high byte, low byte for decimal line
DEFB ';'
COL: DEFW 0 ; high byte, low byte for decimal column
DEFB 'H$'
; convert binary B (0 <= B < 99, not checked) into B+1 in decimal.
; L = upper byte, H = lower byte. ready for LD (...), HL
; destroys A, B, L, H
; optimized for space over time
CONV: INC B ; normalize, home in VT100 is (1,1)
LD A,'0' ; A is counter for low byte of result
LD L,A ; L is counter for high byte of result
CONVLP: INC A ; now B times increment AL in decimal
CP '9'+1 ; low byte overflow?
JR NZ,CONT ; no, continue incrementing
LD A,'0' ; reset low byte
INC L ; and increment high byte
CONT: DJNZ CONVLP ; B times
LD H,A ; put low byte into right place
RET
;BDOS - Save the IX and IY and alternate registers
; before performing a CP/M function call.
;
BDOS: PUSH IX
PUSH IY
EXX
PUSH BC
PUSH DE
PUSH HL
EXX
EX AF,AF'
PUSH AF
EX AF,AF'
CALL CPM
EX AF,AF'
POP AF
EX AF,AF'
EXX
POP HL
POP DE
POP BC
EXX
POP IY
POP IX
RET
;GCSR - Return cursor coordinates.
; Outputs: DE = X coordinate (POS)
; HL = Y coordinate (VPOS)
; Destroys: A,D,E,H,L,F
;
GCSR: LD DE,0
LD HL,0
RET
;
IF $ GT 1F4H
ERROR 'INSUFFICIENT SPACE'
ENDIF
;
ORG 1F4H
;
DEFB 80 ;WIDTH
DEFB 'E' AND 1FH ;CURSOR UP
DEFB 'X' AND 1FH ;CURSOR DOWN
DEFB 'A' AND 1FH ;START OF LINE
DEFB 'F' AND 1FH ;END OF LINE
DEFB 'T' AND 1FH ;DELETE TO END OF LINE
DEFB 'H' AND 1FH ;BACKSPACE
DEFB 'U' AND 1FH ;CANCEL LINE
DEFB 'S' AND 1FH ;CURSOR LEFT
DEFB 'D' AND 1FH ;CURSOR RIGHT
DEFB 'G' AND 1FH ;DELETE CHARACTER
DEFB 'V' AND 1FH ;INSERT CHARACTER
;
FIN: END


View File

@@ -0,0 +1,13 @@
; patch BBCBASIC with BBCDIST
; need M80 and L80
xsub
m80 =bbcdist/z
l80 bbcdist,bbcdist/n/e
ddt bbcbasic.org
ibbcdist.com
r
g0
save 58 bbcbasic.com
era bbcdist.rel
era bbcdist.com


Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -4,20 +4,29 @@
SYSTEMS = ../CPM22/cpm_wbw.sys ../ZSDOS/zsys_wbw.sys ../CPM3/cpmldr.sys ../ZPM3/zpmldr.sys
FDIMGS = fd144_cpm22.img fd144_zsdos.img fd144_nzcom.img \
fd144_cpm3.img fd144_zpm3.img fd144_ws4.img fd144_qpm.img
fd144_cpm3.img fd144_zpm3.img fd144_ws4.img fd144_qpm.img \
fd144_z80asm.img fd144_aztecc.img fd144_hitechc.img \
fd144_bascomp.img fd144_fortran.img fd144_games.img \
fd144_tpascal.img
HD512IMGS = hd512_cpm22.img hd512_zsdos.img hd512_nzcom.img \
hd512_cpm3.img hd512_zpm3.img hd512_ws4.img
HD512XIMGS = hd512_z80asm.img hd512_aztecc.img hd512_hitechc.img \
hd512_bascomp.img hd512_fortran.img hd512_games.img \
hd512_tpascal.img hd512_dos65.img hd512_qpm.img
# HDIMGS += hd512_bp.img
HD1KIMGS = hd1k_cpm22.img hd1k_zsdos.img hd1k_nzcom.img \
hd1k_cpm3.img hd1k_zpm3.img hd1k_ws4.img
HD1KXIMGS = hd1k_z80asm.img hd1k_aztecc.img hd1k_hitechc.img \
hd1k_bascomp.img hd1k_fortran.img hd1k_games.img \
hd1k_tpascal.img hd1k_qpm.img
# HD1KIMGS += hd1k_bp.img
HD512PREFIX =
HD1KPREFIX = hd1k_prefix.dat
OBJECTS = $(FDIMGS)
OBJECTS += $(HD512IMGS) hd512_combo.img hd512_dos65.img hd512_qpm.img$(HD512PREFIX)
OBJECTS += $(HD1KIMGS) hd1k_combo.img hd1k_qpm.img $(HD1KPREFIX)
OBJECTS += $(HD512IMGS) $(HD512XIMGS) hd512_combo.img $(HD512PREFIX)
OBJECTS += $(HD1KIMGS) $(HD1KXIMGS) hd1k_combo.img $(HD1KPREFIX)
OTHERS = blank144 blankhd512 blankhd1k
@@ -61,7 +70,7 @@ blankhd512:
@echo Making Blank HD512 of size $(HD512SIZE)k
@LC_ALL=en_US.US-ASCII tr '\000' '\345' </dev/zero | dd of=$@ bs=1024 count=$(HD512SIZE)
@hexdump $@
blankhd1k:
@echo Making Blank HD1K of size $(HD1KSIZE)k
@LC_ALL=en_US.US-ASCII tr '\000' '\345' </dev/zero | dd of=$@ bs=1024 count=$(HD1KSIZE)
@@ -122,7 +131,7 @@ clean::
@rm -f *.ls
imgdiff:
@for i in $(FDIMGS) $(HD512IMGS) $(HD1KIMGS) ; do \
@for i in $(FDIMGS) $(HD512IMGS) $(HD512XIMGS) $(HD1KIMGS) $(HD1KXIMGS) ; do \
echo $$i ; \
if echo $$i | grep -q ^fd144_ ; then \
fmt=wbw_fd144 ; \

View File

@@ -0,0 +1,26 @@
===== Aztec C II compiler v1.06D =====
Aztec C is a discontinued programming language for a variety of platforms
including MS-DOS, Apple II DOS 3.3 and PRoDOS, Commodore 64, Macintosh and
Amiga. This disk contains the CP/M version of that compiler. A cross-compiler
for MS-DOS or Windows XP is also available.
For full documentation, see https://www.aztecmuseum.ca/
The user manual is available in the Doc directory
Aztec_C_1.06_User_Manual_Mar84.pdf
== License ==
I herewith grant you a non-exclusive conditional licence to use any and
all of my work included with this compiler for whatever use you deem fit,
provided you do not take credit for my work, and that you leave my
copyright notices intact in all of it.
I believe everything I have written to be correct. Regardless, I, Bill
Buckels, do not guarantee, or warranty, in whole or in part, any of this,
and further do not offer support for any of this. All of this is provided
as-is.
Bill Buckels
bbuckels@mts.net

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,9 @@
main()
{
char buf[80];
printf("please enter your name: ");
gets(buf);
printf("hello, %s, welcome to the growing community of Aztec C users\n", buf);
}


View File

@@ -0,0 +1,267 @@
libc.h
/* Copyright (C) 1981, 1982 by Manx Software Systems */
extern int errno;
#define FLT_FAULT 0 /* vector for floating-point faults */
extern int (*Sysvec[])();
#define NULL 0
#define EOF -1
#define BUFSIZ 1024
#define _BUSY 0x01
#define _ALLBUF 0x02
#define _DIRTY 0x04
#define _EOF 0x08
#define _IOERR 0x10
typedef struct {
char *_bp; /* current position in buffer */
char *_bend; /* last character in buffer + 1 */
char *_buff; /* address of buffer */
char _flags; /* open mode, etc. */
char _unit; /* token returned by open */
char _bytbuf; /* single byte buffer for unbuffer streams */
int _buflen; /* length of buffer */
} FILE;
extern FILE Cbuffs[];
extern char *Stdbufs; /* free list of buffers */
long ftell();
#define stdin (&Cbuffs[0])
#define stdout (&Cbuffs[1])
#define stderr (&Cbuffs[2])
#define getchar() agetc(stdin)
#define putchar(c) aputc(c, stdout)
#define feof(fp) (((fp)->_flags&_EOF)!=0)
#define ferror(fp) (((fp)->_flags&_IOERR)!=0)
#define clearerr(fp) ((fp)->_flags &= ~(_IOERR|_EOF))
#define fileno(fp) ((fp)->_unit)
errno.h
extern int errno;
#define ENOENT -1
#define E2BIG -2
#define EBADF -3
#define ENOMEM -4
#define EEXIST -5
#define EINVAL -6
#define ENFILE -7
#define EMFILE -8
#define ENOTTY -9
#define EACCES -10
#define ERANGE -20
#define EDOM -21
fcntl.h
#define O_RDONLY 0
#define O_WRONLY 1
#define O_RDWR 2
#define O_CREAT 0x0100
#define O_TRUNC 0x0200
#define O_EXCL 0x0400
#define O_APPEND 0x0800
io.h
/* Copyright (C) 1982 by Manx Software Systems */
/*
* if MAXCHAN is changed then the initialization of chantab in croot.c
* should be adjusted so that it initializes EXACTLY MAXCHAN elements of
* the array. If this is not done, the I/O library may exhibit
* strange behavior.
*/
#define MAXCHAN 11 /* maximum number of I/O channels */
/*
* argument to device routines.
* this is a typedef to allow future redeclaration to guarantee
* enough space to store either a pointer or an integer.
*/
typedef char *_arg;
/*
* device control structure
*/
struct device {
char d_read;
char d_write;
char d_ioctl; /* used by character special devices (eg CON:) */
char d_seek; /* used by random I/O devices (eg: a file) */
int (*d_open)(); /* for special open handling */
};
/*
* device table, contains names and pointers to device entries
*/
struct devtabl {
char *d_name;
struct device *d_dev;
_arg d_arg;
};
/*
* channel table: relates fd's to devices
*/
struct channel {
char c_read;
char c_write;
char c_ioctl;
char c_seek;
int (*c_close)();
_arg c_arg;
} ;
extern struct channel chantab[MAXCHAN];
struct fcb {
char f_driv;
char f_name[8];
char f_type[3];
char f_ext;
char f_resv[2];
char f_rc;
char f_sydx[16];
char f_cr;
unsigned f_record; char f_overfl;
};
struct fcbtab {
struct fcb fcb;
char offset;
char flags;
char user;
};
#define OPNFIL 15
#define CLSFIL 16
#define DELFIL 19
#define READSQ 20
#define WRITSQ 21
#define MAKFIL 22
#define SETDMA 26
#define GETUSR 32
#define READRN 33
#define WRITRN 34
#define FILSIZ 35
#define SETREC 36
#define Wrkbuf ((char *)0x80)
math.h
double sin(), cos(), tan(), cotan();
double asin(), acos(), atan(), atan2();
double ldexp(), frexp(), modf();
double floor(), ceil();
double log(), log10(), exp(), sqrt(), pow();
double sinh(), cosh(), tanh(), fabs();
#define HUGE 5.2e+151
#define LOGHUGE 349.3
#define TINY 7.5e-155
#define LOGTINY -354.8
setjmp.h
/* Copyright (C) 1983 by Manx Software Systems */
#define JBUFSIZE (5*sizeof(int))
typedef char jmp_buf[JBUFSIZE];
sgtty.h
/* Copyright (C) 1983 by Manx Software Systems */
#define TIOCGETP 0 /* read contents of tty control structure */
#define TIOCSETP 1 /* set contents of tty control structure */
#define TIOCSETN 1 /* ditto only don't wait for output to flush */
struct sgttyb {
char sg_erase; /* ignored */
char sg_kill; /* ignored */
short sg_flags; /* control flags */
};
/* settings for flags */
#define _VALID 0x3a
#define RAW 0x20 /* no echo or mapping of input/output BDOS(6) */
#define CRMOD 0x10 /* map input CR to NL, output NL to CR LF */
#define ECHO 0x08 /* ignored unless CBREAK is set */
#define CBREAK 0x02 /* input using BDOS(1), unless echo off then */
/* same as RAW */
stdio.h
/* Copyright (C) 1982, 1984 by Manx Software Systems */
#define fgetc getc
#define fputc putc
#define NULL 0
#define EOF -1
#ifdef TINY
struct fcb {
char f_driv;
char f_name[8];
char f_type[3];
char f_ext;
char f_resv[2];
char f_rc;
char f_sydx[16];
char f_cr;
unsigned f_record; char f_overfl;
};
typedef struct {
char *_bp;
struct fcb _fcb;
char user;
} FILE;
#else
#define BUFSIZ 1024
#define MAXSTREAM 11
#define _BUSY 0x01
#define _ALLBUF 0x02
#define _DIRTY 0x04
#define _EOF 0x08
#define _IOERR 0x10
typedef struct {
char *_bp; /* current position in buffer */
char *_bend; /* last character in buffer + 1 */
char *_buff; /* address of buffer */
char _flags; /* open mode, etc. */
char _unit; /* token returned by open */
char _bytbuf; /* single byte buffer for unbuffer streams */
int _buflen; /* length of buffer */
} FILE;
extern FILE Cbuffs[];
FILE *fopen();
long ftell();
#define stdin (&Cbuffs[0])
#define stdout (&Cbuffs[1])
#define stderr (&Cbuffs[2])
#define getchar() agetc(stdin)
#define putchar(c) aputc(c, stdout)
#define feof(fp) (((fp)->_flags&_EOF)!=0)
#define ferror(fp) (((fp)->_flags&_IOERR)!=0)
#define clearerr(fp) ((fp)->_flags &= ~(_IOERR|_EOF))
#define fileno(fp) ((fp)->_unit)
#define fflush(fp) flsh_(fp,-1)
#endif
ctype.h
/* Copyright (C) 1984 by Manx Software Systems */
extern char ctp_[];
#define isalpha(x) (ctp_[(x)+1]&0x03)
#define isupper(x) (ctp_[(x)+1]&0x01)
#define islower(x) (ctp_[(x)+1]&0x02)
#define isdigit(x) (ctp_[(x)+1]&0x04)
#define isxdigit(x) (ctp_[(x)+1]&0x08)
#define isalnum(x) (ctp_[(x)+1]&0x07)
#define isspace(x) (ctp_[(x)+1]&0x10)
#define ispunct(x) (ctp_[(x)+1]&0x40)
#define iscntrl(x) (ctp_[(x)+1]&0x20)
#define isprint(x) (ctp_[(x)+1]&0xc7)
#define isgraph(x) (ctp_[(x)+1]&0x47)
#define isascii(x) (((x)&0x80)==0)
#define toascii(x) ((x)&127)
#define _tolower(x) ((x)|0x20)
#define _toupper(x) ((x)&0x5f)


Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,404 @@
r.c
/* Copyright (C) 1984 by Manx Software Systems */
#include <stdio.h>
main(argc, argv)
char **argv;
{
register int (*func)();
int (*prgload())();
if (argc < 2) {
fprintf(stderr, "usage: r progname args ...\n");
exit(4);
}
++argv;
if ((func = prgload(*argv)) == 0) {
fprintf(stderr, "Cannot load program\n");
exit(4);
}
(*func)(argc-1, argv);
}
#define OVMAGIC 0xf1
struct header {
int magic;
unsigned ovaddr;
unsigned ovsize;
unsigned ovbss;
int (*ovbgn)();
};
static int (*prgload(argv0))()
char *argv0;
{
int fd;
char *topmem, *ovend, *sbrk();
unsigned size;
struct header header;
char name[20];
strcpy(name, argv0);
strcat(name, ".ovr");
if ((fd = open(name, 0)) < 0)
return 0;
if (read(fd, &header, sizeof header) < 0)
return 0;
/* check magic number on overlay file */
if (header.magic != OVMAGIC || header.ovsize == 0)
return 0;
topmem = sbrk(0);
ovend = header.ovaddr + header.ovsize + header.ovbss;
if (topmem < ovend) {
if (sbrk(ovend - topmem) == (char *)-1)
return 0;
}
if (read(fd, header.ovaddr, header.ovsize) < header.ovsize)
return 0;
close(fd);
return header.ovbgn;
}
crbegin.asm
; Copyright (C) 1983 by Manx Software Systems
; :ts=8
public .ovbgn
extrn main_
extrn _Uorg_, _Uend_
bss saveret,2
.ovbgn:
lxi h,_Uorg_
lxi b,_Uend_-_Uorg_
mvi e,0
clrbss:
mov m,e
inx h
dcx b
mov a,c
ora b
jnz clrbss
;
pop h
shld saveret
call main_
lhld saveret ;get return addr
pchl ;return to caller
end .ovbgn
rext.asm
extrn .begin
extrn execv_
extrn execl_
extrn agetc_
extrn aputc_
extrn atoi_
extrn atol_
extrn calloc_
extrn Croot_
extrn fdopen_
extrn fgets_
extrn fopen_
extrn freopen_
extrn format_
extrn fprintf_
extrn fputs_
extrn fread_
extrn fscanf_
extrn fseek_
extrn ftell_
extrn fwrite_
extrn getchar_
extrn gets_
extrn getw_
extrn ioctl_
extrn isatty_
extrn lseek_
extrn realloc_
extrn malloc_
extrn free_
extrn creat_
extrn open_
extrn close_
extrn posit_
extrn printf_
extrn fclose_
extrn putchar_
extrn puterr_
extrn puts_
extrn putw_
extrn qsort_
extrn rename_
extrn scanfmt_
extrn scanf_
extrn setbuf_
extrn sprintf_
extrn sscanf_
extrn ungetc_
extrn unlink_
extrn bios_
extrn index_
extrn movmem_
extrn rindex_
extrn sbrk_
extrn rsvstk_
extrn setjmp_
extrn setmem_
extrn strcat_
extrn strncat_
extrn strcmp_
extrn strncmp_
extrn strcpy_
extrn strlen_
extrn strncpy_
extrn swapmem_
extrn toupper_
extrn tolower_
extrn getusr_
extrn setusr_
extrn rstusr_
extrn .dv,.ud
extrn .ml
mrext.asm
extrn .begin
extrn atof_
extrn frexp_, ldexp_, modf_
extrn ftoa_
extrn asin_
extrn acos_
extrn arcsine_
extrn atan2_
extrn atan_
extrn exp_
extrn floor_
extrn ceil_
extrn log10_
extrn log_
extrn pow_
extrn ran_
extrn randl_
extrn cos_
extrn sin_
extrn sinh_
extrn cosh_
extrn sqrt_
extrn cotan_
extrn tan_
extrn tanh_
extrn execv_
extrn execl_
extrn agetc_
extrn aputc_
extrn atoi_
extrn atol_
extrn calloc_
extrn Croot_
extrn fdopen_
extrn fgets_
extrn fopen_
extrn freopen_
extrn format_
extrn fprintf_
extrn fputs_
extrn fread_
extrn fscanf_
extrn fseek_
extrn ftell_
extrn fwrite_
extrn getchar_
extrn gets_
extrn getw_
extrn ioctl_
extrn isatty_
extrn lseek_
extrn realloc_
extrn malloc_
extrn free_
extrn creat_
extrn open_
extrn close_
extrn posit_
extrn printf_
extrn fclose_
extrn putchar_
extrn puts_
extrn putw_
extrn qsort_
extrn rename_
extrn scanfmt_
extrn scanf_
extrn setbuf_
extrn sprintf_
extrn sscanf_
extrn ungetc_
extrn unlink_
extrn bios_
extrn index_
extrn movmem_
extrn rindex_
extrn sbrk_
extrn rsvstk_
extrn setjmp_
extrn setmem_
extrn strcat_
extrn strncat_
extrn strcmp_
extrn strncmp_
extrn strcpy_
extrn strlen_
extrn strncpy_
extrn swapmem_
extrn toupper_
extrn tolower_
extrn getusr_
extrn setusr_
extrn rstusr_
extrn .dv,.ud
extrn .ml
ovloader.c
/* Copyright (C) 1983, 1984 by Manx Software Systems */
#define OVMAGIC 0xf1
struct header {
int magic;
unsigned ovaddr;
unsigned ovsize;
unsigned ovbss;
int (*ovbgn)();
};
static char *ovname;
#asm
public ovloader
ovloader:
lxi h,2
dad sp
mov e,m
inx h
mov d,m
xchg
shld ovname_
;
call _ovld_
pchl
#endasm
static
_ovld()
{
int fd, flag;
auto struct header hdr;
extern char *_mbot;
auto char filename[64];
flag = 0;
strcpy(filename, ovname);
for (;;) {
strcat(filename, ".ovr");
if ((fd = open(filename, 0)) >= 0)
break;
if (flag++)
loadabort(10);
strcpy(filename, "a:");
strcat(filename, ovname);
}
if (read(fd, &hdr, sizeof hdr) != sizeof hdr)
loadabort(20);
/* check magic number on overlay file */
if (hdr.magic != OVMAGIC)
loadabort(30);
if (_mbot < hdr.ovaddr+hdr.ovsize+hdr.ovbss)
loadabort(40);
if (read(fd, hdr.ovaddr, hdr.ovsize) < hdr.ovsize)
loadabort(50);
close(fd);
return hdr.ovbgn;
}
static
loadabort(code)
{
char buffer[80];
sprintf(buffer, "Error %d loading overlay: %s$", code, ovname);
bdos(9, buffer);
exit(10);
}
ovbgn.asm
; Copyright (C) 1983, 1984 by Manx Software Systems
; :ts=8
public .ovbgn, ovexit_
extrn ovmain_
extrn _Uorg_, _Uend_
bss ovstkpt,2
bss saveret,2
bss bcsave,2
bss ixsave,2
bss iysave,2
;
.ovbgn:
lxi h,_Uorg_
lxi b,_Uend_-_Uorg_
mvi e,0
clrbss:
mov m,e
inx h
dcx b
mov a,c
ora b
jnz clrbss
;
mov h,b
mov l,c
shld bcsave
xra a
adi 3
jpe savedone
db 221
shld ixsave
db 253
shld iysave
savedone:
pop h
shld saveret
pop d
lxi h,0
dad sp
shld ovstkpt ;save stack pointer for ovexit
call ovmain_
xchg ;save return value
ovret:
lhld saveret ;get return addr
push h ;place dummy overlay name ptr on stack
push h ;place return addr on stack
xchg ;restore return value to hl
ret ;return to caller
;
ovexit_:
lhld bcsave
mov b,h
mov c,l
xra a
adi 3
jpe restdone
db 221
lhld ixsave
db 253
lhld iysave
restdone:
lxi h,2 ;get return value
dad sp
mov e,m
inx h
mov d,m
lhld ovstkpt ;restore original stack pointer
sphl
jmp ovret
end .ovbgn


Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,4 @@
as rext.asm
ln -ro r.com r.o rext.o -lc
pip r.lib=r.rsm[o],rbegin.o[o]


View File

@@ -0,0 +1,73 @@
extrn .begin
extrn execv_
extrn execl_
extrn agetc_
extrn aputc_
extrn atoi_
extrn atol_
extrn calloc_
extrn Croot_
extrn fdopen_
extrn fgets_
extrn fopen_
extrn freopen_
extrn format_
extrn fprintf_
extrn fputs_
extrn fread_
extrn fscanf_
extrn fseek_
extrn ftell_
extrn fwrite_
extrn getchar_
extrn gets_
extrn getw_
extrn ioctl_
extrn isatty_
extrn lseek_
extrn realloc_
extrn malloc_
extrn free_
extrn creat_
extrn open_
extrn close_
extrn posit_
extrn printf_
extrn fclose_
extrn putchar_
extrn puterr_
extrn puts_
extrn putw_
extrn qsort_
extrn rename_
extrn scanfmt_
extrn scanf_
extrn setbuf_
extrn sprintf_
extrn sscanf_
extrn ungetc_
extrn unlink_
extrn bios_
extrn index_
extrn movmem_
extrn rindex_
extrn sbrk_
extrn rsvstk_
extrn setjmp_
extrn setmem_
extrn strcat_
extrn strncat_
extrn strcmp_
extrn strncmp_
extrn strcpy_
extrn strlen_
extrn strncpy_
extrn swapmem_
extrn toupper_
extrn tolower_
extrn getusr_
extrn setusr_
extrn rstusr_
extrn .dv,.ud
extrn .ml


Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,332 @@
croot.c
/* Copyright (C) 1981, 1982 by Manx Software Systems */
/* Copyright (C) 1983 by Manx Software Systems */
#define MAXARGS 30
static char *Argv[MAXARGS];
static char Argbuf[128];
static int Argc;
Croot()
{
register char *cp;
movmem((char *)0x81, Argbuf, 127);
Argbuf[*(char *)0x80 & 0x7f] = 0;
Argv[0] = "";
cp = Argbuf;
Argc = 1;
while (Argc < MAXARGS) {
while (*cp == ' ' || *cp == '\t')
++cp;
if (*cp == 0)
break;
Argv[Argc++] = cp;
while (*++cp)
if (*cp == ' ' || *cp == '\t') {
*cp++ = 0;
break;
}
}
main(Argc,Argv);
_exit();
}
exit(code)
{
_exit();
}
getchar()
{
register int c;
if ((c = bdos(1)) == '\r') {
bdos(2,'\n');
c = '\n';
} else if (c == 0x1a)
c = -1;
return c;
}
putchar(c)
{
if (c == '\n')
bdos(2,'\r');
bdos(2,c);
return c&255;
}
fprintf.c
/* Copyright (C) 1981,1982 by Manx Software Systems */
/* Copyright (C) 1982 Thomas Fenwick */
#include "stdio.h"
static FILE *Stream;
fprintf(stream,fmt,args)
FILE *stream; char *fmt; unsigned args;
{
int fpsub();
Stream = stream;
return format(fpsub,fmt,&args);
}
static
fpsub(c)
{
return aputc(c,Stream);
}
printf.c
/* Copyright (C) 1981, 1982 by Manx Software Systems */
/* Copyright (C) 1983 by Manx Software Systems */
printf(fmt,args)
char *fmt; unsigned args;
{
int putchar();
format(putchar,fmt,&args);
}
format(putsub, fmt, args)
register int (*putsub)(); register char *fmt; unsigned *args;
{
register int c;
char *ps;
char s[8];
static char *dconv(), *hexconv();
while ( c = *fmt++ ) {
if ( c == '%' ) {
switch ( c = *fmt++ ) {
case 'x':
ps = hexconv(*args++, s+7);
break;
case 'u':
ps = dconv(*args++, s+7);
break;
case 'd':
if ( (int)*args < 0 ) {
ps = dconv(-*args++, s+7);
*--ps = '-';
} else
ps = dconv(*args++, s+7);
break;
case 's':
ps = *args++;
break;
case 'c':
c = *args++;
default:
goto deflt;
}
while ( *ps )
(*putsub)(*ps++);
} else
deflt:
(*putsub)(c);
}
}
static char *
dconv(n, s)
register char *s; register unsigned n;
{
*s = 0;
do {
*--s = n%10 + '0';
} while ( (n /= 10) != 0 );
return s;
}
static char *
hexconv(n, s)
register char *s; register unsigned n;
{
*s = 0;
do {
*--s = "0123456789abcdef" [n&15];
} while ( (n >>= 4) != 0 );
return s;
}
fopen.c
/* Copyright (C) 1981, 1982 by Manx Software Systems */
/* Copyright (C) 1983, 1984 by Manx Software Systems */
#include "stdio.h"
#include "errno.h"
#define MAXFILE 4
#define RBUFSIZ 1024
#define WBUFSIZ 1024
#define RDNSCT (RBUFSIZ/128)
#define WRNSCT (WBUFSIZ/128)
#define OPNFIL 15
#define CLSFIL 16
#define DELFIL 19
#define READSQ 20
#define WRITSQ 21
#define MAKFIL 22
#define SETDMA 26
#define READRN 33
#define WRITRN 34
#define FILSIZ 35
#define SETREC 36
static FILE Cbuffs[MAXFILE];
static char writbuf[WBUFSIZ];
static char readbuf[RBUFSIZ];
static char *bufeof;
static FILE *curread;
static FILE *writfp;
FILE *
fopen(name,mode)
char *name,*mode;
{
register FILE *fp;
int user;
fp = Cbuffs;
while ( fp->_bp ) {
if ( ++fp >= Cbuffs+MAXFILE ) {
errno = ENFILE;
return (NULL);
}
}
if ((user = fcbinit(name,&fp->_fcb)) == -1) {
errno = EINVAL;
return NULL;
}
if (user == 255)
user = getusr();
fp->user = user;
setusr(user);
if (*mode == 'r') {
if (bdos(OPNFIL,&fp->_fcb) == 0xff) {
errno = ENOENT;
rstusr();
return NULL;
}
fp->_bp = readbuf;
curread = 0;
} else {
if ( writfp )
return NULL;
bdos(DELFIL, &fp->_fcb);
if (bdos(MAKFIL,&fp->_fcb) == 0xff) {
errno = ENOENT;
rstusr();
return NULL;
}
fp->_bp = writbuf;
writfp = fp;
}
rstusr();
fp->_fcb.f_overfl = fp->_fcb.f_record = 0;
return fp;
}
fclose(ptr)
register FILE *ptr;
{
register int err;
err = 0;
if (ptr == writfp) { /* if writing flush buffer */
err = flush(ptr->_bp - writbuf);
writfp = 0;
} else if (ptr == curread)
curread = 0;
setusr(ptr->user);
if (bdos(CLSFIL,&ptr->_fcb) == 0xff)
err = -1;
rstusr();
ptr->_bp = 0;
return err;
}
agetc(ptr)
register FILE *ptr;
{
register int c;
top:
if ((c = getc(ptr)) != EOF) {
switch (c &= 127) {
case 0x1a:
--ptr->_bp;
return EOF;
case '\r':
case 0:
goto top;
}
}
return c;
}
getc(ptr)
register FILE *ptr;
{
register int j;
if (ptr != curread) {
readit:
curread = 0; /* mark nobody as current read */
setusr(ptr->user);
if ((j = RDNSCT - blkrd(&ptr->_fcb,readbuf,RDNSCT)) == 0)
return -1;
rstusr();
ptr->_fcb.f_record -= j;
bufeof = readbuf + j*128;
curread = ptr;
}
if (ptr->_bp >= bufeof) {
ptr->_fcb.f_record += (bufeof-readbuf) >> 7;
ptr->_bp = readbuf;
goto readit;
}
return *ptr->_bp++ & 255;
}
aputc(c,ptr)
register int c; register FILE *ptr;
{
c &= 127;
if (c == '\n')
if (putc('\r',ptr) == EOF)
return EOF;
return putc(c,ptr);
}
putc(c,ptr)
int c; register FILE *ptr;
{
*ptr->_bp++ = c;
if (ptr->_bp >= writbuf+WBUFSIZ) {
if (flush(WBUFSIZ))
return EOF;
ptr->_bp = writbuf;
}
return (c&255);
}
flush(len)
register int len;
{
while (len & 127)
writbuf[len++] = 0x1a;
setusr(writfp->user);
if (len != 0 && blkwr(&writfp->_fcb,writbuf,len>>7) != 0) {
rstusr();
return EOF;
}
rstusr();
return 0;
}


Some files were not shown because too many files have changed in this diff Show More