Browse Source

Merge remote-tracking branch 'upstream/dev' into duart

pull/133/head
Chris Odorjan 6 years ago
parent
commit
e861611611
  1. 2
      Binary/Apps/Makefile
  2. 9
      Binary/Apps/ReadMe.txt
  3. 11
      Binary/CPM3/Clean.cmd
  4. 7
      Binary/CPM3/Makefile
  5. 17
      Binary/CPM3/ReadMe.txt
  6. 2
      Binary/Clean.cmd
  7. 6
      Binary/DiskList.txt
  8. 4
      Binary/Makefile
  9. 6
      Binary/ReadMe.txt
  10. 10
      Binary/ZPM3/Clean.cmd
  11. 7
      Binary/ZPM3/Makefile
  12. 17
      Binary/ZPM3/ReadMe.txt
  13. BIN
      Doc/RomWBW Applications.pdf
  14. BIN
      Doc/RomWBW Architecture.pdf
  15. BIN
      Doc/RomWBW Disk Catalog.pdf
  16. BIN
      Doc/RomWBW Getting Started.pdf
  17. 78
      ReadMe.md
  18. 76
      ReadMe.txt
  19. 11
      Source/Apps/Assign.asm
  20. 115
      Source/Apps/Tune/Tune.asm
  21. 54
      Source/Apps/Tune/cli.inc
  22. 8
      Source/CBIOS/cbios.asm
  23. 20
      Source/CPM3/Build.cmd
  24. 27
      Source/CPM3/Makefile
  25. 35
      Source/CPM3/diskio.z80
  26. 4
      Source/CPM3/genbnk.dat
  27. 5
      Source/CPM3/loader.asm
  28. 20
      Source/Doc/Applications.md
  29. 38
      Source/Doc/Architecture.md
  30. 81
      Source/Doc/GettingStarted.md
  31. 2
      Source/HBIOS/audio.inc
  32. 97
      Source/HBIOS/ay38910.asm
  33. 30
      Source/HBIOS/cfg_state.inc
  34. BIN
      Source/Images/Common/CLRDIR.COM
  35. BIN
      Source/RomDsk/ROM_1024KB/CLRDIR.COM
  36. BIN
      Source/RomDsk/ROM_512KB/CLRDIR.COM
  37. 22
      Source/ZPM3/Build.cmd
  38. 20
      Source/ZPM3/Makefile
  39. 5
      Source/ZPM3/loader.asm
  40. 2
      Source/ver.inc
  41. 2
      Source/ver.lib
  42. 2
      Tools/Makefile.inc

2
Binary/Apps/Makefile

