Skip to content

Commit cb67112

Browse files
authored
Merge pull request #12 from nihirash/update
update
2 parents 914490d + 853a0ab commit cb67112

File tree

231 files changed

+26361
-18
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

231 files changed

+26361
-18
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.vscode
22
*.sys
33
*.lst
4-
*.bak
4+
*.bak
5+
cpm*.dsk
6+
release/

bin/cpm.bin

-7.69 KB
Binary file not shown.

bootstrap/crt.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ mos_fclose: equ $0b
3535
mos_fgetc: equ $0c
3636
mos_fputc: equ $0d
3737
mos_feof: equ $0e
38+
mos_setint: equ $14
3839
mos_uopen: equ $15
3940
mos_uclose: equ $16
4041
mos_ugetc: equ $17
4142
mos_uputc: equ $18
4243
mos_fread: equ $1a
4344
mos_fwrite: equ $1b
4445
mos_flseek: equ $1c
45-
4646
;; File modes
4747
fa_read: equ $01
4848
fa_write: equ $02

bootstrap/drive_emu.inc

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,17 +110,16 @@ fs_init:
110110
ld c, 0
111111
MOSCALL mos_fclose
112112

113+
MOSCALL mos_sysvars
114+
xor a
115+
ld (ix+$28), a
116+
ld ix, (sys_ix)
117+
113118
ld hl, drive
114119
ld c, fa_read+fa_write
115120
MOSCALL mos_fopen
116121
ld (f_handle), a
117122
or a
118-
push af
119-
MOSCALL mos_sysvars
120-
xor a
121-
ld (ix+$28), a
122-
ld ix, (sys_ix)
123-
pop af
124123
ret
125124

126125
fs_seek:

bootstrap/terminal.inc

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ _term_init:
2424
ld a, 7
2525
out0 (REG_FTC), a ; Disable fifo
2626

27-
ld a, 0
27+
xor a
2828
out0 (REG_IER), a ; Disable ints
2929

3030
@wait:
@@ -36,7 +36,7 @@ _term_init:
3636
ret
3737

3838
serial_cfg:
39-
dl 115200
39+
dl 57600
4040
db 8
4141
db 1
4242
db 0
@@ -45,6 +45,9 @@ serial_cfg:
4545

4646
vdu_init:
4747
db 23, 0, 255 ; Switch to terminal emulation
48+
db "CP/M to MOS gate v.1.1", 13, 10
49+
db "2023 (c) Aleksandr Sharikhin", 13, 10
50+
db 13,10
4851
init_end:
4952

5053

@@ -55,21 +58,25 @@ _ser_out:
5558

5659
ld a, c
5760
out0 ($D0), a
61+
5862
xor a
5963
ret.lil
6064

6165
_ser_in:
62-
in0 a, ($D5)
66+
in0 a, ($d5)
6367
and UART_LSR_RDY
6468
jr z, _ser_in
69+
6570
in0 a, ($d0)
71+
6672
ret.lil
6773

68-
_ser_status:
69-
in0 a, ($D5)
74+
_ser_status:
75+
in0 a, ($d5)
7076
and UART_LSR_RDY
7177
ret.lil z
7278
ld a, $ff
79+
or a
7380
ret.lil
7481
7582
_term_out:
@@ -121,3 +128,6 @@ _tty_status:
121128
ret.lil z
122129
ld a, $ff
123130
ret.lil
131+
132+
133+

