Skip to content

Commit

Permalink
Now create Squanchy BASIC and Super Squanchy BASIC for the Color Comp…
Browse files Browse the repository at this point in the history
…uter 3
  • Loading branch information
tlindner committed Aug 28, 2021
1 parent 45a18c6 commit 53d50d8
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 22 deletions.
25 changes: 18 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,24 +1,35 @@
all: calc_org bas13.bin install.asm SQUANCHY.DSK
all: calc_org sb.bin ssb.bin install.asm SQUANCHY.DSK

calc_org: calc_org.c
cc -Wall -Werror $^ -o $@

bas13.bin: equates.asm bas.asm calc_org bas13.bin.sym
sb.bin: equates.asm bas.asm calc_org
# Determine length of ROM
lwasm -D BASIC_START=0 -o /dev/null equates.asm bas.asm --symbol-dump=$@.sym
# Assemble again with perfect offset
lwasm -D BASIC_START=`./calc_org bas13.bin.sym` -o $@ equates.asm bas.asm --list=$@.lst --symbol-dump=$@.sym
lwasm -D BASIC_START=`./calc_org sb.bin.sym` -o $@ equates.asm bas.asm --list=$@.lst --symbol-dump=$@.sym

install.bin: bas13.bin.sym install.asm
ssb.bin: equates.asm bas.asm calc_org
# Determine length of ROM
lwasm -D COCO3 -D BASIC_START=0 -o /dev/null equates.asm bas.asm --symbol-dump=$@.sym
# Assemble again with perfect offset
lwasm -D COCO3 -D BASIC_START=`./calc_org ssb.bin.sym` -o $@ equates.asm bas.asm --list=$@.lst --symbol-dump=$@.sym

instsb.bin: sb.bin.sym install.asm
lwasm -o $@ $^ --list=$@.lst --symbol-dump=$@.sym

instssb.bin: ssb.bin.sym install.asm
lwasm -o $@ $^ --list=$@.lst --symbol-dump=$@.sym

SQUANCHY.DSK: readme.bas s.bas squanchy.bas install.bin bas13.bin
SQUANCHY.DSK: readme.bas s.bas squanchy.bas instsb.bin instssb.bin sb.bin ssb.bin
decb dskini SQUANCHY.DSK
decb copy -t readme.bas SQUANCHY.DSK,README.BAS
decb copy -t s.bas SQUANCHY.DSK,S.BAS
decb copy -t squanchy.bas SQUANCHY.DSK,SQUANCHY.BAS
decb copy -2b install.bin SQUANCHY.DSK,INSTALL.BIN
decb copy -2b bas13.bin SQUANCHY.DSK,BAS13.BIN
decb copy -2b instsb.bin SQUANCHY.DSK,INSTSB.BIN
decb copy -2b instssb.bin SQUANCHY.DSK,INSTSSB.BIN
decb copy -2b sb.bin SQUANCHY.DSK,SB.BIN
decb copy -2b ssb.bin SQUANCHY.DSK,SSB.BIN

clean:
-rm -f *.bin *.lst *.sym SQUANCHY.DSK
20 changes: 16 additions & 4 deletions bas.asm
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,16 @@ LA00E LDS #LINBUF+LBUFMX+1 SET STACK TO TOP OF LINE INPUT BUFFER
BNE BACDST NO - DO A COLD START
JMP ,X YES, G0 THERE
RESVEC LEAY <LA00E,PCR POINT Y TO WARM START CHECK CODE
LA02A LDX #PIA1 POINT X TO PIA1
*LA02A LDX #PIA1 POINT X TO PIA1
LA02A LDX #PIA0+4 POINT X TO PIA0
CLR -3,X CLEAR PIA0 CONTROL REGISTER A
CLR -1,X CLEAR PIA0 CONTROL REGISTER B
CLR -4,X SET PIA0 SIDE A TO INPUT
LDD #$FF34 *
STA -2,X * SET PIA0 SIDE B TO OUTPUT
STB -3,X * ENABLE PIA0 PERIPHERAL REGISTERS, DISABLE
STB -1,X * MPU INTERRUPTS, SET CA2, CA1 TO OUTPUTS
LDX #PIA1 POINT X TO PIA1
CLR 1,X CLEAR CONTROL REGISTER A ON PIA1
CLR 3,X CLEAR CONTROL REGISTER B ON PIA1
DECA A REG NOW HAS $FE
Expand Down Expand Up @@ -126,7 +128,7 @@ LA0B6 STX 3,U * SET EXBAS COMMAND INTERPRETATION
ldx #rstpgm point x to rom source data
ldu #RSTRAM point u to ram destination
ldb #7 move 7 bytes
jsr >LA59A move 28 bytes from rom to ram
jsr >LA59A move 7 bytes from rom to ram

