aboutsummaryrefslogtreecommitdiffstats
path: root/addon
diff options
context:
space:
mode:
Diffstat (limited to 'addon')
-rw-r--r--addon/sb_busmon/README.md1
-rw-r--r--addon/sb_frt_pnl/frontpanel.bas104
-rw-r--r--addon/sb_rtc/clock.bas53
-rw-r--r--addon/sb_vfd/vfd.bas35
-rw-r--r--addon/sb_vfd/vfd_clock.bas88
5 files changed, 281 insertions, 0 deletions
diff --git a/addon/sb_busmon/README.md b/addon/sb_busmon/README.md
new file mode 100644
index 0000000..cd3f5d4
--- /dev/null
+++ b/addon/sb_busmon/README.md
@@ -0,0 +1 @@
+[Z80 Retrocomputing 3 - Bus Monitor Board](http://www.smbaker.com/z80-retrocomputing-3-bus-monitor-board)
diff --git a/addon/sb_frt_pnl/frontpanel.bas b/addon/sb_frt_pnl/frontpanel.bas
new file mode 100644
index 0000000..215f0e7
--- /dev/null
+++ b/addon/sb_frt_pnl/frontpanel.bas
@@ -0,0 +1,104 @@
+1 REM clock.bas
+2 REM by Scott Baker, http://www.smbaker.com/
+3 REM Demonstrates use of BQ4845 RTC and TIL311 FrontPanel Board
+
+5 REM set 24-hour mode
+6 OUT &HCE, 2
+
+10 LS=999
+20 MD=1
+30 CTR=0
+40 ADDR=0
+
+100 x=INP(4)
+110 if (x and 1)=1 THEN MD=1
+120 if (x and 2)=2 THEN CTR=0 : MD=2
+130 if (x and 4)=4 THEN ADDR=0 : MD=3
+140 if (x and 8)=8 THEN MD=4
+
+199 REM MD=1 is clock
+200 IF MD<>1 GOTO 300
+210 GOSUB 1000
+215 D=0
+220 if (LS = S) GOTO 100
+230 LS = S
+240 GOSUB 2000
+250 GOTO 100
+
+299 REM MD=2 is counter
+300 IF MD<>2 GOTO 400
+310 I=CTR
+320 J=0
+330 GOSUB 2200
+340 CTR=CTR+1
+350 GOTO 100
+
+399 REM MD=3 is dump
+400 IF MD<>3 GOTO 500
+410 J=ADDR
+420 I=PEEK(ADDR)
+430 GOSUB 2300
+440 ADDR=ADDR+1
+450 GOTO 100
+
+399 REM MD=4 is feedface
+500 IF MD<>4 GOTO 600
+510 OUT 0, &HFE
+520 OUT 1, &HED
+530 OUT 2, &HFA
+540 OUT 3, &HCE
+550 GOTO 100
+
+600 GOTO 100
+
+998 REM read the current time from the RTC
+999 REM store it in the variables H, M, S.
+1000 X=inp(&HC0)
+1010 S=(X and 15) + INT(X/16)*10
+1020 X=inp(&HC2)
+1030 M=(X and 15) + INT(X/16)*10
+1040 X=inp(&HC4)
+1050 H=(X and 15) + (INT(X/16) and 3)*10
+1060 RETURN
+
+1999 REM print (D, H, M, S) on front panel
+2000 TS=INT(S/10)
+2010 OS=S-(TS*10)
+2020 OUT &H03, TS*16 + OS
+2030 TM=INT(M/10)
+2040 OM=M-(TM*10)
+2050 OUT &H02, TM*16 + OM
+2060 TH=INT(H/10)
+2070 OH=H-(TH*10)
+2080 OUT &H01, TH*16 + OH
+2090 TD=INT(D/10)
+2100 OD=D-(TD*10)
+2100 OUT &H00, TD*16 + OD
+2110 RETURN
+
+2199 REM print 16-bit integers (J,I) on front panel in decimal
+2200 D=INT(J/100)
+2210 H=J-(D*100)
+2220 M=INT(I/100)
+2230 S=I-(M*100)
+2240 GOSUB 2000
+2250 RETURN
+
+2299 REM print 16-bit integers (J,I) on front panel in hex
+2300 OUT 0, INT(J/256)
+2310 OUT 1, J-INT(J/256)*256
+2320 OUT 2, INT(I/256)
+2330 OUT 3, I-INT(I/256)*256
+2340 RETURN
+
+2999 REM set the clock using H, M, S
+3000 TS=INT(S/10)
+3010 OS=S-(TS*10)
+3020 OUT &HC0, TS*16 + OS
+3030 TM=INT(M/10)
+3040 OM=M-(TM*10)
+3050 OUT &HC2, TM*16 + OM
+3060 TH=INT(H/10)
+3070 OH=H-(TH*10)
+3080 OUT &HC4, TH*16 + OH
+3090 RETURN
diff --git a/addon/sb_rtc/clock.bas b/addon/sb_rtc/clock.bas
new file mode 100644
index 0000000..d9671d7
--- /dev/null
+++ b/addon/sb_rtc/clock.bas
@@ -0,0 +1,53 @@
+1 REM clock.bas
+2 REM by Scott Baker, http://www.smbaker.com/
+3 REM Demonstrates use of BQ4845 RTC on Z80 RC2014 computer
+
+5 REM set 24-hour mode
+6 OUT &HCE, 2
+
+10 LS=999
+20 GOSUB 1000
+30 if (LS = S) GOTO 100
+40 LS = S
+50 GOSUB 2000
+60 print T$
+70 REM for the display board, output seconds on the LEDs
+80 OUT 0, S
+100 GOTO 20
+
+998 REM read the current time from the RTC
+999 REM store it in the variables H, M, S.
+1000 X=inp(&HC0)
+1010 S=(X and 15) + INT(X/16)*10
+1020 X=inp(&HC2)
+1030 M=(X and 15) + INT(X/16)*10
+1040 X=inp(&HC4)
+1050 H=(X and 15) + (INT(X/16) and 3)*10
+1060 RETURN
+
+1999 REM format H, M, S into a string T$
+2000 T$=""
+2010 if (H>9) GOTO 2030
+2020 T$=T$+"0"
+2030 T$=T$+right$(str$(H),len(str$(H))-1)
+2040 T$=T$+":"
+2050 if (M>9) GOTO 2070
+2060 T$=T$+"0"
+2070 T$=T$+right$(str$(M),len(str$(M))-1)
+2080 T$=T$+":"
+2090 if (S>9) GOTO 2110
+2100 T$=T$+"0"
+2110 T$=T$+right$(str$(S),len(str$(S))-1)
+2120 RETURN
+
+2999 REM set the clock using H, M, S
+3000 TS=INT(S/10)
+3010 OS=S-(TS*10)
+3020 OUT &HC0, TS*16 + OS
+3030 TM=INT(M/10)
+3040 OM=M-(TM*10)
+3050 OUT &HC2, TM*16 + OM
+3060 TH=INT(H/10)
+3070 OH=H-(TH*10)
+3080 OUT &HC4, TH*16 + OH
+3090 RETURN
diff --git a/addon/sb_vfd/vfd.bas b/addon/sb_vfd/vfd.bas
new file mode 100644
index 0000000..aed987c
--- /dev/null
+++ b/addon/sb_vfd/vfd.bas
@@ -0,0 +1,35 @@
+10 GOSUB 4000 : REM initialize
+20 GOSUB 4100 : REM cursor off
+30 T$ = "Hello, World"
+40 GOSUB 4500 : REM print string
+
+999 GOTO 999
+
+4000 OUT 0, &H30 : REM function set - 8 bit
+4010 OUT 1, 0 : REM max brightness
+4020 OUT 0, 1 : REM clear display
+4030 OUT 0, &H0F : REM display on, cursor on, blink on
+4040 RETURN
+
+4099 REM turn cursor off
+4100 OUT 0, &H0C : REM display on, cursor off
+4110 RETURN
+
+4199 REM turn cursor on
+4200 OUT 0, &H0F : REM display on, cursor on, blin on
+4210 RETURN
+
+4299 REM clear screen
+4300 OUT 0, 1
+4310 RETURN
+
+4399 REM goto X, Y
+4400 DA = &H80 + (&H40 * Y) + X
+4410 OUT 0, DA
+4420 RETURN
+
+4499 REM print string
+4500 FOR I=1 to LEN(T$)
+4510 OUT 1, ASC(MID$(T$, I, 1))
+4520 NEXT I
+4530 RETURN
diff --git a/addon/sb_vfd/vfd_clock.bas b/addon/sb_vfd/vfd_clock.bas
new file mode 100644
index 0000000..401a4ea
--- /dev/null
+++ b/addon/sb_vfd/vfd_clock.bas
@@ -0,0 +1,88 @@
+1 REM clock.bas
+2 REM by Scott Baker, http://www.smbaker.com/
+3 REM Demonstrates use of BQ4845 RTC on Z80 RC2014 computer
+4 REM with VFD display.
+
+5 REM set 24-hour mode
+6 OUT &HCE, 2
+
+7 GOSUB 4000 : REM initialize VFD
+8 GOSUB 4100 : REM VFD cursor off
+9 T$="RC2014 VFD Clock"
+10 GOSUB 4500 : REM VFD print string
+
+15 LS=999
+20 GOSUB 1000 : REM get time
+
+30 if (LS = S) GOTO 100
+40 LS = S
+50 GOSUB 2000
+60 X=4 : Y=1 : GOSUB 4400 : REM goto line 2
+70 GOSUB 4500
+100 GOTO 20
+
+998 REM read the current time from the RTC
+999 REM store it in the variables H, M, S.
+1000 X=inp(&HC0)
+1010 S=(X and 15) + INT(X/16)*10
+1020 X=inp(&HC2)
+1030 M=(X and 15) + INT(X/16)*10
+1040 X=inp(&HC4)
+1050 H=(X and 15) + (INT(X/16) and 3)*10
+1060 RETURN
+
+1999 REM format H, M, S into a string T$
+2000 T$=""
+2010 if (H>9) GOTO 2030
+2020 T$=T$+"0"
+2030 T$=T$+right$(str$(H),len(str$(H))-1)
+2040 T$=T$+":"
+2050 if (M>9) GOTO 2070
+2060 T$=T$+"0"
+2070 T$=T$+right$(str$(M),len(str$(M))-1)
+2080 T$=T$+":"
+2090 if (S>9) GOTO 2110
+2100 T$=T$+"0"
+2110 T$=T$+right$(str$(S),len(str$(S))-1)
+2120 RETURN
+
+2999 REM set the clock using H, M, S
+3000 TS=INT(S/10)
+3010 OS=S-(TS*10)
+3020 OUT &HC0, TS*16 + OS
+3030 TM=INT(M/10)
+3040 OM=M-(TM*10)
+3050 OUT &HC2, TM*16 + OM
+3060 TH=INT(H/10)
+3070 OH=H-(TH*10)
+3080 OUT &HC4, TH*16 + OH
+3090 RETURN
+
+4000 OUT 0, &H30 : REM function set - 8 bit
+4010 OUT 1, 0 : REM max brightness
+4020 OUT 0, 1 : REM clear display
+4030 OUT 0, &H0F : REM display on, cursor on, blink on
+4040 RETURN
+
+4099 REM turn cursor off
+4100 OUT 0, &H0C : REM display on, cursor off
+4110 RETURN
+
+4199 REM turn cursor on
+4200 OUT 0, &H0F : REM display on, cursor on, blin on
+4210 RETURN
+
+4299 REM clear screen
+4300 OUT 0, 1
+4310 RETURN
+
+4399 REM goto X, Y
+4400 DA = &H80 + (&H40 * Y) + X
+4410 OUT 0, DA
+4420 RETURN
+
+4499 REM print string
+4500 FOR I=1 to LEN(T$)
+4510 OUT 1, ASC(MID$(T$, I, 1))
+4520 NEXT I
+4530 RETURN