Skip to content

Commit 153c99e

Browse files
authored
Merge pull request #28 from davidgiven/bbcbasic
Add configuration options to BBC Basic to make it work on the ADM3a.
2 parents a86a3f8 + b889245 commit 153c99e

File tree

6 files changed

+160
-21
lines changed

6 files changed

+160
-21
lines changed

arch/brotherop2/build.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ diskimage {
9090
["asm.com"] = "cpmtools+asm",
9191
["copy.com"] = "cpmtools+copy",
9292
["submit.com"] = "cpmtools+submit",
93-
["bbcbasic.com"] = "third_party/bbcbasic+bbcbasic",
93+
["bbcbasic.com"] = "third_party/bbcbasic+bbcbasic_ADM3A",
9494
["qe.com"] = "cpmtools+qe_BROTHEROP2",
9595
["mkfs.com"] = "cpmtools+mkfs",
9696
["rawdisk.com"] = "cpmtools+rawdisk",

arch/kayproii/build.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ diskimage {
5353
["asm.com"] = "cpmtools+asm",
5454
["copy.com"] = "cpmtools+copy",
5555
["submit.com"] = "cpmtools+submit",
56-
["bbcbasic.com"] = "third_party/bbcbasic+bbcbasic",
56+
["bbcbasic.com"] = "third_party/bbcbasic+bbcbasic_ADM3A",
5757
["qe.com"] = "cpmtools+qe_KAYPROII",
5858
},
5959
}