@ -7,4 +7,4 @@ all::
mkdir -p Tunes
clobber::
rm -f *.bin *.com *.img *.rom *.pdf *.log *.eeprom *.COM *.BIN Tunes/*.mym Tunes/*.pt?
@rm -f *.bin *.com *.img *.rom *.pdf *.log *.eeprom *.COM *.BIN Tunes/*.mym Tunes/*.pt?

9
Binary/Apps/ReadMe.txt

@ -11,4 +11,11 @@ are specific to RomWBW. The source for these applications is found
in the Source\Apps directory of the distribution.
The Tunes subdirectory contains some sample ProTracker and MYM sound
files that can be played by the TUNE application.
files that can be played by the TUNE application.
All of these files are already included in the pre-built boot disk
images. They are also included on the ROM disk except for
FAT.COM, TUNE.COM, and the sample tune files in the Tunes directory.
If you upgrade your ROM to a new version, you should also copy
these files over to any hard disk images you are using.

11
Binary/CPM3/Clean.cmd

@ -0,0 +1,11 @@
@echo off
setlocal
if exist *.spr del *.spr
if exist *.com del *.com
if exist *.sys del *.sys
if exist *.pat del *.pat
if exist *.dat del *.dat
if exist *.1st del *.1st
if exist *.spr del *.spr
if exist *.pat del *.pat

7
Binary/CPM3/Makefile

@ -0,0 +1,7 @@
TOOLS = ../../Tools
MOREDIFF := $(shell $(TOOLS)/unix/casefn.sh *.spr)
include $(TOOLS)/Makefile.inc
clobber::
@rm -f *.spr

17
Binary/CPM3/ReadMe.txt

@ -0,0 +1,17 @@
***********************************************************************
*** ***
*** R o m W B W ***
*** ***
*** Z80/Z180 System Software ***
*** ***
***********************************************************************
This directory contains the CP/M 3 system files for the RomWBW CP/M 3
adaptation. All of these files are already included on the CP/M 3
boot disk images. However if you are creating a CP/M 3 boot disk
manually, you should copy all of these files to the boot disk.
These files should also be copied to any CP/M 3 boot disks on your
system when you upgrade your ROM firmware. Some of these files
*must* match the version of the RomWBW firmware you are using for
proper operation of your system.

2
Binary/Clean.cmd

@ -11,3 +11,5 @@ if exist *.log del *.log
if exist *.eeprom del *.eeprom
setlocal & cd Apps && call Clean || exit /b 1 & endlocal
setlocal & cd CPM3 && call Clean || exit /b 1 & endlocal
setlocal & cd ZPM3 && call Clean || exit /b 1 & endlocal

6
Binary/DiskList.txt

@ -17,6 +17,12 @@ a floppy or hard/CF/SD disk. You can use your modern computer
media. The disk media will then be ready to use in your RomWBW
System.
WARNING: The hdnew_*.img disk images are part of a new disk
format that is a work in progress. Do not use these disk
images without knowing exactly what you are doing! The
hd_*.img disk images continue to be the images you should
be using under normal circumstances.
A description of the disk images is provided later in this file.
For more information on the creatioin of these images including
instructions for customizing them or creating your own, refer to

4
Binary/Makefile

@ -1,8 +1,8 @@
TOOLS = ../Tools
MOREDIFF := $(shell $(TOOLS)/unix/casefn.sh *.img *.rom *.com *.eeprom)
SUBDIRS = Apps
SUBDIRS = Apps CPM3 ZPM3
include $(TOOLS)/Makefile.inc
clobber::
rm -f *.bin *.com *.img *.rom *.pdf *.log *.eeprom
@rm -f *.bin *.com *.img *.rom *.pdf *.log *.eeprom

6
Binary/ReadMe.txt

@ -92,6 +92,12 @@ intended to be copied to the start of any type of hard disk media
(typically a CF Card or SD Card). The resulting media will be usable
on any RomWBW-based system that accepts the corresponding media type.
WARNING: The hdnew_*.img disk images are part of a new disk
format that is a work in progress. Do not use these disk
images without knowing exactly what you are doing! The
hd_*.img disk images continue to be the images you should
be using under normal circumstances.
Documentation of the pre-built disk images is contained in the
DiskList.txt file in this directory.

10
Binary/ZPM3/Clean.cmd

@ -0,0 +1,10 @@
@echo off
setlocal
if exist *.spr del *.spr
if exist *.com del *.com
if exist *.sys del *.sys
if exist *.pat del *.pat
if exist *.dat del *.dat
if exist *.zpm del *.zpm
if exist *.spr del *.spr

7
Binary/ZPM3/Makefile

@ -0,0 +1,7 @@
TOOLS = ../../Tools
MOREDIFF := $(shell $(TOOLS)/unix/casefn.sh *.spr)
include $(TOOLS)/Makefile.inc
clobber::
@rm -f *.spr

17
Binary/ZPM3/ReadMe.txt

@ -0,0 +1,17 @@
***********************************************************************
*** ***
*** R o m W B W ***
*** ***
*** Z80/Z180 System Software ***
*** ***
***********************************************************************
This directory contains the ZPM3 system files for the RomWBW ZPM3
adaptation. All of these files are already included on the ZPM3
boot disk images. However if you are creating a CP/M 3 boot disk
manually, you should copy all of these files to the boot disk.
These files should also be copied to any ZPM3 boot disks on your
system when you upgrade your ROM firmware. Some of these files
*must* match the version of the RomWBW firmware you are using for
proper operation of your system.

BIN
Doc/RomWBW Applications.pdf

Binary file not shown.

BIN
Doc/RomWBW Architecture.pdf

Binary file not shown.

BIN
Doc/RomWBW Disk Catalog.pdf

Binary file not shown.

BIN
Doc/RomWBW Getting Started.pdf

Binary file not shown.

78
ReadMe.md

@ -3,7 +3,7 @@
## Z80/Z180 System Software
Version 3.1 Pre-release
Friday 8 May 2020
Wednesday 13 May 2020
Wayne Warthen <wwarthen@gmail.com>
@ -1060,12 +1060,76 @@ your choice. This process is described below in the Disk Images section.
If you wish to update existing disk media in your system, you need to
perform the following steps.
If the disk is bootable, you need to update the system tracks of the
disk. This is done using a SYSCOPY command such as `SYSCOPY
C:=B:ZSYS.SYS`. For a ZSDOS boot disk, use ZSYS.SYS. For a CP/M 2.2
disk, use CPM.SYS. For a CP/M 3 or ZPM3 disk, use CPMLDR.SYS. CPMLDR.SYS
is not provided on the ROM disk, so you will need to upload it from the
distribution.
If the disk is bootable, you need to update the system image on the disk
using the procedure described below corresponsing to the operating
system on your disk.
- **CP/M 2.2**
Boot to CP/M 2.2 from ROM, then use `SYSCOPY` to update the system
image on **all** CP/M 2.2 boot disks/slices. The CP/M 2.2 system
image is called CPM.SYS and is found on the ROM disk. For example:
`B>SYSCOPY C:=CPM.SYS`
- **ZSDOS**
Boot to Z-System from ROM, then use `SYSCOPY` to update the system
image on **all** ZSDOS boot disks/slices. The ZSDOS system image is
called ZSYS.SYS and is found on the ROM disk. For example:
`B>SYSCOPY C:=ZSYS.SYS`
- **NZCOM**
NZCOM runs on top of either CP/M 2.2 or ZSDOS. By default, the
RomWBW disk image for NZCOM uses ZSDOS. Follow the corresponding
procedure above to update the system image on the NZCOM boot
disks/slices.
- **CP/M 3**
CP/M 3 uses a multi-step boot process involving multiple files. The
CP/M 3 boot files are not included on the ROM disk due to space
constraints. You will need to transfer the files to your system from
the RomWBW distribution directory Binary\\CPM3.
After this is done, you will need to use `SYSCOPY` to place the CP/M
3 loader image on the boot tracks of all CP/M 3 boot disks/slices.
The loader image is called `CPMLDR.SYS`. You must then copy (at a
minimum) `CPM3.SYS` and `CCP.COM` onto the disk/slice. Assuming you
copied the CP/M 3 boot files onto your RAM disk at A:, you would
use:
A>B:SYSCOPY C:=CPMLDR.SYS
A>B:COPY CPM3.SYS C:
A>B:COPY CCP.COM C:
- **ZPM3**
ZPM3 uses a multi-step boot process involving multiple files. The
ZPM3 boot files are not included on the ROM disk due to space
constraints. You will need to transfer the files to your system from
the RomWBW distribution directory Binary\\ZPM3.
After this is done, you will need to use `SYSCOPY` to place the ZPM3
loader image on the boot tracks of all ZPM3 boot disks/slices. The
loader image is called `CPMLDR.SYS`. You must then copy (at a
minimum) `CPM3.SYS`, `ZCCP.COM`, `ZINSTAL.ZPM`, and `STARTZPM.COM`
onto the disk/slice. Assuming you copied the ZPM3 boot files onto
your RAM disk at A:, you would use:
A>B:SYSCOPY C:=CPMLDR.SYS
A>B:COPY CPM3.SYS C:
A>B:COPY ZCCP.COM C:
A>B:COPY ZINSTAL.ZPM C:
A>B:COPY STARTZPM.COM C:
You may be wondering if the references to `CPMLDR.SYS` and
`CPM3.SYS` are typos. They are not. ZPM3 uses the same loader image
as CPM3. The ZPM3 main system code file is called `CPM3.SYS` which
is the same name as CP/M 3 uses, but the file contents are not the
same.
Finally, if you have copies of any of the RomWBW custom applications on
your hard disk, you need to update them with the latest copies. The

76
ReadMe.txt

@ -3,7 +3,7 @@ RomWBW
Z80/Z180 System Software
Version 3.1 Pre-release
Friday 8 May 2020
Wednesday 13 May 2020
Wayne Warthen wwarthen@gmail.com
@ -1084,12 +1084,74 @@ your choice. This process is described below in the Disk Images section.
If you wish to update existing disk media in your system, you need to
perform the following steps.
If the disk is bootable, you need to update the system tracks of the
disk. This is done using a SYSCOPY command such as
SYSCOPY C:=B:ZSYS.SYS. For a ZSDOS boot disk, use ZSYS.SYS. For a CP/M
2.2 disk, use CPM.SYS. For a CP/M 3 or ZPM3 disk, use CPMLDR.SYS.
CPMLDR.SYS is not provided on the ROM disk, so you will need to upload
it from the distribution.
If the disk is bootable, you need to update the system image on the disk
using the procedure described below corresponsing to the operating
system on your disk.
- CP/M 2.2
Boot to CP/M 2.2 from ROM, then use SYSCOPY to update the system
image on all CP/M 2.2 boot disks/slices. The CP/M 2.2 system image
is called CPM.SYS and is found on the ROM disk. For example:
B>SYSCOPY C:=CPM.SYS
- ZSDOS
Boot to Z-System from ROM, then use SYSCOPY to update the system
image on all ZSDOS boot disks/slices. The ZSDOS system image is
called ZSYS.SYS and is found on the ROM disk. For example:
B>SYSCOPY C:=ZSYS.SYS
- NZCOM
NZCOM runs on top of either CP/M 2.2 or ZSDOS. By default, the
RomWBW disk image for NZCOM uses ZSDOS. Follow the corresponding
procedure above to update the system image on the NZCOM boot
disks/slices.
- CP/M 3
CP/M 3 uses a multi-step boot process involving multiple files. The
CP/M 3 boot files are not included on the ROM disk due to space
constraints. You will need to transfer the files to your system from
the RomWBW distribution directory Binary\CPM3.
After this is done, you will need to use SYSCOPY to place the CP/M 3
loader image on the boot tracks of all CP/M 3 boot disks/slices. The
loader image is called CPMLDR.SYS. You must then copy (at a minimum)
CPM3.SYS and CCP.COM onto the disk/slice. Assuming you copied the
CP/M 3 boot files onto your RAM disk at A:, you would use:
A>B:SYSCOPY C:=CPMLDR.SYS
A>B:COPY CPM3.SYS C:
A>B:COPY CCP.COM C:
- ZPM3
ZPM3 uses a multi-step boot process involving multiple files. The
ZPM3 boot files are not included on the ROM disk due to space
constraints. You will need to transfer the files to your system from
the RomWBW distribution directory Binary\ZPM3.
After this is done, you will need to use SYSCOPY to place the ZPM3
loader image on the boot tracks of all ZPM3 boot disks/slices. The
loader image is called CPMLDR.SYS. You must then copy (at a minimum)
CPM3.SYS, ZCCP.COM, ZINSTAL.ZPM, and STARTZPM.COM onto the
disk/slice. Assuming you copied the ZPM3 boot files onto your RAM
disk at A:, you would use:
A>B:SYSCOPY C:=CPMLDR.SYS
A>B:COPY CPM3.SYS C:
A>B:COPY ZCCP.COM C:
A>B:COPY ZINSTAL.ZPM C:
A>B:COPY STARTZPM.COM C:
You may be wondering if the references to CPMLDR.SYS and CPM3.SYS
are typos. They are not. ZPM3 uses the same loader image as CPM3.
The ZPM3 main system code file is called CPM3.SYS which is the same
name as CP/M 3 uses, but the file contents are not the same.
Finally, if you have copies of any of the RomWBW custom applications on
your hard disk, you need to update them with the latest copies. The

11
Source/Apps/Assign.asm

@ -26,6 +26,7 @@
; 2020-04-29 [WBW] Updated for larger DPH (16 -> 20 bytes)
; 2020-05-06 [WBW] Add patch level to version compare
; 2020-05-10 [WBW] Set media change flag in XDPH for CP/M 3
; 2020-05-12 [WBW] Back out media change flag
;_______________________________________________________________________________
;
; ToDo:
@ -778,10 +779,10 @@ instc2:
inc hl ; bump to slice field of DPH field
ld a,(de) ; get slice from mapwrk
ld (hl),a ; put slice into DPH field
ld a,11 ; media byte is 11 bytes ahead
call addhl ; bump HL to media byte adr
or $FF ; use $FF to signify media change
ld (hl),a ; set media flag byte
; ld a,11 ; media byte is 11 bytes ahead
; call addhl ; bump HL to media byte adr
; or $FF ; use $FF to signify media change
; ld (hl),a ; set media flag byte
inc de ; bump to next mapwrk entry
inc de ; ...
inc de ; ...
@ -1892,7 +1893,7 @@ stack .equ $ ; stack top
; Messages
;
indent .db " ",0
msgban1 .db "ASSIGN v1.3 for RomWBW CP/M, 10-May-2020",0
msgban1 .db "ASSIGN v1.4 for RomWBW CP/M, 12-May-2020",0
msghb .db " (HBIOS Mode)",0
msgub .db " (UBIOS Mode)",0
msgban2 .db "Copyright 2020, Wayne Warthen, GNU GPL v3",0

115
Source/Apps/Tune/Tune.asm

@ -95,6 +95,7 @@ Id .EQU 1 ; 5) Insert official identificator
CALL CLI_ABRT_IF_OPT_FIRST
CALL CLI_HAVE_HBIOS_SWITCH
CALL CLI_OCTAVE_ADJST
JP CONTINUE
CONTINUE:
@ -581,14 +582,14 @@ FILTYP .DB 0 ; Sound file type (TYPPT2, TYPPT3, TYPMYM)
;
TMP .DB 0 ; work around use of undocumented Z80
HBIOSOPT: .DB "--HBIOS", 0
HBIOSMD .DB 0 ; NON-ZERO IF USING HBIOS SOUND DRIVER, ZERO OTHERWISE
OCTAVEADJ .DB 0 ; AMOUNT TO ADJUST OCTAVE UP OR DOWN
MSGBAN .DB "Tune Player for RomWBW v3.1, 25-Apr-2020",0
MSGUSE .DB "Copyright (C) 2020, Wayne Warthen, GNU GPL v3",13,10
.DB "PTxPlayer Copyright (C) 2004-2007 S.V.Bulba",13,10
.DB "MYMPlay by Marq/Lieves!Tuore",13,10,13,10
.DB "Usage: TUNE <filename>.[PT2|PT3|MYM] [--hbios]",0
.DB "Usage: TUNE <filename>.[PT2|PT3|MYM] [--hbios] [+tn|-tn]",0
MSGBIO .DB "Incompatible BIOS or version, "
.DB "HBIOS v", '0' + RMJ, ".", '0' + RMN, " required",0
MSGPLT .DB "Hardware error, system not supported!",0
@ -2003,74 +2004,74 @@ LOUT2 CALL NORMIO
RET ; AND DONE
PLAYVIAHBIOS:
;
; CHANNEL 0 (LEFT)
;
LD BC, (BF_SNDVOL*256)+0 ; SET VOLUME
LD A, (AYREGS + AmplA) ; DEVICE 0
ADD A,A ; GET 4-BIT
; CHANNEL 0
LD HL, AYREGS + AmplA
LD DE, AYREGS + TonA
LD B, 0
CALL PLAYNOTE
;
; CHANNEL 1
LD HL, AYREGS + AmplB
LD DE, AYREGS + TonB
LD B, 1
CALL PLAYNOTE
; CHANNEL 2
LD HL, AYREGS + AmplC
LD DE, AYREGS + TonC
LD B, 2
JP PLAYNOTE
PLAYNOTE:
PUSH BC ; CHANNEL IN B
PUSH DE ; PERIOD ADDR IN DE
LD A, (HL)
ADD A,A ; GET 4-BIT
ADD A,A ; VOLUME 0-15
ADD A,A ; AND CONVERT
ADD A,A ; TO HBIOS
ADD A,A ; TO HBIOS
LD L, A ; RANGE 0-255
LD BC, (BF_SNDVOL*256)+0 ; SET VOLUME
RST 08
;
LD BC, (BF_SNDPRD*256)+0 ; SET PERIOD
LD HL, (AYREGS+TonA) ; DEVICE 0
POP HL ; RESTORE PERIOD ADDR
LD A, (HL) ; DEVICE 0
INC HL
LD H, (HL)
LD L, A
LD A, H ; GET 12-BIT ONE PERIOD
AND $0F ; MASK OFF HIGH
LD H, A ; NIBBLE
RST 08
;
LD BC, (BF_SNDPLAY*256)+0 ; PLAY
LD D, 0 ; DEVICE 0
RST 08 ; CHANNEL 0
;
; CHANNEL 1 (MIDDLE)
;
LD BC, (BF_SNDVOL*256)+0 ; SET VOLUME
LD A, (AYREGS + AmplB) ; DEVICE 0
ADD A,A ; GET 4-BIT
ADD A,A ; VOLUME 0-15
ADD A,A ; AND CONVERT
ADD A,A ; TO HBIOS
LD L, A ; RANGE 0-255
RST 08
;
LD H, A ; NIBBLE
LD A, (OCTAVEADJ)
OR A
JR Z, PLAYNOTE3 ; NO OCTAVE ADJUSTMENT
BIT 7, A
JR Z, PLAYNOTE2 ; OCTAVE DOWN ADJUSTMENT
PLAYNOTE1:
ADD HL, HL ; MULTIPLE BY 2 FOR EACH OCTAVE
INC A
JR NZ, PLAYNOTE1
JR PLAYNOTE3
PLAYNOTE2:
SRL H ; DIVIDE BY 2 FOR EACH OCTAVE
RR L
DEC A
JR NZ, PLAYNOTE2
PLAYNOTE3
LD BC, (BF_SNDPRD*256)+0 ; SET PERIOD
LD HL, (AYREGS+TonB) ; DEVICE 0
ld A, H ; GET 12-BIT ONE PERIOD
AND $0F ; MASK OFF HIGH
LD H, A ; NIBBLE
RST 08
;
POP DE ; RESTORE CHANNEL IN D (FROM B)
LD BC, (BF_SNDPLAY*256)+0 ; PLAY
LD D, 1 ; DEVICE 0
RST 08 ; CHANNEL 0
;
; CHANNEL 2 (RIGHT)
;
LD BC, (BF_SNDVOL*256)+0 ; SET VOLUME
LD A, (AYREGS + AmplC) ; DEVICE 0
ADD A,A ; GET 4-BIT
ADD A,A ; VOLUME 0-15
ADD A,A ; AND CONVERT
ADD A,A ; TO HBIOS
LD L, A ; RANGE 0-255
RST 08
;
LD BC, (BF_SNDPRD*256)+0 ; SET PERIOD
LD HL, (AYREGS+TonC) ; DEVICE 0
LD A, H ; GET 12-BIT ONE PERIOD
AND $0F ; MASK OFF HIGH
LD H, A ; NIBBLE
RST 08
;
LD BC, (BF_SNDPLAY*256)+0 ; PLAY
LD D, 2 ; DEVICE 0
RST 08 ; CHANNEL 0
RET
#ENDIF
#IF ACBBAC

54
Source/Apps/Tune/cli.inc

@ -1,5 +1,4 @@
CLI_ABRT_IF_OPT_FIRST:
LD A, (FCB+1)
CP '-' ; OPTION FIRST OR - MISSING FILENAME?
@ -11,7 +10,7 @@ CLI_HAVE_HBIOS_SWITCH:
LD DE, HBIOSOPT
CALL STRINDEX
JR NZ, CLI_HAVE_HBIOS_SWITCH1
OR $FF ; MATCHED --HBIOS
OR $FF ; MATCHED --HBIOS
LD (HBIOSMD), A
LD BC,(BF_SYSGET*256)+BF_SND
RST 08 ; CHECK WE HAVE
@ -35,4 +34,53 @@ CLI_ABRT_UNSUPPFILTYP:
CLI_ABRT_UNSUPPFILTYP1:
POP AF
RET
RET
CLI_OCTAVE_ADJST: ; SEARCH FOR OCTAVE ADJUSTMENT SWITCH (-n or +n)
LD HL, CLIARGS ; TEST FOR --HBIOS ON COMMAND LINE
LD DE, DOWN1
CALL STRINDEX
JR NZ, CLI_OCTAVE_ADJST1
LD A, -1
JR CLI_OCTAVE_ADJST5
CLI_OCTAVE_ADJST1:
LD HL, CLIARGS ; TEST FOR --HBIOS ON COMMAND LINE
LD DE, DOWN2
CALL STRINDEX
JR NZ, CLI_OCTAVE_ADJST2
LD A, -2
JR CLI_OCTAVE_ADJST5
CLI_OCTAVE_ADJST2:
LD HL, CLIARGS ; TEST FOR --HBIOS ON COMMAND LINE
LD DE, UP1
CALL STRINDEX
JR NZ, CLI_OCTAVE_ADJST3
LD A, 1
JR CLI_OCTAVE_ADJST5
CLI_OCTAVE_ADJST3:
LD HL, CLIARGS ; TEST FOR --HBIOS ON COMMAND LINE
LD DE, UP2
CALL STRINDEX
JR NZ, CLI_OCTAVE_ADJST4
LD A, 2
JR CLI_OCTAVE_ADJST5
CLI_OCTAVE_ADJST4:
LD A, 0
CLI_OCTAVE_ADJST5:
LD (OCTAVEADJ), A
RET
HBIOSOPT: .DB "--HBIOS", 0
DOWN1 .DB "-t1", 0 ; DOWN AN OCTAVE
DOWN2 .DB "-t2", 0 ; DOWN TWO OCTAVE
UP1 .DB "+t1", 0 ; UP AN OCTAVE
UP2 .DB "+t2", 0 ; UP TWO OCTAVE

8
Source/CBIOS/cbios.asm

@ -1358,6 +1358,8 @@ DSK_MBR0:
;
#IFDEF PLTWBW
; SWITCH TO BIOS BANK TO ACCESS DISK BUFFER
LD (STKSAV),SP ; SAVE CUR STACK
LD SP,XSTACK ; NEW STACK IN HI MEM
LD A,(HB_CURBNK) ; GET CUR BANK
PUSH AF ; SAVE CUR BANK
LD A,(BNKBIOS) ; BIOS BANK
@ -1370,7 +1372,12 @@ DSK_MBR0:
LD A,H ; PREV BANK TO A
CALL HB_BNKSEL ; SELECT IT
POP AF ; ORIGINAL RESULT BACK
LD SP,(STKSAV) ; RESTORE ORIGINAL STACK
RET
.FILL 32,0
XSTACK .EQU $
#ENDIF
;
DSK_MBR1:
@ -1700,6 +1707,7 @@ CCPBUF .DW 0 ; ADDRESS OF CCP BUF IN BIOS BANK
MEDID .DB 0 ; TEMP STORAGE FOR MEDIA ID
SLICE .DB 0 ; CURRENT SLICE
SPS .DW 0 ; SECTORS PER SLICE
STKSAV .DW 0 ; TEMP SAVED STACK POINTER
;
#IFDEF PLTWBW
BNKBIOS .DB 0 ; BIOS BANK ID

20
Source/CPM3/Build.cmd

@ -101,3 +101,23 @@ rem Loader
tasm -t80 -g3 -fFF loader.asm loader.bin loader.lst
copy /b loader.bin + cpmldr.bin cpmldr.sys
rem Copy OS files to Binary directory
copy cpmldr.com ..\..\Binary\CPM3
copy cpmldr.sys ..\..\Binary\CPM3
copy ccp.com ..\..\Binary\CPM3
copy gencpm.com ..\..\Binary\CPM3
copy genres.dat ..\..\Binary\CPM3
copy genbnk.dat ..\..\Binary\CPM3
copy bios3.spr ..\..\Binary\CPM3
copy bnkbios3.spr ..\..\Binary\CPM3
copy bdos3.spr ..\..\Binary\CPM3
copy bnkbdos3.spr ..\..\Binary\CPM3
copy resbdos3.spr ..\..\Binary\CPM3
copy cpm3res.sys ..\..\Binary\CPM3
copy cpm3bnk.sys ..\..\Binary\CPM3
copy gencpm.dat ..\..\Binary\CPM3
copy cpm3.sys ..\..\Binary\CPM3
copy readme.1st ..\..\Binary\CPM3
copy cpm3fix.pat ..\..\Binary\CPM3

27
Source/CPM3/Makefile

@ -4,11 +4,19 @@
#
# it does this by overriding OBJECTS in an invoked sub-make
#
OBJECTS = cpmldr.com cpmldr.sys cpm3res cpm3bnk zpmbios3 cpm3.sys gencpm.dat
OTHERS = cpmldr.rel biosldr.rel cpm3res.sys cpm3bnk.sys zpmbios3.spr loader.bin cpmldr.bin
OBJECTS = cpmldr.com cpmldr.sys cpm3res.sys cpm3bnk.sys zpmbios3
OBJECTS += ccp.com gencpm.com genres.dat genbnk.dat
OBJECTS += bdos3.spr bnkbdos3.spr resbdos3.spr
OBJECTS += readme.1st cpm3fix.pat cpm3.sys gencpm.dat
NOCOPY = zpmbios3
OTHERS = cpmldr.rel biosldr.rel cpm3res.sys cpm3bnk.sys loader.bin cpmldr.bin
OTHERS += biosldrc.rel biosldrd.rel
NODELETE = ccp.com gencpm.com genres.dat genbnk.dat bdos3.spr bnkbdos3.spr resbdos3.spr
NODELETE += readme.1st cpm3fix.pat
DEST = ../../Binary/CPM3
TOOLS = ../../Tools
include $(TOOLS)/Makefile.inc
export ZXINCDIR = ../
@ -25,11 +33,11 @@ DEFCPM3 = bnk
clean:: biosclean
@rm -f bios3.spr bnkbios3.spr zpmbios3.spr cpmldr.com gencpm.dat options.lib ldropts.lib
biosclean:
@rm -f $(BIOSOBJS)
cpm3res:
cpm3res.sys:
make biosclean
cp optres.lib options.lib
cp genres.dat gencpm.dat
@ -38,7 +46,7 @@ cpm3res:
mv cpm3.sys cpm3res.sys
rm gencpm.dat
cpm3bnk:
cpm3bnk.sys:
make biosclean
cp optbnk.lib options.lib
cp genbnk.dat gencpm.dat
@ -50,9 +58,7 @@ cpm3bnk:
zpmbios3:
make biosclean
cp optzpm.lib options.lib
cp genbnk.dat gencpm.dat
make OBJECTS=zpmbios3.spr
rm gencpm.dat
make OBJECTS=zpmbios3.spr DEST=
cpmldr.bin: biosldrd.rel cpmldr.rel
$(ZXCC) $(TOOLS)/cpm/bin/LINK -CPMLDRD[L100]=CPMLDR,BIOSLDRD
@ -83,9 +89,12 @@ zpmbios3.spr: $(BIOSOBJS)
cpm3.sys: cpm3$(DEFCPM3).sys
cp cpm3$(DEFCPM3).sys cpm3.sys
rm -f /tmp/casefn.cache
gencpm.dat: gen$(DEFCPM3).dat
cp gen$(DEFCPM3).dat gencpm.dat
rm -f /tmp/casefn.cache
cpmldr.sys: loader.bin cpmldr.bin
cat loader.bin cpmldr.bin > $@

35
Source/CPM3/diskio.z80

@ -191,7 +191,7 @@ dpb$max:
db 5 ; bsh: block shift factor
db 31 ; blm: block mask
db 1 ; exm: extent mask
dw 2047 ; dsm: total storage in blocks - 1 = (8mb / 4k bls) - 1 = 2047
dw 2048 - 1 ; dsm: total storage in blocks - 1 = (8mb / 4k bls) - 1 = 2047
dw 1024 - 1 ; drm: dir entries - 1
db 11111111b ; al0: dir blk bit map, first byte
db 00000000b ; al1: dir blk bit map, second byte
@ -211,7 +211,7 @@ dpb$rom: ; 384K ROM Drive
dw 256 - 1 ; drm: dir entries - 1 = 256 - 1 = 255
db 11110000b ; al0: dir blk bit map, first byte
db 00000000b ; al1: dir blk bit map, second byte
dw 8000h ; cks: directory check vector size - permanent storage = 8000H
dw 8040h ; cks: directory check vector size - permanent storage = 8000H
dw 0 ; off: reserved tracks = 16 trks * (16 trks * 16 heads * 16 secs * 512 bytes) = 128k
db 2 ; psh: 2 for 512 byte sectors
db 3 ; phm: (512 / 128) - 1
@ -226,7 +226,7 @@ dpb$ram: ; 256K RAM Drive
dw 256 - 1 ; drm: dir entries - 1 = 256 - 1 = 255
db 11110000b ; al0: dir blk bit map, first byte
db 00000000b ; al1: dir blk bit map, second byte
dw 8000h ; cks: directory check vector size - permanent storage = 8000H
dw 8040h ; cks: directory check vector size - permanent storage = 8000H
dw 0 ; off: reserved tracks = 16 trks * (16 trks * 16 heads * 16 secs * 512 bytes) = 128k
db 2 ; psh: 2 for 512 byte sectors
db 3 ; phm: (512 / 128) - 1
@ -236,11 +236,11 @@ dpb$rf: ; 4MB RAM Floppy Drive
db 4 ; bsh: block shift factor
db 15 ; blm: block mask
db 0 ; exm: extent mask
dw 2047 ; dsm: total storage in blocks - 1 = (4mb / 2k bls) - 1 = 2047
dw 255 ; drm: dir entries - 1 = 256 - 1 = 255
dw 2048 - 1 ; dsm: total storage in blocks - 1 = (4mb / 2k bls) - 1 = 2047
dw 256 - 1 ; drm: dir entries - 1 = 256 - 1 = 255
db 11110000b ; al0: dir blk bit map, first byte
db 00000000b ; al1: dir blk bit map, second byte
dw 8000h ; cks: directory check vector size - permanent storage = 8000H
dw 8040h ; cks: directory check vector size - permanent storage = 8000H
dw 0 ; off: reserved tracks = 0 trks
db 2 ; psh: 2 for 512 byte sectors
db 3 ; phm: (512 / 128) - 1
@ -250,7 +250,7 @@ dpb$hd: ; 8MB Hard Disk Drive w/ 512 dir entries
db 5 ; bsh: block shift factor
db 31 ; blm: block mask
db 1 ; exm: extent mask
dw 2047 ; dsm: total storage in blocks - 1 = (8mb / 4k bls) - 1 = 2047
dw 2048 - 1 ; dsm: total storage in blocks - 1 = (8mb / 4k bls) - 1 = 2047
dw 512 - 1 ; drm: dir entries - 1 = 512 - 1 = 511
db 11110000b ; al0: dir blk bit map, first byte
db 00000000b ; al1: dir blk bit map, second byte
@ -264,8 +264,8 @@ dpb$fd720: ; 3.5" DS/DD Floppy Drive (720K)
db 4 ; bsh: block shift factor
db 15 ; blm: block mask
db 0 ; exm: extent mask
dw 350 ; dsm: total storage in blocks - 1 blk = ((720k - 18k off) / 2k bls) - 1 = 350
dw 127 ; drm: dir entries - 1 = 128 - 1 = 127
dw 351 - 1 ; dsm: total storage in blocks - 1 blk = ((720k - 18k off) / 2k bls) - 1 = 350
dw 128 - 1 ; drm: dir entries - 1 = 128 - 1 = 127
db 11000000b ; al0: dir blk bit map, first byte
db 00000000b ; al1: dir blk bit map, second byte
dw 32 ; cks: directory check vector size = 128 / 4
@ -278,8 +278,8 @@ dpb_fd144: ; 3.5" DS/HD Floppy Drive (1.44M)
db 4 ; bsh: block shift factor
db 15 ; blm: block mask
db 0 ; exm: extent mask
dw 710 ; dsm: total storage in blocks - 1 blk = ((1,440k - 18k off) / 2k bls) - 1 = 710
dw 255 ; drm: dir entries - 1 = 256 - 1 = 255
dw 711 - 1 ; dsm: total storage in blocks - 1 blk = ((1,440k - 18k off) / 2k bls) - 1 = 710
dw 256 - 1 ; drm: dir entries - 1 = 256 - 1 = 255
db 11110000b ; al0: dir blk bit map, first byte
db 00000000b ; al1: dir blk bit map, second byte
dw 64 ; cks: directory check vector size = 256 / 4
@ -292,8 +292,8 @@ dpb_fd360: ; 5.25" DS/DD Floppy Drive (360K)
db 4 ; bsh: block shift factor
db 15 ; blm: block mask
db 1 ; exm: extent mask
dw 170 ; dsm: total storage in blocks - 1 blk = ((360k - 18k off) / 2k bls) - 1 = 170
dw 127 ; drm: dir entries - 1 = 128 - 1 = 127
dw 171 - 1 ; dsm: total storage in blocks - 1 blk = ((360k - 18k off) / 2k bls) - 1 = 170
dw 128 - 1 ; drm: dir entries - 1 = 128 - 1 = 127
db 11110000b ; al0: dir blk bit map, first byte
db 00000000b ; al1: dir blk bit map, second byte
dw 32 ; cks: directory check vector size = 128 / 4
@ -306,8 +306,8 @@ dpb_fd120: ; 5.25" DS/HD Floppy Drive (1.2M)
db 4 ; bsh: block shift factor
db 15 ; blm: block mask
db 0 ; exm: extent mask
dw 591 ; dsm: total storage in blocks - 1 blk = ((1,200k - 15k off) / 2k bls) - 1 = 591
dw 255 ; drm: dir entries - 1 = 256 - 1 = 255
dw 592 - 1 ; dsm: total storage in blocks - 1 blk = ((1,200k - 15k off) / 2k bls) - 1 = 591
dw 256 - 1 ; drm: dir entries - 1 = 256 - 1 = 255
db 11110000b ; al0: dir blk bit map, first byte
db 00000000b ; al1: dir blk bit map, second byte
dw 64 ; cks: directory check vector size = 256 / 4
@ -320,8 +320,8 @@ dpb_fd111: ; 8" DS/DD Floppy Drive (1.11M)
db 4 ; bsh: block shift factor
db 15 ; blm: block mask
db 0 ; exm: extent mask
dw 569 ; dsm: total storage in blocks - 1 blk = ((1,155k - 15k off) / 2k bls) - 1 = 569
dw 255 ; drm: dir entries - 1 = 256 - 1 = 255
dw 570 - 1 ; dsm: total storage in blocks - 1 blk = ((1,155k - 15k off) / 2k bls) - 1 = 569
dw 256 - 1 ; drm: dir entries - 1 = 256 - 1 = 255
db 11110000b ; al0: dir blk bit map, first byte
db 00000000b ; al1: dir blk bit map, second byte
dw 64 ; cks: directory check vector size = 256 / 4
@ -650,6 +650,7 @@ dsk$rw$retry:
jr dsk$rw9 ; do the disk I/O
dsk$rw2:
; LBA I/O
push de ; save hiword of LBA
push hl ; save loword of LBA

4
Source/CPM3/genbnk.dat

@ -57,7 +57,7 @@ ALTBNKSM = Y
ALTBNKSN = Y
ALTBNKSO = Y
ALTBNKSP = Y
NDIRRECA = 02
NDIRRECA = 08
NDIRRECB = 00
NDIRRECC = 00
NDIRRECD = 00
@ -73,7 +73,7 @@ NDIRRECM = 00
NDIRRECN = 00
NDIRRECO = 00
NDIRRECP = 00
NDTARECA = 02
NDTARECA = 10
NDTARECB = 00
NDTARECC = 00
NDTARECD = 00

5
Source/CPM3/loader.asm

@ -27,9 +27,12 @@
;
#INCLUDE "../ver.inc"
;
; BELOW, SYS_END MUST BE SET TO THE SIZE OF CPMLDR.BIN + SYS_LOC. IF
; THE SIZE OF CPMLDR.BIN CHANGES, SYS_END MUST BE UPDATED!!!
;
SYS_ENT .EQU $0100 ; SYSTEM (OS) ENTRY POINT ADDRESS
SYS_LOC .EQU $0100 ; STARTING ADDRESS TO LOAD SYSTEM IMAGE
SYS_END .EQU $1480 ; ENDING ADDRESS OF SYSTEM IMAGE
SYS_END .EQU $1580 + SYS_LOC ; ENDING ADDRESS OF SYSTEM IMAGE
;
SEC_SIZE .EQU 512 ; DISK SECTOR SIZE
BLK_SIZE .EQU 128 ; OS BLOCK/RECORD SIZE

20
Source/Doc/Applications.md

@ -949,6 +949,24 @@ accurately pace the sound file output. If no system timer is
available, a delay loop is calculated instead. The delay loop will not
be as accurate as the system timer.
There are two modes of operations. A direct hardware interface for the
AY-3-8910 or YM2149 chips, or a compatibility layer thru HBIOS supporting
the SN76489 chip.
By default the application will attempt to interface directly to the sound
chip. The optional argument `--hbios` supplied after the filename, will
enable the application to use the HBIOS sound driver.
The HBIOS mode also support other switch as desribed below.
| Switch | Description |
| ----------- | ------------------------------------------------------ |
| `--hbios` | Utilise HBIOS' sound driver |
| `+t1` | Play tune an octave higher |
| `+t2` | Play tune two octaves higher |
| `-t1` | Play tune an octave lower |
| `-t2` | Play tune two octaves lower |
All RomWBW operating system boot disks include a selection of sound
files in user area 3.
@ -960,4 +978,4 @@ software was adapted and embedded from pre-existing sources. The YM
player code is from MYMPLAY 0.4 by Lieves!Tuore and the PT player code
is (c)2004-2007 S.V.Bulba <vorobey@mail.khstu.ru>.
The source code is provided in the RomWBW distribution.
The source code is provided in the RomWBW distribution.

38
Source/Doc/Architecture.md

@ -1392,20 +1392,38 @@ supplied is beyond driver capabilities, register A will be set to $FF.
| _Entry Parameters_
| B: 0x53
| C: Audio Device Unit ID
| L: Note (0 to 255 quarter notes)
| HL: Value of note to play
| _Returned Values_
| A: Status (0=OK, else error)
This function sets the sound chip period parameter according to
standardized notes.
The value corresponds to standard musical notes. The value allows
for selection of a quarter of a semitone by giving a value between 0
and up to the drivers maximum supported value. The lowest note is (0).
For the SN76489 chip, 0 corresponds to note A1# and the value 249 is
the maximum supported value, and it corresponds to note C7.
This function sets the sound chip period parameter with steps of quarter
of a semitone. The value of 0 (lowest) corresponds to Bb/A# in octave 0.
Increase by steps of 4 to select the next corresponding note.
Increase by steps of 48 to select the same note in next octave.
If the driver is able to generate the requested note, a success (0) is
returned, otherwise a non-zero error state will be returned.
The following table shows the mapping of the input value in HL
to the corresponding octave and note.
| Note | Octave 0 | Octave 1 | Octave 2 | Octave 3 | Octave 4 | Octave 5 | Octave 6 |
|-------|----------|----------|----------|----------|----------|----------|----------|
| Bb/A# | 0 | 48 | 96 | 144 | 192 | 240 | 288 |
| B | 4 | 52 | 100 | 148 | 196 | 244 | 292 |
| C | 8 | 56 | 104 | 152 | 200 | 248 | 296 |
| C#/Db | 12 | 60 | 108 | 156 | 204 | 252 | 300 |
| D | 16 | 64 | 112 | 160 | 208 | 256 | 304 |
| Eb/D# | 20 | 68 | 116 | 164 | 212 | 260 | 308 |
| E | 24 | 72 | 120 | 168 | 216 | 264 | 312 |
| F | 28 | 76 | 124 | 172 | 220 | 268 | 316 |
| F#/Gb | 32 | 80 | 128 | 176 | 224 | 272 | 320 |
| G | 36 | 84 | 132 | 180 | 228 | 276 | 324 |
| Ab/G# | 40 | 88 | 136 | 184 | 232 | 280 | 328 |
| A | 44 | 92 | 140 | 188 | 236 | 284 | 332 |
### Function 0x54 -- Sound Play (SNDPLAY)

81
Source/Doc/GettingStarted.md

@ -1114,12 +1114,81 @@ your choice. This process is described below in the Disk Images
section. If you wish to update existing disk media in your system, you
need to perform the following steps.
If the disk is bootable, you need to update the system tracks of the
disk. This is done using a SYSCOPY command such as `SYSCOPY
C:=B:ZSYS.SYS`. For a ZSDOS boot disk, use ZSYS.SYS. For a CP/M 2.2
disk, use CPM.SYS. For a CP/M 3 or ZPM3 disk, use CPMLDR.SYS.
CPMLDR.SYS is not provided on the ROM disk, so you will need to
upload it from the distribution.
If the disk is bootable, you need to update the system image on the
disk using the procedure described below corresponsing to the
operating system on your disk.
* **CP/M 2.2**
Boot to CP/M 2.2 from ROM, then use `SYSCOPY` to update the system
image on **all** CP/M 2.2 boot disks/slices. The CP/M 2.2 system image
is called CPM.SYS and is found on the ROM disk. For example:
`B>SYSCOPY C:=CPM.SYS`
* **ZSDOS**
Boot to Z-System from ROM, then use `SYSCOPY` to update the system
image on **all** ZSDOS boot disks/slices. The ZSDOS system image
is called ZSYS.SYS and is found on the ROM disk. For example:
`B>SYSCOPY C:=ZSYS.SYS`
* **NZCOM**
NZCOM runs on top of either CP/M 2.2 or ZSDOS. By default, the
RomWBW disk image for NZCOM uses ZSDOS. Follow the corresponding
procedure above to update the system image on the NZCOM boot
disks/slices.
* **CP/M 3**
CP/M 3 uses a multi-step boot process involving multiple files.
The CP/M 3 boot files are not included on the ROM disk due to
space constraints. You will need to transfer the files to your
system from the RomWBW distribution directory Binary\\CPM3.
After this is done, you will need to use `SYSCOPY` to place
the CP/M 3 loader image on the boot tracks of all CP/M 3
boot disks/slices. The loader image is called `CPMLDR.SYS`.
You must then copy (at a minimum) `CPM3.SYS` and `CCP.COM`
onto the disk/slice. Assuming you copied the CP/M 3 boot files
onto your RAM disk at A:, you would use:
```
A>B:SYSCOPY C:=CPMLDR.SYS
A>B:COPY CPM3.SYS C:
A>B:COPY CCP.COM C:
```
* **ZPM3**
ZPM3 uses a multi-step boot process involving multiple files.
The ZPM3 boot files are not included on the ROM disk due to
space constraints. You will need to transfer the files to your
system from the RomWBW distribution directory Binary\\ZPM3.
After this is done, you will need to use `SYSCOPY` to place
the ZPM3 loader image on the boot tracks of all ZPM3
boot disks/slices. The loader image is called `CPMLDR.SYS`.
You must then copy (at a minimum) `CPM3.SYS`, `ZCCP.COM`,
`ZINSTAL.ZPM`, and `STARTZPM.COM` onto the disk/slice.
Assuming you copied the ZPM3 boot files onto your RAM disk
at A:, you would use:
```
A>B:SYSCOPY C:=CPMLDR.SYS
A>B:COPY CPM3.SYS C:
A>B:COPY ZCCP.COM C:
A>B:COPY ZINSTAL.ZPM C:
A>B:COPY STARTZPM.COM C:
```
You may be wondering if the references to `CPMLDR.SYS` and
`CPM3.SYS` are typos. They are not. ZPM3 uses the same loader
image as CPM3. The ZPM3 main system code file is called `CPM3.SYS`
which is the same name as CP/M 3 uses, but the file contents are
not the same.
Finally, if you have copies of any of the RomWBW custom applications
on your hard disk, you need to update them with the latest copies. The

2
Source/HBIOS/audio.inc

@ -72,4 +72,4 @@ AUD_NOTE2:
LD H, $FF ; OTHERWISE RETURN -1 PERIOD (ERROR)
LD L, $FF
RET
#ENDIF
#ENDIF

97
Source/HBIOS/ay38910.asm

@ -4,6 +4,10 @@
;
;======================================================================
;
#include "cfg_state.inc"
AY_RCSND .EQU 0 ; 0 = EB MODULE, 1=MF MODULE
;
#IF (AYMODE == AYMODE_SCG)
@ -123,13 +127,55 @@ AY_FND: LD IY, AY_IDAT ; SETUP FUNCTION TABLE
LD DE,(AY_R3CHBP*256)+$00
CALL AY_WRTPSG ; R03 = $00 = XXXX0000
;
CALL LDELAY ; HALF SECOND DELAY
;
LD E,$00 ; SET VOLUME OFF
#IF SYSTIMEN
LD A, TICKFREQ / 3 ; SCHEDULE IN 1/3 SECOND TO TURN OFF SOUND
LD (AY_TIMTIK), A
LD HL, (VEC_TICK + 1) ; GET CUR SECONDS VECTOR
LD (AY_TIMHOOK), HL ; SAVE IT INTERNALLY
LD HL, AY_TIMER ; INSTALL TIMER HOOK HANDLER
LD (VEC_TICK + 1), HL
LD A, $02 ; NOT READY & IN INTERUPT HANDLER
LD (AY_READY), A
#ELSE
CALL LDELAY ; HALF SECOND DELAY
LD E,$00 ; SET VOLUME OFF
CALL AY_SETV ; ON ALL CHANNELS
LD A, $01 ; READY & NOT IN INTERUPT HANDLER
LD (AY_READY), A
#ENDIF
;
XOR A ; SUCCESSFULL INIT
RET
#IF SYSTIMEN
AY_TIMER:
LD A, (AY_TIMTIK)
DEC A
LD (AY_TIMTIK), A
JR NZ, AY_TIMER1
LD E,$00 ; SET VOLUME OFF
CALL AY_SETV ; ON ALL CHANNELS
LD A, $01 ; READY & NOT IN INTERUPT HANDLER
LD (AY_READY), A
LD DE, AY_TIMER ; MAKE AY_TIMER A NO_OP HANDLER
LD HL, AY_TIMER1
LD BC, 3
LDIR
AY_TIMER1:
JP 0 ; OVERWRITTEN WITH NEXT HANDLER
AY_TIMHOOK: .EQU $ - 2
AY_TIMTIK .DB 0 ; COUNT DOWN TO FINISH BOOT BEEP
#ENDIF
;
;======================================================================
; INITIALIZE DEVICE
@ -137,8 +183,16 @@ AY_FND: LD IY, AY_IDAT ; SETUP FUNCTION TABLE
;
AY_INIT:
LD DE,(AY_R7ENAB*256)+$F8 ; SET MIXER CONTROL / IO ENABLE. $F8 - 11 111 000
CALL AY_WRTPSG ; I/O PORTS = OUTPUT, NOISE CHANNEL C, B, A DISABLE, TONE CHANNEL C, B, A ENABLE
RET
JP AY_WRTPSG ; I/O PORTS = OUTPUT, NOISE CHANNEL C, B, A DISABLE, TONE CHANNEL C, B, A ENABLE
AY_CHKREDY:
LD A, (AY_READY)
BIT 0, A
RET NZ
POP HL ; REMOVE LAST RETURN ADDRESS
OR $FF
RET ; RETURN NZ
;
;======================================================================
; SET VOLUME ALL CHANNELS
@ -163,7 +217,8 @@ AY_SV: CALL AY_WRTPSG ; CYCLING THROUGH ALL CHANNELS
;
AY_RESET:
AUDTRACE(AYT_INIT)
;
CALL AY_CHKREDY ; RETURNS TO OUR CALLER IF NOT READY
PUSH DE
PUSH HL
CALL AY_INIT ; SET DEFAULT CHIP CONFIGURATION
@ -190,6 +245,7 @@ AY_VOLUME:
AUDTRACE(AYT_VOL)
AUDTRACE_L
AUDTRACE_CR
LD A,L ; SAVE VOLUME
LD (AY_PENDING_VOLUME), A
;
@ -246,6 +302,8 @@ AY_PLAY:
AUDTRACE(AYT_PLAY)
AUDTRACE_D
AUDTRACE_CR
CALL AY_CHKREDY ; RETURNS TO OUR CALLER IF NOT READY
;
LD A, (AY_PENDING_PERIOD + 1) ; CHECK THE HIGH BYTE OF THE PERIOD
INC A
@ -353,6 +411,21 @@ AY_QUERY_DEV:
LD DE, (AY_RSEL*256)+AY_RDAT ; AND ADDRESS AND DATA PORT
XOR A
RET
AY_DI:
LD A, (AY_READY)
BIT 1, A
RET NZ
HB_DI
RET
AY_EI:
LD A, (AY_READY)
BIT 1, A
RET NZ
HB_EI
RET
;
;======================================================================
;
@ -362,7 +435,7 @@ AY_QUERY_DEV:
;======================================================================
;
AY_WRTPSG:
HB_DI
CALL AY_DI
#IF (SBCV2004)
LD A,8 ; SBC-V2-004 CHANGE
OUT (112),A ; TO HALF CLOCK SPEED
@ -385,8 +458,7 @@ AY_WRTPSG:
LD A,0 ; SBC-V2-004 CHANGE TO
OUT (112),A ; NORMAL CLOCK SPEED
#ENDIF
HB_EI
RET
JP AY_EI
;
;======================================================================
@ -394,7 +466,7 @@ AY_WRTPSG:
; READ FROM REGISTER D AND RETURN WITH RESULT IN E
;
AY_RDPSG:
HB_DI
CALL AY_DI
#IF (SBCV2004)
LD A,8 ; SBC-V2-004 CHANGE
OUT (112),A ; TO HALF CLOCK SPEED
@ -417,13 +489,14 @@ AY_RDPSG:
LD A,0 ; SBC-V2-004 CHANGE TO
OUT (112),A ; NORMAL CLOCK SPEED
#ENDIF
HB_EI
RET
JP AY_EI
;
;======================================================================
;
AY_PENDING_PERIOD .DW 0 ; PENDING PERIOD (12 BITS) ; ORDER
AY_PENDING_VOLUME .DB 0 ; PENDING VOL (8 BITS) ; SIGNIFICANT
AY_READY .DB 0 ; BIT 0 -> NZ DRIVER IS READY TO RECEIVE PLAY COMMAND
; BIT 1 -> NZ EXECUTING WITHIN TIMER HANDLER = DO NOT DIS/ENABLE INT
;
#IF AUDIOTRACE
AYT_INIT .DB "\r\nAY_INIT\r\n$"

30
Source/HBIOS/cfg_state.inc

@ -0,0 +1,30 @@
#IFNDEF CFG_STATE
#DEFINE CFG_STATE
SYSTIMEN .EQU FALSE
#IF (CTCENABLE & (INTMODE == 2) & (CTCTIMER))
SYSTIMEN .SET TRUE
#ENDIF
#IF (TMSENABLE & (INTMODE == 1) & TMSTIMENABLE)
SYSTIMEN .SET TRUE
#ENDIF
#IF ((INTMODE == 1) & (PLATFORM == PLT_SBC) & HTIMENABLE)
SYSTIMEN .SET TRUE
#ENDIF
#IF ((INTMODE == 2) & (CPUFAM == CPU_Z180))
SYSTIMEN .SET TRUE
#ENDIF
.ECHO "TIMER INTERRUPT "
#IF SYSTIMEN
.ECHO "ACTIVE\n"
#ELSE
.ECHO "NOT ACTIVE\n"
#ENDIF
#ENDIF

BIN
Source/Images/Common/CLRDIR.COM

Binary file not shown.

BIN
Source/RomDsk/ROM_1024KB/CLRDIR.COM

Binary file not shown.

BIN
Source/RomDsk/ROM_512KB/CLRDIR.COM

Binary file not shown.

22
Source/ZPM3/Build.cmd

@ -19,7 +19,8 @@ copy ..\CPM3\zpmbios3.spr bnkbios3.spr
copy ..\CPM3\gencpm.com .
copy ..\CPM3\biosldrd.rel .
copy ..\CPM3\biosldrc.rel .
rem copy ..\CPM3\cpmldr.com .
copy ..\CPM3\cpmldr.com .
copy ..\CPM3\cpmldr.sys .
rem ZPM Loader
echo.
@ -46,3 +47,22 @@ rem Loader
tasm -t80 -g3 -fFF loader.asm loader.bin loader.lst
copy /b loader.bin + zpmldr.bin zpmldr.sys
rem Copy OS files to Binary directory
copy zpmldr.com ..\..\Binary\ZPM3
copy zpmldr.sys ..\..\Binary\ZPM3
copy cpmldr.com ..\..\Binary\ZPM3
copy cpmldr.sys ..\..\Binary\ZPM3
copy autotog.com ..\..\Binary\ZPM3
copy clrhist.com ..\..\Binary\ZPM3
copy setz3.com ..\..\Binary\ZPM3
copy cpm3.sys ..\..\Binary\ZPM3
copy zccp.com ..\..\Binary\ZPM3
copy zinstal.zpm ..\..\Binary\ZPM3
copy startzpm.com ..\..\Binary\ZPM3
copy makedos.com ..\..\Binary\ZPM3
copy gencpm.dat ..\..\Binary\ZPM3
copy bnkbios3.spr ..\..\Binary\ZPM3
copy bnkbdos3.spr ..\..\Binary\ZPM3
copy resbdos3.spr ..\..\Binary\ZPM3

20
Source/ZPM3/Makefile

@ -1,10 +1,12 @@
OBJECTS = zpmldr.com zpmldr.sys cpm3.sys startzpm.com zccp.com
ifdef REBUILD_ZPM_TOOLS
#ifdef REBUILD_ZPM_TOOLS
OBJECTS += setz3.com clrhist.com autotog.com
else
NODELETE = setz3.com clrhist.com autotog.com
endif
OTHERS = zpmldr.bin loader.bin biosldrd.rel biosldrc.rel gencpm.com gencpm.dat bnkbios3.spr
#else
NODELETE = setz3.com clrhist.com autotog.com makedos.com zinstal.zpm bnkbdos3.spr resbdos3.spr
#endif
OBJECTS += cpmldr.com cpmldr.sys zinstal.zpm makedos.com gencpm.dat bnkbios3.spr bnkbdos3.spr resbdos3.spr
OTHERS = zpmldr.bin loader.bin biosldrd.rel biosldrc.rel gencpm.com
DEST = ../../Binary/ZPM3/
TOOLS =../../Tools
include $(TOOLS)/Makefile.inc
@ -47,8 +49,8 @@ zinstal.zpm: ../ZCCP/zinstal.zpm
startzpm.com: ../ZCCP/startzpm.com
cp $< $@
setz3.com: setz3.z80
clrhist.com: clrhist.z80
cpmldr.com: ../CPM3/cpmldr.com
cp $< $@
autotog.com: autotog.z80
cpmldr.sys: ../CPM3/cpmldr.sys
cp $< $@

5
Source/ZPM3/loader.asm

@ -27,9 +27,12 @@
;
#INCLUDE "../ver.inc"
;
; BELOW, SYS_END MUST BE SET TO THE SIZE OF CPMLDR.BIN + SYS_LOC. IF
; THE SIZE OF CPMLDR.BIN CHANGES, SYS_END MUST BE UPDATED!!!
;
SYS_ENT .EQU $0100 ; SYSTEM (OS) ENTRY POINT ADDRESS
SYS_LOC .EQU $0100 ; STARTING ADDRESS TO LOAD SYSTEM IMAGE
SYS_END .EQU $1480 ; ENDING ADDRESS OF SYSTEM IMAGE
SYS_END .EQU $1580 + SYS_LOC ; ENDING ADDRESS OF SYSTEM IMAGE
;
SEC_SIZE .EQU 512 ; DISK SECTOR SIZE
BLK_SIZE .EQU 128 ; OS BLOCK/RECORD SIZE

2
Source/ver.inc

@ -2,4 +2,4 @@
#DEFINE RMN 1
#DEFINE RUP 1
#DEFINE RTP 0
#DEFINE BIOSVER "3.1.1-pre.7"
#DEFINE BIOSVER "3.1.1-pre.9"

2
Source/ver.lib

@ -3,5 +3,5 @@ rmn equ 1
rup equ 1
rtp equ 0
biosver macro
db "3.1.1-pre.7"
db "3.1.1-pre.9"
endm

2
Tools/Makefile.inc

@ -112,7 +112,7 @@ all:: $(OBJECTS)
@for dir in $(SUBDIRS) ; do \
( echo "building in `pwd`/$$dir" ; $(MAKE) --directory "$$dir" all ) ; \
done
@if [ "$(DEST)" ] ; then for file in $(OBJECTS) ; do \
@if [ "$(DEST)" ] ; then for file in $(filter-out $(NOCOPY),$(OBJECTS)) ; do \
mkdir -p $(DEST) ; \
echo copy $$file to $(DEST) ; \
cp $$($(CASEFN) $$file) $(DEST) ; \

Loading…
Cancel
Save