Mercurial > hg > Members > kono > nitros9-code
changeset 3203:a188cc456fa1
Adding a co-module for a stock WordPak RS with FHL O-PAK support.
author | lfantoniosi |
---|---|
date | Mon, 03 Jul 2017 10:34:01 -0700 |
parents | 04f3ef62b7bb |
children | 64ad5cd0b912 |
files | level1/coco1/bootfiles/makefile level1/coco1/makefile level1/coco1/modules/makefile level1/modules/cowprs.asm level1/modules/term_wprs.asm level1/modules/vtio.asm |
diffstat | 6 files changed, 706 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/level1/coco1/bootfiles/makefile Sun Jun 04 17:52:41 2017 +0100 +++ b/level1/coco1/bootfiles/makefile Mon Jul 03 10:34:01 2017 -0700 @@ -38,6 +38,8 @@ VTIO_COHR = $(MD)/vtio.dr $(MD)/cohr.io $(MD)/term_hr.dt VTIO_CO80 = $(MD)/vtio.dr $(MD)/co80.io $(MD)/term_80.dt VTIO_CO42 = $(MD)/vtio.dr $(MD)/co42.io $(MD)/term_42.dt +VTIO_COWPRS = $(MD)/vtio.dr $(MD)/cowprs.io $(MD)/term_wprs.dt + PIPE = $(MD)/pipeman.mn $(MD)/piper.dr $(MD)/pipe.dd CLOCK60HZ = $(MD)/clock_60hz $(MD)/clock2_soft CLOCK60HZDW = $(MD)/clock_60hz $(MD)/clock2_dw @@ -114,6 +116,18 @@ $(PIPE) \ $(CLOCK60HZ) \ $(MD)/sysgo_dd + +BOOTFILE_COWPRS = $(MD)/ioman \ + $(MD)/rbf.mn \ + $(FLOPPY_40D) \ + $(MD)/ddd0_40d.dd \ + $(MD)/scf.mn \ + $(VTIO_COWPRS) \ + $(MD)/scbbp.dr $(MD)/p_scbbp.dd \ + $(MD)/scbbt.dr $(MD)/t1_scbbt.dd \ + $(PIPE) \ + $(CLOCK60HZ) \ + $(MD)/sysgo_dd BOOTFILE_DW_HEADLESS = $(MD)/ioman \ $(MD)/rbf.mn \ @@ -361,7 +375,7 @@ $(CLOCK60HZ) \ $(MD)/sysgo_dd -BOOTFILES = bootfile_covdg bootfile_cohr bootfile_co42 \ +BOOTFILES = bootfile_covdg bootfile_cohr bootfile_co42 bootfile_cowprs \ bootfile_dw_headless bootfile_covdg_becker \ bootfile_covdg_becker_game bootfile_covdg_dw_game \ bootfile_covdg_cocosdc bootfile_co42_cocosdc bootfile_covdg_cocosdc_game \ @@ -369,7 +383,7 @@ bootfile_covdg_ds80 bootfile_cohr_ds80 bootfile_co42_ds80 \ bootfile_cohr_becker bootfile_becker_headless \ bootfile_covdg_arduino bootfile_arduino_headless \ - bootfile_cohr_arduino bootfile_covdg_arduino_game + bootfile_cohr_arduino bootfile_covdg_arduino_game KERNELS = kernel_1773 kernel_dw kernel_becker kernel_arduino kernel_cocosdc @@ -388,6 +402,9 @@ bootfile_co80: $(BOOTFILE_CO80) $(DEPENDS) $(MERGE) $(BOOTFILE_CO80)>$@ + +bootfile_cowprs: $(BOOTFILE_COWPRS) $(DEPENDS) + $(MERGE) $(BOOTFILE_COWPRS)>$@ bootfile_covdg_ds80: $(BOOTFILE_COVDG_DS80) $(DEPENDS) $(MERGE) $(BOOTFILE_COVDG_DS80)>$@
--- a/level1/coco1/makefile Sun Jun 04 17:52:41 2017 +0100 +++ b/level1/coco1/makefile Mon Jul 03 10:34:01 2017 -0700 @@ -10,6 +10,7 @@ BOOTFILE_COVDG = bootfiles/bootfile_covdg BOOTFILE_COHR = bootfiles/bootfile_cohr BOOTFILE_CO42 = bootfiles/bootfile_co42 +BOOTFILE_COWPRS = bootfiles/bootfile_cowprs BOOTFILE_COVDG_DS80 = bootfiles/bootfile_covdg_ds80 BOOTFILE_DW_HEADLESS = bootfiles/bootfile_dw_headless BOOTFILE_BECKER_HEADLESS = bootfiles/bootfile_becker_headless
--- a/level1/coco1/modules/makefile Sun Jun 04 17:52:41 2017 +0100 +++ b/level1/coco1/modules/makefile Mon Jul 03 10:34:01 2017 -0700 @@ -48,10 +48,10 @@ SCF = scf.mn \ sc6551.dr vrn.dr scbbp.dr scbbt.dr scdwp.dr sspak.dr vtio.dr \ - covdg.io cohr.io co42.io co80.io \ + covdg.io cohr.io co42.io co80.io cowprs.io \ nil.dd p_scbbp.dd p_scdwp.dd pipe.dd ssp.dd \ term_scbbt.dt term_sc6551.dt t1_scbbt.dd t2_sc6551.dd t3_sc6551.dd \ - term_vdg.dt term_hr.dt term_42.dt term_80.dt \ + term_vdg.dt term_hr.dt term_42.dt term_80.dt term_wprs.dt \ scdwv.dr term_scdwv.dt n_scdwv.dd n1_scdwv.dd n2_scdwv.dd \ n3_scdwv.dd n4_scdwv.dd n5_scdwv.dd n6_scdwv.dd n7_scdwv.dd \ n8_scdwv.dd n9_scdwv.dd n10_scdwv.dd n11_scdwv.dd n12_scdwv.dd \
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/level1/modules/cowprs.asm Mon Jul 03 10:34:01 2017 -0700 @@ -0,0 +1,606 @@ +******************************************************************** +* COWP - PBJ WordPak RS Co-Driver for VTIO +* +* $Id$ +* +* Adapted from CO80 for the WordPak RS. +* +* Edt/Rev YYYY/MM/DD Modified by +* Comment +* 2017/07/01 - Initial driver implementation from CO80 - lfantoniosi +* ------------------------------------------------------------------ + + nam COWP + ttl PBJ WordPak RS Co-Driver for VTIO + +BASEADDR equ $FF76 +CURSPTR equ V.ColPtr cursor address (wrap at $4000) +DISPPTR equ V.Co80X display start address (wrap at $800) + + ifp1 + use defsfile + use cocovtio.d + endc + +tylg set Systm+Objct +atrv set ReEnt+rev +rev set $01 +edition set 2 + + mod eom,name,tylg,atrv,start,size + +u0000 rmb 0 +size equ . + fcb $06 + +name fcs /CoWP/ + fcb edition + +* WordPak Initialization Values +WPIV fcb $6F R0 + fcb $50 R1 + fcb $57 R2 + fcb $3C R3 + fcb $1C R4 + fcb $0A R5 + fcb $19 R6 + fcb $1A R7 + fcb $78 R8 + fcb $09 R9 +L0034 fcb $60 R10 + fcb $09 R11 + fcb $00 R12 + fcb $00 R13 + fcb $00 R14 + fcb $00 R15 + fcb $00 R16 + fcb $00 R17 + fcb $00 R18 + fcb $00 R19 + fcb $10 R20 + +start equ * + lbra Init + lbra Write + lbra GetStat + lbra SetStat + lbra Term + +* Init +Init +* Initialize WordPak RS Hardware + clra + leax <WPIV,pcr point to initialization values +L0097 ldb ,x+ + std BASEADDR write to WP hardware + inca + cmpa #20 + bcs L0097 + + ldd #0 + std <DISPPTR,u + std <CURSPTR,u + + ldx #BASEADDR + lbsr ClrScrn + + ldb <V.COLoad,u + orb #ModCoWP + bra L004F +* Term +Term ldb <V.COLoad,u + andb #~ModCoWP +L004F stb <V.COLoad,u + clrb + rts + +* GetStat +GetStat ldx PD.RGS,y get caller's regs + cmpa #SS.Cursr Cursr? + beq Rt.Cursr branch if so + cmpa #131 get O-PAK max ASCII code + bne ScrSz + lda #$7e original WP-RS chargen goes up to 126 + sta R$A,x +NoErr clrb + rts +ScrSz cmpa #132 O-PAK Screen Size + bne CurType + lda #$50 + sta R$A,x save in A + lda #$19 + sta R$B,x save in B + bra NoErr +CurType cmpa #134 O-PAK Cursor Type + bne SetStat + ldd #$0101 block cursor / slow blinking rate + std R$A,x + bra NoErr +* SetStat +SetStat comb + ldb #E$UnkSvc + rts + +* SS.Cursr getstat +Rt.Cursr + clra + ldb <V.C80Y,u + addb #$20 + std R$Y,x + ldb <V.C80X,u + addb #$20 + std R$X,x + lda <V.CChar,u + sta R$A,x +* no operation entry point +NoOp clrb + rts + +* Write +Write ldx #BASEADDR get HW addr in X + cmpa #$0E $0E? + bcs L00B6 branch if less than + cmpa #$1A $1A? + bcs NoOp branch if less than + cmpa #C$SPAC space? + lbcs Check1B branch if less than + cmpa #$7e $7e? + bcs ChrOut ASCII char, branch if less than + cmpa #$C0 $C0? + bls L00A6 branch if lower or same + anda #$1F + suba #$01 + cmpa #$19 + bhi L00B2 + bra ChrOut +L00A6 cmpa #$AA $AA? + bcs L00B2 branch if less than + ora #$10 + anda #$1F + cmpa #$1A + bcc ChrOut +L00B2 lda #$A0 + bra ChrOut + +L00B6 leax >FuncTbl,pcr + lsla + ldd a,x + leax d,x + pshs x + ldx #BASEADDR + rts + +* display functions dispatch table +FuncTbl fdb NoOp-FuncTbl $00:no-op (null) + fdb CurHome-FuncTbl $01:HOME cursor + fdb CurXY-FuncTbl $02:CURSOR XY + fdb ErLine-FuncTbl $03:ERASE LINE + fdb ErEOL-FuncTbl $04:ERASE TO EOL + fdb CurOnOff-FuncTbl $05:CURSOR ON/OFF + fdb CurRgt-FuncTbl $06:CURSOR RIGHT + fdb NoOp-FuncTbl $07:no-op (bel:handled in VTIO) + fdb CurLft-FuncTbl $08:CURSOR LEFT + fdb CurUp-FuncTbl $09:CURSOR UP + fdb CurDown-FuncTbl $0A:CURSOR DOWN + fdb ErEOS-FuncTbl $0B:ERASE TO EOS + fdb ClrScrn-FuncTbl $0C:CLEAR SCREEN + fdb CrRtn-FuncTbl $0D:RETURN + +* $08 - cursor left +CurLft ldd <V.C80X,u get CO80 X/Y + bne L00E8 branch if not at start + clrb + rts +L00E8 deca + bge L00EE + lda #79 + decb +L00EE std <V.C80X,u + lbra L01CC + +* $09 - cursor up +CurUp ldb <V.C80Y,u + beq L00FF + decb + stb <V.C80Y,u + lbra L01CC +L00FF clrb + rts + +* $0D - move cursor to start of line (carriage return) +CrRtn clr <V.C80X,u + bra L014C + +* ChrOut - output a readable character +* Entry: A = ASCII value of character to output +ChrOut ora <V.Invers,u add inverse video flag + pshs a save char + ldd <CURSPTR,u + bsr UptRegs + lda #31 dummy register 31 + sta ,x + bsr WaitBUSY wait for HW + puls a restore char + sta $03,x write character + +* $06 - cursor right +CurRgt inc <V.C80X,u + lda <V.C80X,u + cmpa #79 + ble L014C + bsr CrRtn + +* $0A - cursor down (line feed) +CurDown ldb <V.C80Y,u + cmpb #24 + bge L012E + incb + stb <V.C80Y,u + bra L014F +L012E ldd <DISPPTR,u + addd #80 + bsr L0161 + std <DISPPTR,u + lda #18 + sta ,x + ldd <DISPPTR,u + addd #80*24 + bsr L0161 + sta $01,x + lda #19 + std ,x set update registers + ldx #80 + bsr L0159 clear last line + lda #12 + sta ,x + ldd <DISPPTR,u + sta $01,x + lda #13 + std ,x update display start +L014C ldb <V.C80Y,u +L014F lbra L01CC + +* $01 - home cursor +CurHome clr <V.C80X,u + clr <V.C80Y,u + ldd <DISPPTR,u + std <CURSPTR,u + lbra L01DC + +L0161 anda #$07 + andb #$FF +L016A rts + +* X = address of WordPak +WaitBUSY pshs a + lda #31 + sta BASEADDR +L0178 lda BASEADDR + bpl L0178 + puls a + rts + +UptRegs pshs a + lda #18 + sta BASEADDR + puls a + anda #$07 + andb #$FF + sta BASEADDR+1 + lda #19 + std BASEADDR set update registers + rts + +* $03 - erase line +ErLine lbsr CrRtn do a CR +ErEOL ldd <CURSPTR,u + bsr UptRegs + ldb #80 + subb <V.C80X,u + clra + tfr d,x + bra L0159 + + +* $0C - clear screen +ClrScrn bsr CurHome do home cursor, then erase to EOS + +* $0B - erase to end of screen +ErEOS ldb <V.C80Y,u + lda #80 + mul + addb <V.C80X,u + adca #$00 + pshs a,b save relative address + ldd <CURSPTR,u + bsr UptRegs + ldd #80*25 + subd ,s++ subtract relative address + tfr d,x +L0159 ldb #32 + orb <V.Invers,u +ErOUT bsr WaitBUSY + stb BASEADDR+3 + leax -1,x + bne ErOUT + ldx #BASEADDR +L0189 +L018E +L01A0 clrb + rts + +* $02 XX YY - move cursor to col XX-32, row YY-32 +CurXY leax >L01B0,pcr + ldb #$02 +L01A8 stx <V.RTAdd,u + stb <V.NGChr,u + clrb + rts +L01B0 ldx #BASEADDR get HW address + ldb <V.NChr2,u get char2 in A + lda <V.NChar,u and char1 in B + suba #32 subtract 32 from B + blt L01A0 if less than 0, we're done + cmpa #79 compare against greatest column + bgt L01A0 branch if >79 + subb #32 else subtract 32 from A + blt L01A0 if less than 0, we're done + cmpb #24 compare against greatest row + bgt L01A0 branch if >24 + std <V.C80X,u else store A/B in new col/row position +L01CC lda #80 multiply B*80 to find new row + mul + addb <V.C80X,u + adca #$00 + addd <DISPPTR,u + anda #$3F + andb #$FF + std <CURSPTR,u +L01DC pshs b,a + lda #14 Cursor Position (MSB) + sta ,x + lda ,s+ + sta $01,x + lda #15 Cursor Position (LSB) + sta ,x + lda ,s+ + sta $01,x + clrb + rts + +Check1F cmpa #$1F + bne Done1B sould it be WritErr ? + lda <V.NChr2,u + cmpa #$20 + beq InvOn + cmpa #$21 + beq InvOff +WritErr comb + ldb #E$Write + rts + +InvOn lda #$80 + sta <V.Invers,u + clrb + rts + +InvOff clr <V.Invers,u +L020F clrb + rts + +* $05 XX - set cursor off/on/color per XX-32 +CurOnOff leax >L0219,pcr + ldb #$01 + bra L01A8 +L0219 ldx #BASEADDR + lda <V.NChr2,u get next character + cmpa #$20 cursor code valid? + blt WritErr no, error + beq L022D + cmpa #$2A color code in range? + bgt L020F no, ignore +CurOn lda #$60 cursor on (all colors=on) + bra L022F +L022D lda #$20 cursor off +L022F ldb #10 + stb ,x + sta $01,x + clrb + rts +* FHL O-PAK compatibility. Needed to run DynaStar 3.0 +Check1B cmpa #$1B + bne Check1F + ldb #$01 + stb <V.NGChr,u + leax <Do1B,pcr + stx <V.RTAdd,u +Done1B clrb + rts + +Do1B ldx #BASEADDR get HW addr in X + lda <V.NChr2,u + cmpa #$41 + lbeq ErEOL + cmpa #$42 + lbeq ErEOS + cmpa #$45 + beq InsLine + cmpa #$46 + beq DelLine + cmpa #$47 + lbeq MoveRight + cmpa #$48 + lbeq MoveLeft + clrb + rts + +InsLine + ldb #23 +L3000 pshs b + lda #80 + mul + addd <DISPPTR,u + tfr d,x + lbsr UptRegs + ldb #80 + +L3001 bsr L3003 + lda BASEADDR+3 + sta ,-s + decb + bne L3001 + + tfr x,d + addd #80 + lbsr UptRegs + ldb #79 + +L3002 bsr L3003 + lda b,s + sta BASEADDR+3 + decb + bpl L3002 + + leas 80,s + puls b + decb + cmpb <V.C80Y,u + bpl L3000 + + tfr x,d + lbsr UptRegs + ldx #80 + lbra L0159 clear cursor line + +L3003 lda #31 wait for busy + sta BASEADDR +L3004 lda BASEADDR + bpl L3004 + rts + +DelLine + ldb <V.C80Y,u + incb +L4000 pshs b + lda #80 + mul + addd <DISPPTR,u + tfr d,x + lbsr UptRegs + ldb #80 + +L4001 bsr L3003 + lda BASEADDR+3 + sta ,-s + decb + bne L4001 + + tfr x,d + subd #80 + lbsr UptRegs + ldb #79 + +L4002 bsr L3003 + lda b,s + sta BASEADDR+3 + decb + bpl L4002 + + leas 80,s + puls b + incb + cmpb #25 + bne L4000 + + tfr x,d + lbsr UptRegs + ldx #80 + lbra L0159 clear last line + +MoveRight + ldb <V.C80Y,u + lda #80 + mul + addd <DISPPTR,u + tfr d,x + lbsr UptRegs + ldb #72 + +L5001 bsr L5004 + lda BASEADDR+3 + sta ,-s + decb + bne L5001 + + tfr x,d + lbsr UptRegs + ldb #8 + lda #32 + ora <V.Invers,u +L5002 pshs a + bsr L5004 + puls a + sta BASEADDR+3 + decb + bne L5002 + + ldb #71 +L5003 bsr L5004 + lda b,s + sta BASEADDR+3 + decb + bpl L5003 + + leas 72,s + clrb + rts +L5004 lda #31 wait for busy + sta BASEADDR +L5005 lda BASEADDR + bpl L5005 + rts + +MoveLeft + ldb <V.C80Y,u + lda #80 + mul + addd <DISPPTR,u + tfr d,x + addd #8 + lbsr UptRegs + ldb #72 + +L6001 bsr L5004 + lda BASEADDR+3 + sta ,-s + decb + bne L6001 + + tfr x,d + lbsr UptRegs + + ldb #71 +L6003 bsr L5004 + lda b,s + sta BASEADDR+3 + decb + bpl L6003 + + leas 72,s + + ldb #8 + lda #32 + ora <V.Invers,u +L6002 pshs a + bsr L5004 + puls a + sta BASEADDR+3 + decb + bne L6002 + + clrb + rts + + emod +eom equ * + end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/level1/modules/term_wprs.asm Mon Jul 03 10:34:01 2017 -0700 @@ -0,0 +1,74 @@ +******************************************************************** +* Term - VTIO VDG Device Descriptor +* +* $Id$ +* +* Edt/Rev YYYY/MM/DD Modified by +* Comment +* ------------------------------------------------------------------ + + nam Term + ttl VTIO VDG Device Descriptor + + ifp1 + use defsfile + use cocovtio.d + endc + +tylg set Devic+Objct +atrv set ReEnt+rev +rev set $00 + +* Window descriptor definitions +szx set 80 number of columns for display +szy set 25 number for rows for display + IFGT Level-1 +wnum set 0 window number +sty set 1 window type +cpx set 0 x cursor position +cpy set 0 y cursor position + ENDC + + mod eom,name,tylg,atrv,mgrnam,drvnam + + fcb UPDAT. mode byte + fcb HW.Page extended controller address + fdb $FF76 physical controller address + fcb initsize-*-1 initilization table size + fcb DT.SCF device type:0=scf,1=rbf,2=pipe,3=scf + fcb $00 case:0=up&lower,1=upper only + fcb $01 backspace:0=bsp,1=bsp then sp & bsp + fcb $00 delete:0=bsp over line,1=return + fcb $01 echo:0=no echo + fcb $01 auto line feed:0=off + fcb $00 end of line null count + fcb $01 pause:0=no end of page pause + fcb szy lines per page + fcb C$BSP backspace character + fcb C$DEL delete line character + fcb C$CR end of record character + fcb C$EOF end of file character + fcb C$RARR reprint line character + fcb C$SHRARR duplicate last line character + fcb C$PAUS pause character + fcb C$INTR interrupt character + fcb C$QUIT quit character + fcb C$BSP backspace echo character + fcb C$BELL line overflow character (bell) + fcb ModCoWP init value for dev ctl reg + fcb $00 baud rate + fdb name copy of descriptor name address + fcb $00 acia xon char + fcb $00 acia xoff char + fcb szx (szx) number of columns for display + fcb szy (szy) number of rows for display +initsize equ * + +name fcs /Term/ +mgrnam fcs /SCF/ +drvnam fcs /VTIO/ + + emod +eom equ * + end +
--- a/level1/modules/vtio.asm Sun Jun 04 17:52:41 2017 +0100 +++ b/level1/modules/vtio.asm Mon Jul 03 10:34:01 2017 -0700 @@ -965,8 +965,10 @@ GoCoWP bita #ModCoWP ; CoWP needed ? beq GOCo42 - lda #ModCoWP 'CoWP is loaded' bit - ldx #$5018 80x24 + stb <V.CFlag,u allow lowercase + clr <V.Caps,u set caps off + lda #ModCoWP 'CoWP is loaded' bit + ldx #$5019 80x25 WordPark RS supports 25 lines pshs u,y,x,a leax >CoWP,pcr