arch/nc200/build.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ diskimage {
8686
["asm.com"] = "cpmtools+asm",
8787
["copy.com"] = "cpmtools+copy",
8888
["submit.com"] = "cpmtools+submit",
89-
["bbcbasic.com"] = "third_party/bbcbasic+bbcbasic",
89+
["bbcbasic.com"] = "third_party/bbcbasic+bbcbasic_ADM3A",
9090
["qe.com"] = "cpmtools+qe_NC200",
9191
["flash.com"] = "arch/nc200/tools+flash",
9292
["mkfs.com"] = "cpmtools+mkfs",

arch/wp2450ds/build.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,14 +198,14 @@ diskimage {
198198
bootfile = { "+bootfile_img" },
199199
map = {
200200
["asm.com"] = "cpmtools+asm",
201-
["bbcbasic.com"] = "third_party/bbcbasic+bbcbasic",
202201
["copy.com"] = "cpmtools+copy",
203202
["dump.com"] = "cpmtools+dump",
204203
["mkfs.com"] = "cpmtools+mkfs",
205204
["rawdisk.com"] = "cpmtools+rawdisk",
206205
["stat.com"] = "cpmtools+stat",
207206
["submit.com"] = "cpmtools+submit",
208207
["-readme.txt"] = "+readme",
208+
["bbcbasic.com"] = "third_party/bbcbasic+bbcbasic_ADM3A",
209209
["qe.com"] = "cpmtools+qe_BROTHER_WP2450DS",
210210
["z8e.com"] = "third_party/z8e+z8e_WP2450DS",
211211
["ted.com"] = "third_party/ted+ted_WP2450DS",
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
; WP2450DS main program.
2+
3+
; This is a completely generic ADM3a machine.
4+
5+
6+
aseg
7+
org 0x100
8+
9+
extrn START
10+
11+
BDOS equ 5
12+
13+
; Initial startup.
14+
15+
jp START
16+
17+
; BYE: exit to CP/M
18+
19+
global BYE
20+
BYE equ 0
21+
22+
; CLRSCN: clears the screen.
23+
24+
global CLRSCN
25+
CLRSCN:
26+
push bc
27+
ld c, 2
28+
ld e, 0x1a
29+
call BDOS
30+
pop bc
31+
ret
32+
33+
; PUTIME: set current time to DE:HL, in centiseconds.
34+
35+
global PUTIME
36+
PUTIME:
37+
ret
38+
39+
; GETIME: return current time in DE:HL, in centiseconds.
40+
41+
global GETIME
42+
GETIME:
43+
ld de, 0
44+
ld hl, 0
45+
ret
46+
47+
; PUTCSR: move to cursor to x=DE, y=HL
48+
49+
global PUTCSR
50+
PUTCSR:
51+
push bc
52+
push de
53+
push hl
54+
ld c, 2
55+
ld e, 0x1b
56+
call BDOS
57+
ld c, 2
58+
ld e, '='
59+
call BDOS
60+
pop hl
61+
ld c, 2
62+
ld a, 32
63+
add l
64+
ld e, a
65+
call BDOS
66+
pop hl
67+
ld c, 2
68+
ld a, 32
69+
add l
70+
ld e, a
71+
call BDOS
72+
pop bc
73+
ret
74+
75+
; GETCSR: return cursor position in x=DE, y=HL
76+
77+
global GETCSR
78+
GETCSR:
79+
ld de, 0
80+
ld hl, 0
81+
ret
82+
83+
; GETKEY: return key with timeout
84+
; HL = time to wait in centiseconds
85+
; Returns C if character recieved, with character in A
86+
; Returns !C if timeout
87+
88+
global GETKEY
89+
GETKEY:
90+
push bc
91+
.1
92+
ld c, 6 ; poll character
93+
ld e, 0xff
94+
call BDOS
95+
or a
96+
jr z, .1 ; repeat if no character
97+
scf ; set carry
98+
pop bc
99+
ret
100+
101+
; Edit key table, which must be at 0x01F4
102+
103+
if $ > 0x1f4
104+
error 'Insufficient space in boot block'
105+
endif
106+
107+
org 0x01f4
108+
defb 80 ;WIDTH
109+
defb 11 ;CURSOR UP
110+
defb 10 ;CURSOR DOWN
111+
defb 'A' and 1FH ;START OF LINE
112+
defb 'E' and 1FH ;END OF LINE
113+
defb 'C' and 1FH ;DELETE TO END OF LINE
114+
defb 7FH ;BACKSPACE & DELETE
115+
defb 'U' AND 1FH ;CANCEL LINE
116+
defb 8 ;CURSOR LEFT
117+
defb 12 ;CURSOR RIGHT
118+
defb 'D' AND 1FH ;DELETE CHARACTER
119+
defb 'F' AND 1FH ;INSERT CHARACTER
120+
121+
if $ != 0x200
122+
error 'Edit block wrong length'
123+
endif
124+
;;
125+
;FIN: END
126+
127+
; vim: ts=8 sw=8 et ft=asm
128+

third_party/bbcbasic/build.lua

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
include "third_party/ld80/build.lua"
22
include "third_party/zmac/build.lua"
33

4-
local srcs = {"cmos", "eval", "exec", "fpp", "main", "patch", "ram", "sorry"}
4+
local VERSIONS = {
5+
"ADM3A",
6+
}
7+
8+
local srcs = {"cmos", "eval", "exec", "fpp", "main", "ram", "sorry"}
59
local generated = {}
610
for _, f in pairs(srcs) do
711
generated[#generated+1] = zmac {
@@ -10,20 +14,27 @@ for _, f in pairs(srcs) do
1014
}
1115
end
1216

13-
ld80 {
14-
name = "bbcbasic",
15-
address = 0x100,
16-
srcs = {
17-
"+patch",
18-
"-P0200",
19-
"+main",
20-
"+exec",
21-
"+eval",
22-
"+fpp",
23-
"+sorry",
24-
"+cmos",
25-
"-P3b00",
26-
"+ram"
27-
}
28-
}
17+
for _, version in ipairs(VERSIONS) do
18+
zmac {
19+
name = "boot_"..version,
20+
srcs = { "./"..version:lower().."/boot.z80" }
21+
}
22+
23+
ld80 {
24+
name = "bbcbasic_"..version,
25+
address = 0x100,
26+
srcs = {
27+
"+boot_"..version,
28+
"-P0200",
29+
"+main",
30+
"+exec",
31+
"+eval",
32+
"+fpp",
33+
"+sorry",
34+
"+cmos",
35+
"-P3b00",
36+
"+ram"
37+
}
38+
}
39+
end
2940

0 commit comments

Comments
 (0)