* place 64k RAM aware reset program vector
* LDX #BAWMST WARM START ADDRESS
Expand All @@ -137,7 +139,8 @@ LA0E2 LDA #$55 WARM START FLAG
BRA LA0F3 GO TO BASIC’S MAIN LOOP
*BAWMST NOP NOP REQ’D FOR WARM START
* This no longer needs a NOP
BAWMST CLR DEVNUM SET DEVICE NUMBER TO SCREEN
BAWMST
CLR DEVNUM SET DEVICE NUMBER TO SCREEN
JSR >LAD33 DO PART OF A NEW
ANDCC #$AF ENABLE IRQ,FIRQ
JSR >LA928 CLEAR SCREEN
Expand Down Expand Up @@ -200,7 +203,11 @@ LA145 FDB LAA29 POINTS TO SECONDARY FUNCTION JUMP TABLE
* FCB '1'
* FCC '.'
* FCB '3'
ifdef COCO3
LA147 fcc 'SUPER SQUANCHY BASIC'
else
LA147 fcc 'SQUANCHY BASIC'
endif
LA156 FCB CR
*LA157 FCC '(C) 1982 TANDY'
LA165 FCB $00
Expand Down Expand Up @@ -4563,5 +4570,10 @@ LBFE1 FCB $83,$49,$0F,$DA,$A2 * 2*PI
*LBFFA FDB SWIVEC SWI
*LBFFC FDB NMIVEC NMI
*LBFFE FDB RESVEC RESET

ifdef COCO3
* The ROM reset routine in a CoCo 3 requires this byte to be $55
* if we want to warm start
fcb $55 ($FEED)
zmb 18
endif
BASIC_END equ *
4 changes: 2 additions & 2 deletions readme.bas
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
30 PRINT "REASSEMBLED TO BE AS HIGH IN"
40 PRINT "A 64K COLOR COMPUTER'S RAM AS"
50 PRINT "POSSIBLE."
60 PRINT "THIS SHOULD PRODUCE A BASIC THATIS 100% COMPAITABLE, BUT ALLOWS"
60 PRINT "THIS SHOULD PRODUCE A BASIC THATIS 100% COMPAITABLE, AND ALLOWS"
70 PRINT "LARGER PROGRAMS TO RUN."
70 PRINT "PROGRAMS THAT DEPEND ON ANY"
80 PRINT "INTERNAL ASPECT OF THE"
90 PRINT "INTERRUPTER, EVEN THE"
90 PRINT "INTERPRETER, EVEN THE"
100 PRINT "DOCUMENTED ONES, WILL NOT"
110 PRINT "WORK."
120 PRINT
Expand Down
20 changes: 11 additions & 9 deletions squanchy.bas
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
10 PCLEAR 1 : CLEAR 50, 8192
20 PRINT "LOAD SQUANCHY BASIC ROM, OFFSET INTO LOWER RAM"
30 LOADM "BAS13.BIN",33024
40 PRINT "LOAD INSTALLER"
50 LOADM "INSTALL.BIN"
60 PRINT "TURN OFF DRIVE MOTOR"
70 POKE 65344,0
80 PRINT "EXECUTE"
90 EXEC
10 PCLEAR 1:CLEAR 50, 8192
20 IF PEEK(58108)=77 THEN PRINT "COCO 3 DETECTED":A$="SSB.BIN":B$="INSTSSB.BIN":GOTO 40
30 A$="SB.BIN":B$="INSTSB.BIN"
40 PRINT "LOAD SQUANCHY BASIC ROM, OFFSET INTO LOWER RAM"
50 LOADM A$,33024
60 PRINT "LOAD INSTALLER"
70 LOADM B$
80 PRINT "TURN OFF DRIVE MOTOR"
90 POKE 65344,0
100 PRINT "EXECUTE"
110 EXEC

0 comments on commit 53d50d8

Please sign in to comment.