Compare commits

..

1 Commits
v2.5.4 ... v2.3

Author SHA1 Message Date
wayne
bc9b3e663a 2013-01-17 05:47:04 +00:00
582 changed files with 6286 additions and 41481 deletions

View File

@@ -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);
}

View File

@@ -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%

View File

@@ -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

View File

@@ -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.

View File

@@ -1,19 +0,0 @@
/************************************/
/* applvers.h dwg - 2.5.4.20 */
/************************************/
#define A_RMJ 2
#define A_RMN 5
#define A_RUP 4
#define A_RTP 20
#define A_MONTH 3
#define A_DAY 1
#define A_YEAR 2014
#define A_YR 14
/********************/
/* eof - applvers.h */
/********************/

View File

@@ -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 4
A$RTP equ 20
A$MONTH equ 3
A$DAY equ 1
A$YEAR equ 2014
date macro
dat db ' 3/1/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

View File

@@ -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 */


View File

@@ -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 */
/*****************/


View File

@@ -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


View File

@@ -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


View File

@@ -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


View File

@@ -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);
}


View File

@@ -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);
}


View File

@@ -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 */
/********************/


View File

@@ -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 */
;; /********************/


View File

@@ -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);
}


View File

@@ -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


View File

@@ -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


View File

@@ -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


View File

@@ -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 */
/********************/

View File

@@ -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); */


View File

@@ -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);
}

View File

@@ -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);
}


View File

@@ -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);
}


View File

@@ -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);
}
}
}


View File

@@ -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);
}


View File

@@ -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 Load Diff

View File

@@ -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


View File

@@ -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();
}


View File

@@ -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


View File

@@ -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


View File

@@ -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

View File

@@ -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 Load Diff

View File

@@ -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);
}


View File

@@ -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);
}
}
/**************************************************************************/


View File

@@ -1,8 +0,0 @@
#include <stdio.h>
#include "ascii.h"
main()
{
printf("%c",ASCII_FF);
}


View File

@@ -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 */
}


View File

@@ -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


View File

@@ -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


View File

@@ -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


View File

@@ -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 */
/*****************/


View File

@@ -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); */
}


View File

@@ -1,11 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
int main(argc,argv)
int argc;
char * argv[];
{
printf("Help World!!\n");
return 0;
}


View File

@@ -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


View File

@@ -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


View File

@@ -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


View File

@@ -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


View File

@@ -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 Load Diff

View File

@@ -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 */
/****************/

View File

@@ -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


View File

@@ -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


View File

@@ -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);
}


View File

@@ -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);
}


View File

@@ -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);
}


View File

@@ -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


View File

@@ -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


View File

@@ -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);
}


View File

@@ -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;
}
}
}


View File

@@ -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 */

View File

@@ -1,59 +0,0 @@
extrn .begin,.chl,.swt
extrn csave,cret,.move
PUBLIC main_
main_: lxi d,.2
call csave
LXI H,0
XCHG
LXI H,8-.2
DAD SP
MOV A,M
INX H
MOV H,M
MOV L,A
CALL .lt
JZ .3
LXI H,.1+0
PUSH H
CALL printf_
POP D
.3:
LXI H,1
XCHG
LXI H,8-.2
DAD SP
MOV A,M
INX H
MOV H,M
MOV L,A
CALL .lt
JZ .4
LXI H,.1+7
PUSH H
CALL printf_
POP D
.4:
LXI H,2
XCHG
LXI H,8-.2
DAD SP
MOV A,M
INX H
MOV H,M
MOV L,A
CALL .lt
JZ .5
LXI H,.1+14
PUSH H
CALL printf_
POP D
.5:
RET
.2 EQU 0
.1:
DB 97,114,103,99,62,48,0,97,114,103,99,62,49,0,97
DB 114,103,99,62,50,0
extrn printf_
extrn .lt
END


View File

@@ -1,281 +0,0 @@
/* n8chars.c 9/12/2012 dwg - information from TI Docs */
/* http://www1.cs.columbia.edu/~sedwards/papers/TMS9918.pdf */
unsigned char charset[256*8] = {
/* 10000 */ 0,0,0,0,0,0,0,0,
/* 10001 */ 0,0,0,60,60,48,48,48,
/* 10002 */ 0,0,0,240,240,48,48,48,
/* 10003 */ 48,48,48,60,60,0,0,0,
/* 10004 */ 48,48,48,240,240,0,0,0,
/* 10005 */ 48,48,48,48,48,48,48,48,
/* 10006 */ 0,0,0,255,255,0,0,0,
/* 10007 */ 0,32,112,248,112,32,0,0,
/* 10008 */ 248,216,136,0,136,216,248,0,
/* 10009 */ 0,0,0,0,0,0,0,0,
/* 10010 */ 0,0,0,0,0,0,0,0,
/* 10011 */ 24,24,32,96,144,96,0,0,
/* 10012 */ 32,80,32,32,112,32,0,0,
/* 10013 */ 0,0,0,0,0,0,0,0,
/* 10014 */ 0,0,0,0,0,0,0,0,
/* 10015 */ 168,80,80,216,80,80,168,0,
/* 10016 */ 48,48,48,252,252,48,48,48,
/* 10017 */ 16,48,112,240,112,48,16,0,
/* 10018 */ 32,112,32,32,32,112,32,0,
/* 10019 */ 80,80,80,80,0,80,0,0,
/* 10020 */ 120,168,168,104,40,40,0,0,
/* 10021 */ 48,48,48,252,252,0,0,0,
/* 10022 */ 0,0,0,252,252,48,48,48,
/* 10023 */ 48,48,48,240,240,48,48,48,
/* 10024 */ 32,112,32,32,32,32,32,32,
/* 10025 */ 48,48,48,60,60,48,48,48,
/* 10026 */ 0,16,24,252,24,16,0,0,
/* 10027 */ 0,32,96,252,96,32,0,0,
/* 10028 */ 0,0,0,0,0,0,0,0,
/* 10029 */ 0,0,0,0,0,0,0,0,
/* 10030 */ 0,0,0,0,0,0,0,0,
/* 10031 */ 0,0,0,0,0,0,0,0,
/* 10032 */ 0,0,0,0,0,0,0,0,
/* 10033 */ 48,120,120,48,0,48,0,0,
/* 10034 */ 216,216,80,0,0,0,0,0,
/* 10035 */ 72,72,252,72,72,252,72,72,
/* 10036 */ 32,120,160,120,36,248,32,0,
/* 10037 */ 0,200,208,32,88,152,0,0,
/* 10038 */ 48,72,72,80,96,144,120,0,
/* 10039 */ 48,48,64,0,0,0,0,0,
/* 10040 */ 16,32,32,32,32,32,16,0,
/* 10041 */ 32,16,16,16,16,16,32,0,
/* 10042 */ 32,168,112,248,112,168,32,0,
/* 10043 */ 0,32,32,248,32,32,0,0,
/* 10044 */ 0,0,0,0,0,48,48,64,
/* 10045 0,0,0,252,0,0,0,0, */
/* 10045 */ 0,0,0,112,0,0,0,0,
/* 10046 */ 0,0,0,0,0,48,48,0,
/* 10047 */ 4,8,16,32,64,128,0,0,
/* 10048 */ 112,152,168,168,168,200,112,0,
/* 10049 */ 32,96,32,32,32,32,248,0,
/* 10050 32,80,16,32,64,128,248,0, */
/* 10050 */ 112,136,8,16,96,128,248,0,
/* 10051 */ 112,136,8,112,8,136,112,0,
/* 10052 */ 48,80,144,248,16,16,16,0,
/* 10053 */ 248,128,128,240,8,136,112,0,
/* 10054 */ 56,64,128,240,136,136,112,0,
/* 10055 */ 248,8,16,32,32,32,32,0,
/* 10056 */ 112,136,136,112,136,136,112,0,
/* 10057 */ 112,136,136,120,8,136,112,0,
/* 10058 */ 0,48,48,0,48,48,0,0,
/* 10059 */ 0,48,48,0,48,48,96,0,
/* 10060 */ 16,32,64,128,64,32,16,0,
/* 10061 */ 0,0,252,0,252,0,0,0,
/* 10062 */ 64,32,16,8,16,32,64,0,
/* 10063 */ 112,136,8,48,32,0,32,0,
/* 10064 */ 112,136,184,176,128,128,112,0,
/* 10065 */ 32,80,136,248,136,136,136,0,
/* 10066 */ 240,72,72,112,72,72,240,0,
/* 10067 */ 112,136,128,128,128,136,112,0,
/* 10068 */ 240,72,72,72,72,72,240,0,
/* 10069 */ 248,136,128,224,128,136,248,0,
/* 10070 */ 248,136,128,240,128,128,128,0,
/* 10071 */ 112,136,128,184,136,136,112,0,
/* 10072 */ 136,136,136,248,136,136,136,0,
/* 10073 */ 248,32,32,32,32,32,248,0,
/* 10074 */ 28,8,8,8,8,136,112,0,
/* 10075 */ 136,144,160,192,160,144,136,0,
/* 10076 */ 128,128,128,128,128,136,248,0,
/* 10077 */ 136,216,168,136,136,136,136,0,
/* 10078 */ 136,200,168,168,168,152,136,0,
/* 10079 */ 112,136,136,136,136,136,112,0,
/* 10080 */ 240,136,136,240,128,128,128,0,
/* 10081 */ 112,136,136,136,168,152,120,4,
/* 10082 */ 240,136,136,240,160,144,136,0,
/* 10083 */ 112,136,64,32,16,136,112,0,
/* 10084 */ 248,32,32,32,32,32,112-64-16,0,
/* 10085 */ 136,136,136,136,136,136,112,0,
/* 10086 */ 136,136,136,80,80,80,32,0,
/* 10087 */ 136,136,136,168,168,168,80,0,
/* 10088 */ 136,136,80,32,80,136,136,0,
/* 10089 */ 136,136,80,32,32,32,32,0,
/* 10090 */ 248,136,16,32,64,136,248,0,
/* 10091 */ 120,64,64,64,64,64,120,0,
/* 10092 */ 0,128,64,32,16,8,0,0,
/* 10093 */ 120,8,8,8,8,8,120,0,
/* 10094 */ 32,80,136,0,0,0,0,0,
/* 10095 */ 0,0,0,0,0,0,252,0,
/* 10096 */ 96,96,16,0,0,0,0,0,
/* 10097 */ 0,0,240,8,120,136,112,0,
/* 10098 */ 128,128,128,240,136,136,240,0,
/* 10099 */ 0,0,0,112,128,128,112,0,
/* 10100 */ 8,8,8,120,136,136,120,0,
/* 10101 */ 0,0,112,136,248,128,112,0,
/* 10102 */ 0,48,72,224,64,64,64,0,
/* 10103 */ 0,0,56,72,72,56,8,112,
/* 10104 */ 0,128,128,176,200,136,136,0,
/* 10105 */ 0,0,32,0,96,32,112,0,
/* 10106 */ 0,8,0,24,8,8,72,48,
/* 10107 */ 128,128,144,160,192,160,144,0,
/* 10108 */ 32,32,32,32,32,32,32,0,
/* 10109 */ 0,0,0,80,168,168,136,0,
/* 10110 */ 0,0,0,176,200,136,136,0,
/* 10111 */ 0,0,0,112,136,136,112,0,
/* 10112 */ 0,0,112,72,72,112,64,64,
/* 10113 */ 0,96,56,72,72,56,8,8,
/* 10114 */ 0,0,0,176,200,128,128,0,
/* 10115 */ 0,0,96,128,96,16,96,0,
/* 10116 */ 0,0,64,224,64,64,32,0,
/* 10117 */ 0,0,0,144,144,144,104,0,
/* 10118 */ 0,0,0,136,136,80,32,0,
/* 10119 */ 0,0,0,136,168,168,80,0,
/* 10120 */ 0,0,0,72,48,48,72,0,
/* 10121 */ 0,0,136,80,32,64,128,0,
/* 10122 */ 0,0,248,16,32,64,248,0,
/* 10123 */ 16,32,32,64,32,32,16,0,
/* 10124 */ 32,32,32,0,32,32,32,0,
/* 10125 */ 64,32,32,16,32,32,64,0,
/* 10126 */ 108,144,0,0,0,0,0,0,
/* 10127 */ 112,80,80,80,80,80,112,0,
/****************************************************************/
/* These are Douglas Goodall's personal tri-plex semi graphics */
/* 10128 */ 252,128,188,160,172,168,168,168, /* upper left */
/* 10129 */ 252,0,252,0,252,0,0,0, /* top horz */
/* 10130 */ 252,4,244,20,212,84,84,84, /* upper right */
/* 10131 */ 84,84,84,84,84,84,84,84, /* right vert */
/* 10132 */ 84,84,84,212,20,244,4,252, /* lower right */
/* 10133 */ 0,0,0,255,0,255,0,255, /* bottom horz */
/* 10134 */ 168,168,168,172,160,188,128,252, /* lower left */
/* 10135 */ 168,168,168,168,168,168,168,168, /* left vert */
/* 10136 */ 168,168,172,160,172,168,168,168, /* left joint */
/* 10137 */ 84,84,212,20,212,84,84,84, /* right joint */
/* 10138 */ 0,0,252,0,252,0,0,0, /* inner horz */
/****************************************************************/
/****************************************************************/
/* These are Douglas Goodall's personal uni-plex semi graphics */
/* 10139 */ 252,128,128,128,128,128,128,128, /* upper left */
/* 10140 */ 252,0,0,0,0,0,0,0, /* top horz */
/* 10141 */ 252,4,4,4,4,4,4,4, /* upper right */
/* 10142 */ 4,4,4,4,4,4,4,4, /* right vert */
/* 10143 */ 4,4,4,4,4,4,4,252, /* lower right */
/* 10144 */ 0,0,0,0,0,0,0,252, /* bottom horz */
/* 10145 */ 128,128,128,128,128,128,128,252, /* lower left */
/* 10146 */ 128,128,128,128,128,128,128,128, /* left vert */
/* 10147 */ 128,128,128,252,128,128,128,128, /* left joint */
/* 10148 */ 4,4,4,252,4,4,4,4, /* right joint */
/* 10149 */ 0,0,0,252,0,0,0,0, /* inner horz */
/****************************************************************/
/* 10150 */ 0,0,0,0,0,0,0,0,
/* 10151 */ 0,0,0,0,0,0,0,0,
/* 10152 */ 0,0,0,0,0,0,0,0,
/* 10153 */ 0,0,0,0,0,0,0,0,
/* 10154 */ 0,0,0,0,0,0,0,0,
/* 10155 */ 0,0,0,0,0,0,0,0,
/* 10156 */ 0,0,0,0,0,0,0,0,
/* 10157 */ 0,0,0,0,0,0,0,0,
/* 10158 */ 0,0,0,0,0,0,0,0,
/* 10159 */ 0,0,0,0,0,0,0,0,
/* 10160 */ 32,64,240,8,120,136,112,0,
/* 10161 */ 16,32,0,96,32,32,248,0,
/* 10162 */ 16,32,0,112,136,136,112,0,
/* 10163 */ 16,32,0,136,136,136,116,0,
/* 10164 */ 16,32,0,176,200,136,136,0,
/* 10165 */ 16,32,0,200,168,152,136,0,
/* 10166 */ 112,136,136,124,0,252,0,0,
/* 10167 */ 112,136,136,112,0,252,0,0,
/* 10168 */ 32,0,32,32,64,136,112,0,
/* 10169 */ 0,0,0,0,252,128,128,128,
/* 10170 */ 0,0,0,0,252,4,4,4,
/* 10171 */ 136,144,168,84,136,28,0,0,
/* 10172 */ 136,144,168,88,184,8,0,0,
/* 10173 */ 48,0,48,120,120,48,0,0,
/* 10174 */ 20,40,80,160,80,40,20,0,
/* 10175 */ 160,80,40,20,40,80,160,0,
/* 10176 */ 84,170,84,170,84,170,84,170,
/* 10177 */ 170,84,170,84,170,84,170,84,
/* 10178 */ 182,108,218,182,108,218,182,108,
/* 10179 */ 24,24,24,24,24,24,24,24,
/* 10180 */ 24,24,24,24,248,24,24,24,
/* 10181 */ 24,24,24,248,24,248,24,24,
/* 10182 */ 108,108,108,108,236,108,108,108,
/* 10183 */ 0,0,0,0,252,108,108,108,
/* 10184 */ 0,0,0,252,108,236,108,108,
/* 10185 */ 108,108,236,12,236,108,108,108,
/* 10186 */ 108,108,108,108,108,108,108,108,
/* 10187 */ 0,0,252,14,238,108,108,108,
/* 10188 */ 108,108,236,12,252,0,0,0,
/* 10189 */ 100,100,252,0,0,0,0,0,
/* 10190 */ 48,48,240,48,48,240,0,0,
/* 10191 */ 0,0,0,0,240,48,48,48,
/* 10192 */ 48,48,48,48,60,0,0,0,
/* 10193 */ 48,48,48,48,252,0,0,0,
/* 10194 */ 0,0,0,0,252,48,48,48,
/* 10195 */ 48,48,48,48,60,48,48,48,
/* 10196 */ 0,0,0,0,252,0,0,0,
/* 10197 */ 48,48,48,48,252,48,48,48,
/* 10198 */ 48,48,60,48,60,48,48,48,
/* 10199 */ 216,216,220,216,216,216,216,216,
/* 10200 */ 216,216,216,220,192,252,0,0,
/* 10201 */ 0,0,0,252,192,220,216,216,
/* 10202 */ 216,216,216,220,192,0,252,0,
/* 10203 */ 0,0,0,0,0,0,252,0,
/* 10204 */ 216,216,216,220,192,220,216,216,
/* 10205 */ 0,0,0,252,0,252,0,0,
/* 10206 */ 216,216,216,220,0,220,216,216,
/* 10207 */ 48,48,48,252,0,0,252,0,
/* 10208 */ 216,216,216,252,0,0,0,0,
/* 10209 */ 0,0,252,0,0,252,48,48,
/* 10210 */ 0,0,0,0,0,252,216,216,
/* 10211 */ 216,216,216,252,0,0,0,0,
/* 10212 */ 48,48,48,60,48,48,60,0,
/* 10213 */ 0,0,0,62,48,62,48,48,
/* 10214 */ 0,0,0,0,0,252,216,216,
/* 10215 */ 216,216,216,216,220,216,216,216,
/* 10216 */ 48,48,252,0,0,252,48,48,
/* 10217 */ 48,48,48,240,0,0,0,0,
/* 10218 */ 0,0,0,60,48,48,48,48,
/* 10219 */ 252,252,252,252,252,252,252,252,
/* 10220 */ 0,0,0,252,252,252,192,192,
/* 10221 */ 192,192,192,192,192,192,192,192,
/* 10222 */ 12,12,12,12,12,12,12,12,
/* 10223 */ 12,12,12,12,252,252,252,0,
/* 10224 */ 0,0,0,104,144,144,104,0,
/* 10225 */ 112,136,136,176,136,136,240,64,
/* 10226 */ 240,144,128,128,128,128,128,0,
/* 10227 */ 248,80,80,80,80,72,0,0,
/* 10228 */ 248,136,64,32,64,136,248,0,
/* 10229 */ 0,0,0,124,136,136,112,0,
/* 10230 */ 0,0,0,136,136,136,112,128,
/* 10231 */ 0,0,116,152,16,16,28,0,
/* 10232 */ 252,16,56,68,56,16,252,0,
/* 10233 */ 48,204,204,252,204,204,56,0,
/* 10234 */ 120,132,132,132,72,72,132,0,
/* 10235 */ 60,64,56,68,68,68,56,0,
/* 10236 */ 0,0,108,146,146,108,0,0,
/* 10237 */ 0,0,0,56,88,104,112,0,
/* 10238 */ 56,64,128,248,128,64,56,0,
/* 10239 */ 0,0,48,204,204,204,204,0,
/* 10240 */ 252,0,0,252,0,0,252,0,
/* 10241 */ 16,16,124,16,16,0,254,0,
/* 10242 */ 32,16,8,16,32,0,254,0,
/* 10243 */ 16,32,64,32,16,0,254,0,
/* 10244 */ 24,52,48,48,48,48,48,48,
/* 10245 */ 48,48,48,48,48,48,176,112,
/* 10246 */ 48,48,0,252,0,48,48,0,
/* 10247 */ 0,100,152,0,100,152,0,0,
/* 10248 */ 56,68,68,56,0,0,0,0,
/* 10249 */ 0,56,56,0,0,0,0,0,
/* 10250 */ 0,0,56,0,0,0,0,0,
/* 10251 */ 14,8,8,72,40,24,8,0,
/* 10252 */ 0,0,0,176,72,72,72,0,
/* 10253 */ 0,0,240,60,64,128,248,0,
/* 10254 */ 252,252,252,252,252,252,252,252,
/* 10255 */ 0,0,0,0,0,0,0,0
};
/*******************/
/* eof - n8chars.c */
/*******************/


