mirror of https://github.com/wwarthen/RomWBW.git
582 changed files with 84481 additions and 58917 deletions
File diff suppressed because it is too large
File diff suppressed because it is too large
@ -0,0 +1,26 @@ |
|||||
|
@echo off |
||||
|
|
||||
|
setlocal |
||||
|
|
||||
|
set PATH=..\Tools\tasm32;..\Tools\zx;%PATH% |
||||
|
|
||||
|
set TASMTABS=..\Tools\tasm32 |
||||
|
|
||||
|
set ZXBINDIR=../tools/cpm/bin/ |
||||
|
set ZXLIBDIR=../tools/cpm/lib/ |
||||
|
set ZXINCDIR=../tools/cpm/include/ |
||||
|
|
||||
|
call :asm SysCopy || goto :eof |
||||
|
call :asm Assign || goto :eof |
||||
|
call :asm Format || goto :eof |
||||
|
call :asm Talk || goto :eof |
||||
|
|
||||
|
zx Z80ASM -SYSGEN/F |
||||
|
|
||||
|
goto :eof |
||||
|
|
||||
|
:asm |
||||
|
echo. |
||||
|
echo Building %1... |
||||
|
tasm -t80 -b -g3 -fFF %1.asm %1.com %1.lst |
||||
|
goto :eof |
||||
@ -0,0 +1,4 @@ |
|||||
|
@echo off |
||||
|
if exist *.bin del *.bin |
||||
|
if exist *.com del *.com |
||||
|
if exist *.lst del *.lst |
||||
@ -0,0 +1,28 @@ |
|||||
|
;=============================================================================== |
||||
|
; FORMAT - DISK FORMAT UTILITY FOR ROMWBW ADAPTATION OF CP/M 2.2 |
||||
|
;=============================================================================== |
||||
|
; |
||||
|
; AUTHOR: WAYNE WARTHEN (wwarthen@gmail.com) |
||||
|
;_______________________________________________________________________________ |
||||
|
; |
||||
|
; CHANGELOG: |
||||
|
;_______________________________________________________________________________ |
||||
|
; |
||||
|
; TODO: |
||||
|
; |
||||
|
;_______________________________________________________________________________ |
||||
|
; |
||||
|
; |
||||
|
;=============================================================================== |
||||
|
; MAIN PROGRAM PROCEDURE |
||||
|
;=============================================================================== |
||||
|
; |
||||
|
.ORG 00100H |
||||
|
RET |
||||
|
; |
||||
|
STACKSAV .DW 0 |
||||
|
STACKSIZ .EQU 40H ; WE ARE A STACK PIG |
||||
|
.FILL STACKSIZ,0 |
||||
|
STACK .EQU $ |
||||
|
; |
||||
|
.END |
||||
@ -1,106 +0,0 @@ |
|||||
/* twodrive.c 7/11/2012 dwg - */ |
|
||||
|
|
||||
/* This program is experimental and is not for release because
|
|
||||
it contains techniques which are not recommended because |
|
||||
there are better API functions to do these operations. */ |
|
||||
|
|
||||
/*
|
|
||||
This code is in the crossdev folder because it is part of |
|
||||
my development environment, and I said I would make everything |
|
||||
available. |
|
||||
|
|
||||
The purpose of this code is to dynamically alter the BIOS |
|
||||
data associated with PPIDE (or PPISD) drives. The default |
|
||||
configuration is that mass storage devices get four drives. |
|
||||
|
|
||||
Each of the four drives can be remapped using the logical |
|
||||
unit utility MAP. |
|
||||
|
|
||||
The purpose of this code is to alter the runtime data so that |
|
||||
instead of the PPIDE having four drives for the primary IDE |
|
||||
device, it then has two for the primary and two for the secondary. |
|
||||
|
|
||||
The MAP command will properly display the status after this is |
|
||||
run, but you must keep in mind that having two sets of logical |
|
||||
units at the same time is twice as complicated to keep straight |
|
||||
in your mind, and you have to be more careful you know exactly |
|
||||
how the drives are mapped so you don't accidentally destroy your |
|
||||
data. |
|
||||
|
|
||||
This utility is unsupported, and not recommended for general use. |
|
||||
The reason this utility wasn't generally published is that it |
|
||||
is very difficult to give support about this remotely. |
|
||||
|
|
||||
If you are brave, and talented, and you can figure out what I did |
|
||||
with pointers in this program, then you get the prize, which is |
|
||||
to be able to copy from one CF chip to another in a dual adapter. |
|
||||
|
|
||||
It has only been tested on my PPIDE, and I don't know what will |
|
||||
happen if you try it. You could wipe out your CF chip, so make |
|
||||
sure you are backed up if you try this. |
|
||||
*/ |
|
||||
|
|
||||
|
|
||||
#include "cpmbios.h" |
|
||||
#include "bioscall.h" |
|
||||
|
|
||||
#include "cpmbdos.h" |
|
||||
#include "bdoscall.h" |
|
||||
|
|
||||
#define u8 unsigned char |
|
||||
#define u16 unsigned int |
|
||||
|
|
||||
struct DPH * pDPH_C; |
|
||||
struct DPB * pDPB_C; |
|
||||
u8 * pDU_C; |
|
||||
u16 * pCUR_C; |
|
||||
u16 * pNUM_C; |
|
||||
|
|
||||
struct DPH * pDPH_D; |
|
||||
struct DPB * pDPB_D; |
|
||||
u8 * pDU_D; |
|
||||
u16 * pCUR_D; |
|
||||
u16 * pNUM_D; |
|
||||
|
|
||||
main(argc,argv) |
|
||||
int argc; |
|
||||
char *argv[]; |
|
||||
{ |
|
||||
|
|
||||
ireghl = pSELDSK; |
|
||||
iregbc = DRIVEC; |
|
||||
iregde = 0; |
|
||||
bioscall(); |
|
||||
pDPH_C = ireghl; |
|
||||
pDPB_C = pDPH_C->dpb; |
|
||||
pDU_C = ireghl -1; |
|
||||
*pDU_C = 0X41; |
|
||||
printf("Current C: DevUnit is %02x\n",*pDU_C); |
|
||||
pCUR_C = ireghl + 18; |
|
||||
*pCUR_C = 0; |
|
||||
printf("Current C: Logical Unit is %d\n",* pCUR_C); |
|
||||
pNUM_C = ireghl + 20; |
|
||||
*pNUM_C = 64/9; |
|
||||
printf("Current C: Number of LU's is %d\n",* pNUM_C); |
|
||||
|
|
||||
ireghl = pSELDSK; |
|
||||
iregbc = DRIVED; |
|
||||
iregde = 0; |
|
||||
bioscall(); |
|
||||
|
|
||||
pDPH_D = ireghl; |
|
||||
pDPB_D = pDPH_D->dpb; |
|
||||
pDU_D = ireghl -1; |
|
||||
*pDU_D = 0x41; |
|
||||
printf("Current D: DevUnit is %02x\n",*pDU_D); |
|
||||
|
|
||||
pCUR_D = ireghl + 18; |
|
||||
*pCUR_D = 1; |
|
||||
printf("Current D: Logical Unit is %d\n",* pCUR_D); |
|
||||
|
|
||||
pNUM_D = ireghl + 20; |
|
||||
*pNUM_D = 64/9; |
|
||||
printf("Current D: Number of LU's is %d\n",* pNUM_D); |
|
||||
|
|
||||
|
|
||||
} |
|
||||
@ -1,322 +0,0 @@ |
|||||
/* map.c 6/7/2012 dwg - */ |
|
||||
|
|
||||
#include "portab.h" |
|
||||
#include "globals.h" |
|
||||
#include "stdio.h" |
|
||||
#include "stdlib.h" |
|
||||
#include "memory.h" |
|
||||
|
|
||||
#include "cpmbind.h" |
|
||||
|
|
||||
#include "infolist.h" |
|
||||
#include "dphdpb.h" |
|
||||
#include "dphmap.h" |
|
||||
#include "metadata.h" |
|
||||
#include "clogical.h" |
|
||||
#include "applvers.h" |
|
||||
|
|
||||
#define MAXDRIVE 8 |
|
||||
|
|
||||
/* Drive List Geometry */ |
|
||||
#define COL1 0 |
|
||||
#define COL2 (80/4) |
|
||||
#define COL3 (80/2) |
|
||||
#define COL4 (COL2+COL3) |
|
||||
#define LINE 3 |
|
||||
|
|
||||
/* Logical Unit List Geometry */ |
|
||||
#define LGUT 5 |
|
||||
#define COL1A 0 |
|
||||
#define COL2A (80/3) |
|
||||
#define COL3A (2*COL2A) |
|
||||
|
|
||||
/* Nomenclature Geometry */ |
|
||||
#define LINE2 8 |
|
||||
|
|
||||
/* Misc Info Geometry */ |
|
||||
#define CDLINE 6 |
|
||||
|
|
||||
/* BDOS Function number */ |
|
||||
#define RETCURR 25 |
|
||||
|
|
||||
/* function defined in bdoscall.asm */ |
|
||||
extern lurst(); |
|
||||
|
|
||||
struct BIOS * pBIOS; |
|
||||
|
|
||||
struct DPH * pDPH; |
|
||||
|
|
||||
int devunit; |
|
||||
int dev; |
|
||||
int unit; |
|
||||
int currlu; |
|
||||
int numlu; |
|
||||
int drivenum; |
|
||||
int drive; |
|
||||
int deflu; |
|
||||
|
|
||||
char szTemp[128]; |
|
||||
|
|
||||
int readsec(drive,track,sector,buffer) |
|
||||
int drive; |
|
||||
int track; |
|
||||
int sector; |
|
||||
unsigned int buffer; |
|
||||
{ |
|
||||
ireghl = pSELDSK; |
|
||||
iregbc = drive; |
|
||||
iregde = 0; |
|
||||
bioscall(); |
|
||||
|
|
||||
ireghl = pSETTRK; |
|
||||
iregbc = track; |
|
||||
bioscall(); |
|
||||
|
|
||||
ireghl = pSETSEC; |
|
||||
iregbc = sector; |
|
||||
bioscall(); |
|
||||
|
|
||||
ireghl = pSETDMA; |
|
||||
iregbc = buffer; |
|
||||
bioscall(); |
|
||||
|
|
||||
ireghl = pREAD; |
|
||||
bioscall(); |
|
||||
return irega; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
int haslu(dr) |
|
||||
int dr; |
|
||||
{ |
|
||||
if(0 < lugnum(dr)) { |
|
||||
return TRUE; |
|
||||
} else { |
|
||||
return FALSE; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
|
|
||||
|
|
||||
void dispdph(l,c,drive,ptr) |
|
||||
int l; |
|
||||
int c; |
|
||||
char drive; |
|
||||
struct DPH *ptr; |
|
||||
{ |
|
||||
|
|
||||
/*
|
|
||||
unsigned int xlt; |
|
||||
unsigned int rv1; |
|
||||
unsigned int rv2; |
|
||||
unsigned int rv3; |
|
||||
unsigned int dbf; |
|
||||
unsigned int dpb; |
|
||||
unsigned int csv; |
|
||||
unsigned int alv; |
|
||||
unsigned char sigl; |
|
||||
unsigned char sigu; |
|
||||
unsigned int current; |
|
||||
unsigned int number; |
|
||||
*/ |
|
||||
crtlc(l,c); |
|
||||
printf("%c: ",drive); |
|
||||
|
|
||||
devunit = lugdu(drive-'A'); |
|
||||
dev = devunit & 0xf0; |
|
||||
unit = devunit & 0x0f; |
|
||||
|
|
||||
currlu = lugcur(drive-'A'); |
|
||||
switch(dev) { |
|
||||
case DEV_MD: |
|
||||
if(0 == unit) printf("ROM"); |
|
||||
if(1 == unit) printf("RAM"); |
|
||||
break; |
|
||||
case DEV_FD: |
|
||||
printf("FD%d",unit); |
|
||||
break; |
|
||||
case DEV_IDE: |
|
||||
printf("IDE%d",unit); |
|
||||
break; |
|
||||
case DEV_ATAPI: |
|
||||
printf("ATAPI%d",unit); |
|
||||
break; |
|
||||
case DEV_PPIDE: |
|
||||
printf("PPIDE%d",unit); |
|
||||
break; |
|
||||
case DEV_SD: |
|
||||
printf("SD%d",unit); |
|
||||
break; |
|
||||
case DEV_PRPSD: |
|
||||
printf("PRPSD%d",unit); |
|
||||
break; |
|
||||
default: |
|
||||
printf("UNK"); |
|
||||
break; |
|
||||
}; |
|
||||
|
|
||||
if('L' == (unsigned char)ptr->sigl) { |
|
||||
if('U' == (unsigned char)ptr->sigu) { |
|
||||
/* printf("-LU%d",(int)ptr->current); */ |
|
||||
printf("-LU%d",currlu); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
/* printf("dpb=0x%04x, ",(unsigned int)ptr->dpb);
|
|
||||
printf("sigl=0x%02x, ",(unsigned char)ptr->sigl); |
|
||||
printf("sigu=0x%02x, ",(unsigned char)ptr->sigu); |
|
||||
printf("curr=0x%04x, ",(unsigned int)ptr->current); |
|
||||
printf("numb=0x%04x", (unsigned int)ptr->number); |
|
||||
*/ |
|
||||
|
|
||||
} |
|
||||
|
|
||||
int main(argc,argv) |
|
||||
int argc; |
|
||||
char *argv[]; |
|
||||
{ |
|
||||
int i; |
|
||||
int mylu; |
|
||||
int drivenum; |
|
||||
int column; |
|
||||
int line; |
|
||||
char szDrive[32]; |
|
||||
char szLuNum[32]; |
|
||||
|
|
||||
if(argc == 3) { |
|
||||
|
|
||||
strcpy(szDrive,argv[1]); |
|
||||
strcpy(szLuNum,argv[2]); |
|
||||
|
|
||||
mylu = atoi(szLuNum); |
|
||||
|
|
||||
if(strlen(szDrive) == 2) { |
|
||||
if(':' == szDrive[1]) { |
|
||||
switch(szDrive[0]) { |
|
||||
case 'a': |
|
||||
case 'A': |
|
||||
luscur(0,mylu); |
|
||||
break; |
|
||||
case 'b': |
|
||||
case 'B': |
|
||||
luscur(1,mylu); |
|
||||
break; |
|
||||
case 'c': |
|
||||
case 'C': |
|
||||
luscur(2,mylu); |
|
||||
break; |
|
||||
case 'd': |
|
||||
case 'D': |
|
||||
luscur(3,mylu); |
|
||||
break; |
|
||||
case 'e': |
|
||||
case 'E': |
|
||||
luscur(4,mylu); |
|
||||
break; |
|
||||
case 'f': |
|
||||
case 'F': |
|
||||
luscur(5,mylu); |
|
||||
break; |
|
||||
case 'g': |
|
||||
case 'G': |
|
||||
luscur(6,mylu); |
|
||||
break; |
|
||||
case 'h': |
|
||||
case 'H': |
|
||||
luscur(7,mylu); |
|
||||
break; |
|
||||
default: |
|
||||
break; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
exit(1); |
|
||||
} |
|
||||
|
|
||||
|
|
||||
pBIOS = BIOSAD; |
|
||||
|
|
||||
crtinit(); |
|
||||
crtclr(); |
|
||||
crtlc(0,0); |
|
||||
|
|
||||
printf("MAP.COM %d/%d/%d v%d.%d.%d.%d", |
|
||||
A_MONTH,A_DAY,A_YEAR,A_RMJ,A_RMN,A_RUP,A_RTP); |
|
||||
printf(" dwg - System Storage Drives and Logical Units"); |
|
||||
|
|
||||
ireghl = pGETINFO; |
|
||||
bioscall(); |
|
||||
pINFOLIST = ireghl; |
|
||||
|
|
||||
crtlc(CDLINE,COL3A+LGUT); |
|
||||
printf("infolist.version %d\n",pINFOLIST->version); |
|
||||
|
|
||||
pDPHMAP = (struct DPHMAPA *)pINFOLIST->dphmap; |
|
||||
|
|
||||
dispdph(LINE, COL1+LGUT-1,'A',(struct DPH *)pDPHMAP->drivea); |
|
||||
dispdph(LINE+1,COL1+LGUT-1,'B',(struct DPH *)pDPHMAP->driveb); |
|
||||
dispdph(LINE, COL2+LGUT-1,'C',(struct DPH *)pDPHMAP->drivec); |
|
||||
dispdph(LINE+1,COL2+LGUT-1,'D',(struct DPH *)pDPHMAP->drived); |
|
||||
dispdph(LINE, COL3+LGUT-1,'E',(struct DPH *)pDPHMAP->drivee); |
|
||||
dispdph(LINE+1,COL3+LGUT-1,'F',(struct DPH *)pDPHMAP->drivef); |
|
||||
dispdph(LINE, COL4+LGUT-1,'G',(struct DPH *)pDPHMAP->driveg); |
|
||||
dispdph(LINE+1,COL4+LGUT-1,'H',(struct DPH *)pDPHMAP->driveh); |
|
||||
|
|
||||
dregbc = RETCURR; |
|
||||
bdoscall(); |
|
||||
drive = drega; |
|
||||
|
|
||||
crtlc(CDLINE,5); |
|
||||
printf("Current drive is %c:",'A'+drive); |
|
||||
|
|
||||
devunit = lugdu(drive); |
|
||||
dev = devunit & 0xf0; |
|
||||
unit = devunit & 0x0f; |
|
||||
currlu = lugcur(drive); |
|
||||
deflu = currlu; |
|
||||
numlu = lugnum(drive); |
|
||||
|
|
||||
crtlc(CDLINE,COL2A+LGUT); |
|
||||
printf("Number of LUs is %d\n",lugnum(drive)); |
|
||||
|
|
||||
if(0<numlu) { |
|
||||
crtlc(LINE2,COL1A+LGUT); |
|
||||
printf("LU -----Label------"); |
|
||||
crtlc(LINE2,COL2A+LGUT); |
|
||||
printf("LU -----Label------"); |
|
||||
crtlc(LINE2,COL3A+LGUT); |
|
||||
printf("LU -----Label------"); |
|
||||
|
|
||||
line = LINE2+1; |
|
||||
column = 0; |
|
||||
for(i=0;i<numlu;i++) { |
|
||||
luscur(drive,i); |
|
||||
readsec(drive,0,11,&metadata); |
|
||||
metadata.term = 0; |
|
||||
switch(column++) { |
|
||||
case 0: |
|
||||
crtlc(line,COL1A+LGUT); |
|
||||
printf("%2d %s",i,metadata.label); |
|
||||
break; |
|
||||
case 1: |
|
||||
crtlc(line,COL2A+LGUT); |
|
||||
printf("%2d %s",i,metadata.label); |
|
||||
break; |
|
||||
case 2: |
|
||||
crtlc(line,COL3A+LGUT); |
|
||||
printf("%2d %s",i,metadata.label); |
|
||||
column = 0; |
|
||||
line++; |
|
||||
break; |
|
||||
} |
|
||||
} |
|
||||
luscur(drive,deflu); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
/****************/ |
|
||||
/* eof - cmap.c */ |
|
||||
/****************/ |
|
||||
@ -1,185 +0,0 @@ |
|||||
@echo off |
|
||||
|
|
||||
setlocal |
|
||||
|
|
||||
set PATH=..\..\tools\zx;%PATH% |
|
||||
set ZXBINDIR=../../tools/cpm/bin/ |
|
||||
set ZXLIBDIR=../../tools/cpm/lib/ |
|
||||
set ZXINCDIR=../../tools/cpm/include/ |
|
||||
|
|
||||
set OUTDIR=..\Output\ |
|
||||
set COREAPPS=ACCESS CPMNAME FINDFILE MAP META MULTIFMT REM SETLABEL SYSGEN TERMTYPE VIEW |
|
||||
|
|
||||
echo. |
|
||||
echo Building DWG.REL... |
|
||||
echo. |
|
||||
set TGT=dwg.rel |
|
||||
if exist %TGT% del %TGT% |
|
||||
zx rmac printers.asm -$PN |
|
||||
zx rmac memory.asm -$PN |
|
||||
zx rmac banner.asm -$PN |
|
||||
zx rmac terminal.asm -$PN |
|
||||
zx rmac identity.asm -$PN |
|
||||
zx rmac hbios.asm -$PN |
|
||||
ZX rmac labelib.asm -$PN |
|
||||
zx rmac metadata.asm -$PN |
|
||||
zx lib %TGT%=printers,memory,banner,terminal,identity,hbios,labelib,metadata |
|
||||
if not exist %TGT% echo *** Failed to build %TGT% *** && pause |
|
||||
|
|
||||
echo. |
|
||||
echo Building DWG.LIB... |
|
||||
echo. |
|
||||
set TGT=dwg.lib |
|
||||
if exist %TGT% del %TGT% |
|
||||
zx as bioscall |
|
||||
zx as bdoscall |
|
||||
zx as diagnose |
|
||||
zx cz --o cmemory.a80 --DTINY cmemory |
|
||||
zx as cmemory.a80 |
|
||||
zx cz --o cbanner.a80 --DTINY cbanner |
|
||||
zx as cbanner.a80 |
|
||||
zx cz --o ctermcap.a80 --DTINY ctermcap |
|
||||
zx as ctermcap.a80 |
|
||||
zx cz --o clogical.a80 --DTINY clogical |
|
||||
zx as clogical.a80 |
|
||||
zx as asmiface |
|
||||
zx cz --o sectorio.a80 --DTINY sectorio |
|
||||
zx as sectorio.a80 |
|
||||
zx libutil --o dwg.lib cbanner.o clogical.o ctermcap.o sectorio.o asmiface.o |
|
||||
zx libutil --o dwg.lib dwg.lib bioscall.o bdoscall.o diagnose.o cmemory.o clogical.o |
|
||||
if not exist %TGT% echo *** Failed to build %TGT% *** && pause |
|
||||
|
|
||||
echo. |
|
||||
echo Building ACCESS.COM... |
|
||||
echo. |
|
||||
set TGT=access.com |
|
||||
if exist %TGT% del %TGT% |
|
||||
zx rmac access.asm -$PN |
|
||||
zx link access,dwg |
|
||||
if not exist %TGT% echo *** Failed to build %TGT% *** && pause |
|
||||
|
|
||||
echo. |
|
||||
echo Building CPMNAME.COM... |
|
||||
echo. |
|
||||
set TGT=cpmname.com |
|
||||
if exist %TGT% del %TGT% |
|
||||
zx cz --o cpmname.a80 --DTINY cpmname |
|
||||
zx as cpmname.a80 |
|
||||
zx ln cpmname.o --ldwg --lt --lc |
|
||||
if not exist %TGT% echo *** Failed to build %TGT% *** && pause |
|
||||
|
|
||||
echo. |
|
||||
echo Building FINDFILE.COM... |
|
||||
echo. |
|
||||
set TGT=findfile.com |
|
||||
if exist %TGT% del %TGT% |
|
||||
zx rmac findfile.asm -$PN |
|
||||
zx link findfile,dwg |
|
||||
if not exist %TGT% echo *** Failed to build %TGT% *** && pause |
|
||||
|
|
||||
echo. |
|
||||
echo Building MAP.COM... |
|
||||
echo. |
|
||||
set TGT=map.com |
|
||||
if exist %TGT% del %TGT% |
|
||||
zx cz --o map.a80 --DTINY map |
|
||||
zx as map.a80 |
|
||||
zx ln map.o --ldwg --lt --lc |
|
||||
if not exist %TGT% echo *** Failed to build %TGT% *** && pause |
|
||||
|
|
||||
echo. |
|
||||
echo Building META.COM... |
|
||||
echo. |
|
||||
set TGT=meta.com |
|
||||
if exist %TGT% del %TGT% |
|
||||
zx cz --o meta.a80 --DTINY meta |
|
||||
zx as meta.a80 |
|
||||
zx ln meta.o --ldwg --lt --lc |
|
||||
if not exist %TGT% echo *** Failed to build %TGT% *** && pause |
|
||||
|
|
||||
echo. |
|
||||
echo Building MULTIFMT.COM... |
|
||||
echo. |
|
||||
set TGT=multifmt.com |
|
||||
if exist %TGT% del %TGT% |
|
||||
zx cz --o multifmt.a80 --DTINY multifmt |
|
||||
zx as multifmt.a80 |
|
||||
zx ln multifmt.o --ldwg --lt --lc |
|
||||
if not exist %TGT% echo *** Failed to build %TGT% *** && pause |
|
||||
|
|
||||
echo. |
|
||||
echo Building REM.COM... |
|
||||
echo. |
|
||||
set TGT=rem.com |
|
||||
if exist %TGT% del %TGT% |
|
||||
zx rmac rem.asm -$PN |
|
||||
zx link rem |
|
||||
if not exist %TGT% echo *** Failed to build %TGT% *** && pause |
|
||||
|
|
||||
echo. |
|
||||
echo Building SETLABEL.COM... |
|
||||
echo. |
|
||||
set TGT=setlabel.com |
|
||||
if exist %TGT% del %TGT% |
|
||||
zx rmac setlabel.asm -$PN |
|
||||
zx link setlabel,dwg |
|
||||
if not exist %TGT% echo *** Failed to build %TGT% *** && pause |
|
||||
|
|
||||
echo. |
|
||||
echo Building SYSGEN.COM... |
|
||||
echo. |
|
||||
set TGT=sysgen.com |
|
||||
if exist %TGT% del %TGT% |
|
||||
zx cz --o sysgen.a80 --DTINY sysgen |
|
||||
zx as sysgen.a80 |
|
||||
zx ln sysgen.o --ldwg --lt --lc |
|
||||
if not exist %TGT% echo *** Failed to build %TGT% *** && pause |
|
||||
|
|
||||
echo. |
|
||||
echo Building TERMTYPE.COM... |
|
||||
echo. |
|
||||
set TGT=termtype.com |
|
||||
if exist %TGT% del %TGT% |
|
||||
zx cz --o termtype.a80 --DTINY termtype |
|
||||
zx as termtype.a80 |
|
||||
zx ln termtype.o --ldwg --lt --lc |
|
||||
if not exist %TGT% echo *** Failed to build %TGT% *** && pause |
|
||||
|
|
||||
echo. |
|
||||
echo Building VIEW.COM... |
|
||||
echo. |
|
||||
set TGT=view.com |
|
||||
if exist %TGT% del %TGT% |
|
||||
zx cz --o view.a80 --DTINY view |
|
||||
zx as view.a80 |
|
||||
zx ln view.o --ldwg --lt --lc |
|
||||
if not exist %TGT% echo *** Failed to build %TGT% *** && pause |
|
||||
|
|
||||
echo. |
|
||||
echo Building N8VIDTST.COM / TMSSTAT.COM... |
|
||||
echo. |
|
||||
zx cz --o n8chars.a80 --DTINY n8chars |
|
||||
zx as n8chars.a80 |
|
||||
zx cz --o tms9918.a80 --DTINY tms9918 |
|
||||
zx as tms9918.a80 |
|
||||
|
|
||||
set TGT=n8vidtst.com |
|
||||
if exist %TGT% del %TGT% |
|
||||
zx cz --o n8vidtst.a80 --DTINY n8vidtst |
|
||||
zx as n8vidtst.a80 |
|
||||
zx ln n8vidtst.o n8chars.o tms9918.o --ldwg --lt --lc |
|
||||
if not exist %TGT% echo *** Failed to build %TGT% *** && pause |
|
||||
|
|
||||
set TGT=tmsstat.com |
|
||||
if exist %TGT% del %TGT% |
|
||||
zx cz --o tmsstat.a80 --DTINY tmsstat |
|
||||
zx as tmsstat.a80 |
|
||||
zx ln tmsstat.o n8chars.o tms9918.o --ldwg --lt --lc |
|
||||
if not exist %TGT% echo *** Failed to build %TGT% *** && pause |
|
||||
|
|
||||
echo. |
|
||||
echo Generating Output... |
|
||||
echo. |
|
||||
if exist %OUTDIR%\*.* del /f /q %OUTDIR%\*.* |
|
||||
for %%f in (%COREAPPS%) do echo %%f... && copy %%f.COM %OUTDIR% |
|
||||
echo DWG-APPS.MAN... && copy DWG-APPS.MAN %OUTDIR% |
|
||||
@ -1,10 +0,0 @@ |
|||||
@echo off |
|
||||
if exist *.bak erase *.bak |
|
||||
if exist *.prn erase *.prn |
|
||||
if exist *.o erase *.o |
|
||||
if exist *.rel erase *.rel |
|
||||
if exist *.cpm erase *.cpm |
|
||||
if exist *.sym erase *.sym |
|
||||
if exist *.com erase *.com |
|
||||
if exist *.a80 erase *.a80 |
|
||||
if exist dwg.lib erase dwg.lib |
|
||||
@ -1,106 +0,0 @@ |
|||||
; access.asm 7/19/2012 dwg - for 2.0.0.0 B22 |
|
||||
; access.com 2/17/2012 dwg - review for release 1.5.1.0 |
|
||||
; access.asm 2/11/2012 dwg - make ident compliant |
|
||||
; access.com 2/07/2012 dwg - review for release 1.5 |
|
||||
; access.com 2/05/2012 dwg - adjust for new macros |
|
||||
; access.asm 1/30/2012 dwg - use new do$start and do$end macros |
|
||||
; access.asm 1/28/2012 dwg - assure file exists from within submit file |
|
||||
|
|
||||
; Copyright (C) 2011-2012 Douglas Goodall Licensed under GPL Ver 3. |
|
||||
; |
|
||||
; This file is part of NuBiosDWG and is free software: you can |
|
||||
; redistribute it and/or modify it under the terms of the GNU |
|
||||
; General Public License as published by the Free Software Foundation, |
|
||||
; either version 3 of the License, or (at your option) any later version. |
|
||||
; This file is distributed in the hope that it will be useful, |
|
||||
; but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||
; GNU General Public License for more details. |
|
||||
; You should have received a copy of the GNU General Public License |
|
||||
; along with it. If not, see <http://www.gnu.org/licenses/>. |
|
||||
|
|
||||
;---------------------------------------------------------------------- |
|
||||
maclib portab |
|
||||
maclib globals |
|
||||
maclib cpmbdos |
|
||||
maclib printers |
|
||||
maclib banner |
|
||||
maclib applvers |
|
||||
maclib z80 |
|
||||
maclib memory |
|
||||
maclib version |
|
||||
maclib cpmappl |
|
||||
maclib banner |
|
||||
;----------------------- |
|
||||
|
|
||||
do$start |
|
||||
|
|
||||
jmp around$bandata |
|
||||
argv dw prog,dat,prod,orig,ser,myname,0 |
|
||||
prog db 'ACCESS.COM $' |
|
||||
date |
|
||||
serial |
|
||||
product |
|
||||
originator |
|
||||
oriname |
|
||||
uuid db '08D4953E-B6F4-4673-990C-7E17A0A299BD$' |
|
||||
around$bandata: |
|
||||
|
|
||||
sbanner argv |
|
||||
|
|
||||
lda 80h ; pick up the command tail length provided by CCP |
|
||||
cpi 0 ; were there any parameters given? |
|
||||
jnz no$usage ; If not, go around |
|
||||
printf 'usage - access <filename>' |
|
||||
jmp do$exit |
|
||||
no$usage: |
|
||||
|
|
||||
memcpy work$fcb,PRIFCB,32 ; Save initial default FCB from CCP |
|
||||
|
|
||||
printf 'Checking: ' |
|
||||
|
|
||||
mvi a,'$' ; place a terminating dollar sign |
|
||||
sta PRIFCB+9 ; at the end of the filname field |
|
||||
print PRIFCB+1 ; and print the filename portion |
|
||||
|
|
||||
conout '.' ; print the seperating dot |
|
||||
|
|
||||
memcpy PRIFCB,work$fcb,16 ; get a fresh copy of the initial FCB |
|
||||
mvi a,'$' ; place a terminating dollar sign |
|
||||
sta PRIFCB+12 ; at the end of the filetype field |
|
||||
print PRIFCB+9 ; and print the filetype |
|
||||
print crlf ; followed by a CR and LF |
|
||||
|
|
||||
memcpy PRIFCB,work$fcb,32 ; restore the initial FCB |
|
||||
|
|
||||
mvi c,FOPEN ; Try to open the given filename |
|
||||
lxi d,PRIFCB ; using the primary default FCB |
|
||||
call BDOS ; with a BDOS call |
|
||||
cpi 255 ; Test for Open Failure (255) |
|
||||
jnz done ; jump if file existed |
|
||||
|
|
||||
mvi c,FDELETE ; Delete the A:$$$.SUB file |
|
||||
lxi d,del$fcb ; using an alternative FCB |
|
||||
call BDOS |
|
||||
|
|
||||
printf 'Submit file terminated due to missing file$' |
|
||||
|
|
||||
jmp do$exit ; Go to the one true exit point |
|
||||
|
|
||||
done: |
|
||||
printf 'File found, Submit may proceed' |
|
||||
do$exit: |
|
||||
do$end |
|
||||
|
|
||||
newfcb del$fcb,1,'$$$ SUB' |
|
||||
|
|
||||
work$fcb ds 36 ; A place to save a copy of the default FCB on entry |
|
||||
|
|
||||
crlf db CR,LF ; a dollar sign terminated CR and LF |
|
||||
term db '$' ; a general purpose terminating character |
|
||||
|
|
||||
end start |
|
||||
|
|
||||
; eof - access.asm |
|
||||
|
|
||||
|
|
||||
Binary file not shown.
@ -1,19 +0,0 @@ |
|||||
/************************************/ |
|
||||
/* applvers.h dwg - 2.5.5.21 */ |
|
||||
/************************************/ |
|
||||
|
|
||||
#define A_RMJ 2 |
|
||||
#define A_RMN 5 |
|
||||
#define A_RUP 5 |
|
||||
#define A_RTP 21 |
|
||||
|
|
||||
#define A_MONTH 5 |
|
||||
#define A_DAY 4 |
|
||||
#define A_YEAR 2014 |
|
||||
#define A_YR 14 |
|
||||
|
|
||||
/********************/ |
|
||||
/* eof - applvers.h */ |
|
||||
/********************/ |
|
||||
|
|
||||
|
|
||||
@ -1,32 +0,0 @@ |
|||||
; applvers.lib 3/31/2012 dwg - For RomWBW 2.5.4.20 Release |
|
||||
|
|
||||
A$RMJ equ 2 |
|
||||
A$RMN equ 5 |
|
||||
A$RUP equ 5 |
|
||||
A$RTP equ 21 |
|
||||
|
|
||||
A$MONTH equ 5 |
|
||||
A$DAY equ 4 |
|
||||
A$YEAR equ 2014 |
|
||||
|
|
||||
date macro |
|
||||
dat db ' 5/4/2014$' |
|
||||
endm |
|
||||
|
|
||||
serial macro |
|
||||
ser db '654321$' |
|
||||
endm |
|
||||
|
|
||||
product macro |
|
||||
prod db 'CPM80$' |
|
||||
endm |
|
||||
|
|
||||
originator macro |
|
||||
orig db 'DWG$' |
|
||||
endm |
|
||||
|
|
||||
oriname macro |
|
||||
myname db ' Douglas W Goodall $' |
|
||||
endm |
|
||||
|
|
||||
; eof - applvers.lib |
|
||||
@ -1,13 +0,0 @@ |
|||||
/* ascii.h 11/25/2012 dwg - */ |
|
||||
|
|
||||
#define ASCII_BS 8 |
|
||||
#define ASCII_TAB 9 |
|
||||
#define ASCII_LF 10 |
|
||||
#define ASCII_VT 11 |
|
||||
#define ASCII_FF 12 |
|
||||
#define ASCII_CR 13 |
|
||||
#define ASCII_ESC 27 |
|
||||
|
|
||||
/* eof - ascii.h */ |
|
||||
|
|
||||
|
|
||||
@ -1,67 +0,0 @@ |
|||||
; asmiface.asm 6/4/2012 dwg - |
|
||||
|
|
||||
extrn .begin,.chl,.swt |
|
||||
extrn csave,cret,.move |
|
||||
|
|
||||
global xrega_,1 |
|
||||
global xregbc_,2 |
|
||||
global xregde_,2 |
|
||||
global xreghl_,2 |
|
||||
|
|
||||
PUBLIC asmif_ |
|
||||
asmif_: lxi d,.2 |
|
||||
call csave |
|
||||
|
|
||||
LXI H,8-.2 ; pick up 1st parm "function address" |
|
||||
DAD SP |
|
||||
MOV E,M |
|
||||
INX H |
|
||||
MOV D,M |
|
||||
xchg |
|
||||
shld callad+1 |
|
||||
|
|
||||
LXI H,10-.2 |
|
||||
DAD SP |
|
||||
MOV E,M |
|
||||
INX H |
|
||||
MOV D,M ; DE = parm |
|
||||
xchg |
|
||||
shld xregbc_ |
|
||||
|
|
||||
LXI H,12-.2 |
|
||||
DAD SP |
|
||||
MOV E,M |
|
||||
INX H |
|
||||
MOV D,M |
|
||||
xchg |
|
||||
shld xregde_ |
|
||||
|
|
||||
LXI H,14-.2 |
|
||||
DAD SP |
|
||||
MOV E,M |
|
||||
INX H |
|
||||
MOV D,M |
|
||||
xchg |
|
||||
shld xreghl_ |
|
||||
|
|
||||
lhld xregbc_ |
|
||||
mov b,h |
|
||||
mov c,l ; setup B&C |
|
||||
lhld xregde_ |
|
||||
xchg ; setup D&E |
|
||||
lhld xreghl_ ; setup H&L |
|
||||
|
|
||||
callad: call 0e639h ; setlu |
|
||||
|
|
||||
sta xrega_ |
|
||||
shld xreghl_ |
|
||||
xchg |
|
||||
shld xregde_ |
|
||||
mov l,c |
|
||||
mov h,b |
|
||||
shld xregbc_ |
|
||||
RET ; HL has return value |
|
||||
|
|
||||
.2 EQU 0 |
|
||||
END |
|
||||
|
|
||||
@ -1,14 +0,0 @@ |
|||||
/*****************************/ |
|
||||
/* asmiface.H 6/4/2012 dwg - */ |
|
||||
/*****************************/ |
|
||||
|
|
||||
extern char xrega; |
|
||||
extern unsigned int xregbc; |
|
||||
extern unsigned int xregde; |
|
||||
extern unsigned int xreghl; |
|
||||
extern asmif(); /* asmif(0xe60,bc,de,hl); */ |
|
||||
|
|
||||
/********************/ |
|
||||
/* eof - asmiface.h */ |
|
||||
/********************/ |
|
||||
|
|
||||
@ -1,153 +0,0 @@ |
|||||
/* banker.c 6/7/2012 dwg - */ |
|
||||
|
|
||||
#include "stdio.h" |
|
||||
#include "stdlib.h" |
|
||||
#include "memory.h" |
|
||||
|
|
||||
/* #include "cpmbind.h" */ |
|
||||
|
|
||||
#include "std.h" |
|
||||
#include "infolist.h" |
|
||||
#include "metadata.h" |
|
||||
|
|
||||
/* #include "setlunum.h" */ |
|
||||
|
|
||||
#include "applvers.h" |
|
||||
#include "bdoscall.h" |
|
||||
#include "cpmbdos.h" |
|
||||
#include "bioscall.h" |
|
||||
#include "cpmbios.h" |
|
||||
#include "diagnose.h" |
|
||||
#include "cnfgdata.h" |
|
||||
#include "syscfg.h" |
|
||||
#include "applvers.h" |
|
||||
|
|
||||
#define COL1 0 |
|
||||
#define COL2 (80/3) |
|
||||
#define COL3 (2*COL2) |
|
||||
#define LINE 2 |
|
||||
|
|
||||
#define BDOS 5 /* memory address of BDOS invocation */ |
|
||||
#define HIGHSEG 0x0C000 /* memory address of system config */ |
|
||||
|
|
||||
#define GETSYSCFG 0x0F000 /* HBIOS function for Get System Configuration */ |
|
||||
|
|
||||
struct SYSCFG * pSYSCFG; |
|
||||
struct BIOS * pCBIOS; |
|
||||
|
|
||||
int main(argc,argv) |
|
||||
int argc; |
|
||||
char *argv[] ; |
|
||||
{ |
|
||||
|
|
||||
char * varloc; |
|
||||
char * tstloc; |
|
||||
char temp[128]; |
|
||||
|
|
||||
int i; |
|
||||
int bFirst; |
|
||||
|
|
||||
bFirst = 0; |
|
||||
|
|
||||
ireghl = pGETINFO; |
|
||||
bioscall(); |
|
||||
pINFOLIST = ireghl; |
|
||||
printf("post GETINFO ireghl is 0x%04x\n",pINFOLIST); |
|
||||
|
|
||||
pCBIOS = 0x0e600; |
|
||||
|
|
||||
hregbc = GETSYSCFG; /* function = Get System Config */ |
|
||||
hregde = HIGHSEG; /* addr of dest (must be high) */ |
|
||||
diagnose(); /* invoke the NBIOS function */ |
|
||||
pSYSCFG = HIGHSEG; |
|
||||
|
|
||||
crtinit(pSYSCFG->cnfgdata.termtype); |
|
||||
crtclr(); |
|
||||
crtlc(0,0); |
|
||||
|
|
||||
printf("BANKER.COM %d/%d/%d v%d.%d.%d.%d", |
|
||||
A_MONTH,A_DAY,A_YEAR,A_RMJ,A_RMN,A_RUP,A_RTP); |
|
||||
printf(" dwg - Display Memory Bank Characteristics"); |
|
||||
|
|
||||
hregbc = 0x0f000; |
|
||||
hregde = 0x0c000; |
|
||||
diagnose(); |
|
||||
pSYSCFG = 0x0C000; |
|
||||
|
|
||||
crtlc(LINE+0,COL1); |
|
||||
crtlc(LINE+1,COL1); |
|
||||
printf("ROM Bank1"); |
|
||||
crtlc(LINE+2,COL1); |
|
||||
printf("RMJ = %d",pSYSCFG->cnfgdata.rmj); |
|
||||
crtlc(LINE+3,COL1); |
|
||||
printf("RMN = %d",pSYSCFG->cnfgdata.rmn); |
|
||||
crtlc(LINE+4,COL1); |
|
||||
printf("RUP = %d",pSYSCFG->cnfgdata.rup); |
|
||||
crtlc(LINE+5,COL1); |
|
||||
printf("RTP = %d",pSYSCFG->cnfgdata.rtp); |
|
||||
crtlc(LINE+7,COL1); |
|
||||
varloc = pSYSCFG->varloc; |
|
||||
/* dregde = (unsigned int)varloc-0x200+0x0c000; */ |
|
||||
dregde = (unsigned int)varloc+0x0c000; |
|
||||
|
|
||||
dregbc = 9; |
|
||||
bdoscall(); |
|
||||
crtlc(LINE+8,COL1); |
|
||||
/* tstloc = 0x0c000-0x0200+(unsigned int)pSYSCFG->tstloc; */ |
|
||||
tstloc = 0x0c000+(unsigned int)pSYSCFG->tstloc; |
|
||||
memset(temp,0,sizeof(temp)); |
|
||||
memcpy(temp,tstloc,11); |
|
||||
printf("%s",temp); |
|
||||
|
|
||||
crtlc(LINE+1,COL2); |
|
||||
printf("CBIOS HDR"); |
|
||||
crtlc(LINE+2,COL2); |
|
||||
printf("RMJ = %d",pCBIOS->rmj); |
|
||||
crtlc(LINE+3,COL2); |
|
||||
printf("RMN = %d",pCBIOS->rmn); |
|
||||
crtlc(LINE+4,COL2); |
|
||||
printf("RUP = %d",pCBIOS->rup); |
|
||||
crtlc(LINE+5,COL2); |
|
||||
printf("RTP = %d",pCBIOS->rtp); |
|
||||
/* */ |
|
||||
crtlc(LINE+7,COL2); |
|
||||
varloc = pINFOLIST->varloc; |
|
||||
memset(temp,0,sizeof(temp)); |
|
||||
memcpy(temp,varloc,sizeof(temp)-1); |
|
||||
for(i=0;i<sizeof(temp);i++) { |
|
||||
if('-' == temp[i]) { |
|
||||
if(0 != bFirst) { |
|
||||
temp[i] = 0; |
|
||||
} else { |
|
||||
bFirst = 1; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
printf("%s",temp); |
|
||||
|
|
||||
crtlc(LINE+8,COL2); |
|
||||
tstloc = pINFOLIST->tstloc; |
|
||||
memset(temp,0,sizeof(temp)); |
|
||||
memcpy(temp,tstloc,11); |
|
||||
printf("%s",temp); |
|
||||
|
|
||||
crtlc(LINE+1,COL3); |
|
||||
printf("BANKER.COM"); |
|
||||
crtlc(LINE+2,COL3); |
|
||||
printf("RMJ = %d",A_RMJ); |
|
||||
crtlc(LINE+3,COL3); |
|
||||
printf("RMN = %d",A_RMN); |
|
||||
crtlc(LINE+4,COL3); |
|
||||
printf("RUP = %d",A_RUP); |
|
||||
crtlc(LINE+5,COL3); |
|
||||
printf("RTP = %d",A_RTP); |
|
||||
|
|
||||
crtlc(LINE+8,COL3); |
|
||||
printf("%02d%02d%02d",A_YR,A_MONTH,A_DAY); |
|
||||
crtlc(23,0); |
|
||||
} |
|
||||
|
|
||||
/*****************/ |
|
||||
/* eof - cview.c */ |
|
||||
/*****************/ |
|
||||
|
|
||||
@ -1,156 +0,0 @@ |
|||||
; banner.asm 9/5/2012 dwg - new version semantics - #.#.# (#) |
|
||||
|
|
||||
maclib portab |
|
||||
maclib globals |
|
||||
maclib cpmbios |
|
||||
maclib cpmbdos |
|
||||
maclib bioshdr |
|
||||
maclib printers |
|
||||
maclib cpmappl |
|
||||
maclib applvers |
|
||||
|
|
||||
cseg |
|
||||
|
|
||||
|
|
||||
; entered with argv in hl |
|
||||
public x$banner |
|
||||
x$banner: |
|
||||
shld argv |
|
||||
mov e,m ! inx h ! mov d,m ! inx h ! xchg ! shld xprog ! xchg |
|
||||
mov e,m ! inx h ! mov d,m ! inx h ! xchg ! shld xvers ! xchg |
|
||||
mov e,m ! inx h ! mov d,m ! inx h ! xchg ! shld xprod ! xchg |
|
||||
mov e,m ! inx h ! mov d,m ! inx h ! xchg ! shld xorig ! xchg |
|
||||
mov e,m ! inx h ! mov d,m ! inx h ! xchg ! shld xser ! xchg |
|
||||
mov e,m ! inx h ! mov d,m ! inx h ! xchg ! shld xnam ! xchg |
|
||||
|
|
||||
|
|
||||
printf '----------------------------------------' |
|
||||
print crlf |
|
||||
lhld xprog ! xchg ! mvi c,9 ! call BDOS |
|
||||
printf ' ' |
|
||||
IF A$MONTH LT 10 |
|
||||
conout ' ' |
|
||||
ENDIF |
|
||||
IF A$DAY LT 10 |
|
||||
conout ' ' |
|
||||
ENDIF |
|
||||
lxi h,A$MONTH |
|
||||
call pr$d$word |
|
||||
conout '/' |
|
||||
lxi h,A$DAY |
|
||||
call pr$d$word |
|
||||
conout '/' |
|
||||
lxi h,A$YEAR |
|
||||
call pr$d$word |
|
||||
printf ' ' |
|
||||
printf 'Version ' |
|
||||
lxi h,A$RMJ |
|
||||
call pr$d$word |
|
||||
conout '.' |
|
||||
lxi h,A$RMN |
|
||||
call pr$d$word |
|
||||
conout '.' |
|
||||
lxi h,A$RUP |
|
||||
call pr$d$word |
|
||||
printf ' (' |
|
||||
lxi h,A$RTP |
|
||||
call pr$d$word |
|
||||
conout ')' |
|
||||
print crlf |
|
||||
printf 'S/N ' |
|
||||
|
|
||||
lhld xprod ! xchg ! mvi c,9 ! call BDOS |
|
||||
|
|
||||
conout '-' |
|
||||
|
|
||||
lhld xorig ! xchg ! mvi c,9 ! call BDOS |
|
||||
|
|
||||
conout '-' |
|
||||
|
|
||||
; print xser |
|
||||
lhld xser ! xchg ! mvi c,9 ! call BDOS |
|
||||
|
|
||||
printf ' ' |
|
||||
; printf 'All Rights Reserved' |
|
||||
printf 'Licensed under GPL3' |
|
||||
print crlf |
|
||||
printf 'Copyright (C) 2011-12' |
|
||||
|
|
||||
lhld xnam ! xchg ! mvi c,9 ! call BDOS |
|
||||
|
|
||||
print crlf |
|
||||
printf '----------------------------------------' |
|
||||
print crlf |
|
||||
|
|
||||
ret |
|
||||
|
|
||||
|
|
||||
; entered with argv in hl |
|
||||
public x$sbanner |
|
||||
x$sbanner: |
|
||||
shld argv |
|
||||
mov e,m ! inx h ! mov d,m ! inx h ! xchg ! shld xprog ! xchg |
|
||||
mov e,m ! inx h ! mov d,m ! inx h ! xchg ! shld xvers ! xchg |
|
||||
mov e,m ! inx h ! mov d,m ! inx h ! xchg ! shld xprod ! xchg |
|
||||
mov e,m ! inx h ! mov d,m ! inx h ! xchg ! shld xorig ! xchg |
|
||||
mov e,m ! inx h ! mov d,m ! inx h ! xchg ! shld xser ! xchg |
|
||||
mov e,m ! inx h ! mov d,m ! inx h ! xchg ! shld xnam ! xchg |
|
||||
|
|
||||
|
|
||||
; printf '----------------------------------------' |
|
||||
; print crlf |
|
||||
lhld xprog ! xchg ! mvi c,9 ! call BDOS |
|
||||
printf ' ' |
|
||||
IF A$MONTH LT 10 |
|
||||
conout ' ' |
|
||||
ENDIF |
|
||||
IF A$DAY LT 10 |
|
||||
conout ' ' |
|
||||
ENDIF |
|
||||
lxi h,A$MONTH |
|
||||
call pr$d$word |
|
||||
conout '/' |
|
||||
lxi h,A$DAY |
|
||||
call pr$d$word |
|
||||
conout '/' |
|
||||
lxi h,A$YEAR |
|
||||
call pr$d$word |
|
||||
printf ' ' |
|
||||
printf 'Vers. ' |
|
||||
lxi h,A$RMJ |
|
||||
call pr$d$word |
|
||||
conout '.' |
|
||||
lxi h,A$RMN |
|
||||
call pr$d$word |
|
||||
conout '.' |
|
||||
lxi h,A$RUP |
|
||||
call pr$d$word |
|
||||
printf ' ( ' |
|
||||
lxi h,A$RTP |
|
||||
call pr$d$word |
|
||||
printf ') ' |
|
||||
printf 'COPR Douglas Goodall Licensed w/GPLv3' |
|
||||
|
|
||||
|
|
||||
print crlf |
|
||||
|
|
||||
ret |
|
||||
|
|
||||
|
|
||||
;---------------------------------------------------------------- |
|
||||
|
|
||||
argv ds 2 |
|
||||
;---------------- |
|
||||
xprog ds 2 |
|
||||
xvers ds 2 |
|
||||
xprod ds 2 |
|
||||
xorig ds 2 |
|
||||
xser ds 2 |
|
||||
xnam ds 2 |
|
||||
|
|
||||
crlf db CR,LF,'$' |
|
||||
|
|
||||
end |
|
||||
|
|
||||
; eof - banner.asm |
|
||||
|
|
||||
@ -1,18 +0,0 @@ |
|||||
; banner.lib 7/19/2012 dwg - for 2.0.0.0 B22 |
|
||||
; banner.lib 2/17/2012 dwg - review for release 1.5.1.0 |
|
||||
; banner.lib 2/11/2012 dwg - banner library declarations |
|
||||
|
|
||||
extrn x$banner |
|
||||
banner macro argv |
|
||||
lxi h,argv |
|
||||
call x$banner |
|
||||
endm |
|
||||
|
|
||||
extrn x$sbanner |
|
||||
sbanner macro argv |
|
||||
lxi h,argv |
|
||||
call x$sbanner |
|
||||
endm |
|
||||
|
|
||||
; eof - banner.lib |
|
||||
|
|
||||
@ -1,71 +0,0 @@ |
|||||
; bdoscall.asm 3/10/2012 dwg - bdos binding for Aztec C |
|
||||
|
|
||||
global drega_,1 |
|
||||
global dregbc_,2 |
|
||||
global dregde_,2 |
|
||||
global dreghl_,2 |
|
||||
|
|
||||
PUBLIC lurst_ |
|
||||
lurst_: |
|
||||
|
|
||||
push b |
|
||||
push d |
|
||||
push h |
|
||||
push psw |
|
||||
|
|
||||
mvi c,37 |
|
||||
lxi d,127 |
|
||||
lxi b,127 |
|
||||
call 5 |
|
||||
|
|
||||
pop psw |
|
||||
pop h |
|
||||
pop d |
|
||||
pop b |
|
||||
|
|
||||
RET |
|
||||
|
|
||||
|
|
||||
PUBLIC bdoscall_ |
|
||||
bdoscall_: |
|
||||
|
|
||||
push b |
|
||||
push d |
|
||||
push h |
|
||||
push psw |
|
||||
|
|
||||
lhld dregbc_ |
|
||||
mov b,h |
|
||||
mov c,l |
|
||||
|
|
||||
lhld dregde_ |
|
||||
mov d,h |
|
||||
mov e,l |
|
||||
|
|
||||
lhld dreghl_ |
|
||||
|
|
||||
lda drega_ |
|
||||
|
|
||||
call 5 |
|
||||
|
|
||||
sta drega_ |
|
||||
|
|
||||
shld dreghl_ |
|
||||
|
|
||||
mov l,e |
|
||||
mov h,d |
|
||||
shld dregde_ |
|
||||
|
|
||||
mov l,c |
|
||||
mov h,b |
|
||||
shld dregbc_ |
|
||||
|
|
||||
pop psw |
|
||||
pop h |
|
||||
pop d |
|
||||
pop b |
|
||||
|
|
||||
RET |
|
||||
|
|
||||
END |
|
||||
|
|
||||
@ -1,8 +0,0 @@ |
|||||
/* bdoscall.h 3/10/2012 dwg - header file for bdoscall */ |
|
||||
|
|
||||
extern char drega; |
|
||||
extern unsigned int dregbc; |
|
||||
extern unsigned int dregde; |
|
||||
extern unsigned int dreghl; |
|
||||
extern bdoscall(); |
|
||||
|
|
||||
@ -1,80 +0,0 @@ |
|||||
; bioscall.asm 3/10/2012 dwg - bios binding for Aztec C |
|
||||
|
|
||||
global irega_,1 |
|
||||
global iregbc_,2 |
|
||||
global iregde_,2 |
|
||||
global ireghl_,2 |
|
||||
|
|
||||
|
|
||||
public getmeta_ |
|
||||
getmeta_: |
|
||||
push psw |
|
||||
push b |
|
||||
push d |
|
||||
push h |
|
||||
|
|
||||
lxi b,4 |
|
||||
lxi d,0 |
|
||||
call 0e61bh |
|
||||
|
|
||||
lxi d,0 |
|
||||
call 0e61eh |
|
||||
|
|
||||
lxi d,11 |
|
||||
call 0e621h |
|
||||
|
|
||||
lxi d,80h |
|
||||
call 0e624h |
|
||||
|
|
||||
call 0e627h |
|
||||
|
|
||||
pop h |
|
||||
pop d |
|
||||
pop b |
|
||||
pop psw |
|
||||
ret |
|
||||
|
|
||||
PUBLIC bioscall_ |
|
||||
bioscall_: |
|
||||
|
|
||||
push b |
|
||||
push d |
|
||||
push h |
|
||||
push psw |
|
||||
|
|
||||
lhld iregbc_ |
|
||||
mov b,h |
|
||||
mov c,l |
|
||||
|
|
||||
lhld iregde_ |
|
||||
mov d,h |
|
||||
mov e,l |
|
||||
|
|
||||
lhld ireghl_ |
|
||||
shld mycall+1 |
|
||||
|
|
||||
lda irega_ |
|
||||
|
|
||||
mycall: call 5 |
|
||||
|
|
||||
sta irega_ |
|
||||
|
|
||||
shld ireghl_ |
|
||||
|
|
||||
mov l,e |
|
||||
mov h,d |
|
||||
shld iregde_ |
|
||||
|
|
||||
mov l,c |
|
||||
mov h,b |
|
||||
shld iregbc_ |
|
||||
|
|
||||
pop psw |
|
||||
pop h |
|
||||
pop d |
|
||||
pop b |
|
||||
|
|
||||
RET |
|
||||
|
|
||||
END |
|
||||
|
|
||||
@ -1,8 +0,0 @@ |
|||||
/* bioscall.h 3/10/2012 dwg - header file for bdoscall */ |
|
||||
|
|
||||
extern char irega; |
|
||||
extern unsigned int iregbc; |
|
||||
extern unsigned int iregde; |
|
||||
extern unsigned int ireghl; |
|
||||
extern bioscall(); |
|
||||
|
|
||||
@ -1,385 +0,0 @@ |
|||||
; biohdr.lib 2/19/2012 dwg - BIOS header display macros |
|
||||
; copyright (C) 2011 Douglas Goodall. All Rights Reserved. |
|
||||
; Licensed to N8VEM Community for non-commercial use only. |
|
||||
|
|
||||
; 2/19/2012 dwg - review for release 1.5.1.0 |
|
||||
; 2/05/2012 dwg - added DSKM (DM_ROM...) better late than never |
|
||||
; 2/05/2012 dwg - added prpsdenable,prpsdtrace, and prpsdcapacity |
|
||||
; 1/16/2012 dwg - extend LU numbers to 0x1C entries (256MB) |
|
||||
; 1/11/2012 dwg - added new setlu for 1.4 slice technique |
|
||||
; 12/18/2011 dwg - added REVISION (from svn) |
|
||||
; 12/07/2011 dwg - BIOS header enhancement for version 1.3 |
|
||||
|
|
||||
; Common Configuration items, |
|
||||
; Valid in all configurations |
|
||||
RMJ equ 0E64Bh |
|
||||
RMN equ RMJ+1 |
|
||||
RUP equ RMN+1 |
|
||||
RTP equ RUP+1 |
|
||||
|
|
||||
if 0 |
|
||||
BANPTR equ RTP+1 |
|
||||
DKMP equ BANPTR+2 |
|
||||
DBBOOL equ DKMP+2 ; Disk Boot Boolean |
|
||||
DBDRV equ DBBOOL+1 ; Disk Boot Drive Code |
|
||||
FREQ equ DBDRV+1 |
|
||||
PLAT equ FREQ+1 ; Hardware Platform |
|
||||
DIOPLT equ PLAT+1 |
|
||||
VDUPLT equ DIOPLT+1 |
|
||||
ROMSIZ equ VDUPLT+1 |
|
||||
RAMSIZ equ ROMSIZ+2 |
|
||||
CRAM equ RAMSIZ+2 |
|
||||
DSKY equ CRAM+1 ; Is Display/Keyboard Attached? |
|
||||
UART equ DSKY+1 ; Is UART Enabled? |
|
||||
VDUEN equ UART+1 |
|
||||
FDEN equ VDUEN+1 ; Is Floppy Disk Support Enabled |
|
||||
FDTR equ FDEN+1 ; Is Floppy Disk Error Tracing Enabled? |
|
||||
FMED equ FDTR+1 ; Floppy Disk Media Type |
|
||||
FALT equ FMED+1 ; Alternative Floppy Disk Media Type |
|
||||
FAUT equ FALT+1 ; Is Floppy Disk Automatic Sensing Enabled? |
|
||||
IDEN equ FAUT+1 ; Is On-Board IDE Support Enabled |
|
||||
IDTR equ IDEN+1 |
|
||||
IDE8 equ IDTR+1 |
|
||||
IDCP equ IDE8+1 ; 1/13/2012 IDE Capacity |
|
||||
PPEN equ IDCP+2 ; Is PPIDE Support Enablned? |
|
||||
PPTR equ PPEN+1 ; Is PPIDE Tracing Enabled? |
|
||||
PP8B equ PPTR+1 |
|
||||
PPCP equ PP8B+1 ; 1/13/2012 PPIDE Capacity |
|
||||
PSLW equ PPCP+2 ; Use NOPs for recovery-time compensation |
|
||||
BTYP equ PSLW+1 |
|
||||
BTTO equ BTYP+1 |
|
||||
BTDF equ BTTO+1 |
|
||||
BAUD equ BTDF+1 ; What is the Console Baud Rate |
|
||||
|
|
||||
; Only Valid if PLATFORM == PLT_N8 |
|
||||
CLKDIV equ BAUD+2 ; Z180_CLKDIV |
|
||||
MEMWAIT equ CLKDIV+1 ; Z180_MEMWAIT |
|
||||
IOWAIT equ MEMWAIT+1 ; Z180_IOWAIT |
|
||||
CNTLB0 equ IOWAIT+1 ; Z180_CNTLB0 |
|
||||
CNTLB1 equ CNTLB0+1 ; Z180_CNTLB1 |
|
||||
SDENABLE equ CNTLB1+1 |
|
||||
SDTRACE equ SDENABLE+1 |
|
||||
SDCP equ SDTRACE+1 ; 1/13/2012 SD Capacity |
|
||||
VDPTR equ SDCP+2 ; pointer to VDU Data |
|
||||
FDPTR equ VDPTR+2 ; pointer to FD Data |
|
||||
IDEPTR equ FDPTR+2 ; pointer to IDE Data |
|
||||
PPIPTR equ IDEPTR+2 ; pointer to PPIDE_DATA Data |
|
||||
PPIPTR2 equ PPIPTR+2 ; pointer to PPIDE.ASM DATA |
|
||||
|
|
||||
DEFIO equ PPIPTR2+2 ; pointer to DEFIOBYTE |
|
||||
LDRC equ DEFIO+1 ; pointer to LDRCON |
|
||||
DBGC equ LDRC+1 ; pointer to DBGCON |
|
||||
TTYP equ DBGC+1 ; pointer to TERMTYPE |
|
||||
REV equ TTYP+1 ; subversion revision |
|
||||
|
|
||||
TMDT equ REV+2 ; startup date and time |
|
||||
|
|
||||
PSDE equ TMDT+6 ; prpsdenable |
|
||||
PSDT equ PSDE+1 ; prpsdtrace |
|
||||
PSDC equ PSDT+1 ; prpsdcapacity |
|
||||
PRCE equ PSDC+2 |
|
||||
|
|
||||
DSKM equ PRCE+1 ; DM_ROM... |
|
||||
|
|
||||
DTSZ equ DSKM+1 ; DATASIZE |
|
||||
|
|
||||
; LU0 LU1 LU2 LU3 LU4 LU5 LU6 LU7 LU8 LU9 |
|
||||
; 41 82 c3 104 145 186 1c7 208 249 286 |
|
||||
; |
|
||||
; LU10 LU11 LU12 LU13 LU14 LU15 LU16 |
|
||||
; 2c7 308 349 38a 3cb 40c 44d |
|
||||
|
|
||||
LU0 equ 0 ; 041h ; PPIDE1 offset for first slice (default) |
|
||||
LU1 equ 1 ; 082h ; PPIDE1 offset for second slice |
|
||||
LU2 equ 2 ; 0C3h ; PPIDE1 offset for third slice |
|
||||
LU3 equ 3 ; 104h ; PPIDE1 offset for fourth slice |
|
||||
LU4 equ 4 ; 145h ; PPIDE1 offset for fifth slice |
|
||||
LU5 equ 5 ; 186h ; PPIDE1 offset for sixth slice |
|
||||
LU6 equ 6 ; 1c7h ; PPIDE1 offset for seventh slice |
|
||||
LU7 equ 7 ; 208h ; PPIDE1 offset for eighth slice |
|
||||
LU8 equ 8 ; 249h ; PPIDE1 offset for ninth slice |
|
||||
LU9 equ 9 ; 286h ; PPIDE1 offset for tenth slice |
|
||||
LU10 equ 10 |
|
||||
LU11 equ 11 |
|
||||
LU12 equ 12 |
|
||||
LU13 equ 13 |
|
||||
LU14 equ 14 |
|
||||
LU15 equ 15 |
|
||||
LU16 equ 16 |
|
||||
LU17 equ 17 |
|
||||
LU18 equ 18 |
|
||||
LU19 equ 19 |
|
||||
LU20 equ 20 |
|
||||
LU21 equ 21 |
|
||||
LU22 equ 22 |
|
||||
LU23 equ 23 |
|
||||
LU24 equ 24 |
|
||||
LU25 equ 25 |
|
||||
LU26 equ 26 ; 0x1a |
|
||||
LU27 equ 27 ; 0x1b (1Cth entry) |
|
||||
|
|
||||
endif |
|
||||
|
|
||||
DRIVEB equ 1 ; 0=A, 1=B... |
|
||||
|
|
||||
|
|
||||
setlu13 macro offset |
|
||||
lxi h,PPIPTR2 ; set pointer to ppide.asm data |
|
||||
mov e,m ; dereference pointer |
|
||||
inx h |
|
||||
mov d,m ; de -> ppide.asm data |
|
||||
xchg ; hl -> ppide.asm data |
|
||||
lxi d,6 ; offset to offset |
|
||||
dad d ; hl -> offset in ppide.asm data |
|
||||
lxi d,offset ; load caller's parameter in de |
|
||||
mov m,e ; stuff LO offset byte into offset |
|
||||
inx h ; bump ptr |
|
||||
mov m,d ; stuff HO offset byte into offset |
|
||||
mvi c,13 ; BDOS DSKRESET |
|
||||
call 5 ; call BDOS |
|
||||
endm |
|
||||
|
|
||||
getlu13 macro |
|
||||
lxi h,PPIPTR2 ; set pointer to ppide.asm data |
|
||||
mov e,m ; dereference pointer |
|
||||
inx h |
|
||||
mov d,m ; de -> ppide.asm data |
|
||||
xchg ; hl -> ppide.asm data |
|
||||
lxi d,6 ; offset to offset |
|
||||
dad d ; hl -> offset in ppide.asm data |
|
||||
mov e,m ; pick up LO byte of offset |
|
||||
inx h ; bump ptr |
|
||||
mov d,m ; pick up HO byte of offset |
|
||||
xchg ; hl = offset |
|
||||
endm |
|
||||
|
|
||||
setlu14 macro offset |
|
||||
lxi h,PPIPTR2 ; set pointer to ppide.asm data |
|
||||
mov e,m ; dereference pointer |
|
||||
inx h |
|
||||
mov d,m ; de -> ppide.asm data |
|
||||
xchg ; hl -> ppide.asm data |
|
||||
lxi d,6 ; offset to offset |
|
||||
dad d ; hl -> offset in ppide.asm data |
|
||||
lxi d,offset ; load caller's parameter in de |
|
||||
mov m,e ; stuff LO offset byte into offset |
|
||||
inx h ; bump ptr |
|
||||
mov m,d ; stuff HO offset byte into offset |
|
||||
mvi c,13 ; BDOS DSKRESET |
|
||||
call 5 ; call BDOS |
|
||||
endm |
|
||||
|
|
||||
getlu14 macro |
|
||||
lxi h,PPIPTR2 ; set pointer to ppide.asm data |
|
||||
mov e,m ; dereference pointer |
|
||||
inx h |
|
||||
mov d,m ; de -> ppide.asm data |
|
||||
xchg ; hl -> ppide.asm data |
|
||||
lxi d,6 ; offset to offset |
|
||||
dad d ; hl -> offset in ppide.asm data |
|
||||
mov e,m ; pick up LO byte of offset |
|
||||
inx h ; bump ptr |
|
||||
mov d,m ; pick up HO byte of offset |
|
||||
xchg ; hl = offset |
|
||||
endm |
|
||||
|
|
||||
setlu macro drive,slice |
|
||||
local dontboth,msg,msg2 |
|
||||
mvi c,drive |
|
||||
call BISELDSK |
|
||||
lxi d,16 |
|
||||
dad d |
|
||||
mov a,m |
|
||||
cpi 'L' |
|
||||
jnz dontboth |
|
||||
inx h |
|
||||
mov a,m |
|
||||
cpi 'U' |
|
||||
jnz dontboth |
|
||||
inx h |
|
||||
mvi a,slice |
|
||||
mov m,a |
|
||||
print msg |
|
||||
mvi a,drive |
|
||||
adi 'A' |
|
||||
mov e,a |
|
||||
mvi c,2 |
|
||||
call BDOS |
|
||||
print msg2 |
|
||||
lxi h,slice |
|
||||
call pr$d$word |
|
||||
jmp dontboth |
|
||||
msg db CR,LF,'Drive $' |
|
||||
msg2 db ': set to Logical Unit (slice) $' |
|
||||
dontboth: |
|
||||
endm |
|
||||
|
|
||||
|
|
||||
xluset macro |
|
||||
local ldrive,lslice,dontboth,msg,msg2 |
|
||||
; C = DRIVE |
|
||||
; A = SLICE |
|
||||
sta lslice |
|
||||
mov a,c |
|
||||
sta ldrive |
|
||||
|
|
||||
call BISELDSK ; uses c parameter (drive) |
|
||||
lxi d,16 |
|
||||
dad d |
|
||||
mov a,m |
|
||||
cpi 'L' |
|
||||
jnz dontboth |
|
||||
inx h |
|
||||
mov a,m |
|
||||
cpi 'U' |
|
||||
jnz dontboth |
|
||||
inx h |
|
||||
lda lslice |
|
||||
mov m,a ; put slice into CURRENT |
|
||||
|
|
||||
; print msg |
|
||||
; lda ldrive |
|
||||
; adi 'A' |
|
||||
; mov e,a |
|
||||
; mvi c,2 |
|
||||
; call BDOS |
|
||||
; print msg2 |
|
||||
; lda lslice |
|
||||
; mov l,a |
|
||||
; mvi h,0 |
|
||||
; call pr$d$word |
|
||||
|
|
||||
jmp dontboth |
|
||||
msg db CR,LF,'Drive $' |
|
||||
msg2 db ': set to Logical Unit (slice) $' |
|
||||
ldrive db 0 |
|
||||
lslice db 0 |
|
||||
dontboth: |
|
||||
endm |
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
hdrlit macro ptr,val,msg |
|
||||
local notval |
|
||||
lxi h,ptr |
|
||||
mvi a,val |
|
||||
cmp m |
|
||||
jnz notval |
|
||||
print msg |
|
||||
notval: |
|
||||
endm |
|
||||
|
|
||||
|
|
||||
hdrbool macro ptr,tmsg,fmsg |
|
||||
local itstrue,itsfalse,imdone |
|
||||
enter |
|
||||
lxi h,ptr |
|
||||
mov a,m |
|
||||
cpi TRUE |
|
||||
jnz itsfalse |
|
||||
lxi d,tmsg |
|
||||
jmp imdone |
|
||||
itsfalse: lxi d,fmsg |
|
||||
imdone: mvi c,PRINTSTR |
|
||||
call BDOS |
|
||||
leave |
|
||||
endm |
|
||||
|
|
||||
hdrbyte macro ptr,msg |
|
||||
enter |
|
||||
mvi c,PRINTSTR |
|
||||
lxi d,msg |
|
||||
call BDOS |
|
||||
lxi h,ptr |
|
||||
mov a,m |
|
||||
call pr$h$byte |
|
||||
|
|
||||
conout '(' |
|
||||
mov e,m |
|
||||
mov d,0 |
|
||||
xchg |
|
||||
call pr$d$word |
|
||||
conout ')' |
|
||||
|
|
||||
leave |
|
||||
endm |
|
||||
|
|
||||
hdrpbyte macro ptr,msg |
|
||||
enter |
|
||||
mvi c,PRINTSTR |
|
||||
lxi d,msg |
|
||||
call BDOS |
|
||||
lxi h,PTR |
|
||||
mov e,m |
|
||||
inx h |
|
||||
mov d,m |
|
||||
xchg |
|
||||
mov a,m |
|
||||
call pr$h$byte |
|
||||
|
|
||||
; conout ' ' |
|
||||
conout '(' |
|
||||
mov e,m |
|
||||
mov d,0 |
|
||||
xchg |
|
||||
call pr$d$word |
|
||||
conout ')' |
|
||||
leave |
|
||||
endm |
|
||||
|
|
||||
hdrword macro ptr,msg |
|
||||
enter |
|
||||
|
|
||||
mvi c,PRINTSTR |
|
||||
lxi d,msg |
|
||||
call BDOS |
|
||||
|
|
||||
lxi h,ptr |
|
||||
inx h |
|
||||
mov a,m |
|
||||
call pr$h$byte |
|
||||
|
|
||||
lxi h,ptr |
|
||||
mov a,m |
|
||||
call pr$h$byte |
|
||||
|
|
||||
conout '(' |
|
||||
lxi h,ptr |
|
||||
mov e,m |
|
||||
inx h |
|
||||
mov d,m |
|
||||
xchg |
|
||||
call pr$d$word |
|
||||
conout ')' |
|
||||
leave |
|
||||
endm |
|
||||
|
|
||||
syncerr macro |
|
||||
print syncmsg |
|
||||
exit |
|
||||
endm |
|
||||
|
|
||||
hdrvalid macro |
|
||||
local byte1ok,byte2ok |
|
||||
enter |
|
||||
lxi h,CFDA |
|
||||
mov a,m |
|
||||
cpi 0DAh |
|
||||
jz byte1ok |
|
||||
syncerr |
|
||||
byte1ok: |
|
||||
inx h |
|
||||
mov al,m |
|
||||
cpi 0CFh |
|
||||
jz byte2ok |
|
||||
syncerr |
|
||||
byte2ok: |
|
||||
leave |
|
||||
endm |
|
||||
|
|
||||
; eof - bioshdr.lib |
|
||||
|
|
||||
@ -1,39 +0,0 @@ |
|||||
/* cbanner.c 3/12/2012 dwg - */ |
|
||||
|
|
||||
#include "portab.h" |
|
||||
#include "globals.h" |
|
||||
#include "applvers.h" |
|
||||
|
|
||||
char * lines = "----------------------------------------"; |
|
||||
char * line1 = "12345678.123 mm/dd/yyyy Version x.x.x.x"; |
|
||||
char * line2 = "S/N CPM80-DWG-654321 Licensed under GPL3"; |
|
||||
char * line3 = "Copyright (C) 2011-12 Douglas W. Goodall"; |
|
||||
|
|
||||
sbanner(program) |
|
||||
char *program; |
|
||||
{ |
|
||||
char szTemp[128]; |
|
||||
|
|
||||
printf("%s ",program); |
|
||||
printf("%d/%d/%d ",A_MONTH,A_DAY,A_YEAR); |
|
||||
printf("Version %d.%d.%d.%d ",A_RMJ,A_RMN,A_RUP,A_RTP); |
|
||||
printf("COPR Douglas Goodall Licensed w/GPLv3\n"); |
|
||||
} |
|
||||
|
|
||||
banner(program) |
|
||||
char *program; |
|
||||
{ |
|
||||
char szTemp[128]; |
|
||||
|
|
||||
printf("%s\n",lines); |
|
||||
strcpy(szTemp,program); |
|
||||
while(12 > strlen(szTemp)) { |
|
||||
strcat(szTemp," "); |
|
||||
} |
|
||||
printf("%s ",szTemp); |
|
||||
printf("%d/%d/%d ",A_MONTH,A_DAY,A_YEAR); |
|
||||
printf("Version %d.%d.%d.%d\n",A_RMJ,A_RMN,A_RUP,A_RTP); |
|
||||
printf("%s\n",line2); |
|
||||
printf("%s\n",line3); |
|
||||
printf("%s\n",lines); |
|
||||
} |
|
||||
@ -1 +0,0 @@ |
|||||
裹裹裹裹裹裹裹裹裹裹裹裹裹裹裹裹裹裹裹裹裹裹裹裹裹裹裹裹裹裹裹裹裹裹裹裹裹裹裹裹裹裹裹裹裹裹裹裹裹裹裹裹裹裹裹裹裹裹裹裹裹裹裹裹 |
|
||||
@ -1,152 +0,0 @@ |
|||||
/* chars.c 6/7/2012 dwg - test command line arguments */ |
|
||||
|
|
||||
#include "stdio.h" |
|
||||
|
|
||||
#include "portab.h" |
|
||||
#include "globals.h" |
|
||||
#include "std.h" |
|
||||
#include "cpm80.h" |
|
||||
#include "cpmappl.h" |
|
||||
#include "applvers.h" |
|
||||
#include "cnfgdata.h" |
|
||||
#include "syscfg.h" |
|
||||
|
|
||||
#define TOP 0 |
|
||||
#define LEFT 4 |
|
||||
|
|
||||
#define BDOS 5 /* memory address of BDOS invocation */ |
|
||||
#define HIGHSEG 0x0C000 /* memory address of system config */ |
|
||||
|
|
||||
#define GETSYSCFG 0x0F000 /* HBIOS function for Get System Configuration */ |
|
||||
|
|
||||
struct SYSCFG * pSYSCFG = HIGHSEG; |
|
||||
|
|
||||
char map[256] = |
|
||||
{ |
|
||||
/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ |
|
||||
|
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0 */ |
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 1 */ |
|
||||
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 2 */ |
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 3 0 - 9 */ |
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 4 A - O */ |
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 5 P - Z */ |
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 6 a - o */ |
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, /* 7 p - z */ |
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 8 */ |
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 9 */ |
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* A */ |
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* B 0 - 9 */ |
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* C A - O */ |
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* D P - Z */ |
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* E a - o */ |
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 /* F p - z */ |
|
||||
}; |
|
||||
|
|
||||
char attroff[] = { 27, '[', 'm', 0 }; |
|
||||
char attrbold[] = { 27, '[', '1', 'm', 0 }; |
|
||||
char attrlow[] = { 27, '[', '2', 'm', 0 }; |
|
||||
char attrundr[] = { 27, '[', '4', 'm', 0 }; |
|
||||
char attrblnk[] = { 27, '[', '5', 'm', 0 }; |
|
||||
char attrrevs[] = { 27, '[', '7', 'm', 0 }; |
|
||||
char attrinvs[] = { 27, '[', '8', 'm', 0 }; |
|
||||
char graphon[] = { 27, 'F', 0 }; |
|
||||
char graphoff[] = { 27, 'G', 0 }; |
|
||||
|
|
||||
|
|
||||
char atreset[] = "0"; |
|
||||
char atbold[] = "1"; |
|
||||
char atdim[] = "2"; |
|
||||
char atundrscr[] = "4"; |
|
||||
char atblink[] = "5"; |
|
||||
char atrevs[] = "7"; |
|
||||
char athidden[] = "8"; |
|
||||
|
|
||||
char fgblack[] = "30"; |
|
||||
char fgred[] = "31"; |
|
||||
char fggreen[] = "32"; |
|
||||
char fgyellow[] = "33"; |
|
||||
char fgblue[] = "34"; |
|
||||
char fgmagenta[] = "35"; |
|
||||
char fgcyan[] = "36"; |
|
||||
char fgwhite[] = "37"; |
|
||||
|
|
||||
char bgblack[] = "40"; |
|
||||
char bgred[] = "41"; |
|
||||
char bggreen[] = "42"; |
|
||||
char bgyellow[] = "43"; |
|
||||
char bgblue[] = "44"; |
|
||||
char bgmagenta[] = "45"; |
|
||||
char bgcyan[] = "46"; |
|
||||
char bgwhite[] = "47"; |
|
||||
|
|
||||
dispattr(attr,fg,bg) |
|
||||
char * attr; |
|
||||
char * fg; |
|
||||
char * bg; |
|
||||
{ |
|
||||
printf("%c[%s;%s;%sm",27,attr,fg,bg); |
|
||||
} |
|
||||
|
|
||||
int main(argc,argv) |
|
||||
int argc; |
|
||||
char *argv[]; |
|
||||
{ |
|
||||
int i,j,k; |
|
||||
int x,y; |
|
||||
|
|
||||
if(1 < argc) { |
|
||||
for(i=1;i<argc;i++) { |
|
||||
printf("%c",atoi(argv[i])); |
|
||||
} |
|
||||
} else { |
|
||||
|
|
||||
|
|
||||
|
|
||||
hregbc = GETSYSCFG; /* function = Get System Config */ |
|
||||
hregde = HIGHSEG; /* addr of dest (must be high) */ |
|
||||
diagnose(); /* invoke the NBIOS function */ |
|
||||
pSYSCFG = HIGHSEG; |
|
||||
|
|
||||
/* printf("TT is %d\n",pSYSCFG->cnfgdata.termtype); */ |
|
||||
|
|
||||
|
|
||||
crtinit(pSYSCFG->cnfgdata.termtype); |
|
||||
crtclr(); |
|
||||
crtlc(0,0); |
|
||||
|
|
||||
dispattr(atbold,fggreen,bgblack); |
|
||||
banner("CHARS"); |
|
||||
|
|
||||
printf("%s",attroff); |
|
||||
|
|
||||
dispattr(atbold,fgcyan,bgblack); |
|
||||
for(x=0;x<16;x++) { |
|
||||
crtlc(TOP+6,LEFT+(x*4)+5); |
|
||||
printf("[%x]",x); |
|
||||
} |
|
||||
printf("%s",attroff); |
|
||||
|
|
||||
for(y=0;y<16;y++) { |
|
||||
crtlc(TOP+y+7,LEFT+0); |
|
||||
dispattr(atbold,fgcyan,bgblack); |
|
||||
printf("[%x]",y); |
|
||||
printf("%s",attroff); |
|
||||
|
|
||||
for(x=0;x<16;x++) { |
|
||||
crtlc(TOP+y+7,LEFT+(x*4)+6); |
|
||||
if(1 == map[(y*16)+x]) { |
|
||||
printf("."); |
|
||||
} else { |
|
||||
printf("%c",(y*16)+x); |
|
||||
} |
|
||||
} |
|
||||
dispattr(atbold,fgcyan,bgblack); |
|
||||
printf(" [%x]",y); |
|
||||
printf("%s",attroff); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
return 0; |
|
||||
} |
|
||||
|
|
||||
@ -1,48 +0,0 @@ |
|||||
/* clear.c 11/23/2012 dwg - */ |
|
||||
|
|
||||
#include "portab.h" |
|
||||
#include "globals.h" |
|
||||
|
|
||||
#include "stdio.h" |
|
||||
#include "stdlib.h" |
|
||||
#include "memory.h" |
|
||||
#include "applvers.h" |
|
||||
#include "n8chars.h" |
|
||||
#include "tms9918.h" |
|
||||
#include "std.h" |
|
||||
#include "ctermcap.h" |
|
||||
#include "cpmbdos.h" |
|
||||
#include "bdoscall.h" |
|
||||
#include "hbios.h" |
|
||||
#include "asmiface.h" |
|
||||
#include "diagnose.h" |
|
||||
#include "cnfgdata.h" |
|
||||
#include "syscfg.h" |
|
||||
#include "cpmbind.h" |
|
||||
#include "infolist.h" |
|
||||
#include "metadata.h" |
|
||||
#include "clogical.h" |
|
||||
|
|
||||
#define HIGHSEG 0x0C000 /* memory address of system config */ |
|
||||
|
|
||||
#define GETSYSCFG 0x0F000 /* HBIOS function for Get System Configuration */ |
|
||||
|
|
||||
struct CNFGDATA * pCNFGDATA; |
|
||||
struct SYSCFG * pSYSCFG; |
|
||||
|
|
||||
int main(argc,argv) |
|
||||
int argc; |
|
||||
char *argv[]; |
|
||||
{ |
|
||||
char column; |
|
||||
|
|
||||
hregbc = GETSYSCFG; /* function = Get System Config */ |
|
||||
hregde = HIGHSEG; /* addr of dest (must be high) */ |
|
||||
diagnose(); /* invoke the NBIOS function */ |
|
||||
pSYSCFG = HIGHSEG; |
|
||||
crtinit(pSYSCFG->cnfgdata.termtype); |
|
||||
crtclr(); |
|
||||
crtlc(0,0); |
|
||||
} |
|
||||
|
|
||||
|
|
||||
@ -1,57 +0,0 @@ |
|||||
/* clogical.c 6/4/2012 dwg - */ |
|
||||
|
|
||||
#include "portab.h" |
|
||||
#include "cpmbios.h" |
|
||||
#include "asmiface.h" |
|
||||
|
|
||||
lugcur(drive) |
|
||||
{ |
|
||||
asmif(pGETLU,drive,0,0); |
|
||||
return xregde; |
|
||||
} |
|
||||
|
|
||||
lugnum(drive) |
|
||||
{ |
|
||||
asmif(pGETLU,drive,0,0); |
|
||||
return xreghl; |
|
||||
} |
|
||||
|
|
||||
lugdu(drive) |
|
||||
{ |
|
||||
asmif(pGETLU,drive,0,0); |
|
||||
return xregbc>>8; |
|
||||
} |
|
||||
|
|
||||
luscur(drive,lunum) |
|
||||
{ |
|
||||
asmif(pGETLU,drive,0,0); |
|
||||
/* A = Result 0=OK */ |
|
||||
/* B = devunit */ |
|
||||
/* DE = current */ |
|
||||
/* HL = numlu */ |
|
||||
|
|
||||
/* BC = devunit*256+drive */ |
|
||||
/* DE = current */ |
|
||||
/* HL = numlu */ |
|
||||
asmif(pSETLU,xregbc,lunum,xreghl); |
|
||||
} |
|
||||
|
|
||||
lusnum(drive,numlu) |
|
||||
{ |
|
||||
asmif(pGETLU,drive,0,0); |
|
||||
/* A = Result 0=OK */ |
|
||||
/* B = devunit */ |
|
||||
/* DE = current */ |
|
||||
/* HL = numlu */ |
|
||||
|
|
||||
/* BC = devunit*256+drive */ |
|
||||
/* DE = current */ |
|
||||
/* HL = numlu */ |
|
||||
asmif(pSETLU,xregbc,xregde,numlu); |
|
||||
} |
|
||||
|
|
||||
|
|
||||
/********************/ |
|
||||
/* eof - clogical.c */ |
|
||||
/********************/ |
|
||||
|
|
||||
@ -1,14 +0,0 @@ |
|||||
/*****************************/ |
|
||||
/* clogical.H 6/4/2012 dwg - */ |
|
||||
/*****************************/ |
|
||||
|
|
||||
extern lugdu(); |
|
||||
extern lugcur(); |
|
||||
extern luscur(); |
|
||||
extern lugnum(); |
|
||||
extern lusnum(); |
|
||||
|
|
||||
/********************/ |
|
||||
/* eof - clogical.h */ |
|
||||
/********************/ |
|
||||
|
|
||||
@ -1,127 +0,0 @@ |
|||||
/* cls.c 7/21/2012 dwg - elegant form of clear screen program */ |
|
||||
|
|
||||
/*
|
|
||||
#include "stdio.h" |
|
||||
#include "applvers.h" |
|
||||
*/ |
|
||||
|
|
||||
/* declarations for HBIOS access */ |
|
||||
extern char hrega; |
|
||||
extern unsigned int hregbc; |
|
||||
extern unsigned int hregde; |
|
||||
extern unsigned int hreghl; |
|
||||
extern diagnose(); |
|
||||
|
|
||||
/* declaration dir BIOS and BDOS and low level calls */ |
|
||||
extern char xrega; |
|
||||
extern unsigned int xregbc; |
|
||||
extern unsigned int xregde; |
|
||||
extern unsigned int xreghl; |
|
||||
extern asmif(); /* asmif(0x0E6**,bc,de,hl); */ |
|
||||
|
|
||||
#define BDOS 5 /* memory address of BDOS invocation */ |
|
||||
#define HIGHSEG 0x0C000 /* memory address of system config */ |
|
||||
|
|
||||
#define GETSYSCFG 0x0F000 /* HBIOS function for Get System Configuration */ |
|
||||
|
|
||||
/* pointer based Configuration Data structure */ |
|
||||
struct CNFGDATA { |
|
||||
unsigned char rmj; |
|
||||
unsigned char rmn; |
|
||||
unsigned char rup; |
|
||||
unsigned char rtp; |
|
||||
unsigned char diskboot; |
|
||||
unsigned char devunit; |
|
||||
unsigned int bootlu; |
|
||||
unsigned char hour; |
|
||||
unsigned char minute; |
|
||||
unsigned char second; |
|
||||
unsigned char month; |
|
||||
unsigned char day; |
|
||||
unsigned char year; |
|
||||
unsigned char freq; |
|
||||
unsigned char platform; |
|
||||
unsigned char dioplat; |
|
||||
unsigned char vdumode; |
|
||||
unsigned int romsize; |
|
||||
unsigned int ramsize; |
|
||||
unsigned char clrramdk; |
|
||||
unsigned char dskyenable; |
|
||||
unsigned char uartenable; |
|
||||
unsigned char vduenable; |
|
||||
unsigned char fdenable; |
|
||||
unsigned char fdtrace; |
|
||||
unsigned char fdmedia; |
|
||||
unsigned char fdmediaalt; |
|
||||
unsigned char fdmauto; |
|
||||
unsigned char ideenable; |
|
||||
unsigned char idetrace; |
|
||||
unsigned char ide8bit; |
|
||||
unsigned int idecapacity; |
|
||||
unsigned char ppideenable; |
|
||||
unsigned char ppidetrace; |
|
||||
unsigned char ppide8bit; |
|
||||
unsigned int ppidecapacity; |
|
||||
unsigned char ppideslow; |
|
||||
unsigned char boottype; |
|
||||
unsigned char boottimeout; |
|
||||
unsigned char bootdefault; |
|
||||
unsigned int baudrate; |
|
||||
unsigned char ckdiv; |
|
||||
unsigned char memwait; |
|
||||
unsigned char iowait; |
|
||||
unsigned char cntlb0; |
|
||||
unsigned char cntlb1; |
|
||||
unsigned char sdenable; |
|
||||
unsigned char sdtrace; |
|
||||
unsigned int sdcapacity; |
|
||||
unsigned char sdcsio; |
|
||||
unsigned char sdcsiofast; |
|
||||
unsigned char defiobyte; |
|
||||
unsigned char termtype; |
|
||||
unsigned int revision; |
|
||||
unsigned char prpsdenable; |
|
||||
unsigned char prpsdtrace; |
|
||||
unsigned int prpsdcapacity; |
|
||||
unsigned char prpconenable; |
|
||||
unsigned int biossize; |
|
||||
unsigned char pppenable; |
|
||||
unsigned char pppsdenable; |
|
||||
unsigned char pppsdtrace; |
|
||||
unsigned int pppsdcapacity; |
|
||||
unsigned char pppconenable; |
|
||||
unsigned char prpenable; |
|
||||
}; |
|
||||
|
|
||||
struct JMP { |
|
||||
unsigned char opcode; /* JMP opcode */ |
|
||||
unsigned int address; /* JMP address */ |
|
||||
}; |
|
||||
|
|
||||
struct SYSCFG { |
|
||||
struct JMP jmp; |
|
||||
void * cnfloc; |
|
||||
void * tstloc; |
|
||||
void * varloc; |
|
||||
struct CNFGDATA cnfgdata; |
|
||||
char filler[256-3-2-2-2-sizeof(struct CNFGDATA)]; |
|
||||
} * pSYSCFG = HIGHSEG; |
|
||||
|
|
||||
|
|
||||
main(argc,argv) |
|
||||
int argc; |
|
||||
char *argv[]; |
|
||||
{ |
|
||||
hregbc = GETSYSCFG; /* function = Get System Config */ |
|
||||
hregde = HIGHSEG; /* addr of dest (must be high) */ |
|
||||
diagnose(); /* invoke the HBIOS function */ |
|
||||
|
|
||||
crtinit(pSYSCFG->cnfgdata.termtype); /* pass termtype to init */ |
|
||||
|
|
||||
crtclr(); |
|
||||
|
|
||||
crtlc(0,0); |
|
||||
} |
|
||||
|
|
||||
|
|
||||
|
|
||||
@ -1,53 +0,0 @@ |
|||||
/* cmemory.c 3/13/2012 dwg - */ |
|
||||
|
|
||||
#include "portab.h" |
|
||||
/* #include "cpmbind.h" */ |
|
||||
|
|
||||
memcmp(xptr,yptr,count) |
|
||||
u8 * xptr; |
|
||||
u8 * yptr; |
|
||||
int count; |
|
||||
{ |
|
||||
u8 * x; |
|
||||
u8 * y; |
|
||||
int i; |
|
||||
|
|
||||
x = xptr; |
|
||||
y = yptr; |
|
||||
for(i=0;i<count;i++) { |
|
||||
if(*x++ != *y++) return FALSE; |
|
||||
} |
|
||||
return TRUE; |
|
||||
} |
|
||||
|
|
||||
memcpy(dstptr,srcptr,count) |
|
||||
u8 * dstptr; |
|
||||
u8 * srcptr; |
|
||||
int count; |
|
||||
{ |
|
||||
u8 * s; |
|
||||
u8 * d; |
|
||||
int i; |
|
||||
|
|
||||
s = srcptr; |
|
||||
d = dstptr; |
|
||||
for(i=0;i<count;i++) { |
|
||||
*d++ = *s++; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
memset(dstptr,data,count) |
|
||||
u8 * dstptr; |
|
||||
u8 data; |
|
||||
u16 count; |
|
||||
{ |
|
||||
u8 * p; |
|
||||
int i; |
|
||||
|
|
||||
p = dstptr; |
|
||||
for(i=0;i<count;i++) { |
|
||||
*p++ = data; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
|
|
||||
@ -1,58 +0,0 @@ |
|||||
/* metadata.c 6/10/2012 dwg - functions for manipulating a drive's metadata */ |
|
||||
|
|
||||
#include "portab.h" |
|
||||
#include "globals.h" |
|
||||
#include "cpmbios.h" |
|
||||
#include "bioscall.h" |
|
||||
#include "sectorio.h" |
|
||||
#include "infolist.h" |
|
||||
#include "dphmap.h" |
|
||||
|
|
||||
int hasmeta(drive) |
|
||||
int drive; |
|
||||
{ |
|
||||
ireghl = pGETINFO; |
|
||||
bioscall(); |
|
||||
pINFOLIST = ireghl; |
|
||||
pDPHVEC = pINFOLIST->dphmap; |
|
||||
pDPH = pDPHVEC[drive] |
|
||||
pDPB = pDPH->dpb; |
|
||||
if(0 < pDPB->off) { |
|
||||
return TRUE; |
|
||||
} else { |
|
||||
return FALSE; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
int getmeta(drive,buffer) |
|
||||
int drive; |
|
||||
struct METADATA * buffer; |
|
||||
{ |
|
||||
if(TRUE == hasmeta(drive)) { |
|
||||
rdsector(drive,track,sector,buffer,0); |
|
||||
return SUCCESS; |
|
||||
} else { |
|
||||
return FAILURE; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
int putmeta(drive,buffer) |
|
||||
int drive; |
|
||||
struct METADATA * buffer; |
|
||||
{ |
|
||||
if(TRUE == hasmeta(drive)) { |
|
||||
wrsector(drive,track,sector,buffer,0); |
|
||||
return SUCCESS; |
|
||||
} else { |
|
||||
return FAILURE; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
/********************/ |
|
||||
/* eof - metadata.c */ |
|
||||
/********************/ |
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
@ -1,140 +0,0 @@ |
|||||
/* cnfgdata.h 6/04/2012 dwg - */ |
|
||||
|
|
||||
struct CNFGDATA { |
|
||||
|
|
||||
unsigned char rmj; |
|
||||
unsigned char rmn; |
|
||||
unsigned char rup; |
|
||||
unsigned char rtp; |
|
||||
unsigned int revision; |
|
||||
|
|
||||
unsigned char diskboot; |
|
||||
unsigned char devunit; |
|
||||
unsigned int bootlu; |
|
||||
unsigned char year; |
|
||||
unsigned char month; |
|
||||
unsigned char day; |
|
||||
unsigned char hour; |
|
||||
unsigned char minute; |
|
||||
unsigned char second; |
|
||||
|
|
||||
unsigned char platform; |
|
||||
unsigned char freq; |
|
||||
unsigned int ramsize; |
|
||||
unsigned int romsize; |
|
||||
|
|
||||
unsigned char ckdiv; |
|
||||
unsigned char memwait; |
|
||||
unsigned char iowait; |
|
||||
unsigned char cntlb0; |
|
||||
unsigned char cntlb1; |
|
||||
|
|
||||
unsigned char boottype; |
|
||||
unsigned char boottimeout; |
|
||||
unsigned char bootdefault; |
|
||||
|
|
||||
unsigned char defcon; |
|
||||
unsigned char altcon; |
|
||||
unsigned int conbaud; |
|
||||
unsigned char defvda; |
|
||||
unsigned char defemu; |
|
||||
unsigned char termtype; |
|
||||
|
|
||||
unsigned char defiobyte; |
|
||||
unsigned char altiobyte; |
|
||||
unsigned char wrtcache; |
|
||||
unsigned char dsktrace; |
|
||||
unsigned char dskmap; |
|
||||
unsigned char clrramdsk; |
|
||||
|
|
||||
unsigned char dskyenable; |
|
||||
|
|
||||
unsigned char uartenable; |
|
||||
unsigned char uartcnt; |
|
||||
unsigned char uart0iob; |
|
||||
unsigned int uart0baud; /* actual baudrate / 10 */ |
|
||||
unsigned char uart0fifo; |
|
||||
unsigned char uart0afc; |
|
||||
unsigned char uart1iob; |
|
||||
unsigned int uart1baud; /* actual baudrate / 10 */ |
|
||||
unsigned char uart1fifo; |
|
||||
unsigned char uart1afc; |
|
||||
unsigned char uart2iob; |
|
||||
unsigned int uart2baud; /* actual baudrate / 10 */ |
|
||||
unsigned char uart2fifo; |
|
||||
unsigned char uart2afc; |
|
||||
unsigned char uart3iob; |
|
||||
unsigned int uart3baud; /* actual baudrate / 10 */ |
|
||||
unsigned char uart3fifo; |
|
||||
unsigned char uart3afc; |
|
||||
|
|
||||
unsigned char ascienable; |
|
||||
unsigned int asci0baud; /* actual baudrate / 10 */ |
|
||||
unsigned int asci1baud; /* actual baudrate / 10 */ |
|
||||
|
|
||||
unsigned char vduenable; |
|
||||
|
|
||||
unsigned char cvduenable; |
|
||||
|
|
||||
unsigned char upd7220enable; |
|
||||
|
|
||||
unsigned char n8venable; |
|
||||
|
|
||||
unsigned char fdenable; |
|
||||
unsigned char fdmode; |
|
||||
unsigned char fdtrace; |
|
||||
unsigned char fdmedia; |
|
||||
unsigned char fdmediaalt; |
|
||||
unsigned char fdmauto; |
|
||||
|
|
||||
unsigned char ideenable; |
|
||||
unsigned char idemode; |
|
||||
unsigned char idetrace; |
|
||||
unsigned char ide8bit; |
|
||||
unsigned int idecapacity; |
|
||||
|
|
||||
unsigned char ppideenable; |
|
||||
unsigned char ppideiob; |
|
||||
unsigned char ppidetrace; |
|
||||
unsigned char ppide8bit; |
|
||||
unsigned int ppidecapacity; |
|
||||
unsigned char ppideslow; |
|
||||
|
|
||||
unsigned char sdenable; |
|
||||
unsigned char sdmode; |
|
||||
unsigned char sdtrace; |
|
||||
unsigned int sdcapacity; |
|
||||
unsigned char sdcsiofast; |
|
||||
|
|
||||
unsigned char prpenable; |
|
||||
unsigned char prpsdenable; |
|
||||
unsigned char prpsdtrace; |
|
||||
unsigned int prpsdcapacity; |
|
||||
unsigned char prpconenable; |
|
||||
|
|
||||
unsigned char pppenable; |
|
||||
unsigned char pppsdenable; |
|
||||
unsigned char pppsdtrace; |
|
||||
unsigned int pppsdcapacity; |
|
||||
unsigned char pppconenable; |
|
||||
|
|
||||
unsigned char hdskenable; |
|
||||
unsigned char hdsktrace; |
|
||||
unsigned int hdskcapacity; |
|
||||
|
|
||||
unsigned char ppkenable; |
|
||||
unsigned char ppktrace; |
|
||||
|
|
||||
unsigned char kbdenable; |
|
||||
unsigned char kbdtrace; |
|
||||
|
|
||||
unsigned char ttyenable; |
|
||||
|
|
||||
unsigned char ansienable; |
|
||||
unsigned char ansitrace; |
|
||||
}; |
|
||||
|
|
||||
/********************/ |
|
||||
/* eof - cnfgdata.h */ |
|
||||
/********************/ |
|
||||
|
|
||||
@ -1,210 +0,0 @@ |
|||||
; cnfgdata.lib 7/19/2012 dwg - |
|
||||
|
|
||||
byte equ 1 |
|
||||
word equ 2 |
|
||||
|
|
||||
;; /* cnfgdata.h 6/04/2012 dwg - */ |
|
||||
;; |
|
||||
;; struct CNFGDATA { |
|
||||
;; unsigned char rmj; |
|
||||
cfgrmj equ 08009h |
|
||||
;; |
|
||||
;; unsigned char rmn; |
|
||||
cfgrmn equ cfgrmj + byte |
|
||||
;; |
|
||||
;; unsigned char rup; |
|
||||
cfgrup equ cfgrmn + byte |
|
||||
;; |
|
||||
;; unsigned char rtp; |
|
||||
cfgrtp equ cfgrup + byte |
|
||||
;; |
|
||||
;; unsigned char diskboot; |
|
||||
diskboot equ cfgrtp + byte |
|
||||
;; |
|
||||
;; unsigned char devunit; |
|
||||
devunit equ diskboot + byte |
|
||||
;; |
|
||||
;; unsigned int bootlu; |
|
||||
bootlu equ devunit + byte |
|
||||
;; |
|
||||
;; unsigned char hour; |
|
||||
hour equ bootlu + word |
|
||||
;; |
|
||||
;; unsigned char minute; |
|
||||
minute equ hour + byte |
|
||||
;; |
|
||||
;; unsigned char second; |
|
||||
second equ minute + byte |
|
||||
;; |
|
||||
;; unsigned char month; |
|
||||
month equ second + byte |
|
||||
;; |
|
||||
;; unsigned char day; |
|
||||
day equ month + byte |
|
||||
;; |
|
||||
;; unsigned char year; |
|
||||
year equ day + byte |
|
||||
;; |
|
||||
;; unsigned char freq; |
|
||||
freq equ year + byte |
|
||||
;; |
|
||||
;; unsigned char platform; |
|
||||
platform equ freq+ byte |
|
||||
;; |
|
||||
;; unsigned char dioplat; |
|
||||
dioplat equ platform + byte |
|
||||
;; |
|
||||
;; unsigned char vdumode; |
|
||||
vdumode equ dioplat + byte |
|
||||
;; |
|
||||
;; unsigned int romsize; |
|
||||
romsize equ vdumode + byte |
|
||||
;; |
|
||||
;; unsigned int ramsize; |
|
||||
ramsize equ romsize + word |
|
||||
;; |
|
||||
;; unsigned char clrramdk; |
|
||||
clrramdk equ ramsize + word |
|
||||
;; |
|
||||
;; unsigned char dskyenable; |
|
||||
dskyenable equ clrramdk + byte |
|
||||
;; |
|
||||
;; unsigned char uartenable; |
|
||||
uartenable equ dskyenable + byte |
|
||||
;; |
|
||||
;; unsigned char vduenable; |
|
||||
vduenable equ uartenable + byte |
|
||||
;; |
|
||||
;; unsigned char fdenable; |
|
||||
fdenable equ vduenable + byte |
|
||||
;; |
|
||||
;; unsigned char fdtrace; |
|
||||
fdtrace equ fdenable + byte |
|
||||
;; |
|
||||
;; unsigned char fdmedia; |
|
||||
fdmedia equ fdtrace + byte |
|
||||
;; |
|
||||
;; unsigned char fdmediaalt; |
|
||||
fdmediaalt equ fdmedia + byte |
|
||||
;; |
|
||||
;; unsigned char fdmauto; |
|
||||
fdmauto equ fdmediaalt + byte |
|
||||
;; |
|
||||
;; unsigned char ideenable; |
|
||||
ideenable equ fdmauto + byte |
|
||||
;; |
|
||||
;; unsigned char idetrace; |
|
||||
idetrace equ ideenable + byte |
|
||||
;; |
|
||||
;; unsigned char ide8bit; |
|
||||
ide8bit equ idetrace + byte |
|
||||
;; |
|
||||
;; unsigned int idecapacity; |
|
||||
idecapacity equ ide8bit + byte |
|
||||
;; |
|
||||
;; unsigned char ppideenable; |
|
||||
ppideenable equ idecapacity + word |
|
||||
;; |
|
||||
;; unsigned char ppidetrace; |
|
||||
ppidetrace equ ppideenable + byte |
|
||||
;; |
|
||||
;; unsigned char ppide8bit; |
|
||||
ppide8bit equ ppidetrace + byte |
|
||||
;; |
|
||||
;; unsigned int ppidecapacity; |
|
||||
ppidecapacity equ ppide8bit + byte |
|
||||
;; |
|
||||
;; unsigned char ppideslow; |
|
||||
ppideslow equ ppidecapacity + word |
|
||||
;; |
|
||||
;; unsigned char boottype; |
|
||||
boottype equ ppideslow + byte |
|
||||
;; |
|
||||
;; unsigned char boottimeout; |
|
||||
boottimeout equ boottype + byte |
|
||||
;; |
|
||||
;; unsigned char bootdefault; |
|
||||
bootdefault equ boottimeout + byte |
|
||||
;; |
|
||||
;; unsigned int baudrate; |
|
||||
baudrate equ bootdefault + byte |
|
||||
;; |
|
||||
;; unsigned char ckdiv; |
|
||||
ckdiv equ baudrate + word |
|
||||
;; |
|
||||
;; unsigned char memwait; |
|
||||
memwait equ ckdiv + byte |
|
||||
;; |
|
||||
;; unsigned char iowait; |
|
||||
iowait equ memwait + byte |
|
||||
;; |
|
||||
;; unsigned char cntlb0; |
|
||||
cntlb0 equ iowait + byte |
|
||||
;; |
|
||||
;; unsigned char cntlb1; |
|
||||
cntlb1 equ cntlb0 + byte |
|
||||
;; |
|
||||
;; unsigned char sdenable; |
|
||||
sdenable equ cntlb1 + byte |
|
||||
;; |
|
||||
;; unsigned char sdtrace; |
|
||||
sdtrace equ sdenable + byte |
|
||||
;; |
|
||||
;; unsigned int sdcapacity; |
|
||||
sdcapacity equ sdtrace + byte |
|
||||
;; |
|
||||
;; unsigned char sdcsio; |
|
||||
sdcsio equ sdcapacity + word |
|
||||
;; |
|
||||
;; unsigned char sdcsiofast; |
|
||||
sdcsiofast equ sdcsio + byte |
|
||||
;; |
|
||||
;; unsigned char defiobyte; |
|
||||
defiobyte equ sdcsiofast + byte |
|
||||
;; |
|
||||
;; unsigned char termtype; |
|
||||
termtype equ defiobyte + byte |
|
||||
;; |
|
||||
;; unsigned int revision; |
|
||||
revision equ termtype + byte |
|
||||
;; |
|
||||
;; unsigned char prpsdenable; |
|
||||
prpsdenable equ revision + word |
|
||||
;; |
|
||||
;; unsigned char prpsdtrace; |
|
||||
prpsdtrace equ prpsdenable + byte |
|
||||
;; |
|
||||
;; unsigned int prpsdcapacity; |
|
||||
prpsdcapacity equ prpsdtrace + byte |
|
||||
;; |
|
||||
;; unsigned char prpconenable; |
|
||||
prpconenable equ prpsdcapacity + word |
|
||||
;; |
|
||||
;; unsigned int biossize; |
|
||||
biossize equ prpconenable + byte |
|
||||
;; |
|
||||
;; unsigned char pppenable; |
|
||||
pppenable equ biossize + word |
|
||||
;; |
|
||||
;; unsigned char pppsdenable; |
|
||||
pppsdenable equ pppenable + byte |
|
||||
;; |
|
||||
;; unsigned char pppsdtrace; |
|
||||
pppsdtrace equ pppsdenable + byte |
|
||||
;; |
|
||||
;; unsigned int pppsdcapacity; |
|
||||
pppsdcapacity equ pppsdtrace + byte |
|
||||
;; |
|
||||
;; unsigned char pppconenable; |
|
||||
pppconenable equ pppsdcapacity + word |
|
||||
;; |
|
||||
;; unsigned char prpenable; |
|
||||
prpenable equ pppconenable + byte |
|
||||
;; |
|
||||
;; }; |
|
||||
;; |
|
||||
;; /********************/ |
|
||||
;; /* eof - cnfgdata.h */ |
|
||||
;; /********************/ |
|
||||
|
|
||||
|
|
||||
@ -1,80 +0,0 @@ |
|||||
/* convert.c 7/11/2012 dwg -
|
|
||||
|
|
||||
The purpose of this program is similar to the CP/M dump program |
|
||||
except that in addition to the normal hexadecimal bytes, a field |
|
||||
of ascii bytes to the right are displayed as well. |
|
||||
|
|
||||
*/ |
|
||||
|
|
||||
#include "stdio.h" |
|
||||
|
|
||||
|
|
||||
char visible[256] = { |
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 00 */ |
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 10 */ |
|
||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 20 */ |
|
||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 30 */ |
|
||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 40 */ |
|
||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 50 */ |
|
||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 60 */ |
|
||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0, /* 70 */ |
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 80 */ |
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 90 */ |
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* A0 */ |
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* B0 */ |
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* C0 */ |
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* D0 */ |
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* E0 */ |
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* F0 */ |
|
||||
}; |
|
||||
|
|
||||
#include "cvt2h.h" |
|
||||
|
|
||||
unsigned char sector[32767]; |
|
||||
|
|
||||
main(argc,argv) |
|
||||
int argc; |
|
||||
char *argv[]; |
|
||||
{ |
|
||||
int i,j; |
|
||||
int offset; |
|
||||
int result; |
|
||||
unsigned char byte; |
|
||||
char name[32]; |
|
||||
|
|
||||
|
|
||||
FILE * fd; |
|
||||
|
|
||||
for(i=0;i<sizeof(sector);i++) sector[i] = 0; |
|
||||
|
|
||||
banner("DUMP.COM"); |
|
||||
|
|
||||
/* cvt2h(0x0100,12*1024,"dumpcomh.h"); */ |
|
||||
|
|
||||
|
|
||||
if(1 == argc) { |
|
||||
printf("Sorry, no input file specified"); |
|
||||
exit(1); |
|
||||
} |
|
||||
|
|
||||
fd = fopen(argv[1],"r"); |
|
||||
if(NULL == fd) { |
|
||||
printf("Sorry, cannot open input file"); |
|
||||
exit(1); |
|
||||
} |
|
||||
|
|
||||
printf("Converting %s\n\n",argv[1]); |
|
||||
|
|
||||
result = fread(sector,32767,1,fd); |
|
||||
|
|
||||
for(i=32767;i>0;i--) { |
|
||||
if(sector[i] != 0) break; |
|
||||
} |
|
||||
|
|
||||
sprintf(name,"sect%04x.h",0); |
|
||||
cvt2h(sector,i,name); |
|
||||
fclose(fd); |
|
||||
|
|
||||
exit(0); |
|
||||
} |
|
||||
|
|
||||
@ -1,195 +0,0 @@ |
|||||
/* cpmbios.h 3/11/2012 dwg - added CURDRV */ |
|
||||
|
|
||||
/*************************/ |
|
||||
/* BIOS Memory Locations */ |
|
||||
/*************************/ |
|
||||
|
|
||||
#define CURDRV 0x00004 |
|
||||
#define BIOSAD 0x0e600 |
|
||||
|
|
||||
#define pBOOT 0x0E600 |
|
||||
#define pWBOOT 0x0E603 |
|
||||
#define pCONST 0x0E606 |
|
||||
#define pCONIN 0x0E609 |
|
||||
#define pCONOUT 0x0E60C |
|
||||
#define pLIST 0x0E60F |
|
||||
#define pPUNCH 0x0E612 |
|
||||
#define pREADER 0x0E615 |
|
||||
#define pHOME 0x0E618 |
|
||||
#define pSELDSK 0x0E61B |
|
||||
#define pSETTRK 0x0E61E |
|
||||
#define pSETSEC 0x0E621 |
|
||||
#define pSETDMA 0x0E624 |
|
||||
#define pREAD 0x0E627 |
|
||||
#define pWRITE 0x0E62A |
|
||||
#define pLISTST 0x0E62D |
|
||||
#define pSECTRN 0x0E630 |
|
||||
#define pBNKSEL 0x0E633 |
|
||||
#define pGETLU 0x0E636 |
|
||||
#define pSETLU 0x0E639 |
|
||||
#define pGETINFO 0x0E63C |
|
||||
|
|
||||
struct JMP { |
|
||||
unsigned char opcode; |
|
||||
unsigned int address; |
|
||||
}; |
|
||||
|
|
||||
struct BIOS { |
|
||||
struct JMP boot; |
|
||||
struct JMP wboot; |
|
||||
struct JMP const; |
|
||||
struct JMP conin; |
|
||||
struct JMP conout; |
|
||||
struct JMP list; |
|
||||
struct JMP punch; |
|
||||
struct JMP reader; |
|
||||
struct JMP home; |
|
||||
struct JMP seldsk; |
|
||||
struct JMP settrk; |
|
||||
struct JMP setsec; |
|
||||
struct JMP setdma; |
|
||||
struct JMP read; |
|
||||
struct JMP write; |
|
||||
struct JMP listst; |
|
||||
struct JMP sectrn; |
|
||||
struct JMP bnksel; |
|
||||
struct JMP getlu; |
|
||||
struct JMP setlu; |
|
||||
struct JMP getinfo; |
|
||||
struct JMP rsvd1; |
|
||||
struct JMP rsvd2; |
|
||||
struct JMP rsvd3; |
|
||||
struct JMP rsvd4; |
|
||||
|
|
||||
char diskboot; |
|
||||
char bootdrive; |
|
||||
|
|
||||
char rmj; |
|
||||
char rmn; |
|
||||
char rup; |
|
||||
char rtp; |
|
||||
}; |
|
||||
|
|
||||
|
|
||||
struct DPH { |
|
||||
unsigned int xlt; |
|
||||
unsigned int rv1; |
|
||||
unsigned int rv2; |
|
||||
unsigned int rv3; |
|
||||
unsigned int dbf; |
|
||||
unsigned int dpb; |
|
||||
unsigned int csv; |
|
||||
unsigned int alv; |
|
||||
unsigned char sigl; |
|
||||
unsigned char sigu; |
|
||||
unsigned int current; |
|
||||
unsigned int number; |
|
||||
}; |
|
||||
|
|
||||
struct DPB { |
|
||||
unsigned int spt; |
|
||||
unsigned char bsh; |
|
||||
unsigned char blm; |
|
||||
unsigned char exm; |
|
||||
unsigned int dsm; |
|
||||
unsigned int drm; |
|
||||
unsigned char al0; |
|
||||
unsigned char al1; |
|
||||
unsigned int cks; |
|
||||
unsigned int off; |
|
||||
}; |
|
||||
|
|
||||
/* bioscall.h 3/10/2012 dwg - header file for bdoscall */ |
|
||||
|
|
||||
extern char irega; |
|
||||
extern unsigned int iregbc; |
|
||||
extern unsigned int iregde; |
|
||||
extern unsigned int ireghl; |
|
||||
extern bioscall(); |
|
||||
|
|
||||
|
|
||||
/* bdoscall.h 3/10/2012 dwg - header file for bdoscall */ |
|
||||
|
|
||||
extern char drega; |
|
||||
extern unsigned int dregbc; |
|
||||
extern unsigned int dregde; |
|
||||
extern unsigned int dreghl; |
|
||||
extern bdoscall(); |
|
||||
|
|
||||
/* diagnose.h 5/23/2012 dwg - */ |
|
||||
|
|
||||
extern char hrega; |
|
||||
extern unsigned int hregbc; |
|
||||
extern unsigned int hregde; |
|
||||
extern unsigned int hreghl; |
|
||||
|
|
||||
extern diagnose(); |
|
||||
|
|
||||
/* ctermcap.h 3/11/2012 dwg - declarations for termal capability */ |
|
||||
|
|
||||
extern crtinit(); |
|
||||
extern crtclr(); |
|
||||
extern crtlc(); |
|
||||
|
|
||||
/* cpmbdos.h */ |
|
||||
#define TERMCPM 0 |
|
||||
#define CONIN 1 |
|
||||
#define CWRITE 2 |
|
||||
#define DIRCONIO 6 |
|
||||
#define PRINTSTR 9 |
|
||||
#define RDCONBUF 10 |
|
||||
#define GETCONST 11 |
|
||||
#define RETVERNUM 12 |
|
||||
#define RESDISKSYS 13 |
|
||||
#define SELECTDISK 14 |
|
||||
#define FOPEN 15 |
|
||||
#define FCLOSE 16 |
|
||||
#define SEARCHFIRST 17 |
|
||||
#define SEARCHNEXT 18 |
|
||||
#define FDELETE 19 |
|
||||
#define FREADSEQ 20 |
|
||||
#define FWRITESEQ 21 |
|
||||
#define FMAKEFILE 22 |
|
||||
#define FRENAME 23 |
|
||||
#define RETLOGINVEC 24 |
|
||||
#define RETCURRDISK 25 |
|
||||
#define SETDMAADDR 26 |
|
||||
#define GETALLOCVEC 27 |
|
||||
#define WRPROTDISK 28 |
|
||||
#define GETROVECTOR 29 |
|
||||
#define FSETATTRIB 30 |
|
||||
#define GETDPBADDR 31 |
|
||||
#define SETGETUSER 32 |
|
||||
#define FREADRANDOM 33 |
|
||||
#define FWRITERAND 34 |
|
||||
#define FCOMPSIZE 35 |
|
||||
#define SETRANDREC 36 |
|
||||
#define RESETDRIVE 37 |
|
||||
#define WRRANDFILL 38 |
|
||||
|
|
||||
#define DRIVEA 0 |
|
||||
|
|
||||
/* dphmap.h 5/29/2012 dwg - declaration of DPH MAP structure */ |
|
||||
|
|
||||
struct DPHMAP { |
|
||||
struct DPH * drivea; |
|
||||
struct DPH * driveb; |
|
||||
struct DPH * drivec; |
|
||||
struct DPH * drived; |
|
||||
struct DPH * drivee; |
|
||||
struct DPH * drivef; |
|
||||
struct DPH * driveg; |
|
||||
struct DPH * driveh; |
|
||||
} * pDPHMAP; |
|
||||
|
|
||||
struct DPHMAP * pDPHVEC[MAXDRIVE]; |
|
||||
|
|
||||
|
|
||||
/******************/ |
|
||||
/* eof - dphmap.h */ |
|
||||
/******************/ |
|
||||
|
|
||||
/*****************/ |
|
||||
/* eof - cpm80.h */ |
|
||||
/*****************/ |
|
||||
|
|
||||
@ -1,8 +0,0 @@ |
|||||
/* cpmappl.h */ |
|
||||
|
|
||||
extern banner(); |
|
||||
|
|
||||
/*******************/ |
|
||||
/* eof - cpmappl.h */ |
|
||||
/*******************/ |
|
||||
|
|
||||
@ -1,82 +0,0 @@ |
|||||
; cpmappl.lib 2/10/2012 dwg - begin 1.6 development |
|
||||
; cpmappl.lib 2/04/2012 dwg - fix typo mov becomes mvi |
|
||||
; cpmappl.lib 2/ 2/2012 dwg - initial version |
|
||||
|
|
||||
; |
|
||||
; Copyright (C) 2011-2012 Douglas Goodall Licensed under GPL Ver 3. |
|
||||
; |
|
||||
; This file is part of NuBiosDWG and is free software: you can |
|
||||
; redistribute it and/or modify it under the terms of the GNU |
|
||||
; General Public License as published by the Free Software Foundation, |
|
||||
; either version 3 of the License, or (at your option) any later version. |
|
||||
; This file is distributed in the hope that it will be useful, |
|
||||
; but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||
; GNU General Public License for more details. |
|
||||
; You should have received a copy of the GNU General Public License |
|
||||
; along with it. If not, see <http://www.gnu.org/licenses/>. |
|
||||
; |
|
||||
|
|
||||
do$start macro |
|
||||
|
|
||||
start: jmp begin |
|
||||
|
|
||||
public hexref |
|
||||
hexref db '0123456789ABCDEF' |
|
||||
|
|
||||
public id$sig,id$rmj,id$rmn,id$rup,id$rtp,id$mon,id$day,id$yr |
|
||||
id$sig db 'ID' |
|
||||
id$rmj db A$RMJ |
|
||||
id$rmn db A$RMN |
|
||||
id$rup db A$RUP |
|
||||
id$rtp db A$RTP |
|
||||
id$mon db A$MONTH |
|
||||
id$day db A$DAY |
|
||||
id$yr dw A$YEAR |
|
||||
id$argv dw argv |
|
||||
db 0e5h |
|
||||
|
|
||||
|
|
||||
public pre$stk |
|
||||
pre$stk ds 2 |
|
||||
|
|
||||
public begin |
|
||||
begin: lxi h,0 |
|
||||
dad sp |
|
||||
shld pre$stk |
|
||||
lxi sp,stack$top |
|
||||
nop |
|
||||
endm |
|
||||
|
|
||||
|
|
||||
;--------------------------------- |
|
||||
|
|
||||
|
|
||||
do$end macro |
|
||||
lhld pre$stk |
|
||||
sphl |
|
||||
|
|
||||
mvi c,13 |
|
||||
call BDOS |
|
||||
|
|
||||
ret |
|
||||
ds stack$size |
|
||||
stack$top: |
|
||||
|
|
||||
endm |
|
||||
|
|
||||
movfcb macro destn,source |
|
||||
lxi d,destn |
|
||||
lxi h,source |
|
||||
lxi b,LENFCB |
|
||||
ldir |
|
||||
endm |
|
||||
|
|
||||
copyfcb macro fcbname,source |
|
||||
local around |
|
||||
jmp around |
|
||||
fcbname ds 32 |
|
||||
around: |
|
||||
endm |
|
||||
|
|
||||
|
|
||||
@ -1,53 +0,0 @@ |
|||||
|
|
||||
#define TERMCPM 0 |
|
||||
#define CONIN 1 |
|
||||
#define CWRITE 2 |
|
||||
#define DIRCONIO 6 |
|
||||
#define PRINTSTR 9 |
|
||||
#define RDCONBUF 10 |
|
||||
#define GETCONST 11 |
|
||||
#define RETVERNUM 12 |
|
||||
#define RESDISKSYS 13 |
|
||||
#define SELECTDISK 14 |
|
||||
#define FOPEN 15 |
|
||||
#define FCLOSE 16 |
|
||||
#define SEARCHFIRST 17 |
|
||||
#define SEARCHNEXT 18 |
|
||||
#define FDELETE 19 |
|
||||
#define FREADSEQ 20 |
|
||||
#define FWRITESEQ 21 |
|
||||
#define FMAKEFILE 22 |
|
||||
#define FRENAME 23 |
|
||||
#define RETLOGINVEC 24 |
|
||||
#define RETCURRDISK 25 |
|
||||
#define SETDMAADDR 26 |
|
||||
#define GETALLOCVEC 27 |
|
||||
#define WRPROTDISK 28 |
|
||||
#define GETROVECTOR 29 |
|
||||
#define FSETATTRIB 30 |
|
||||
#define GETDPBADDR 31 |
|
||||
#define SETGETUSER 32 |
|
||||
#define FREADRANDOM 33 |
|
||||
#define FWRITERAND 34 |
|
||||
#define FCOMPSIZE 35 |
|
||||
#define SETRANDREC 36 |
|
||||
#define RESETDRIVE 37 |
|
||||
#define WRRANDFILL 38 |
|
||||
|
|
||||
#define BDOSDEFDR 0 /* BDOS Default (current) Drive Number */ |
|
||||
#define BDOSDRA 1 |
|
||||
#define BDOSDRB 2 |
|
||||
#define BDOSDRC 3 |
|
||||
#define BDOSDRD 4 |
|
||||
#define BDOSDRE 5 |
|
||||
#define BDOSDRF 6 |
|
||||
#define BDOSDRG 7 |
|
||||
#define BDOSDRH 8 |
|
||||
|
|
||||
struct FCB { |
|
||||
char drive; |
|
||||
char filename[8]; |
|
||||
char filetype[3]; |
|
||||
char filler[24]; |
|
||||
}; |
|
||||
|
|
||||
@ -1,174 +0,0 @@ |
|||||
; cpmbdos.lib 1/19/2012 dwg - add READ$CON$BUF (10) |
|
||||
; cpmbdos.lib 1/15/2012 dwg - add more functions |
|
||||
|
|
||||
; |
|
||||
; Copyright (C) 2011-2012 Douglas Goodall Licensed under GPL Ver 3. |
|
||||
; |
|
||||
; This file is part of NuBiosDWG and is free software: you can |
|
||||
; redistribute it and/or modify it under the terms of the GNU |
|
||||
; General Public License as published by the Free Software Foundation, |
|
||||
; either version 3 of the License, or (at your option) any later version. |
|
||||
; This file is distributed in the hope that it will be useful, |
|
||||
; but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||
; GNU General Public License for more details. |
|
||||
; You should have received a copy of the GNU General Public License |
|
||||
; along with it. If not, see <http://www.gnu.org/licenses/>. |
|
||||
; |
|
||||
|
|
||||
; BDOS function codes |
|
||||
|
|
||||
TERMCPM equ 0 ; return to command line |
|
||||
CREAD equ 1 ; read a character |
|
||||
CWRITE equ 2 ; write a character |
|
||||
PRINTSTR equ 9 ; print string |
|
||||
READ$CON$BUF equ 10 ; read console buffer |
|
||||
RETVERNO equ 12 ; return version number |
|
||||
DSKRESET equ 13 ; disk reset |
|
||||
SELDSK equ 14 ; select disk |
|
||||
FOPEN equ 15 ; open file |
|
||||
FCLOSE equ 16 ; close file |
|
||||
FDELETE equ 19 ; delete file |
|
||||
READSEQ equ 20 ; read sequential |
|
||||
WRITESEQ equ 21 ; write sequential |
|
||||
FMAKE equ 22 ; make file |
|
||||
FRENAME equ 23 ; rename file |
|
||||
RETCURR equ 25 ; return current disk, 0=a |
|
||||
SETDMA equ 26 ; set dma address |
|
||||
WRITERAND equ 34 ; write random record |
|
||||
FCOMPSIZE equ 35 ; compute file size |
|
||||
SETRANDREC equ 36 ; set random record |
|
||||
RESETDRIVE equ 37 ; reset drive |
|
||||
WRITERANDZF equ 40 ; write random with zero fill |
|
||||
|
|
||||
OEMID equ 0E5h |
|
||||
|
|
||||
; File Control Block |
|
||||
DR$OFS equ 0 |
|
||||
F1$OFS equ DR$OFS+BYTESIZE |
|
||||
F2$OFS equ F1$OFS+BYTESIZE |
|
||||
F3$OFS equ F2$OFS+BYTESIZE |
|
||||
F4$OFS equ F3$OFS+BYTESIZE |
|
||||
F5$OFS equ F4$OFS+BYTESIZE |
|
||||
F6$OFS equ F5$OFS+BYTESIZE |
|
||||
F7$OFS equ F6$OFS+BYTESIZE |
|
||||
F8$OFS equ F7$OFS+BYTESIZE |
|
||||
T1$OFS equ F8$OFS+BYTESIZE |
|
||||
T2$OFS equ T1$OFS+BYTESIZE |
|
||||
T3$OFS equ T2$OFS+BYTESIZE |
|
||||
EX$OFS equ T3$OFS+BYTESIZE |
|
||||
S1$OFS equ EX$OFS+BYTESIZE |
|
||||
S2$OFS equ S1$OFS+BYTESIZE |
|
||||
RC$OFS equ S2$OFS+BYTESIZE |
|
||||
D0$OFS equ RC$OFS+BYTESIZE |
|
||||
CR$OFS equ DR$OFS+32 |
|
||||
R0$OFS equ CR$OFS+BYTESIZE |
|
||||
R1$OFS equ R0$OFS+BYTESIZE |
|
||||
R2$OFS equ R1$OFS+BYTESIZE |
|
||||
FCB$LEN equ R2$OFS+BYTESIZE |
|
||||
|
|
||||
; Memory Locations |
|
||||
|
|
||||
BDOS equ 5 ; entry point fo BDOS function calls |
|
||||
PRIFCB equ 5Ch ; primary file control block address |
|
||||
SECFCB equ 6Ch ; secondary file control block address |
|
||||
LENFCB equ 32 ; length of file control block |
|
||||
DEFBUF equ 80h ; address of default buffer |
|
||||
|
|
||||
|
|
||||
EXIT macro |
|
||||
mvi c,TERMCPM |
|
||||
call BDOS |
|
||||
endm |
|
||||
|
|
||||
conin macro |
|
||||
push b ; save context B&C |
|
||||
push d ; save context D&E |
|
||||
push h ; save context H&L |
|
||||
mvi c,CREAD ; set up for console input BDOS call |
|
||||
call BDOS ; call BDOS function entry point |
|
||||
pop h ; restore context H&L |
|
||||
pop d ; restore context D&E |
|
||||
pop b ; restore context B&C |
|
||||
endm |
|
||||
|
|
||||
conout macro char |
|
||||
enter ; save all context regs |
|
||||
mvi c,CWRITE ; set for console output BDOS call |
|
||||
mvi e,char ; place output character in E as required |
|
||||
call bdos ; call BDOS function entry point |
|
||||
leave ; restore all context regs |
|
||||
endm |
|
||||
|
|
||||
conouta macro |
|
||||
enter |
|
||||
mvi c,CWRITE |
|
||||
mov e,a |
|
||||
call bdos |
|
||||
leave |
|
||||
endm |
|
||||
|
|
||||
PRINT macro addr |
|
||||
enter |
|
||||
mvi c,PRINTSTR |
|
||||
lxi d,addr |
|
||||
call BDOS |
|
||||
leave |
|
||||
endm |
|
||||
|
|
||||
PTRPRT macro addr |
|
||||
enter ; save all context registers |
|
||||
lxi h,addr ; load the address parameter into H&L |
|
||||
mov e,m ; pick up LO byte of new pointer |
|
||||
inx h ; bump index register |
|
||||
mov d,m ; pick up HO byte of new pointer |
|
||||
mvi c,PRINTSTR ; assembled pointer used for printstring call |
|
||||
call BDOS |
|
||||
leave ; restore all context registers |
|
||||
endm |
|
||||
|
|
||||
|
|
||||
movfcb macro destn,source |
|
||||
lxi d,destn |
|
||||
lxi h,source |
|
||||
lxi b,LENFCB |
|
||||
ldir |
|
||||
endm |
|
||||
|
|
||||
copyfcb macro fcbname,source |
|
||||
local around |
|
||||
jmp around |
|
||||
fcbname ds 32 |
|
||||
around: |
|
||||
endm |
|
||||
|
|
||||
printf macro parmdata |
|
||||
local around |
|
||||
local string |
|
||||
print string |
|
||||
jmp around |
|
||||
string db parmdata |
|
||||
db '$' |
|
||||
around: |
|
||||
endm |
|
||||
|
|
||||
printmsg macro parmdata |
|
||||
enter |
|
||||
local around |
|
||||
local string |
|
||||
print string |
|
||||
jmp around |
|
||||
string db parmdata |
|
||||
db '$' |
|
||||
around: |
|
||||
leave |
|
||||
endm |
|
||||
|
|
||||
newfcb macro fcbname,drive,filename |
|
||||
fcbname db drive,filename |
|
||||
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
|
||||
endm |
|
||||
|
|
||||
|
|
||||
; eof - cpmbdos.lib |
|
||||
|
|
||||
@ -1,684 +0,0 @@ |
|||||
/* cpmbind.h 5/21/2012 dwg - added b1f0peek and b1f0poke */ |
|
||||
/* cpmbind.h 3/16/2012 dgw - created */ |
|
||||
|
|
||||
|
|
||||
#define CR 0x0d |
|
||||
#define LF 0x0a |
|
||||
#define ESC 27 |
|
||||
|
|
||||
#define BIOSAD 0x0e600 |
|
||||
#define pTermType 0x0E679 |
|
||||
|
|
||||
/*************************/ |
|
||||
/* BIOS Memory Locations */ |
|
||||
/*************************/ |
|
||||
|
|
||||
#define CURDRV 0x00004 |
|
||||
#define BIOSAD 0x0e600 |
|
||||
|
|
||||
#define pBOOT 0x0E600 |
|
||||
#define pWBOOT 0x0E603 |
|
||||
#define pCONST 0x0E606 |
|
||||
#define pCONIN 0x0E609 |
|
||||
#define pCONOUT 0x0E60C |
|
||||
#define pLIST 0x0E60F |
|
||||
#define pPUNCH 0x0E612 |
|
||||
#define pREADER 0x0E615 |
|
||||
#define pHOME 0x0E618 |
|
||||
#define pSELDSK 0x0E61B |
|
||||
#define pSETTRK 0x0E61E |
|
||||
#define pSETSEC 0x0E621 |
|
||||
#define pSETDMA 0x0E624 |
|
||||
#define pREAD 0x0E627 |
|
||||
#define pWRITE 0x0E62A |
|
||||
#define pLISTST 0x0E62D |
|
||||
#define pSECTRN 0x0E630 |
|
||||
#define pBNKSEL 0x0E633 |
|
||||
#define pGETLU 0x0E636 |
|
||||
#define pSETLU 0x0E639 |
|
||||
#define pGETINFO 0x0E63C |
|
||||
#define pB1F0PEEK 0x0E63F |
|
||||
#define pB1F0POKE 0x0E642 |
|
||||
|
|
||||
/*
|
|
||||
|
|
||||
struct JMP { |
|
||||
unsigned char opcode; |
|
||||
unsigned int address; |
|
||||
}; |
|
||||
|
|
||||
struct BIOS { |
|
||||
struct JMP boot; |
|
||||
struct JMP wboot; |
|
||||
struct JMP const; |
|
||||
struct JMP conin; |
|
||||
struct JMP conout; |
|
||||
struct JMP list; |
|
||||
struct JMP punch; |
|
||||
struct JMP reader; |
|
||||
struct JMP home; |
|
||||
struct JMP seldsk; |
|
||||
struct JMP settrk; |
|
||||
struct JMP setsec; |
|
||||
struct JMP setdma; |
|
||||
struct JMP read; |
|
||||
struct JMP write; |
|
||||
struct JMP listst; |
|
||||
struct JMP sectrn; |
|
||||
struct JMP bnksel; |
|
||||
struct JMP getlu; |
|
||||
struct JMP setlu; |
|
||||
struct JMP getinfo; |
|
||||
struct JMP b1f0peek; |
|
||||
struct JMP b1f0poke; |
|
||||
struct JMP res1; |
|
||||
struct JMP res2; |
|
||||
|
|
||||
char rmj; |
|
||||
char rmn; |
|
||||
char rup; |
|
||||
char rtp; |
|
||||
char diskboot; |
|
||||
char bootdrive; |
|
||||
char timedate[6]; |
|
||||
char cpufreq; |
|
||||
char platform; |
|
||||
char dioplat; |
|
||||
char vduplt; |
|
||||
unsigned int romsize; |
|
||||
unsigned int ramsize; |
|
||||
char clrramdisk; |
|
||||
char dskyenable; |
|
||||
char uartenable; |
|
||||
char vduenable; |
|
||||
char fdenable; |
|
||||
char fdtrace; |
|
||||
char fdmedia; |
|
||||
char fdmediaalt; |
|
||||
char fdmauto; |
|
||||
char ideenable; |
|
||||
char idetrace; |
|
||||
char ide8bit; |
|
||||
unsigned int idecapacity; |
|
||||
char ppideenable; |
|
||||
char ppidetrace; |
|
||||
char ppide8bit; |
|
||||
unsigned int ppidecapacity; |
|
||||
char ppideslow; |
|
||||
char boottype; |
|
||||
char boot_timeout; |
|
||||
char boot_default; |
|
||||
unsigned int baudrate; |
|
||||
char clkdiv; |
|
||||
char memwait; |
|
||||
char iowait; |
|
||||
char cntlb0; |
|
||||
char cntlb1; |
|
||||
char sdenable; |
|
||||
char sdtrace; |
|
||||
unsigned int sdcapacity; |
|
||||
char sdcsio; |
|
||||
char sdcsiofast; |
|
||||
char defiobyte; |
|
||||
char termtype; |
|
||||
unsigned int revision; |
|
||||
char prpsdenable; |
|
||||
char prpsdtrace; |
|
||||
char prpsdcapacity; |
|
||||
char prpconenable; |
|
||||
unsigned int biossize; |
|
||||
}; |
|
||||
|
|
||||
*/ |
|
||||
|
|
||||
/*
|
|
||||
|
|
||||
|
|
||||
*/ |
|
||||
|
|
||||
/* bioscall.h 3/10/2012 dwg - header file for bdoscall */ |
|
||||
|
|
||||
extern char irega; |
|
||||
extern unsigned int iregbc; |
|
||||
extern unsigned int iregde; |
|
||||
extern unsigned int ireghl; |
|
||||
extern bioscall(); |
|
||||
|
|
||||
|
|
||||
/*********************/ |
|
||||
/* BDOS Declarations */ |
|
||||
/*********************/ |
|
||||
|
|
||||
#define TERMCPM 0 |
|
||||
#define CONIN 1 |
|
||||
#define CWRITE 2 |
|
||||
#define DIRCONIO 6 |
|
||||
#define PRINTSTR 9 |
|
||||
#define RDCONBUF 10 |
|
||||
#define GETCONST 11 |
|
||||
#define RETVERNUM 12 |
|
||||
#define RESDISKSYS 13 |
|
||||
#define SELECTDISK 14 |
|
||||
#define FOPEN 15 |
|
||||
#define FCLOSE 16 |
|
||||
#define SEARCHFIRST 17 |
|
||||
#define SEARCHNEXT 18 |
|
||||
#define FDELETE 19 |
|
||||
#define FREADSEQ 20 |
|
||||
#define FWRITESEQ 21 |
|
||||
#define FMAKEFILE 22 |
|
||||
#define FRENAME 23 |
|
||||
#define RETLOGINVEC 24 |
|
||||
#define RETCURRDISK 25 |
|
||||
#define SETDMAADDR 26 |
|
||||
#define GETALLOCVEC 27 |
|
||||
#define WRPROTDISK 28 |
|
||||
#define GETROVECTOR 29 |
|
||||
#define FSETATTRIB 30 |
|
||||
#define GETDPBADDR 31 |
|
||||
#define SETGETUSER 32 |
|
||||
#define FREADRANDOM 33 |
|
||||
#define FWRITERAND 34 |
|
||||
#define FCOMPSIZE 35 |
|
||||
#define SETRANDREC 36 |
|
||||
#define RESETDRIVE 37 |
|
||||
#define WRRANDFILL 38 |
|
||||
|
|
||||
#define DRIVEA 0 |
|
||||
|
|
||||
/* bdoscall.h 3/10/2012 dwg - header file for bdoscall */ |
|
||||
|
|
||||
extern char drega; |
|
||||
extern unsigned int dregbc; |
|
||||
extern unsigned int dregde; |
|
||||
extern unsigned int dreghl; |
|
||||
extern bdoscall(); |
|
||||
|
|
||||
/* std.h 3/11/2012 dwg - c version of std.asm */ |
|
||||
|
|
||||
#define TERM_TTY 0 |
|
||||
#define TERM_ANSI 1 |
|
||||
#define TERM_WYSE 2 |
|
||||
#define TERM_VT52 3 |
|
||||
|
|
||||
#define DEV_MD 0x00 |
|
||||
#define DEV_FD 0x10 |
|
||||
#define DEV_IDE 0x20 |
|
||||
#define DEV_ATAPI 0x30 |
|
||||
#define DEV_PPIDE 0x40 |
|
||||
#define DEV_SD 0x50 |
|
||||
#define DEV_PRPSD 0x60 |
|
||||
#define DEV_PPPSD 0x70 |
|
||||
#define DEV_HDSK 0x80 |
|
||||
|
|
||||
#define PLT_N8VEM 1 |
|
||||
#define PLT_ZETA 2 |
|
||||
#define PLT_N8 3 |
|
||||
|
|
||||
|
|
||||
/*
|
|
||||
|
|
||||
|
|
||||
; std.lib 2/21/2012 dwg - added TERM$VT52 |
|
||||
|
|
||||
; TRUE equ 1 |
|
||||
; FALSE equ 00 |
|
||||
; |
|
||||
; PRIMARY HARDWARE PLATFORMS |
|
||||
; PLT$N8VEM equ 1 ; N8VEM ECB Z80 SBC |
|
||||
; PLT$ZETA equ 2 ; ZETA Z80 SBC |
|
||||
; PLT$N8 equ 3 ; N8 (HOME COMPUTER) Z180 SBC |
|
||||
; |
|
||||
; BOOT STYLE |
|
||||
; BT$MENU equ 1 ; WAIT FOR MENU SELECTION AT LOADER PROMPT |
|
||||
; BT$AUTO equ 2 ; AUTO SELECT BOOT$DEFAULT AFTER BOOT$TIMEOUT |
|
||||
; |
|
||||
; VDU PLATFORM SELECTIONS |
|
||||
; |
|
||||
; |
|
||||
; VDUPLT$NONE equ 0 ; NO VDU |
|
||||
; VDUPLT$VDU equ 1 ; ORIGINAL ECB VDU (6545 CHIP) |
|
||||
; VDUPLT$VDUC equ 2 ; ECB VDU COLOR (PENDING HARDWARE DEVELOPMENT) |
|
||||
; VDUPLT$PROPIO equ 3 ; ECB PROPIO (NOT IMPLEMENTED) |
|
||||
; VDUPLT$N8 equ 4 ; N8 ONBOARD VIDEO SUBSYSTEM (NOT IMPLEMENTED) |
|
||||
; |
|
||||
; RAM DISK INITIALIZATION OPTIONS |
|
||||
; CLR$NEVER equ 0 ; NEVER CLEAR RAM DISK |
|
||||
; CLR$AUTO equ 1 ; CLEAR RAM DISK IF INVALID DIR ENTRIES |
|
||||
; CLR$ALWAYS equ 2 ; ALWAYS CLEAR RAM DISK |
|
||||
; |
|
||||
; |
|
||||
; ; DISK MAP SELECTION OPTIONS |
|
||||
; |
|
||||
; DM$ROM equ 1 ; ROM DRIVE PRIORITY |
|
||||
; DM$RAM equ 2 ; RAM DRIVE PRIORITY |
|
||||
; DM$FD equ 3 ; FLOPPY DRIVE PRIORITY |
|
||||
; DM$IDE equ 4 ; IDE DRIVE PRIORITY |
|
||||
; DM$PPIDE equ 5 ; PPIDE DRIVE PRIORITY |
|
||||
; DM$SD equ 6 ; SD DRIVE PRIORITY |
|
||||
; DM$PRPSD equ 7 ; PROPIO SD DRIVE PRIORITY |
|
||||
; |
|
||||
; |
|
||||
; ; FLOPPY DISK MEDIA SELECTIONS (ID'S MUST BE INDEX OF ENTRY IN FCD$TBL) |
|
||||
; |
|
||||
; |
|
||||
; FDM720 equ 0 ; 3.5" FLOPPY, 720KB, 2 SIDES, 80 TRKS, 9 SECTORS |
|
||||
; FDM144 equ 1 ; 3.5" FLOPPY, 1.44MB, 2 SIDES, 80 TRKS, 18 SECTORS |
|
||||
; FDM360 equ 2 ; 5.25" FLOPPY, 360KB, 2 SIDES, 40 TRKS, 9 SECTORS |
|
||||
; FDM120 equ 3 ; 3.5" FLOPPY, 1.2MB, 2 SIDES, 80 TRKS, 15 SECTORS |
|
||||
; |
|
||||
; |
|
||||
; ; DISK PLATFORM SELECTIONS |
|
||||
; |
|
||||
; DIOPLT$NONE equ 0 ; NO DISK IO HARDWARE |
|
||||
; DIOPLT$DISKIO equ 1 ; N8VEM ECB DISK IO BOARD |
|
||||
; DIOPLT$ZETA equ 2 ; ZETA BUILT-IN DISK IO SECTION |
|
||||
; DIOPLT$DIDE equ 3 ; N8VEM ECB DUAL IDE W/ FLOPPY BOARD |
|
||||
; DIOPLT$N8 equ 4 ; N8 BUILT-IN DISK IO SECTION |
|
||||
; DIOPLT$DISKIO3 equ 5 ; N8VEM ECB DISK IO V3 BOARD |
|
||||
; |
|
||||
; CONSOLE DEVICE CHOICES FOR LDRCON AND DBGCON IN CONFIG SETTINGS |
|
||||
; |
|
||||
; CON$UART equ 1 |
|
||||
; CON$VDU equ 2 |
|
||||
; CON$PRP equ 3 |
|
||||
; |
|
||||
; CONSOLE TERMINAL TYPE CHOICES |
|
||||
; |
|
||||
TERM$TTY equ 0 |
|
||||
TERM$ANSI equ 1 |
|
||||
TERM$WYSE equ 2 |
|
||||
TERM$VT52 equ 3 |
|
||||
; |
|
||||
; |
|
||||
; ; SYSTEM GENERATION SETTINGS |
|
||||
; |
|
||||
; SYS$CPM equ 1 ; CPM (IMPLIES BDOS + CCP) |
|
||||
; SYS$ZSYS equ 2 ; ZSYSTEM OS (IMPLIES ZSDOS + ZCPR) |
|
||||
; |
|
||||
; DOS$BDOS equ 1 ; BDOS |
|
||||
; DOS$ZDDOS equ 2 ; ZDDOS VARIANT OF ZSDOS |
|
||||
; DOS$ZSDOS equ 3 ; ZSDOS |
|
||||
; |
|
||||
; CP$CCP equ 1 ; CCP COMMAND PROCESSOR |
|
||||
; CP$ZCPR equ 2 ; ZCPR COMMAND PROCESSOR |
|
||||
; |
|
||||
; CONFIGURE DOS (DOS) AND COMMAND PROCESSOR (CP) BASED ON SYSTEM SETTING (SYS) |
|
||||
; |
|
||||
; |
|
||||
; #IFNDEF BLD$SYS |
|
||||
; SYS equ SYS$CPM |
|
||||
; #ELSE |
|
||||
; SYS equ BLD$SYS |
|
||||
; #ENDIF |
|
||||
; |
|
||||
; #IF (SYS == SYS$CPM) |
|
||||
; DOS equ DOS$BDOS |
|
||||
; CP equ CP$CCP |
|
||||
; #DEFINE OSLBL "CP/M-80 2.2C" |
|
||||
; #ENDIF |
|
||||
; |
|
||||
; #IF (SYS == SYS$ZSYS) |
|
||||
; DOS equ DOS$ZSDOS |
|
||||
; CP equ CP$ZCPR |
|
||||
; #DEFINE OSLBL "ZSYSTEM (ZSDOS 1.2, ZCPR 1.0)" |
|
||||
; #ENDIF |
|
||||
; |
|
||||
; |
|
||||
; ; INCLUDE VERSION AND BUILD SETTINGS |
|
||||
; |
|
||||
; #INCLUDE "ver.inc" ; ADD BIOSVER |
|
||||
; |
|
||||
; |
|
||||
; #INCLUDE "build.inc" ; INCLUDE USER CONFIG, ADD VARIANT, TIMESTAMP, & ROMSIZE |
|
||||
; |
|
||||
; |
|
||||
; #IF (PLATFORM NE PLT$N8) |
|
||||
; |
|
||||
; |
|
||||
; ; N8VEM HARDWARE IO PORT ADDRESSES AND MEMORY LOCATIONS |
|
||||
; MPCL$RAM equ 78H ; BASE IO ADDRESS OF RAM MEMORY PAGER CONFIGURATION LATCH |
|
||||
; MPCL$ROM equ 7CH ; BASE IO ADDRESS OF ROM MEMORY PAGER CONFIGURATION LATCH |
|
||||
; |
|
||||
; |
|
||||
; ; HARDWARE INTERFACES |
|
||||
; |
|
||||
; PIO 82C55 I/O IS DECODED TO PORT 60-67 |
|
||||
; PIOA equ 60H ; PORT A |
|
||||
; PIOB equ 61H ; PORT B |
|
||||
; PIOC equ 62H ; PORT C |
|
||||
; PIOX equ 63H ; PIO CONTROL PORT |
|
||||
; |
|
||||
; 16C550 SERIAL LINE UART |
|
||||
; |
|
||||
; SIO$BASE equ 68H |
|
||||
; SIO$RBR equ SIO$BASE + 0 ; DLAB=0: RCVR BUFFER REG (READ ONLY) |
|
||||
; SIO$THR equ SIO$BASE + 0 ; DLAB=0: XMIT HOLDING REG (WRITE ONLY) |
|
||||
; SIO$IER equ SIO$BASE + 1 ; DLAB=0: INT ENABLE REG |
|
||||
; SIO$IIR equ SIO$BASE + 2 ; INT IDENT REGISTER (READ ONLY) |
|
||||
; SIO$FCR equ SIO$BASE + 2 ; FIFO CONTROL REG (WRITE ONLY) |
|
||||
; SIO$LCR equ SIO$BASE + 3 ; LINE CONTROL REG |
|
||||
; SIO$MCR equ SIO$BASE + 4 ; MODEM CONTROL REG |
|
||||
; SIO$LSR equ SIO$BASE + 5 ; LINE STATUS REG |
|
||||
; SIO$MSR equ SIO$BASE + 6 ; MODEM STATUS REG |
|
||||
; SIO$SCR equ SIO$BASE + 7 ; SCRATCH REGISTER |
|
||||
; SIO$DLL equ SIO$BASE + 0 ; DLAB=1: DIVISOR LATCH (LS) |
|
||||
; SIO$DLM equ SIO$BASE + 1 ; DLAB=1: DIVISOR LATCH (MS) |
|
||||
; #ENDIF ; (PLATFORM NE PLT$N8) |
|
||||
; |
|
||||
; |
|
||||
; #IF (PLATFORM NE PLT$N8) |
|
||||
; |
|
||||
; |
|
||||
; ; Z180 REGISTERS |
|
||||
; |
|
||||
; |
|
||||
; CPU$IOBASE equ 40H ; ONLY RELEVANT FOR Z180 |
|
||||
; CPU$CNTLA0 equ CPU$IOBASE+$00 ;ASCI0 control A |
|
||||
; CPU$CNTLA1 equ CPU$IOBASE+$01 ;ASCI1 control A |
|
||||
; CPU$CNTLB0 equ CPU$IOBASE+$02 ;ASCI0 control B |
|
||||
; CPU$CNTLB1 equ CPU$IOBASE+$03 ;ASCI1 control B |
|
||||
; CPU$STAT0 equ CPU$IOBASE+$04 ;ASCI0 status |
|
||||
; CPU$STAT1 equ CPU$IOBASE+$05 ;ASCI1 status |
|
||||
; CPU$TDR0 equ CPU$IOBASE+$06 ;ASCI0 transmit |
|
||||
; CPU$TDR1 equ CPU$IOBASE+$07 ;ASCI1 transmit |
|
||||
; CPU$RDR0 equ CPU$IOBASE+$08 ;ASCI0 receive |
|
||||
; CPU$RDR1 equ CPU$IOBASE+$09 ;ASCI1 receive |
|
||||
; CPU$CNTR equ CPU$IOBASE+$0A ;CSI/O control |
|
||||
; CPU$TRDR equ CPU$IOBASE+$0B ;CSI/O transmit/receive |
|
||||
; CPU$TMDR0L equ CPU$IOBASE+$0C ;Timer 0 data lo |
|
||||
; CPU$TMDR0H equ CPU$IOBASE+$0D ;Timer 0 data hi |
|
||||
; CPU$RLDR0L equ CPU$IOBASE+$0E ;Timer 0 reload lo |
|
||||
; CPU$RLDR0H equ CPU$IOBASE+$0F ;Timer 0 reload hi |
|
||||
; CPU$TCR equ CPU$IOBASE+$10 ;Timer control |
|
||||
; CPU$ASEXT0 equ CPU$IOBASE+$12 ;ASCI0 extension control (Z8S180) |
|
||||
; CPU$ASEXT1 equ CPU$IOBASE+$13 ;ASCI1 extension control (Z8S180) |
|
||||
; CPU$TMDR1L equ CPU$IOBASE+$14 ;Timer 1 data lo |
|
||||
; CPU$TMDR1H equ CPU$IOBASE+$15 ;Timer 1 data hi |
|
||||
; CPU$RLDR1L equ CPU$IOBASE+$16 ;Timer 1 reload lo |
|
||||
; CPU$RLDR1H equ CPU$IOBASE+$17 ;Timer 1 reload hi |
|
||||
; CPU$FRC equ CPU$IOBASE+$18 ;Free running counter |
|
||||
; CPU$ASTC0L equ CPU$IOBASE+$1A ;ASCI0 Time constant lo (Z8S180) |
|
||||
; CPU$ASTC0H equ CPU$IOBASE+$1B ;ASCI0 Time constant hi (Z8S180) |
|
||||
; CPU$ASTC1L equ CPU$IOBASE+$1C ;ASCI1 Time constant lo (Z8S180) |
|
||||
; CPU$ASTC1H equ CPU$IOBASE+$1D ;ASCI1 Time constant hi (Z8S180) |
|
||||
; CPU$CMR equ CPU$IOBASE+$1E ;Clock multiplier (latest Z8S180) |
|
||||
; CPU$CCR equ CPU$IOBASE+$1F ;CPU control (Z8S180) |
|
||||
; CPU$SAR0L equ CPU$IOBASE+$20 ;DMA0 source addr lo |
|
||||
; CPU$SAR0H equ CPU$IOBASE+$21 ;DMA0 source addr hi |
|
||||
; CPU$SAR0B equ CPU$IOBASE+$22 ;DMA0 source addr bank |
|
||||
; CPU$DAR0L equ CPU$IOBASE+$23 ;DMA0 dest addr lo |
|
||||
; CPU$DAR0H equ CPU$IOBASE+$24 ;DMA0 dest addr hi |
|
||||
; CPU$DAR0B equ CPU$IOBASE+$25 ;DMA0 dest addr bank |
|
||||
; CPU$BCR0L equ CPU$IOBASE+$26 ;DMA0 byte count lo |
|
||||
; CPU$BCR0H equ CPU$IOBASE+$27 ;DMA0 byte count hi |
|
||||
; CPU$MAR1L equ CPU$IOBASE+$28 ;DMA1 memory addr lo |
|
||||
; CPU$MAR1H equ CPU$IOBASE+$29 ;DMA1 memory addr hi |
|
||||
; CPU$MAR1B equ CPU$IOBASE+$2A ;DMA1 memory addr bank |
|
||||
; CPU$IAR1L equ CPU$IOBASE+$2B ;DMA1 I/O addr lo |
|
||||
; CPU$IAR1H equ CPU$IOBASE+$2C ;DMA1 I/O addr hi |
|
||||
; CPU$IAR1B equ CPU$IOBASE+$2D ;DMA1 I/O addr bank (Z8S180) |
|
||||
; CPU$BCR1L equ CPU$IOBASE+$2E ;DMA1 byte count lo |
|
||||
; CPU$BCR1H equ CPU$IOBASE+$2F ;DMA1 byte count hi |
|
||||
; CPU$DSTAT equ CPU$IOBASE+$30 ;DMA status |
|
||||
; CPU$DMODE equ CPU$IOBASE+$31 ;DMA mode |
|
||||
; CPU$DCNTL equ CPU$IOBASE+$32 ;DMA/WAIT control |
|
||||
; CPU$IL equ CPU$IOBASE+$33 ;Interrupt vector load |
|
||||
; CPU$ITC equ CPU$IOBASE+$34 ;INT/TRAP control |
|
||||
; CPU$RCR equ CPU$IOBASE+$36 ;Refresh control |
|
||||
; CPU$CBR equ CPU$IOBASE+$38 ;MMU common base register |
|
||||
; CPU$BBR equ CPU$IOBASE+$39 ;MMU bank base register |
|
||||
; CPU$CBAR equ CPU$IOBASE+$3A ;MMU common/bank area register |
|
||||
; CPU$OMCR equ CPU$IOBASE+$3E ;Operation mode control |
|
||||
; CPU$ICR equ $3F ;I/O control register (not relocated) |
|
||||
; |
|
||||
; N8 ONBOARD I/O REGISTERS |
|
||||
; N8$IOBASE equ $80 |
|
||||
; PIO equ N8$IOBASE+$00 |
|
||||
; PIOA equ PIO+$00 ; PORT A |
|
||||
; PIOB equ PIO+$01 ; PORT B |
|
||||
; PIOC equ PIO+$02 ; PORT C |
|
||||
; PIOX equ PIO+$03 ; PIO CONTROL PORT |
|
||||
; PIO2 equ N8$IOBASE+$04 |
|
||||
; PIO2A equ PIO2+$00 ; PORT A |
|
||||
; PIO2B equ PIO2+$01 ; PORT B |
|
||||
; PIO2C equ PIO2+$02 ; PORT C |
|
||||
; PIO2X equ PIO2+$03 ; PIO CONTROL PORT |
|
||||
; |
|
||||
; RTC equ N8$IOBASE+$08 ;RTC latch and buffer |
|
||||
; FDC equ N8$IOBASE+$0C ;Floppy disk controller |
|
||||
; UTIL equ N8$IOBASE+$10 ;Floppy disk utility |
|
||||
; ACR equ N8$IOBASE+$14 ;auxillary control register |
|
||||
; RMAP equ N8$IOBASE+$16 ;ROM page register |
|
||||
; VDP equ N8$IOBASE+$18 ;Video Display Processor (TMS9918A) |
|
||||
; PSG equ N8$IOBASE+$1C ;Programmable Sound Generator (AY-3-8910) |
|
||||
; |
|
||||
; DEFACR equ $1B |
|
||||
; |
|
||||
; #ENDIF |
|
||||
; |
|
||||
; |
|
||||
; ; CHARACTER DEVICE FUNCTIONS |
|
||||
; |
|
||||
; |
|
||||
; CF$INIT equ 0 |
|
||||
; CF$IN equ 1 |
|
||||
; CF$IST equ 2 |
|
||||
; CF$OUT equ 3 |
|
||||
; CF$OST equ 4 |
|
||||
; |
|
||||
; DISK OPERATIONS |
|
||||
; DOP$READ equ 0 ; READ OPERATION |
|
||||
; DOP$WRITE equ 1 ; WRITE OPERATION |
|
||||
; DOP$FORMAT equ 2 ; FORMAT OPERATION |
|
||||
; DOP$READID equ 3 ; READ ID OPERATION |
|
||||
; |
|
||||
; DISK DRIVER FUNCTIONS |
|
||||
; DF$READY equ 1 |
|
||||
; DF$SELECT equ 2 |
|
||||
; DF$READ equ 3 |
|
||||
; DF$WRITE equ 4 |
|
||||
; DF$FORMAT equ 5 |
|
||||
; |
|
||||
; DISK DEVICES (ONLY FIRST NIBBLE RELEVANT, SECOND NIBBLE MUST BE ZERO) |
|
||||
; DEV$MD equ 000H |
|
||||
; DEV$FD equ 010H |
|
||||
; DEV$IDE equ 020H |
|
||||
; DEV$ATAPI equ 030H |
|
||||
; DEV$PPIDE equ 040H |
|
||||
; DEV$SD equ 050H |
|
||||
; DEV$PRPSD equ 060H |
|
||||
; |
|
||||
; IMG$START equ 00000H ; IMMUTABLE: ROM IMAGE AREA START |
|
||||
; IMG$END equ 08000H ; IMMUTABLE: ROM IMAGE AREA END |
|
||||
; |
|
||||
; PG0$LOC equ 00000H ; IMMUTABLE |
|
||||
; PG0$SIZ equ 00100H ; IMMUTABLE |
|
||||
; PG0$END equ PG0$LOC + PG0$SIZ |
|
||||
; PG0$IMG equ IMG$START ; IMMUTABLE |
|
||||
; LDR$LOC equ PG0$END |
|
||||
; LDR$SIZ equ 02000H - PG0$SIZ ; CONFIGURABLE |
|
||||
; LDR$END equ LDR$LOC + LDR$SIZ |
|
||||
; LDR$IMG equ PG0$IMG + PG0$SIZ |
|
||||
; CPM$LOC equ 0D000H ; CONFIGURABLE: LOCATION OF CPM FOR RUNNING SYSTEM |
|
||||
; CPM$END equ 10000H ; IMMUTABLE: TOP OF MEMORY |
|
||||
; CPM$SIZ equ CPM$END - CPM$LOC ; SIZE OF CPM IMAGE (CCP + BDOS + CBIOS (INCLUDING DATA)) |
|
||||
; CPM$ENT equ CPM$LOC + 01600H ; IMMUTABLE: CPM ENTRY POINT |
|
||||
; CPM$IMG equ LDR$IMG + LDR$SIZ ; START OF CONCATENATED CPM IMAGE |
|
||||
; DAT$SIZ equ DATASIZE ; FROM CONFIG FILE |
|
||||
; DAT$END equ CPM$END |
|
||||
; DAT$LOC equ DAT$END - DAT$SIZ |
|
||||
; BIOS$LOC equ CPM$ENT |
|
||||
; BIOS$END equ DAT$LOC |
|
||||
; BIOS$SIZ equ DAT$LOC - CPM$ENT |
|
||||
; MON$IMG equ CPM$IMG + CPM$SIZ ; LOCATION OF MONITOR BINARY IMAGE IN ROM |
|
||||
; MON$LOC equ 08000H ; LOCATION OF MONITOR FOR RUNNING SYSTEM |
|
||||
; MON$SIZ equ 01000H ; SIZE OF MONITOR BINARY IMAGE |
|
||||
; MON$END equ MON$LOC + MON$SIZ |
|
||||
; MON$DSKY equ MON$LOC ; MONITOR ENTRY (DSKY) |
|
||||
; MON$UART equ MON$LOC + 3 ; MONITOR ENTRY (UART) |
|
||||
; ROMX$LOC equ MON$IMG + MON$SIZ ; LOCATION OF ROM EXTENSION CODE |
|
||||
; |
|
||||
; |
|
||||
; ROMX$SIZ equ 02000H ; FIXED |
|
||||
; ROMX$END equ ROMX$LOC + ROMX$SIZ |
|
||||
; |
|
||||
; |
|
||||
; VDU$LOC equ ROMX$LOC + 0 ; LOCATION OF ROM VDU DRIVER |
|
||||
; |
|
||||
; |
|
||||
; CBIOS$BOOT equ BIOS$LOC + 0 |
|
||||
; CBIOS$WBOOT equ BIOS$LOC + 3 |
|
||||
; CBIOS$CONST equ BIOS$LOC + 6 |
|
||||
; CBIOS$CONIN equ BIOS$LOC + 9 |
|
||||
; CBIOS$CONOUT equ BIOS$LOC + 12 |
|
||||
; CBIOS$LIST equ BIOS$LOC + 15 |
|
||||
; CBIOS$PUNCH equ BIOS$LOC + 18 |
|
||||
; CBIOS$READER equ BIOS$LOC + 21 |
|
||||
; CBIOS$HOME equ BIOS$LOC + 24 |
|
||||
; CBIOS$SELDSK equ BIOS$LOC + 27 |
|
||||
; CBIOS$SETTRK equ BIOS$LOC + 30 |
|
||||
; CBIOS$SETSEC equ BIOS$LOC + 33 |
|
||||
; CBIOS$SETDMA equ BIOS$LOC + 36 |
|
||||
; CBIOS$READ equ BIOS$LOC + 39 |
|
||||
; CBIOS$WRITE equ BIOS$LOC + 42 |
|
||||
; CBIOS$LISTST equ BIOS$LOC + 45 |
|
||||
; CBIOS$SECTRN equ BIOS$LOC + 48 |
|
||||
; |
|
||||
; MEMORY CONFIGURATION |
|
||||
; |
|
||||
; MSIZE equ 59 ; CP/M VERSION MEMORY SIZE IN KILOBYTES |
|
||||
; |
|
||||
; "BIAS" IS ADDRESS OFFSET FROM 3400H FOR MEMORY SYSTEMS |
|
||||
; ; THAN 16K (REFERRED TO AS "B" THROUGHOUT THE TEXT) |
|
||||
; |
|
||||
; BIAS equ (MSIZE-20)*1024 |
|
||||
; CCP equ 3400H+BIAS ; BASE OF CCP |
|
||||
; BDOS equ CCP+806H ; BASE OF BDOS |
|
||||
; BIOS equ CCP+1600H ; BASE OF BIOS |
|
||||
; CCPSIZ equ 00800H |
|
||||
; |
|
||||
; #IF (PLATFORM == PLT$N8VEM) |
|
||||
; |
|
||||
; |
|
||||
; ; #DEFINE PLATFORM$NAME "N8VEM Z80 SBC" |
|
||||
; |
|
||||
; |
|
||||
; ; #ENDIF |
|
||||
; |
|
||||
; |
|
||||
; ; #IF (PLATFORM == PLT$ZETA) |
|
||||
; ; #DEFINE PLATFORM$NAME "ZETA Z80 SBC" |
|
||||
; ; #ENDIF |
|
||||
; |
|
||||
; |
|
||||
; ; #IF (PLATFORM == PLT$N8) |
|
||||
; ; #DEFINE PLATFORM$NAME "N8 Z180 SBC" |
|
||||
; ; #ENDIF |
|
||||
; |
|
||||
; #IF (DSKYENABLE) |
|
||||
; ; #DEFINE DSKYLBL ", DSKY" |
|
||||
; ; #ELSE |
|
||||
; ; #DEFINE DSKYLBL "" |
|
||||
; ; #ENDIF |
|
||||
; |
|
||||
; #IF (VDUENABLE) |
|
||||
; #DEFINE VDULBL ", VDU" |
|
||||
; #ELSE |
|
||||
; #DEFINE VDULBL "" |
|
||||
; #ENDIF |
|
||||
; |
|
||||
; #IF (DIOPLT NE DIOPLT$NONE) |
|
||||
; |
|
||||
; |
|
||||
; #IF (DIOPLT EQ DIOPLT$DISKIO) |
|
||||
; #DEFINE DIOLBL ", DISKIO" |
|
||||
; #ENDIF |
|
||||
; |
|
||||
; |
|
||||
; #IF (DIOPLT EQ DIOPLT$ZETA) |
|
||||
; #DEFINE DIOLBL "" |
|
||||
; #ENDIF |
|
||||
; |
|
||||
; |
|
||||
; #IF (DIOPLT EQ DIOPLT$DIDE) |
|
||||
; #DEFINE DIOLBL ", DUALIDE" |
|
||||
; #ENDIF |
|
||||
; |
|
||||
; |
|
||||
; #IF (DIOPLT EQ DIOPLT$N8) |
|
||||
; #DEFINE DIOLBL "" |
|
||||
; #ENDIF |
|
||||
; |
|
||||
; #IF (DIOPLT EQ DIOPLT$DISKIO3) |
|
||||
; #DEFINE DIOLBL ", DISKIO-V3" |
|
||||
; #ENDIF |
|
||||
; |
|
||||
; #ELSE |
|
||||
; #DEFINE DIOLBL "" |
|
||||
; #ENDIF |
|
||||
; |
|
||||
; |
|
||||
; ; #ENDIF |
|
||||
; |
|
||||
; |
|
||||
; #IF (FDENABLE) |
|
||||
; #IF (FDMAUTO) |
|
||||
; #DEFINE FDLBL ", FLOPPY (AUTOSIZE)" |
|
||||
; #ELSE |
|
||||
; #IF (FDMEDIA == FDM720) |
|
||||
; #DEFINE FDLBL ", FLOPPY (720KB)" |
|
||||
; #ENDIF |
|
||||
; #IF (FDMEDIA == FDM144) |
|
||||
; #DEFINE FDLBL ", FLOPPY (1.44MB)" |
|
||||
; #ENDIF |
|
||||
; #ENDIF |
|
||||
; #ELSE |
|
||||
; #DEFINE FDLBL "" |
|
||||
; #ENDIF |
|
||||
; |
|
||||
; |
|
||||
; #IF (IDEENABLE) |
|
||||
; #DEFINE IDELBL ", IDE" |
|
||||
; #ELSE |
|
||||
; #DEFINE IDELBL "" |
|
||||
; #ENDIF |
|
||||
; |
|
||||
; |
|
||||
; #IF (PPIDEENABLE) |
|
||||
; #DEFINE PPIDELBL ", PPIDE" |
|
||||
; #ELSE |
|
||||
; #DEFINE PPIDELBL "" |
|
||||
; #ENDIF |
|
||||
; |
|
||||
; #IF (SDENABLE) |
|
||||
; #DEFINE SDLBL ", SD CARD" |
|
||||
; #ELSE |
|
||||
; #DEFINE SDLBL "" |
|
||||
; #ENDIF |
|
||||
; |
|
||||
; |
|
||||
; #IF (PRPSDENABLE) |
|
||||
; #DEFINE PRPSDLBL ", PROPIO SD CARD" |
|
||||
; #ELSE |
|
||||
; #DEFINE PRPSDLBL "" |
|
||||
; #ENDIF |
|
||||
; |
|
||||
; |
|
||||
; ; .ECHO "Configuration: " |
|
||||
; ; .ECHO PLATFORM$NAME |
|
||||
; ; .ECHO DSKYLBL |
|
||||
; ; .ECHO VDULBL |
|
||||
; ; .ECHO DIOLBL |
|
||||
; ; .ECHO FDLBL |
|
||||
; ; .ECHO IDELBL |
|
||||
; ; .ECHO PPIDELBL |
|
||||
; ; .ECHO SDLBL |
|
||||
; ; .ECHO PRPSDLBL |
|
||||
; ; .ECHO "\n" |
|
||||
; ; |
|
||||
; |
|
||||
; eof - std.lib |
|
||||
|
|
||||
*/ |
|
||||
|
|
||||
@ -1,104 +0,0 @@ |
|||||
/* cpmbios.h 6/ 4/2012 dwg - added bootlu */ |
|
||||
/* cpmbios.h 3/11/2012 dwg - added CURDRV */ |
|
||||
|
|
||||
/*************************/ |
|
||||
/* BIOS Memory Locations */ |
|
||||
/*************************/ |
|
||||
|
|
||||
#define CURDRV 0x00004 |
|
||||
#define BIOSAD 0x0e600 |
|
||||
|
|
||||
#define pBOOT 0x0E600 |
|
||||
#define pWBOOT 0x0E603 |
|
||||
#define pCONST 0x0E606 |
|
||||
#define pCONIN 0x0E609 |
|
||||
#define pCONOUT 0x0E60C |
|
||||
#define pLIST 0x0E60F |
|
||||
#define pPUNCH 0x0E612 |
|
||||
#define pREADER 0x0E615 |
|
||||
#define pHOME 0x0E618 |
|
||||
#define pSELDSK 0x0E61B |
|
||||
#define pSETTRK 0x0E61E |
|
||||
#define pSETSEC 0x0E621 |
|
||||
#define pSETDMA 0x0E624 |
|
||||
#define pREAD 0x0E627 |
|
||||
#define pWRITE 0x0E62A |
|
||||
#define pLISTST 0x0E62D |
|
||||
#define pSECTRN 0x0E630 |
|
||||
#define pBNKSEL 0x0E633 |
|
||||
#define pGETLU 0x0E636 |
|
||||
#define pSETLU 0x0E639 |
|
||||
#define pGETINFO 0x0E63C |
|
||||
|
|
||||
struct JMP { |
|
||||
unsigned char opcode; |
|
||||
unsigned int address; |
|
||||
}; |
|
||||
|
|
||||
struct BIOS { |
|
||||
struct JMP boot; |
|
||||
struct JMP wboot; |
|
||||
struct JMP const; |
|
||||
struct JMP conin; |
|
||||
struct JMP conout; |
|
||||
struct JMP list; |
|
||||
struct JMP punch; |
|
||||
struct JMP reader; |
|
||||
struct JMP home; |
|
||||
struct JMP seldsk; |
|
||||
struct JMP settrk; |
|
||||
struct JMP setsec; |
|
||||
struct JMP setdma; |
|
||||
struct JMP read; |
|
||||
struct JMP write; |
|
||||
struct JMP listst; |
|
||||
struct JMP sectrn; |
|
||||
struct JMP bnksel; |
|
||||
struct JMP getlu; |
|
||||
struct JMP setlu; |
|
||||
struct JMP getinfo; |
|
||||
struct JMP rsvd1; |
|
||||
struct JMP rsvd2; |
|
||||
struct JMP rsvd3; |
|
||||
struct JMP rsvd4; |
|
||||
|
|
||||
/* char diskboot;
|
|
||||
char bootdrive; |
|
||||
int bootlu; */ |
|
||||
|
|
||||
char rmj; |
|
||||
char rmn; |
|
||||
char rup; |
|
||||
char rtp; |
|
||||
}; |
|
||||
|
|
||||
|
|
||||
struct DPH { |
|
||||
unsigned int xlt; |
|
||||
unsigned int rv1; |
|
||||
unsigned int rv2; |
|
||||
unsigned int rv3; |
|
||||
unsigned int dbf; |
|
||||
unsigned int dpb; |
|
||||
unsigned int csv; |
|
||||
unsigned int alv; |
|
||||
unsigned char sigl; |
|
||||
unsigned char sigu; |
|
||||
unsigned int current; |
|
||||
unsigned int number; |
|
||||
}; |
|
||||
|
|
||||
struct DPB { |
|
||||
unsigned int spt; |
|
||||
unsigned char bsh; |
|
||||
unsigned char blm; |
|
||||
unsigned char exm; |
|
||||
unsigned int dsm; |
|
||||
unsigned int drm; |
|
||||
unsigned char al0; |
|
||||
unsigned char al1; |
|
||||
unsigned int cks; |
|
||||
unsigned int off; |
|
||||
}; |
|
||||
|
|
||||
|
|
||||
@ -1,137 +0,0 @@ |
|||||
; cpmbios.lib 2/20/2012 dwg - get$off, get$drm, and get$spt need c=drvnum |
|
||||
; cpmbios.lib 12/26/2011 dwg - |
|
||||
|
|
||||
; Copyright (C) 2011-2012 Douglas Goodall All Rights Reserved. |
|
||||
; For non-commercial use by N8VEM community |
|
||||
|
|
||||
XLT$OFS equ 0 ; Translate Table |
|
||||
RV1$OFS equ XLT$OFS+WORDSIZE ; Reserved Field 1 |
|
||||
RV2$OFS equ RV1$OFS+WORDSIZE ; Reserved Field 2 |
|
||||
RV3$OFS equ RV2$OFS+WORDSIZE ; Reserved Field 3 |
|
||||
DBF$OFS equ RV3$OFS+WORDSIZE ; Directory Buffer |
|
||||
DPB$OFS equ DBF$OFS+WORDSIZE ; Diskk Parameter Block Pointer |
|
||||
CSV$OFS equ DPB$OFS+WORDSIZE ; Checksum Vector |
|
||||
ALV$OFS equ CSV$OFS+WORDSIZE ; Allocation Vector |
|
||||
DPH$LEN equ ALV$OFS+WORDSIZE ; size of normal DPH |
|
||||
LU1$OFS equ ALV$OFS+WORDSIZE ; Logical Unit Signature Byte 1 'L' |
|
||||
LU2$OFS equ LU1$OFS+BYTESIZE ; Logical Unit Signature Byte 2 'U' |
|
||||
CUR$OFS equ LU2$OFS+BYTESIZE ; Current Logical Unit (default) |
|
||||
NLU$OFS equ CUR$OFS+WORDSIZE ; Number of LU's (capacity/9) |
|
||||
|
|
||||
|
|
||||
SPT$OFS equ 0 ; Sectors Per Track |
|
||||
BSH$OFS equ SPT$OFS+WORDSIZE ; Block Shift Factor |
|
||||
BLM$OFS equ BSH$OFS+BYTESIZE ; Data Allocation Block Mask |
|
||||
EXM$OFS equ BLM$OFS+BYTESIZE ; Extend Mask |
|
||||
DSM$OFS equ EXM$OFS+BYTESIZE ; Disk Size Max |
|
||||
DRM$OFS equ DSM$OFS+WORDSIZE ; Number of Directory Entries |
|
||||
AL0$OFS equ DRM$OFS+WORDSIZE ; Allocation bitmask for directories |
|
||||
AL1$OFS equ AL0$OFS+BYTESIZE ; Allocation bitmask for directories |
|
||||
CKS$OFS equ AL1$OFS+BYTESIZE ; Size of Directory Check Vector |
|
||||
OFF$OFS equ CKS$OFS+WORDSIZE ; Number of Reserved Tracks |
|
||||
DPB$LEN equ OFF$OFS+WORDSIZE ; Disk Parameter Block Length |
|
||||
|
|
||||
; BIOS Memory Locations |
|
||||
BIBOOT equ 0E600h |
|
||||
BIWBOOT equ 0E603h |
|
||||
BICONST equ 0E606h |
|
||||
BICONIN equ 0E609h |
|
||||
BICONOUT equ 0E60Ch |
|
||||
BILIST equ 0E60Fh |
|
||||
BIPUNCH equ 0E612h |
|
||||
BIREADER equ 0E615h |
|
||||
BIHOME equ 0E618h |
|
||||
BISELDSK equ 0E61Bh |
|
||||
BISETTRK equ 0E61Eh |
|
||||
BISETSEC equ 0E621h |
|
||||
BISETDMA equ 0E624h |
|
||||
BIREAD equ 0E627h |
|
||||
BIWRITE equ 0E62Ah |
|
||||
BILISTST equ 0E62Dh |
|
||||
BISECTRN equ 0E630h |
|
||||
|
|
||||
; These are rel zero drive number for talking to the BIOS |
|
||||
; BDOS typically uses rel one drive codes |
|
||||
|
|
||||
BIDRVA equ 0 |
|
||||
BIDRVB equ 1 |
|
||||
BIDRVC equ 2 |
|
||||
BIDRVD equ 3 |
|
||||
BIDRVE equ 4 |
|
||||
BIDRVF equ 5 |
|
||||
BIDRVG equ 6 |
|
||||
BIDRVH equ 7 |
|
||||
|
|
||||
; On entry: c=drive number |
|
||||
get$spt macro |
|
||||
push psw |
|
||||
push b |
|
||||
push d |
|
||||
call BISELDSK |
|
||||
lxi d,DPB$OFS |
|
||||
dad d |
|
||||
mov e,m |
|
||||
inx h |
|
||||
mov d,m |
|
||||
xchg |
|
||||
lxi d,SPT$OFS |
|
||||
dad d |
|
||||
mov e,m |
|
||||
inx h |
|
||||
mov d,m |
|
||||
xchg |
|
||||
pop d |
|
||||
pop b |
|
||||
pop psw |
|
||||
endm |
|
||||
|
|
||||
; On entry: c=drive number |
|
||||
get$drm macro |
|
||||
push psw |
|
||||
push b |
|
||||
push d |
|
||||
call BISELDSK |
|
||||
lxi d,DPB$OFS |
|
||||
dad d |
|
||||
mov e,m |
|
||||
inx h |
|
||||
mov d,m |
|
||||
xchg |
|
||||
lxi d,DRM$OFS |
|
||||
dad d |
|
||||
mov e,m |
|
||||
inx h |
|
||||
mov d,m |
|
||||
xchg |
|
||||
pop d |
|
||||
pop b |
|
||||
pop psw |
|
||||
endm |
|
||||
|
|
||||
; On entry, c=drive number |
|
||||
get$off macro |
|
||||
push psw |
|
||||
push b |
|
||||
push d |
|
||||
call BISELDSK |
|
||||
lxi d,DPB$OFS |
|
||||
dad d |
|
||||
mov e,m |
|
||||
inx h |
|
||||
mov d,m |
|
||||
xchg |
|
||||
lxi d,OFF$OFS |
|
||||
dad d |
|
||||
mov e,m |
|
||||
inx h |
|
||||
mov d,m |
|
||||
xchg |
|
||||
pop d |
|
||||
pop b |
|
||||
pop psw |
|
||||
endm |
|
||||
|
|
||||
|
|
||||
|
|
||||
; eof - cpmbios.lib |
|
||||
|
|
||||
@ -1,286 +0,0 @@ |
|||||
/* cpmname.c 5/21/2012 dwg - */ |
|
||||
|
|
||||
#include "applvers.h" |
|
||||
#include "infolist.h" |
|
||||
#include "cnfgdata.h" |
|
||||
#include "syscfg.h" |
|
||||
#include "diagnose.h" |
|
||||
#include "std.h" |
|
||||
|
|
||||
#define HIGHSEG 0xC000 /* memory address of system config */ |
|
||||
|
|
||||
#define GETSYSCFG 0xF000 /* HBIOS function for Get System Configuration */ |
|
||||
|
|
||||
char None[] = "*None*"; |
|
||||
char Unk[] = "*Unknown*"; |
|
||||
char * PltName[] = {None, "N8VEM Z80", "ZETA Z80", "N8 Z180"}; |
|
||||
char * CIOName[] = {"UART", "ASCI", "VDU", "CVDU", "UPD7220", |
|
||||
"N8V", "PRPCON", "PPPCON", Unk, Unk, Unk, Unk, Unk, |
|
||||
"CRT", "BAT", "NUL"}; |
|
||||
char * DIOName[] = {"MD", "FD", "IDE", "ATAPI", "PPIDE", |
|
||||
"SD", "PRPSD", "PPPSD", "HDSK"}; |
|
||||
char * VDAName[] = {None, "VDU", "CVDU", "UPD7220", "N8V"}; |
|
||||
char * EmuName[] = {None, "TTY", "ANSI"}; |
|
||||
char * TermName[] = {"TTY", "ANSI", "WYSE", "VT52"}; |
|
||||
char * DiskMapName[] = {None, "ROM", "RAM", "FD", "IDE", |
|
||||
"PPIDE", "SD", "PRPSD", "PPPSD", "HDSK"}; |
|
||||
char * ClrRamName[] = {"Never", "Auto", "Always"}; |
|
||||
char * FDModeName[] = {None, "DIO", "ZETA", "DIDE", "N8", "DIO3"}; |
|
||||
char * FDMediaName[] = {"720K", "1.44M", "360K", "1.2M", "1.11M"}; |
|
||||
char * IDEModeName[] = {None, "DIO", "DIDE"}; |
|
||||
|
|
||||
char hexchar(val, bitoff) |
|
||||
{ |
|
||||
static char hexmap[] = "0123456789ABCDEF"; |
|
||||
|
|
||||
return hexmap[(val >> bitoff) & 0xF]; |
|
||||
} |
|
||||
|
|
||||
char * fmthexbyte(val, buf) |
|
||||
unsigned char val; |
|
||||
char * buf; |
|
||||
{ |
|
||||
buf[0] = hexchar(val, 4); |
|
||||
buf[1] = hexchar(val, 0); |
|
||||
buf[2] = '\0'; |
|
||||
|
|
||||
return buf; |
|
||||
} |
|
||||
|
|
||||
char * fmthexword(val, buf) |
|
||||
unsigned int val; |
|
||||
char * buf; |
|
||||
{ |
|
||||
buf[0] = hexchar(val, 12); |
|
||||
buf[1] = hexchar(val, 8); |
|
||||
fmthexbyte(val, buf + 2); |
|
||||
|
|
||||
return buf; |
|
||||
} |
|
||||
|
|
||||
char * fmtbool(val) |
|
||||
unsigned char val; |
|
||||
{ |
|
||||
return (val ? "True" : "False"); |
|
||||
} |
|
||||
|
|
||||
char * fmtenable(val) |
|
||||
unsigned char val; |
|
||||
{ |
|
||||
return (val ? "Enabled" : "Disabled"); |
|
||||
} |
|
||||
|
|
||||
putscpm(p) |
|
||||
char * p; |
|
||||
{ |
|
||||
while (*p != '$') |
|
||||
putchar(*(p++)); |
|
||||
} |
|
||||
|
|
||||
pager() |
|
||||
{ |
|
||||
static int line = 1; |
|
||||
int i; |
|
||||
|
|
||||
line++; |
|
||||
printf("\r\n"); |
|
||||
|
|
||||
if(line >= 24) |
|
||||
{ |
|
||||
printf("*** Press any key to continue..."); |
|
||||
while (bdos(6, 0xFF) == 0); |
|
||||
putchar('\r'); |
|
||||
for (i = 0; i < 40; i++) {putchar(' ');} |
|
||||
putchar('\r'); |
|
||||
line = 1; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
prtcfg1(pSysCfg) |
|
||||
struct SYSCFG * pSysCfg; |
|
||||
{ |
|
||||
struct CNFGDATA * pCfg; |
|
||||
char buf[5]; |
|
||||
char buf2[5]; |
|
||||
|
|
||||
pCfg = &(pSysCfg->cnfgdata); |
|
||||
|
|
||||
printf("%s @ %dMHz, RAM=%dMB, ROM=%dMB", |
|
||||
PltName[pCfg->platform], |
|
||||
pCfg->freq, |
|
||||
pCfg->ramsize, |
|
||||
pCfg->romsize); |
|
||||
pager(); |
|
||||
printf("RomWBW Version %d.%d.%d.%d, ", |
|
||||
pCfg->rmj, pCfg->rmn, |
|
||||
pCfg->rup, pCfg->rtp); |
|
||||
putscpm((unsigned int)pSysCfg + (unsigned int)pSysCfg->tstloc); |
|
||||
pager(); |
|
||||
if (pCfg->diskboot) |
|
||||
printf("Disk Boot Device=%s, Unit=%d, LU=%d", |
|
||||
DIOName[pCfg->devunit >> 4], |
|
||||
pCfg->devunit & 0xF, pCfg->bootlu); |
|
||||
else |
|
||||
printf("ROM Boot"); |
|
||||
pager(); |
|
||||
pager(); |
|
||||
|
|
||||
printf("Console: Default=%s:%d, Alternate=%s:%d, Init Baudrate=%d0", |
|
||||
CIOName[(pCfg->defcon) >> 4], pCfg->defcon & 0xF, |
|
||||
CIOName[(pCfg->altcon) >> 4], pCfg->altcon & 0xF, |
|
||||
pCfg->conbaud); |
|
||||
pager(); |
|
||||
printf ("Default Video Display: %s, Default Emulation: %s", |
|
||||
VDAName[(pCfg->defvda) >> 4], EmuName[pCfg->defemu]); |
|
||||
pager(); |
|
||||
printf ("Current Terminal Type: %s", |
|
||||
TermName[pCfg->termtype]); |
|
||||
pager(); |
|
||||
|
|
||||
printf("Default IO Byte=0x%s, Alternate IO Byte=0x%s", |
|
||||
fmthexbyte(pCfg->defiobyte, buf), |
|
||||
fmthexbyte(pCfg->altiobyte, buf2)); |
|
||||
pager(); |
|
||||
printf("Disk Write Caching=%s, Disk IO Tracing=%s", |
|
||||
fmtbool(pCfg->wrtcache), fmtbool(pCfg->dsktrace)); |
|
||||
pager(); |
|
||||
printf("Disk Mapping Priority: %s, Clear RAM Disk: %s", |
|
||||
DiskMapName[pCfg->dskmap], ClrRamName[pCfg->clrramdsk]); |
|
||||
pager(); |
|
||||
pager(); |
|
||||
|
|
||||
printf("DSKY %s", fmtenable(pCfg->dskyenable)); |
|
||||
pager(); |
|
||||
if (pCfg->uartenable) |
|
||||
{ |
|
||||
printf("UART Enabled"); |
|
||||
pager(); |
|
||||
if (pCfg->uartcnt >= 1) |
|
||||
printf("UART0 FIFO=%s, AFC=%s, Baudrate=%d0", |
|
||||
fmtbool(pCfg->uart0fifo), fmtbool(pCfg->uart0afc), pCfg->uart0baud); |
|
||||
if (pCfg->uartcnt >= 2) |
|
||||
printf("UART1 FIFO=%s, AFC=%s, Baudrate=%d0", |
|
||||
fmtbool(pCfg->uart1fifo), fmtbool(pCfg->uart1afc), pCfg->uart1baud); |
|
||||
if (pCfg->uartcnt >= 3) |
|
||||
printf("UART2 FIFO=%s, AFC=%s, Baudrate=%d0", |
|
||||
fmtbool(pCfg->uart2fifo), fmtbool(pCfg->uart2afc), pCfg->uart2baud); |
|
||||
if (pCfg->uartcnt >= 4) |
|
||||
printf("UART3 FIFO=%s, AFC=%s, Baudrate=%d0", |
|
||||
fmtbool(pCfg->uart3fifo), fmtbool(pCfg->uart3afc), pCfg->uart3baud); |
|
||||
} |
|
||||
else |
|
||||
printf("UART Disabled"); |
|
||||
pager(); |
|
||||
if (pCfg->ascienable) |
|
||||
{ |
|
||||
printf("ASCI Enabled"); |
|
||||
pager(); |
|
||||
printf("ASCI0, Baudrate=%d0", pCfg->asci0baud); |
|
||||
printf("ASCI1, Baudrate=%d0", pCfg->asci1baud); |
|
||||
} |
|
||||
else |
|
||||
printf("ASCI Disabled"); |
|
||||
pager(); |
|
||||
printf("VDU %s", fmtenable(pCfg->vduenable)); |
|
||||
pager(); |
|
||||
printf("CVDU %s", fmtenable(pCfg->cvduenable)); |
|
||||
pager(); |
|
||||
printf("UPD7220 %s", fmtenable(pCfg->upd7220enable)); |
|
||||
pager(); |
|
||||
printf("N8V %s", fmtenable(pCfg->n8venable)); |
|
||||
pager(); |
|
||||
pager(); |
|
||||
} |
|
||||
|
|
||||
prtcfg2(pSysCfg) |
|
||||
struct SYSCFG * pSysCfg; |
|
||||
{ |
|
||||
struct CNFGDATA * pCfg; |
|
||||
char buf[5]; |
|
||||
char buf2[5]; |
|
||||
|
|
||||
pCfg = &(pSysCfg->cnfgdata); |
|
||||
|
|
||||
printf("FD %s, Mode=%s, TraceLevel=%d, Media=%s/%s, Auto=%s", |
|
||||
fmtenable(pCfg->fdenable), FDModeName[pCfg->fdmode], |
|
||||
pCfg->fdtrace, |
|
||||
FDMediaName[pCfg->fdmedia], FDMediaName[pCfg->fdmediaalt], |
|
||||
fmtbool(pCfg->fdmauto)); |
|
||||
pager(); |
|
||||
printf("IDE %s, Mode=%s, TraceLevel=%d, 8bit=%s, Size=%dMB", |
|
||||
fmtenable(pCfg->ideenable), IDEModeName[pCfg->idemode], |
|
||||
pCfg->idetrace, fmtbool(pCfg->ide8bit), pCfg->idecapacity); |
|
||||
pager(); |
|
||||
printf("PPIDE %s, IOBase=0x%s, TraceLevel=%d, 8bit=%s, Slow=%s, Size=%dMB", |
|
||||
fmtenable(pCfg->ppideenable), fmthexbyte(pCfg->ppideiob, buf), |
|
||||
pCfg->ppidetrace, fmtbool(pCfg->ppide8bit), |
|
||||
fmtbool(pCfg->ppideslow), pCfg->ppidecapacity); |
|
||||
pager(); |
|
||||
printf("PRP %s, SD %s, TraceLevel=%d, Size=%dMB, Console %s", |
|
||||
fmtenable(pCfg->prpenable), fmtenable(pCfg->prpsdenable), |
|
||||
pCfg->prpsdtrace, pCfg->prpsdcapacity, |
|
||||
fmtenable(pCfg->prpconenable)); |
|
||||
pager(); |
|
||||
printf("PPP %s, SD %s, TraceLevel=%d, Size=%dMB, Console %s", |
|
||||
fmtenable(pCfg->pppenable), fmtenable(pCfg->pppsdenable), |
|
||||
pCfg->pppsdtrace, pCfg->pppsdcapacity, |
|
||||
fmtenable(pCfg->pppconenable)); |
|
||||
pager(); |
|
||||
printf("HDSK %s, TraceLevel=%d, Size=%dMB", |
|
||||
fmtenable(pCfg->hdskenable), |
|
||||
pCfg->hdsktrace, pCfg->hdskcapacity); |
|
||||
pager(); |
|
||||
pager(); |
|
||||
|
|
||||
printf("PPK %s, TraceLevel=%d", |
|
||||
fmtenable(pCfg->ppkenable), pCfg->ppktrace); |
|
||||
pager(); |
|
||||
printf("KBD %s, TraceLevel=%d", |
|
||||
fmtenable(pCfg->kbdenable), pCfg->kbdtrace); |
|
||||
pager(); |
|
||||
pager(); |
|
||||
|
|
||||
printf("TTY %s", fmtenable(pCfg->ttyenable)); |
|
||||
pager(); |
|
||||
printf("ANSI %s, TraceLevel=%d", |
|
||||
fmtenable(pCfg->ansienable), pCfg->ansitrace); |
|
||||
pager(); |
|
||||
} |
|
||||
|
|
||||
int main(argc,argv) |
|
||||
int argc; |
|
||||
char *argv[]; |
|
||||
{ |
|
||||
struct INFOLIST * pInfoList; |
|
||||
struct SYSCFG * pSysCfg; |
|
||||
|
|
||||
printf("CPMNAME.COM %d/%d/%d v%d.%d.%d (%d)", |
|
||||
A_MONTH,A_DAY,A_YEAR,A_RMJ,A_RMN,A_RUP,A_RTP); |
|
||||
printf(" dwg - Display System Configuration"); |
|
||||
pager(); |
|
||||
pager(); |
|
||||
|
|
||||
pInfoList = bioshl(20, 0, 0); |
|
||||
|
|
||||
putscpm(pInfoList->banptr); |
|
||||
pager(); |
|
||||
pager(); |
|
||||
|
|
||||
pSysCfg = HIGHSEG; |
|
||||
hregbc = GETSYSCFG; /* function = Get System Config */ |
|
||||
hregde = pSysCfg; /* addr of dest (must be high) */ |
|
||||
diagnose(); /* invoke the HBIOS function */ |
|
||||
|
|
||||
if (pSysCfg->marker != CFGMARKER) |
|
||||
{ |
|
||||
printf("*** Invalid configuration data ***\r\n"); |
|
||||
return; |
|
||||
} |
|
||||
|
|
||||
prtcfg1(pSysCfg); |
|
||||
prtcfg2(pSysCfg); |
|
||||
} |
|
||||
|
|
||||
/********************/ |
|
||||
/* eof - ccpmname.c */ |
|
||||
/********************/ |
|
||||
@ -1,99 +0,0 @@ |
|||||
/* ctermcap.c 3/11/2012 dwg - terminal capbility file */ |
|
||||
|
|
||||
#include "stdio.h" |
|
||||
#include "stdlib.h" |
|
||||
#include "cpmbind.h" |
|
||||
#include "applvers.h" |
|
||||
#include "cnfgdata.h" |
|
||||
#include "syscfg.h" |
|
||||
#include "diagnose.h" |
|
||||
|
|
||||
char termtype; |
|
||||
|
|
||||
|
|
||||
|
|
||||
char wy50row[24] = { ' ', '!', '"', '#', '$', '%', '&', 39, |
|
||||
'(', ')', '*', '+', ',', '-', '.', '/', |
|
||||
'0', '1', '2', '3', '4', '5', '6', '7' }; |
|
||||
|
|
||||
char wy50col[80] = { ' ', '!', '"', '#', '$', '%', '&', 39, |
|
||||
'(', ')', '*', '+', ',', '-', '.', '/', |
|
||||
'0', '1', '2', '3', '4', '5', '6', '7', |
|
||||
'8', '9', ':', ';', '<', '=', '>', '?', |
|
||||
'@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', |
|
||||
'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', |
|
||||
'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', |
|
||||
'X', 'Y', 'Z', '[', '\\', ']', '^', '_', |
|
||||
96, 'a', 'b', 'c', 'd', 'e', 'f', 'g', |
|
||||
'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o' }; |
|
||||
|
|
||||
|
|
||||
|
|
||||
crtinit(tt) |
|
||||
char tt; |
|
||||
{ |
|
||||
termtype = tt; |
|
||||
} |
|
||||
|
|
||||
crtclr() |
|
||||
{ |
|
||||
int i; |
|
||||
|
|
||||
switch(termtype) { |
|
||||
case TERM_TTY: |
|
||||
for(i=0;i<43;i++) { |
|
||||
printf("%c%c",CR,LF); |
|
||||
} |
|
||||
break; |
|
||||
case TERM_ANSI: |
|
||||
printf("%c[2J",ESC); |
|
||||
break; |
|
||||
case TERM_WYSE: |
|
||||
printf("%c+",ESC); |
|
||||
break; |
|
||||
case TERM_VT52: |
|
||||
printf("%cJ%cH",ESC,ESC); |
|
||||
break; |
|
||||
}; |
|
||||
} |
|
||||
|
|
||||
crtlc(line,col) |
|
||||
int line; |
|
||||
int col; |
|
||||
{ |
|
||||
int i; |
|
||||
|
|
||||
switch(termtype) { |
|
||||
case TERM_TTY: |
|
||||
break; |
|
||||
case TERM_ANSI: |
|
||||
printf("%c[%d;%d%c",ESC,line,col,0x66); |
|
||||
break; |
|
||||
case TERM_WYSE: |
|
||||
printf("%c=%c%c",ESC,wy50row[line-1],wy50col[col-1]); |
|
||||
break; |
|
||||
case TERM_VT52: |
|
||||
printf("%cY%c%c",ESC,' '+line,' '+col); |
|
||||
break; |
|
||||
}; |
|
||||
} |
|
||||
|
|
||||
/*
|
|
||||
|
|
||||
wy50row db ' !"#$%&' |
|
||||
db 39 |
|
||||
db '()*+,-./01234567' |
|
||||
|
|
||||
wy50col db ' !"#$%&' |
|
||||
db 39 |
|
||||
db '()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_' |
|
||||
db 96 |
|
||||
db 'abcdefghijklmno' |
|
||||
|
|
||||
*/ |
|
||||
|
|
||||
|
|
||||
/********************/ |
|
||||
/* eof - ctermcap.c */ |
|
||||
/********************/ |
|
||||
|
|
||||
@ -1,6 +0,0 @@ |
|||||
/* ctermcap.h 3/11/2012 dwg - declarations for termal capability */ |
|
||||
|
|
||||
extern crtinit(); /* void crtinit(char termtype); */ |
|
||||
extern crtclr(); /* void crtclr(void); */ |
|
||||
extern crtlc(); /* void crtlc(char line,char column); */ |
|
||||
|
|
||||
@ -1,45 +0,0 @@ |
|||||
/* cvt2h.h 7/11/2012 dwg - Copyright (C) 2012 Douglas Goodall */ |
|
||||
|
|
||||
/* This is an include file for a function which takes a pointer,
|
|
||||
a length, and a filename, and converts a buffer into a C |
|
||||
header file that can be later incuded in some other compilation. */ |
|
||||
|
|
||||
#include "stdio.h" |
|
||||
#include "visible.h" |
|
||||
|
|
||||
cvt2h(buffer,length,name) |
|
||||
unsigned char * buffer; |
|
||||
int length; |
|
||||
char * name; |
|
||||
{ |
|
||||
FILE * fd; |
|
||||
int i,j,k,l; |
|
||||
char szTemp[32]; |
|
||||
fd = fopen(name,"w"); |
|
||||
fprintf(fd, |
|
||||
"/* %s produced automatically by cvt2h.h */\n",name); |
|
||||
strcpy(szTemp,name); |
|
||||
szTemp[8] = 0; |
|
||||
fprintf(fd, |
|
||||
"unsigned char %s[%d] = {\n\t", |
|
||||
szTemp,length); |
|
||||
for(i=0;i<length;i++) { |
|
||||
fprintf(fd,"0x%02x, ",buffer[i]); |
|
||||
if(7 == (i&0x07)) { |
|
||||
fprintf(fd," /* "); |
|
||||
j = i && 0x07; |
|
||||
k = j + 8; |
|
||||
for(l=j;l<k;l++) { |
|
||||
if(1 == visible[buffer[l]]) { |
|
||||
fprintf(fd,"%02x ",buffer[l]); |
|
||||
} else { |
|
||||
fprintf(fd,"."); |
|
||||
} |
|
||||
} |
|
||||
fprintf(fd,"*/"); |
|
||||
fprintf(fd,"\n\t"); |
|
||||
} |
|
||||
} |
|
||||
fprintf(fd,"};\n/* eof - %s */\n",name); |
|
||||
fclose(fd); |
|
||||
} |
|
||||
@ -1,41 +0,0 @@ |
|||||
/* cvt2h.h 7/11/2012 dwg - Copyright (C) 2012 Douglas Goodall */ |
|
||||
|
|
||||
cvt2h(buffer,length,name) |
|
||||
unsigned char * buffer; |
|
||||
int length; |
|
||||
char * name; |
|
||||
{ |
|
||||
FILE * fd; |
|
||||
int i,j,k,l; |
|
||||
char szTemp[32]; |
|
||||
fd = fopen(name,"w"); |
|
||||
fprintf(fd, |
|
||||
"/* %s produced automatically by cvt2h.h */\n",name); |
|
||||
strcpy(szTemp,name); |
|
||||
szTemp[8] = 0; |
|
||||
fprintf(fd, |
|
||||
"unsigned char %s[%d] = {\n\t", |
|
||||
szTemp,length); |
|
||||
for(i=0;i<length;i++) { |
|
||||
fprintf(fd,"0x%02x,",buffer[i]); |
|
||||
if(7 == (i&0x07)) { |
|
||||
fprintf(fd," /* "); |
|
||||
j = i & 0xfff8; |
|
||||
k = j + 8; |
|
||||
fprintf(fd," %04x: ",j); |
|
||||
|
|
||||
for(l=j;l<k;l++) { |
|
||||
if(1 == visible[buffer[l]]) { |
|
||||
fprintf(fd,"%c ",buffer[l]); |
|
||||
} else { |
|
||||
fprintf(fd,". "); |
|
||||
} |
|
||||
} |
|
||||
fprintf(fd,"*/"); |
|
||||
fprintf(fd,"\n\t"); |
|
||||
} |
|
||||
} |
|
||||
fprintf(fd,"};\n/* eof - %s */\n",name); |
|
||||
fclose(fd); |
|
||||
} |
|
||||
|
|
||||
@ -1,45 +0,0 @@ |
|||||
/* cvt2inc.h 7/23/2012 dwg - make tasm include file from binary buffer */ |
|
||||
|
|
||||
cvt2inc(buffer,length,name) |
|
||||
unsigned char * buffer; |
|
||||
int length; |
|
||||
char * name; |
|
||||
{ |
|
||||
FILE * fd; |
|
||||
int i,j,k,l; |
|
||||
char szTemp[32]; |
|
||||
fd = fopen(name,"w"); |
|
||||
fprintf(fd, |
|
||||
"; %s produced automatically by cvt2inc.h \n",name); |
|
||||
strcpy(szTemp,name); |
|
||||
szTemp[8] = 0; |
|
||||
fprintf(fd,"%s:\n",szTemp); |
|
||||
fprintf(fd," .DB "); |
|
||||
i = 0; |
|
||||
|
|
||||
for(i=0;i<length;i++) { |
|
||||
fprintf(fd,"%03xh",buffer[i]); |
|
||||
if(7 == (i&0x07)) { |
|
||||
fprintf(fd," ; "); |
|
||||
j = i & 0xfff8; |
|
||||
k = j + 8; |
|
||||
fprintf(fd," %04x: ",j); |
|
||||
|
|
||||
for(l=j;l<k;l++) { |
|
||||
if(1 == visible[buffer[l]]) { |
|
||||
fprintf(fd,"%c ",buffer[l]); |
|
||||
} else { |
|
||||
fprintf(fd,". "); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
if(i != length-1) fprintf(fd,"\n .DB "); |
|
||||
|
|
||||
} else { |
|
||||
fprintf(fd,","); |
|
||||
} |
|
||||
} |
|
||||
fprintf(fd,"\n"); |
|
||||
fclose(fd); |
|
||||
} |
|
||||
|
|
||||
@ -1,49 +0,0 @@ |
|||||
; diagnose.asm 5/23/2012 dwg - diagnose binding for Aztec C |
|
||||
|
|
||||
global hrega_,1 |
|
||||
global hregbc_,2 |
|
||||
global hregde_,2 |
|
||||
global hreghl_,2 |
|
||||
|
|
||||
|
|
||||
public diagnose_ |
|
||||
diagnose: |
|
||||
push psw |
|
||||
push b |
|
||||
push d |
|
||||
push h |
|
||||
|
|
||||
lhld hregbc_ |
|
||||
mov b,h |
|
||||
mov c,l |
|
||||
|
|
||||
lhld hregde_ |
|
||||
mov d,h |
|
||||
mov e,l |
|
||||
|
|
||||
lhld hreghl_ |
|
||||
|
|
||||
lda hrega_ |
|
||||
|
|
||||
db 0cfh ; rst 8 |
|
||||
|
|
||||
sta hrega_ |
|
||||
shld hreghl_ |
|
||||
|
|
||||
mov l,e |
|
||||
mov h,d |
|
||||
shld hregde_ |
|
||||
|
|
||||
mov l,c |
|
||||
mov h,b |
|
||||
shld hregbc_ |
|
||||
|
|
||||
pop h |
|
||||
pop d |
|
||||
pop b |
|
||||
pop psw |
|
||||
|
|
||||
RET |
|
||||
|
|
||||
END |
|
||||
|
|
||||
@ -1,12 +0,0 @@ |
|||||
/* diagnose.h 5/23/2012 dwg - */ |
|
||||
|
|
||||
extern char hrega; |
|
||||
extern unsigned int hregbc; |
|
||||
extern unsigned int hregde; |
|
||||
extern unsigned int hreghl; |
|
||||
|
|
||||
extern diagnose(); |
|
||||
|
|
||||
/********************/ |
|
||||
/* eof - diagnose.h */ |
|
||||
/********************/ |
|
||||
@ -1,229 +0,0 @@ |
|||||
/* view.c 6/7/2012 dwg - */ |
|
||||
|
|
||||
#include "std.h" |
|
||||
/* #include "hbios.h" */ |
|
||||
#include "stdio.h" |
|
||||
#include "stdlib.h" |
|
||||
#include "memory.h" |
|
||||
#include "portab.h" |
|
||||
#define MAXDRIVE 8 |
|
||||
#include "cpm80.h" |
|
||||
#include "cpmappl.h" |
|
||||
#include "applvers.h" |
|
||||
|
|
||||
#include "trackio.h" |
|
||||
|
|
||||
#define DSM144 0x02C6 |
|
||||
#define DSM720 0x015E |
|
||||
#define DSM360 0x00AA |
|
||||
#define DSM120 0x024F |
|
||||
#define DSM111 0x0222 |
|
||||
|
|
||||
struct DPH * pDPH; |
|
||||
struct DPB * pDPB; |
|
||||
|
|
||||
unsigned char buffer[72*128]; |
|
||||
char gbFD[MAXDRIVE]; |
|
||||
char gFDNums[MAXDRIVE]; |
|
||||
char gNumFD; /* this value is set by the fdcount function */ |
|
||||
|
|
||||
/* the purpose of this function is to set the global variable
|
|
||||
gNumFD to the number of floppy drives detected, and to set |
|
||||
a boolean in the vector gbFD indicating the drive is present |
|
||||
the drive number of each one in the vector |
|
||||
*/ |
|
||||
|
|
||||
diomed(devunit) |
|
||||
unsigned char devunit; |
|
||||
{ |
|
||||
hregbc = 0x1300 + devunit; |
|
||||
diagnose(); |
|
||||
return hrega; |
|
||||
} |
|
||||
|
|
||||
sensefd() |
|
||||
{ |
|
||||
char device; |
|
||||
char unit; |
|
||||
char devunit; |
|
||||
|
|
||||
/* init local variables */ |
|
||||
char drive; |
|
||||
char result; |
|
||||
drive = 0; |
|
||||
result = 0; |
|
||||
|
|
||||
/* init global variables */ |
|
||||
gNumFD = 0; |
|
||||
memset(&gbFD,FALSE,MAXDRIVE); |
|
||||
memset(&gFDNums,0,MAXDRIVE); |
|
||||
/* for all valid drive numbers */ |
|
||||
while(0 == result) { |
|
||||
ireghl = pGETLU; |
|
||||
iregbc = drive; |
|
||||
bioscall(); |
|
||||
result = irega; |
|
||||
/* return from GETLU goes to 1 if drive # invalid */ |
|
||||
|
|
||||
devunit = iregbc >> 8; |
|
||||
device = devunit & 0xf0; |
|
||||
unit = devunit & 0x0f; |
|
||||
if(DEV_FD == device) { |
|
||||
gFDNums[gNumFD] = drive; |
|
||||
gbFD[gNumFD++] = iregbc & 0xff; |
|
||||
} |
|
||||
drive++; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
|
|
||||
int main(argc,argv) |
|
||||
int argc; |
|
||||
char *argv[] ; |
|
||||
{ |
|
||||
char drive; |
|
||||
int fd0,fd1; |
|
||||
int i; |
|
||||
int spt; |
|
||||
int track; |
|
||||
int tracks; |
|
||||
int bValid; |
|
||||
|
|
||||
sensefd(); |
|
||||
|
|
||||
if(2 != gNumFD) { |
|
||||
printf("Sorry, this version of diskcopy only supports dual drives"); |
|
||||
exit(FAILURE); |
|
||||
} |
|
||||
printf("The copy will be from drive %c: to drive %c:\n", |
|
||||
gFDNums[0]+'A',gFDNums[1]+'A'); |
|
||||
|
|
||||
printf("The media in FD0 is "); |
|
||||
fd0 = diomed(DEV_FD); |
|
||||
switch(fd0) { |
|
||||
case MID_NONE: |
|
||||
printf("Drive is empty"); |
|
||||
break; |
|
||||
case MID_MDROM: |
|
||||
printf("a memory ROM drive"); |
|
||||
break; |
|
||||
case MID_MDRAM: |
|
||||
printf("a memory RAM drive"); |
|
||||
break; |
|
||||
case MID_HD: |
|
||||
printf("an HD drive"); |
|
||||
break; |
|
||||
case MID_FD720: |
|
||||
printf("a 720KB floppy disk"); |
|
||||
tracks = 80 * 2; |
|
||||
break; |
|
||||
case MID_FD144: |
|
||||
printf("a 1.44MB floppy disk"); |
|
||||
tracks = 80 * 2; |
|
||||
break; |
|
||||
case MID_FD360: |
|
||||
printf("a 360KB floppy disk"); |
|
||||
tracks = 40 * 2; |
|
||||
break; |
|
||||
case MID_FD120: |
|
||||
printf("a 120KB floppy disk"); |
|
||||
tracks = 80 * 2; |
|
||||
break; |
|
||||
case MID_FD111: |
|
||||
printf("a 111KB floppy disk"); |
|
||||
tracks = 74 * 2; |
|
||||
break; |
|
||||
default: |
|
||||
printf("an unknown media type"); |
|
||||
break; |
|
||||
} |
|
||||
printf("\n"); |
|
||||
|
|
||||
|
|
||||
|
|
||||
printf("The media in FD1 is "); |
|
||||
fd1 = diomed(DEV_FD+1); |
|
||||
switch(fd1) { |
|
||||
case MID_NONE: |
|
||||
printf("Drive is empty"); |
|
||||
break; |
|
||||
case MID_MDROM: |
|
||||
printf("a memory ROM drive"); |
|
||||
break; |
|
||||
case MID_MDRAM: |
|
||||
printf("a memory RAM drive"); |
|
||||
break; |
|
||||
case MID_HD: |
|
||||
printf("an HD drive"); |
|
||||
break; |
|
||||
case MID_FD720: |
|
||||
printf("a 720KB floppy disk"); |
|
||||
break; |
|
||||
case MID_FD144: |
|
||||
printf("a 1.44MB floppy disk"); |
|
||||
break; |
|
||||
case MID_FD360: |
|
||||
printf("a 360KB floppy disk"); |
|
||||
break; |
|
||||
case MID_FD120: |
|
||||
printf("a 120KB floppy disk"); |
|
||||
break; |
|
||||
case MID_FD111: |
|
||||
printf("a 111KB floppy disk"); |
|
||||
break; |
|
||||
default: |
|
||||
printf("an unknown media type"); |
|
||||
break; |
|
||||
} |
|
||||
printf("\n"); |
|
||||
|
|
||||
if(fd0 != fd1) { |
|
||||
printf("Sorry, media types don't match, as required for diskcopy"); |
|
||||
exit(1); |
|
||||
} |
|
||||
|
|
||||
for(track=0;track<tracks;track++) { |
|
||||
|
|
||||
ireghl = pSELDSK; |
|
||||
iregbc = gFDNums[0]; /* G: */ |
|
||||
iregde = 0; |
|
||||
bioscall(); |
|
||||
pDPH = ireghl; |
|
||||
pDPB = pDPH->dpb; |
|
||||
spt = pDPB->spt; |
|
||||
ireghl = pSETTRK; |
|
||||
iregbc = track; |
|
||||
bioscall(); |
|
||||
printf("%3d ",track); |
|
||||
rdtrack(0,spt,buffer); |
|
||||
printf("%c",0x0d); |
|
||||
|
|
||||
bValid = FALSE; |
|
||||
for(i=0;i<spt*128;i++) { |
|
||||
if(0xe5 != buffer[i]) { |
|
||||
bValid = TRUE; |
|
||||
break; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
if(TRUE == bValid) { |
|
||||
|
|
||||
ireghl = pSELDSK; |
|
||||
iregbc = gFDNums[1]; /* G: */ |
|
||||
iregde = 0; |
|
||||
bioscall(); |
|
||||
pDPH = ireghl; |
|
||||
pDPB = pDPH->dpb; |
|
||||
spt = pDPB->spt; |
|
||||
ireghl = pSETTRK; |
|
||||
iregbc = track; /* Track 0 */ |
|
||||
bioscall(); |
|
||||
printf("%3d ",track); |
|
||||
wrtrack(0,spt,buffer); |
|
||||
printf("%c",0x0d); |
|
||||
|
|
||||
} |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
|
|
||||
@ -1,12 +0,0 @@ |
|||||
#include "stdio.h" |
|
||||
|
|
||||
main() |
|
||||
{ |
|
||||
FILE * fd; |
|
||||
fd = fopen("$$$.SUB","w"); |
|
||||
fprintf(fd,"%ca:getcfg\n",9); |
|
||||
fprintf(fd,"%ca:dump syscfg.bin\n",18); |
|
||||
fprintf(fd,"%ctype a:sect0000.h\n",17); |
|
||||
fclose(fd); |
|
||||
} |
|
||||
|
|
||||
@ -1,30 +0,0 @@ |
|||||
|
|
||||
struct DPH { |
|
||||
unsigned int xlt; |
|
||||
unsigned int rv1; |
|
||||
unsigned int rv2; |
|
||||
unsigned int rv3; |
|
||||
unsigned int dbf; |
|
||||
void * dpb; |
|
||||
void * csv; |
|
||||
void * alv; |
|
||||
/* extension */ |
|
||||
unsigned char sigl; |
|
||||
unsigned char sigu; |
|
||||
unsigned int current; |
|
||||
unsigned int number; |
|
||||
}; |
|
||||
|
|
||||
struct DPB { |
|
||||
unsigned int spt; |
|
||||
unsigned char bsh; |
|
||||
unsigned char blm; |
|
||||
unsigned char exm; |
|
||||
unsigned int dsm; |
|
||||
unsigned int drm; |
|
||||
unsigned char al0; |
|
||||
unsigned char al1; |
|
||||
unsigned int cks; |
|
||||
unsigned int off; |
|
||||
}; |
|
||||
|
|
||||
@ -1,25 +0,0 @@ |
|||||
/* dphmap.h 9/4/2012 dwg - expand to include I through L */ |
|
||||
/* dphmap.h 5/29/2012 dwg - declaration of DPH MAP structure */ |
|
||||
|
|
||||
struct DPHMAP { |
|
||||
struct DPH * drivea; |
|
||||
struct DPH * driveb; |
|
||||
struct DPH * drivec; |
|
||||
struct DPH * drived; |
|
||||
struct DPH * drivee; |
|
||||
struct DPH * drivef; |
|
||||
struct DPH * driveg; |
|
||||
struct DPH * driveh; |
|
||||
|
|
||||
struct DPH * drivei; |
|
||||
struct DPH * drivej; |
|
||||
struct DPH * drivek; |
|
||||
struct DPH * drivel; |
|
||||
} * pDPHMAP; |
|
||||
|
|
||||
struct DPHMAP * pDPHVEC[MAXDRIVE]; |
|
||||
|
|
||||
|
|
||||
/******************/ |
|
||||
/* eof - dphmap.h */ |
|
||||
/******************/ |
|
||||
@ -1,101 +0,0 @@ |
|||||
/* dump.c 7/11/2012 dwg -
|
|
||||
|
|
||||
The purpose of this program is similar to the CP/M dump program |
|
||||
except that in addition to the normal hexadecimal bytes, a field |
|
||||
of ascii bytes to the right are displayed as well. |
|
||||
|
|
||||
*/ |
|
||||
|
|
||||
#include "stdio.h" |
|
||||
|
|
||||
|
|
||||
char visible[256] = { |
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 00 */ |
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 10 */ |
|
||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 20 */ |
|
||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 30 */ |
|
||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 40 */ |
|
||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 50 */ |
|
||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 60 */ |
|
||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0, /* 70 */ |
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 80 */ |
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 90 */ |
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* A0 */ |
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* B0 */ |
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* C0 */ |
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* D0 */ |
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* E0 */ |
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* F0 */ |
|
||||
}; |
|
||||
|
|
||||
#include "cvt2h.h" |
|
||||
#include "cvt2inc.h" |
|
||||
|
|
||||
main(argc,argv) |
|
||||
int argc; |
|
||||
char *argv[]; |
|
||||
{ |
|
||||
int i,j; |
|
||||
int offset; |
|
||||
int result; |
|
||||
unsigned char byte; |
|
||||
unsigned char sector[128]; |
|
||||
char name[32]; |
|
||||
|
|
||||
|
|
||||
FILE * fd; |
|
||||
|
|
||||
banner("DUMP.COM"); |
|
||||
|
|
||||
/* cvt2h(0x0100,12*1024,"dumpcomh.h"); */ |
|
||||
|
|
||||
|
|
||||
if(1 == argc) { |
|
||||
printf("Sorry, no input file specified"); |
|
||||
exit(1); |
|
||||
} |
|
||||
|
|
||||
fd = fopen(argv[1],"r"); |
|
||||
if(NULL == fd) { |
|
||||
printf("Sorry, cannot open input file"); |
|
||||
exit(1); |
|
||||
} |
|
||||
|
|
||||
printf("Dumping %s\n\n",argv[1]); |
|
||||
|
|
||||
offset = 0; |
|
||||
result = fread(sector,sizeof(sector),1,fd); |
|
||||
while(0 < result) { |
|
||||
|
|
||||
sprintf(name,"sect%04x.h",offset); |
|
||||
cvt2h(sector,sizeof(sector),name); |
|
||||
sprintf(name,"sect%04x.inc",offset); |
|
||||
cvt2inc(sector,sizeof(sector),name); |
|
||||
|
|
||||
for(i=0;i<8;i++) { |
|
||||
printf("%04x: ",offset); |
|
||||
|
|
||||
|
|
||||
offset += 16; |
|
||||
for(j=0;j<16;j++) { |
|
||||
printf("%02x ",sector[(i*8)+j]); |
|
||||
} |
|
||||
printf(" "); |
|
||||
for(j=0;j<16;j++) { |
|
||||
byte = sector[(i*8)+j]; |
|
||||
if(1 == visible[byte]) { |
|
||||
printf("%c",byte); |
|
||||
} else { |
|
||||
printf("."); |
|
||||
} |
|
||||
} |
|
||||
printf("\n"); |
|
||||
} |
|
||||
printf("\n"); |
|
||||
result = fread(sector,sizeof(sector),1,fd); |
|
||||
} |
|
||||
fclose(fd); |
|
||||
|
|
||||
exit(0); |
|
||||
} |
|
||||
|
|
||||
File diff suppressed because it is too large
@ -1,108 +0,0 @@ |
|||||
; dumpmac.asm 2/1/2012 dwg - dump macro, declaration and implementation |
|
||||
|
|
||||
maclib portab |
|
||||
maclib globals |
|
||||
maclib hardware |
|
||||
maclib z80 |
|
||||
maclib cpmbdos |
|
||||
maclib printers |
|
||||
|
|
||||
cseg |
|
||||
|
|
||||
; e=char on entry |
|
||||
public x$pr$vis |
|
||||
x$pr$vis: |
|
||||
enter |
|
||||
lxi h,x$visibool |
|
||||
mvi d,0 |
|
||||
dad d |
|
||||
mov a,m |
|
||||
cpi 0 |
|
||||
jz do$dot |
|
||||
mvi c,2 |
|
||||
call BDOS |
|
||||
jmp x$pr$fini |
|
||||
do$dot: |
|
||||
conout '.' |
|
||||
x$pr$fini: |
|
||||
leave |
|
||||
ret |
|
||||
|
|
||||
public x$dump |
|
||||
x$dump: shld x$dump$tmp |
|
||||
call pr$h$word |
|
||||
conout ':' |
|
||||
conout ' ' |
|
||||
mvi b,16 |
|
||||
x$d$lp1: |
|
||||
mov a,m |
|
||||
inx h |
|
||||
xchg |
|
||||
mov l,a |
|
||||
call pr$h$byte |
|
||||
conout ' ' |
|
||||
xchg |
|
||||
dcr b |
|
||||
jnz x$d$lp1 |
|
||||
conout ' ' |
|
||||
conout ' ' |
|
||||
mvi b,16 |
|
||||
lhld x$dump$tmp |
|
||||
x$d$lp2: |
|
||||
mov a,m |
|
||||
inx h |
|
||||
mov e,a |
|
||||
call x$pr$vis |
|
||||
dcr b |
|
||||
jnz x$d$lp2 |
|
||||
conout CR |
|
||||
conout LF |
|
||||
lhld x$dump$tmp |
|
||||
ret |
|
||||
|
|
||||
|
|
||||
; display a number of lines of sixteen bytes in hex with leading address |
|
||||
; and ascii |
|
||||
public x$dump$multi |
|
||||
x$dump$multi: |
|
||||
push h ; save display address in case x$dump changes it |
|
||||
call x$dump ; call actual dump routine for 16 bytes |
|
||||
pop h ; restore display address |
|
||||
lxi d,16 ; get ready to increment it by 16 bytes |
|
||||
dad d ; here we go, HL = new load address |
|
||||
dcr c ; decrement line counter |
|
||||
jnz x$dump$multi ; do more as necessary |
|
||||
ret |
|
||||
|
|
||||
|
|
||||
dseg |
|
||||
|
|
||||
x$dump$tmp ds 2 |
|
||||
|
|
||||
public x$visibool |
|
||||
x$visibool: |
|
||||
; 0 1 2 3 4 5 6 7 8 9 A B C D E F |
|
||||
; - - - - - - - - - - - - - - - - |
|
||||
vb$00 db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
|
||||
vb$10 db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
|
||||
vb$20 db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 ; "#$%&'()*+,-./ |
|
||||
vb$30 db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 ;0123456789:;<=>? |
|
||||
vb$40 db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 ;@ABCDEFGHIJKLMNO |
|
||||
vb$50 db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 ;PQRSTUVWXYZ[\]^_ |
|
||||
vb$60 db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 ;`abcdefghijklmno |
|
||||
vb$70 db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0 ;pqrstuvwxyz{|}~ |
|
||||
vb$80 db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
|
||||
vb$90 db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
|
||||
vb$a0 db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
|
||||
vb$b0 db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
|
||||
vb$c0 db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
|
||||
vb$d0 db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
|
||||
vb$e0 db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
|
||||
vb$f0 db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 |
|
||||
|
|
||||
; eof - dumpmac.asm |
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
@ -1,16 +0,0 @@ |
|||||
dwg-apps.man 7/22/2012 dwg - 2.0 Apps - Command syntax |
|
||||
|
|
||||
banker display version and specifics of bnk1, bnk0... |
|
||||
cpmname [-a] display values in syscfg and cnfgdata |
|
||||
setlabel edit drive label of current drive (interactive) |
|
||||
map displays current drives, mapping, and LU labels |
|
||||
map <drive> <lunum> changes LU of specified drive to specified LU # |
|
||||
meta display and/or edit metadata of current drive |
|
||||
rem used in submit file to add remarks |
|
||||
sysgen writes default system onto current drive |
|
||||
sysgen <filespec> writes specified file onto current drive |
|
||||
sysgen <filespec> <drive> write specified file to specified drive |
|
||||
termtype display and or edit terminal type |
|
||||
view display tables of current and next 3 drives |
|
||||
view { A: | B: | C: | D: | E: | F: | G: | H: } dsply specified & nxt 3 drvs |
|
||||
|
|
||||
@ -1,103 +0,0 @@ |
|||||
/* editor.c 11/18/2012 dwg - */ |
|
||||
|
|
||||
|
|
||||
#include "std.h" |
|
||||
#include "applvers.h" |
|
||||
#include "diagnose.h" |
|
||||
#include "cpmbdos.h" |
|
||||
#include "cpmbios.h" |
|
||||
#include "bdoscall.h" |
|
||||
|
|
||||
|
|
||||
#define VDA_N8 4 |
|
||||
#define VDAINI 0x40 |
|
||||
#define VDAQRY 0x41 |
|
||||
#define VDARES 0x42 |
|
||||
#define VDASCS 0x43 |
|
||||
|
|
||||
|
|
||||
int vdaini(devunit,vidmode,bitmapp) |
|
||||
unsigned int devunit; |
|
||||
unsigned int vidmode; |
|
||||
unsigned int bitmapp; |
|
||||
{ |
|
||||
hregbc = (VDAINI << 8) | devunit; |
|
||||
hregde = vidmode; |
|
||||
hreghl = bitmapp; |
|
||||
diagnose(); |
|
||||
return hrega; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
bitlook() |
|
||||
{ |
|
||||
unsigned char *p; |
|
||||
int ascii,row; |
|
||||
|
|
||||
p = 0x8000; |
|
||||
for(ascii=0;ascii<256;ascii++) { |
|
||||
printf("ascii = 0x%02x ",ascii); |
|
||||
for(row=0l;row<8;row++) { |
|
||||
printf("0x%02x ",*p++); |
|
||||
} |
|
||||
printf("\n"); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
|
|
||||
int vdaqry(devunit,bitmapp) |
|
||||
unsigned int devunit; |
|
||||
unsigned int bitmapp; |
|
||||
{ |
|
||||
hregbc = (VDAQRY << 8) | devunit; |
|
||||
hreghl = bitmapp; |
|
||||
diagnose(); |
|
||||
return hrega; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
flip() |
|
||||
{ |
|
||||
unsigned char * p; |
|
||||
unsigned char byte; |
|
||||
int offs; |
|
||||
int retcode; |
|
||||
|
|
||||
retcode = vdaqry(VDA_N8 << 4,0x8000); |
|
||||
|
|
||||
p = 0x8000; |
|
||||
for(offs=0;offs<256*8;offs++) { |
|
||||
byte = *p; |
|
||||
byte = byte ^ 255; |
|
||||
*p = byte; |
|
||||
p++; |
|
||||
} |
|
||||
|
|
||||
/* bitlook(); */ |
|
||||
|
|
||||
vdaini(VDA_N8 << 4, 0, 0x8000); |
|
||||
} |
|
||||
|
|
||||
|
|
||||
int main(argc,argv) |
|
||||
int argc; |
|
||||
char *argv[]; |
|
||||
{ |
|
||||
int bRunning; |
|
||||
|
|
||||
bRunning = 1; |
|
||||
while(1 == bRunning) { |
|
||||
|
|
||||
crtlc ( |
|
||||
dregbc = 1; |
|
||||
bdoscall(); |
|
||||
switch(drega) { |
|
||||
case 'f': flip(); break; |
|
||||
case 3: bRunning = 0; break; |
|
||||
default: printf("%c",7); break; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
flip(); |
|
||||
} |
|
||||
|
|
||||
@ -1,12 +0,0 @@ |
|||||
; ffsetlu.lib 1/24/2012 dwg - |
|
||||
ffgetlu macro |
|
||||
mvi c,RETCURR |
|
||||
call BDOS |
|
||||
mov c,a |
|
||||
call BISELDSK |
|
||||
lxi d,16+2 |
|
||||
dad d |
|
||||
mov a,m |
|
||||
endm |
|
||||
; eof - ffsetlu |
|
||||
|
|
||||
@ -1,25 +0,0 @@ |
|||||
; ffhaslu.lib 1/22/2012 dwg - macro to detect drive with logical unit support |
|
||||
|
|
||||
ffhaslu macro |
|
||||
local ret$false,fini |
|
||||
mvi c,RETCURR |
|
||||
call BDOS |
|
||||
mov c,a |
|
||||
call BISELDSK |
|
||||
lxi d,16 ; offset to end of DPH |
|
||||
dad d ; calc offset of 1st signature byte |
|
||||
mov a,m ; pick up first sig byte which s/b 'L' |
|
||||
cpi 'L' |
|
||||
jnz ret$false ; if it wasn't, indicate to caller no LU |
|
||||
inx h ; bump ptr to 2nd signature byte |
|
||||
mov a,m ; pick up second sig byte which s/b 'U' |
|
||||
cpi 'U' |
|
||||
jnz ret$false ; if it wasn't, indicate to caller no LU |
|
||||
mvi a,TRUE ; otherwise indicate presence of LU support |
|
||||
jmp fini ; finish up macro |
|
||||
ret$false: |
|
||||
mvi a,FALSE ; prepare negative response for caller |
|
||||
fini: |
|
||||
endm |
|
||||
|
|
||||
|
|
||||
@ -1,13 +0,0 @@ |
|||||
; ffnumlu.lib 1/22/2012 dwg - macro to get number of logical units |
|
||||
|
|
||||
ffnumlu macro |
|
||||
mvi c,RETCURR |
|
||||
call BDOS |
|
||||
mov c,a |
|
||||
call BISELDSK |
|
||||
lxi d,16+2+2 ; offset to end of DPH |
|
||||
dad d ; calc offset of 1st signature byte |
|
||||
mov a,m |
|
||||
endm |
|
||||
|
|
||||
; eof - ffnumlu.lib |
|
||||
@ -1,22 +0,0 @@ |
|||||
; ffsetlu.lib 2/12/2012 dwg - review for use in superfmt |
|
||||
; ffsetlu.lib 1/24/2012 dwg - |
|
||||
|
|
||||
; enter with desired LU in A reg |
|
||||
ffsetlu macro |
|
||||
enter |
|
||||
push psw |
|
||||
mvi c,RETCURR |
|
||||
call BDOS |
|
||||
mov c,a |
|
||||
call BISELDSK ; uses c parameter (drive) |
|
||||
lxi d,16+2 |
|
||||
dad d |
|
||||
pop psw |
|
||||
mov m,a ; put slice into CURRENT |
|
||||
mvi c,13 |
|
||||
call BDOS |
|
||||
leave |
|
||||
endm |
|
||||
|
|
||||
; eof - ffsetlu |
|
||||
|
|
||||
File diff suppressed because it is too large
@ -1,98 +0,0 @@ |
|||||
/* flip.c 11/17/2012 dwg - reverse the contrast */ |
|
||||
|
|
||||
#include "std.h" |
|
||||
#include "applvers.h" |
|
||||
#include "diagnose.h" |
|
||||
|
|
||||
#define VDA_N8 4 |
|
||||
#define VDAINI 0x40 |
|
||||
#define VDAQRY 0x41 |
|
||||
#define VDARES 0x42 |
|
||||
#define VDASCS 0x43 |
|
||||
|
|
||||
int vdaini(devunit,vidmode,bitmapp) |
|
||||
unsigned int devunit; |
|
||||
unsigned int vidmode; |
|
||||
unsigned int bitmapp; |
|
||||
{ |
|
||||
hregbc = (VDAINI << 8) | devunit; |
|
||||
printf("hregbc = 0x%04x\n",hregbc); |
|
||||
hregde = vidmode; |
|
||||
printf("hregde = 0x%04x\n",hregde); |
|
||||
hreghl = bitmapp; |
|
||||
printf("hreghl = 0x%04x\n",hreghl); |
|
||||
diagnose(); |
|
||||
printf("VDAINI called, return code was 0x%02x\n",hrega); |
|
||||
return hrega; |
|
||||
} |
|
||||
|
|
||||
bitlook() |
|
||||
{ |
|
||||
unsigned char *p; |
|
||||
int ascii,row; |
|
||||
|
|
||||
p = 0x8000; |
|
||||
for(ascii=0;ascii<256;ascii++) { |
|
||||
printf("ascii = 0x%02x ",ascii); |
|
||||
for(row=0l;row<8;row++) { |
|
||||
printf("0x%02x ",*p++); |
|
||||
} |
|
||||
printf("\n"); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
int vdaqry(devunit,bitmapp) |
|
||||
unsigned int devunit; |
|
||||
unsigned int bitmapp; |
|
||||
{ |
|
||||
hregbc = (VDAQRY << 8) | devunit; |
|
||||
printf("hregbc = 0x%04x\n",hregbc); |
|
||||
hreghl = bitmapp; |
|
||||
|
|
||||
if(hreghl != 0x8000) printf("vdaqry says hl != 0x8000\n"); |
|
||||
|
|
||||
diagnose(); |
|
||||
printf("VDAQRY called, status was 0x%02x\n",hrega); |
|
||||
printf(" video mode was 0x%02x\n",hregbc & 255); |
|
||||
printf(" row count was 0x%02x(%d)\n", |
|
||||
(hregde >> 8),(hregde >> 8) ); |
|
||||
printf(" column count was 0x%02x(%d)\n", |
|
||||
hregde & 255, hregde & 255); |
|
||||
|
|
||||
/* if(0 != bitmapp) {
|
|
||||
printf("vdaqry called with bitmap pointer\n"); |
|
||||
bitlook(); |
|
||||
} |
|
||||
*/ |
|
||||
|
|
||||
return hrega; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
int main(argc,argv) |
|
||||
int argc; |
|
||||
char *argv[]; |
|
||||
{ |
|
||||
unsigned char * p; |
|
||||
unsigned char byte; |
|
||||
int offs; |
|
||||
int retcode; |
|
||||
|
|
||||
printf("flip.com(c) 11/15/2012 dwg - \n\n"); |
|
||||
|
|
||||
retcode = vdaqry(VDA_N8 << 4,0x8000); |
|
||||
|
|
||||
p = 0x8000; |
|
||||
for(offs=0;offs<256*8;offs++) { |
|
||||
byte = *p; |
|
||||
byte = byte ^ 255; |
|
||||
*p = byte; |
|
||||
p++; |
|
||||
} |
|
||||
|
|
||||
/* bitlook(); */ |
|
||||
|
|
||||
vdaini(VDA_N8 << 4, 0, 0x8000); |
|
||||
} |
|
||||
|
|
||||
|
|
||||
@ -1,107 +0,0 @@ |
|||||
/* form.c 8/21/2012 dwg - */ |
|
||||
|
|
||||
|
|
||||
#define MAXDRIVE 8 |
|
||||
#include "cpm80.h" |
|
||||
#include "cpmbdos.h" |
|
||||
#include "bdoscall.h" |
|
||||
#include "cpmappl.h" |
|
||||
#include "applvers.h" |
|
||||
#include "cnfgdata.h" |
|
||||
#include "syscfg.h" |
|
||||
|
|
||||
|
|
||||
#define BDOS 5 /* memory address of BDOS invocation */ |
|
||||
#define HIGHSEG 0x0C000 /* memory address of system config */ |
|
||||
#define GETSYSCFG 0x0F000 /* HBIOS function for Get System Configuration */ |
|
||||
|
|
||||
|
|
||||
struct SYSCFG * pSYSCFG = HIGHSEG; |
|
||||
|
|
||||
#define FRMFLDS 2 |
|
||||
#define FRSTLIN 6 |
|
||||
#define VISCOL 3 |
|
||||
#define VISSIZ 6 |
|
||||
#define VALCOL (VISCOL+VISSIZ+4) |
|
||||
#define VALSIZ 32 |
|
||||
|
|
||||
struct FORM { |
|
||||
int visline; |
|
||||
int viscol; |
|
||||
int vissize; |
|
||||
char visible[VISSIZ+1]; |
|
||||
int valline; |
|
||||
int valcol; |
|
||||
char value[VALSIZ+1]; |
|
||||
} form[FRMFLDS] = { |
|
||||
{ FRSTLIN, VISCOL, VISSIZ, "field1", FRSTLIN, VALCOL, "default1" }, |
|
||||
{ FRSTLIN+1, VISCOL, VISSIZ, "field2", FRSTLIN+1, VALCOL, "default2" } |
|
||||
}; |
|
||||
|
|
||||
|
|
||||
int main(argc,argv) |
|
||||
int argc; |
|
||||
char *argv[]; |
|
||||
{ |
|
||||
int i,j; |
|
||||
char buffer[VALSIZ+2]; |
|
||||
|
|
||||
hregbc = GETSYSCFG; /* function = Get System Config */ |
|
||||
hregde = HIGHSEG; /* addr of dest (must be high) */ |
|
||||
diagnose(); /* invoke the NBIOS function */ |
|
||||
pSYSCFG = HIGHSEG; |
|
||||
|
|
||||
crtinit(pSYSCFG->cnfgdata.termtype); |
|
||||
crtclr(); |
|
||||
crtlc(0,0); |
|
||||
|
|
||||
banner("FORM"); |
|
||||
|
|
||||
for(i=0;i<FRMFLDS;i++) { |
|
||||
crtlc(form[i].visline,form[i].viscol); |
|
||||
printf("%s",form[i].visible); |
|
||||
crtlc(form[i].valline,form[i].valcol); |
|
||||
for(j=0;j<strlen(form[i].value);j++) { |
|
||||
printf("_"); |
|
||||
} |
|
||||
crtlc(form[i].valline,form[i].valcol); |
|
||||
printf("%s",form[i].value); |
|
||||
} |
|
||||
|
|
||||
for(i=0;i<FRMFLDS;i++) { |
|
||||
crtlc(form[i].valline,form[i].valcol); |
|
||||
|
|
||||
memset(buffer,0,sizeof(buffer)); |
|
||||
dregbc = 10; /* READ CONSOLE BUFFER */ |
|
||||
dregde = &buffer; |
|
||||
buffer[0] = VALSIZ-1; |
|
||||
buffer[1] = 0; |
|
||||
bdoscall(); |
|
||||
if(0 < buffer[1]) { |
|
||||
memset(form[i].value,0,VALSIZ); |
|
||||
strcpy(form[i].value,buffer[2]); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
|
|
||||
for(i=0;i<FRMFLDS;i++) { |
|
||||
|
|
||||
crtlc(form[i].visline,form[i].viscol); |
|
||||
printf("%s",form[i].visible); |
|
||||
|
|
||||
crtlc(form[i].valline,form[i].valcol); |
|
||||
for(j=0;j<strlen(form[i].value);j++) { |
|
||||
printf(" "); |
|
||||
} |
|
||||
|
|
||||
crtlc(form[i].valline,form[i].valcol); |
|
||||
printf("%s",form[i].value); |
|
||||
} |
|
||||
|
|
||||
|
|
||||
|
|
||||
} |
|
||||
|
|
||||
/**************************************************************************/ |
|
||||
|
|
||||
|
|
||||
@ -1,8 +0,0 @@ |
|||||
#include <stdio.h> |
|
||||
#include "ascii.h" |
|
||||
|
|
||||
main() |
|
||||
{ |
|
||||
printf("%c",ASCII_FF); |
|
||||
} |
|
||||
|
|
||||
@ -1,333 +0,0 @@ |
|||||
/* test.c 7/23/2012 dwg - */ |
|
||||
|
|
||||
#include "stdio.h" |
|
||||
#include "applvers.h" |
|
||||
#include "ctermcap.h" |
|
||||
|
|
||||
/* declarations for HBIOS access */ |
|
||||
extern char hrega; |
|
||||
extern unsigned int hregbc; |
|
||||
extern unsigned int hregde; |
|
||||
extern unsigned int hreghl; |
|
||||
extern diagnose(); |
|
||||
|
|
||||
/* declaration dir BIOS and BDOS and low level calls */ |
|
||||
extern char xrega; |
|
||||
extern unsigned int xregbc; |
|
||||
extern unsigned int xregde; |
|
||||
extern unsigned int xreghl; |
|
||||
extern asmif(); /* asmif(0x0E6**,bc,de,hl); */ |
|
||||
|
|
||||
#define BDOS 5 /* memory address of BDOS invocation */ |
|
||||
#define PRIFCB 0x5C /* memory address of primary FCB */ |
|
||||
#define SECFCB 0x6C /* memory address of secondary FCB */ |
|
||||
#define DEFBUF 0x80 /* memory address of default buffer */ |
|
||||
#define HIGHSEG 0x0C000 /* memory address of system config */ |
|
||||
|
|
||||
#define GETSYSCFG 0x0F000 /* HBIOS function for Get System Configuration */ |
|
||||
|
|
||||
#define TERMCPM 0 /* BDOS function for System Reset */ |
|
||||
#define CONIN 1 /* BDOS function for Console Input */ |
|
||||
#define CWRITE 2 /* BDOS function for Console Output */ |
|
||||
#define DIRCONIO 6 /* BDOS function for Direct Console I/O */ |
|
||||
#define PRINTSTR 9 /* BDOS function for Print String */ |
|
||||
#define RDCONBUF 10 /* BDOS function for Buffered Console Read */ |
|
||||
#define GETCONST 11 /* BDOS function for Get Console Status */ |
|
||||
#define RETVERNUM 12 /* BDOS function for Return Version Number */ |
|
||||
#define RESDISKSYS 13 /* BDOS function for Reset Disk System */ |
|
||||
#define SELECTDISK 14 /* BDOS function for Select Disk */ |
|
||||
#define FOPEN 15 /* BDOS function for File Open */ |
|
||||
#define FCLOSE 16 /* BDOS function for File Close */ |
|
||||
#define SEARCHFIRST 17 /* BDOS function for Search First */ |
|
||||
#define SEARCHNEXT 18 /* BDOS function for Search Next */ |
|
||||
#define FDELETE 19 /* BDOS function for File Delete */ |
|
||||
#define FREADSEQ 20 /* BDOS function for File Read Sequential */ |
|
||||
#define FWRITESEQ 21 /* BDOS function for File Write Sequential */ |
|
||||
#define FMAKEFILE 22 /* BDOS function for File Make */ |
|
||||
#define FRENAME 23 /* BDOS function for File Rename */ |
|
||||
#define RETLOGINVEC 24 /* BDOS function for Return Login Vector */ |
|
||||
#define RETCURRDISK 25 /* BDOS function for Return Current Disk */ |
|
||||
#define SETDMAADDR 26 /* BDOS function for Set DMA Address */ |
|
||||
#define GETALLOCVEC 27 /* BDOS function for Get Allocation Vector */ |
|
||||
#define WRPROTDISK 28 /* BDOS function for Write Protect Disk */ |
|
||||
#define GETROVECTOR 29 /* BDOS function for Get Read Only Vector */ |
|
||||
#define FSETATTRIB 30 /* BDOS function for File Set Attribute */ |
|
||||
#define GETDPBADDR 31 /* BDOS function for Get DPB Address */ |
|
||||
#define SETGETUSER 32 /* BDOS function for Set & Get User Number */ |
|
||||
#define FREADRANDOM 33 /* BDOS function for File Read Random */ |
|
||||
#define FWRITERAND 34 /* BDOS function for File Write Random */ |
|
||||
#define FCOMPSIZE 35 /* BDOS function for File Compare Size */ |
|
||||
#define SETRANDREC 36 /* BDOS function for Set Random Record # */ |
|
||||
#define RESETDRIVE 37 /* BDOS function for Reset Drive */ |
|
||||
#define WRRANDFILL 38 /* BDOS function for Write Random w/ Fill */ |
|
||||
|
|
||||
#define BDOSDEFDR 0 /* BDOS Default (current) Drive Number */ |
|
||||
#define BDOSDRA 1 /* BDOS Drive A: number */ |
|
||||
#define BDOSDRB 2 /* BDOS Drive B: number */ |
|
||||
#define BDOSDRC 3 /* BDOS Drive C: number */ |
|
||||
#define BDOSDRD 4 /* BDOS Drive D: number */ |
|
||||
#define BDOSDRE 5 /* BDOS Drive E: number */ |
|
||||
#define BDOSDRF 6 /* BDOS Drive F: number */ |
|
||||
#define BDOSDRG 7 /* BDOS Drive G: number */ |
|
||||
#define BDOSDRH 8 /* BDOS Drive H: number */ |
|
||||
|
|
||||
#define BIOSDRA 0 /* BIOS Drive A: number */ |
|
||||
#define BIOSDRB 1 /* BIOS Drive B: number */ |
|
||||
#define BIOSDRC 2 /* BIOS Drive C: number */ |
|
||||
#define BIOSDRD 3 /* BIOS Drive D: number */ |
|
||||
#define BIOSDRE 4 /* BIOS Drive E: number */ |
|
||||
#define BIOSDRF 5 /* BIOS Drive F: number */ |
|
||||
#define BIOSDRG 6 /* BIOS Drive G: number */ |
|
||||
#define BIOSDRH 7 /* BIOS Drive H: number */ |
|
||||
|
|
||||
struct FCB { |
|
||||
char drive; /* BDOS Drive Code */ |
|
||||
char filename[8]; /* space padded file name */ |
|
||||
char filetype[3]; /* space padded file extension */ |
|
||||
char filler[24]; /* remainder of FCB */ |
|
||||
}; |
|
||||
|
|
||||
struct FCB * pPriFcb = PRIFCB; /* pointer to Primary FCB structure */ |
|
||||
|
|
||||
struct FCB * pSecFcb = SECFCB; /* pointer to secondary FCB structure */ |
|
||||
|
|
||||
struct { |
|
||||
char length; /* length of commad tail */ |
|
||||
char tail[127]; /* command tail */ |
|
||||
} * pDefBuf = DEFBUF; |
|
||||
|
|
||||
|
|
||||
#define CURDRV 0x00004 |
|
||||
#define BIOSAD 0x0e600 /* base address of BIOS jumps */ |
|
||||
|
|
||||
/* addresses of BIOS jumps */ |
|
||||
#define pBOOT 0x0E600 |
|
||||
#define pWBOOT 0x0E603 |
|
||||
#define pCONST 0x0E606 |
|
||||
#define pCONIN 0x0E609 |
|
||||
#define pCONOUT 0x0E60C |
|
||||
#define pLIST 0x0E60F |
|
||||
#define pPUNCH 0x0E612 |
|
||||
#define pREADER 0x0E615 |
|
||||
#define pHOME 0x0E618 |
|
||||
#define pSELDSK 0x0E61B |
|
||||
#define pSETTRK 0x0E61E |
|
||||
#define pSETSEC 0x0E621 |
|
||||
#define pSETDMA 0x0E624 |
|
||||
#define pREAD 0x0E627 |
|
||||
#define pWRITE 0x0E62A |
|
||||
#define pLISTST 0x0E62D |
|
||||
#define pSECTRN 0x0E630 |
|
||||
#define pBNKSEL 0x0E633 |
|
||||
#define pGETLU 0x0E636 |
|
||||
#define pSETLU 0x0E639 |
|
||||
#define pGETINFO 0x0E63C |
|
||||
|
|
||||
struct JMP { |
|
||||
unsigned char opcode; /* JMP opcode */ |
|
||||
unsigned int address; /* JMP address */ |
|
||||
}; |
|
||||
|
|
||||
struct BIOS { |
|
||||
struct JMP boot; |
|
||||
struct JMP wboot; |
|
||||
struct JMP const; |
|
||||
struct JMP conin; |
|
||||
struct JMP conout; |
|
||||
struct JMP list; |
|
||||
struct JMP punch; |
|
||||
struct JMP reader; |
|
||||
struct JMP home; |
|
||||
struct JMP seldsk; |
|
||||
struct JMP settrk; |
|
||||
struct JMP setsec; |
|
||||
struct JMP setdma; |
|
||||
struct JMP read; |
|
||||
struct JMP write; |
|
||||
struct JMP listst; |
|
||||
struct JMP sectrn; |
|
||||
struct JMP bnksel; |
|
||||
struct JMP getlu; |
|
||||
struct JMP setlu; |
|
||||
struct JMP getinfo; |
|
||||
struct JMP rsvd1; |
|
||||
struct JMP rsvd2; |
|
||||
struct JMP rsvd3; |
|
||||
struct JMP rsvd4; |
|
||||
|
|
||||
char rmj; |
|
||||
char rmn; |
|
||||
char rup; |
|
||||
char rtp; |
|
||||
|
|
||||
} * pBIOS = 0xe600; |
|
||||
|
|
||||
/* pointer based Disk Parameter Block structure */ |
|
||||
struct DPB { |
|
||||
unsigned int spt; |
|
||||
unsigned char bsh; |
|
||||
unsigned char blm; |
|
||||
unsigned char exm; |
|
||||
unsigned int dsm; |
|
||||
unsigned int drm; |
|
||||
unsigned char al0; |
|
||||
unsigned int cks; |
|
||||
unsigned int off; |
|
||||
} * pDPB; |
|
||||
|
|
||||
/* pointer based Disk Parameter Header structure */ |
|
||||
struct DPH { |
|
||||
unsigned int xlt; |
|
||||
unsigned int rv1; |
|
||||
unsigned int rv2; |
|
||||
unsigned int rv3; |
|
||||
unsigned int dbf; |
|
||||
struct DPB * pDpb; |
|
||||
unsigned int csv; |
|
||||
unsigned int alv; |
|
||||
unsigned char sigl; |
|
||||
unsigned char sigu; |
|
||||
unsigned int current; |
|
||||
unsigned int number; |
|
||||
} * pDPH; |
|
||||
|
|
||||
/* pointer based Information List structure */ |
|
||||
struct INFOLIST { |
|
||||
int version; |
|
||||
void * banptr; |
|
||||
void * varloc; |
|
||||
void * tstloc; |
|
||||
void * dpbmap; |
|
||||
void * dphmap; |
|
||||
void * ciomap; |
|
||||
} * pINFOLIST; |
|
||||
|
|
||||
/* pointer based Configuration Data structure */ |
|
||||
struct CNFGDATA { |
|
||||
unsigned char rmj; |
|
||||
unsigned char rmn; |
|
||||
unsigned char rup; |
|
||||
unsigned char rtp; |
|
||||
unsigned char diskboot; |
|
||||
unsigned char devunit; |
|
||||
unsigned int bootlu; |
|
||||
unsigned char hour; |
|
||||
unsigned char minute; |
|
||||
unsigned char second; |
|
||||
unsigned char month; |
|
||||
unsigned char day; |
|
||||
unsigned char year; |
|
||||
unsigned char freq; |
|
||||
unsigned char platform; |
|
||||
unsigned char dioplat; |
|
||||
unsigned char vdumode; |
|
||||
unsigned int romsize; |
|
||||
unsigned int ramsize; |
|
||||
unsigned char clrramdk; |
|
||||
unsigned char dskyenable; |
|
||||
unsigned char uartenable; |
|
||||
unsigned char vduenable; |
|
||||
unsigned char fdenable; |
|
||||
unsigned char fdtrace; |
|
||||
unsigned char fdmedia; |
|
||||
unsigned char fdmediaalt; |
|
||||
unsigned char fdmauto; |
|
||||
unsigned char ideenable; |
|
||||
unsigned char idetrace; |
|
||||
unsigned char ide8bit; |
|
||||
unsigned int idecapacity; |
|
||||
unsigned char ppideenable; |
|
||||
unsigned char ppidetrace; |
|
||||
unsigned char ppide8bit; |
|
||||
unsigned int ppidecapacity; |
|
||||
unsigned char ppideslow; |
|
||||
unsigned char boottype; |
|
||||
unsigned char boottimeout; |
|
||||
unsigned char bootdefault; |
|
||||
unsigned int baudrate; |
|
||||
unsigned char ckdiv; |
|
||||
unsigned char memwait; |
|
||||
unsigned char iowait; |
|
||||
unsigned char cntlb0; |
|
||||
unsigned char cntlb1; |
|
||||
unsigned char sdenable; |
|
||||
unsigned char sdtrace; |
|
||||
unsigned int sdcapacity; |
|
||||
unsigned char sdcsio; |
|
||||
unsigned char sdcsiofast; |
|
||||
unsigned char defiobyte; |
|
||||
unsigned char termtype; |
|
||||
unsigned int revision; |
|
||||
unsigned char prpsdenable; |
|
||||
unsigned char prpsdtrace; |
|
||||
unsigned int prpsdcapacity; |
|
||||
unsigned char prpconenable; |
|
||||
unsigned int biossize; |
|
||||
unsigned char pppenable; |
|
||||
unsigned char pppsdenable; |
|
||||
unsigned char pppsdtrace; |
|
||||
unsigned int pppsdcapacity; |
|
||||
unsigned char pppconenable; |
|
||||
unsigned char prpenable; |
|
||||
} * pCNFGDATA; |
|
||||
|
|
||||
|
|
||||
struct JMP_TAG { |
|
||||
unsigned char opcode; |
|
||||
unsigned int address; |
|
||||
}; |
|
||||
|
|
||||
|
|
||||
/* pointer based System Configuration structure */ |
|
||||
struct SYSCFG { |
|
||||
struct JMP_TAG jmp; |
|
||||
void * cnfloc; |
|
||||
void * tstloc; |
|
||||
void * varloc; |
|
||||
struct CNFGDATA cnfgdata; |
|
||||
char filler[256-3-2-2-2-sizeof(struct CNFGDATA)]; |
|
||||
} * pSYSCFG = HIGHSEG; |
|
||||
|
|
||||
|
|
||||
main(argc,argv) |
|
||||
int argc; |
|
||||
char *argv[]; |
|
||||
{ |
|
||||
FILE * fd; |
|
||||
|
|
||||
hregbc = GETSYSCFG; /* function = Get System Config */ |
|
||||
hregde = HIGHSEG; /* addr of dest (must be high) */ |
|
||||
diagnose(); /* invoke the NBIOS function */ |
|
||||
|
|
||||
printf("TT is %d\n",pSYSCFG->cnfgdata.termtype); |
|
||||
|
|
||||
crtinit(pSYSCFG->cnfgdata.termtype); |
|
||||
crtclr(); |
|
||||
crtlc(0,0); |
|
||||
|
|
||||
printf( |
|
||||
"GETCFG.COM %d/%d/%d %d.%d.%d.%d dwg - Elegantly Expressed CP/M Program\n", |
|
||||
A_MONTH,A_DAY,A_YEAR, |
|
||||
pBIOS->rmj,pBIOS->rmn,pBIOS->rup,pBIOS->rtp); |
|
||||
|
|
||||
fd = fopen("syscfg.bin","w"); |
|
||||
fwrite(HIGHSEG,1,256,fd); |
|
||||
fclose(fd); |
|
||||
|
|
||||
|
|
||||
|
|
||||
asmif(pGETINFO,0,0,0); /* get addr of the information list */ |
|
||||
pINFOLIST = xreghl; /* set base pointer of the structure */ |
|
||||
|
|
||||
asmif(BDOS,RETCURRDISK,0,0); /* get current drive into xrega */ |
|
||||
asmif(pSELDSK,xrega,0,0); /* get DPH of current drive */ |
|
||||
pDPH = xreghl; /* establish addressability to DPH */ |
|
||||
pDPB = pDPH->pDpb; /* establish addressability to DPB */ |
|
||||
|
|
||||
/* printf("spt is %d\n",pDPB->spt); */ /* demonstrate DPB access */ |
|
||||
|
|
||||
|
|
||||
|
|
||||
} |
|
||||
|
|
||||
|
|
||||
@ -1,18 +0,0 @@ |
|||||
/****************************************************************/ |
|
||||
/* globals.h 9/4/2012 dwg - increase MAXDRIVE to 12 */ |
|
||||
/* globals.h 3/11/2012 dwg - add BIOS_ADDR */ |
|
||||
/* globals.h 3/11/2012 dwg - declarations common to all modules */ |
|
||||
/****************************************************************/ |
|
||||
|
|
||||
#define CR 0x0d |
|
||||
#define LF 0x0a |
|
||||
#define ESC 27 |
|
||||
|
|
||||
#define BIOSAD 0x0e600 |
|
||||
#define INFLSTV 1 |
|
||||
|
|
||||
#define MAXDRIVE 12 |
|
||||
|
|
||||
/*******************/ |
|
||||
/* eof - globals.h */ |
|
||||
/*******************/ |
|
||||
@ -1,18 +0,0 @@ |
|||||
; globals.lib 7/19/2012 dwg - update for 2.0.0.0 B22 |
|
||||
; globals.lib 1/18/2012 dwg - program globals |
|
||||
|
|
||||
ENGLISH equ TRUE |
|
||||
SPANISH equ FALSE |
|
||||
|
|
||||
MAX$LABEL equ 16 |
|
||||
STACK$SIZE equ 512 |
|
||||
|
|
||||
COLON equ ':' |
|
||||
|
|
||||
stack macro |
|
||||
ds STACK$SIZE |
|
||||
stack$top: |
|
||||
endm |
|
||||
|
|
||||
; eof - globals.lib |
|
||||
|
|
||||
@ -1,16 +0,0 @@ |
|||||
; hardware.lib 1/18/2012 dwg - hardware declarations |
|
||||
HASZ80 equ TRUE |
|
||||
|
|
||||
; I/O address of Zeta RTC |
|
||||
zeta$rtc equ 70h |
|
||||
; write bit definitions |
|
||||
z$rtc$ce equ 10h |
|
||||
z$rtc$we equ 20h |
|
||||
z$rtc$clk equ 40h |
|
||||
z$rtc$inp equ 80h |
|
||||
; read bit definitions |
|
||||
z$rtc$out equ 01h |
|
||||
z$rtc$cfg equ 40h |
|
||||
|
|
||||
; eof - hardware.lib |
|
||||
|
|
||||
@ -1,18 +0,0 @@ |
|||||
; hbios.asm 7/19/2012 dwg - |
|
||||
|
|
||||
CFGVERS equ 0 |
|
||||
|
|
||||
public xgetsc |
|
||||
xgetsc: |
|
||||
enter |
|
||||
mvi b,0F0h |
|
||||
mvi c,CFGVERS |
|
||||
lxi d,8000h |
|
||||
db 0cfh ; rst 8 |
|
||||
lxi h,8000h |
|
||||
leave |
|
||||
ret |
|
||||
|
|
||||
|
|
||||
END |
|
||||
|
|
||||
@ -1,48 +0,0 @@ |
|||||
/* hbios.h 7/4/2012 dgw - */ |
|
||||
|
|
||||
/* CIO */ |
|
||||
|
|
||||
/* Character Input (CIOIN) */ |
|
||||
|
|
||||
/* Character Output (CIOOUT) */ |
|
||||
|
|
||||
/* Character Input Status (CIOIST) */ |
|
||||
|
|
||||
/* Character Output Status (CIOOST) */ |
|
||||
|
|
||||
/* DIO */ |
|
||||
|
|
||||
/* Disk Read (DIORD) */ |
|
||||
|
|
||||
/* Disk Write (DIOWR) */ |
|
||||
|
|
||||
/* Disk Status (DIOST) */ |
|
||||
|
|
||||
/* Disk Media (DIOMED) */ |
|
||||
|
|
||||
/* Disk Idetify (DIOID) */ |
|
||||
|
|
||||
/* Disk Get Buffer Address (DIOGBA) */ |
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
/*
|
|
||||
extern char hrega; |
|
||||
extern unsigned int hregbc; |
|
||||
extern unsigned int hregde; |
|
||||
extern unsigned int hreghl; |
|
||||
extern diagnose(); |
|
||||
*/ |
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
/*****************/ |
|
||||
/* eof - hbios.h */ |
|
||||
/*****************/ |
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
@ -1,3 +0,0 @@ |
|||||
; hbios.lib 7/19/2012 dwg - |
|
||||
extrn xgetsc |
|
||||
|
|
||||
@ -1,333 +0,0 @@ |
|||||
/* test.c 7/21/2012 dwg - */ |
|
||||
|
|
||||
#include "stdio.h" |
|
||||
#include "applvers.h" |
|
||||
|
|
||||
/* declarations for HBIOS access */ |
|
||||
extern char hrega; |
|
||||
extern unsigned int hregbc; |
|
||||
extern unsigned int hregde; |
|
||||
extern unsigned int hreghl; |
|
||||
extern diagnose(); |
|
||||
|
|
||||
/* declaration dir BIOS and BDOS and low level calls */ |
|
||||
extern char xrega; |
|
||||
extern unsigned int xregbc; |
|
||||
extern unsigned int xregde; |
|
||||
extern unsigned int xreghl; |
|
||||
extern asmif(); /* asmif(0x0E6**,bc,de,hl); */ |
|
||||
|
|
||||
#define BDOS 5 /* memory address of BDOS invocation */ |
|
||||
#define PRIFCB 0x5C /* memory address of primary FCB */ |
|
||||
#define SECFCB 0x6C /* memory address of secondary FCB */ |
|
||||
#define DEFBUF 0x80 /* memory address of default buffer */ |
|
||||
#define HIGHSEG 0x0C000 /* memory address of system config */ |
|
||||
|
|
||||
#define GETSYSCFG 0x0F000 /* HBIOS function for Get System Configuration */ |
|
||||
|
|
||||
#define TERMCPM 0 /* BDOS function for System Reset */ |
|
||||
#define CONIN 1 /* BDOS function for Console Input */ |
|
||||
#define CWRITE 2 /* BDOS function for Console Output */ |
|
||||
#define DIRCONIO 6 /* BDOS function for Direct Console I/O */ |
|
||||
#define PRINTSTR 9 /* BDOS function for Print String */ |
|
||||
#define RDCONBUF 10 /* BDOS function for Buffered Console Read */ |
|
||||
#define GETCONST 11 /* BDOS function for Get Console Status */ |
|
||||
#define RETVERNUM 12 /* BDOS function for Return Version Number */ |
|
||||
#define RESDISKSYS 13 /* BDOS function for Reset Disk System */ |
|
||||
#define SELECTDISK 14 /* BDOS function for Select Disk */ |
|
||||
#define FOPEN 15 /* BDOS function for File Open */ |
|
||||
#define FCLOSE 16 /* BDOS function for File Close */ |
|
||||
#define SEARCHFIRST 17 /* BDOS function for Search First */ |
|
||||
#define SEARCHNEXT 18 /* BDOS function for Search Next */ |
|
||||
#define FDELETE 19 /* BDOS function for File Delete */ |
|
||||
#define FREADSEQ 20 /* BDOS function for File Read Sequential */ |
|
||||
#define FWRITESEQ 21 /* BDOS function for File Write Sequential */ |
|
||||
#define FMAKEFILE 22 /* BDOS function for File Make */ |
|
||||
#define FRENAME 23 /* BDOS function for File Rename */ |
|
||||
#define RETLOGINVEC 24 /* BDOS function for Return Login Vector */ |
|
||||
#define RETCURRDISK 25 /* BDOS function for Return Current Disk */ |
|
||||
#define SETDMAADDR 26 /* BDOS function for Set DMA Address */ |
|
||||
#define GETALLOCVEC 27 /* BDOS function for Get Allocation Vector */ |
|
||||
#define WRPROTDISK 28 /* BDOS function for Write Protect Disk */ |
|
||||
#define GETROVECTOR 29 /* BDOS function for Get Read Only Vector */ |
|
||||
#define FSETATTRIB 30 /* BDOS function for File Set Attribute */ |
|
||||
#define GETDPBADDR 31 /* BDOS function for Get DPB Address */ |
|
||||
#define SETGETUSER 32 /* BDOS function for Set & Get User Number */ |
|
||||
#define FREADRANDOM 33 /* BDOS function for File Read Random */ |
|
||||
#define FWRITERAND 34 /* BDOS function for File Write Random */ |
|
||||
#define FCOMPSIZE 35 /* BDOS function for File Compare Size */ |
|
||||
#define SETRANDREC 36 /* BDOS function for Set Random Record # */ |
|
||||
#define RESETDRIVE 37 /* BDOS function for Reset Drive */ |
|
||||
#define WRRANDFILL 38 /* BDOS function for Write Random w/ Fill */ |
|
||||
|
|
||||
#define BDOSDEFDR 0 /* BDOS Default (current) Drive Number */ |
|
||||
#define BDOSDRA 1 /* BDOS Drive A: number */ |
|
||||
#define BDOSDRB 2 /* BDOS Drive B: number */ |
|
||||
#define BDOSDRC 3 /* BDOS Drive C: number */ |
|
||||
#define BDOSDRD 4 /* BDOS Drive D: number */ |
|
||||
#define BDOSDRE 5 /* BDOS Drive E: number */ |
|
||||
#define BDOSDRF 6 /* BDOS Drive F: number */ |
|
||||
#define BDOSDRG 7 /* BDOS Drive G: number */ |
|
||||
#define BDOSDRH 8 /* BDOS Drive H: number */ |
|
||||
|
|
||||
#define BIOSDRA 0 /* BIOS Drive A: number */ |
|
||||
#define BIOSDRB 1 /* BIOS Drive B: number */ |
|
||||
#define BIOSDRC 2 /* BIOS Drive C: number */ |
|
||||
#define BIOSDRD 3 /* BIOS Drive D: number */ |
|
||||
#define BIOSDRE 4 /* BIOS Drive E: number */ |
|
||||
#define BIOSDRF 5 /* BIOS Drive F: number */ |
|
||||
#define BIOSDRG 6 /* BIOS Drive G: number */ |
|
||||
#define BIOSDRH 7 /* BIOS Drive H: number */ |
|
||||
|
|
||||
struct FCB { |
|
||||
char drive; /* BDOS Drive Code */ |
|
||||
char filename[8]; /* space padded file name */ |
|
||||
char filetype[3]; /* space padded file extension */ |
|
||||
char filler[24]; /* remainder of FCB */ |
|
||||
}; |
|
||||
|
|
||||
struct FCB * pPriFcb = PRIFCB; /* pointer to Primary FCB structure */ |
|
||||
|
|
||||
struct FCB * pSecFcb = SECFCB; /* pointer to secondary FCB structure */ |
|
||||
|
|
||||
struct { |
|
||||
char length; /* length of commad tail */ |
|
||||
char tail[127]; /* command tail */ |
|
||||
} * pDefBuf = DEFBUF; |
|
||||
|
|
||||
|
|
||||
#define CURDRV 0x00004 |
|
||||
#define BIOSAD 0x0e600 /* base address of BIOS jumps */ |
|
||||
|
|
||||
/* addresses of BIOS jumps */ |
|
||||
#define pBOOT 0x0E600 |
|
||||
#define pWBOOT 0x0E603 |
|
||||
#define pCONST 0x0E606 |
|
||||
#define pCONIN 0x0E609 |
|
||||
#define pCONOUT 0x0E60C |
|
||||
#define pLIST 0x0E60F |
|
||||
#define pPUNCH 0x0E612 |
|
||||
#define pREADER 0x0E615 |
|
||||
#define pHOME 0x0E618 |
|
||||
#define pSELDSK 0x0E61B |
|
||||
#define pSETTRK 0x0E61E |
|
||||
#define pSETSEC 0x0E621 |
|
||||
#define pSETDMA 0x0E624 |
|
||||
#define pREAD 0x0E627 |
|
||||
#define pWRITE 0x0E62A |
|
||||
#define pLISTST 0x0E62D |
|
||||
#define pSECTRN 0x0E630 |
|
||||
#define pBNKSEL 0x0E633 |
|
||||
#define pGETLU 0x0E636 |
|
||||
#define pSETLU 0x0E639 |
|
||||
#define pGETINFO 0x0E63C |
|
||||
|
|
||||
struct JMP { |
|
||||
unsigned char opcode; /* JMP opcode */ |
|
||||
unsigned int address; /* JMP address */ |
|
||||
}; |
|
||||
|
|
||||
struct BIOS { |
|
||||
struct JMP boot; |
|
||||
struct JMP wboot; |
|
||||
struct JMP const; |
|
||||
struct JMP conin; |
|
||||
struct JMP conout; |
|
||||
struct JMP list; |
|
||||
struct JMP punch; |
|
||||
struct JMP reader; |
|
||||
struct JMP home; |
|
||||
struct JMP seldsk; |
|
||||
struct JMP settrk; |
|
||||
struct JMP setsec; |
|
||||
struct JMP setdma; |
|
||||
struct JMP read; |
|
||||
struct JMP write; |
|
||||
struct JMP listst; |
|
||||
struct JMP sectrn; |
|
||||
struct JMP bnksel; |
|
||||
struct JMP getlu; |
|
||||
struct JMP setlu; |
|
||||
struct JMP getinfo; |
|
||||
struct JMP rsvd1; |
|
||||
struct JMP rsvd2; |
|
||||
struct JMP rsvd3; |
|
||||
struct JMP rsvd4; |
|
||||
|
|
||||
char rmj; |
|
||||
char rmn; |
|
||||
char rup; |
|
||||
char rtp; |
|
||||
|
|
||||
} * pBIOS = 0xe600; |
|
||||
|
|
||||
/* pointer based Disk Parameter Block structure */ |
|
||||
struct DPB { |
|
||||
unsigned int spt; |
|
||||
unsigned char bsh; |
|
||||
unsigned char blm; |
|
||||
unsigned char exm; |
|
||||
unsigned int dsm; |
|
||||
unsigned int drm; |
|
||||
unsigned char al0; |
|
||||
unsigned int cks; |
|
||||
unsigned int off; |
|
||||
} * pDPB; |
|
||||
|
|
||||
/* pointer based Disk Parameter Header structure */ |
|
||||
struct DPH { |
|
||||
unsigned int xlt; |
|
||||
unsigned int rv1; |
|
||||
unsigned int rv2; |
|
||||
unsigned int rv3; |
|
||||
unsigned int dbf; |
|
||||
struct DPB * pDpb; |
|
||||
unsigned int csv; |
|
||||
unsigned int alv; |
|
||||
unsigned char sigl; |
|
||||
unsigned char sigu; |
|
||||
unsigned int current; |
|
||||
unsigned int number; |
|
||||
} * pDPH; |
|
||||
|
|
||||
/* pointer based Information List structure */ |
|
||||
struct INFOLIST { |
|
||||
int version; |
|
||||
void * banptr; |
|
||||
void * varloc; |
|
||||
void * tstloc; |
|
||||
void * dpbmap; |
|
||||
void * dphmap; |
|
||||
void * ciomap; |
|
||||
} * pINFOLIST; |
|
||||
|
|
||||
/* pointer based Configuration Data structure */ |
|
||||
struct CNFGDATA { |
|
||||
unsigned char rmj; |
|
||||
unsigned char rmn; |
|
||||
unsigned char rup; |
|
||||
unsigned char rtp; |
|
||||
unsigned char diskboot; |
|
||||
unsigned char devunit; |
|
||||
unsigned int bootlu; |
|
||||
unsigned char hour; |
|
||||
unsigned char minute; |
|
||||
unsigned char second; |
|
||||
unsigned char month; |
|
||||
unsigned char day; |
|
||||
unsigned char year; |
|
||||
unsigned char freq; |
|
||||
unsigned char platform; |
|
||||
unsigned char dioplat; |
|
||||
unsigned char vdumode; |
|
||||
unsigned int romsize; |
|
||||
unsigned int ramsize; |
|
||||
unsigned char clrramdk; |
|
||||
unsigned char dskyenable; |
|
||||
unsigned char uartenable; |
|
||||
unsigned char vduenable; |
|
||||
unsigned char fdenable; |
|
||||
unsigned char fdtrace; |
|
||||
unsigned char fdmedia; |
|
||||
unsigned char fdmediaalt; |
|
||||
unsigned char fdmauto; |
|
||||
unsigned char ideenable; |
|
||||
unsigned char idetrace; |
|
||||
unsigned char ide8bit; |
|
||||
unsigned int idecapacity; |
|
||||
unsigned char ppideenable; |
|
||||
unsigned char ppidetrace; |
|
||||
unsigned char ppide8bit; |
|
||||
unsigned int ppidecapacity; |
|
||||
unsigned char ppideslow; |
|
||||
unsigned char boottype; |
|
||||
unsigned char boottimeout; |
|
||||
unsigned char bootdefault; |
|
||||
unsigned int baudrate; |
|
||||
unsigned char ckdiv; |
|
||||
unsigned char memwait; |
|
||||
unsigned char iowait; |
|
||||
unsigned char cntlb0; |
|
||||
unsigned char cntlb1; |
|
||||
unsigned char sdenable; |
|
||||
unsigned char sdtrace; |
|
||||
unsigned int sdcapacity; |
|
||||
unsigned char sdcsio; |
|
||||
unsigned char sdcsiofast; |
|
||||
unsigned char defiobyte; |
|
||||
unsigned char termtype; |
|
||||
unsigned int revision; |
|
||||
unsigned char prpsdenable; |
|
||||
unsigned char prpsdtrace; |
|
||||
unsigned int prpsdcapacity; |
|
||||
unsigned char prpconenable; |
|
||||
unsigned int biossize; |
|
||||
unsigned char pppenable; |
|
||||
unsigned char pppsdenable; |
|
||||
unsigned char pppsdtrace; |
|
||||
unsigned int pppsdcapacity; |
|
||||
unsigned char pppconenable; |
|
||||
unsigned char prpenable; |
|
||||
} * pCNFGDATA; |
|
||||
|
|
||||
|
|
||||
struct JMP_TAG { |
|
||||
unsigned char opcode; |
|
||||
unsigned int address; |
|
||||
}; |
|
||||
|
|
||||
|
|
||||
/* pointer based System Configuration structure */ |
|
||||
struct SYSCFG { |
|
||||
struct JMP_TAG jmp; |
|
||||
void * cnfloc; |
|
||||
void * tstloc; |
|
||||
void * varloc; |
|
||||
struct CNFGDATA cnfgdata; |
|
||||
char filler[256-3-2-2-2-sizeof(struct CNFGDATA)]; |
|
||||
} * pSYSCFG = HIGHSEG; |
|
||||
|
|
||||
|
|
||||
main(argc,argv) |
|
||||
int argc; |
|
||||
char *argv[]; |
|
||||
{ |
|
||||
|
|
||||
|
|
||||
hregbc = GETSYSCFG; /* function = Get System Config */ |
|
||||
hregde = HIGHSEG; /* addr of dest (must be high) */ |
|
||||
diagnose(); /* invoke the NBIOS function */ |
|
||||
pSYSCFG = HIGHSEG; |
|
||||
|
|
||||
crtinit(pSYSCFG->cnfgdata.termtype); |
|
||||
crtclr(); |
|
||||
crtlc(0,0); |
|
||||
|
|
||||
/* printf("TT is %d\n",pSYSCFG->cnfgdata.termtype); */ |
|
||||
|
|
||||
|
|
||||
printf( |
|
||||
"TEST.COM %d/%d/%d %d.%d.%d.%d dwg - Elegantly Expressed CP/M Program\n", |
|
||||
A_MONTH,A_DAY,A_YEAR, |
|
||||
pBIOS->rmj,pBIOS->rmn,pBIOS->rup,pBIOS->rtp); |
|
||||
|
|
||||
asmif(pGETINFO,0,0,0); /* get addr of the information list */ |
|
||||
pINFOLIST = xreghl; /* set base pointer of the structure */ |
|
||||
|
|
||||
asmif(BDOS,RETCURRDISK,0,0); /* get current drive into xrega */ |
|
||||
asmif(pSELDSK,xrega,0,0); /* get DPH of current drive */ |
|
||||
pDPH = xreghl; /* establish addressability to DPH */ |
|
||||
pDPB = pDPH->pDpb; /* establish addressability to DPB */ |
|
||||
|
|
||||
/* printf("spt is %d\n",pDPB->spt); */ /* demonstrate DPB access */ |
|
||||
|
|
||||
hregbc = GETSYSCFG; /* function = Get System Config */ |
|
||||
hregde = HIGHSEG; /* addr of dest (must be high) */ |
|
||||
diagnose(); /* invoke the NBIOS function */ |
|
||||
|
|
||||
/* printf("TT is %d\n",pSYSCFG->cnfgdata.termtype); */ |
|
||||
|
|
||||
|
|
||||
} |
|
||||
|
|
||||
|
|
||||
@ -1,11 +0,0 @@ |
|||||
#include <stdio.h> |
|
||||
#include <stdlib.h> |
|
||||
|
|
||||
int main(argc,argv) |
|
||||
int argc; |
|
||||
char * argv[]; |
|
||||
{ |
|
||||
printf("Help World!!\n"); |
|
||||
return 0; |
|
||||
} |
|
||||
|
|
||||
@ -1,64 +0,0 @@ |
|||||
title 'Ident - Display Program Identification' |
|
||||
|
|
||||
; ident.asm 2/21/2012 dwg - review for release 2.0.0.0 |
|
||||
; ident.asm 2/19.2012 dwg - review for release 1.5.1.0 |
|
||||
; ident.asm 2/19/2012 dwg - remove test* & analyse & ws-shim |
|
||||
; ident.asm 2/18/2012 dwg - drives,map and slice become map |
|
||||
; ident.asm 2/14/2012 dwg - superfmt becomes multifmt |
|
||||
; ident.asm 2/13/2012 dwg - add disk |
|
||||
; ident.asm 2/12/2012 dwg - add cleardir and superfmt |
|
||||
; ident.asm 2/11/2012 dwg - Display the Ident of a program file |
|
||||
|
|
||||
; Copyright (C) 2011-2012 Douglas Goodall Licensed under GPL Ver 3. |
|
||||
; |
|
||||
; This file is part of NuBiosDWG and is free software: you can |
|
||||
; redistribute it and/or modify it under the terms of the GNU |
|
||||
; General Public License as published by the Free Software Foundation, |
|
||||
; either version 3 of the License, or (at your option) any later version. |
|
||||
; This file is distributed in the hope that it will be useful, |
|
||||
; but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||
; GNU General Public License for more details. |
|
||||
; You should have received a copy of the GNU General Public License |
|
||||
; along with it. If not, see <http://www.gnu.org/licenses/>. |
|
||||
|
|
||||
maclib portab |
|
||||
maclib globals |
|
||||
maclib cpmbdos |
|
||||
maclib cpmappl |
|
||||
maclib applvers |
|
||||
maclib banner |
|
||||
maclib printers |
|
||||
maclib dumpmac |
|
||||
maclib memory |
|
||||
maclib identity |
|
||||
|
|
||||
do$start |
|
||||
|
|
||||
idata |
|
||||
|
|
||||
sbanner argv |
|
||||
|
|
||||
ify 'ACCESS COM',TRUE |
|
||||
; ify 'ASSIGN COM',TRUE |
|
||||
; ify 'CPMNAME COM',TRUE |
|
||||
; ify 'ERASE COM',TRUE |
|
||||
ify 'FINDFILECOM',TRUE |
|
||||
; ify 'HEADER COM',TRUE |
|
||||
ify 'IDENT COM',TRUE |
|
||||
ify 'SETLABELCOM',TRUE |
|
||||
; ify 'MAP COM',TRUE |
|
||||
; ify 'METAVIEWCOM',TRUE |
|
||||
; ify 'MULTIFMTCOM',TRUE |
|
||||
ify 'NOACCESSCOM',TRUE |
|
||||
; ify 'PAUSE COM',TRUE |
|
||||
; ify 'REM COM',TRUE |
|
||||
; ify 'REQ1PARMCOM',TRUE |
|
||||
; ify 'STOP COM',TRUE |
|
||||
; ify 'TERMTYPECOM',TRUE |
|
||||
; ify 'WRITESYSCOM',FALSE |
|
||||
|
|
||||
do$end |
|
||||
|
|
||||
end |
|
||||
|
|
||||
@ -1,196 +0,0 @@ |
|||||
; identity.asm 2/17/2012 dwg - Program Identity Declarations |
|
||||
|
|
||||
maclib portab |
|
||||
maclib globals |
|
||||
maclib stdlib |
|
||||
maclib cpmbios |
|
||||
maclib cpmbdos |
|
||||
maclib memory |
|
||||
maclib printers |
|
||||
|
|
||||
public x$ident |
|
||||
x$ident: |
|
||||
shld lfcbptr ; save pointer to fcb |
|
||||
|
|
||||
mvi c,FOPEN |
|
||||
lhld lfcbptr |
|
||||
xchg |
|
||||
call BDOS |
|
||||
cpi 255 |
|
||||
jnz openok |
|
||||
|
|
||||
;;; memcpy lname,file1fcb+1,8 |
|
||||
mvi c,8 |
|
||||
lxi d,lname |
|
||||
lhld lfcbptr |
|
||||
inx h |
|
||||
call x$memcpy |
|
||||
|
|
||||
mvi a,',' |
|
||||
sta ldot |
|
||||
|
|
||||
;;; memcpy lext,file1fcb+9,3 |
|
||||
mvi c,3 |
|
||||
lhld lfcbptr |
|
||||
lxi d,9 |
|
||||
dad d |
|
||||
lxi d,lext |
|
||||
call x$memcpy |
|
||||
|
|
||||
|
|
||||
mvi a,'$' |
|
||||
sta lterm |
|
||||
print lname |
|
||||
printf ' -- File Not Found' |
|
||||
mvi a,FAILURE |
|
||||
jmp fini |
|
||||
openok: |
|
||||
|
|
||||
mvi c,SETDMA |
|
||||
lxi d,buffer |
|
||||
call BDOS |
|
||||
|
|
||||
mvi c,READSEQ |
|
||||
lhld lfcbptr |
|
||||
xchg |
|
||||
call BDOS |
|
||||
|
|
||||
|
|
||||
mvi c,SETDMA |
|
||||
lxi d,buffer+128 |
|
||||
call BDOS |
|
||||
|
|
||||
mvi c,READSEQ |
|
||||
lhld lfcbptr |
|
||||
xchg |
|
||||
call BDOS |
|
||||
|
|
||||
mvi c,FCLOSE |
|
||||
lhld lfcbptr |
|
||||
xchg |
|
||||
call BDOS |
|
||||
|
|
||||
lxi d,d$prog |
|
||||
mvi c,9 |
|
||||
call BDOS |
|
||||
|
|
||||
conout ',' |
|
||||
conout ' ' |
|
||||
lda p$rmj |
|
||||
mov l,a |
|
||||
mvi h,0 |
|
||||
call pr$d$word |
|
||||
conout '.' |
|
||||
lda p$rmn |
|
||||
mov l,a |
|
||||
call pr$d$word |
|
||||
conout '.' |
|
||||
lda p$rup |
|
||||
mov l,a |
|
||||
call pr$d$word |
|
||||
conout '.' |
|
||||
lda p$rtp |
|
||||
mov l,a |
|
||||
call pr$d$word |
|
||||
conout ',' |
|
||||
conout ' ' |
|
||||
|
|
||||
lda p$mon |
|
||||
mov l,a |
|
||||
call pr$d$word |
|
||||
conout '/' |
|
||||
lda p$day |
|
||||
mov l,a |
|
||||
call pr$d$word |
|
||||
conout '/' |
|
||||
lhld p$year |
|
||||
call pr$d$word |
|
||||
conout ',' |
|
||||
conout ' ' |
|
||||
|
|
||||
lxi d,d$prod |
|
||||
mvi c,9 |
|
||||
call BDOS |
|
||||
conout ',' |
|
||||
conout ' ' |
|
||||
|
|
||||
lxi d,d$orig |
|
||||
mvi c,9 |
|
||||
call BDOS |
|
||||
conout ',' |
|
||||
conout ' ' |
|
||||
|
|
||||
lxi d,d$ser |
|
||||
mvi c,9 |
|
||||
call BDOS |
|
||||
conout ',' |
|
||||
conout ' ' |
|
||||
|
|
||||
lda d$term2 |
|
||||
cpi '$' |
|
||||
jnz do$name |
|
||||
conout ' ' |
|
||||
lxi d,d$uuid+19 |
|
||||
jmp do$any |
|
||||
do$name: |
|
||||
lxi d,d$name |
|
||||
do$any: |
|
||||
mvi c,9 |
|
||||
call BDOS |
|
||||
|
|
||||
mvi a,SUCCESS ; set return code |
|
||||
fini: |
|
||||
ret |
|
||||
|
|
||||
lfcbptr ds 2 |
|
||||
ldrive ds 1 |
|
||||
lcolon ds 1 |
|
||||
lname ds 8 |
|
||||
ldot ds 1 |
|
||||
lext ds 3 |
|
||||
lterm ds 1 |
|
||||
|
|
||||
db 'buffer-->' |
|
||||
buffer ds 1 |
|
||||
p$start ds 2 |
|
||||
p$hexrf ds 16 |
|
||||
p$sig ds 2 |
|
||||
p$rmj ds 1 |
|
||||
p$rmn ds 1 |
|
||||
p$rup ds 1 |
|
||||
p$rtp ds 1 |
|
||||
p$mon ds 1 |
|
||||
p$day ds 1 |
|
||||
p$year ds 2 |
|
||||
p$argv ds 2 |
|
||||
p$e5 ds 1 |
|
||||
p$pr$st ds 2 |
|
||||
p$code1 ds 3 ; begin: lxi h,0 |
|
||||
p$code2 ds 1 ; dad sp |
|
||||
p$code3 ds 3 ; shld pre$stk |
|
||||
p$code4 ds 3 ; lxi sp,stack$top |
|
||||
p$code5 ds 1 ; nop |
|
||||
p$code6 ds 3 ; jmp around$bandata |
|
||||
p$prog ds 2 ; dw prog |
|
||||
p$dat ds 2 ; dw dat |
|
||||
p$prod ds 2 ; dw prod |
|
||||
p$orig ds 2 ; dw orig |
|
||||
p$ser ds 2 ; dw ser |
|
||||
p$nam ds 2 ; dw nam |
|
||||
p$term ds 2 ; dw 0 |
|
||||
d$prog ds 8+1+3+1 ; db '12345678.123$' |
|
||||
d$date ds 2+1+2+1+4+1 ; db ' 2/11/2012$' |
|
||||
d$ser ds 6+1 ; db '654321$' |
|
||||
d$prod ds 5+1 ; db 'CPM80$' |
|
||||
d$orig ds 3+1 ; db 'DWG$' |
|
||||
d$name ds 1+7+1+1+1+1+7+1 ; db ' Douglas W. Goodall$' |
|
||||
d$uuid ds 36 ; unique user identification |
|
||||
d$term2 ds 1 ; can be set to zero or dollar sign |
|
||||
p$len equ $-buffer |
|
||||
p$rsvd ds 256-p$len |
|
||||
db '<--buffer' |
|
||||
dw p$len |
|
||||
crlf db CR,LF,'$' |
|
||||
|
|
||||
; eof - identity.asm |
|
||||
|
|
||||
@ -1,191 +0,0 @@ |
|||||
; identity.lib 2/19/2012 dwg - add ify macro |
|
||||
; identity.lib 2/17/2012 dwg - Program Identity Declarations |
|
||||
|
|
||||
extrn x$ident |
|
||||
|
|
||||
ident macro file1fcb |
|
||||
lxi h,file1fcb |
|
||||
call x$ident |
|
||||
endm |
|
||||
|
|
||||
ify macro progname,bool |
|
||||
local done |
|
||||
local file |
|
||||
local fini |
|
||||
ident file |
|
||||
jmp fini |
|
||||
newfcb file,0,progname |
|
||||
fini: mvi a,bool |
|
||||
cpi TRUE |
|
||||
jnz done |
|
||||
conout CR |
|
||||
conout LF |
|
||||
done: |
|
||||
endm |
|
||||
|
|
||||
|
|
||||
identx macro file1fcb |
|
||||
local openok |
|
||||
local identend |
|
||||
|
|
||||
local ldrive,lcolon,lname,ldot,lext,lterm |
|
||||
|
|
||||
mvi c,FOPEN |
|
||||
lxi d,file1fcb |
|
||||
call BDOS |
|
||||
cpi 255 |
|
||||
jnz openok |
|
||||
|
|
||||
memcpy lname,file1fcb+1,8 |
|
||||
mvi a,',' |
|
||||
sta ldot |
|
||||
memcpy lext,file1fcb+9,3 |
|
||||
mvi a,'$' |
|
||||
sta lterm |
|
||||
print lname |
|
||||
printf ' -- File Not Found' |
|
||||
jmp identend |
|
||||
openok: |
|
||||
|
|
||||
mvi c,SETDMA |
|
||||
lxi d,buffer |
|
||||
call BDOS |
|
||||
|
|
||||
mvi c,READSEQ |
|
||||
lxi d,file1fcb |
|
||||
call BDOS |
|
||||
|
|
||||
mvi c,FCLOSE |
|
||||
lxi d,file1fcb |
|
||||
call BDOS |
|
||||
|
|
||||
lxi d,d$prog |
|
||||
mvi c,9 |
|
||||
call BDOS |
|
||||
|
|
||||
conout ',' |
|
||||
conout ' ' |
|
||||
lda p$rmj |
|
||||
mov l,a |
|
||||
mvi h,0 |
|
||||
call pr$d$word |
|
||||
conout '.' |
|
||||
lda p$rmn |
|
||||
mov l,a |
|
||||
call pr$d$word |
|
||||
conout '.' |
|
||||
lda p$rup |
|
||||
mov l,a |
|
||||
call pr$d$word |
|
||||
conout '.' |
|
||||
lda p$rtp |
|
||||
mov l,a |
|
||||
call pr$d$word |
|
||||
conout ',' |
|
||||
conout ' ' |
|
||||
|
|
||||
lda p$mon |
|
||||
mov l,a |
|
||||
call pr$d$word |
|
||||
conout '/' |
|
||||
lda p$day |
|
||||
mov l,a |
|
||||
call pr$d$word |
|
||||
conout '/' |
|
||||
lhld p$year |
|
||||
call pr$d$word |
|
||||
conout ',' |
|
||||
conout ' ' |
|
||||
|
|
||||
lxi d,d$prod |
|
||||
mvi c,9 |
|
||||
call BDOS |
|
||||
conout ',' |
|
||||
conout ' ' |
|
||||
|
|
||||
lxi d,d$orig |
|
||||
mvi c,9 |
|
||||
call BDOS |
|
||||
conout ',' |
|
||||
conout ' ' |
|
||||
|
|
||||
lxi d,d$ser |
|
||||
mvi c,9 |
|
||||
call BDOS |
|
||||
conout ',' |
|
||||
conout ' ' |
|
||||
|
|
||||
lxi d,d$name |
|
||||
mvi c,9 |
|
||||
call BDOS |
|
||||
jmp identend |
|
||||
|
|
||||
ldrive ds 1 |
|
||||
lcolon ds 1 |
|
||||
lname ds 8 |
|
||||
ldot ds 1 |
|
||||
lext ds 3 |
|
||||
lterm ds 1 |
|
||||
|
|
||||
identend: |
|
||||
endm |
|
||||
|
|
||||
idata macro |
|
||||
jmp around$bandata |
|
||||
argv dw prog,dat,prod,orig,ser,myname,0 |
|
||||
prog db 'IDENT.COM $' |
|
||||
date |
|
||||
serial |
|
||||
product |
|
||||
originator |
|
||||
oriname |
|
||||
uuid db '777A67C2-4A92-42D4-80FE-C96FD6483BD2$' |
|
||||
db 'buffer-->' |
|
||||
public buffer,p$start,p$hexrf,p$sig |
|
||||
public p$rmj,p$rmn,p$rup,p$rtp |
|
||||
public p$mon,p$day,p$year |
|
||||
buffer ds 1 |
|
||||
p$start ds 2 |
|
||||
p$hexrf ds 16 |
|
||||
p$sig ds 2 |
|
||||
p$rmj ds 1 |
|
||||
p$rmn ds 1 |
|
||||
p$rup ds 1 |
|
||||
p$rtp ds 1 |
|
||||
p$mon ds 1 |
|
||||
p$day ds 1 |
|
||||
p$year ds 2 |
|
||||
p$argv ds 2 |
|
||||
p$e5 ds 1 |
|
||||
p$pr$st ds 2 |
|
||||
p$code1 ds 3 ; begin: lxi h,0 |
|
||||
p$code2 ds 1 ; dad sp |
|
||||
p$code3 ds 3 ; shld pre$stk |
|
||||
p$code4 ds 3 ; lxi sp,stack$top |
|
||||
p$code5 ds 1 ; nop |
|
||||
p$code6 ds 3 ; jmp around$bandata |
|
||||
p$prog ds 2 ; dw prog |
|
||||
p$dat ds 2 ; dw dat |
|
||||
p$prod ds 2 ; dw prod |
|
||||
p$orig ds 2 ; dw orig |
|
||||
p$ser ds 2 ; dw ser |
|
||||
p$nam ds 2 ; dw nam |
|
||||
p$term ds 2 ; dw 0 |
|
||||
d$prog ds 8+1+3+1 ; db '12345678.123$' |
|
||||
d$date ds 2+1+2+1+4+1 ; db ' 2/11/2012$' |
|
||||
d$ser ds 6+1 ; db '654321$' |
|
||||
d$prod ds 5+1 ; db 'CPM80$' |
|
||||
d$orig ds 3+1 ; db 'DWG$' |
|
||||
d$name ds 1+7+1+1+1+1+7+1 ; db ' Douglas W. Goodall$' |
|
||||
d$uuid ds 37 ; unique user identification |
|
||||
d$term2 ds 1 ; can be set to zero or dollar sign |
|
||||
p$len equ $-buffer |
|
||||
p$rsvd ds 128-p$len |
|
||||
db '<--buffer' |
|
||||
crlf db CR,LF,'$' |
|
||||
around$bandata: |
|
||||
|
|
||||
endm |
|
||||
|
|
||||
; eof - identity.lib |
|
||||
|
|
||||
@ -1,16 +0,0 @@ |
|||||
/* infolist.h 6/7/2012 dwg - BIOS Information Structure version 2 */ |
|
||||
|
|
||||
struct INFOLIST { |
|
||||
int version; |
|
||||
void * banptr; |
|
||||
void * varloc; |
|
||||
void * tstloc; |
|
||||
void * dpbmap; |
|
||||
void * dphmap; |
|
||||
void * ciomap; |
|
||||
}; |
|
||||
|
|
||||
/********************/ |
|
||||
/* eof - infolist.h */ |
|
||||
/********************/ |
|
||||
|
|
||||
@ -1,124 +0,0 @@ |
|||||
/* label.c 67/10/2012 dwg - */ |
|
||||
|
|
||||
#include "stdio.h" |
|
||||
#include "cpmbios.h" |
|
||||
#include "bioscall.h" |
|
||||
#include "cpmbdos.h" |
|
||||
#include "bdoscall.h" |
|
||||
#include "metadata.h" |
|
||||
#include "banner.h" |
|
||||
|
|
||||
struct FCB * pPRIFCB; |
|
||||
struct FCB * pSECFCB; |
|
||||
struct DPH * pDPH; |
|
||||
struct DPB * pDPB; |
|
||||
|
|
||||
testdrive(drive) |
|
||||
int drive; |
|
||||
{ |
|
||||
ireghl = pSELDSK; |
|
||||
iregbc = drive; |
|
||||
bioscall(); |
|
||||
pDPH = ireghl; |
|
||||
pDPB = pDPH->dpb; |
|
||||
if(0 == pDPB->off) { |
|
||||
printf("Sorry Drive %c: has no prefix area and cannot be labeled", |
|
||||
drive+'A'); |
|
||||
exit(1); |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
interactive(drive) |
|
||||
int drive; |
|
||||
{ |
|
||||
int i; |
|
||||
|
|
||||
struct { |
|
||||
char size; |
|
||||
char len; |
|
||||
char data[16]; |
|
||||
} rdcons; |
|
||||
|
|
||||
testdrive(drive); |
|
||||
ireghl = pGETLU; |
|
||||
iregbc = drive; |
|
||||
bioscall(); |
|
||||
if(1 == irega) { |
|
||||
printf("interactive(%d) says drive %c: can't have label",drive,drive); |
|
||||
printf("%c",7); |
|
||||
exit(1); |
|
||||
|
|
||||
} |
|
||||
rdsector(drive,0,11,&metadata,0); |
|
||||
printf("Old label = "); |
|
||||
for(i=0;i<16;i++) { |
|
||||
printf("%c",metadata.label[i]); |
|
||||
} |
|
||||
|
|
||||
printf("\nNew label = "); |
|
||||
rdcons.size=16; |
|
||||
rdcons.len =0; |
|
||||
dregbc = RDCONBUF; |
|
||||
dregde = &rdcons; |
|
||||
bdoscall(); |
|
||||
|
|
||||
if(0 < rdcons.len) { |
|
||||
memset(metadata.label,' ',16); |
|
||||
memcpy(metadata.label,rdcons.data,rdcons.len); |
|
||||
wrsector(drive,0,11,&metadata,0); |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
noninteractive(drive,label) |
|
||||
int drive; |
|
||||
char * label; |
|
||||
{ |
|
||||
int i; |
|
||||
|
|
||||
testdrive(drive); |
|
||||
|
|
||||
rdsector(drive,0,11,&metadata,0); |
|
||||
memset(metadata.label,' ',16); |
|
||||
for(i=0;i<strlen(label);i++) { |
|
||||
metadata.label[i] = label[i]; |
|
||||
} |
|
||||
wrsector(drive,0,11,&metadata,0); |
|
||||
} |
|
||||
|
|
||||
main(argc,argv) |
|
||||
int argc; |
|
||||
char *argv[]; |
|
||||
{ |
|
||||
int i; |
|
||||
int drive; |
|
||||
char szDrive[3]; |
|
||||
|
|
||||
sbanner("LABEL.COM"); |
|
||||
|
|
||||
pPRIFCB = 0x5c; |
|
||||
|
|
||||
switch(argc) { |
|
||||
case 1: |
|
||||
dregbc = RETCURRDISK; |
|
||||
bdoscall(); |
|
||||
drive = drega; |
|
||||
interactive(drive); |
|
||||
break; |
|
||||
case 2: |
|
||||
if(2 == strlen(argv[1])) { |
|
||||
strcpy(szDrive,argv[1]); |
|
||||
if(':' == szDrive[1]) { |
|
||||
interactive(pPRIFCB->drive-1); |
|
||||
exit(0); |
|
||||
} |
|
||||
} |
|
||||
break; |
|
||||
default: |
|
||||
noninteractive(pPRIFCB->drive-1,0x85); |
|
||||
break; |
|
||||
} |
|
||||
exit(0); |
|
||||
} |
|
||||
|
|
||||
@ -1,217 +0,0 @@ |
|||||
; labelib.asm 2/22/2012 dwg - label library function implementation |
|
||||
; label.asm 2/11/2012 dwg - make ident compliant |
|
||||
; label.asm 2/11/2012 dwg - begin 1.6 enhancements |
|
||||
; label.asm 2/04/2012 dwg - use new macros for benefits |
|
||||
; label.asm 1/20/2012 dwg - label a drive or slice |
|
||||
|
|
||||
; |
|
||||
; Copyright (C) 2011-2012 Douglas Goodall Licensed under GPL Ver 3. |
|
||||
; |
|
||||
; This file is part of NuBiosDWG and is free software: you can |
|
||||
; redistribute it and/or modify it under the terms of the GNU |
|
||||
; General Public License as published by the Free Software Foundation, |
|
||||
; either version 3 of the License, or (at your option) any later version. |
|
||||
; This file is distributed in the hope that it will be useful, |
|
||||
; but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||
; GNU General Public License for more details. |
|
||||
; You should have received a copy of the GNU General Public License |
|
||||
; along with it. If not, see <http://www.gnu.org/licenses/>. |
|
||||
; |
|
||||
|
|
||||
|
|
||||
maclib portab |
|
||||
maclib globals |
|
||||
maclib cpmbios |
|
||||
maclib cpmbdos |
|
||||
maclib bioshdr |
|
||||
maclib hardware |
|
||||
maclib z80 |
|
||||
maclib memory |
|
||||
; maclib applvers |
|
||||
; maclib cpmappl |
|
||||
maclib printers |
|
||||
maclib metadata |
|
||||
; maclib banner |
|
||||
maclib stdlib |
|
||||
; maclib ffhaslu |
|
||||
; maclib identity |
|
||||
|
|
||||
|
|
||||
|
|
||||
cseg |
|
||||
|
|
||||
public x$label |
|
||||
x$label: |
|
||||
mov a,c |
|
||||
sta drive$num |
|
||||
|
|
||||
get$off |
|
||||
mov a,h |
|
||||
ora l |
|
||||
jnz off$ok |
|
||||
printf 'Sorry, you can only label drives with reserved tracks' |
|
||||
jmp main$exit |
|
||||
off$ok: |
|
||||
|
|
||||
lda drive$num |
|
||||
mov c,a |
|
||||
lxi h,buffer |
|
||||
call x$g$meta |
|
||||
|
|
||||
lda DEFBUF ! mov c,a |
|
||||
cpi 0 ! jnz x$lab2 |
|
||||
|
|
||||
; ; Interactive label functionality here... |
|
||||
|
|
||||
prompt: |
|
||||
; signature exists so label should be displayable |
|
||||
|
|
||||
print old$lbl |
|
||||
|
|
||||
; print label |
|
||||
lxi h,buffer |
|
||||
lxi d,meta$label |
|
||||
dad d |
|
||||
push h |
|
||||
pop d |
|
||||
mvi c,PRINTSTR |
|
||||
call BDOS |
|
||||
|
|
||||
print crlf |
|
||||
print new$lbl |
|
||||
|
|
||||
mvi c,READ$CON$BUF |
|
||||
lxi d,rcbuff |
|
||||
call BDOS |
|
||||
lda rclen |
|
||||
cpi 0 |
|
||||
jnz length$ok |
|
||||
jmp main$exit |
|
||||
length$ok: |
|
||||
inr a |
|
||||
sta DEFBUF |
|
||||
mvi a,' ' |
|
||||
sta DEFBUF+1 |
|
||||
mov c,a |
|
||||
mvi b,0 |
|
||||
lxi h,rcdata |
|
||||
lxi d,DEFBUF+2 |
|
||||
ldir |
|
||||
|
|
||||
print crlf |
|
||||
|
|
||||
lda drive$num |
|
||||
mov c,a |
|
||||
; fall through to code below |
|
||||
|
|
||||
|
|
||||
;;; not$interactive: |
|
||||
|
|
||||
public x$lab2 |
|
||||
x$lab2: |
|
||||
; This routine can be used interactively or non-interactively. |
|
||||
; You can set up the default buffer at 80h and call x$lab2, |
|
||||
; or you can call x$label and it will interactively redo the label. |
|
||||
; |
|
||||
mov a,c |
|
||||
sta drive$num |
|
||||
|
|
||||
|
|
||||
lxi h,buffer |
|
||||
lxi d,meta$label |
|
||||
dad d |
|
||||
mvi a,' ' |
|
||||
lxi b,meta$label$len ; max length of label |
|
||||
call x$memset |
|
||||
|
|
||||
lda DEFBUF ; pick up length of command tail |
|
||||
cpi 18 ; compare with max size of label |
|
||||
jc lenok ; jump if size is within limits |
|
||||
mvi a,17 ; specify maximum size |
|
||||
sta DEFBUF ; and poke into default buffer size byte |
|
||||
|
|
||||
lenok: lda DEFBUF ; pick up command tail size byte |
|
||||
dcr a ; decrement |
|
||||
|
|
||||
mov c,a ; move to c reg as counter |
|
||||
mvi b,0 |
|
||||
|
|
||||
lxi h,buffer |
|
||||
lxi d,meta$label |
|
||||
dad d |
|
||||
xchg |
|
||||
lxi h,DEFBUF+2 ; set source index for move |
|
||||
ldir |
|
||||
|
|
||||
lxi h,buffer |
|
||||
lxi d,meta$term |
|
||||
dad d |
|
||||
mvi a,'$' |
|
||||
mov m,a |
|
||||
|
|
||||
lda drive$num |
|
||||
mov c,a |
|
||||
|
|
||||
lxi h,buffer |
|
||||
call x$u$meta |
|
||||
cpi FAILURE |
|
||||
jz write$prot$err |
|
||||
|
|
||||
lxi h,buffer |
|
||||
call x$p$meta |
|
||||
|
|
||||
print suc$msg |
|
||||
|
|
||||
jmp main$exit |
|
||||
|
|
||||
write$prot$err: |
|
||||
print wr$prot$msg |
|
||||
jmp main$exit |
|
||||
|
|
||||
readerr: |
|
||||
print rd$err$msg |
|
||||
jmp main$exit |
|
||||
|
|
||||
writeerr: |
|
||||
print wr$err$msg |
|
||||
jmp main$exit |
|
||||
|
|
||||
dontboth: |
|
||||
print usage$msg |
|
||||
|
|
||||
main$exit: |
|
||||
ret |
|
||||
|
|
||||
dseg |
|
||||
|
|
||||
suc$msg db 'Label Written Successfully$' |
|
||||
rd$err$msg db 'Sorry, cannot read label sector$' |
|
||||
wr$err$msg db 'Sorry, cannot write label sector$' |
|
||||
wr$prot$msg db 'Sorry, metadata is write protected$' |
|
||||
usage$msg db 'usage - label <label>$' |
|
||||
ver$msg db 'Sorry, requires RomWBW or NuBios v1.5$' |
|
||||
def$label db 'Unlabeled ',0 |
|
||||
init$msg db 'Label initialized$' |
|
||||
old$lbl db 'Old Label: $' |
|
||||
new$lbl db 'New Label: $' |
|
||||
copr$msg db 'Copyright (C) 2012 Douglas Goodall$' |
|
||||
lic$msg db 'Program licensed under the GPL v3$' |
|
||||
|
|
||||
crlf db CR,LF |
|
||||
term db '$' |
|
||||
|
|
||||
|
|
||||
drive$num ds 1 |
|
||||
|
|
||||
rcbuff db MAX$LABEL |
|
||||
rclen db 0 |
|
||||
rcdata ds MAX$LABEL |
|
||||
|
|
||||
buffer ds 128 |
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
end start |
|
||||
|
|
||||
@ -1,33 +0,0 @@ |
|||||
; labelib.lib 2/22/2012 dwg - label library macro front end |
|
||||
|
|
||||
|
|
||||
; Copyright (C) 2011-2012 Douglas Goodall Licensed under GPL Ver 3. |
|
||||
; |
|
||||
; This file is part of NuBiosDWG and is free software: you can |
|
||||
; redistribute it and/or modify it under the terms of the GNU |
|
||||
; General Public License as published by the Free Software Foundation, |
|
||||
; either version 3 of the License, or (at your option) any later version. |
|
||||
; This file is distributed in the hope that it will be useful, |
|
||||
; but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||
; GNU General Public License for more details. |
|
||||
; You should have received a copy of the GNU General Public License |
|
||||
; along with it. If not, see <http://www.gnu.org/licenses/>. |
|
||||
|
|
||||
|
|
||||
extrn x$label |
|
||||
|
|
||||
label macro drivenumber |
|
||||
mvi c,drivenumber |
|
||||
call x$label |
|
||||
endm |
|
||||
|
|
||||
extrn x$lab2 |
|
||||
|
|
||||
label2 macro drivenumber |
|
||||
mvi c,drivenumber |
|
||||
call x$lab2 |
|
||||
endm |
|
||||
|
|
||||
; eof - labelib.lib |
|
||||
|
|
||||
File diff suppressed because it is too large
@ -1,473 +0,0 @@ |
|||||
/* map.c 9/4/2012 dwg - added support for four more drives I: to L: */ |
|
||||
/* map.c 8/3/2012 dwg - added DEV_PPPSD and DEV_HDSK, fixed end of drives */ |
|
||||
/* map.c 6/7/2012 dwg - */ |
|
||||
|
|
||||
#include "portab.h" |
|
||||
|
|
||||
#include "globals.h" |
|
||||
|
|
||||
#include "stdio.h" |
|
||||
|
|
||||
#include "stdlib.h" |
|
||||
|
|
||||
#include "memory.h" |
|
||||
|
|
||||
#include "cpmbind.h" |
|
||||
|
|
||||
/* #include "cbioshdr.h" */ |
|
||||
|
|
||||
#include "infolist.h" |
|
||||
|
|
||||
#include "dphdpb.h" |
|
||||
|
|
||||
#include "dphmap.h" |
|
||||
|
|
||||
#include "metadata.h" |
|
||||
|
|
||||
#include "clogical.h" |
|
||||
|
|
||||
#include "applvers.h" |
|
||||
|
|
||||
#include "diagnose.h" |
|
||||
|
|
||||
#include "cnfgdata.h" |
|
||||
|
|
||||
#include "syscfg.h" |
|
||||
|
|
||||
/* #define MAXDRIVE 12 */ |
|
||||
|
|
||||
#define BDOS 5 /* memory address of BDOS invocation */ |
|
||||
#define HIGHSEG 0x0C000 /* memory address of system config */ |
|
||||
|
|
||||
#define GETSYSCFG 0x0F000 /* HBIOS function for Get System Configuration */ |
|
||||
|
|
||||
/* Drive List Geometry */ |
|
||||
#define COL1 5 |
|
||||
#define COL2 25 |
|
||||
#define COL3 45 |
|
||||
#define COL4 65 |
|
||||
|
|
||||
#define LINE 3 |
|
||||
|
|
||||
/* Logical Unit List Geometry */ |
|
||||
#define LGUT 5 |
|
||||
#define COL1A 0 |
|
||||
#define COL2A (80/3) |
|
||||
#define COL3A (2*COL2A) |
|
||||
|
|
||||
/* Nomenclature Geometry */ |
|
||||
#define LINE2 9 |
|
||||
|
|
||||
/* Misc Info Geometry */ |
|
||||
#define CDLINE 7 |
|
||||
|
|
||||
/* BDOS Function number */ |
|
||||
#define RETCURR 25 |
|
||||
|
|
||||
/* function defined in bdoscall.asm */ |
|
||||
extern lurst(); |
|
||||
|
|
||||
struct BIOS * pBIOS; |
|
||||
|
|
||||
struct DPH * pDPH; |
|
||||
|
|
||||
struct CNFGDATA * pCNFGDATA; |
|
||||
struct SYSCFG * pSYSCFG; |
|
||||
|
|
||||
|
|
||||
|
|
||||
int devunit; |
|
||||
int dev; |
|
||||
int unit; |
|
||||
int currlu; |
|
||||
int numlu; |
|
||||
int drivenum; |
|
||||
int drive; |
|
||||
int deflu; |
|
||||
|
|
||||
char szTemp[128]; |
|
||||
|
|
||||
int readsec(drive,track,sector,buffer) |
|
||||
int drive; |
|
||||
int track; |
|
||||
int sector; |
|
||||
unsigned int buffer; |
|
||||
{ |
|
||||
ireghl = pSELDSK; |
|
||||
iregbc = drive; |
|
||||
iregde = 0; |
|
||||
bioscall(); |
|
||||
|
|
||||
ireghl = pSETTRK; |
|
||||
iregbc = track; |
|
||||
bioscall(); |
|
||||
|
|
||||
ireghl = pSETSEC; |
|
||||
iregbc = sector; |
|
||||
bioscall(); |
|
||||
|
|
||||
ireghl = pSETDMA; |
|
||||
iregbc = buffer; |
|
||||
bioscall(); |
|
||||
|
|
||||
ireghl = pREAD; |
|
||||
bioscall(); |
|
||||
return irega; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
int haslu(dr) |
|
||||
int dr; |
|
||||
{ |
|
||||
if(0 < lugnum(dr)) { |
|
||||
return TRUE; |
|
||||
} else { |
|
||||
return FALSE; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
|
|
||||
|
|
||||
void dispdph(l,c,drive,ptr) |
|
||||
int l; |
|
||||
int c; |
|
||||
char drive; |
|
||||
struct DPH *ptr; |
|
||||
{ |
|
||||
|
|
||||
/*
|
|
||||
unsigned int xlt; |
|
||||
unsigned int rv1; |
|
||||
unsigned int rv2; |
|
||||
unsigned int rv3; |
|
||||
unsigned int dbf; |
|
||||
unsigned int dpb; |
|
||||
unsigned int csv; |
|
||||
unsigned int alv; |
|
||||
unsigned char sigl; |
|
||||
unsigned char sigu; |
|
||||
unsigned int current; |
|
||||
unsigned int number; |
|
||||
*/ |
|
||||
|
|
||||
|
|
||||
/* 8/3/2012 dwg - detect end of drives properly */ |
|
||||
ireghl = pGETLU; |
|
||||
iregbc = drive-'A'; |
|
||||
bioscall(); |
|
||||
if(1 == irega) { |
|
||||
return; |
|
||||
} |
|
||||
|
|
||||
crtlc(l,c); |
|
||||
printf("%c: ",drive); |
|
||||
|
|
||||
|
|
||||
devunit = lugdu(drive-'A'); |
|
||||
|
|
||||
|
|
||||
dev = devunit & 0xf0; |
|
||||
unit = devunit & 0x0f; |
|
||||
|
|
||||
currlu = lugcur(drive-'A'); |
|
||||
switch(dev) { |
|
||||
case DEV_MD: |
|
||||
if(0 == unit) printf("ROM"); |
|
||||
if(1 == unit) printf("RAM"); |
|
||||
break; |
|
||||
case DEV_FD: |
|
||||
printf("FD%d",unit); |
|
||||
break; |
|
||||
case DEV_IDE: |
|
||||
printf("IDE%d",unit); |
|
||||
break; |
|
||||
case DEV_ATAPI: |
|
||||
printf("ATAPI%d",unit); |
|
||||
break; |
|
||||
case DEV_PPIDE: |
|
||||
printf("PPIDE%d",unit); |
|
||||
break; |
|
||||
case DEV_SD: |
|
||||
printf("SD%d",unit); |
|
||||
break; |
|
||||
case DEV_PRPSD: |
|
||||
printf("PRPSD%d",unit); |
|
||||
break; |
|
||||
case DEV_PPPSD: |
|
||||
printf("PPPSD%d",unit); |
|
||||
break; |
|
||||
case DEV_HDSK: |
|
||||
printf("HDSK%d",unit); |
|
||||
break; |
|
||||
default: |
|
||||
printf("UNK"); |
|
||||
break; |
|
||||
}; |
|
||||
|
|
||||
if('L' == (unsigned char)ptr->sigl) { |
|
||||
if('U' == (unsigned char)ptr->sigu) { |
|
||||
/* printf("-LU%d",(int)ptr->current); */ |
|
||||
printf("-LU%d",currlu); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
/* printf("dpb=0x%04x, ",(unsigned int)ptr->dpb);
|
|
||||
printf("sigl=0x%02x, ",(unsigned char)ptr->sigl); |
|
||||
printf("sigu=0x%02x, ",(unsigned char)ptr->sigu); |
|
||||
printf("curr=0x%04x, ",(unsigned int)ptr->current); |
|
||||
printf("numb=0x%04x", (unsigned int)ptr->number); |
|
||||
*/ |
|
||||
|
|
||||
} |
|
||||
|
|
||||
int main(argc,argv) |
|
||||
int argc; |
|
||||
char *argv[]; |
|
||||
{ |
|
||||
int i; |
|
||||
int mylu; |
|
||||
int drivenum; |
|
||||
int column; |
|
||||
int l; |
|
||||
int line; |
|
||||
int startlu; |
|
||||
int limit; |
|
||||
char bRunning; |
|
||||
char szDrive[32]; |
|
||||
char szLuNum[32]; |
|
||||
char szWP[2]; |
|
||||
struct INFOLIST * pINFOLIST; |
|
||||
|
|
||||
if(argc == 3) { |
|
||||
|
|
||||
strcpy(szDrive,argv[1]); |
|
||||
strcpy(szLuNum,argv[2]); |
|
||||
|
|
||||
mylu = atoi(szLuNum); |
|
||||
|
|
||||
if(strlen(szDrive) == 2) { |
|
||||
if(':' == szDrive[1]) { |
|
||||
switch(szDrive[0]) { |
|
||||
case 'a': |
|
||||
case 'A': |
|
||||
luscur(0,mylu); |
|
||||
break; |
|
||||
case 'b': |
|
||||
case 'B': |
|
||||
luscur(1,mylu); |
|
||||
break; |
|
||||
case 'c': |
|
||||
case 'C': |
|
||||
luscur(2,mylu); |
|
||||
break; |
|
||||
case 'd': |
|
||||
case 'D': |
|
||||
luscur(3,mylu); |
|
||||
break; |
|
||||
case 'e': |
|
||||
case 'E': |
|
||||
luscur(4,mylu); |
|
||||
break; |
|
||||
case 'f': |
|
||||
case 'F': |
|
||||
luscur(5,mylu); |
|
||||
break; |
|
||||
case 'g': |
|
||||
case 'G': |
|
||||
luscur(6,mylu); |
|
||||
break; |
|
||||
case 'h': |
|
||||
case 'H': |
|
||||
luscur(7,mylu); |
|
||||
break; |
|
||||
|
|
||||
case 'i': |
|
||||
case 'I': |
|
||||
luscur(8,mylu); |
|
||||
break; |
|
||||
case 'j': |
|
||||
case 'J': |
|
||||
luscur(9,mylu); |
|
||||
break; |
|
||||
case 'k': |
|
||||
case 'K': |
|
||||
luscur(10,mylu); |
|
||||
break; |
|
||||
case 'l': |
|
||||
case 'L': |
|
||||
luscur(11,mylu); |
|
||||
break; |
|
||||
|
|
||||
default: |
|
||||
break; |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
exit(1); |
|
||||
} |
|
||||
|
|
||||
|
|
||||
pBIOS = BIOSAD; |
|
||||
|
|
||||
|
|
||||
hregbc = GETSYSCFG; /* function = Get System Config */ |
|
||||
hregde = HIGHSEG; /* addr of dest (must be high) */ |
|
||||
diagnose(); /* invoke the NBIOS function */ |
|
||||
pSYSCFG = HIGHSEG; |
|
||||
crtinit(pSYSCFG->cnfgdata.termtype); |
|
||||
crtclr(); |
|
||||
crtlc(0,0); |
|
||||
|
|
||||
printf("MAP.COM %d/%d/%d v%d.%d.%d (%d)", |
|
||||
A_MONTH,A_DAY,A_YEAR,A_RMJ,A_RMN,A_RUP,A_RTP); |
|
||||
printf(" dwg - System Storage Drives and Logical Units"); |
|
||||
|
|
||||
ireghl = pGETINFO; |
|
||||
bioscall(); |
|
||||
pINFOLIST = ireghl; |
|
||||
|
|
||||
crtlc(CDLINE,COL3A+LGUT); |
|
||||
printf("infolist.version %d\n",pINFOLIST->version); |
|
||||
|
|
||||
pDPHMAP = (struct DPHMAPA *)pINFOLIST->dphmap; |
|
||||
|
|
||||
|
|
||||
dispdph(LINE, COL1,'A',(struct DPH *)pDPHMAP->drivea); |
|
||||
dispdph(LINE+1,COL1,'B',(struct DPH *)pDPHMAP->driveb); |
|
||||
dispdph(LINE+2,COL1,'C',(struct DPH *)pDPHMAP->drivec); |
|
||||
dispdph(LINE ,COL2,'D',(struct DPH *)pDPHMAP->drived); |
|
||||
dispdph(LINE+1,COL2,'E',(struct DPH *)pDPHMAP->drivee); |
|
||||
dispdph(LINE+2,COL2,'F',(struct DPH *)pDPHMAP->drivef); |
|
||||
dispdph(LINE, COL3,'G',(struct DPH *)pDPHMAP->driveg); |
|
||||
dispdph(LINE+1,COL3,'H',(struct DPH *)pDPHMAP->driveh); |
|
||||
dispdph(LINE+2,COL3,'I',(struct DPH *)pDPHMAP->drivei); |
|
||||
dispdph(LINE ,COL4,'J',(struct DPH *)pDPHMAP->drivej); |
|
||||
dispdph(LINE+1,COL4,'K',(struct DPH *)pDPHMAP->drivek); |
|
||||
dispdph(LINE+2,COL4,'L',(struct DPH *)pDPHMAP->drivel); |
|
||||
|
|
||||
dregbc = RETCURR; |
|
||||
bdoscall(); |
|
||||
drive = drega; |
|
||||
|
|
||||
crtlc(CDLINE,5); |
|
||||
printf("Current drive is %c:",'A'+drive); |
|
||||
|
|
||||
devunit = lugdu(drive); |
|
||||
dev = devunit & 0xf0; |
|
||||
unit = devunit & 0x0f; |
|
||||
currlu = lugcur(drive); |
|
||||
deflu = currlu; |
|
||||
numlu = lugnum(drive); |
|
||||
|
|
||||
crtlc(CDLINE,COL2A+LGUT); |
|
||||
printf("Number of LUs is %d\n",lugnum(drive)); |
|
||||
|
|
||||
if(0<numlu) { |
|
||||
crtlc(LINE2,COL1A+LGUT-1); |
|
||||
printf("LU P -----Label------"); |
|
||||
crtlc(LINE2,COL2A+LGUT-1); |
|
||||
printf("LU P -----Label------"); |
|
||||
crtlc(LINE2,COL3A+LGUT-1); |
|
||||
printf("LU P -----Label------"); |
|
||||
|
|
||||
startlu = 0; |
|
||||
limit = startlu+39; |
|
||||
if(limit>numlu) limit = numlu; |
|
||||
bRunning = 1; |
|
||||
|
|
||||
while(1 == bRunning) { |
|
||||
|
|
||||
line = LINE2+1; |
|
||||
column = 0; |
|
||||
|
|
||||
for(l=0;l<13;l++) { |
|
||||
crtlc(line+l,0); |
|
||||
/* 1 2 3 4 */ |
|
||||
/* 1234567890123456789012345678901234567890 */ |
|
||||
printf(" "); |
|
||||
/* 5 6 7 */ |
|
||||
/* 123456789012345678901234567890123456789 */ |
|
||||
printf(" "); |
|
||||
} |
|
||||
|
|
||||
for(i=startlu;i<limit;i++) { |
|
||||
int pad; |
|
||||
if (i >= 100) |
|
||||
pad = 0; |
|
||||
else if (i >= 10) |
|
||||
pad = 1; |
|
||||
else |
|
||||
pad = 2; |
|
||||
|
|
||||
luscur(drive,i); |
|
||||
readsec(drive,0,11,&metadata); |
|
||||
metadata.term = 0; |
|
||||
|
|
||||
|
|
||||
if(TRUE == metadata.writeprot) strcpy(szWP,"*"); |
|
||||
else strcpy(szWP," "); |
|
||||
|
|
||||
switch(column++) { |
|
||||
case 0: |
|
||||
crtlc(line,COL1A+LGUT-2+pad); |
|
||||
printf("%d %s %s",i,szWP,metadata.label); |
|
||||
break; |
|
||||
case 1: |
|
||||
crtlc(line,COL2A+LGUT-2+pad); |
|
||||
printf("%d %s %s",i,szWP,metadata.label); |
|
||||
break; |
|
||||
case 2: |
|
||||
crtlc(line,COL3A+LGUT-2+pad); |
|
||||
printf("%d %s %s",i,szWP,metadata.label); |
|
||||
column = 0; |
|
||||
line++; |
|
||||
break; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
crtlc(23,0); |
|
||||
printf("Options( N(ext), P(revious), Q(uit) )? "); |
|
||||
|
|
||||
dregbc = 1; /* CONIN */ |
|
||||
bdoscall(); |
|
||||
|
|
||||
switch(drega) { |
|
||||
case 'Q': |
|
||||
case 'q': |
|
||||
case 'X': |
|
||||
case 'x': |
|
||||
case 3: |
|
||||
bRunning = 0; |
|
||||
break; |
|
||||
case 'N': |
|
||||
case 'n': |
|
||||
case ' ': |
|
||||
startlu += 39; |
|
||||
if(startlu>numlu) startlu=0; |
|
||||
limit = startlu+39; |
|
||||
if(limit > numlu) limit = numlu; |
|
||||
break; |
|
||||
case 'P': |
|
||||
case 'p': |
|
||||
startlu -= 39; |
|
||||
if(startlu < 0) startlu = 0; |
|
||||
limit = startlu+39; |
|
||||
if (limit > numlu) limit = numlu; |
|
||||
break; |
|
||||
default: |
|
||||
printf("%c",7); |
|
||||
break; |
|
||||
} |
|
||||
|
|
||||
} /* end of (1==bRunning) */ |
|
||||
|
|
||||
luscur(drive,deflu); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
/****************/ |
|
||||
/* eof - cmap.c */ |
|
||||
/****************/ |
|
||||
@ -1,27 +0,0 @@ |
|||||
; memory.asm 2/1/2012 dwg - memory library implementation |
|
||||
maclib z80 |
|
||||
|
|
||||
;memcpy macro h=src,d==dst,bc=size |
|
||||
public x$memcpy |
|
||||
x$memcpy: |
|
||||
ldir |
|
||||
ret |
|
||||
|
|
||||
; memset macro h=dst,a=data,c=siz |
|
||||
public x$memset |
|
||||
x$memset: |
|
||||
push psw |
|
||||
x$ms$loop: |
|
||||
pop psw |
|
||||
mov m,a |
|
||||
inx h |
|
||||
dcx b |
|
||||
push psw |
|
||||
mov a,b |
|
||||
ora c |
|
||||
jnz x$ms$loop |
|
||||
pop psw |
|
||||
ret |
|
||||
|
|
||||
; eof - memory.asm |
|
||||
|
|
||||
@ -1,8 +0,0 @@ |
|||||
/* memory.h 3/13/2012 dwg - POSIX-like memory functions */ |
|
||||
|
|
||||
extern void memcmp(); |
|
||||
|
|
||||
extern void memcpy(); |
|
||||
|
|
||||
extern void memset(); |
|
||||
|
|
||||
@ -1,24 +0,0 @@ |
|||||
; memory.lib 2/17/2012 dwg - review for release 1.5.1.0 |
|
||||
; memory.lib 2/11/2012 dwg - review for release 1.5 |
|
||||
; memory.lib 2/04/2012 dwg - adjust for new macros |
|
||||
; memory.lib 1/13/2012 dwg - POSIX memcpy and memset |
|
||||
|
|
||||
extrn x$memcpy |
|
||||
extrn x$memset |
|
||||
|
|
||||
memcpy macro dst,src,siz |
|
||||
lxi d,dst ; load 1st positional parameter into reg |
|
||||
lxi h,src ; load 2nd positional parameter into reg |
|
||||
lxi b,siz ; load 3rd positional parameter into reg |
|
||||
call x$memcpy ; call actual routine in see memory.asm |
|
||||
endm |
|
||||
|
|
||||
memset macro dst,data,siz |
|
||||
lxi h,dst ; load 1st positional parameter into reg |
|
||||
mvi a,data ; load 2nd positional parameter into reg |
|
||||
lxi b,siz ; load 3rd positional parameter into reg |
|
||||
call x$memset ; call actual routine in see memory.asm |
|
||||
endm |
|
||||
|
|
||||
; eof - memory.lib |
|
||||
|
|
||||
@ -1,184 +0,0 @@ |
|||||
/* menu.c 8/4/2012 dwg - framework of newcode */ |
|
||||
|
|
||||
/* This code is known to work in both ANSI and WSYSE termtype modes */ |
|
||||
|
|
||||
#include "stdio.h" |
|
||||
#include "portab.h" |
|
||||
#include "globals.h" |
|
||||
#include "cpmbios.h" |
|
||||
#include "bioscall.h" |
|
||||
#include "cpmbdos.h" |
|
||||
#include "bdoscall.h" |
|
||||
#include "sectorio.h" |
|
||||
#include "diagnose.h" |
|
||||
#include "ctermcap.h" |
|
||||
#include "clogical.h" |
|
||||
#include "metadata.h" |
|
||||
#include "applvers.h" |
|
||||
#include "cnfgdata.h" |
|
||||
#include "syscfg.h" |
|
||||
|
|
||||
|
|
||||
#define BDOS 5 /* memory address of BDOS invocation */ |
|
||||
#define HIGHSEG 0x0C000 /* memory address of system config */ |
|
||||
#define GETSYSCFG 0x0F000 /* HBIOS function for Get System Configuration */ |
|
||||
|
|
||||
#define HORIZ "-" |
|
||||
#define VERTI "|" |
|
||||
#define SPACE ' ' |
|
||||
|
|
||||
struct SYSCFG * pSYSCFG = HIGHSEG; |
|
||||
|
|
||||
|
|
||||
struct MENUENT { |
|
||||
char * szName; |
|
||||
void (*meFunc)(); |
|
||||
struct MENUENT * pmeNext; |
|
||||
}; |
|
||||
|
|
||||
mfFile(); |
|
||||
mfEdit(); |
|
||||
mfView(); |
|
||||
mfOptions(); |
|
||||
mfTransfer(); |
|
||||
mfScript(); |
|
||||
mfTools(); |
|
||||
mfHelp(); |
|
||||
|
|
||||
struct MENUENT meHelp = { "Help", &mfHelp, NULL }; |
|
||||
struct MENUENT meTools = { "Tools", &mfTools, &meHelp }; |
|
||||
struct MENUENT meScript = { "Script", &mfScript, &meTools }; |
|
||||
struct MENUENT meTransfer = { "Transfer", &mfTransfer, &meScripts }; |
|
||||
struct MENUENT meOptions = { "Otions", &mfOptions, &meTransfer }; |
|
||||
struct MENUENT meView = { "View", &mfView, &meOptions }; |
|
||||
struct MENUENT meEdit = { "Edit", &mfEdit, &meView }; |
|
||||
struct MENUENT meFile = { "File", &mfFile, &meEdit }; |
|
||||
|
|
||||
struct MENU { |
|
||||
struct MENUENT * pFirstEnt; |
|
||||
}; |
|
||||
|
|
||||
|
|
||||
struct MENU mMain = { &meFile }; |
|
||||
|
|
||||
struct WINDOW { |
|
||||
char ull; |
|
||||
char ulc; |
|
||||
char lrl; |
|
||||
char lrc; |
|
||||
char bFill; |
|
||||
struct MENU * pMenu; |
|
||||
}; |
|
||||
|
|
||||
struct WINDOW wRoot = { 1, 1, 23, 80, SPACE, &mMain}; |
|
||||
|
|
||||
window(win) |
|
||||
struct WINDOW * win; |
|
||||
{ char width,height,x,y,filler,i; |
|
||||
struct MENU * pm; |
|
||||
struct MENUENT * pme; |
|
||||
i = 0; |
|
||||
|
|
||||
width = win->lrc-win->ulc+1; |
|
||||
height = win->lrl-win->ull+1; |
|
||||
for(y=0;y<height;y++) { |
|
||||
crtlc(win->ull+y,win->lrc); |
|
||||
printf(VERTI); |
|
||||
} |
|
||||
for(y=0;y<height;y++) { |
|
||||
crtlc(win->ull+y,win->ulc); |
|
||||
printf(VERTI); |
|
||||
} |
|
||||
crtlc(win->ull,win->ulc); |
|
||||
for(x=0;x<width;x++) { |
|
||||
printf(HORIZ); |
|
||||
} |
|
||||
crtlc(win->lrl,win->ulc); |
|
||||
for(x=0;x<width;x++) { |
|
||||
printf(HORIZ); |
|
||||
} |
|
||||
|
|
||||
filler = win->bFill; |
|
||||
if(0 != filler) { |
|
||||
width = win->lrc-win->ulc-1; |
|
||||
height = win->lrl-win->ull-1; |
|
||||
for(y=0;y<height;y++) { |
|
||||
crtlc(win->ull+y+1,win->ulc+1); |
|
||||
for(x=0;x<width;x++) { |
|
||||
printf("%c",filler); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
|
|
||||
pm = win->pMenu; |
|
||||
if(0 != pm) { |
|
||||
crtlc(win->ull+1,win->ulc+1); |
|
||||
pme = pm->pFirstEnt; |
|
||||
while(0 != pme) { |
|
||||
printf("%s ",pme->szName); |
|
||||
pme = pme->pmeNext; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
} |
|
||||
|
|
||||
|
|
||||
} |
|
||||
|
|
||||
|
|
||||
mfFile() |
|
||||
{ |
|
||||
|
|
||||
} |
|
||||
|
|
||||
mfEdit() |
|
||||
{ |
|
||||
|
|
||||
} |
|
||||
|
|
||||
mfView() |
|
||||
{ |
|
||||
} |
|
||||
|
|
||||
mfOptions() |
|
||||
{ |
|
||||
} |
|
||||
|
|
||||
mfTransfer() |
|
||||
{ |
|
||||
} |
|
||||
|
|
||||
mfScript() |
|
||||
{ |
|
||||
} |
|
||||
|
|
||||
mfTools() |
|
||||
{ |
|
||||
} |
|
||||
|
|
||||
mfHelp() |
|
||||
{ |
|
||||
} |
|
||||
|
|
||||
|
|
||||
main(argc,argv) |
|
||||
int argc; |
|
||||
char *argv[]; |
|
||||
{ |
|
||||
hregbc = GETSYSCFG; /* function = Get System Config */ |
|
||||
hregde = HIGHSEG; /* addr of dest (must be high) */ |
|
||||
diagnose(); /* invoke the NBIOS function */ |
|
||||
|
|
||||
pSYSCFG = HIGHSEG; |
|
||||
crtinit(pSYSCFG->cnfgdata.termtype); |
|
||||
crtclr(); |
|
||||
|
|
||||
window(&wRoot); |
|
||||
|
|
||||
crtlc(wRoot.lrl,wRoot.ulc); |
|
||||
} |
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
@ -1,184 +0,0 @@ |
|||||
/* menu.c 8/4/2012 dwg - framework of newcode */ |
|
||||
|
|
||||
/* This code is known to work in both ANSI and WSYSE termtype modes */ |
|
||||
|
|
||||
#include "stdio.h" |
|
||||
#include "portab.h" |
|
||||
#include "globals.h" |
|
||||
#include "cpmbios.h" |
|
||||
#include "bioscall.h" |
|
||||
#include "cpmbdos.h" |
|
||||
#include "bdoscall.h" |
|
||||
#include "sectorio.h" |
|
||||
#include "diagnose.h" |
|
||||
#include "ctermcap.h" |
|
||||
#include "clogical.h" |
|
||||
#include "metadata.h" |
|
||||
#include "applvers.h" |
|
||||
#include "cnfgdata.h" |
|
||||
#include "syscfg.h" |
|
||||
|
|
||||
|
|
||||
#define BDOS 5 /* memory address of BDOS invocation */ |
|
||||
#define HIGHSEG 0x0C000 /* memory address of system config */ |
|
||||
#define GETSYSCFG 0x0F000 /* HBIOS function for Get System Configuration */ |
|
||||
|
|
||||
#define HORIZ "-" |
|
||||
#define VERTI "|" |
|
||||
#define SPACE ' ' |
|
||||
|
|
||||
struct SYSCFG * pSYSCFG = HIGHSEG; |
|
||||
|
|
||||
|
|
||||
struct MENUENT { |
|
||||
char * szName; |
|
||||
void (*meFunc)(); |
|
||||
struct MENUENT * pmeNext; |
|
||||
}; |
|
||||
|
|
||||
mfFile(); |
|
||||
mfEdit(); |
|
||||
mfView(); |
|
||||
mfOptions(); |
|
||||
mfTransfer(); |
|
||||
mfScript(); |
|
||||
mfTools(); |
|
||||
mfHelp(); |
|
||||
|
|
||||
struct MENUENT meHelp = { "Help", &mfHelp, NULL }; |
|
||||
struct MENUENT meTools = { "Tools", &mfTools, &meHelp }; |
|
||||
struct MENUENT meScript = { "Script", &mfScript, &meTools }; |
|
||||
struct MENUENT meTransfer = { "Transfer", &mfTransfer, &meScripts }; |
|
||||
struct MENUENT meOptions = { "Otions", &mfOptions, &meTransfer }; |
|
||||
struct MENUENT meView = { "View", &mfView, &meOptions }; |
|
||||
struct MENUENT meEdit = { "Edit", &mfEdit, &meView }; |
|
||||
struct MENUENT meFile = { "File", &mfFile, &meEdit }; |
|
||||
|
|
||||
struct MENU { |
|
||||
struct MENUENT * pFirstEnt; |
|
||||
}; |
|
||||
|
|
||||
|
|
||||
struct MENU mMain = { &meFile }; |
|
||||
|
|
||||
struct WINDOW { |
|
||||
char ull; |
|
||||
char ulc; |
|
||||
char lrl; |
|
||||
char lrc; |
|
||||
char bFill; |
|
||||
struct MENU * pMenu; |
|
||||
}; |
|
||||
|
|
||||
struct WINDOW wRoot = { 1, 1, 23, 80, SPACE, &mMain}; |
|
||||
|
|
||||
window(win) |
|
||||
struct WINDOW * win; |
|
||||
{ char width,height,x,y,filler,i; |
|
||||
struct MENU * pm; |
|
||||
struct MENUENT * pme; |
|
||||
i = 0; |
|
||||
|
|
||||
width = win->lrc-win->ulc+1; |
|
||||
height = win->lrl-win->ull+1; |
|
||||
for(y=0;y<height;y++) { |
|
||||
crtlc(win->ull+y,win->lrc); |
|
||||
printf(VERTI); |
|
||||
} |
|
||||
for(y=0;y<height;y++) { |
|
||||
crtlc(win->ull+y,win->ulc); |
|
||||
printf(VERTI); |
|
||||
} |
|
||||
crtlc(win->ull,win->ulc); |
|
||||
for(x=0;x<width;x++) { |
|
||||
printf(HORIZ); |
|
||||
} |
|
||||
crtlc(win->lrl,win->ulc); |
|
||||
for(x=0;x<width;x++) { |
|
||||
printf(HORIZ); |
|
||||
} |
|
||||
|
|
||||
filler = win->bFill; |
|
||||
if(0 != filler) { |
|
||||
width = win->lrc-win->ulc-1; |
|
||||
height = win->lrl-win->ull-1; |
|
||||
for(y=0;y<height;y++) { |
|
||||
crtlc(win->ull+y+1,win->ulc+1); |
|
||||
for(x=0;x<width;x++) { |
|
||||
printf("%c",filler); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
|
|
||||
pm = win->pMenu; |
|
||||
if(0 != pm) { |
|
||||
crtlc(win->ull+1,win->ulc+1); |
|
||||
pme = pm->pFirstEnt; |
|
||||
while(0 != pme) { |
|
||||
printf("%s ",pme->szName); |
|
||||
pme = pme->pmeNext; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
} |
|
||||
|
|
||||
|
|
||||
} |
|
||||
|
|
||||
|
|
||||
mfFile() |
|
||||
{ |
|
||||
|
|
||||
} |
|
||||
|
|
||||
mfEdit() |
|
||||
{ |
|
||||
|
|
||||
} |
|
||||
|
|
||||
mfView() |
|
||||
{ |
|
||||
} |
|
||||
|
|
||||
mfOptions() |
|
||||
{ |
|
||||
} |
|
||||
|
|
||||
mfTransfer() |
|
||||
{ |
|
||||
} |
|
||||
|
|
||||
mfScript() |
|
||||
{ |
|
||||
} |
|
||||
|
|
||||
mfTools() |
|
||||
{ |
|
||||
} |
|
||||
|
|
||||
mfHelp() |
|
||||
{ |
|
||||
} |
|
||||
|
|
||||
|
|
||||
main(argc,argv) |
|
||||
int argc; |
|
||||
char *argv[]; |
|
||||
{ |
|
||||
hregbc = GETSYSCFG; /* function = Get System Config */ |
|
||||
hregde = HIGHSEG; /* addr of dest (must be high) */ |
|
||||
diagnose(); /* invoke the NBIOS function */ |
|
||||
|
|
||||
pSYSCFG = HIGHSEG; |
|
||||
crtinit(pSYSCFG->cnfgdata.termtype); |
|
||||
crtclr(); |
|
||||
|
|
||||
window(&wRoot); |
|
||||
|
|
||||
crtlc(wRoot.lrl,wRoot.ulc); |
|
||||
} |
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
@ -1,153 +0,0 @@ |
|||||
/* menu.c 8/4/2012 dwg - framework of newcode */ |
|
||||
|
|
||||
/* This code is known to work in bot ANSI and WSYSE termtype modes */ |
|
||||
|
|
||||
#include "stdio.h" |
|
||||
#include "portab.h" |
|
||||
#include "globals.h" |
|
||||
#include "cpmbios.h" |
|
||||
#include "bioscall.h" |
|
||||
#include "cpmbdos.h" |
|
||||
#include "bdoscall.h" |
|
||||
#include "sectorio.h" |
|
||||
#include "diagnose.h" |
|
||||
#include "ctermcap.h" |
|
||||
#include "clogical.h" |
|
||||
#include "metadata.h" |
|
||||
#include "applvers.h" |
|
||||
#include "cnfgdata.h" |
|
||||
#include "syscfg.h" |
|
||||
|
|
||||
#define BDOS 5 /* memory address of BDOS invocation */ |
|
||||
#define HIGHSEG 0x0C000 /* memory address of system config */ |
|
||||
|
|
||||
#define GETSYSCFG 0x0F000 /* HBIOS function for Get System Configuration */ |
|
||||
|
|
||||
struct SYSCFG * pSYSCFG = HIGHSEG; |
|
||||
|
|
||||
#define NORMAL 0 |
|
||||
#define BRIGHT 1 |
|
||||
#define UNDER 4 |
|
||||
#define BLINK 5 |
|
||||
#define REVERSE 7 |
|
||||
#define CANCEL 8 |
|
||||
|
|
||||
#define BLACK 0 |
|
||||
#define RED 1 |
|
||||
#define GREEN 2 |
|
||||
#define YELLOW 3 |
|
||||
#define BLUE 4 |
|
||||
#define MAGENTA 5 |
|
||||
#define CYAN 6 |
|
||||
#define WHITE 7 |
|
||||
|
|
||||
#define FG 30 |
|
||||
#define BG 40 |
|
||||
|
|
||||
struct BOX { |
|
||||
char ull; |
|
||||
char ulc; |
|
||||
char lrl; |
|
||||
char lrc; |
|
||||
char fgnd; |
|
||||
char bgnd; |
|
||||
}; |
|
||||
|
|
||||
struct BOX mainbx = { 1, 1, 23, 80, 0, 0}; |
|
||||
|
|
||||
char normalco[] = { 27, '[', NORMAL, ';', BG+BLACK, ';', FG+GREEN, 'm', 0 }; |
|
||||
/* char mainco[] = { 27, '[', BRIGHT, ';', BG+RED, ';', FG+BLACK, 'm', 0 }; */ |
|
||||
|
|
||||
char mainco[] = { 27, '[', BG+RED, ';', FG+BLACK, 'm', 0 }; |
|
||||
|
|
||||
box(bx,borderco) |
|
||||
struct BOX * bx; |
|
||||
char * borderco; |
|
||||
{ |
|
||||
|
|
||||
char width; |
|
||||
char height; |
|
||||
char x; |
|
||||
char y; |
|
||||
|
|
||||
/* printf("%s",borderco);
|
|
||||
*/ |
|
||||
|
|
||||
width = bx->lrc-bx->ulc+1; |
|
||||
height = bx->lrl-bx->ull+1; |
|
||||
|
|
||||
for(y=0;y<height;y++) { |
|
||||
crtlc(bx->ull+y,bx->lrc); |
|
||||
printf("|"); |
|
||||
} |
|
||||
|
|
||||
for(y=0;y<height;y++) { |
|
||||
crtlc(bx->ull+y,bx->ulc); |
|
||||
printf("|"); |
|
||||
} |
|
||||
|
|
||||
|
|
||||
|
|
||||
crtlc(bx->ull,bx->ulc); |
|
||||
for(x=0;x<width;x++) { |
|
||||
printf("-"); |
|
||||
} |
|
||||
|
|
||||
crtlc(bx->lrl,bx->ulc); |
|
||||
for(x=0;x<width;x++) { |
|
||||
printf("-"); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
fill(bx,filler,fillco) |
|
||||
struct BOX * bx; |
|
||||
char filler; |
|
||||
char * fillco; |
|
||||
{ |
|
||||
|
|
||||
char width; |
|
||||
char height; |
|
||||
char x; |
|
||||
char y; |
|
||||
|
|
||||
width = bx->lrc-bx->ulc-1; |
|
||||
height = bx->lrl-bx->ull-1; |
|
||||
|
|
||||
/* printf("%s",fillco);
|
|
||||
*/ |
|
||||
|
|
||||
for(y=0;y<height;y++) { |
|
||||
crtlc(bx->ull+y+1,bx->ulc+1); |
|
||||
for(x=0;x<width;x++) { |
|
||||
printf("%c",filler); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
|
|
||||
} |
|
||||
|
|
||||
|
|
||||
main(argc,argv) |
|
||||
int argc; |
|
||||
char *argv[]; |
|
||||
{ |
|
||||
hregbc = GETSYSCFG; /* function = Get System Config */ |
|
||||
hregde = HIGHSEG; /* addr of dest (must be high) */ |
|
||||
diagnose(); /* invoke the NBIOS function */ |
|
||||
|
|
||||
pSYSCFG = HIGHSEG; |
|
||||
crtinit(pSYSCFG->cnfgdata.termtype); |
|
||||
crtclr(); |
|
||||
|
|
||||
/* banner("MENU");
|
|
||||
*/ |
|
||||
|
|
||||
box(&mainbx,mainco); |
|
||||
fill(&mainbx,'%',normalco); |
|
||||
|
|
||||
crtlc(mainbx.lrl,mainbx.ulc); |
|
||||
} |
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
@ -1,253 +0,0 @@ |
|||||
/* meta.c 6/7/2012 dwg - view and edit the metadata */ |
|
||||
|
|
||||
#include "stdio.h" |
|
||||
#include "portab.h" |
|
||||
#include "globals.h" |
|
||||
#include "cpmbios.h" |
|
||||
#include "bioscall.h" |
|
||||
#include "cpmbdos.h" |
|
||||
#include "bdoscall.h" |
|
||||
#include "sectorio.h" |
|
||||
#include "diagnose.h" |
|
||||
#include "ctermcap.h" |
|
||||
#include "clogical.h" |
|
||||
#include "metadata.h" |
|
||||
#include "applvers.h" |
|
||||
#include "cnfgdata.h" |
|
||||
#include "syscfg.h" |
|
||||
|
|
||||
|
|
||||
#define BDOS 5 /* memory address of BDOS invocation */ |
|
||||
#define HIGHSEG 0x0C000 /* memory address of system config */ |
|
||||
|
|
||||
#define GETSYSCFG 0x0F000 /* HBIOS function for Get System Configuration */ |
|
||||
|
|
||||
#define METALINE 7 |
|
||||
#define METACOL 0 |
|
||||
|
|
||||
/* Application Globals */ |
|
||||
|
|
||||
int bRunning; |
|
||||
int deflu; |
|
||||
int drive; |
|
||||
int logunit; |
|
||||
int numlu; |
|
||||
|
|
||||
struct SYSCFG * pSYSCFG = HIGHSEG; |
|
||||
|
|
||||
char hexchar(val, bitoff) |
|
||||
{ |
|
||||
static char hexmap[] = "0123456789ABCDEF"; |
|
||||
|
|
||||
return hexmap[(val >> bitoff) & 0xF]; |
|
||||
} |
|
||||
|
|
||||
char * fmthexbyte(val, buf) |
|
||||
unsigned char val; |
|
||||
char * buf; |
|
||||
{ |
|
||||
buf[0] = hexchar(val, 4); |
|
||||
buf[1] = hexchar(val, 0); |
|
||||
buf[2] = '\0'; |
|
||||
|
|
||||
return buf; |
|
||||
} |
|
||||
|
|
||||
char * fmthexword(val, buf) |
|
||||
unsigned int val; |
|
||||
char * buf; |
|
||||
{ |
|
||||
buf[0] = hexchar(val, 12); |
|
||||
buf[1] = hexchar(val, 8); |
|
||||
fmthexbyte(val, buf + 2); |
|
||||
|
|
||||
return buf; |
|
||||
} |
|
||||
|
|
||||
display() |
|
||||
{ |
|
||||
int i; |
|
||||
char buf[5]; |
|
||||
|
|
||||
/* Set Current Logical Unit */ |
|
||||
luscur(drive,logunit); |
|
||||
|
|
||||
/* Read the Prefix Sector */ |
|
||||
rdsector(drive,0,11,&metadata); |
|
||||
|
|
||||
crtlc(METALINE+0,METACOL); |
|
||||
printf("metadata.signature = 0x%s", fmthexword(metadata.signature, buf)); |
|
||||
|
|
||||
crtlc(METALINE+1,METACOL); |
|
||||
printf("metadata.platform = 0x%s", fmthexbyte(metadata.platform, buf)); |
|
||||
|
|
||||
crtlc(METALINE+2,METACOL); |
|
||||
printf("metadata.formatter = \""); |
|
||||
for(i=0;i<8;i++) { |
|
||||
printf("%c",metadata.formatter[i]); |
|
||||
} |
|
||||
printf("\""); |
|
||||
|
|
||||
crtlc(METALINE+3,METACOL); |
|
||||
printf("metadata.drive = %c:",metadata.drive+'A'); |
|
||||
|
|
||||
if(metadata.logunit != logunit) { |
|
||||
metadata.logunit = logunit; |
|
||||
metadata.update++; |
|
||||
wrsector(drive,0,11,&metadata); |
|
||||
} |
|
||||
|
|
||||
crtlc(METALINE+4,METACOL); |
|
||||
printf("metadata.logunit = %d(rel0) of %d ",metadata.logunit,numlu); |
|
||||
|
|
||||
crtlc(METALINE+5,METACOL); |
|
||||
printf("metadata.writeprot = "); |
|
||||
switch(metadata.writeprot) { |
|
||||
case TRUE: printf("TRUE "); break; |
|
||||
case FALSE: printf("FALSE"); break; |
|
||||
default: printf("Unk!!"); break; |
|
||||
} |
|
||||
|
|
||||
crtlc(METALINE+6,METACOL); |
|
||||
printf("metadata.update = %d",metadata.update); |
|
||||
|
|
||||
crtlc(METALINE+7,METACOL); |
|
||||
printf("metadata.{ver} = %d.%d.%d.%d", |
|
||||
metadata.rmj,metadata.rmn,metadata.rup,metadata.rup); |
|
||||
|
|
||||
crtlc(METALINE+8,METACOL); |
|
||||
printf("metadata.label = \""); |
|
||||
for(i=0;i<16;i++) { |
|
||||
printf("%c",metadata.label[i]); |
|
||||
} |
|
||||
printf("\""); |
|
||||
crtlc(METALINE+9,METACOL); |
|
||||
printf("metadata.infloc = 0x%s", fmthexword(metadata.infloc, buf)); |
|
||||
|
|
||||
crtlc(METALINE+10,METACOL); |
|
||||
printf("metadata.cpmloc = 0x%s", fmthexword(metadata.cpmloc, buf)); |
|
||||
|
|
||||
crtlc(METALINE+11,METACOL); |
|
||||
printf("metadata.cpmend = 0x%s", fmthexword(metadata.cpmend, buf)); |
|
||||
|
|
||||
crtlc(METALINE+12,METACOL); |
|
||||
printf("metadata.cpment = 0x%s", fmthexword(metadata.cpment, buf)); |
|
||||
|
|
||||
} |
|
||||
|
|
||||
int menu(state) |
|
||||
int state; |
|
||||
{ |
|
||||
int retcode; |
|
||||
|
|
||||
crtlc(METALINE+14,METACOL); |
|
||||
printf(" "); |
|
||||
printf(" "); |
|
||||
|
|
||||
crtlc(METALINE+14,METACOL); |
|
||||
|
|
||||
printf("Options( "); |
|
||||
|
|
||||
if(0 < logunit) { |
|
||||
printf(" -{prev lu}"); |
|
||||
} |
|
||||
|
|
||||
|
|
||||
if(logunit < (numlu-1)) { |
|
||||
printf(" +{next lu}"); |
|
||||
} |
|
||||
|
|
||||
if(TRUE == metadata.writeprot) { |
|
||||
printf(" u{nprotect}"); |
|
||||
} |
|
||||
|
|
||||
if(FALSE == metadata.writeprot) { |
|
||||
printf(" p{rotect}"); |
|
||||
} |
|
||||
|
|
||||
printf(" x{quit} ): "); |
|
||||
|
|
||||
dregbc = 1; |
|
||||
bdoscall(); |
|
||||
|
|
||||
retcode = TRUE; |
|
||||
|
|
||||
switch(drega) { |
|
||||
case 'X': |
|
||||
case 'x': |
|
||||
retcode = FALSE; break; |
|
||||
|
|
||||
case '+': |
|
||||
if(logunit < (numlu-1)) { |
|
||||
logunit++; |
|
||||
} else { |
|
||||
printf("%c",7); |
|
||||
} |
|
||||
break; |
|
||||
|
|
||||
case '-': |
|
||||
if(0 < logunit) { |
|
||||
logunit--; |
|
||||
} else { |
|
||||
printf("%c",7); |
|
||||
} |
|
||||
break; |
|
||||
|
|
||||
case 'p': |
|
||||
metadata.writeprot = TRUE; |
|
||||
metadata.update++; |
|
||||
wrsector(drive,0,11,&metadata); |
|
||||
break; |
|
||||
|
|
||||
case 'u': |
|
||||
metadata.writeprot = FALSE; |
|
||||
metadata.update++; |
|
||||
wrsector(drive,0,11,&metadata); |
|
||||
break; |
|
||||
|
|
||||
default: printf("%c",7); break; |
|
||||
} |
|
||||
|
|
||||
return retcode; |
|
||||
} |
|
||||
|
|
||||
main(argc,argv) |
|
||||
int argc; |
|
||||
char *argv[]; |
|
||||
{ |
|
||||
hregbc = GETSYSCFG; /* function = Get System Config */ |
|
||||
hregde = HIGHSEG; /* addr of dest (must be high) */ |
|
||||
diagnose(); /* invoke the NBIOS function */ |
|
||||
|
|
||||
/* printf("TT is %d\n",pSYSCFG->cnfgdata.termtype); */ |
|
||||
|
|
||||
pSYSCFG = HIGHSEG; |
|
||||
crtinit(pSYSCFG->cnfgdata.termtype); |
|
||||
crtclr(); |
|
||||
crtlc(0,0); |
|
||||
|
|
||||
banner("META"); |
|
||||
|
|
||||
dregbc = RETCURRDISK; |
|
||||
bdoscall(); |
|
||||
drive = drega; |
|
||||
|
|
||||
numlu = lugnum(drive); |
|
||||
|
|
||||
|
|
||||
deflu = lugcur(drive); |
|
||||
logunit = deflu; |
|
||||
|
|
||||
bRunning = TRUE; |
|
||||
while(TRUE == bRunning) { |
|
||||
display(); |
|
||||
bRunning = menu(1); |
|
||||
} |
|
||||
|
|
||||
luscur(drive,deflu); |
|
||||
crtlc(23,0); |
|
||||
} |
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
@ -1,523 +0,0 @@ |
|||||
; metadata.asm 7/30/2012 dwg - set c=0 for BIOS WRITE calls per Wayne |
|
||||
; metadata.asm 2/17/2012 dwg - review for release 1.5.1.0 |
|
||||
; metadata.asm 2/11/2012 dwg - review for release 1.5 |
|
||||
; metadata.asm 2/ 4/2012 dwg - metadata library implementation |
|
||||
|
|
||||
; Copyright (C) 2011-2012 Douglas Goodall Licensed under GPL Ver 3. |
|
||||
; |
|
||||
; This file is part of NuBiosDWG and is free software: you can |
|
||||
; redistribute it and/or modify it under the terms of the GNU |
|
||||
; General Public License as published by the Free Software Foundation, |
|
||||
; either version 3 of the License, or (at your option) any later version. |
|
||||
; This file is distributed in the hope that it will be useful, |
|
||||
; but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||
; GNU General Public License for more details. |
|
||||
; You should have received a copy of the GNU General Public License |
|
||||
; along with it. If not, see <http://www.gnu.org/licenses/>. |
|
||||
|
|
||||
|
|
||||
maclib portab |
|
||||
maclib globals |
|
||||
maclib cpmbios |
|
||||
maclib cpmbdos |
|
||||
maclib memory ; has x$memset |
|
||||
maclib applvers ; has A$RMJ, A$RMN, A$RUP, A$RTP |
|
||||
maclib printers |
|
||||
maclib stdlib ; SUCCESS and FAILURE |
|
||||
|
|
||||
; metadata.lib 1/31/2012 dwg - macros to manipulate drive metadata |
|
||||
; |
|
||||
; update$meta buffer | x$u$meta hl -> buffer |
|
||||
; init$meta buffer | x$i$meta hl -> buffer |
|
||||
; get$meta drive,buffer | x$g$meta hl -> buffer, c = drivenum |
|
||||
; put$meta drive,buffer | x$p$meta hl -> buffer, c = drivenum |
|
||||
; prot$meta drive | x$pr$meta c = drivenum |
|
||||
; unprot$meta drive | x$un$meta c = drivenum |
|
||||
; |
|
||||
;------------------------------------------- |
|
||||
|
|
||||
;meta$debug equ TRUE |
|
||||
meta$debug equ FALSE |
|
||||
|
|
||||
meta$sig5a equ 0 |
|
||||
meta$siga5 equ 1 |
|
||||
meta$prot equ 128-8-1-16-7 |
|
||||
meta$updates equ 128-8-1-16-6 |
|
||||
meta$rmj equ 128-8-1-16-4 |
|
||||
meta$rmn equ 128-8-1-16-3 |
|
||||
meta$rup equ 128-8-1-16-2 |
|
||||
meta$rtp equ 128-8-1-16-1 |
|
||||
meta$label equ 128-8-1-16 |
|
||||
meta$term equ 128-8-1 |
|
||||
meta$info$loc equ 128-8 |
|
||||
meta$cpm$loc equ 128-6 |
|
||||
meta$dat$end equ 128-4 |
|
||||
meta$cpm$ent equ 128-2 |
|
||||
meta$label$len equ meta$term-meta$label |
|
||||
|
|
||||
;----------------------------- |
|
||||
crlf db CR,LF,'$' |
|
||||
;----------------------------- |
|
||||
|
|
||||
page |
|
||||
|
|
||||
public x$u$meta |
|
||||
x$u$meta: |
|
||||
shld x$u$bufptr |
|
||||
|
|
||||
; lhld x$u$bufptr |
|
||||
lxi d,meta$prot |
|
||||
dad d |
|
||||
mov a,m |
|
||||
cpi TRUE ; is metadata write protected |
|
||||
jz x$u$proterr ; if so go around update code |
|
||||
|
|
||||
; increment the update count |
|
||||
lhld x$u$bufptr |
|
||||
lxi d,meta$updates |
|
||||
dad d |
|
||||
mov e,m ; pick up LO byte into E |
|
||||
inx h |
|
||||
mov d,m ; pick up HO byte into D |
|
||||
inx d ; increment DE |
|
||||
mov m,d |
|
||||
dcx h |
|
||||
mov m,e |
|
||||
|
|
||||
; update last written version quad |
|
||||
lhld x$u$bufptr |
|
||||
lxi d,meta$rmj |
|
||||
dad d |
|
||||
mvi a,A$RMJ |
|
||||
mov m,a |
|
||||
inx h |
|
||||
mvi a,A$RMN |
|
||||
mov m,a |
|
||||
inx h |
|
||||
mvi a,A$RUP |
|
||||
mov m,a |
|
||||
inx h |
|
||||
mvi a,A$RTP |
|
||||
mov m,a |
|
||||
|
|
||||
lhld x$u$bufptr |
|
||||
lxi d,meta$term |
|
||||
dad d |
|
||||
mov a,m |
|
||||
cpi '$' |
|
||||
jz x$u$end |
|
||||
|
|
||||
lhld x$u$bufptr |
|
||||
lxi d,meta$label |
|
||||
dad d |
|
||||
mvi a,' ' |
|
||||
mvi c,16 |
|
||||
call x$memset |
|
||||
|
|
||||
lhld x$u$bufptr |
|
||||
lxi d,meta$term |
|
||||
dad d |
|
||||
mvi a,'$' |
|
||||
mov m,a |
|
||||
|
|
||||
x$u$end: |
|
||||
mvi a,SUCCESS |
|
||||
ret |
|
||||
|
|
||||
x$u$proterr: |
|
||||
mvi a,FAILURE |
|
||||
ret |
|
||||
|
|
||||
x$u$bufptr ds 2 |
|
||||
|
|
||||
|
|
||||
;----------------------------- |
|
||||
|
|
||||
page |
|
||||
|
|
||||
public x$i$meta |
|
||||
x$i$meta: |
|
||||
shld x$i$bufptr |
|
||||
|
|
||||
lhld x$i$bufptr |
|
||||
lxi d,meta$sig5a |
|
||||
dad d |
|
||||
mvi a,05ah |
|
||||
mov m,a |
|
||||
inx h |
|
||||
mvi a,0a5h |
|
||||
mov m,a |
|
||||
|
|
||||
lhld x$i$bufptr |
|
||||
lxi d,meta$prot |
|
||||
dad d |
|
||||
mvi a,FALSE |
|
||||
mov m,a |
|
||||
|
|
||||
lhld x$i$bufptr |
|
||||
lxi d,meta$updates |
|
||||
dad d |
|
||||
mvi a,0 |
|
||||
mov m,a |
|
||||
inx h |
|
||||
mov m,a |
|
||||
|
|
||||
lhld x$i$bufptr |
|
||||
lxi d,meta$label |
|
||||
dad d ; hl -> dest |
|
||||
mvi a,' ' |
|
||||
mvi c,meta$label$len |
|
||||
call x$memset |
|
||||
|
|
||||
lhld x$i$bufptr |
|
||||
lxi d,meta$term |
|
||||
dad d |
|
||||
mvi a,'$' |
|
||||
mov m,a |
|
||||
|
|
||||
lhld x$i$bufptr |
|
||||
lxi d,meta$updates |
|
||||
dad d |
|
||||
mvi a,0 |
|
||||
mov m,a |
|
||||
inx h |
|
||||
mov m,a |
|
||||
|
|
||||
lhld x$i$bufptr |
|
||||
call x$u$meta |
|
||||
|
|
||||
ret |
|
||||
|
|
||||
x$i$bufptr ds 2 |
|
||||
|
|
||||
;------------------------------------------- |
|
||||
|
|
||||
page |
|
||||
|
|
||||
public x$g$meta |
|
||||
x$g$meta; |
|
||||
|
|
||||
shld x$g$bufptr ; entry hl has bufptr |
|
||||
mov a,c ; entry c has drivenum |
|
||||
sta x$g$drivenum |
|
||||
|
|
||||
; lda x$g$drivenum |
|
||||
mov c,a |
|
||||
call BISELDSK |
|
||||
|
|
||||
lxi b,0 |
|
||||
call BISETTRK |
|
||||
|
|
||||
lxi b,11 |
|
||||
call BISETSEC |
|
||||
|
|
||||
lhld x$g$bufptr |
|
||||
push h |
|
||||
pop b |
|
||||
call BISETDMA |
|
||||
|
|
||||
call BIREAD |
|
||||
|
|
||||
lhld x$g$bufptr |
|
||||
lxi d,meta$siga5 |
|
||||
dad d |
|
||||
mov a,m |
|
||||
cpi 0a5h |
|
||||
jnz x$g$needs$init |
|
||||
|
|
||||
lhld x$g$bufptr |
|
||||
lxi d,meta$sig5a |
|
||||
dad d |
|
||||
mov a,m |
|
||||
cpi 05ah |
|
||||
jnz x$g$needs$init |
|
||||
|
|
||||
jmp x$g$fini |
|
||||
|
|
||||
x$g$needs$init: |
|
||||
|
|
||||
lhld x$g$bufptr |
|
||||
call x$i$meta |
|
||||
|
|
||||
mvi c,0 ; default to 0 per Wayne |
|
||||
call BIWRITE |
|
||||
|
|
||||
x$g$fini: |
|
||||
mvi c,13 |
|
||||
call BDOS |
|
||||
ret |
|
||||
|
|
||||
x$g$bufptr ds 2 |
|
||||
x$g$drivenum ds 1 |
|
||||
|
|
||||
;----------------------------------- |
|
||||
|
|
||||
page |
|
||||
|
|
||||
public x$p$meta |
|
||||
x$p$meta: |
|
||||
shld x$p$bufptr |
|
||||
mov a,c |
|
||||
sta x$p$drivenum |
|
||||
|
|
||||
IF meta$debug eq TRUE |
|
||||
conout 'x' |
|
||||
conout '$' |
|
||||
conout 'p' |
|
||||
conout '$' |
|
||||
printf 'meta called, drive=' |
|
||||
lda x$p$drivenum |
|
||||
mov l,a |
|
||||
mvi h,0 |
|
||||
call pr$d$word |
|
||||
printf ', buffer=' |
|
||||
lhld x$p$bufptr |
|
||||
call pr$h$word |
|
||||
print crlf |
|
||||
ENDIF |
|
||||
|
|
||||
; increment the update count |
|
||||
lhld x$p$bufptr ; hl -> buffer |
|
||||
lxi d,meta$updates ; de = offset to updates word |
|
||||
dad d ; hl -> updates word |
|
||||
mov e,m ; e = LO byte of updates |
|
||||
inx h ; hl -> HO byte |
|
||||
mov d,m ; d = HO byte of updates |
|
||||
inx d ; increment DE (updates) |
|
||||
mov m,d ; put back HO byte |
|
||||
dcx h ; back up ptr |
|
||||
mov m,e ; put back LO byte |
|
||||
|
|
||||
; update last written version quad |
|
||||
lhld x$p$bufptr |
|
||||
lxi d,meta$rmj |
|
||||
dad d |
|
||||
mvi a,A$RMJ |
|
||||
mov m,a |
|
||||
inx h |
|
||||
mvi a,A$RMN |
|
||||
mov m,a |
|
||||
inx h |
|
||||
mov a,A$RUP |
|
||||
mov m,a |
|
||||
inx h |
|
||||
mvi a,A$RTP |
|
||||
mov m,a |
|
||||
|
|
||||
lhld x$p$bufptr |
|
||||
lxi d,meta$prot |
|
||||
dad d |
|
||||
mov a,m |
|
||||
cpi TRUE ; if metadata is write protected |
|
||||
jz x$p$fini ; jump around update code |
|
||||
lda x$p$drivenum |
|
||||
mov c,a |
|
||||
call BISELDSK |
|
||||
lxi b,0 |
|
||||
call BISETTRK |
|
||||
lxi b,11 |
|
||||
call BISETSEC |
|
||||
lhld x$p$bufptr |
|
||||
push h |
|
||||
pop b |
|
||||
call BISETDMA |
|
||||
|
|
||||
mvi c,0 ; default to 0 per Wayne |
|
||||
call BIWRITE |
|
||||
|
|
||||
IF meta$debug eq TRUE |
|
||||
printf 'return from BIWRITE is ' |
|
||||
mov l,a |
|
||||
mvi h,0 |
|
||||
call pr$h$word |
|
||||
print crlf |
|
||||
ENDIF |
|
||||
|
|
||||
x$p$fini: |
|
||||
ret |
|
||||
|
|
||||
x$p$bufptr ds 2 |
|
||||
x$p$drivenum ds 1 |
|
||||
|
|
||||
;----------------------- |
|
||||
|
|
||||
page |
|
||||
|
|
||||
public x$pr$meta |
|
||||
x$pr$meta: |
|
||||
mov a,c |
|
||||
sta x$pr$drivenum |
|
||||
|
|
||||
IF meta$debug eq TRUE |
|
||||
conout 'x' |
|
||||
conout '$' |
|
||||
printf 'pr' |
|
||||
conout '$' |
|
||||
printf 'meta called, drive=' |
|
||||
lda x$pr$drivenum |
|
||||
mov l,a |
|
||||
mvi h,0 |
|
||||
call pr$d$word |
|
||||
print crlf |
|
||||
ENDIF |
|
||||
|
|
||||
lda x$pr$drivenum |
|
||||
mov c,a |
|
||||
call BISELDSK |
|
||||
lxi b,0 |
|
||||
call BISETTRK |
|
||||
lxi b,11 |
|
||||
call BISETSEC |
|
||||
lxi b,x$pr$buffer |
|
||||
call BISETDMA |
|
||||
call BIREAD |
|
||||
|
|
||||
IF meta$debug eq TRUE |
|
||||
printf 'return from BIREAD is ' |
|
||||
mov l,a |
|
||||
mvi h,0 |
|
||||
call pr$h$word |
|
||||
print crlf |
|
||||
ENDIF |
|
||||
|
|
||||
lxi h,x$pr$buffer |
|
||||
lxi d,meta$prot |
|
||||
dad d |
|
||||
mvi a,TRUE |
|
||||
mov m,a |
|
||||
|
|
||||
|
|
||||
lxi h,x$pr$buffer |
|
||||
lxi d,meta$updates |
|
||||
dad d |
|
||||
mov e,m |
|
||||
inx h |
|
||||
mov d,m |
|
||||
inx d |
|
||||
mov m,d |
|
||||
dcx h |
|
||||
mov m,e |
|
||||
|
|
||||
lda x$pr$drivenum |
|
||||
mov c,a |
|
||||
call BISELDSK |
|
||||
lxi b,0 |
|
||||
call BISETTRK |
|
||||
lxi b,11 |
|
||||
call BISETSEC |
|
||||
lxi b,x$pr$buffer |
|
||||
call BISETDMA |
|
||||
|
|
||||
mvi c,0 ; default to 0 per Wayne |
|
||||
call BIWRITE |
|
||||
|
|
||||
IF meta$debug eq TRUE |
|
||||
printf 'return from BIWRITE is ' |
|
||||
mov l,a |
|
||||
mvi h,0 |
|
||||
call pr$h$word |
|
||||
print crlf |
|
||||
ENDIF |
|
||||
|
|
||||
mvi c,13 |
|
||||
call BDOS |
|
||||
|
|
||||
ret |
|
||||
|
|
||||
|
|
||||
x$pr$drivenum ds 1 |
|
||||
x$pr$buffer ds 128 |
|
||||
|
|
||||
;----------------------- |
|
||||
|
|
||||
page |
|
||||
|
|
||||
public x$un$meta |
|
||||
x$un$meta: |
|
||||
mov a,c |
|
||||
sta x$un$drivenum |
|
||||
|
|
||||
IF meta$debug eq TRUE |
|
||||
conout 'x' |
|
||||
conout '$' |
|
||||
printf 'un' |
|
||||
conout '$' |
|
||||
printf 'meta called, drive=' |
|
||||
lda x$un$drivenum |
|
||||
mov l,a |
|
||||
mvi h,0 |
|
||||
call pr$d$word |
|
||||
print crlf |
|
||||
ENDIF |
|
||||
|
|
||||
lda x$un$drivenum |
|
||||
mov c,a |
|
||||
call BISELDSK |
|
||||
lxi b,0 |
|
||||
call BISETTRK |
|
||||
lxi b,11 |
|
||||
call BISETSEC |
|
||||
lxi b,x$un$buffer |
|
||||
call BISETDMA |
|
||||
call BIREAD |
|
||||
|
|
||||
IF meta$debug eq TRUE |
|
||||
printf 'return from BIREAD is ' |
|
||||
mov l,a |
|
||||
mvi h,0 |
|
||||
call pr$h$word |
|
||||
print crlf |
|
||||
ENDIF |
|
||||
|
|
||||
lxi h,x$un$buffer |
|
||||
lxi d,meta$prot |
|
||||
dad d |
|
||||
mvi a,FALSE |
|
||||
mov m,a |
|
||||
|
|
||||
|
|
||||
lxi h,x$un$buffer |
|
||||
lxi d,meta$updates |
|
||||
dad d |
|
||||
mov e,m |
|
||||
inx h |
|
||||
mov d,m |
|
||||
inx d |
|
||||
mov m,d |
|
||||
dcx h |
|
||||
mov m,e |
|
||||
|
|
||||
lda x$un$drivenum |
|
||||
mov c,a |
|
||||
call BISELDSK |
|
||||
lxi b,0 |
|
||||
call BISETTRK |
|
||||
lxi b,11 |
|
||||
call BISETSEC |
|
||||
lxi b,x$un$buffer |
|
||||
call BISETDMA |
|
||||
|
|
||||
mvi c,0 ; default to 0 per Wayne |
|
||||
call BIWRITE |
|
||||
|
|
||||
IF meta$debug eq TRUE |
|
||||
printf 'return from BIWRITE is ' |
|
||||
mov l,a |
|
||||
mvi h,0 |
|
||||
call pr$h$word |
|
||||
print crlf |
|
||||
ENDIF |
|
||||
|
|
||||
mvi c,13 |
|
||||
call BDOS |
|
||||
|
|
||||
ret |
|
||||
|
|
||||
x$un$drivenum ds 1 |
|
||||
x$un$buffer ds 128 |
|
||||
|
|
||||
;----------------------- |
|
||||
|
|
||||
; eof - metadata.asm |
|
||||
|
|
||||
@ -1,66 +0,0 @@ |
|||||
/*
|
|
||||
* metadata.h 3/12/2012 dwg - |
|
||||
* |
|
||||
*/ |
|
||||
|
|
||||
|
|
||||
extern initmeta(); |
|
||||
extern getmeta(); |
|
||||
extern putmeta(); |
|
||||
|
|
||||
|
|
||||
/*
|
|
||||
* This structure is the same as the metadata sector |
|
||||
* in RomWBW storage drives. (track 0 sector 11) |
|
||||
* |
|
||||
*/ |
|
||||
|
|
||||
struct MD_TAG { |
|
||||
char sig5a; |
|
||||
char siga5; |
|
||||
|
|
||||
char platform; |
|
||||
char device; |
|
||||
char formatter[8]; |
|
||||
char drive; |
|
||||
char lu; |
|
||||
|
|
||||
char filler[128-34-12]; |
|
||||
/* ... */ |
|
||||
char prot; |
|
||||
int updates; |
|
||||
char rmj; |
|
||||
char rmn; |
|
||||
char rup; |
|
||||
char rtp; |
|
||||
char label[16]; |
|
||||
char term; |
|
||||
unsigned int infoloc; |
|
||||
unsigned int cpmloc; |
|
||||
unsigned int datend; |
|
||||
unsigned int cpment; |
|
||||
}; |
|
||||
|
|
||||
struct METADATA { |
|
||||
unsigned int signature; |
|
||||
unsigned char platform; |
|
||||
unsigned char device; |
|
||||
unsigned char formatter[8]; |
|
||||
unsigned char drive; |
|
||||
unsigned int logunit; |
|
||||
unsigned char unused[0x51]; |
|
||||
unsigned char writeprot; |
|
||||
unsigned int update; |
|
||||
unsigned char rmj; |
|
||||
unsigned char rmn; |
|
||||
unsigned char rup; |
|
||||
unsigned char rtp; |
|
||||
unsigned char label[16]; |
|
||||
unsigned char term; |
|
||||
unsigned int infloc; |
|
||||
unsigned int cpmloc; |
|
||||
unsigned int cpmend; |
|
||||
unsigned int cpment; |
|
||||
} metadata; |
|
||||
|
|
||||
|
|
||||
@ -1,86 +0,0 @@ |
|||||
; metadata.lib 2/17/2012 dwg - review for release 1.5.1.0 |
|
||||
; metadata.lib 2/11/2012 dwg - review for release 1.5 |
|
||||
; metadata.lib 2/ 3/2012 dwg - macro to manipulate drive metadata |
|
||||
; |
|
||||
;-------------------------------------------------------------------------- |
|
||||
; update$meta buffer | x$u$meta hl -> buffer |
|
||||
; init$meta buffer | x$i$meta hl -> buffer |
|
||||
; get$meta drive,buffer | x$g$meta hl -> buffer, c = drivenum |
|
||||
; put$meta drive,buffer | x$p$meta hl -> buffer, c = drivenum |
|
||||
; prot$meta drive | x$pr$meta c = drivenum |
|
||||
; unprot$meta drive | x$un$meta c = drivenum |
|
||||
;-------------------------------------------------------------------------- |
|
||||
|
|
||||
; these must be kept in sync with prefix.asm and loader.asm |
|
||||
; |
|
||||
meta$sig5a equ 0 ; 1st signature byte |
|
||||
meta$siga5 equ 1 ; 2nd signature byte |
|
||||
meta$prot equ 128-8-1-16-7 ; write protect boolean |
|
||||
meta$updates equ 128-8-1-16-6 ; update counter |
|
||||
meta$rmj equ 128-8-1-16-4 ; Major Version |
|
||||
meta$rmn equ 128-8-1-16-3 ; Minor Version |
|
||||
meta$rup equ 128-8-1-16-2 ; Update Number |
|
||||
meta$rtp equ 128-8-1-16-1 ; Patch Number |
|
||||
meta$label equ 128-8-1-16 ; Drive Label (space padded) |
|
||||
meta$term equ 128-8-1 ; Dollar Sign String Term |
|
||||
meta$info$loc equ 128-8 ; pointer to info poked by ldr |
|
||||
meta$cpm$loc equ 128-6 ; location of CP/M |
|
||||
meta$dat$end equ 128-4 ; End of image load |
|
||||
meta$cpm$ent equ 128-2 ; Entryr point after relocation |
|
||||
; |
|
||||
meta$label$len equ meta$term-meta$label |
|
||||
;---------------------------------------------------------------------- |
|
||||
extrn x$u$meta ; Update Metadata |
|
||||
extrn x$i$meta ; Initialize Metadata |
|
||||
extrn x$g$meta ; Get Metadata |
|
||||
extrn x$p$meta ; Put Metadata |
|
||||
extrn x$pr$meta ; Protect Metadata |
|
||||
extrn x$un$meta ; Unprotect Metadata |
|
||||
|
|
||||
;---------------------------------------------------- |
|
||||
; Read the metadata into the specified buffer from the specified drive |
|
||||
; (set up the entry registers then transfer to the library routine) |
|
||||
get$meta macro drive,buffer |
|
||||
mvi c,drive |
|
||||
lxi h,buffer |
|
||||
call x$g$meta |
|
||||
endm |
|
||||
;----------------------------------- |
|
||||
; Write the metadata from the specified buffer to the specified drive |
|
||||
; (set up the entry registers then transfer to the library routine) |
|
||||
put$meta macro drive,buffer |
|
||||
mov c,drive ; load 1st positional parameter into reg |
|
||||
lxi h,buffer ; load 2nd positional parameter into reg |
|
||||
call x$p$meta ; call actual routine in metadata.asm |
|
||||
endm |
|
||||
;----------------------------------- |
|
||||
; Update fields in the buffer with current data |
|
||||
; (set up the entry registers then transfer to the library routine) |
|
||||
update$meta macro buffer |
|
||||
lxi h,buffer ; load the parameter into reg as required |
|
||||
call x$u$meta ; call actual routine in metadata.asm |
|
||||
endm |
|
||||
;----------------------------------- |
|
||||
; Initialize the buffer with all required fields for first time use |
|
||||
; (set up the entry registers then transfer to the library routine) |
|
||||
init$meta macro buffer |
|
||||
lxi h,buffer ; load the parameter into reg as required |
|
||||
call x$i$meta ; call the actual routine in metadata.asm |
|
||||
endm |
|
||||
;----------------------------------- |
|
||||
; Write Protect the Metadata by setting the protect boolean |
|
||||
; (set up the entry registers then transfer to the library routine) |
|
||||
prot$meta macro drive |
|
||||
mvi c,drive ; load the parameter into reg as required |
|
||||
call x$pr$meta ; call the actual routine in metadata.asm |
|
||||
endm |
|
||||
;----------------------------------- |
|
||||
; Unprotect the Metadata by clearing the protect boolean |
|
||||
; (set up the entry registers then transfer to the library routine) |
|
||||
unprot$meta macro drive |
|
||||
mvi c,drive ; load the parameter into reg as required |
|
||||
call x$un$meta ; call the actual routine in metadata.asm |
|
||||
endm |
|
||||
;----------------------------------- |
|
||||
; eof - metadata.lib |
|
||||
|
|
||||
@ -1,11 +0,0 @@ |
|||||
#include "stdio.h" |
|
||||
#include "rasm80.h" |
|
||||
|
|
||||
main() |
|
||||
{ |
|
||||
FILE * fd; |
|
||||
fd = fopen("rasm8080.com","w"); |
|
||||
fwrite(rasm80,sizeof(rasm80),1,fd); |
|
||||
fclose(fd); |
|
||||
} |
|
||||
|
|
||||
@ -1,115 +0,0 @@ |
|||||
/* monitor.c 7/22/2012 dwg - look around, see what's goin down */ |
|
||||
|
|
||||
#include "stdio.h" |
|
||||
#include "asmiface.h" |
|
||||
#include "ctermcap.h" |
|
||||
#include "cnfgdata.h" |
|
||||
#include "diagnose.h" |
|
||||
#include "syscfg.h" |
|
||||
|
|
||||
struct SYSCFG * pSYSCFG; |
|
||||
|
|
||||
char visible[256] = { |
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 00 */ |
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 10 */ |
|
||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 20 */ |
|
||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 30 */ |
|
||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 40 */ |
|
||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 50 */ |
|
||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 60 */ |
|
||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0, /* 70 */ |
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 80 */ |
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 90 */ |
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* A0 */ |
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* B0 */ |
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* C0 */ |
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* D0 */ |
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* E0 */ |
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* F0 */ |
|
||||
}; |
|
||||
|
|
||||
display(sector) |
|
||||
char * sector; |
|
||||
{ |
|
||||
int i,j; |
|
||||
int offset; |
|
||||
unsigned char byte; |
|
||||
|
|
||||
offset = 0; |
|
||||
for(i=0;i<8;i++) { |
|
||||
printf("%04x: ",sector+offset); |
|
||||
offset += 16; |
|
||||
for(j=0;j<16;j++) { |
|
||||
printf("%02x ",sector[(i*8)+j]); |
|
||||
} |
|
||||
printf(" "); |
|
||||
for(j=0;j<16;j++) { |
|
||||
byte = sector[(i*8)+j]; |
|
||||
if(1 == visible[byte]) { |
|
||||
printf("%c",byte); |
|
||||
} else { |
|
||||
printf("."); |
|
||||
} |
|
||||
} |
|
||||
printf("\n"); |
|
||||
} |
|
||||
printf("\n"); |
|
||||
} |
|
||||
|
|
||||
|
|
||||
#define HIGHSEG 0x0c000 |
|
||||
#define GETSYSCFG 0x0f000 |
|
||||
|
|
||||
main() |
|
||||
{ |
|
||||
char bRun; |
|
||||
unsigned int offset; |
|
||||
struct SYSCFG * pSYSCFG; |
|
||||
|
|
||||
pSYSCFG = HIGHSEG; |
|
||||
|
|
||||
hregbc = GETSYSCFG; /* function = Get System Config */ |
|
||||
hregde = HIGHSEG; /* addr of dest (must be high) */ |
|
||||
diagnose(); /* invoke the NBIOS function */ |
|
||||
crtinit(pSYSCFG->cnfgdata.termtype); |
|
||||
crtclr();crtlc(0,0); |
|
||||
printf("monitor.c 7/22/2012 dwg - view contents of memory"); |
|
||||
offset = HIGHSEG; |
|
||||
bRun = 1; |
|
||||
|
|
||||
while(1 == bRun) { |
|
||||
crtlc(3,0); |
|
||||
display(offset); |
|
||||
display(offset+128); |
|
||||
printf( |
|
||||
"Options: 0(0x0000) 1(0x1000) 2(0x2000) 3(0x3000) 4(0x4000) 5(0x5000)\n"); |
|
||||
printf( |
|
||||
" 6(0x6000) 7(0x7000) 8(0x8000) 9(0x9000) a(0xa000) b(0xb000)\n"); |
|
||||
printf( |
|
||||
" c(syscfg) n(ext) p(revious) q(uit) ?"); |
|
||||
|
|
||||
asmif(5,1,00); |
|
||||
printf("%c",0x0d); |
|
||||
switch(xrega) { |
|
||||
case '0': offset = 0x00000; break; |
|
||||
case '1': offset = 0x01000; break; |
|
||||
case '2': offset = 0x02000; break; |
|
||||
case '3': offset = 0x03000; break; |
|
||||
case '4': offset = 0x04000; break; |
|
||||
case '5': offset = 0x05000; break; |
|
||||
case '6': offset = 0x06000; break; |
|
||||
case '7': offset = 0x07000; break; |
|
||||
case '8': offset = 0x08000; break; |
|
||||
case '9': offset = 0x09000; break; |
|
||||
case 'a': offset = 0x0a000; break; |
|
||||
case 'b': offset = 0x0b000; break; |
|
||||
case 'd': offset = 0x0d000; break; |
|
||||
case 'c': offset = 0x0c000; break; |
|
||||
case 'n': offset += 2*128; break; |
|
||||
case 'p': offset -= 2*128; break; |
|
||||
case 'x': |
|
||||
case 'q': bRun = 0; break; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
@ -1,477 +0,0 @@ |
|||||
/* multifmt.c 6/12/2012 dwg - */ |
|
||||
|
|
||||
/*
|
|
||||
* |
|
||||
* The purpose of this program is to prepare a new mass storage device |
|
||||
* for use with the CP/M-80 Operating System with the RomWBW BIOS. |
|
||||
* |
|
||||
* Each Logical Unit has a prefix sector which must be initialized and |
|
||||
* a set of directory sectors that must be cleared to E5's in order that |
|
||||
* the directory entries wil be cleared for subsequent use. |
|
||||
* |
|
||||
* The Logical Units feature is implemented through the use of a DPH |
|
||||
* extention that contains a signature word, a "current LU" word, and |
|
||||
* a "number of LU's" word. The "number of LU's" word is assembled in |
|
||||
* based on the configurtion files present at system build time. |
|
||||
* |
|
||||
* The configuration of the LU feature has been managed by poking values |
|
||||
* into the "current" and "number of LU's" fields. As of the 2.0 BIOS, |
|
||||
* the LU feature is now managed via OEM BIOS calls to GETLU and SETLU. |
|
||||
* |
|
||||
* The following list of concepts contains the methods by which needed |
|
||||
* information can be accessed under the new architecture. |
|
||||
* |
|
||||
* To begin with, questions about disk drives can be answered through |
|
||||
* sequences of operations as described here. |
|
||||
* |
|
||||
* The first operation is to call GETLU and pass it a drive number. If |
|
||||
* the return code is 0, this means the drive exists. If a 1 is returned, |
|
||||
* this indicates an invalid drive number. |
|
||||
* |
|
||||
* Once you know that a drive number is valid, the next thing to know is |
|
||||
* the meaning of the Device/Unit returned by the call. The device numbers |
|
||||
* are hard coded in the STD.ASM, and derived from that a STD.H file which |
|
||||
* can be included into C programs. The known devices include DEV_MD, |
|
||||
* DEV_FD, DEV_IDE, DEV_PPIDE... The high nybble of the byte contains the |
|
||||
* device code, and the low nybble contains the unit number. The RAM disk |
|
||||
* and ROM disk are both DEV_MD devices. They just have different unit |
|
||||
* numbers. RAM and ROM drives do not have reserved tracks, and as well do |
|
||||
* not have a prefix sector. Because of this, there is no space to write a |
|
||||
* system image, and therefore are not usable for booting. |
|
||||
* |
|
||||
* The next more sophisticated storage device is the floppy disk. It does |
|
||||
* have reserved tracks and a prefix sector and can therefore have a system |
|
||||
* image written to it. Floppies, due to there size do not support "logical |
|
||||
* unit extentions". |
|
||||
* |
|
||||
* Things become much more interesting once you have a media adapter such |
|
||||
* as an IDE to compact flash adapter. Using a PPIDE miniboard attached |
|
||||
* to the parallel port, a media adapter may be attached, and a storage |
|
||||
* device as well, such as a CF chip. |
|
||||
* |
|
||||
* Compact Flash chips are generally many times larger than a maximum size |
|
||||
* of a CP/M-80 disk drive. The Logical Unit feature takes advatage of this |
|
||||
* by dividing the available space into a contiguous collection of 9MB slices |
|
||||
* which we describe as "logical units". The first one is numbered from zero |
|
||||
* and additional slices are numbered upwards from there. |
|
||||
* |
|
||||
* The maximum number of logical units supported on a single chip is 232. |
|
||||
* |
|
||||
* The RomWBW BIOS maps a device such as a PPIDE into four CP/M drives. By |
|
||||
* default, the drives are assigned to logical units 0 to 3. When using the |
|
||||
* DM_PPIDE configuration option, the four PPIDE drives are A: B: C: & D:. |
|
||||
* |
|
||||
* The A: drive is assigned to logical unit 0. The B: drive is assigned to |
|
||||
* logical unit 1. The C: drive is assigned to logical unit 2, and the D: |
|
||||
* drive is assigned to logical unit 3. This gives the appearance of having |
|
||||
* four individual 8MB drives. |
|
||||
* |
|
||||
* In order to make all the space on the media available, you can change |
|
||||
* the mapping of each of the drives through the use of the "MAP" program, |
|
||||
* or by making system calls to the BIOS function SETLU. It is common to |
|
||||
* lelave the A: drive mapped to logical unit 0. Then the A: drive can be |
|
||||
* backed up through a simple copy operation dto any of the mappable logical |
|
||||
* units on the media. Here is the sequence of operations used to back up |
|
||||
* the A: drive onto logical unit 8. (arbitrary) |
|
||||
* |
|
||||
* map d: 8 |
|
||||
* clrdir d: |
|
||||
* pip d:=a:*.* |
|
||||
* label d: 6/1/2012-12:30 |
|
||||
* |
|
||||
* this operation creates a complete backup of the A: drive (LU0) onto LU8, |
|
||||
* and labels the drive for future reference. |
|
||||
* |
|
||||
* |
|
||||
* The problem this programs solves is how to prepare a large media device a few |
|
||||
* logical units, or an entire device, possible having hundreds of logical |
|
||||
* units. |
|
||||
* |
|
||||
* The prefix sector of each logical unit has a label, and a write protect |
|
||||
* field. Once the logical united is protected, it makes it harder to |
|
||||
* destroy your data. As powerful as the MULTIFMT program is, if operated |
|
||||
* incorrectly, it can format hundreds of logical units in several minutes |
|
||||
* and potentially destroy a lot of your data and programs. Care is required. |
|
||||
* |
|
||||
* The program begins by asking for a starting and ending logical unit |
|
||||
* number which provides a range within which to operate. Within that range |
|
||||
* individual logical units can be protected or not. The program also asks |
|
||||
* if you would like to override all the protected logical units, and thereby |
|
||||
* format the entire device, regardless of prior contents. |
|
||||
* |
|
||||
* It should only be necessary to run multifmt once to create the prefixes |
|
||||
* and clear the directories. The clrdir program can be used ad hoc to clear |
|
||||
* individual logical units as needed. |
|
||||
* |
|
||||
* Now that a this is understood, the code of the program will make a lot |
|
||||
* more sense. The main function calls the gather funtion that queries the |
|
||||
* for constraints, then it call the logical formatter to deal with high |
|
||||
* level issues like how many logical units... |
|
||||
* The logical formatter calls the physical formatter to actually get the |
|
||||
* work done and make changes to the target media. Because of this structure, |
|
||||
* it is possible to operate the program in a sort of demo mode by disabling |
|
||||
* the operation of the physical format function. |
|
||||
* |
|
||||
*/ |
|
||||
|
|
||||
#include "portab.h" |
|
||||
#include "globals.h" |
|
||||
#include "stdio.h" |
|
||||
#include "stdlib.h" |
|
||||
#include "std.h" |
|
||||
#include "memory.h" |
|
||||
#include "cpmbios.h" |
|
||||
#include "bioscall.h" |
|
||||
#include "cpmbdos.h" |
|
||||
#include "bdoscall.h" |
|
||||
#include "sectorio.h" |
|
||||
#include "infolist.h" |
|
||||
#include "metadata.h" |
|
||||
#include "clogical.h" |
|
||||
#include "applvers.h" |
|
||||
#include "diagnose.h" |
|
||||
#include "cnfgdata.h" |
|
||||
#include "syscfg.h" |
|
||||
|
|
||||
#define BDOS 5 /* memory address of BDOS invocation */ |
|
||||
#define HIGHSEG 0x0C000 /* memory address of system config */ |
|
||||
|
|
||||
#define GETSYSCFG 0x0F000 /* HBIOS function for Get System Configuration */ |
|
||||
|
|
||||
|
|
||||
struct DPB * pDPB; /* a pointer to a disk parameter block */ |
|
||||
struct DPH * pDPH; /* a pointer to a disk parameter header */ |
|
||||
|
|
||||
struct SYSCFG * pSYSCFG; /* a pointer to the system configuration data */ |
|
||||
|
|
||||
int gDrvNum; /* The global drive number, A:=0, B:=1... */ |
|
||||
int gDevUnit; /* The globals drive's device type and unit */ |
|
||||
int gDefLU; /* The global storage location for the default LU */ |
|
||||
int gCurLU; /* The global storage location for the current LU */ |
|
||||
int gNumLU; /* The global storage location for the number of LUs */ |
|
||||
int gStatus; |
|
||||
int gRetcode; |
|
||||
int g1st; /* The global storage location for the first LU to format */ |
|
||||
int gLast; /* The global storage location for the last LU to format */ |
|
||||
int gOverAll; /* The global boolean indicating protection overrides */ |
|
||||
char gTT; /* Terminal Type */ |
|
||||
|
|
||||
unsigned char e5buffer[128]; /* a buffer full of empty dir entries */ |
|
||||
|
|
||||
|
|
||||
dispattr(fg) |
|
||||
char * fg; |
|
||||
{ |
|
||||
printf("%c[%sm",27,fg); |
|
||||
} |
|
||||
|
|
||||
|
|
||||
clrline() |
|
||||
{ |
|
||||
if(0 < gTT) { |
|
||||
crtlc(2,0); |
|
||||
} |
|
||||
printf("\r "); |
|
||||
printf(" \r"); |
|
||||
} |
|
||||
|
|
||||
/* The purpose of this routine is to access the BIOS GETDSK function
|
|
||||
and determine the device, unit, current logical unit, and number |
|
||||
of logical units present on the media. */ |
|
||||
|
|
||||
getinfo(drnum) |
|
||||
{ |
|
||||
ireghl = pGETLU; |
|
||||
iregbc= drnum; |
|
||||
bioscall(); |
|
||||
gStatus = irega; /* 0=ok, 1=invdrv */ |
|
||||
gDevUnit = iregbc; |
|
||||
gCurLU = iregde; |
|
||||
gNumLU = ireghl; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
clrdir(line,col) |
|
||||
int line; |
|
||||
int col; |
|
||||
{ |
|
||||
int sector; |
|
||||
int sectors; |
|
||||
|
|
||||
if(0 == gTT) printf("clrdir(%d) ",gDrvNum); |
|
||||
|
|
||||
memset(e5buffer,0x0e5,sizeof(e5buffer)); |
|
||||
|
|
||||
ireghl = pSELDSK; |
|
||||
iregbc = gDrvNum; |
|
||||
iregde = 0; |
|
||||
bioscall(); |
|
||||
pDPH = ireghl; |
|
||||
pDPB = pDPH->dpb; |
|
||||
|
|
||||
sectors = (pDPB->drm+1)/4; |
|
||||
wrsector(gDrvNum,pDPB->off,0,e5buffer,0); |
|
||||
for(sector=1;sector<sectors;sector++) { |
|
||||
|
|
||||
if(-1 != line) { |
|
||||
crtlc(line,col-1); |
|
||||
printf("%d",sectors-sector); |
|
||||
} |
|
||||
|
|
||||
wrsector(gDrvNum,pDPB->off,sector,e5buffer,1); |
|
||||
} |
|
||||
|
|
||||
|
|
||||
|
|
||||
} |
|
||||
|
|
||||
clrmeta(lu,line,col) |
|
||||
int lu; |
|
||||
int line; |
|
||||
int col; |
|
||||
{ |
|
||||
|
|
||||
if(0 == gTT) printf("clrmeta(%d) ",lu); |
|
||||
else { |
|
||||
crtlc(line,col-1); |
|
||||
printf("met"); |
|
||||
} |
|
||||
|
|
||||
rdsector(gDrvNum,0,11,&metadata,0); |
|
||||
metadata.signature = 0x0a55a; |
|
||||
metadata.platform = pSYSCFG->cnfgdata.platform; |
|
||||
|
|
||||
memcpy(metadata.formatter,"multifmt",8); |
|
||||
metadata.drive = gDrvNum; |
|
||||
metadata.logunit = lu; |
|
||||
metadata.writeprot = FALSE; |
|
||||
metadata.rmj = A_RMJ; |
|
||||
metadata.rmn = A_RMN; |
|
||||
metadata.rup = A_RUP; |
|
||||
metadata.rtp = A_RTP; |
|
||||
memcpy(metadata.label,"[multiformatted]",16); |
|
||||
metadata.term = '$'; |
|
||||
metadata.update = 0; |
|
||||
wrsector(gDrvNum,0,11,&metadata,0); |
|
||||
} |
|
||||
|
|
||||
/* The purpose of the physical format routine is to do last minute
|
|
||||
checks on logical unit protection status, and call the actual |
|
||||
routines that initialize the metadata and clear the directory */ |
|
||||
|
|
||||
physfmt(lu) |
|
||||
int lu; |
|
||||
{ |
|
||||
int line,col; |
|
||||
|
|
||||
rdsector(gDrvNum,0,11,&metadata,0); |
|
||||
if(TRUE == metadata.writeprot) { |
|
||||
if(gTT == 0) { |
|
||||
printf("LU%d is protected, ",lu); |
|
||||
} |
|
||||
if(FALSE == gOverAll) { |
|
||||
if(0==gTT) printf("Override is not enabled, "); |
|
||||
return FALSE; |
|
||||
} |
|
||||
if(gTT == 0) printf("Override is enabled, "); |
|
||||
} |
|
||||
|
|
||||
/* LU is not protected or override is enabled */ |
|
||||
|
|
||||
if(0==gTT) { |
|
||||
printf("Formatting LU# %d\r",lu); |
|
||||
clrmeta(lu,-1,-1); |
|
||||
clrdir(-1,-1); |
|
||||
} else { |
|
||||
/* Produce formatted progress display */ |
|
||||
|
|
||||
line = lu / 16; |
|
||||
crtlc(26-16-4+line,0); |
|
||||
printf("%d...",lu & 0xf0); |
|
||||
|
|
||||
col = lu & 15; |
|
||||
clrmeta(lu,24-16-2+line,((80-64)/2)+(col*4)+1); |
|
||||
clrdir( 24-16-2+line,((80-64)/2)+(col*4)+1); |
|
||||
|
|
||||
crtlc(24-16-2+line,((80-64)/2)+(col*4)); |
|
||||
printf(" OK"); |
|
||||
} |
|
||||
|
|
||||
return TRUE; |
|
||||
} |
|
||||
|
|
||||
|
|
||||
/* The purpose of the logical formatting routine is to implement the
|
|
||||
main format loop that traverses the range of logical units, and |
|
||||
calls tyhe physical format routine above. */ |
|
||||
|
|
||||
lformat() |
|
||||
{ |
|
||||
int index; |
|
||||
|
|
||||
|
|
||||
if(0 != gTT) { |
|
||||
for(index=0;index<16;index++) { |
|
||||
crtlc(24-16-2-2,((80-64)/2)+(index*4)); |
|
||||
printf("+%d",index); |
|
||||
} |
|
||||
for(index=0;index<16;index++) { |
|
||||
crtlc(24-16-2-1,((80-64)/2)+(index*4)); |
|
||||
printf("---"); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
gDefLU = lugcur(gDrvNum); |
|
||||
for(index=g1st;index<=gLast;index++) { |
|
||||
luscur(gDrvNum,index); |
|
||||
rdsector(gDrvNum,0,11,&metadata,0); |
|
||||
if(TRUE == metadata.writeprot) { |
|
||||
if(TRUE == gOverAll) { |
|
||||
physfmt(index); |
|
||||
} |
|
||||
} else { |
|
||||
physfmt(index); |
|
||||
} |
|
||||
} |
|
||||
luscur(gDrvNum,gDefLU); |
|
||||
} |
|
||||
|
|
||||
/* The purpose of the dispinfo routie is to display the formatted
|
|
||||
parameters gathered in the previous routine and ask the user |
|
||||
for permission to proceed with the formatting on that basis. */ |
|
||||
|
|
||||
int dispinfo() |
|
||||
{ |
|
||||
if(1 == gRetcode) { |
|
||||
return FAILURE; |
|
||||
} |
|
||||
|
|
||||
if(0 == gNumLU) { |
|
||||
return FAILURE; |
|
||||
} |
|
||||
|
|
||||
printf("\nDrive %c:, ",gDrvNum+'A'); |
|
||||
printf("Current LU is %d, ",gCurLU); |
|
||||
printf("Number of LU's is %d, ",gNumLU); |
|
||||
switch((gDevUnit>>8) & 0xf0) { |
|
||||
case DEV_IDE: |
|
||||
printf("Drive is IDE"); |
|
||||
break; |
|
||||
case DEV_PPIDE: |
|
||||
printf("Drive is PPIDE"); |
|
||||
break; |
|
||||
default: |
|
||||
printf("Drive is Unknown!!(%x)",gDevUnit); |
|
||||
break; |
|
||||
|
|
||||
} |
|
||||
clrline(); |
|
||||
printf("Would you like to format the logical units on this drive(Y/n)?"); |
|
||||
|
|
||||
dregbc = 1; |
|
||||
bdoscall(); |
|
||||
switch(drega) { |
|
||||
case 'Y': |
|
||||
case 'y': |
|
||||
return TRUE; |
|
||||
default: |
|
||||
return FALSE; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
|
|
||||
/* The purpose of the gather routine is to have a dialog with the user
|
|
||||
end obtain the range of logical units to be formatted and the choice |
|
||||
of whether logical unit protection will be overridden in the process. */ |
|
||||
|
|
||||
gather() |
|
||||
{ |
|
||||
|
|
||||
char szTemp[128]; |
|
||||
|
|
||||
clrline(); |
|
||||
g1st = 1; |
|
||||
|
|
||||
printf("Please enter first logical unit to format 0-%d (%d):", |
|
||||
gNumLU-1,g1st); |
|
||||
gets(szTemp); |
|
||||
if(0 < strlen(szTemp)) { |
|
||||
g1st = atoi(szTemp); |
|
||||
} |
|
||||
|
|
||||
clrline(); |
|
||||
gLast = gNumLU-1; |
|
||||
printf("Please enter last logical unit to format 0-%d (%d):", |
|
||||
gNumLU-1,gLast); |
|
||||
gets(szTemp); |
|
||||
if(0 < strlen(szTemp)) { |
|
||||
gLast = atoi(szTemp); |
|
||||
} |
|
||||
|
|
||||
clrline(); |
|
||||
gOverAll = FALSE; |
|
||||
printf("Do you want to override all protected logical units (Y/n): "); |
|
||||
dregbc = 1; |
|
||||
bdoscall(); |
|
||||
if('Y' == drega) { |
|
||||
clrline(); |
|
||||
printf("Do you really want to DESTROY all logical units (D/n): "); |
|
||||
dregbc = 1; |
|
||||
bdoscall(); |
|
||||
if('D' == drega) { |
|
||||
gOverAll = TRUE; |
|
||||
} |
|
||||
} else { |
|
||||
printf("\n"); |
|
||||
} |
|
||||
|
|
||||
} |
|
||||
|
|
||||
|
|
||||
|
|
||||
main(argc,argv) |
|
||||
int argc; |
|
||||
char *argv[]; |
|
||||
{ |
|
||||
int retcode; |
|
||||
struct INFOLIST * pINFOLIST; |
|
||||
|
|
||||
hregbc = GETSYSCFG; /* function = Get System Config */ |
|
||||
hregde = HIGHSEG; /* addr of dest (must be high) */ |
|
||||
diagnose(); /* invoke the NBIOS function */ |
|
||||
|
|
||||
pSYSCFG = HIGHSEG; |
|
||||
|
|
||||
/* printf("TT is %d\n",pSYSCFG->cnfgdata.termtype); */ |
|
||||
|
|
||||
gTT = pSYSCFG->cnfgdata.termtype; |
|
||||
crtinit(gTT); |
|
||||
if(0 < gTT) { |
|
||||
crtclr(); |
|
||||
crtlc(0,0); |
|
||||
} |
|
||||
|
|
||||
printf("MULTIFMT.COM %d/%d/%d v%d.%d.%d.%d", |
|
||||
A_MONTH,A_DAY,A_YEAR,A_RMJ,A_RMN,A_RUP,A_RTP); |
|
||||
printf(" dwg - Prepare new mass storage media for use"); |
|
||||
|
|
||||
ireghl = pGETINFO; |
|
||||
bioscall(); |
|
||||
pINFOLIST = ireghl; |
|
||||
|
|
||||
dregbc = RETCURRDISK; |
|
||||
bdoscall(); |
|
||||
gDrvNum = drega; |
|
||||
|
|
||||
getinfo(gDrvNum); |
|
||||
retcode = dispinfo(); |
|
||||
if(FALSE == retcode) { |
|
||||
printf("\nFormat cancelled at user's request"); |
|
||||
exit(1); |
|
||||
} |
|
||||
gather(); |
|
||||
lformat(); |
|
||||
} |
|
||||
|
|
||||
/********************/ |
|
||||
/* eof - multifmt.c */ |
|
||||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue