Skip to content

Commit

Permalink
Merge pull request #12 from nihirash/update
Browse files Browse the repository at this point in the history
update
  • Loading branch information
nihirash authored Aug 8, 2023
2 parents 914490d + 853a0ab commit cb67112
Show file tree
Hide file tree
Showing 231 changed files with 26,361 additions and 18 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.vscode
*.sys
*.lst
*.bak
*.bak
cpm*.dsk
release/
Binary file removed bin/cpm.bin
Binary file not shown.
2 changes: 1 addition & 1 deletion bootstrap/crt.inc
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ mos_fclose: equ $0b
mos_fgetc: equ $0c
mos_fputc: equ $0d
mos_feof: equ $0e
mos_setint: equ $14
mos_uopen: equ $15
mos_uclose: equ $16
mos_ugetc: equ $17
mos_uputc: equ $18
mos_fread: equ $1a
mos_fwrite: equ $1b
mos_flseek: equ $1c

;; File modes
fa_read: equ $01
fa_write: equ $02
Expand Down
11 changes: 5 additions & 6 deletions bootstrap/drive_emu.inc
Original file line number Diff line number Diff line change
Expand Up @@ -110,17 +110,16 @@ fs_init:
ld c, 0
MOSCALL mos_fclose

MOSCALL mos_sysvars
xor a
ld (ix+$28), a
ld ix, (sys_ix)

ld hl, drive
ld c, fa_read+fa_write
MOSCALL mos_fopen
ld (f_handle), a
or a
push af
MOSCALL mos_sysvars
xor a
ld (ix+$28), a
ld ix, (sys_ix)
pop af
ret

fs_seek:
Expand Down
20 changes: 15 additions & 5 deletions bootstrap/terminal.inc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ _term_init:
ld a, 7
out0 (REG_FTC), a ; Disable fifo

ld a, 0
xor a
out0 (REG_IER), a ; Disable ints

@wait:
Expand All @@ -36,7 +36,7 @@ _term_init:
ret

serial_cfg:
dl 115200
dl 57600
db 8
db 1
db 0
Expand All @@ -45,6 +45,9 @@ serial_cfg:

vdu_init:
db 23, 0, 255 ; Switch to terminal emulation
db "CP/M to MOS gate v.1.1", 13, 10
db "2023 (c) Aleksandr Sharikhin", 13, 10
db 13,10
init_end:


Expand All @@ -55,21 +58,25 @@ _ser_out:

ld a, c
out0 ($D0), a

xor a
ret.lil

_ser_in:
in0 a, ($D5)
in0 a, ($d5)
and UART_LSR_RDY
jr z, _ser_in

in0 a, ($d0)

ret.lil

_ser_status:
in0 a, ($D5)
_ser_status:
in0 a, ($d5)
and UART_LSR_RDY
ret.lil z
ld a, $ff
or a
ret.lil
_term_out:
Expand Down Expand Up @@ -121,3 +128,6 @@ _tty_status:
ret.lil z
ld a, $ff
ret.lil



12 changes: 12 additions & 0 deletions disks/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash -e