disks/build.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash -e
2+
3+
rm -rf cpm*.dsk
4+
for pth in images/*
5+
do
6+
drive="${pth: -1}"
7+
image_name="cpm$drive.dsk"
8+
cp template.dsk $image_name
9+
echo "Working with drive image: $image_name"
10+
cpmcp -fnihirash $image_name $pth/*.* 0:
11+
echo "Image prepared"
12+
done

disks/cpma.dsk

-8 MB
Binary file not shown.

disks/cpmb.dsk

-8 MB
Binary file not shown.

disks/cpmc.dsk

-8 MB
Binary file not shown.

disks/cpmd.dsk

Lines changed: 0 additions & 1 deletion
This file was deleted.

disks/images/a/ASM.COM

8 KB
Binary file not shown.

disks/images/a/DDT.COM

4.75 KB
Binary file not shown.

disks/images/a/DUMP.COM

512 Bytes
Binary file not shown.

disks/images/a/ED.COM

6.5 KB
Binary file not shown.

disks/images/a/LOAD.COM

1.75 KB
Binary file not shown.

disks/images/a/PIP.COM

7.25 KB
Binary file not shown.

disks/images/a/STAT.COM

5.13 KB
Binary file not shown.

disks/images/a/SUBMIT.COM

1.25 KB
Binary file not shown.

disks/images/a/XSUB.COM

768 Bytes
Binary file not shown.

disks/images/a/arc.com

27 KB
Binary file not shown.

disks/images/a/arcsq.com

27.5 KB
Binary file not shown.

disks/images/a/ark.com

13.6 KB
Binary file not shown.

disks/images/a/ccploc.com

640 Bytes
Binary file not shown.

disks/images/a/cpmstat.com

9.38 KB
Binary file not shown.

disks/images/a/cpmunarj.com

12.1 KB
Binary file not shown.

disks/images/a/crck.com

1.25 KB
Binary file not shown.

disks/images/a/crunch.com

5.63 KB
Binary file not shown.

disks/images/a/fm.com

7.63 KB
Binary file not shown.

disks/images/a/kermit.com

28.8 KB
Binary file not shown.

disks/images/a/kermit.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
SET PORT TTY
2+
SET TERMINAL OFF

disks/images/a/lbrext.com

6 KB
Binary file not shown.

disks/images/a/ldir.com

1.75 KB
Binary file not shown.

disks/images/a/lu.com

19.8 KB
Binary file not shown.

disks/images/a/m80.com

19.6 KB
Binary file not shown.

disks/images/a/mload.com

2.75 KB
Binary file not shown.

disks/images/a/nulu152.com

15.2 KB
Binary file not shown.

disks/images/a/pmarc.com

10.1 KB
Binary file not shown.

disks/images/a/pmext.com

12.6 KB
Binary file not shown.

disks/images/a/pmset.com

3.13 KB
Binary file not shown.

disks/images/a/relhex.com

1.5 KB
Binary file not shown.

disks/images/a/te.com

18.8 KB
Binary file not shown.

disks/images/a/unarc.com

4.63 KB
Binary file not shown.

disks/images/a/uncr.com

6.25 KB
Binary file not shown.

disks/images/a/uncrlzw2.com

8.5 KB
Binary file not shown.

disks/images/a/uncrunch.com

5.5 KB
Binary file not shown.

disks/images/a/unzip.com

3.38 KB
Binary file not shown.

disks/images/a/usq.com

1.88 KB
Binary file not shown.

disks/images/b/BACCRRT.ASC

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
100 REM (SOURCE UNKNOWN) EDITED SLIGHTLY BY D. KURLAND 11/6/75
2+
110 PRINT "WELCOME TO CASINO UNIVAC 1108"
3+
120 PRINT "THE GAME IS BACCARAT"
4+
130 H=0
5+
140 GOSUB 1400
6+
150 DIM A(10),C(10)
7+
160 PRINT "ARE YOU READY";
8+
170 INPUT X$
9+
180 IF X$="NO" OR X$="N" THEN 1390
10+
190 PRINT "WAGER";
11+
200 D=0
12+
210 E=0
13+
220 INPUT G
14+
230 IF G>100000! THEN 1370
15+
240 IF G>0 THEN 270
16+
250 PRINT "HA!HA!, VERY FUNNY!!"
17+
260 GOTO 190
18+
270 B=1
19+
280 GOTO 740
20+
290 A(B)=INT(RND(1)*52)+1
21+
300 C(B)=A(B)-13*INT(A(B)/13)
22+
310 IF C(B)=0 THEN 600
23+
320 ON C(B)GOTO330,350,370,390,410,430,450,470,490,510,540,570
24+
330 PRINT "ACE ";
25+
340 GOTO 620
26+
350 PRINT "DEUCE ";
27+
360 GOTO 620
28+
370 PRINT "THREE ";
29+
380 GOTO 620
30+
390 PRINT "FOUR ";
31+
400 GOTO 620
32+
410 PRINT "FIVE ";
33+
420 GOTO 620
34+
430 PRINT "SIX ";
35+
440 GOTO 620
36+
450 PRINT "SEVEN ";
37+
460 GOTO 620
38+
470 PRINT "EIGHT ";
39+
480 GOTO 620
40+
490 PRINT "NINE ";
41+
500 GOTO 620
42+
510 PRINT "TEN ";
43+
520 C(B)=0
44+
530 GOTO 620
45+
540 PRINT "JACK ";
46+
550 C(B)=0
47+
560 GOTO 620
48+
570 PRINT "QUEEN ";
49+
580 C(B)=0
50+
590 GOTO 620
51+
600 PRINT "KING ";
52+
610 C(B)=0
53+
620 IF INT(A(B)/13)<>A(B)/13 THEN 640
54+
630 ON A(B)/13 GOTO 660,680,700,720
55+
640 IF INT(A(B)/13)=0 THEN 660
56+
650 ON INT(A(B)/13)GOTO 680,700,720
57+
660 PRINT "OF CLUBS"
58+
670 RETURN
59+
680 PRINT "OF DIAMONDS"
60+
690 RETURN
61+
700 PRINT "OF SPADES"
62+
710 RETURN
63+
720 PRINT "OF HEARTS"
64+
730 RETURN
65+
740 PRINT "YOUR FIRST CARD IS A ";
66+
750 GOSUB 290
67+
760 GOSUB 1310
68+
770 PRINT "YOUR NEXT CARD IS A ";
69+
780 GOSUB 290
70+
790 GOSUB 1310
71+
800 PRINT "DO YOU WANT A CARD";
72+
810 INPUT J$
73+
820 IF J$="YES" OR J$="Y" THEN 870
74+
830 C(3)=0
75+
840 D=D+C(B)
76+
850 B=B+1
77+
860 GOTO 900
78+
870 PRINT "THE CARD IS A ";
79+
880 GOSUB290
80+
890 GOSUB 1310
81+
900 PRINT "MY FIRST CARD IS A ";
82+
910 GOSUB 290
83+
920 GOSUB 1340
84+
930 PRINT "MY NEXT CARD IS A ";
85+
940 GOSUB 290
86+
950 GOSUB 1340
87+
960 IF E<10 THEN 990
88+
970 E=E-10
89+
980 GOTO 960
90+
990 IF E<6 THEN 1030
91+
1000 PRINT "I DO NOT WANT A CARD"
92+
1010 C(6)=0
93+
1020 GOTO 1060
94+
1030 PRINT "I TAKE CARD"
95+
1040 PRINT "THE CARD IS A ";
96+
1050 GOSUB 290
97+
1060 E=E+C(6)
98+
1070 IF D<10 THEN 1100
99+
1080 D=D-10
100+
1090 GOTO 1070
101+
1100 PRINT "YOUR TOTAL IS";D
102+
1110 IF E<10 THEN 1140
103+
1120 E=E-10
104+
1130 GOTO 1110
105+
1140 PRINT "MY TOTAL IS ";E
106+
1150 IF D=E THEN 1590
107+
1160 IF D>E THEN 1200
108+
1170 PRINT "I WIN $"G
109+
1180 G=-G
110+
1190 GOTO 1210
111+
1200 PRINT "YOU WIN $";G
112+
1210 H=H+G
113+
1220 IF H>0 THEN 1290
114+
1230 IF H=0 THEN 1610
115+
1240 PRINT "YOU OWE ME $";-H
116+
1250 PRINT "DO YOU WANT TO TRY AGAIN";
117+
1260 INPUT K$
118+
1270 IF K$="NO" OR K$="N" THEN 1390
119+
1280 GOTO 190
120+
1290 PRINT "I.O.U. $";H
121+
1300 GOTO 1250
122+
1310 D=D+C(B)
123+
1320 B=B+1
124+
1330 RETURN
125+
1340 E=E+C(B)
126+
1350 B=B+1
127+
1360 RETURN
128+
1370 PRINT "HOUSE LIMIT IS $100000"
129+
1380 GOTO190
130+
1390 STOP
131+
1400 PRINT "DO YOU WANT THE RULES OF THE GAME";
132+
1410 INPUT I$
133+
1420 IF I$="NO" OR I$="N" THEN RETURN
134+
1430 PRINT "* OFFICIAL RULES FOR THE GAME OF BACCARAT *"
135+
1440 PRINT "THE COMPUTER IS SHUFFLING SIX DECKS OF CARDS"
136+
1450 PRINT "TOGETHER. THE RULES ARE AS FOLLOWS: THE OBJECT"
137+
1460 PRINT "IS TO BE AS CLOSE TO POSSIBLE TO NINE IN TWO"
138+
1470 PRINT "OR THREE CARDS, FACE CARDS AND TENS COUNT ZERO"
139+
1480 PRINT "ACES COUNT AS ONE EACH,ALL OTHER CARDS COUNT"
140+
1490 PRINT "THEIR INDEX VALUE. WHEN THE TOTAL IS OVER TEN"
141+
1500 PRINT "THE TENS UNIT IS DROPPED. EXAMPLE: A SEVEN AND"
142+
1510 PRINT "A SIX TOTALING THIRTEEN COUNT AS THREE. THE"
143+
1520 PRINT "PLAYER WITH THE HIGHER TOTAL WINS. IN CASE OF"
144+
1530 PRINT "A TIE THE COMPUTER WINS. "
145+
1540 PRINT "DO YOU UNDERSTAND THE RULES";
146+
1550 INPUT O$
147+
1560 IF O$="YES" OR O$="Y" THEN RETURN
148+
1570 PRINT "TOUGH LUCK"
149+
1580 RETURN
150+
1590 PRINT "IT IS A TIE. THE COMPUTER WINS!"
151+
1600 GOTO 1170
152+
1610 PRINT "YOU ARE EVEN-UP !!"
153+
1620 GOTO1250
154+
1630 END
155+
N
156+
1590 PRINT "I

0 commit comments

Comments
 (0)