diff --git a/Doc/RomWBW Applications.pdf b/Doc/RomWBW Applications.pdf index 7c04e888..a81cd991 100644 Binary files a/Doc/RomWBW Applications.pdf and b/Doc/RomWBW Applications.pdf differ diff --git a/Doc/RomWBW Architecture.pdf b/Doc/RomWBW Architecture.pdf index 76c4944b..4ae067d4 100644 Binary files a/Doc/RomWBW Architecture.pdf and b/Doc/RomWBW Architecture.pdf differ diff --git a/Doc/RomWBW Getting Started.pdf b/Doc/RomWBW Getting Started.pdf index 23eb3b7b..ed132f42 100644 Binary files a/Doc/RomWBW Getting Started.pdf and b/Doc/RomWBW Getting Started.pdf differ diff --git a/ReadMe.md b/ReadMe.md index e789beea..ae38d703 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -165,119 +165,6 @@ disappear at the next power on (RAM is generally not persistent). Also note that attempts to save files to the ROM disk (B:) will fail because ROM is not writable. -# Upgrading - -Upgrading to a newer release of RomWBW is essentially just a matter of -updating the ROM chip in your system. If you have spare ROM chips for -your system and a ROM programmer, it is always safest to retain your -existing, working ROM chip and program a new one with the new firmware. -If the new one fails to boot, you can easily return to the known working -ROM. - -Prior to attempting to reprogram your actual ROM chip, you may wish to -“try” the upgrade. With RomWBW, you can upload a new system image -executable and load it from the command line. For each ROM image file -(.rom) in the Binary directory, you will also find a corresponding -application file (.com). For example, for SBC\_std.rom, there is also an -SBC\_std.com file. You can upload the .com file to your system using -XModem, then simply run the .com file. You will see your system go -through the normal startup process just like it was started from ROM. -However, your ROM has not been updated and the next time you boot your -system, it will revert to the system image contained in ROM. You may -find that you are unable to load the .com file because it is too large -to fit in available application RAM (TPA). Unfortunately, in this case, -you will not be able to use the .com file mechanism to start your -system. - -If you do not have easy access to a ROM programmer, it is usually -possible to reprogram your system ROM using the FLASH utility from Will -Sowerbutts. This application, called FLASH.COM, can be found on the ROM -drive of any running system. In this case, you would need to transfer -the new ROM image (.rom) over to your system using XModem (or one of the -other mechanisms described in the Transferring Files section below). The -ROM image is too large to fit on your RAM drive, so you will need to -transfer it to a larger storage drive. Once the ROM image is on your -system, you can use the FLASH application to update your ROM. The -following is a typical example of transferring ROM image using XModem -and flashing the chip in-situ. - - E>xm r rom.img - - XMODEM v12.5 - 07/13/86 - RBC, 28-Aug-2019 [WBW], ASCI - - Receiving: E0:ROM.IMG - 7312k available for uploads - File open - ready to receive - To cancel: Ctrl-X, pause, Ctrl-X - - Thanks for the upload - - E>flash write rom.img - FLASH4 by Will Sowerbutts version 1.2.3 - - Using RomWBW (v2.6+) bank switching. - Flash memory chip ID is 0xBFB7: 39F040 - Flash memory has 128 sectors of 4096 bytes, total 512KB - Write complete: Reprogrammed 2/128 sectors. - Verify (128 sectors) complete: OK! - -Obviously, there is some risk to this approach since any issues with the -programming or ROM image could result in a non-functional system. - -To confirm your ROM chip has been successfully updated, restart your -system and boot an operating system from ROM. Do not boot from a disk -device yet. Review the boot messages to see if any issues have occurred. - -Once you are satisfied that the ROM is working well, you will need to -update the system images and RomWBW custom applications on your disk -drives. The system images and custom applications are matched to the -RomWBW ROM firmware in use. If you attempt to boot a disk or run -applications that have not been updated to match the current ROM -firmware, you are likely to have odd problems. - -The simplest way to update your disk media is to just use your modern -computer to overwrite the entire media with the latest disk image of -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 would need to upload it from the -distribution. - -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 -following applications are found on your ROM disk. Use COPY to copy them -over any older versions of the app on your disk: - - - ASSIGN.COM - - SYSCOPY.COM - - MODE.COM - - FDU.COM (was FDTST.COM) - - FORMAT.COM - - XM.COM - - FLASH.COM - - FDISK80.COM - - TALK.COM - - RTC.COM - - TIMER.COM - - INTTEST.COM - -For example: `B>COPY ASSIGN.COM C:` - -Some RomWBW custom applications are too large to fit on the ROM disk. If -you are using any of these you will need to transfer them to your system -and then update all copies. These applications are found in the -Binary\\Apps directory of the distribution and in all of the disk -images. - - - FAT.COM - - TUNE.COM - # General Usage Each of the operating systems and ROM applications included with RomWBW @@ -487,14 +374,16 @@ therefore, globally available. | ----------- | ---------------------------------------------------------------------------------------------------- | | ASSIGN | Add, change, and delete drive letter assignments. Use ASSIGN /? for usage instructions. | | SYSCOPY | Copy system image to a device to make it bootable. Use SYSCOPY with no parms for usage instructions. | +| MODE | Reconfigures serial ports dynamically. | | FDU | Format and test floppy disks. Menu driven interface. | | FORMAT | Will someday be a command line tool to format floppy disks. Currently does nothing\! | -| MODE | Reconfigures serial ports dynamically. | | XM | XModem file transfer program adapted to hardware. Automatically uses primary serial port on system. | -| FDISK80 | John Coffman’s Z80 hard disk partitioning tool. See documentation in Doc directory. | -| FAT | Access MS-DOS FAT filesystems from RomWBW (based on FatFs). | | FLASH | Will Sowerbutts’ in-situ ROM programming utility. | -| CLRDIR | Initialize the directory area of a CP/M disk (Max Scane). | +| FDISK80 | John Coffman’s Z80 hard disk partitioning tool. See documentation in Doc directory. | +| TALK | Direct console I/O to a specified character device. | +| RTC | Manage and test the Real Time Clock hardware. | +| TIMER | Display value of running periodic system timer. | +| INTTEST | Test interrupt vector hooking. | Some custom applications do not fit on the ROM disk. They are found on the disk image files or the individual files can be found in the @@ -505,9 +394,8 @@ Binary\\Apps directory of the distribution. | TUNE | Play .PT2, .PT3, .MYM audio files. | | FAT | Access MS-DOS FAT filesystems from RomWBW (based on FatFs). | -There is additional documentation on some of these applications at the -[RomWBW Applications -Page](https://www.retrobrewcomputers.org/doku.php?id=software:firmwareos:romwbw:apps). +Additional documentation on all of these applications can be found in +“RomWBW Applications.pdf” in the Doc directory of the distribution. # Using Disks @@ -1062,6 +950,123 @@ Please refer to the [UNA BIOS Firmware Page](https://www.retrobrewcomputers.org/doku.php?id=software:firmwareos:una:start) for more information on UNA. +# Upgrading + +Upgrading to a newer release of RomWBW is essentially just a matter of +updating the ROM chip in your system. If you have spare ROM chips for +your system and a ROM programmer, it is always safest to retain your +existing, working ROM chip and program a new one with the new firmware. +If the new one fails to boot, you can easily return to the known working +ROM. + +Prior to attempting to reprogram your actual ROM chip, you may wish to +“try” the upgrade. With RomWBW, you can upload a new system image +executable and load it from the command line. For each ROM image file +(.rom) in the Binary directory, you will also find a corresponding +application file (.com). For example, for SBC\_std.rom, there is also an +SBC\_std.com file. You can upload the .com file to your system using +XModem, then simply run the .com file. You will see your system go +through the normal startup process just like it was started from ROM. +However, your ROM has not been updated and the next time you boot your +system, it will revert to the system image contained in ROM. + +There are two restrictions to be aware of related to loading a system +image as a .com application. First, this is only supported under +Z-System and CP/M 2.2. You must boot into one of these OSes before +attempting to launch the .com file. Second, you may find that you are +unable to load the .com file because it is too large to fit in available +application RAM (TPA). Your only recourse in this situation is to build +a custom ROM with fewer features. + +If you do not have easy access to a ROM programmer, it is usually +possible to reprogram your system ROM using the FLASH utility from Will +Sowerbutts. This application, called FLASH.COM, can be found on the ROM +drive of any running system. In this case, you would need to transfer +the new ROM image (.rom) over to your system using XModem (or one of the +other mechanisms described in the Transferring Files section). The ROM +image is too large to fit on your RAM drive, so you will need to +transfer it to a larger storage drive. Once the ROM image is on your +system, you can use the FLASH application to update your ROM. The +following is a typical example of transferring ROM image using XModem +and flashing the chip in-situ. + + E>xm r rom.img + + XMODEM v12.5 - 07/13/86 + RBC, 28-Aug-2019 [WBW], ASCI + + Receiving: E0:ROM.IMG + 7312k available for uploads + File open - ready to receive + To cancel: Ctrl-X, pause, Ctrl-X + + Thanks for the upload + + E>flash write rom.img + FLASH4 by Will Sowerbutts version 1.2.3 + + Using RomWBW (v2.6+) bank switching. + Flash memory chip ID is 0xBFB7: 39F040 + Flash memory has 128 sectors of 4096 bytes, total 512KB + Write complete: Reprogrammed 2/128 sectors. + Verify (128 sectors) complete: OK! + +Obviously, there is some risk to this approach since any issues with the +programming or ROM image could result in a non-functional system. + +To confirm your ROM chip has been successfully updated, restart your +system and boot an operating system from ROM. Do not boot from a disk +device yet. Review the boot messages to see if any issues have occurred. + +Once you are satisfied that the ROM is working well, you will need to +update the system images and RomWBW custom applications on your disk +drives. The system images and custom applications are matched to the +RomWBW ROM firmware in use. If you attempt to boot a disk or run +applications that have not been updated to match the current ROM +firmware, you are likely to have odd problems. + +The simplest way to update your disk media is to just use your modern +computer to overwrite the entire media with the latest disk image of +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. + +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 +following applications are found on your ROM disk. Use COPY to copy them +over any older versions of the app on your disk: + + - ASSIGN.COM + - SYSCOPY.COM + - MODE.COM + - FDU.COM (was FDTST.COM) + - FORMAT.COM + - XM.COM + - FLASH.COM + - FDISK80.COM + - TALK.COM + - RTC.COM + - TIMER.COM + - INTTEST.COM + +For example: `B>COPY ASSIGN.COM C:` + +Some RomWBW custom applications are too large to fit on the ROM disk. If +you are using any of these you will need to transfer them to your system +and then update all copies. These applications are found in the +Binary\\Apps directory of the distribution and in all of the disk +images. + + - FAT.COM + - TUNE.COM + # RomWBW Distribution All source code and distributions are maintained on GitHub. Code diff --git a/ReadMe.txt b/ReadMe.txt index e6eea6b1..9dd43532 100644 --- a/ReadMe.txt +++ b/ReadMe.txt @@ -179,117 +179,6 @@ disappear at the next power on (RAM is generally not persistent). Also note that attempts to save files to the ROM disk (B:) will fail because ROM is not writable. -Upgrading - -Upgrading to a newer release of RomWBW is essentially just a matter of -updating the ROM chip in your system. If you have spare ROM chips for -your system and a ROM programmer, it is always safest to retain your -existing, working ROM chip and program a new one with the new firmware. -If the new one fails to boot, you can easily return to the known working -ROM. - -Prior to attempting to reprogram your actual ROM chip, you may wish to -“try” the upgrade. With RomWBW, you can upload a new system image -executable and load it from the command line. For each ROM image file -(.rom) in the Binary directory, you will also find a corresponding -application file (.com). For example, for SBC_std.rom, there is also an -SBC_std.com file. You can upload the .com file to your system using -XModem, then simply run the .com file. You will see your system go -through the normal startup process just like it was started from ROM. -However, your ROM has not been updated and the next time you boot your -system, it will revert to the system image contained in ROM. You may -find that you are unable to load the .com file because it is too large -to fit in available application RAM (TPA). Unfortunately, in this case, -you will not be able to use the .com file mechanism to start your -system. - -If you do not have easy access to a ROM programmer, it is usually -possible to reprogram your system ROM using the FLASH utility from Will -Sowerbutts. This application, called FLASH.COM, can be found on the ROM -drive of any running system. In this case, you would need to transfer -the new ROM image (.rom) over to your system using XModem (or one of the -other mechanisms described in the Transferring Files section below). The -ROM image is too large to fit on your RAM drive, so you will need to -transfer it to a larger storage drive. Once the ROM image is on your -system, you can use the FLASH application to update your ROM. The -following is a typical example of transferring ROM image using XModem -and flashing the chip in-situ. - - E>xm r rom.img - - XMODEM v12.5 - 07/13/86 - RBC, 28-Aug-2019 [WBW], ASCI - - Receiving: E0:ROM.IMG - 7312k available for uploads - File open - ready to receive - To cancel: Ctrl-X, pause, Ctrl-X - - Thanks for the upload - - E>flash write rom.img - FLASH4 by Will Sowerbutts version 1.2.3 - - Using RomWBW (v2.6+) bank switching. - Flash memory chip ID is 0xBFB7: 39F040 - Flash memory has 128 sectors of 4096 bytes, total 512KB - Write complete: Reprogrammed 2/128 sectors. - Verify (128 sectors) complete: OK! - -Obviously, there is some risk to this approach since any issues with the -programming or ROM image could result in a non-functional system. - -To confirm your ROM chip has been successfully updated, restart your -system and boot an operating system from ROM. Do not boot from a disk -device yet. Review the boot messages to see if any issues have occurred. - -Once you are satisfied that the ROM is working well, you will need to -update the system images and RomWBW custom applications on your disk -drives. The system images and custom applications are matched to the -RomWBW ROM firmware in use. If you attempt to boot a disk or run -applications that have not been updated to match the current ROM -firmware, you are likely to have odd problems. - -The simplest way to update your disk media is to just use your modern -computer to overwrite the entire media with the latest disk image of -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 would need to upload it from the distribution. - -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 -following applications are found on your ROM disk. Use COPY to copy them -over any older versions of the app on your disk: - -- ASSIGN.COM -- SYSCOPY.COM -- MODE.COM -- FDU.COM (was FDTST.COM) -- FORMAT.COM -- XM.COM -- FLASH.COM -- FDISK80.COM -- TALK.COM -- RTC.COM -- TIMER.COM -- INTTEST.COM - -For example: B>COPY ASSIGN.COM C: - -Some RomWBW custom applications are too large to fit on the ROM disk. If -you are using any of these you will need to transfer them to your system -and then update all copies. These applications are found in the -Binary\Apps directory of the distribution and in all of the disk images. - -- FAT.COM -- TUNE.COM - General Usage Each of the operating systems and ROM applications included with RomWBW @@ -495,34 +384,38 @@ the OS variants included with RomWBW. The following custom applications are found on the ROM disk and are, therefore, globally available. - -------------------------------------------------------------------------- + ----------------------------------------------------------------------------- Application Description - ------------- ------------------------------------------------------------ - ASSIGN Add, change, and delete drive letter assignments. Use ASSIGN - /? for usage instructions. + ------------- --------------------------------------------------------------- + ASSIGN Add, change, and delete drive letter assignments. Use ASSIGN /? + for usage instructions. + + SYSCOPY Copy system image to a device to make it bootable. Use SYSCOPY + with no parms for usage instructions. - SYSCOPY Copy system image to a device to make it bootable. Use - SYSCOPY with no parms for usage instructions. + MODE Reconfigures serial ports dynamically. FDU Format and test floppy disks. Menu driven interface. FORMAT Will someday be a command line tool to format floppy disks. Currently does nothing! - MODE Reconfigures serial ports dynamically. + XM XModem file transfer program adapted to hardware. Automatically + uses primary serial port on system. - XM XModem file transfer program adapted to hardware. - Automatically uses primary serial port on system. + FLASH Will Sowerbutts’ in-situ ROM programming utility. FDISK80 John Coffman’s Z80 hard disk partitioning tool. See documentation in Doc directory. - FAT Access MS-DOS FAT filesystems from RomWBW (based on FatFs). + TALK Direct console I/O to a specified character device. - FLASH Will Sowerbutts’ in-situ ROM programming utility. + RTC Manage and test the Real Time Clock hardware. - CLRDIR Initialize the directory area of a CP/M disk (Max Scane). - -------------------------------------------------------------------------- + TIMER Display value of running periodic system timer. + + INTTEST Test interrupt vector hooking. + ----------------------------------------------------------------------------- Some custom applications do not fit on the ROM disk. They are found on the disk image files or the individual files can be found in the @@ -533,8 +426,8 @@ Binary\Apps directory of the distribution. TUNE Play .PT2, .PT3, .MYM audio files. FAT Access MS-DOS FAT filesystems from RomWBW (based on FatFs). -There is additional documentation on some of these applications at the -RomWBW Applications Page. +Additional documentation on all of these applications can be found in +“RomWBW Applications.pdf” in the Doc directory of the distribution. Using Disks @@ -1083,6 +976,122 @@ support for VGA3 as soon as it reaches production status. Please refer to the UNA BIOS Firmware Page for more information on UNA. +Upgrading + +Upgrading to a newer release of RomWBW is essentially just a matter of +updating the ROM chip in your system. If you have spare ROM chips for +your system and a ROM programmer, it is always safest to retain your +existing, working ROM chip and program a new one with the new firmware. +If the new one fails to boot, you can easily return to the known working +ROM. + +Prior to attempting to reprogram your actual ROM chip, you may wish to +“try” the upgrade. With RomWBW, you can upload a new system image +executable and load it from the command line. For each ROM image file +(.rom) in the Binary directory, you will also find a corresponding +application file (.com). For example, for SBC_std.rom, there is also an +SBC_std.com file. You can upload the .com file to your system using +XModem, then simply run the .com file. You will see your system go +through the normal startup process just like it was started from ROM. +However, your ROM has not been updated and the next time you boot your +system, it will revert to the system image contained in ROM. + +There are two restrictions to be aware of related to loading a system +image as a .com application. First, this is only supported under +Z-System and CP/M 2.2. You must boot into one of these OSes before +attempting to launch the .com file. Second, you may find that you are +unable to load the .com file because it is too large to fit in available +application RAM (TPA). Your only recourse in this situation is to build +a custom ROM with fewer features. + +If you do not have easy access to a ROM programmer, it is usually +possible to reprogram your system ROM using the FLASH utility from Will +Sowerbutts. This application, called FLASH.COM, can be found on the ROM +drive of any running system. In this case, you would need to transfer +the new ROM image (.rom) over to your system using XModem (or one of the +other mechanisms described in the Transferring Files section). The ROM +image is too large to fit on your RAM drive, so you will need to +transfer it to a larger storage drive. Once the ROM image is on your +system, you can use the FLASH application to update your ROM. The +following is a typical example of transferring ROM image using XModem +and flashing the chip in-situ. + + E>xm r rom.img + + XMODEM v12.5 - 07/13/86 + RBC, 28-Aug-2019 [WBW], ASCI + + Receiving: E0:ROM.IMG + 7312k available for uploads + File open - ready to receive + To cancel: Ctrl-X, pause, Ctrl-X + + Thanks for the upload + + E>flash write rom.img + FLASH4 by Will Sowerbutts version 1.2.3 + + Using RomWBW (v2.6+) bank switching. + Flash memory chip ID is 0xBFB7: 39F040 + Flash memory has 128 sectors of 4096 bytes, total 512KB + Write complete: Reprogrammed 2/128 sectors. + Verify (128 sectors) complete: OK! + +Obviously, there is some risk to this approach since any issues with the +programming or ROM image could result in a non-functional system. + +To confirm your ROM chip has been successfully updated, restart your +system and boot an operating system from ROM. Do not boot from a disk +device yet. Review the boot messages to see if any issues have occurred. + +Once you are satisfied that the ROM is working well, you will need to +update the system images and RomWBW custom applications on your disk +drives. The system images and custom applications are matched to the +RomWBW ROM firmware in use. If you attempt to boot a disk or run +applications that have not been updated to match the current ROM +firmware, you are likely to have odd problems. + +The simplest way to update your disk media is to just use your modern +computer to overwrite the entire media with the latest disk image of +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. + +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 +following applications are found on your ROM disk. Use COPY to copy them +over any older versions of the app on your disk: + +- ASSIGN.COM +- SYSCOPY.COM +- MODE.COM +- FDU.COM (was FDTST.COM) +- FORMAT.COM +- XM.COM +- FLASH.COM +- FDISK80.COM +- TALK.COM +- RTC.COM +- TIMER.COM +- INTTEST.COM + +For example: B>COPY ASSIGN.COM C: + +Some RomWBW custom applications are too large to fit on the ROM disk. If +you are using any of these you will need to transfer them to your system +and then update all copies. These applications are found in the +Binary\Apps directory of the distribution and in all of the disk images. + +- FAT.COM +- TUNE.COM + RomWBW Distribution All source code and distributions are maintained on GitHub. Code diff --git a/Source/Apps/Tune/Tune.asm b/Source/Apps/Tune/Tune.asm index 2526fccf..14814b23 100644 --- a/Source/Apps/Tune/Tune.asm +++ b/Source/Apps/Tune/Tune.asm @@ -100,9 +100,19 @@ CFGSEL: LD A,(PLT) ; Get platform id of loaded config CP E ; Equal? JR NZ,CFGSEL ; If no match keep trying +; + ; Activate card if applicable + CALL SLOWIO ; Slow down I/O now + LD A,(ACR) ; Get ACR port address (if any) + INC A ; $FF -> $00 & set flags + JR Z,PROBE ; Skip ahead to probe if no ACR + DEC A ; Restore real ACR port address + LD C,A ; Put in C for I/O + LD A,$FF ; Value to activate card + OUT (C),A ; Write value to ACR ; +PROBE: ; Test for hardware (sound chip detection) - CALL SLOWIO LD DE,(PORTS) ; D := RDAT, E := RSEL LD C,E ; Port = RSEL LD A,2 ; Register 2 @@ -110,17 +120,16 @@ CFGSEL: LD C,D ; Port = RDAT LD A,$AA ; Value = $AA OUT (C),A ; Write $AA to register 2 - ;LD C,E ; Port = RSEL LD A,(RIN) ; Port = RIN LD C,A ; ... to C IN A,(C) ; Read back value in register 2 - PUSH AF - CALL NORMIO - POP AF - ;CALL PRTHEX ; *debug* CP $AA ; Value as written? - JR NZ,CFGSEL ; If not, keep trying configs + JR Z,MAT ; Hardware matched! + CALL NORMIO ; Back to normal I/O speeds + JR CFGSEL ; And keep trying ; +MAT: + ; Hardware matched! CALL CRLF ; Formatting LD DE,(DESC) ; Load hardware description pointer CALL PRTSTR ; Print description @@ -150,15 +159,6 @@ SETDLY: RR E ; ... for delay factor EX DE,HL ; Move result to HL LD (QDLY),HL ; Save result as quark delay factor -; - ; Activate SCG card if applicable - LD A,(ACR) - CP $FF - JR Z,NOSCG - LD C,A - LD A,$FF - OUT (C),A -NOSCG: ; ; Clear heap storage LD HL,HEAP ; Point to heap start @@ -766,7 +766,7 @@ FILTYP .DB 0 ; Sound file type (TYPPT2, TYPPT3, TYPMYM) TMP .DB 0 ; work around use of undocumented Z80 ; -MSGBAN .DB "Tune Player for RomWBW v2.3, 11-Feb-2020",0 +MSGBAN .DB "Tune Player for RomWBW v2.4, 23-Mar-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 diff --git a/Source/CBIOS/cbios.asm b/Source/CBIOS/cbios.asm index 5482cbc1..a822887f 100644 --- a/Source/CBIOS/cbios.asm +++ b/Source/CBIOS/cbios.asm @@ -2277,7 +2277,7 @@ CLRRAM2: CLRRAM3: LD A,(BNKUSER) ; USR BANK (TPA) CALL HB_BNKSEL ; SELECT BANK - EI ; RESUME INTRRUPTS + EI ; RESUME INTERRUPTS #ENDIF ; #ENDIF diff --git a/Source/CPM3/boot.z80 b/Source/CPM3/boot.z80 index a252faff..9c423f68 100644 --- a/Source/CPM3/boot.z80 +++ b/Source/CPM3/boot.z80 @@ -59,14 +59,15 @@ init$2: call ?pmsg ; print it ; Get boot disk unit and save it - ld bc,0F8E0h ; HBIOS func: get boot info - rst 08 ; do it, D := boot unit, E: := boot slice - ld a,d ; move boot unit to A - ld (@bootdu),a ; save it - ld a,e ; move boot slice to A - ld (@bootsl),a ; save it + ld bc,0F8E0h ; HBIOS func: get boot info + rst 08 ; do it, D := boot unit, E: := boot slice + ld a,d ; move boot unit to A + ld (@bootdu),a ; save it + ld a,e ; move boot slice to A + ld (@bootsl),a ; save it call dinit + call clrram ret cinit: @@ -298,6 +299,75 @@ stpimg db 'W',~'W' ; marker dw cbx ; address of cbios ext data stpsiz equ $ - stpimg + + cseg ; ram disk init must be done from resident memory + +; +; Initialize ram disk by filling directory with 'e5' bytes +; Fill first 8k of ram disk track 1 with 'e5' +; +clrram: + di ; no interrupts + ld a,(0FFE0h) ; get current bank + push af ; save it + ;ld a,(bnkramd) ; first bank of ram disk + ld a,080h ; first bank of ram disk + ;call hb_bnksel ; select bank + call 0FFF3h ; select bank + + ; Check first 32 directory entries. If any start with an invalid + ; value, init the ram disk. Valid entries are e5 (empty entry) or + ; 0-15 (user number). + ld hl,0 + ld de,32 + ld b,32 +clrram0: + ld a,(hl) + cp 0E5h + jr z,clrram1 ; e5 is valid + cp 16 + jr c,clrram1 ; 0-15 is also valid + jr clrram2 ; invalid entry! jump to init +clrram1: + add hl,de ; loop for 32 entries + djnz clrram0 +; jr clrram2 ; *debug* + jr clrram3 ; all entries valid, bypass init +clrram2: + ld hl,0 ; source adr for fill + ld bc,2000h ; length of fill is 8k + ld a,0E5h ; fill value + call fill ; do it + or 0ffh ; flag value for cleared + ld (clrflg),a ; save it +clrram3: + ;ld a,(bnkuser) ; usr bank (tpa) + pop af ; recover original bank + ;call hb_bnksel ; select bank + call 0FFF3h ; select bank + ei ; resume interrupts + + ld a,(clrflg) ; get cleared flag + or a ; set flags + ld hl,clr$msg ; clear ram disk message + call nz,?pmsg ; print msg if true + + ret + +; +; Fill memory at hl with value a, length in bc. All regs used. +; Length *must* be greater than 1 for proper operation!!! +; +fill: + ld d,h ; set de to hl + ld e,l ; so destination equals source + ld (hl),a ; fill the first byte with desired value + inc de ; increment destination + dec bc ; decrement the count + ldir ; do the rest + ret ; return + + cseg ; boot loading most be done from resident memory ; This version of the boot loader loads the CCP from a file @@ -569,6 +639,9 @@ read: ld c,20 jp bdos +clrflg db 0 ; RAM disk cleared flag +clr$msg db 'RAM Disk Initialized',13,10,13,10,0 + if zpm signon$msg db 13,10,'ZPM3' diff --git a/Source/Doc/GettingStarted.md b/Source/Doc/GettingStarted.md index 0083d7d4..128d29f9 100644 --- a/Source/Doc/GettingStarted.md +++ b/Source/Doc/GettingStarted.md @@ -196,122 +196,6 @@ to the RAM disk (A:) will disappear at the next power on (RAM is generally not persistent). Also note that attempts to save files to the ROM disk (B:) will fail because ROM is not writable. -# Upgrading - -Upgrading to a newer release of RomWBW is essentially just a matter of -updating the ROM chip in your system. If you have spare ROM chips for -your system and a ROM programmer, it is always safest to retain your -existing, working ROM chip and program a new one with the new -firmware. If the new one fails to boot, you can easily return to the -known working ROM. - -Prior to attempting to reprogram your actual ROM chip, you may wish to -"try" the upgrade. With RomWBW, you can upload a new system image -executable and load it from the command line. For each ROM image file -(.rom) in the Binary directory, you will also find a corresponding -application file (.com). For example, for SBC_std.rom, there is also -an SBC_std.com file. You can upload the .com file to your system using -XModem, then simply run the .com file. You will see your system go -through the normal startup process just like it was started from ROM. -However, your ROM has not been updated and the next time you boot your -system, it will revert to the system image contained in ROM. You may -find that you are unable to load the .com file because it is too large -to fit in available application RAM (TPA). Unfortunately, in this -case, you will not be able to use the .com file mechanism to start -your system. - -If you do not have easy access to a ROM programmer, it is usually -possible to reprogram your system ROM using the FLASH utility from -Will Sowerbutts. This application, called FLASH.COM, can be found on the -ROM drive of any running system. In this case, you would need to -transfer the new ROM image (.rom) over to your system using XModem (or -one of the other mechanisms described in the Transferring Files -section below). The ROM image is too large to fit on your RAM drive, -so you will need to transfer it to a larger storage drive. Once the -ROM image is on your system, you can use the FLASH application to -update your ROM. The following is a typical example of transferring -ROM image using XModem and flashing the chip in-situ. - -``` -E>xm r rom.img - -XMODEM v12.5 - 07/13/86 -RBC, 28-Aug-2019 [WBW], ASCI - -Receiving: E0:ROM.IMG -7312k available for uploads -File open - ready to receive -To cancel: Ctrl-X, pause, Ctrl-X - -Thanks for the upload - -E>flash write rom.img -FLASH4 by Will Sowerbutts version 1.2.3 - -Using RomWBW (v2.6+) bank switching. -Flash memory chip ID is 0xBFB7: 39F040 -Flash memory has 128 sectors of 4096 bytes, total 512KB -Write complete: Reprogrammed 2/128 sectors. -Verify (128 sectors) complete: OK! -``` - -Obviously, there is some risk to this approach since any issues with the -programming or ROM image could result in a non-functional system. - -To confirm your ROM chip has been successfully updated, restart your -system and boot an operating system from ROM. Do not boot from a disk -device yet. Review the boot messages to see if any issues have -occurred. - -Once you are satisfied that the ROM is working well, you will need to -update the system images and RomWBW custom applications on your disk -drives. The system images and custom applications are matched to the -RomWBW ROM firmware in use. If you attempt to boot a disk or run -applications that have not been updated to match the current ROM -firmware, you are likely to have odd problems. - -The simplest way to update your disk media is to just use your modern -computer to overwrite the entire media with the latest disk image of 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 would need to -upload it from the distribution. - -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 -following applications are found on your ROM disk. Use COPY to copy -them over any older versions of the app on your disk: - -* ASSIGN.COM -* SYSCOPY.COM -* MODE.COM -* FDU.COM (was FDTST.COM) -* FORMAT.COM -* XM.COM -* FLASH.COM -* FDISK80.COM -* TALK.COM -* RTC.COM -* TIMER.COM -* INTTEST.COM - -For example: `B>COPY ASSIGN.COM C:` - -Some RomWBW custom applications are too large to fit on the ROM disk. -If you are using any of these you will need to transfer them to your -system and then update all copies. These applications are found in -the Binary\\Apps directory of the distribution and in all of the disk -images. - -* FAT.COM -* TUNE.COM - # General Usage Each of the operating systems and ROM applications included with @@ -523,18 +407,20 @@ functional on all of the OS variants included with RomWBW. The following custom applications are found on the ROM disk and are, therefore, globally available. -| Application | Description | -| ----------- | -------------------------------------------------------------- | -| ASSIGN | Add, change, and delete drive letter assignments. Use ASSIGN /? for usage instructions. | +| Application | Description | +| ----------- | ---------------------------------------------------------------------------------------------------- | +| ASSIGN | Add, change, and delete drive letter assignments. Use ASSIGN /? for usage instructions. | | SYSCOPY | Copy system image to a device to make it bootable. Use SYSCOPY with no parms for usage instructions. | -| FDU | Format and test floppy disks. Menu driven interface. | -| FORMAT | Will someday be a command line tool to format floppy disks. Currently does nothing! | -| MODE | Reconfigures serial ports dynamically. | -| XM | XModem file transfer program adapted to hardware. Automatically uses primary serial port on system. | -| FDISK80 | John Coffman's Z80 hard disk partitioning tool. See documentation in Doc directory. | -| FAT | Access MS-DOS FAT filesystems from RomWBW (based on FatFs). | -| FLASH | Will Sowerbutts' in-situ ROM programming utility. | -| CLRDIR | Initialize the directory area of a CP/M disk (Max Scane). | +| MODE | Reconfigures serial ports dynamically. | +| FDU | Format and test floppy disks. Menu driven interface. | +| FORMAT | Will someday be a command line tool to format floppy disks. Currently does nothing! | +| XM | XModem file transfer program adapted to hardware. Automatically uses primary serial port on system. | +| FLASH | Will Sowerbutts' in-situ ROM programming utility. | +| FDISK80 | John Coffman's Z80 hard disk partitioning tool. See documentation in Doc directory. | +| TALK | Direct console I/O to a specified character device. | +| RTC | Manage and test the Real Time Clock hardware. | +| TIMER | Display value of running periodic system timer. | +| INTTEST | Test interrupt vector hooking. | Some custom applications do not fit on the ROM disk. They are found on the disk image files or the individual files can be found in the Binary\\Apps @@ -545,8 +431,8 @@ directory of the distribution. | TUNE | Play .PT2, .PT3, .MYM audio files. | | FAT | Access MS-DOS FAT filesystems from RomWBW (based on FatFs). | -There is additional documentation on some of these applications at the -[RomWBW Applications Page](https://www.retrobrewcomputers.org/doku.php?id=software:firmwareos:romwbw:apps). +Additional documentation on all of these applications can be found in +"RomWBW Applications.pdf" in the Doc directory of the distribution. # Using Disks @@ -1117,6 +1003,126 @@ Please refer to the [UNA BIOS Firmware Page](https://www.retrobrewcomputers.org/doku.php?id=software:firmwareos:una:start) for more information on UNA. +# Upgrading + +Upgrading to a newer release of RomWBW is essentially just a matter of +updating the ROM chip in your system. If you have spare ROM chips for +your system and a ROM programmer, it is always safest to retain your +existing, working ROM chip and program a new one with the new +firmware. If the new one fails to boot, you can easily return to the +known working ROM. + +Prior to attempting to reprogram your actual ROM chip, you may wish to +"try" the upgrade. With RomWBW, you can upload a new system image +executable and load it from the command line. For each ROM image file +(.rom) in the Binary directory, you will also find a corresponding +application file (.com). For example, for SBC_std.rom, there is also +an SBC_std.com file. You can upload the .com file to your system using +XModem, then simply run the .com file. You will see your system go +through the normal startup process just like it was started from ROM. +However, your ROM has not been updated and the next time you boot your +system, it will revert to the system image contained in ROM. + +There are two restrictions to be aware of related to loading a system +image as a .com application. First, this is only supported under +Z-System and CP/M 2.2. You must boot into one of these OSes before +attempting to launch the .com file. Second, you may find that you +are unable to load the .com file because it is too large to fit in +available application RAM (TPA). Your only recourse in this +situation is to build a custom ROM with fewer features. + +If you do not have easy access to a ROM programmer, it is usually +possible to reprogram your system ROM using the FLASH utility from +Will Sowerbutts. This application, called FLASH.COM, can be found on the +ROM drive of any running system. In this case, you would need to +transfer the new ROM image (.rom) over to your system using XModem (or +one of the other mechanisms described in the Transferring Files +section). The ROM image is too large to fit on your RAM drive, +so you will need to transfer it to a larger storage drive. Once the +ROM image is on your system, you can use the FLASH application to +update your ROM. The following is a typical example of transferring +ROM image using XModem and flashing the chip in-situ. + +``` +E>xm r rom.img + +XMODEM v12.5 - 07/13/86 +RBC, 28-Aug-2019 [WBW], ASCI + +Receiving: E0:ROM.IMG +7312k available for uploads +File open - ready to receive +To cancel: Ctrl-X, pause, Ctrl-X + +Thanks for the upload + +E>flash write rom.img +FLASH4 by Will Sowerbutts version 1.2.3 + +Using RomWBW (v2.6+) bank switching. +Flash memory chip ID is 0xBFB7: 39F040 +Flash memory has 128 sectors of 4096 bytes, total 512KB +Write complete: Reprogrammed 2/128 sectors. +Verify (128 sectors) complete: OK! +``` + +Obviously, there is some risk to this approach since any issues with the +programming or ROM image could result in a non-functional system. + +To confirm your ROM chip has been successfully updated, restart your +system and boot an operating system from ROM. Do not boot from a disk +device yet. Review the boot messages to see if any issues have +occurred. + +Once you are satisfied that the ROM is working well, you will need to +update the system images and RomWBW custom applications on your disk +drives. The system images and custom applications are matched to the +RomWBW ROM firmware in use. If you attempt to boot a disk or run +applications that have not been updated to match the current ROM +firmware, you are likely to have odd problems. + +The simplest way to update your disk media is to just use your modern +computer to overwrite the entire media with the latest disk image of +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. + +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 +following applications are found on your ROM disk. Use COPY to copy +them over any older versions of the app on your disk: + +* ASSIGN.COM +* SYSCOPY.COM +* MODE.COM +* FDU.COM (was FDTST.COM) +* FORMAT.COM +* XM.COM +* FLASH.COM +* FDISK80.COM +* TALK.COM +* RTC.COM +* TIMER.COM +* INTTEST.COM + +For example: `B>COPY ASSIGN.COM C:` + +Some RomWBW custom applications are too large to fit on the ROM disk. +If you are using any of these you will need to transfer them to your +system and then update all copies. These applications are found in +the Binary\\Apps directory of the distribution and in all of the disk +images. + +* FAT.COM +* TUNE.COM + # RomWBW Distribution All source code and distributions are maintained on GitHub. Code