rm -rf cpm*.dsk
for pth in images/*
do
drive="${pth: -1}"
image_name="cpm$drive.dsk"
cp template.dsk $image_name
echo "Working with drive image: $image_name"
cpmcp -fnihirash $image_name $pth/*.* 0:
echo "Image prepared"
done
Binary file removed disks/cpma.dsk
Binary file not shown.
Binary file removed disks/cpmb.dsk
Binary file not shown.
Binary file removed disks/cpmc.dsk
Binary file not shown.
1 change: 0 additions & 1 deletion disks/cpmd.dsk

This file was deleted.

Binary file added disks/images/a/ASM.COM
Binary file not shown.
Binary file added disks/images/a/DDT.COM
Binary file not shown.
Binary file added disks/images/a/DUMP.COM
Binary file not shown.
Binary file added disks/images/a/ED.COM
Binary file not shown.
Binary file added disks/images/a/LOAD.COM
Binary file not shown.
Binary file added disks/images/a/PIP.COM
Binary file not shown.
Binary file added disks/images/a/STAT.COM
Binary file not shown.
Binary file added disks/images/a/SUBMIT.COM
Binary file not shown.
Binary file added disks/images/a/XSUB.COM
Binary file not shown.
Binary file added disks/images/a/arc.com
Binary file not shown.
Binary file added disks/images/a/arcsq.com
Binary file not shown.
Binary file added disks/images/a/ark.com
Binary file not shown.
Binary file added disks/images/a/ccploc.com
Binary file not shown.
Binary file added disks/images/a/cpmstat.com
Binary file not shown.
Binary file added disks/images/a/cpmunarj.com
Binary file not shown.
Binary file added disks/images/a/crck.com
Binary file not shown.
Binary file added disks/images/a/crunch.com
Binary file not shown.
Binary file added disks/images/a/fm.com
Binary file not shown.
Binary file added disks/images/a/kermit.com
Binary file not shown.
2 changes: 2 additions & 0 deletions disks/images/a/kermit.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SET PORT TTY
SET TERMINAL OFF
Binary file added disks/images/a/lbrext.com
Binary file not shown.
Binary file added disks/images/a/ldir.com
Binary file not shown.
Binary file added disks/images/a/lu.com
Binary file not shown.
Binary file added disks/images/a/m80.com
Binary file not shown.
Binary file added disks/images/a/mload.com
Binary file not shown.
Binary file added disks/images/a/nulu152.com
Binary file not shown.
Binary file added disks/images/a/pmarc.com
Binary file not shown.
Binary file added disks/images/a/pmext.com
Binary file not shown.
Binary file added disks/images/a/pmset.com
Binary file not shown.
Binary file added disks/images/a/relhex.com
Binary file not shown.
Binary file added disks/images/a/te.com
Binary file not shown.
Binary file added disks/images/a/unarc.com
Binary file not shown.
Binary file added disks/images/a/uncr.com
Binary file not shown.
Binary file added disks/images/a/uncrlzw2.com
Binary file not shown.
Binary file added disks/images/a/uncrunch.com
Binary file not shown.
Binary file added disks/images/a/unzip.com
Binary file not shown.
Binary file added disks/images/a/usq.com
Binary file not shown.
156 changes: 156 additions & 0 deletions disks/images/b/BACCRRT.ASC
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
100 REM (SOURCE UNKNOWN) EDITED SLIGHTLY BY D. KURLAND 11/6/75
110 PRINT "WELCOME TO CASINO UNIVAC 1108"
120 PRINT "THE GAME IS BACCARAT"
130 H=0
140 GOSUB 1400
150 DIM A(10),C(10)
160 PRINT "ARE YOU READY";
170 INPUT X$
180 IF X$="NO" OR X$="N" THEN 1390
190 PRINT "WAGER";
200 D=0
210 E=0
220 INPUT G
230 IF G>100000! THEN 1370
240 IF G>0 THEN 270
250 PRINT "HA!HA!, VERY FUNNY!!"
260 GOTO 190
270 B=1
280 GOTO 740
290 A(B)=INT(RND(1)*52)+1
300 C(B)=A(B)-13*INT(A(B)/13)
310 IF C(B)=0 THEN 600
320 ON C(B)GOTO330,350,370,390,410,430,450,470,490,510,540,570
330 PRINT "ACE ";
340 GOTO 620
350 PRINT "DEUCE ";
360 GOTO 620
370 PRINT "THREE ";
380 GOTO 620
390 PRINT "FOUR ";
400 GOTO 620
410 PRINT "FIVE ";
420 GOTO 620
430 PRINT "SIX ";
440 GOTO 620
450 PRINT "SEVEN ";
460 GOTO 620
470 PRINT "EIGHT ";
480 GOTO 620
490 PRINT "NINE ";
500 GOTO 620
510 PRINT "TEN ";
520 C(B)=0
530 GOTO 620
540 PRINT "JACK ";
550 C(B)=0
560 GOTO 620
570 PRINT "QUEEN ";
580 C(B)=0
590 GOTO 620
600 PRINT "KING ";
610 C(B)=0
620 IF INT(A(B)/13)<>A(B)/13 THEN 640
630 ON A(B)/13 GOTO 660,680,700,720
640 IF INT(A(B)/13)=0 THEN 660
650 ON INT(A(B)/13)GOTO 680,700,720
660 PRINT "OF CLUBS"
670 RETURN
680 PRINT "OF DIAMONDS"
690 RETURN
700 PRINT "OF SPADES"
710 RETURN
720 PRINT "OF HEARTS"
730 RETURN
740 PRINT "YOUR FIRST CARD IS A ";
750 GOSUB 290
760 GOSUB 1310
770 PRINT "YOUR NEXT CARD IS A ";
780 GOSUB 290
790 GOSUB 1310
800 PRINT "DO YOU WANT A CARD";
810 INPUT J$
820 IF J$="YES" OR J$="Y" THEN 870
830 C(3)=0
840 D=D+C(B)
850 B=B+1
860 GOTO 900
870 PRINT "THE CARD IS A ";
880 GOSUB290
890 GOSUB 1310
900 PRINT "MY FIRST CARD IS A ";
910 GOSUB 290
920 GOSUB 1340
930 PRINT "MY NEXT CARD IS A ";
940 GOSUB 290
950 GOSUB 1340
960 IF E<10 THEN 990
970 E=E-10
980 GOTO 960
990 IF E<6 THEN 1030
1000 PRINT "I DO NOT WANT A CARD"
1010 C(6)=0
1020 GOTO 1060
1030 PRINT "I TAKE CARD"
1040 PRINT "THE CARD IS A ";
1050 GOSUB 290
1060 E=E+C(6)
1070 IF D<10 THEN 1100
1080 D=D-10
1090 GOTO 1070
1100 PRINT "YOUR TOTAL IS";D
1110 IF E<10 THEN 1140
1120 E=E-10
1130 GOTO 1110
1140 PRINT "MY TOTAL IS ";E
1150 IF D=E THEN 1590
1160 IF D>E THEN 1200
1170 PRINT "I WIN $"G
1180 G=-G
1190 GOTO 1210
1200 PRINT "YOU WIN $";G
1210 H=H+G
1220 IF H>0 THEN 1290
1230 IF H=0 THEN 1610
1240 PRINT "YOU OWE ME $";-H
1250 PRINT "DO YOU WANT TO TRY AGAIN";
1260 INPUT K$
1270 IF K$="NO" OR K$="N" THEN 1390
1280 GOTO 190
1290 PRINT "I.O.U. $";H
1300 GOTO 1250
1310 D=D+C(B)
1320 B=B+1
1330 RETURN
1340 E=E+C(B)
1350 B=B+1
1360 RETURN
1370 PRINT "HOUSE LIMIT IS $100000"
1380 GOTO190
1390 STOP
1400 PRINT "DO YOU WANT THE RULES OF THE GAME";
1410 INPUT I$
1420 IF I$="NO" OR I$="N" THEN RETURN
1430 PRINT "* OFFICIAL RULES FOR THE GAME OF BACCARAT *"
1440 PRINT "THE COMPUTER IS SHUFFLING SIX DECKS OF CARDS"
1450 PRINT "TOGETHER. THE RULES ARE AS FOLLOWS: THE OBJECT"
1460 PRINT "IS TO BE AS CLOSE TO POSSIBLE TO NINE IN TWO"
1470 PRINT "OR THREE CARDS, FACE CARDS AND TENS COUNT ZERO"
1480 PRINT "ACES COUNT AS ONE EACH,ALL OTHER CARDS COUNT"
1490 PRINT "THEIR INDEX VALUE. WHEN THE TOTAL IS OVER TEN"
1500 PRINT "THE TENS UNIT IS DROPPED. EXAMPLE: A SEVEN AND"
1510 PRINT "A SIX TOTALING THIRTEEN COUNT AS THREE. THE"
1520 PRINT "PLAYER WITH THE HIGHER TOTAL WINS. IN CASE OF"
1530 PRINT "A TIE THE COMPUTER WINS. "
1540 PRINT "DO YOU UNDERSTAND THE RULES";
1550 INPUT O$
1560 IF O$="YES" OR O$="Y" THEN RETURN
1570 PRINT "TOUGH LUCK"
1580 RETURN
1590 PRINT "IT IS A TIE. THE COMPUTER WINS!"
1600 GOTO 1170
1610 PRINT "YOU ARE EVEN-UP !!"
1620 GOTO1250
1630 END
N
1590 PRINT "I
Loading

0 comments on commit cb67112

Please sign in to comment.