mirror of https://github.com/wwarthen/RomWBW.git
30 changed files with 1784 additions and 1473 deletions
@ -0,0 +1,274 @@ |
|||||
|
========================== |
||||
|
HBIOS Management Functions |
||||
|
========================== |
||||
|
|
||||
|
GET ($05): |
||||
|
BC=Function/Subfunction A=Result |
||||
|
|
||||
|
Subfunctions: |
||||
|
|
||||
|
CIOCNT ($00): |
||||
|
BC=Function/Subfunction A=Result |
||||
|
E=Serial Unit Count |
||||
|
|
||||
|
DIOCNT ($10): |
||||
|
BC=Function/Subfunction A=Result |
||||
|
E=Disk Unit Count |
||||
|
|
||||
|
BIOSVER ($F0): |
||||
|
BC=Function/Subfunction A=Result |
||||
|
DE=BIOS Version |
||||
|
L=Platform |
||||
|
|
||||
|
SET ($06): |
||||
|
BC=Function/Subfunction A=Result |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
================ |
||||
|
Serial Functions |
||||
|
================ |
||||
|
|
||||
|
IN ($00): |
||||
|
BC=Function/Unit A=Result |
||||
|
E=Byte Input |
||||
|
|
||||
|
Wait for a single character to be available at the specified device and return the character in E. Function |
||||
|
will wait indefinitely for a character to be available. |
||||
|
|
||||
|
OUT ($01): |
||||
|
BC=Function/Unit A=Result |
||||
|
E=Character to Output |
||||
|
|
||||
|
Wait for device/unit to be ready to send a character, then send the character specified in E. |
||||
|
|
||||
|
IST ($02): |
||||
|
BC=Function/Unit A=Result |
||||
|
*E=# Bytes Pending |
||||
|
|
||||
|
OST ($03): |
||||
|
BC=Function/Unit A=Result |
||||
|
*E=# Buffer Bytes Available |
||||
|
|
||||
|
INIT ($04): |
||||
|
BC=Function/Unit A=Result |
||||
|
DE=Line Characteristics |
||||
|
|
||||
|
QUERY ($05) |
||||
|
BC=Function/Unit A=Result |
||||
|
DE=Line Characteristics |
||||
|
|
||||
|
DEVICE ($06): |
||||
|
BC=Function/Unit A=Result |
||||
|
D=Device Type |
||||
|
E=Physical Unit |
||||
|
|
||||
|
============== |
||||
|
Disk Functions |
||||
|
============== |
||||
|
|
||||
|
STATUS ($10): |
||||
|
BC=Function/Unit A=Result |
||||
|
|
||||
|
Return current status result code of specified unit. Does not clear |
||||
|
the status. |
||||
|
|
||||
|
RESET ($11): |
||||
|
BC=Function/Unit A=Result |
||||
|
|
||||
|
Reset the physical interface associated with the specified unit. Flag all units |
||||
|
associated with the interface for unit initialization at next I/O call. Clear |
||||
|
media identified unless locked. Reset result code of all associated units. |
||||
|
|
||||
|
SEEK ($12): |
||||
|
BC=Function/Unit A=Result |
||||
|
D:7=Address Type (0=CHS, 1=LBA) |
||||
|
CHS: D:0-6=Head,E=Sector,HL=Track |
||||
|
LBA: DE:HL |
||||
|
|
||||
|
Update target CHS or LBA for next I/O request on designated unit. |
||||
|
Physical seek is typically deferred until subsequent I/O operation. |
||||
|
|
||||
|
READ ($13) / WRITE ($14) / VERIFY ($15): |
||||
|
BC=Function/Unit A=Result |
||||
|
HL=Buffer Address |
||||
|
E=Block Count |
||||
|
|
||||
|
Read, write, or verify sectors starting at current target sector. Current |
||||
|
target sector is incremented on each successful operation. On error, |
||||
|
target sector is sector where error occurred. |
||||
|
|
||||
|
FORMAT ($16): |
||||
|
BC=Function/Unit A=Result |
||||
|
CHS: D=Head, HL=Cylinder |
||||
|
E=Fill Byte |
||||
|
|
||||
|
Format the designated track using the current media_id. Many devices |
||||
|
do not support a true format operation. If so, format should write |
||||
|
sectors with designated fill byte. |
||||
|
|
||||
|
*** Need to specify interleave/sector id's somehow. |
||||
|
|
||||
|
DEVICE ($17) |
||||
|
BC=Function/Unit A=Result |
||||
|
D=Device Type |
||||
|
E=Physical Unit |
||||
|
|
||||
|
Report the device type (Floppy, IDE, SD, etc.) and physical unit number. Call |
||||
|
does not perform any I/O and succeeds even if the device is in an error state. |
||||
|
It does not reset the unit status. |
||||
|
|
||||
|
MEDIA ($18): |
||||
|
BC=Function/Unit A=Result |
||||
|
E0:=Enable Media Discovery E=Media ID (legacy) |
||||
|
|
||||
|
Report the media definition for media in specified unit. If bit 0 of E is |
||||
|
set, then perform media discovery or verification. If no media in device, |
||||
|
return no media error. |
||||
|
|
||||
|
DEFMED ($19): |
||||
|
BC=Function/Unit A=Result |
||||
|
E=Media ID (legacy) |
||||
|
|
||||
|
Define media in unit. |
||||
|
|
||||
|
CAPACITY ($1A): |
||||
|
BC=Function/Unit DE:HL=Blocks on Device |
||||
|
BC=Block Size |
||||
|
A=Result |
||||
|
|
||||
|
Return device capacity information. |
||||
|
If media is unknown, return error (no media) |
||||
|
|
||||
|
GEOMETRY ($1B): |
||||
|
BC=Function/Unit HL=Cylinders |
||||
|
D:0-6=Heads |
||||
|
D:7=LBA Capable |
||||
|
E=Sectors |
||||
|
BC=Block Size |
||||
|
A=Result |
||||
|
|
||||
|
Return device geometry information. |
||||
|
If media is unknown, return error (no media) |
||||
|
|
||||
|
INFO ($1F): |
||||
|
BC=Function/Sub-function A=Result |
||||
|
|
||||
|
C=0: Report total unit count in system: |
||||
|
BC=Function/Sub-function A=Result |
||||
|
B=Count |
||||
|
|
||||
|
|
||||
|
|
||||
|
A: RAM0 B: ROM0 C: |
||||
|
|
||||
|
|
||||
|
|
||||
|
Unit Device Board Part Slice Cap |
||||
|
------- ------- ------- ------- ------- ------- |
||||
|
#0 RAM MK4 384K |
||||
|
#1 ROM MK4 384K |
||||
|
#2 FD0 DIO3 3.5" DS/HD |
||||
|
#3 IDE0 DIO3 0 8M |
||||
|
|
||||
|
|
||||
|
|
||||
|
Unit 0: RAMDISK on MK4 (384K) |
||||
|
Unit 1: ROMDISK on MK4 (384K) |
||||
|
Unit 2: FD0 on DISKIO3 (3.5") |
||||
|
Unit 3: FD1 on DISKIO3 (5.25") |
||||
|
Unit 4: IDE0 on DISKIO3 (4096M) |
||||
|
|
||||
|
A: RAM0 MK4 RAM Disk, 384K |
||||
|
B: ROM0 MK4 ROM Disk, 384K |
||||
|
C: FD0 DiskIO3 Floppy Disk 0, 3.5" DS/HD |
||||
|
D: FD1 DiskIO3 Floppy Disk 1, 5.25" DS/DD |
||||
|
E: IDE0:0 MK4 IDE Hard Disk 0, Slice 0, 8M |
||||
|
F: IDE0:1 MK4 IDE Hard Disk 0, Slice 1, 8M |
||||
|
G: PRPSD0:0 PropIO SD Card, Slice 0 |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
0: RAM- RAMdrive on the Z180 SBC Mark IV board |
||||
|
LBASupported UserAddressableSectors 832 |
||||
|
|
||||
|
1: ROM- ROMdrive on the Z180 SBC Mark IV board |
||||
|
LBASupported UserAddressableSectors 768 |
||||
|
|
||||
|
2: IDE- SanDisk SDCFHSNJC-004G |
||||
|
s/n: DMZ031215013440 fmw: HDX 7.08 |
||||
|
CHS: 7751:16:63 nSectors 7813008 MaxBlkTransfer 1 |
||||
|
LBASupported UserAddressableSectors 7813120 |
||||
|
|
||||
|
3: IDE- SanDisk SDCFHSNJC-004G |
||||
|
s/n: BKZ031215015432 fmw: HDX 7.08 |
||||
|
CHS: 7751:16:63 nSectors 7813008 MaxBlkTransfer 1 |
||||
|
LBASupported UserAddressableSectors 7813120 |
||||
|
|
||||
|
4: SD- SD SU02G |
||||
|
s/n: 139401536 fmw: 8.0 d/c: 2013-07 |
||||
|
LBASupported UserAddressableSectors 1931264 |
||||
|
|
||||
|
Boot UNA unit number or ROM? [R,X,0..4] (R): |
||||
|
|
||||
|
N8VEM UNA CP/M (Will Sowerbutts, 2014-08-01 git cbed09) |
||||
|
|
||||
|
Unit Disk Driver Capacity Slices Start LBA Flags |
||||
|
0 RAM0 Memory 416.0KB 1 0x00000000 (formatted) |
||||
|
1 ROM0 Memory 384.0KB 1 0x00000000 |
||||
|
2 IDE0 Dual-IDE 3.7GB 469 0x00000000 MBR FGN |
||||
|
3 IDE1 Dual-IDE 3.7GB 469 0x00000000 MBR FGN |
||||
|
4 SD0 CSIO-SD 943.0MB 0 0x00000000 MBR FGN |
||||
|
|
||||
|
Drive A: assigned to RAM0 slice 0 |
||||
|
Drive B: assigned to ROM0 slice 0 |
||||
|
Drive C: assigned to IDE0 slice 0 |
||||
|
Drive D: assigned to IDE1 slice 0 |
||||
|
|
||||
|
Loading Residual CP/M at 0xE100 ... done. |
||||
|
CP/M 2.2 Copyright 1979 (c) by Digital Research |
||||
|
|
||||
|
--- |
||||
|
|
||||
|
<VDA>_INIT: |
||||
|
- ADD OURSELVES TO VDA_TBL |
||||
|
- ADD OURSELVES TO CIO_TBL & RECORD <VDA>_CIOUNIT |
||||
|
- INIT HARDWARE |
||||
|
- GOTO <VDA>_INI |
||||
|
|
||||
|
<VDA>_INI: |
||||
|
- CALL <VDA>_RES |
||||
|
- INITIALIZE EMULATION BY CALLING EMU_INIT (PASS IN C=EMU_TYPE & DE=VDA_DISPATCH ADDRESS) |
||||
|
- EMU_INIT RETURNS ADDRESS OF CIO DISPATCHER ADDRESS FOR SUBSEQUENT FORWARDING |
||||
|
- RECORD EMULATORS CIO DISPATCHER ADDRESS IN <VDA>_CIODISPATCH |
||||
|
|
||||
|
<VDA>_RES: |
||||
|
- RESET HARDWARE |
||||
|
|
||||
|
EMU_INIT: |
||||
|
- CALL <EMU>_INIT BASED ON VALUE IN C |
||||
|
|
||||
|
<EMU>_INIT: |
||||
|
- RECORD DE IN VDA_DISPADR |
||||
|
- INITIALIZE/RESET EMULATION ENGINE |
||||
|
- RETURN EMULATOR CIO DISPATCH ADDRESS IN DE |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
-------------------------- |
||||
|
md |
||||
|
hdsk |
||||
|
rf |
||||
|
ide |
||||
|
sd |
||||
|
ppide |
||||
|
fd |
||||
|
prp |
||||
|
ppp |
||||
@ -0,0 +1,114 @@ |
|||||
|
------------------ |
||||
|
Final Output Files |
||||
|
------------------ |
||||
|
|
||||
|
ROM Output File [512K] -> <config>.rom |
||||
|
setup [32K] romboot? |
||||
|
hbios+hbfill [32K] |
||||
|
OSIMG [32K] |
||||
|
OSIMG [32K] (used as filler) |
||||
|
romdisk - [384K] |
||||
|
|
||||
|
COM Output File -> <config>.com |
||||
|
comldr [varies] appboot? |
||||
|
hbios [varies] |
||||
|
OSIMG [32K] |
||||
|
|
||||
|
IMG Output File -> <config>.img |
||||
|
imgldr [varies] imgboot? |
||||
|
hbios [varies] |
||||
|
OSIMG [32K] |
||||
|
|
||||
|
------------------------- |
||||
|
Intermediate Output Files |
||||
|
------------------------- |
||||
|
|
||||
|
OSIMG [32K] -> osimg.bin |
||||
|
romldr [4K] osldr? |
||||
|
dbgmon [4K] tbasic? |
||||
|
CPM (ccp/bdos/cbios) [12K] |
||||
|
ZSYS (zcpr/zsdos/cbios) [12K] |
||||
|
|
||||
|
CPM [12K] -> cpm.bin |
||||
|
ccp [2K] |
||||
|
bdos [3.5K] |
||||
|
cbios [6.5K] |
||||
|
|
||||
|
ZSYS [12K] -> zsys.bin |
||||
|
zcpr [2K] |
||||
|
zsdos [3.5K] |
||||
|
cbios [6.5K] |
||||
|
|
||||
|
----------------- |
||||
|
Compilation Units |
||||
|
----------------- |
||||
|
|
||||
|
setup.asm -> setup.bin: romboot? |
||||
|
std.asm |
||||
|
ver.inc |
||||
|
hbios.inc |
||||
|
build.inc |
||||
|
<config>.asm |
||||
|
plt_<platform>.inc |
||||
|
hbios.exp |
||||
|
loader boot? |
||||
|
xio |
||||
|
memmgr |
||||
|
|
||||
|
comldr.asm -> comldr.bin: appboot? |
||||
|
std.asm |
||||
|
ver.inc |
||||
|
hbios.inc |
||||
|
build.inc |
||||
|
<config>.asm |
||||
|
plt_<platform>.inc |
||||
|
hbios.exp |
||||
|
loader boot? |
||||
|
xio |
||||
|
memmgr |
||||
|
|
||||
|
imgldr.asm -> imgldr.bin: imgboot? |
||||
|
std.asm |
||||
|
ver.inc |
||||
|
hbios.inc |
||||
|
build.inc |
||||
|
<config>.asm |
||||
|
plt_<platform>.inc |
||||
|
hbios.exp |
||||
|
loader boot? |
||||
|
xio |
||||
|
memmgr |
||||
|
|
||||
|
hbios.bin: |
||||
|
std.asm |
||||
|
ver.inc |
||||
|
hbios.inc |
||||
|
build.inc |
||||
|
<config>.asm |
||||
|
plt_<platform>.inc |
||||
|
<device drivers> |
||||
|
util.asm |
||||
|
time.asm |
||||
|
bcd.asm |
||||
|
dsky.asm |
||||
|
|
||||
|
romldr.asm -> romldr.bin: loader? |
||||
|
std.asm |
||||
|
ver.inc |
||||
|
hbios.inc |
||||
|
build.inc |
||||
|
<config>.asm |
||||
|
plt_<platform>.inc |
||||
|
util.asm |
||||
|
dsky.asm |
||||
|
|
||||
|
dbgmon.asm -> dbgmon.bin: |
||||
|
std.asm |
||||
|
ver.inc |
||||
|
hbios.inc |
||||
|
build.inc |
||||
|
<config>.asm |
||||
|
plt_<platform>.inc |
||||
|
util.asm |
||||
|
memmgr.asm |
||||
|
dsky.asm |
||||
@ -0,0 +1,252 @@ |
|||||
|
; |
||||
|
;================================================================================================== |
||||
|
; DSKY KEYBOARD ROUTINES |
||||
|
;================================================================================================== |
||||
|
; |
||||
|
PPIA .EQU PPIBASE + 0 ; PORT A |
||||
|
PPIB .EQU PPIBASE + 1 ; PORT B |
||||
|
PPIC .EQU PPIBASE + 2 ; PORT C |
||||
|
PPIX .EQU PPIBASE + 3 ; PPI CONTROL PORT |
||||
|
|
||||
|
; |
||||
|
; _____C0______C1______C2______C3__ |
||||
|
;B5 | $20 D $60 E $A0 F $E0 BO |
||||
|
;B4 | $10 A $50 B $90 C $D0 GO |
||||
|
;B3 | $08 7 $48 8 $88 9 $C8 EX |
||||
|
;B2 | $04 4 $44 5 $84 6 $C4 DE |
||||
|
;B1 | $02 1 $42 2 $82 3 $C2 EN |
||||
|
;B0 | $01 FW $41 0 $81 BK $C1 CL |
||||
|
; |
||||
|
KY_0 .EQU 000H |
||||
|
KY_1 .EQU 001H |
||||
|
KY_2 .EQU 002H |
||||
|
KY_3 .EQU 003H |
||||
|
KY_4 .EQU 004H |
||||
|
KY_5 .EQU 005H |
||||
|
KY_6 .EQU 006H |
||||
|
KY_7 .EQU 007H |
||||
|
KY_8 .EQU 008H |
||||
|
KY_9 .EQU 009H |
||||
|
KY_A .EQU 00AH |
||||
|
KY_B .EQU 00BH |
||||
|
KY_C .EQU 00CH |
||||
|
KY_D .EQU 00DH |
||||
|
KY_E .EQU 00EH |
||||
|
KY_F .EQU 00FH |
||||
|
KY_FW .EQU 010H ; FORWARD |
||||
|
KY_BK .EQU 011H ; BACKWARD |
||||
|
KY_CL .EQU 012H ; CLEAR |
||||
|
KY_EN .EQU 013H ; ENTER |
||||
|
KY_DE .EQU 014H ; DEPOSIT |
||||
|
KY_EX .EQU 015H ; EXAMINE |
||||
|
KY_GO .EQU 016H ; GO |
||||
|
KY_BO .EQU 017H ; BOOT |
||||
|
; |
||||
|
;__DSKY_INIT_________________________________________________________________________________________ |
||||
|
; |
||||
|
; CHECK FOR KEY PRESS, SAVE RAW VALUE, RETURN STATUS |
||||
|
;____________________________________________________________________________________________________ |
||||
|
; |
||||
|
DSKY_INIT: |
||||
|
LD A,82H |
||||
|
OUT (PPIX),A |
||||
|
LD A,30H ;disable /CS on PPISD card(s) |
||||
|
OUT (PPIC),A |
||||
|
XOR A |
||||
|
LD (KY_BUF),A |
||||
|
RET |
||||
|
|
||||
|
#IFDEF DSKY_KBD |
||||
|
; |
||||
|
;__KY_STAT___________________________________________________________________________________________ |
||||
|
; |
||||
|
; CHECK FOR KEY PRESS, SAVE RAW VALUE, RETURN STATUS |
||||
|
;____________________________________________________________________________________________________ |
||||
|
; |
||||
|
KY_STAT: |
||||
|
; IF WE ALREADY HAVE A KEY, RETURN WITH NZ |
||||
|
LD A,(KY_BUF) |
||||
|
OR A |
||||
|
RET NZ |
||||
|
; SCAN FOR A KEYPRESS, A=0 NO DATA OR A=RAW BYTE |
||||
|
CALL KY_SCAN ; SCAN KB ONCE |
||||
|
OR A ; SET FLAGS |
||||
|
RET Z ; NOTHING FOUND, GET OUT |
||||
|
LD (KY_BUF),A ; SAVE RAW KEYCODE |
||||
|
RET ; RETURN |
||||
|
; |
||||
|
;__KY_GET____________________________________________________________________________________________ |
||||
|
; |
||||
|
; GET A SINGLE KEY (WAIT FOR ONE IF NECESSARY) |
||||
|
;____________________________________________________________________________________________________ |
||||
|
; |
||||
|
KY_GET: |
||||
|
; SEE IF WE ALREADY HAVE A KEY SAVED, GO TO DECODE IF SO |
||||
|
LD A,(KY_BUF) |
||||
|
OR A |
||||
|
JR NZ,KY_DECODE |
||||
|
; NO KEY SAVED, WAIT FOR ONE |
||||
|
KY_STATLOOP: |
||||
|
CALL KY_STAT |
||||
|
OR A |
||||
|
JR Z,KY_STATLOOP |
||||
|
; DECODE THE RAW VALUE |
||||
|
KY_DECODE: |
||||
|
LD D,00H |
||||
|
LD HL,KY_KEYMAP ; POINT TO BEGINNING OF TABLE |
||||
|
KY_GET_LOOP: |
||||
|
CP (HL) ; MATCH? |
||||
|
JR Z,KY_GET_DONE ; FOUND, DONE |
||||
|
INC HL |
||||
|
INC D ; D + 1 |
||||
|
JR NZ,KY_GET_LOOP ; NOT FOUND, LOOP UNTIL EOT |
||||
|
KY_GET_DONE: |
||||
|
; CLEAR OUT KEY_BUF |
||||
|
XOR A |
||||
|
LD (KY_BUF),A |
||||
|
; RETURN THE INDEX POSITION WHERE THE RAW VALUE WAS FOUND |
||||
|
LD A,D |
||||
|
RET |
||||
|
; |
||||
|
;__KY_SCAN____________________________________________________________________________________________ |
||||
|
; |
||||
|
; SCAN KEYBOARD MATRIX FOR AN INPUT |
||||
|
;____________________________________________________________________________________________________ |
||||
|
; |
||||
|
KY_SCAN: |
||||
|
LD C,0000H |
||||
|
LD A,41H | 30H ; SCAN COL ONE |
||||
|
OUT (PPIC),A ; SEND TO COLUMN LINES |
||||
|
CALL DLY2 ; DEBOUNCE |
||||
|
IN A,(PPIB) ; GET ROWS |
||||
|
AND 7FH ;ignore PB7 for PPISD |
||||
|
CP 00H ; ANYTHING PRESSED? |
||||
|
JR NZ,KY_SCAN_FOUND ; YES, EXIT |
||||
|
|
||||
|
LD C,0040H |
||||
|
LD A,42H | 30H ; SCAN COL TWO |
||||
|
OUT (PPIC),A ; SEND TO COLUMN LINES |
||||
|
CALL DLY2 ; DEBOUNCE |
||||
|
IN A,(PPIB) ; GET ROWS |
||||
|
AND 7FH ;ignore PB7 for PPISD |
||||
|
CP 00H ; ANYTHING PRESSED? |
||||
|
JR NZ,KY_SCAN_FOUND ; YES, EXIT |
||||
|
|
||||
|
LD C,0080H |
||||
|
LD A,44H | 30H ; SCAN COL THREE |
||||
|
OUT (PPIC),A ; SEND TO COLUMN LINES |
||||
|
CALL DLY2 ; DEBOUNCE |
||||
|
IN A,(PPIB) ; GET ROWS |
||||
|
AND 7FH ;ignore PB7 for PPISD |
||||
|
CP 00H ; ANYTHING PRESSED? |
||||
|
JR NZ,KY_SCAN_FOUND ; YES, EXIT |
||||
|
|
||||
|
LD C,00C0H ; |
||||
|
LD A,48H | 30H ; SCAN COL FOUR |
||||
|
OUT (PPIC),A ; SEND TO COLUMN LINES |
||||
|
CALL DLY2 ; DEBOUNCE |
||||
|
IN A,(PPIB) ; GET ROWS |
||||
|
AND 7FH ;ignore PB7 for PPISD |
||||
|
CP 00H ; ANYTHING PRESSED? |
||||
|
JR NZ,KY_SCAN_FOUND ; YES, EXIT |
||||
|
|
||||
|
LD A,040H | 30H ; TURN OFF ALL COLUMNS |
||||
|
OUT (PPIC),A ; SEND TO COLUMN LINES |
||||
|
LD A,00H ; RETURN NULL |
||||
|
RET ; EXIT |
||||
|
|
||||
|
KY_SCAN_FOUND: |
||||
|
AND 3FH ; CLEAR TOP TWO BITS |
||||
|
OR C ; ADD IN ROW BITS |
||||
|
LD C,A ; STORE VALUE |
||||
|
|
||||
|
; WAIT FOR KEY TO BE RELEASED |
||||
|
LD A,4FH | 30H ; SCAN ALL COL LINES |
||||
|
OUT (PPIC),A ; SEND TO COLUMN LINES |
||||
|
CALL DLY2 ; DEBOUNCE |
||||
|
KY_CLEAR_LOOP: ; WAIT FOR KEY TO CLEAR |
||||
|
IN A,(PPIB) ; GET ROWS |
||||
|
AND 7FH ;ignore PB7 for PPISD |
||||
|
CP 00H ; ANYTHING PRESSED? |
||||
|
JR NZ,KY_CLEAR_LOOP ; YES, LOOP UNTIL KEY RELEASED |
||||
|
|
||||
|
LD A,040H | 30H ; TURN OFF ALL COLUMNS |
||||
|
OUT (PPIC),A ; SEND TO COLUMN LINES |
||||
|
|
||||
|
LD A,C ; RESTORE VALUE |
||||
|
RET |
||||
|
; |
||||
|
;_KEYMAP_TABLE_____________________________________________________________________________________________________________ |
||||
|
; |
||||
|
KY_KEYMAP: |
||||
|
; 0 1 2 3 4 5 6 7 |
||||
|
.DB 041H,002H,042H,082H,004H,044H,084H,008H |
||||
|
; 8 9 A B C D E F |
||||
|
.DB 048H,088H,010H,050H,090H,020H,060H,0A0H |
||||
|
; FW BK CL EN DE EX GO BO |
||||
|
.DB 001H,081H,0C1H,0C2H,0C4H,0C8H,0D0H,0E0H |
||||
|
; |
||||
|
#ENDIF ; DSKY_KBD |
||||
|
; |
||||
|
;================================================================================================== |
||||
|
; DSKY HEX DISPLAY |
||||
|
;================================================================================================== |
||||
|
; |
||||
|
DSKY_HEXOUT: |
||||
|
LD B,DSKY_HEXBUFLEN |
||||
|
LD HL,DSKY_BUF |
||||
|
LD DE,DSKY_HEXBUF |
||||
|
DSKY_HEXOUT1: |
||||
|
LD A,(DE) ; FIRST NIBBLE |
||||
|
SRL A |
||||
|
SRL A |
||||
|
SRL A |
||||
|
SRL A |
||||
|
LD (HL),A |
||||
|
INC HL |
||||
|
LD A,(DE) ; SECOND NIBBLE |
||||
|
AND 0FH |
||||
|
LD (HL),A |
||||
|
INC HL |
||||
|
INC DE ; NEXT BYTE |
||||
|
DJNZ DSKY_HEXOUT1 |
||||
|
|
||||
|
LD A,82H ; SETUP PPI |
||||
|
OUT (PPIX),A |
||||
|
CALL DSKY_COFF |
||||
|
LD A,0D0H ; 7218 -> (DATA COMING, HEXA DECODE) |
||||
|
OUT (PPIA),A |
||||
|
CALL DSKY_STROBEC |
||||
|
|
||||
|
LD HL,DSKY_BUF ; POINT TO START OF BUF |
||||
|
LD B,DSKY_BUFLEN ; NUMBER OF DIGITS |
||||
|
LD C,PPIA |
||||
|
DSKY_HEXOUT2: |
||||
|
OUTI |
||||
|
JP Z,DSKY_STROBE ; DO FINAL STROBE AND RETURN |
||||
|
CALL DSKY_STROBE |
||||
|
JR DSKY_HEXOUT2 |
||||
|
|
||||
|
DSKY_STROBEC: |
||||
|
LD A,80H | 30H |
||||
|
JP DSKY_STROBE0 |
||||
|
|
||||
|
DSKY_STROBE: |
||||
|
LD A,00H | 30H ; SET WRITE STROBE |
||||
|
|
||||
|
DSKY_STROBE0: |
||||
|
OUT (PPIC),A ; OUT TO PORTC |
||||
|
CALL DLY2 ; DELAY |
||||
|
DSKY_COFF |
||||
|
LD A,40H | 30H ; SET CONTROL PORT OFF |
||||
|
OUT (PPIC),A ; OUT TO PORTC |
||||
|
; CALL DSKY_DELAY ; WAIT |
||||
|
RET |
||||
|
; |
||||
|
; |
||||
|
; |
||||
|
KY_BUF .DB 0 |
||||
|
DSKY_BUF: .FILL 8,0 |
||||
|
DSKY_BUFLEN .EQU $ - DSKY_BUF |
||||
|
DSKY_HEXBUF .FILL 4,0 |
||||
|
DSKY_HEXBUFLEN .EQU $ - DSKY_HEXBUF |
||||
File diff suppressed because it is too large
Loading…
Reference in new issue