View File

@@ -1,113 +0,0 @@
/* n8chars.h 9/12/2012 dwg - information from TI Docs */
/* http://www1.cs.columbia.edu/~sedwards/papers/TMS9918.pdf */
extern unsigned char charset[256*8];
/*******************/
/* eof - n8chars.h */
/*******************/
0,48,48,48,
/* 10003 */ 48,48,48,60,60,0,0,0,
/* 10004 */ 48,48,48,240,240,0,0,0,
/* 10005 */ 48,48,48,48,48,48,48,48,
/* 10006 */ 0,0,0,255,255,0,0,0,
/* 10007 */ 0,32,112,248,112,32,0,0,
/* 10008 */ 248,216,136,0,136,216,248,0,
/* 10009 */ 0,0,0,0,0,0,0,0,
/* 10010 */ 0,0,0,0,0,0,0,0,
/* 10011 */ 24,24,32,96,144,96,0,0,
/* 10012 */ 32,80,32,32,112,32,0,0,
/* 10013 */ 0,0,0,0,0,0,0,0,
/* 10014 */ 0,0,0,0,0,0,0,0,
/* 10015 */ 168,80,80,216,80,80,168,0,
/* 10016 */ 48,48,48,252,252,48,48,48,
/* 10017 */ 16,48,112,240,112,48,16,0,
/* 10018 */ 32,112,32,32,32,112,32,0,
/* 10019 */ 80,80,80,80,0,80,0,0,
/* 10020 */ 120,168,168,104,40,40,0,0,
/* 10021 */ 48,48,48,252,252,0,0,0,
/* 10022 */ 0,0,0,252,252,48,48,48,
/* 10023 */ 48,48,48,240,240,48,48,48,
/* 10024 */ 32,112,32,32,32,32,32,32,
/* 10025 */ 48,48,48,60,60,48,48,48,
/* 10026 */ 0,16,24,252,24,16,0,0,
/* 10027 */ 0,32,96,252,96,32,0,0,
/* 10028 */ 0,0,0,0,0,0,0,0,
/* 10029 */ 0,0,0,0,0,0,0,0,
/* 10030 */ 0,0,0,0,0,0,0,0,
/* 10031 */ 0,0,0,0,0,0,0,0,
/* 10032 */ 0,0,0,0,0,0,0,0,
/* 10033 */ 48,120,120,48,0,48,0,0,
/* 10034 */ 216,216,80,0,0,0,0,0,
/* 10035 */ 72,72,252,72,72,252,72,72,
/* 10036 */ 32,120,160,120,36,248,32,0,
/* 10037 */ 0,200,208,32,88,152,0,0,
/* 10038 */ 48,72,72,80,96,144,120,0,
/* 10039 */ 48,48,64,0,0,0,0,0,
/* 10040 */ 16,32,32,32,32,32,16,0,
/* 10041 */ 32,16,16,16,16,16,32,0,
/* 10042 */ 32,168,112,248,112,168,32,0,
/* 10043 */ 0,32,32,248,32,32,0,0,
/* 10044 */ 0,0,0,0,0,48,48,64,
/* 10045 0,0,0,252,0,0,0,0, */
/* 10045 */ 0,0,0,112,0,0,0,0,
/* 10046 */ 0,0,0,0,0,48,48,0,
/* 10047 */ 4,8,16,32,64,128,0,0,
/* 10048 */ 112,152,168,168,168,200,112,0,
/* 10049 */ 32,96,32,32,32,32,248,0,
/* 10050 32,80,16,32,64,128,248,0, */
/* 10050 */ 112,136,8,16,96,128,248,0,
/* 10051 */ 112,136,8,112,8,136,112,0,
/* 10052 */ 48,80,144,248,16,16,16,0,
/* 10053 */ 248,128,128,240,8,136,112,0,
/* 10054 */ 56,64,128,240,136,136,112,0,
/* 10055 */ 248,8,16,32,32,32,32,0,
/* 10056 */ 112,136,136,112,136,136,112,0,
/* 10057 */ 112,136,136,120,8,136,112,0,
/* 10058 */ 0,48,48,0,48,48,0,0,
/* 10059 */ 0,48,48,0,48,48,96,0,
/* 10060 */ 16,32,64,128,64,32,16,0,
/* 10061 */ 0,0,252,0,252,0,0,0,
/* 10062 */ 64,32,16,8,16,32,64,0,
/* 10063 */ 112,136,8,48,32,0,32,0,
/* 10064 */ 112,136,184,176,128,128,112,0,
/* 10065 */ 32,80,136,248,136,136,136,0,
/* 10066 */ 240,72,72,112,72,72,240,0,
/* 10067 */ 112,136,128,128,128,136,112,0,
/* 10068 */ 240,72,72,72,72,72,240,0,
/* 10069 */ 248,136,128,224,128,136,248,0,
/* 10070 */ 248,136,128,240,128,128,128,0,
/* 10071 */ 112,136,128,184,136,136,112,0,
/* 10072 */ 136,136,136,248,136,136,136,0,
/* 10073 */ 248,32,32,32,32,32,248,0,
/* 10074 */ 28,8,8,8,8,136,112,0,
/* 10075 */ 136,144,160,192,160,144,136,0,
/* 10076 */ 128,128,128,128,128,136,248,0,
/* 10077 */ 136,216,168,136,136,136,136,0,
/* 10078 */ 136,200,168,168,168,152,136,0,
/* 10079 */ 112,136,136,136,136,136,112,0,
/* 10080 */ 240,136,136,240,128,128,128,0,
/* 10081 */ 112,136,136,136,168,152,120,4,
/* 10082 */ 240,136,136,240,160,144,136,0,
/* 10083 */ 112,136,64,32,16,136,112,0,
/* 10084 */ 248,32,32,32,32,32,112-64-16,0,
/* 10085 */ 136,136,136,136,136,136,112,0,
/* 10086 */ 136,136,136,80,80,80,32,0,
/* 10087 */ 136,136,136,168,168,168,80,0,
/* 10088 */ 136,136,80,32,80,136,136,0,
/* 10089 */ 136,136,80,32,32,32,32,0,
/* 10090 */ 248,136,16,32,64,136,248,0,
/* 10091 */ 120,64,64,64,64,64,120,0,
/* 10092 */ 0,128,64,32,16,8,0,0,
/* 10093 */ 120,8,8,8,8,8,120,0,
/* 10094 */ 32,80,136,0,0,0,0,0,
/* 10095 */ 0,0,0,0,0,0,252,0,
/* 10096 */ 96,96,16,0,0,0,0,0,
/* 10097 */ 0,0,240,8,120,136,112,0,
/* 10098 */ 128,128,128,240,136,136,240,0,
/* 10099 */ 0,0,0,112,128,128,112,0,
/* 10100 */ 8,8,8,120,136,136,120,0,

View File

@@ -1,621 +0,0 @@
name 'N8VEM'
title 'N8VEM RomWBW 2.0 HBIOS Calls From PL/I-80'
;***********************************************************
;* *
;* N8VEM 2.0 HBIOS calls from pl/i *
;* *
;***********************************************************
public getcfg ;copy syscfg to high memory location
;; public memptr ;return pointer to base of free mem
;; public memsiz ;return size of memory in bytes
;; public memwds ;return size of memory in words
;; public dfcb0 ;return address of default fcb 0
;; public dfcb1 ;return address of default fcb 1
;; public dbuff ;return address of default buffer
;; public reboot ;system reboot (#0)
;; public rdcon ;read console character (#1)
;; public wrcon ;write console character(#2)
;; public rdrdr ;read reader character (#3)
;; public wrpun ;write punch character (#4)
;; public wrlst ;write list character (#5)
;; public coninp ;direct console input (#6a)
;; public conout ;direct console output (#6b)
;; public rdstat ;read console status (#6c)
;; public getio ;get io byte (#8)
;; public setio ;set i/o byte (#9)
;; public wrstr ;write string (#10)
;; public rdbuf ;read console buffer (#10)
;; public break ;get console status (#11)
;; public vers ;get version number (#12)
;; public reset ;reset disk system (#13)
;; public select ;select disk (#14)
;; public open ;open file (#15)
;; public close ;close file (#16)
;; public sear ;search for file (#17)
;; public searn ;search for next (#18)
;; public delete ;delete file (#19)
;; public rdseq ;read file sequential mode (#20)
;; public wrseq ;write file sequential mode (#21)
;; public make ;create file (#22)
;; public rename ;rename file (#23)
;; public logvec ;return login vector (#24)
;; public curdsk ;return current disk number (#25)
;; public setdma ;set DMA address (#26)
;; public allvec ;return address of alloc vector (#27)
;; public wpdisk ;write protect disk (#28)
;; public rovec ;return read/only vector (#29)
;; public filatt ;set file attributes (#30)
;; public getdpb ;get base of disk parm block (#31)
;; public getusr ;get user code (#32a)
;; public setusr ;set user code (#32b)
;; public rdran ;read random (#33)
;; public wrran ;write random (#34)
;; public filsiz ;random file size (#35)
;; public setrec ;set random record pos (#36)
;; public resdrv ;reset drive (#37)
;; public wrranz ;write random, zero fill (#40)
;;;
;;;
;; extrn ?begin ;beginning of free list
;; extrn ?boot ;system reboot entry point
;; extrn ?bdos ;bdos entry point
;; extrn ?dfcb0 ;default fcb 0
;; extrn ?dfcb1 ;default fcb 1
;; extrn ?dbuff ;default buffer
;;;
;;;***********************************************************
;;;* *
;;;* equates for interface to cp/m bdos *
;;;* *
;;;***********************************************************
;;cr equ 0dh ;carriage return
;;lf equ 0ah ;line feed
;;eof equ 1ah ;end of file
;;;
;;readc equ 1 ;read character from console
;;writc equ 2 ;write console character
;;rdrf equ 3 ;reader input
;;punf equ 4 ;punch output
;;listf equ 5 ;list output function
;;diof equ 6 ;direct i/o, version 2.0
;;getiof equ 7 ;get i/o byte
;;setiof equ 8 ;set i/o byte
;;printf equ 9 ;print string function
;;rdconf equ 10 ;read console buffer
;;statf equ 11 ;return console status
;;versf equ 12 ;get version number
;;resetf equ 13 ;system reset
;;seldf equ 14 ;select disk function
;;openf equ 15 ;open file function
;;closef equ 16 ;close file
;;serchf equ 17 ;search for file
;;serchn equ 18 ;search next
;;deletf equ 19 ;delete file
;;readf equ 20 ;read next record
;;writf equ 21 ;write next record
;;makef equ 22 ;make file
;;renamf equ 23 ;rename file
;;loginf equ 24 ;get login vector
;;cdiskf equ 25 ;get current disk number
;;setdmf equ 26 ;set dma function
;;getalf equ 27 ;get allocation base
;;wrprof equ 28 ;write protect disk
;;getrof equ 29 ;get r/o vector
;;setatf equ 30 ;set file attributes
;;getdpf equ 31 ;get disk parameter block
;;userf equ 32 ;set/get user code
;;rdranf equ 33 ;read random
;;wrranf equ 34 ;write random
;;filszf equ 35 ;compute file size
;;setrcf equ 36 ;set random record position
;;rsdrvf equ 37 ;reset drive function
;;wrrnzf equ 40 ;write random zero fill
; utility functions
;***********************************************************
;* *
;* general purpose routines used upon entry *
;* *
;***********************************************************
; DE -> destination for syscfg
getcfg:
mov e,m
inx h
mov d,m
mvi b,0f0h ; GETSYSCFG
db 0cfh ; rst 08
ret
;;getp1: ;get single byte parameter to register e
;; mov e,m ;low (addr)
;; inx h
;; mov d,m ;high(addr)
;; xchg ;hl = .char
;; mov e,m ;to register e
;; ret
;;;
;;getp2: ;get single word value to DE
;;getp2i: ;(equivalent to getp2)
;; call getp1
;; inx h
;; mov d,m ;get high byte as well
;; ret
;;;
;;getver: ;get cp/m or mp/m version number
;; push h ;save possible data adr
;; mvi c,versf
;; call ?bdos
;; pop h ;recall data addr
;; ret
;;;
;;chkv20: ;check for version 2.0 or greater
;; call getver
;; cpi 20
;; rnc ;return if > 2.0
;;; error message and stop
;; jmp vererr ;version error
;;;
;;chkv22: ;check for version 2.2 or greater
;; call getver
;; cpi 22h
;; rnc ;return if >= 2.2
;;vererr:
;; ;version error, report and terminate
;; lxi d,vermsg
;; mvi c,printf
;; call ?bdos ;write message
;; jmp ?boot ;and reboot
;;vermsg: db cr,lf,'Later CP/M or MP/M Version Required$'
;;;
;;;***********************************************************
;;;* *
;;;***********************************************************
;;memptr: ;return pointer to base of free storage
;; lhld ?begin
;; ret
;;;
;;;***********************************************************
;;;* *
;;;***********************************************************
;;memsiz: ;return size of free memory in bytes
;; lhld ?bdos+1 ;base of bdos
;; xchg ;de = .bdos
;; lhld ?begin ;beginning of free storage
;; mov a,e ;low(.bdos)
;; sub l ;-low(begin)
;; mov l,a ;back to l
;; mov a,d ;high(.bdos)
;; sbb h
;; mov h,a ;hl = mem size remaining
;; ret
;;;
;;;***********************************************************
;;;* *
;;;***********************************************************
;;memwds: ;return size of free memory in words
;; call memsiz ;hl = size in bytes
;; mov a,h ;high(size)
;; ora a ;cy = 0
;; rar ;cy = ls bit
;; mov h,a ;back to h
;; mov a,l ;low(size)
;; rar ;include ls bit
;; mov l,a ;back to l
;; ret ;with wds in hl
;;;
;;;***********************************************************
;;;* *
;;;***********************************************************
;;dfcb0: ;return address of default fcb 0
;; lxi h,?dfcb0
;; ret
;;;
;;;***********************************************************
;;;* *
;;;***********************************************************
;;dfcb1: ;return address of default fcb 1
;; lxi h,?dfcb1
;; ret
;;;
;;;***********************************************************
;;;* *
;;;***********************************************************
;;dbuff: ;return address of default buffer
;; lxi h,?dbuff
;; ret
;;;
;;;***********************************************************
;;;* *
;;;***********************************************************
;;reboot: ;system reboot (#0)
;; jmp ?boot
;;;
;;;***********************************************************
;;;* *
;;;***********************************************************
;;rdcon: ;read console character (#1)
;; ;return character value to stack
;; mvi c,readc
;; jmp chrin ;common code to read char
;;;
;;;***********************************************************
;;;* *
;;;***********************************************************
;;wrcon: ;write console character(#2)
;; ;1->char(1)
;; mvi c,writc ;console write function
;; jmp chrout ;to write the character
;;;
;;;***********************************************************
;;;* *
;;;***********************************************************
;;rdrdr: ;read reader character (#3)
;; mvi c,rdrf ;reader function
;;chrin:
;; ;common code for character input
;; call ?bdos ;value returned to A
;; pop h ;return address
;; push psw ;character to stack
;; inx sp ;delete flags
;; mvi a,1 ;character length is 1
;; pchl ;back to calling routine
;;;
;;;***********************************************************
;;;* *
;;;***********************************************************
;;wrpun: ;write punch character (#4)
;; ;1->char(1)
;; mvi c,punf ;punch output function
;; jmp chrout ;common code to write chr
;;;
;;;***********************************************************
;;;* *
;;;***********************************************************
;;wrlst: ;write list character (#5)
;; ;1->char(1)
;; mvi c,listf ;list output function
;;chrout:
;; ;common code to write character
;; ;1-> character to write
;; call getp1 ;output char to register e
;; jmp ?bdos ;to write and return
;;;
;;;***********************************************************
;;;* *
;;;***********************************************************
;;coninp: ;perform console input, char returned in stack
;; lxi h,chrstr ;return address
;; push h ;to stack for return
;; lhld ?boot+1 ;base of bios jmp vector
;; lxi d,2*3 ;offset to jmp conin
;; dad d
;; pchl ;return to chrstr
;;;
;;chrstr: ;create character string, length 1
;; pop h ;recall return address
;; push psw ;save character
;; inx sp ;delete psw
;; pchl ;return to caller
;;;
;;;***********************************************************
;;;* *
;;;***********************************************************
;;conout: ;direct console output
;; ;1->char(1)
;; call getp1 ;get parameter
;; mov c,e ;character to c
;; lhld ?boot+1 ;base of bios jmp
;; lxi d,3*3 ;console output offset
;; dad d ;hl = .jmp conout
;; pchl ;return through handler
;;;
;;;***********************************************************
;;;* *
;;;***********************************************************
;;rdstat: ;direct console status read
;; lxi h,rdsret ;read status return
;; push h ;return to rdsret
;; lhld ?boot+1 ;base of jmp vector
;; lxi d,1*3 ;offset to .jmp const
;; dad d ;hl = .jmp const
;; pchl
;;;
;;;***********************************************************
;;;* *
;;;***********************************************************
;;getio: ;get io byte (#8)
;; mvi c,getiof
;; jmp ?bdos ;value returned to A
;;;
;;;***********************************************************
;;;* *
;;;***********************************************************
;;setio: ;set i/o byte (#9)
;; ;1->i/o byte
;; call getp1 ;new i/o byte to E
;; mvi c,setiof
;; jmp ?bdos ;return through bdos
;;;
;;;***********************************************************
;;;* *
;;;***********************************************************
;;wrstr: ;write string (#10)
;; ;1->addr(string)
;; call getp2 ;get parameter value to DE
;; mvi c,printf ;print string function
;; jmp ?bdos ;return through bdos
;;;
;;;***********************************************************
;;;* *
;;;***********************************************************
;;rdbuf: ;read console buffer (#10)
;; ;1->addr(buff)
;; call getp2i ;DE = .buff
;; mvi c,rdconf ;read console function
;; jmp ?bdos ;return through bdos
;;;
;;;***********************************************************
;;;* *
;;;***********************************************************
;;break: ;get console status (#11)
;; mvi c,statf
;; call ?bdos ;return through bdos
;;;
;;rdsret: ;return clean true value
;; ora a ;zero?
;; rz ;return if so
;; mvi a,0ffh ;clean true value
;; ret
;;;
;;;***********************************************************
;;;* *
;;;***********************************************************
;;vers: ;get version number (#12)
;; mvi c,versf
;; jmp ?bdos ;return through bdos
;;;
;;;***********************************************************
;;;* *
;;;***********************************************************
;;reset: ;reset disk system (#13)
;; mvi c,resetf
;; jmp ?bdos
;;;
;;;***********************************************************
;;;* *
;;;***********************************************************
;;select: ;select disk (#14)
;; ;1->fixed(7) drive number
;; call getp1 ;disk number to E
;; mvi c,seldf
;; jmp ?bdos ;return through bdos
;;;***********************************************************
;;;* *
;;;***********************************************************
;;open: ;open file (#15)
;; ;1-> addr(fcb)
;; call getp2i ;fcb address to de
;; mvi c,openf
;; jmp ?bdos ;return through bdos
;;;
;;;***********************************************************
;;;* *
;;;***********************************************************
;;close: ;close file (#16)
;; ;1-> addr(fcb)
;; call getp2i ;.fcb to DE
;; mvi c,closef
;; jmp ?bdos ;return through bdos
;;;
;;;***********************************************************
;;;* *
;;;***********************************************************
;;sear: ;search for file (#17)
;; ;1-> addr(fcb)
;; call getp2i ;.fcb to DE
;; mvi c,serchf
;; jmp ?bdos
;;;
;;;***********************************************************
;;;* *
;;;***********************************************************
;;searn: ;search for next (#18)
;; mvi c,serchn ;search next function
;; jmp ?bdos ;return through bdos
;;;
;;;***********************************************************
;;;* *
;;;***********************************************************
;;delete: ;delete file (#19)
;; ;1-> addr(fcb)
;; call getp2i ;.fcb to DE
;; mvi c,deletf
;; jmp ?bdos ;return through bdos
;;;
;;;***********************************************************
;;;* *
;;;***********************************************************
;;rdseq: ;read file sequential mode (#20)
;; ;1-> addr(fcb)
;; call getp2i ;.fcb to DE
;; mvi c,readf
;; jmp ?bdos ;return through bdos
;;;
;;;***********************************************************
;;;* *
;;;***********************************************************
;;wrseq: ;write file sequential mode (#21)
;; ;1-> addr(fcb)
;; call getp2i ;.fcb to DE
;; mvi c,writf
;; jmp ?bdos ;return through bdos
;;;
;;;***********************************************************
;;;* *
;;;***********************************************************
;;make: ;create file (#22)
;; ;1-> addr(fcb)
;; call getp2i ;.fcb to DE
;; mvi c,makef
;; jmp ?bdos ;return through bdos
;;;
;;;***********************************************************
;;;* *
;;;***********************************************************
;;rename: ;rename file (#23)
;; ;1-> addr(fcb)
;; call getp2i ;.fcb to DE
;; mvi c,renamf
;; jmp ?bdos ;return through bdos
;;;
;;;***********************************************************
;;;* *
;;;***********************************************************
;;logvec: ;return login vector (#24)
;; mvi c,loginf
;; jmp ?bdos ;return through BDOS
;;;
;;;***********************************************************
;;;* *
;;;***********************************************************
;;curdsk: ;return current disk number (#25)
;; mvi c,cdiskf
;; jmp ?bdos ;return value in A
;;;
;;;***********************************************************
;;;* *
;;;***********************************************************
;;setdma: ;set DMA address (#26)
;; ;1-> pointer (dma address)
;; call getp2 ;dma address to DE
;; mvi c,setdmf
;; jmp ?bdos ;return through bdos
;;;
;;;***********************************************************
;;;* *
;;;***********************************************************
;;allvec: ;return address of allocation vector (#27)
;; mvi c,getalf
;; jmp ?bdos ;return through bdos
;;;
;;;***********************************************************
;;;* *
;;;***********************************************************
;;wpdisk: ;write protect disk (#28)
;; call chkv20 ;must be 2.0 or greater
;; mvi c,wrprof
;; jmp ?bdos
;;;
;;;***********************************************************
;;;* *
;;;***********************************************************
;;rovec: ;return read/only vector (#29)
;; call chkv20 ;must be 2.0 or greater
;; mvi c,getrof
;; jmp ?bdos ;value returned in HL
;;;
;;;***********************************************************
;;;* *
;;;***********************************************************
;;filatt: ;set file attributes (#30)
;; ;1-> addr(fcb)
;; call chkv20 ;must be 2.0 or greater
;; call getp2i ;.fcb to DE
;; mvi c,setatf
;; jmp ?bdos
;;;
;;;***********************************************************
;;;* *
;;;***********************************************************
;;getdpb: ;get base of current disk parm block (#31)
;; call chkv20 ;check for 2.0 or greater
;; mvi c,getdpf
;; jmp ?bdos ;addr returned in HL
;;;
;;;***********************************************************
;;;* *
;;;***********************************************************
;;getusr: ;get user code to register A
;; call chkv20 ;check for 2.0 or greater
;; mvi e,0ffh ;to get user code
;; mvi c,userf
;; jmp ?bdos
;;;
;;;***********************************************************
;;;* *
;;;***********************************************************
;;setusr: ;set user code
;; call chkv20 ;check for 2.0 or greater
;; call getp1 ;code to E
;; mvi c,userf
;; jmp ?bdos
;;;
;;;***********************************************************
;;;* *
;;;***********************************************************
;;rdran: ;read random (#33)
;; ;1-> addr(fcb)
;; call chkv20 ;check for 2.0 or greater
;; call getp2i ;.fcb to DE
;; mvi c,rdranf
;; jmp ?bdos ;return through bdos
;;;
;;;***********************************************************
;;;* *
;;;***********************************************************
;;wrran: ;write random (#34)
;; ;1-> addr(fcb)
;; call chkv20 ;check for 2.0 or greater
;; call getp2i ;.fcb to DE
;; mvi c,wrranf
;; jmp ?bdos ;return through bdos
;;;
;;;***********************************************************
;;;* *
;;;***********************************************************
;;filsiz: ;compute file size (#35)
;; call chkv20 ;must be 2.0 or greater
;; call getp2 ;.fcb to DE
;; mvi c,filszf
;; jmp ?bdos ;return through bdos
;;;
;;;***********************************************************
;;;* *
;;;***********************************************************
;;setrec: ;set random record position (#36)
;; call chkv20 ;must be 2.0 or greater
;; call getp2 ;.fcb to DE
;; mvi c,setrcf
;; jmp ?bdos ;return through bdos
;;;
;;;***********************************************************
;;;* *
;;;***********************************************************
;;resdrv: ;reset drive function (#37)
;; ;1->drive vector - bit(16)
;; call chkv22 ;must be 2.2 or greater
;; call getp2 ;drive reset vector to DE
;; mvi c,rsdrvf
;; jmp ?bdos ;return through bdos
;;;
;;;***********************************************************
;;;* *
;;;***********************************************************
;;wrranz: ;write random, zero fill function
;; ;1-> addr(fcb)
;; call chkv22 ;must be 2.2 or greater
;; call getp2i ;.fcb to DE
;; mvi c,wrrnzf
;; jmp ?bdos
;;;
;;;***********************************************************
;;;* *
;;;***********************************************************
end


File diff suppressed because it is too large Load Diff

View File

@@ -1,81 +0,0 @@
/* n8video.c 9/11/2012 dwg - derived from Wayne's TESTV5.BAS */
/* Simple VIDEO test for N8; I/O Base assumed as 128 */
#include "stdio.h"
#include "applvers.h"
#include "n8chars.h"
#include "tms9918.h"
char szTemp[128];
char linenum;
char counter;
char outer;
char inner;
char limit;
int index;
int main(argc,argv)
int argc;
char *argv[];
{
int i;
char szTemp[64];
unsigned char chardex;
unsigned char * p;
FILE * fd;
vdp_clr16k();
vdp_setregs();
vdp_modes();
vdp_pnt();
vdp_pgt();
vdp_colors();
vdp_load_set450();
if(outer == 3) style = TRIPLE;
vdp_main_frame("N8VIDTST(dwg)");
chardex = 0;
for(outer=0;outer<4;outer++) {
linenum = 4;
for(inner=0;inner<6;inner++) {
if(inner < 5) limit=11;
else limit=9;
for(i=0;i<limit;i++) {
sprintf(szTemp,"%c",chardex);
vdp_display(linenum,2+(i*3),szTemp);
sprintf(szTemp,"%02x",chardex++);
vdp_display(linenum+1,2+(i*3),szTemp);
}
linenum += 3;
if(inner==5) {
sprintf(szTemp,"Pg %d/4",outer+1);
vdp_display(20,29,szTemp);
}
}
if(outer < 3) {
vdp_display(22,2," Press any key to continue");
gets(szTemp);
}
}
vdp_display(22,1,"Execution complete,returned to CP/M");
if(argc == 2) {
sprintf(szTemp,"%c",atoi(argv[1]));
vdp_display(1,WIDTH-2,szTemp);
}
p = charset;
fd = fopen("n8chars.inc","w");
fprintf(fd,"; n8chars.inc - automatically generated by n8vidtst\n");
for(index=0;index<256;index++) {
fprintf(fd,"\t.DB\t");
fprintf(fd,"%03xh,%03xh,%03xh,%03xh,%03xh,%03xh,%03xh,%03xh\t; 0x%02x(%d)\n",
*p++,*p++,*p++,*p++,*p++,*p++,*p++,*p++,index,index);
}
fprintf(fd,"; eof - n8chars.inc\n");
fclose(fd);
}


View File

@@ -1,595 +0,0 @@
extrn .begin,.chl,.swt
extrn csave,cret,.move
global style_,1
global vdp_rege_,960
global szTemp_,128
global linenum_,1
global counter_,1
global outer_,1
global inner_,1
global limit_,1
global index_,2
PUBLIC main_
main_: lxi d,.2
call csave
LDA outer_
MOV L,A
MVI H,0
LXI D,3
CALL .eq
JZ .3
LXI H,0
MOV A,L
STA style_
.3:
LXI H,.1+0
PUSH H
CALL vdp_main_
POP D
LXI H,0
XCHG
LXI H,-63-.2
DAD SP
MOV M,E
LXI H,0
MOV A,L
STA outer_
JMP .5
.4:
LDA outer_
MOV L,A
INX H
MOV A,L
STA outer_
.5:
LDA outer_
MOV L,A
MVI H,0
LXI D,4
XCHG
CALL .lt
JZ .6
LXI H,4
MOV A,L
STA linenum_
LXI H,0
MOV A,L
STA inner_
JMP .8
.7:
LDA inner_
MOV L,A
INX H
MOV A,L
STA inner_
.8:
LDA inner_
MOV L,A
MVI H,0
LXI D,6
XCHG
CALL .lt
JZ .9
LDA inner_
MOV L,A
MVI H,0
LXI D,5
XCHG
CALL .lt
JZ .10
LXI H,11
MOV A,L
STA limit_
JMP .11
.10:
LXI H,9
MOV A,L
STA limit_
.11:
LXI H,0
XCHG
LXI H,2-.2
DAD SP
MOV M,E
INX H
MOV M,D
JMP .13
.12:
LXI H,2-.2
DAD SP
PUSH H
MOV A,M
INX H
MOV H,M
MOV L,A
INX H
XCHG
POP H
MOV M,E
INX H
MOV M,D
.13:
LDA limit_
MOV L,A
MVI H,0
PUSH H
LXI H,4-.2
DAD SP
MOV E,M
INX H
MOV D,M
POP H
CALL .lt
JZ .14
LXI H,-63-.2
DAD SP
MOV E,M
MVI D,0
PUSH D
LXI H,.1+14
PUSH H
LXI H,-58-.2
DAD SP
PUSH H
CALL sprintf_
POP D
POP D
POP D
LXI H,-62-.2
DAD SP
PUSH H
LXI H,4-.2
DAD SP
MOV E,M
INX H
MOV D,M
LXI H,3
CALL .ml
INX H
INX H
PUSH H
LDA linenum_
MOV L,A
MVI H,0
PUSH H
CALL vdp_disp_
POP D
POP D
POP D
LXI H,-63-.2
DAD SP
PUSH H
MOV L,M
INX H
XCHG
POP H
MOV M,E
XCHG
DCX H
MVI H,0
PUSH H
LXI H,.1+17
PUSH H
LXI H,-58-.2
DAD SP
PUSH H
CALL sprintf_
POP D
POP D
POP D
LXI H,-62-.2
DAD SP
PUSH H
LXI H,4-.2
DAD SP
MOV E,M
INX H
MOV D,M
LXI H,3
CALL .ml
INX H
INX H
PUSH H
LDA linenum_
MOV L,A
MVI H,0
INX H
PUSH H
CALL vdp_disp_
POP D
POP D
POP D
JMP .12
.14:
LXI H,3
XCHG
LDA linenum_
MOV L,A
mvi h,0
DAD D
MOV A,L
STA linenum_
LDA inner_
MOV L,A
MVI H,0
LXI D,5
CALL .eq
JZ .15
LDA outer_
MOV L,A
MVI H,0
INX H
PUSH H
LXI H,.1+22
PUSH H
LXI H,-58-.2
DAD SP
PUSH H
CALL sprintf_
POP D
POP D
POP D
LXI H,-62-.2
DAD SP
PUSH H
LXI H,29
PUSH H
LXI H,20
PUSH H
CALL vdp_disp_
POP D
POP D
POP D
.15:
JMP .7
.9:
LDA outer_
MOV L,A
MVI H,0
LXI D,3
XCHG
CALL .lt
JZ .16
LXI H,.1+30
PUSH H
LXI H,2
PUSH H
LXI H,22
PUSH H
CALL vdp_disp_
POP D
POP D
POP D
LXI H,-62-.2
DAD SP
PUSH H
CALL gets_
POP D
.16:
JMP .4
.6:
LXI H,.1+57
PUSH H
LXI H,1
PUSH H
LXI H,22
PUSH H
CALL vdp_disp_
POP D
POP D
POP D
LXI H,8-.2
DAD SP
MOV E,M
INX H
MOV D,M
LXI H,2
CALL .eq
JZ .17
LXI H,10-.2
DAD SP
MOV E,M
INX H
MOV D,M
XCHG
INX H
INX H
MOV E,M
INX H
MOV D,M
PUSH D
CALL atoi_
POP D
PUSH H
LXI H,.1+93
PUSH H
LXI H,-58-.2
DAD SP
PUSH H
CALL sprintf_
POP D
POP D
POP D
LXI H,-62-.2
DAD SP
PUSH H
LXI H,35
PUSH H
LXI H,1
PUSH H
CALL vdp_disp_
POP D
POP D
POP D
.17:
LXI H,charset_
XCHG
LXI H,-65-.2
DAD SP
MOV M,E
INX H
MOV M,D
LXI H,.1+108
PUSH H
LXI H,.1+96
PUSH H
CALL fopen_
POP D
POP D
XCHG
LXI H,-67-.2
DAD SP
MOV M,E
INX H
MOV M,D
LXI H,.1+110
PUSH H
LXI H,-65-.2
DAD SP
MOV E,M
INX H
MOV D,M
PUSH D
CALL fprintf_
POP D
POP D
LXI H,0
SHLD index_
JMP .19
.18:
LHLD index_
INX H
SHLD index_
.19:
LHLD index_
LXI D,256
XCHG
CALL .lt
JZ .20
LXI H,.1+163
PUSH H
LXI H,-65-.2
DAD SP
MOV E,M
INX H
MOV D,M
PUSH D
CALL fprintf_
POP D
POP D
LHLD index_
PUSH H
LHLD index_
PUSH H
LXI H,-61-.2
DAD SP
PUSH H
MOV A,M
INX H
MOV H,M
MOV L,A
INX H
XCHG
POP H
MOV M,E
INX H
MOV M,D
XCHG
DCX H
MOV E,M
MVI D,0
PUSH D
LXI H,-59-.2
DAD SP
PUSH H
MOV A,M
INX H
MOV H,M
MOV L,A
INX H
XCHG
POP H
MOV M,E
INX H
MOV M,D
XCHG
DCX H
MOV E,M
MVI D,0
PUSH D
LXI H,-57-.2
DAD SP
PUSH H
MOV A,M
INX H
MOV H,M
MOV L,A
INX H
XCHG
POP H
MOV M,E
INX H
MOV M,D
XCHG
DCX H
MOV E,M
MVI D,0
PUSH D
LXI H,-55-.2
DAD SP
PUSH H
MOV A,M
INX H
MOV H,M
MOV L,A
INX H
XCHG
POP H
MOV M,E
INX H
MOV M,D
XCHG
DCX H
MOV E,M
MVI D,0
PUSH D
LXI H,-53-.2
DAD SP
PUSH H
MOV A,M
INX H
MOV H,M
MOV L,A
INX H
XCHG
POP H
MOV M,E
INX H
MOV M,D
XCHG
DCX H
MOV E,M
MVI D,0
PUSH D
LXI H,-51-.2
DAD SP
PUSH H
MOV A,M
INX H
MOV H,M
MOV L,A
INX H
XCHG
POP H
MOV M,E
INX H
MOV M,D
XCHG
DCX H
MOV E,M
MVI D,0
PUSH D
LXI H,-49-.2
DAD SP
PUSH H
MOV A,M
INX H
MOV H,M
MOV L,A
INX H
XCHG
POP H
MOV M,E
INX H
MOV M,D
XCHG
DCX H
MOV E,M
MVI D,0
PUSH D
LXI H,-47-.2
DAD SP
PUSH H
MOV A,M
INX H
MOV H,M
MOV L,A
INX H
XCHG
POP H
MOV M,E
INX H
MOV M,D
XCHG
DCX H
MOV E,M
MVI D,0
PUSH D
LXI H,.1+169
PUSH H
LXI H,-45-.2
DAD SP
MOV E,M
INX H
MOV D,M
PUSH D
CALL fprintf_
XCHG
LXI H,24
DAD SP
SPHL
JMP .18
.20:
LXI H,.1+231
PUSH H
LXI H,-65-.2
DAD SP
MOV E,M
INX H
MOV D,M
PUSH D
CALL fprintf_
POP D
POP D
LXI H,-67-.2
DAD SP
MOV E,M
INX H
MOV D,M
PUSH D
CALL fclose_
POP D
RET
.2 EQU -71
.1:
DB 78,56,86,73,68,84,83,84,40,100,119,103,41,0,37
DB 99,0,37,48,50,120,0,80,103,32,37,100,47,52,0
DB 32,80,114,101,115,115,32,97,110,121,32,107,101,121,32
DB 116,111,32,99,111,110,116,105,110,117,101,0,69,120,101
DB 99,117,116,105,111,110,32,99,111,109,112,108,101,116,101
DB 44,114,101,116,117,114,110,101,100,32,116,111,32,67,80
DB 47,77,0,37,99,0,110,56,99,104,97,114,115,46,105
DB 110,99,0,119,0,59,32,110,56,99,104,97,114,115,46
DB 105,110,99,32,45,32,97,117,116,111,109,97,116,105,99
DB 97,108,108,121,32,103,101,110,101,114,97,116,101,100,32
DB 98,121,32,110,56,118,105,100,116,115,116,10,0,9,46
DB 68,66,9,0,37,48,51,120,104,44,37,48,51,120,104
DB 44,37,48,51,120,104,44,37,48,51,120,104,44,37,48
DB 51,120,104,44,37,48,51,120,104,44,37,48,51,120,104
DB 44,37,48,51,120,104,9,59,32,48,120,37,48,50,120
DB 40,37,100,41,10,0,59,32,101,111,102,32,45,32,110
DB 56,99,104,97,114,115,46,105,110,99,10,0
extrn fclose_
extrn fprintf_
extrn atoi_
extrn gets_
extrn sprintf_
extrn vdp_main_
extrn vdp_disp_
extrn charset_
extrn fopen_
extrn .eq
extrn .lt
extrn .ml
END


View File

@@ -1,84 +0,0 @@
; noaccess.asm 7/19/2012 dwg - for 2.0.0.0 B22
; noaccess.asm 2/11/2012 dwg - make ident compliant
; noaccess.asm 2/11/2012 dwg - begin 1.6 enhancements
; noaccess.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
maclib portab
maclib globals
maclib cpmbdos
maclib printers
maclib banner
maclib applvers
maclib z80
maclib memory
maclib version
maclib cpmappl
maclib banner
maclib identity
do$start
jmp around$bandata
argv dw prog,dat,prod,orig,ser,myname,0
prog db 'NOACCESS.COM$'
date
serial
product
originator
oriname
uuid db '260115A3-3463-48DE-B807-7D5F8FEE177B$'
around$bandata:
sbanner argv
lda 80h
cpi 0
jnz no$usage
printf 'usage - noaccess <filename>'
jmp do$exit
no$usage:
memcpy work$fcb,PRIFCB,32
printf 'Checking: '
memcpy PRIFCB,work$fcb,16
mvi a,'$'
sta PRIFCB+9
print PRIFCB+1
conout '.'
memcpy PRIFCB,work$fcb,16
mvi a,'$'
sta PRIFCB+12
print PRIFCB+9
print crlf
memcpy PRIFCB,work$fcb,32
mvi c,FOPEN
lxi d,PRIFCB
call BDOS
cpi 255
jz done
mvi c,FDELETE
lxi d,del$fcb
call BDOS
printf 'Submit file terminating due to presence of file$'
jmp do$exit
done:
printf 'File found, Submit is terminating'
do$exit:
do$end
crlf db CR,LF,'$'
newfcb del$fcb,1,'$$$ SUB'
work$fcb ds 36
end


View File

@@ -1,607 +0,0 @@
name 'DIOMOD'
title 'Direct CP/M Calls From PL/I-80'
;
;***********************************************************
;* *
;* cp/m calls from pl/i for direct i/o *
;* *
;***********************************************************
public memptr ;return pointer to base of free mem
public memsiz ;return size of memory in bytes
public memwds ;return size of memory in words
public dfcb0 ;return address of default fcb 0
public dfcb1 ;return address of default fcb 1
public dbuff ;return address of default buffer
public reboot ;system reboot (#0)
public rdcon ;read console character (#1)
public wrcon ;write console character(#2)
public rdrdr ;read reader character (#3)
public wrpun ;write punch character (#4)
public wrlst ;write list character (#5)
public coninp ;direct console input (#6a)
public conout ;direct console output (#6b)
public rdstat ;read console status (#6c)
public getio ;get io byte (#8)
public setio ;set i/o byte (#9)
public wrstr ;write string (#10)
public rdbuf ;read console buffer (#10)
public break ;get console status (#11)
public vers ;get version number (#12)
public reset ;reset disk system (#13)
public select ;select disk (#14)
public open ;open file (#15)
public close ;close file (#16)
public sear ;search for file (#17)
public searn ;search for next (#18)
public delete ;delete file (#19)
public rdseq ;read file sequential mode (#20)
public wrseq ;write file sequential mode (#21)
public make ;create file (#22)
public rename ;rename file (#23)
public logvec ;return login vector (#24)
public curdsk ;return current disk number (#25)
public setdma ;set DMA address (#26)
public allvec ;return address of alloc vector (#27)
public wpdisk ;write protect disk (#28)
public rovec ;return read/only vector (#29)
public filatt ;set file attributes (#30)
public getdpb ;get base of disk parm block (#31)
public getusr ;get user code (#32a)
public setusr ;set user code (#32b)
public rdran ;read random (#33)
public wrran ;write random (#34)
public filsiz ;random file size (#35)
public setrec ;set random record pos (#36)
public resdrv ;reset drive (#37)
public wrranz ;write random, zero fill (#40)
;
;
extrn ?begin ;beginning of free list
extrn ?boot ;system reboot entry point
extrn ?bdos ;bdos entry point
extrn ?dfcb0 ;default fcb 0
extrn ?dfcb1 ;default fcb 1
extrn ?dbuff ;default buffer
;
;***********************************************************
;* *
;* equates for interface to cp/m bdos *
;* *
;***********************************************************
cr equ 0dh ;carriage return
lf equ 0ah ;line feed
eof equ 1ah ;end of file
;
readc equ 1 ;read character from console
writc equ 2 ;write console character
rdrf equ 3 ;reader input
punf equ 4 ;punch output
listf equ 5 ;list output function
diof equ 6 ;direct i/o, version 2.0
getiof equ 7 ;get i/o byte
setiof equ 8 ;set i/o byte
printf equ 9 ;print string function
rdconf equ 10 ;read console buffer
statf equ 11 ;return console status
versf equ 12 ;get version number
resetf equ 13 ;system reset
seldf equ 14 ;select disk function
openf equ 15 ;open file function
closef equ 16 ;close file
serchf equ 17 ;search for file
serchn equ 18 ;search next
deletf equ 19 ;delete file
readf equ 20 ;read next record
writf equ 21 ;write next record
makef equ 22 ;make file
renamf equ 23 ;rename file
loginf equ 24 ;get login vector
cdiskf equ 25 ;get current disk number
setdmf equ 26 ;set dma function
getalf equ 27 ;get allocation base
wrprof equ 28 ;write protect disk
getrof equ 29 ;get r/o vector
setatf equ 30 ;set file attributes
getdpf equ 31 ;get disk parameter block
userf equ 32 ;set/get user code
rdranf equ 33 ;read random
wrranf equ 34 ;write random
filszf equ 35 ;compute file size
setrcf equ 36 ;set random record position
rsdrvf equ 37 ;reset drive function
wrrnzf equ 40 ;write random zero fill
;
; utility functions
;***********************************************************
;* *
;* general purpose routines used upon entry *
;* *
;***********************************************************
;
getp1: ;get single byte parameter to register e
mov e,m ;low (addr)
inx h
mov d,m ;high(addr)
xchg ;hl = .char
mov e,m ;to register e
ret
;
getp2: ;get single word value to DE
getp2i: ;(equivalent to getp2)
call getp1
inx h
mov d,m ;get high byte as well
ret
;
getver: ;get cp/m or mp/m version number
push h ;save possible data adr
mvi c,versf
call ?bdos
pop h ;recall data addr
ret
;
chkv20: ;check for version 2.0 or greater
call getver
cpi 20
rnc ;return if > 2.0
; error message and stop
jmp vererr ;version error
;
chkv22: ;check for version 2.2 or greater
call getver
cpi 22h
rnc ;return if >= 2.2
vererr:
;version error, report and terminate
lxi d,vermsg
mvi c,printf
call ?bdos ;write message
jmp ?boot ;and reboot
vermsg: db cr,lf,'Later CP/M or MP/M Version Required$'
;
;***********************************************************
;* *
;***********************************************************
memptr: ;return pointer to base of free storage
lhld ?begin
ret
;
;***********************************************************
;* *
;***********************************************************
memsiz: ;return size of free memory in bytes
lhld ?bdos+1 ;base of bdos
xchg ;de = .bdos
lhld ?begin ;beginning of free storage
mov a,e ;low(.bdos)
sub l ;-low(begin)
mov l,a ;back to l
mov a,d ;high(.bdos)
sbb h
mov h,a ;hl = mem size remaining
ret
;
;***********************************************************
;* *
;***********************************************************
memwds: ;return size of free memory in words
call memsiz ;hl = size in bytes
mov a,h ;high(size)
ora a ;cy = 0
rar ;cy = ls bit
mov h,a ;back to h
mov a,l ;low(size)
rar ;include ls bit
mov l,a ;back to l
ret ;with wds in hl
;
;***********************************************************
;* *
;***********************************************************
dfcb0: ;return address of default fcb 0
lxi h,?dfcb0
ret
;
;***********************************************************
;* *
;***********************************************************
dfcb1: ;return address of default fcb 1
lxi h,?dfcb1
ret
;
;***********************************************************
;* *
;***********************************************************
dbuff: ;return address of default buffer
lxi h,?dbuff
ret
;
;***********************************************************
;* *
;***********************************************************
reboot: ;system reboot (#0)
jmp ?boot
;
;***********************************************************
;* *
;***********************************************************
rdcon: ;read console character (#1)
;return character value to stack
mvi c,readc
jmp chrin ;common code to read char
;
;***********************************************************
;* *
;***********************************************************
wrcon: ;write console character(#2)
;1->char(1)
mvi c,writc ;console write function
jmp chrout ;to write the character
;
;***********************************************************
;* *
;***********************************************************
rdrdr: ;read reader character (#3)
mvi c,rdrf ;reader function
chrin:
;common code for character input
call ?bdos ;value returned to A
pop h ;return address
push psw ;character to stack
inx sp ;delete flags
mvi a,1 ;character length is 1
pchl ;back to calling routine
;
;***********************************************************
;* *
;***********************************************************
wrpun: ;write punch character (#4)
;1->char(1)
mvi c,punf ;punch output function
jmp chrout ;common code to write chr
;
;***********************************************************
;* *
;***********************************************************
wrlst: ;write list character (#5)
;1->char(1)
mvi c,listf ;list output function
chrout:
;common code to write character
;1-> character to write
call getp1 ;output char to register e
jmp ?bdos ;to write and return
;
;***********************************************************
;* *
;***********************************************************
coninp: ;perform console input, char returned in stack
lxi h,chrstr ;return address
push h ;to stack for return
lhld ?boot+1 ;base of bios jmp vector
lxi d,2*3 ;offset to jmp conin
dad d
pchl ;return to chrstr
;
chrstr: ;create character string, length 1
pop h ;recall return address
push psw ;save character
inx sp ;delete psw
pchl ;return to caller
;
;***********************************************************
;* *
;***********************************************************
conout: ;direct console output
;1->char(1)
call getp1 ;get parameter
mov c,e ;character to c
lhld ?boot+1 ;base of bios jmp
lxi d,3*3 ;console output offset
dad d ;hl = .jmp conout
pchl ;return through handler
;
;***********************************************************
;* *
;***********************************************************
rdstat: ;direct console status read
lxi h,rdsret ;read status return
push h ;return to rdsret
lhld ?boot+1 ;base of jmp vector
lxi d,1*3 ;offset to .jmp const
dad d ;hl = .jmp const
pchl
;
;***********************************************************
;* *
;***********************************************************
getio: ;get io byte (#8)
mvi c,getiof
jmp ?bdos ;value returned to A
;
;***********************************************************
;* *
;***********************************************************
setio: ;set i/o byte (#9)
;1->i/o byte
call getp1 ;new i/o byte to E
mvi c,setiof
jmp ?bdos ;return through bdos
;
;***********************************************************
;* *
;***********************************************************
wrstr: ;write string (#10)
;1->addr(string)
call getp2 ;get parameter value to DE
mvi c,printf ;print string function
jmp ?bdos ;return through bdos
;
;***********************************************************
;* *
;***********************************************************
rdbuf: ;read console buffer (#10)
;1->addr(buff)
call getp2i ;DE = .buff
mvi c,rdconf ;read console function
jmp ?bdos ;return through bdos
;
;***********************************************************
;* *
;***********************************************************
break: ;get console status (#11)
mvi c,statf
call ?bdos ;return through bdos
;
rdsret: ;return clean true value
ora a ;zero?
rz ;return if so
mvi a,0ffh ;clean true value
ret
;
;***********************************************************
;* *
;***********************************************************
vers: ;get version number (#12)
mvi c,versf
jmp ?bdos ;return through bdos
;
;***********************************************************
;* *
;***********************************************************
reset: ;reset disk system (#13)
mvi c,resetf
jmp ?bdos
;
;***********************************************************
;* *
;***********************************************************
select: ;select disk (#14)
;1->fixed(7) drive number
call getp1 ;disk number to E
mvi c,seldf
jmp ?bdos ;return through bdos
;***********************************************************
;* *
;***********************************************************
open: ;open file (#15)
;1-> addr(fcb)
call getp2i ;fcb address to de
mvi c,openf
jmp ?bdos ;return through bdos
;
;***********************************************************
;* *
;***********************************************************
close: ;close file (#16)
;1-> addr(fcb)
call getp2i ;.fcb to DE
mvi c,closef
jmp ?bdos ;return through bdos
;
;***********************************************************
;* *
;***********************************************************
sear: ;search for file (#17)
;1-> addr(fcb)
call getp2i ;.fcb to DE
mvi c,serchf
jmp ?bdos
;
;***********************************************************
;* *
;***********************************************************
searn: ;search for next (#18)
mvi c,serchn ;search next function
jmp ?bdos ;return through bdos
;
;***********************************************************
;* *
;***********************************************************
delete: ;delete file (#19)
;1-> addr(fcb)
call getp2i ;.fcb to DE
mvi c,deletf
jmp ?bdos ;return through bdos
;
;***********************************************************
;* *
;***********************************************************
rdseq: ;read file sequential mode (#20)
;1-> addr(fcb)
call getp2i ;.fcb to DE
mvi c,readf
jmp ?bdos ;return through bdos
;
;***********************************************************
;* *
;***********************************************************
wrseq: ;write file sequential mode (#21)
;1-> addr(fcb)
call getp2i ;.fcb to DE
mvi c,writf
jmp ?bdos ;return through bdos
;
;***********************************************************
;* *
;***********************************************************
make: ;create file (#22)
;1-> addr(fcb)
call getp2i ;.fcb to DE
mvi c,makef
jmp ?bdos ;return through bdos
;
;***********************************************************
;* *
;***********************************************************
rename: ;rename file (#23)
;1-> addr(fcb)
call getp2i ;.fcb to DE
mvi c,renamf
jmp ?bdos ;return through bdos
;
;***********************************************************
;* *
;***********************************************************
logvec: ;return login vector (#24)
mvi c,loginf
jmp ?bdos ;return through BDOS
;
;***********************************************************
;* *
;***********************************************************
curdsk: ;return current disk number (#25)
mvi c,cdiskf
jmp ?bdos ;return value in A
;
;***********************************************************
;* *
;***********************************************************
setdma: ;set DMA address (#26)
;1-> pointer (dma address)
call getp2 ;dma address to DE
mvi c,setdmf
jmp ?bdos ;return through bdos
;
;***********************************************************
;* *
;***********************************************************
allvec: ;return address of allocation vector (#27)
mvi c,getalf
jmp ?bdos ;return through bdos
;
;***********************************************************
;* *
;***********************************************************
wpdisk: ;write protect disk (#28)
call chkv20 ;must be 2.0 or greater
mvi c,wrprof
jmp ?bdos
;
;***********************************************************
;* *
;***********************************************************
rovec: ;return read/only vector (#29)
call chkv20 ;must be 2.0 or greater
mvi c,getrof
jmp ?bdos ;value returned in HL
;
;***********************************************************
;* *
;***********************************************************
filatt: ;set file attributes (#30)
;1-> addr(fcb)
call chkv20 ;must be 2.0 or greater
call getp2i ;.fcb to DE
mvi c,setatf
jmp ?bdos
;
;***********************************************************
;* *
;***********************************************************
getdpb: ;get base of current disk parm block (#31)
call chkv20 ;check for 2.0 or greater
mvi c,getdpf
jmp ?bdos ;addr returned in HL
;
;***********************************************************
;* *
;***********************************************************
getusr: ;get user code to register A
call chkv20 ;check for 2.0 or greater
mvi e,0ffh ;to get user code
mvi c,userf
jmp ?bdos
;
;***********************************************************
;* *
;***********************************************************
setusr: ;set user code
call chkv20 ;check for 2.0 or greater
call getp1 ;code to E
mvi c,userf
jmp ?bdos
;
;***********************************************************
;* *
;***********************************************************
rdran: ;read random (#33)
;1-> addr(fcb)
call chkv20 ;check for 2.0 or greater
call getp2i ;.fcb to DE
mvi c,rdranf
jmp ?bdos ;return through bdos
;
;***********************************************************
;* *
;***********************************************************
wrran: ;write random (#34)
;1-> addr(fcb)
call chkv20 ;check for 2.0 or greater
call getp2i ;.fcb to DE
mvi c,wrranf
jmp ?bdos ;return through bdos
;
;***********************************************************
;* *
;***********************************************************
filsiz: ;compute file size (#35)
call chkv20 ;must be 2.0 or greater
call getp2 ;.fcb to DE
mvi c,filszf
jmp ?bdos ;return through bdos
;
;***********************************************************
;* *
;***********************************************************
setrec: ;set random record position (#36)
call chkv20 ;must be 2.0 or greater
call getp2 ;.fcb to DE
mvi c,setrcf
jmp ?bdos ;return through bdos
;
;***********************************************************
;* *
;***********************************************************
resdrv: ;reset drive function (#37)
;1->drive vector - bit(16)
call chkv22 ;must be 2.2 or greater
call getp2 ;drive reset vector to DE
mvi c,rsdrvf
jmp ?bdos ;return through bdos
;
;***********************************************************
;* *
;***********************************************************
wrranz: ;write random, zero fill function
;1-> addr(fcb)
call chkv22 ;must be 2.2 or greater
call getp2i ;.fcb to DE
mvi c,wrrnzf
jmp ?bdos
;
;***********************************************************
;* *
;***********************************************************
end


View File

@@ -1,35 +0,0 @@
; portab.lib 1/18/2012 dwg - added ESC, NEVER
; Copyright (C) 2011-2012 Douglas Goodall All Rights Reserved.
; For non-commerial use by N8VEM community
TRUE equ 1
FALSE equ 0
NEVER equ FALSE
CR equ 0dh
LF equ 0ah
ESC equ 01bh
BYTESIZE equ 1
WORDSIZE equ 2
; save registers on entry
enter macro
push psw
push b
push d
push h
endm
; restore registers on exit
leave macro
pop h
pop d
pop b
pop psw
endm
; eof - portab.h


View File

@@ -1,17 +0,0 @@
/* portio.c 8/30/2012 dwg - skeleton for inb and outb routines */
int inb(address)
unsigned int address;
{
return address;
}
int outb(address,data)
unsigned int address;
int data;
{
return address+data;
}


View File

@@ -1,113 +0,0 @@
; printers.asm 12/25/2011 dwg -
; Copyright (C) 2011-2012 Douglas Goodall All Rights Reserved.
; For non-commercial use by N8VEM community
maclib portab
maclib cpmbdos
extrn hexref
cseg
public pr$h$nyb
pr$h$nyb:
enter
ani 15
lxi h,hexref
add l
mov l,a
mov e,m
mvi c,CWRITE
call BDOS
leave
ret
public pr$h$byte
pr$h$byte:
enter
push psw
rrc
rrc
rrc
rrc
call pr$h$nyb
pop psw
call pr$h$nyb
leave
ret
public pr$h$word
pr$h$word:
enter
push h
mov a,h
call pr$h$byte
pop h
mov a,l
call pr$h$byte
leave
ret
public pr$d$word
pr$d$word:
enter
call PDEC
leave
ret
; From the "99 Bottles of Beer" web page at
; http://99-bottles-of-beer.net/language-assembler-(8080-8085)-764.html
; adapted for use in RomWBW/Apps with rmac syntax
; PRINT HL AS A DECIMAL NUMBER (0-65535)
; public PDEC
public PDEC,PDEC1,PDEC2,PDEC3,PDEC4,PDEC5
PDEC: XRA A ; LEADING ZERO FLAG
STA PDEC5
LXI B, -10000
CALL PDEC1
LXI B, -1000
CALL PDEC1
LXI B, -100
CALL PDEC1
MVI C, -10
CALL PDEC1
MVI C, -1
MVI A, 0FFh ; IF NUMBER IS ZERO, THIS MAKES SURE
STA PDEC5 ; IT'S PRINTED
PDEC1: MVI A, '/' ; "0" - 1
PDEC2: INR A
DAD B
JC PDEC2
STA PDEC4 ; SUBTRACT BC FROM HL
MOV A, L
SBB C
MOV L, A
MOV A, H
SBB B
MOV H, A
LDA PDEC4
CPI '0' ; ZERO?
JNZ PDEC3
LDA PDEC5 ; ZERO FLAG SET?
CPI 0h
RZ ; COMMENT OUT TO PRINT LEADING ZEROS
PDEC3: LDA PDEC4
CONOUTA ; WAS "CALL PCHAR"
MVI A, 0FFh ; SET LEADING ZERO FLAG
STA PDEC5
RET
dseg
PDEC4: DB 0 ; TEMP FOR 16 BIT SUBTRACTION
PDEC5: DB 0 ; FLAG FOR LEADING ZEROS
END
; eof - printers.asm


View File

@@ -1,13 +0,0 @@
; printers.lib 2/17/2012 dwg - review for release 1.5.1.0
; printers.lib 2/11/2012 dwg - review for release 1.5
; printers.lib 12/24/2011 Douglas Goodall
; The hex printing routines use the hexref string which just follows
; the entry point of the program and is placed there by the do$start macro.
extrn pr$d$word ; print a decimal word
extrn pr$h$byte ; print a hexadecimal byte
extrn pr$h$word ; print a hexadecimal word
; eof - printers.lib


View File

@@ -1,79 +0,0 @@
/*****************************/
/* floppyio.h 7/4/2012 dwg - */
/*****************************/
/*
Call DIOMED function first
on return A reg contains MID_XXXX (see std.asm)
Then call DIORD or DIOWR as required
Whendone do BDOS Drive Reset
*/
#define MID_NONE 0
#define MID_MDROM 1
#define MID_MDRAM 2
#define MID_HD 3
#define MID_FD720 4
#define MID_FD144 5
#define MID_FD360 6
#define MID_FD120 7
#define MID_FD111 8
setfldma(dmaaddr)
void * dmaaddr;
{
}
rdpsec(sector,buffer)
int sector;
void * buffer;
{
}
wrpsec(sector,buffer)
int sector;
void * buffer;
{
}
rdptrk(sector,buffer,mcnt,pspt)
int sector;
void * buffer;
int mcnt;
int pspt;
{
int sec;
for(sec=sector;sec<pspt;sec++) {
rdpsec(sector,buffer);
}
}
wrptrk(sector,buffer,mcnt,pspt)
int sector;
void * buffer;
int mcnt;
int pspt;
{
int sec;
for(sec=sector;sec<pspt;sec++) {
wrpsec(sector,buffer);
}
}
/********************/
/* eof - floppyio.h */
/********************/


View File

@@ -1,43 +0,0 @@
/* putc.c 11/21/2012 dwg - output a test character to the TMS9918 */
#include <stdio.h>
#include <stdlib.h>
#include <diagnose.h>
#include <n8chars.h>
#include <memory.h>
copyup()
{
unsigned char * p;
int ascii;
int byte;
p = 0x8000;
for(ascii=0;ascii<256;ascii++) {
for(byte=0;byte<8;byte++) {
*p++ = charset[(ascii*8)+7-byte];
}
}
}
main()
{
int index;
copyup();
hregbc = 0x4040;
hregde = 0;
hreghl = 0x8000;
diagnose();
hregbc = 0x4440;
hregde = (12<<8)+12;
diagnose();
for(index=0;index<600;index++) {
hregbc = 0x4740;
hregde = '?';
diagnose();
}
}


File diff suppressed because it is too large Load Diff

View File

@@ -1,31 +0,0 @@
#include "stdio.h"
extern unsigned char * bits;
main()
{
int ascii;
int index;
FILE * fd;
fd = fopen("n8chars2.h","w");
index = 0;
for(ascii=0;ascii<256;ascii++) {
byte8 = charset[index++];
byte7 = charset[index++];
byte6 = charset[index++];
byte5 = charset[index++];
byte4 = charset[index++];
byte3 = charset[index++];
byte2 = charset[index++];
byte1 = charset[index++];
fprintf(fd,"/* %03d (%d) */ %d,%d,%d,%d,%d,%d,%d,%d,
}
}


View File

@@ -1,24 +0,0 @@
; rem.asm 1/28/2012 dwg - update for 1.4.1.0
; rem.asm 1/23/2012 dwg - fix stack bug
; rem.asm 1/16/2012 dwg - a remark in a 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/>.
;
start: mvi c,0
call 5
end start


View File

@@ -1,104 +0,0 @@
/* remote.c 11/20/2012 dwg - */
/* Ther purpose of this program is to read the VRAM of the
TMS9918 video processor and display the contents in the
most usable form. First is the raw hexadecimal dump of
the first 16K of the VRAM, followed by a hexadecimal
dump of the name table by line number, and finally the
charactert generator bitmaps in ASCII order.
*/
#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 */
char szTemp[128];
char linenum;
char counter;
char outer;
char inner;
char limit;
int index;
unsigned int line;
unsigned char ubyte;
unsigned char bitmask;
int row;
int bit;
int ascii;
int bool;
struct CNFGDATA * pCNFGDATA;
struct SYSCFG * pSYSCFG;
FILE * fd;
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();
vdp_wrvram(0);
in(DATAP);
in(DATAP);
for(line=0;line<24;line++) {
crtlc(line+1,0);
printf("line %2d |",line+1);
for(column=0;column<40;column++) {
ubyte = in(DATAP);
switch(ubyte) {
case 0x0d: ubyte = 0; break;
case 0x0a: ubyte = 0; break;
case 0x09: ubyte = 0; break;
case 0x00: ubyte = 0x20; break;
}
if(0 != ubyte ) printf("%c",ubyte);
}
crtlc(line+1,50);
printf("|");
if(line==0) printf(" remote.com 11/21/2012 dwg");
if(line==1) printf(" display tms9918 screen");
if(line==4) printf(" Note: semi-graphics not");
if(line==5) printf(" supported.");
}
printf(" (press enter to exit)");
dregbc=1;
bdoscall();
}


View File

@@ -1,70 +0,0 @@
; req1parm.asm 7/19/2012 dwg - for 2.0.0.0 B22
; req1parm.asm 2/11/2012 dwg - review for release 1.5.1.0
; req1parm.asm 2/11/2012 dwg - review for release 1.5
; req1parm.asm 2/05/2012 dwg - update for macro usage
; req1parm.asm 1/28/2012 dwg - update for 1.4.1.0
; req1parm.asm 1/22/2012 dwg - require one parameter or stop submit
; 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 cpmappl
maclib applvers
maclib printers
maclib banner
maclib identity
cseg
do$start
jmp around$bandata
argv dw prog,dat,prod,orig,ser,myname,0
prog db 'REQ1PARM.COM$'
date
serial
product
originator
oriname
uuid db 'B9772224-F47A-4309-BECA-9D7AB1B7EDE7$'
around$bandata:
sbanner argv
lda 80h
cpi 0
jnz fini
printmsg 'Sorry, submit file requires a parameter'
mvi c,FDELETE
lxi d,del$fcb
call BDOS
fini:
do$end
dseg
newfcb del$fcb,1,'$$$ SUB'
crlf db CR,LF
term db '$'
end start


View File

@@ -1,72 +0,0 @@
/**************************************************************/
/* sectorio.c 7/30/2012 dwg - read and write physical sectors */
/**************************************************************/
/* 7/30/2012 dwg - wrsector now has c=0 for WRITE call per Wayne */
#include "cpmbios.h"
#include "bioscall.h"
int rdsector(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 wrsector(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 = pWRITE;
iregbc = 0; /* default to 0 per wayne 7/30.2012 */
bioscall();
return irega;
}
/********************/
/* eof - sectorio.c */
/********************/


View File

@@ -1,88 +0,0 @@
; setlabel.asm 2/22/2012 dwg - use new labelib macro library for labels
; 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 stdlib ; SUCCESS & FAILURE
maclib cpmbios
maclib cpmbdos
maclib bioshdr
maclib applvers
maclib cpmappl
maclib banner
maclib identity
maclib labelib
maclib version
cseg
do$start ; begin application housekeeping
jmp around$bandata
argv dw prog,dat,prod,orig,ser,myname,0
prog db 'SETLABEL.COM$'
date
serial
product
originator
oriname
uuid db 'A3EEDB99-2CC0-483E-8176-A67118936E32$'
around$bandata:
sbanner argv
; version warn$msg,error$msg
mvi c,RETCURR
call BDOS
sta drive$num
mov c,a
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 ; using the default drive number
mov c,a ; (presented in the C register)
call x$label ; call the actual code in labelib.asm
main$exit:
do$end ; finish up application housekeeping
dseg
drive$num ds 1
; here are the two strings required for the version call
warn$msg db 'The version number of this program '
db 'is not exactly the same as the BIOS',CR,LF,'$'
error$msg db 'Sorry, requires RomWBW or NuBios v2.0'
crlf db CR,LF,'$'
end start


View File

@@ -1,80 +0,0 @@
/* stat9918.c 9/11/2012 dwg - */
#include "stdio.h"
#include "applvers.h"
#include "n8chars.h"
#include "tms9918.h"
char szTemp[128];
char linenum;
char counter;
char outer;
char inner;
char limit;
int index;
int main(argc,argv)
int argc;
char *argv[];
{
int i;
char szTemp[64];
unsigned char chardex;
unsigned char * p;
FILE * fd;
vdp_clr16k();
vdp_setregs();
vdp_modes();
vdp_pnt();
vdp_pgt();
vdp_colors();
vdp_load_set450();
if(outer == 3) style = TRIPLE;
vdp_main_frame("N8VIDTST(dwg)");
chardex = 0;
for(outer=0;outer<4;outer++) {
linenum = 4;
for(inner=0;inner<6;inner++) {
if(inner < 5) limit=11;
else limit=9;
for(i=0;i<limit;i++) {
sprintf(szTemp,"%c",chardex);
vdp_display(linenum,2+(i*3),szTemp);
sprintf(szTemp,"%02x",chardex++);
vdp_display(linenum+1,2+(i*3),szTemp);
}
linenum += 3;
if(inner==5) {
sprintf(szTemp,"Pg %d/4",outer+1);
vdp_display(20,29,szTemp);
}
}
if(outer < 3) {
vdp_display(22,2," Press any key to continue");
gets(szTemp);
}
}
vdp_display(22,1,"Execution complete,returned to CP/M");
if(argc == 2) {
sprintf(szTemp,"%c",atoi(argv[1]));
vdp_display(1,WIDTH-2,szTemp);
}
p = charset;
fd = fopen("n8chars.inc","w");
fprintf(fd,"; n8chars.inc - automatically generated by n8vidtst\n");
for(index=0;index<256;index++) {
fprintf(fd,"\t.DB\t");
fprintf(fd,"%03xh,%03xh,%03xh,%03xh,%03xh,%03xh,%03xh,%03xh\t; 0x%02x(%d)\n",
*p++,*p++,*p++,*p++,*p++,*p++,*p++,*p++,index,index);
}
fprintf(fd,"; eof - n8chars.inc\n");
fclose(fd);
}


View File

@@ -1,578 +0,0 @@
;
;==================================================================================================
; STANDARD INCLUDE STUFF
;==================================================================================================
;
; 5/21/2012 2.0.0.0 dwg - added B1F0PEEK & B1F0POKE
;
; 5/11/2012 2.0.0.0 dwg - moved BIOS JMPS together
;
; 3/04/2012 2.0.0.0 dwg - added CBIOS_BNKSEL for new BIOS jump (OEM extension)
;
; 2/21/2012 dwg - added TERM_VT52 terminal type for VDU
; 12/12/2011 dwg - changed TERM_NOT_SPEC to TERM_TTY & TTY=0 ANSI=1 WYSE=2
;
; 12/11/2011 dwg - added TERM_ANSI and TERM_WYSE for TERMTYPE
;
; 11/29/2011 dwg - now uses dynamically generated include file
; instead of static definitions.
;
;---------------------------------------------------------------------------------------------------
;
TRUE: .EQU 1
FALSE: .EQU 0
;
; 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 MODE SELECTIONS
;
VDUMODE_VDU .EQU 1 ; ORIGINAL ECB VDU (6545 CHIP)
VDUMODE_CVDU .EQU 2 ; ECB VDU COLOR (PENDING HARDWARE DEVELOPMENT)
VDUMODE_N8 .EQU 3 ; N8 ONBOARD VIDEO SUBSYSTEM (NOT IMPLEMENTED)
;
; CHARACTER DEVICES
;
CIODEV_UART .EQU $00
CIODEV_PRPCON .EQU $10
CIODEV_VDU .EQU $20
CIODEV_CVDU .EQU $30
CIODEV_PPPCON .EQU $40
CIODEV_BAT .EQU $E0
CIODEV_NUL .EQU $F0
;
; DISK DEVICES (ONLY FIRST NIBBLE RELEVANT, SECOND NIBBLE RESERVED FOR UNIT)
;
DIODEV_MD .EQU $00
DIODEV_FD .EQU $10
DIODEV_IDE .EQU $20
DIODEV_ATAPI .EQU $30
DIODEV_PPIDE .EQU $40
DIODEV_SD .EQU $50
DIODEV_PRPSD .EQU $60
DIODEV_PPPSD .EQU $70
DIODEV_HDSK .EQU $80
;
; 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
DM_PPPSD .EQU 8 ; PROPIO SD DRIVE PRIORITY
DM_HDSK .EQU 9 ; SIMH HARD DISK 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 ; 5.25" FLOPPY, 1.2MB, 2 SIDES, 80 TRKS, 15 SECTORS
FDM111 .EQU 4 ; 8" FLOPPY, 1.11MB, 2 SIDES, 74 TRKS, 15 SECTORS
;
; MEDIA ID VALUES
;
MID_NONE .EQU 0
MID_MDROM .EQU 1
MID_MDRAM .EQU 2
MID_HD .EQU 3
MID_FD720 .EQU 4
MID_FD144 .EQU 5
MID_FD360 .EQU 6
MID_FD120 .EQU 7
MID_FD111 .EQU 8
;
; FD MODE SELECTIONS
;
FDMODE_DIO .EQU 1 ; DISKIO V1
FDMODE_ZETA .EQU 2 ; ZETA
FDMODE_DIDE .EQU 3 ; DUAL IDE
FDMODE_N8 .EQU 4 ; N8
FDMODE_DIO3 .EQU 5 ; DISKIO V3
;
; IDE MODE SELECTIONS
;
IDEMODE_DIO .EQU 1 ; DISKIO V1
IDEMODE_DIDE .EQU 2 ; DUAL IDE
;
; PPIDE MODE SELECTIONS
;
PPIDEMODE_STD .EQU 1 ; STANDARD N8VEM PARALLEL PORT
PPIDEMODE_DIO3 .EQU 2 ; DISKIO V3 PARALLEL PORT
;
; CONSOLE DEVICE CHOICES FOR LDRCON AND DBGCON IN CONFIG SETTINGS
;
CON_UART .EQU 1
CON_VDU .EQU 2
CON_PRP .EQU 3
CON_PPP .EQU 4
;
; 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 "ZSDOS 1.1"
#ENDIF
;
; INCLUDE VERSION AND BUILD SETTINGS
;
#INCLUDE "ver.inc" ; ADD BIOSVER
;
#INCLUDE "build.inc" ; INCLUDE USER CONFIG, ADD VARIANT, TIMESTAMP, & ROMSIZE
;
#IF (PLATFORM != 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
RTC .EQU 70H ; ADDRESS OF RTC LATCH AND INPUT PORT
;__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 != PLT_N8)
;
#IF (PLATFORM == 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
;
; BIOS FUNCTIONS
;
BF_CIO .EQU $00
BF_CIOIN .EQU BF_CIO + 0 ; CHARACTER INPUT
BF_CIOOUT .EQU BF_CIO + 1 ; CHARACTER OUTPUT
BF_CIOIST .EQU BF_CIO + 2 ; CHARACTER INPUT STATUS
BF_CIOOST .EQU BF_CIO + 3 ; CHARACTER OUTPUT STATUS
;
BF_DIO .EQU $10
BF_DIORD .EQU BF_DIO + 0 ; DISK READ
BF_DIOWR .EQU BF_DIO + 1 ; DISK WRITE
BF_DIOST .EQU BF_DIO + 2 ; DISK STATUS
BF_DIOMED .EQU BF_DIO + 3 ; DISK MEDIA
BF_DIOID .EQU BF_DIO + 4 ; DISK IDENTIFY
BF_DIOGBA .EQU BF_DIO + 8 ; DISK GET BUFFER ADR
BF_DIOSBA .EQU BF_DIO + 9 ; DISK SET BUFFER ADR
;
BF_CLK .EQU $20
BF_CLKRD .EQU BF_CLK + 0
BF_CLKWR .EQU BF_CLK + 1
;
BF_VDU .EQU $30
BF_VDUIN .EQU BF_VDU + 0 ; VDU CHARACTER INPUT
BF_VDUOUT .EQU BF_VDU + 1 ; VDU CHARACTER OUTPUT
BF_VDUIST .EQU BF_VDU + 2 ; VDU CHARACTER INPUT STATUS
BF_VDUOST .EQU BF_VDU + 3 ; VDU CHARACTER OUTPUT STATUS
BF_VDUXY .EQU BF_VDU + 4 ; VDU CURSOR POSITION X/Y
;
BF_SYS .EQU $F0
BF_SYSGETCFG .EQU BF_SYS + 0 ; GET CONFIGURATION DATA BLOCK
BF_SYSSETCFG .EQU BF_SYS + 1 ; SET CONFIGURATION DATA BLOCK
BF_SYSBNKCPY .EQU BF_SYS + 2 ; COPY TO/FROM RAM/ROM MEMORY BANK
;
;
; MEMORY LAYOUT
;
CPM_LOC .EQU 0D000H ; CONFIGURABLE: LOCATION OF CPM FOR RUNNING SYSTEM
CPM_SIZ .EQU 2F00H ; SIZE OF CPM IMAGE (CCP + BDOS + CBIOS (INCLUDING DATA))
CPM_END .EQU CPM_LOC + CPM_SIZ
;
CCP_LOC .EQU CPM_LOC ; START OF COMMAND PROCESSOR
CCP_SIZ .EQU 800H
CCP_END .EQU CCP_LOC + CCP_SIZ
;
BDOS_LOC .EQU CCP_END ; START OF BDOS
BDOS_SIZ .EQU 0E00H
BDOS_END .EQU BDOS_LOC + BDOS_SIZ
;
CBIOS_LOC .EQU BDOS_END
CBIOS_SIZ .EQU CPM_END - CBIOS_LOC
CBIOS_END .EQU CBIOS_LOC + CBIOS_SIZ
;
CPM_ENT .EQU CBIOS_LOC
;
HB_LOC .EQU CPM_END
HB_SIZ .EQU 100H
HB_END .EQU HB_LOC + HB_SIZ
;
MON_LOC .EQU 0C000H ; 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)
;
CBIOS_BOOT .EQU CBIOS_LOC + 0
CBIOS_WBOOT .EQU CBIOS_LOC + 3
CBIOS_CONST .EQU CBIOS_LOC + 6
CBIOS_CONIN .EQU CBIOS_LOC + 9
CBIOS_CONOUT .EQU CBIOS_LOC + 12
CBIOS_LIST .EQU CBIOS_LOC + 15
CBIOS_PUNCH .EQU CBIOS_LOC + 18
CBIOS_READER .EQU CBIOS_LOC + 21
CBIOS_HOME .EQU CBIOS_LOC + 24
CBIOS_SELDSK .EQU CBIOS_LOC + 27
CBIOS_SETTRK .EQU CBIOS_LOC + 30
CBIOS_SETSEC .EQU CBIOS_LOC + 33
CBIOS_SETDMA .EQU CBIOS_LOC + 36
CBIOS_READ .EQU CBIOS_LOC + 39
CBIOS_WRITE .EQU CBIOS_LOC + 42
CBIOS_LISTST .EQU CBIOS_LOC + 45
CBIOS_SECTRN .EQU CBIOS_LOC + 48
;
; EXTENDED CBIOS FUNCTIONS
;
CBIOS_BNKSEL .EQU CBIOS_LOC + 51
CBIOS_GETDSK .EQU CBIOS_LOC + 54
CBIOS_SETDSK .EQU CBIOS_LOC + 57
CBIOS_GETINFO .EQU CBIOS_LOC + 60
;
; PLACEHOLDERS FOR FUTURE CBIOS EXTENSIONS
;
CBIOS_RSVD1 .EQU CBIOS_LOC + 63
CBIOS_RSVD2 .EQU CBIOS_LOC + 76
CBIOS_RSVD3 .EQU CBIOS_LOC + 69
CBIOS_RSVD4 .EQU CBIOS_LOC + 72
;
CDISK: .EQU 00004H ; LOC IN PAGE 0 OF CURRENT DISK NUMBER 0=A,...,15=P
IOBYTE: .EQU 00003H ; LOC IN PAGE 0 OF I/O DEFINITION BYTE.
;
; 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 (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
#IF (FDMEDIA == FDM120)
#DEFINE FDLBL ", FLOPPY (1.20MB)"
#ENDIF
#IF (FDMEDIA == FDM360)
#DEFINE FDLBL ", FLOPPY (360KB)"
#ENDIF
#IF (FDMEDIA == FDM111)
#DEFINE FDLBL ", FLOPPY (1.11MB)"
#ENDIF
#ENDIF
#ELSE
#DEFINE FDLBL ""
#ENDIF
;
#IF (IDEENABLE)
#IF (IDEMODE == IDEMODE_DIO)
#DEFINE IDELBL ", IDE (DISKIO)"
#ENDIF
#IF (IDEMODE == IDEMODE_DIDE)
#DEFINE IDELBL ", IDE (DUAL IDE)"
#ENDIF
#ELSE
#DEFINE IDELBL ""
#ENDIF
;
#IF (PPIDEENABLE)
#IF (PPIDEMODE == PPIDEMODE_STD)
#DEFINE PPIDELBL ", PPIDE (STD)"
#ENDIF
#IF (PPIDEMODE == PPIDEMODE_DIO3)
#DEFINE PPIDELBL ", PPIDE (DISKIO V3)"
#ENDIF
#ELSE
#DEFINE PPIDELBL ""
#ENDIF
;
#IF (SDENABLE)
#DEFINE SDLBL ", SD CARD"
#ELSE
#DEFINE SDLBL ""
#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 (PRPENABLE)
#IF (PRPCONENABLE & PRPSDENABLE)
#DEFINE PRPLBL ", PROPIO (CONSOLE, SD CARD)"
#ENDIF
#IF (PRPCONENABLE & !PRPSDENABLE)
#DEFINE PRPLBL ", PROPIO (CONSOLE)"
#ENDIF
#IF (!PRPCONENABLE & PRPSDENABLE)
#DEFINE PRPLBL ", PROPIO (SD CARD)"
#ENDIF
#IF (!PRPCONENABLE & !PRPSDENABLE)
#DEFINE PRPLBL ", PROPIO ()"
#ENDIF
#ELSE
#DEFINE PRPLBL ""
#ENDIF
#IF (PPPENABLE)
#IF (PPPCONENABLE & PPPSDENABLE)
#DEFINE PPPLBL ", PARPORTPROP (CONSOLE, SD CARD)"
#ENDIF
#IF (PPPCONENABLE & !PPPSDENABLE)
#DEFINE PPPLBL ", PARPORTPROP (CONSOLE)"
#ENDIF
#IF (!PPPCONENABLE & PPPSDENABLE)
#DEFINE PPPLBL ", PARPORTPROP (SD CARD)"
#ENDIF
#IF (!PPPCONENABLE & !PPPSDENABLE)
#DEFINE PPPLBL ", PARPORTPROP ()"
#ENDIF
#ELSE
#DEFINE PPPLBL ""
#ENDIF
.ECHO "Configuration: "
.ECHO PLATFORM_NAME
.ECHO DSKYLBL
.ECHO VDULBL
.ECHO FDLBL
.ECHO IDELBL
.ECHO PPIDELBL
.ECHO SDLBL
.ECHO PRPLBL
.ECHO PPPLBL
.ECHO "\n"


View File

@@ -1,475 +0,0 @@
; std.lib 2/21/2012 dwg - added TERM$VT52
; ; std.lib 2/8/2012 derived from std.asm (1.5-RC1)
;
;
; ;==================================================================================================
; ; STANDARD INCLUDE STUFF
; ;==================================================================================================
;
; 12/12/2011 dwg - changed TERM$NOT$SPEC to TERM$TTY & TTY=0 ANSI=1 WYSE=2
;
; 12/11/2011 dwg - added TERM$ANSI and TERM$WYSE for TERMTYPE
;
; 11/29/2011 dwg - now uses dynamically generated include file
; ; instead of static definitions.
;
; 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


View File

@@ -1,630 +0,0 @@
/*
;
;==================================================================================================
; STANDARD INCLUDE STUFF
;==================================================================================================
;
; 5/21/2012 2.0.0.0 dwg - added B1F0PEEK & B1F0POKE
;
; 5/11/2012 2.0.0.0 dwg - moved BIOS JMPS together
;
; 3/04/2012 2.0.0.0 dwg - added CBIOS_BNKSEL for new BIOS jump (OEM extension)
;
; 2/21/2012 dwg - added TERM_VT52 terminal type for VDU
; 12/12/2011 dwg - changed TERM_NOT_SPEC to TERM_TTY & TTY=0 ANSI=1 WYSE=2
;
; 12/11/2011 dwg - added TERM_ANSI and TERM_WYSE for TERMTYPE
;
; 11/29/2011 dwg - now uses dynamically generated include file
; instead of static definitions.
;
;---------------------------------------------------------------------------------------------------
;
TRUE: .EQU 1
FALSE: .EQU 0
;
; 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
*/
#define PLT_N8VEM 1
#define PLT_ZETA 2
#define PLT_N8 3
/*
;
; 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 MODE SELECTIONS
;
VDUMODE_VDU .EQU 1 ; ORIGINAL ECB VDU (6545 CHIP)
VDUMODE_CVDU .EQU 2 ; ECB VDU COLOR (PENDING HARDWARE DEVELOPMENT)
VDUMODE_N8 .EQU 3 ; N8 ONBOARD VIDEO SUBSYSTEM (NOT IMPLEMENTED)
;
; CHARACTER DEVICES
;
CIODEV_UART .EQU $00
CIODEV_PRPCON .EQU $10
CIODEV_VDU .EQU $20
CIODEV_CVDU .EQU $30
CIODEV_PPPCON .EQU $40
CIODEV_BAT .EQU $E0
CIODEV_NUL .EQU $F0
;
; DISK DEVICES (ONLY FIRST NIBBLE RELEVANT, SECOND NIBBLE RESERVED FOR UNIT)
;
DIODEV_MD .EQU $00
DIODEV_FD .EQU $10
DIODEV_IDE .EQU $20
DIODEV_ATAPI .EQU $30
DIODEV_PPIDE .EQU $40
DIODEV_SD .EQU $50
DIODEV_PRPSD .EQU $60
DIODEV_PPPSD .EQU $70
DIODEV_HDSK .EQU $80
;
; 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
DM_PPPSD .EQU 8 ; PROPIO SD DRIVE PRIORITY
DM_HDSK .EQU 9 ; SIMH HARD DISK 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 ; 5.25" FLOPPY, 1.2MB, 2 SIDES, 80 TRKS, 15 SECTORS
FDM111 .EQU 4 ; 8" FLOPPY, 1.11MB, 2 SIDES, 74 TRKS, 15 SECTORS
;
; MEDIA ID VALUES
;
MID_NONE .EQU 0
MID_MDROM .EQU 1
MID_MDRAM .EQU 2
MID_HD .EQU 3
MID_FD720 .EQU 4
MID_FD144 .EQU 5
MID_FD360 .EQU 6
MID_FD120 .EQU 7
MID_FD111 .EQU 8
;
; FD MODE SELECTIONS
;
FDMODE_DIO .EQU 1 ; DISKIO V1
FDMODE_ZETA .EQU 2 ; ZETA
FDMODE_DIDE .EQU 3 ; DUAL IDE
FDMODE_N8 .EQU 4 ; N8
FDMODE_DIO3 .EQU 5 ; DISKIO V3
;
; IDE MODE SELECTIONS
;
IDEMODE_DIO .EQU 1 ; DISKIO V1
IDEMODE_DIDE .EQU 2 ; DUAL IDE
;
; PPIDE MODE SELECTIONS
;
PPIDEMODE_STD .EQU 1 ; STANDARD N8VEM PARALLEL PORT
PPIDEMODE_DIO3 .EQU 2 ; DISKIO V3 PARALLEL PORT
;
; CONSOLE DEVICE CHOICES FOR LDRCON AND DBGCON IN CONFIG SETTINGS
;
CON_UART .EQU 1
CON_VDU .EQU 2
CON_PRP .EQU 3
CON_PPP .EQU 4
;
; 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 "ZSDOS 1.1"
#ENDIF
;
; INCLUDE VERSION AND BUILD SETTINGS
;
#INCLUDE "ver.inc" ; ADD BIOSVER
;
#INCLUDE "build.inc" ; INCLUDE USER CONFIG, ADD VARIANT, TIMESTAMP, & ROMSIZE
;
#IF (PLATFORM != 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
RTC .EQU 70H ; ADDRESS OF RTC LATCH AND INPUT PORT
;__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
*/
#define PIOA 0x60
#define PIOB 0x61
#define PIOC 0x62
#define PIOX 0x63
/*
;
; 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 != PLT_N8)
;
#IF (PLATFORM == 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
*/
#define N8_IOBASE 0x80
#define PIO2 (N8_IOBASE+4)
#define PIO2A PIO2
#define PIO2B (PIO2+1)
#define PIO2C (PIO2+2)
#define PIO2X (PIO2+3)
/*
;
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)
*/
#define RTC (N8_IOBASE+8)
#define ACR (N8_IOBASE+0x14)
#define RMAP (N8_IOBASE+0x16)
#define VDP (N8_IOBASE+0x18)
#define VDP_DATA 0x50
#define VDP_ADDR 0x51
#define VDP_STAT 0x51
#define VDP_PALT 0x53
#define VDP_REGS 0x54
#define VDP_ACR 0x54
#define PSG (N8_IOBASE+0x1c)
#define PSG_REGS 0x052
#define PSG_DATA 0x053
#define PSG_STAT 0x052
/*
;
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
;
; BIOS FUNCTIONS
;
BF_CIO .EQU $00
BF_CIOIN .EQU BF_CIO + 0 ; CHARACTER INPUT
BF_CIOOUT .EQU BF_CIO + 1 ; CHARACTER OUTPUT
BF_CIOIST .EQU BF_CIO + 2 ; CHARACTER INPUT STATUS
BF_CIOOST .EQU BF_CIO + 3 ; CHARACTER OUTPUT STATUS
;
BF_DIO .EQU $10
BF_DIORD .EQU BF_DIO + 0 ; DISK READ
BF_DIOWR .EQU BF_DIO + 1 ; DISK WRITE
BF_DIOST .EQU BF_DIO + 2 ; DISK STATUS
BF_DIOMED .EQU BF_DIO + 3 ; DISK MEDIA
BF_DIOID .EQU BF_DIO + 4 ; DISK IDENTIFY
BF_DIOGBA .EQU BF_DIO + 8 ; DISK GET BUFFER ADR
BF_DIOSBA .EQU BF_DIO + 9 ; DISK SET BUFFER ADR
;
BF_CLK .EQU $20
BF_CLKRD .EQU BF_CLK + 0
BF_CLKWR .EQU BF_CLK + 1
;
BF_VDU .EQU $30
BF_VDUIN .EQU BF_VDU + 0 ; VDU CHARACTER INPUT
BF_VDUOUT .EQU BF_VDU + 1 ; VDU CHARACTER OUTPUT
BF_VDUIST .EQU BF_VDU + 2 ; VDU CHARACTER INPUT STATUS
BF_VDUOST .EQU BF_VDU + 3 ; VDU CHARACTER OUTPUT STATUS
BF_VDUXY .EQU BF_VDU + 4 ; VDU CURSOR POSITION X/Y
;
BF_SYS .EQU $F0
BF_SYSGETCFG .EQU BF_SYS + 0 ; GET CONFIGURATION DATA BLOCK
BF_SYSSETCFG .EQU BF_SYS + 1 ; SET CONFIGURATION DATA BLOCK
BF_SYSBNKCPY .EQU BF_SYS + 2 ; COPY TO/FROM RAM/ROM MEMORY BANK
;
;
; MEMORY LAYOUT
;
CPM_LOC .EQU 0D000H ; CONFIGURABLE: LOCATION OF CPM FOR RUNNING SYSTEM
CPM_SIZ .EQU 2F00H ; SIZE OF CPM IMAGE (CCP + BDOS + CBIOS (INCLUDING DATA))
CPM_END .EQU CPM_LOC + CPM_SIZ
;
CCP_LOC .EQU CPM_LOC ; START OF COMMAND PROCESSOR
CCP_SIZ .EQU 800H
CCP_END .EQU CCP_LOC + CCP_SIZ
;
BDOS_LOC .EQU CCP_END ; START OF BDOS
BDOS_SIZ .EQU 0E00H
BDOS_END .EQU BDOS_LOC + BDOS_SIZ
;
CBIOS_LOC .EQU BDOS_END
CBIOS_SIZ .EQU CPM_END - CBIOS_LOC
CBIOS_END .EQU CBIOS_LOC + CBIOS_SIZ
;
CPM_ENT .EQU CBIOS_LOC
;
HB_LOC .EQU CPM_END
HB_SIZ .EQU 100H
HB_END .EQU HB_LOC + HB_SIZ
;
MON_LOC .EQU 0C000H ; 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)
;
CBIOS_BOOT .EQU CBIOS_LOC + 0
CBIOS_WBOOT .EQU CBIOS_LOC + 3
CBIOS_CONST .EQU CBIOS_LOC + 6
CBIOS_CONIN .EQU CBIOS_LOC + 9
CBIOS_CONOUT .EQU CBIOS_LOC + 12
CBIOS_LIST .EQU CBIOS_LOC + 15
CBIOS_PUNCH .EQU CBIOS_LOC + 18
CBIOS_READER .EQU CBIOS_LOC + 21
CBIOS_HOME .EQU CBIOS_LOC + 24
CBIOS_SELDSK .EQU CBIOS_LOC + 27
CBIOS_SETTRK .EQU CBIOS_LOC + 30
CBIOS_SETSEC .EQU CBIOS_LOC + 33
CBIOS_SETDMA .EQU CBIOS_LOC + 36
CBIOS_READ .EQU CBIOS_LOC + 39
CBIOS_WRITE .EQU CBIOS_LOC + 42
CBIOS_LISTST .EQU CBIOS_LOC + 45
CBIOS_SECTRN .EQU CBIOS_LOC + 48
;
; EXTENDED CBIOS FUNCTIONS
;
CBIOS_BNKSEL .EQU CBIOS_LOC + 51
CBIOS_GETDSK .EQU CBIOS_LOC + 54
CBIOS_SETDSK .EQU CBIOS_LOC + 57
CBIOS_GETINFO .EQU CBIOS_LOC + 60
;
; PLACEHOLDERS FOR FUTURE CBIOS EXTENSIONS
;
CBIOS_RSVD1 .EQU CBIOS_LOC + 63
CBIOS_RSVD2 .EQU CBIOS_LOC + 76
CBIOS_RSVD3 .EQU CBIOS_LOC + 69
CBIOS_RSVD4 .EQU CBIOS_LOC + 72
;
CDISK: .EQU 00004H ; LOC IN PAGE 0 OF CURRENT DISK NUMBER 0=A,...,15=P
IOBYTE: .EQU 00003H ; LOC IN PAGE 0 OF I/O DEFINITION BYTE.
;
; 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 (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
#IF (FDMEDIA == FDM120)
#DEFINE FDLBL ", FLOPPY (1.20MB)"
#ENDIF
#IF (FDMEDIA == FDM360)
#DEFINE FDLBL ", FLOPPY (360KB)"
#ENDIF
#IF (FDMEDIA == FDM111)
#DEFINE FDLBL ", FLOPPY (1.11MB)"
#ENDIF
#ENDIF
#ELSE
#DEFINE FDLBL ""
#ENDIF
;
#IF (IDEENABLE)
#IF (IDEMODE == IDEMODE_DIO)
#DEFINE IDELBL ", IDE (DISKIO)"
#ENDIF
#IF (IDEMODE == IDEMODE_DIDE)
#DEFINE IDELBL ", IDE (DUAL IDE)"
#ENDIF
#ELSE
#DEFINE IDELBL ""
#ENDIF
;
#IF (PPIDEENABLE)
#IF (PPIDEMODE == PPIDEMODE_STD)
#DEFINE PPIDELBL ", PPIDE (STD)"
#ENDIF
#IF (PPIDEMODE == PPIDEMODE_DIO3)
#DEFINE PPIDELBL ", PPIDE (DISKIO V3)"
#ENDIF
#ELSE
#DEFINE PPIDELBL ""
#ENDIF
;
#IF (SDENABLE)
#DEFINE SDLBL ", SD CARD"
#ELSE
#DEFINE SDLBL ""
#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 (PRPENABLE)
#IF (PRPCONENABLE & PRPSDENABLE)
#DEFINE PRPLBL ", PROPIO (CONSOLE, SD CARD)"
#ENDIF
#IF (PRPCONENABLE & !PRPSDENABLE)
#DEFINE PRPLBL ", PROPIO (CONSOLE)"
#ENDIF
#IF (!PRPCONENABLE & PRPSDENABLE)
#DEFINE PRPLBL ", PROPIO (SD CARD)"
#ENDIF
#IF (!PRPCONENABLE & !PRPSDENABLE)
#DEFINE PRPLBL ", PROPIO ()"
#ENDIF
#ELSE
#DEFINE PRPLBL ""
#ENDIF
#IF (PPPENABLE)
#IF (PPPCONENABLE & PPPSDENABLE)
#DEFINE PPPLBL ", PARPORTPROP (CONSOLE, SD CARD)"
#ENDIF
#IF (PPPCONENABLE & !PPPSDENABLE)
#DEFINE PPPLBL ", PARPORTPROP (CONSOLE)"
#ENDIF
#IF (!PPPCONENABLE & PPPSDENABLE)
#DEFINE PPPLBL ", PARPORTPROP (SD CARD)"
#ENDIF
#IF (!PPPCONENABLE & !PPPSDENABLE)
#DEFINE PPPLBL ", PARPORTPROP ()"
#ENDIF
#ELSE
#DEFINE PPPLBL ""
#ENDIF
.ECHO "Configuration: "
.ECHO PLATFORM_NAME
.ECHO DSKYLBL
.ECHO VDULBL
.ECHO FDLBL
.ECHO IDELBL
.ECHO PPIDELBL
.ECHO SDLBL
.ECHO PRPLBL
.ECHO PPPLBL
.ECHO "\n"
*/


View File

@@ -1,10 +0,0 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; stdlib.lib 1/18/2012 dwg - some stdlib declarations ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
SUCCESS equ FALSE ; depends on previous portab.lib
FAILURE equ TRUE ; depends on previous portab.lib
;;;;;;;;;;;;;;;;;;;;
; eof - stdlib.lib ;
;;;;;;;;;;;;;;;;;;;;


View File

@@ -1,67 +0,0 @@
; stop.asm 7/19/2012 dwg - for 2.0.0.0 B22
; stop.asm 2/11/2012 dwg - review for release 1.5.1.0
; stop.asm 2/11/2012 dwg - review for release 1.5
; stop.asm 1/28/2012 dwg - update for 1.4.1.0
; stop.asm 1/22/2012 dwg - review for release 1.4
; stop.asm 1/20.2012 dwg - stop submit file activity
; 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 banner
maclib cpmbdos
maclib cpmappl
maclib applvers
maclib printers
maclib version
maclib z80
maclib identity
cseg
do$start
jmp around$bandata
argv dw prog,dat,prod,orig,ser,myname,0
prog db 'STOP.COM $'
date
serial
product
originator
oriname
uuid db '4A7BABA3-D6F3-4AAC-9C02-4F92CD52F91E$'
around$bandata:
sbanner argv
mvi c,FDELETE
lxi d,del$fcb
call BDOS
printmsg 'Submit file halted'
do$end
dseg
newfcb del$fcb,1,'$$$ SUB'
crlf db CR,LF
term db '$'
end start


View File

@@ -1,322 +0,0 @@
; terminal.asm 2/17/2012 dwg - review for release 1.5.1.0
; terminal.asm 12/26/2011 dwg -
; 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/>.
; The termbind lib is the home of the macros that are the
; ; front end for access to library routines that implement
; ; terminal specific functionality.
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Table 4-11 VT52 Escape Sequences
;
; ESC A
; Cursor up.
;
; ESC B
; Cursor down.
;
; ESC C
; Cursor right.
;
; ESC D
; Cursor left.
;
; ESC F
; Enter graphics mode.
;
; ESC G
; Exit graphics mode.
;
; ESC H
; Cursor to home.
;
; ESC I
; Reverse line feed.
;
; ESC J
; Erase to end of screen.
;
; ESC K
; Erase to end of line.
;
; ESC Y Line Column
; Direct cursor address.
;
; ESC Z
; Identify.
;
; ESC =
; Enter alternate keypad mode.
;
; ESC &gt;
; Exit alternate keypad mode.
;
; ESC &lt;
; Enter ANSI mode.
;
; ESC ^
; Enter auto print mode.
;
; ESC _
; Exit auto print mode.
;
; ESC W
; Enter printer controller mode.
;
; ESC X
; Exit printer controller mode.
;
; ESC ]
; Print screen.
;
; ESC V
; Print cursor line.
; ANSI
; CSI = <esc>[
; CSI n A CUU - CUrsor Up, n cells
; CSI n B CUD - CUrsor Down, n cells
; CSI n C CUF - CUrsor Forward
; CSI n D CUB - CUrsor Back
; CSI n E CNL - Cursor Next Line
; CSI n F CPL - Cursor Previous Line
; CSI n G CHA - Cursor Horizontal Absolute
; CSI n ; m H CUP - Cursor Position,n = row, m = col (1rel)
; CSI 0 J ED - clear from cursor to EOS
; CSI 1 J ED - clear from cursor to BOS
; CSI 2 J ED - clear screen
; CSI n K EL - 0-clr-2eol,1-clr-to-bol,2-clr-line
; CSI n S SU - Scroll Up
; CSI n T SD - Scroll Down
; CSI s SCP - Save Cursor Position
; CSI u RCP - Restore Cursor Position
; CSI n [;k] m SGR - Select Graphic Rendition
; CSI 0 m SGR - Reset / Normal
; CSI 1 m SGR - Bright or Bold
; CSI 3 m SGR - italic on
; CSI 4 m SGR - underline (single) on
; CSI 5 m SGR - blink slow
; CSI 6 m SGR - blink rapid
; CSI 7 m SGR - negative
; CSI 8 m SGR - Conceal
; CSI 9 m SGR - Crossed Out
; CSI 10 m SGR - Primary (default) Font
; CSI 21 m SGR - Bright Bold Off
; CSI 22 m SGR - Normal COlor or Intensity
; CSI 23 m SGR - Not Italic
; CSI 24 m SGR - Not underline
; CSI 25 m SGR - Not Blink
; CSI 27 m SGR - Image Positive
; CSI 28 m SGR - Reveal
; CSI 29 m SGR - Not Crossed Out
; CSI 30 m SGR - Black CSI 30 ; 1 m (light black)
; CSI 31 m SGR - Red CSI 31 ; 1 m (light red)
; CSI 32 m SGR - Green CSI 32 ; 1 m (light green)
; CSI 33 m SGR - Yellow CSI 33 ; 1 m (light yellow)
; CSI 34 m SGR - Blue CSI 34 ; 1 m (light blue)
; CSI 35 m SGR - Magenta CSI 35 ; 1 m (light magenta)
; CSI 36 m SGR - Cyan CSI 36 ; 1 m (light cyan)
; CSI 37 m SGR - White CSI 37 ; 1 m (light white)
; CSI 39 m SGR - Set Default Text Color
; CSI 40-47 m SGR - Set Background Color
; CSI 6 n DSR - Device Status Report
; VT100
; VT220
; WYSE
; WY50
; ESC = r c Set Cursor Position (see row codes)
; ESC * Clear screen to nulls
; ESC + Clear screen to spaces
maclib portab
maclib std
maclib cpmbios
maclib cpmbdos
maclib bioshdr
maclib hbios
maclib cnfgdata
; enter with the number in de
public xprdec
xprdec: lxi h,dr
dad d
dad d
dad d
dad d
xchg
mvi c,9
call 5
ret
public xcrtinit
xcrtinit:
call xgetsc
lxi h,termtype
mov a,m
sta ttyp
ret
public xcrtclr
xcrtclr:
lda ttyp
cpi TERM$ANSI
jnz xnotansi1
mvi c,2 ! mvi e,27 ! call 5
mvi c,2 ! mvi e,'[' ! call 5
mvi c,2 ! mvi e,'2' ! call 5
mvi c,2 ! mvi e,'J' ! call 5
jmp xdone1
xnotansi1:
cpi TERM$WYSE
jnz xnotwyse1
conout 27
conout '+'
jmp xdone1
xnotwyse1:
cpi TERM$VT52
jnz xdone
conout 27
conout 'H' ; Cursor to Hoe
conout 27
conout 'J' ; Erase to End of Screen
xdone1:
ret
; h=line l=col
public xcrtlc
xcrtlc:
lda ttyp
cpi TERM$ANSI
jz xisansi
cpi TERM$WYSE
jz xiswyse
cpi TERM$VT52
jz xisvt52
ret
xiswyse:
mov a,h
sta templine
mov a,l
sta tempcol
conout 27
conout '='
lda templine
mov e,a
mvi d,0
lxi h,wy50row
dad d
dcx h
mov e,m
mvi c,2
call BDOS
;
lda tempcol
mov e,a
mvi d,0
lxi h,wy50col
dad d
dcx h
mov e,m
mvi c,2
call BDOS
jmp xdone
;------->
xisansi:
push h
push h
mvi c,2 ! mvi e,27 ! call 5
mvi c,2 ! mvi e,'[' ! call 5
pop h
mov e,h
mvi d,0
call xprdec
mvi c,2 ! mvi e,';' ! call 5
pop h
mov e,l
mvi d,0
call xprdec
mvi c,2 ! mvi e,66h ! call 5
xdone:
ret
xisvt52:
push h
push h
conout 27
conout 'Y'
pop h
mov a,h
adi 32
mov e,a
mvi c,CWRITE
call BDOS
pop h
mov a,l
adi 32
mov e,a
mvi c,CWRITE
call BDOS
ret
public dr
dr db '0$ ','1$ ','2$ ','3$ ','4$ '
db '5$ ','6$ ','7$ ','8$ ','9$ '
db '10$ ','11$ ','12$ ','13$ ','14$ '
db '15$ ','16$ ','17$ ','18$ ','19$ '
db '20$ ','21$ ','22$ ','23$ ','24$ '
db '25$ ','26$ ','27$ ','28$ ','29$ '
db '30$ ','31$ ','32$ ','33$ ','34$ '
db '35$ ','36$ ','37$ ','38$ ','39$ '
db '40$ ','41$ ','42$ ','43$ ','44$ '
db '45$ ','46$ ','47$ ','48$ ','49$ '
db '50$ ','51$ ','52$ ','53$ ','54$ '
db '55$ ','56$ ','57$ ','58$ ','59$ '
db '60$ ','61$ ','62$ ','63$ ','64$ '
db '65$ ','66$ ','67$ ','68$ ','69$ '
db '70$ ','71$ ','72$ ','73$ ','74$ '
db '75$ ','76$ ','77$ ','78$ ','79$ '
db '80$ ','81$ ','82$ ','83$ ','84$ '
db '85$ ','86$ ','87$ ','88$ ','89$ '
db '90$ ','91$ ','92$ ','93$ ','94$ '
db '95$ ','96$ ','97$ ','99$ ','100$'
SINGLEQUOTE equ 0
RIGHTQUOTE equ 0
LEFTQUOTE equ 0
wy50row db ' !"#$%&'
db 39
db '()*+,-./01234567'
wy50col db ' !"#$%&'
db 39
db '()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_'
db 96
db 'abcdefghijklmno'
templine db 0
tempcol db 0
ttyp db 0
end


View File

@@ -1,34 +0,0 @@
; terminal.lib 2/17/2012 dwg - review for release 1.5.1.0
; terminal.lib 2/11/2012 dwg - review for release 1.5
; terminal.lib 2/07/2012 dwg - review for release 1.5
; terminal.lib 12/25/2011 dwg -
;
;--------------------------
extrn xcrtinit
extrn xcrtlc
extrn xcrtclr
crtinit macro
enter
call xcrtinit
leave
endm
;--------------------------
; Clear the CRT Screen using the appropriate escape sequence by termtype
crtclr macro
enter
call xcrtclr ; call actual routine in terminal.asm
leave
endm
;--------------------------
crtlc macro line,column
enter
mvi h,line ; load 1st positional parameter into reg
mvi l,column ; load 2nd positional parameter into reg
call xcrtlc ; call actual routine in terminal.asm
leave
endm
;--------------------------
; eof - terminal.lib


View File

@@ -1,146 +0,0 @@
/* termtype.c 7/21/2012 dwg - */
#include "stdio.h"
#include "applvers.h"
#include "infolist.h"
#include "cnfgdata.h"
#include "syscfg.h"
#include "diagnose.h"
#include "asmiface.h"
#include "cpmbdos.h"
#include "cpmbios.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 PUTSYSCFG 0x0F100 /* HBIOS function for Put System Configuration */
struct SYSCFG * pSYSCFG = HIGHSEG;
#define TTY 0
#define ANSI 1
#define WYSE 2
#define VT52 3
char bRun = 1;
char c;
char newtt = -1;
char tt;
int i;
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 */
for(i=0;i<25;i++) printf("\n");
printf(
"TERMTYPE.COM %d/%d/%d %d.%d.%d.%d dwg - Display/Change Terminal Type\n",
A_MONTH,A_DAY,A_YEAR,A_RMJ,A_RMN,A_RUP,A_RTP);
while(1 == bRun) {
printf("\nThe Terminal Type is ");
tt = pSYSCFG->cnfgdata.termtype;
switch(tt) {
case 0:
printf(" TTY, Options: a(nsi), w(yse), v(t52), q(uit) ?");
break;
case 1:
printf("ANSI, Options: t(ty), w(yse), v(t52), q(uit) ?");
break;
case 2:
printf("WYSE, Options: t(ty), a(nsi), v(t52), q(uit) ?");
break;
case 3:
printf("VT52, Options: t(ty), a(nsi), w(yse), q(uit) ?");
break;
default:
printf("Unknown, Options: ");
printf("t(ty), a(nsi), w(yse), v(t52), q(uit) ?");
break;
};
asmif(BDOS,1,0,0);
c = xrega;
if('q' == c) {
bRun = 0;
}
if('x' == c) {
bRun = 0;
}
if('Q' == c) {
bRun = 0;
}
if('X' == c) {
bRun = 0;
}
switch(tt) {
case TTY:
switch(c) {
case 'a':
case 'A': newtt=ANSI; break;
case 'w':
case 'W': newtt=WYSE; break;
case 'v':
case 'V': newtt=VT52; break;
};
break;
case ANSI:
switch(c) {
case 't':
case 'T': newtt=TTY; break;
case 'w':
case 'W': newtt=WYSE; break;
case 'v':
case 'V': newtt=VT52; break;
};
break;
case WYSE:
switch(c) {
case 't':
case 'T': newtt=TTY; break;
case 'a':
case 'A': newtt=ANSI; break;
case 'v':
case 'V': newtt=VT52; break;
};
break;
case VT52:
switch(c) {
case 't':
case 'T': newtt=TTY; break;
case 'a':
case 'A': newtt=ANSI; break;
case 'w':
case 'W': newtt=WYSE; break;
};
break;
default:
printf("%c",7);
break;
}
if(255 != newtt) {
pSYSCFG->cnfgdata.termtype = newtt;
hregbc = PUTSYSCFG;
hregde = HIGHSEG;
diagnose();
}
}
}


View File

@@ -1,325 +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[];
{
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(
"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 */
}


View File

@@ -1,50 +0,0 @@
/* lookn8.c 8/30/2012 dwg - look at n8 hardware */
#include "stdio.h"
#include "std21.h"
/*
int in(unsigned int address);
int out(unsigned int address,int data);
*/
#define BASE 128
#define DATAP (BASE+24)
#define CMDP (BASE+25)
int main(argc,argv)
int argc;
char *argv[];
{
/*
#define N8_IOBASE 0x80
#define PIO2 (N8_IOBASE+4)
#define PIO2A PIO2
#define PIO2B (PIO2+1)
#define PIO2C (PIO2+2)
#define PIO2X (PIO2+3)
#define RTC (N8_IOBASE+8)
#define ACR (N8_IOBASE+0x14)
#define RMAP (N8_IOBASE+0x16)
#define VDP (N8_IOBASE+0x18)
#define PSG (N8_IOBASE+0x1c)
*/
printf("N8_IOBASE is 0x%04x\n",N8_IOBASE);
printf("RTC is 0x%04x value is 0x%2x\n",RTC,in(RTC));
printf("ACR is 0x%04x\n",ACR);
printf("RMAP is 0x%04x\n",RMAP);
printf("VDP is 0x%04x\n",VDP);
printf("PSG is 0x%04x\n",PSG);
}

NN

View File

@@ -1,36 +0,0 @@
/* testv5.c 8/30/2012 dwg - derived from Wayne's TESTV5.BAS */
/* Simple VIDEO test for N8; I/O Base assumed as 128 */
#include "tms9918.h"
int main(argc,argv)
int argc;
char *argv[];
{
int i;
vdp_clr16k();
vdp_setregs();
vdp_modes();
vdp_pnt();
vdp_pgt();
vdp_colors();
vdp_load_set450();
/* vdp_clr_regen(); */
/* vdp_fill(); */
/* vdp_num_regen(); */
/* vdp_clr_regen(); */
/* vdp_sync_regen(); */
vdp_write_ram(40);
for(i=0;i<40;i++) {
out(DATAP,i);
}
func700();
/* vdp_display(); */
}


View File

@@ -1,31 +0,0 @@
/* testv6.c 8/30/2012 dwg - derived from Wayne's TESTV5.BAS */
/* Test methods for controlling TMS9918 Video Functions */
#include "tms9918.h"
int main(argc,argv)
int argc;
char *argv[];
{
vdp_clr16k();
vdp_setregs();
vdp_modes();
vdp_pnt();
vdp_pgt();
vdp_colors();
vdp_load_set450();
/* vdp_clr_regen(); */
vdp_fill();
/* vdp_num_regen(); */
/* vdp_clr_regen(); */
/* vdp_sync_regen(); */
func700();
/* vdp_display(); */
}


View File

@@ -1,362 +0,0 @@
/* tms9918.c 9/12/2012 dwg - information from TI Docs */
/* http://www1.cs.columbia.edu/~sedwards/papers/TMS9918.pdf */
/* TMS9918 Modes:
Graphics I
Graphics Mode I provides 256x192 pixel display for generating
pattern graphics in 15 colors plus transparent.
Graphics II
Graphics mode II is an enhancement of Graphics Mode I, allowing
it to generate more complex color and pattern displays.
Multicolor
The Muylticolor mode provides an unrestricted 64x48
color-dot display employing 15 colors plus transparent.
Text Mode
The Text Mode provides twenty-four 40-character in two colors
and is intended to maximize the capacity of the TV screen to
display alphanumeric characters. (24 lines of forty blocks (each 8x8).
*/
#include "applvers.h"
#include "n8chars.h"
/*
#define DEBUG
*/
#define WIDTH 37
#define HEIGHT 24
#define GUTTER 3
#define BASE 128
#define DATAP (BASE+24)
#define CMDP (BASE+25)
#define WO_R0
#define WOR0B6
#define VDP_TRANSPARENT 0
#define VDP_BLACK 1
#define VDP_MED_GREEN 2
#define VDP_LGREEN 3
#define VDP_DBLUE 4
#define VDP_LBLUE 5
#define VDP_DRED 6
#define VDP_CYAN 7
#define VDP_MRED 8
#define VDP_LRED 9
#define VDP_DYELLOW 10
#define VDP_LYELLOW 11
#define VDP_DGREEN 12
#define VDP_MAGENTA 13
#define VDP_GRAY 14
#define VDP_WHITE 15
#define SINGLE 11
#define TRIPLE 0
char style; /* can be SINGLE or TRIPPLE */
unsigned char vdp_regen[24*40];
void vdp_read()
{
char c,v;
for(c=0;c<17;c++) {
v = in(DATAP);
printf("0x2x ",v);
}
}
void vdp_display(line,column,string)
int line;
int column;
char * string;
{
char index;
vdp_wrvram(GUTTER+(line*40)+column);
for(index=0;index<strlen(string);index++) {
out(DATAP,string[index]);
}
}
void vdp_pad(line,column,string)
int line;
int column;
char * string;
{
char index;
vdp_wrvram(GUTTER+(line*40)+column);
for(index=0;index<strlen(string);index++) {
out(DATAP,string[index]);
}
if(40>strlen(string)) {
for(index=strlen(string);index<40;index++) {
out(DATAP,' ');
}
}
}
void vdp_hz_join(line)
int line;
{
char i;
char szTemp[2];
sprintf(szTemp,"%c",0x8a+style);
for(i=1;i<WIDTH-1;i++) {
vdp_display(line,i,szTemp);
}
sprintf(szTemp,"%c",0x88+style);
vdp_display(line,0,szTemp);
sprintf(szTemp,"%c",0x89+style);
vdp_display(line,WIDTH-1,szTemp);
}
void vdp_main_frame(name)
char * name;
{
char i;
char szTemp[48];
sprintf(szTemp,"%c",0x81+style);
for(i=1;i<WIDTH-1;i++) {
vdp_display(0,i,szTemp);
}
sprintf(szTemp,"%c",0x85+style);
for(i=1;i<WIDTH-1;i++) {
vdp_display(HEIGHT-1,i,szTemp);
}
sprintf(szTemp,"%c",0x87+style);
for(i=1;i<HEIGHT-1;i++) {
vdp_display(i,0,szTemp);
}
sprintf(szTemp,"%c",0x83+style);
for(i=1;i<HEIGHT-1;i++) {
vdp_display(i,WIDTH-1,szTemp);
}
sprintf(szTemp,"%c",0x80+style);
vdp_display(0,0,szTemp);
sprintf(szTemp,"%c",0x82+style);
vdp_display(0,WIDTH-1,szTemp);
sprintf(szTemp,"%c",0x84+style);
vdp_display(HEIGHT-1,WIDTH-1,szTemp);
sprintf(szTemp,"%c",0x86+style);
vdp_display(HEIGHT-1,0,szTemp);
sprintf(szTemp,"%s %d/%d/%d Ver %d.%d.%d",
name,A_MONTH,A_DAY,A_YEAR,A_RMJ,A_RMN,A_RUP);
vdp_display(1,(WIDTH-strlen(szTemp))/2,szTemp);
vdp_hz_join(2);
vdp_hz_join(HEIGHT-3);
}
void vdp_clr16k()
{
unsigned int a;
#ifdef DEBUG
printf("Let's set VDP write address to #0000 \n");
#endif
out(CMDP,0); /* 0x00 - a6 a7 a8 a9 a10 a11 a12 a13 - all zeroes */
out(CMDP,64); /* 0x40 - 01 a0 a1 a2 a3 a4 a5 - all zeroes */
#ifdef DEBUG
printf("Now let's clear first 16Kb of VDP memory\n");
#endif
for(a=0;a<16384;a++) {
out(DATAP,0);
}
}
void vdp_setregs()
{
#ifdef DEBUG
printf("Now it's time to set up VDP registers\n");
#endif
out(CMDP,0); /* 0x00 - 000000 - 0 M3 M3 of 0 required text mode */
/* 0 EX EX of 0 disables extVDP inp */
out(CMDP,128); /* 0x80 - 1 0000 000 - reg 0 */
}
void vdp_modes()
{
#ifdef DEBUG
printf("Select 40 column mode, ");
printf("enable screen and disable vertical interrupt\n");
#endif
out(CMDP,80); /* 0x50 - 0101 0000 - 0 4/16K Select 4027 RAM operation */
/* 1 BLANK Enables the active display */
/* 0 IE Disables VDP interrupt */
/* 1 M1 M1 of 1 is required for text mode */
/* 0 M2 M2 of zero is required for text mode */
/* 0 n/a */
/* 0 SIZE 0 sprites 8x8 */
/* 0 MAG 0 sprites 2X */
out(CMDP,129); /* 0x81 - 1 0000 001 - reg 1 */
}
void vdp_pnt()
{
#ifdef DEBUG
printf("Set pattern name table to #0000\n");
#endif
out(CMDP,0); /* 0x00 - 0000 0000 - name table base addr 0 */
out(CMDP,130); /* 0x82 - 1 0000 010 - reg 2 */
}
void vdp_pgt()
{
#ifdef DEBUG
printf("Set pattern generator table to #800\n");
#endif
out(CMDP,1); /* 0x01 - 00000 001 - pattern generator base addr 1 */
out(CMDP,132); /* 0x84 - 1 0000 100 - reg 4 */
}
void vdp_colors()
{
#ifdef DEBUG
printf("Set colors to white on black\n");
#endif
out(CMDP,240); /* 0xF0 - 1111 0000 - (text=1111 bkgd=0000 */
out(CMDP,135); /* 0x87 - 1 0000 111 - reg 7 */
}
void vdp_load_set()
{
int c,d,index;
#ifdef DEBUG
printf("Let's set VDP write address to #800 so ");
printf("that we can write character set to memory\n");
#endif
out(CMDP,0); /* 0x00 - a6 a7 a8 a9 a10 a11 a12 a13 - all zeroes */
out(CMDP,72); /* 0x48 - 01 a0=0 a1=0 a2=1 a3=0 a4=0 a5=0 */
/* a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 */
/* 0 0 0 1 0 0 0 0 0 0 0 0 0 0 */
/* 000 1000 0000 0000 */
#ifdef DEBUG
printf("Create a character set\n");
#endif
index=0;
for(c=0;c<256;c++) {
for(d=0;d<8;d++) {
out(DATAP,charset[index++]);
}
}
}
void vdp_fill()
{
int c;
char d;
#ifdef DEBUG
printf("Let's set write address to start of name table\n");
#endif
out(CMDP,0);
out(CMDP,64); /* 0x40 */
#ifdef DEBUG
printf("Let's put characters to screen\n");
#endif
d = 0;
for(c=0;c<(40*24);c++) {
out(DATAP,d);
d++;
if(128 == d) d=0;
}
}
void vdp_sync_vdp_regen()
{
int c,d;
#ifdef DEBUG
printf("Let's set write address to start of name table\n");
#endif
out(CMDP,0);
out(CMDP,64); /* 0x40 */
#ifdef DEBUG
printf("Let's put characters to screen\n");
#endif
d = 0;
for(c=0;c<(40*24);c++) {
out(DATAP,vdp_regen[c]);
}
}
void func700()
{
out(CMDP,0);
out(CMDP,0);
}
void vdp_clr_vdp_regen()
{
unsigned int index;
for(index=0;index<(24*40);index++) {
vdp_regen[index] = ' ';
}
}
void vdp_set_vdp_regen()
{
unsigned int index;
for(index=0;index<40*24;index++) {
vdp_regen[index]=index&0x7f;
}
}
void vdp_num_vdp_regen()
{
unsigned int index;
for(index=0;index<40*24;index++) {
vdp_regen[index]=0x30+(index%10);
}
}
vdp_wrvram(o)
{
unsigned char byte1;
unsigned char byte2;
byte1 = o & 255;
byte2 = (o >> 8) | 0x40;
out(CMDP,byte1);
out(CMDP,byte2);
}
/* eof - tms9918.c */


View File

@@ -1,64 +0,0 @@
/* tms9918.h 9/11/2012 dwg - information from TI Docs */
/* http://www1.cs.columbia.edu/~sedwards/papers/TMS9918.pdf */
extern void vdp_read();
extern void vdp_display();
extern void vdp_pad();
extern void vdp_hz_join();
extern void vdp_main_frame();
extern void vdp_clr16k();
extern void vdp_setregs();
extern void vdp_modes();
extern void vdp_pnt();
extern void vdp_pgt();
extern void vdp_colors();
extern void vdp_load_set();
extern void vdp_fill();
extern void vdp_sync_vdp_regen();
extern void func700();
extern void vdp_clr_vdp_regen();
extern void vdp_set_vdp_regen();
extern void vdp_num_vdp_regen();
extern vdp_wrvram();
/*
#define DEBUG
*/
#define WIDTH 37
#define HEIGHT 24
#define GUTTER 3
#define BASE 128
#define DATAP (BASE+24)
#define CMDP (BASE+25)
#define WO_R0
#define WOR0B6
#define VDP_TRANSPARENT 0
#define VDP_BLACK 1
#define VDP_MED_GREEN 2
#define VDP_LGREEN 3
#define VDP_DBLUE 4
#define VDP_LBLUE 5
#define VDP_DRED 6
#define VDP_CYAN 7
#define VDP_MRED 8
#define VDP_LRED 9
#define VDP_DYELLOW 10
#define VDP_LYELLOW 11
#define VDP_DGREEN 12
#define VDP_MAGENTA 13
#define VDP_GRAY 14
#define VDP_WHITE 15
#define SINGLE 11
#define TRIPLE 0
char style; /* can be SINGLE or TRIPPLE */
unsigned char vdp_regen[24*40];
/* eof - tms9918.h */


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